'}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/remove count:",a.__inserted):a.detachedCallback&&a.detachedCallback()),A.dom&&console.groupEnd())}function q(a){return window.ShadowDOMPolyfill?ShadowDOMPolyfill.wrapIfNeeded(a):a}function r(a){for(var b=a,c=q(document);b;){if(b==c)return!0;b=b.parentNode||b.host}}function s(a){if(a.shadowRoot&&!a.shadowRoot.__watched){A.dom&&console.log("watching shadow-root for: ",a.localName);for(var b=a.shadowRoot;b;)t(b),b=b.olderShadowRoot}}function t(a){a.__watched||(w(a),a.__watched=!0)}function u(a){if(A.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=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()}function v(){u(F.takeRecords()),k()}function w(a){F.observe(a,{childList:!0,subtree:!0})}function x(a){w(a)}function y(a){A.dom&&console.group("upgradeDocument: ",a.baseURI.split("/").pop()),g(a),A.dom&&console.groupEnd()}function z(a){a=q(a);for(var b,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)throw new Error("document.registerElement: first argument (\'name\') must contain a dash (\'-\'). Argument provided was \'"+String(b)+"\'.");if(c(b))throw new Error("Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'"+String(b)+"\'. The type name is invalid.");if(n(b))throw new Error("DuplicateDefinitionError: a type with name \'"+String(b)+"\'isalreadyregistered");if(!h.prototype)throw new Error("Optionsmissingrequiredprototypeproperty");return h.__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}function c(a){for(var b=0;b<y.length;b++)if(a===y[b])return!0}function d(a){var b=n(a);return b?d(b.extends).concat([b]):[]}function e(a){for(var b,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)}function f(a){if(!Object.__proto__){var b=HTMLElement.prototype;if(a.is){var c=document.createElement(a.tag),d=Object.getPrototypeOf(c);d===a.prototype&&(b=d)}for(var e,f=a.prototype;f&&f!==b;)e=Object.getPrototypeOf(f),f.__proto__=e,f=e;a.native=b}}function g(a){return h(B(a.tag),a)}function h(b,c){return c.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)
'',
'<!-- src -->',
'<script>(function(scope){var Gui=function(params){if(!ready){Gui.error("Gui not ready. Put your code inside Gui.ready()")}params=params||{};var panel=document.createElement("gui-panel");panel.autoPlace=params.autoPlace!==false;if(panel.autoPlace){document.body.appendChild(panel)}return panel};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){ready?fnc():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("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;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>',
'if(d?f=f.toModel:"function"==typeoff.toDOM&&(f=f.toDOM),"function"!=typeoff)returnvoidconsole.error("Cannot find function or filter: "+this.name);for(varh=e||[],j=0;j<this.args.length;j++)h.push(i(this.args[j])(a,b,c));returnf.apply(g,h)}};varr={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},s={"+":function(a,b){returna+b},"-":function(a,b){returna-b},"*":function(a,b){returna*b},"/":function(a,b){returna/b},"%":function(a,b){returna%b},"<":function(a,b){returnb>a},">":function(a,b){returna>b},"<=":function(a,b){returnb>=a},">=":function(a,b){returna>=b},"==":function(a,b){returna==b},"!=":function(a,b){returna!=b},"===":function(a,b){returna===b},"!==":function(a,b){returna!==b},"&&":function(a,b){returna&&b},"||":function(a,b){returna||b}};j.prototype={createUnaryExpression:function(a,b){if(!r[a])throwError("Disallowed operator: "+a);returnb=i(b),function(c,d,e){returnr[a](b(c,d,e))}},createBinaryExpression:function(a,b,c){if(!s[a])throwError("Disallowed operator: "+a);switch(b=i(b),c=i(c),a){case"||":returnthis.dynamicDeps=!0,function(a,d,e){returnb(a,d,e)||c(a,d,e)};case"&&":returnthis.dynamicDeps=!0,function(a,d,e){returnb(a,d,e)&&c(a,d,e)}}returnfunction(d,e,f){returns[a](b(d,e,f),c(d,e,f))}},createConditionalExpression:function(a,b,c){returna=i(a),b=i(b),c=i(c),this.dynamicDeps=!0,function(d,e,f){returna(d,e,f)?b(d,e,f):c(d,e,f)}},createIdentifier:function(a){varb=newe(a);returnb.type="Identifier",b},createMemberExpression:function(a,b,c){vard=newf(b,c,a);returnd.dynamicDeps&&(this.dynamicDeps=!0),d},createCallExpression:function(a,b){if(!(ainstanceofe))throwError("Only identifier function invocations are allowed");varc=newg(a.name,b);returnfunction(a,b,d){returnc.transform(a,b,d,!1)}},createLiteral:function(a){returnnewd(a.value)},createArrayExpression:function(a){for(varb=0;b<a.length;b++)a[b]=i(a[b]);returnfunction(b,c,d){for(vare=[],f=0;f<a.length;f++)e.push(a[f](b,c,d));returne}},createProperty:function(a,b,c){return{key:binstanceofe?b.name:b.value,value:c}},createObjectExpression:function(a){for(varb=0;b<a.length;b++)a[b].value=i(a[b].value);returnfunction(b,c,d){for(vare={},f=0;f<a.length;f++)e[a[f].key]=a[f].value(b,c,d);returne}},createFilter:function(a,b){this.filters.push(newg(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(){returnthis.value_},discardChanges:function(){returnthis.value_},deliver:function(){},close:function(){}},l.prototype={getBinding:function(a,b,c){functiond(){if(h)returnh=!1,g;i.dynamicDeps&&f.startReset();varc=i.getValue(a,i.dynamicDeps?f:void0,b);returni.dynamicDeps&&f.finishReset(),c}functione(c){returni.setValue(a,c,b),c}if(c)returnthis.getValue(a,void0,b);varf=newCompoundObserver,g=this.getValue(a,f,b),h=!0,i=this;returnnewObserverTransform(f,d,e,!0)},getValue:function(a,b,c){for(vard=i(this.expression)(a,b,c),e=0;e<this.filters.length;e++)d=this.filters[e].transform(a,b,c,!1,[d]);returnd},setValue:function(a,b,c){for(vard=this.filters?this.filters.length:0;d-->0;)b=this.filters[d].transform(a,void0,c,!0,[b]);returnthis.expression.setValue?this.expression.setValue(a,b):void0}};vart="@"+Math.random().toString(36).slice(2);p.prototype={styleObject:function(a){varb=[];for(varcina)b.push(m(c)+": "+a[c]);returnb.join("; ")},tokenList:function(a){varb=[];for(varcina)a[c]&&b.push(c);returnb.join(" ")},prepareInstancePositionChanged:function(a){varb=a.polymerExpressionIndexIdent_;if(b)returnfunction(a,c){a.model[b]=c}},prepareBinding:function(a,c,d){vare=Path.get(a);{if(o(a)||!e.valid)returnb(a,c,d,this);if(1==e.length)returnfunction(a,b,c){if(c)returne.getValueFrom(a);vard=n(a,e[0]);returnnewPathObserver(d,e)}}},prepareInstanceModel:function(a){varb=a.polymerExpressionScopeIdent_;if(b){varc=a.templateInstance?a.templateInstance.model:a.mo
'},_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-element name="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-mouse
'<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="objectpathvalue"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="minmaxvaluestep"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-col