text: !function(){return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var f="function"==typeof require&&require;if(!s&&f)return f(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}}()({1:[function(e,t,r){t.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],2:[function(e,t,r){t.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],3:[function(e,t,r){t.exports=["normal","italic","oblique"]},{}],4:[function(e,t,r){t.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],5:[function(e,t,r){"use strict";t.exports={parse:e("./parse"),stringify:e("./stringify")}},{"./parse":7,"./stringify":8}],6:[function(e,t,r){"use strict";var n=e("css-font-size-keywords");t.exports={isSize:function(e){return/^[\d\.]/.test(e)||-1!==e.indexOf("/")||-1!==n.indexOf(e)}}},{"css-font-size-keywords":1}],7:[function(e,t,r){"use strict";var n=e("unquote"),i=e("css-global-keywords"),a=e("css-system-font-keywords"),o=e("css-font-weight-keywords"),s=e("css-font-style-keywords"),f=e("css-font-stretch-keywords"),u=e("string-split-by"),c=e("./lib/util").isSize;t.exports=h;var l=h.cache={};function h(e){if("string"!=typeof e)throw new Error("Font argument must be a string.");if(l[e])return l[e];if(""===e)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(e))return l[e]={system:e};for(var t,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},h=u(e,/\s+/);t=h.shift();){if(-1!==i.indexOf(t))return["style","variant","weight","stretch"].forEach(function(e){r[e]=t}),l[e]=r;if(-1===s.indexOf(t))if("normal"!==t&&"small-caps"!==t)if(-1===f.indexOf(t)){if(-1===o.indexOf(t)){if(c(t)){var d=u(t,"/");if(r.size=d[0],null!=d[1]?r.lineHeight=p(d[1]):"/"===h[0]&&(h.shift(),r.lineHeight=p(h.shift())),!h.length)throw new Error("Missing required font-family.");return r.family=u(h.join(" "),/\s*,\s*/).map(n),l[e]=r}throw new Error("Unknown or unsupported font token: "+t)}r.weight=t}else r.stretch=t;else r.variant=t;else r.style=t}throw new Error("Missing required font-size.")}function p(e){var t=parseFloat(e);return t.toString()===e?t:e}},{"./lib/util":6,"css-font-stretch-keywords":2,"css-font-style-keywords":3,"css-font-weight-keywords":4,"css-global-keywords":9,"css-system-font-keywords":10,"string-split-by":29,unquote:31}],8:[function(e,t,r){"use strict";var n=e("pick-by-alias"),i=e("./lib/util").isSize,a=m(e("css-global-keywords")),o=m(e("css-system-font-keywords")),s=m(e("css-font-weight-keywords")),f=m(e("css-font-style-keywords")),u=m(e("css-font-stretch-keywords")),c={normal:1,"small-caps":1},l={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="1rem",p="serif";function d(e,t){if(e&&!t[e]&&!a[e])throw Error("Unknown keyword `"+e+"`");return e}function m(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=1;return t}t.exports=function(e){if((e=n(e,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"})).system)return e.system&&d(e.system,o),e.system;if(d(e.style,f),d(e.variant,c),d(e.weight,s),d(e.stretch,u),null==e.size&&(e.size=h),"number"==typeof e.size&&(e.size+="px"),!i)throw Error("Bad size value `"+e.size+"`");e.family||(e.family=p),Array.isArray(e.family)&&(e.family.length||(e.family=[p]),e.family=e.family.map(function(e){return l[e]?e:'"'+e+'"'}).join(", "));var t=[];return t.push(e.style),e.variant!==e.style&&t.push(e.variant),e.weight!==e.variant&&e.weight!==e.style&&t.push(e.weight),e.stretch!==e.weight&&e.stretch!==e.variant&&e.stretch!==e.style&&t.push(e.stretch),t.push(e.size+(null==e.lineHeight||"normal"===e.lineHeight||e.lineHeight+""=="1"?"":"/"+e.lineHeight)),t.push(e.family),t.filter(Boolean).join(" ")}},{"./lib/util":6,"css-font-stretch-keywords":2,"css-font-style-keywords":3,"css-font-weight-keywords":4,"css-global-keywords":9,"css-system-font-keywords":10,"pick-by-alias":27}],9:[function(e,t,r){t.exports=["inherit","initial","unset"]},{}],10:[function(e,t,r){t.exports=["caption","icon","menu","message-box","small-caption","status-bar"]},{}],11:[function(e,t,r){"use strict";var n=1e-8,i=e("next-pow-2"),a=new Float64Array(1024),o=new Float64Array(1024);function s(e,t,r,n,i){var a=e-r,o=t-n,s=a*a+o*o;return s*s<i}t.exports=function(e,t,r,f,u,c){var l=e.length;if(l<=1)return[];if(a.length<l){var h=i(l);a=new Float64Array(h),o=new Float64Array(h)}for(w=0;w<l;++w)a[w]=e[w];if(t)for(w=0;w<l;++w)o[w]=t[w];else for(w=0;w<l;++w)o[w]=0;for(var p,d,m,g=a[l-1],v=o[l-1],y=g*g+v*v,b=(v/=-y)-(g/=y),x=g+v,w=0;w<l-1;++w)p=g*(a[w]+o[w]),d=a[w]*b,m=o[w]*x,a[w]=p-m,o[w]=p+d;if(a[l-1]=1,o[l-1]=0,r||(r=100*l),f||(f=1e-6),u){if(!c)for(c=new Array(u.length),w=0;w<c.length;++w)c[w]=0}else{u=new Array(l-1),c=new Array(l-1);var k,A=function(e){var t,r=0;for(t=0;t<e;++t)r=Math.max(r,a[t]*a[t]+o[t]*o[t]);return 1+Math.sqrt(r)}(l);for(w=0;w<l-1;++w)x=Math.random()*A,k=Math.cos(2*Math.random()*Math.PI),u[w]=x*k,c[w]=x*Math.sqrt(1-k*k)}return function(e,t,r,i,f){var u,c,l,h,p,d,m,g,v,y,b,x,w,k,A,_,S,M=i.length,T=Math.max,F=Math.abs;for(u=0;u<t;++u){for(_=0,c=0;c<M;++c){for(g=i[c],v=f[c],h=1,p=0,l=0;l<M;++l)l!==c&&((y=g-i[l])*y+(b=v-f[l])*b<r||(w=h*(b-y),h=(x=y*(h+p))-p*(y+b),p=x+w));for(d=a[e-1],m=o[e-1],k=v-g,A=g+v,l=e-2;l>=0;--l)w=d*k,d=(x=g*(d+m))-m*A+a[l],m=x+w+o[l];F(x=h*h+p*p)>n?(h/=x,p/=-x):(h=1,p=0),y=(x=d*(h+p))-p*(d+m),b=x+(w=h*(m-d)),i[c]=g-y,f[c]=v-b,_=T(_,T(F(y),F(b)))}if(_<r)break}for(u=0;u<M;++u){for(S=1,h=i[u],p=f[u],c=0;c<M;++c)u!==c&&s(i[u],f[u],i[c],f[c],r)&&(++S,h+=i[c],p+=f[c]);if(S>1){for(h/=S,p/=S,c=0;c<M;++c)u!==c&&s(i[u],f[u],i[c],f[c],r)&&(i[c]=h,f[c]=p);i[u]=h,f[u]=p}}return[i,f]}(l,r,f,u,c)}},{"next-pow-2":23}],12:[function(e,t,r){t.exports=function(e){return e<.5?4*e*e*e:.5*Math.pow(2*e-2,3)+1}},{}],13:[function(e,t,r){"use strict";var n=e("h");t.exports=function(e,t){return t=t||{},function(r,i){if(!r)return e&&e(i);if(r instanceof Error)r=r.name+": "+r.message;else if("string"!=typeof r)throw new Error("fail-nicely: Oops! the message must be a String or an Error. How ironic.");var a=void 0===t.zIndex?9999:parseInt(t.zIndex),o=void 0===t.bg?"#333":t.bg,s=void 0===t.fg?"#fff":t.fg,f=void 0===t.title?"Sorry!":t.title,u=void 0===t.fontFamily?"Helvetica, Arial, sans-serif":t.fontFamily,c=void 0===t.position?"fixed":t.position;if(void 0!==t.invert&&t.invert){var l=s;s=o,o=l}var h={position:c,top:0,right:0,bottom:0,left:0,"background-color":o,color:s,"text-align":"center","z-index":a},p={"font-family":u},d={"font-family":u,"max-width":"640px","margin-left":"auto","margin-right":"auto","line-height":"1.4",padding:"0 15px"};document.body.appendChild(n("div",{style:h},[n("div",{style:{transform:"translate(0, -50%)","margin-top":"50vh"}},[n("h1",f,{style:p}),n("p",r,{style:d})])]))}}},{h:21}],14:[function(e,t,r){"use strict";var n=e("tiny-sdf"),i=e("optical-properties"),a=e("css-font");t.exports=function(e){var t,r,i=(e=e||{}).canvas||document.createElement("canvas"),o=e.shape||[512,512],f=e.step||[32,32],u=e.font?"string"==typeof e.font?a.parse(e.font):e.font:{},c=parseFloat(u.size)||16,l=u.family||"sans-serif",h=e.chars||[32,126],p=Math.floor((f[0]-c)/2),d=e.radius||1.5*p,m=new n(c,p,d,0,l),g=null==e.align?"optical":e.align,v=null==e.fit||1==e.fit?.5:e.fit;if(Array.isArray(h)){if(2===h.length&&"number"==typeof h[0]&&"number"==typeof h[1]){var y=[];for(t=h[0],r=0;t<=h[1];t++)y[r++]=String.fromCharCode(t);h=y}}else h=String(h).split("");o=o.slice(),i.width=o[0],i.height=o[1];var b=i.getContext("2d");b.fillStyle="#000",b.fillRect(0,0,i.width,i.height),b.textBaseline="middle";var x=f[0],w=f[1],k=0,A=0,_=c/w,S=Math.min(h.length,Math.floor(o[0]/x)*Math.ceil(o[1]/w)),M=m.ctx.textAlign,T=m.buffer,F=m.middle;for(m.ctx.textAlign="center",m.buffer=m.size/2,t=0;t<S;t++)if(h[t]){var O=s(h[t],l,_),E=1,C=[0,0];if(v){var D=v;Array.isArray(v)&&(D=v[t]);var z=.5*(O.bounds[3]-O.bounds[1]),P=.5*(O.bounds[2]-O.bounds[0]),j=Math.max(z,P),B=Math.sqrt(z*z+P*P),I=.333*O.radius+.333*j+.333*B;E=w*D/(I*w*2),m.ctx.font=c*E+"px "+l}else m.ctx.font=c+"px "+l;g&&(C="optical"===g||!0===g?[.5*x-x*O.center[0],.5*w-w*O.center[1]]:[.5*x-x*(O.bounds[2]+O.bounds[0])*.5,.5*w-w*(O.bounds[3]+O.bounds[1])*.5],m.middle=F+C[1]*E);var L=m.draw(h[t]);b.putImageData(L,k+C[0]*E,A),(k+=f[0])>o[0]-f[0]&&(k=0,A+=f[1])}return m.ctx.textAlign=M,m.buffer=T,m.middle=F,i};var o={};function s(e,t,r){if(o[t]&&o[t][e])return o[t][e];var n=i(e,{size:200,fontSize:200*r,fontFamily:t});o[t]||(o[t]={});var a={center:[n.center[0]/200,n.center[1]/200],bounds:n.bounds.map(function(e){return e/200}),radius:n.radius/200};return o[t][e]=a,a}},{"css-font":5,"optical-properties":25,"tiny-sdf":30}],15:[function(e,t,r){t.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],16:[function(e,t,r){t.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],17:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],f=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],d=t[12],m=t[13],g=t[14],v=t[15],y=r*s-n*o,b=r*f-i*o,x=r*u-a*o,w=n*f-i*s,k=n*u-a*s,A=i*u-a*f,_=c*m-l*d,S=c*g-h*d,M=c*v-p*d,T=l*g-h*m,F=l*v-p*m,O=h*v-p*g,E=y*O-b*F+x*T+w*M-k*S+A*_;if(!E)return null;return E=1/E,e[0]=(s*O-f*F+u*T)*E,e[1]=(i*F-n*O-a*T)*E,e[2]=(m*A-g*k+v*w)*E,e[3]=(h*k-l*A-p*w)*E,e[4]=(f*M-o*O-u*S)*E,e[5]=(r*O-i*M+a*S)*E,e[6]=(g*x-d*A-v*b)*E,e[7]=(c*A-h*x+p*b)*E,e[8]=(o*F-s*M+u*_)*E,e[9]=(n*M-r*F-a*_)*E,e[10]=(d*k-m*x+v*y)*E,e[11]=(l*x-c*k-p*y)*E,e[12]=(s*S-o*T-f*_)*E,e[13]=(r*T-n*S+i*_)*E,e[14]=(m*b-d*w-g*y)*E,e[15]=(c*w-l*b+h*y)*E,e}},{}],18:[function(e,t,r){t.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}},{}],19:[function(e,t,r){t.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}},{}],20:[function(e,t,r){t.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n<e.length-1;n++)r.push(e[n],t[n]||"");return r.push(e[n]),r.join("")}},{}],21:[function(e,t,r){!function(){function e(){var e=[].slice.call(arguments),t=null;function r(e){if(null==e);else if("string"==typeof e)t?t.appendChild(document.createTextNode(e)):e.split(/([\.#]?[a-zA-Z0-9_-]+)/).forEach(function(e){var r=e.substring(1,e.length);e&&(t?"."===e[0]?t.classList.add(r):"#"===e[0]&&t.setAttribute("id",r):t=document.createElement(e))});else if("number"==typeof e||"boolean"==typeof e||e instanceof Date||e instanceof RegExp)t.appendChild(document.createTextNode(e.toString()));else if(Array.isArray(e))e.forEach(r);else if(e instanceof HTMLElement)t.appendChild(e);else if("object"==typeof e)for(var n in e)if("function"==typeof e[n])t.addEventListener(n,e[n]);else if("style"===n)for(var i in e[n])t.style.setProperty(i,e[n][i]);else t.setAttribute(n,e[n])}for(;e.length;)r(e.shift());return t}"object"==typeof t?t.exports=e:this.h=e}()},{}],22:[function(e,t,r){var n=[],i=[],a="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function o(e,t){if(t=t||{},void 0===e)throw new Error(a);var r,o=!0===t.prepend?"prepend":"append",s=void 0!==t.container?t.container:document.querySelector("head"),f=n.indexOf(s);return-1===f&&(f=n.push(s)-1,i[f]={}),void 0!==i[f]&&void 0!==i[f][o]?r=i[f][o]:(r=i[f][o]=function(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}(),"prepend"===o?s.insertBefore(r,s.childNodes[0]):s.appendChild(r)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),r.styleSheet?r.styleSheet.cssText+=e:r.textContent+=e,r}t.exports=o,t.exports.insertCss=o},{}],23:[function(e,t,r){t.exports=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1}},{}],24:[function(e,t,r){"use strict";function n(e,t,r,n){return Math.abs(r)+Math.abs(t*n)+1e-32}function i(e,t,r){return Math.max(t,Math.abs(r))}function a(e){return e}function o(e,t){return(e>0?Math.max:Math.min)(e,t)}t.exports=function(e,t,r,n,i){return new s(e,t,r,n,i)};var s=function(e,t,r,o,s){var f=s||{};this.tol=void 0===f.tol?1e-8:f.tol,this.maxIncreaseFactor=void 0===f.maxIncreaseFactor?10:f.maxIncreaseFactor,this.maxDecreaseFactor=void 0===f.maxDecreaseFactor?10:f.maxDecreaseFactor,this.dtMinMag=void 0===f.dtMinMag?0:Math.abs(f.dtMinMag),this.dtMaxMag=void 0===f.dtMaxMag?void 0:Math.abs(f.dtMaxMag),this.verbose=void 0===f.verbose||!!f.verbose;var u=0,c=!1;this.__log=function(e,t){this.verbose&&(u<10?(console.log("ode45-cash-karp::"+e+"(): "+t),u++):c||(console.log("ode45-cash-karp: too many warnings. Silencing further output"),c=!0))}.bind(this),this.errorScaleFunction=void 0===f.errorScaleFunction?n:f.errorScaleFunction,this.errorReduceFunction=void 0===f.errorReduceFunction?i:f.errorReduceFunction,this.errorPostFunction=void 0===f.errorPostFunction?a:f.errorPostFunction,this.safetyFactor=void 0===f.safetyFactor?.9:f.safetyFactor,this.deriv=t,this.y=e,this.n=this.y.length,this.dt=o,this.t=r,this._ctor=this.y.constructor,this._errorScale=new this._ctor(this.n),this._w=new this._ctor(this.n),this._k1=new this._ctor(this.n),this._k2=new this._ctor(this.n),this._k3=new this._ctor(this.n),this._k4=new this._ctor(this.n),this._k5=new this._ctor(this.n),this._k6=new this._ctor(this.n)};s.prototype._calculateK1=function(){return this.deriv(this._k1,this.y,this.t),this},s.prototype._calculateKs=function(e){var t;for(t=0;t<this.n;t++)this._w[t]=this.y[t]+e*(.2*this._k1[t]);for(this.deriv(this._k2,this._w,this.t+.2*e),t=0;t<this.n;t++)this._w[t]=this.y[t]+e*(.075*this._k1[t]+.225*this._k2[t]);for(this.deriv(this._k3,this._w,this.t+.3*e),t=0;t<this.n;t++)this._w[t]=this.y[t]+e*(.3*this._k1[t]+-.9*this._k2[t]+1.2*this._k3[t]);for(this.deriv(this._k4,this._w,this.t+.6*e),t=0;t<this.n;t++)this._w[t]=this.y[t]+e*(-.2037037037037037*this._k1[t]+2.5*this._k2[t]+-2.5925925925925926*this._k3[t]+1.2962962962962963*this._k4[t]);for(this.deriv(this._k5,this._w,this.t+e),t=0;t<this.n;t++)this._w[t]=this.y[t]+e*(.029495804398148147*this._k1[t]+.341796875*this._k2[t]+.041594328703703706*this._k3[t]+.40034541377314814*this._k4[t]+.061767578125*this._k5[t]);return this.deriv(this._k6,this._w,this.t+.875*e),this},s.prototype._calculateError=function(e){for(var t=0,r=0;r<this.n;r++)t=this.errorReduceFunction(r,t,e*(.004293774801587301*this._k1[r]+-.018668586093857832*this._k3[r]+.03415502683080808*this._k4[r]+.019321986607142856*this._k5[r]+-.03910220214568041*this._k6[r])/this._errorScale[r]);return this.errorPostFunction(t)},s.prototype._update=function(e){for(var t=0;t<this.n;t++)this.y[t]+=e*(.09788359788359788*this._k1[t]+.4025764895330113*this._k3[t]+.21043771043771042*this._k4[t]+.2891022021456804*this._k6[t]);return this.t+=e,this},s.prototype._calculateErrorScale=function(e){for(var t=0;t<this.n;t++)this._errorScale[t]=this.errorScaleFunction(t,e,this.y[t],this._k1[t]);return this},s.prototype.step=function(e){if(Math.abs(this.t-e)<1e-10*this.dt)return!1;var t=this.dt;void 0!==e&&(t=t>0?Math.min(e-this.t,t):Math.max(e-this.t,t)),void 0!==this.dtMaxMag&&Math.abs(t)>this.dtMaxMag&&(this.__log("step","step greater than maximum stepsize requested. dt magnitude has been limited."),t=t>0?this.dtMaxMag:-this.dtMaxMag),void 0!==this.dtMinMag&&Math.abs(t)<this.dtMinMag&&(this.__log("step","step smaller than minimum stepsize requested. dt magnitude has been limited."),t=t>0?this.dtMinMag:-this.dtMinMag),this._calculateK1(),this._calculateErrorScale(t);for(var r,n,i,a=1/0,s=!1;this._calculateKs(t),!((a=this._calculateError(t))<this.tol||s);){if(!Number.isFinite(a))throw new Error("ode45-cash-karp::step() NaN encountered while integrating.");r=this.safetyFactor*t*Math.pow(this.tol/a,.2),t=o(t/this.maxDecreaseFactor,r),void 0!==this.dtMinMag&&Math.abs(t)<this.dtMinMag&&(t=this.dtMinMag*(t>0?1:-1),this.__log("step","minimum stepsize reached."),s=!0)}return this._update(t),r=this.safetyFactor*t*Math.pow(this.tol/a,.25),this.dt=o(this.dt/this.maxDecreaseFactor,(n=this.dt*this.maxIncreaseFactor,i=r,(n>0?Math.min:Math.max)(n,i))),void 0===e||Math.abs(this.t-e)>1e-8*this.dt},s.prototype.steps=function(e,t){for(var r=0;r<e;r++)if(!this.step(t))return!1}},{}],25:[function(e,t,r){"use strict";t.exports=a;var n=document.createElement("canvas"),i=n.getContext("2d");function a(e,t){var r,a,f;return"string"==typeof e?(r=function(e,t){t||(t={});var r=t.family||"sans-serif",a=n.width,o=n.height,s=t.width||t.height||t.size;s&&s!=a&&(a=o=n.width=n.height=s);var f=t.fontSize||a/2;return i.fillStyle="#000",i.fillRect(0,0,a,o),i.font=f+"px "+r,i.textBaseline="middle",i.textAlign="center",i.fillStyle="white",i.fillText(e,a/2,o/2),i.getImageData(0,0,a,o)}(e,t),a=r.width,f=r.height):e instanceof HTMLCanvasElement?(a=e.width,f=e.height,r=(e=e.getContext("2d")).getImageData(0,0,a,f)):e instanceof ImageData&&(a=e.width,f=e.height,r=e),function(e){var t,r,n,i,a,f,u,c,l,h,p,d,m=e.data,g=e.width,v=e.height,y=Array(v),b=Array(v),x=0,w=0,k=g,A=0,_=0,S=Array(v);for(r=0;r<v;r++)if(a=0,f=0,i=4*r*g,(h=o(m.subarray(i,i+4*g),4))[0]!==h[1]){for(x||(x=r),w=r,t=h[0];t<h[1];t++)n=m[i+4*t],a+=n,f+=t*n;y[r]=0===a?0:a/g,b[r]=0===a?0:f/a,h[0]<k&&(k=h[0]),h[1]>A&&(A=h[1]),S[r]=h}for(a=0,u=0,f=0,r=0;r<v;r++)(p=y[r])&&(u+=p*r,a+=p,f+=b[r]*p);for(l=u/a,c=f/a,_=0,d=0,r=0;r<v;r++)(h=S[r])&&(d=Math.max(s(c-h[0],l-r),s(c-h[1],l-r)))>_&&(_=d);return{center:[c,l],bounds:[k,x,A,w+1],radius:Math.sqrt(_)}}(r)}function o(e,t){var r,n=e.length,i=0;for(t||(t=4);!e[i]&&i<n;)i+=t;for(r=i,i=e.length;!e[i]&&i>r;)i-=t;return[r/t,(n=i)/t]}function s(e,t){return e*e+t*t}n.width=200,n.height=200,a.canvas=n},{}],26:[function(e,t,r){"use strict";function n(e,t){if("string"!=typeof e)return[e];var r=[e];"string"==typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",a=!!t.flat;n.forEach(function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function a(t,a,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(s),i+s}r.forEach(function(e,n){for(var i,o=0;e!=i;)if(i=e,e=e.replace(t,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=e}),n=n.reverse(),r=r.map(function(t){return n.forEach(function(r){t=t.replace(new RegExp("(\\"+i+r+"(?![0-9]))","g"),e[0]+"$1"+e[1])}),t})});var o=new RegExp("\\"+i+"([0-9]+)");return a?r:function e(t,r,n){for(var i,a=[],s=0;i=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(t.slice(0,i.index)),a.push(e(r[i[1]],r)),t=t.slice(i.index+i[0].length)}return a.push(t),a}(r[0],r)}function i(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",i=e[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)"),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=i,i=i.replace(a,s)}return i}return e.reduce(function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r},"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function a(e,t){return Array.isArray(e)?i(e,t):n(e,t)}a.parse=n,a.stringify=i,t.exports=a},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,a,o={};if("string"==typeof t&&(t=i(t)),Array.isArray(t)){var s={};for(a=0;a<t.length;a++)s[t[a]]=!0;t=s}for(n in t)t[n]=i(t[n]);var f={};for(n in t){var u=t[n];if(Array.isArray(u))for(a=0;a<u.length;a++){var c=u[a];if(r&&(f[c]=!0),c in e){if(o[n]=e[c],r)for(var l=a;l<u.length;l++)f[u[l]]=!0;break}}else n in e&&(t[n]&&(o[n]=e[n]),r&&(f[n]=!0))}if(r)for(n in e)f[n]||(o[n]=e[n]);return o};var n={};function i(e){return n[e]?n[e]:("string"==typeof e&&(e=n[e]=e.split(/\s*,\s*|\s+/)),e)}},{}],28:[function(e,t,r){var n,i;n=this,i=function(){function e(e,t){this.id=V++,this.type=e,this.data=t}function t(e){return"["+function e(t){if(0===t.length)return[];var r=t.charAt(0),n=t.charAt(t.length-1);if(1<t.length&&r===n&&('"'===r||"'"===r))return['"'+t.substr(1,t.length-2).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];if(r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t))return e(t.substr(0,r.index)).concat(e(r[1])).concat(e(t.substr(r.index+r[0].length)));if(1===(r=t.split(".")).length)return['"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];for(t=[],n=0;n<r.length;++n)t=t.concat(e(r[n]));return t}(e).join("][")+"]"}function r(e){return"string"==typeof e?e.split():e}function n(e){return"string"==typeof e?document.querySelector(e):e}function i(e){var t,i,a,o,s=e||{};e={};var f=[],u=[],c="undefined"==typeof window?1:window.devicePixelRatio,l=!1,h=function(e){},p=function(){};if("string"==typeof s?t=document.querySelector(s):"object"==typeof s&&("string"==typeof s.nodeName&&"function"==typeof s.appendChild&&"function"==typeof s.getBoundingClientRect?t=s:"function"==typeof s.drawArrays||"function"==typeof s.drawElements?a=(o=s).canvas:("gl"in s?o=s.gl:"canvas"in s?a=n(s.canvas):"container"in s&&(i=n(s.container)),"attributes"in s&&(e=s.attributes),"extensions"in s&&(f=r(s.extensions)),"optionalExtensions"in s&&(u=r(s.optionalExtensions)),"onDone"in s&&(h=s.onDone),"profile"in s&&(l=!!s.profile),"pixelRatio"in s&&(c=+s.pixelRatio))),t&&("canvas"===t.nodeName.toLowerCase()?a=t:i=t),!o){if(!a){if(!(t=function(e,t,r){function n(){var t=window.innerWidth,n=window.innerHeight;e!==document.body&&(t=(n=e.getBoundingClientRect()).right-n.left,n=n.bottom-n.top),i.width=r*t,i.height=r*n,W(i.style,{width:t+"px",height:n+"px"})}var i=document.createElement("canvas");return W(i.style,{border:0,margin:0,padding:0,top:0,left:0}),e.appendChild(i),e===document.body&&(i.style.position="absolute",W(e.style,{margin:0,padding:0})),window.addEventListener("resize",n,!1),n(),{canvas:i,onDestroy:function(){window.removeEventListener("resize",n),e.removeChild(i)}}}(i||document.body,0,c)))return null;a=t.canvas,p=t.onDestroy}o=function(e,t){function r(r){try{return e.getContext(r,t)}catch(e){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(a,e)}return o?{gl:o,canvas:a,container:i,extensions:f,optionalExtensions:u,pixelRatio:c,profile:l,onDone:h,onDestroy:p}:(p(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function a(e,t){for(var r=Array(e),n=0;n<e;++n)r[n]=t(n);return r}function o(e){var t,r;return t=(65535<e)<<4,t|=r=(255<(e>>>=t))<<3,(t|=r=(15<(e>>>=r))<<2)|(r=(3<(e>>>=r))<<1)|e>>>r>>1}function s(){function e(e){e:{for(var t=16;268435456>=t;t*=16)if(e<=t){e=t;break e}e=0}return 0<(t=r[o(e)>>2]).length?t.pop():new ArrayBuffer(e)}function t(e){r[o(e.byteLength)>>2].push(e)}var r=a(8,function(){return[]});return{alloc:e,free:t,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){t(e.buffer)}}}function f(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||Q(e.data))}function u(e,t,r,n,i,a){for(var o=0;o<t;++o)for(var s=e[o],f=0;f<r;++f)for(var u=s[f],c=0;c<n;++c)i[a++]=u[c]}function c(e){return 0|K[Object.prototype.toString.call(e)]}function l(e,t){for(var r=0;r<t.length;++r)e[r]=t[r]}function h(e,t,r,n,i,a,o){for(var s=0,f=0;f<r;++f)for(var u=0;u<n;++u)e[s++]=t[i*f+a*u+o]}function p(e,t,r,n){function i(t){this.id=u++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}function a(t,r,n){t.byteLength=r.byteLength,e.bufferData(t.type,r,n)}function o(e,t,r,n,i,o){if(e.usage=r,Array.isArray(t)){if(e.dtype=n||5126,0<t.length)if(Array.isArray(t[0])){i=ee(t);for(var s=n=1;s<i.length;++s)n*=i[s];e.dimension=n,a(e,t=$(t,i,e.dtype),r),o?e.persistentData=t:N.freeType(t)}else"number"==typeof t[0]?(e.dimension=i,l(i=N.allocType(e.dtype,t.length),t),a(e,i,r),o?e.persistentData=i:N.freeType(i)):Q(t[0])&&(e.dimension=t[0].length,e.dtype=n||c(t[0])||5126,a(e,t=$(t,[t.length,t[0].length],e.dtype),r),o?e.persistentData=t:N.freeType(t))}else if(Q(t))e.dtype=n||c(t),e.dimension=i,a(e,t,r),o&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(f(t)){i=t.shape;var u=t.stride,p=(s=t.offset,0),d=0,m=0,g=0;1===i.length?(p=i[0],d=1,m=u[0],g=0):2===i.length&&(p=i[0],d=i[1],m=u[0],g=u[1]),e.dtype=n||c(t.data)||5126,e.dimension=d,h(i=N.allocType(e.dtype,p*d),t.data,p,d,m,g,s),a(e,i,r),o?e.persistentData=i:N.freeType(i)}}function s(r){t.bufferCount--;for(var i=0;i<n.state.length;++i){var a=n.state[i];a.buffer===r&&(e.disableVertexAttribArray(i),a.buffer=null)}e.deleteBuffer(r.buffer),r.buffer=null,delete p[r.id]}var u=0,p={};i.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},i.prototype.destroy=function(){s(this)};var d=[];return r.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(p).forEach(function(t){e+=p[t].stats.size}),e}),{create:function(n,a,u,d){function m(t){var n=35044,i=null,a=0,s=0,u=1;return Array.isArray(t)||Q(t)||f(t)?i=t:"number"==typeof t?a=0|t:t&&("data"in t&&(i=t.data),"usage"in t&&(n=Z[t.usage]),"type"in t&&(s=J[t.type]),"dimension"in t&&(u=0|t.dimension),"length"in t&&(a=0|t.length)),g.bind(),i?o(g,i,n,s,u,d):(a&&e.bufferData(g.type,a,n),g.dtype=s||5121,g.usage=n,g.dimension=u,g.byteLength=a),r.profile&&(g.stats.size=g.byteLength*te[g.dtype]),m}t.bufferCount++;var g=new i(a);return p[g.id]=g,u||m(n),m._reglType="buffer",m._buffer=g,m.subdata=function(t,r){var n,i=0|(r||0);if(g.bind(),Q(t))e.bufferSubData(g.type,i,t);else if(Array.isArray(t)){if(0<t.length)if("number"==typeof t[0]){var a=N.allocType(g.dtype,t.length);l(a,t),e.bufferSubData(g.type,i,a),N.freeType(a)}else(Array.isArray(t[0])||Q(t[0]))&&(n=ee(t),a=$(t,n,g.dtype),e.bufferSubData(g.type,i,a),N.freeType(a))}else if(f(t)){n=t.shape;var o=t.stride,s=a=0,u=0,p=0;1===n.length?(a=n[0],s=1,u=o[0],p=0):2===n.length&&(a=n[0],s=n[1],u=o[0],p=o[1]),n=Array.isArray(t.data)?g.dtype:c(t.data),h(n=N.allocType(n,a*s),t.data,a,s,u,p,t.offset),e.bufferSubData(g.type,i,n),N.freeType(n)}return m},r.profile&&(m.stats=g.stats),m.destroy=function(){s(g)},m},createStream:function(e,t){var r=d.pop();return r||(r=new i(e)),r.bind(),o(r,t,35040,0,1,!1),r},destroyStream:function(e){d.push(e)},clear:function(){X(p).forEach(s),d.forEach(s)},getBuffer:function(e){return e&&e._buffer instanceof i?e._buffer:null},restore:function(){X(p).forEach(function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)})},_initBuffer:o}}function d(e,t,r,n){function i(e){this.id=u++,s[this.id]=this,this.buffer=e,this.primType=4,this.type=this.vertCount=0}function a(n,i,a,o,s,u,c){if(n.buffer.bind(),i){var l=c;c||Q(i)&&(!f(i)||Q(i.data))||(l=t.oes_element_index_uint?5125:5123),r._initBuffer(n.buffer,i,a,l,3)}else e.bufferData(34963,u,a),n.buffer.dtype=l||5121,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=u;if(l=c,!c){switch(n.buffer.dtype){case 5121:case 5120:l=5121;break;case 5123:case 5122:l=5123;break;case 5125:case 5124:l=5125}n.buffer.dtype=l}n.type=l,0>(i=s)&&(i=n.buffer.byteLength,5123===l?i>>=1:5125===l&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(e){n.elementsCount--,delete s[e.id],e.buffer.destroy(),e.buffer=null}var s={},u=0,c={uint8:5121,uint16:5123};t.oes_element_index_uint&&(c.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var l=[];return{create:function(e,t){function s(e){if(e)if("number"==typeof e)u(e),l.primType=4,l.vertCount=0|e,l.type=5121;else{var t=null,r=35044,n=-1,i=-1,o=0,h=0;Array.isArray(e)||Q(e)||f(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=Z[e.usage]),"primitive"in e&&(n=re[e.primitive]),"count"in e&&(i=0|e.count),"type"in e&&(h=c[e.type]),"length"in e?o=0|e.length:(o=i,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),a(l,t,r,n,i,o,h)}else u(),l.primType=4,l.vertCount=0,l.type=5121;return s}var u=r.create(null,34963,!0),l=new i(u._buffer);return n.elementsCount++,s(e),s._reglType="elements",s._elements=l,s.subdata=function(e,t){return u.subdata(e,t),s},s.destroy=function(){o(l)},s},createStream:function(e){var t=l.pop();return t||(t=new i(r.create(null,34963,!0,!1)._buffer)),a(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){l.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof i?e._elements:null},clear:function(){X(s).forEach(o)}}}function m(e){for(var t=N.allocType(5123,e.length),r=0;r<e.length;++r)if(isNaN(e[r]))t[r]=65535;else if(1/0===e[r])t[r]=31744;else if(-1/0===e[r])t[r]=64512;else{ne[0]=e[r];var n=(a=ie[0])>>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;t[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15<i?n+31744:n+(i+15<<10)+a}return t}function g(e){return Array.isArray(e)||Q(e)}function v(e){return"[object "+e+"]"}function y(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function b(e){return!(!Array.isArray(e)||0===e.length||!g(e[0]))}function x(e){return Object.prototype.toString.call(e)}function w(e){if(!e)return!1;var t=x(e);return 0<=pe.indexOf(t)||(y(e)||b(e)||f(e))}function k(e,t){36193===e.type?(e.data=m(t),N.freeType(t)):e.data=t}function A(e,t,r,n,i,a){if(e=void 0!==me[e]?me[e]:se[e]*de[t],a&&(e*=6),i){for(n=0;1<=r;)n+=e*r*r,r/=2;return n}return e*r*n}function _(e,t,r,n,i,a,o){function s(){this.format=this.internalformat=6408,this.type=5121,this.flipY=this.premultiplyAlpha=this.compressed=!1,this.unpackAlignment=1,this.colorSpace=37444,this.channels=this.height=this.width=0}function u(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function c(e,t){if("object"==typeof t&&t){"premultiplyAlpha"in t&&(e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(e.flipY=t.flipY),"alignment"in t&&(e.unpackAlignment=t.alignment),"colorSpace"in t&&(e.colorSpace=H[t.colorSpace]),"type"in t&&(e.type=q[t.type]);var r=e.width,n=e.height,i=e.channels,a=!1;"shape"in t?(r=t.shape[0],n=t.shape[1],3===t.shape.length&&(i=t.shape[2],a=!0)):("radius"in t&&(r=n=t.radius),"width"in t&&(r=t.width),"height"in t&&(n=t.height),"channels"in t&&(i=t.channels,a=!0)),e.width=0|r,e.height=0|n,e.channels=0|i,r=!1,"format"in t&&(r=t.format,n=e.internalformat=U[r],e.format=ie[n],r in q&&!("type"in t)&&(e.type=q[r]),r in G&&(e.compressed=!0),r=!0),!a&&r?e.channels=se[e.format]:a&&!r&&e.channels!==oe[e.format]&&(e.format=e.internalformat=oe[e.channels])}}function l(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function h(){s.call(this),this.yOffset=this.xOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function p(e,t){var r=null;if(w(t)?r=t:t&&(c(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),w(t.data)&&(r=t.data)),t.copy){var n=i.viewportWidth,a=i.viewportHeight;e.width=e.width||n-e.xOffset,e.height=e.height||a-e.yOffset,e.needsCopy=!0}else if(r){if(Q(r))e.channels=e.channels||4,e.data=r,"type"in t||5121!==e.type||(e.type=0|K[Object.prototype.toString.call(r)]);else if(y(r)){switch(e.channels=e.channels||4,a=(n=r).length,e.type){case 5121:case 5123:case 5125:case 5126:(a=N.allocType(e.type,a)).set(n),e.data=a;break;case 36193:e.data=m(n)}e.alignment=1,e.needsFree=!0}else if(f(r)){n=r.data,Array.isArray(n)||5121!==e.type||(e.type=0|K[Object.prototype.toString.call(n)]);a=r.shape;var o,s,u,l,h=r.stride;3===a.length?(u=a[2],l=h[2]):l=u=1,o=a[0],s=a[1],a=h[0],h=h[1],e.alignment=1,e.width=o,e.height=s,e.channels=u,e.format=e.internalformat=oe[u],e.needsFree=!0,o=l,r=r.offset,u=e.width,l=e.height,s=e.channels;for(var p=N.allocType(36193===e.type?5126:e.type,u*l*s),d=0,v=0;v<l;++v)for(var A=0;A<u;++A)for(var _=0;_<s;++_)p[d++]=n[a*A+h*v+o*_+r];k(e,p)}else if(x(r)===fe||x(r)===ue)x(r)===fe?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(x(r)===ce)e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(x(r)===le)e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(x(r)===he)e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(b(r)){for(n=e.width||r[0].length,a=e.height||r.length,h=e.channels,h=g(r[0][0])?h||r[0][0].length:h||1,o=Y.shape(r),u=1,l=0;l<o.length;++l)u*=o[l];u=N.allocType(36193===e.type?5126:e.type,u),Y.flatten(r,o,"",u),k(e,u),e.alignment=1,e.width=n,e.height=a,e.channels=h,e.format=e.internalformat=oe[h],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4}function d(t,r,i,a,o){var s=t.element,f=t.data,u=t.internalformat,c=t.format,h=t.type,p=t.width,d=t.height;l(t),s?e.texSubImage2D(r,o,i,a,c,h,s):t.compressed?e.compressedTexSubImage2D(r,o,i,a,u,p,d,f):t.needsCopy?(n(),e.copyTexSubImage2D(r,o,i,a,t.xOffset,t.yOffset,p,d)):e.texSubImage2D(r,o,i,a,p,d,c,h,f)}function v(){return pe.pop()||new h}function _(e){e.needsFree&&N.freeType(e.data),h.call(e),pe.push(e)}function S(e,t,r){var n=e.images[0]=v();e.mipmask=1,n.width=e.width=t,n.height=e.height=r,n.channels=e.channels=4}function M(e,t){var r=null;if(w(t))u(r=e.images[0]=v(),e),p(r,t),e.mipmask=1;else if(c(e,t),Array.isArray(t.mipmap))for(var n=t.mipmap,i=0;i<n.length;++i)u(r=e.images[i]=v(),e),r.width>>=i,r.height>>=i,p(r,n[i]),e.mipmask|=1<<i;else u(r=e.images[0]=v(),e),p(r,t),e.mipmask=1;u(e,e.images[0])}function T(t,r){for(var i=t.images,a=0;a<i.length&&i[a];++a){var o=i[a],s=r,f=a,u=o.element,c=o.data,h=o.internalformat,p=o.format,d=o.type,m=o.width,g=o.height,v=o.channels;l(o),u?e.texImage2D(s,f,p,p,d,u):o.compressed?e.compressedTexImage2D(s,f,h,m,g,0,c):o.needsCopy?(n(),e.copyTexImage2D(s,f,p,o.xOffset,o.yOffset,m,g,0)):((o=!c)&&(c=N.zero.allocType(d,m*g*v)),e.texImage2D(s,f,p,m,g,0,p,d,c),o&&c&&N.zero.freeType(c))}}function F(){var e=de.pop()||new function(){s.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)};s.call(e);for(var t=e.mipmask=0;16>t;++t)e.images[t]=null;return e}function O(e){for(var t=e.images,r=0;r<t.length;++r)t[r]&&_(t[r]),t[r]=null;de.push(e)}function E(){this.magFilter=this.minFilter=9728,this.wrapT=this.wrapS=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function C(e,t){"min"in t&&(e.minFilter=V[t.min],0<=ae.indexOf(e.minFilter)&&!("faces"in t)&&(e.genMipmaps=!0)),"mag"in t&&(e.magFilter=R[t.mag]);var r=e.wrapS,n=e.wrapT;if("wrap"in t){var i=t.wrap;"string"==typeof i?r=n=L[i]:Array.isArray(i)&&(r=L[i[0]],n=L[i[1]])}else"wrapS"in t&&(r=L[t.wrapS]),"wrapT"in t&&(n=L[t.wrapT]);if(e.wrapS=r,e.wrapT=n,"anisotropic"in t&&(e.anisotropic=t.anisotropic),"mipmap"in t){switch(r=!1,typeof t.mipmap){case"string":e.mipmapHint=I[t.mipmap],r=e.genMipmaps=!0;break;case"boolean":r=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,r=!0}!r||"min"in t||(e.minFilter=9984)}}function D(r,n){e.texParameteri(n,10241,r.minFilter),e.texParameteri(n,10240,r.magFilter),e.texParameteri(n,10242,r.wrapS),e.texParameteri(n,10243,r.wrapT),t.ext_texture_filter_anisotropic&&e.texParameteri(n,34046,r.anisotropic),r.genMipmaps&&(e.hint(33170,r.mipmapHint),e.generateMipmap(n))}function z(t){s.call(this),this.mipmask=0,this.internalformat=6408,this.id=me++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new E,o.profile&&(this.stats={size:0})}function P(t){e.activeTexture(33984),e.bindTexture(t.target,t.texture)}function j(){var t=ye[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(3553,null)}function B(t){var r=t.texture,n=t.unit,i=t.target;0<=n&&(e.activeTexture(33984+n),e.bindTexture(i,null),ye[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete ge[t.id],a.textureCount--}var I={"don't care":4352,"dont care":4352,nice:4354,fast:4353},L={repeat:10497,clamp:33071,mirror:33648},R={nearest:9728,linear:9729},V=W({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},R),H={none:0,browser:37444},q={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},U={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},G={};t.ext_srgb&&(U.srgb=35904,U.srgba=35906),t.oes_texture_float&&(q.float32=q.float=5126),t.oes_texture_half_float&&(q.float16=q["half float"]=36193),t.webgl_depth_texture&&(W(U,{depth:6402,"depth stencil":34041}),W(q,{uint16:5123,uint32:5125,"depth stencil":34042})),t.webgl_compressed_texture_s3tc&&W(G,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),t.webgl_compressed_texture_atc&&W(G,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),t.webgl_compressed_texture_pvrtc&&W(G,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),t.webgl_compressed_texture_etc1&&(G["rgb etc1"]=36196);var J=Array.prototype.slice.call(e.getParameter(34467));Object.keys(G).forEach(function(e){var t=G[e];0<=J.indexOf(t)&&(U[e]=t)});var Z=Object.keys(U);r.textureFormats=Z;var $=[];Object.keys(U).forEach(function(e){$[U[e]]=e});var ee=[];Object.keys(q).forEach(function(e){ee[q[e]]=e});var te=[];Object.keys(R).forEach(function(e){te[R[e]]=e});var re=[];Object.keys(V).forEach(function(e){re[V[e]]=e});var ne=[];Object.keys(L).forEach(function(e){ne[L[e]]=e});var ie=Z.reduce(function(e,t){var r=U[t];return 6409===r||6406===r||6409===r||6410===r||6402===r||34041===r?e[r]=r:32855===r||0<=t.indexOf("rgba")?e[r]=6408:e[r]=6407,e},{}),pe=[],de=[],me=0,ge={},ve=r.maxTextureUnits,ye=Array(ve).map(function(){return null});return W(z.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(0>t){for(var r=0;r<ve;++r){var n=ye[r];if(n){if(0<n.bindCount)continue;n.unit=-1}ye[r]=this,t=r;break}o.profile&&a.maxTextureUnits<t+1&&(a.maxTextureUnits=t+1),this.unit=t,e.activeTexture(33984+t),e.bindTexture(this.target,this.texture)}return t},unbind:function(){--this.bindCount},decRef:function(){0>=--this.refCount&&B(this)}}),o.profile&&(a.getTotalTextureSize=function(){var e=0;return Object.keys(ge).forEach(function(t){e+=ge[t].stats.size}),e}),{create2D:function(t,r){function n(e,t){var r=i.texInfo;E.call(r);var a=F();return"number"==typeof e?S(a,0|e,"number"==typeof t?0|t:0|e):e?(C(r,e),M(a,e)):S(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,u(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,P(i),T(a,3553),D(r,3553),j(),O(a),o.profile&&(i.stats.size=A(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=$[i.internalformat],n.type=ee[i.type],n.mag=te[r.magFilter],n.min=re[r.minFilter],n.wrapS=ne[r.wrapS],n.wrapT=ne[r.wrapT],n}var i=new z(3553);return ge[i.id]=i,a.textureCount++,n(t,r),n.subimage=function(e,t,r,a){t|=0,r|=0,a|=0;var o=v();return u(o,i),o.width=0,o.height=0,p(o,e),o.width=o.width||(i.width>>a)-t,o.height=o.height||(i.height>>a)-r,P(i),d(o,3553,t,r,a),j(),_(o),n},n.resize=function(t,r){var a=0|t,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,P(i);for(var f,u=i.channels,c=i.type,l=0;i.mipmask>>l;++l){var h=a>>l,p=s>>l;if(!h||!p)break;f=N.zero.allocType(c,h*p*u),e.texImage2D(3553,l,i.format,h,p,0,i.format,i.type,f),f&&N.zero.freeType(f)}return j(),o.profile&&(i.stats.size=A(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(t,r,n,i,s,f){function l(e,t,r,n,i,a){var s,f=h.texInfo;for(E.call(f),s=0;6>s;++s)m[s]=F();if("number"!=typeof e&&e){if("object"==typeof e)if(t)M(m[0],e),M(m[1],t),M(m[2],r),M(m[3],n),M(m[4],i),M(m[5],a);else if(C(f,e),c(h,e),"faces"in e)for(e=e.faces,s=0;6>s;++s)u(m[s],h),M(m[s],e[s]);else for(s=0;6>s;++s)M(m[s],e)}else for(e=0|e||1,s=0;6>s;++s)S(m[s],e,e);for(u(h,m[0]),h.mipmask=f.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,h.internalformat=m[0].internalformat,l.width=m[0].width,l.height=m[0].height,P(h),s=0;6>s;++s)T(m[s],34069+s);for(D(f,34067),j(),o.profile&&(h.stats.size=A(h.internalformat,h.type,l.width,l.height,f.genMipmaps,!0)),l.format=$[h.internalformat],l.type=ee[h.type],l.mag=te[f.magFilter],l.min=re[f.minFilter],l.wrapS=ne[f.wrapS],l.wrapT=ne[f.wrapT],s=0;6>s;++s)O(m[s]);return l}var h=new z(34067);ge[h.id]=h,a.cubeCount++;var m=Array(6);return l(t,r,n,i,s,f),l.subimage=function(e,t,r,n,i){r|=0,n|=0,i|=0;var a=v();return u(a,h),a.width=0,a.height=0,p(a,t),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,P(h),d(a,34069+e,r,n,i),j(),_(a),l},l.resize=function(t){if((t|=0)!==h.width){l.width=h.width=t,l.height=h.height=t,P(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)e.texImage2D(34069+r,n,h.format,t>>n,t>>n,0,h.format,h.type,null);return j(),o.profile&&(h.stats.size=A(h.internalformat,h.type,l.width,l.height,!1,!0)),l}},l._reglType="textureCube",l._texture=h,o.profile&&(l.stats=h.stats),l.destroy=function(){h.decRef()},l},clear:function(){for(var t=0;t<ve;++t)e.activeTexture(33984+t),e.bindTexture(3553,null),ye[t]=null;X(ge).forEach(B),a.cubeCount=0,a.textureCount=0},getTexture:function(e){return null},restore:function(){X(ge).forEach(function(t){t.texture=e.createTexture(),e.bindTexture(t.target,t.texture);for(var r=0;32>r;++r)if(0!=(t.mipmask&1<<r))if(3553===t.target)e.texImage2D(3553,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;6>n;++n)e.texImage2D(34069+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);D(t.texInfo,t.target)})}}}function S(e,t,r,n,i,a){function o(e,t,r){this.target=e,this.texture=t,this.renderbuffer=r;var n=e=0;t?(e=t.width,n=t.height):r&&(e=r.width,n=r.height),this.width=e,this.height=n}function s(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function f(e,t,r){e&&(e.texture?e.texture._texture.refCount+=1:e.renderbuffer._renderbuffer.refCount+=1)}function u(t,r){r&&(r.texture?e.framebufferTexture2D(36160,t,r.target,r.texture._texture.texture,0):e.framebufferRenderbuffer(36160,t,36161,r.renderbuffer._renderbuffer.renderbuffer))}function c(e){var t=3553,r=null,n=null,i=e;return"object"==typeof e&&(i=e.data,"target"in e&&(t=0|e.target)),"texture2d"===(e=i._reglType)?r=i:"textureCube"===e?r=i:"renderbuffer"===e&&(n=i,t=36161),new o(t,r,n)}function l(e,t,r,a,s){return r?((e=n.create2D({width:e,height:t,format:a,type:s}))._texture.refCount=0,new o(3553,e,null)):((e=i.create({width:e,height:t,format:a}))._renderbuffer.refCount=0,new o(36161,null,e))}function h(e){return e&&(e.texture||e.renderbuffer)}function p(e,t,r){e&&(e.texture?e.texture.resize(t,r):e.renderbuffer&&e.renderbuffer.resize(t,r))}function d(){this.id=A++,_[this.id]=this,this.framebuffer=e.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(e){e.colorAttachments.forEach(s),s(e.depthAttachment),s(e.stencilAttachment),s(e.depthStencilAttachment)}function g(t){e.deleteFramebuffer(t.framebuffer),t.framebuffer=null,a.framebufferCount--,delete _[t.id]}function v(t){var n;e.bindFramebuffer(36160,t.framebuffer);var i=t.colorAttachments;for(n=0;n<i.length;++n)u(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)e.framebufferTexture2D(36160,36064+n,3553,null,0);e.framebufferTexture2D(36160,33306,3553,null,0),e.framebufferTexture2D(36160,36096,3553,null,0),e.framebufferTexture2D(36160,36128,3553,null,0),u(36096,t.depthAttachment),u(36128,t.stencilAttachment),u(33306,t.depthStencilAttachment),e.checkFramebufferStatus(36160),e.bindFramebuffer(36160,b.next?b.next.framebuffer:null),b.cur=b.next,e.getError()}function y(e,t){function r(e,t){var i,a=0,o=0,s=!0,u=!0;i=null;var p=!0,d="rgba",g="uint8",y=1,b=null,k=null,A=null,_=!1;"number"==typeof e?(a=0|e,o=0|t||a):e?("shape"in e?(a=(o=e.shape)[0],o=o[1]):("radius"in e&&(a=o=e.radius),"width"in e&&(a=e.width),"height"in e&&(o=e.height)),("color"in e||"colors"in e)&&(i=e.color||e.colors,Array.isArray(i)),i||("colorCount"in e&&(y=0|e.colorCount),"colorTexture"in e&&(p=!!e.colorTexture,d="rgba4"),"colorType"in e&&(g=e.colorType,!p)&&("half float"===g||"float16"===g?d="rgba16f":"float"!==g&&"float32"!==g||(d="rgba32f")),"colorFormat"in e&&(d=e.colorFormat,0<=x.indexOf(d)?p=!0:0<=w.indexOf(d)&&(p=!1))),("depthTexture"in e||"depthStencilTexture"in e)&&(_=!(!e.depthTexture&&!e.depthStencilTexture)),"depth"in e&&("boolean"==typeof e.depth?s=e.depth:(b=e.depth,u=!1)),"stencil"in e&&("boolean"==typeof e.stencil?u=e.stencil:(k=e.stencil,s=!1)),"depthStencil"in e&&("boolean"==typeof e.depthStencil?s=u=e.depthStencil:(A=e.depthStencil,u=s=!1))):a=o=1;var S=null,M=null,T=null,F=null;if(Array.isArray(i))S=i.map(c);else if(i)S=[c(i)];else for(S=Array(y),i=0;i<y;++i)S[i]=l(a,o,p,d,g);for(a=a||S[0].width,o=o||S[0].height,b?M=c(b):s&&!u&&(M=l(a,o,_,"depth","uint32")),k?T=c(k):u&&!s&&(T=l(a,o,!1,"stencil","uint8")),A?F=c(A):!b&&!k&&u&&s&&(F=l(a,o,_,"depth stencil","depth stencil")),s=null,i=0;i<S.length;++i)f(S[i]),S[i]&&S[i].texture&&(u=ye[S[i].texture._texture.format]*be[S[i].texture._texture.type],null===s&&(s=u));return f(M),f(T),f(F),m(n),n.width=a,n.height=o,n.colorAttachments=S,n.depthAttachment=M,n.stencilAttachment=T,n.depthStencilAttachment=F,r.color=S.map(h),r.depth=h(M),r.stencil=h(T),r.depthStencil=h(F),r.width=n.width,r.height=n.height,v(n),r}var n=new d;return a.framebufferCount++,r(e,t),W(r,{resize:function(e,t){var i=0|e,a=0|t||i;if(i===n.width&&a===n.height)return r;for(var o=n.colorAttachments,s=0;s<o.length;++s)p(o[s],i,a);return p(n.depthAttachment,i,a),p(n.stencilAttachment,i,a),p(n.depthStencilAttachment,i,a),n.width=r.width=i,n.height=r.height=a,v(n),r},_reglType:"framebuffer",_framebuffer:n,destroy:function(){g(n),m(n)},use:function(e){b.setFBO({framebuffer:r},e)}})}var b={cur:null,next:null,dirty:!1,setFBO:null},x=["rgba"],w=["rgba4","rgb565","rgb5 a1"];t.ext_srgb&&w.push("srgba"),t.ext_color_buffer_half_float&&w.push("rgba16f","rgb16f"),t.webgl_color_buffer_float&&w.push("rgba32f");var k=["uint8"];t.oes_texture_half_float&&k.push("half float","float16"),t.oes_texture_float&&k.push("float","float32");var A=0,_={};return W(b,{getFramebuffer:function(e){return"function"==typeof e&&"framebuffer"===e._reglType&&(e=e._framebuffer)instanceof d?e:null},create:y,createCube:function(e){function t(e){var i,a={color:null},o=0,s=null;i="rgba";var f="uint8",u=1;if("number"==typeof e?o=0|e:e?("shape"in e?o=e.shape[0]:("radius"in e&&(o=0|e.radius),"width"in e?o=0|e.width:"height"in e&&(o=0|e.height)),("color"in e||"colors"in e)&&(s=e.color||e.colors,Array.isArray(s)),s||("colorCount"in e&&(u=0|e.colorCount),"colorType"in e&&(f=e.colorType),"colorFormat"in e&&(i=e.colorFormat)),"depth"in e&&(a.depth=e.depth),"stencil"in e&&(a.stencil=e.stencil),"depthStencil"in e&&(a.depthStencil=e.depthStencil)):o=1,s)if(Array.isArray(s))for(e=[],i=0;i<s.length;++i)e[i]=s[i];else e=[s];else for(e=Array(u),s={radius:o,format:i,type:f},i=0;i<u;++i)e[i]=n.createCube(s);for(a.color=Array(e.length),i=0;i<e.length;++i)u=e[i],o=o||u.width,a.color[i]={target:34069,data:e[i]};for(i=0;6>i;++i){for(u=0;u<e.length;++u)a.color[u].target=34069+i;0<i&&(a.depth=r[0].depth,a.stencil=r[0].stencil,a.depthStencil=r[0].depthStencil),r[i]?r[i](a):r[i]=y(a)}return W(t,{width:o,height:o,color:e})}var r=Array(6);return t(e),W(t,{faces:r,resize:function(e){var n=0|e;if(n===t.width)return t;var i=t.color;for(e=0;e<i.length;++e)i[e].resize(n);for(e=0;6>e;++e)r[e].resize(n);return t.width=t.height=n,t},_reglType:"framebufferCube",destroy:function(){r.forEach(function(e){e.destroy()})}})},clear:function(){X(_).forEach(g)},restore:function(){X(_).forEach(function(t){t.framebuffer=e.createFramebuffer(),v(t)})}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function T(e,t,r,n){function i(e,t,r,n){this.name=e,this.id=t,this.location=r,this.info=n}function a(e,t){for(var r=0;r<e.length;++r)if(e[r].id===t.id)return void(e[r].location=t.location);e.push(t)}function o(r,n,i){if(!(o=(i=35632===r?u:c)[n])){var a=t.str(n),o=e.createShader(r);e.shaderSource(o,a),e.compileShader(o),i[n]=o}return o}function s(e,t){this.id=p++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function f(r,s){var f,u;f=o(35632,r.fragId),u=o(35633,r.vertId);var c=r.program=e.createProgram();e.attachShader(c,f),e.attachShader(c,u),e.linkProgram(c);var l=e.getProgramParameter(c,35718);n.profile&&(r.stats.uniformsCount=l);var h=r.uniforms;for(f=0;f<l;++f)if(u=e.getActiveUniform(c,f))if(1<u.size)for(var p=0;p<u.size;++p){var d=u.name.replace("[0]","["+p+"]");a(h,new i(d,t.id(d),e.getUniformLocation(c,d),u))}else a(h,new i(u.name,t.id(u.name),e.getUniformLocation(c,u.name),u));for(l=e.getProgramParameter(c,35721),n.profile&&(r.stats.attributesCount=l),h=r.attributes,f=0;f<l;++f)(u=e.getActiveAttrib(c,f))&&a(h,new i(u.name,t.id(u.name),e.getAttribLocation(c,u.name),u))}var u={},c={},l={},h=[],p=0;return n.profile&&(r.getMaxUniformsCount=function(){var e=0;return h.forEach(function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)}),e},r.getMaxAttributesCount=function(){var e=0;return h.forEach(function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)}),e}),{clear:function(){var t=e.deleteShader.bind(e);X(u).forEach(t),u={},X(c).forEach(t),c={},h.forEach(function(t){e.deleteProgram(t.program)}),h.length=0,l={},r.shaderCount=0},program:function(e,t,n){var i=l[t];i||(i=l[t]={});var a=i[e];return a||(a=new s(t,e),r.shaderCount++,f(a),i[e]=a,h.push(a)),a},restore:function(){u={},c={};for(var e=0;e<h.length;++e)f(h[e])},shader:o,frag:-1,vert:-1}}function F(e,t,r,n,i,a,o){function s(i){var a;a=null===t.next?5121:t.next.colorAttachments[0].texture._texture.type;var o=0,s=0,f=n.framebufferWidth,u=n.framebufferHeight,c=null;return Q(i)?c=i:i&&(o=0|i.x,s=0|i.y,f=0|(i.width||n.framebufferWidth-o),u=0|(i.height||n.framebufferHeight-s),c=i.data||null),r(),i=f*u*4,c||(5121===a?c=new Uint8Array(i):5126===a&&(c=c||new Float32Array(i))),e.pixelStorei(3333,4),e.readPixels(o,s,f,u,6408,a,c),c}return function(e){return e&&"framebuffer"in e?function(e){var r;return t.setFBO({framebuffer:e.framebuffer},function(){r=s(e)}),r}(e):s(e)}}function O(e){return Array.prototype.slice.call(e)}function E(e){return O(e).join("")}function C(){function e(){var e=[],t=[];return W(function(){e.push.apply(e,O(arguments))},{def:function(){var n="v"+r++;return t.push(n),0<arguments.length&&(e.push(n,"="),e.push.apply(e,O(arguments)),e.push(";")),n},toString:function(){return E([0<t.length?"var "+t+";":"",E(e)])}})}function t(){function t(e,t){n(e,t,"=",r.def(e,t),";")}var r=e(),n=e(),i=r.toString,a=n.toString;return W(function(){r.apply(r,O(arguments))},{def:r.def,entry:r,exit:n,save:t,set:function(e,n,i){t(e,n),r(e,n,"=",i,";")},toString:function(){return i()+a()}})}var r=0,n=[],i=[],a=e(),o={};return{global:a,link:function(e){for(var t=0;t<i.length;++t)if(i[t]===e)return n[t];return t="g"+r++,n.push(t),i.push(e),t},block:e,proc:function(e,r){function n(){var e="a"+i.length;return i.push(e),e}var i=[];r=r||0;for(var a=0;a<r;++a)n();var s=(a=t()).toString;return o[e]=W(a,{arg:n,toString:function(){return E(["function(",i.join(),"){",s(),"}"])}})},scope:t,cond:function(){var e=E(arguments),r=t(),n=t(),i=r.toString,a=n.toString;return W(r,{then:function(){return r.apply(r,O(arguments)),this},else:function(){return n.apply(n,O(arguments)),this},toString:function(){var t=a();return t&&(t="else{"+t+"}"),E(["if(",e,"){",i(),"}",t])}})},compile:function(){var e=['"use strict";',a,"return {"];Object.keys(o).forEach(function(t){e.push('"',t,'":',o[t].toString(),",")}),e.push("}");var t=E(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(t)).apply(null,i)}}}function D(e){return Array.isArray(e)||Q(e)||f(e)}function z(e){return e.sort(function(e,t){return"viewport"===e?-1:"viewport"===t?1:e<t?-1:1})}function P(e,t,r,n){this.thisDep=e,this.contextDep=t,this.propDep=r,this.append=n}function j(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function B(e){return new P(!1,!1,!1,e)}function I(e,t){var r=e.type;return 0===r?new P(!0,1<=(r=e.data.length),2<=r,t):4===r?new P((r=e.data).thisDep,r.contextDep,r.propDep,t):new P(3===r,2===r,1===r,t)}function L(e,t,r,n,i,o,s,f,u,c,l,h,p,d,m){function v(e){return e.replace(".","_")}function y(e,t,r){var n=v(e);ne.push(e),te[n]=ee[n]=!!r,ie[n]=t}function b(e,t,r){var n=v(e);ne.push(e),Array.isArray(r)?(ee[n]=r.slice(),te[n]=r.slice()):ee[n]=te[n]=r,ae[n]=t}function x(){var e=C(),r=e.link,n=e.global;e.id=fe++,e.batchId="0";var i=r(oe),a=e.shared={props:"a0"};Object.keys(oe).forEach(function(e){a[e]=n.def(i,".",e)});var o=e.next={},s=e.current={};Object.keys(ae).forEach(function(e){Array.isArray(ee[e])&&(o[e]=n.def(a.next,".",e),s[e]=n.def(a.current,".",e))});var f=e.constants={};Object.keys(se).forEach(function(e){f[e]=n.def(JSON.stringify(se[e]))}),e.invoke=function(t,n){switch(n.type){case 0:var i=["this",a.context,a.props,e.batchId];return t.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return t.def(a.props,n.data);case 2:return t.def(a.context,n.data);case 3:return t.def("this",n.data);case 4:return n.data.append(e,t),n.data.ref}},e.attribCache={};var u={};return e.scopeAttrib=function(e){if((e=t.id(e))in u)return u[e];var n=c.scope[e];return n||(n=c.scope[e]=new Y),u[e]=r(n)},e}function w(e,t){var r=e.static,n=e.dynamic;if("framebuffer"in r){var i=r.framebuffer;return i?(i=f.getFramebuffer(i),B(function(e,t){var r=e.link(i),n=e.shared;return t.set(n.framebuffer,".next",r),n=n.context,t.set(n,".framebufferWidth",r+".width"),t.set(n,".framebufferHeight",r+".height"),r})):B(function(e,t){var r=e.shared;return t.set(r.framebuffer,".next","null"),r=r.context,t.set(r,".framebufferWidth",r+".drawingBufferWidth"),t.set(r,".framebufferHeight",r+".drawingBufferHeight"),"null"})}if("framebuffer"in n){var a=n.framebuffer;return I(a,function(e,t){var r=e.invoke(t,a),n=e.shared,i=n.framebuffer;r=t.def(i,".getFramebuffer(",r,")");return t.set(i,".next",r),n=n.context,t.set(n,".framebufferWidth",r+"?"+r+".width:"+n+".drawingBufferWidth"),t.set(n,".framebufferHeight",r+"?"+r+".height:"+n+".drawingBufferHeight"),r})}return null}function k(e){function r(e){if(e in n){var r=t.id(n[e]);return(e=B(function(){return r})).id=r,e}if(e in i){var a=i[e];return I(a,function(e,t){var r=e.invoke(t,a);return t.def(e.shared.strings,".id(",r,")")})}return null}var n=e.static,i=e.dynamic,a=r("frag"),o=r("vert"),s=null;return j(a)&&j(o)?(s=l.program(o.id,a.id),e=B(function(e,t){return e.link(s)})):e=new P(a&&a.thisDep||o&&o.thisDep,a&&a.contextDep||o&&o.contextDep,a&&a.propDep||o&&o.propDep,function(e,t){var r,n,i=e.shared.shader;return r=a?a.append(e,t):t.def(i,".","frag"),n=o?o.append(e,t):t.def(i,".","vert"),t.def(i+".program("+n+","+r+")")}),{frag:a,vert:o,progVar:e,program:s}}function A(e,t){function r(e,t){if(e in n){var r=0|n[e];return B(function(e,n){return t&&(e.OFFSET=r),r})}if(e in i){var o=i[e];return I(o,function(e,r){var n=e.invoke(r,o);return t&&(e.OFFSET=n),n})}return t&&a?B(function(e,t){return e.OFFSET="0",0}):null}var n=e.static,i=e.dynamic,a=function(){if("elements"in n){var e=n.elements;D(e)?e=o.getElements(o.create(e,!0)):e&&(e=o.getElements(e));var t=B(function(t,r){if(e){var n=t.link(e);return t.ELEMENTS=n}return t.ELEMENTS=null});return t.value=e,t}if("elements"in i){var r=i.elements;return I(r,function(e,t){var n=(i=e.shared).isBufferArgs,i=i.elements,a=e.invoke(t,r),o=t.def("null");n=t.def(n,"(",a,")"),a=e.cond(n).then(o,"=",i,".createStream(",a,");").else(o,"=",i,".getElements(",a,");");return t.entry(a),t.exit(e.cond(n).then(i,".destroyStream(",o,");")),e.ELEMENTS=o})}return null}(),s=r("offset",!0);return{elements:a,primitive:function(){if("primitive"in n){var e=n.primitive;return B(function(t,r){return re[e]})}if("primitive"in i){var t=i.primitive;return I(t,function(e,r){var n=e.constants.primTypes,i=e.invoke(r,t);return r.def(n,"[",i,"]")})}return a?j(a)?a.value?B(function(e,t){return t.def(e.ELEMENTS,".primType")}):B(function(){return 4}):new P(a.thisDep,a.contextDep,a.propDep,function(e,t){var r=e.ELEMENTS;return t.def(r,"?",r,".primType:",4)}):null}(),count:function(){if("count"in n){var e=0|n.count;return B(function(){return e})}if("count"in i){var t=i.count;return I(t,function(e,r){return e.invoke(r,t)})}return a?j(a)?a?s?new P(s.thisDep,s.contextDep,s.propDep,function(e,t){return t.def(e.ELEMENTS,".vertCount-",e.OFFSET)}):B(function(e,t){return t.def(e.ELEMENTS,".vertCount")}):B(function(){return-1}):new P(a.thisDep||s.thisDep,a.contextDep||s.contextDep,a.propDep||s.propDep,function(e,t){var r=e.ELEMENTS;return e.OFFSET?t.def(r,"?",r,".vertCount-",e.OFFSET,":-1"):t.def(r,"?",r,".vertCount:-1")}):null}(),instances:r("instances",!1),offset:s}}function _(e,r){var n=e.static,a=e.dynamic,o={};return Object.keys(n).forEach(function(e){var r=n[e],a=t.id(e),s=new Y;if(D(r))s.state=1,s.buffer=i.getBuffer(i.create(r,34962,!1,!0)),s.type=0;else if(u=i.getBuffer(r))s.state=1,s.buffer=u,s.type=0;else if("constant"in r){var f=r.constant;s.buffer="null",s.state=2,"number"==typeof f?s.x=f:xe.forEach(function(e,t){t<f.length&&(s[e]=f[t])})}else{var u=D(r.buffer)?i.getBuffer(i.create(r.buffer,34962,!1,!0)):i.getBuffer(r.buffer),c=0|r.offset,l=0|r.stride,h=0|r.size,p=!!r.normalized,d=0;"type"in r&&(d=J[r.type]),r=0|r.divisor,s.buffer=u,s.state=1,s.size=h,s.normalized=p,s.type=d||u.dtype,s.offset=c,s.stride=l,s.divisor=r}o[e]=B(function(e,t){var r=e.attribCache;if(a in r)return r[a];var n={isStream:!1};return Object.keys(s).forEach(function(e){n[e]=s[e]}),s.buffer&&(n.buffer=e.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[a]=n})}),Object.keys(a).forEach(function(e){var t=a[e];o[e]=I(t,function(e,r){function n(e){r(f[e],"=",i,".",e,"|0;")}var i=e.invoke(r,t),a=e.shared,o=a.isBufferArgs,s=a.buffer,f={isStream:r.def(!1)},u=new Y;u.state=1,Object.keys(u).forEach(function(e){f[e]=r.def(""+u[e])});var c=f.buffer,l=f.type;return r("if(",o,"(",i,")){",f.isStream,"=true;",c,"=",s,".createStream(",34962,",",i,");",l,"=",c,".dtype;","}else{",c,"=",s,".getBuffer(",i,");","if(",c,"){",l,"=",c,".dtype;",'}else if("constant" in ',i,"){",f.state,"=",2,";","if(typeof "+i+'.constant === "number"){',f[xe[0]],"=",i,".constant;",xe.slice(1).map(function(e){return f[e]}).join("="),"=0;","}else{",xe.map(function(e,t){return f[e]+"="+i+".constant.length>"+t+"?"+i+".constant["+t+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",c,"=",s,".createStream(",34962,",",i,".buffer);","}else{",c,"=",s,".getBuffer(",i,".buffer);","}",l,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",c,".dtype;",f.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",f.isStream,"){",s,".destroyStream(",c,");","}"),f})}),o}function S(e,t,r,n,i){var o=w(e),s=function(e,t,r){function n(e){if(e in i){var r=i[e];e=!0;var n,o,s=0|r.x,f=0|r.y;return"width"in r?n=0|r.width:e=!1,"height"in r?o=0|r.height:e=!1,new P(!e&&t&&t.thisDep,!e&&t&&t.contextDep,!e&&t&&t.propDep,function(e,t){var i=e.shared.context,a=n;"width"in r||(a=t.def(i,".","framebufferWidth","-",s));var u=o;return"height"in r||(u=t.def(i,".","framebufferHeight","-",f)),[s,f,a,u]})}if(e in a){var u=a[e];return e=I(u,function(e,t){var r=e.invoke(t,u),n=e.shared.context,i=t.def(r,".x|0"),a=t.def(r,".y|0");return[i,a,t.def('"width" in ',r,"?",r,".width|0:","(",n,".","framebufferWidth","-",i,")"),r=t.def('"height" in ',r,"?",r,".height|0:","(",n,".","framebufferHeight","-",a,")")]}),t&&(e.thisDep=e.thisDep||t.thisDep,e.contextDep=e.contextDep||t.contextDep,e.propDep=e.propDep||t.propDep),e}return t?new P(t.thisDep,t.contextDep,t.propDep,function(e,t){var r=e.shared.context;return[0,0,t.def(r,".","framebufferWidth"),t.def(r,".","framebufferHeight")]}):null}var i=e.static,a=e.dynamic;if(e=n("viewport")){var o=e;e=new P(e.thisDep,e.contextDep,e.propDep,function(e,t){var r=o.append(e,t),n=e.shared.context;return t.set(n,".viewportWidth",r[2]),t.set(n,".viewportHeight",r[3]),r})}return{viewport:e,scissor_box:n("scissor.box")}}(e,o),f=A(e),u=function(e,t){var r=e.static,n=e.dynamic,i={};return ne.forEach(function(e){function t(t,a){if(e in r){var s=t(r[e]);i[o]=B(function(){return s})}else if(e in n){var f=n[e];i[o]=I(f,function(e,t){return a(e,t,e.invoke(t,f))})}}var o=v(e);switch(e){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return t(function(e){return e},function(e,t,r){return r});case"depth.func":return t(function(e){return Ae[e]},function(e,t,r){return t.def(e.constants.compareFuncs,"[",r,"]")});case"depth.range":return t(function(e){return e},function(e,t,r){return[t.def("+",r,"[0]"),t=t.def("+",r,"[1]")]});case"blend.func":return t(function(e){return[ke["srcRGB"in e?e.srcRGB:e.src],ke["dstRGB"in e?e.dstRGB:e.dst],ke["srcAlpha"in e?e.srcAlpha:e.src],ke["dstAlpha"in e?e.dstAlpha:e.dst]]},function(e,t,r){function n(e,n){return t.def('"',e,n,'" in ',r,"?",r,".",e,n,":",r,".",e)}e=e.constants.blendFuncs;var i=n("src","RGB"),a=n("dst","RGB"),o=(i=t.def(e,"[",i,"]"),t.def(e,"[",n("src","Alpha"),"]"));return[i,a=t.def(e,"[",a,"]"),o,e=t.def(e,"[",n("dst","Alpha"),"]")]});case"blend.equation":return t(function(e){return"string"==typeof e?[K[e],K[e]]:"object"==typeof e?[K[e.rgb],K[e.alpha]]:void 0},function(e,t,r){var n=e.constants.blendEquations,i=t.def(),a=t.def();return(e=e.cond("typeof ",r,'==="string"')).then(i,"=",a,"=",n,"[",r,"];"),e.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),t(e),[i,a]});case"blend.color":return t(function(e){return a(4,function(t){return+e[t]})},function(e,t,r){return a(4,function(e){return t.def("+",r,"[",e,"]")})});case"stencil.mask":return t(function(e){return 0|e},function(e,t,r){return t.def(r,"|0")});case"stencil.func":return t(function(e){return[Ae[e.cmp||"keep"],e.ref||0,"mask"in e?e.mask:-1]},function(e,t,r){return[e=t.def('"cmp" in ',r,"?",e.constants.compareFuncs,"[",r,".cmp]",":",7680),t.def(r,".ref|0"),t=t.def('"mask" in ',r,"?",r,".mask|0:-1")]});case"stencil.opFront":case"stencil.opBack":return t(function(t){return["stencil.opBack"===e?1029:1028,_e[t.fail||"keep"],_e[t.zfail||"keep"],_e[t.zpass||"keep"]]},function(t,r,n){function i(e){return r.def('"',e,'" in ',n,"?",a,"[",n,".",e,"]:",7680)}var a=t.constants.stencilOps;return["stencil.opBack"===e?1029:1028,i("fail"),i("zfail"),i("zpass")]});case"polygonOffset.offset":return t(function(e){return[0|e.factor,0|e.units]},function(e,t,r){return[t.def(r,".factor|0"),t=t.def(r,".units|0")]});case"cull.face":return t(function(e){var t=0;return"front"===e?t=1028:"back"===e&&(t=1029),t},function(e,t,r){return t.def(r,'==="front"?',1028,":",1029)});case"lineWidth":return t(function(e){return e},function(e,t,r){return r});case"frontFace":return t(function(e){return Se[e]},function(e,t,r){return t.def(r+'==="cw"?2304:2305')});case"colorMask":return t(function(e){return e.map(function(e){return!!e})},function(e,t,r){return a(4,function(e){return"!!"+r+"["+e+"]"})});case"sample.coverage":return t(function(e){return["value"in e?e.value:1,!!e.invert]},function(e,t,r){return[t.def('"value" in ',r,"?+",r,".value:1"),t=t.def("!!",r,".invert")]})}}),i}(e),c=k(e),l=s.viewport;return l&&(u.viewport=l),(s=s[l=v("scissor.box")])&&(u[l]=s),(o={framebuffer:o,draw:f,shader:c,state:u,dirty:s=0<Object.keys(u).length}).profile=function(e){var t,r=e.static;if(e=e.dynamic,"profile"in r){var n=!!r.profile;(t=B(function(e,t){return n})).enable=n}else if("profile"in e){var i=e.profile;t=I(i,function(e,t){return e.invoke(t,i)})}return t}(e),o.uniforms=function(e,t){var r=e.static,n=e.dynamic,i={};return Object.keys(r).forEach(function(e){var t,n=r[e];if("number"==typeof n||"boolean"==typeof n)t=B(function(){return n});else if("function"==typeof n){var o=n._reglType;"texture2d"===o||"textureCube"===o?t=B(function(e){return e.link(n)}):"framebuffer"!==o&&"framebufferCube"!==o||(t=B(function(e){return e.link(n.color[0])}))}else g(n)&&(t=B(function(e){return e.global.def("[",a(n.length,function(e){return n[e]}),"]")}));t.value=n,i[e]=t}),Object.keys(n).forEach(function(e){var t=n[e];i[e]=I(t,function(e,r){return e.invoke(r,t)})}),i}(r),o.attributes=_(t),o.context=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach(function(e){var r=t[e];n[e]=B(function(e,t){return"number"==typeof r||"boolean"==typeof r?""+r:e.link(r)})}),Object.keys(r).forEach(function(e){var t=r[e];n[e]=I(t,function(e,r){return e.invoke(r,t)})}),n}(n),o}function M(e,t,r){var n=e.shared.context,i=e.scope();Object.keys(r).forEach(function(a){t.save(n,"."+a),i(n,".",a,"=",r[a].append(e,t),";")}),t(i)}function T(e,t,r,n){var i,a=(s=e.shared).gl,o=s.framebuffer;$&&(i=t.def(s.extensions,".webgl_draw_buffers"));var s=(f=e.constants).drawBuffer,f=f.backBuffer;e=r?r.append(e,t):t.def(o,".next"),n||t("if(",e,"!==",o,".cur){"),t("if(",e,"){",a,".bindFramebuffer(",36160,",",e,".framebuffer);"),$&&t(i,".drawBuffersWEBGL(",s,"[",e,".colorAttachments.length]);"),t("}else{",a,".bindFramebuffer(",36160,",null);"),$&&t(i,".drawBuffersWEBGL(",f,");"),t("}",o,".cur=",e,";"),n||t("}")}function F(e,t,r){var n=e.shared,i=n.gl,o=e.current,s=e.next,f=n.current,u=n.next,c=e.cond(f,".dirty");ne.forEach(function(t){var n,l;if(!((t=v(t))in r.state))if(t in s){n=s[t],l=o[t];var h=a(ee[t].length,function(e){return c.def(n,"[",e,"]")});c(e.cond(h.map(function(e,t){return e+"!=="+l+"["+t+"]"}).join("||")).then(i,".",ae[t],"(",h,");",h.map(function(e,t){return l+"["+t+"]="+e}).join(";"),";"))}else n=c.def(u,".",t),h=e.cond(n,"!==",f,".",t),c(h),t in ie?h(e.cond(n).then(i,".enable(",ie[t],");").else(i,".disable(",ie[t],");"),f,".",t,"=",n,";"):h(i,".",ae[t],"(",n,");",f,".",t,"=",n,";")}),0===Object.keys(r.state).length&&c(f,".dirty=false;"),t(c)}function O(e,t,r,n){var i=e.shared,a=e.current,o=i.current,s=i.gl;z(Object.keys(r)).forEach(function(i){var f=r[i];if(!n||n(f)){var u=f.append(e,t);if(ie[i]){var c=ie[i];j(f)?t(s,u?".enable(":".disable(",c,");"):t(e.cond(u).then(s,".enable(",c,");").else(s,".disable(",c,");")),t(o,".",i,"=",u,";")}else if(g(u)){var l=a[i];t(s,".",ae[i],"(",u,");",u.map(function(e,t){return l+"["+t+"]="+e}).join(";"),";")}else t(s,".",ae[i],"(",u,");",o,".",i,"=",u,";")}})}function E(e,t){Z&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function L(e,t,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(e){e(u=t.def(),"=",a(),";"),"string"==typeof i?e(h,".count+=",i,";"):e(h,".count++;"),d&&(n?e(c=t.def(),"=",m,".getNumPendingQueries();"):e(m,".beginQuery(",h,");"))}function s(e){e(h,".cpuTime+=",a(),"-",u,";"),d&&(n?e(m,".pushScopeStats(",c,",",m,".getNumPendingQueries(),",h,");"):e(m,".endQuery();"))}function f(e){var r=t.def(p,".profile");t(p,".profile=",e,";"),t.exit(p,".profile=",r,";")}var u,c,l=e.shared,h=e.stats,p=l.current,m=l.timer;if(r=r.profile){if(j(r))return void(r.enable?(o(t),s(t.exit),f("true")):f("false"));f(r=r.append(e,t))}else r=t.def(p,".profile");o(l=e.block()),t("if(",r,"){",l,"}"),s(e=e.block()),t.exit("if(",r,"){",e,"}")}function R(e,t,r,n,i){function a(r,n,i){function a(){t("if(!",c,".buffer){",f,".enableVertexAttribArray(",u,");}");var r,a=i.type;r=i.size?t.def(i.size,"||",n):n,t("if(",c,".type!==",a,"||",c,".size!==",r,"||",p.map(function(e){return c+"."+e+"!=="+i[e]}).join("||"),"){",f,".bindBuffer(",34962,",",l,".buffer);",f,".vertexAttribPointer(",[u,r,a,i.normalized,i.stride,i.offset],");",c,".type=",a,";",c,".size=",r,";",p.map(function(e){return c+"."+e+"="+i[e]+";"}).join(""),"}"),Z&&(a=i.divisor,t("if(",c,".divisor!==",a,"){",e.instancing,".vertexAttribDivisorANGLE(",[u,a],");",c,".divisor=",a,";}"))}function s(){t("if(",c,".buffer){",f,".disableVertexAttribArray(",u,");","}if(",xe.map(function(e,t){return c+"."+e+"!=="+h[t]}).join("||"),"){",f,".vertexAttrib4f(",u,",",h,");",xe.map(function(e,t){return c+"."+e+"="+h[t]+";"}).join(""),"}")}var f=o.gl,u=t.def(r,".location"),c=t.def(o.attributes,"[",u,"]");r=i.state;var l=i.buffer,h=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];1===r?a():2===r?s():(t("if(",r,"===",1,"){"),a(),t("}else{"),s(),t("}"))}var o=e.shared;n.forEach(function(n){var o,s=n.name,f=r.attributes[s];if(f){if(!i(f))return;o=f.append(e,t)}else{if(!i(Me))return;var u=e.scopeAttrib(s);o={},Object.keys(new Y).forEach(function(e){o[e]=t.def(u,".",e)})}a(e.link(n),function(e){switch(e){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)})}function W(e,r,n,i,o){for(var s,f=e.shared,u=f.gl,c=0;c<i.length;++c){var l,h=(m=i[c]).name,p=m.info.type,d=n.uniforms[h],m=e.link(m)+".location";if(d){if(!o(d))continue;if(j(d)){if(h=d.value,35678===p||35680===p)r(u,".uniform1i(",m,",",(p=e.link(h._texture||h.color[0]._texture))+".bind());"),r.exit(p,".unbind();");else if(35674===p||35675===p||35676===p)h=e.global.def("new Float32Array(["+Array.prototype.slice.call(h)+"])"),d=2,35675===p?d=3:35676===p&&(d=4),r(u,".uniformMatrix",d,"fv(",m,",false,",h,");");else{switch(p){case 5126:s="1f";break;case 35664:s="2f";break;case 35665:s="3f";break;case 35666:s="4f";break;case 35670:case 5124:s="1i";break;case 35671:case 35667:s="2i";break;case 35672:case 35668:s="3i";break;case 35673:s="4i";break;case 35669:s="4i"}r(u,".uniform",s,"(",m,",",g(h)?Array.prototype.slice.call(h):h,");")}continue}l=d.append(e,r)}else{if(!o(Me))continue;l=r.def(f.uniforms,"[",t.id(h),"]")}switch(35678===p?r("if(",l,"&&",l,'._reglType==="framebuffer"){',l,"=",l,".color[0];","}"):35680===p&&r("if(",l,"&&",l,'._reglType==="framebufferCube"){',l,"=",l,".color[0];","}"),h=1,p){case 35678:case 35680:r(u,".uniform1i(",m,",",p=r.def(l,"._texture"),".bind());"),r.exit(p,".unbind();");continue;case 5124:case 35670:s="1i";break;case 35667:case 35671:s="2i",h=2;break;case 35668:case 35672:s="3i",h=3;break;case 35669:case 35673:s="4i",h=4;break;case 5126:s="1f";break;case 35664:s="2f",h=2;break;case 35665:s="3f",h=3;break;case 35666:s="4f",h=4;break;case 35674:s="Matrix2fv";break;case 35675:s="Matrix3fv";break;case 35676:s="Matrix4fv"}if(r(u,".uniform",s,"(",m,","),"M"===s.charAt(0)){m=Math.pow(p-35674+2,2);var v=e.global.def("new Float32Array(",m,")");r("false,(Array.isArray(",l,")||",l," instanceof Float32Array)?",l,":(",a(m,function(e){return v+"["+e+"]="+l+"["+e+"]"}),",",v,")")}else r(1<h?a(h,function(e){return l+"["+e+"]"}):l);r(");")}}function V(e,t,r,n){function i(i){var a=h[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(e,r):a.append(e,t):t.def(l,".",i)}function a(){function e(){r(f,".drawElementsInstancedANGLE(",[d,g,v,m+"<<(("+v+"-5121)>>1)",s],");")}function t(){r(f,".drawArraysInstancedANGLE(",[d,m,g,s],");")}p?y?e():(r("if(",p,"){"),e(),r("}else{"),t(),r("}")):t()}function o(){function e(){r(c+".drawElements("+[d,g,v,m+"<<(("+v+"-5121)>>1)"]+");")}function t(){r(c+".drawArrays("+[d,m,g]+");")}p?y?e():(r("if(",p,"){"),e(),r("}else{"),t(),r("}")):t()}var s,f,u=e.shared,c=u.gl,l=u.draw,h=n.draw,p=function(){var i=h.elements,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a)):i=a.def(l,".","elements"),i&&a("if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),d=i("primitive"),m=i("offset"),g=function(){var i=h.count,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a)):i=a.def(l,".","count"),i}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");Z&&(s=i("instances"),f=e.instancing);var v=p+".type",y=h.elements&&j(h.elements);Z&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function q(e,t,r,n,i){return i=(t=x()).proc("body",i),Z&&(t.instancing=i.def(t.shared.extensions,".angle_instanced_arrays")),e(t,i,r,n),t.compile().body}function U(e,t,r,n){E(e,t),R(e,t,r,n.attributes,function(){return!0}),W(e,t,r,n.uniforms,function(){return!0}),V(e,t,t,r)}function N(e,t,r,n){function i(){return!0}e.batchId="a1",E(e,t),R(e,t,r,n.attributes,i),W(e,t,r,n.uniforms,i),V(e,t,t,r)}function G(e,t,r,n){function i(e){return e.contextDep&&o||e.propDep}function a(e){return!i(e)}E(e,t);var o=r.contextDep,s=t.def(),f=t.def();e.shared.props=f,e.batchId=s;var u=e.scope(),c=e.scope();t(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",f,"=","a0","[",s,"];",c,"}",u.exit),r.needsContext&&M(e,c,r.context),r.needsFramebuffer&&T(e,c,r.framebuffer),O(e,c,r.state,i),r.profile&&i(r.profile)&&L(e,c,r,!1,!0),n?(R(e,u,r,n.attributes,a),R(e,c,r,n.attributes,i),W(e,u,r,n.uniforms,a),W(e,c,r,n.uniforms,i),V(e,u,c,r)):(t=e.global.def("{}"),n=r.shader.progVar.append(e,c),f=c.def(n,".id"),u=c.def(t,"[",f,"]"),c(e.shared.gl,".useProgram(",n,".program);","if(!",u,"){",u,"=",t,"[",f,"]=",e.link(function(t){return q(N,e,r,t,2)}),"(",n,");}",u,".call(this,a0[",s,"],",s,");"))}function Q(e,r){function n(t){var n=r.shader[t];n&&i.set(a.shader,"."+t,n.append(e,i))}var i=e.proc("scope",3);e.batchId="a2";var a=e.shared,o=a.current;M(e,i,r.context),r.framebuffer&&r.framebuffer.append(e,i),z(Object.keys(r.state)).forEach(function(t){var n=r.state[t].append(e,i);g(n)?n.forEach(function(r,n){i.set(e.next[t],"["+n+"]",r)}):i.set(a.next,"."+t,n)}),L(e,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(t){var n=r.draw[t];n&&i.set(a.draw,"."+t,""+n.append(e,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+t.id(n)+"]",r.uniforms[n].append(e,i))}),Object.keys(r.attributes).forEach(function(t){var n=r.attributes[t].append(e,i),a=e.scopeAttrib(t);Object.keys(new Y).forEach(function(e){i.set(a,"."+e,n[e])})}),n("vert"),n("frag"),0<Object.keys(r.state).length&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",e.shared.context,",a0,",e.batchId,");")}function X(e,t,r){var n=t.static[r];if(n&&function(e){if("object"==typeof e&&!g(e)){for(var t=Object.keys(e),r=0;r<t.length;++r)if(H.isDynamic(e[t[r]]))return!0;return!1}}(n)){var i=e.global,a=Object.keys(n),o=!1,s=!1,f=!1,u=e.global.def("{}");a.forEach(function(t){var r=n[t];if(H.isDynamic(r))"function"==typeof r&&(r=n[t]=H.unbox(r)),t=I(r,null),o=o||t.thisDep,f=f||t.propDep,s=s||t.contextDep;else{switch(i(u,".",t,"="),typeof r){case"number":i(r);break;case"string":i('"',r,'"');break;case"object":Array.isArray(r)&&i("[",r.join(),"]");break;default:i(e.link(r))}i(";")}}),t.dynamic[r]=new H.DynamicVariable(4,{thisDep:o,contextDep:s,propDep:f,ref:u,append:function(e,t){a.forEach(function(r){var i=n[r];H.isDynamic(i)&&(i=e.invoke(t,i),t(u,".",r,"=",i,";"))})}}),delete t.static[r]}}var Y=c.Record,K={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(K.min=32775,K.max=32776);var Z=r.angle_instanced_arrays,$=r.webgl_draw_buffers,ee={dirty:!0,profile:m.profile},te={},ne=[],ie={},ae={};y("dither",3024),y("blend.enable",3042),b("blend.color","blendColor",[0,0,0,0]),b("blend.equation","blendEquationSeparate",[32774,32774]),b("blend.func","blendFuncSeparate",[1,0,1,0]),y("depth.enable",2929,!0),b("depth.func","depthFunc",513),b("depth.range","depthRange",[0,1]),b("depth.mask","depthMask",!0),b("colorMask","colorMask",[!0,!0,!0,!0]),y("cull.enable",2884),b("cull.face","cullFace",1029),b("frontFace","frontFace",2305),b("lineWidth","lineWidth",1),y("polygonOffset.enable",32823),b("polygonOffset.offset","polygonOffset",[0,0]),y("sample.alpha",32926),y("sample.enable",32928),b("sample.coverage","sampleCoverage",[1,!1]),y("stencil.enable",2960),b("stencil.mask","stencilMask",-1),b("stencil.func","stencilFunc",[519,0,-1]),b("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),b("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),y("scissor.enable",3089),b("scissor.box","scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),b("viewport","viewport",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var oe={gl:e,context:p,strings:t,next:te,current:ee,draw:h,elements:o,buffer:i,shader:l,attributes:c.state,uniforms:u,framebuffer:f,extensions:r,timer:d,isBufferArgs:D},se={primTypes:re,compareFuncs:Ae,blendFuncs:ke,blendEquations:K,stencilOps:_e,glTypes:J,orientationType:Se};$&&(se.backBuffer=[1029],se.drawBuffer=a(n.maxDrawbuffers,function(e){return 0===e?[0]:a(e,function(e){return 36064+e})}));var fe=0;return{next:te,current:ee,procs:function(){var e=x(),t=e.proc("poll"),r=e.proc("refresh"),i=e.block();t(i),r(i);var o,s=e.shared,f=s.gl,u=s.next,c=s.current;i(c,".dirty=false;"),T(e,t),T(e,r,null,!0),Z&&(o=e.link(Z));for(var l=0;l<n.maxAttributes;++l){var h=r.def(s.attributes,"[",l,"]"),p=e.cond(h,".buffer");p.then(f,".enableVertexAttribArray(",l,");",f,".bindBuffer(",34962,",",h,".buffer.buffer);",f,".vertexAttribPointer(",l,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(f,".disableVertexAttribArray(",l,");",f,".vertexAttrib4f(",l,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),r(p),Z&&r(o,".vertexAttribDivisorANGLE(",l,",",h,".divisor);")}return Object.keys(ie).forEach(function(n){var a=ie[n],o=i.def(u,".",n),s=e.block();s("if(",o,"){",f,".enable(",a,")}else{",f,".disable(",a,")}",c,".",n,"=",o,";"),r(s),t("if(",o,"!==",c,".",n,"){",s,"}")}),Object.keys(ae).forEach(function(n){var o,s,l=ae[n],h=ee[n],p=e.block();p(f,".",l,"("),g(h)?(l=h.length,o=e.global.def(u,".",n),s=e.global.def(c,".",n),p(a(l,function(e){return o+"["+e+"]"}),");",a(l,function(e){return s+"["+e+"]="+o+"["+e+"];"}).join("")),t("if(",a(l,function(e){return o+"["+e+"]!=="+s+"["+e+"]"}).join("||"),"){",p,"}")):(o=i.def(u,".",n),s=i.def(c,".",n),p(o,");",c,".",n,"=",o,";"),t("if(",o,"!==",s,"){",p,"}")),r(p)}),e.compile()}(),compile:function(e,t,r,n,i){var a=x();return a.stats=a.link(i),Object.keys(t.static).forEach(function(e){X(a,t,e)}),we.forEach(function(t){X(a,e,t)}),r=S(e,t,r,n),function(e,t){var r=e.proc("draw",1);E(e,r),M(e,r,t.context),T(e,r,t.framebuffer),F(e,r,t),O(e,r,t.state),L(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)U(e,r,t,t.shader.program);else{var i=e.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link(function(r){return q(U,e,t,r,1)}),"(",n,");",o,".call(this,a0);"))}0<Object.keys(t.state).length&&r(e.shared.current,".dirty=true;")}(a,r),Q(a,r),function(e,t){function r(e){return e.contextDep&&i||e.propDep}var n=e.proc("batch",2);e.batchId="0",E(e,n);var i=!1,a=!0;Object.keys(t.context).forEach(function(e){i=i||t.context[e].propDep}),i||(M(e,n,t.context),a=!1);var o=!1;if((s=t.framebuffer)?(s.propDep?i=o=!0:s.contextDep&&i&&(o=!0),o||T(e,n,s)):T(e,n,null),t.state.viewport&&t.state.viewport.propDep&&(i=!0),F(e,n,t),O(e,n,t.state,function(e){return!r(e)}),t.profile&&r(t.profile)||L(e,n,t,!1,"a1"),t.contextDep=i,t.needsContext=a,t.needsFramebuffer=o,(a=t.shader.progVar).contextDep&&i||a.propDep)G(e,n,t,null);else if(a=a.append(e,n),n(e.shared.gl,".useProgram(",a,".program);"),t.shader.program)G(e,n,t,t.shader.program);else{var s=e.global.def("{}"),f=(o=n.def(a,".id"),n.def(s,"[",o,"]"));n(e.cond(f).then(f,".call(this,a0,a1);").else(f,"=",s,"[",o,"]=",e.link(function(r){return q(G,e,t,r,2)}),"(",a,");",f,".call(this,a0,a1);"))}0<Object.keys(t.state).length&&n(e.shared.current,".dirty=true;")}(a,r),a.compile()}}}function R(e,t){for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}var W=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]=t[r[n]];return e},V=0,H={DynamicVariable:e,define:function(r,n){return new e(r,t(n+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof e},unbox:function(t,r){return"function"==typeof t?new e(0,t):t},accessor:t},q={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},U="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},N=s();N.zero=s();var G=function(e,t){var r=1;t.ext_texture_filter_anisotropic&&(r=e.getParameter(34047));var n=1,i=1;t.webgl_draw_buffers&&(n=e.getParameter(34852),i=e.getParameter(36063));var a=!!t.oes_texture_float;if(a){a=e.createTexture(),e.bindTexture(3553,a),e.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var o=e.createFramebuffer();if(e.bindFramebuffer(36160,o),e.framebufferTexture2D(36160,36064,3553,a,0),e.bindTexture(3553,null),36053!==e.checkFramebufferStatus(36160))a=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var s=N.allocType(5126,4);e.readPixels(0,0,1,1,6408,5126,s),e.getError()?a=!1:(e.deleteFramebuffer(o),e.deleteTexture(a),a=1===s[0]),N.freeType(s)}}return s=!0,s=e.createTexture(),o=N.allocType(5121,36),e.activeTexture(33984),e.bindTexture(34067,s),e.texImage2D(34069,0,6408,3,3,0,6408,5121,o),N.freeType(o),e.bindTexture(34067,null),e.deleteTexture(s),s=!e.getError(),{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter(function(e){return!!t[e]}),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:a,npotTextureCube:s}},Q=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},X=function(e){return Object.keys(e).map(function(t){return e[t]})},Y={shape:function(e){for(var t=[];e.length;e=e[0])t.push(e.length);return t},flatten:function(e,t,r,n){var i=1;if(t.length)for(var a=0;a<t.length;++a)i*=t[a];else i=0;switch(r=n||N.allocType(r,i),t.length){case 0:break;case 1:for(n=t[0],t=0;t<n;++t)r[t]=e[t];break;case 2:for(n=t[0],t=t[1],a=i=0;a<n;++a)for(var o=e[a],s=0;s<t;++s)r[i++]=o[s];break;case 3:u(e,t[0],t[1],t[2],r,0);break;default:!function e(t,r,n,i,a){for(var o=1,s=n+1;s<r.length;++s)o*=r[s];var f=r[n];if(4==r.length-n){var c=r[n+1],l=r[n+2];for(r=r[n+3],s=0;s<f;++s)u(t[s],c,l,r,i,a),a+=o}else for(s=0;s<f;++s)e(t[s],r,n+1,i,a),a+=o}(e,t,0,r,0)}return r}},K={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},J={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},Z={dynamic:35048,stream:35040,static:35044},$=Y.flatten,ee=Y.shape,te=[];te[5120]=1,te[5122]=2,te[5124]=4,te[5121]=1,te[5123]=2,te[5125]=4,te[5126]=4;var re={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},ne=new Float32Array(1),ie=new Uint32Array(ne.buffer),ae=[9984,9986,9985,9987],oe=[0,6409,6410,6407,6408],se={};se[6409]=se[6406]=se[6402]=1,se[34041]=se[6410]=2,se[6407]=se[35904]=3,se[6408]=se[35906]=4;var fe=v("HTMLCanvasElement"),ue=v("CanvasRenderingContext2D"),ce=v("ImageBitmap"),le=v("HTMLImageElement"),he=v("HTMLVideoElement"),pe=Object.keys(K).concat([fe,ue,ce,le,he]),de=[];de[5121]=1,de[5126]=4,de[36193]=2,de[5123]=2,de[5125]=4;var me=[];me[32854]=2,me[32855]=2,me[36194]=2,me[34041]=4,me[33776]=.5,me[33777]=.5,me[33778]=1,me[33779]=1,me[35986]=.5,me[35987]=1,me[34798]=1,me[35840]=.5,me[35841]=.25,me[35842]=.5,me[35843]=.25,me[36196]=.5;var ge=[];ge[32854]=2,ge[32855]=2,ge[36194]=2,ge[33189]=2,ge[36168]=1,ge[34041]=4,ge[35907]=4,ge[34836]=16,ge[34842]=8,ge[34843]=6;var ve=function(e,t,r,n,i){function a(e){this.id=u++,this.refCount=1,this.renderbuffer=e,this.format=32854,this.height=this.width=0,i.profile&&(this.stats={size:0})}function o(t){var r=t.renderbuffer;e.bindRenderbuffer(36161,null),e.deleteRenderbuffer(r),t.renderbuffer=null,t.refCount=0,delete c[t.id],n.renderbufferCount--}var s={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(s.srgba=35907),t.ext_color_buffer_half_float&&(s.rgba16f=34842,s.rgb16f=34843),t.webgl_color_buffer_float&&(s.rgba32f=34836);var f=[];Object.keys(s).forEach(function(e){f[s[e]]=e});var u=0,c={};return a.prototype.decRef=function(){0>=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(c).forEach(function(t){e+=c[t].stats.size}),e}),{create:function(t,r){function o(t,r){var n=0,a=0,c=32854;if("object"==typeof t&&t?("shape"in t?(n=0|(a=t.shape)[0],a=0|a[1]):("radius"in t&&(n=a=0|t.radius),"width"in t&&(n=0|t.width),"height"in t&&(a=0|t.height)),"format"in t&&(c=s[t.format])):"number"==typeof t?(n=0|t,a="number"==typeof r?0|r:n):t||(n=a=1),n!==u.width||a!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=a,u.format=c,e.bindRenderbuffer(36161,u.renderbuffer),e.renderbufferStorage(36161,c,n,a),i.profile&&(u.stats.size=ge[u.format]*u.width*u.height),o.format=f[u.format],o}var u=new a(e.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(t,r),o.resize=function(t,r){var n=0|t,a=0|r||n;return n===u.width&&a===u.height?o:(o.width=u.width=n,o.height=u.height=a,e.bindRenderbuffer(36161,u.renderbuffer),e.renderbufferStorage(36161,u.format,n,a),i.profile&&(u.stats.size=ge[u.format]*u.width*u.height),o)},o._reglType="renderbuffer",o._renderbuffer=u,i.profile&&(o.stats=u.stats),o.destroy=function(){u.decRef()},o},clear:function(){X(c).forEach(o)},restore:function(){X(c).forEach(function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)}),e.bindRenderbuffer(36161,null)}}},ye=[];ye[6408]=4,ye[6407]=3;var be=[];be[5121]=1,be[5126]=4,be[36193]=2;var xe=["x","y","z","w"],we="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),ke={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ae={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},_e={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Se={cw:2304,ccw:2305},Me=new P(!1,!1,!1,function(){});return function(e){function t(){if(0===Y.length)k&&k.update(),$=null;else{$=q.next(t),l();for(var e=Y.length-1;0<=e;--e){var r=Y[e];r&&r(C,null,0)}g.flush(),k&&k.update()}}function r(){!$&&0<Y.length&&($=q.next(t))}function n(){$&&(q.cancel(t),$=null)}function a(e){e.preventDefault(),n(),K.forEach(function(e){e()})}function o(e){g.getError(),y.restore(),j.restore(),z.restore(),B.restore(),I.restore(),V.restore(),k&&k.restore(),N.procs.refresh(),r(),J.forEach(function(e){e()})}function s(e){function t(e){var t={},r={};return Object.keys(e).forEach(function(n){var i=e[n];H.isDynamic(i)?r[n]=H.unbox(i,n):t[n]=i}),{dynamic:r,static:t}}var r=t(e.context||{}),n=t(e.uniforms||{}),i=t(e.attributes||{}),a=t(function(e){function t(e){if(e in r){var t=r[e];delete r[e],Object.keys(t).forEach(function(n){r[e+"."+n]=t[n]})}}var r=W({},e);return delete r.uniforms,delete r.attributes,delete r.context,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),t("blend"),t("depth"),t("cull"),t("stencil"),t("polygonOffset"),t("scissor"),t("sample"),r}(e));e={gpuTime:0,cpuTime:0,count:0};var o=(r=N.compile(a,i,n,r,e)).draw,s=r.batch,f=r.scope,u=[];return W(function(e,t){var r;if("function"==typeof e)return f.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(r=0;r<e;++r)f.call(this,null,t,r);else{if(!Array.isArray(e))return f.call(this,e,t,0);for(r=0;r<e.length;++r)f.call(this,e[r],t,r)}else if("number"==typeof e){if(0<e)return s.call(this,function(e){for(;u.length<e;)u.push(null);return u}(0|e),0|e)}else{if(!Array.isArray(e))return o.call(this,e);if(e.length)return s.call(this,e,e.length)}},{stats:e})}function f(e,t){var r=0;N.procs.poll();var n=t.color;n&&(g.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=16384),"depth"in t&&(g.clearDepth(+t.depth),r|=256),"stencil"in t&&(g.clearStencil(0|t.stencil),r|=1024),g.clear(r)}function u(e){return Y.push(e),r(),{cancel:function(){var t=R(Y,e);Y[t]=function e(){var t=R(Y,e);Y[t]=Y[Y.length-1],--Y.length,0>=Y.length&&n()}}}}function c(){var e=Q.viewport,t=Q.scissor_box;e[0]=e[1]=t[0]=t[1]=0,C.viewportWidth=C.framebufferWidth=C.drawingBufferWidth=e[2]=t[2]=g.drawingBufferWidth,C.viewportHeight=C.framebufferHeight=C.drawingBufferHeight=e[3]=t[3]=g.drawingBufferHeight}function l(){C.tick+=1,C.time=m(),c(),N.procs.poll()}function h(){c(),N.procs.refresh(),k&&k.update()}function m(){return(U()-A)/1e3}if(!(e=i(e)))return null;var g=e.gl,v=g.getContextAttributes();g.isContextLost();var y=function(e,t){function r(t){var r;t=t.toLowerCase();try{r=n[t]=e.getExtension(t)}catch(e){}return!!r}for(var n={},i=0;i<t.extensions.length;++i){var a=t.extensions[i];if(!r(a))return t.onDestroy(),t.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach(function(e){if(!r(e))throw Error("(regl): error restoring extension "+e)})}}}(g,e);if(!y)return null;var b=function(){var e={"":0},t=[""];return{id:function(r){var n=e[r];return n||(n=e[r]=t.length,t.push(r),n)},str:function(e){return t[e]}}}(),x={bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},w=y.extensions,k=function(e,t){function r(e,t,r){var n=o.pop()||new function(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null};n.startQueryIndex=e,n.endQueryIndex=t,n.sum=0,n.stats=r,s.push(n)}var n=t.ext_disjoint_timer_query;if(!n)return null;var i=[],a=[],o=[],s=[],f=[],u=[];return{beginQuery:function(e){var t=i.pop()||n.createQueryEXT();n.beginQueryEXT(35007,t),a.push(t),r(a.length-1,a.length,e)},endQuery:function(){n.endQueryEXT(35007)},pushScopeStats:r,update:function(){var e,t;if(0!==(e=a.length)){u.length=Math.max(u.length,e+1),f.length=Math.max(f.length,e+1),f[0]=0;var r=u[0]=0;for(t=e=0;t<a.length;++t){var c=a[t];n.getQueryObjectEXT(c,34919)?(r+=n.getQueryObjectEXT(c,34918),i.push(c)):a[e++]=c,f[t+1]=r,u[t+1]=e}for(a.length=e,t=e=0;t<s.length;++t){var l=(r=s[t]).startQueryIndex;c=r.endQueryIndex,r.sum+=f[c]-f[l],l=u[l],(c=u[c])===l?(r.stats.gpuTime+=r.sum/1e6,o.push(r)):(r.startQueryIndex=l,r.endQueryIndex=c,s[e++]=r)}s.length=e}},getNumPendingQueries:function(){return a.length},clear:function(){i.push.apply(i,a);for(var e=0;e<i.length;e++)n.deleteQueryEXT(i[e]);a.length=0,i.length=0},restore:function(){a.length=0,i.length=0}}}(0,w),A=U(),O=g.drawingBufferWidth,E=g.drawingBufferHeight,C={tick:0,time:0,viewportWidth:O,viewportHeight:E,framebufferWidth:O,framebufferHeight:E,drawingBufferWidth:O,drawingBufferHeight:E,pixelRatio:e.pixelRatio},D=G(g,w),z=(O=function(e,t,r,n){for(e=r.maxAttributes,t=Array(e),r=0;r<e;++r)t[r]=new M;return{Record:M,scope:{},state:t}}(g,w,D),p(g,x,e,O)),P=d(g,w,z,x),j=T(g,b,x,e),B=_(g,w,D,function(){N.procs.poll()},C,x,e),I=ve(g,w,0,x,e),V=S(g,w,D,B,I,x),N=L(g,b,w,D,z,P,0,V,{},O,j,{elements:null,primitive:4,count:-1,offset:0,instances:-1},C,k,e),Q=(b=F(g,V,N.procs.poll,C),N.next),X=g.canvas,Y=[],K=[],J=[],Z=[e.onDestroy],$=null;X&&(X.addEventListener("webglcontextlost",a,!1),X.addEventListener("webglcontextrestored",o,!1));var ee=V.setFBO=s({framebuffer:H.define.call(null,1,"framebuffer")});return h(),v=W(s,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var t=0;6>t;++t)ee(W({framebuffer:e.framebuffer.faces[t]},e),f);else ee(e,f);else f(0,e)},prop:H.define.bind(null,1),context:H.define.bind(null,2),this:H.define.bind(null,3),draw:s({}),buffer:function(e){return z.create(e,34962,!1,!1)},elements:function(e){return P.create(e,!1)},texture:B.create2D,cube:B.createCube,renderbuffer:I.create,framebuffer:V.create,framebufferCube:V.createCube,attributes:v,frame:u,on:function(e,t){var r;switch(e){case"frame":return u(t);case"lost":r=K;break;case"restore":r=J;break;case"destroy":r=Z}return r.push(t),{cancel:function(){for(var e=0;e<r.length;++e)if(r[e]===t){r[e]=r[r.length-1],r.pop();break}}}},limits:D,hasExtension:function(e){return 0<=D.extensions.indexOf(e.toLowerCase())},read:b,destroy:function(){Y.length=0,n(),X&&(X.removeEventListener("webglcontextlost",a),X.removeEventListener("webglcontextrestored",o)),j.clear(),V.clear(),I.clear(),B.clear(),P.clear(),z.clear(),k&&k.clear(),Z.forEach(function(e){e()})},_gl:g,_refresh:h,poll:function(){l(),k&&k.update()},now:m,stats:x}),e.onDone(null,v),v}},"object"==typeof r&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):n.createREGL=i()},{}],29:[function(e,t,r){"use strict";var n=e("parenthesis");t.exports=function(e,t,r){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map(function(e){return 1===e.length&&(e+=e),e}));var i=n.parse(e,{flat:!0,brackets:r.ignore}),a=i[0].split(t);if(r.escape){for(var o=[],s=0;s<a.length;s++){var f=a[s],u=a[s+1];"\\"===f[f.length-1]&&"\\"!==f[f.length-2]?(o.push(f+t+u),s++):o.push(f)}a=o}for(s=0;s<a.length;s++)i[0]=a[s],a[s]=n.stringify(i,{flat:!0});return a}},{parenthesis:26}],30:[function(e,t,r){"use strict";t.exports=i;var n=1e20;function i(e,t,r,n,i){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=e+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,r,n,i,a,s){for(var f=0;f<t;f++){for(var u=0;u<r;u++)n[u]=e[u*t+f];for(o(n,i,a,s,r),u=0;u<r;u++)e[u*t+f]=i[u]}for(u=0;u<r;u++){for(f=0;f<t;f++)n[f]=e[u*t+f];for(o(n,i,a,s,t),f=0;f<t;f++)e[u*t+f]=Math.sqrt(i[f])}}function o(e,t,r,i,a){r[0]=0,i[0]=-n,i[1]=+n;for(var o=1,s=0;o<a;o++){for(var f=(e[o]+o*o-(e[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);f<=i[s];)s--,f=(e[o]+o*o-(e[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,i[s]=f,i[s+1]=+n}for(o=0,s=0;o<a;o++){for(;i[s+1]<o;)s++;t[o]=(o-r[s])*(o-r[s])+e[r[s]]}}i.prototype.draw=function(e){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(e,this.buffer,this.middle);for(var t=this.ctx.getImageData(0,0,this.size,this.size),r=t.data,i=0;i<this.size*this.size;i++){var o=r[4*i+3]/255;this.gridOuter[i]=1===o?0:0===o?n:Math.pow(Math.max(0,.5-o),2),this.gridInner[i]=1===o?n:0===o?0:Math.pow(Math.max(0,o-.5),2)}for(a(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),a(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++){var s=this.gridOuter[i]-this.gridInner[i],f=Math.max(0,Math.min(255,Math.round(255-255*(s/this.radius+this.cutoff))));r[4*i+0]=f,r[4*i+1]=f,r[4*i+2]=f,r[4*i+3]=255}return t}},{}],31:[function(e,t,r){var n=/[\'\"]/;t.exports=function(e){return e?(n.test(e.charAt(0))&&(e=e.substr(1)),n.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,i,a){for(var o=Math.floor(t/a),s=Math.floor(r/a),f=Math.floor(n/a),u=Math.floor(i/a),c=[],l=f;l<u;l++)for(var h=l*a,p=o;p<=s;p++){var d=p*a,m=e(d,h);isFinite(m[0])&&!isNaN(m[0])&&isFinite(m[1])&&!isNaN(m[1])&&(c.push([d,h]),c.push([m[0],m[1]]))}return c}},{}],33:[function(e,t,r){"use strict";t.exports=function(e){for(var t=[],r=0;r<=0;r++)t.push([-200,r,200,r]),t.push([r,-200,r,200]);return e({vert:"\n      precision highp float;\n      uniform mat4 uView, uWorld;\n      attribute vec2 aPoint;\n  \n      void main () {\n        vec2 xy = (uView * uWorld * vec4(aPoint, 0, 1)).xy;\n        gl_Position = vec4(xy, 0, 1);\n      }\n    ",frag:"\n      precision highp float;\n      uniform float uOpacity;\n      void main () {\n        gl_FragColor = vec4(vec3(1), uOpacity);\n      }\n    ",depth:{enable:!1},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:"src alpha",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},attributes:{aPoint:e.buffer(t)},uniforms:{uOpacity:e.prop("opacity")},primitive:"lines",count:2*t.length})}},{}],34:[function(e,t,r){"use strict";var n=e("glslify");t.exports=function(e){for(var t=256,r=256,i=new Uint8Array(t*r*4),a=0,o=0;a<65536;a++,o+=4){s=1+80*((s=Math.random())-1);var s=Math.max(0,Math.min(255,Math.floor(204.8*Math.pow(s,3))));i[o]=s,i[o+1]=s,i[o+2]=s,i[o+3]=255}var f=new e.texture({data:i,width:t,height:r,wrapS:"repeat",wrapT:"repeat",mag:"linear",min:"linear"});return e({vert:"\n      precision highp float;\n      uniform mat4 uWorldInverse, uViewInverse;\n      attribute vec2 xy;\n      varying vec2 uv;\n      void main () {\n        uv = (uWorldInverse * uViewInverse * vec4(2.0 * xy, 0, 1)).xy / 2.0;\n        gl_Position = vec4(xy, 0, 1);\n      }\n    ",frag:n(["\n      precision highp float;\n#define GLSLIFY 1\n\n      uniform vec2 uResolution;\n      uniform float uOpacity;\n      uniform sampler2D uBackground;\n      uniform vec2 uTextureScale;\n      varying vec2 uv;\n      void main () {\n        gl_FragColor = vec4(texture2D(uBackground, uv * uTextureScale).rgb, uOpacity);\n      }\n    ",""]),attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:{uBackground:f,uTextureScale:function(e){return[Math.min(e.framebufferHeight,e.framebufferWidth)/t/6,Math.min(e.framebufferHeight,e.framebufferWidth)/r/6]},uOpacity:e.prop("opacity")},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:"zero",dstRGB:"one",dstAlpha:"one"}},depth:{enable:!1},count:3})}},{glslify:20}],35:[function(e,t,r){"use strict";t.exports=function(e){return e({vert:"\n      precision highp float;\n      attribute vec2 xy;\n      uniform mat4 uViewInverse, uModelInverse;\n      varying vec2 vXy;\n      void main () {\n        vXy = (uModelInverse * uViewInverse * vec4(xy, 0, 1)).xy;\n        gl_Position = vec4(xy, 0, 1);\n      }\n    ",frag:"\n      precision highp float;\n\n      #extension GL_OES_standard_derivatives : enable\n\n      float gridFactor (float parameter, float width, float feather) {\n\t\t\t\tfloat w1 = width - feather * 0.5;\n\t\t\t\tfloat d = fwidth(parameter);\n\t\t\t\tfloat looped = 0.5 - abs(mod(parameter, 1.0) - 0.5);\n\t\t\t\treturn smoothstep(d * w1, d * (w1 + feather), looped);\n\t\t\t}\n\n      varying vec2 vXy;\n      uniform float uR1, uR2, uM1, uM2, uSynodicField;\n      uniform sampler2D uColormap;\n      uniform float uOpacity, uContourOpacity;\n\n      void main () {\n        float y2 = vXy.y * vXy.y;\n        float rad2 = dot(vXy, vXy);\n\t\t\t\tfloat dX1 = vXy.x - uR1;\n\t\t\t\tfloat dX2 = vXy.x + uR2;\n        float V = -uM1 / sqrt(dX1 * dX1 + y2) + -uM2 / sqrt(dX2 * dX2 + y2) + -0.5 * rad2 * uSynodicField;\n\n\t\t\t\tfloat grid = gridFactor(V * 16.0, 1.0, 2.0);\n        grid = (1.0 - grid) * smoothstep(-10.0, -0.2, V);\n\n        float cmin = -4.0;\n        float cmax = -1.0 + (1.0 - uSynodicField) * 1.5;\n        vec3 color = texture2D(uColormap, vec2(\n          (V - cmin) / (cmax - cmin)\n         )).rgb;\n\n        gl_FragColor = vec4(vec3(1.0 - uContourOpacity * grid) * color, uOpacity);\n      }\n    ",attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:{uOpacity:e.prop("opacity"),uContourOpacity:e.prop("contourOpacity")},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:"src alpha",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},depth:{enable:!1},count:3})}},{}],36:[function(e,t,r){"use strict";t.exports=function(e){return e({vert:"\n      precision highp float;\n      uniform mat4 uView;\n      uniform float uLineWidth, uAspect;\n      uniform mat4 uWorld;\n      attribute vec3 aPoint, aNextPoint;\n      attribute vec2 aLine;\n      varying float vDash;\n  \n      void main () {\n        vDash = mix(aPoint.z, aNextPoint.z, aLine.y);\n        vec4 p = uView * uWorld * vec4(aPoint.xy, 0, 1);\n        vec4 n = uView * uWorld * vec4(aNextPoint.xy, 0, 1);\n        gl_Position = mix(p, n, aLine.y);\n        gl_Position.xy += normalize((p.yx / p.w  - n.yx / n.w) * vec2(1, uAspect)) * vec2(-1.0 / uAspect, 1) * aLine.x * uLineWidth * gl_Position.w;\n      }\n    ",frag:"\n      precision highp float;\n      uniform vec4 uColor;\n      varying float vDash;\n      void main () {\n        gl_FragColor = uColor * (mod(vDash, 1.0) > 0.5 ? 1.0 : 0.0);\n      }\n    ",attributes:{aPoint:{buffer:e.prop("points"),divisor:1},aNextPoint:{buffer:e.prop("points"),divisor:1,offset:12},aLine:new Int8Array([-1,0,1,0,-1,1,1,1])},depth:{enable:!1},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:"src alpha",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},uniforms:{uLineWidth:function(e,t){return t.lineWidth/e.framebufferHeight*e.pixelRatio},uColor:e.prop("color"),uAspect:function(e){return e.framebufferWidth/e.framebufferHeight}},primitive:"triangle strip",instances:function(e,t){return t.count-1},count:4})}},{}],37:[function(e,t,r){"use strict";t.exports=function(e){return e({vert:"\n      precision highp float;\n      uniform mat4 uView, uModel;\n      uniform float uPointSize;\n      attribute vec2 aPoint;\n  \n      void main () {\n        vec2 xy = (uView * uModel * vec4(aPoint, 0, 1)).xy;\n        gl_Position = vec4(xy, 0, 1);\n        gl_PointSize = uPointSize * 2.0;\n      }\n    ",frag:"\n      precision highp float;\n      uniform float uPointSize, uHalo;\n      uniform vec4 uColor;\n      void main () {\n        float r = length(gl_PointCoord.xy - 0.5) * 2.0;\n        float alpha = smoothstep(0.5, 0.5 * (uPointSize - 3.0) / uPointSize, r);\n        gl_FragColor = vec4(mix(\n          mix(vec3(1), uColor.rgb, 0.5),\n          uColor.rgb,\n          alpha\n        ), (1.0 / r - 1.0) * mix(uHalo, 1.0, alpha));\n      }\n    ",depth:{enable:!1},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:"src alpha",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},attributes:{aPoint:e.prop("points")},uniforms:{uPointSize:function(e,t){return(void 0===t.pointSize?10:t.pointSize)*e.pixelRatio},uColor:e.prop("color"),uHalo:e.prop("halo")},primitive:"points",count:e.prop("count")})}},{}],38:[function(e,t,r){"use strict";var n=e("font-atlas-sdf");t.exports=function(e,t){var r=n({font:"12px serif",shape:[320,64],step:[64,64],chars:["L1","L2","L3","L4","L5"]}),i=e.texture({data:r,flipY:!0,mag:"linear",min:"linear"});return e({vert:"\n      precision highp float;\n      attribute vec2 aSpriteVertex;\n      uniform vec2 uResolution, uAtlasOffset, uAtlasScale, uPosition, uOffset;\n      uniform mat4 uView, uModel;\n      varying vec2 vUv;\n      uniform float uPixelRatio;\n      void main () {\n        vUv = uAtlasOffset + uAtlasScale * aSpriteVertex;\n        gl_Position = vec4(\n          (uView * uModel * vec4(uPosition, 0, 1)).xy + \n          uOffset * uResolution * 2.0 * uPixelRatio +\n          (aSpriteVertex - 0.5) * uResolution * 2.0 * 40.0 * uPixelRatio,\n          0, 1);\n      }\n    ",frag:"\n      precision highp float;\n      uniform sampler2D uAtlas;\n      uniform float uOpacity;\n      varying vec2 vUv;\n      void main () {\n        float value = texture2D(uAtlas, vUv).r;\n        gl_FragColor = vec4(\n          vec3(smoothstep(0.76, 0.72, value)),\n          smoothstep(0.68, 0.71, value) * uOpacity\n        );\n      }\n    ",attributes:{aSpriteVertex:new Uint8Array([0,0,1,0,0,1,1,1])},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:"src alpha",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},uniforms:{uAtlas:i,uOffset:e.prop("offset"),uPosition:e.prop("position"),uAtlasOffset:function(e,r){return[r.index/t.length,0]},uAtlasScale:function(e,r){return[1/t.length,1]},uOpacity:e.prop("opacity"),uPixelRatio:e.context("pixelRatio"),uResolution:function(e){return[1/e.framebufferWidth,1/e.framebufferHeight]}},depth:{enable:!1},primitive:"triangle strip",count:4})}},{"font-atlas-sdf":14}],39:[function(e,t,r){"use strict";t.exports=function(e,t){return e({vert:"\n      precision highp float;\n      uniform mat4 uWorld, uView;\n      uniform float uLineWidth, uAspect;\n      uniform vec2 uArrowheadShape;\n      attribute vec2 aVertex, aNextVertex;\n      attribute vec4 aLine;\n      uniform float uLengthMultiplier;\n\n      void main () {\n        vec4 p = uView * vec4(aVertex, 0, 1);\n        vec4 n = uView * vec4(aVertex + aNextVertex * uLengthMultiplier, 0, 1);\n        gl_Position = mix(p, n, aLine.y);\n\n        vec2 unitVector = normalize((p.xy / p.w  - n.xy / n.w) * vec2(uAspect, 1));\n\n        gl_Position.xy += (\n            vec2(-unitVector.y, unitVector.x) * (aLine.x * uLineWidth + aLine.w * uArrowheadShape.y) +\n            -unitVector * aLine.z * uArrowheadShape.x\n          ) *\n          vec2(1.0 / uAspect, 1) * gl_Position.w;\n\n      }\n    ",frag:"\n      precision highp float;\n      uniform vec4 uColor;\n      void main () {\n        gl_FragColor = uColor;\n      }\n    ",attributes:{aVertex:{buffer:e.prop("points"),divisor:2,stride:16},aNextVertex:{buffer:e.prop("points"),divisor:2,offset:8,stride:16},aLine:new Float32Array([-1,0,0,0,1,0,0,0,1,1,-1,0,-1,0,0,0,1,1,-1,0,-1,1,-1,0,0,1,-1,-1,0,1,-1,1,0,1,0,0])},depth:{enable:!1},cull:{enable:!0,face:"back"},uniforms:{uLengthMultiplier:function(e,t){return void 0==t.lengthMultiplier?1:t.lengthMultiplier},uLineWidth:function(e,t){return(void 0===t.lineWidth?1:t.lineWidth)/e.framebufferHeight*e.pixelRatio},uArrowheadShape:function(e,t){var r=void 0===t.arrowheadLength?8:t.arrowheadLength,n=void 0===t.arrowheadWidth?4:t.arrowheadWidth;return[r/e.framebufferHeight*e.pixelRatio*2,n/e.framebufferHeight*e.pixelRatio]},uColor:e.prop("color"),uAspect:function(e){return e.framebufferWidth/e.framebufferHeight}},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:"src alpha",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},primitive:"triangles",instances:function(e,t){return 2*Math.floor(t.count/2)},count:9})}},{}],40:[function(e,t,r){"use strict";var n=e("./lagrange-points"),i=e("./scrollyteller"),a=e("./sequencer"),o=e("h");e("insert-css")("\nbody {\n  background-color: black;\n}\n\na,\na:visited {\n\tcolor: #8bd;\n}\na:hover {\n\tcolor: #ace;\n}\n\ncanvas {\n  position: fixed !important;\n  top: 0;\n  right: 0;\n  left: 0;\n  bottom: 0;\n}\n\n.frame-container {\n  width: 100%;\n  position: relative;\n  z-index: 1000;\n}\n\n.frame {\n\tfont-family: 'Open Sans', sans-serif;\n  height: 110vh;\n  position: relative;\n  text-align: center;\n}\n\n.frame-content a,\n.frame-content a:visited {\n\tcolor: #345;\n}\n.frame-content a:hover {\n\tcolor: #456;\n}\n\n.frame-title {\n  font-weight: 400;\n\n  position: relative;\n  top: 5vh;\n  z-index: 1000;\n  color: white;\n  margin-left: auto;\n  margin-right: auto;\n  padding: 0 15px;\n}\n\n.frame-text {\n\tcolor: white;\n  text-align: left;\n\tmax-width: 420px;\n\tmargin-left: auto;\n\tmargin-right: auto;\n\tposition: relative;\n\ttop: 10vh;\n  line-height: 1.4;\n  padding: 0 15px;\n}\n\n.frame-content {\n  text-align: left;\n  font-size: 16px;\n  line-height: 1.5;\n\n  background-color: rgba(255, 255, 255, 0.8);\n  padding: 10px 12px;\n  display: inline-block;\n  max-width: 350px;\n  position: absolute;\n  bottom: 10%;\n  left: 10%;\n}\n");var s=1.5;window.innerWidth>640?s=1.25:window.innerWidth>800?s=1.125:window.innerWidth>1024&&(s=1),e("regl")({pixelRatio:Math.min(window.devicePixelRatio,s),extensions:["oes_standard_derivatives","angle_instanced_arrays"],attributes:{antialias:!0,alpha:!1},onDone:e("fail-nicely")(function(t){var r,s=e("./draw-background")(t),f=e("./draw-field")(t),u=e("./draw-axes")(t),c=e("./draw-lines")(t),l=e("./draw-vector-field")(t),h=e("./draw-text")(t,["L1","L2","L3","L4","L5"]),p=e("./draw-points")(t),d=e("./uniforms")(t),m={mu:.1,scale:1.5,synodicFrame:0,synodicField:0,restrictedThreeBodySynodicWasRunning:!1,dirty:!0},g=t.buffer(new Float32Array(10));function v(){r=n(m.mu),g.subdata(r)}v();var y=e("./restricted-three-body")(m),b=t.buffer(y.state);var x=e("./arrow-field")(function(e,t){var r=Math.sqrt(e*e+t*t),n=r*r,i=Math.min(.1/n,.2);return[-e*i/r,-t*i/r]},-4,4,-4,4,.25),w=t.buffer(x),k=e("./arrow-field")(function(e,t){var r=Math.sqrt(e*e+t*t),n=r*r,i=Math.min(.2*n,.4);return[e/r*i,t/r*i]},-3,3,-3,3,.4),A=t.buffer(k);window.addEventListener("resize",function(){return m.dirty=!0});var _=[{raw:o("div",[o("h1.frame-title","The Three-Body Problem"),o("p.frame-text",["Just as the earth resists our best attempts at jumping or the sun pulls the earth around in its orbit, we all have some sense of what it means for objects to pull on each other gravitationally. Still, even though everything pulls on everything simultaneously, we don't typically consider more than two objects at a time."]),o("p.frame-text",["In this exploration, we'll go a step further and consider what it means for two bodies to pull on a third."])]),state:{omega:[{t:-1,value:.8}],scale:[{t:-1,value:1.7},{t:1,value:1.3}],y0:[{t:-2,value:-2.2},{t:2,value:0}],bgOpacity:[{t:0,value:1}]}},{content:o("span",["Consider the earth as it orbits the sun (not to scale), though any two gravitating bodies would do."],o("br"),o("br"),"The orbit isn't perfectly circular, but at ","147,100,000 km from the sun at Earth's closest approach (",o("em",o("a",{href:"https://en.wikipedia.org/wiki/Apsis",target:"_blank"},"perihelion")),") to 152,100,000 km at its farthest (",o("em",o("a",{href:"https://en.wikipedia.org/wiki/Apsis",target:"_blank"},"aphelion")),"), it's close enough we'll treat it as circular."),state:{orbitOpacity:[{t:-.5,value:0},{t:.5,value:.5}],bgOpacity:[{t:-.5,value:1},{t:.5,value:.8}]}},{content:o("span",["The mass of the earth is only about ",o("a",{href:"http://www.wolframalpha.com/input/?i=(mass+of+the+earth)+%2F+(mass+of+the+sun)+as+a+percent",target:"_blank"},"0.0003%")," the mass of the sun. To make things interesting and easier to see, we'll imagine an Earth with 10% the mass of the sun."]),state:{mu:[{t:-.5,value:.001},{t:.5,value:1/11}]}},{content:o("span",["With this exaggerated mass, we see that the sun and the earth orbit their collective center of mass. This system is called the ",o("em",[o("a",{href:"https://en.wikipedia.org/wiki/Two-body_problem",target:"_blank"},"two-body problem")])," and is very straightforward to solve."]),state:{axisOpacity:[{t:-.5,value:0},{t:.5,value:.5}],orbitOpacity:[{t:-.5,value:.5},{t:.5,value:.4}]}},{content:o("span",["A third body interacts gravitationally with the other two. This system is called the ",o("em",o("a",{href:"https://en.wikipedia.org/wiki/Three-body_problem",target:"_blank"},"three-body problem"))," and immediately complicates things beyond our ability to solve directly. (simulation not yet implemented)"]),state:{axisOpacity:[{t:-.25,value:.5},{t:0,value:0}],orbitOpacity:[{t:-.25,value:.4},{t:0,value:0}],synodicPointsOpacity:[{t:-.25,value:1},{t:-0,value:0}],generalThreeBodyOpacity:[{t:-.25,value:0},{t:0,value:1},{t:1,value:1},{t:1.5,value:0}]}},{state:{orbitOpacity:[{t:.5,value:0},{t:.75,value:.4}],synodicPointsOpacity:[{t:.5,value:0},{t:.75,value:1}]}},{content:o("span",["If, however, we add the restriction that the the mass of the third body is insignificant relative to the two larger bodies, we can say quite a bit about the behavior. This is called the ",o("em",o("a",{href:"https://ocw.mit.edu/courses/aeronautics-and-astronautics/16-07-dynamics-fall-2009/lecture-notes/MIT16_07F09_Lec18.pdf",target:"_blank"},"restricted circular three-body problem")),"."]),state:{thirdBodyColor:[{t:-.5,value:[.7,.7,.7,0]},{t:-.25,value:[.7,.7,.7,1]}],restrictedThreeBodyInitialConditions:[{t:-1,value:[1.13,0,0,-.935]},{t:2,value:[1.13,0,0,-.935]}],restrictedThreeBodySynodicOpacity:[{t:-.5,value:0},{t:0,value:1},{t:1,value:1},{t:1.5,value:0}]}},{},{content:"To understand how the third body moves in this system, let's first look at the gravitational field of the sun.",state:{mu:[{t:-.5,value:1/11},{t:0,value:0}],orbitOpacity:[{t:-.5,value:.8},{t:0,value:0}]}},{content:"The sun's gravitational field pulls objects inward with strength inversely proportional to the square of distance.",state:{sunVectorFieldOpacity:[{t:-.5,value:0},{t:0,value:.5}],sunVectorFieldLength:[{t:-.5,value:0},{t:0,value:1}]}},{content:"We can represent the sun's gravity as a potential field. Objects in this field fall inward toward lower potential.",state:{omega:[{t:-1,value:.8},{t:0,value:.3}],fieldOpacity:[{t:0,value:0},{t:.5,value:1}],sunVectorFieldOpacity:[{t:0,value:.5},{t:1,value:0}],fieldContourOpacity:[{t:0,value:0},{t:.5,value:.3}],bgOpacity:[{t:0,value:.8},{t:.1,value:.7}]}},{content:"In the circular two-body problem, the earth and sun fall into each other's gravitational fields and sit in circular orbits.",state:{mu:[{t:-.5,value:0},{t:.25,value:1/11}],orbitOpacity:[{t:-.5,value:0},{t:.25,value:1}]}},{content:"We now want to consider a small third body moving in this potential. Unfortunately, it's a bit too difficult for us to analyze moving objects in moving gravitational fields.",state:{restrictedThreeBodyInitialConditions:[{t:-1,value:[1,0,0,-1]},{t:4,value:[1,0,0,-1]}],thirdBodyColor:[{t:-1,value:[.7,.7,.7,1]},{t:4,value:[.7,.7,.7,1]}],restrictedThreeBodySynodicOpacity:[{t:0,value:0},{t:.5,value:1}]}},{content:o("span",["To simplify things, imagine that we, the observer, rotate at the same speed as the earth-sun system.",o("br"),o("br"),o("span",["In this rotating frame of reference, called the ",o("em","synodic frame"),", the earth and sun appear"," to stand still while the rest of the universe spins around us."])]),state:{synodicFrame:[{t:-.5,value:0},{t:.5,value:1}]}},{content:o("span",["We can still use our potential field to compute the force of gravity, but to correctly describe the motion from our rotating frame, we must also add the apparent ",o("em",o("a",{href:"https://en.wikipedia.org/wiki/Centrifugal_force",target:"_blank"},"centrifugal"))," and ",o("em",o("a",{href:"https://en.wikipedia.org/wiki/Coriolis_force",target:"_blank"},"Coriolis"))," forces."]),state:{scale:[{t:-2,value:1.3}]}},{content:o("span",["Objects moving in a straight line appear to get deflected when seen from a rotating frame. This is called the Coriolis effect.",o("br"),o("br"),"It's nothing more than a fictitious force to help account for our rotation, but since it depends on the velocity of the object, it's a bit inconvenient. We'll neglect the Coriolis force with the caveat that we'll only be able to talk about objects stationary in the synodic frame."])},{content:"Centrifugal force is simpler. It's an apparent outward pull seen in rotating frames.",state:{scale:[{t:1.5,value:1.7}],centrifugalVectorFieldOpacity:[{t:-.25,value:0},{t:.25,value:1}],centrifugalVectorFieldLength:[{t:-.25,value:0},{t:.25,value:1}]}},{content:"We can easily build centrifugal force into our potential as an outward pull that counteracts gravity's inward pull.",state:{centrifugalVectorFieldOpacity:[{t:-.25,value:1},{t:.5,value:0}],synodicField:[{t:-.25,value:0},{t:.5,value:1}]}},{content:o("span",["Since we neglected the Coriolis force, the resulting field is called the ",o("em","pseudo-potential"),".",o("br"),o("br"),"It's not a full gravitational potential for our rotating frame, but it does work for objects stationary in the synodic frame."]),state:{restrictedThreeBodySynodicOpacity:[{t:0,value:1},{t:.5,value:0}]}},{content:"For a single gravitating body and a given rotational speed, there's a radius at which the pseudo-potential is simply flat.",state:{mu:[{t:-.5,value:1/11},{t:0,value:0}]}},{content:"Satellites with negligible mass can sit in a circular orbit anywhere in this ring.",state:{mu:[{t:-.25,value:0},{t:.25,value:1e-7}]}},{content:"If both bodies are massive, however, the pseudo-potential is more complicated.",state:{mu:[{t:-.25,value:1e-7},{t:.25,value:1/11}]}},{content:o("span",["In fact the pseudo-potential for two bodies has five separate equilibrium points at which stationary objects remain stationary. These are called the ",o("em","Lagrange")," or ",o("em","libration points"),", abbreviated L",o("sub",1)," through L",o("sub",5),"."]),state:{librationPointOpacity:[{t:-.25,value:0},{t:.05,value:1}]}},{content:o("span",["Objects at the Lagrange points orbit together with the earth and sun and experience no net pull away from the respective Lagrange point."]),state:{fieldOpacity:[{t:-.25,value:1},{t:.1,value:.35},{t:.8,value:.35},{t:1,value:1}],synodicFrame:[{t:-.3,value:1},{t:0,value:0}]}},{content:o("span",["The location of the Lagrange points depends only on the relative masses of the two bodies."]),state:{synodicFrame:[{t:-.25,value:0},{t:-.05,value:1}],mu:[{t:.5,value:1/11}]}},{content:"For two equally massive bodies, the Lagrange points are symmetric.",state:{mu:[{t:.2,value:.5},{t:1,value:.5}]}},{},{content:"For the earth and sun, the Lagrange points look more like this.",state:{mu:[{t:0,value:.001},{t:1,value:.001}]}},{state:{mu:[{t:.5,value:1/11}]}},{}],S=a(function(e){for(var t={},r=0;r<e.length;r++){var n=e[r].state;if(n)for(var i=Object.keys(n),a=0;a<i.length;a++){var o=i[a],s=n[o].map(function(e){return Object.assign({},e,{t:r+e.t})});t[o],t[o]=(t[o]||[]).concat(s)}}return t}(_)),M=null,T=new Float32Array(4),F=t.buffer(T),O=new Float32Array(0),E=new Float32Array(0),C=t.buffer(O),D=t.buffer(E);var z=function(e){return o("div.frame-container",e.map(function(e){return o("div.frame",e.raw&&e.raw,e.content&&[o("div.frame-content",e.content)])}))}(_),P=i(z,{tmin:0,tmax:_.length-1});document.body.appendChild(z),P.onUpdate(S.setPosition),S.setPosition(0);var j,B=null;t.frame(function(e){null!==B&&(j=e.time-B),B=e.time,Object.assign(m,S.getState()),m.dirty=!1,function(e){if(M!==e){v(),T[0]=-e,T[2]=1-e,F.subdata(T);var t=e,r=1-e,n=2*Math.PI*t,i=2*Math.PI*r,a=Math.ceil(10+n/.4),o=Math.ceil(10+i/.4),s=Math.max(1,Math.floor(Math.sqrt(n/.001))),f=Math.max(1,Math.floor(Math.sqrt(i/.001)));O=new Float32Array(3*s),E=new Float32Array(3*f);for(var u=0,c=0;u<s;u++,c+=3){var l=u/(s-1)*Math.PI*2;O[c]=Math.cos(l)*t,O[c+1]=Math.sin(l)*t,O[c+2]=u/(s-1)*a}for(var u=0,c=0;u<f;u++,c+=3){var l=u/(f-1)*Math.PI*2;E[c]=Math.cos(l)*r,E[c+1]=Math.sin(l)*r,E[c+2]=u/(f-1)*o}C=C(O),D=D(E)}M=e}(m.mu),d(Object.assign(m,e),function(){m.fieldOpacity>1e-4&&f({opacity:m.fieldOpacity,contourOpacity:m.fieldContourOpacity}),m.bgOpacity>1e-4&&s({opacity:m.bgOpacity}),m.axisOpacity>1e-4&&u({opacity:m.axisOpacity}),m.orbitOpacity>1e-4&&c([{points:C,count:O.length/3,color:[1,1,1,m.orbitOpacity],lineWidth:1.5},{points:D,count:E.length/3,color:[1,1,1,m.orbitOpacity],lineWidth:1.5}]),m.sunVectorFieldOpacity>1e-4&&l({points:w,count:x.length,arrowheadWidth:8,arrowheadLenth:10,lineWidth:2,lengthMultiplier:m.sunVectorFieldLength,color:[1,.95,.75,m.sunVectorFieldOpacity]}),m.centrifugalVectorFieldOpacity>1e-4&&l({points:A,count:k.length,arrowheadWidth:12,arrowheadLength:14,lineWidth:4,lengthMultiplier:m.centrifugalVectorFieldLength,color:[.8,.95,1,m.centrifugalVectorFieldOpacity]}),p([{color:[1,.9,.4,1*m.synodicPointsOpacity],points:{buffer:F},pointSize:Math.max(8,30*Math.sqrt(1-m.mu)),halo:.3,count:1},{color:[.2,.4,1,1*m.synodicPointsOpacity],points:{buffer:F,offset:8},pointSize:Math.max(10,30*Math.sqrt(m.mu))*(m.mu>1e-8?1:0),halo:.1,count:1}]),m.restrictedThreeBodySynodicOpacity>1e-4?(m.restrictedThreeBodySynodicWasRunning||(y.initialize(),m.restrictedThreeBodySynodicWasRunning=!0),function(e){y.step(e),b.subdata(y.state)}(j),p({color:m.thirdBodyColor,points:{buffer:b},pointSize:10,halo:.2,count:1})):m.restrictedThreeBodySynodicWasRunning=!1,m.librationPointOpacity>.01&&(p({color:[1,0,.1,m.librationPointOpacity],points:g,halo:.2,count:5}),h([0,1,2,3,4].map(function(e){return{opacity:m.librationPointOpacity,position:r.slice(2*e,2*(e+1)),offset:[15,-15],index:e}})))})})})})},{"./arrow-field":32,"./draw-axes":33,"./draw-background":34,"./draw-field":35,"./draw-lines":36,"./draw-points":37,"./draw-text":38,"./draw-vector-field":39,"./lagrange-points":41,"./restricted-three-body":42,"./scrollyteller":43,"./sequencer":44,"./uniforms":45,"fail-nicely":13,h:21,"insert-css":22,regl:28}],41:[function(e,t,r){"use strict";var n=e("durand-kerner");t.exports=function(e){for(var t,r,i,a=e*e,o=e*a,s=a*a,f=n([-3*a+3*e-1,s-2*o+a-4*e+2,4*o-6*a+2*e-1,6*a-6*e+1,4*e-2,1]),u=0;u<5;u++)Math.abs(f[1][u])<1e-8&&(r=f[0][u]);var c=n([2*o-3*a+3*e-1,s-2*o+5*a-4*e+2,4*o-6*a+4*e-1,6*a-6*e+1,4*e-2,1]);for(u=0;u<5;u++)Math.abs(c[1][u])<1e-8&&(t=c[0][u]);var l=n([3*a-3*e+1,s-2*o+a+4*e-2,4*o-6*a+2*e+1,6*a-6*e+1,4*e-2,1]);for(u=0;u<5;u++)Math.abs(l[1][u])<1e-8&&(i=l[0][u]);var h=.5-e,p=.5*Math.sqrt(3);return new Float32Array([t,0,r,0,i,0,h,p,h,-p])}},{"durand-kerner":11}],42:[function(e,t,r){var n=e("ode45-cash-karp");t.exports=function(e){var t=0,r=new Float32Array(4),i=n(r,function(t,r,n){var i=e.mu,a=r[0],o=r[1],s=r[2],f=r[3],u=o*o,c=Math.sqrt(Math.pow(a+i,2)+u),l=Math.sqrt(Math.pow(a-1+i,2)+u),h=c*c*c,p=l*l*l;t[0]=r[2],t[1]=r[3],t[2]=2*f+a-(1-i)*(a+i)/h-i*(a-1+i)/p,t[3]=-2*s+o-(1-i)*o/h-i*o/p},t,1/60);function a(){if(t=0,i.t=0,i.dt=1/60*e.omega,e.restrictedThreeBodyInitialConditions)for(var n=0;n<4;n++)r[n]=e.restrictedThreeBodyInitialConditions[n]}return a(),{initialize:a,step:function(r){return t+=r*e.omega,i.steps(1e3,t),i.y},state:r,getTime:function(){return i.t}}}},{"ode45-cash-karp":24}],43:[function(e,t,r){e("h");var n=1/Math.log(2);t.exports=function(e,t){var r,i=(t=t||{}).resolutionFactor||10,a=1e3*t.timeConstant||100,o=-n/a,s=t.tmin||0,f=t.tmax||1;function u(){return window.scrollY/(e.offsetHeight-window.innerHeight)}function c(t){var r=e.offsetHeight;return Math.round(t*r*i)/r/i}var l,h=u(),p=0,d=c(h),m=!1;function g(e){var t=e-p;if(void 0!==p){var n=Math.exp(t*o);h*=n,h+=(1-n)*u()}var i=c(h);i===d&&m||(r&&(r(s+(f-s)*i),m=!0),d=i),l=requestAnimationFrame(g),p=e}function v(){if(void 0===l)return l=requestAnimationFrame(g),y}requestAnimationFrame(v);var y={onUpdate:function(e){return r=e,y},start:v,stop:function(){if(void 0!==l)return cancelAnimationFrame(l),l=void 0,y}};return y}},{h:21}],44:[function(e,t,r){e("h");var n=e("eases/cubic-in-out"),i=e("gl-vec3/lerp"),a=e("gl-vec4/lerp");t.exports=function(e,t){var r=Object.keys(e);function o(e,t,r){switch(e.length){case void 0:return(1-r)*e+r*t;case 2:return vec2Lerp([],e,t,r);case 3:return i([],e,t,r);case 4:return a([],e,t,r)}}var s={},f={};function u(t){for(var i,a=!1,u=0;u<r.length;u++){var c=r[u],l=e[c],h=Array.isArray(l)?l:l.steps;f[c]=!1;for(var p=h[0],d=0;d<h.length;d++){var m=h[d];if(t<m.t)break;p=m}(i=p===m?p.value:(l.interpolate||o)(p.value,m.value,(m.ease||n)((t-p.t)/(m.t-p.t))))!==s[c]&&(f[c]=!0,a=!0,s[c]=i)}return a}var c=0;u(c);var l={setPosition:function(e){return c=e,u(e)&&t&&t(s,f),l},getPosition:function(){return c},getState:function(){return s}};return l}},{"eases/cubic-in-out":12,"gl-vec3/lerp":18,"gl-vec4/lerp":19,h:21}],45:[function(e,t,r){"use strict";var n=e("gl-mat4/identity"),i=e("gl-mat4/invert"),a=e("gl-mat4/create");t.exports=function(t){var r=a(),o=a(),s=a(),f=a(),u=a(),c=a(),l=0,h=null,p=0,d=t({uniforms:{uResolution:function(e){return[1/e.framebufferWidth,1/e.framebufferHeight]},uWorld:function(){return u},uWorldInverse:function(){return c},uModel:function(){return s},uModelInverse:function(){return f},uViewInverse:function(){return o},uView:function(){return r},uRotation:t.prop("rotationSpeed"),uSynodicField:t.prop("synodicField"),uColormap:t.texture([e("./viridis")]),uMu:t.prop("mu"),uM1:function(e,t){return t.mu},uM2:function(e,t){return 1-t.mu},uR1:function(e,t){return 1-t.mu},uR2:function(e,t){return t.mu},uOmega:2*Math.PI}});return function(e,t){var a=e.time;if(null!==h){var m=a-h;e.rotationSpeed=(1-e.synodicFrame)*e.omega,p+=e.rotationSpeed*m,l-=(e.omega-e.rotationSpeed)*m}h=a;var g=Math.cos(p),v=Math.sin(p);n(s),s[0]=g,s[1]=v,s[4]=-v,s[5]=g,s[13]=e.y0,i(f,s),g=Math.cos(l),v=Math.sin(l),n(u),u[0]=g,u[1]=v,u[4]=-v,u[5]=g,u[13]=e.y0,i(c,u);var y,b,x=(y=e.framebufferWidth,b=e.framebufferHeight,y>b?[y/b,1]:[1,b/y]);n(o),o[0]=x[0]*e.scale,o[5]=x[1]*e.scale,i(r,o),d(e,t)}}},{"./viridis":46,"gl-mat4/create":15,"gl-mat4/identity":16,"gl-mat4/invert":17}],46:[function(e,t,r){t.exports=[[.26700401,.00487433,.32941519,1],[.26851048,.00960483,.33542652,1],[.26994384,.01462494,.34137895,1],[.27130489,.01994186,.34726862,1],[.27259384,.02556309,.35309303,1],[.27380934,.03149748,.35885256,1],[.27495242,.03775181,.36454323,1],[.27602238,.04416723,.37016418,1],[.2770184,.05034437,.37571452,1],[.27794143,.05632444,.38119074,1],[.27879067,.06214536,.38659204,1],[.2795655,.06783587,.39191723,1],[.28026658,.07341724,.39716349,1],[.28089358,.07890703,.40232944,1],[.28144581,.0843197,.40741404,1],[.28192358,.08966622,.41241521,1],[.28232739,.09495545,.41733086,1],[.28265633,.10019576,.42216032,1],[.28291049,.10539345,.42690202,1],[.28309095,.11055307,.43155375,1],[.28319704,.11567966,.43611482,1],[.28322882,.12077701,.44058404,1],[.28318684,.12584799,.44496,1],[.283072,.13089477,.44924127,1],[.28288389,.13592005,.45342734,1],[.28262297,.14092556,.45751726,1],[.28229037,.14591233,.46150995,1],[.28188676,.15088147,.46540474,1],[.28141228,.15583425,.46920128,1],[.28086773,.16077132,.47289909,1],[.28025468,.16569272,.47649762,1],[.27957399,.17059884,.47999675,1],[.27882618,.1754902,.48339654,1],[.27801236,.18036684,.48669702,1],[.27713437,.18522836,.48989831,1],[.27619376,.19007447,.49300074,1],[.27519116,.1949054,.49600488,1],[.27412802,.19972086,.49891131,1],[.27300596,.20452049,.50172076,1],[.27182812,.20930306,.50443413,1],[.27059473,.21406899,.50705243,1],[.26930756,.21881782,.50957678,1],[.26796846,.22354911,.5120084,1],[.26657984,.2282621,.5143487,1],[.2651445,.23295593,.5165993,1],[.2636632,.23763078,.51876163,1],[.26213801,.24228619,.52083736,1],[.26057103,.2469217,.52282822,1],[.25896451,.25153685,.52473609,1],[.25732244,.2561304,.52656332,1],[.25564519,.26070284,.52831152,1],[.25393498,.26525384,.52998273,1],[.25219404,.26978306,.53157905,1],[.25042462,.27429024,.53310261,1],[.24862899,.27877509,.53455561,1],[.2468114,.28323662,.53594093,1],[.24497208,.28767547,.53726018,1],[.24311324,.29209154,.53851561,1],[.24123708,.29648471,.53970946,1],[.23934575,.30085494,.54084398,1],[.23744138,.30520222,.5419214,1],[.23552606,.30952657,.54294396,1],[.23360277,.31382773,.54391424,1],[.2316735,.3181058,.54483444,1],[.22973926,.32236127,.54570633,1],[.22780192,.32659432,.546532,1],[.2258633,.33080515,.54731353,1],[.22392515,.334994,.54805291,1],[.22198915,.33916114,.54875211,1],[.22005691,.34330688,.54941304,1],[.21812995,.34743154,.55003755,1],[.21620971,.35153548,.55062743,1],[.21429757,.35561907,.5511844,1],[.21239477,.35968273,.55171011,1],[.2105031,.36372671,.55220646,1],[.20862342,.36775151,.55267486,1],[.20675628,.37175775,.55311653,1],[.20490257,.37574589,.55353282,1],[.20306309,.37971644,.55392505,1],[.20123854,.38366989,.55429441,1],[.1994295,.38760678,.55464205,1],[.1976365,.39152762,.55496905,1],[.19585993,.39543297,.55527637,1],[.19410009,.39932336,.55556494,1],[.19235719,.40319934,.55583559,1],[.19063135,.40706148,.55608907,1],[.18892259,.41091033,.55632606,1],[.18723083,.41474645,.55654717,1],[.18555593,.4185704,.55675292,1],[.18389763,.42238275,.55694377,1],[.18225561,.42618405,.5571201,1],[.18062949,.42997486,.55728221,1],[.17901879,.43375572,.55743035,1],[.17742298,.4375272,.55756466,1],[.17584148,.44128981,.55768526,1],[.17427363,.4450441,.55779216,1],[.17271876,.4487906,.55788532,1],[.17117615,.4525298,.55796464,1],[.16964573,.45626209,.55803034,1],[.16812641,.45998802,.55808199,1],[.1666171,.46370813,.55811913,1],[.16511703,.4674229,.55814141,1],[.16362543,.47113278,.55814842,1],[.16214155,.47483821,.55813967,1],[.16066467,.47853961,.55811466,1],[.15919413,.4822374,.5580728,1],[.15772933,.48593197,.55801347,1],[.15626973,.4896237,.557936,1],[.15481488,.49331293,.55783967,1],[.15336445,.49700003,.55772371,1],[.1519182,.50068529,.55758733,1],[.15047605,.50436904,.55742968,1],[.14903918,.50805136,.5572505,1],[.14760731,.51173263,.55704861,1],[.14618026,.51541316,.55682271,1],[.14475863,.51909319,.55657181,1],[.14334327,.52277292,.55629491,1],[.14193527,.52645254,.55599097,1],[.14053599,.53013219,.55565893,1],[.13914708,.53381201,.55529773,1],[.13777048,.53749213,.55490625,1],[.1364085,.54117264,.55448339,1],[.13506561,.54485335,.55402906,1],[.13374299,.54853458,.55354108,1],[.13244401,.55221637,.55301828,1],[.13117249,.55589872,.55245948,1],[.1299327,.55958162,.55186354,1],[.12872938,.56326503,.55122927,1],[.12756771,.56694891,.55055551,1],[.12645338,.57063316,.5498411,1],[.12539383,.57431754,.54908564,1],[.12439474,.57800205,.5482874,1],[.12346281,.58168661,.54744498,1],[.12260562,.58537105,.54655722,1],[.12183122,.58905521,.54562298,1],[.12114807,.59273889,.54464114,1],[.12056501,.59642187,.54361058,1],[.12009154,.60010387,.54253043,1],[.11973756,.60378459,.54139999,1],[.11951163,.60746388,.54021751,1],[.11942341,.61114146,.53898192,1],[.11948255,.61481702,.53769219,1],[.11969858,.61849025,.53634733,1],[.12008079,.62216081,.53494633,1],[.12063824,.62582833,.53348834,1],[.12137972,.62949242,.53197275,1],[.12231244,.63315277,.53039808,1],[.12344358,.63680899,.52876343,1],[.12477953,.64046069,.52706792,1],[.12632581,.64410744,.52531069,1],[.12808703,.64774881,.52349092,1],[.13006688,.65138436,.52160791,1],[.13226797,.65501363,.51966086,1],[.13469183,.65863619,.5176488,1],[.13733921,.66225157,.51557101,1],[.14020991,.66585927,.5134268,1],[.14330291,.66945881,.51121549,1],[.1466164,.67304968,.50893644,1],[.15014782,.67663139,.5065889,1],[.15389405,.68020343,.50417217,1],[.15785146,.68376525,.50168574,1],[.16201598,.68731632,.49912906,1],[.1663832,.69085611,.49650163,1],[.1709484,.69438405,.49380294,1],[.17570671,.6978996,.49103252,1],[.18065314,.70140222,.48818938,1],[.18578266,.70489133,.48527326,1],[.19109018,.70836635,.48228395,1],[.19657063,.71182668,.47922108,1],[.20221902,.71527175,.47608431,1],[.20803045,.71870095,.4728733,1],[.21400015,.72211371,.46958774,1],[.22012381,.72550945,.46622638,1],[.2263969,.72888753,.46278934,1],[.23281498,.73224735,.45927675,1],[.2393739,.73558828,.45568838,1],[.24606968,.73890972,.45202405,1],[.25289851,.74221104,.44828355,1],[.25985676,.74549162,.44446673,1],[.26694127,.74875084,.44057284,1],[.27414922,.75198807,.4366009,1],[.28147681,.75520266,.43255207,1],[.28892102,.75839399,.42842626,1],[.29647899,.76156142,.42422341,1],[.30414796,.76470433,.41994346,1],[.31192534,.76782207,.41558638,1],[.3198086,.77091403,.41115215,1],[.3277958,.77397953,.40664011,1],[.33588539,.7770179,.40204917,1],[.34407411,.78002855,.39738103,1],[.35235985,.78301086,.39263579,1],[.36074053,.78596419,.38781353,1],[.3692142,.78888793,.38291438,1],[.37777892,.79178146,.3779385,1],[.38643282,.79464415,.37288606,1],[.39517408,.79747541,.36775726,1],[.40400101,.80027461,.36255223,1],[.4129135,.80304099,.35726893,1],[.42190813,.80577412,.35191009,1],[.43098317,.80847343,.34647607,1],[.44013691,.81113836,.3409673,1],[.44936763,.81376835,.33538426,1],[.45867362,.81636288,.32972749,1],[.46805314,.81892143,.32399761,1],[.47750446,.82144351,.31819529,1],[.4870258,.82392862,.31232133,1],[.49661536,.82637633,.30637661,1],[.5062713,.82878621,.30036211,1],[.51599182,.83115784,.29427888,1],[.52577622,.83349064,.2881265,1],[.5356211,.83578452,.28190832,1],[.5455244,.83803918,.27562602,1],[.55548397,.84025437,.26928147,1],[.5654976,.8424299,.26287683,1],[.57556297,.84456561,.25641457,1],[.58567772,.84666139,.24989748,1],[.59583934,.84871722,.24332878,1],[.60604528,.8507331,.23671214,1],[.61629283,.85270912,.23005179,1],[.62657923,.85464543,.22335258,1],[.63690157,.85654226,.21662012,1],[.64725685,.85839991,.20986086,1],[.65764197,.86021878,.20308229,1],[.66805369,.86199932,.19629307,1],[.67848868,.86374211,.18950326,1],[.68894351,.86544779,.18272455,1],[.69941463,.86711711,.17597055,1],[.70989842,.86875092,.16925712,1],[.72039115,.87035015,.16260273,1],[.73088902,.87191584,.15602894,1],[.74138803,.87344918,.14956101,1],[.75188414,.87495143,.14322828,1],[.76237342,.87642392,.13706449,1],[.77285183,.87786808,.13110864,1],[.78331535,.87928545,.12540538,1],[.79375994,.88067763,.12000532,1],[.80418159,.88204632,.11496505,1],[.81457634,.88339329,.11034678,1],[.82494028,.88472036,.10621724,1],[.83526959,.88602943,.1026459,1],[.84556056,.88732243,.09970219,1],[.8558096,.88860134,.09745186,1],[.86601325,.88986815,.09595277,1],[.87616824,.89112487,.09525046,1],[.88627146,.89237353,.09537439,1],[.89632002,.89361614,.09633538,1],[.90631121,.89485467,.09812496,1],[.91624212,.89609127,.1007168,1],[.92610579,.89732977,.10407067,1],[.93590444,.8985704,.10813094,1],[.94563626,.899815,.11283773,1],[.95529972,.90106534,.11812832,1],[.96489353,.90232311,.12394051,1],[.97441665,.90358991,.13021494,1],[.98386829,.90486726,.13689671,1],[.99324789,.90615657,.1439362,1]].map(function(e){return e.map(function(e){return Math.max(0,Math.min(255,256*e))})})},{}]},{},[40]);