2014-09-10 22:40:55 +00:00
< script > w i n d o w . P l a t f o r m = w i n d o w . P l a t f o r m | | { } , w i n d o w . l o g F l a g s = w i n d o w . l o g F l a g s | | { } , f u n c t i o n ( a ) { v a r b = a . f l a g s | | { } ; l o c a t i o n . s e a r c h . s l i c e ( 1 ) . s p l i t ( " & " ) . f o r E a c h ( f u n c t i o n ( a ) { a = a . s p l i t ( " = " ) , a [ 0 ] & & ( b [ a [ 0 ] ] = a [ 1 ] | | ! 0 ) } ) ; v a r c = d o c u m e n t . c u r r e n t S c r i p t | | d o c u m e n t . q u e r y S e l e c t o r ( ' s c r i p t [ s r c * = " p l a t f o r m . j s " ] ' ) ; i f ( c ) f o r ( v a r d , e = c . a t t r i b u t e s , f = 0 ; f < e . l e n g t h ; f + + ) d = e [ f ] , " s r c " ! = = d . n a m e & & ( b [ d . n a m e ] = d . v a l u e | | ! 0 ) ; b . l o g & & b . l o g . s p l i t ( " , " ) . f o r E a c h ( f u n c t i o n ( a ) { w i n d o w . l o g F l a g s [ a ] = ! 0 } ) , b . s h a d o w = b . s h a d o w | | b . s h a d o w d o m | | b . p o l y f i l l , b . s h a d o w = " n a t i v e " = = = b . s h a d o w ? ! 1 : b . s h a d o w | | ! H T M L E l e m e n t . p r o t o t y p e . c r e a t e S h a d o w R o o t , b . s h a d o w & & d o c u m e n t . q u e r y S e l e c t o r A l l ( " s c r i p t " ) . l e n g t h > 1 & & c o n s o l e . w a r n ( " p l a t f o r m . j s i s n o t t h e f i r s t s c r i p t o n t h e p a g e . S e e h t t p : / / w w w . p o l y m e r - p r o j e c t . o r g / d o c s / s t a r t / p l a t f o r m . h t m l # s e t u p f o r d e t a i l s . " ) , b . r e g i s t e r & & ( w i n d o w . C u s t o m E l e m e n t s = w i n d o w . C u s t o m E l e m e n t s | | { f l a g s : { } } , w i n d o w . C u s t o m E l e m e n t s . f l a g s . r e g i s t e r = b . r e g i s t e r ) , b . i m p o r t s & & ( w i n d o w . H T M L I m p o r t s = w i n d o w . H T M L I m p o r t s | | { f l a g s : { } } , w i n d o w . H T M L I m p o r t s . f l a g s . i m p o r t s = b . i m p o r t s ) , a . f l a g s = b } ( P l a t f o r m ) , " u n d e f i n e d " = = t y p e o f W e a k M a p & & ! f u n c t i o n ( ) { v a r a = O b j e c t . d e f i n e P r o p e r t y , b = D a t e . n o w ( ) % 1 e 9 , c = f u n c t i o n ( ) { t h i s . n a m e = " _ _ s t " + ( 1 e 9 * M a t h . r a n d o m ( ) > > > 0 ) + ( b + + + " _ _ " ) } ; c . p r o t o t y p e = { s e t : f u n c t i o n ( b , c ) { v a r d = b [ t h i s . n a m e ] ; d & & d [ 0 ] = = = b ? d [ 1 ] = c : a ( b , t h i s . n a m e , { v a l u e : [ b , c ] , w r i t a b l e : ! 0 } ) } , g e t : f u n c t i o n ( a ) { v a r b ; r e t u r n ( b = a [ t h i s . n a m e ] ) & & b [ 0 ] = = = a ? b [ 1 ] : v o i d 0 } , " d e l e t e " : f u n c t i o n ( a ) { v a r b = a [ t h i s . n a m e ] ; i f ( ! b ) r e t u r n ! 1 ; v a r c = b [ 0 ] = = = a ; r e t u r n b [ 0 ] = b [ 1 ] = v o i d 0 , c } , h a s : f u n c t i o n ( a ) { v a r b = a [ t h i s . n a m e ] ; r e t u r n b ? b [ 0 ] = = = a : ! 1 } } , w i n d o w . W e a k M a p = c } ( ) , P l a t f o r m . f l a g s . s h a d o w ? ( ! f u n c t i o n ( g l o b a l ) { " u s e s t r i c t " ; f u n c t i o n d e t e c t O b j e c t O b s e r v e ( ) { f u n c t i o n a ( a ) { b = a } i f ( " f u n c t i o n " ! = t y p e o f O b j e c t . o b s e r v e | | " f u n c t i o n " ! = t y p e o f A r r a y . o b s e r v e ) r e t u r n ! 1 ; v a r b = [ ] , c = { } , d = [ ] ; r e t u r n O b j e c t . o b s e r v e ( c , a ) , A r r a y . o b s e r v e ( d , a ) , c . i d = 1 , c . i d = 2 , d e l e t e c . i d , d . p u s h ( 1 , 2 ) , d . l e n g t h = 0 , O b j e c t . d e l i v e r C h a n g e R e c o r d s ( a ) , 5 ! = = b . l e n g t h ? ! 1 : " a d d " ! = b [ 0 ] . t y p e | | " u p d a t e " ! = b [ 1 ] . t y p e | | " d e l e t e " ! = b [ 2 ] . t y p e | | " s p l i c e " ! = b [ 3 ] . t y p e | | " s p l i c e " ! = b [ 4 ] . t y p e ? ! 1 : ( O b j e c t . u n o b s e r v e ( c , a ) , A r r a y . u n o b s e r v e ( d , a ) , ! 0 ) } f u n c t i o n d e t e c t E v a l ( ) { i f ( " u n d e f i n e d " ! = t y p e o f c h r o m e & & c h r o m e . a p p & & c h r o m e . a p p . r u n t i m e ) r e t u r n ! 1 ; i f ( n a v i g a t o r . g e t D e v i c e S t o r a g e ) r e t u r n ! 1 ; t r y { v a r a = n e w F u n c t i o n ( " " , " r e t u r n t r u e ; " ) ; r e t u r n a ( ) } c a t c h ( b ) { r e t u r n ! 1 } } f u n c t i o n i s I n d e x ( a ) { r e t u r n + a = = = a > > > 0 } f u n c t i o n t o N u m b e r ( a ) { r e t u r n + a } f u n c t i o n i s O b j e c t ( a ) { r e t u r n a = = = O b j e c t ( a ) } f u n c t i o n a r e S a m e V a l u e ( a , b ) { r e t u r n a = = = b ? 0 ! = = a | | 1 / a = = = 1 / b : n u m b e r I s N a N ( a ) & & n u m b e r I s N a N ( b ) ? ! 0 : a ! = = a & & b ! = = b } f u n c t i o n g e t P a t h C h a r T y p e ( a ) { i f ( v o i d 0 = = = a ) r e t u r n " e o f " ; v a r b = a . c h a r C o d e A t ( 0 ) ; s w i t c h ( b ) { c a s e 9 1 : c a s e 9 3 : c a s e 4 6 : c a s e 3 4 : c a s e 3 9 : c a s e 4 8 : r e t u r n a ; c a s e 9 5 : c a s e 3 6 : r e t u r n " i d e n t " ; c a s e 3 2 : c a s e 9 : c a s e 1 0 : c a s e 1 3 : c a s e 1 6 0 : c a s e 6 5 2 7 9 : c a s e 8 2 3 2 : c a s e 8 2 3 3 : r e t u r n " w s " } r e t u r n b > = 9 7 & & 1 2 2 > = b | | b > = 6 5 & & 9 0 > = b ? " i d e n t " : b > = 4 9 & & 5 7 > = b ? " n u m b e r " : " e l s e " } f u n c t i o n n o o p ( ) { } f u n c t i o n p a r s e P a t h ( a ) { f u n c t i o n b ( ) { i f ( ! ( k > = a . l e n g t h ) ) { v a r b = a [ k + 1 ] ; r e t u r n " i n S i n g l e Q u o t e " = = l & & " ' " = = b | | " i n D o u b l e Q u o t e " = = l & & ' " ' = = b ? ( k + + , d = b , m . a p p e n d ( ) , ! 0 ) : v o i d 0 } } f o r ( v a r c , d , e , f , g , h , i , j = [ ] , k = - 1 , l = " b e f o r e P a t h " , m = { p u s h : f u n c t i o n ( ) { v o i d 0 ! = = e & & ( j . p u s h ( e ) , e = v o i d 0 ) } , a p p e n d : f u n c t i o n ( ) { v o i d 0 = = = e ? e = d : e + = d } } ; l ; ) i f ( k + + , c = a [ k ] , " \ \ " ! = c | | ! b ( l ) ) { i f ( f = g e t P a t h C h a r T y p e ( c ) , i = p a t h S t a t e M a c h i n e [ l ] , g = i [ f ] | | i [ " e l s e " ] | | " e r r o r " , " e r r o r " = = g ) r e t u r n ; i f ( l = g [ 0 ] , h = m [ g [ 1 ] ] | | n o o p , d = v o i d 0 = = = g [ 2 ] ? c : g [ 2 ] , h ( ) , " a f t e r P a t h " = = = l ) r e t u r n j } } f u n c t i o n i s I d e n t ( a ) { r e t u r n i d e n t R e g E x p . t e s t ( a ) } f u n c t i o n P a t h ( a , b ) { i f ( b ! = = c o n s t r u c t o r I s P r i v a t e ) t h r o w E r r o r ( " U s e P a t h . g e t t o r e t r i e v e p a t h o b j e c t s " ) ; f o r ( v a r c = 0 ; c < a . l e n g t h ; c + + ) t h i s . p u s h ( S t r i n g ( a [ c ] ) ) ; h a s E v a l & & t h i s . l e n g t h & & ( t h i s . g e t V a l u e F r o m = t h i s . c o m p i l e d G e t V a l u e F r o m F n ( ) ) } f u n c t i o n g e t P a t h ( a ) { i f ( a i n s t a n c e o f P a t h ) r e t u r n a ; i f ( ( n u l l = = a | | 0 = = a . l e n g t h ) & & ( a = " " ) , " s t r i n g " ! = t y p e o f a ) { i f ( i s I n d e x ( a . l e n g t h ) ) r e t u r n n e w P a t h ( a , c o n s t r u c t o r I s P r i v a t e ) ; a = S t r i n g ( a ) } v a r b = p a t h C a c h e [ a ] ; i f ( b ) r e t u r n b ; v a r c = p a r s e P a t h ( a ) ; i f ( ! c ) r e t u r n i n v a l i d P a t h ; v a r b = n e w P a t h ( c , c o n s t r u c t o r I s P r i v a t e ) ; r e t u r n p a t h C a c h e [ a ] = b , b } f u n c t i o n f o r m a t A c c e s s o r ( a ) { r e t u r n i s I n d e x ( a ) ? " [ " + a + " ] " : ' [ " ' + a . r e p l a c e ( / " / g , ' \ \ " ' ) + ' " ] ' } f u n c t i o n d i r t y C h e c k ( a ) { f o r ( v a r b = 0 ; M A X _ D I R T Y _ C H E C K _ C Y C L E S > b & & a . c h e c k _ ( ) ; ) b + + ; r e t u r n t e s t i n g E x p o s e C y c l e C o u n t & & ( g l o b a l . d i r t y C h e c k C y
}function o(a,b,c,d){var e=db;if(c&&!r(c,a,e,b,d))return!1; for(var f=b.length-1;f>0;f--)if(!r(b[f],a,e,b,d))return!1;return!0}function p(a,b,c,d){var e=eb,f=b[0]||c;return r(f,a,e,b,d)}function q(a,b,c,d){for(var e=fb,f=1;f< b.length ; f + + ) if ( ! r ( b [ f ] , a , e , b , d ) ) return ; c & & b . length > 0& & r(c,a,e,b,d)}function r(a,b,c,d,e){var f=T.get(a);if(!f)return!0;var g=e||h(d,a);if(g===a){if(c===db)return!0;c===fb& & (c=eb)}else if(c===fb&&!b.bubbles)return!0; if("relatedTarget"in b){var i=Q(b),j=i.relatedTarget;if(j){if(j instanceof Object& & j.addEventListener){var l=R(j),m=k(b,a,l);if(m===g)return!0}else m=null;Y.set(b,m)}}Z.set(b,c);var n=b.type,o=!1;W.set(b,g),X.set(b,a),f.depth++;for(var p=0,q=f.length;q>p;p++){var r=f[p];if(r.removed)o=!0;else if(!(r.type!==n||!r.capture& & c===db||r.capture& & c===fb))try{if("function"==typeof r.handler?r.handler.call(a,b):r.handler.handleEvent(b),_.get(b))return!1}catch(s){J||(J=s)}}if(f.depth--,o& & 0===f.depth){var t=f.slice();f.length=0;for(var p=0;p< t.length ; p + + ) t [ p ] . removed | | f . push ( t [ p ] ) } return ! $ . get ( b ) } function s ( a , b , c ) { this . type = a,this.handler=b,this.capture=Boolean(c)}function t ( a , b ) { if ( ! ( a instanceof gb ) ) return R ( x ( gb , " Event " , a , b ) ) ; var c = a;return rb | | " beforeunload " ! = = c . type ? void O ( c , this ) :new y ( c ) } function u ( a ) { return a & & a . relatedTarget ? Object . create ( a , { relatedTarget: { value:Q ( a . relatedTarget ) } } ) :a } function v ( a , b , c ) { var d = window[a],e=function(b,c){return b instanceof d ? void O ( b , this ) :R ( x ( d , a , b , c ) ) } ; if ( e . prototype = Object.create(b.prototype),c&&M(e.prototype,c),d)try{N(d,e,new d ( " temp " ) ) } catch ( f ) { N ( d , e , document . createEvent ( a ) ) } return e } function w ( a , b ) { return function ( ) { arguments [ b ] = Q ( arguments [ b ] ) ; var c = Q(this);c[a].apply(c,arguments)}}function x ( a , b , c , d ) { if ( pb ) return new a ( c , u ( d ) ) ; var e = Q(document.createEvent(b)),f=ob[b],g=[c];return Object . keys ( f ) . forEach ( function ( a ) { var b = null!=d&&a in d ? d [ a ] :f [ a ] ; " relatedTarget " = = = a & & ( b = Q(b)),g.push(b)}),e["init"+b].apply(e,g),e}function y ( a ) { t . call ( this , a ) } function z ( a ) { return " function " = = typeof a ? ! 0:a & & a . handleEvent } function A ( a ) { switch ( a ) { case " DOMAttrModified " :case " DOMAttributeNameChanged " :case " DOMCharacterDataModified " :case " DOMElementNameChanged " :case " DOMNodeInserted " :case " DOMNodeInsertedIntoDocument " :case " DOMNodeRemoved " :case " DOMNodeRemovedFromDocument " :case " DOMSubtreeModified " :return ! 0 } return ! 1 } function B ( a ) { O ( a , this ) } function C ( a ) { return a instanceof S . ShadowRoot & & ( a = a.host),Q(a)}function D ( a , b ) { var c = T.get(a);if(c)for(var d = 0;d<c.length;d++)if(!c[d].removed&&c[d].type===b)return!0;return!1}function E ( a , b ) { for ( var c = Q(a);c;c=c.parentNode)if(D(R(c),b))return!0;return!1}function F ( a ) { K ( a , tb ) } function G ( b , c , e , f ) { a . renderAllPending ( ) ; var g = R(ub.call(P(c),e,f));if(!g)return null ; var i = d(g,null),j=i.lastIndexOf(b);return-1==j?null:(i=i.slice(0,j),h(i,b))}function H ( a ) { return function ( ) { var b = ab.get(this);return b & & b [ a ] & & b [ a ] . value | | null } } function I ( a ) { var b = a.slice(2);return function ( c ) { var d = ab.get(this);d||(d=Object.create(null),ab.set(this,d));var e = d[a];if(e&&this.removeEventListener(b,e.wrapped,!1),"function"==typeof c ) { var f = function(b){var d = c.call(this,b);d===!1?b.preventDefault():"onbeforeunload"===a&&"string"==typeof d & & ( b . returnValue = d)};this.addEventListener(b,f,!1),d[a]={value:c,wrapped:f}}}}var J , K = a.forwardMethodsToWrapper,L=a.getTreeScope,M=a.mixin,N=a.registerWrapper,O=a.setWrapper,P=a.unsafeUnwrap,Q=a.unwrap,R=a.wrap,S=a.wrappers,T=(new WeakMap , new WeakMap ) , U = new WeakMap , V = new WeakMap , W = new WeakMap , X = new WeakMap , Y = new WeakMap , Z = new WeakMap , $ = new WeakMap , _ = new WeakMap , ab = new WeakMap , bb = new WeakMap , cb = 0,db=1,eb=2,fb=3;s.prototype={equals:function(a){return this . handler = ==a.handler&&this.type===a.type&&this.capture===a.capture},get removed ( ) { return null = ==this.handler},remove:function(){this.handler=null}};var gb = window.Event;gb.prototype.polymerBlackList_={returnValue:!0,keyLocation:!0},t.prototype={get target ( ) { return W . get ( this ) } , get currentTarget ( ) { return X . get ( this ) } , get eventPhase ( ) { return Z . get ( this ) } , get path ( ) { var a = bb.get(this);return a ? a . slice ( ) : [ ] } , stopPropagation:function ( ) { $ . set ( this , ! 0 ) } , stopImmediatePropagation:function ( ) { $ . set ( this , ! 0 )
},get rows(){return h(f(this).rows)},insertRow:function(a){return g(f(this).insertRow(a))}}),e(i,b,document.createElement("table")),a.wrappers.HTMLTableElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=a.wrapHTMLCollection,g=a.unwrap,h=a.wrap,i=window.HTMLTableSectionElement;b.prototype=Object.create(c.prototype),d(b.prototype,{constructor:b,get rows(){return f(g(this).rows)},insertRow:function(a){return h(g(this).insertRow(a))}}),e(i,b,document.createElement("thead")),a.wrappers.HTMLTableSectionElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=a.wrapHTMLCollection,g=a.unwrap,h=a.wrap,i=window.HTMLTableRowElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get cells(){return f(g(this).cells)},insertCell:function(a){return h(g(this).insertCell(a))}}),e(i,b,document.createElement("tr")),a.wrappers.HTMLTableRowElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){switch(a.localName){case"content":return new c(a);case"shadow":return new e(a);case"template":return new f(a)}d.call(this,a)}var c=a.wrappers.HTMLContentElement,d=a.wrappers.HTMLElement,e=a.wrappers.HTMLShadowElement,f=a.wrappers.HTMLTemplateElement,g=(a.mixin,a.registerWrapper),h=window.HTMLUnknownElement;b.prototype=Object.create(d.prototype),g(h,b),a.wrappers.HTMLUnknownElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";var b=a.wrappers.Element,c=a.wrappers.HTMLElement,d=a.registerObject,e="http://www.w3.org/2000/svg",f=document.createElementNS(e,"title"),g=d(f),h=Object.getPrototypeOf(g.prototype).constructor;if(!("classList"in f)){var i=Object.getOwnPropertyDescriptor(b.prototype,"classList");Object.defineProperty(c.prototype,"classList",i),delete b.prototype.classList}a.wrappers.SVGElement=h}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){m.call(this,a)}var c=a.mixin,d=a.registerWrapper,e=a.unwrap,f=a.wrap,g=window.SVGUseElement,h="http://www.w3.org/2000/svg",i=f(document.createElementNS(h,"g")),j=document.createElementNS(h,"use"),k=i.constructor,l=Object.getPrototypeOf(k.prototype),m=l.constructor;b.prototype=Object.create(l),"instanceRoot"in j& & c(b.prototype,{get instanceRoot(){return f(e(this).instanceRoot)},get animatedInstanceRoot(){return f(e(this).animatedInstanceRoot)}}),d(g,b,j),a.wrappers.SVGUseElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.EventTarget,d=a.mixin,e=a.registerWrapper,f=a.unsafeUnwrap,g=a.wrap,h=window.SVGElementInstance;h& & (b.prototype=Object.create(c.prototype),d(b.prototype,{get correspondingElement(){return g(f(this).correspondingElement)},get correspondingUseElement(){return g(f(this).correspondingUseElement)},get parentNode(){return g(f(this).parentNode)},get childNodes(){throw new Error("Not implemented")},get firstChild(){return g(f(this).firstChild)},get lastChild(){return g(f(this).lastChild)},get previousSibling(){return g(f(this).previousSibling)},get nextSibling(){return g(f(this).nextSibling)}}),e(h,b),a.wrappers.SVGElementInstance=b)}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){e(a,this)}var c=a.mixin,d=a.registerWrapper,e=a.setWrapper,f=a.unsafeUnwrap,g=a.unwrap,h=a.unwrapIfNeeded,i=a.wrap,j=window.CanvasRenderingContext2D;c(b.prototype,{get canvas(){return i(f(this).canvas)},drawImage:function(){arguments[0]=h(arguments[0]),f(this).drawImage.apply(f(this),arguments)},createPattern:function(){return arguments[0]=g(arguments[0]),f(this).createPattern.apply(f(this),arguments)}}),d(j,b,document.createElement("canvas").getContext("2d")),a.wrappers.CanvasRenderingContext2D=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){e(a,this)}var c=a.mixin,d=a.registerWrapper,e=a.setWrapper,f=a.unsafeUnwrap,g=a.unwrapIfNeeded,h=a.wrap,i=window.WebGLRenderingContext;if(i){c(b.prototype,{get canvas(){return h(f(this).canvas)},texImage2D:function(){arguments[5]=g(arguments[5]),f(
}};var e=HTMLImports.parser.hasResource;HTMLImports.parser.hasResource=function(a){return"link"===a.localName& & "stylesheet"===a.rel& & a.hasAttribute(y)?a.__resource:e.call(this,a)}}})}a.ShadowCSS=k}(window.Platform)):!function(){window.wrap=window.unwrap=function(a){return a},addEventListener("DOMContentLoaded",function(){if(CustomElements.useNative===!1){var a=Element.prototype.createShadowRoot;Element.prototype.createShadowRoot=function(){var b=a.call(this);return CustomElements.watchShadow(this),b}}})}(window.Platform),function(a){"use strict";function b(a){return void 0!==m[a]}function c(){h.call(this),this._isInvalid=!0}function d(a){return""==a& & c.call(this),a.toLowerCase()}function e(a){var b=a.charCodeAt(0);return b>32& & 127>b& & -1==[34,35,60,62,63,96].indexOf(b)?a:encodeURIComponent(a)}function f(a){var b=a.charCodeAt(0);return b>32& & 127>b& & -1==[34,35,60,62,96].indexOf(b)?a:encodeURIComponent(a)}function g(a,g,h){function i(a){t.push(a)}var j=g||"scheme start",k=0,l="",r=!1,s=!1,t=[];a:for(;(a[k-1]!=o||0==k)&&!this._isInvalid; ){var u=a[k];switch(j){case"scheme start":if(!u||!p.test(u)){if(g){i("Invalid scheme.");break a}l="",j="no scheme";continue}l+=u.toLowerCase(),j="scheme";break;case"scheme":if(u&&q.test(u))l+=u.toLowerCase(); else{if(":"!=u){if(g){if(o==u)break a;i("Code point not allowed in scheme: "+u);break a}l="",k=0,j="no scheme";continue}if(this._scheme=l,l="",g)break a;b(this._scheme)& & (this._isRelative=!0),j="file"==this._scheme?"relative":this._isRelative& & h& & h._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==u?(query="?",j="query"):"#"==u?(this._fragment="#",j="fragment"):o!=u& & " "!=u&&"\n"!=u&&"\r"!=u&&(this._schemeData+=e(u)); break;case"no scheme":if(h&&b(h._scheme)){j="relative"; continue}i("Missing scheme."),c.call(this);break;case"relative or authority":if("/"!=u||"/"!=a[k+1]){i("Expected /, got: "+u),j="relative";continue}j="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=h._scheme),o==u){this._host=h._host,this._port=h._port,this._path=h._path.slice(),this._query=h._query; break a}if("/"==u||"\\"==u)"\\"==u& & i("\\ is an invalid code point."),j="relative slash";else if("?"==u)this._host=h._host,this._port=h._port,this._path=h._path.slice(),this._query="?",j="query";else{if("#"!=u){var v=a[k+1],w=a[k+2];("file"!=this._scheme||!p.test(u)||":"!=v& & "|"!=v||o!=w& & "/"!=w& & "\\"!=w& & "?"!=w& & "#"!=w)& & (this._host=h._host,this._port=h._port,this._path=h._path.slice(),this._path.pop()),j="relative path";continue}this._host=h._host,this._port=h._port,this._path=h._path.slice(),this._query=h._query,this._fragment="#",j="fragment"}break;case"relative slash":if("/"!=u& & "\\"!=u){"file"!=this._scheme& & (this._host=h._host,this._port=h._port),j="relative path";continue}"\\"==u& & i("\\ is an invalid code point."),j="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=u){i("Expected '/', got: "+u),j="authority ignore slashes";continue}j="authority second slash";break;case"authority second slash":if(j="authority ignore slashes","/"!=u){i("Expected '/', got: "+u);continue}break;case"authority ignore slashes":if("/"!=u&&"\\"!=u){j="authority"; continue}i("Expected authority, got: "+u);break;case"authority":if("@"==u){r& & (i("@ already seen."),l+="%40"),r=!0;for(var x=0;x< l.length ; x + + ) { var y = l[x];if(" " ! = y & & " \ n " ! = y & & " \ r " ! = y ) if ( " : " ! = y | | null ! = = this . _password ) { var z = e(y);null!==this._password?this._password+=z:this._username+=z}else this . _password = "" ; else i ( " Invalid whitespace in authority . " ) } l = "" } else { if ( o = =u||"/"==u||"\\"==u||"?"==u||"#"==u){k-=l.length,l="",j="host";continue}l+=u}break;case"file host " :if ( o = =u||"/"==u||"\\"==u||"?"==u||"#"==u){2!=l.length||!p.test(l[0])||":"!=l[1]&&"|"!=l[1]?0==l.length?j="relative path start " : ( this . _host = d.call(this,l),l="",j="relative path start " ) :j = "relative path" ; continue } " " = = u | | " \ n " = = u | | " \ r " = = u ? i ( " Invalid whitespace in file host . " ) :l + = u ; break ; case " host " :case " hostname " :if ( " : " ! = u | | s ) { if ( o = =u||"/"==u||"\\
document.registerElement=b,document.createElement=r,document.createElementNS=q,Node.prototype.cloneNode=t,a.registry=z,a.upgrade=s}var E;E=Object.__proto__||w?function(a,b){return a instanceof b}:function(a,b){for(var c=a;c;){if(c===b.prototype)return!0;c=c.__proto__}return!1},a.instanceof=E,a.reservedTagList=y,document.register=document.registerElement,a.hasNative=v,a.useNative=w}(window.CustomElements),function(a){function b(a){return"link"===a.localName& & a.getAttribute("rel")===c}var c=a.IMPORT_LINK_TYPE,d={selectors:["link[rel="+c+"]"],map:{link:"parseLink"},parse:function(a){if(!a.__parsed){a.__parsed=!0;var b=a.querySelectorAll(d.selectors);e(b,function(a){d[d.map[a.localName]](a)}),CustomElements.upgradeDocument(a),CustomElements.observeDocument(a)}},parseLink:function(a){b(a)&&this.parseImport(a)},parseImport:function(a){a.import&&d.parse(a.import)}},e=Array.prototype.forEach.call.bind(Array.prototype.forEach); a.parser=d,a.IMPORT_LINK_TYPE=c}(window.CustomElements),function(a){function b(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),window.HTMLImports& & (HTMLImports.__importsParsingHook=function(a){CustomElements.parser.parse(a.import)}),CustomElements.ready=!0,setTimeout(function(){CustomElements.readyTime=Date.now(),window.HTMLImports& & (CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}if("function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a,b){b=b||{}; var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,Boolean(b.bubbles),Boolean(b.cancelable),b.detail),c},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||a.flags.eager)b();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports& & !window.HTMLImports.ready){var c=window.HTMLImports&&!HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded"; window.addEventListener(c,b)}else b()}(window.CustomElements),function(){if(window.ShadowDOMPolyfill){var a=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],b={};a.forEach(function(a){b[a]=CustomElements[a]}),a.forEach(function(a){CustomElements[a]=function(c){return b[a](wrap(c))}})}}(),function(){var a=document.createElement("style");a.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; } \n";var b=document.querySelector("head");b.insertBefore(a,b.firstChild)}(Platform),function(a){function b(a,b){return b=b||[],b.map||(b=[b]),a.apply(this,b.map(d))}function c(a,c,d){var e;switch(arguments.length){case 0:return;case 1:e=null;break;case 2:e=c.apply(this);break;default:e=b(d,c)}f[a]=e}function d(a){return f[a]}function e(a,c){HTMLImports.whenImportsReady(function(){b(c,a)})}var f={};a.marshal=d,a.modularize=c,a.using=e}(window);< / script >
2014-09-09 20:58:42 +00:00
< script > ( function ( scope ) { var Gui = function ( params ) { if ( ! ready ) { Gui . error ( "Gui not ready. Put your code inside Gui.ready()" ) } params = params || { } ; this . vars = { } ; this . localStorage = params . localStorage || false ; this . panel = document . createElement ( "dat-gui" ) ; this . panel . autoPlace = params . autoPlace !== false ; if ( this . panel . autoPlace ) { document . body . appendChild ( this . panel ) } } ; Gui . prototype . add = function ( object , path ) { var value = Path . get ( path ) . getValueFrom ( object ) ; if ( value === null || value === undefined ) { return Gui . error ( object + " doesn't have a value for path \"" + path + '".' ) } var args = Array . prototype . slice . call ( arguments , 2 ) ; var controller ; if ( args [ 0 ] instanceof Array || typeof args [ 0 ] == "object" ) { controller = document . createElement ( "dat-gui-option" ) } else { controller = Gui . getController ( value ) } if ( ! controller ) { return Gui . error ( "Unrecognized type:" , value ) } controller . watch ( object , path ) ; controller . init . apply ( controller , args ) ; var row = document . createElement ( "gui-row" ) ; row . name = path ; controller . row = row ; controller . name = function ( name ) { row . name = name } ; controller . comment = function ( comment ) { row . comment = comment } ; row . appendChild ( controller ) ; this . panel . appendChild ( row ) ; return controller } ; Gui . prototype . remember = function ( object ) { } ; Gui . prototype . var = function ( ) { var name , initialValue , args ; if ( arguments . length == 1 ) { name = arguments [ 0 ] ; return this . vars [ name ] } initialValue = arguments [ 1 ] ; name = arguments [ 0 ] ; args = [ this . vars , name ] ; args = args . concat ( Array . prototype . slice . call ( arguments , 2 ) ) ; this . vars [ name ] = initialValue ; return this . add . apply ( this , args ) } ; Gui . prototype . listenAll = function ( ) { Gui . warn ( "controller.listenAll() is deprecated. All controllers are listened for free." ) } ; var controllers = { } ; Gui . register = function ( elementName , test ) { controllers [ elementName ] = test } ; Gui . getController = function ( value ) { for ( var type in controllers ) { var test = controllers [ type ] ; if ( test ( value ) ) { return document . createElement ( type ) } } } ; var ready = false ; var readyHandlers = [ ] ; document . addEventListener ( "polymer-ready" , function ( ) { ready = true ; readyHandlers . forEach ( function ( fnc ) { fnc ( ) } ) } ) ; Gui . ready = function ( fnc ) { if ( ready ) { fnc ( ) } else { readyHandlers . push ( fnc ) } } ; Gui . error = function ( ) { var args = Array . prototype . slice . apply ( arguments ) ; args . unshift ( "dat-gui ::" ) ; console . error . apply ( console , args ) } ; Gui . warn = function ( ) { var args = Array . prototype . slice . apply ( arguments ) ; args . unshift ( "dat-gui ::" ) ; console . warn . apply ( console , args ) } ; var dat = { } ; dat . gui = { } ; dat . gui . GUI = Gui ; dat . GUI = dat . gui . GUI ; dat . color = { } ; dat . color . Color = function ( ) { } ; dat . dom = { } ; dat . dom . dom = function ( ) { } ; dat . controllers = { } ; dat . controllers . Controller = constructor ( "dat-gui-base" ) ; dat . controllers . NumberController = constructor ( "dat-gui-number" ) ; dat . controllers . FunctionController = constructor ( "dat-gui-function" ) ; dat . controllers . ColorController = constructor ( "dat-gui-color" ) ; dat . controllers . BooleanController = constructor ( "dat-gui-boolean" ) ; dat . controllers . OptionController = constructor ( "dat-gui-option" ) ; dat . controllers . NumberControllerBox = dat . controllers . NumberController ; dat . controllers . NumberControllerSlider = dat . controllers . NumberController ; function constructor ( elementName ) { return function ( object , path ) { var el = document . createElement ( elementName ) ; el . watch ( object , path ) ; return el } } scope . dat = dat ; scope . Gui = Gui } ) ( this ) ; < / script >
2014-09-10 22:40:55 +00:00
< div hidden > < style shim-shadowdom = "" > html / deep / [ layout ] [ horizontal ] , html / deep / [ layout ] [ vertical ] { display : -ms- flexbox ; display : -webkit- flex ; display : flex } html / deep / [ layout ] [ horizontal ] [ inline ] , html / deep / [ layout ] [ vertical ] [ inline ] { display : -ms- inline - flexbox ; display : -webkit- inline-flex ; display : inline-flex } html / deep / [ layout ] [ horizontal ] { -ms- flex-direction : row ; -webkit- flex-direction : row ; flex-direction : row } html / deep / [ layout ] [ horizontal ] [ reverse ] { -ms- flex-direction : row-reverse ; -webkit- flex-direction : row-reverse ; flex-direction : row-reverse } html / deep / [ layout ] [ vertical ] { -ms- flex-direction : column ; -webkit- flex-direction : column ; flex-direction : column } html / deep / [ layout ] [ vertical ] [ reverse ] { -ms- flex-direction : column-reverse ; -webkit- flex-direction : column-reverse ; flex-direction : column-reverse } html / deep / [ layout ] [ wrap ] { -ms- flex-wrap : wrap ; -webkit- flex-wrap : wrap ; flex-wrap : wrap } html / deep / [ layout ] [ wrap-reverse ] { -ms- flex-wrap : wrap-reverse ; -webkit- flex-wrap : wrap-reverse ; flex-wrap : wrap-reverse } html / deep / [ flex ] { -ms- flex : 1 1 0 ; -webkit- flex : 1 ; flex : 1 ; -webkit- flex-basis : 0 ; flex-basis : 0 } html / deep / [ vertical ] [ layout ] > [ flex ] [ auto-vertical ] , html / deep / [ vertical ] [ layout ] :: shadow [ flex ] [ auto-vertical ] { -ms- flex : 1 1 auto ; -webkit- flex-basis : auto ; flex-basis : auto } html / deep / [ flex ] [ auto ] { -ms- flex : 1 1 auto ; -webkit- flex-basis : auto ; flex-basis : auto } html / deep / [ flex ] [ none ] { -ms- flex : none ; -webkit- flex : none ; flex : none } html / deep / [ flex ] [ one ] { -ms- flex : 1 ; -webkit- flex : 1 ; flex : 1 } html / deep / [ flex ] [ two ] { -ms- flex : 2 ; -webkit- flex : 2 ; flex : 2 } html / deep / [ flex ] [ three ] { -ms- flex : 3 ; -webkit- flex : 3 ; flex : 3 } html / deep / [ flex ] [ four ] { -ms- flex : 4 ; -webkit- flex : 4 ; flex : 4 } html / deep / [ flex ] [ five ] { -ms- flex : 5 ; -webkit- flex : 5 ; flex : 5 } html / deep / [ flex ] [ six ] { -ms- flex : 6 ; -webkit- flex : 6 ; flex : 6 } html / deep / [ flex ] [ seven ] { -ms- flex : 7 ; -webkit- flex : 7 ; flex : 7 } html / deep / [ flex ] [ eight ] { -ms- flex : 8 ; -webkit- flex : 8 ; flex : 8 } html / deep / [ flex ] [ nine ] { -ms- flex : 9 ; -webkit- flex : 9 ; flex : 9 } html / deep / [ flex ] [ ten ] { -ms- flex : 10 ; -webkit- flex : 10 ; flex : 10 } html / deep / [ flex ] [ eleven ] { -ms- flex : 11 ; -webkit- flex : 11 ; flex : 11 } html / deep / [ flex ] [ twelve ] { -ms- flex : 12 ; -webkit- flex : 12 ; flex : 12 } html / deep / [ layout ] [ start ] { -ms- flex-align : start ; -webkit- align-items : flex-start ; align-items : flex-start } html / deep / [ layout ] [ center ] , html / deep / [ layout ] [ center-center ] { -ms- flex-align : center ; -webkit- align-items : center ; align-items : center } html / deep / [ layout ] [ end ] { -ms- flex-align : end ; -webkit- align-items : flex-end ; align-items : flex-end } html / deep / [ layout ] [ start-justified ] { -ms- flex-pack : start ; -webkit- justify-content : flex-start ; justify-content : flex-start } html / deep / [ layout ] [ center-justified ] , html / deep / [ layout ] [ center-center ] { -ms- flex-pack : center ; -webkit- justify-content : center ; justify-content : center } html / deep / [ layout ] [ end-justified ] { -ms- flex-pack : end ; -webkit- justify-content : flex-end ; justify-content : flex-end } html / deep / [ layout ] [ around-justified ] { -ms- flex-pack : distribute ; -webkit- justify-content : space-around ; justify-content : space-around } html / deep / [ layout ] [ justified ] { -ms- flex-pack : justify ; -webkit- justify-content : space-between ; justify-content : space-between } html / deep / [ self-start ] { -ms- align-self : flex-start ; -webkit- align-self : flex-start ; align-self : flex-start } html / deep / [ self-center ] { -ms- align-self : center ; -webkit- align-self : center ; align-self : center } html / deep / [ self-end ] { -ms- align-self : flex-end ; -webkit- align-self : flex-end ; align-self : flex-end } html / deep / [ self-stretch ] { -ms- align-self : stretch ; -webkit- align-self : stretch ; align-self : stretch } html / deep / [ block ] { display : block } html / deep / [ hidden ] { display : none !important } html / deep / [ relative ] { position : relative } html / deep / [ fit ] { position : absolute ; top : 0 ; right : 0 ; bottom : 0 ; left : 0 } body [ fullbleed ] { margin : 0 ; height : 100 vh } html / deep / [ segment ] , html / deep / segment { display : block ; position : relative ; -webkit- box-sizing : border-box ; -ms- box-sizing : border-box ; box-sizing : border-box ; margin : 1 em .5 em ; padding : 1 em ; background-color : #fff ; -webkit- box-shadow : 0 0 0 1 px rgba ( 0 , 0 , 0 , .1 ) ; box-shadow : 0 0 0 1 px rgba ( 0 , 0 , 0 , .1 ) ; border-radius : 5 px 5 px 5 px 5 px } < / style > < script > w i n d o w . P o l y m e r G e s t u r e s = { } , f u n c t i o n ( a ) { v a r b = ! 1 , c = d o c u m e n t . c r e a t e E l e m e n t ( " m e
}else{var b=Path.get(this.property.name);this.valueFn_=function(c,d,e){var f=a(c,d,e);return d& & d.addPath(f,b),b.getValueFrom(f)}}}return this.valueFn_},setValue:function(a,b){if(this.simplePath)return this.fullPath.setValueFrom(a,b),b;var c=this.object(a),d=this.property instanceof e?this.property.name:this.property(a);return c[d]=b}},g.prototype={transform:function(a,b,c,d,e){var f=c[this.name],g=a;if(f)g=void 0;else if(f=g[this.name],!f)return void console.error("Cannot find function or filter: "+this.name);if(d?f=f.toModel:"function"==typeof f.toDOM& & (f=f.toDOM),"function"!=typeof f)return void console.error("Cannot find function or filter: "+this.name);for(var h=e||[],j=0;j< this.args.length ; j + + ) h . push ( i ( this . args [ j ] ) ( a , b , c ) ) ; return f . apply ( g , h ) } } ; var r = {"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},s={"+":function(a,b){return a + b } , " - " :function ( a , b ) { return a-b } , " * " :function ( a , b ) { return a * b } , " / " :function ( a , b ) { return a / b } , " % " :function ( a , b ) { return a % b } , " < " :function ( a , b ) { return b > a},">":function(a,b){return a>b},"< =":function(a,b){return b>=a},">=":function(a,b){return a>=b},"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"===":function(a,b){return a===b},"!==":function(a,b){return a!==b},"& & ":function(a,b){return a& & b},"||":function(a,b){return a||b}};j.prototype={createUnaryExpression:function(a,b){if(!r[a])throw Error("Disallowed operator: "+a);return b=i(b),function(c,d,e){return r[a](b(c,d,e))}},createBinaryExpression:function(a,b,c){if(!s[a])throw Error("Disallowed operator: "+a);switch(b=i(b),c=i(c),a){case"||":return this.dynamicDeps=!0,function(a,d,e){return b(a,d,e)||c(a,d,e)};case"& & ":return this.dynamicDeps=!0,function(a,d,e){return b(a,d,e)& & c(a,d,e)}}return function(d,e,f){return s[a](b(d,e,f),c(d,e,f))}},createConditionalExpression:function(a,b,c){return a=i(a),b=i(b),c=i(c),this.dynamicDeps=!0,function(d,e,f){return a(d,e,f)?b(d,e,f):c(d,e,f)}},createIdentifier:function(a){var b=new e(a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){var d=new f(b,c,a);return d.dynamicDeps& & (this.dynamicDeps=!0),d},createCallExpression:function(a,b){if(!(a instanceof e))throw Error("Only identifier function invocations are allowed");var c=new g(a.name,b);return function(a,b,d){return c.transform(a,b,d,!1)}},createLiteral:function(a){return new d(a.value)},createArrayExpression:function(a){for(var b=0;b< a.length ; b + + ) a [ b ] = i ( a [ b ] ) ; return function ( b , c , d ) { for ( var e = [],f=0;f<a.length;f++)e.push(a[f](b,c,d));return e } } , createProperty:function ( a , b , c ) { return { key:b instanceof e ? b . name:b . value , value:c } } , createObjectExpression:function ( a ) { for ( var b = 0;b<a.length;b++)a[b].value=i(a[b].value);return function ( b , c , d ) { for ( var e = {},f=0;f<a.length;f++)e[a[f].key]=a[f].value(b,c,d);return e } } , createFilter:function ( a , b ) { this . filters . push ( new g ( a , b ) ) } , createAsExpression:function ( a , b ) { this . expression = a,this.scopeIdent=b},createInExpression:function(a,b,c){this.expression=c,this.scopeIdent=a,this.indexIdent=b},createTopLevel:function(a){this.expression=a},createThisExpression:h},k.prototype={open:function(){return this . value_ } , discardChanges:function ( ) { return this . value_ } , deliver:function ( ) { } , close:function ( ) { } } , l . prototype = {getBinding:function(a,b,c){function d ( ) { if ( h ) return h = !1,g;i.dynamicDeps&&f.startReset();var c = i.getValue(a,i.dynamicDeps?f:void 0 , b ) ; return i . dynamicDeps & & f . finishReset ( ) , c } function e ( c ) { return i . setValue ( a , c , b ) , c } if ( c ) return this . getValue ( a , void 0 , b ) ; var f = new CompoundObserver , g = this.getValue(a,f,b),h=!0,i=this;return new ObserverTransform ( f , d , e , ! 0 ) } , getValue:function ( a , b , c ) { for ( var d = i(this.expression)(a,b,c),e=0;e<this.filters.length;e++)d=this.filters[e].transform(a,b,c,!1,[d]);return d } , setValue:function ( a , b , c ) { for ( var d = this.filters?this.filters.length:0;d-- > 0;)b=this.filters[d].transform(a,void 0,c,!0,[b]);return this.expression.setValue?this.expression.setValue(a,b):void 0}};var t="@"+Math.random().toString(36).slice(2);p.prototype={styleObject:function(a){var b=[];for(var c in a)b.push(m(c)+": "+a[c]);return b.join("; ")},tokenList:function(a){v
return q(this,d.open(r(this))),t(this,a,e)},HTMLSelectElement.prototype.bind=function(a,c,d){if("selectedindex"===a& & (a="selectedIndex"),"selectedIndex"!==a& & "value"!==a)return HTMLElement.prototype.bind.call(this,a,c,d);if(this.removeAttribute(a),d)return j(this,a,c);var e=c,f=m(this,a,e);return j(this,a,e.open(k(this,a))),b(this,a,f)}}(this),function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a){for(var b;b=a.parentNode;)a=b;return a}function d(a,b){if(b){for(var d,e="#"+b;!d&&(a=c(a),a.protoContent_?d=a.protoContent_.querySelector(e):a.getElementById&&(d=a.getElementById(b)),!d&&a.templateCreator_); )a=a.templateCreator_;return d}}function e(a){return"template"==a.tagName& & "http://www.w3.org/2000/svg"==a.namespaceURI}function f(a){return"TEMPLATE"==a.tagName& & "http://www.w3.org/1999/xhtml"==a.namespaceURI}function g(a){return Boolean(L[a.tagName]& & a.hasAttribute("template"))}function h(a){return void 0===a.isTemplate_& & (a.isTemplate_="TEMPLATE"==a.tagName||g(a)),a.isTemplate_}function i(a,b){var c=a.querySelectorAll(N);h(a)& & b(a),G(c,b)}function j(a){function b(a){HTMLTemplateElement.decorate(a)||j(a.content)}i(a,b)}function k(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function l(a){var b=a.ownerDocument;if(!b.defaultView)return b;var c=b.templateContentsOwner_;if(!c){for(c=b.implementation.createHTMLDocument("");c.lastChild;)c.removeChild(c.lastChild);b.templateContentsOwner_=c}return c}function m(a){if(!a.stagingDocument_){var b=a.ownerDocument;if(!b.stagingDocument_){b.stagingDocument_=b.implementation.createHTMLDocument(""),b.stagingDocument_.isStagingDocument=!0;var c=b.stagingDocument_.createElement("base");c.href=document.baseURI,b.stagingDocument_.head.appendChild(c),b.stagingDocument_.stagingDocument_=b.stagingDocument_}a.stagingDocument_=b.stagingDocument_}return a.stagingDocument_}function n(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];K[e.name]& & ("template"!==e.name& & b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function o(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];b.setAttribute(e.name,e.value),a.removeAttribute(e.name)}return a.parentNode.removeChild(a),b}function p(a,b,c){var d=a.content;if(c)return void d.appendChild(b);for(var e;e=b.firstChild;)d.appendChild(e)}function q(a){P?a.__proto__=HTMLTemplateElement.prototype:k(a,HTMLTemplateElement.prototype)}function r(a){a.setModelFn_||(a.setModelFn_=function(){a.setModelFnScheduled_=!1;var b=z(a,a.delegate_&&a.delegate_.prepareBinding); w(a,b,a.model_)}),a.setModelFnScheduled_||(a.setModelFnScheduled_=!0,Observer.runEOM_(a.setModelFn_))}function s(a,b,c,d){if(a& & a.length){for(var e,f=a.length,g=0,h=0,i=0,j=!0;f>h;){var g=a.indexOf("{{",h),k=a.indexOf("[[",h),l=!1,m="}}";if(k>=0&&(0>g||g>k)&&(g=k,l=!0,m="]]"),i=0>g?-1:a.indexOf(m,g+2),0>i){if(!e)return; e.push(a.slice(h));break}e=e||[],e.push(a.slice(h,g));var n=a.slice(g+2,i).trim();e.push(l),j=j&&l; var o=d&&d(n,b,c); e.push(null==o?Path.get(n):null),e.push(o),h=i+2}return h===f& & e.push(""),e.hasOnePath=5===e.length,e.isSimplePath=e.hasOnePath& & ""==e[0]& & ""==e[4],e.onlyOneTime=j,e.combinator=function(a){for(var b=e[0],c=1;c< e.length ; c + = 4 ) { var d = e.hasOnePath?a:a[(c-1)/4];void 0 ! = = d & & ( b + = d ) , b + = e [ c + 3 ] } return b } , e } } function t ( a , b , c , d ) { if ( b . hasOnePath ) { var e = b[3],f=e?e(d,c,!0):b[2].getValueFrom(d);return b . isSimplePath ? f:b . combinator ( f ) } for ( var g = [],h=1;h<b.length;h+=4){var e = b[h+2];g[(h-1)/4]=e?e(d,c):b[h+1].getValueFrom(d)}return b . combinator ( g ) } function u ( a , b , c , d ) { var e = b[3],f=e?e(d,c,!1):new PathObserver ( d , b [ 2 ] ) ; return b . isSimplePath ? f:new ObserverTransform ( f , b . combinator ) } function v ( a , b , c , d ) { if ( b . onlyOneTime ) return t ( a , b , c , d ) ; if ( b . hasOnePath ) return u ( a , b , c , d ) ; for ( var e = new CompoundObserver , f = 1;f<b.length;f+=4){var g = b[f],h=b[f+2];if(h){var i = h(d,c,g);g?e.addPath(i):e.addObserver(i)}else{var j =
},parseDeclarations:function(a){a& & a.element& & (this.parseDeclarations(a.__proto__),a.parseDeclaration.call(this,a.element))},parseDeclaration:function(a){var b=this.fetchTemplate(a);if(b){var c=this.shadowFromTemplate(b);this.shadowRoots[a.name]=c}},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemplate:function(a){if(a){var b=this.createShadowRoot(),c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady(b,a),b}},lightFromTemplate:function(a,b){if(a){this.eventController=this;var c=this.instanceTemplate(a);return b?this.insertBefore(c,b):this.appendChild(c),this.shadowRootReady(this),c}},shadowRootReady:function(a){this.marshalNodeReferences(a)},marshalNodeReferences:function(a){var b=this.$=this.$||{};if(a)for(var c,d=a.querySelectorAll("[id]"),e=0,f=d.length;f>e&&(c=d[e]); e++)b[c.id]=c},attributeChangedCallback:function(a){"class"!==a& & "style"!==a& & this.attributeToProperty(a,this.getAttribute(a)),this.attributeChanged& & this.attributeChanged.apply(this,arguments)},onMutation:function(a,b){var c=new MutationObserver(function(a){b.call(this,c,a),c.disconnect()}.bind(this));c.observe(a,{childList:!0,subtree:!0})}};c.prototype=d,d.constructor=c,a.Base=c,a.isBase=b,a.api.instance.base=d}(Polymer),function(a){function b(a){return a.__proto__}function c(a,b){var c="",d=!1;b&&(c=b.localName,d=b.hasAttribute("is")); var e=Platform.ShadowCSS.makeScopeSelector(c,d);return Platform.ShadowCSS.shimCssText(a,e)}var d=(window.logFlags||{},window.ShadowDOMPolyfill),e="element",f="controller",g={STYLE_SCOPE_ATTRIBUTE:e,installControllerStyles:function(){var a=this.findStyleScope();if(a& & !this.scopeHasNamedStyle(a,this.localName)){for(var c=b(this),d="";c&&c.element; )d+=c.element.cssTextForScope(f),c=b(c);d& & this.installScopeCssText(d,a)}},installScopeStyle:function(a,b,c){var c=c||this.findStyleScope(),b=b||"";if(c& & !this.scopeHasNamedStyle(c,this.localName+b)){var d="";if(a instanceof Array)for(var e,f=0,g=a.length;g>f&&(e=a[f]); f++)d+=e.textContent+"\n\n";else d=a.textContent;this.installScopeCssText(d,c,b)}},installScopeCssText:function(a,b,e){if(b=b||this.findStyleScope(),e=e||"",b){d&&(a=c(a,b.host)); var g=this.element.cssTextToScopeStyle(a,f);Polymer.applyStyleToScope(g,b),this.styleCacheForScope(b)[this.localName+e]=!0}},findStyleScope:function(a){for(var b=a||this;b.parentNode;)b=b.parentNode;return b},scopeHasNamedStyle:function(a,b){var c=this.styleCacheForScope(a);return c[b]},styleCacheForScope:function(a){if(d){var b=a.host?a.host.localName:a.localName;return h[b]||(h[b]={})}return a._scopeStyles=a._scopeStyles||{}}},h={};a.api.instance.styles=g}(Polymer),function(a){function b(a,b){if("string"!=typeof a){var c=b||document._currentScript;if(b=a,a=c& & c.parentNode& & c.parentNode.getAttribute?c.parentNode.getAttribute("name"):"",!a)throw"Element name could not be inferred."}if(f[a])throw"Already registered (Polymer) prototype for element "+a;e(a,b),d(a)}function c(a,b){h[a]=b}function d(a){h[a]& & (h[a].registerWhenReady(),delete h[a])}function e(a,b){return i[a]=b||{}}function f(a){return i[a]}var g=a.extend,h=(a.api,{}),i={};a.getRegisteredPrototype=f,a.waitingForPrototype=c,window.Polymer=b,g(Polymer,a),Platform.consumeDeclarations& & Platform.consumeDeclarations(function(a){if(a)for(var c,d=0,e=a.length;e>d&&(c=a[d]); d++)b.apply(null,c)})}(Polymer),function(a){var b={resolveElementPaths:function(a){Polymer.urlResolver.resolveDom(a)},addResolvePathApi:function(){var a=this.getAttribute("assetpath")||"",b=new URL(a,this.ownerDocument.baseURI);this.prototype.resolvePath=function(a,c){var d=new URL(a,c||b);return d.href}}};a.api.declaration.path=b}(Polymer),function(a){function b(a,b){var c=new URL(a.getAttribute("href"),b).href;return"@import '"+c+"';"}function c(a,b){if(a){b===document&&(b=document.head),i&&(b=document.head); var c=d(a.textContent),e=a.getAttribute(h);e&&c.setAttribute(h,e); var f=b.firstElementChild;if(b===document.head){var g="style["+h+"]",j=document.head.querySelectorAll(g);j.length& & (f=j[j.length-1].nextElementSibling)}b.insertBefore(c,f)}}function d(a,b){b=b||document
2014-09-09 19:53:30 +00:00
< div hidden > < script > Polymer ( "dat-gui-base" , { ready : function ( ) { this . update ( ) } , update : function ( ) { } , init : function ( ) { } , watch : function ( object , path ) { this . object = object ; this . path = path ; this . bind ( "value" , new PathObserver ( this . object , this . path ) ) } , valueChanged : function ( ) { this . fire ( "change" , this . value ) ; this . update ( ) } , on : function ( event , listener ) { this . addEventListener ( event , listener ) ; return this } , map : function ( x , a , b , c , d ) { return ( x - a ) / ( b - a ) * ( d - c ) + c } , listen : function ( ) { Gui . warn ( "controller.listen() is deprecated. All controllers are listened for free." ) ; return this } , getValue : function ( ) { return this . value } , setValue : function ( v ) { this . value = v ; return this } , onChange : function ( v ) { this . addEventListener ( "change" , function ( e ) { v ( e . detail ) } ) ; return this } } ) ; < / script > < polymer-element name = "dat-gui-base" attributes = "object path value" assetpath = "../elements/dat-gui-base/" > < / polymer-element > < script > Gui . register ( "dat-gui-number" , function ( value ) { return typeof value == "number" } ) ; Polymer ( "dat-gui-number" , { value : 0 , decimals : 3 , computed : { slider : "min !== undefined && max !== undefined" } , ready : function ( ) { var _this = this ; window . addEventListener ( "keydown" , function ( e ) { if ( e . keyCode == 18 ) { _this . _alt = true } } , false ) ; window . addEventListener ( "keyup" , function ( e ) { if ( e . keyCode == 18 ) { _this . _alt = false } } , false ) } , init : function ( min , max , step ) { this . min = min ; this . max = max ; this . step = step } , valueChanged : function ( newValue ) { if ( this . step !== undefined ) { this . value = Math . round ( this . value / this . step ) * this . step } if ( this . min !== undefined ) { this . value = Math . max ( this . value , this . min ) } if ( this . max !== undefined ) { this . value = Math . min ( this . value , this . max ) } this . super ( ) } , minChanged : function ( ) { this . value = Math . max ( this . value , this . min ) ; this . update ( ) } , maxChanged : function ( ) { this . value = Math . min ( this . value , this . max ) ; this . update ( ) } , update : function ( ) { var ratio = this . map ( this . value , this . min , this . max , 0 , 1 ) ; if ( this . min < 0 && this . max > 0 ) { this . $ . container . classList . add ( "straddle-zero" ) ; var zero = this . map ( 0 , this . min , this . max , 0 , 1 ) ; if ( this . value >= 0 ) { this . $ . fill . style . left = zero * 100 + "%" ; this . $ . fill . style . width = ( ratio - zero ) * 100 + "%" ; this . $ . fill . style . right = "" } else { this . $ . fill . style . left = "" ; this . $ . fill . style . width = ( zero - ratio ) * 100 + "%" ; this . $ . fill . style . right = ( 1 - zero ) * 100 + "%" } } else { this . $ . container . classList . remove ( "straddle-zero" ) ; if ( this . max > 0 ) { this . $ . fill . style . left = 0 ; this . $ . fill . style . width = ratio * 100 + "%" ; this . $ . fill . style . right = "" } else { this . $ . fill . style . left = "" ; this . $ . fill . style . width = ( 1 - ratio ) * 100 + "%" ; this . $ . fill . style . right = 0 } } this . $ . knob . style . left = ratio * 100 + "%" ; this . $ . container . classList . toggle ( "positive" , this . value >= 0 ) ; this . $ . container . classList . toggle ( "negative" , this . value < 0 ) ; this . super ( ) } , click : function ( e ) { this . $ . input . select ( ) } , keydown : function ( e ) { if ( e . keyCode == 13 ) { this . $ . input . blur ( ) } } , down : function ( e ) { e . preventDefault ( ) ; this . _rect = this . $ . track . getBoundingClientRect ( ) ; if ( ! this . _alt ) { this . value = this . valueFromX ( e . x ) } this . fire ( "sliderDown" ) } , up : function ( e ) { this . fire ( "sliderUp" ) } , trackstart : function ( e ) { this . _dragFriction = 1 } , trackx : function ( e ) { if ( this . step === undefined ) { var dv = this . valueFromDX ( e . ddx ) ; if ( this . _alt ) { dv /= 10 } this . value += dv * this . _dragFriction } else { this . value = this . valueFromX ( e . pageX ) } } , tracky : function ( e ) { this . _dragFriction = Math . max ( . 01 , Math . min ( 1 , this . map ( e . dy , 50 , 300 , 1 , . 1 ) ) ) } , blur : function ( e ) { var v = parseFloat ( this . $ . input . value ) ; if ( v === v ) { this . value = v } } , truncate : function ( v ) { if ( v % 1 !== 0 && this . decimals !== undefined ) { return this . limitDecimals ( v , this . decimals ) } else { return v } } , limitDecimals : function ( v , maxDecimals ) { var str = v . toString ( ) ; var numDecimals = str . substring ( str . indexOf ( "." ) + 1 ) . length ; str = v . toFixed ( Math . min ( numDecimals , this . decimals ) ) ; for ( var z , i = 0 , l = str . length ; i < l ; i ++ ) { if ( str . charAt ( i ) !== "0" ) { z = i } } return str . substring ( 0 , z + 1 ) } , valueFromX : function ( x ) { return this . map ( x , this . _rect . left , this . _rect . right , this . min , this . max ) } , valueFromDX : function ( dx ) { return this . map ( dx , 0 , this . _rect . width , 0 , this . max - this . min ) } } ) ; < / script > < polymer-element name = "dat-gui-number" attributes = "min max value step" extends = "dat-gui-base" assetpath = "../elements/dat-gui-number/" > < template > < style > i n p u t { f o n t : 1 0 p x ' L u c i d a G r a n d e ' , s a n s - s e r i f ; c o l o r : # e c e b e 0 ; - w e b k i t - f o n t - s m o o t h
< div hidden > < script > Gui . register ( "dat-gui-string" , function ( value ) { return typeof value == "string" } ) ; Polymer ( "dat-gui-string" , { click : function ( e ) { this . $ . input . select ( ) } , keydown : function ( e ) { if ( e . keyCode == 13 ) { this . $ . input . blur ( ) } } } ) ; < / script > < polymer-element name = "dat-gui-string" extends = "dat-gui-base" assetpath = "../elements/dat-gui-string/" > < template > < style > input { font : 10 px 'Lucida Grande' , sans-serif ; color : #ecebe0 ; -webkit- font-smoothing : antialiased ; height : 100 % ; width : 100 % ; display : inline-block ; background-color : transparent ; border : 0 ; -webkit- border-radius : 0 ; border-radius : 0 ; padding : 0 ; outline : 0 ; -webkit- transition : background-color .15 s linear ; -moz- transition : background-color .15 s linear ; -o- transition : background-color .15 s linear ; -ms- transition : background-color .15 s linear ; transition : background-color .15 s linear ; -webkit- box-sizing : border-box ; -moz- box-sizing : border-box ; box-sizing : border-box } : host-context ( . touch-true ) input { font-size : 13.5 px } input : focus { background : rgba ( 255 , 255 , 255 , .05 ) } : host-context ( . touch-false ) input : hover { background : rgba ( 255 , 255 , 255 , .05 ) } < / style > < style > input { color : #1ebd6e ; padding-left : 8 px } < / style > < input id = "input" type = "text" value = "{{ value }}" on-click = "{{ click }}" on-keydown = "{{ keydown }}" > < / template > < / polymer-element > < / div >
< div hidden > < script > Gui . register ( "dat-gui-boolean" , function ( value ) { return typeof value == "boolean" } ) ; Polymer ( "dat-gui-boolean" , { ready : function ( ) { } , toggle : function ( ) { this . value = ! this . value } } ) ; < / script > < polymer-element name = "dat-gui-boolean" extends = "dat-gui-base" assetpath = "../elements/dat-gui-boolean/" > < template > < style > input { font : 10 px 'Lucida Grande' , sans-serif ; color : #ecebe0 ; -webkit- font-smoothing : antialiased ; height : 100 % ; width : 100 % ; display : inline-block ; background-color : transparent ; border : 0 ; -webkit- border-radius : 0 ; border-radius : 0 ; padding : 0 ; outline : 0 ; -webkit- transition : background-color .15 s linear ; -moz- transition : background-color .15 s linear ; -o- transition : background-color .15 s linear ; -ms- transition : background-color .15 s linear ; transition : background-color .15 s linear ; -webkit- box-sizing : border-box ; -moz- box-sizing : border-box ; box-sizing : border-box } : host-context ( . touch-true ) input { font-size : 13.5 px } input : focus { background : rgba ( 255 , 255 , 255 , .05 ) } : host-context ( . touch-false ) input : hover { background : rgba ( 255 , 255 , 255 , .05 ) } < / style > < style > # container { height : 100 % ; cursor : pointer ; padding-left : 8 px } # switch-track { width : 2 em ; height : .8 em ; background : rgba ( 255 , 255 , 255 , .25 ) ; border-radius : 999 px ; -webkit- transition : background .1 s linear ; -moz- transition : background .1 s linear ; -o- transition : background .1 s linear ; -ms- transition : background .1 s linear ; transition : background .1 s linear } # switch-knob { height : .8 em ; width : .8 em ; border-radius : 100 % ; background : #ecebe0 ; -webkit- transition : -webkit- transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -moz- transition : -moz- transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -o- transition : -o- transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; -ms- transition : -ms- transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) ; transition : transform .15 s cubic-bezier ( 0.25 , .25 , 0 , 1 ) } . value-true # switch-track { background : #864694 } . value-true # switch-knob { -webkit- transform : translate3d ( 1.2 em , 0 , 0 ) ; -moz- transform : translate3d ( 1.2 em , 0 , 0 ) ; -o- transform : translate3d ( 1.2 em , 0 , 0 ) ; -ms- transform : translate3d ( 1.2 em , 0 , 0 ) ; transform : translate3d ( 1.2 em , 0 , 0 ) } : host-context ( . touch-false ) . value-false : hover # switch-knob { -webkit- transform : scale ( 1.5 ) ; -moz- transform : scale ( 1.5 ) ; -o- transform : scale ( 1.5 ) ; -ms- transform : scale ( 1.5 ) ; transform : scale ( 1.5 ) } : host-context ( . touch-false ) . value-true : hover # switch-knob { -webkit- transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) ; -moz- transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) ; -o- transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) ; -ms- transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) ; transform : translate3d ( 1.2 em , 0 , 0 ) scale ( 1.5 ) } # text { margin-left : 8 px } . value-false # text { color : rgba ( 255 , 255 , 255 , .25 ) } < / style > < div id = "container" horizontal = "" layout = "" center = "" on-tap = "{{ toggle }}" class = "value-{{ value }}" > < div id = "switch-track" > < div id = "switch-knob" > < / div > < / div > < / div > < / template > < / polymer-element > < / div >
< div hidden > < script > Gui . register ( "dat-gui-function" , function ( value ) { return typeof value == "function" } ) ; Polymer ( "dat-gui-function" , { } ) ; < / script > < polymer-element name = "dat-gui-function" extends = "dat-gui-base" assetpath = "../elements/dat-gui-function/" > < template > < style > input { font : 10 px 'Lucida Grande' , sans-serif ; color : #ecebe0 ; -webkit- font-smoothing : antialiased ; height : 100 % ; width : 100 % ; display : inline-block ; background-color : transparent ; border : 0 ; -webkit- border-radius : 0 ; border-radius : 0 ; padding : 0 ; outline : 0 ; -webkit- transition : background-color .15 s linear ; -moz- transition : background-color .15 s linear ; -o- transition : background-color .15 s linear ; -ms- transition : background-color .15 s linear ; transition : background-color .15 s linear ; -webkit- box-sizing : border-box ; -moz- box-sizing : border-box ; box-sizing : border-box } : host-context ( . touch-true ) input { font-size : 13.5 px } input : focus { background : rgba ( 255 , 255 , 255 , .05 ) } : host-context ( . touch-false ) input : hover { background : rgba ( 255 , 255 , 255 , .05 ) } < / style > < style > < / style > < div id = "container" > < / div > < / template > < / polymer-element > < / div >
< div hidden > < script > Polymer ( "dat-gui-option" , { key : null , ready : function ( ) { this . options = { } } , init : function ( options ) { if ( Array . isArray ( options ) ) { options . forEach ( function ( opt ) { this . options [ opt ] = opt } , this ) } else { this . options = options } } , valueChanged : function ( ) { for ( var i in this . options ) { if ( this . options [ i ] === this . value ) { this . key = i ; break } } this . super ( ) } , keyChanged : function ( ) { this . value = this . options [ this . key ] } , keys : function ( object ) { if ( object ) { return Object . keys ( object ) } } } ) ; < / script > < polymer-element name = "dat-gui-option" extends = "dat-gui-base" attributes = "options key" assetpath = "../elements/dat-gui-option/" > < template > < style > # container { height : 100 % ; cursor : pointer ; padding-left : 8 px } select { outline : 0 } < / style > < div id = "container" horizontal = "" layout = "" center = "" > < select value = "{{ key }}" on-change = "{{ change }}" > < template repeat = "{{ name in options | keys }}" > < option value = "{{ name }}" > {{ name }}< / option > < / template > < / select > < / div > < / template > < / polymer-element > < / div >