},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}}}),Platform.templateContent=function(a){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(a),!a.content&&!a._content){for(var b=document.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a._content=b}return a.content||a._content}}(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++){vary=l[x];if(""!=y&&"\n"!=y&&"\r"!=y)if(":"!=y||null!==this._password){varz=e(y);null!==this._password?this._password+=z:this._username+=z}elsethis._password="";elsei("Invalidwhitespaceinauthority.")}l=""}else{if(o==u||"/"==u||"\\"==u||"?"==u||"#"==u){k-=l.length,l="",j="host";continue}l+=u}break;case"filehost":if(o==u||"/"==u||"\\"==u||"?"==u||"#"==u){2!=l.length||!p.test(l[0])||":"!=l[1]&&"|"!=l[1]?0==l.length?j="relativepathstart":(this._host=d.call(this,l),l="",j="relativepathstart"):j="relative path";continue}""==u||"\n"==u||"\r"==u?i("Invalidwhitespaceinfilehost."):l+=u;break;case"host":case"hostname":if(":"!=u||s){if(o==u|
}function n(a){o(a),d(a,function(a){o(a)})}function o(a){C?j(function(){p(a)}):p(a)}function p(a){(a.attachedCallback||a.detachedCallback||a.__upgraded__&&A.dom)&&(A.dom&&console.group("removed:",a.localName),r(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?A.dom&&console.warn("removed:",a.localName,"insert/removecount:",a.__inserted):a.detachedCallback&&a.detachedCallback()),A.dom&&console.groupEnd())}functionq(a){returnwindow.ShadowDOMPolyfill?ShadowDOMPolyfill.wrapIfNeeded(a):a}functionr(a){for(varb=a,c=q(document);b;){if(b==c)return!0;b=b.parentNode||b.host}}functions(a){if(a.shadowRoot&&!a.shadowRoot.__watched){A.dom&&console.log("watchingshadow-rootfor:",a.localName);for(varb=a.shadowRoot;b;)t(b),b=b.olderShadowRoot}}functiont(a){a.__watched||(w(a),a.__watched=!0)}functionu(a){if(A.dom){varb=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(varc=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;vard=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations(%d)[%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(G(a.addedNodes,function(a){a.localName&&g(a)}),G(a.removedNodes,function(a){a.localName&&n(a)}))}),A.dom&&console.groupEnd()}functionv(){u(F.takeRecords()),k()}functionw(a){F.observe(a,{childList:!0,subtree:!0})}functionx(a){w(a)}functiony(a){A.dom&&console.group("upgradeDocument:",a.baseURI.split("/").pop()),g(a),A.dom&&console.groupEnd()}functionz(a){a=q(a);for(varb,c=a.querySelectorAll("link[rel="+B+"]"),d=0,e=c.length;e>d&&(b=c[d]);d++)b.import&&b.import.__parsed&&z(b.import);y(a)}var A=window.logFlags||{},B=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none",C=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;a.hasPolyfillMutations=C;var D=!1,E=[],F=new MutationObserver(u),G=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.IMPORT_LINK_TYPE=B,a.watchShadow=s,a.upgradeDocumentTree=z,a.upgradeAll=g,a.upgradeSubtree=f,a.insertedNode=i,a.observeDocument=x,a.upgradeDocument=y,a.takeRecords=v}(window.CustomElements),function(a){function b(b,g){var h=g||{};if(!b)throw new Error("document.registerElement: first argument `name` must not be empty");if(b.indexOf("-")<0)thrownewError("document.registerElement:firstargument('name')mustcontainadash('-').Argumentprovidedwas'"+String(b)+"'.");if(c(b))thrownewError("Failedtoexecute'registerElement'on'Document':Registrationfailedfortype'"+String(b)+"'.Thetypenameisinvalid.");if(n(b))thrownewError("DuplicateDefinitionError:atypewithname'"+String(b)+"'isalreadyregistered");if(!h.prototype)thrownewError("Optionsmissingrequiredprototypeproperty");returnh.__name=b.toLowerCase(),h.lifecycle=h.lifecycle||{},h.ancestry=d(h.extends),e(h),f(h),l(h.prototype),o(h.__name,h),h.ctor=p(h),h.ctor.prototype=h.prototype,h.prototype.constructor=h.ctor,a.ready&&a.upgradeDocumentTree(document),h.ctor}functionc(a){for(varb=0;b<y.length;b++)if(a===y[b])return!0}functiond(a){varb=n(a);returnb?d(b.extends).concat([b]):[]}functione(a){for(varb,c=a.extends,d=0;b=a.ancestry[d];d++)c=b.is&&b.tag;a.tag=c||a.__name,c&&(a.is=a.__name)}functionf(a){if(!Object.__proto__){varb=HTMLElement.prototype;if(a.is){varc=document.createElement(a.tag),d=Object.getPrototypeOf(c);d===a.prototype&&(b=d)}for(vare,f=a.prototype;f&&f!==b;)e=Object.getPrototypeOf(f),f.__proto__=e,f=e;a.native=b}}functiong(a){returnh(B(a.tag),a)}functionh(b,c){returnc.is&&b.setAttribute("is",c.is),i(b,c),b.__upgraded__=!0,k(b),a.insertedNode(b),a.upgradeSubtree(b),b}functioni(a,b){Object.__proto__?a.__proto__=b.prototype:(j(a,b.prototype,b.native),a.__proto__=b.prototype)}functionj(a,b,c){for(vard={},e=b;e!==c&&e!==HTMLElement.prototype;){for(varf,g=Object.getOwnPropertyNames(e),h=0;f=g[h];h++)d[f]||(Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(e,f)),d[f]=1);e=Object.getPrototypeOf(e)}}functionk(a){a.createdCallback&&a.createdCallback()}functionl(a){if(!a.setAttri
<script>(function(scope){varGui=function(params){if(!ready){Gui.error("Gui not ready. Put your code inside Gui.ready()")}params=params||{};varpanel=document.createElement("gui-panel");panel.autoPlace=params.autoPlace!==false;if(panel.autoPlace){document.body.appendChild(panel)}returnpanel};varcontrollers={};Gui.register=function(elementName,test){controllers[elementName]=test};Gui.getController=function(value){for(vartypeincontrollers){vartest=controllers[type];if(test(value)){returndocument.createElement(type)}}};varready=false;varreadyHandlers=[];document.addEventListener("polymer-ready",function(){ready=true;readyHandlers.forEach(function(fnc){fnc()})});Gui.ready=function(fnc){ready?fnc():readyHandlers.push(fnc)};Gui.error=function(){varargs=Array.prototype.slice.apply(arguments);args.unshift("dat-gui ::");console.error.apply(console,args)};Gui.warn=function(){varargs=Array.prototype.slice.apply(arguments);args.unshift("dat-gui ::");console.warn.apply(console,args)};vardat={};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("controller-base");dat.controllers.NumberController=constructor("controller-number");dat.controllers.FunctionController=constructor("controller-function");dat.controllers.ColorController=constructor("controller-color");dat.controllers.BooleanController=constructor("controller-boolean");dat.controllers.OptionController=constructor("controller-option");dat.controllers.NumberControllerBox=dat.controllers.NumberController;dat.controllers.NumberControllerSlider=dat.controllers.NumberController;functionconstructor(elementName){returnfunction(object,path){varel=document.createElement(elementName);el.watch(object,path);returnel}}scope.dat=dat;scope.Gui=Gui})(this);</script>
},_register:function(){c(this.extends)&&!b(this.extends)&&console.warn("%s is attempting to extend %s, an unregistered element or one that was not registered with Polymer.",this.name,this.extends),this.register(this.name,this.extends),this.registered=!0},waitingForPrototype:function(a){return h(a)?void 0:(i(a,this),this.handleNoScript(a),!0)},handleNoScript:function(a){this.hasAttribute("noscript")&&!this.noscript&&(this.noscript=!0,Polymer(a))},waitingForResources:function(){return this._needsResources},waitingForQueue:function(){return f.enqueue(this,this.registerWhenReady,this._register)},loadResources:function(){this._needsResources=!0,this.loadStyles(function(){this._needsResources=!1,this.registerWhenReady()}.bind(this))}});e.publish(e.declaration,j),g(function(){document.body.removeAttribute("unresolved"),document.dispatchEvent(new CustomEvent("polymer-ready",{bubbles:!0}))}),document.registerElement("polymer-element",{prototype:j})}(Polymer),function(){var a=document.createElement("polymer-element");a.setAttribute("name","auto-binding"),a.setAttribute("extends","template"),a.init(),Polymer("auto-binding",{createdCallback:function(){this.syntax=this.bindingDelegate=this.makeSyntax(),Polymer.whenPolymerReady(function(){this.model=this,this.setAttribute("bind",""),this.async(function(){this.marshalNodeReferences(this.parentNode),this.fire("template-bound")})}.bind(this))},makeSyntax:function(){var a=Object.create(Polymer.api.declaration.events),b=this;a.findController=function(){return b.model};var c=new PolymerExpressions,d=c.prepareBinding;return c.prepareBinding=function(b,e,f){return a.prepareEventBinding(b,e,f)||d.call(c,b,e,f)},c}})}();</script><polymer-elementname="gui-row"attributes="name comment"assetpath="../elements/gui-row/"><template><div><style>:host{font:10px'Lucida Grande',sans-serif;color:#ecebe0;-webkit-font-smoothing:antialiased}#row{height:29px;-webkit-transition:background-color.2slinear;-moz-transition:background-color.2slinear;-o-transition:background-color.2slinear;-ms-transition:background-color.2slinear;transition:background-color.2slinear;border-bottom:1pxsolidrgba(255,255,255,.05)}#controller{height:100%}#name{padding:08px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:40%;cursor:default}.comment-true#name{cursor:pointer}#nameInner{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}#comment{line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;background:#e0cf99;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow:hidden;-webkit-transition:height.15scubic-bezier(0.25,.25,0,1);-moz-transition:height.15scubic-bezier(0.25,.25,0,1);-o-transition:height.15scubic-bezier(0.25,.25,0,1);-ms-transition:height.15scubic-bezier(0.25,.25,0,1);transition:height.15scubic-bezier(0.25,.25,0,1);position:absolute;z-index:999;pointer-events:none;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transform:translate3d(0,20px,0);-moz-transform:translate3d(0,20px,0);-o-transform:translate3d(0,20px,0);-ms-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0);-webkit-transition:all.2scubic-bezier(0.25,.25,0,1);-moz-transition:all.2scubic-bezier(0.25,.25,0,1);-o-transition:all.2scubic-bezier(0.25,.25,0,1);-ms-transition:all.2scubic-bezier(0.25,.25,0,1);transition:all.2scubic-bezier(0.25,.25,0,1)}#comment.open-true{opacity:1;-ms-filter:none;filter:none;-webkit-transition-delay:200ms;-moz-transition-delay:200ms;-o-transition-delay:200ms;-ms-transition-delay:200ms;transition-delay:200ms;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}#commentInner{padding:8px}.comment-true#nameInner{display:inline-block;border-bottom:1pxdottedrgba(255,255,255,.25)}</style><divid="row"class="comment-{{ comment != null }}"layout=""horizontal=""><divid="name"on-mouseover="{{ openComment }}"on-mouseout
<divhidden><script>Polymer("controller-base",{ready:function(){this.update()},update:function(){},init:function(){},watch:function(object,path){this.object=object;this.path=path;this.bind("value",newPathObserver(this.object,this.path))},valueChanged:function(){this.update()},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.");returnthis},getValue:function(){returnthis.value},setValue:function(v){this.value=v}});</script><polymer-elementname="controller-base"attributes="object path value"assetpath="../elements/controller-base/"></polymer-element><script>Gui.register("controller-number",function(value){returntypeofvalue=="number"});Polymer("controller-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);this.super()},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(){varratio=this.map(this.value,this.min,this.max,0,1);if(this.min<0&&this.max>0){this.$.container.classList.add("straddle-zero");varzero=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)},up:function(e){},trackstart:function(e){this._dragFriction=1},trackx:function(e){if(this.step===undefined){vardv=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){varv=parseFloat(this.$.input.value);if(v===v){this.value=v}},truncate:function(v){if(v%1!==0&&this.decimals!==undefined){returnthis.limitDecimals(v,this.decimals)}else{returnv}},limitDecimals:function(v,maxDecimals){varstr=v.toString();varnumDecimals=str.substring(str.indexOf(".")+1).length;str=v.toFixed(Math.min(numDecimals,this.decimals));for(varz,i=0,l=str.length;i<l;i++){if(str.charAt(i)!=="0"){z=i}}returnstr.substring(0,z+1)},valueFromX:function(x){returnthis.map(x,this._rect.left,this._rect.right,this.min,this.max)},valueFromDX:function(dx){returnthis.map(dx,0,this._rect.width,0,this.max-this.min)}});</script><polymer-elementname="controller-number"attributes="min max value step"extends="controller-base"assetpath="../elements/controller-number/"><template><style>input{height:100%;display:inline-block;background-color:transparent;border:0;padding:0;outline:0;-webkit-transition:background-color.15slinear;-moz-transition:background-color.15slinear;-o-transition:background-color.15slinear;-ms-transition:background-color.15slinear;transition:background-colo
<divhidden><script>Gui.register("controller-string",function(value){returntypeofvalue=="string"});Polymer("controller-string",{click:function(e){this.$.input.select()},keydown:function(e){if(e.keyCode==13){this.$.input.blur()}}});</script><polymer-elementname="controller-string"extends="controller-base"assetpath="../elements/controller-string/"><template><style>input{height:100%;display:inline-block;background-color:transparent;border:0;padding:0;outline:0;-webkit-transition:background-color.15slinear;-moz-transition:background-color.15slinear;-o-transition:background-color.15slinear;-ms-transition:background-color.15slinear;transition:background-color.15slinear;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input:hover,input:focus{background:rgba(255,255,255,.05)}</style><style>input{color:#1ebd6e;width:100%;height:100%;padding-left:8px}</style><inputid="input"type="text"value="{{ value }}"on-click="{{ click }}"on-keydown="{{ keydown }}"></template></polymer-element></div>
<divhidden><script>Gui.register("controller-boolean",function(value){returntypeofvalue=="boolean"});Polymer("controller-boolean",{ready:function(){},toggle:function(){this.value=!this.value}});</script><polymer-elementname="controller-boolean"extends="controller-base"assetpath="../elements/controller-boolean/"><template><style>input{height:100%;display:inline-block;background-color:transparent;border:0;padding:0;outline:0;-webkit-transition:background-color.15slinear;-moz-transition:background-color.15slinear;-o-transition:background-color.15slinear;-ms-transition:background-color.15slinear;transition:background-color.15slinear;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input:hover,input:focus{background:rgba(255,255,255,.05)}</style><style>#container{height:100%;cursor:pointer;padding-left:8px}#switch-track{width:20px;height:8px;background:rgba(255,255,255,.25);border-radius:8px;-webkit-transition:background.1slinear;-moz-transition:background.1slinear;-o-transition:background.1slinear;-ms-transition:background.1slinear;transition:background.1slinear}#switch-knob{height:8px;width:8px;border-radius:8px;background:#ecebe0;-webkit-transition:-webkit-transform.15scubic-bezier(0.25,.25,0,1);-moz-transition:-moz-transform.15scubic-bezier(0.25,.25,0,1);-o-transition:-o-transform.15scubic-bezier(0.25,.25,0,1);-ms-transition:-ms-transform.15scubic-bezier(0.25,.25,0,1);transition:transform.15scubic-bezier(0.25,.25,0,1)}.value-true#switch-track{background:#864694}.value-true#switch-knob{-webkit-transform:translate3d(12px,0,0);-moz-transform:translate3d(12px,0,0);-o-transform:translate3d(12px,0,0);-ms-transform:translate3d(12px,0,0);transform:translate3d(12px,0,0)}.value-true:hover#switch-knob{-webkit-transform:translate3d(12px,0,0)scale(1.5);-moz-transform:translate3d(12px,0,0)scale(1.5);-o-transform:translate3d(12px,0,0)scale(1.5);-ms-transform:translate3d(12px,0,0)scale(1.5);transform:translate3d(12px,0,0)scale(1.5)}.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)}#text{margin-left:8px}.value-false#text{color:rgba(255,255,255,.25)}</style><divid="container"horizontal=""layout=""center=""on-tap="{{ toggle }}"class="value-{{ value }}"><divid="switch-track"><divid="switch-knob"></div></div></div></template></polymer-element></div>