0?1/s-1:0,v=this.props.position,_=this.props.scale,g=this.props.quaternion,E=this.props.rotation,f=this.props.range,l=this.props.eulerOrder,M=f[0].x,S=f[1].x,k=f[2].x,a=f[0].y-M||1,u=f[1].y-S||1,h=f[2].y-k||1,x=_.x,w=_.y,R=_.z,m=a>0?1:-1,y=i.Axis.recenterAxis(S,u,s),S=y[0],u=y[1],r=Math.abs(u),c=a+(r*m-a)*s,b=c/x,T=u/w,this.aspect=o=Math.abs(b/T),this.uniforms.polarFocus.value=p,this.uniforms.polarAspect.value=o,this.viewMatrix.set(2/c,0,0,-(2*M+a)/a,0,2/u,0,-(2*S+u)/u,0,0,2/h,-(2*k+h)/h,0,0,0,1),H=this.composer(v,E,g,_,null,l),this.viewMatrix.multiplyMatrices(H,this.viewMatrix),t["view.range"]||e.polar?this.trigger({type:"view.range"}):void 0},e.prototype.vertex=function(t,n){return 1===n&&t.pipe("polar.position",this.uniforms),e.__super__.vertex.call(this,t,n)},e.prototype.axis=function(t){var e,n,r;return r=this.props.range[t-1],n=r.x,e=r.y,2===t&&this.bend>0&&(e=Math.max(Math.abs(e),Math.abs(n)),n=Math.max(-this.focus/this.aspect,n)),new THREE.Vector2(n,e)},e}(o),e.exports=r},{"../../../util":175,"./view":122}],119:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;o=t("./view"),i=t("../../../util"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.traits=["node","object","visible","view","view3","spherical","vertex"],e.prototype.make=function(){var t;return e.__super__.make.apply(this,arguments),t=this._attributes.types,this.uniforms={sphericalBend:this.node.attributes["spherical.bend"],sphericalFocus:this._attributes.make(this._types.number()),sphericalAspectX:this._attributes.make(this._types.number()),sphericalAspectY:this._attributes.make(this._types.number()),sphericalScaleY:this._attributes.make(this._types.number()),viewMatrix:this._attributes.make(this._types.mat4())},this.viewMatrix=this.uniforms.viewMatrix.value,this.composer=i.Three.transformComposer(),this.aspectX=1,this.aspectY=1},e.prototype.unmake=function(){return e.__super__.unmake.apply(this,arguments),delete this.viewMatrix,delete this.objectMatrix,delete this.aspectX,delete this.aspectY,delete this.uniforms},e.prototype.change=function(t,e,n){var r,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S,k,A,C,P,L,z,O;if(e.view||e.view3||e.spherical||n)return this.bend=u=this.props.bend,this.focus=m=u>0?1/u-1:0,y=this.props.position,w=this.props.scale,_=this.props.quaternion,b=this.props.rotation,v=this.props.range,p=this.props.eulerOrder,L=v[0].x,z=v[1].x,O=v[2].x,h=v[0].y-L||1,l=v[1].y-z||1,c=v[2].y-O||1,k=w.x,A=w.y,C=w.z,T=i.Axis.recenterAxis(z,l,u),z=T[0],l=T[1],x=i.Axis.recenterAxis(O,c,u),O=x[0],c=x[1],g=h>0?1:-1,E=l>0?1:-1,r=Math.abs(c),f=h+(r*g-h)*u,d=l+(r*E-l)*u,H=f/k,M=d/A,S=c/C,this.aspectX=o=Math.abs(H/S),this.aspectY=s=Math.abs(M/S/o),a=l/h*k/A*2,this.scaleY=R=Math.min(s/u,1+(a-1)*u),this.uniforms.sphericalBend.value=u,this.uniforms.sphericalFocus.value=m,this.uniforms.sphericalAspectX.value=o,this.uniforms.sphericalAspectY.value=s,this.uniforms.sphericalScaleY.value=R,this.viewMatrix.set(2/f,0,0,-(2*L+h)/h,0,2/d,0,-(2*z+l)/l,0,0,2/c,-(2*O+c)/c,0,0,0,1),P=this.composer(y,b,_,w,null,p),this.viewMatrix.multiplyMatrices(P,this.viewMatrix),t["view.range"]||e.spherical?this.trigger({type:"view.range"}):void 0},e.prototype.vertex=function(t,n){return 1===n&&t.pipe("spherical.position",this.uniforms),e.__super__.vertex.call(this,t,n)},e.prototype.axis=function(t){var e,n,r;return r=this.props.range[t-1],n=r.x,e=r.y,3===t&&this.bend>0&&(e=Math.max(Math.abs(e),Math.abs(n)),n=Math.max(-this.focus/this.aspectX+.001,n)),new THREE.Vector2(n,e)},e}(o),e.exports=r},{"../../../util":175,"./view":122}],120:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;o=t("./view"),i=t("../../../util"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.traits=["node","object","visible","view","view3","stereographic","vertex"],e.prototype.make=function(){var t;return e.__super__.make.apply(this,arguments),t=this._attributes.types,this.uniforms={stereoBend:this.node.attributes["stereographic.bend"],viewMatrix:this._attributes.make(this._types.mat4())},this.viewMatrix=this.uniforms.viewMatrix.value,this.composer=i.Three.transformComposer()},e.prototype.unmake=function(){return e.__super__.unmake.apply(this,arguments),delete this.viewMatrix,delete this.rotationMatrix,delete this.uniforms},e.prototype.change=function(t,e,n){var r,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;if(e.view||e.view3||e.stereographic||n)return this.bend=r=this.props.bend,l=this.props.position,d=this.props.scale,c=this.props.quaternion,p=this.props.rotation,h=this.props.range,u=this.props.eulerOrder,y=h[0].x,_=h[1].x,b=h[2].x,o=h[0].y-y||1,s=h[1].y-_||1,a=h[2].y-b||1,m=d.x,v=d.y,g=d.z,f=i.Axis.recenterAxis(b,a,r,1),b=f[0],a=f[1],this.uniforms.stereoBend.value=r,this.viewMatrix.set(2/o,0,0,-(2*y+o)/o,0,2/s,0,-(2*_+s)/s,0,0,2/a,-(2*b+a)/a,0,0,0,1),E=this.composer(l,p,c,d,null,u),this.viewMatrix.multiplyMatrices(E,this.viewMatrix),t["view.range"]||e.stereographic?this.trigger({type:"view.range"}):void 0},e.prototype.vertex=function(t,n){return 1===n&&t.pipe("stereographic.position",this.uniforms),e.__super__.vertex.call(this,t,n)},e}(o),e.exports=r},{"../../../util":175,"./view":122}],121:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;o=t("./view"),i=t("../../../util"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.traits=["node","object","visible","view","view4","stereographic","vertex"],e.prototype.make=function(){return e.__super__.make.apply(this,arguments),this.uniforms={basisOffset:this._attributes.make(this._types.vec4()),basisScale:this._attributes.make(this._types.vec4()),stereoBend:this.node.attributes["stereographic.bend"]},this.basisScale=this.uniforms.basisScale.value,this.basisOffset=this.uniforms.basisOffset.value},e.prototype.unmake=function(){return e.__super__.unmake.apply(this,arguments),delete this.basisScale,delete this.basisOffset,delete this.uniforms},e.prototype.change=function(t,e,n){var r,o,s,a,u,h,l,c,p,f,d,m,v,g;if(e.view||e.view4||e.stereographic||n)return this.bend=r=this.props.bend,c=this.props.position,f=this.props.scale,h=this.props.range,m=h[0].x,v=h[1].x,g=h[2].x,d=h[3].x,s=h[0].y-m||1,a=h[1].y-v||1,u=h[2].y-g||1,o=h[3].y-d||1,l=function(t,e){return t.x*=e.x,t.y*=e.y,t.z*=e.z,t.w*=e.w},p=i.Axis.recenterAxis(d,o,r,1),d=p[0],o=p[1],this.basisScale.set(2/s,2/a,2/u,2/o),this.basisOffset.set(-(2*m+s)/s,-(2*v+a)/a,-(2*g+u)/u,-(2*d+o)/o),l(this.basisScale,f),l(this.basisOffset,f),this.basisOffset.add(c),t["view.range"]||e.stereographic?this.trigger({type:"view.range"}):void 0},e.prototype.vertex=function(t,n){return 1===n&&t.pipe("stereographic4.position",this.uniforms),e.__super__.vertex.call(this,t,n)},e}(o),e.exports=r},{"../../../util":175,"./view":122}],122:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=t("../transform/transform"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.traits=["node","object","visible","view","vertex"],e.prototype.make=function(){return this._helpers.visible.make()},e.prototype.unmake=function(){return this._helpers.visible.unmake()},e.prototype.axis=function(t){return this.props.range[t-1]},e}(r),e.exports=i},{"../transform/transform":111}],123:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=t("./databuffer"),o=t("../../util"),r=function(t){function e(t,n,r){this.width=r.width||1,this.history=r.history||1,this.samples=this.width,this.wrap=this.history>1,r.width=this.width,r.height=this.history,r.depth=1,e.__super__.constructor.call(this,t,n,r)}return s(e,t),e.prototype.build=function(t){return e.__super__.build.apply(this,arguments),this.index=0,this.pad=0,this.streamer=this.generate(this.data)},e.prototype.setActive=function(t){return this.pad=Math.max(0,this.width-t)},e.prototype.fill=function(){var t,e,n,r,i,o,s,a,u;for(t=this.callback,"function"==typeof t.reset&&t.reset(),s=this.streamer,r=s.emit,u=s.skip,e=s.count,n=s.done,a=s.reset,a(),o=this.samples-this.pad,i=0;!n()&&o>i&&t(r,i++)!==!1;);return Math.floor(e()/this.items)},e.prototype.write=function(t){return null==t&&(t=this.samples),t*=this.items,this.texture.write(this.data,0,this.index,t,1),this.dataPointer.set(.5,this.index+.5),this.index=(this.index+this.history-1)%this.history,this.filled=Math.min(this.history,this.filled+1)},e.prototype.through=function(t,e){var n,r,i,s,a,u,h,l;return h=l=this.streamer,n=h.consume,r=h.done,s=(i=e.streamer).emit,a=0,u=function(){return n(function(e,n,r,i){return t(s,e,n,r,i,a)})},u=o.Data.repeatCall(u,this.items),function(t){return function(){var e;for(l.reset(),i.reset(),e=t.samples-t.pad,a=0;!r()&&e>a;)u(),a++;return l.count()}}(this)},e}(i),e.exports=r},{"../../util":175,"./databuffer":126}],124:[function(t,e,n){var r,i,o,s,a,u,h=function(t,e){function n(){this.constructor=t}for(var r in e)l.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},l={}.hasOwnProperty;s=t("../renderable"),u=t("../../util"),o=t("./texture/datatexture"),i=t("./texture/backedtexture"),r=function(t){function e(t,n,r){null==this.width&&(this.width=r.width||512),null==this.height&&(this.height=r.height||512),null==this.channels&&(this.channels=r.channels||4),null==this.backed&&(this.backed=r.backed||!1),this.samples=this.width*this.height,e.__super__.constructor.call(this,t,n),this.build(r)}return h(e,t),e.prototype.shader=function(t){return t.pipe("map.2d.data",this.uniforms),t.pipe("sample.2d",this.uniforms),this.channels<4&&t.pipe(u.GLSL.swizzleVec4(["0000","x000","xw00","xyz0"][this.channels])),t},e.prototype.build=function(t){var e;return this.klass=e=this.backed?i:o,this.texture=new e(this.gl,this.width,this.height,this.channels,t),this.uniforms={dataPointer:{type:"v2",value:new THREE.Vector2(0,0)}},this._adopt(this.texture.uniforms),this.reset()},e.prototype.reset=function(){return this.rows=[],this.bottom=0},e.prototype.resize=function(t,e){if(!this.backed)throw new Error("Cannot resize unbacked texture atlas");return t>2048&&e>2048?console.warn("Giant text atlas "+t+"x"+e+"."):console.info("Resizing text atlas "+t+"x"+e+"."),this.texture.resize(t,e),this.width=t,this.height=e,this.samples=t*e},e.prototype.collapse=function(t){var e,n,r;return r=this.rows,r.splice(r.indexOf(t),1),this.bottom=null!=(e=null!=(n=r[r.length-1])?n.bottom:void 0)?e:0,this.last===t?this.last=null:void 0},e.prototype.allocate=function(t,e,n,r){var i,o,s,u,h,l,c,p,f,d,m,v;if(v=this.width,s=this.height,p=2*n,e>v)return this.resize(2*v,2*s),this.last=null,this.allocate(t,e,n,r);if(d=this.last,null!=d&&d.height>=n&&d.heightl;u=++l)if(d=f[u],o=d.top-i,o>=n&&0>h&&(h=u,m=i),i=d.bottom,d.height>=n&&d.height
=0)d=new a(m,n),this.rows.splice(h,0,d);else{if(m=i,i+=n,i>=s)return this.resize(2*v,2*s),this.last=null,this.allocate(t,e,n,r);d=new a(m,n),this.rows.push(d),this.bottom=i}d.append(t,e,n,r),this.last=d},e.prototype.read=function(){return this.texture.textureObject},e.prototype.write=function(t,e,n,r,i){return this.texture.write(t,e,n,r,i)},e.prototype.dispose=function(){return this.texture.dispose(),this.data=null,e.__super__.dispose.apply(this,arguments)},e}(s),a=function(){function t(t,e){this.top=t,this.bottom=t+e,this.width=0,this.height=e,this.alive=0,this.keys=[]}return t.prototype.append=function(t,e,n,r){var i,o;return i=this.width,o=this.top,this.alive++,this.width+=e,this.keys.push(t),r(this,i,o)},t}(),e.exports=r},{"../../util":175,"../renderable":161,"./texture/backedtexture":133,"./texture/datatexture":134}],125:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=t("../renderable"),o=t("../../util"),r=function(t){function e(t,n,r){null==this.items&&(this.items=r.items||1),null==this.samples&&(this.samples=r.samples||1),null==this.channels&&(this.channels=r.channels||4),null==this.callback&&(this.callback=r.callback||function(){}),e.__super__.constructor.call(this,t,n)}return s(e,t),e.prototype.dispose=function(){return e.__super__.dispose.apply(this,arguments)},e.prototype.update=function(){var t;return t=this.fill(),this.write(t),t},e.prototype.setActive=function(t,e,n,r){},e.prototype.setCallback=function(t){this.callback=t},e.prototype.write=function(){},e.prototype.fill=function(){},e.prototype.generate=function(t){return o.Data.getStreamer(t,this.samples,this.channels,this.items)},e}(i),e.exports=r},{"../../util":175,"../renderable":161}],126:[function(t,e,n){var r,i,o,s,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;r=t("./buffer"),o=t("./texture/datatexture"),s=t("../../util"),i=function(t){function e(t,n,r){this.width=r.width||1,this.height=r.height||1,this.depth=r.depth||1,null==this.samples&&(this.samples=this.width*this.height*this.depth),e.__super__.constructor.call(this,t,n,r),this.build(r)}return a(e,t),e.prototype.shader=function(t,e){var n;return null==e&&(e=4),this.items>1||this.depth>1?(4!==e&&t.pipe(s.GLSL.extendVec(e,4)),t.pipe("map.xyzw.texture",this.uniforms)):2!==e&&t.pipe(s.GLSL.truncateVec(e,2)),n=this.wrap?".wrap":"",t.pipe("map.2d.data"+n,this.uniforms),t.pipe("sample.2d",this.uniforms),this.channels<4&&t.pipe(s.GLSL.swizzleVec4(["0000","x000","xw00","xyz0"][this.channels])),t},e.prototype.build=function(t){return this.data=new Float32Array(this.samples*this.channels*this.items),this.texture=new o(this.gl,this.items*this.width,this.height*this.depth,this.channels,t),this.filled=0,this.used=0,this._adopt(this.texture.uniforms),this._adopt({dataPointer:{type:"v2",value:new THREE.Vector2},textureItems:{type:"f",value:this.items},textureHeight:{type:"f",value:this.height}}),this.dataPointer=this.uniforms.dataPointer.value,this.streamer=this.generate(this.data)},e.prototype.dispose=function(){return this.data=null,this.texture.dispose(),e.__super__.dispose.apply(this,arguments)},e.prototype.getFilled=function(){return this.filled},e.prototype.setCallback=function(t){return this.callback=t,this.filled=0},e.prototype.copy=function(t){var e,n,r,i,o;for(i=Math.min(t.length,this.samples*this.channels*this.items),e=this.data,n=r=0,o=i;o>=0?o>r:r>o;n=o>=0?++r:--r)e[n]=t[n];return this.write(Math.ceil(i/this.channels/this.items))},e.prototype.write=function(t){var e,n;return null==t&&(t=this.samples),e=t/this.width,t*=this.items,n=1>e?t:this.items*this.width,e=Math.ceil(e),this.texture.write(this.data,0,0,n,e),this.dataPointer.set(.5,.5),this.filled=1,this.used=t},e.prototype.through=function(t,e){var n,r,i,o,a,u,h,l;return h=l=this.streamer,n=h.consume,r=h.done,o=(i=e.streamer).emit,a=0,u=function(){return n(function(e,n,r,i){return t(o,e,n,r,i,a)})},u=s.Data.repeatCall(u,this.items),function(t){return function(){var e;for(l.reset(),i.reset(),e=t.used,a=0;!r()&&e>a;)u(),a++;return l.count()}}(this)},e}(r),e.exports=i},{"../../util":175,"./buffer":125,"./texture/datatexture":134}],127:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("./databuffer"),o=t("../../util"),i=function(t){function e(t,n,r){this.width=r.width||1,this.height=r.height||1,this.history=r.history||1,this.samples=this.width*this.height,this.wrap=this.history>1,r.depth=this.history,e.__super__.constructor.call(this,t,n,r)}return s(e,t),e.prototype.build=function(t){return e.__super__.build.apply(this,arguments),this.index=0,this.pad={x:0,y:0},this.streamer=this.generate(this.data)},e.prototype.getFilled=function(){return this.filled},e.prototype.setActive=function(t,e){var n;return n=[Math.max(0,this.width-t),Math.max(0,this.height-e)],this.pad.x=n[0],this.pad.y=n[1],n},e.prototype.fill=function(){var t,e,n,r,i,o,s,a,u,h,l,c,p,f;if(t=this.callback,"function"==typeof t.reset&&t.reset(),l=this.streamer,r=l.emit,f=l.skip,e=l.count,n=l.done,p=l.reset,p(),u=this.width,h=this.pad.x,a=this.samples-this.pad.y*u,i=o=s=0,h)for(;!n()&&a>s&&(s++,c=t(r,i,o),++i===u-h&&(f(h),i=0,o++),c!==!1););else for(;!n()&&a>s&&(s++,c=t(r,i,o),++i===u&&(i=0,o++),c!==!1););return Math.floor(e()/this.items)},e.prototype.write=function(t){var e,n;return null==t&&(t=this.samples),t*=this.items,n=this.width*this.items,e=Math.ceil(t/n),this.texture.write(this.data,0,this.index*this.height,n,e),this.dataPointer.set(.5,this.index*this.height+.5),this.index=(this.index+this.history-1)%this.history,this.filled=Math.min(this.history,this.filled+1)},e.prototype.through=function(t,e){var n,r,i,s,a,u,h,l,c;return l=c=this.streamer,n=l.consume,r=l.done,s=(i=e.streamer).emit,a=u=0,h=function(){return n(function(e,n,r,i){return t(s,e,n,r,i,a,u)})},h=o.Data.repeatCall(h,this.items),function(t){return function(){var e,n,o,s;if(c.reset(),i.reset(),o=t.width,s=t.pad.x,n=t.samples-t.pad.y*o,a=u=e=0,s)for(;!r()&&n>e;)e++,h(),++a===o-s&&(skip(s),a=0,u++);else for(;!r()&&n>e;)e++,h(),++a===o&&(a=0,u++);return c.count()}}(this)},e}(r),e.exports=i},{"../../util":175,"./databuffer":126}],128:[function(t,e,n){var r,i,o,s,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;o=t("../renderable"),i=t("./rendertotexture"),s=t("../../util"),r=function(t){function e(t,n,r){null==this.items&&(this.items=r.items||1),null==this.channels&&(this.channels=r.channels||4),null==this.width&&(this.width=r.width||1),null==this.height&&(this.height=r.height||1),null==this.depth&&(this.depth=r.depth||1),r.format=THREE.RGBAFormat,r.width=this._width=this.items*this.width,r.height=this._height=this.height*this.depth,r.frames=1,delete r.items,delete r.depth,delete r.channels,e.__super__.constructor.call(this,t,n,r),this._adopt({textureItems:{type:"f",value:this.items},textureHeight:{type:"f",value:this.height}})}return a(e,t),e.prototype.shaderAbsolute=function(t){return null==t&&(t=this.shaders.shader()),t.pipe("map.xyzw.texture",this.uniforms),e.__super__.shaderAbsolute.call(this,t,1,2)},e}(i),e.exports=r},{"../../util":175,"../renderable":161,"./rendertotexture":131}],129:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("./buffer"),o=t("../../util"),i=function(t){function e(t,n,r){this.width=r.width||1,this.height=r.height||1,this.depth=r.depth||1,null==this.samples&&(this.samples=this.width*this.height*this.depth),e.__super__.constructor.call(this,t,n,r),this.build(r)}return s(e,t),e.prototype.build=function(t){return this.data=[],this.data.length=this.samples,this.filled=0,this.pad={x:0,y:0,z:0},this.streamer=this.generate(this.data)},e.prototype.dispose=function(){return this.data=null,e.__super__.dispose.apply(this,arguments)},e.prototype.getFilled=function(){return this.filled},e.prototype.setActive=function(t,e,n){var r;return r=[this.width-t,this.height-e,this.depth-n],this.pad.x=r[0],this.pad.y=r[1],this.pad.z=r[2],r},e.prototype.read=function(){return this.data},e.prototype.copy=function(t){var e,n,r,i,o,s;for(r=Math.min(t.length,this.samples),e=this.data,s=[],n=i=0,o=r;o>=0?o>i:i>o;n=o>=0?++i:--i)s.push(e[n]=t[n]);return s},e.prototype.fill=function(){var t,e,n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g;if(t=this.callback,"function"==typeof t.reset&&t.reset(),d=this.streamer,r=d.emit,g=d.skip,e=d.count,n=d.done,v=d.reset,v(),l=this.width,h=this.height,c=this.depth,p=this.pad.x,f=this.pad.y,u=this.samples-this.pad.z*l*h,i=o=s=a=0,p>0||f>0)for(;!n()&&u>a&&(a++,m=t(r,i,o,s),++i===l-p&&(g(p),i=0,++o===h-f&&(g(l*f),o=0,s++)),m!==!1););else for(;!n()&&u>a&&(a++,m=t(r,i,o,s),++i===l&&(i=0,++o===h&&(o=0,s++)),m!==!1););return this.filled=1,e()},e}(r),e.exports=i},{"../../util":175,"./buffer":125}],130:[function(t,e,n){var r,i,o,s,a,u,h=function(t,e){function n(){this.constructor=t}for(var r in e)l.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},l={}.hasOwnProperty;a=t("../renderable"),r=t("./buffer"),i=t("./memo"),o=t("../meshes/memoscreen"),u=t("../../util"),s=function(t){function e(t,n,r){null==this.items&&(this.items=r.items||1),null==this.channels&&(this.channels=r.channels||4),null==this.width&&(this.width=r.width||1),null==this.height&&(this.height=r.height||1),null==this.depth&&(this.depth=r.depth||1),null==this.type&&(this.type=r.type||THREE.FloatType),null==this.stpq&&(this.stpq=r.stpq||!1),this.isFloat=this.type===THREE.FloatType,this.active=this.sampled=this.rect=this.pad=null,e.__super__.constructor.call(this,t,n),this.build(r)}return h(e,t),e.prototype.build=function(t){var e,n,r,s,a,h,l,c,p,f,d,m,v,g;return p=t.map,h=t.indexer,l=null!=h&&!h.empty(),c=this.items,g=this.width,a=this.height,n=this.depth,d=this.stpq,f=p,l&&(this._adopt({indexModulus:{type:"v4",value:new THREE.Vector4(c,c*g,c*g*a,1)}}),f=this.shaders.shader(),f.require(p),f.require(h),f.pipe("float.index.pack",this.uniforms)),this.isFloat&&this.channels>1&&(this.floatMemo=new i(this.renderer,this.shaders,{items:c,channels:4,width:g,height:a,depth:n,history:0,type:THREE.FloatType}),this.floatCompose=new o(this.renderer,this.shaders,{map:f,items:c,width:g,height:a,depth:n,stpq:d}),this.floatMemo.adopt(this.floatCompose),d=!1,f=this.shaders.shader(),this.floatMemo.shaderAbsolute(f)),this.isFloat?(m=this.channels,e=4):(m=1,e=this.channels),m>1?(r=this.shaders.shader(),r.pipe(u.GLSL.mapByte2FloatOffset(m)),r.require(f),r.pipe("float.stretch"),r.pipe("float.encode"),f=r):this.isFloat&&(r=this.shaders.shader(),r.pipe(f),r.pipe(u.GLSL.truncateVec4(4,1)),r.pipe("float.encode"),f=r),this.byteMemo=new i(this.renderer,this.shaders,{items:c*m,channels:4,width:g,height:a,depth:n,history:0,type:THREE.UnsignedByteType}),this.byteCompose=new o(this.renderer,this.shaders,{map:f,items:c*m,width:g,height:a,depth:n,stpq:d}),this.byteMemo.adopt(this.byteCompose),v=c*g*m,s=a*n,this.samples=this.width*this.height*this.depth,this.bytes=new Uint8Array(v*s*4),this.isFloat&&(this.floats=new Float32Array(this.bytes.buffer)),this.data=this.isFloat?this.floats:this.bytes,this.streamer=this.generate(this.data),this.active={items:0,width:0,height:0,depth:0},this.sampled={items:0,width:0,height:0,depth:0},this.rect={w:0,h:0},this.pad={x:0,y:0,z:0,w:0},this.stretch=m,this.isIndexed=l,this.setActive(c,g,a,n)},e.prototype.generate=function(t){return u.Data.getStreamer(t,this.samples,4,this.items)},e.prototype.setActive=function(t,e,n,r){var i,o,s,a,u,h,l,c;if(t!==this.active.items||e!==this.active.width||n!==this.active.height||r!==this.active.depth)return o=[t,e,n,r],this.active.items=o[0],
-this.active.width=o[1],this.active.height=o[2],this.active.depth=o[3],null!=(s=this.floatCompose)&&s.cover(e,n,r),null!=(a=this.byteCompose)&&a.cover(e*this.stretch,n,r),t=this.items,e=this.active.width,n=1===this.depth?this.active.height:this.height,r=this.active.depth,c=t*e*this.stretch,i=n*r,u=[t,e,n,r],this.sampled.items=u[0],this.sampled.width=u[1],this.sampled.height=u[2],this.sampled.depth=u[3],h=[c,i],this.rect.w=h[0],this.rect.h=h[1],l=[this.sampled.width-this.active.width,this.sampled.height-this.active.height,this.sampled.depth-this.active.depth,this.sampled.items-this.active.items],this.pad.x=l[0],this.pad.y=l[1],this.pad.z=l[2],this.pad.w=l[3],l},e.prototype.update=function(t){var e,n;return null!=(e=this.floatMemo)&&e.render(t),null!=(n=this.byteMemo)?n.render(t):void 0},e.prototype.post=function(){return this.renderer.setRenderTarget(this.byteMemo.target.write),this.gl.readPixels(0,0,this.rect.w,this.rect.h,gl.RGBA,gl.UNSIGNED_BYTE,this.bytes)},e.prototype.readFloat=function(t){var e;return null!=(e=this.floatMemo)?e.read(t):void 0},e.prototype.readByte=function(t){var e;return null!=(e=this.byteMemo)?e.read(t):void 0},e.prototype.setCallback=function(t){return this.emitter=this.callback(t)},e.prototype.callback=function(t){var e,n,r,i,o;return this.isIndexed?(r=this.width,n=this.height,i=this.depth,o=this.items,e=function(e,i,s,a){var u,h,l,c,p;return u=a,p=u%o,u=(u-p)/o,h=u%r,u=(u-h)/r,l=u%n,u=(u-l)/n,c=u,t(e,i,s,a,h,l,c,p)},e.reset=function(){return"function"==typeof t.reset?t.reset():void 0},e):t},e.prototype.iterate=function(){var t,e,n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;for(i=this.emitter,"function"==typeof i.reset&&i.reset(),E=this.streamer,e=E.consume,b=E.skip,n=E.count,r=E.done,_=E.reset,_(),c=0|this.sampled.width,l=0|this.sampled.height,p=0|this.sampled.depth,f=0|this.sampled.items,m=0|this.pad.x,v=0|this.pad.y,g=0|this.pad.z,d=0|this.pad.w,h=c*l*f*(p-g),this.isIndexed||(t=i,i=function(e,n,r,i){return t(e,n,r,i,o,s,a,u)}),o=s=a=u=l=0;!r()&&h>l&&(l++,y=e(i),++u===f-d&&(b(m),u=0,++o===c-m&&(b(f*m),o=0,++s===l-v&&(b(f*c*v),s=0,a++))),y!==!1););return Math.floor(n()/f)},e.prototype.dispose=function(){var t,e,n,r,i,o;return null!=(t=this.floatMemo)&&t.unadopt(this.floatCompose),null!=(e=this.floatMemo)&&e.dispose(),null!=(n=this.floatCompose)&&n.dispose(),null!=(r=this.byteMemo)&&r.unadopt(this.byteCompose),null!=(i=this.byteMemo)&&i.dispose(),null!=(o=this.byteCompose)&&o.dispose(),this.floatMemo=this.byteMemo=this.floatCompose=this.byteCompose=null},e}(a),e.exports=s},{"../../util":175,"../meshes/memoscreen":155,"../renderable":161,"./buffer":125,"./memo":128}],131:[function(t,e,n){var r,i,o,s,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;o=t("../renderable"),r=t("./texture/rendertarget"),s=t("../../util"),i=function(t){function e(t,n,r){var i;this.scene=null!=(i=r.scene)?i:new THREE.Scene,this.camera=r.camera,e.__super__.constructor.call(this,t,n),this.build(r)}return a(e,t),e.prototype.shaderRelative=function(t){return null==t&&(t=this.shaders.shader()),t.pipe("sample.2d",this.uniforms)},e.prototype.shaderAbsolute=function(t,e,n){var r;return null==e&&(e=1),null==n&&(n=4),null==t&&(t=this.shaders.shader()),1>=e?(n>2&&t.pipe(s.GLSL.truncateVec(n,2)),t.pipe("map.2d.data",this.uniforms),t.pipe("sample.2d",this.uniforms)):(r=s.GLSL.sample2DArray(Math.min(e,this.target.frames)),4>n&&t.pipe(s.GLSL.extendVec(n,4)),t.pipe("map.xyzw.2dv"),t.split(),t.pipe("map.2d.data",this.uniforms),t.pass(),t.pipe(r,this.uniforms))},e.prototype.build=function(t){var e;return this.camera||(this.camera=new THREE.PerspectiveCamera,this.camera.position.set(0,0,3),this.camera.lookAt(new THREE.Vector3)),"function"==typeof(e=this.scene).inject&&e.inject(),this.target=new r(this.gl,t.width,t.height,t.frames,t),this.target.warmup(function(t){return function(e){return t.renderer.setRenderTarget(e)}}(this)),this.renderer.setRenderTarget(null),this._adopt(this.target.uniforms),this._adopt({dataPointer:{type:"v2",value:new THREE.Vector2(.5,.5)}}),this.filled=0},e.prototype.adopt=function(t){var e,n,r,i,o;for(i=t.renders,o=[],e=0,n=i.length;n>e;e++)r=i[e],o.push(this.scene.add(r));return o},e.prototype.unadopt=function(t){var e,n,r,i,o;for(i=t.renders,o=[],e=0,n=i.length;n>e;e++)r=i[e],o.push(this.scene.remove(r));return o},e.prototype.render=function(t){var e;return null==t&&(t=this.camera),this.renderer.render(null!=(e=this.scene.scene)?e:this.scene,t,this.target.write),this.target.cycle(),this.filled=0?d>l:l>d;h=d>=0?++l:--l)u=("00"+Math.max(0,8*-h+128-8*!h).toString(16)).slice(-2),r.push("#"+u+u+u);return m=new Uint8Array(p*c*2),this.canvas=n,this.context=o,this.lineHeight=c,this.maxWidth=p,this.colors=r,this.scratch=m,this._allocate=this.allocate.bind(this),this._write=this.write.bind(this)},e.prototype.reset=function(){return e.__super__.reset.apply(this,arguments),this.mapped={}},e.prototype.begin=function(){var t,e,n,r,i;for(n=this.rows,r=[],t=0,e=n.length;e>t;t++)i=n[t],r.push(i.alive=0);return r},e.prototype.end=function(){var t,e,n,r,i,o,s,a,u;for(o=this.mapped,s=this.rows.slice(),t=0,r=s.length;r>t;t++)if(u=s[t],0===u.alive){for(a=u.keys,n=0,i=a.length;i>n;n++)e=a[n],delete o[e];this.collapse(u)}},e.prototype.map=function(t,e){var n,r,i,o,s,a,u;return s=this.mapped,r=s[t],null!=r?(r.row.alive++,e(r.x,r.y,r.w,r.h)):(this.draw(t),i=this.scratch,a=this.scratchW,o=this.scratchH,n=this._allocate,u=this._write,n(t,a,o,function(n,r,h){return s[t]={x:r,y:h,w:a,h:o,row:n},u(i,r,h,a,o),e(r,h,a,o)}))},e.prototype.draw=function(t){var e,n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R;if(x=this.width,h=this.lineHeight,y=this.outline,o=this.context,a=this.scratch,g=this.maxWidth,i=this.colors,w=y+1,R=Math.round(1.05*h-1),m=o.measureText(t),x=Math.min(g,Math.ceil(m.width+2*w+1)),o.clearRect(0,0,x,h),0===this.outline){for(o.fillText(t,w,R),s=(c=o.getImageData(0,0,x,h)).data,p=3,l=f=0,_=s.length/4;_>=0?_>f:f>_;l=_>=0?++f:--f)a[l]=s[p],p+=4;return this.scratchW=x,this.scratchH=h}for(o.globalCompositeOperation="source-over",l=d=b=y+1;1>=b?1>=d:d>=1;l=1>=b?++d:--d)p=l>1?2*l-2:l,o.strokeStyle=i[p-1],o.lineWidth=p,o.strokeText(t,w,R);for(o.globalCompositeOperation="multiply",o.fillText(t,w,R),s=(c=o.getImageData(0,0,x,h)).data,p=0,u=this.gamma,l=E=0,T=s.length/4;T>=0?T>E:E>T;l=T>=0?++E:--E)e=s[p],v=e?s[p+1]/e:1,.5===u&&(v=Math.sqrt(v)),v=Math.min(1,Math.max(0,v)),n=256-e,r=n+(e-n)*v,a[l]=Math.max(0,Math.min(255,r+2)),p+=4;return this.scratchW=x,this.scratchH=h},e}(r),e.exports=o},{"./atlas":124}],133:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;o=t("../../../Util"),i=t("./datatexture"),r=function(t){function e(t,n,r,i,o){e.__super__.constructor.call(this,t,n,r,i,o),this.data=new this.ctor(this.n)}return s(e,t),e.prototype.resize=function(t,e){var n,r,i,o;return r=this.data,o=this.width,i=this.height,this.width=t,this.height=e,this.n=t*e*this.channels,this.data=new this.ctor(this.n),n=this.gl,n.bindTexture(n.TEXTURE_2D,this.texture),n.pixelStorei(n.UNPACK_ALIGNMENT,1),n.texImage2D(n.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,this.data),this.uniforms.dataResolution.value.set(1/t,1/e),this.write(r,0,0,o,i)},e.prototype.write=function(t,n,r,i,o){var s,a,u,h,l,c,p,f,d,m,v,g;if(f=this.width,a=this.data,s=this.channels,u=0,f===i&&0===n)for(h=r*i*s,c=i*o*s;c>u;)a[h++]=t[u++];else for(p=f*s,d=i*s,m=n*s,g=r,v=r+o;v>g;){for(l=0,h=m+g*p;l++=0?r>n:n>r;t=r>=0?++n:--n)i.push(e());return i}.call(this),this.reads=function(){var n,r,i;for(i=[],t=n=0,r=this.buffers;r>=0?r>n:n>r;t=r>=0?++n:--n)i.push(e());return i}.call(this),this.write=e(),this.index=0,this.uniforms={dataResolution:{type:"v2",value:new THREE.Vector2(1/this.width,1/this.height)},dataTexture:{type:"t",value:this.reads[0]},dataTextures:{type:"tv",value:this.reads}}},t.prototype.cycle=function(){var t,e,n,r,i,o,s,a,u;for(o=["__webglTexture","__webglFramebuffer","__webglRenderbuffer"],e=this.buffers,n=function(t,e){var n,r,i;for(n=0,i=o.length;i>n;n++)r=o[n],e[r]=t[r];return null},t=function(t,n){return(t+n+2*e)%e},n(this.write,this.targets[this.index]),u=this.reads,r=i=0,s=u.length;s>i;r=++i)a=u[r],n(this.targets[t(this.index,-r)],a);return this.index=t(this.index,1),n(this.targets[this.index],this.write)},t.prototype.warmup=function(t){var e,n,r,i;for(i=[],e=n=0,r=this.buffers;r>=0?r>n:n>r;e=r>=0?++n:--n)t(this.write),i.push(this.cycle());return i},t.prototype.dispose=function(){var t,e,n,r;for(n=this.targets,t=0,e=n.length;e>t;t++)r=n[t],r.dispose();return this.targets=this.reads=this.write=null},t}(),e.exports=r},{}],136:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("./databuffer"),i=t("../../util"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.build=function(t){return e.__super__.build.apply(this,arguments),this.pad={x:0,y:0,z:0},this.streamer=this.generate(this.data)},e.prototype.setActive=function(t,e,n){var r;return r=[Math.max(0,this.width-t),Math.max(0,this.height-e),Math.max(0,this.depth-n)],this.pad.x=r[0],this.pad.y=r[1],this.pad.z=r[2],r},e.prototype.fill=function(){var t,e,n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g;if(t=this.callback,"function"==typeof t.reset&&t.reset(),d=this.streamer,r=d.emit,g=d.skip,e=d.count,n=d.done,v=d.reset,v(),l=this.width,h=this.height,c=this.depth,p=this.pad.x,f=this.pad.y,u=this.samples-this.pad.z*l*h,i=o=s=a=0,p>0||f>0)for(;!n()&&u>a&&(a++,m=t(r,i,o,s),++i===l-p&&(g(p),i=0,++o===h-f&&(g(l*f),o=0,s++)),m!==!1););else for(;!n()&&u>a&&(a++,m=t(r,i,o,s),++i===l&&(i=0,++o===h&&(o=0,s++)),m!==!1););return Math.floor(e()/this.items)},e.prototype.through=function(t,e){var n,r,o,s,a,u,h,l,c,p;return c=p=this.streamer,n=c.consume,r=c.done,s=(o=e.streamer).emit,a=u=h=0,l=function(){return n(function(e,n,r,i){return t(s,e,n,r,i,a,u,h)})},l=i.Data.repeatCall(l,this.items),function(t){return function(){var e,n,i,s,c,f,d;if(p.reset(),o.reset(),s=t.width,i=t.height,c=t.depth,f=t.pad.x,d=t.pad.y,n=t.samples-t.pad.z*s*i,a=u=h=e=0,f>0||d>0)for(;!r()&&n>e;)e++,l(),++a===s-f&&(skip(f),a=0,++u===i-d&&(skip(s*d),u=0,h++));else for(;!r()&&n>e;)e++,l(),++a===s&&(a=0,++u===i&&(u=0,h++));return p.count()}}(this)},e}(r),e.exports=o},{"../../util":175,"./databuffer":126}],137:[function(t,e,n){var r;r={sprite:t("./meshes/sprite"),point:t("./meshes/point"),line:t("./meshes/line"),surface:t("./meshes/surface"),face:t("./meshes/face"),strip:t("./meshes/strip"),arrow:t("./meshes/arrow"),screen:t("./meshes/screen"),memoScreen:t("./meshes/memoscreen"),debug:t("./meshes/debug"),dataBuffer:t("./buffer/databuffer"),arrayBuffer:t("./buffer/arraybuffer"),matrixBuffer:t("./buffer/matrixbuffer"),voxelBuffer:t("./buffer/voxelbuffer"),pushBuffer:t("./buffer/pushbuffer"),renderToTexture:t("./buffer/rendertotexture"),memo:t("./buffer/memo"),readback:t("./buffer/readback"),atlas:t("./buffer/atlas"),textAtlas:t("./buffer/textatlas"),scene:t("./scene")},e.exports=r},{"./buffer/arraybuffer":123,"./buffer/atlas":124,"./buffer/databuffer":126,"./buffer/matrixbuffer":127,"./buffer/memo":128,"./buffer/pushbuffer":129,"./buffer/readback":130,"./buffer/rendertotexture":131,"./buffer/textatlas":132,"./buffer/voxelbuffer":136,"./meshes/arrow":150,"./meshes/debug":152,"./meshes/face":153,"./meshes/line":154,"./meshes/memoscreen":155,"./meshes/point":156,"./meshes/screen":157,"./meshes/sprite":158,"./meshes/strip":159,"./meshes/surface":160,"./scene":162}],138:[function(t,e,n){var r;r=function(){function t(t,e,n){this.classes=t,this.renderer=e,this.shaders=n}return t.prototype.getTypes=function(){return Object.keys(this.classes)},t.prototype.make=function(t,e){return new this.classes[t](this.renderer,this.shaders,e)},t}(),e.exports=r},{}],139:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;i=t("./clipgeometry"),r=function(t){function e(t){var n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S,k,A,C,P,L,z,O,D,F,U,B,N,V,I,j,G,W,q,X,Y;for(e.__super__.constructor.call(this,t),this._clipUniforms(),this.sides=V=+t.sides||12,this.samples=N=+t.samples||2,this.strips=j=+t.strips||1,this.ribbons=B=+t.ribbons||1,this.layers=_=+t.layers||1,this.flip=d=null!=(A=t.flip)?A:!1,this.anchor=r=null!=(C=t.anchor)?C:d?0:N-1,s=j*B*_,H=(V+2)*s,W=2*V*s,this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(3*W),1)),this.addAttribute("position4",new THREE.BufferAttribute(new Float32Array(4*H),4)),this.addAttribute("arrow",new THREE.BufferAttribute(new Float32Array(3*H),3)),this.addAttribute("attach",new THREE.BufferAttribute(new Float32Array(2*H),2)),this._autochunk(),v=this._emitter("index"),M=this._emitter("position4"),o=this._emitter("arrow"),a=this._emitter("attach"),p=[],E=g=0,P=V;P>=0?P>g:g>P;E=P>=0?++g:--g)i=E/V*τ,p.push([Math.cos(i),Math.sin(i),1]);for(l=0,m=b=0,L=s;L>=0?L>b:b>L;m=L>=0?++b:--b){for(G=l++,h=G+V+1,E=T=0,z=V;z>=0?z>T:T>z;E=z>=0?++T:--T)n=l+E%V,u=l+(E+1)%V,v(G),v(n),v(u),v(u),v(n),v(h);l+=V+1}for(I=d?1:-1,f=d?N-1:0,x=r+I,q=r,y=w=0,O=_;O>=0?O>w:w>O;y=O>=0?++w:--w)for(Y=R=0,D=B;D>=0?D>R:R>D;Y=D>=0?++R:--R)for(X=S=0,F=j;F>=0?F>S:S>F;X=F>=0?++S:--S){for(M(q,X,Y,y),o(0,0,0),a(x,f),E=k=0,U=V;U>=0?U>k:k>U;E=U>=0?++k:--k)M(q,X,Y,y),c=p[E],o(c[0],c[1],c[2]),a(x,f);M(q,X,Y,y),o(0,0,1),a(x,f)}this._finalize(),this.clip()}return o(e,t),e.prototype.clip=function(t,e,n,r){var i,o,s,a;return null==t&&(t=this.samples),null==e&&(e=this.strips),null==n&&(n=this.ribbons),null==r&&(r=this.layers),a=Math.max(0,t-1),this._clipGeometry(t,e,n,r),t>this.anchor?(i=[r,n,e],o=[this.layers,this.ribbons,this.strips],s=this.sides*this._reduce(i,o)):s=0,this._offsets([{start:0,count:6*s}])},e}(i),e.exports=r},{"./clipgeometry":140}],140:[function(t,e,n){var r,i,o,s,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;i=t("./geometry"),o=!1,s=function(){var t;return t=+new Date,function(e){var n;return n=+new Date-t,console.log(e,n+" ms"),n}},r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype._clipUniforms=function(){return this.geometryClip=new THREE.Vector4(1e10,1e10,1e10,1e10),this.geometryResolution=new THREE.Vector4,this.mapSize=new THREE.Vector4,null==this.uniforms&&(this.uniforms={}),this.uniforms.geometryClip={type:"v4",value:this.geometryClip},this.uniforms.geometryResolution={type:"v4",value:this.geometryResolution},this.uniforms.mapSize={type:"v4",value:this.mapSize}},e.prototype._clipGeometry=function(t,e,n,r){var i,o;return i=function(t){return Math.max(0,t-1)},o=function(t){return 1/Math.max(1,t-1)},this.geometryClip.set(i(t),i(e),i(n),i(r)),this.geometryResolution.set(o(t),o(e),o(n),o(r))},e.prototype._clipMap=function(t,e,n,r){return this.mapSize.set(t,e,n,r)},e.prototype._clipOffsets=function(t,e,n,r,i,o,s,a,u){var h,l,c;return h=[r,n,e,i],c=[a,s,o,u],l=this._reduce(h,c),this._offsets([{start:0,count:l*t}])},e}(i),e.exports=r},{"./geometry":142}],141:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=t("./clipgeometry"),i=function(t){function e(t){var n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S,k,A;for(e.__super__.constructor.call(this,t),this._clipUniforms(),this.items=a=+t.items||2,this.width=M=+t.width||1,this.height=i=+t.height||1,this.depth=r=+t.depth||1,this.sides=R=Math.max(0,a-2),w=M*i*r,m=a*w,H=R*w,this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(3*H),1)),this.addAttribute("position4",new THREE.BufferAttribute(new Float32Array(4*m),4)),this._autochunk(),s=this._emitter("index"),v=this._emitter("position4"),n=0,o=h=0,E=w;E>=0?E>h:h>E;o=E>=0?++h:--h){for(u=c=0,y=R;y>=0?y>c:c>y;u=y>=0?++c:--c)s(n),s(n+u+1),s(n+u+2);n+=a}for(A=p=0,_=r;_>=0?_>p:p>_;A=_>=0?++p:--p)for(k=f=0,b=i;b>=0?b>f:f>b;k=b>=0?++f:--f)for(S=d=0,T=M;T>=0?T>d:d>T;S=T>=0?++d:--d)for(l=g=0,x=a;x>=0?x>g:g>x;l=x>=0?++g:--g)v(S,k,A,l);this._finalize(),this.clip()}return o(e,t),e.prototype.clip=function(t,e,n,r){var i;return null==t&&(t=this.width),null==e&&(e=this.height),null==n&&(n=this.depth),null==r&&(r=this.items),i=Math.max(0,r-2),this._clipGeometry(t,e,n,r),this._clipOffsets(3,t,e,n,i,this.width,this.height,this.depth,this.sides)},e}(r),e.exports=i},{"./clipgeometry":140}],142:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=!1,o=function(){var t;return t=+new Date,function(e){var n;return n=+new Date-t,console.log(e,n+" ms"),n}},r=function(t){function e(){THREE.BufferGeometry.call(this),null==this.uniforms&&(this.uniforms={}),null==this.offsets&&(this.offsets=[]),i&&(this.tock=o()),this.chunked=!1,this.limit=65535}return s(e,t),e.prototype._reduce=function(t,e){var n,r,i,o,s,a,u;for(a=!1,r=i=0,o=t.length;o>i;r=++i)n=t[r],s=e[r],a&&(t[r]=s),n>1&&(a=!0);return u=t.reduce(function(t,e){return t*e})},e.prototype._emitter=function(t){var e,n,r,i,o,s,a,u;return n=this.attributes[t],r=n.itemSize,e=n.array,o=0,s=function(t){return e[o++]=t},u=function(t,n){return e[o++]=t,e[o++]=n},a=function(t,n,r){return e[o++]=t,e[o++]=n,e[o++]=r},i=function(t,n,r,i){return e[o++]=t,e[o++]=n,e[o++]=r,e[o++]=i},[null,s,u,a,i][r]},e.prototype._autochunk=function(){var t,e,n,r,i,o;n=this.attributes.index,o=this.attributes;for(r in o)if(e=o[r],"index"!==r&&n){i=e.array.length/e.itemSize,i>this.limit&&(this.chunked=!0);break}return this.chunked&&!n.u16?(n.u16=t=n.array,n.array=new Uint32Array(t.length)):void 0},e.prototype._finalize=function(){var t;if(this.chunked)return t=this.attributes.index,this.chunks=this._chunks(t.array,this.limit),this._chunkify(t,this.chunks),i?this.tock(this.constructor.name):void 0},e.prototype._chunks=function(t,e){var n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E;for(i=[],f=0,E=t[0],o=t[0],v=function(t){var e,n,r;return r=3*f,n=3*t,e=n-r,i.push({index:E,start:r,count:e,end:n})},d=Math.floor(t.length/3),m=0,s=a=0,g=d;g>=0?g>a:a>g;s=g>=0?++a:--a)u=t[m++],h=t[m++],l=t[m++],p=Math.min(u,h,l),c=Math.max(u,h,l),n=Math.min(E,p),r=Math.max(o,c),r-n>e&&(v(s),n=p,r=c,f=s),E=n,o=r;return v(d),i},e.prototype._chunkify=function(t,e){var n,r,i,o,s,a,u,h,l,c;if(t.u16){for(r=t.array,c=t.u16,o=0,a=e.length;a>o;o++)for(n=e[o],u=n.index,i=s=h=n.start,l=n.end;l>=h?l>s:s>l;i=l>=h?++s:--s)c[i]=r[i]-u;return t.array=t.u16,delete t.u16}},e.prototype._offsets=function(t){var e,n,r,i,o,s,a,u,h,l,c,p;if(this.chunked)for(i=this.chunks,c=this.offsets,c.length=null,s=0,u=t.length;u>s;s++)for(l=t[s],p=l.start,o=l.count-p,a=0,h=i.length;h>a;a++)r=i[a],n=r.start,e=r.end,(n>=p&&o>n||e>p&&o>=e||p>n&&e>o)&&(n=Math.max(p,n),e=Math.min(o,e),c.push({index:r.index,start:n,count:e-n}));else this.offsets=t;return null},e}(THREE.BufferGeometry),e.exports=r},{}],143:[function(t,e,n){n.Geometry=t("./geometry"),n.ArrowGeometry=t("./arrowgeometry"),n.FaceGeometry=t("./facegeometry"),n.LineGeometry=t("./linegeometry"),n.ScreenGeometry=t("./screengeometry"),n.SpriteGeometry=t("./spritegeometry"),n.StripGeometry=t("./stripgeometry"),n.SurfaceGeometry=t("./surfacegeometry")},{"./arrowgeometry":139,"./facegeometry":141,"./geometry":142,"./linegeometry":144,"./screengeometry":145,"./spritegeometry":146,"./stripgeometry":147,"./surfacegeometry":148}],144:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=t("./clipgeometry"),i=function(t){function e(t){var n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S,k,A,C,P,L,z,O,D,F,U,B,N,V,I,j,G,W,q,X,Y,Z,K,Q,J,$,tt,et;for(e.__super__.constructor.call(this,t),this._clipUniforms(),this.closed=o=t.closed||!1,this.samples=I=(+t.samples||2)+(o?1:0),this.strips=W=+t.strips||1,this.ribbons=N=+t.ribbons||1,this.layers=v=+t.layers||1,this.detail=s=+t.detail||1,E=I-1,this.joints=f=s-1,this.vertices=K=(E-1)*f+I,this.segments=j=(E-1)*f+E,J=I-(o?1:0),x=K*W*N*v*2,H=j*W*N*v,X=2*H,this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(3*X),1)),this.addAttribute("position4",new THREE.BufferAttribute(new Float32Array(4*x),4)),this.addAttribute("line",new THREE.BufferAttribute(new Float32Array(2*x),2)),this.addAttribute("strip",new THREE.BufferAttribute(new Float32Array(2*x),2)),s>1&&this.addAttribute("joint",new THREE.BufferAttribute(new Float32Array(x),1)),this._autochunk(),l=this._emitter("index"),w=this._emitter("position4"),g=this._emitter("line"),G=this._emitter("strip"),s>1&&(p=this._emitter("joint")),i=0,h=_=0,S=N*v;S>=0?S>_:_>S;h=S>=0?++_:--_)for(c=b=0,k=W;k>=0?k>b:b>k;c=k>=0?++b:--b){for(d=T=0,P=j;P>=0?P>T:T>P;d=P>=0?++T:--T)l(i),l(i+1),l(i+2),l(i+2),l(i+1),l(i+3),i+=2;i+=2}if(u=o?function(){return 0}:function(t){return 0===t?-1:t===I-1?1:0},s>1)for(m=R=0,L=v;L>=0?L>R:R>L;m=L>=0?++R:--R)for(et=M=0,z=N;z>=0?z>M:M>z;et=z>=0?++M:--M)for(tt=V=0,O=W;O>=0?O>V:V>O;tt=O>=0?++V:--V)for($=q=0,D=I;D>=0?D>q:q>D;$=D>=0?++q:--q)if(o&&($%=J),a=u($),0!==a)w($,tt,et,m),w($,tt,et,m),g(a,1),g(a,-1),G(0,j),G(0,j),p(.5),p(.5);else for(y=Y=0,F=s;F>=0?F>Y:Y>F;y=F>=0?++Y:--Y)w($,tt,et,m),w($,tt,et,m),g(a,1),g(a,-1),G(0,j),G(0,j),p(y/f),p(y/f);else for(m=Z=0,U=v;U>=0?U>Z:Z>U;m=U>=0?++Z:--Z)for(et=Q=0,B=N;B>=0?B>Q:Q>B;et=B>=0?++Q:--Q)for(tt=n=0,A=W;A>=0?A>n:n>A;tt=A>=0?++n:--n)for($=r=0,C=I;C>=0?C>r:r>C;$=C>=0?++r:--r)o&&($%=J),a=u($),w($,tt,et,m),w($,tt,et,m),g(a,1),g(a,-1),G(0,j),G(0,j);this._finalize(),this.clip()}return o(e,t),e.prototype.clip=function(t,e,n,r){var i,o;return null==t&&(t=this.samples-this.closed),null==e&&(e=this.strips),null==n&&(n=this.ribbons),null==r&&(r=this.layers),i=Math.max(0,t-(this.closed?0:1)),o=t+(t-2)*this.joints,i=o-1,this._clipGeometry(o,e,n,r),this._clipOffsets(6,i,e,n,r,this.segments,this.strips,this.ribbons,this.layers)},e}(r),e.exports=i},{"./clipgeometry":140}],145:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;i=t("./surfacegeometry"),r=function(t){function e(t){var n,r;null==this.uniforms&&(this.uniforms={}),this.uniforms.geometryScale={type:"v4",value:new THREE.Vector4},t.width=Math.max(2,null!=(n=+t.width)?n:2),t.height=Math.max(2,null!=(r=+t.height)?r:2),this.cover(),e.__super__.constructor.call(this,t)}return o(e,t),e.prototype.cover=function(t,e,n,r){this.scaleX=null!=t?t:1,this.scaleY=null!=e?e:1,this.scaleZ=null!=n?n:1,this.scaleW=null!=r?r:1},e.prototype.clip=function(t,n,r,i){var o;return null==t&&(t=this.width),null==n&&(n=this.height),null==r&&(r=this.surfaces),null==i&&(i=this.layers),e.__super__.clip.call(this,t,n,r,i),o=function(t){return 1/Math.max(1,t-1)},this.uniforms.geometryScale.value.set(o(t)*this.scaleX,o(n)*this.scaleY,o(r)*this.scaleZ,o(i)*this.scaleW)},e}(i),e.exports=r},{"./surfacegeometry":148}],146:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=t("./clipgeometry"),i=function(t){function e(t){var n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S,k,A,C;for(e.__super__.constructor.call(this,t),this._clipUniforms(),this.items=a=+t.items||2,this.width=S=+t.width||1,this.height=i=+t.height||1,this.depth=r=+t.depth||1,w=a*S*i*r,v=4*w,H=2*w,this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(3*H),1)),this.addAttribute("position4",new THREE.BufferAttribute(new Float32Array(4*v),4)),this.addAttribute("sprite",new THREE.BufferAttribute(new Float32Array(2*v),2)),this._autochunk(),s=this._emitter("index"),g=this._emitter("position4"),R=this._emitter("sprite"),E=[[-1,-1],[-1,1],[1,-1],[1,1]],n=0,o=u=0,y=w;y>=0?y>u:u>y;o=y>=0?++u:--u)s(n),s(n+1),s(n+2),s(n+1),s(n+2),s(n+3),n+=4;for(C=h=0,_=r;_>=0?_>h:h>_;C=_>=0?++h:--h)for(A=p=0,b=i;b>=0?b>p:p>b;A=b>=0?++p:--p)for(k=f=0,T=S;T>=0?T>f:f>T;k=T>=0?++f:--f)for(l=d=0,x=a;x>=0?x>d:d>x;l=x>=0?++d:--d)for(m=0,c=E.length;c>m;m++)M=E[m],g(k,A,C,l),R(M[0],M[1]);this._finalize(),this.clip()}return o(e,t),e.prototype.clip=function(t,e,n,r){return null==t&&(t=this.width),null==e&&(e=this.height),null==n&&(n=this.depth),null==r&&(r=this.items),this._clipGeometry(t,e,n,r),this._clipOffsets(6,t,e,n,r,this.width,this.height,this.depth,this.items)},e}(r),e.exports=i},{"./clipgeometry":140}],147:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=t("./clipgeometry"),i=function(t){function e(t){var n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S,k,A,C,P,L,z;for(e.__super__.constructor.call(this,t),this._clipUniforms(),this.items=u=+t.items||2,this.width=C=+t.width||1,this.height=o=+t.height||1,this.depth=r=+t.depth||1,this.sides=S=Math.max(0,u-2),M=C*o*r,g=u*M,A=S*M,this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(3*A),1)),this.addAttribute("position4",new THREE.BufferAttribute(new Float32Array(4*g),4)),this.addAttribute("strip",new THREE.BufferAttribute(new Float32Array(3*g),3)),this._autochunk(),a=this._emitter("index"),E=this._emitter("position4"),k=this._emitter("strip"),n=0,s=l=0,b=M;b>=0?b>l:l>b;s=b>=0?++l:--l){for(m=n,h=f=0,T=S;T>=0?T>f:f>T;h=T>=0?++f:--f)1&h?(a(m+1),a(m),a(m+2)):(a(m),a(m+1),a(m+2)),m++;n+=u}for(p=u-1,z=d=0,x=r;x>=0?x>d:d>x;z=x>=0?++d:--d)for(L=v=0,w=o;w>=0?w>v:v>w;L=w>=0?++v:--v)for(P=y=0,R=C;R>=0?R>y:y>R;P=R>=0?++y:--y){for(i=1,E(P,L,z,0),k(1,2,i),c=_=1,H=p;H>=1?H>_:_>H;c=H>=1?++_:--_)E(P,L,z,c),k(c-1,c+1,i=-i);E(P,L,z,p),k(p-2,p-1,-i)}this._finalize(),this.clip()}return o(e,t),e.prototype.clip=function(t,e,n,r){var i;return null==t&&(t=this.width),null==e&&(e=this.height),null==n&&(n=this.depth),null==r&&(r=this.items),i=Math.max(0,r-2),this._clipGeometry(t,e,n,r),this._clipOffsets(3,t,e,n,i,this.width,this.height,this.depth,this.sides)},e}(r),e.exports=i},{"./clipgeometry":140}],148:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=t("./clipgeometry"),i=function(t){function e(t){var n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S,k,A,C,P,L,z,O,D,F,U,B,N,V,I,j;
-for(e.__super__.constructor.call(this,t),this._clipUniforms(),this.closedX=r=t.closedX||!1,this.closedY=i=t.closedY||!1,this.width=U=(+t.width||2)+(r?1:0),this.height=h=(+t.height||2)+(i?1:0),this.surfaces=D=+t.surfaces||1,this.layers=m=+t.layers||1,B=U-(r?1:0),N=h-(i?1:0),this.segmentsX=L=Math.max(0,U-1),this.segmentsY=z=Math.max(0,h-1),_=U*h*D*m,x=L*z*D*m,F=2*x,this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(3*F),1)),this.addAttribute("position4",new THREE.BufferAttribute(new Float32Array(4*_),4)),this.addAttribute("surface",new THREE.BufferAttribute(new Float32Array(2*_),2)),this._autochunk(),c=this._emitter("index"),b=this._emitter("position4"),O=this._emitter("surface"),n=0,l=v=0,R=D*m;R>=0?R>v:v>R;l=R>=0?++v:--v){for(p=g=0,H=z;H>=0?H>g:g>H;p=H>=0?++g:--g){for(f=E=0,M=L;M>=0?M>E:E>M;f=M>=0?++E:--E)c(n),c(n+1),c(n+U),c(n+U),c(n+1),c(n+U+1),n++;n++}n+=U}for(a=r?function(){return 0}:function(t){return 0===t?-1:t===L?1:0},u=i?function(){return 0}:function(t){return 0===t?-1:t===z?1:0},d=y=0,S=m;S>=0?S>y:y>S;d=S>=0?++y:--y)for(j=T=0,k=D;k>=0?k>T:T>k;j=k>=0?++T:--T)for(I=w=0,A=h;A>=0?A>w:w>A;I=A>=0?++w:--w)for(i&&(I%=N),s=u(I),V=P=0,C=U;C>=0?C>P:P>C;V=C>=0?++P:--P)r&&(V%=B),o=a(V),b(V,I,j,d),O(o,s);this._finalize(),this.clip()}return o(e,t),e.prototype.clip=function(t,e,n,r){var i,o;return null==t&&(t=this.width),null==e&&(e=this.height),null==n&&(n=this.surfaces),null==r&&(r=this.layers),i=Math.max(0,t-1),o=Math.max(0,e-1),this._clipGeometry(t,e,n,r),this._clipOffsets(6,i,o,n,r,this.segmentsX,this.segmentsY,this.surfaces,this.layers)},e.prototype.map=function(t,e,n,r){return null==t&&(t=this.width),null==e&&(e=this.height),null==n&&(n=this.surfaces),null==r&&(r=this.layers),this._clipMap(t,e,n,r)},e}(r),e.exports=i},{"./clipgeometry":140}],149:[function(t,e,n){n.Scene=t("./scene"),n.Factory=t("./factory"),n.Renderable=t("./scene"),n.Classes=t("./classes")},{"./classes":137,"./factory":138,"./scene":162}],150:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;o=t("./base"),i=t("../geometry").ArrowGeometry,r=function(t){function e(t,n,r){var o,s,a,u,h,l,c,p,f,d,m,v,g,E;e.__super__.constructor.call(this,t,n,r),g=r.uniforms,f=r.material,m=r.position,o=r.color,p=r.mask,c=r.map,s=r.combine,v=r.stpq,l=r.linear,null==g&&(g={}),h=null!=g.styleColor,this.geometry=new i({sides:r.sides,samples:r.samples,strips:r.strips,ribbons:r.ribbons,layers:r.layers,anchor:r.anchor,flip:r.flip}),this._adopt(g),this._adopt(this.geometry.uniforms),u=n.material(),E=u.vertex,E.pipe(this._vertexColor(o,p)),E.require(this._vertexPosition(m,f,c,1,v)),E.pipe("arrow.position",this.uniforms),E.pipe("project.position",this.uniforms),u.fragment=a=this._fragmentColor(h,f,o,p,c,1,v,s,l),a.pipe("fragment.color",this.uniforms),this.material=this._material(u.link({})),d=new THREE.Mesh(this.geometry,this.material),d.frustumCulled=!1,d.matrixAutoUpdate=!1,this._raw(d),this.renders=[d]}return s(e,t),e.prototype.dispose=function(){return this.geometry.dispose(),this.material.dispose(),this.renders=this.geometry=this.material=null,e.__super__.dispose.apply(this,arguments)},e}(o),e.exports=r},{"../geometry":143,"./base":151}],151:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=t("../renderable"),o=t("../../util"),r=function(t){function e(t,n,r){var i;e.__super__.constructor.call(this,t,n,r),this.zUnits=null!=(i=r.zUnits)?i:0}return s(e,t),e.prototype.raw=function(){var t,e,n,r;for(r=this.renders,t=0,e=r.length;e>t;t++)n=r[t],this._raw(n);return null},e.prototype.depth=function(t,e){var n,r,i,o;for(o=this.renders,n=0,r=o.length;r>n;n++)i=o[n],this._depth(i,t,e);return null},e.prototype.polygonOffset=function(t,e){var n,r,i,o;for(o=this.renders,n=0,r=o.length;r>n;n++)i=o[n],this._polygonOffset(i,t,e);return null},e.prototype.show=function(t,e,n){var r,i,o,s,a;for(s=this.renders,a=[],r=0,i=s.length;i>r;r++)o=s[r],a.push(this._show(o,t,e,n));return a},e.prototype.hide=function(){var t,e,n,r;for(r=this.renders,t=0,e=r.length;e>t;t++)n=r[t],this._hide(n);return null},e.prototype._material=function(t){var e,n,r,i,o,s,a,u;for(s=this.renderer.getPrecision(),u=" precision "+s+" float;\n precision "+s+" int;\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;",e=" precision "+s+" float;\n precision "+s+" int;\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;",o=new THREE.RawShaderMaterial(t),a=["vertexGraph","fragmentGraph"],n=0,i=a.length;i>n;n++)r=a[n],o[r]=t[r];return o.vertexShader=[u,o.vertexShader].join("\n"),o.fragmentShader=[e,o.fragmentShader].join("\n"),o},e.prototype._raw=function(t){return t.rotationAutoUpdate=!1,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.material.defaultAttributeValues=void 0},e.prototype._depth=function(t,e,n){var r;return r=t.material,r.depthWrite=e,r.depthTest=n},e.prototype._polygonOffset=function(t,e,n){var r,i;return n-=this.zUnits,r=0!==n,i=t.material,i.polygonOffset=r,r?(i.polygonOffsetFactor=e,i.polygonOffsetUnits=n):void 0},e.prototype._show=function(t,e,n,r){var i;return e=!0,i=t.material,t.renderOrder=-r,t.visible=!0,i.transparent=e,i.blending=n,null},e.prototype._hide=function(t){return t.visible=!1},e.prototype._vertexColor=function(t,e){var n;if(t||e)return n=this.shaders.shader(),t&&(n.require(t),n.pipe("mesh.vertex.color",this.uniforms)),e&&(n.require(e),n.pipe("mesh.vertex.mask",this.uniforms)),n},e.prototype._vertexPosition=function(t,e,n,r,i){var o,s;return s=this.shaders.shader(),(n||e&&e!==!0)&&(o={},(r>0||i)&&(o.POSITION_MAP=""),r>0&&(o[["POSITION_U","POSITION_UV","POSITION_UVW","POSITION_UVWO"][r-1]]=""),i&&(o.POSITION_STPQ="")),s.require(t),s.pipe("mesh.vertex.position",this.uniforms,o)},e.prototype._fragmentColor=function(t,e,n,r,i,s,a,u,h){var l,c,p,f;return c=this.shaders.shader(),f=!1,p=!1,l={},s>0&&(l[["POSITION_U","POSITION_UV","POSITION_UVW","POSITION_UVWO"][s-1]]=""),a&&(l.POSITION_STPQ=""),t&&(c.pipe("style.color",this.uniforms),f=!0,(n||i||e)&&((!h||n)&&c.pipe("mesh.gamma.in"),p=!0)),n&&(c.isolate(),c.pipe("mesh.fragment.color",this.uniforms),(!h||f)&&c.pipe("mesh.gamma.in"),c.end(),f&&c.pipe(o.GLSL.binaryOperator("vec4","*")),h&&f&&c.pipe("mesh.gamma.out"),f=!0,p=!0),i&&(!f&&u&&c.pipe(o.GLSL.constant("vec4","vec4(1.0)")),c.isolate(),c.require(i),c.pipe("mesh.fragment.map",this.uniforms,l),h||c.pipe("mesh.gamma.in"),c.end(),u?c.pipe(u):f&&c.pipe(o.GLSL.binaryOperator("vec4","*")),f=!0,p=!0),e&&(f||c.pipe(o.GLSL.constant("vec4","vec4(1.0)")),e===!0?c.pipe("mesh.fragment.shaded",this.uniforms):(c.require(e),c.pipe("mesh.fragment.material",this.uniforms,l)),p=!0),p&&!h&&c.pipe("mesh.gamma.out"),r&&(c.pipe("mesh.fragment.mask",this.uniforms),f&&c.pipe(o.GLSL.binaryOperator("vec4","*"))),c},e}(i),e.exports=r},{"../../util":175,"../renderable":161}],152:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=t("./base"),i=function(t){function e(t,n,r){var i;e.__super__.constructor.call(this,t,n,r),this.geometry=new THREE.PlaneGeometry(1,1),this.material=new THREE.MeshBasicMaterial({map:r.map}),this.material.side=THREE.DoubleSide,i=new THREE.Mesh(this.geometry,this.material),i.position.x+=r.x||0,i.position.y+=r.y||0,i.frustumCulled=!1,i.scale.set(2,2,2),i.__debug=!0,this.objects=[i]}return o(e,t),e.prototype.dispose=function(){return this.geometry.dispose(),this.material.dispose(),this.objects=this.geometry=this.material=null,e.__super__.dispose.apply(this,arguments)},e}(r),e.exports=i},{"./base":151}],153:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("./base"),o=t("../geometry").FaceGeometry,i=function(t){function e(t,n,r){var i,s,a,u,h,l,c,p,f,d,m,v,g,E;e.__super__.constructor.call(this,t,n,r),g=r.uniforms,f=r.material,m=r.position,i=r.color,p=r.mask,c=r.map,s=r.combine,v=r.stpq,l=r.linear,null==g&&(g={}),null==f&&(f=!0),h=null!=g.styleColor,this.geometry=new o({items:r.items,width:r.width,height:r.height,depth:r.depth}),this._adopt(g),this._adopt(this.geometry.uniforms),u=n.material(),E=u.vertex,E.pipe(this._vertexColor(i,p)),E.require(this._vertexPosition(m,f,c,2,v)),f||E.pipe("face.position",this.uniforms),f&&E.pipe("face.position.normal",this.uniforms),E.pipe("project.position",this.uniforms),u.fragment=a=this._fragmentColor(h,f,i,p,c,2,v,s,l),a.pipe("fragment.color",this.uniforms),this.material=this._material(u.link({side:THREE.DoubleSide})),d=new THREE.Mesh(this.geometry,this.material),this._raw(d),this.renders=[d]}return s(e,t),e.prototype.dispose=function(){return this.geometry.dispose(),this.material.dispose(),this.renders=this.geometry=this.material=null,e.__super__.dispose.apply(this,arguments)},e}(r),e.exports=i},{"../geometry":143,"./base":151}],154:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("./base"),o=t("../geometry").LineGeometry,i=function(t){function e(t,n,r){var i,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R;e.__super__.constructor.call(this,t,n,r),w=r.uniforms,g=r.material,y=r.position,s=r.color,v=r.mask,m=r.map,a=r.combine,T=r.stpq,d=r.linear,i=r.clip,x=r.stroke,f=r.join,_=r.proximity,null==w&&(w={}),x=[null,"dotted","dashed"][x],p=null!=w.styleColor,f=null!=(b=["miter","round","bevel"][f])?b:"miter",h={miter:1,round:4,bevel:2}[f],this.geometry=new o({samples:r.samples,strips:r.strips,ribbons:r.ribbons,layers:r.layers,anchor:r.anchor,closed:r.closed,detail:h}),this._adopt(w),this._adopt(this.geometry.uniforms),c=n.material(),u={},x&&(u.LINE_STROKE=""),i&&(u.LINE_CLIP=""),null!=_&&(u.LINE_PROXIMITY=""),u["LINE_JOIN_"+f.toUpperCase()]="",h>1&&(u.LINE_JOIN_DETAIL=h),R=c.vertex,R.pipe(this._vertexColor(s,v)),R.require(this._vertexPosition(y,g,m,2,T)),R.pipe("line.position",this.uniforms,u),R.pipe("project.position",this.uniforms),l=c.fragment,x&&l.pipe("fragment.clip."+x,this.uniforms),i&&l.pipe("fragment.clip.ends",this.uniforms),null!=_&&l.pipe("fragment.clip.proximity",this.uniforms),l.pipe(this._fragmentColor(p,g,s,v,m,2,T,a,d)),l.pipe("fragment.color",this.uniforms),this.material=this._material(c.link({side:THREE.DoubleSide})),E=new THREE.Mesh(this.geometry,this.material),this._raw(E),this.renders=[E]}return s(e,t),e.prototype.dispose=function(){return this.geometry.dispose(),this.material.dispose(),this.renders=this.geometry=this.material=null,e.__super__.dispose.apply(this,arguments)},e}(r),e.exports=i},{"../geometry":143,"./base":151}],155:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=t("./screen"),o=t("../../util"),r=function(t){function e(t,n,r){var i,o,s,a,u,h,l,c,p,f,d,m;for(this.memo=(h=r.items,m=r.width,o=r.height,i=r.depth,d=r.stpq,r),a=function(t){return 1/Math.max(1,t)},u=function(t){return 1/Math.max(1,t-1)},this.uniforms={remapUVScale:{type:"v2",value:new THREE.Vector2(h*m,o*i)},remapModulus:{type:"v2",value:new THREE.Vector2(h,o)},remapModulusInv:{type:"v2",value:new THREE.Vector2(a(h),a(o))},remapSTPQScale:{type:"v4",value:new THREE.Vector4(u(m),u(o),u(i),u(h))}},c=n.shader(),c.pipe("screen.map.xyzw",this.uniforms),null!=r.map&&(d&&c.pipe("screen.map.stpq",this.uniforms),c.pipe(r.map)),e.__super__.constructor.call(this,t,n,{map:c,linear:!0}),f=this.renders,s=0,l=f.length;l>s;s++)p=f[s],p.transparent=!1}return s(e,t),e.prototype.cover=function(t,e,n,r){var i,o,s;return null==t&&(t=this.memo.width),null==e&&(e=this.memo.height),null==n&&(n=this.memo.depth),null==r&&(r=this.memo.items),i=function(t){return 1/Math.max(1,t-1)},this.uniforms.remapSTPQScale.value.set(i(t),i(e),i(n),i(r)),o=t/this.memo.width,s=n/this.memo.depth,1===this.memo.depth&&(s=e/this.memo.height),this.geometry.cover(o,s)},e}(i),e.exports=r},{"../../util":175,"./screen":157}],156:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("./base"),o=t("../geometry").SpriteGeometry,i=function(t){function e(t,n,r){var i,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S,k,A,C,P,L,z,O;e.__super__.constructor.call(this,t,n,r),z=r.uniforms,_=r.material,w=r.position,u=r.color,P=r.size,y=r.mask,E=r.map,h=r.combine,g=r.linear,A=r.shape,b=r.optical,d=r.fill,L=r.stpq,null==z&&(z={}),A=null!=(R=+A)?R:0,null==d&&(d=!0),v=null!=z.styleColor,C=["circle","square","diamond","up","down","left","right"],x=["circle","generic","generic","generic","generic","generic","generic"],k=[1.2,1,1.414,1.16,1.16,1.16,1.16],T=null!=(H=x[A])?H:x[0],s=null!=(M=C[A])?M:C[0],i=null!=(S=b&&k[A])?S:1,a=d?T:T+".hollow",this.geometry=new o({items:r.items,width:r.width,height:r.height,depth:r.depth}),this._adopt(z),this._adopt(this.geometry.uniforms),l={POINT_SHAPE_SCALE:+(i+1e-5)},f=n.material(),O=f.vertex,O.pipe(this._vertexColor(u,y)),P?(O.isolate(),O.require(P),O.require("point.size.varying",this.uniforms),O.end()):O.require("point.size.uniform",this.uniforms),O.require(this._vertexPosition(w,_,E,2,L)),O.pipe("point.position",this.uniforms,l),O.pipe("project.position",this.uniforms),f.fragment=p=this._fragmentColor(v,_,u,y,E,2,L,h,g),c=n.material(),c.vertex.pipe(O),p=c.fragment.pipe(f.fragment),p.require("point.mask."+s,this.uniforms),p.require("point.alpha."+a,this.uniforms),p.pipe("point.edge",this.uniforms),m=n.material(),m.vertex.pipe(O),p=m.fragment.pipe(f.fragment),p.require("point.mask."+s,this.uniforms),p.require("point.alpha."+a,this.uniforms),p.pipe("point.fill",this.uniforms),this.fillMaterial=this._material(m.link({side:THREE.DoubleSide})),this.edgeMaterial=this._material(c.link({side:THREE.DoubleSide})),this.fillObject=new THREE.Mesh(this.geometry,this.fillMaterial),this.edgeObject=new THREE.Mesh(this.geometry,this.edgeMaterial),this._raw(this.fillObject),this._raw(this.edgeObject),this.renders=[this.fillObject,this.edgeObject]}return s(e,t),e.prototype.show=function(t,e,n,r){return this._show(this.edgeObject,!0,e,n,r),this._show(this.fillObject,t,e,n,r)},e.prototype.dispose=function(){return this.geometry.dispose(),this.edgeMaterial.dispose(),this.fillMaterial.dispose(),this.renders=this.edgeObject=this.fillObject=this.geometry=this.edgeMaterial=this.fillMaterial=null,e.__super__.dispose.apply(this,arguments)},e}(r),e.exports=i},{"../geometry":143,"./base":151}],157:[function(t,e,n){var r,i,o,s,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;r=t("./base"),o=t("../geometry").ScreenGeometry,s=t("../../util"),i=function(t){function e(t,n,r){var i,s,a,u,h,l,c,p,f,d;e.__super__.constructor.call(this,t,n,r),f=r.uniforms,l=r.map,i=r.combine,p=r.stpq,h=r.linear,null==f&&(f={}),u=null!=f.styleColor,this.geometry=new o({width:r.width,height:r.height}),this._adopt(f),this._adopt(this.geometry.uniforms),a=n.material(),d=a.vertex,d.pipe("raw.position.scale",this.uniforms),d.fan(),d.pipe("stpq.xyzw.2d",this.uniforms),d.next(),d.pipe("screen.position",this.uniforms),d.join(),a.fragment=s=this._fragmentColor(u,!1,null,null,l,2,p,i,h),s.pipe("fragment.color",this.uniforms),this.material=this._material(a.link({side:THREE.DoubleSide})),c=new THREE.Mesh(this.geometry,this.material),c.frustumCulled=!1,this._raw(c),this.renders=[c]}return a(e,t),e.prototype.dispose=function(){return this.geometry.dispose(),this.material.dispose(),this.renders=this.geometry=this.material=null,e.__super__.dispose.apply(this,arguments)},e}(r),e.exports=i},{"../../util":175,"../geometry":143,"./base":151}],158:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("./base"),o=t("../geometry").SpriteGeometry,i=function(t){function e(t,n,r){var i,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_;e.__super__.constructor.call(this,t,n,r),y=r.uniforms,m=r.material,v=r.position,g=r.sprite,f=r.map,s=r.combine,p=r.linear,i=r.color,d=r.mask,E=r.stpq,null==y&&(y={}),c=null!=y.styleColor,this.geometry=new o({items:r.items,width:r.width,height:r.height,depth:r.depth}),this._adopt(y),this._adopt(this.geometry.uniforms),h=n.material(),_=h.vertex,_.pipe(this._vertexColor(i,d)),_.require(this._vertexPosition(v,m,f,2,E)),_.require(g),_.pipe("sprite.position",this.uniforms),_.pipe("project.position",this.uniforms),h.fragment=u=this._fragmentColor(c,m,i,d,f,2,E,s,p),a=n.material(),a.vertex.pipe(_),a.fragment.pipe(u),a.fragment.pipe("fragment.transparent",this.uniforms),l=n.material(),l.vertex.pipe(_),l.fragment.pipe(u),l.fragment.pipe("fragment.solid",this.uniforms),this.fillMaterial=this._material(l.link({side:THREE.DoubleSide})),this.edgeMaterial=this._material(a.link({side:THREE.DoubleSide})),this.fillObject=new THREE.Mesh(this.geometry,this.fillMaterial),this.edgeObject=new THREE.Mesh(this.geometry,this.edgeMaterial),this._raw(this.fillObject),this._raw(this.edgeObject),this.renders=[this.fillObject,this.edgeObject]}return s(e,t),e.prototype.show=function(t,e,n,r){return this._show(this.edgeObject,!0,e,n,r),this._show(this.fillObject,t,e,n,r)},e.prototype.dispose=function(){return this.geometry.dispose(),this.edgeMaterial.dispose(),this.fillMaterial.dispose(),this.nreders=this.geometry=this.edgeMaterial=this.fillMaterial=this.edgeObject=this.fillObject=null,e.__super__.dispose.apply(this,arguments)},e}(r),e.exports=i},{"../geometry":143,"./base":151}],159:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("./base"),o=t("../geometry").StripGeometry,i=function(t){function e(t,n,r){var i,s,a,u,h,l,c,p,f,d,m,v,g,E;e.__super__.constructor.call(this,t,n,r),g=r.uniforms,f=r.material,m=r.position,i=r.color,p=r.mask,c=r.map,s=r.combine,l=r.linear,v=r.stpq,null==g&&(g={}),null==f&&(f=!0),h=null!=g.styleColor,this.geometry=new o({items:r.items,width:r.width,height:r.height,depth:r.depth}),this._adopt(g),this._adopt(this.geometry.uniforms),u=n.material(),E=u.vertex,E.pipe(this._vertexColor(i,p)),E.require(this._vertexPosition(m,f,c,2,v)),f||E.pipe("mesh.position",this.uniforms),f&&E.pipe("strip.position.normal",this.uniforms),E.pipe("project.position",this.uniforms),u.fragment=a=this._fragmentColor(h,f,i,p,c,2,v,s,l),a.pipe("fragment.color",this.uniforms),this.material=this._material(u.link({side:THREE.DoubleSide})),d=new THREE.Mesh(this.geometry,this.material),this._raw(d),this.renders=[d]}return s(e,t),e.prototype.dispose=function(){return this.geometry.dispose(),this.material.dispose(),this.renders=this.geometry=this.material=null,e.__super__.dispose.apply(this,arguments)},e}(r),e.exports=i},{"../geometry":143,"./base":151}],160:[function(t,e,n){var r,i,o,s,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;r=t("./base"),o=t("../geometry").SurfaceGeometry,s=t("../../util"),i=function(t){function e(t,n,r){var i,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;e.__super__.constructor.call(this,t,n,r),_=r.uniforms,v=r.material,E=r.position,i=r.color,m=r.mask,d=r.map,s=r.combine,f=r.linear,y=r.stpq,p=r.intUV,null==_&&(_={}),null==v&&(v=!0),c=null!=_.styleColor,l=null!=_.surfaceHollow,this.geometry=new o({width:r.width,height:r.height,surfaces:r.surfaces,layers:r.layers,closedX:r.closedX,closedY:r.closedY}),this._adopt(_),this._adopt(this.geometry.uniforms),h=n.material(),b=h.vertex,p&&(a={POSITION_UV_INT:""}),b.pipe(this._vertexColor(i,m)),b.require(this._vertexPosition(E,v,d,2,y)),v||b.pipe("surface.position",this.uniforms,a),v&&b.pipe("surface.position.normal",this.uniforms,a),b.pipe("project.position",this.uniforms),h.fragment=u=this._fragmentColor(c,v,i,m,d,2,y,s,f),u.pipe("fragment.color",this.uniforms),this.material=this._material(h.link({side:THREE.DoubleSide})),g=new THREE.Mesh(this.geometry,this.material),this._raw(g),this.renders=[g]}return a(e,t),e.prototype.dispose=function(){return this.geometry.dispose(),this.material.dispose(),this.renders=this.geometry=this.material=null,e.__super__.dispose.apply(this,arguments)},e}(r),e.exports=i},{"../../util":175,"../geometry":143,"./base":151}],161:[function(t,e,n){var r;r=function(){function t(t,e){this.renderer=t,this.shaders=e,this.gl=this.renderer.context,null==this.uniforms&&(this.uniforms={})}return t.prototype.dispose=function(){return this.uniforms=null},t.prototype._adopt=function(t){var e,n;for(e in t)n=t[e],this.uniforms[e]=n},t.prototype._set=function(t){var e,n;for(e in t)n=t[e],null!=this.uniforms[e]&&(this.uniforms[e].value=n)},t}(),e.exports=r},{}],162:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty,u=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};i=t("./renderable"),r=function(t){function e(){e.__super__.constructor.apply(this,arguments),this.rotationAutoUpdate=!1,this.frustumCulled=!1,this.matrixAutoUpdate=!1}return s(e,t),e}(THREE.Object3D),o=function(t){function e(t,n,i){e.__super__.constructor.call(this,t,n,i),this.root=new r,null!=(null!=i?i.scene:void 0)&&(this.scene=i.scene),null==this.scene&&(this.scene=new THREE.Scene),this.pending=[],this.async=0,this.scratch=new THREE.WebGLRenderTarget(1,1),this.camera=new THREE.PerspectiveCamera}return s(e,t),e.prototype.inject=function(t){return null!=t&&(this.scene=t),this.scene.add(this.root)},e.prototype.unject=function(){var t;return null!=(t=this.scene)?t.remove(this.root):void 0},e.prototype.add=function(t){return this.async?this.pending.push(t):this._add(t)},e.prototype.remove=function(t){return this.pending=this.pending.filter(function(e){return e!==t}),null!=t.parent?this._remove(t):void 0},e.prototype._add=function(t){return this.root.add(t)},e.prototype._remove=function(t){return this.root.remove(t)},e.prototype.dispose=function(){return null!=this.root.parent?this.unject():void 0},e.prototype.warmup=function(t){return this.async=+t||0},e.prototype.render=function(){var t,e,n,r,i,o,s;if(this.pending.length){for(e=this.root.children,t=[],n=r=0,o=this.async;(o>=0?o>r:r>o)&&(i=this.pending.shift(),i);n=o>=0?++r:--r)this._add(i),t.push(t);return s=e.map(function(t){var e;return e=t.visible}),e.map(function(e){return e.visible=u.call(t,e)<0}),this.renderer.render(this.scene,this.camera,this.scratch),e.map(function(t,e){return t.visible=s[e]})}},e.prototype.toJSON=function(){return this.root.toJSON()},e}(i),e.exports=o},{"./renderable":161}],163:[function(t,e,n){var r,i;i=t("../../vendor/shadergraph/src"),r=function(t){var e;return e=function(e){var n,r,i,o,s;if(o=t[e],null!=o)return o;if(r="#"===(i=e[0])||"."===i||":"===i||"["===i,s=r?e:"#"+e,n=document.querySelector(s),null!=n&&"SCRIPT"===n.tagName)return n.textContent||n.innerText;throw new Error("Unknown shader `"+e+"`")},new i(e,{autoInspect:!0})},e.exports=r},{"../../vendor/shadergraph/src":208}],164:[function(t,e,n){n.Factory=t("./factory"),n.Snippets=t("../../build/shaders")},{"../../build/shaders":1,"./factory":163}],165:[function(t,e,n){THREE.Bootstrap.registerPlugin("splash",{defaults:{color:"mono",fancy:!0},listen:["ready","mathbox/init:init","mathbox/progress:progress","mathbox/destroy:destroy"],uninstall:function(){return this.destroy()},ready:function(t,e){return e.MathBox&&!this.div?init(t,e):void 0},init:function(t,e){var n,r,i,o,s,a,u;return this.destroy(),n=this.options.color,i='',this.div=r=document.createElement("div"),r.innerHTML=i,e.element.appendChild(r),s=2*Math.random()-1,a=2*Math.random()-1,u=2*Math.random()-1,o=1/Math.sqrt(s*s+a*a+u*u),this.loader=r.querySelector(".mathbox-loader"),this.bar=r.querySelector(".mathbox-progress > div"),this.gyro=r.querySelectorAll(".mathbox-logo > div"),this.transforms=["rotateZ(22deg) rotateX(24deg) rotateY(30deg)","rotateZ(11deg) rotateX(12deg) rotateY(15deg) scale3d(.6, .6, .6)"],this.random=[s*o,a*o,u*o],this.start=e.Time.now,this.timer=null},progress:function(t,e){var n,r,i,o,s,a,u,h,l,c,p,f,d,m;if(this.div&&(n=t.current,p=t.total,f=p>n,clearTimeout(this.timer),f?(this.loader.classList.remove("mathbox-exit"),this.loader.style.display="block"):(this.loader.classList.add("mathbox-exit"),this.timer=setTimeout(function(t){return function(){return t.loader.style.display="none"}}(this),150)),m=p>n?.1*Math.round(1e3*n/p)+"%":"100%",this.bar.style.width=m,this.options.fancy)){for(d=this.random,i=Math.max(0,Math.min(1,e.Time.now-this.start)),s=function(t,n){return null==n&&(n=0),t.replace(/(-?[0-9.e]+)deg/g,function(t,r){return+r+d[n++]*i*e.Time.step*60+"deg"})},h=this.gyro,l=[],o=a=0,u=h.length;u>a;o=++a)r=h[o],this.transforms[o]=c=s(this.transforms[o]),l.push(r.style.transform=r.style.WebkitTransform=c);return l}},destroy:function(){var t;return null!=(t=this.div)&&t.remove(),this.div=null}})},{}],166:[function(t,e,n){var r,i,o;o=t("../util").Ease,i=function(){function t(t){this.context=t,this.anims=[]}return t.prototype.make=function(t,e){var n;return n=new r(this,this.context.time,t,e),this.anims.push(n),n},t.prototype.unmake=function(t){var e;return this.anims=function(){var n,r,i,o;for(i=this.anims,o=[],n=0,r=i.length;r>n;n++)e=i[n],e!==t&&o.push(e);return o}.call(this)},t.prototype.update=function(){var t,e;return e=this.context.time,this.anims=function(){var n,r,i,o;for(i=this.anims,o=[],n=0,r=i.length;r>n;n++)t=i[n],t.update(e)!==!1&&o.push(t);return o}.call(this)},t.prototype.lerp=function(t,e,n,r,i){var o,s,a,u;if(null==i&&(i=t.make()),t.lerp)i=t.lerp(e,n,i,r);else if(t.emitter){if(s=e.emitterFrom,u=n.emitterTo,null!=s&&null!=u&&s===u)return s.lerp(r),s;o=t.emitter(e,n),e.emitterFrom=o,n.emitterTo=o}else t.op?(a=function(t,e){return t===+t&&e===+e?t+(e-t)*r:r>.5?e:t},i=t.op(e,n,i,a)):i=r>.5?n:e;return i},t}(),r=function(){function t(t,e,n,r){this.animator=t,this.time=e,this.type=n,this.options=r,this.value=this.type.make(),this.target=this.type.make(),this.queue=[]}return t.prototype.dispose=function(){return this.animator.unmake(this)},t.prototype.set=function(){var t,e,n;return e=this.target,n=arguments.length>1?[].slice.call(arguments):arguments[0],t=!1,n=this.type.validate(n,e,function(){return t=!0}),t||(e=n),this.cancel(),this.target=this.value,this.value=e,this.notify()},t.prototype.getTime=function(){var t,e;return t=this.options.clock,e=t?t.getTime():this.time,this.options.realtime?e.time:e.clock},t.prototype.cancel=function(t){var e,n,r,i,o,s;for(null==t&&(t=this.getTime()),o=this.queue,n=function(){var e,n,r;for(r=[],e=0,n=o.length;n>e;e++)s=o[e],s.end>=t&&r.push(s);return r}(),this.queue=function(){var e,n,r;for(r=[],e=0,n=o.length;n>e;e++)s=o[e],s.endr;r++)s=n[r],"function"==typeof s.complete&&s.complete(!1);"function"==typeof(e=this.options).complete&&e.complete(!1)},t.prototype.notify=function(){var t;return"function"==typeof(t=this.options).step?t.step(this.value):void 0},t.prototype.immediate=function(t,e){var n,r,i,o,s,a,u,h,l,c;return i=e.duration,r=e.delay,o=e.ease,h=e.step,n=e.complete,c=this.getTime(),u=c+r,s=u+i,a=!1,l=this.type.make(),t=this.type.validate(t,l,function(){return a=!0,null}),void 0!==t&&(l=t),this.cancel(u),this.queue.push({from:null,to:l,start:u,end:s,ease:o,step:h,complete:n})},t.prototype.update=function(t){var e,n,r,i,s,a,u,h,l,c,p,f,d,m,v,g;if(this.time=t,0===this.queue.length)return!0;for(r=this.getTime(),g=this.value,c=this.queue,e=!1;!e;){if(p=f=c[0],h=p.from,v=p.to,d=p.start,a=p.end,m=p.step,i=p.complete,s=p.ease,null==h&&(h=f.from=this.type.clone(this.value)),u=o.clamp((r-d)/Math.max(1e-5,a-d)||0,0,1),0===u)return;if(l=function(){switch(s){case"linear":case 0:return null;case"cosine":case 1:return o.cosine;case"binary":case 2:return o.binary;case"hold":case 3:return o.hold;default:return o.cosine}}(),null!=l&&(u=l(u)),e=1>u,g=e?this.animator.lerp(this.type,h,v,u,g):v,"function"==typeof m&&m(g),!e&&("function"==typeof i&&i(!0),"function"==typeof(n=this.options).complete&&n.complete(!0),c.shift(),0===c.length))break}return this.value=g,this.notify()},t}(),e.exports=i},{"../util":175}],167:[function(t,e,n){var r,i;i=t("../util"),r=function(){function t(t,e,n){var r,i,o,s,a,u,h,l,c,p;for(this._context=t,this._up=e,this._targets=n,l=this._context.controller.getRoot(),null==this._targets&&(this._targets=[l]),this.isRoot=1===this._targets.length&&this._targets[0]===l,this.isLeaf=1===this._targets.length&&null==this._targets[0].children,u=this._targets,r=i=0,s=u.length;s>i;r=++i)c=u[r],this[r]=c;for(this.length=this._targets.length,h=this._context.controller.getTypes(),o=0,a=h.length;a>o;o++)p=h[o],"root"!==p&&!function(t){return function(e){return t[e]=function(n,r){return t.add(e,n,r)}}}(this)(p)}return t.prototype.v2=function(){return this},t.prototype.select=function(t){var e;return e=this._context.model.select(t,this.isRoot?null:this._targets),this._push(e)},t.prototype.eq=function(t){return this._targets.length>t?this._push([this._targets[t]]):this._push([])},t.prototype.filter=function(t){var e;return"string"==typeof t&&(e=this._context.model._matcher(t),t=function(t){return e(t)}),this._push(this._targets.filter(t))},t.prototype.map=function(t){var e,n,r,i;for(i=[],e=n=0,r=this.length;r>=0?r>n:n>r;e=r>=0?++n:--n)i.push(t(this[e],e,this));return i},t.prototype.each=function(t){var e,n,r;for(e=n=0,r=this.length;r>=0?r>n:n>r;e=r>=0?++n:--n)t(this[e],e,this);return this},t.prototype.add=function(t,e,n){var r,i,o,s,a,u,h;if(r=this._context.controller,this.isLeaf)return this._pop().add(t,e,n);for(a=[],u=this._targets,i=0,o=u.length;o>i;i++)h=u[i],s=r.make(t,e,n),r.add(s,h),a.push(s);return this._push(a)},t.prototype.remove=function(t){var e,n,r,i;if(t)return this.select(t).remove();for(r=this._targets.slice().reverse(),e=0,n=r.length;n>e;e++)i=r[e],this._context.controller.remove(i);return this._pop()},t.prototype.set=function(t,e){var n,r,i,o;for(i=this._targets,n=0,r=i.length;r>n;n++)o=i[n],this._context.controller.set(o,t,e);return this},t.prototype.getAll=function(t){var e,n,r,i,o;for(r=this._targets,i=[],e=0,n=r.length;n>e;e++)o=r[e],i.push(this._context.controller.get(o,t));return i},t.prototype.get=function(t){var e;return null!=(e=this._targets[0])?e.get(t):void 0},t.prototype.evaluate=function(t,e){var n;return null!=(n=this._targets[0])?n.evaluate(t,e):void 0},t.prototype.bind=function(t,e){var n,r,i,o;for(i=this._targets,n=0,r=i.length;r>n;n++)o=i[n],this._context.controller.bind(o,t,e);return this},t.prototype.unbind=function(t){var e,n,r,i;for(r=this._targets,e=0,n=r.length;n>e;e++)i=r[e],this._context.controller.unbind(i,t);return this},t.prototype.end=function(){return(this.isLeaf?this._pop():this)._pop()},t.prototype._push=function(e){return new t(this._context,this,e);
-},t.prototype._pop=function(){var t;return null!=(t=this._up)?t:this},t.prototype._reset=function(){var t,e;return null!=(t=null!=(e=this._up)?e.reset():void 0)?t:this},t.prototype.map=function(t){return this._targets.map(t)},t.prototype.on=function(){var t;return t=arguments,this._targets.map(function(e){return e.on.apply(e,t)}),this},t.prototype.off=function(){var t;return t=arguments,this._targets.map(function(e){return e.on.apply(e,t)}),this},t.prototype.toString=function(){var t;return t=this._targets.map(function(t){return t.toString()}),this._targets.length>1?"["+t.join(", ")+"]":t[0]},t.prototype.toMarkup=function(){var t;return t=this._targets.map(function(t){return t.toMarkup()}),t.join("\n\n")},t.prototype.print=function(){return i.Pretty.print(this._targets.map(function(t){return t.toMarkup()}).join("\n\n")),this},t.prototype.debug=function(){var t,e,n,r,i,o,s,a;for(e=this.inspect(),console.log("Renderables: ",e.renderables),console.log("Renders: ",e.renders),console.log("Shaders: ",e.shaders),t=function(t){return t.constructor.toString().match("function +([^(]*)")[1]},a=[],o=e.shaders,n=0,r=o.length;r>n;n++)s=o[n],i=t(s.owner),a.push(i+" - Vertex"),a.push(s.vertex),a.push(i+" - Fragment"),a.push(s.fragment);return ShaderGraph.inspect(a)},t.prototype.inspect=function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m;for("boolean"==typeof e&&(n=e,e=null),null==n&&(n=!0),l=function(t){var e,n;return null!=(e=null!=(n=t.controller)?n.objects:void 0)?e:[]},c=d=function(t,n){var r,i,o,s;if(null==n&&(n=[]),(!e||t.traits.hash[e])&&n.push(l(t)),null!=t.children)for(s=t.children,i=0,o=s.length;o>i;i++)r=s[i],d(r,n);return n},i=function(t){return t=t.reduce(function(t,e){return t.concat(e)},[]),t=t.filter(function(e,n){return null!=e&&t.indexOf(e)===n})},h=function(t,e){var n;return n={},n.owner=t,n.geometry=e.geometry,n.material=e.material,n.vertex=e.material.vertexGraph,n.fragment=e.material.fragmentGraph,n},o={nodes:this._targets.slice(),renderables:[],renders:[],shaders:[]},p=this._targets,s=0,u=p.length;u>s;s++){m=p[s],n&&m.print(t,"info"),r={renderables:f=i(c(m)),renders:i(f.map(function(t){return t.renders})),shaders:i(f.map(function(t){var e;return null!=(e=t.renders)?e.map(function(e){return h(t,e)}):void 0}))};for(a in r)o[a]=o[a].concat(r[a])}return o},t}(),e.exports=r},{"../util":175}],168:[function(t,e,n){var r,i;i=t("../util"),r=function(){function t(t,e){this.model=t,this.primitives=e}return t.prototype.getRoot=function(){return this.model.getRoot()},t.prototype.getTypes=function(){return this.primitives.getTypes()},t.prototype.make=function(t,e,n){return this.primitives.make(t,e,n)},t.prototype.get=function(t,e){return t.get(e)},t.prototype.set=function(t,e,n){var r,i;try{return t.set(e,n)}catch(i){return r=i,t.print(null,"warn"),console.error(r)}},t.prototype.bind=function(t,e,n){var r,i;try{return t.bind(e,n)}catch(i){return r=i,t.print(null,"warn"),console.error(r)}},t.prototype.unbind=function(t,e){var n,r;try{return t.unbind(e)}catch(r){return n=r,t.print(null,"warn"),console.error(n)}},t.prototype.add=function(t,e){return null==e&&(e=this.model.getRoot()),e.add(t)},t.prototype.remove=function(t){var e;return e=t.parent,e?e.remove(t):void 0},t}(),e.exports=r},{"../util":175}],169:[function(t,e,n){n.Animator=t("./animator"),n.API=t("./api"),n.Controller=t("./controller")},{"./animator":166,"./api":167,"./controller":168}],170:[function(t,e,n){var r=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};n.setOrigin=function(t,e,n){var i,o,s,a;return+e===e&&(e=[e]),o=r.call(e,1)>=0?0:n.x,s=r.call(e,2)>=0?0:n.y,a=r.call(e,3)>=0?0:n.z,i=r.call(e,4)>=0?0:n.w,t.set(o,s,a,i)},n.addOrigin=function(){var t;return t=new THREE.Vector4,function(e,r,i){return n.setOrigin(t,r,i),e.add(t)}}(),n.setDimension=function(t,e){var n,r,i,o;return r=1===e?1:0,i=2===e?1:0,o=3===e?1:0,n=4===e?1:0,t.set(r,i,o,n)},n.setDimensionNormal=function(t,e){var n,r,i,o;return r=1===e?1:0,i=2===e?1:0,o=3===e?1:0,n=4===e?1:0,t.set(i,o+r,n,0)},n.recenterAxis=function(){var t;return t=[0,0],function(e,n,r,i){var o,s,a,u,h,l;return null==i&&(i=0),r>0&&(h=e,l=e+n,o=Math.max(Math.abs(h),Math.abs(l)),s=o*i,u=Math.min(h,l),a=Math.max(h,l),e=u+(-o+s-u)*r,n=a+(o+s-a)*r-e),t[0]=e,t[1]=n,t}}()},{}],171:[function(t,e,n){e.exports=self={bind:function(t,e){return function(n,r){r.__binds||(r.__binds=[]);var i=t;_.isArray(n)&&(i=n[0],n=n[1]);for(var o=/^([^.:]*(?:\.[^.:]+)*)?(?:\:(.*))?$/.exec(n),s=o[1].split(/\./g),a=s.pop(),u=o[2]||a,h=s.shift(),l={"this":r}[h]||e[h]||t[h]||i;l&&(n=s.shift());)l=l[n];if(l&&(l.on||l.addEventListener)){var c=function(e){r[u]&&r[u](e,t)};self._polyfill(l,["addEventListener","on"],function(t){l[t](a,c)});var p={target:l,name:a,callback:c};return r.__binds.push(p),c}throw"Cannot bind '"+n+"' in "+this.__name}},unbind:function(){return function(t){t.__binds&&(t.__binds.forEach(function(t){self._polyfill(t.target,["removeEventListener","off"],function(e){t.target[e](t.name,t.callback)})}.bind(this)),t.__binds=[])}},apply:function(t){THREE.EventDispatcher.prototype.apply(t),t.trigger=self._trigger,t.triggerOnce=self._triggerOnce,t.on=t.addEventListener,t.off=t.removeEventListener,t.dispatchEvent=t.trigger},_triggerOnce:function(t){this.trigger(t),this._listeners&&delete this._listeners[t.type]},_trigger:function(t){if(void 0!==this._listeners){var e=t.type,n=this._listeners[e];if(void 0!==n){n=n.slice();var r=n.length;t.target=this;for(var i=0;r>i;i++)n[i].call(this,t,this)}}},_polyfill:function(t,e,n){e.map(function(e){return t.method}),e.length&&n(e[0])}}},{}],172:[function(t,e,n){var r;n.getSizes=r=function(t){var e,n;for(n=[],e=t;"string"!=typeof e&&null!=(null!=e?e.length:void 0);)n.push(e.length),e=e[0];return n},n.getDimensions=function(t,e){var n,i,o,s,a,u,h,l,c,p,f,d,m,v,g;return null==e&&(e={}),a=e.items,n=e.channels,g=e.width,s=e.height,i=e.depth,o={},t&&t.length?(v=r(t),l=v.length,o.channels=1!==n&&v.length>1?v.pop():n,o.items=1!==a&&v.length>1?v.pop():a,o.width=1!==g&&v.length>1?v.pop():g,o.height=1!==s&&v.length>1?v.pop():s,o.depth=1!==i&&v.length>1?v.pop():i,u=l,1===n&&u++,1===a&&u>1&&u++,1===g&&u>2&&u++,1===s&&u>3&&u++,h=null!=(c=v.pop())?c:1,1>=u&&(h/=null!=(p=o.channels)?p:1),2>=u&&(h/=null!=(f=o.items)?f:1),3>=u&&(h/=null!=(d=o.width)?d:1),4>=u&&(h/=null!=(m=o.height)?m:1),h=Math.floor(h),null==o.width&&(o.width=h,h=1),null==o.height&&(o.height=h,h=1),null==o.depth&&(o.depth=h,h=1),o):{items:a,channels:n,width:null!=g?g:0,height:null!=s?s:0,depth:null!=i?i:0}},n.repeatCall=function(t,e){switch(e){case 0:return function(){return!0};case 1:return function(){return t()};case 2:return function(){return t(),t()};case 3:return function(){return t(),t(),t(),t()};case 4:return function(){return t(),t(),t(),t()};case 6:return function(){return t(),t(),t(),t(),t(),t()};case 8:return function(){return t(),t(),t(),t(),t(),t()}}},n.makeEmitter=function(t,e,n){var r,i,o,s;for(r=function(){switch(n){case 0:return function(){return!0};case 1:return function(e){return e(t())};case 2:return function(e){return e(t(),t())};case 3:return function(e){return e(t(),t(),t())};case 4:return function(e){return e(t(),t(),t(),t())};case 6:return function(e){return e(t(),t(),t(),t(),t(),t())};case 8:return function(e){return e(t(),t(),t(),t(),t(),t(),t(),t())}}}(),o=null;e>0;)i=Math.min(e,8),s=function(){switch(i){case 1:return function(t){return r(t)};case 2:return function(t){return r(t),r(t)};case 3:return function(t){return r(t),r(t),r(t)};case 4:return function(t){return r(t),r(t),r(t),r(t)};case 5:return function(t){return r(t),r(t),r(t),r(t),r(t)};case 6:return function(t){return r(t),r(t),r(t),r(t),r(t),r(t)};case 7:return function(t){return r(t),r(t),r(t),r(t),r(t),r(t),r(t)};case 8:return function(t){return r(t),r(t),r(t),r(t),r(t),r(t),r(t),r(t)}}}(),o=null!=o?function(t,e){return function(n){return t(n),e(n)}}(s,o):s,e-=i;return s=null!=o?o:function(){return!0},s.reset=t.reset,s.rebind=t.rebind,s},n.getThunk=function(t){var e,n,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S;switch(H=r(t),d=H.length,e=H.pop(),n=H.pop(),i=H.pop(),o=H.pop(),s=!1,d){case 0:S=function(){return 0},S.reset=function(){};break;case 1:h=0,S=function(){return t[h++]},S.reset=function(){return h=0};break;case 2:h=l=0,a=null!=(m=t[l])?m:[],S=function(){var n,r;return r=a[h++],h===e&&(h=0,l++,a=null!=(n=t[l])?n:[]),r},S.reset=function(){var e;h=l=0,a=null!=(e=t[l])?e:[]};break;case 3:h=l=c=0,R=null!=(v=t[c])?v:[],a=null!=(g=R[l])?g:[],S=function(){var r,i,o;return o=a[h++],h===e&&(h=0,l++,l===n&&(l=0,c++,R=null!=(r=t[c])?r:[]),a=null!=(i=R[l])?i:[]),o},S.reset=function(){var e,n;h=l=c=0,R=null!=(e=t[c])?e:[],a=null!=(n=R[l])?n:[]};break;case 4:h=l=c=p=0,M=null!=(E=t[p])?E:[],R=null!=(y=M[c])?y:[],a=null!=(_=R[l])?_:[],S=function(){var r,o,s,u;return u=a[h++],h===e&&(h=0,l++,l===n&&(l=0,c++,c===i&&(c=0,p++,M=null!=(r=t[p])?r:[]),R=null!=(o=M[c])?o:[]),a=null!=(s=R[l])?s:[]),u},S.reset=function(){var e,n,r;h=l=c=p=0,M=null!=(e=t[p])?e:[],R=null!=(n=M[c])?n:[],a=null!=(r=R[l])?r:[]};break;case 5:h=l=c=p=f=0,u=null!=(b=t[f])?b:[],M=null!=(T=u[p])?T:[],R=null!=(x=M[c])?x:[],a=null!=(w=R[l])?w:[],S=function(){var r,s,d,m,v;return v=a[h++],h===e&&(h=0,l++,l===n&&(l=0,c++,c===i&&(c=0,p++,p===o&&(p=0,f++,u=null!=(r=t[f])?r:[]),M=null!=(s=u[p])?s:[]),R=null!=(d=M[c])?d:[]),a=null!=(m=R[l])?m:[]),v},S.reset=function(){var e,n,r,i;h=l=c=p=f=0,u=null!=(e=t[f])?e:[],M=null!=(n=u[p])?n:[],R=null!=(r=M[c])?r:[],a=null!=(i=R[l])?i:[]}}return S.rebind=function(o){return t=o,H=r(t),H.length&&(e=H.pop()),H.length&&(n=H.pop()),H.length&&(i=H.pop()),H.length?o=H.pop():void 0},S},n.getStreamer=function(t,e,n,r){var i,o,s,a,u,h,l,c,p;return l=u=h=0,c=function(){return l=e*n*r,u=h=0},o=function(){return h},s=function(){return 0>=l-u},p=function(){switch(n){case 1:return function(t){u+=t,h+=t};case 2:return function(t){u+=2*t,h+=t};case 3:return function(t){u+=3*t,h+=t};case 4:return function(t){u+=4*t,h+=t}}}(),i=function(){switch(n){case 1:return function(e){e(t[u++]),++h};case 2:return function(e){e(t[u++],t[u++]),++h};case 3:return function(e){e(t[u++],t[u++],t[u++]),++h};case 4:return function(e){e(t[u++],t[u++],t[u++],t[u++]),++h}}}(),a=function(){switch(n){case 1:return function(e){t[u++]=e,++h};case 2:return function(e,n){t[u++]=e,t[u++]=n,++h};case 3:return function(e,n,r){t[u++]=e,t[u++]=n,t[u++]=r,++h};case 4:return function(e,n,r,i){t[u++]=e,t[u++]=n,t[u++]=r,t[u++]=i,++h}}}(),i.reset=c,a.reset=c,c(),{emit:a,consume:i,skip:p,count:o,done:s,reset:c}},n.getLerpEmitter=function(t,e){var n,r,i,o,s,a,u,h,l,c,p;return p=new Float32Array(4096),s=a=.5,u=h=l=c=0,r=function(t,e,n,r){return l++,p[u++]=t*s,p[u++]=e*s,p[u++]=n*s,p[u++]=r*s},i=function(t,e,n,r){return c++,p[h++]+=t*a,p[h++]+=e*a,p[h++]+=n*a,p[h++]+=r*a},n=Math.max(t.length,e.length),o=3>=n?function(n,o,s){var a,f,d,m,v,g;for(u=h=l=c=0,t(r,o,s),e(i,o,s),d=Math.min(l,c),f=0,g=[],a=m=0,v=d;v>=0?v>m:m>v;a=v>=0?++m:--m)g.push(n(p[f++],p[f++],p[f++],p[f++]));return g}:5>=n?function(n,o,s,a,f){var d,m,v,g,E,y;for(u=h=l=c=0,t(r,o,s,a,f),e(i,o,s,a,f),v=Math.min(l,c),m=0,y=[],d=g=0,E=v;E>=0?E>g:g>E;d=E>=0?++g:--g)y.push(n(p[m++],p[m++],p[m++],p[m++]));return y}:7>=n?function(n,o,s,a,f,d,m){var v,g,E,y,_;for(u=h=l=c=0,t(r,o,s,a,f,d,m),e(i,o,s,a,f,d,m),g=Math.min(l,c),v=0,_=[],m=E=0,y=g;y>=0?y>E:E>y;m=y>=0?++E:--E)_.push(n(p[v++],p[v++],p[v++],p[v++]));return _}:9>=n?function(n,o,s,a,f,d,m,v,g){var E,y,_,b;for(u=h=l=c=0,t(r,o,s,a,f,d,m,v,g),e(i,o,s,a,f,d,m,v,g),E=Math.min(l,c),g=0,b=[],v=y=0,_=E;_>=0?_>y:y>_;v=_>=0?++y:--y)b.push(n(p[g++],p[g++],p[g++],p[g++]));return b}:function(n,o,s,a,f,d,m,v,g,E,y){var _,b,T,x;for(u=h=0,t(r,o,s,a,f,d,m,v,g,E,y),e(i,o,s,a,f,d,m,v,g,E,y),_=Math.min(l,c),g=0,x=[],v=b=0,T=_;T>=0?T>b:b>T;v=T>=0?++b:--b)x.push(n(p[g++],p[g++],p[g++],p[g++]));return x},o.lerp=function(t){var e;return e=[1-t,t],s=e[0],a=e[1],e},o},n.getLerpThunk=function(t,e){var r,i,o,s,a,u;return i=n.getSizes(t).reduce(function(t,e){return t*e}),o=n.getSizes(e).reduce(function(t,e){return t*e}),r=Math.min(i,o),a=n.getThunk(t),u=n.getThunk(e),s=new Float32Array(r),s.lerp=function(t){var e,n,i,o;for(a.reset(),u.reset(),i=0,o=[];r>i;)e=a(),n=u(),o.push(s[i++]=e+(n-e)*t);return o},s}},{}],173:[function(t,e,n){var r,i;i=Math.PI,r={clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},cosine:function(t){return.5-.5*Math.cos(r.clamp(t,0,1)*i)},binary:function(t){return+(t>=.5)},hold:function(t){return+(t>=1)}},e.exports=r},{}],174:[function(t,e,n){var r,i,o,s,a,u=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};i="xyzw".split(""),r={0:-1,x:0,y:1,z:2,w:3},o=function(t){return t===""+t&&(t=t.split("")),t===+t&&(t=[t]),t},a=function(t){return t===+t&&(t="vec"+t),"vec1"===t&&(t="float"),t},s=function(t){return t=""+t,t.indexOf(".")<0?t+=".0":void 0},n.mapByte2FloatOffset=function(t){var e;return null==t&&(t=4),e=s(t),"vec4 float2ByteIndex(vec4 xyzw, out float channelIndex) {\n float relative = xyzw.w / "+e+";\n float w = floor(relative);\n channelIndex = (relative - w) * "+e+";\n return vec4(xyzw.xyz, w);\n}"},n.sample2DArray=function(t){var e,n;return n=function(t,e){var r,i;return t===e?i="return texture2D(dataTextures["+t+"], uv);":(r=Math.ceil(t+(e-t)/2),i="if (z < "+(r-.5)+") {\n "+n(t,r-1)+"\n}\nelse {\n "+n(r,e)+"\n}"),i=i.replace(/\n/g,"\n ")},e=n(0,t-1),"uniform sampler2D dataTextures["+t+"];\n\nvec4 sample2DArray(vec2 uv, float z) {\n "+e+"\n}"},n.binaryOperator=function(t,e,n){return t=a(t),null!=n?t+" binaryOperator("+t+" a) {\n return a "+e+" "+n+";\n}":t+" binaryOperator("+t+" a, "+t+" b) {\n return a "+e+" b;\n}"},n.extendVec=function(t,e,r){var i,o,u,h;return null==r&&(r=0),t>e?n.truncateVec(t,e):(o=e-t,t=a(t),e=a(e),r=s(r),u=function(){h=[];for(var t=0;o>=0?o>=t:t>=o;o>=0?t++:t--)h.push(t);return h}.apply(this).map(function(t){return t?r:"v"}),i=u.join(","),e+" extendVec("+t+" v) { return "+e+"("+i+"); }")},n.truncateVec=function(t,e){var r;return e>t?n.extendVec(t,e):(r="."+"xyzw".substr(0,e),t=a(t),e=a(e),e+" truncateVec("+t+" v) { return v"+r+"; }")},n.injectVec4=function(t){var e,n,i,s,a,u,h;for(h=["0.0","0.0","0.0","0.0"],t=o(t),t=t.map(function(t){return t===""+t?r[t]:t}),i=s=0,a=t.length;a>s;i=++s)n=t[i],h[n]=["a","b","c","d"][i];return u=h.slice(0,4).join(", "),e=["float a","float b","float c","float d"].slice(0,t.length),"vec4 inject("+e+") {\n return vec4("+u+");\n}"},n.swizzleVec4=function(t,e){var n,i;for(null==e&&(e=null),n=["0.0","xyzw.x","xyzw.y","xyzw.z","xyzw.w"],null==e&&(e=t.length),t=o(t),t=t.map(function(t){var e;return e=+t,u.call([0,1,2,3,4],e)>=0&&(t=+t),t===""+t&&(t=r[t]+1),n[t]});t.lengths;e=++s)u=t[e],l=i[e],n=r[u],c[n]="xyzw."+l;return h=c.join(", "),"vec4 invertSwizzle(vec4 xyzw) {\n return vec4("+h+");\n}"},n.identity=function(t){var e;return e=[].slice.call(arguments),e.length>1?(e=e.map(function(t,e){return["inout",t,String.fromCharCode(97+e)].join(" ")}),e=e.join(", "),"void identity("+e+") { }"):t+" identity("+t+" x) {\n return x;\n}"},n.constant=function(t,e){return t+" constant() {\n return "+e+";\n}"},n.toType=a},{}],175:[function(t,e,n){n.Axis=t("./axis"),n.Data=t("./data"),n.Ease=t("./ease"),n.GLSL=t("./glsl"),n.JS=t("./js"),n.Pretty=t("./pretty"),n.Three=t("./three"),n.Ticks=t("./ticks"),n.VDOM=t("./vdom")},{"./axis":170,"./data":172,"./ease":173,"./glsl":174,"./js":176,"./pretty":177,"./three":178,"./ticks":179,"./vdom":180}],176:[function(t,e,n){n.merge=function(){var t,e,n,r,i,o;for(o={},t=0,n=arguments.length;n>t;t++){r=arguments[t];for(e in r)i=r[e],o[e]=i}return o},n.clone=function(t){return JSON.parse(JSON.serialize(t))},n.parseQuoted=function(t){var e,n,r,i,o,s,a,u,h,l;for(e="",l=function(t){return t=t.replace(/\\/g,"")},a=function(t){return e.length&&s.push(l(e)),e=null!=t?t:""},t=t.split(/(?=(?:\\.|["' ,]))/g),u=!1,s=[],i=0,o=t.length;o>i;i++)switch(r=t[i],n=r[0],h=r.slice(1),n){case'"':case"'":if(u)u===n?(u=!1,a(h)):e+=r;else{if(""!==e)throw new Error("ParseError: String `"+t+"` does not contain comma-separated quoted tokens.");u=n,e+=h}break;case" ":case",":u?e+=r:a(h);break;default:e+=r}return a(),s}},{}],177:[function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E;r=5,i=1e-4,o=function(t,e){return Math.abs(t/e-Math.round(t/e))i?"-":"",i+=n):"1"!==n&&(i+=r?""+n:"*"+n),i+"/"+e},u=[{1:1},{1:1,"τ":2*Math.PI},{1:1,"π":Math.PI},{1:1,"τ":2*Math.PI,"π":Math.PI},{1:1,e:Math.E},{1:1,"τ":2*Math.PI,e:Math.E},{1:1,"π":Math.PI,e:Math.E},{1:1,"τ":2*Math.PI,"π":Math.PI,e:Math.E}],c=[[420,[2,3,5,7]],[88200,[2,3,5,7]],[60060,[2,3,5,7,11,13]],[861764,[2,17,19,23,29]],[65536,[2]],[1e6,[2,5]]],g=function(t){var e,n,o,a,p,f,d,m,v,g;return t&&(e=t.cache,o=t.compact,v=t.tau,d=t.pi,a=t.e,g=t.threshold,m=t.precision),o=+!!(null!=o?o:!0),v=+!!(null!=v?v:!0),d=+!!(null!=d?d:!0),a=+!!(null!=a?a:!0),e=+!!(null!=e?e:!0),g=+(null!=g?g:i),m=+(null!=m?m:r),p=v+2*d+4*a,n=p+g+m,f=e?{}:null,function(t){var e,n,i,a,d,m,v,g,E,y,_,b,T,x,w,R,H,M;if(null!=f){if(null!=(n=f[t]))return n;if(t===Math.round(t))return f[t]=""+t}w=""+t,e=w.length+w.indexOf(".")+2,b=function(t){var n;return n=t.length,e>=n?(w=""+t,e=n):void 0},H=u[p];for(g in H)if(d=H[g],s(t/d))b(""+l(t/d,1,g,o));else for(m=0,E=c.length;E>m;m++)if(M=c[m],a=M[0],_=M[1],x=t/d*a,s(x)){for(v=0,y=_.length;y>v;v++)for(R=_[v];s(T=x/R)&&s(i=a/R);)x=T,a=i;b(""+h(t/d,a,g,o));break}return(""+t).length>r&&b(""+t.toPrecision(r)),null!=f&&(f[t]=w),w}},E=function(t,e){return null==e&&(e="info"),t=v(t),console[e].apply(console,t)},v=function(t){var e,n,r,i,o,s,a,u;return a="color:rgb(128,0,128)",n="color:rgb(144,64,0)",s="color:rgb(0,0,192)",i="color:rgb(0,70,156)",u="color:inherit",o=!1,r=0,e=[],t=t.replace(/(\\[<={}> "'])|(=>|[<={}> "'])/g,function(t,h,l){var c;return(null!=h?h.length:void 0)?h:o&&'"'!==l&&"'"!==l?l:r&&'"'!==l&&"'"!==l&&"{"!==l&&"}"!==l?l:c=function(){switch(l){case"<":return e.push(a),"%c<";case">":return e.push(a),e.push(u),"%c>%c";case" ":return e.push(n)," %c";case"=":case"=>":return e.push(a),"%c"+l;case'"':case"'":return o=!o,o?(e.push(r?n:s),l+"%c"):(e.push(r?i:a),"%c"+l);case"{":return 0===r++?(e.push(i),"%c"+l):l;case"}":return 0===--r?(e.push(a),l+"%c"):l;default:return l}}()}),[t].concat(e)},m=function(t,e){return d(t,e,"=")},f=function(t,e){return d(t,e,"=>")},d=function(){var t;return t=g({compact:!1}),function(e,n,r){var i,o,s;return i=function(t){return t===""+ +t||t.match(/^[A-Za-z_][A-Za-z0-9]*$/)?t:JSON.stringify(t)},s=function(t){return t.match('\n*"')?t:"{"+t+"}"},o=function(e){var n,r;if(e instanceof Array)return"["+e.map(o).join(", ")+"]";switch(typeof e){case"string":return e.match("\n")?'"\n'+e+'"\n':'"'+e+'"';case"function":return e=""+e,e.match("\n"),e=e.replace(/^function (\([^)]+\))/,"$1 =>"),e=e.replace(/^(\([^)]+\)) =>\s*{\s*return\s*([^}]+)\s*;\s*}/,"$1 => $2");case"number":return t(e);default:return null!=e&&e!==!!e?null!=e._up?o(e.map(function(t){return t})):e.toMarkup?e.toString():"{"+function(){var t;t=[];for(n in e)r=e[n],e.hasOwnProperty(n)&&t.push(i(n)+": "+o(r));return t}().join(", ")+"}":""+JSON.stringify(e)}},[e,r,s(o(n))].join("")}}(),a=function(t){return t=t.replace(/&/g,"&"),t=t.replace(/",t=a(t),r=0,i=n.length;i>r;r++)e=n[r],t=t.replace(/%([a-z])/,function(t,e){var r;switch(r=n.shift(),e){case"c":return'';default:return a(r)}});return o+=t,o+=""},e.exports={markup:v,number:g,print:E,format:p,JSX:{prop:m,bind:f}}},{}],178:[function(t,e,n){n.paramToGL=function(t,e){return e===THREE.RepeatWrapping?t.REPEAT:e===THREE.ClampToEdgeWrapping?t.CLAMP_TO_EDGE:e===THREE.MirroredRepeatWrapping?t.MIRRORED_REPEAT:e===THREE.NearestFilter?t.NEAREST:e===THREE.NearestMipMapNearestFilter?t.NEAREST_MIPMAP_NEAREST:e===THREE.NearestMipMapLinearFilter?t.NEAREST_MIPMAP_LINEAR:e===THREE.LinearFilter?t.LINEAR:e===THREE.LinearMipMapNearestFilter?t.LINEAR_MIPMAP_NEAREST:e===THREE.LinearMipMapLinearFilter?t.LINEAR_MIPMAP_LINEAR:e===THREE.UnsignedByteType?t.UNSIGNED_BYTE:e===THREE.UnsignedShort4444Type?t.UNSIGNED_SHORT_4_4_4_4:e===THREE.UnsignedShort5551Type?t.UNSIGNED_SHORT_5_5_5_1:e===THREE.UnsignedShort565Type?t.UNSIGNED_SHORT_5_6_5:e===THREE.ByteType?t.BYTE:e===THREE.ShortType?t.SHORT:e===THREE.UnsignedShortType?t.UNSIGNED_SHORT:e===THREE.IntType?t.INT:e===THREE.UnsignedIntType?t.UNSIGNED_INT:e===THREE.FloatType?t.FLOAT:e===THREE.AlphaFormat?t.ALPHA:e===THREE.RGBFormat?t.RGB:e===THREE.RGBAFormat?t.RGBA:e===THREE.LuminanceFormat?t.LUMINANCE:e===THREE.LuminanceAlphaFormat?t.LUMINANCE_ALPHA:e===THREE.AddEquation?t.FUNC_ADD:e===THREE.SubtractEquation?t.FUNC_SUBTRACT:e===THREE.ReverseSubtractEquation?t.FUNC_REVERSE_SUBTRACT:e===THREE.ZeroFactor?t.ZERO:e===THREE.OneFactor?t.ONE:e===THREE.SrcColorFactor?t.SRC_COLOR:e===THREE.OneMinusSrcColorFactor?t.ONE_MINUS_SRC_COLOR:e===THREE.SrcAlphaFactor?t.SRC_ALPHA:e===THREE.OneMinusSrcAlphaFactor?t.ONE_MINUS_SRC_ALPHA:e===THREE.DstAlphaFactor?t.DST_ALPHA:e===THREE.OneMinusDstAlphaFactor?t.ONE_MINUS_DST_ALPHA:e===THREE.DstColorFactor?t.DST_COLOR:e===THREE.OneMinusDstColorFactor?t.ONE_MINUS_DST_COLOR:e===THREE.SrcAlphaSaturateFactor?t.SRC_ALPHA_SATURATE:0},n.paramToArrayStorage=function(t){switch(t){case THREE.UnsignedByteType:return Uint8Array;case THREE.ByteType:return Int8Array;case THREE.ShortType:return Int16Array;case THREE.UnsignedShortType:return Uint16Array;case THREE.IntType:return Int32Array;case THREE.UnsignedIntType:return Uint32Array;case THREE.FloatType:return Float32Array}},n.swizzleToEulerOrder=function(t){return t.map(function(t){return["","X","Y","Z"][t]}).join("")},n.transformComposer=function(){var t,e,r,i,o;return t=new THREE.Euler,r=new THREE.Quaternion,e=new THREE.Vector3,i=new THREE.Vector3,o=new THREE.Matrix4,function(s,a,u,h,l,c){return null==c&&(c="XYZ"),null!=a?(c instanceof Array&&(c=n.swizzleToEulerOrder(c)),t.setFromVector3(a,c),r.setFromEuler(t)):r.set(0,0,0,1),null!=u&&r.multiply(u),null!=s?e.copy(s):e.set(0,0,0),null!=h?i.copy(h):i.set(1,1,1),o.compose(e,r,i),null!=l&&o.multiplyMatrices(o,l),o}}},{}],179:[function(t,e,n){var r,i,o,s,a;o=function(t,e,n,r,i,o,s,a,u,h){var l,c,p,f,d,m,v,g,E,y;return null==h&&(h=!0),n||(n=10),r||(r=1),i||(i=10),o||(o=1),v=e-t,d=v/n,h?(r||(r=1),i||(i=10),m=r*Math.pow(i,Math.floor(Math.log(d/r)/Math.log(i))),p=i%2===0?[i/2,1,.5]:i%3===0?[i/3,1,1/3]:[1],E=function(){var t,e,n;for(n=[],t=0,e=p.length;e>t;t++)c=p[t],n.push(m*c);return n}(),l=1/0,g=E.reduce(function(t,e){var n;return c=e/d,n=Math.max(c,1/c),l>n?(l=n,e):t},m),g*=o,t=Math.ceil(t/g+ +!s)*g,e=(Math.floor(e/g)-+!a)*g,n=Math.ceil((e-t)/g),y=function(){var e,r,i;for(i=[],f=e=0,r=n;r>=0?r>=e:e>=r;f=r>=0?++e:--e)i.push(t+f*g);return i}(),u||(y=y.filter(function(t){return 0!==t})),y):(y=function(){var e,r,i;for(i=[],f=e=0,r=n;r>=0?r>=e:e>=r;f=r>=0?++e:--e)i.push(t+f*d);return i}(),s||y.shift(),a||y.pop(),u||(y=y.filter(function(t){return 0!==t})),y)},s=function(t,e,n,r,i,o,s,a,u,h){throw new Error("Log ticks not yet implemented.")},r=0,i=1,a=function(t,e,n,a,u,h,l,c,p,f,d){switch(t){case r:return o(e,n,a,u,h,l,c,p,f,d);case i:return s(e,n,a,u,h,l,c,p,f,d)}},n.make=a,n.linear=o,n.log=s},{}],180:[function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;for(r=[],l=0,i={},a=function(){return{id:l++,type:null,props:null,children:null,rendered:null,instance:null}},h=function(t){var e,n,i,o;for(t*=2,t=Math.max(0,r.length-t),o=[],e=n=0,i=t;i>=0?i>n:n>i;e=i>=0?++n:--n)o.push(r.push(a()));return o},u=function(t,e,n){var i;return i=r.length?r.pop():a(),i.type=null!=t?t:"div",i.props=null!=e?e:null,i.children=null!=n?n:null,i},g=function(t){var e,n,i,o;if(t.type&&(n=t.children,t.type=t.props=t.children=t.instance=null,r.push(t),null!=n))for(i=0,o=n.length;o>i;i++)e=n[i],g(e)},o=function(t,e,n,r,s){var a,h,l,c,p,f,d,v,g,E,T,x,w,R,H,M,S,k,A,C,P,L,z,O,D,F,U,B,N,V;if(null!=t){if(null==e)return m(t,r,s);if(t instanceof Node){if(F=t===e)return}else F=typeof t==typeof e&&null!==e&&null!==t&&t.type===e.type;if(F){if(t.instance=e.instance,B=(null!=(P=t.type)?P.isComponentClass:void 0)?t.type:i[t.type],A=null!=e?e.props:void 0,H=t.props,c=null!=(L=null!=e?e.children:void 0)?L:null,R=t.children,null!=H&&(H.children=R),null!=B){if(f=n._COMPONENT_DIRTY,null!=A!=(null!=H)&&(f=!0),c!==R&&(f=!0),null!=A&&null!=H){if(!f)for(E in A)H.hasOwnProperty(E)||(f=!0);if(!f)for(E in H)V=H[E],(C=A[E])!==V&&(f=!0)}if(f){p=e.instance,null==t.props&&(t.props={}),z=p.defaultProps;for(g in z)N=z[g],null==(a=t.props)[g]&&(a[g]=N);t.props.children=t.children,"function"==typeof p.willReceiveProps&&p.willReceiveProps(t.props),U=n._COMPONENT_FORCE||(null!=(O="function"==typeof p.shouldUpdate?p.shouldUpdate(t.props):void 0)?O:!0),U&&(M=p.getNextState(),"function"==typeof p.willUpdate&&p.willUpdate(t.props,M)),S=p.props,k=p.applyNextState(),p.props=t.props,p.children=t.children,U&&(t=t.rendered="function"==typeof p.render?p.render(u,t.props,t.children):void 0,o(t,e.rendered,n,r,s),"function"==typeof p.didUpdate&&p.didUpdate(S,k))}return}if(null!=A)for(E in A)H.hasOwnProperty(E)||b(n,E,A[E]);if(null!=H)for(E in H)V=H[E],(C=A[E])!==V&&"children"!==E&&y(n,E,V,C);if(null!=R)if("string"==(D=typeof R)||"number"===D)R!==c&&(n.textContent=R);else if(null!=R.type)o(R,c,n.childNodes[0],n,0);else if(l=n.childNodes,null!=c)for(d=v=0,x=R.length;x>v;d=++v)h=R[d],o(h,c[d],l[d],n,d);else for(d=T=0,w=R.length;w>T;d=++T)h=R[d],o(h,null,l[d],n,d);else null!=c&&(_(null,n),n.innerHTML="");return}return _(e.instance,n),n.remove(),m(t,r,s)}return null!=e?(_(e.instance,n),e.node.remove()):void 0},m=function(t,e,n){var r,o,s,a,h,l,c,p,f,d,v,g,E,_,b,T,x,w,R,H;if(null==n&&(n=0),w=(null!=(g=t.type)?g.isComponentClass:void 0)?t.type:i[t.type],t instanceof Node)v=t;else{if(null!=w){if(h=(null!=(E=t.type)?E.isComponentClass:void 0)?t.type:i[t.type],!h)return t=t.rendered=u("noscript"),v=m(t,e,n);t.instance=a=new h(e),null==t.props&&(t.props={}),_=a.defaultProps;for(p in _)R=_[p],null==(r=t.props)[p]&&(r[p]=R);return t.props.children=t.children,a.props=t.props,a.children=t.children,a.setState("function"==typeof a.getInitialState?a.getInitialState():void 0),"function"==typeof a.willMount&&a.willMount(),t=t.rendered="function"==typeof a.render?a.render(u,t.props,t.children):void 0,v=m(t,e,n),"function"==typeof a.didMount&&a.didMount(t),v._COMPONENT=a,v}if("string"==(b=typeof t)||"number"===b)v=document.createTextNode(t);else{v=document.createElement(t.type),T=t.props;for(f in T)H=T[f],y(v,f,H)}if(s=t.children,null!=s)if("string"==(x=typeof s)||"number"===x)v.textContent=s;else if(null!=s.type)m(s,v,0);else for(l=c=0,d=s.length;d>c;l=++c)o=s[l],m(o,v,l)}return e.insertBefore(v,e.childNodes[n]),v},_=function(t,e){var n,r,i,o,s,a;if(t){"function"==typeof t.willUnmount&&t.willUnmount();for(i in t)delete t[i]}for(s=e.childNodes,a=[],r=0,o=s.length;o>r;r++)n=s[r],_(n._COMPONENT,n),a.push(delete n._COMPONENT);return a},v=function(t){var e,n,r,i;if("undefined"==typeof document)return!0;if(null!=document.documentElement.style[t])return t;for(t=t[0].toUpperCase()+t.slice(1),i=["webkit","moz","ms","o"],e=0,n=i.length;n>e;e++)if(r=i[e],null!=document.documentElement.style[r+t])return r+t},d={},E=["transform"],c=0,f=E.length;f>c;c++)p=E[c],d[p]=v(p);y=function(t,e,n,r){var i,o,s;{if("style"!==e)return null!=t[e]?void(t[e]=n):void(t instanceof Node&&t.setAttribute(e,n));for(i in n)s=n[i],(null!=r?r[i]:void 0)!==s&&(t.style[null!=(o=d[i])?o:i]=s)}},b=function(t,e,n){var r,i,o;if("style"!==e)null!=t[e]&&(t[e]=void 0),t instanceof Node&&t.removeAttribute(e);else for(r in n)o=n[r],t.style[null!=(i=d[r])?i:r]=""},s=function(t){var e,n,r,i,o;r={willMount:"componentWillMount",didMount:"componentDidMount",willReceiveProps:"componentWillReceiveProps",shouldUpdate:"shouldComponentUpdate",willUpdate:"componentWillUpdate",didUpdate:"componentDidUpdate",willUnmount:"componentWillUnmount"};for(n in r)i=r[n],null==t[n]&&(t[n]=t[i]);return e=function(){function e(e,n,r,i){var o,s,a,u;this.props=null!=n?n:{},this.state=null!=r?r:null,this.children=null!=i?i:null,o=function(t,e){return"function"==typeof t?t.bind(e):t};for(s in t)u=t[s],this[s]=o(u,this);a=null,this.setState=function(t){null==a&&(a=t?null!=a?a:{}:null);for(s in t)u=t[s],a[s]=u;e._COMPONENT_DIRTY=!0},this.forceUpdate=function(){var t,n;for(e._COMPONENT_FORCE=e._COMPONENT_DIRTY=!0,t=e,n=[];t=t.parentNode;)t._COMPONENT?n.push(t._COMPONENT_FORCE=!0):n.push(void 0);return n},this.getNextState=function(){return a},this.applyNextState=function(){var t,n;return e._COMPONENT_FORCE=e._COMPONENT_DIRTY=!1,t=this.state,n=[null,a],a=n[0],this.state=n[1],t}}return e}(),e.isComponentClass=!0,e.prototype.defaultProps=null!=(o="function"==typeof t.getDefaultProps?t.getDefaultProps():void 0)?o:{},e},e.exports={element:u,recycle:g,apply:o,hint:h,Types:i,createClass:s}},{}],181:[function(t,e,n){var r;r=function(){function t(e,n){this.parent=null!=n?n:null,this.id=t.id(),this.nodes=[],e&&this.add(e)}return t.index=0,t.id=function(e){return++t.index},t.IN=0,t.OUT=1,t.prototype.inputs=function(){var t,e,n,r,i,o,s,a,u;for(e=[],a=this.nodes,t=0,r=a.length;r>t;t++)for(o=a[t],u=o.inputs,n=0,i=u.length;i>n;n++)s=u[n],null===s.input&&e.push(s);return e},t.prototype.outputs=function(){var t,e,n,r,i,o,s,a,u;for(s=[],a=this.nodes,t=0,n=a.length;n>t;t++)for(i=a[t],u=i.outputs,e=0,r=u.length;r>e;e++)o=u[e],0===o.output.length&&s.push(o);return s},t.prototype.getIn=function(t){var e;return function(){var n,r,i,o;for(i=this.inputs(),o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.getOut=function(t){var e;return function(){var n,r,i,o;for(i=this.outputs(),o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.add=function(t,e){var n,r,i;{if(!t.length){if(t.graph&&!e)throw new Error("Adding node to two graphs at once");return t.graph=this,this.nodes.push(t)}for(r=0,i=t.length;i>r;r++)n=t[r],this.add(n)}},t.prototype.remove=function(t,e){var n,r,i;{if(!t.length){if(t.graph!==this)throw new Error("Removing node from wrong graph.");return e||t.disconnect(),this.nodes.splice(this.nodes.indexOf(t),1),t.graph=null}for(r=0,i=t.length;i>r;r++)n=t[r],this.remove(n)}},t.prototype.adopt=function(t){var e,n,r;{if(!t.length)return t.graph.remove(t,!0),this.add(t,!0);for(n=0,r=t.length;r>n;n++)e=t[n],this.adopt(e)}},t}(),e.exports=r},{}],182:[function(t,e,n){n.Graph=t("./graph"),n.Node=t("./node"),n.Outlet=t("./outlet"),n.IN=n.Graph.IN,n.OUT=n.Graph.OUT},{"./graph":181,"./node":183,"./outlet":184}],183:[function(t,e,n){var r,i,o;r=t("./graph"),o=t("./outlet"),i=function(){function t(e,n){this.owner=e,this.graph=null,this.inputs=[],this.outputs=[],this.all=[],this.outlets=null,this.id=t.id(),this.setOutlets(n)}return t.index=0,t.id=function(e){return++t.index},t.prototype.getIn=function(t){var e;return function(){var n,r,i,o;for(i=this.inputs,o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.getOut=function(t){var e;return function(){var n,r,i,o;for(i=this.outputs,o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.get=function(t){return this.getIn(t)||this.getOut(t)},t.prototype.setOutlets=function(t){var e,n,r,i,s,a,u,h,l,c,p,f;if(null!=t){if(null==this.outlets){for(this.outlets={},r=0,u=t.length;u>r;r++)p=t[r],p instanceof o||(p=o.make(p)),this._add(p);return}for(n=function(t){return[t.name,t.inout,t.type].join("-")},c={},i=0,h=t.length;h>i;i++)p=t[i],
-c[n(p)]=!0;f=this.outlets;for(a in f)p=f[a],a=n(p),c[a]?c[a]=p:this._remove(p);for(s=0,l=t.length;l>s;s++)p=t[s],e=c[n(p)],e instanceof o?this._morph(e,p):(p instanceof o||(p=o.make(p)),this._add(p))}return this.outlets},t.prototype.connect=function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;for(d={},s={},b=function(t){return _+"/"+t.hint},m=t.inputs,a=0,l=m.length;l>a;a++)r=m[a],(n||!r.input)&&(_=r.type,o=b(r),s[o]||(s[o]=r),d[_]=f=d[_]||[],f.push(r));for(y=this.outputs,y=y.filter(function(t){return!(e&&t.output.length)}),v=y.slice(),u=0,c=v.length;c>u;u++)E=v[u],_=E.type,o=b(E),i=d[_],(r=s[o])&&(E.connect(r),delete s[o],i.splice(i.indexOf(r),1),y.splice(y.indexOf(E),1));if(!y.length)return this;for(g=y.slice(),h=0,p=g.length;p>h;h++)E=g[h],_=E.type,i=d[_],i&&i.length&&E.connect(i.shift());return this},t.prototype.disconnect=function(t){var e,n,r,i,o,s,a;for(s=this.inputs,e=0,r=s.length;r>e;e++)o=s[e],o.disconnect();for(a=this.outputs,n=0,i=a.length;i>n;n++)o=a[n],o.disconnect();return this},t.prototype._key=function(t){return[t.name,t.inout].join("-")},t.prototype._add=function(t){var e;if(e=this._key(t),t.node)throw new Error("Adding outlet to two nodes at once.");if(this.outlets[e])throw new Error("Adding two identical outlets to same node. ("+e+")");return t.node=this,t.inout===r.IN&&this.inputs.push(t),t.inout===r.OUT&&this.outputs.push(t),this.all.push(t),this.outlets[e]=t},t.prototype._morph=function(t,e){var n;return n=this._key(e),delete this.outlets[n],t.morph(e),n=this._key(e),this.outlets[n]=e},t.prototype._remove=function(t){var e,n;if(n=this._key(t),e=t.inout,t.node!==this)throw new Error("Removing outlet from wrong node.");return t.disconnect(),t.node=null,delete this.outlets[n],t.inout===r.IN&&this.inputs.splice(this.inputs.indexOf(t),1),t.inout===r.OUT&&this.outputs.splice(this.outputs.indexOf(t),1),this.all.splice(this.all.indexOf(t),1),this},t}(),e.exports=i},{"./graph":181,"./outlet":184}],184:[function(t,e,n){var r,i;r=t("./graph"),i=function(){function t(e,n,r,i,o,s){this.inout=e,this.name=n,this.hint=r,this.type=i,this.meta=null!=o?o:{},this.id=s,null==this.hint&&(this.hint=t.hint(this.name)),this.node=null,this.input=null,this.output=[],null==this.id&&(this.id=t.id(this.hint))}return t.make=function(e,n){var r,i,o,s;if(null==n&&(n={}),i=n,null!=e.meta){o=e.meta;for(r in o)s=o[r],i[r]=s}return new t(e.inout,e.name,e.hint,e.type,i)},t.index=0,t.id=function(e){return"_io_"+ ++t.index+"_"+e},t.hint=function(t){return t=t.replace(/^_io_[0-9]+_/,""),t=t.replace(/_i_o$/,""),t=t.replace(/(In|Out|Inout|InOut)$/,"")},t.prototype.morph=function(t){return this.inout=t.inout,this.name=t.name,this.hint=t.hint,this.type=t.type,this.meta=t.meta},t.prototype.dupe=function(e){var n;return null==e&&(e=this.id),n=t.make(this),n.name=e,n},t.prototype.connect=function(t){if(this.inout===r.IN&&t.inout===r.OUT)return t.connect(this);if(this.inout!==r.OUT||t.inout!==r.IN)throw new Error("Can only connect out to in.");if(t.input!==this)return t.disconnect(),t.input=this,this.output.push(t)},t.prototype.disconnect=function(t){var e,n,r,i;if(this.input&&this.input.disconnect(this),this.output.length){if(!t){for(i=this.output,e=0,r=i.length;r>e;e++)t=i[e],t.input=null;return this.output=[]}if(n=this.output.indexOf(t),n>=0)return this.output.splice(n,1),t.input=null}},t}(),e.exports=i},{"./graph":181}],185:[function(t,e,n){var r,i,o,s,a,u;i=t("../graph"),a=t("../linker").Program,o=t("../linker").Layout,u=!1,r=function(){function t(){var t;null==this.namespace&&(this.namespace=a.entry()),this.node=new i.Node(this,null!=(t="function"==typeof this.makeOutlets?this.makeOutlets():void 0)?t:{})}return t.previous=function(t){var e;return null!=(e=t.input)?e.node.owner:void 0},t.prototype.refresh=function(){var t;return this.node.setOutlets(null!=(t="function"==typeof this.makeOutlets?this.makeOutlets():void 0)?t:{})},t.prototype.clone=function(){return new t},t.prototype.compile=function(t,e){var n;return n=new a(t,null!=e?e:a.entry(),this.node.graph),this.call(n,0),n.assemble()},t.prototype.link=function(t,e){var n,r;return r=this.compile(t,e),n=new o(t,this.node.graph),this._include(r,n,0),this["export"](n,0),n.link(r)},t.prototype.call=function(t,e){},t.prototype.callback=function(t,e,n,r,i){},t.prototype["export"]=function(t,e){},t.prototype._info=function(t){var e,n,r;return r=null!=(e=null!=(n=this.node.owner.snippet)?n._name:void 0)?e:this.node.owner.namespace,null!=t?r+="."+t:void 0},t.prototype._outlet=function(t,e){var n;return n=i.Outlet.make(t,e),n.meta.def=t,n},t.prototype._call=function(t,e,n){return e.call(this.node,t,n)},t.prototype._require=function(t,e){return e.require(this.node,t)},t.prototype._inputs=function(e,n,r){var i,o,s,a,u,h,l;for(u=e.main.signature,l=[],o=0,s=u.length;s>o;o++)i=u[o],a=this.node.get(i.name),l.push(null!=(h=t.previous(a))?h.call(n,r+1):void 0);return l},t.prototype._callback=function(t,e,n,r,i,o){return e.callback(this.node,t,n,r,i,o)},t.prototype._include=function(t,e,n){return e.include(this.node,t,n)},t.prototype._link=function(e,n,r){var i,o,a,h,l,c,p,f,d,m,v,g;for(u&&console.log("block::_link",this.toString(),e.namespace),d=e.symbols,g=[],a=0,l=d.length;l>a;a++){if(h=d[a],o=e.externals[h],p=this.node.get(o.name),!p)throw new s("External not found on "+this._info(o.name));if(null==p.meta.child){for(m=[p,p,null],c=m[0],f=m[1],i=m[2];!i&&f;)v=[p.meta.parent,f],f=v[0],p=v[1];if(i=t.previous(p),!i)throw new s("Missing connection on "+this._info(o.name));u&&console.log("callback -> ",this.toString(),o.name,p),i.callback(n,r+1,h,o,p.input),g.push(null!=i?i["export"](n,r+1):void 0)}}return g},t.prototype._trace=function(e,n,r){var i,o,s,a,h,l,c;for(u&&console.log("block::_trace",this.toString(),e.namespace),h=e.main.signature,c=[],o=0,s=h.length;s>o;o++)i=h[o],a=this.node.get(i.name),c.push(null!=(l=t.previous(a))?l["export"](n,r+1):void 0);return c},t}(),s=function(t){var e;return e=new Error(t),e.name="OutletError",e},s.prototype=new Error,e.exports=r},{"../graph":205,"../linker":210}],186:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=t("./block"),i=function(t){function e(t){this.snippet=t,this.namespace=this.snippet.namespace,e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.clone=function(){return new e(this.snippet)},e.prototype.makeOutlets=function(){var t,e,n,r,i,o,s;return r=this.snippet.main.signature,e=this.snippet.externals,s=this.snippet.symbols,o=function(){var t,e,n;for(n=[],t=0,e=r.length;e>t;t++)i=r[t],n.push(this._outlet(i,{callback:!1}));return n}.call(this),t=function(){var t,r,i;for(i=[],t=0,r=s.length;r>t;t++)n=s[t],i.push(this._outlet(e[n],{callback:!0}));return i}.call(this),o.concat(t)},e.prototype.call=function(t,e){return this._call(this.snippet,t,e),this._inputs(this.snippet,t,e)},e.prototype["export"]=function(t,e){return t.visit(this.namespace,e)?(this._link(this.snippet,t,e),this._trace(this.snippet,t,e)):void 0},e}(r),e.exports=i},{"./block":185}],187:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;o=t("../graph"),r=t("./block"),i=function(t){function e(t){this.graph=t,e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.refresh=function(){return e.__super__.refresh.apply(this,arguments),delete this.subroutine},e.prototype.clone=function(){return new e(this.graph)},e.prototype.makeOutlets=function(){var t,e,n,r,i,s,a,u,h,l,c,p;for(this.make(),u=[],n=[],h=[],t=function(t){return function(t,e){var n,r;return t.meta.callback?t.inout===o.IN?(r=t.dupe(),null==(n=r.meta).child&&(n.child=t),t.meta.parent=r,u.push(r)):void 0:e.push(t.type)}}(this),l=this.graph.inputs(),e=0,i=l.length;i>e;e++)a=l[e],t(a,n);for(c=this.graph.outputs(),r=0,s=c.length;s>r;r++)a=c[r],t(a,h);return n=n.join(","),h=h.join(","),p="("+n+")("+h+")",u.push({name:"callback",type:p,inout:o.OUT,meta:{callback:!0,def:this.subroutine.main}}),u},e.prototype.make=function(){return this.subroutine=this.graph.compile(this.namespace)},e.prototype["export"]=function(t,e){return t.visit(this.namespace,e)?(this._link(this.subroutine,t,e),this.graph["export"](t,e)):void 0},e.prototype.call=function(t,e){return this._require(this.subroutine,t,e)},e.prototype.callback=function(t,e,n,r,i){return this._include(this.subroutine,t,e),this._callback(this.subroutine,t,e,n,r,i)},e}(r),e.exports=i},{"../graph":205,"./block":185}],188:[function(t,e,n){n.Block=t("./block"),n.Call=t("./call"),n.Callback=t("./callback"),n.Isolate=t("./isolate"),n.Join=t("./join")},{"./block":185,"./call":186,"./callback":187,"./isolate":189,"./join":190}],189:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=t("../graph"),r=t("./block"),o=function(t){function e(t){this.graph=t,e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.refresh=function(){return e.__super__.refresh.apply(this,arguments),delete this.subroutine},e.prototype.clone=function(){return new e(this.graph)},e.prototype.makeOutlets=function(){var t,e,n,r,o,s,a,u,h,l,c,p,f,d,m;for(this.make(),l=[],d={},e={},c=["inputs","outputs"],r=0,s=c.length;s>r;r++)for(m=c[r],p=this.graph[m](),o=0,a=p.length;a>o;o++)h=p[o],u=void 0,"return"!==(f=h.hint)&&"callback"!==f||h.inout!==i.OUT||(u=h.hint),null!=d[u]&&(u=void 0),n=h.dupe(u),null==(t=n.meta).child&&(t.child=h),h.meta.parent=n,null!=u&&(d[u]=!0),e[h.name]=n,l.push(n);return l},e.prototype.make=function(){return this.subroutine=this.graph.compile(this.namespace)},e.prototype.call=function(t,e){return this._call(this.subroutine,t,e),this._inputs(this.subroutine,t,e)},e.prototype["export"]=function(t,e){return t.visit(this.namespace,e)?(this._link(this.subroutine,t,e),this._trace(this.subroutine,t,e),this.graph["export"](t,e)):void 0},e.prototype.callback=function(t,e,n,r,i){return i=i.meta.child,i.node.owner.callback(t,e,n,r,i)},e}(r),e.exports=o},{"../graph":205,"./block":185}],190:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;r=t("./block"),i=function(t){function e(t){this.nodes=t,e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.clone=function(){return new e(this.nodes)},e.prototype.makeOutlets=function(){return[]},e.prototype.call=function(t,e){var n,r,i,o,s,a;for(s=this.nodes,a=[],r=0,i=s.length;i>r;r++)o=s[r],n=o.owner,a.push(n.call(t,e));return a},e.prototype["export"]=function(t,e){var n,r,i,o,s,a;for(s=this.nodes,a=[],r=0,i=s.length;i>r;r++)o=s[r],n=o.owner,a.push(n["export"](t,e));return a},e}(r),e.exports=i},{"./block":185}],191:[function(t,e,n){var r,i,o;o=t("./queue"),i=t("./hash"),r=function(t){var e,n;return e={},n=o(100),function(r){var o,s;return s=r.length>32?"##"+i(r).toString(16):r,o=n(s),null!=o&&delete e[o],null==e[s]&&(e[s]=t(r)),e[s].clone()}},e.exports=r},{"./hash":193,"./queue":197}],192:[function(t,e,n){var r,i,o,s,a;o=t("../graph").Graph,r=t("../block"),a=t("../visualize"),i=function(){function t(t,e,n){this.language=t,this.fetch=e,this.config=n,this.graph()}return t.prototype.pipe=function(e,n,r,i){return e instanceof t?this._concat(e):null!=e&&this._call(e,n,r,i),this},t.prototype.call=function(t,e,n,r){return this.pipe(t,e,n,r)},t.prototype.require=function(e,n,r,i){return e instanceof t?this._import(e):null!=e&&(this.callback(),this._call(e,n,r,i),this.end()),this},t.prototype["import"]=function(t,e,n,r){return this.require(t,e,n,r)},t.prototype.split=function(){return this._group("_combine",!0),this},t.prototype.fan=function(){return this._group("_combine",!1),this},t.prototype.isolate=function(){return this._group("_isolate"),this},t.prototype.callback=function(){return this._group("_callback"),this},t.prototype.next=function(){return this._next(),this},t.prototype.pass=function(){var t;return t=this._stack[2].end,this.end(),this._state.end=this._state.end.concat(t),this},t.prototype.end=function(){var t,e,n,r;return n=this._exit(),r=n[0],t=n[1],e=r.op,this[e]&&this[e](r,t),this},t.prototype.join=function(){return this.end()},t.prototype.graph=function(){for(var t,e;(null!=(e=this._stack)?e.length:void 0)>1;)this.end();return this._graph&&this._tail(this._state,this._graph),t=this._graph,this._graph=new o,this._state=new s,this._stack=[this._state],t},t.prototype.compile=function(t){return null==t&&(t="main"),this.graph().compile(t)},t.prototype.link=function(t){return null==t&&(t="main"),this.graph().link(t)},t.prototype.serialize=function(){return a.serialize(this._graph)},t.prototype.empty=function(){return 0===this._graph.nodes.length},t.prototype._concat=function(t){var e,n,i;if(0===t._state.nodes.length)return this;this._tail(t._state,t._graph);try{e=new r.Isolate(t._graph)}catch(i){throw n=i,this.config.autoInspect&&a.inspect(n,this._graph,t),n}return this._auto(e),this},t.prototype._import=function(t){var e,n,i;if(0===t._state.nodes.length)throw"Can't import empty callback";this._tail(t._state,t._graph);try{e=new r.Callback(t._graph)}catch(i){throw n=i,this.config.autoInspect&&a.inspect(n,this._graph,t),n}return this._auto(e),this},t.prototype._combine=function(t,e){var n,r,i,o,s,a,u,h;for(a=t.start,r=0,o=a.length;o>r;r++)for(h=a[r],u=e.end,i=0,s=u.length;s>i;i++)n=u[i],n.connect(h,t.multi);return e.end=t.end,e.nodes=e.nodes.concat(t.nodes)},t.prototype._isolate=function(t,e){var n,i,o,s;if(t.nodes.length){s=this._subgraph(t),this._tail(t,s);try{n=new r.Isolate(s)}catch(o){throw i=o,this.config.autoInspect&&a.inspect(i,this._graph,s),i}return this._auto(n)}},t.prototype._callback=function(t,e){var n,i,o,s;if(t.nodes.length){s=this._subgraph(t),this._tail(t,s);try{n=new r.Callback(s)}catch(o){throw i=o,this.config.autoInspect&&a.inspect(i,this._graph,s),i}return this._auto(n)}},t.prototype._call=function(t,e,n,i){var o,s;return s=this.fetch(t),s.bind(this.config,e,n,i),o=new r.Call(s),this._auto(o)},t.prototype._subgraph=function(t){var e;return e=new o(null,this._graph),e.adopt(t.nodes),e},t.prototype._tail=function(t,e){var n;if(n=t.end.concat(t.tail),n=n.filter(function(t,e){return n.indexOf(t)===e}),n.length>1&&(n=new r.Join(n),n=[n.node],this._graph.add(n)),e.tail=n[0],t.end=n,t.tail=[],!e.tail)throw new Error("Cannot finalize empty graph");return e.compile=function(t){return function(n){var r,i;null==n&&(n="main");try{return e.tail.owner.compile(t.language,n)}catch(i){throw r=i,t.config.autoInspect&&e.inspect(r),r}}}(this),e.link=function(t){return function(n){var r,i;null==n&&(n="main");try{return e.tail.owner.link(t.language,n)}catch(i){throw r=i,t.config.autoInspect&&e.inspect(r),r}}}(this),e["export"]=function(t){return function(t,n){return e.tail.owner["export"](t,n)}}(this),e.inspect=function(t){return null==t&&(t=null),a.inspect(t,e)}},t.prototype._group=function(t,e){return this._push(t,e),this._push(),this},t.prototype._next=function(){var t;return t=this._pop(),this._state.start=this._state.start.concat(t.start),this._state.end=this._state.end.concat(t.end),this._state.nodes=this._state.nodes.concat(t.nodes),this._state.tail=this._state.tail.concat(t.tail),this._push()},t.prototype._exit=function(){return this._next(),this._pop(),[this._pop(),this._state]},t.prototype._push=function(t,e){return this._stack.unshift(new s(t,e)),this._state=this._stack[0]},t.prototype._pop=function(){var t;return this._state=this._stack[1],null==this._state&&(this._state=new s),null!=(t=this._stack.shift())?t:new s},t.prototype._auto=function(t){return t.node.inputs.length?this._append(t):this._insert(t)},t.prototype._append=function(t){var e,n,r,i,o;for(i=t.node,this._graph.add(i),o=this._state.end,n=0,r=o.length;r>n;n++)e=o[n],e.connect(i);return this._state.start.length||(this._state.start=[i]),this._state.end=[i],this._state.nodes.push(i),i.outputs.length?void 0:this._state.tail.push(i)},t.prototype._prepend=function(t){var e,n,r,i,o;for(r=t.node,this._graph.add(r),i=this._state.start,e=0,n=i.length;n>e;e++)o=i[e],r.connect(o);return this._state.end.length||(this._state.end=[r]),this._state.start=[r],this._state.nodes.push(r),r.outputs.length?void 0:this._state.tail.push(r)},t.prototype._insert=function(t){var e;return e=t.node,this._graph.add(e),this._state.start.push(e),this._state.end.push(e),this._state.nodes.push(e),e.outputs.length?void 0:this._state.tail.push(e)},t}(),s=function(){function t(t,e,n,r,i,o){this.op=null!=t?t:null,this.multi=null!=e?e:!1,this.start=null!=n?n:[],this.end=null!=r?r:[],this.nodes=null!=i?i:[],this.tail=null!=o?o:[]}return t}(),e.exports=i},{"../block":188,"../graph":205,"../visualize":216}],193:[function(t,e,n){var r,i,o,s,a,u,h,l;r=3432918353,i=461845907,o=3864292196,s=2246822507,a=3266489909,h=function(t,e){var n,r,i,o;return n=t>>>16&65535,r=65535&t,i=e>>>16&65535,o=65535&e,r*o+(n*o+r*i<<16>>>0)|0},null!=Math.imul&&(l=Math.imul(4294967295,5),-5===l&&(h=Math.imul)),u=function(t){var e,n,u,l,c,p;for(c=t.length,l=Math.floor(c/2),u=e=0,p=function(){return t.charCodeAt(u++)},n=function(t,n){var s;return s=t|n<<16,s^=s<<9,s=h(s,r),s=s<<15|s>>>17,s=h(s,i),e^=s,e=e<<13|e>>>19,e=h(e,5),e=e+o|0};l--;)n(p(),p());return 1&c&&n(p(),0),e^=c,e^=e>>>16,e=h(e,s),e^=e>>>13,e=h(e,a),e^=e>>>16},e.exports=u},{}],194:[function(t,e,n){n.Factory=t("./factory"),n.Material=t("./material"),n.library=t("./library"),n.cache=t("./cache"),n.queue=t("./queue"),n.hash=t("./hash")},{"./cache":191,"./factory":192,"./hash":193,"./library":195,"./material":196,"./queue":197}],195:[function(t,e,n){var r;r=function(t,e,n){var r,i,o,s;return r=null,s={},null!=e&&("function"==typeof e?r=function(r){return n(t,r,e(r))}:"object"==typeof e&&(r=function(r){if(null==e[r])throw new Error("Unknown snippet `"+r+"`");return n(t,r,e[r])})),o=function(e){return n(t,"",e)},null==r?o:(i=function(t){return t.match(/[{;]/)?o(t):(s[t]=!0,r(t))},i.used=function(t){return null==t&&(t=s),s=t},i)},e.exports=r},{}],196:[function(t,e,n){var r,i,o,s;o=!1,i=t("../visualize"),s=function(){var t;return t=+new Date,function(e){var n;return n=+new Date-t,console.log(e,n+" ms"),n}},r=function(){function t(t,e){this.vertex=t,this.fragment=e,o&&(this.tock=s())}return t.prototype.build=function(t){return this.link(t)},t.prototype.link=function(t){var e,n,r,s,a,u,h,l,c,p,f,d,m,v;for(null==t&&(t={}),f={},m={},e={},v=this.vertex.link("main"),n=this.fragment.link("main"),u=[v,n],r=0,a=u.length;a>r;r++){p=u[r],h=p.uniforms;for(s in h)d=h[s],f[s]=d;l=p.varyings;for(s in l)d=l[s],m[s]=d;c=p.attributes;for(s in c)d=c[s],e[s]=d}return t.vertexShader=v.code,t.vertexGraph=v.graph,t.fragmentShader=n.code,t.fragmentGraph=n.graph,t.attributes=e,t.uniforms=f,t.varyings=m,t.inspect=function(){return i.inspect("Vertex Shader",v,"Fragment Shader",n.graph)},o&&this.tock("Material build"),t},t.prototype.inspect=function(){return i.inspect("Vertex Shader",this.vertex,"Fragment Shader",this.fragment.graph)},t}(),e.exports=r},{"../visualize":216}],197:[function(t,e,n){var r;r=function(t){var e,n,r,i,o,s;return null==t&&(t=100),i={},r=null,s=null,n=0,e=function(t){return t.prev=null,t.next=r,null!=r&&(r.prev=t),r=t,null==s?s=t:void 0},o=function(t){var e,n;return n=t.prev,e=t.next,null!=n&&(n.next=e),null!=e&&(e.prev=n),r===t&&(r=e),s===t?s=n:void 0},function(a){var u,h;return(h=i[a]&&h!==r)?(o(h),e(h)):(n===t?(u=s.key,o(s),delete i[u]):n++,h={next:r,prev:null,key:a},e(h),i[a]=h),u}},e.exports=r},{}],198:[function(t,e,n){var r,i,o,s;r=function(t){var e,n,r,s,a;return n=t.ast,r=t.code,a=t.signatures,s=i(a),e=o(r,s),[a,e]},s=function(){var t;return t=+new Date,function(e){var n;return n=+new Date-t,console.log(e,n+" ms"),n}},i=function(t){var e,n,r,i,o,s,a,u,h,l;for(s={},h=function(t){return s[t.name]=!0},h(t.main),a=["external","internal","varying","uniform","attribute"],e=0,i=a.length;i>e;e++)for(r=a[e],u=t[r],n=0,o=u.length;o>n;n++)l=u[n],h(l);return s},o=function(t,e){var n,r;return r=new RegExp("\\b("+function(){var t;t=[];for(n in e)t.push(n);return t}().join("|")+")\\b","g"),t=t.replace(/\/\/[^\n]*/g,""),t=t.replace(/\/\*([^*]|\*[^\/])*\*\//g,""),function(i,o,s){var a,u,h,l;null==i&&(i=""),null==o&&(o={}),null==s&&(s={}),h={};for(n in e)h[n]=null!=o[n]?n:i+n;return a=t.replace(r,function(t){return h[t]}),u=function(){var t;t=[];for(n in s)l=s[n],t.push("#define "+n+" "+l);return t}(),u.length&&u.push(""),u.join("\n")+a}},e.exports=r},{}],199:[function(t,e,n){e.exports={SHADOW_ARG:"_i_o",RETURN_ARG:"return"}},{}],200:[function(t,e,n){var r,i,o,s,a,u,h;e.exports=i={},i["in"]=0,i.out=1,i.inout=2,s=function(t){return t.token.data},i.node=function(t){var e,n;return"function"===(null!=(e=t.children[5])?e.type:void 0)?i["function"](t):"keyword"===(null!=(n=t.token)?n.type:void 0)?i.external(t):void 0},i.external=function(t){var e,n,r,i,o,a,u,h,l,c,p,f,d;for(e=t.children,p=s(e[1]),f=s(e[3]),d=s(e[4]),a=e[5],"attribute"!==p&&"uniform"!==p&&"varying"!==p&&(p="global"),h=[],c=a.children,n=i=0,o=c.length;o>i;n=++i)e=c[n],"ident"===e.type&&(r=s(e),u=a.children[n+1],l="quantifier"===(null!=u?u.type:void 0),h.push({decl:"external",storage:p,type:d,ident:r,quant:!!l,count:l}));return h},i["function"]=function(t){var e,n,r,o,a,u,h,l,c,p;return r=t.children,l=s(r[1]),c=s(r[3]),p=s(r[4]),u=r[5],h=s(u.children[0]),e=u.children[1],n=u.children[2],a=function(){var t,n,r,s;for(r=e.children,s=[],t=0,n=r.length;n>t;t++)o=r[t],s.push(i.argument(o));return s}(),[{decl:"function",storage:l,type:p,ident:h,body:!!n,args:a}]},i.argument=function(t){var e,n,r,i,o,a,u,h;return e=t.children,u=s(e[1]),i=s(e[2]),h=s(e[4]),o=e[5],r=s(o.children[0]),a=o.children[1],n=a?a.children[0].token.data:void 0,{decl:"argument",storage:u,inout:i,type:h,ident:r,quant:!!a,count:n}},i.param=function(t,e,n,r,o){var s,a,u;return a=[],null!=e&&a.push(e),null!=n&&a.push(n),a.push(""),a=a.join(" "),u=r?"["+o+"]":"",""!==t&&(t+=" "),s=function(e,n){return(n?t:"")+(""+a+e+u)},s.split=function(t){return i.param(t,e,n,r,o)},s},h="undefined"!=typeof window,u=h&&!!window.THREE,o={"int":0,"float":0,vec2:u?THREE.Vector2:null,vec3:u?THREE.Vector3:null,vec4:u?THREE.Vector4:null,mat2:null,mat3:u?THREE.Matrix3:null,mat4:u?THREE.Matrix4:null,sampler2D:0,samplerCube:0},a={"int":"i","float":"f",vec2:"v2",vec3:"v3",vec4:"v4",mat2:"m2",mat3:"m3",mat4:"m4",sampler2D:"t",samplerCube:"t"},i.type=function(t,e,n,s,u,h){var l,c,p,f,d,m,v;return l={"in":i["in"],out:i.out,inout:i.inout},d={"const":"const"},m=a[e],n&&(m+="v"),v=o[e],(null!=v?v.call:void 0)&&(v=new v),n&&(v=[v]),c=null!=(f=l[u])?f:l["in"],h=d[h],p=i.param(u,h,e,n,s),new r(t,m,e,p,v,c)},r=function(){function t(t,e,n,r,i,o,s){this.name=t,this.type=e,this.spec=n,this.param=r,this.value=i,this.inout=o,this.meta=s}return t.prototype.split=function(){var e,n,r,o;return r=null!=this.meta.shadowed,e=r?"in":"out",n=r?i["in"]:i.out,o=this.param.split(e),new t(this.name,this.type,this.spec,o,this.value,n)},t.prototype.copy=function(e,n){var r;return r=new t(null!=e?e:this.name,this.type,this.spec,this.param,this.value,this.inout,n)},t}()},{}],201:[function(t,e,n){var r,i,o;i=t("../graph"),r=t("./constants"),e.exports=o={unshadow:function(t){var e;return e=t.replace(r.SHADOW_ARG,""),e!==t?e:null},lines:function(t){return t.join("\n")},list:function(t){return t.join(", ")},statements:function(t){return t.join(";\n")},body:function(t){return{entry:t,type:"void",params:[],signature:[],"return":"",vars:{},calls:[],post:[],chain:{}}},define:function(t,e){return"#define "+t+" "+e},"function":function(t,e,n,r,i){return t+" "+e+"("+n+") {\n"+r+i+"}"},invoke:function(t,e,n){return t=t?t+" = ":"",n=o.list(n)," "+t+e+"("+n+")"},same:function(t,e){var n,i,o,s,a;for(o=s=0,a=t.length;a>s;o=++s){if(n=t[o],i=e[o],!i)return!1;if(n.type!==i.type)return!1;if(n.name===r.RETURN_ARG!=(i.name===r.RETURN_ARG))return!1}return!0},call:function(t,e,n,i,s){var a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w;for(u=[],T="",x=1,f=0,d=i.length;d>f;f++){if(a=i[f],v=a.name,h=l=t(v),y=null,m=null,g=!1,c=a.inout,p=v===r.RETURN_ARG,(w=null!=(_=a.meta)?_.shadowed:void 0)&&(y=t(w),y&&(s.vars[y]=" "+a.param(y),s.calls.push(" "+y+" = "+l),e(w)?m={shadowed:y}:a=a.split())),(w=null!=(b=a.meta)?b.shadow:void 0)&&(y=t(w))){if(e(w)){m={shadow:y};continue}a=a.split(),g=!0}p?T=l:g||u.push(null!=y?y:l),e(v)?(E="push",p?""===s["return"]?(E="unshift",h=v,s.type=a.spec,s["return"]=" return "+l,s.vars[l]=" "+a.param(l)):(s.vars[l]=" "+a.param(l),s.params.push(a.param(l,!0))):s.params.push(a.param(l,!0)),a=a.copy(h,m),s.signature[E](a)):s.vars[l]=" "+a.param(l)}return s.calls.push(o.invoke(T,n,u))},build:function(t,e){var n,r,i,s,a,u,h,l,c,p,f;return a=t.entry,i=null,e&&1===e.length&&"main"!==a&&(n=t,r=e[0].module,o.same(t.signature,r.main.signature)&&(i=o.define(a,r.entry))),null==i&&(f=function(){var e,n;e=t.vars,n=[];for(p in e)s=e[p],n.push(s);return n}(),e=t.calls,h=t.post,u=t.params,c=t.type,l=t["return"],e=e.concat(h),""!==l&&e.push(l),e.push(""),f.length?(f.push(""),f=o.statements(f)+"\n"):f="",e=o.statements(e),u=o.list(u),i=o["function"](c,a,u,f,e)),{signature:t.signature,code:i,name:a}},links:function(t){var e,n,r,i;for(i={defs:[],bodies:[]},e=0,r=t.length;r>e;e++)n=t[e],o.link(n,i);return i.defs=o.lines(i.defs),i.bodies=o.statements(i.bodies),""===i.defs&&delete i.defs,""===i.bodies&&delete i.bodies,i},link:function(t){return function(t,e){var n,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S;if(y=t.module,b=t.name,l=t.external,g=y.main,h=y.entry,o.same(g.signature,l.signature))return e.defs.push(o.define(b,h));for(p=[],w=[],E={},M=[y.namespace,r.RETURN_ARG].join(""),R=l.signature,f=0,d=R.length;d>f;f++)u=R[f],v=u.inout===i.IN?p:w,v.push(u);for(H=g.signature,_=0,m=H.length;m>_;_++)u=H[_],v=u.inout===i.IN?p:w,T=v.shift(),a=T.name,a===r.RETURN_ARG&&(a=M),E[u.name]=a;return s=function(t){return E[t]},n=function(){return!0},c=o.body(),o.call(s,n,h,g.signature,c),c.entry=h,E={"return":M},s=function(t){var e;return null!=(e=E[t])?e:t},x=o.body(),S=o.call(s,n,h,l.signature,x),x.calls=c.calls,x.entry=b,e.bodies.push(o.build(c).code.split(" {")[0]),e.bodies.push(o.build(x).code)}}(this),defuse:function(t){var e,n,r,i,o,s,a,u,h,l,c,p,f,d,m;for(f=/([A-Za-z0-9_]+\s+)?[A-Za-z0-9_]+\s+[A-Za-z0-9_]+\s*\([^)]*\)\s*;\s*/gm,m=function(t){return t.replace(f,function(t){return""})},n=t.split(/(?=[{}])/g),l=0,o=a=0,u=n.length;u>a;o=++a){switch(e=n[o],e[0]){case"{":l++;break;case"}":l--}if(0===l){for(r=e.split(/^[ \t]*#/m),s=p=0,h=r.length;h>p;s=++p)c=r[s],s>0?(c=c.split(/\n/),i=c.shift(),d=c.join("\n"),r[s]=[i,m(d)].join("\n")):r[s]=m(c);n[o]=r.join("#")}}return t=n.join("")},dedupe:function(t){var e,n;return e={},n=/((attribute|uniform|varying)\s+)[A-Za-z0-9_]+\s+([A-Za-z0-9_]+)\s*(\[[^\]]*\]\s*)?;\s*/gm,t.replace(n,function(t,n,r,i,o){return e[i]?"":(e[i]=!0,t)})},hoist:function(t){var e,n,r,i,o,s,a,u;for(u=/^#define ([^ ]+ _pg_[0-9]+_|_pg_[0-9]+_ [^ ]+)$/,o=t.split(/\n/g),e=[],a=[],n=0,r=o.length;r>n;n++)i=o[n],s=i.match(u)?e:a,s.push(i);return e.concat(a).join("\n")}}},{"../graph":205,"./constants":199}],202:[function(t,e,n){var r,i,o,s,a;for(n.compile=t("./compile"),n.parse=t("./parse"),n.generate=t("./generate"),s=t("./constants"),a=r=0,o=s.length;o>r;a=++r)i=s[a],n[i]=a},{"./compile":198,"./constants":199,"./generate":201,"./parse":203}],203:[function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m,v;m=t("../../vendor/glsl-tokenizer"),c=t("../../vendor/glsl-parser"),s=t("./decl"),r=t("./constants"),o=!1,h=function(t,e){var n,r;return n=l(t,e),r=p(n,e)},l=function(t,e){var n,r,i,s,a,u,h,l,p,f,v;o&&(v=d());try{p=m().process(c(),e),f=p[0],n=f[0],a=p[1]}catch(s){r=s,a=[{message:r}]}if(o&&v("GLSL Tokenize & Parse"),u=function(t){var e,n;return t=t.split("\n"),e=(""+t.length).length,n=function(t){return(t=""+t).lengthh;h++)i=a[h],console.error(t+" -",i.message);throw new Error("GLSL parse error")}return n},p=function(t,e){var n,r,s,h,l,c,p;return o&&(p=d()),c=[],v(u,i(c),t,""),h=f(c),s=h[0],r=h[1],n=h[2],l=a(s,r,n),o&&p("GLSL AST"),{ast:t,code:e,signatures:l}},u=function(t,e){switch(t.type){case"decl":return e(s.node(t)),!1}return!0},i=function(t){return function(e){var n,r,i,o;if(null!=e){for(o=[],n=0,r=e.length;r>n;n++)i=e[n],o.push(t.push(i));return o}}},f=function(t){var e,n,r,i,o,s,a,u,h;for(a=null,i=[],n=[],u={},r=!1,o=0,s=t.length;s>o;o++)h=t[o],h.body?(u[h.ident]&&(n=function(){var t,r,i;for(i=[],t=0,r=n.length;r>t;t++)e=n[t],e.ident!==h.ident&&i.push(e);return i}(),delete u[h.ident]),i.push(h),"main"===h.ident?(a=h,r=!0):r||(a=h)):"global"===h.storage?i.push(h):(n.push(h),u[h.ident]=!0);return[a,i,n]},a=function(t,e,n){var i,o,a,u,h,l,c,p,f;for(p={uniform:[],attribute:[],varying:[],external:[],internal:[],global:[],main:null},o=function(t){return s.type(t.ident,t.type,t.quant,t.count,t.inout,t.storage)},a=function(t,e){var n,i,a,u,h,l,c,p,f,d,m;for(d=function(){var e,n,r,s;for(r=t.args,s=[],e=0,n=r.length;n>e;e++)i=r[e],s.push(o(i));return s}(),c=0,p=d.length;p>c;c++)u=d[c],u.inout===s.inout&&(n=u,a=u.copy(),n.inout=s["in"],a.inout=s.out,a.meta={shadow:n.name},a.name+=r.SHADOW_ARG,n.meta={shadowed:a.name},d.push(a));return"void"!==t.type&&d.unshift(s.type(r.RETURN_ARG,t.type,!1,"","out")),l=function(){var t,e,n;for(n=[],t=0,e=d.length;e>t;t++)u=d[t],u.inout===s["in"]&&n.push(u.type);return n}().join(","),f=function(){var t,e,n;for(n=[],t=0,e=d.length;e>t;t++)u=d[t],u.inout===s.out&&n.push(u.type);return n}().join(","),m="("+l+")("+f+")",h={name:t.ident,type:m,signature:d,inout:e,spec:t.type}},p.main=a(t,s.out),u=0,l=e.length;l>u;u++)f=e[u],p.internal.push({name:f.ident});for(h=0,c=n.length;c>h;h++)switch(f=n[h],f.decl){case"external":i=o(f),p[f.storage].push(i);break;case"function":i=a(f,s["in"]),p.external.push(i)}return p},o=!1,v=function(t,e,n,r){var i,s,a,u,h,l,c,p;if(o&&console.log(r,n.type,null!=(l=n.token)?l.data:void 0,null!=(c=n.token)?c.type:void 0),h=t(n,e))for(p=n.children,s=a=0,u=p.length;u>a;s=++a)i=p[s],v(t,e,i,r+" ",o);return null},d=function(){var t;return t=+new Date,function(e){var n;return n=+new Date-t,console.log(e,n+" ms"),n}},e.exports=v,e.exports=h},{"../../vendor/glsl-parser":219,"../../vendor/glsl-tokenizer":223,"./constants":199,"./decl":200}],204:[function(t,e,n){var r;r=function(){function t(e,n){this.parent=null!=n?n:null,this.id=t.id(),this.nodes=[],e&&this.add(e)}return t.index=0,t.id=function(e){return++t.index},t.IN=0,t.OUT=1,t.prototype.inputs=function(){var t,e,n,r,i,o,s,a,u;for(e=[],a=this.nodes,t=0,r=a.length;r>t;t++)for(o=a[t],u=o.inputs,n=0,i=u.length;i>n;n++)s=u[n],null===s.input&&e.push(s);return e},t.prototype.outputs=function(){var t,e,n,r,i,o,s,a,u;for(s=[],a=this.nodes,t=0,n=a.length;n>t;t++)for(i=a[t],u=i.outputs,e=0,r=u.length;r>e;e++)o=u[e],0===o.output.length&&s.push(o);return s},t.prototype.getIn=function(t){var e;return function(){var n,r,i,o;for(i=this.inputs(),o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.getOut=function(t){var e;return function(){var n,r,i,o;for(i=this.outputs(),o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.add=function(t,e){var n,r,i;{if(!t.length){if(t.graph&&!e)throw new Error("Adding node to two graphs at once");return t.graph=this,this.nodes.push(t)}for(r=0,i=t.length;i>r;r++)n=t[r],this.add(n)}},t.prototype.remove=function(t,e){var n,r,i;{if(!t.length){if(t.graph!==this)throw new Error("Removing node from wrong graph.");return e||t.disconnect(),this.nodes.splice(this.nodes.indexOf(t),1),t.graph=null}for(r=0,i=t.length;i>r;r++)n=t[r],this.remove(n)}
-},t.prototype.adopt=function(t){var e,n,r;{if(!t.length)return t.graph.remove(t,!0),this.add(t,!0);for(n=0,r=t.length;r>n;n++)e=t[n],this.adopt(e)}},t}(),e.exports=r},{}],205:[function(t,e,n){n.Graph=t("./graph"),n.Node=t("./node"),n.Outlet=t("./outlet"),n.IN=n.Graph.IN,n.OUT=n.Graph.OUT},{"./graph":204,"./node":206,"./outlet":207}],206:[function(t,e,n){var r,i,o;r=t("./graph"),o=t("./outlet"),i=function(){function t(e,n){this.owner=e,this.graph=null,this.inputs=[],this.outputs=[],this.all=[],this.outlets=null,this.id=t.id(),this.setOutlets(n)}return t.index=0,t.id=function(e){return++t.index},t.prototype.getIn=function(t){var e;return function(){var n,r,i,o;for(i=this.inputs,o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.getOut=function(t){var e;return function(){var n,r,i,o;for(i=this.outputs,o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.get=function(t){return this.getIn(t)||this.getOut(t)},t.prototype.setOutlets=function(t){var e,n,r,i,s,a,u,h,l,c,p,f;if(null!=t){if(null==this.outlets){for(this.outlets={},r=0,u=t.length;u>r;r++)p=t[r],p instanceof o||(p=o.make(p)),this._add(p);return}for(n=function(t){return[t.name,t.inout,t.type].join("-")},c={},i=0,h=t.length;h>i;i++)p=t[i],c[n(p)]=!0;f=this.outlets;for(a in f)p=f[a],a=n(p),c[a]?c[a]=p:this._remove(p);for(s=0,l=t.length;l>s;s++)p=t[s],e=c[n(p)],e instanceof o?this._morph(e,p):(p instanceof o||(p=o.make(p)),this._add(p))}return this.outlets},t.prototype.connect=function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;for(d={},s={},b=function(t){return _+"/"+t.hint},m=t.inputs,a=0,l=m.length;l>a;a++)r=m[a],(n||!r.input)&&(_=r.type,o=b(r),s[o]||(s[o]=r),d[_]=f=d[_]||[],f.push(r));for(y=this.outputs,y=y.filter(function(t){return!(e&&t.output.length)}),v=y.slice(),u=0,c=v.length;c>u;u++)E=v[u],_=E.type,o=b(E),i=d[_],(r=s[o])&&(E.connect(r),delete s[o],i.splice(i.indexOf(r),1),y.splice(y.indexOf(E),1));if(!y.length)return this;for(g=y.slice(),h=0,p=g.length;p>h;h++)E=g[h],_=E.type,i=d[_],i&&i.length&&E.connect(i.shift());return this},t.prototype.disconnect=function(t){var e,n,r,i,o,s,a;for(s=this.inputs,e=0,r=s.length;r>e;e++)o=s[e],o.disconnect();for(a=this.outputs,n=0,i=a.length;i>n;n++)o=a[n],o.disconnect();return this},t.prototype._key=function(t){return[t.name,t.inout].join("-")},t.prototype._add=function(t){var e;if(e=this._key(t),t.node)throw new Error("Adding outlet to two nodes at once.");if(this.outlets[e])throw new Error("Adding two identical outlets to same node. ("+e+")");return t.node=this,t.inout===r.IN&&this.inputs.push(t),t.inout===r.OUT&&this.outputs.push(t),this.all.push(t),this.outlets[e]=t},t.prototype._morph=function(t,e){var n;return n=this._key(e),delete this.outlets[n],t.morph(e),n=this._key(e),this.outlets[n]=e},t.prototype._remove=function(t){var e,n;if(n=this._key(t),e=t.inout,t.node!==this)throw new Error("Removing outlet from wrong node.");return t.disconnect(),t.node=null,delete this.outlets[n],t.inout===r.IN&&this.inputs.splice(this.inputs.indexOf(t),1),t.inout===r.OUT&&this.outputs.splice(this.outputs.indexOf(t),1),this.all.splice(this.all.indexOf(t),1),this},t}(),e.exports=i},{"./graph":204,"./outlet":207}],207:[function(t,e,n){var r,i;r=t("./graph"),i=function(){function t(e,n,r,i,o,s){this.inout=e,this.name=n,this.hint=r,this.type=i,this.meta=null!=o?o:{},this.id=s,null==this.hint&&(this.hint=t.hint(this.name)),this.node=null,this.input=null,this.output=[],null==this.id&&(this.id=t.id(this.hint))}return t.make=function(e,n){var r,i,o,s;if(null==n&&(n={}),i=n,null!=e.meta){o=e.meta;for(r in o)s=o[r],i[r]=s}return new t(e.inout,e.name,e.hint,e.type,i)},t.index=0,t.id=function(e){return"_io_"+ ++t.index+"_"+e},t.hint=function(t){return t=t.replace(/^_io_[0-9]+_/,""),t=t.replace(/_i_o$/,""),t=t.replace(/(In|Out|Inout|InOut)$/,"")},t.prototype.morph=function(t){return this.inout=t.inout,this.name=t.name,this.hint=t.hint,this.type=t.type,this.meta=t.meta},t.prototype.dupe=function(e){var n;return null==e&&(e=this.id),n=t.make(this),n.name=e,n},t.prototype.connect=function(t){if(this.inout===r.IN&&t.inout===r.OUT)return t.connect(this);if(this.inout!==r.OUT||t.inout!==r.IN)throw new Error("Can only connect out to in.");if(t.input!==this)return t.disconnect(),t.input=this,this.output.push(t)},t.prototype.disconnect=function(t){var e,n,r,i;if(this.input&&this.input.disconnect(this),this.output.length){if(!t){for(i=this.output,e=0,r=i.length;r>e;e++)t=i[e],t.input=null;return this.output=[]}if(n=this.output.indexOf(t),n>=0)return this.output.splice(n,1),t.input=null}},t}(),e.exports=i},{"./graph":204}],208:[function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m;r=t("./block"),i=t("./factory"),o=t("./glsl"),s=t("./graph"),a=t("./linker"),l=t("./visualize"),f=i.library,c=i.cache,m=l.visualize,p=l.inspect,h=a.Snippet,d=function(t,e){var n,r,i,o;null==e&&(e={}),r={};for(n in t)o=t[n],r[n]=null!=(i=e[n])?i:t[n];return r},u=function(){function t(e,n){var r;return this instanceof t?(r={globalUniforms:!1,globalVaryings:!0,globalAttributes:!0,globals:[],autoInspect:!1},this.config=d(r,n),void(this.fetch=c(f(o,e,h.load)))):new t(e,n)}return t.prototype.shader=function(t){var e;return null==t&&(t={}),e=d(this.config,t),new i.Factory(o,this.fetch,e)},t.prototype.material=function(t){return new i.Material(this.shader(t),this.shader(t))},t.prototype.inspect=function(e){return t.inspect(e)},t.prototype.visualize=function(e){return t.visualize(e)},t.Block=r,t.Factory=i,t.GLSL=o,t.Graph=s,t.Linker=a,t.Visualize=l,t.inspect=function(t){return p(t)},t.visualize=function(t){return m(t)},t}(),e.exports=u,"undefined"!=typeof window&&(window.ShaderGraph=u)},{"./block":188,"./factory":194,"./glsl":202,"./graph":205,"./linker":210,"./visualize":216}],209:[function(t,e,n){var r,i,o;r=t("../graph"),i=t("./priority"),o=function(t,e,n,o){var s,a,u,h,l,c,p,f,d,m,v,g,E,y;return h=t.generate,u={},g=[],E={},y={},a={},f={},m=function(){var t,r,s,c,p,d,m,_,b;for(d in o)m=o[d],v(m.node,m.module);return _=l(n),t=_[0],n=_[1],null!=e&&(t.entry=e),p=h.build(t,n),b=function(){var t;t=[];for(d in f)c=f[d],t.push(c);return t}().sort(function(t,e){return i.compare(t.priority,e.priority)}),s=b.map(function(t){return t.code}),s.push(p.code),r=h.lines(s),{namespace:p.name,library:f,body:p.code,code:r,main:p,entry:p.name,symbols:g,externals:u,uniforms:E,varyings:y,attributes:a}},l=function(t){return function(t){var e,n,r,i,o,s;for(t=function(){var e;e=[];for(s in t)n=t[s],e.push(n);return e}(),t.sort(function(t,e){return e.priority-t.priority}),r=function(t,n,r){var i,o,s,a;return c(t,n,r),a=n.main,s=n.entry,o=function(e){return d(t,e)},i=function(e){return p(t,e)},h.call(o,i,s,a.signature,e)},e=h.body(),i=0,o=t.length;o>i;i++)n=t[i],r(n.node,n.module,n.priority);return[e,t]}}(this),s=function(t,e,n){var r;return r=f[t],null!=r?r.priority=i.max(r.priority,n):f[t]={code:e,priority:n}},c=function(t,e,n){var r,o,u,h,l,c,p,f;n=i.make(n),l=e.library;for(h in l)u=l[h],s(h,u.code,i.nest(n,u.priority));s(e.namespace,e.body,n),c=e.uniforms;for(o in c)r=c[o],E[o]=r;p=e.varyings;for(o in p)r=p[o],y[o]=r;f=e.attributes;for(o in f)r=f[o],a[o]=r;return v(t,e)},v=function(t,e){var n,r,i,o,s,a,h,l,c;for(h=e.symbols,l=[],i=0,a=h.length;a>i;i++)if(s=h[i],r=e.externals[s],p(t,r.name)){n={};for(o in r)c=r[o],n[o]=c;n.name=d(t,r.name),u[s]=n,l.push(g.push(s))}else l.push(void 0);return l},p=function(t,e){var n;return n=t.get(e),n.inout===r.IN?null===n.input:n.inout===r.OUT?0===n.output.length:void 0},d=function(t,e){var n;return(n=t.get(e))?(n.input&&(n=n.input),e=n.name,n.id):null},m()},e.exports=o},{"../graph":205,"./priority":213}],210:[function(t,e,n){n.Snippet=t("./snippet"),n.Program=t("./program"),n.Layout=t("./layout"),n.assemble=t("./assemble"),n.link=t("./link"),n.priority=t("./priority"),n.load=n.Snippet.load},{"./assemble":209,"./layout":211,"./link":212,"./priority":213,"./program":214,"./snippet":215}],211:[function(t,e,n){var r,i,o,s;i=t("./snippet"),s=t("./link"),o=!1,r=function(){function t(t,e){this.language=t,this.graph=e,this.links=[],this.includes=[],this.modules={},this.visits={}}return t.prototype.callback=function(t,e,n,r,i){return this.links.push({node:t,module:e,priority:n,name:r,external:i})},t.prototype.include=function(t,e,n){var r;return null!=(r=this.modules[e.namespace])?r.priority=Math.max(n,r.priority):(this.modules[e.namespace]=!0,this.includes.push({node:t,module:e,priority:n}))},t.prototype.visit=function(t){return o&&console.log("Visit",t,!this.visits[t]),this.visits[t]?!1:this.visits[t]=!0},t.prototype.link=function(t){var e,n,r;e=s(this.language,this.links,this.includes,t),r=new i;for(n in e)r[n]=e[n];return r.graph=this.graph,r},t}(),e.exports=r},{"./link":212,"./snippet":215}],212:[function(t,e,n){var r,i,o;r=t("../graph"),i=t("./priority"),o=function(t,e,n,o){var s,a,u,h,l,c,p,f,d,m,v,g;return h=t.generate,c=[],m=[],u={},v={},a={},g={},f={},d=function(){var t,r,s,p,d,m,E,y,_,b;for(s=h.links(e),p=[],null!=s.defs&&p.push(s.defs),null!=s.bodies&&p.push(s.bodies),d=0,m=n.length;m>d;d++)y=n[d],l(y.node,y.module,y.priority);return b=function(){var t;t=[];for(_ in f)E=f[_],t.push(E);return t}().sort(function(t,e){return i.compare(t.priority,e.priority)}),c=b.map(function(t){return t.code}),t=h.lines(c),t=h.defuse(t),p.length&&(t=[h.lines(p),t].join("\n")),t=h.hoist(t),t=h.dedupe(t),r=o,{namespace:r.main.name,code:t,main:r.main,entry:r.main.name,externals:u,uniforms:v,attributes:a,varyings:g}},s=function(t,e,n){var r;return r=f[t],null!=r?r.priority=i.max(r.priority,n):f[t]={code:e,priority:n}},l=function(t,e,n){var r,o,h,l,c,f,d,E,y,_,b,T,x;n=i.make(n),E=e.library;for(d in E)f=E[d],s(d,f.code,i.nest(n,f.priority));s(e.namespace,e.body,n),y=e.uniforms;for(l in y)r=y[l],v[l]=r;_=e.varyings;for(l in _)r=_[l],g[l]=r;b=e.attributes;for(l in b)r=b[l],a[l]=r;for(T=e.symbols,x=[],h=0,c=T.length;c>h;h++)l=T[h],o=e.externals[l],p(t,o.name)?(u[l]=o,x.push(m.push(l))):x.push(void 0);return x},p=function(t,e){var n,i,o,s;if(i=t.get(e),!i)throw n=null!=(o=null!=(s=t.owner.snippet)?s._name:void 0)?o:t.owner.namespace,new Error("Unable to link program. Unlinked callback `"+e+"` on `"+n+"`");return i.inout===r.IN?null===i.input:i.inout===r.OUT?0===i.output.length:void 0},d()},e.exports=o},{"../graph":205,"./priority":213}],213:[function(t,e,n){n.make=function(t){var e;return null==t&&(t=[]),t instanceof Array||(t=[null!=(e=+t)?e:0]),t},n.nest=function(t,e){return t.concat(e)},n.compare=function(t,e){var n,r,i,o,s,a;for(i=Math.min(t.length,e.length),n=r=0,a=i;a>=0?a>r:r>a;n=a>=0?++r:--r){if(o=t[n],s=e[n],o>s)return-1;if(s>o)return 1}return t=t.length,e=e.length,t>e?-1:e>t?1:0},n.max=function(t,e){return n.compare(t,e)>0?e:t}},{}],214:[function(t,e,n){var r,i,o;i=t("./snippet"),o=t("./assemble"),r=function(){function t(t,e,n){this.language=t,this.namespace=e,this.graph=n,this.calls={},this.requires={}}return t.index=0,t.entry=function(){return"_pg_"+ ++t.index+"_"},t.prototype.call=function(t,e,n){var r,i;return i=e.namespace,(r=this.calls[i])?r.priority=Math.max(r.priority,n):this.calls[i]={node:t,module:e,priority:n},this},t.prototype.require=function(t,e){var n;return n=e.namespace,this.requires[n]={node:t,module:e}},t.prototype.assemble=function(){var e,n,r,s;e=o(this.language,null!=(r=this.namespace)?r:t.entry,this.calls,this.requires),s=new i;for(n in e)s[n]=e[n];return s.graph=this.graph,s},t}(),e.exports=r},{"./assemble":209,"./snippet":215}],215:[function(t,e,n){var r;r=function(){function t(t,e,n,r,i){var o;this.language=t,this._signatures=e,this._compiler=n,this._name=r,this._original=i,this.namespace=null,this.code=null,this.main=null,this.entry=null,this.uniforms=null,this.externals=null,this.symbols=null,this.attributes=null,this.varyings=null,this.language||delete this.language,this._signatures||delete this._signatures,this._compiler||delete this._compiler,this._original||delete this._original,this._name||(this._name=null!=(o=this._signatures)?o.main.name:void 0)}return t.index=0,t.namespace=function(){return"_sn_"+ ++t.index+"_"},t.load=function(e,n,r){var i,o,s,a;return o=e.parse(n,r),s=e.compile(o),a=s[0],i=s[1],new t(e,a,i,n,r)},t.prototype.clone=function(){return new t(this.language,this._signatures,this._compiler,this._name,this._original)},t.prototype.bind=function(e,n,r,i){var o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S,k,A,C,P,L,z,O,D,F,U,B,N,V,I,j,G;if(n===""+n?(L=[n,null!=r?r:{},null!=i?i:{}],r=L[0],n=L[1],i=L[2]):r!==""+r&&(z=[null!=r?r:{},void 0],i=z[0],r=z[1]),this.main=this._signatures.main,this.namespace=null!=(O=null!=r?r:this.namespace)?O:t.namespace(),this.entry=this.namespace+this.main.name,this.uniforms={},this.varyings={},this.attributes={},this.externals={},this.symbols=[],d={},f={},m=function(t){return f[t]=!0,t},M=function(t){return function(e){return t.namespace+e}}(this),e.globals)for(D=e.globals,v=0,b=D.length;b>v;v++)y=D[v],m(y);for(a=e.globalUniforms?m:M,u=e.globalVaryings?m:M,o=e.globalAttributes?m:M,s=M,G=function(t){return function(t){return d[t.name]=!0}}(this),I=function(t){return function(e,n){return t.uniforms[a(null!=n?n:e.name)]=e}}(this),j=function(t){return function(e){return t.varyings[u(e.name)]=e}}(this),h=function(t){return function(e){return t.attributes[o(e.name)]=e}}(this),p=function(t){return function(e){var n;return n=s(e.name),t.externals[n]=e,t.symbols.push(n)}}(this),P=function(t){return{type:t.type,name:t.name,value:t.value}},F=this._signatures.uniform,g=0,T=F.length;T>g;g++)l=F[g],G(l);for(U=this._signatures.uniform,_=0,x=U.length;x>_;_++)l=U[_],I(P(l));for(B=this._signatures.varying,S=0,w=B.length;w>S;S++)l=B[S],j(P(l));for(N=this._signatures.external,k=0,R=N.length;R>k;k++)l=N[k],p(l);for(V=this._signatures.attribute,C=0,H=V.length;H>C;C++)l=V[C],h(P(l));for(A in n)l=n[A],d[A]&&I(l,A);return this.body=this.code=this._compiler(this.namespace,f,i),i&&(c=function(){var t;t=[];for(E in i)j=i[E],t.push("#define "+E+" "+j);return t}().join("\n"),c.length&&(this._original=[c,"//----------------------------------------",this._original].join("\n"))),null},t}(),e.exports=r},{}],216:[function(t,e,n){var r,i,o,s,a,u;r=t("../Graph").Graph,n.serialize=a=t("./serialize"),n.markup=i=t("./markup"),u=function(t){var e;if(t)return t.nodes?(e=a(t),i.process(e)):t},s=function(t){return null==t?t:t instanceof Array?t.map(s):null!=t.vertex&&null!=t.fragment?[s(t.vertex,s(t.fragment))]:null!=t._graph?t._graph:null!=t.graph?t.graph:t},o=function(t){var e,n,r,i;for(i=[],n=0,r=t.length;r>n;n++)e=t[n],e instanceof Array?i=i.concat(o(e)):null!=e&&i.push(e);return i},n.visualize=function(){var t,e;return e=o(s([].slice.call(arguments))),i.merge(function(){var n,r,i;for(i=[],n=0,r=e.length;r>n;n++)t=e[n],t&&i.push(u(t));return i}())},n.inspect=function(){var t,e,r,o,s,a;for(t=n.visualize.apply(null,arguments),r=i.overlay(t),a=document.querySelectorAll(".shadergraph-overlay"),o=0,s=a.length;s>o;o++)e=a[o],e.remove();return document.body.appendChild(r),t.update(),r}},{"../Graph":182,"./markup":217,"./serialize":218}],217:[function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E;h=t("../factory/hash"),g=function(t){return(""+t).replace(/^\s+|\s+$/g,"")},a=function(t,e,n,r){return"rgba("+[t,e,n,r].join(", ")+")"},l=function(t,e){var n,r,i,o,s,u,l;return null==e&&(e=1),r=1193046^h(t),l=255&r,i=r>>>8&255,n=r>>>16&255,o=Math.max(l,i,n),u=140/o,s=Math.round(o/3),l=Math.min(255,Math.round(u*Math.max(l,s))),i=Math.min(255,Math.round(u*Math.max(i,s))),n=Math.min(255,Math.round(u*Math.max(n,s))),a(l,i,n,e)},u=function(t){return t=null!=t?t:"",t.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},m=function(t){var e,n;return n=[],e=i(t,n),e.update=function(){return s(e,n)},r(e),e},r=function(t){var e,n,r,i,o;for(n=t.querySelectorAll(".shadergraph-code"),o=[],r=0,i=n.length;i>r;r++)e=n[r],o.push(function(){var t;return t=e,t.parentNode.classList.add("shadergraph-has-code"),t.parentNode.addEventListener("click",function(e){return t.style.display={block:"none",none:"block"}[t.style.display||"none"]})}());return o},o=function(t){var e,n,r,i,o,s,a,u,h,l,c,p,f,d,m;for(c={},u={},f=t.nodes,e=0,i=f.length;i>e;e++)l=f[e],c[l.id]=l;for(d=t.links,n=0,o=d.length;o>n;n++)a=d[n],null==u[h=a.from]&&(u[h]=[]),u[a.from].push(a);for(p=function(t,e){var n,r,i,o;if(null==e&&(e=0),t.depth=Math.max(null!=(o=t.depth)?o:0,e),i=u[t.id])for(n=0,r=i.length;r>n;n++)a=i[n],p(c[a.to],e+1);return null},m=t.nodes,r=0,s=m.length;s>r;r++)l=m[r],null==l.depth&&p(l);return null},i=function(t,e){var n,r,s,a,h,c,p,f,d,m,v,E,y,_,b,T,x,w,R,H,M,S,k,A,C,P;for(o(t),P=document.createElement("div"),P.classList.add("shadergraph-graph"),c=[],M={},S=t.nodes,f=0,E=S.length;E>f;f++){for(R=S[f],r=document.createElement("div"),r.classList.add("shadergraph-node"),r.classList.add("shadergraph-node-"+R.type),r.innerHTML='",n=function(t,e){var n,i;return n=l(t.type),i=document.createElement("div"),i.classList.add("shadergraph-outlet"),i.classList.add("shadergraph-outlet-"+e),i.innerHTML='\n'+u(t.type)+'
\n'+u(t.name)+"
",r.appendChild(i),M[t.id]=i.querySelector(".shadergraph-point")},k=R.inputs,d=0,y=k.length;y>d;d++)H=k[d],n(H,"in");for(A=R.outputs,m=0,_=A.length;_>m;m++)H=A[m],n(H,"out");null!=R.graph?r.appendChild(i(R.graph,e)):(s=document.createElement("div"),s.classList.add("shadergraph-clear"),r.appendChild(s)),null!=R.code&&(p=document.createElement("div"),p.classList.add("shadergraph-code"),p.innerHTML=u(g(R.code)),r.appendChild(p)),h=c[R.depth],null==h&&(h=document.createElement("div"),h.classList.add("shadergraph-column"),c[R.depth]=h),h.appendChild(r)}for(v=0,b=c.length;b>v;v++)h=c[v],null!=h&&P.appendChild(h);for(C=t.links,w=0,T=C.length;T>w;w++)x=C[w],a=l(x.type),e.push({color:a,out:M[x.out],"in":M[x["in"]]});return P},v=function(t){return t*t},d=function(t,e,n,r){var i,o,s,a,u,h,l,c;return o=n-t,s=r-e,i=Math.sqrt(v(o)+v(s)),c=Math.abs(s)>Math.abs(o),c?(h=(t+n)/2,l=(e+r)/2,a=s>0?.3:-.3,u=Math.min(Math.abs(o)/2,20+i/8),["M",t,e,"C",t+u,e+",",h,l-i*a,h,l,"C",h,l+i*a,n-u,r+",",n,r].join(" ")):(u=Math.min(Math.abs(o)/2.5,20+i/4),["M",t,e,"C",t+u,e+",",n-u,r+",",n,r].join(" "))},c=function(t){return null==t&&(t="svg"),document.createElementNS("http://www.w3.org/2000/svg",t)},s=function(t,e){var n,r,i,o,s,a,u,h,l,p,f,m;if(null!=t.parentNode){for(f=t.getBoundingClientRect(),s=0,u=e.length;u>s;s++)p=e[s],n=p.out.getBoundingClientRect(),r=p["in"].getBoundingClientRect(),p.coords={x1:(n.left+n.right)/2-f.left,y1:(n.top+n.bottom)/2-f.top,x2:(r.left+r.right)/2-f.left,y2:(r.top+r.bottom)/2-f.top};for(m=t.querySelector("svg"),null!=m&&t.removeChild(m),i=t;i.parentNode&&0===i.offsetHeight;)i=i.parentNode;for(m=c(),m.setAttribute("width",i.offsetWidth),m.setAttribute("height",i.offsetHeight),a=0,h=e.length;h>a;a++)p=e[a],o=p.coords,l=c("path"),l.setAttribute("d",d(o.x1,o.y1,o.x2,o.y2)),l.setAttribute("stroke",p.color),l.setAttribute("stroke-width",3),l.setAttribute("fill","transparent"),m.appendChild(l);return t.appendChild(m)}},f=function(t){var e,n,r,i;return n=document.createElement("div"),n.setAttribute("class","shadergraph-overlay"),e=document.createElement("div"),e.setAttribute("class","shadergraph-close"),e.innerHTML="×",i=document.createElement("div"),i.setAttribute("class","shadergraph-view"),r=document.createElement("div"),r.setAttribute("class","shadergraph-inside"),r.appendChild(t),i.appendChild(r),n.appendChild(i),n.appendChild(e),e.addEventListener("click",function(){return n.parentNode.removeChild(n)}),n},E=function(t){var e;return t instanceof Node?t:(e=document.createElement("span"),e.innerText=null!=t?t:"",e)},p=function(t){var e,n,r,i;if(1!==t.length){for(e=document.createElement("div"),r=0,i=t.length;i>r;r++)n=t[r],e.appendChild(E(n));return e.update=function(){var e,r,i;for(i=[],e=0,r=t.length;r>e;e++)n=t[e],i.push("function"==typeof n.update?n.update():void 0);return i},e}return E(t[0])},e.exports={process:m,merge:p,overlay:f}},{"../factory/hash":193}],218:[function(t,e,n){var r,i,o;r=t("../block"),i=function(t){return"("===t.type[0]},o=function(t){var e,n,i,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R;for(v=[],d=[],b=t.nodes,i=0,l=b.length;l>i;i++){for(m=b[i],_={id:m.id,name:null,type:null,depth:null,graph:null,inputs:[],outputs:[]},v.push(_),s=_.inputs,y=_.outputs,e=m.owner,e instanceof r.Call?(_.name=e.snippet._name,_.type="call",_.code=e.snippet._original):e instanceof r.Callback?(_.name="Callback",_.type="callback",_.graph=o(e.graph)):e instanceof r.Isolate?(_.name="Isolate",_.type="isolate",_.graph=o(e.graph)):e instanceof r.Join?(_.name="Join",_.type="join"):null!=e&&(null==_.name&&(_.name=null!=(T=e.name)?T:e.type),null==_.type&&(_.type=e.type),null==_.code&&(_.code=e.code),null!=e.graph&&(_.graph=o(e.graph))),n=function(t){return t=t.replace(")(",")→("),t=t.replace("()","")},x=m.inputs,a=0,c=x.length;c>a;a++)E=x[a],s.push({id:E.id,name:E.name,type:n(E.type),open:null==E.input});for(w=m.outputs,u=0,p=w.length;p>u;u++)for(E=w[u],y.push({id:E.id,name:E.name,type:n(E.type),open:!E.output.length}),R=E.output,h=0,f=R.length;f>h;h++)g=R[h],d.push({from:m.id,out:E.id,to:g.node.id,"in":g.id,type:n(E.type)})}return{nodes:v,links:d}},e.exports=o},{"../block":188}],219:[function(t,e,n){e.exports=t("./lib/index")},{"./lib/index":221}],220:[function(t,e,n){function r(){return this}function i(t,e){var n=E[t];return e=e||0,n?e>n.lbp&&(n.lbp=e):(n=Object.create(g),n.id=t,n.lbp=e,E[t]=n),n}function o(t){var e,n=d;for(c(),e=n.nud();t=m.length)return void(d=E["(end)"]);if(e=m[v++],n=e.data,i=e.type,"ident"===i)o=f.scope.find(n)||f.create_node(),i=o.type;else if("builtin"===i)o=E["(builtin)"];else if("keyword"===i)o=E["(keyword)"];else if("operator"===i){if(o=E[n],!o)return f.unexpected("unknown operator `"+n+"`")}else{if("float"!==i&&"integer"!==i)return f.unexpected("unexpected token.");i="literal",o=E["(literal)"]}return o&&(o.nud||(o.nud=r),o.children||(o.children=[])),o=Object.create(o),o.token=e,o.type=i,o.data||(o.data=n),d=o}function p(t){return function(){return f.unexpected(t)}}var f,d,m,v,g={nud:function(){return this.children&&this.children.length?this:p("unexpected")()},led:p("missing operator")},E={};i("(ident)").nud=r,i("(keyword)").nud=r,i("(builtin)").nud=r,i("(literal)").nud=r,i("(end)"),i(":"),i(";"),i(","),i(")"),i("]"),i("}"),a("&&",30),a("||",30),s("|",43),s("^",44),s("&",45),s("==",46),s("!=",46),s("<",47),s("<=",47),s(">",47),s(">=",47),s(">>",48),s("<<",48),s("+",50),s("-",50),s("*",60),s("/",60),s("%",60),s("?",20,function(t){return this.children=[t,o(0),(c(":"),o(0))],this.type="ternary",this}),s(".",80,function(t){return d.type="literal",f.fake(d),this.children=[t,d],c(),this}),s("[",80,function(t){return this.children=[t,o(0)],this.type="binary",c("]"),this}),s("(",80,function(t){if(this.children=[t],this.type="call",")"!==d.data)for(;;){if(this.children.push(o(0)),","!==d.data)break;c(",")}return c(")"),this}),u("-"),u("+"),u("!"),u("~"),u("defined"),u("(",function(){return this.type="group",this.children=[o(0)],c(")"),this}),u("++"),u("--"),h("++"),h("--"),l("="),l("+="),l("-="),l("*="),l("/="),l("%="),l("&="),l("|="),l("^="),l(">>="),l("<<="),e.exports=function(t,e){function n(t){f.unshift(t,!1);for(var e=0,r=t.children.length;r>e;++e)n(t.children[e]);f.shift()}f=t,m=e,v=0;var r;if(m.length){if(c(),r=o(0),r.parent=f[0],n(r),v1?void ht("unexpected EOF"):void qt.emit("end")}function n(){return Qt||!Yt.length?!1:(Ct=Zt[0])&&!qt.paused}function r(t){Yt.unshift(t),Yt.shift()}function f(t,e){t.parent=Yt[0];var n=[].unshift.call(this,t);if(e=void 0===e?!0:e,p){for(var r="",i=0,o=this.length-1;o>i;++i)r+=" |";console.log(r,"\\"+t.type,t.token.data)}return e&&Pt!==t&&Pt.children.push(t),Pt=t,n}function M(){var t=[].shift.call(this),e=Xt[this.length],n=!1;if(p){for(var r="",i=0,o=this.length;o>i;++i)r+=" |";console.log(r,"/"+t.type)}return Xt.length?"function"==typeof Xt[0]?n=Xt[0](t):void 0!==e&&(n=e.test?e.test(t.type):e===t.type):n=!0,n&&qt.emit("data",t),Pt=t.parent,t}function S(){function t(){if(Ct.data===Yt[0].expecting)return Yt.scope.exit(),Yt.shift();switch(Ct.type){case"preprocessor":return Yt.fake(it()),void Zt.shift();default:return void Yt.unshift(zt())}}return pt(function(){return Yt.scope.enter(),c},t)()}function N(){if(Yt[0].brace)return"}"!==Ct.data?ht("expected `}`, got "+Ct.data):(Yt[0].brace=!1,Zt.shift(),Yt.shift());switch(Ct.type){case"eof":return Yt.shift();case"keyword":switch(Ct.data){case"for":return Yt.unshift(Nt());case"if":return Yt.unshift(Vt());case"while":return Yt.unshift(It());case"do":return Yt.unshift(Gt());case"break":return Yt.fake(i(P,Ct)),Zt.shift();case"continue":return Yt.fake(i(L,Ct)),Zt.shift();case"discard":return Yt.fake(i(z,Ct)),Zt.shift();case"return":return Yt.unshift(jt());case"precision":return Yt.unshift(Dt())}return Yt.unshift(ot(W));case"ident":var t;if(t=Yt.scope.find(Ct.data))return"struct"===t.parent.type?Yt.unshift(ot(W)):Yt.unshift(at(";"));case"operator":if("{"===Ct.data){Yt[0].brace=!0;var e=Lt();return e.expecting="}",Zt.shift(),Yt.unshift(e)}if(";"===Ct.data)return Zt.shift(),Yt.shift();default:return Yt.unshift(at(";"))}}function Q(){function t(){return"invariant"===Ct.data?d.flags&V?(Yt.unshift(ut()),c):ht("`invariant` is not allowed here"):(Yt.fake(i(D,{data:"",position:Ct.position})),c)}function e(){return o(Ct)?d.flags&I?(Yt.unshift(ut()),c):ht("storage is not allowed here"):(Yt.fake(i(D,{data:"",position:Ct.position})),c)}function n(){return s(Ct)?d.flags&j?ht("parameter is not allowed here"):(Yt.unshift(ut()),c):(Yt.fake(i(D,{data:"",position:Ct.position})),c)}function r(){return a(Ct)?(Yt.unshift(ut()),c):(Yt.fake(i(D,{data:"",position:Ct.position})),c)}function u(){if("struct"===Ct.data)return d.flags&G?(Yt.unshift(st()),c):ht("cannot nest structs");if("keyword"===Ct.type)return Yt.unshift(ut()),c;var t=Yt.scope.find(Ct.data);return t?(Yt.fake(Object.create(t)),Zt.shift(),c):ht("expected user defined type, struct or keyword, got "+Ct.data)}function h(){return","!==Ct.data||d.flags&B?"["===Ct.data?void Yt.unshift(Wt()):")"===Ct.data?Yt.shift():";"===Ct.data?d.stage+3:"ident"!==Ct.type?(console.log(Ct),ht("expected identifier, got "+Ct.data)):(d.collected_name=Zt.shift(),c):Yt.shift()}function l(){return"("===Ct.data?(Zt.unshift(d.collected_name),delete d.collected_name,Yt.unshift(Ut()),d.stage+2):c}function p(){return Zt.unshift(d.collected_name),delete d.collected_name,Yt.unshift(Ot()),c}function f(){return Yt.shift()}var d=Yt[0];return pt(t,e,n,r,u,h,l,p,f)()}function J(){if("ident"===Ct.type){var t=Ct.data;return Yt.unshift(Ft()),void Yt.scope.define(t)}if("operator"===Ct.type){if(","===Ct.data)return Yt[1].flags&B?Zt.shift():Yt.shift();if("="===Ct.data)return Yt[1].flags&U?(Zt.shift(),void Yt.unshift(at(",",";"))):ht("`=` is not allowed here.");if("["===Ct.data)return void Yt.unshift(Wt())}return Yt.shift()}function $(){return"keyword"===Ct.type?(Yt[0].type="keyword",void(Yt[0].mode=k)):"ident"===Ct.type?(Yt[0].type="ident",void(Yt[0].mode=d)):ht("expected keyword or user-defined name, got "+Ct.data)}function tt(){return"keyword"!==Ct.type?ht("expected keyword, got "+Ct.data):(Yt.shift(),Zt.shift())}function et(){return"ident"!==Ct.type?ht("expected user-defined name, got "+Ct.data):(Yt[0].data=Ct.data,Yt.shift(),Zt.shift())}function nt(){function t(t){return h(Yt,t),Yt.shift()}var e=Yt[0].expecting;if(Yt[0].tokens=Yt[0].tokens||[],void 0===Yt[0].parenlevel&&(Yt[0].parenlevel=0,Yt[0].bracelevel=0),Yt[0].parenlevel<1&&e.indexOf(Ct.data)>-1)return t(Yt[0].tokens);switch("("===Ct.data?++Yt[0].parenlevel:")"===Ct.data&&--Yt[0].parenlevel,Ct.data){case"{":++Yt[0].bracelevel;break;case"}":--Yt[0].bracelevel;break;case"(":++Yt[0].parenlevel;break;case")":--Yt[0].parenlevel}return Yt[0].parenlevel<0?ht("unexpected `)`"):Yt[0].bracelevel<0?ht("unexpected `}`"):void Yt[0].tokens.push(Zt.shift())}function rt(t){return function(){return i(t,Ct)}}function it(){return i(K[Ct.type],Ct,Pt)}function ot(t){var e=i(_,Ct,Pt);return e.flags=t,e}function st(t,e){var n=i(g,Ct,Pt);return n.allow_assign=void 0===t?!0:t,n.allow_comma=void 0===e?!0:e,n}function at(){var t=i(R,Ct,Pt);return t.expecting=[].slice.call(arguments),t}function ut(t){var e=Ct;return t&&(e={type:"(implied)",data:"(default)",position:e.position}),i(k,e,Pt)}function ht(t){Qt=!0,qt.emit("error",new Error((t||"unexpected "+Yt)+" at line "+Yt[0].token.line))}function lt(t,e){return ct(t,Ct.type)&&ct(e,Ct.data)}function ct(t,e){switch(typeof t){case"string":return e!==t&&ht("expected `"+t+"`, got "+e+"\n"+Ct.data),!Qt;case"object":return t&&-1===t.indexOf(e)&&ht("expected one of `"+t.join("`, `")+"`, got "+e),!Qt}return!0}function pt(){var t,e,n=[].slice.call(arguments);return function(){var r=Yt[0];return r.stage||(r.stage=0),(t=n[r.stage])?(e=t(),e===c?++r.stage:void(void 0!==e&&(r.stage=e))):ht("parser in undefined state!")}}function ft(t,e){return e=e||"operator",function(){if(lt(e,t)){var n=Zt.shift(),r=Yt[0].children,i=r[r.length-1];return i&&i.token&&n.preceding&&(i.token.succeeding=i.token.succeeding||[],i.token.succeeding=i.token.succeeding.concat(n.preceding)),c}}}function dt(t){return function(){return Yt.unshift(at(t)),c}}function mt(t){return t?function(){var t=Ct.data;return lt("ident")&&(Yt.unshift(Ft()),Yt.scope.define(t),c)}:function(){if(lt("ident")){var t=Object.create(Yt.scope.find(Ct.data));return t.token=Ct,Zt.shift(),c}}}function vt(){return function(){var t=Lt();return t.expecting="}",Yt.unshift(t),c}}function gt(t){return function(){var e=Yt[0].stage;return"{"!==Ct.data?(Yt.unshift(zt()),e+t):(Zt.shift(),c)}}function Et(){return function(){return Yt.shift(),Yt.shift()}}function yt(){_t=pt(ft("struct","keyword"),function(){return"{"===Ct.data?(Yt.fake(i(d,{data:"",position:Ct.position,type:"ident"})),c):mt(!0)()},function(){return Yt.scope.enter(),c},ft("{"),function(){return"}"===Ct.data?(Yt.scope.exit(),Zt.shift(),Yt.shift()):";"===Ct.data?void Zt.shift():void Yt.unshift(ot(X))}),bt=pt(function(){return Zt.shift(),c},function(){return lt("keyword",["lowp","mediump","highp"])&&(Yt.unshift(ut()),c)},function(){return Yt.unshift(ut()),c},function(){return Yt.shift()}),Tt=pt(ft("["),dt("]"),ft("]"),function(){return Yt.shift()}),xt=pt(ft("for","keyword"),ft("("),function(){var t;if("ident"===Ct.type){if((t=Yt.scope.find(Ct.data))||(t=Yt.create_node()),"struct"===t.parent.type)return Yt.unshift(ot(W)),
-c}else if("builtin"===Ct.type||"keyword"===Ct.type)return Yt.unshift(ot(W)),c;return dt(";")()},ft(";"),dt(";"),ft(";"),dt(")"),ft(")"),gt(3),vt(),ft("}"),Et()),wt=pt(ft("if","keyword"),ft("("),dt(")"),ft(")"),gt(3),vt(),ft("}"),function(){return"else"===Ct.data?(Zt.shift(),Yt.unshift(zt()),c):Et()()},Et()),Rt=pt(ft("return","keyword"),function(){return";"===Ct.data?c:(Yt.unshift(at(";")),c)},function(){Zt.shift(),Et()()}),Ht=pt(ft("while","keyword"),ft("("),dt(")"),ft(")"),gt(3),vt(),ft("}"),Et()),Mt=pt(ft("do","keyword"),gt(3),vt(),ft("}"),ft("while","keyword"),ft("("),dt(")"),ft(")"),Et()),St=pt(function(){for(var t=1,e=Yt.length;e>t;++t)if(Yt[t].mode===E)return ht("function definition is not allowed within another function");return c},function(){if(lt("ident")){var t=Ct.data,e=Yt.scope.find(t);return Yt.unshift(Ft()),Yt.scope.define(t),Yt.scope.enter(e?e.scope:null),c}},ft("("),function(){return Yt.unshift(Bt()),c},ft(")"),function(){return";"===Ct.data?(Yt.scope.exit(),Yt.shift(),Yt.shift()):c},ft("{"),vt(),ft("}"),function(){return Yt.scope.exit(),c},function(){return Yt.shift(),Yt.shift(),Yt.shift()}),kt=pt(function(){return"void"===Ct.data?(Yt.fake(ut()),Zt.shift(),c):")"===Ct.data?void Yt.shift():"struct"===Ct.data?(Yt.unshift(st(Y,Z)),c):(Yt.unshift(ot(q)),c)},function(){return","===Ct.data?(Zt.shift(),0):")"===Ct.data?void Yt.shift():void ht("expected one of `,` or `)`, got "+Ct.data)})}var _t,bt,Tt,xt,wt,Rt,Ht,Mt,St,kt,At,Ct,Pt,Lt=rt(v),zt=rt(m),Ot=rt(b),Dt=rt(H),Ft=rt(d),Ut=(rt(A),rt(E)),Bt=rt(y),Nt=rt(T),Vt=rt(w),It=rt(x),jt=rt(C),Gt=rt(O),Wt=rt(F),qt=u(t,e),Xt=arguments.length?[].slice.call(arguments):[],Yt=[],Zt=[],Kt=[],Qt=!1;return Yt.shift=M,Yt.unshift=f,Yt.fake=r,Yt.unexpected=ht,Yt.scope=new l(Yt),Yt.create_node=function(){var t=i(d,Ct);return t.parent=qt.program,t},yt(),Pt=Lt(),Pt.expecting="(eof)",Pt.mode=v,Pt.token={type:"(program)",data:"(program)"},At=Pt,qt.program=At,qt.scope=function(t){return 1===arguments.length&&(Yt.scope=t),Yt.scope},Yt.unshift(Pt),qt}function i(t,e){return{mode:t,token:e,children:[],type:Q[t]}}function o(t){return"const"===t.data||"attribute"===t.data||"uniform"===t.data||"varying"===t.data}function s(t){return"in"===t.data||"inout"===t.data||"out"===t.data}function a(t){return"highp"===t.data||"mediump"===t.data||"lowp"===t.data}e.exports=r;var u=t("../../through"),h=t("./expr"),l=t("./scope"),c=new Object,p=!1,f=0,d=f++,m=f++,v=f++,g=f++,E=f++,y=f++,_=f++,b=f++,T=f++,x=f++,w=f++,R=f++,H=f++,M=f++,S=f++,k=f++,A=f++,C=f++,P=f++,L=f++,z=f++,O=f++,D=f++,F=f++,U=1,B=2,N=4,V=8,I=16,j=32,G=64,W=255,q=W&~(U|B|j|V|N),X=W&~(U|V|I|G),Y=!1,Z=!1,K={"block-comment":M,"line-comment":M,preprocessor:S},Q=f=["ident","stmt","stmtlist","struct","function","functionargs","decl","decllist","forloop","whileloop","if","expr","precision","comment","preprocessor","keyword","keyword_or_ident","return","break","continue","discard","do-while","placeholder","quantifier"]},{"../../through":227,"./expr":220,"./scope":222}],222:[function(t,e,n){function r(t){return this.constructor!==r?new r(t):(this.state=t,this.scopes=[],void(this.current=null))}e.exports=r;var i=r,o=i.prototype;o.enter=function(t){this.scopes.push(this.current=this.state[0].scope=t||{})},o.exit=function(){this.scopes.pop(),this.current=this.scopes[this.scopes.length-1]},o.define=function(t){this.current[t]=this.state[0]},o.find=function(t,e){for(var n=this.scopes.length-1;n>-1;--n)if(this.scopes[n].hasOwnProperty(t))return this.scopes[n][t];return null}},{}],223:[function(t,e,n){function r(){function t(t){t.length&&D.queue({type:T[B],data:t,position:I,line:V})}function e(t){for(F=0,W+=t.toString(),O=W.length;L=W[F],O>F;)switch(B){case l:F=H();break;case c:F=R();break;case p:F=w();break;case f:F=M();break;case d:F=A();break;case b:F=k();break;case m:F=C();break;case h:F=P();break;case y:F=x();break;case u:F=r()}U+=F,W=W.slice(F)}function n(e){N.length&&t(N.join("")),B=_,t("(eof)"),D.queue(null)}function r(){return N=N.length?[]:N,"/"===z&&"*"===L?(I=U+F-1,B=l,z=L,F+1):"/"===z&&"/"===L?(I=U+F-1,B=c,z=L,F+1):"#"===L?(B=p,I=U+F,F):/\s/.test(L)?(B=y,I=U+F,F):(j=/\d/.test(L),G=/[^\w_]/.test(L),I=U+F,B=j?d:G?f:h,F)}function x(){return"\n"===L&&++V,/[^\s]/g.test(L)?(t(N.join("")),B=u,F):(N.push(L),z=L,F+1)}function w(){return"\n"===L&&++V,"\n"===L&&"\\"!==z?(t(N.join("")),B=u,F):(N.push(L),z=L,F+1)}function R(){return w()}function H(){return"/"===L&&"*"===z?(N.push(L),t(N.join("")),B=u,F+1):("\n"===L&&++V,N.push(L),z=L,F+1)}function M(){if("."===z&&/\d/.test(L))return B=m,F;if("/"===z&&"*"===L)return B=l,F;if("/"===z&&"/"===L)return B=c,F;if("."===L&&N.length){for(;S(N););return B=m,F}if(";"===L){if(N.length)for(;S(N););return t(L),B=u,F+1}var e=2===N.length&&"="!==L;if(/[\w_\d\s]/.test(L)||e){for(;S(N););return B=u,F}return N.push(L),z=L,F+1}function S(e){for(var n,r=0,i=e.length;;){n=s.indexOf(e.slice(0,e.length+r).join(""));{if(-1!==n)return t(s[n]),I+=s[n].length,N=N.slice(s[n].length),N.length;if(r-=1,i-=1,0>i)return 0}}}function k(){return/[^a-fA-F0-9]/.test(L)?(t(N.join("")),B=u,F):(N.push(L),z=L,F+1)}function A(){return"."===L?(N.push(L),B=m,z=L,F+1):/[eE]/.test(L)?(N.push(L),B=m,z=L,F+1):"x"===L&&1===N.length&&"0"===N[0]?(B=b,N.push(L),z=L,F+1):/[^\d]/.test(L)?(t(N.join("")),B=u,F):(N.push(L),z=L,F+1)}function C(){return"f"===L&&(N.push(L),z=L,F+=1),/[eE]/.test(L)?(N.push(L),z=L,F+1):/[^\d]/.test(L)?(t(N.join("")),B=u,F):(N.push(L),z=L,F+1)}function P(){if(/[^\d\w_]/.test(L)){var e=N.join("");return B=o.indexOf(e)>-1?E:a.indexOf(e)>-1?g:v,t(N.join("")),B=u,F}return N.push(L),z=L,F+1}var L,z,O,D=i(e,n),F=0,U=0,B=u,N=[],V=1,I=0,j=!1,G=!1,W="";return D}e.exports=r;var i=t("../through"),o=t("./lib/literals"),s=t("./lib/operators"),a=t("./lib/builtins"),u=999,h=9999,l=0,c=1,p=2,f=3,d=4,m=5,v=6,g=7,E=8,y=9,_=10,b=11,T=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"../through":227,"./lib/builtins":224,"./lib/literals":225,"./lib/operators":226}],224:[function(t,e,n){e.exports=["gl_Position","gl_PointSize","gl_ClipVertex","gl_FragCoord","gl_FrontFacing","gl_FragColor","gl_FragData","gl_FragDepth","gl_Color","gl_SecondaryColor","gl_Normal","gl_Vertex","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_FogCoord","gl_MaxLights","gl_MaxClipPlanes","gl_MaxTextureUnits","gl_MaxTextureCoords","gl_MaxVertexAttribs","gl_MaxVertexUniformComponents","gl_MaxVaryingFloats","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformComponents","gl_MaxDrawBuffers","gl_ModelViewMatrix","gl_ProjectionMatrix","gl_ModelViewProjectionMatrix","gl_TextureMatrix","gl_NormalMatrix","gl_ModelViewMatrixInverse","gl_ProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverse","gl_TextureMatrixInverse","gl_ModelViewMatrixTranspose","gl_ProjectionMatrixTranspose","gl_ModelViewProjectionMatrixTranspose","gl_TextureMatrixTranspose","gl_ModelViewMatrixInverseTranspose","gl_ProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixInverseTranspose","gl_TextureMatrixInverseTranspose","gl_NormalScale","gl_DepthRangeParameters","gl_DepthRange","gl_ClipPlane","gl_PointParameters","gl_Point","gl_MaterialParameters","gl_FrontMaterial","gl_BackMaterial","gl_LightSourceParameters","gl_LightSource","gl_LightModelParameters","gl_LightModel","gl_LightModelProducts","gl_FrontLightModelProduct","gl_BackLightModelProduct","gl_LightProducts","gl_FrontLightProduct","gl_BackLightProduct","gl_FogParameters","gl_Fog","gl_TextureEnvColor","gl_EyePlaneS","gl_EyePlaneT","gl_EyePlaneR","gl_EyePlaneQ","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_ObjectPlaneR","gl_ObjectPlaneQ","gl_FrontColor","gl_BackColor","gl_FrontSecondaryColor","gl_BackSecondaryColor","gl_TexCoord","gl_FogFragCoord","gl_Color","gl_SecondaryColor","gl_TexCoord","gl_FogFragCoord","gl_PointCoord","radians","degrees","sin","cos","tan","asin","acos","atan","pow","exp","log","exp2","log2","sqrt","inversesqrt","abs","sign","floor","ceil","fract","mod","min","max","clamp","mix","step","smoothstep","length","distance","dot","cross","normalize","faceforward","reflect","refract","matrixCompMult","lessThan","lessThanEqual","greaterThan","greaterThanEqual","equal","notEqual","any","all","not","texture2D","texture2DProj","texture2DLod","texture2DProjLod","textureCube","textureCubeLod"]},{}],225:[function(t,e,n){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],226:[function(t,e,n){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],227:[function(t,e,n){var r;r=function(t,e){var n,r;return r=[],n=[],{output:r,parser:null,write:t,end:e,process:function(e,n){return this.parser=e,t(n),this.flush(),this.parser.flush()},flush:function(){return e(),[r,n]},queue:function(t){var e;return null!=t&&null!=(e=this.parser)?e.write(t):void 0},emit:function(t,e){return"data"===t&&null==e.parent&&r.push(e),"error"===t?n.push(e):void 0}}},e.exports=r},{}]},{},[30]);
\ No newline at end of file
diff --git a/htdocs/mathbox.css b/htdocs/mathbox.css
deleted file mode 100644
index dd93e59..0000000
--- a/htdocs/mathbox.css
+++ /dev/null
@@ -1,461 +0,0 @@
-.shadergraph-graph {
- font: 12px sans-serif;
- line-height: 25px;
- position: relative;
-}
-.shadergraph-graph:after {
- content: ' ';
- display: block;
- height: 0;
- font-size: 0;
- clear: both;
-}
-.shadergraph-graph svg {
- pointer-events: none;
-}
-.shadergraph-clear {
- clear: both;
-}
-.shadergraph-graph svg {
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- width: auto;
- height: auto;
-}
-.shadergraph-column {
- float: left;
-}
-.shadergraph-node .shadergraph-graph {
- float: left;
- clear: both;
- overflow: visible;
-}
-.shadergraph-node .shadergraph-graph .shadergraph-node {
- margin: 5px 15px 15px;
-}
-.shadergraph-node {
- margin: 5px 15px 25px;
- background: rgba(0, 0, 0, .1);
- border-radius: 5px;
- box-shadow: 0 1px 2px rgba(0, 0, 0, .2),
- 0 1px 10px rgba(0, 0, 0, .2);
- min-height: 35px;
- float: left;
- clear: left;
- position: relative;
-}
-.shadergraph-type {
- font-weight: bold;
-}
-.shadergraph-header {
- font-weight: bold;
- text-align: center;
- height: 25px;
- background: rgba(0, 0, 0, .3);
- text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
- color: #fff;
- border-top-left-radius: 5px;
- border-top-right-radius: 5px;
- margin-bottom: 5px;
- padding: 0 10px;
-}
-.shadergraph-outlet div {
-}
-.shadergraph-outlet-in .shadergraph-name {
- margin-right: 7px;
-}
-.shadergraph-outlet-out .shadergraph-name {
- margin-left: 7px;
-}
-
-.shadergraph-name {
- margin: 0 4px;
-}
-.shadergraph-point {
- margin: 6px;
- width: 11px;
- height: 11px;
- border-radius: 7.5px;
- background: rgba(255, 255, 255, 1);
-}
-.shadergraph-outlet-in {
- float: left;
- clear: left;
-}
-.shadergraph-outlet-in div {
- float: left;
-}
-.shadergraph-outlet-out {
- float: right;
- clear: right;
-}
-.shadergraph-outlet-out div {
- float: right;
-}
-
-.shadergraph-node-callback {
- background: rgba(205, 209, 221, .5);
- box-shadow: 0 1px 2px rgba(0, 10, 40, .2),
- 0 1px 10px rgba(0, 10, 40, .2);
-}
-.shadergraph-node-callback > .shadergraph-header {
- background: rgba(0, 20, 80, .3);
-}
-.shadergraph-graph .shadergraph-graph .shadergraph-node-callback {
- background: rgba(0, 20, 80, .1);
-}
-
-.shadergraph-node-call {
- background: rgba(209, 221, 205, .5);
- box-shadow: 0 1px 2px rgba(10, 40, 0, .2),
- 0 1px 10px rgba(10, 40, 0, .2);
-}
-.shadergraph-node-call > .shadergraph-header {
- background: rgba(20, 80, 0, .3);
-}
-.shadergraph-graph .shadergraph-graph .shadergraph-node-call {
- background: rgba(20, 80, 0, .1);
-}
-
-.shadergraph-node-isolate {
- background: rgba(221, 205, 209, .5);
- box-shadow: 0 1px 2px rgba(40, 0, 10, .2),
- 0 1px 10px rgba(40, 0, 10, .2);
-}
-.shadergraph-node-isolate > .shadergraph-header {
- background: rgba(80, 0, 20, .3);
-}
-.shadergraph-graph .shadergraph-graph .shadergraph-node-isolate {
- background: rgba(80, 0, 20, .1);
-}
-
-.shadergraph-node.shadergraph-has-code {
- cursor: pointer;
-}
-.shadergraph-node.shadergraph-has-code::before {
- position: absolute;
- content: ' ';
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- display: none;
- border: 2px solid rgba(0, 0, 0, .25);
- border-radius: 5px;
-}
-.shadergraph-node.shadergraph-has-code:hover::before {
- display: block;
-}
-.shadergraph-code {
- z-index: 10000;
- display: none;
- position: absolute;
- background: #fff;
- color: #000;
- white-space: pre;
- padding: 10px;
- border-radius: 5px;
- box-shadow: 0 1px 2px rgba(0, 0, 0, .2),
- 0 1px 10px rgba(0, 0, 0, .2);
- font-family: monospace;
- font-size: 10px;
- line-height: 12px;
-}
-
-.shadergraph-overlay {
- position: fixed;
- top: 50%;
- left: 0;
- right: 0;
- bottom: 0;
- background: #fff;
- border-top: 1px solid #CCC;
-}
-.shadergraph-overlay .shadergraph-view {
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- overflow: auto;
-}
-.shadergraph-overlay .shadergraph-inside {
- width: 4000px;
- min-height: 100%;
- box-sizing: border-box;
-}
-.shadergraph-overlay .shadergraph-close {
- position: absolute;
- top: 5px;
- right: 5px;
- padding: 4px;
- border-radius: 16px;
- background: rgba(255,255,255,.3);
- color: rgba(0, 0, 0, .3);
- cursor: pointer;
- font-size: 24px;
- line-height: 24px;
- width: 24px;
- text-align: center;
- vertical-align: middle;
-}
-.shadergraph-overlay .shadergraph-close:hover {
- background: rgba(255,255,255,1);
- color: rgba(0, 0, 0, 1);
-}
-.shadergraph-overlay .shadergraph-graph {
- padding-top: 10px;
- overflow: visible;
- min-height: 100%;
-}
-.shadergraph-overlay span {
- display: block;
- padding: 5px 15px;
- margin: 0;
- background: rgba(0, 0, 0, .1);
- font-weight: bold;
- font-family: sans-serif;
-}
-.mathbox-loader {
- position: absolute;
- top: 50%;
- left: 50%;
- -webkit-transform: translate(-50%, -50%);
- transform: translate(-50%, -50%);
- padding: 10px;
- border-radius: 50%;
- background: #fff;
-}
-
-.mathbox-loader.mathbox-exit {
- opacity: 0;
- -webkit-transition:
- opacity .15s ease-in-out;
- transition:
- opacity .15s ease-in-out;
-}
-
-.mathbox-progress {
- height: 10px;
- border-radius: 5px;
- width: 80px;
- margin: 0 auto 20px;
- box-shadow:
- 1px 1px 1px rgba(255, 255, 255, .2),
- 1px -1px 1px rgba(255, 255, 255, .2),
- -1px 1px 1px rgba(255, 255, 255, .2),
- -1px -1px 1px rgba(255, 255, 255, .2);
- background: #ccc;
- overflow: hidden;
-}
-
-.mathbox-progress > div {
- display: block;
- width: 0px;
- height: 10px;
- background: #888;
-}
-
-.mathbox-logo {
- position: relative;
- width: 140px;
- height: 100px;
- margin: 0 auto 10px;
- -webkit-perspective: 200px;
- perspective: 200px;
-}
-
-.mathbox-logo > div {
- position: absolute;
- left: 0;
- top: 0;
- bottom: 0;
- right: 0;
- -webkit-transform-style: preserve-3d;
- transform-style: preserve-3d;
-}
-
-.mathbox-logo > :nth-child(1) {
- -webkit-transform: rotateZ(22deg) rotateX(24deg) rotateY(30deg);
- transform: rotateZ(22deg) rotateX(24deg) rotateY(30deg);
-}
-
-.mathbox-logo > :nth-child(2) {
- -webkit-transform: rotateZ(11deg) rotateX(12deg) rotateY(15deg) scale3d(.6, .6, .6);
- transform: rotateZ(11deg) rotateX(12deg) rotateY(15deg) scale3d(.6, .6, .6);
-}
-
-.mathbox-logo > div > div {
- position: absolute;
- top: 50%;
- left: 50%;
- margin-left: -100px;
- margin-top: -100px;
- width: 200px;
- height: 200px;
- box-sizing: border-box;
- border-radius: 50%;
-}
-
-.mathbox-logo > div > :nth-child(1) {
- -webkit-transform: scale(0.5, 0.5);
- transform: rotateX(30deg) scale(0.5, 0.5);
-}
-
-.mathbox-logo > div > :nth-child(2) {
- -webkit-transform: rotateX(90deg) scale(0.42, 0.42);
- transform: rotateX(90deg) scale(0.42, 0.42);
-}
-
-.mathbox-logo > div > :nth-child(3) {
- -webkit-transform: rotateY(90deg) scale(0.35, 0.35);
- transform: rotateY(90deg) scale(0.35, 0.35);
-}
-
-.mathbox-logo > :nth-child(1) > :nth-child(1) {
- border: 16px solid #808080;
-}
-.mathbox-logo > :nth-child(1) > :nth-child(2) {
- border: 19px solid #A0A0A0;
-}
-.mathbox-logo > :nth-child(1) > :nth-child(3) {
- border: 23px solid #C0C0C0;
-}
-.mathbox-logo > :nth-child(2) > :nth-child(1) {
- border: 27px solid #808080;
-}
-.mathbox-logo > :nth-child(2) > :nth-child(2) {
- border: 32px solid #A0A0A0;
-}
-.mathbox-logo > :nth-child(2) > :nth-child(3) {
- border: 38px solid #C0C0C0;
-}
-
-.mathbox-splash-blue .mathbox-progress {
- background: #def;
-}
-.mathbox-splash-blue .mathbox-progress > div {
- background: #1979e7;
-}
-.mathbox-splash-blue .mathbox-logo > :nth-child(1) > :nth-child(1) {
- border-color: #1979e7;
-}
-.mathbox-splash-blue .mathbox-logo > :nth-child(1) > :nth-child(2) {
- border-color: #33b0ff;
-}
-.mathbox-splash-blue .mathbox-logo > :nth-child(1) > :nth-child(3) {
- border-color: #75eaff;
-}
-.mathbox-splash-blue .mathbox-logo > :nth-child(2) > :nth-child(1) {
- border-color: #18487F;
-}
-.mathbox-splash-blue .mathbox-logo > :nth-child(2) > :nth-child(2) {
- border-color: #33b0ff;
-}
-.mathbox-splash-blue .mathbox-logo > :nth-child(2) > :nth-child(3) {
- border-color: #75eaff;
-}
-
-
-
-
-.mathbox-overlays {
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- pointer-events: none;
- transform-style: preserve-3d;
- overflow: hidden;
-}
-.mathbox-overlays > div {
- transform-style: preserve-3d;
-}
-.mathbox-overlay > div {
- position: absolute;
- will-change: transform, opacity;
-}
-.mathbox-label {
- font-family: sans-serif;
-}
-.mathbox-outline-1 {
- text-shadow:
- -1px -1px 0px rgb(255, 255, 255),
- 1px 1px 0px rgb(255, 255, 255),
- -1px 1px 0px rgb(255, 255, 255),
- 1px -1px 0px rgb(255, 255, 255),
- 1px 0px 1px rgb(255, 255, 255),
- -1px 0px 1px rgb(255, 255, 255),
- 0px -1px 1px rgb(255, 255, 255),
- 0px 1px 1px rgb(255, 255, 255);
-}
-.mathbox-outline-2 {
- text-shadow:
- 0px -2px 0px rgb(255, 255, 255),
- 0px 2px 0px rgb(255, 255, 255),
- -2px 0px 0px rgb(255, 255, 255),
- 2px 0px 0px rgb(255, 255, 255),
- -1px -2px 0px rgb(255, 255, 255),
- -2px -1px 0px rgb(255, 255, 255),
- -1px 2px 0px rgb(255, 255, 255),
- -2px 1px 0px rgb(255, 255, 255),
- 1px 2px 0px rgb(255, 255, 255),
- 2px 1px 0px rgb(255, 255, 255),
- 1px -2px 0px rgb(255, 255, 255),
- 2px -1px 0px rgb(255, 255, 255);
-}
-.mathbox-outline-3 {
- text-shadow:
- 3px 0px 0px rgb(255, 255, 255),
- -3px 0px 0px rgb(255, 255, 255),
- 0px 3px 0px rgb(255, 255, 255),
- 0px -3px 0px rgb(255, 255, 255),
-
- -2px -2px 0px rgb(255, 255, 255),
- -2px 2px 0px rgb(255, 255, 255),
- 2px 2px 0px rgb(255, 255, 255),
- 2px -2px 0px rgb(255, 255, 255),
-
- -1px -2px 1px rgb(255, 255, 255),
- -2px -1px 1px rgb(255, 255, 255),
- -1px 2px 1px rgb(255, 255, 255),
- -2px 1px 1px rgb(255, 255, 255),
- 1px 2px 1px rgb(255, 255, 255),
- 2px 1px 1px rgb(255, 255, 255),
- 1px -2px 1px rgb(255, 255, 255),
- 2px -1px 1px rgb(255, 255, 255);
-}
-.mathbox-outline-4 {
- text-shadow:
- 4px 0px 0px rgb(255, 255, 255),
- -4px 0px 0px rgb(255, 255, 255),
- 0px 4px 0px rgb(255, 255, 255),
- 0px -4px 0px rgb(255, 255, 255),
-
- -3px -2px 0px rgb(255, 255, 255),
- -3px 2px 0px rgb(255, 255, 255),
- 3px 2px 0px rgb(255, 255, 255),
- 3px -2px 0px rgb(255, 255, 255),
-
- -2px -3px 0px rgb(255, 255, 255),
- -2px 3px 0px rgb(255, 255, 255),
- 2px 3px 0px rgb(255, 255, 255),
- 2px -3px 0px rgb(255, 255, 255),
-
- -1px -2px 1px rgb(255, 255, 255),
- -2px -1px 1px rgb(255, 255, 255),
- -1px 2px 1px rgb(255, 255, 255),
- -2px 1px 1px rgb(255, 255, 255),
- 1px 2px 1px rgb(255, 255, 255),
- 2px 1px 1px rgb(255, 255, 255),
- 1px -2px 1px rgb(255, 255, 255),
- 2px -1px 1px rgb(255, 255, 255);
-
-}
-.mathbox-outline-fill, .mathbox-outline-fill * {
- color: #fff !important;
-}
diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js
index 1288d6d..6d79d1d 100644
--- a/htdocs/openwebrx.js
+++ b/htdocs/openwebrx.js
@@ -1054,9 +1054,6 @@ function on_ws_recv(evt) {
fft_compression = config['fft_compression'];
divlog("FFT stream is " + ((fft_compression === "adpcm") ? "compressed" : "uncompressed") + ".");
clientProgressBar.setMaxClients(config['max_clients']);
- mathbox_waterfall_colors = config['mathbox_waterfall_colors'];
- mathbox_waterfall_frequency_resolution = config['mathbox_waterfall_frequency_resolution'];
- mathbox_waterfall_history_length = config['mathbox_waterfall_history_length'];
var sql = Number.isInteger(config['initial_squelch_level']) ? config['initial_squelch_level'] : -150;
$("#openwebrx-panel-squelch").val(sql);
updateSquelch();
@@ -1625,7 +1622,6 @@ function add_canvas() {
function init_canvas_container() {
canvas_container = e("webrx-canvas-container");
- mathbox_container = e("openwebrx-mathbox-container");
canvas_container.addEventListener("mouseleave", canvas_container_mouseleave, false);
canvas_container.addEventListener("mousemove", canvas_mousemove, false);
canvas_container.addEventListener("mouseup", canvas_mouseup, false);
@@ -1663,27 +1659,6 @@ function waterfall_init() {
waterfall_setup_done = 1;
}
-var mathbox_shift = function () {
- if (mathbox_data_current_depth < mathbox_data_max_depth) mathbox_data_current_depth++;
- if (mathbox_data_index + 1 >= mathbox_data_max_depth) mathbox_data_index = 0;
- else mathbox_data_index++;
- mathbox_data_global_index++;
-};
-
-var mathbox_clear_data = function () {
- mathbox_data_index = 50;
- mathbox_data_current_depth = 0;
-};
-
-var mathbox_get_data_line = function (x) {
- return (mathbox_data_max_depth + mathbox_data_index + x - 1) % mathbox_data_max_depth;
-};
-
-var mathbox_data_index_valid = function (x) {
- return x > mathbox_data_max_depth - mathbox_data_current_depth;
-};
-
-
function waterfall_add(data) {
if (!waterfall_setup_done) return;
var w = fft_size;
@@ -1695,26 +1670,18 @@ function waterfall_add(data) {
waterfallColorsAuto();
}
- if (mathbox_mode === MATHBOX_MODES.WATERFALL) {
- //Handle mathbox
- for (var i = 0; i < fft_size; i++) mathbox_data[i + mathbox_data_index * fft_size] = data[i];
- mathbox_shift();
- } else {
- //Add line to waterfall image
- var oneline_image = canvas_context.createImageData(w, 1);
- for (var x = 0; x < w; x++) {
- var color = waterfall_mkcolor(data[x]);
- for (i = 0; i < 4; i++)
- oneline_image.data[x * 4 + i] = ((color >>> 0) >> ((3 - i) * 8)) & 0xff;
- }
-
- //Draw image
- canvas_context.putImageData(oneline_image, 0, canvas_actual_line--);
- shift_canvases();
- if (canvas_actual_line < 0) add_canvas();
+ //Add line to waterfall image
+ var oneline_image = canvas_context.createImageData(w, 1);
+ for (var x = 0; x < w; x++) {
+ var color = waterfall_mkcolor(data[x]);
+ for (i = 0; i < 4; i++)
+ oneline_image.data[x * 4 + i] = ((color >>> 0) >> ((3 - i) * 8)) & 0xff;
}
-
+ //Draw image
+ canvas_context.putImageData(oneline_image, 0, canvas_actual_line--);
+ shift_canvases();
+ if (canvas_actual_line < 0) add_canvas();
}
function check_top_bar_congestion() {
@@ -1732,167 +1699,6 @@ function check_top_bar_congestion() {
}
-var MATHBOX_MODES =
- {
- UNINITIALIZED: 0,
- NONE: 1,
- WATERFALL: 2,
- CONSTELLATION: 3
- };
-var mathbox_mode = MATHBOX_MODES.UNINITIALIZED;
-var mathbox;
-var mathbox_element;
-var mathbox_waterfall_colors;
-var mathbox_waterfall_frequency_resolution;
-var mathbox_waterfall_history_length;
-var mathbox_correction_for_z;
-var mathbox_data_max_depth;
-var mathbox_data_current_depth;
-var mathbox_data_index;
-var mathbox_data;
-var mathbox_data_global_index;
-var mathbox_container;
-
-function mathbox_init() {
- //mathbox_waterfall_history_length is defined in the config
- mathbox_data_max_depth = fft_fps * mathbox_waterfall_history_length; //how many lines can the buffer store
- mathbox_data_current_depth = 0; //how many lines are in the buffer currently
- mathbox_data_index = 0; //the index of the last empty line / the line to be overwritten
- mathbox_data = new Float32Array(fft_size * mathbox_data_max_depth);
- mathbox_data_global_index = 0;
- mathbox_correction_for_z = 0;
-
- mathbox = mathBox({
- plugins: ['core', 'controls', 'cursor', 'stats'],
- controls: {klass: THREE.OrbitControls}
- });
- var three = mathbox.three;
- if (typeof three === "undefined") divlog("3D waterfall cannot be initialized because WebGL is not supported in your browser.", true);
-
- three.renderer.setClearColor(new THREE.Color(0x808080), 1.0);
- mathbox_container.appendChild((mathbox_element = three.renderer.domElement));
- var view = mathbox
- .set({
- scale: 1080,
- focus: 3
- })
- .camera({
- proxy: true,
- position: [-2, 1, 3]
- })
- .cartesian({
- range: [[-1, 1], [0, 1], [0, 1]],
- scale: [2, 2 / 3, 1]
- });
-
- view.axis({
- axis: 1,
- width: 3,
- color: "#fff"
- });
- view.axis({
- axis: 2,
- width: 3,
- color: "#fff"
- //offset: [0, 0, 0],
- });
- view.axis({
- axis: 3,
- width: 3,
- color: "#fff"
- });
-
- view.grid({
- width: 2,
- opacity: 0.5,
- axes: [1, 3],
- zOrder: 1,
- color: "#fff"
- });
-
- var remap = function (x, z, t) {
- var currentTimePos = mathbox_data_global_index / (fft_fps * 1.0);
- var realZAdd = (-(t - currentTimePos) / mathbox_waterfall_history_length);
- var zAdd = realZAdd - mathbox_correction_for_z;
- if (zAdd < -0.2 || zAdd > 0.2) {
- mathbox_correction_for_z = realZAdd;
- }
-
- var xIndex = Math.trunc(((x + 1) / 2.0) * fft_size); //x: frequency
- var zIndex = Math.trunc(z * (mathbox_data_max_depth - 1)); //z: time
- var realZIndex = mathbox_get_data_line(zIndex);
- if (!mathbox_data_index_valid(zIndex)) return {y: undefined, dBValue: undefined, zAdd: 0};
- var index = Math.trunc(xIndex + realZIndex * fft_size);
- var dBValue = mathbox_data[index];
- var y;
- if (dBValue > waterfall_max_level) y = 1;
- else if (dBValue < waterfall_min_level) y = 0;
- else y = (dBValue - waterfall_min_level) / (waterfall_max_level - waterfall_min_level);
- if (!y) y = 0;
- return {y: y, dBValue: dBValue, zAdd: zAdd};
- };
-
- view.area({
- expr: function (emit, x, z, i, j, t) {
- var y;
- var remapResult = remap(x, z, t);
- if ((y = remapResult.y) === undefined) return;
- emit(x, y, z + remapResult.zAdd);
- },
- width: mathbox_waterfall_frequency_resolution,
- height: mathbox_data_max_depth - 1,
- channels: 3,
- axes: [1, 3]
- });
-
- view.area({
- expr: function (emit, x, z, i, j, t) {
- var dBValue;
- if ((dBValue = remap(x, z, t).dBValue) === undefined) return;
- var color = waterfall_mkcolor(dBValue, mathbox_waterfall_colors);
- var b = (color & 0xff) / 255.0;
- var g = ((color & 0xff00) >> 8) / 255.0;
- var r = ((color & 0xff0000) >> 16) / 255.0;
- emit(r, g, b, 1.0);
- },
- width: mathbox_waterfall_frequency_resolution,
- height: mathbox_data_max_depth - 1,
- channels: 4,
- axes: [1, 3]
- });
-
- view.surface({
- shaded: true,
- points: '<<',
- colors: '<',
- color: 0xFFFFFF
- });
-
- view.surface({
- fill: false,
- lineX: false,
- lineY: false,
- points: '<<',
- colors: '<',
- color: 0xFFFFFF,
- width: 2,
- blending: 'add',
- opacity: .25,
- zBias: 5
- });
- mathbox_mode = MATHBOX_MODES.NONE;
-
-}
-
-function mathbox_toggle() {
-
- if (mathbox_mode === MATHBOX_MODES.UNINITIALIZED) mathbox_init();
- mathbox_mode = (mathbox_mode === MATHBOX_MODES.NONE) ? MATHBOX_MODES.WATERFALL : MATHBOX_MODES.NONE;
- mathbox_container.style.display = (mathbox_mode === MATHBOX_MODES.WATERFALL) ? "block" : "none";
- mathbox_clear_data();
- waterfall_clear();
-}
-
function waterfall_clear() {
while (canvases.length) //delete all canvases
{
diff --git a/owrx/connection.py b/owrx/connection.py
index 612815e..2798f83 100644
--- a/owrx/connection.py
+++ b/owrx/connection.py
@@ -74,9 +74,6 @@ class OpenWebRxReceiverClient(Client):
"start_mod",
"start_freq",
"center_freq",
- "mathbox_waterfall_colors",
- "mathbox_waterfall_history_length",
- "mathbox_waterfall_frequency_resolution",
"initial_squelch_level",
"profile_id",
]