define("clustergrammer_widget2",["@jupyter-widgets/base"],function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EXTENSION_SPEC_VERSION="0.4.5"},function(e,n){e.exports=t},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const o=n(1),a=n(0),u=r(n(5)),s=i(n(6));console.log("version 0.5.0, new reorder buttons");class l extends o.DOMWidgetModel{defaults(){return Object.assign({},super.defaults(),{_model_name:l.model_name,_model_module:l.model_module,_model_module_version:l.model_module_version,_view_name:l.view_name,_view_module:l.view_module,_view_module_version:l.view_module_version,value:"default-string",network:""})}}function f(t){var e=document.getElementById(t.container_name);console.log("inst_container_2",e),t.container=e;var n=u.default(t);console.log("making clustergram in make_viz"),console.log(n)}l.serializers=Object.assign({},o.DOMWidgetModel.serializers),l.model_name="ExampleModel",l.model_module="clustergrammer_widget2",l.model_module_version=a.EXTENSION_SPEC_VERSION,l.view_name="ExampleView",l.view_module="clustergrammer_widget2",l.view_module_version=a.EXTENSION_SPEC_VERSION,e.ExampleModel=l,console.log(f);e.ExampleView=class extends o.DOMWidgetView{render(){this.value_changed(),console.log("\n**********************************************"),console.log("rendering!!"),console.log("**********************************************");var t=this.model.get("network"),e=JSON.parse(t);console.log(e);var n=this.cid;console.log("container_name",n);var r=s.select(this.el).append("div").classed("clustergrammer_glidget",!0).attr("id",n).style("width","900px").style("height","1035px").style("border","2px solid #eee"),i="#"+n;console.log(n,r,i);var o={container_name:n,network:e,viz_width:850,viz_height:850};console.log(o),setTimeout(f,10,o)}value_changed(){console.log("CHANGING")}}},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),r(n(4)),r(n(0)),r(n(2))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(1),i=n(2),o=n(0),a={id:"clustergrammer_widget2",requires:[r.IJupyterWidgetRegistry],activate:function(t,e){e.registerWidget({name:"clustergrammer_widget2",version:o.EXTENSION_SPEC_VERSION,exports:{ExampleModel:i.ExampleModel,ExampleView:i.ExampleView}})},autoStart:!0};e.default=a},function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="./src/main.js")}({"./img/graham_cracker_144.png":
/*!************************************!*\
  !*** ./img/graham_cracker_144.png ***!
  \************************************/
/*! no static exports found */function(t,e,n){t.exports=n.p+"401229782cf70826d5f0e68711a53a51.png"},"./node_modules/base64-js/index.js":
/*!*****************************************!*\
  !*** ./node_modules/base64-js/index.js ***!
  \*****************************************/
/*! no static exports found */function(t,e,n){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=l(t),r=n[0],a=n[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,r,a)),s=0,f=a>0?r-4:r,c=0;c<f;c+=4)e=i[t.charCodeAt(c)]<<18|i[t.charCodeAt(c+1)]<<12|i[t.charCodeAt(c+2)]<<6|i[t.charCodeAt(c+3)],u[s++]=e>>16&255,u[s++]=e>>8&255,u[s++]=255&e;2===a&&(e=i[t.charCodeAt(c)]<<2|i[t.charCodeAt(c+1)]>>4,u[s++]=255&e);1===a&&(e=i[t.charCodeAt(c)]<<10|i[t.charCodeAt(c+1)]<<4|i[t.charCodeAt(c+2)]>>2,u[s++]=e>>8&255,u[s++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=0,u=n-i;a<u;a+=16383)o.push(c(t,a,a+16383>u?u:a+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)r[u]=a[u],i[a.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function c(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(f(r));return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},"./node_modules/big-rat/add.js":
/*!*************************************!*\
  !*** ./node_modules/big-rat/add.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./lib/rationalize */"./node_modules/big-rat/lib/rationalize.js");t.exports=function(t,e){return r(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},"./node_modules/big-rat/cmp.js":
/*!*************************************!*\
  !*** ./node_modules/big-rat/cmp.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},"./node_modules/big-rat/div.js":
/*!*************************************!*\
  !*** ./node_modules/big-rat/div.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./lib/rationalize */"./node_modules/big-rat/lib/rationalize.js");t.exports=function(t,e){return r(t[0].mul(e[1]),t[1].mul(e[0]))}},"./node_modules/big-rat/index.js":
/*!***************************************!*\
  !*** ./node_modules/big-rat/index.js ***!
  \***************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./is-rat */"./node_modules/big-rat/is-rat.js"),i=n(/*! ./lib/is-bn */"./node_modules/big-rat/lib/is-bn.js"),o=n(/*! ./lib/num-to-bn */"./node_modules/big-rat/lib/num-to-bn.js"),a=n(/*! ./lib/str-to-bn */"./node_modules/big-rat/lib/str-to-bn.js"),u=n(/*! ./lib/rationalize */"./node_modules/big-rat/lib/rationalize.js"),s=n(/*! ./div */"./node_modules/big-rat/div.js");t.exports=function t(e,n){if(r(e))return n?s(e,t(n)):[e[0].clone(),e[1].clone()];var l=0;var f,c;if(i(e))f=e.clone();else if("string"==typeof e)f=a(e);else{if(0===e)return[o(0),o(1)];if(e===Math.floor(e))f=o(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),l-=256;f=o(e)}}if(r(n))f.mul(n[1]),c=n[0].clone();else if(i(n))c=n.clone();else if("string"==typeof n)c=a(n);else if(n)if(n===Math.floor(n))c=o(n);else{for(;n!==Math.floor(n);)n*=Math.pow(2,256),l+=256;c=o(n)}else c=o(1);l>0?f=f.ushln(l):l<0&&(c=c.ushln(-l));return u(f,c)}},"./node_modules/big-rat/is-rat.js":
/*!****************************************!*\
  !*** ./node_modules/big-rat/is-rat.js ***!
  \****************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./lib/is-bn */"./node_modules/big-rat/lib/is-bn.js");t.exports=function(t){return Array.isArray(t)&&2===t.length&&r(t[0])&&r(t[1])}},"./node_modules/big-rat/lib/bn-sign.js":
/*!*********************************************!*\
  !*** ./node_modules/big-rat/lib/bn-sign.js ***!
  \*********************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! bn.js */"./node_modules/bn.js/lib/bn.js");t.exports=function(t){return t.cmp(new r(0))}},"./node_modules/big-rat/lib/bn-to-num.js":
/*!***********************************************!*\
  !*** ./node_modules/big-rat/lib/bn-to-num.js ***!
  \***********************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./bn-sign */"./node_modules/big-rat/lib/bn-sign.js");t.exports=function(t){var e=t.length,n=t.words,i=0;if(1===e)i=n[0];else if(2===e)i=n[0]+67108864*n[1];else for(var o=0;o<e;o++){var a=n[o];i+=a*Math.pow(67108864,o)}return r(t)*i}},"./node_modules/big-rat/lib/ctz.js":
/*!*****************************************!*\
  !*** ./node_modules/big-rat/lib/ctz.js ***!
  \*****************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! double-bits */"./node_modules/double-bits/double.js"),i=n(/*! bit-twiddle */"./node_modules/bit-twiddle/twiddle.js").countTrailingZeros;t.exports=function(t){var e=i(r.lo(t));if(e<32)return e;var n=i(r.hi(t));if(n>20)return 52;return n+32}},"./node_modules/big-rat/lib/is-bn.js":
/*!*******************************************!*\
  !*** ./node_modules/big-rat/lib/is-bn.js ***!
  \*******************************************/
/*! no static exports found */function(t,e,n){"use strict";n(/*! bn.js */"./node_modules/bn.js/lib/bn.js");t.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},"./node_modules/big-rat/lib/num-to-bn.js":
/*!***********************************************!*\
  !*** ./node_modules/big-rat/lib/num-to-bn.js ***!
  \***********************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! bn.js */"./node_modules/bn.js/lib/bn.js"),i=n(/*! double-bits */"./node_modules/double-bits/double.js");t.exports=function(t){var e=i.exponent(t);return e<52?new r(t):new r(t*Math.pow(2,52-e)).ushln(e-52)}},"./node_modules/big-rat/lib/rationalize.js":
/*!*************************************************!*\
  !*** ./node_modules/big-rat/lib/rationalize.js ***!
  \*************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./num-to-bn */"./node_modules/big-rat/lib/num-to-bn.js"),i=n(/*! ./bn-sign */"./node_modules/big-rat/lib/bn-sign.js");t.exports=function(t,e){var n=i(t),o=i(e);if(0===n)return[r(0),r(1)];if(0===o)return[r(0),r(0)];o<0&&(t=t.neg(),e=e.neg());var a=t.gcd(e);if(a.cmpn(1))return[t.div(a),e.div(a)];return[t,e]}},"./node_modules/big-rat/lib/str-to-bn.js":
/*!***********************************************!*\
  !*** ./node_modules/big-rat/lib/str-to-bn.js ***!
  \***********************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! bn.js */"./node_modules/bn.js/lib/bn.js");t.exports=function(t){return new r(t)}},"./node_modules/big-rat/mul.js":
/*!*************************************!*\
  !*** ./node_modules/big-rat/mul.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./lib/rationalize */"./node_modules/big-rat/lib/rationalize.js");t.exports=function(t,e){return r(t[0].mul(e[0]),t[1].mul(e[1]))}},"./node_modules/big-rat/sign.js":
/*!**************************************!*\
  !*** ./node_modules/big-rat/sign.js ***!
  \**************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./lib/bn-sign */"./node_modules/big-rat/lib/bn-sign.js");t.exports=function(t){return r(t[0])*r(t[1])}},"./node_modules/big-rat/sub.js":
/*!*************************************!*\
  !*** ./node_modules/big-rat/sub.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./lib/rationalize */"./node_modules/big-rat/lib/rationalize.js");t.exports=function(t,e){return r(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},"./node_modules/big-rat/to-float.js":
/*!******************************************!*\
  !*** ./node_modules/big-rat/to-float.js ***!
  \******************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./lib/bn-to-num */"./node_modules/big-rat/lib/bn-to-num.js"),i=n(/*! ./lib/ctz */"./node_modules/big-rat/lib/ctz.js");t.exports=function(t){var e=t[0],n=t[1];if(0===e.cmpn(0))return 0;var o=e.abs().divmod(n.abs()),a=o.div,u=r(a),s=o.mod,l=e.negative!==n.negative?-1:1;if(0===s.cmpn(0))return l*u;if(u){var f=i(u)+4,c=r(s.ushln(f).divRound(n));return l*(u+c*Math.pow(2,-f))}var h=n.bitLength()-s.bitLength()+53,c=r(s.ushln(h).divRound(n));return h<1023?l*c*Math.pow(2,-h):(c*=Math.pow(2,-1023),l*c*Math.pow(2,1023-h))}},"./node_modules/binary-search-bounds/search-bounds.js":
/*!************************************************************!*\
  !*** ./node_modules/binary-search-bounds/search-bounds.js ***!
  \************************************************************/
/*! no static exports found */function(t,e,n){"use strict";function r(t,e,n,r,i){var o=["function ",t,"(a,l,h,",r.join(","),"){",i?"":"var i=",n?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a[m]"];return i?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),n?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),i?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,n,i){return new Function([r("A","x"+t+"y",e,["y"],i),r("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",n,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",n].join(""))()}t.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},"./node_modules/bit-twiddle/twiddle.js":
/*!*********************************************!*\
  !*** ./node_modules/bit-twiddle/twiddle.js ***!
  \*********************************************/
/*! no static exports found */function(t,e,n){"use strict";"use restrict";function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t<e)},e.max=function(t,e){return t^(t^e)&-(t<e)},e.isPow2=function(t){return!(t&t-1||!t)},e.log2=function(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var n=e,r=e,i=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=1&n,--i;t[e]=r<<i&255}}(i),e.reverse=function(t){return i[255&t]<<24|i[t>>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,n){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(n=1227133513&((n=3272356035&((n=251719695&((n=4278190335&((n&=1023)|n<<16))|n<<8))|n<<4))|n<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},"./node_modules/bn.js/lib/bn.js":
/*!**************************************!*\
  !*** ./node_modules/bn.js/lib/bn.js ***!
  \**************************************/
/*! no static exports found */function(t,e,n){(function(t){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function o(t,e,n){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=n(/*! buffer */0).Buffer}catch(t){}function u(t,e,n){for(var r=0,i=Math.min(t.length,n),o=e;o<i;o++){var a=t.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function s(t,e,n,r){for(var i=0,o=Math.min(t.length,n),a=e;a<o;a++){var u=t.charCodeAt(a)-48;i*=r,i+=u>=49?u-49+10:u>=17?u-17+10:u}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,u=0;if("be"===n)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<u&67108863,this.words[o+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===n)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<u&67108863,this.words[o+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,i,o=0;for(n=t.length-6,r=0;n>=e;n-=6)i=u(t,n,n+6),this.words[r]|=i<<o&67108863,this.words[r+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=u(t,e,n+6),this.words[r]|=i<<o&67108863,this.words[r+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,u=Math.min(o,o-a)+n,l=0,f=n;f<u;f+=r)l=s(t,f,f+r,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var c=1;for(l=s(t,f,t.length,e),f=0;f<a;f++)c*=e;this.imuln(c),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,u=67108863&a,s=a/67108864|0;n.words[0]=u;for(var l=1;l<r;l++){for(var f=s>>>26,c=67108863&s,h=Math.min(l,e.length-1),p=Math.max(0,l-t.length+1);p<=h;p++){var d=l-p|0;f+=(a=(i=0|t.words[d])*(o=0|e.words[p])+c)/67108864|0,c=67108863&a}n.words[l]=0|c,s=0|f}return 0!==s?n.words[l]=0|s:n.length--,n.strip()}o.prototype.toString=function(t,e){var n;if(t=t||10,e=0|e||1,16===t||"hex"===t){n="";for(var i=0,o=0,a=0;a<this.length;a++){var u=this.words[a],s=(16777215&(u<<i|o)).toString(16);n=0!==(o=u>>>24-i&16777215)||a!==this.length-1?l[6-s.length]+s+n:s+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],p=c[t];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);n=(d=d.idivn(p)).isZero()?m+n:l[h-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,u,s="le"===e,l=new t(o),f=this.clone();if(s){for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),l[u]=a;for(;u<o;u++)l[u]=0}else{for(u=0;u<o-i;u++)l[u]=0;for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),l[o-u-1]=a}return l},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o<r.length;o++)e=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<n.length;o++)e=(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)o=(e=(0|n.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,n){var r,i,o,a=t.words,u=e.words,s=n.words,l=0,f=0|a[0],c=8191&f,h=f>>>13,p=0|a[1],d=8191&p,m=p>>>13,g=0|a[2],v=8191&g,y=g>>>13,_=0|a[3],b=8191&_,x=_>>>13,w=0|a[4],M=8191&w,j=w>>>13,k=0|a[5],A=8191&k,z=k>>>13,E=0|a[6],S=8191&E,T=E>>>13,C=0|a[7],P=8191&C,O=C>>>13,N=0|a[8],I=8191&N,D=N>>>13,L=0|a[9],R=8191&L,B=L>>>13,F=0|u[0],q=8191&F,U=F>>>13,Y=0|u[1],H=8191&Y,V=Y>>>13,Z=0|u[2],W=8191&Z,Q=Z>>>13,X=0|u[3],G=8191&X,K=X>>>13,$=0|u[4],J=8191&$,tt=$>>>13,et=0|u[5],nt=8191&et,rt=et>>>13,it=0|u[6],ot=8191&it,at=it>>>13,ut=0|u[7],st=8191&ut,lt=ut>>>13,ft=0|u[8],ct=8191&ft,ht=ft>>>13,pt=0|u[9],dt=8191&pt,mt=pt>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(l+(r=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,U))+Math.imul(h,q)|0))<<13)|0;l=((o=Math.imul(h,U))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(d,q),i=(i=Math.imul(d,U))+Math.imul(m,q)|0,o=Math.imul(m,U);var vt=(l+(r=r+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,V)|0)+Math.imul(h,H)|0))<<13)|0;l=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,q),i=(i=Math.imul(v,U))+Math.imul(y,q)|0,o=Math.imul(y,U),r=r+Math.imul(d,H)|0,i=(i=i+Math.imul(d,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var yt=(l+(r=r+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,Q)|0)+Math.imul(h,W)|0))<<13)|0;l=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(b,q),i=(i=Math.imul(b,U))+Math.imul(x,q)|0,o=Math.imul(x,U),r=r+Math.imul(v,H)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,V)|0,r=r+Math.imul(d,W)|0,i=(i=i+Math.imul(d,Q)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Q)|0;var _t=(l+(r=r+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(h,G)|0))<<13)|0;l=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(M,q),i=(i=Math.imul(M,U))+Math.imul(j,q)|0,o=Math.imul(j,U),r=r+Math.imul(b,H)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Q)|0,r=r+Math.imul(d,G)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var bt=(l+(r=r+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(h,J)|0))<<13)|0;l=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(A,q),i=(i=Math.imul(A,U))+Math.imul(z,q)|0,o=Math.imul(z,U),r=r+Math.imul(M,H)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,V)|0,r=r+Math.imul(b,W)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,K)|0,r=r+Math.imul(d,J)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,tt)|0;var xt=(l+(r=r+Math.imul(c,nt)|0)|0)+((8191&(i=(i=i+Math.imul(c,rt)|0)+Math.imul(h,nt)|0))<<13)|0;l=((o=o+Math.imul(h,rt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(S,q),i=(i=Math.imul(S,U))+Math.imul(T,q)|0,o=Math.imul(T,U),r=r+Math.imul(A,H)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(z,H)|0,o=o+Math.imul(z,V)|0,r=r+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,K)|0,r=r+Math.imul(v,J)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,tt)|0,r=r+Math.imul(d,nt)|0,i=(i=i+Math.imul(d,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0;var wt=(l+(r=r+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,at)|0)+Math.imul(h,ot)|0))<<13)|0;l=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(P,q),i=(i=Math.imul(P,U))+Math.imul(O,q)|0,o=Math.imul(O,U),r=r+Math.imul(S,H)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(A,W)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(z,W)|0,o=o+Math.imul(z,Q)|0,r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,K)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,tt)|0,r=r+Math.imul(v,nt)|0,i=(i=i+Math.imul(v,rt)|0)+Math.imul(y,nt)|0,o=o+Math.imul(y,rt)|0,r=r+Math.imul(d,ot)|0,i=(i=i+Math.imul(d,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(l+(r=r+Math.imul(c,st)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(h,st)|0))<<13)|0;l=((o=o+Math.imul(h,lt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(I,q),i=(i=Math.imul(I,U))+Math.imul(D,q)|0,o=Math.imul(D,U),r=r+Math.imul(P,H)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Q)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(z,G)|0,o=o+Math.imul(z,K)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,tt)|0,r=r+Math.imul(b,nt)|0,i=(i=i+Math.imul(b,rt)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,rt)|0,r=r+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,r=r+Math.imul(d,st)|0,i=(i=i+Math.imul(d,lt)|0)+Math.imul(m,st)|0,o=o+Math.imul(m,lt)|0;var jt=(l+(r=r+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(h,ct)|0))<<13)|0;l=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(R,q),i=(i=Math.imul(R,U))+Math.imul(B,q)|0,o=Math.imul(B,U),r=r+Math.imul(I,H)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(P,W)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,K)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(z,J)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(j,nt)|0,o=o+Math.imul(j,rt)|0,r=r+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,r=r+Math.imul(v,st)|0,i=(i=i+Math.imul(v,lt)|0)+Math.imul(y,st)|0,o=o+Math.imul(y,lt)|0,r=r+Math.imul(d,ct)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ht)|0;var kt=(l+(r=r+Math.imul(c,dt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(h,dt)|0))<<13)|0;l=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(R,H),i=(i=Math.imul(R,V))+Math.imul(B,H)|0,o=Math.imul(B,V),r=r+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,Q)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,K)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(A,nt)|0,i=(i=i+Math.imul(A,rt)|0)+Math.imul(z,nt)|0,o=o+Math.imul(z,rt)|0,r=r+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,r=r+Math.imul(b,st)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(x,st)|0,o=o+Math.imul(x,lt)|0,r=r+Math.imul(v,ct)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,ht)|0;var At=(l+(r=r+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;l=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,K)|0,r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(S,nt)|0,i=(i=i+Math.imul(S,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,at)|0,r=r+Math.imul(M,st)|0,i=(i=i+Math.imul(M,lt)|0)+Math.imul(j,st)|0,o=o+Math.imul(j,lt)|0,r=r+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,ht)|0;var zt=(l+(r=r+Math.imul(v,dt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,dt)|0))<<13)|0;l=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,K))+Math.imul(B,G)|0,o=Math.imul(B,K),r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(P,nt)|0,i=(i=i+Math.imul(P,rt)|0)+Math.imul(O,nt)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,r=r+Math.imul(A,st)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(z,st)|0,o=o+Math.imul(z,lt)|0,r=r+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,ht)|0;var Et=(l+(r=r+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(x,dt)|0))<<13)|0;l=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,tt))+Math.imul(B,J)|0,o=Math.imul(B,tt),r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(D,nt)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul(S,st)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(T,st)|0,o=o+Math.imul(T,lt)|0,r=r+Math.imul(A,ct)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(z,ct)|0,o=o+Math.imul(z,ht)|0;var St=(l+(r=r+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(j,dt)|0))<<13)|0;l=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(R,nt),i=(i=Math.imul(R,rt))+Math.imul(B,nt)|0,o=Math.imul(B,rt),r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(P,st)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(O,st)|0,o=o+Math.imul(O,lt)|0,r=r+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ht)|0;var Tt=(l+(r=r+Math.imul(A,dt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(z,dt)|0))<<13)|0;l=((o=o+Math.imul(z,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(R,ot),i=(i=Math.imul(R,at))+Math.imul(B,ot)|0,o=Math.imul(B,at),r=r+Math.imul(I,st)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(D,st)|0,o=o+Math.imul(D,lt)|0,r=r+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ht)|0;var Ct=(l+(r=r+Math.imul(S,dt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(T,dt)|0))<<13)|0;l=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(R,st),i=(i=Math.imul(R,lt))+Math.imul(B,st)|0,o=Math.imul(B,lt),r=r+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ht)|0;var Pt=(l+(r=r+Math.imul(P,dt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(O,dt)|0))<<13)|0;l=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(R,ct),i=(i=Math.imul(R,ht))+Math.imul(B,ct)|0,o=Math.imul(B,ht);var Ot=(l+(r=r+Math.imul(I,dt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(D,dt)|0))<<13)|0;l=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(l+(r=Math.imul(R,dt))|0)+((8191&(i=(i=Math.imul(R,mt))+Math.imul(B,dt)|0))<<13)|0;return l=((o=Math.imul(B,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,s[0]=gt,s[1]=vt,s[2]=yt,s[3]=_t,s[4]=bt,s[5]=xt,s[6]=wt,s[7]=Mt,s[8]=jt,s[9]=kt,s[10]=At,s[11]=zt,s[12]=Et,s[13]=St,s[14]=Tt,s[15]=Ct,s[16]=Pt,s[17]=Ot,s[18]=Nt,0!==l&&(s[19]=l,n.length++),n};function d(t,e,n){return(new m).mulp(t,e,n)}function m(t,e){this.x=t,this.y=e}Math.imul||(p=h),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):n<63?h(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var u=67108863&r,s=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=s;l++){var f=o-l,c=(0|t.words[f])*(0|e.words[l]),h=67108863&c;u=67108863&(h=h+u|0),i+=(a=(a=a+(c/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}n.words[o]=u,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,t,e):d(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,n,t);return e},m.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var r=0,i=0;i<e;i++)r|=(1&t)<<e-i-1,t>>=1;return r},m.prototype.permute=function(t,e,n,r,i,o){for(var a=0;a<o;a++)r[a]=e[t[a]],i[a]=n[t[a]]},m.prototype.transform=function(t,e,n,r,i,o){this.permute(o,t,e,n,r,i);for(var a=1;a<i;a<<=1)for(var u=a<<1,s=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),f=0;f<i;f+=u)for(var c=s,h=l,p=0;p<a;p++){var d=n[f+p],m=r[f+p],g=n[f+p+a],v=r[f+p+a],y=c*g-h*v;v=c*v+h*g,g=y,n[f+p]=d+g,r[f+p]=m+v,n[f+p+a]=d-g,r[f+p+a]=m-v,p!==u&&(y=s*c-l*h,h=s*h+l*c,c=y)}},m.prototype.guessLen13b=function(t,e){var n=1|Math.max(e,t),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},m.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=t[r];t[r]=t[n-r-1],t[n-r-1]=i,i=e[r],e[r]=-e[n-r-1],e[n-r-1]=-i}},m.prototype.normalize13b=function(t,e){for(var n=0,r=0;r<e/2;r++){var i=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+n;t[r]=67108863&i,n=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,n,i){for(var o=0,a=0;a<e;a++)o+=0|t[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*e;a<i;++a)n[a]=0;r(0===o),r(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},m.prototype.mulp=function(t,e,n){var r=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(r),o=this.stub(r),a=new Array(r),u=new Array(r),s=new Array(r),l=new Array(r),f=new Array(r),c=new Array(r),h=n.words;h.length=r,this.convert13b(t.words,t.length,a,r),this.convert13b(e.words,e.length,l,r),this.transform(a,o,u,s,r,i),this.transform(l,o,f,c,r,i);for(var p=0;p<r;p++){var d=u[p]*f[p]-s[p]*c[p];s[p]=u[p]*c[p]+s[p]*f[p],u[p]=d}return this.conjugate(u,s,r),this.transform(u,s,h,o,r,i),this.conjugate(h,o,r),this.normalize13b(h,r),n.negative=t.negative^e.negative,n.length=t.length+e.length,n.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),d(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,n=0;n<this.length;n++){var i=(0|this.words[n])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=(t.words[r]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var i=n.sqr();r<e.length;r++,i=i.sqr())0!==e[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(e=0;e<this.length;e++){var u=this.words[e]&o,s=(0|this.words[e])-u<<n;this.words[e]=s|a,a=u>>>26-n}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,n){var i;r("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<<o,s=n;if(i-=a,i=Math.max(0,i),s){for(var l=0;l<a;l++)s.words[l]=this.words[l];s.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var f=0;for(l=this.length-1;l>=0&&(0!==f||l>=i);l--){var c=0|this.words[l];this.words[l]=f<<26-o|c>>>o,f=c&u}return s&&0!==f&&(s.words[s.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;return!(this.length<=n)&&!!(this.words[n]&i)},o.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,n){var i,o,a=t.length+n;this._expand(a);var u=0;for(i=0;i<t.length;i++){o=(0|this.words[i+n])+u;var s=(0|t.words[i])*e;u=((o-=67108863&s)>>26)-(s/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)u=(o=(0|this.words[i+n])+u)>>26,this.words[i+n]=67108863&o;if(0===u)return this.strip();for(r(-1===u),u=0,i=0;i<this.length;i++)u=(o=-(0|this.words[i])+u)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),i=t,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var u,s=r.length-i.length;if("mod"!==e){(u=new o(null)).length=s+1,u.words=new Array(u.length);for(var l=0;l<u.length;l++)u.words[l]=0}var f=r.clone()._ishlnsubmul(i,1,s);0===f.negative&&(r=f,u&&(u.words[s]=1));for(var c=s-1;c>=0;c--){var h=67108864*(0|r.words[i.length+c])+(0|r.words[i.length+c-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,c);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,c),r.isZero()||(r.negative^=1);u&&(u.words[c]=h)}return u&&u.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:u||null,mod:r}},o.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.isub(t)),{div:u.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,u},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),u=new o(0),s=new o(1),l=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++l;for(var f=n.clone(),c=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(c)),i.iushrn(1),a.iushrn(1);for(var d=0,m=1;0==(n.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(n.iushrn(d);d-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(f),s.isub(c)),u.iushrn(1),s.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(u),a.isub(s)):(n.isub(e),u.isub(i),s.isub(a))}return{a:u,b:s,gcd:n.iushln(l)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),u=new o(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,f=1;0==(e.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(e.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var c=0,h=1;0==(n.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(n.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(u)):(n.isub(e),u.isub(a))}return(i=0===e.cmpn(1)?a:u).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,a=n;0!==o&&a<this.length;a++){var u=0|this.words[a];o=(u+=o)>>>26,u&=67108863,this.words[a]=u}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new w(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):n.strip(),n},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r<n;r++)e.words[r]=t.words[r];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[r-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(_,v),i(b,v),i(x,v),x.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new _;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return g[t]=e,e},w.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},w.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var u=new o(1).toRed(this),s=u.redNeg(),l=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,l).cmp(s);)f.redIAdd(s);for(var c=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=a;0!==p.cmp(u);){for(var m=p,g=0;0!==m.cmp(u);g++)m=m.redSqr();r(g<d);var v=this.pow(c,new o(1).iushln(d-g-1));h=h.redMul(v),c=v.redSqr(),p=p.redMul(c),d=g}return h},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var i=n[0],a=0,u=0,s=e.bitLength()%26;for(0===s&&(s=26),r=e.length-1;r>=0;r--){for(var l=e.words[r],f=s-1;f>=0;f--){var c=l>>f&1;i!==n[0]&&(i=this.sqr(i)),0!==c||0!==a?(a<<=1,a|=c,(4===++u||0===r&&0===f)&&(i=this.mul(i,n[a]),u=0,a=0)):u=0}s=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},i(M,w),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)}).call(this,n(/*! ./../../webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(t))},"./node_modules/box-intersect/index.js":
/*!*********************************************!*\
  !*** ./node_modules/box-intersect/index.js ***!
  \*********************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n){switch(arguments.length){case 1:return function(t){return r=[],l(t,t,f,!0),r}(t);case 2:return"function"==typeof e?l(t,t,e,!0):function(t,e){return r=[],l(t,e,f,!1),r}(t,e);case 3:return l(t,e,n,!1);default:throw new Error("box-intersect: Invalid arguments")}};var r,i=n(/*! typedarray-pool */"./node_modules/typedarray-pool/pool.js"),o=n(/*! ./lib/sweep */"./node_modules/box-intersect/lib/sweep.js"),a=n(/*! ./lib/intersect */"./node_modules/box-intersect/lib/intersect.js");function u(t,e){for(var n=0;n<t;++n)if(!(e[n]<=e[n+t]))return!0;return!1}function s(t,e,n,r){for(var i=0,o=0,a=0,s=t.length;a<s;++a){var l=t[a];if(!u(e,l)){for(var f=0;f<2*e;++f)n[i++]=l[f];r[o++]=a}}return o}function l(t,e,n,r){var u=t.length,l=e.length;if(!(u<=0||l<=0)){var f=t[0].length>>>1;if(!(f<=0)){var c,h=i.mallocDouble(2*f*u),p=i.mallocInt32(u);if((u=s(t,f,h,p))>0){if(1===f&&r)o.init(u),c=o.sweepComplete(f,n,0,u,h,p,0,u,h,p);else{var d=i.mallocDouble(2*f*l),m=i.mallocInt32(l);(l=s(e,f,d,m))>0&&(o.init(u+l),c=1===f?o.sweepBipartite(f,n,0,u,h,p,0,l,d,m):a(f,n,r,u,h,p,l,d,m),i.free(d),i.free(m))}i.free(h),i.free(p)}return c}}}function f(t,e){r.push([t,e])}},"./node_modules/box-intersect/lib/brute.js":
/*!*************************************************!*\
  !*** ./node_modules/box-intersect/lib/brute.js ***!
  \*************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r="d",i="ax",o="vv",a="fp",u="es",s="rs",l="re",f="rb",c="ri",h="rp",p="bs",d="be",m="bb",g="bi",v="bp",y="rv",_="Q",b=[r,i,o,s,l,f,c,p,d,m,g];function x(t){var e="bruteForce"+(t?"Full":"Partial"),n=[],x=b.slice();t||x.splice(3,0,a);var w=["function "+e+"("+x.join()+"){"];function M(e,a){var x=function(t,e,n){var a="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(n?"Full":""),x=["function ",a,"(",b.join(),"){","var ",u,"=2*",r,";"],w="for(var i="+s+","+h+"="+u+"*"+s+";i<"+l+";++i,"+h+"+="+u+"){var x0="+f+"["+i+"+"+h+"],x1="+f+"["+i+"+"+h+"+"+r+"],xi="+c+"[i];",M="for(var j="+p+","+v+"="+u+"*"+p+";j<"+d+";++j,"+v+"+="+u+"){var y0="+m+"["+i+"+"+v+"],"+(n?"y1="+m+"["+i+"+"+v+"+"+r+"],":"")+"yi="+g+"[j];";return t?x.push(w,_,":",M):x.push(M,_,":",w),n?x.push("if(y1<x0||x1<y0)continue;"):e?x.push("if(y0<=x0||x1<y0)continue;"):x.push("if(y0<x0||x1<y0)continue;"),x.push("for(var k="+i+"+1;k<"+r+";++k){var r0="+f+"[k+"+h+"],r1="+f+"[k+"+r+"+"+h+"],b0="+m+"[k+"+v+"],b1="+m+"[k+"+r+"+"+v+"];if(r1<b0||b1<r0)continue "+_+";}var "+y+"="+o+"("),e?x.push("yi,xi"):x.push("xi,yi"),x.push(");if("+y+"!==void 0)return "+y+";}}}"),{name:a,code:x.join("")}}(e,a,t);n.push(x.code),w.push("return "+x.name+"("+b.join()+");")}w.push("if("+l+"-"+s+">"+d+"-"+p+"){"),t?(M(!0,!1),w.push("}else{"),M(!1,!1)):(w.push("if("+a+"){"),M(!0,!0),w.push("}else{"),M(!0,!1),w.push("}}else{if("+a+"){"),M(!1,!0),w.push("}else{"),M(!1,!1),w.push("}")),w.push("}}return "+e);var j=n.join("")+w.join("");return new Function(j)()}e.partial=x(!1),e.full=x(!0)},"./node_modules/box-intersect/lib/intersect.js":
/*!*****************************************************!*\
  !*** ./node_modules/box-intersect/lib/intersect.js ***!
  \*****************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n,o,f,z,E,S,T){!function(t,e){var n=8*i.log2(e+1)*(t+1)|0,o=i.nextPow2(b*n);w.length<o&&(r.free(w),w=r.mallocInt32(o));var a=i.nextPow2(x*n);M<a&&(r.free(M),M=r.mallocDouble(a))}(t,o+E);var C,P=0,O=2*t;j(P++,0,0,o,0,E,n?16:0,-1/0,1/0),n||j(P++,0,0,E,0,o,1,-1/0,1/0);for(;P>0;){var N=(P-=1)*b,I=w[N],D=w[N+1],L=w[N+2],R=w[N+3],B=w[N+4],F=w[N+5],q=P*x,U=M[q],Y=M[q+1],H=1&F,V=!!(16&F),Z=f,W=z,Q=S,X=T;if(H&&(Z=S,W=T,Q=f,X=z),!(2&F&&(L=g(t,I,D,L,Z,W,Y),D>=L)||4&F&&(D=v(t,I,D,L,Z,W,U))>=L)){var G=L-D,K=B-R;if(V){if(t*G*(G+K)<p){if(void 0!==(C=s.scanComplete(t,I,e,D,L,Z,W,R,B,Q,X)))return C;continue}}else{if(t*Math.min(G,K)<c){if(void 0!==(C=a(t,I,e,H,D,L,Z,W,R,B,Q,X)))return C;continue}if(t*G*K<h){if(void 0!==(C=s.scanBipartite(t,I,e,H,D,L,Z,W,R,B,Q,X)))return C;continue}}var $=d(t,I,D,L,Z,W,U,Y);if(D<$)if(t*($-D)<c){if(void 0!==(C=u(t,I+1,e,D,$,Z,W,R,B,Q,X)))return C}else if(I===t-2){if(void 0!==(C=H?s.sweepBipartite(t,e,R,B,Q,X,D,$,Z,W):s.sweepBipartite(t,e,D,$,Z,W,R,B,Q,X)))return C}else j(P++,I+1,D,$,R,B,H,-1/0,1/0),j(P++,I+1,R,B,D,$,1^H,-1/0,1/0);if($<L){var J=l(t,I,R,B,Q,X),tt=Q[O*J+I],et=m(t,I,J,B,Q,X,tt);if(et<B&&j(P++,I,$,L,et,B,(4|H)+(V?16:0),tt,Y),R<J&&j(P++,I,$,L,R,J,(2|H)+(V?16:0),U,tt),J+1===et){if(void 0!==(C=V?A(t,I,e,$,L,Z,W,J,Q,X[J]):k(t,I,e,H,$,L,Z,W,J,Q,X[J])))return C}else if(J<et){var nt;if(V){if(nt=y(t,I,$,L,Z,W,tt),$<nt){var rt=m(t,I,$,nt,Z,W,tt);if(I===t-2){if($<rt&&void 0!==(C=s.sweepComplete(t,e,$,rt,Z,W,J,et,Q,X)))return C;if(rt<nt&&void 0!==(C=s.sweepBipartite(t,e,rt,nt,Z,W,J,et,Q,X)))return C}else $<rt&&j(P++,I+1,$,rt,J,et,16,-1/0,1/0),rt<nt&&(j(P++,I+1,rt,nt,J,et,0,-1/0,1/0),j(P++,I+1,J,et,rt,nt,1,-1/0,1/0))}}else nt=H?_(t,I,$,L,Z,W,tt):y(t,I,$,L,Z,W,tt),$<nt&&(I===t-2?C=H?s.sweepBipartite(t,e,J,et,Q,X,$,nt,Z,W):s.sweepBipartite(t,e,$,nt,Z,W,J,et,Q,X):(j(P++,I+1,$,nt,J,et,H,-1/0,1/0),j(P++,I+1,J,et,$,nt,1^H,-1/0,1/0)))}}}}};var r=n(/*! typedarray-pool */"./node_modules/typedarray-pool/pool.js"),i=n(/*! bit-twiddle */"./node_modules/bit-twiddle/twiddle.js"),o=n(/*! ./brute */"./node_modules/box-intersect/lib/brute.js"),a=o.partial,u=o.full,s=n(/*! ./sweep */"./node_modules/box-intersect/lib/sweep.js"),l=n(/*! ./median */"./node_modules/box-intersect/lib/median.js"),f=n(/*! ./partition */"./node_modules/box-intersect/lib/partition.js"),c=128,h=1<<22,p=1<<22,d=f("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),m=f("lo===p0",["p0"]),g=f("lo<p0",["p0"]),v=f("hi<=p0",["p0"]),y=f("lo<=p0&&p0<=hi",["p0"]),_=f("lo<p0&&p0<=hi",["p0"]),b=6,x=2,w=r.mallocInt32(1024),M=r.mallocDouble(1024);function j(t,e,n,r,i,o,a,u,s){var l=b*t;w[l]=e,w[l+1]=n,w[l+2]=r,w[l+3]=i,w[l+4]=o,w[l+5]=a;var f=x*t;M[f]=u,M[f+1]=s}function k(t,e,n,r,i,o,a,u,s,l,f){var c=2*t,h=s*c,p=l[h+e];t:for(var d=i,m=i*c;d<o;++d,m+=c){var g=a[m+e],v=a[m+e+t];if(!(p<g||v<p)&&(!r||p!==g)){for(var y,_=u[d],b=e+1;b<t;++b){g=a[m+b],v=a[m+b+t];var x=l[h+b],w=l[h+b+t];if(v<x||w<g)continue t}if(void 0!==(y=r?n(f,_):n(_,f)))return y}}}function A(t,e,n,r,i,o,a,u,s,l){var f=2*t,c=u*f,h=s[c+e];t:for(var p=r,d=r*f;p<i;++p,d+=f){var m=a[p];if(m!==l){var g=o[d+e],v=o[d+e+t];if(!(h<g||v<h)){for(var y=e+1;y<t;++y){g=o[d+y],v=o[d+y+t];var _=s[c+y],b=s[c+y+t];if(v<_||b<g)continue t}var x=n(m,l);if(void 0!==x)return x}}}}},"./node_modules/box-intersect/lib/median.js":
/*!**************************************************!*\
  !*** ./node_modules/box-intersect/lib/median.js ***!
  \**************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n,a,u,s){if(a<=n+1)return n;var l=n,f=a,c=a+n>>>1,h=2*t,p=c,d=u[h*c+e];for(;l<f;){if(f-l<i){o(t,e,l,f,u,s),d=u[h*c+e];break}var m=f-l,g=Math.random()*m+l|0,v=u[h*g+e],y=Math.random()*m+l|0,_=u[h*y+e],b=Math.random()*m+l|0,x=u[h*b+e];v<=_?x>=_?(p=y,d=_):v>=x?(p=g,d=v):(p=b,d=x):_>=x?(p=y,d=_):x>=v?(p=g,d=v):(p=b,d=x);for(var w=h*(f-1),M=h*p,j=0;j<h;++j,++w,++M){var k=u[w];u[w]=u[M],u[M]=k}var A=s[f-1];s[f-1]=s[p],s[p]=A,p=r(t,e,l,f-1,u,s,d);for(var w=h*(f-1),M=h*p,j=0;j<h;++j,++w,++M){var k=u[w];u[w]=u[M],u[M]=k}var A=s[f-1];if(s[f-1]=s[p],s[p]=A,c<p){for(f=p-1;l<f&&u[h*(f-1)+e]===d;)f-=1;f+=1}else{if(!(p<c))break;for(l=p+1;l<f&&u[h*l+e]===d;)l+=1}}return r(t,e,n,c,u,s,u[h*c+e])};var r=n(/*! ./partition */"./node_modules/box-intersect/lib/partition.js")("lo<p0",["p0"]),i=8;function o(t,e,n,r,i,o){for(var a=2*t,u=a*(n+1)+e,s=n+1;s<r;++s,u+=a)for(var l=i[u],f=s,c=a*(s-1);f>n&&i[c+e]>l;--f,c-=a){for(var h=c,p=c+a,d=0;d<a;++d,++h,++p){var m=i[h];i[h]=i[p],i[p]=m}var g=o[f];o[f]=o[f-1],o[f-1]=g}}},"./node_modules/box-intersect/lib/partition.js":
/*!*****************************************************!*\
  !*** ./node_modules/box-intersect/lib/partition.js ***!
  \*****************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){var n="abcdef".split("").concat(e),i=[];t.indexOf("lo")>=0&&i.push("lo=e[k+n]");t.indexOf("hi")>=0&&i.push("hi=e[k+o]");return n.push(r.replace("_",i.join()).replace("$",t)),Function.apply(void 0,n)};var r="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},"./node_modules/box-intersect/lib/sort.js":
/*!************************************************!*\
  !*** ./node_modules/box-intersect/lib/sort.js ***!
  \************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){e<=4*r?i(0,e-1,t):function t(e,n,c){var h=(n-e+1)/6|0,p=e+h,d=n-h,m=e+n>>1,g=m-h,v=m+h,y=p,_=g,b=m,x=v,w=d,M=e+1,j=n-1,k=0;l(y,_,c)&&(k=y,y=_,_=k);l(x,w,c)&&(k=x,x=w,w=k);l(y,b,c)&&(k=y,y=b,b=k);l(_,b,c)&&(k=_,_=b,b=k);l(y,x,c)&&(k=y,y=x,x=k);l(b,x,c)&&(k=b,b=x,x=k);l(_,w,c)&&(k=_,_=w,w=k);l(_,b,c)&&(k=_,_=b,b=k);l(x,w,c)&&(k=x,x=w,w=k);var A=c[2*_];var z=c[2*_+1];var E=c[2*x];var S=c[2*x+1];var T=2*y;var C=2*b;var P=2*w;var O=2*p;var N=2*m;var I=2*d;for(var D=0;D<2;++D){var L=c[T+D],R=c[C+D],B=c[P+D];c[O+D]=L,c[N+D]=R,c[I+D]=B}a(g,e,c);a(v,n,c);for(var F=M;F<=j;++F)if(f(F,A,z,c))F!==M&&o(F,M,c),++M;else if(!f(F,E,S,c))for(;;){if(f(j,E,S,c)){f(j,A,z,c)?(u(F,M,j,c),++M,--j):(o(F,j,c),--j);break}if(--j<F)break}s(e,M-1,A,z,c);s(n,j+1,E,S,c);M-2-e<=r?i(e,M-2,c):t(e,M-2,c);n-(j+2)<=r?i(j+2,n,c):t(j+2,n,c);j-M<=r?i(M,j,c):t(M,j,c)}(0,e-1,t)};var r=32;function i(t,e,n){for(var r=2*(t+1),i=t+1;i<=e;++i){for(var o=n[r++],a=n[r++],u=i,s=r-2;u-- >t;){var l=n[s-2],f=n[s-1];if(l<o)break;if(l===o&&f<a)break;n[s]=l,n[s+1]=f,s-=2}n[s]=o,n[s+1]=a}}function o(t,e,n){e*=2;var r=n[t*=2],i=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=r,n[e+1]=i}function a(t,e,n){e*=2,n[t*=2]=n[e],n[t+1]=n[e+1]}function u(t,e,n,r){e*=2,n*=2;var i=r[t*=2],o=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=r[n],r[e+1]=r[n+1],r[n]=i,r[n+1]=o}function s(t,e,n,r,i){e*=2,i[t*=2]=i[e],i[e]=n,i[t+1]=i[e+1],i[e+1]=r}function l(t,e,n){e*=2;var r=n[t*=2],i=n[e];return!(r<i)&&(r!==i||n[t+1]>n[e+1])}function f(t,e,n,r){var i=r[t*=2];return i<e||i===e&&r[t+1]<n}},"./node_modules/box-intersect/lib/sweep.js":
/*!*************************************************!*\
  !*** ./node_modules/box-intersect/lib/sweep.js ***!
  \*************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports={init:function(t){var e=i.nextPow2(t);u.length<e&&(r.free(u),u=r.mallocInt32(e));s.length<e&&(r.free(s),s=r.mallocInt32(e));l.length<e&&(r.free(l),l=r.mallocInt32(e));f.length<e&&(r.free(f),f=r.mallocInt32(e));c.length<e&&(r.free(c),c=r.mallocInt32(e));h.length<e&&(r.free(h),h=r.mallocInt32(e));var n=8*e;p.length<n&&(r.free(p),p=r.mallocDouble(n))},sweepBipartite:function(t,e,n,r,i,c,h,g,v,y){for(var _=0,b=2*t,x=t-1,w=b-1,M=n;M<r;++M){var j=c[M],k=b*M;p[_++]=i[k+x],p[_++]=-(j+1),p[_++]=i[k+w],p[_++]=j}for(var M=h;M<g;++M){var j=y[M]+a,A=b*M;p[_++]=v[A+x],p[_++]=-j,p[_++]=v[A+w],p[_++]=j}var z=_>>>1;o(p,z);for(var E=0,S=0,M=0;M<z;++M){var T=0|p[2*M+1];if(T>=a)d(l,f,S--,T=T-a|0);else if(T>=0)d(u,s,E--,T);else if(T<=-a){T=-T-a|0;for(var C=0;C<E;++C){var P=e(u[C],T);if(void 0!==P)return P}m(l,f,S++,T)}else{T=-T-1|0;for(var C=0;C<S;++C){var P=e(T,l[C]);if(void 0!==P)return P}m(u,s,E++,T)}}},sweepComplete:function(t,e,n,r,i,a,g,v,y,_){for(var b=0,x=2*t,w=t-1,M=x-1,j=n;j<r;++j){var k=a[j]+1<<1,A=x*j;p[b++]=i[A+w],p[b++]=-k,p[b++]=i[A+M],p[b++]=k}for(var j=g;j<v;++j){var k=_[j]+1<<1,z=x*j;p[b++]=y[z+w],p[b++]=1|-k,p[b++]=y[z+M],p[b++]=1|k}var E=b>>>1;o(p,E);for(var S=0,T=0,C=0,j=0;j<E;++j){var P=0|p[2*j+1],O=1&P;if(j<E-1&&P>>1==p[2*j+3]>>1&&(O=2,j+=1),P<0){for(var N=-(P>>1)-1,I=0;I<C;++I){var D=e(c[I],N);if(void 0!==D)return D}if(0!==O)for(var I=0;I<S;++I){var D=e(u[I],N);if(void 0!==D)return D}if(1!==O)for(var I=0;I<T;++I){var D=e(l[I],N);if(void 0!==D)return D}0===O?m(u,s,S++,N):1===O?m(l,f,T++,N):2===O&&m(c,h,C++,N)}else{var N=(P>>1)-1;0===O?d(u,s,S--,N):1===O?d(l,f,T--,N):2===O&&d(c,h,C--,N)}}},scanBipartite:function(t,e,n,r,i,l,f,c,h,g,v,y){var _=0,b=2*t,x=e,w=e+t,M=1,j=1;r?j=a:M=a;for(var k=i;k<l;++k){var A=k+M,z=b*k;p[_++]=f[z+x],p[_++]=-A,p[_++]=f[z+w],p[_++]=A}for(var k=h;k<g;++k){var A=k+j,E=b*k;p[_++]=v[E+x],p[_++]=-A}var S=_>>>1;o(p,S);for(var T=0,k=0;k<S;++k){var C=0|p[2*k+1];if(C<0){var A=-C,P=!1;if(A>=a?(P=!r,A-=a):(P=!!r,A-=1),P)m(u,s,T++,A);else{var O=y[A],N=b*A,I=v[N+e+1],D=v[N+e+1+t];t:for(var L=0;L<T;++L){var R=u[L],B=b*R;if(!(D<f[B+e+1]||f[B+e+1+t]<I)){for(var F=e+2;F<t;++F)if(v[N+F+t]<f[B+F]||f[B+F+t]<v[N+F])continue t;var q,U=c[R];if(void 0!==(q=r?n(O,U):n(U,O)))return q}}}}else d(u,s,T--,C-M)}},scanComplete:function(t,e,n,r,i,s,l,f,c,h,d){for(var m=0,g=2*t,v=e,y=e+t,_=r;_<i;++_){var b=_+a,x=g*_;p[m++]=s[x+v],p[m++]=-b,p[m++]=s[x+y],p[m++]=b}for(var _=f;_<c;++_){var b=_+1,w=g*_;p[m++]=h[w+v],p[m++]=-b}var M=m>>>1;o(p,M);for(var j=0,_=0;_<M;++_){var k=0|p[2*_+1];if(k<0){var b=-k;if(b>=a)u[j++]=b-a;else{var A=d[b-=1],z=g*b,E=h[z+e+1],S=h[z+e+1+t];t:for(var T=0;T<j;++T){var C=u[T],P=l[C];if(P===A)break;var O=g*C;if(!(S<s[O+e+1]||s[O+e+1+t]<E)){for(var N=e+2;N<t;++N)if(h[z+N+t]<s[O+N]||s[O+N+t]<h[z+N])continue t;var I=n(P,A);if(void 0!==I)return I}}}}else{for(var b=k-a,T=j-1;T>=0;--T)if(u[T]===b){for(var N=T+1;N<j;++N)u[N-1]=u[N];break}--j}}}};var r=n(/*! typedarray-pool */"./node_modules/typedarray-pool/pool.js"),i=n(/*! bit-twiddle */"./node_modules/bit-twiddle/twiddle.js"),o=n(/*! ./sort */"./node_modules/box-intersect/lib/sort.js"),a=1<<28,u=r.mallocInt32(1024),s=r.mallocInt32(1024),l=r.mallocInt32(1024),f=r.mallocInt32(1024),c=r.mallocInt32(1024),h=r.mallocInt32(1024),p=r.mallocDouble(8192);function d(t,e,n,r){var i=e[r],o=t[n-1];t[i]=o,e[o]=i}function m(t,e,n,r){t[n]=r,e[r]=n}},"./node_modules/buffer/index.js":
/*!**************************************!*\
  !*** ./node_modules/buffer/index.js ***!
  \**************************************/
/*! no static exports found */function(t,e,n){"use strict";(function(t){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */
var r=n(/*! base64-js */"./node_modules/base64-js/index.js"),i=n(/*! ieee754 */"./node_modules/ieee754/index.js"),o=n(/*! isarray */"./node_modules/isarray/index.js");function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return l(this,t,e,n)}function l(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=h(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=u(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(s.isBuffer(e)){var n=0|p(e.length);return 0===(t=u(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?u(t,0):h(t,e);if("Buffer"===e.type&&o(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e){if(f(e),t=u(t,e<0?0:0|p(e)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e){var n=e.length<0?0:0|p(e.length);t=u(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(t).length;default:if(r)return F(t).length;e=(""+e).toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,a=1,u=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,u/=2,s/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=n;o<u;o++)if(l(t,o)===l(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===s)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(n+s>u&&(n=u-s),o=n;o>=0;o--){for(var c=!0,h=0;h<s;h++)if(l(t,o+h)!==l(e,h)){c=!1;break}if(c)return o}return-1}function y(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[n+a]=u}return a}function _(t,e,n,r){return U(F(e,t.length-n),t,n,r)}function b(t,e,n,r){return U(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function x(t,e,n,r){return b(t,e,n,r)}function w(t,e,n,r){return U(q(e),t,n,r)}function M(t,e,n,r){return U(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function j(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,u,s,l=t[i],f=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=n)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&l)<<6|63&o)>127&&(f=s);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(s=(15&l)<<12|(63&o)<<6|63&a)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(s=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(f=s)}null===f?(f=65533,c=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=c}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=A));return n}(r)}e.Buffer=s,e.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},e.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,n){return l(null,t,e,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,n){return function(t,e,n,r){return f(e),e<=0?u(t,e):void 0!==n?"string"==typeof r?u(t,e).fill(n,r):u(t,e).fill(n):u(t,e)}(null,t,e,n)},s.allocUnsafe=function(t){return c(null,t)},s.allocUnsafeSlow=function(t){return c(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=s.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var a=t[n];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):function(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return z(this,e,n);case"latin1":case"binary":return E(this,e,n);case"base64":return j(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,n,r,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,a=n-e,u=Math.min(o,a),l=this.slice(r,i),f=t.slice(e,n),c=0;c<u;++c)if(l[c]!==f[c]){o=l[c],a=f[c];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},s.prototype.indexOf=function(t,e,n){return g(this,t,e,n,!0)},s.prototype.lastIndexOf=function(t,e,n){return g(this,t,e,n,!1)},s.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return x(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function z(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function E(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function S(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=B(t[o]);return i}function T(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function C(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,r,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function N(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function I(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(t,e,n,r,o){return o||I(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function L(t,e,n,r,o){return o||I(t,0,n,8),i.write(t,e,n,r,52,8),n+8}s.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=s.prototype;else{var i=e-t;n=new s(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},s.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},s.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},s.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},s.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},s.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},s.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+n},s.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=n-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,n){return D(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return D(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},s.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=s.isBuffer(t)?t:F(new s(t,r).toString()),u=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%u]}return this};var R=/[^+\/0-9A-Za-z-_]/g;function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(/*! ./../webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"))},"./node_modules/cdt2d/cdt2d.js":
/*!*************************************!*\
  !*** ./node_modules/cdt2d/cdt2d.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./lib/monotone */"./node_modules/cdt2d/lib/monotone.js"),i=n(/*! ./lib/triangulation */"./node_modules/cdt2d/lib/triangulation.js"),o=n(/*! ./lib/delaunay */"./node_modules/cdt2d/lib/delaunay.js"),a=n(/*! ./lib/filter */"./node_modules/cdt2d/lib/filter.js");function u(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function s(t,e){return t[0]-e[0]||t[1]-e[1]}function l(t,e,n){return e in t?t[e]:n}t.exports=function(t,e,n){Array.isArray(e)?(n=n||{},e=e||[]):(n=e||{},e=[]);var f=!!l(n,"delaunay",!0),c=!!l(n,"interior",!0),h=!!l(n,"exterior",!0),p=!!l(n,"infinity",!1);if(!c&&!h||0===t.length)return[];var d=r(t,e);if(f||c!==h||p){for(var m=i(t.length,function(t){return t.map(u).sort(s)}(e)),g=0;g<d.length;++g){var v=d[g];m.addTriangle(v[0],v[1],v[2])}return f&&o(t,m),h?c?p?a(m,0,p):m.cells():a(m,1,p):a(m,-1)}return d}},"./node_modules/cdt2d/lib/delaunay.js":
/*!********************************************!*\
  !*** ./node_modules/cdt2d/lib/delaunay.js ***!
  \********************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! robust-in-sphere */"./node_modules/robust-in-sphere/in-sphere.js")[4];n(/*! binary-search-bounds */"./node_modules/binary-search-bounds/search-bounds.js");function i(t,e,n,i,o,a){var u=e.opposite(i,o);if(!(u<0)){if(o<i){var s=i;i=o,o=s,s=a,a=u,u=s}e.isConstraint(i,o)||r(t[i],t[o],t[a],t[u])<0&&n.push(i,o)}}t.exports=function(t,e){for(var n=[],o=t.length,a=e.stars,u=0;u<o;++u)for(var s=a[u],l=1;l<s.length;l+=2){var f=s[l];if(!(f<u)&&!e.isConstraint(u,f)){for(var c=s[l-1],h=-1,p=1;p<s.length;p+=2)if(s[p-1]===f){h=s[p];break}h<0||r(t[u],t[f],t[c],t[h])<0&&n.push(u,f)}}for(;n.length>0;){for(var f=n.pop(),u=n.pop(),c=-1,h=-1,s=a[u],d=1;d<s.length;d+=2){var m=s[d-1],g=s[d];m===f?h=g:g===f&&(c=m)}c<0||h<0||(r(t[u],t[f],t[c],t[h])>=0||(e.flip(u,f),i(t,e,n,c,u,h),i(t,e,n,u,h,c),i(t,e,n,h,f,c),i(t,e,n,f,c,h)))}}},"./node_modules/cdt2d/lib/filter.js":
/*!******************************************!*\
  !*** ./node_modules/cdt2d/lib/filter.js ***!
  \******************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! binary-search-bounds */"./node_modules/binary-search-bounds/search-bounds.js");function i(t,e,n,r,i,o,a){this.cells=t,this.neighbor=e,this.flags=r,this.constraint=n,this.active=i,this.next=o,this.boundary=a}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}t.exports=function(t,e,n){var r=function(t,e){for(var n=t.cells(),r=n.length,a=0;a<r;++a){var u=n[a],s=u[0],l=u[1],f=u[2];l<f?l<s&&(u[0]=l,u[1]=f,u[2]=s):f<s&&(u[0]=f,u[1]=s,u[2]=l)}n.sort(o);for(var c=new Array(r),a=0;a<c.length;++a)c[a]=0;var h=[],p=[],d=new Array(3*r),m=new Array(3*r),g=null;e&&(g=[]);for(var v=new i(n,d,m,c,h,p,g),a=0;a<r;++a)for(var u=n[a],y=0;y<3;++y){var s=u[y],l=u[(y+1)%3],_=d[3*a+y]=v.locate(l,s,t.opposite(l,s)),b=m[3*a+y]=t.isConstraint(s,l);_<0&&(b?p.push(a):(h.push(a),c[a]=1),e&&g.push([l,s,-1]))}return v}(t,n);if(0===e)return n?r.cells.concat(r.boundary):r.cells;var a=1,u=r.active,s=r.next,l=r.flags,f=r.cells,c=r.constraint,h=r.neighbor;for(;u.length>0||s.length>0;){for(;u.length>0;){var p=u.pop();if(l[p]!==-a){l[p]=a;f[p];for(var d=0;d<3;++d){var m=h[3*p+d];m>=0&&0===l[m]&&(c[3*p+d]?s.push(m):(u.push(m),l[m]=a))}}}var g=s;s=u,u=g,s.length=0,a=-a}var v=function(t,e,n){for(var r=0,i=0;i<t.length;++i)e[i]===n&&(t[r++]=t[i]);return t.length=r,t}(f,l,e);if(n)return v.concat(r.boundary);return v},i.prototype.locate=function(){var t=[0,0,0];return function(e,n,i){var a=e,u=n,s=i;return n<i?n<e&&(a=n,u=i,s=e):i<e&&(a=i,u=e,s=n),a<0?-1:(t[0]=a,t[1]=u,t[2]=s,r.eq(this.cells,t,o))}}()},"./node_modules/cdt2d/lib/monotone.js":
/*!********************************************!*\
  !*** ./node_modules/cdt2d/lib/monotone.js ***!
  \********************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! binary-search-bounds */"./node_modules/binary-search-bounds/search-bounds.js"),i=n(/*! robust-orientation */"./node_modules/robust-orientation/orientation.js")[3],o=0,a=1,u=2;function s(t,e,n,r,i){this.a=t,this.b=e,this.idx=n,this.lowerIds=r,this.upperIds=i}function l(t,e,n,r){this.a=t,this.b=e,this.type=n,this.idx=r}function f(t,e){var n=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return n||(t.type!==o&&(n=i(t.a,t.b,e.b))?n:t.idx-e.idx)}function c(t,e){return i(t.a,t.b,e)}function h(t,e,n,o,a){for(var u=r.lt(e,o,c),s=r.gt(e,o,c),l=u;l<s;++l){for(var f=e[l],h=f.lowerIds,p=h.length;p>1&&i(n[h[p-2]],n[h[p-1]],o)>0;)t.push([h[p-1],h[p-2],a]),p-=1;h.length=p,h.push(a);var d=f.upperIds;for(p=d.length;p>1&&i(n[d[p-2]],n[d[p-1]],o)<0;)t.push([d[p-2],d[p-1],a]),p-=1;d.length=p,d.push(a)}}function p(t,e){var n;return(n=t.a[0]<e.a[0]?i(t.a,t.b,e.a):i(e.b,e.a,t.a))?n:(n=e.b[0]<t.b[0]?i(t.a,t.b,e.b):i(e.b,e.a,t.b))||t.idx-e.idx}function d(t,e,n){var i=r.le(t,n,p),o=t[i],a=o.upperIds,u=a[a.length-1];o.upperIds=[u],t.splice(i+1,0,new s(n.a,n.b,n.idx,[u],a))}function m(t,e,n){var i=n.a;n.a=n.b,n.b=i;var o=r.eq(t,n,p),a=t[o];t[o-1].upperIds=a.upperIds,t.splice(o,1)}t.exports=function(t,e){for(var n=t.length,r=e.length,i=[],c=0;c<n;++c)i.push(new l(t[c],null,o,c));for(var c=0;c<r;++c){var p=e[c],g=t[p[0]],v=t[p[1]];g[0]<v[0]?i.push(new l(g,v,u,c),new l(v,g,a,c)):g[0]>v[0]&&i.push(new l(v,g,u,c),new l(g,v,a,c))}i.sort(f);for(var y=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),_=[new s([y,1],[y,0],-1,[],[],[],[])],b=[],c=0,x=i.length;c<x;++c){var w=i[c],M=w.type;M===o?h(b,_,t,w.a,w.idx):M===u?d(_,t,w):m(_,t,w)}return b}},"./node_modules/cdt2d/lib/triangulation.js":
/*!*************************************************!*\
  !*** ./node_modules/cdt2d/lib/triangulation.js ***!
  \*************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! binary-search-bounds */"./node_modules/binary-search-bounds/search-bounds.js");function i(t,e){this.stars=t,this.edges=e}t.exports=function(t,e){for(var n=new Array(t),r=0;r<t;++r)n[r]=[];return new i(n,e)};var o=i.prototype;function a(t,e,n){for(var r=1,i=t.length;r<i;r+=2)if(t[r-1]===e&&t[r]===n)return t[r-1]=t[i-2],t[r]=t[i-1],void(t.length=i-2)}o.isConstraint=function(){var t=[0,0];function e(t,e){return t[0]-e[0]||t[1]-e[1]}return function(n,i){return t[0]=Math.min(n,i),t[1]=Math.max(n,i),r.eq(this.edges,t,e)>=0}}(),o.removeTriangle=function(t,e,n){var r=this.stars;a(r[t],e,n),a(r[e],n,t),a(r[n],t,e)},o.addTriangle=function(t,e,n){var r=this.stars;r[t].push(e,n),r[e].push(n,t),r[n].push(t,e)},o.opposite=function(t,e){for(var n=this.stars[e],r=1,i=n.length;r<i;r+=2)if(n[r]===t)return n[r-1];return-1},o.flip=function(t,e){var n=this.opposite(t,e),r=this.opposite(e,t);this.removeTriangle(t,e,n),this.removeTriangle(e,t,r),this.addTriangle(t,r,n),this.addTriangle(e,n,r)},o.edges=function(){for(var t=this.stars,e=[],n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length;o<a;o+=2)e.push([i[o],i[o+1]]);return e},o.cells=function(){for(var t=this.stars,e=[],n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length;o<a;o+=2){var u=i[o],s=i[o+1];n<Math.min(u,s)&&e.push([n,u,s])}return e}},"./node_modules/clean-pslg/clean-pslg.js":
/*!***********************************************!*\
  !*** ./node_modules/clean-pslg/clean-pslg.js ***!
  \***********************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n){var r;if(n){r=e;for(var i=new Array(e.length),o=0;o<e.length;++o){var a=e[o];i[o]=[a[0],a[1],n[o]]}e=i}var u=function(t,e,n){var r=d(t,[],p(t));return v(e,r,n),!!r}(t,e,!!n);for(;y(t,e,!!n);)u=!0;if(n&&u){r.length=0,n.length=0;for(var o=0;o<e.length;++o){var a=e[o];r.push([a[0],a[1]]),n.push(a[2])}}return u};var r=n(/*! union-find */"./node_modules/union-find/index.js"),i=n(/*! box-intersect */"./node_modules/box-intersect/index.js"),o=n(/*! robust-segment-intersect */"./node_modules/robust-segment-intersect/segseg.js"),a=n(/*! big-rat */"./node_modules/big-rat/index.js"),u=n(/*! big-rat/cmp */"./node_modules/big-rat/cmp.js"),s=n(/*! big-rat/to-float */"./node_modules/big-rat/to-float.js"),l=n(/*! rat-vec */"./node_modules/rat-vec/index.js"),f=n(/*! nextafter */"./node_modules/nextafter/nextafter.js"),c=n(/*! ./lib/rat-seg-intersect */"./node_modules/clean-pslg/lib/rat-seg-intersect.js");function h(t){var e=s(t);return[f(e,-1/0),f(e,1/0)]}function p(t){for(var e=new Array(t.length),n=0;n<t.length;++n){var r=t[n];e[n]=[f(r[0],-1/0),f(r[1],-1/0),f(r[0],1/0),f(r[1],1/0)]}return e}function d(t,e,n){for(var o=e.length,a=new r(o),u=[],s=0;s<e.length;++s){var l=e[s],c=h(l[0]),p=h(l[1]);u.push([f(c[0],-1/0),f(p[0],-1/0),f(c[1],1/0),f(p[1],1/0)])}i(u,function(t,e){a.link(t,e)});var d=!0,m=new Array(o);for(s=0;s<o;++s){(v=a.find(s))!==s&&(d=!1,t[v]=[Math.min(t[s][0],t[v][0]),Math.min(t[s][1],t[v][1])])}if(d)return null;var g=0;for(s=0;s<o;++s){var v;(v=a.find(s))===s?(m[s]=g,t[g++]=t[s]):m[s]=-1}t.length=g;for(s=0;s<o;++s)m[s]<0&&(m[s]=m[a.find(s)]);return m}function m(t,e){return t[0]-e[0]||t[1]-e[1]}function g(t,e){var n=t[0]-e[0]||t[1]-e[1];return n||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function v(t,e,n){if(0!==t.length){if(e)for(var r=0;r<t.length;++r){var i=e[(a=t[r])[0]],o=e[a[1]];a[0]=Math.min(i,o),a[1]=Math.max(i,o)}else for(r=0;r<t.length;++r){var a;i=(a=t[r])[0],o=a[1];a[0]=Math.min(i,o),a[1]=Math.max(i,o)}n?t.sort(g):t.sort(m);var u=1;for(r=1;r<t.length;++r){var s=t[r-1],l=t[r];(l[0]!==s[0]||l[1]!==s[1]||n&&l[2]!==s[2])&&(t[u++]=l)}t.length=u}}function y(t,e,n){var r=function(t,e){for(var n=new Array(e.length),r=0;r<e.length;++r){var i=e[r],o=t[i[0]],a=t[i[1]];n[r]=[f(Math.min(o[0],a[0]),-1/0),f(Math.min(o[1],a[1]),-1/0),f(Math.max(o[0],a[0]),1/0),f(Math.max(o[1],a[1]),1/0)]}return n}(t,e),h=function(t,e,n){var r=[];return i(n,function(n,i){var a=e[n],u=e[i];if(a[0]!==u[0]&&a[0]!==u[1]&&a[1]!==u[0]&&a[1]!==u[1]){var s=t[a[0]],l=t[a[1]],f=t[u[0]],c=t[u[1]];o(s,l,f,c)&&r.push([n,i])}}),r}(t,e,r),m=p(t),g=function(t,e,n,r){var a=[];return i(n,r,function(n,r){var i=e[n];if(i[0]!==r&&i[1]!==r){var u=t[r],s=t[i[0]],l=t[i[1]];o(s,l,u,u)&&a.push([n,r])}}),a}(t,e,r,m),y=d(t,function(t,e,n,r,i){var o,f,h=t.map(function(t){return[a(t[0]),a(t[1])]});for(o=0;o<n.length;++o){var p=n[o];f=p[0];var d=p[1],m=e[f],g=e[d],v=c(l(t[m[0]]),l(t[m[1]]),l(t[g[0]]),l(t[g[1]]));if(v){var y=t.length;t.push([s(v[0]),s(v[1])]),h.push(v),r.push([f,y],[d,y])}}for(r.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var n=h[t[1]],r=h[e[1]];return u(n[0],r[0])||u(n[1],r[1])}),o=r.length-1;o>=0;--o){var _=e[f=(z=r[o])[0]],b=_[0],x=_[1],w=t[b],M=t[x];if((w[0]-M[0]||w[1]-M[1])<0){var j=b;b=x,x=j}_[0]=b;var k,A=_[1]=z[1];for(i&&(k=_[2]);o>0&&r[o-1][0]===f;){var z,E=(z=r[--o])[1];i?e.push([A,E,k]):e.push([A,E]),A=E}i?e.push([A,x,k]):e.push([A,x])}return h}(t,e,h,g,n));return v(e,y,n),!!y||(h.length>0||g.length>0)}},"./node_modules/clean-pslg/lib/rat-seg-intersect.js":
/*!**********************************************************!*\
  !*** ./node_modules/clean-pslg/lib/rat-seg-intersect.js ***!
  \**********************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n,r){var o=u(e,t),c=u(r,n),h=f(o,c);if(0===a(h))return null;var p=u(t,n),d=f(c,p),m=i(d,h),g=l(o,m);return s(t,g)};var r=n(/*! big-rat/mul */"./node_modules/big-rat/mul.js"),i=n(/*! big-rat/div */"./node_modules/big-rat/div.js"),o=n(/*! big-rat/sub */"./node_modules/big-rat/sub.js"),a=n(/*! big-rat/sign */"./node_modules/big-rat/sign.js"),u=n(/*! rat-vec/sub */"./node_modules/rat-vec/sub.js"),s=n(/*! rat-vec/add */"./node_modules/rat-vec/add.js"),l=n(/*! rat-vec/muls */"./node_modules/rat-vec/muls.js");function f(t,e){return o(r(t[0],e[1]),r(t[1],e[0]))}},"./node_modules/compare-angle/cmpangle.js":
/*!************************************************!*\
  !*** ./node_modules/compare-angle/cmpangle.js ***!
  \************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n,o){var a=r(e,n,o);if(0===a){var u=i(r(t,e,n)),l=i(r(t,e,o));if(u===l){if(0===u){var f=s(t,e,n),c=s(t,e,o);return f===c?0:f?1:-1}return 0}return 0===l?u>0?-1:s(t,e,o)?-1:1:0===u?l>0?1:s(t,e,n)?1:-1:i(l-u)}var h=r(t,e,n);if(h>0)return a>0&&r(t,e,o)>0?1:-1;if(h<0)return a>0||r(t,e,o)>0?1:-1;var p=r(t,e,o);return p>0?1:s(t,e,n)?1:-1};var r=n(/*! robust-orientation */"./node_modules/robust-orientation/orientation.js"),i=n(/*! signum */"./node_modules/compare-angle/node_modules/signum/sgn.js"),o=n(/*! two-sum */"./node_modules/two-sum/two-sum.js"),a=n(/*! robust-product */"./node_modules/robust-product/product.js"),u=n(/*! robust-sum */"./node_modules/robust-sum/robust-sum.js");function s(t,e,n){var r=o(t[0],-e[0]),i=o(t[1],-e[1]),s=o(n[0],-e[0]),l=o(n[1],-e[1]),f=u(a(r,s),a(i,l));return f[f.length-1]>=0}},"./node_modules/compare-angle/node_modules/signum/sgn.js":
/*!***************************************************************!*\
  !*** ./node_modules/compare-angle/node_modules/signum/sgn.js ***!
  \***************************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t){return t<0?-1:t>0?1:0}},"./node_modules/cwise-compiler/compiler.js":
/*!*************************************************!*\
  !*** ./node_modules/cwise-compiler/compiler.js ***!
  \*************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./lib/thunk.js */"./node_modules/cwise-compiler/lib/thunk.js");t.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var n=t.args.slice(0);e.argTypes=n;for(var i=0;i<n.length;++i){var o=n[i];if("array"===o||"object"==typeof o&&o.blockIndices){if(e.argTypes[i]="array",e.arrayArgs.push(i),e.arrayBlockIndices.push(o.blockIndices?o.blockIndices:0),e.shimArgs.push("array"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array args");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array index");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array index");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array shape");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof o||!o.offset)throw new Error("cwise: Unknown argument type "+n[i]);e.argTypes[i]="offset",e.offsetArgs.push({array:o.array,offset:o.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>n.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,r(e)}},"./node_modules/cwise-compiler/lib/compile.js":
/*!****************************************************!*\
  !*** ./node_modules/cwise-compiler/lib/compile.js ***!
  \****************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! uniq */"./node_modules/uniq/uniq.js");function i(t,e,n){var r,i,o=t.length,a=e.arrayArgs.length,u=e.indexArgs.length>0,s=[],l=[],f=0,c=0;for(r=0;r<o;++r)l.push(["i",r,"=0"].join(""));for(i=0;i<a;++i)for(r=0;r<o;++r)c=f,f=t[r],0===r?l.push(["d",i,"s",r,"=t",i,"p",f].join("")):l.push(["d",i,"s",r,"=(t",i,"p",f,"-s",c,"*t",i,"p",c,")"].join(""));for(l.length>0&&s.push("var "+l.join(",")),r=o-1;r>=0;--r)f=t[r],s.push(["for(i",r,"=0;i",r,"<s",f,";++i",r,"){"].join(""));for(s.push(n),r=0;r<o;++r){for(c=f,f=t[r],i=0;i<a;++i)s.push(["p",i,"+=d",i,"s",r].join(""));u&&(r>0&&s.push(["index[",c,"]-=s",c].join("")),s.push(["++index[",f,"]"].join(""))),s.push("}")}return s.join("\n")}function o(t,e,n){for(var r=t.body,i=[],o=[],a=0;a<t.args.length;++a){var u=t.args[a];if(!(u.count<=0)){var s=new RegExp(u.name,"g"),l="",f=e.arrayArgs.indexOf(a);switch(e.argTypes[a]){case"offset":var c=e.offsetArgIndex.indexOf(a);f=e.offsetArgs[c].array,l="+q"+c;case"array":l="p"+f+l;var h="l"+a,p="a"+f;if(0===e.arrayBlockIndices[f])1===u.count?"generic"===n[f]?u.lvalue?(i.push(["var ",h,"=",p,".get(",l,")"].join("")),r=r.replace(s,h),o.push([p,".set(",l,",",h,")"].join(""))):r=r.replace(s,[p,".get(",l,")"].join("")):r=r.replace(s,[p,"[",l,"]"].join("")):"generic"===n[f]?(i.push(["var ",h,"=",p,".get(",l,")"].join("")),r=r.replace(s,h),u.lvalue&&o.push([p,".set(",l,",",h,")"].join(""))):(i.push(["var ",h,"=",p,"[",l,"]"].join("")),r=r.replace(s,h),u.lvalue&&o.push([p,"[",l,"]=",h].join("")));else{for(var d=[u.name],m=[l],g=0;g<Math.abs(e.arrayBlockIndices[f]);g++)d.push("\\s*\\[([^\\]]+)\\]"),m.push("$"+(g+1)+"*t"+f+"b"+g);if(s=new RegExp(d.join(""),"g"),l=m.join("+"),"generic"===n[f])throw new Error("cwise: Generic arrays not supported in combination with blocks!");r=r.replace(s,[p,"[",l,"]"].join(""))}break;case"scalar":r=r.replace(s,"Y"+e.scalarArgs.indexOf(a));break;case"index":r=r.replace(s,"index");break;case"shape":r=r.replace(s,"shape")}}}return[i.join("\n"),r,o.join("\n")].join("\n").trim()}t.exports=function(t,e){for(var n=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,a=new Array(t.arrayArgs.length),u=new Array(t.arrayArgs.length),s=0;s<t.arrayArgs.length;++s)u[s]=e[2*s],a[s]=e[2*s+1];var l=[],f=[],c=[],h=[],p=[];for(s=0;s<t.arrayArgs.length;++s){t.arrayBlockIndices[s]<0?(c.push(0),h.push(n),l.push(n),f.push(n+t.arrayBlockIndices[s])):(c.push(t.arrayBlockIndices[s]),h.push(t.arrayBlockIndices[s]+n),l.push(0),f.push(t.arrayBlockIndices[s]));for(var d=[],m=0;m<a[s].length;m++)c[s]<=a[s][m]&&a[s][m]<h[s]&&d.push(a[s][m]-c[s]);p.push(d)}var g=["SS"],v=["'use strict'"],y=[];for(m=0;m<n;++m)y.push(["s",m,"=SS[",m,"]"].join(""));for(s=0;s<t.arrayArgs.length;++s){for(g.push("a"+s),g.push("t"+s),g.push("p"+s),m=0;m<n;++m)y.push(["t",s,"p",m,"=t",s,"[",c[s]+m,"]"].join(""));for(m=0;m<Math.abs(t.arrayBlockIndices[s]);++m)y.push(["t",s,"b",m,"=t",s,"[",l[s]+m,"]"].join(""))}for(s=0;s<t.scalarArgs.length;++s)g.push("Y"+s);if(t.shapeArgs.length>0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var _=new Array(n);for(s=0;s<n;++s)_[s]="0";y.push(["index=[",_.join(","),"]"].join(""))}for(s=0;s<t.offsetArgs.length;++s){var b=t.offsetArgs[s],x=[];for(m=0;m<b.offset.length;++m)0!==b.offset[m]&&(1===b.offset[m]?x.push(["t",b.array,"p",m].join("")):x.push([b.offset[m],"*t",b.array,"p",m].join("")));0===x.length?y.push("q"+s+"=0"):y.push(["q",s,"=",x.join("+")].join(""))}var w=r([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));for((y=y.concat(w)).length>0&&v.push("var "+y.join(",")),s=0;s<t.arrayArgs.length;++s)v.push("p"+s+"|=0");t.pre.body.length>3&&v.push(o(t.pre,t,u));var M=o(t.body,t,u),j=function(t){for(var e=0,n=t[0].length;e<n;){for(var r=1;r<t.length;++r)if(t[r][e]!==t[0][e])return e;++e}return e}(p);j<n?v.push(function(t,e,n,r){for(var o=e.length,a=n.arrayArgs.length,u=n.blockSize,s=n.indexArgs.length>0,l=[],f=0;f<a;++f)l.push(["var offset",f,"=p",f].join(""));for(f=t;f<o;++f)l.push(["for(var j"+f+"=SS[",e[f],"]|0;j",f,">0;){"].join("")),l.push(["if(j",f,"<",u,"){"].join("")),l.push(["s",e[f],"=j",f].join("")),l.push(["j",f,"=0"].join("")),l.push(["}else{s",e[f],"=",u].join("")),l.push(["j",f,"-=",u,"}"].join("")),s&&l.push(["index[",e[f],"]=j",f].join(""));for(f=0;f<a;++f){for(var c=["offset"+f],h=t;h<o;++h)c.push(["j",h,"*t",f,"p",e[h]].join(""));l.push(["p",f,"=(",c.join("+"),")"].join(""))}for(l.push(i(e,n,r)),f=t;f<o;++f)l.push("}");return l.join("\n")}(j,p[0],t,M)):v.push(i(p[0],t,M)),t.post.body.length>3&&v.push(o(t.post,t,u)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var k=[t.funcName||"unnamed","_cwise_loop_",a[0].join("s"),"m",j,function(t){for(var e=new Array(t.length),n=!0,r=0;r<t.length;++r){var i=t[r],o=i.match(/\d+/);o=o?o[0]:"",0===i.charAt(0)?e[r]="u"+i.charAt(1)+o:e[r]=i.charAt(0)+o,r>0&&(n=n&&e[r]===e[r-1])}return n?e[0]:e.join("")}(u)].join("");return new Function(["function ",k,"(",g.join(","),"){",v.join("\n"),"} return ",k].join(""))()}},"./node_modules/cwise-compiler/lib/thunk.js":
/*!**************************************************!*\
  !*** ./node_modules/cwise-compiler/lib/thunk.js ***!
  \**************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./compile.js */"./node_modules/cwise-compiler/lib/compile.js");t.exports=function(t){var e=["'use strict'","var CACHED={}"],n=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],u=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],s=[],l=[],f=0;f<t.arrayArgs.length;++f){var c=t.arrayArgs[f];n.push(["t",c,"=array",c,".dtype,","r",c,"=array",c,".order"].join("")),o.push("t"+c),o.push("r"+c),a.push("t"+c),a.push("r"+c+".join()"),u.push("array"+c+".data"),u.push("array"+c+".stride"),u.push("array"+c+".offset|0"),f>0&&(s.push("array"+t.arrayArgs[0]+".shape.length===array"+c+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[f]))),l.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+c+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[f])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+s.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),f=0;f<t.scalarArgs.length;++f)u.push("scalar"+t.scalarArgs[f]);return n.push(["type=[",a.join(","),"].join()"].join("")),n.push("proc=CACHED[type]"),e.push("var "+n.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",o.join(","),"])}","return proc(",u.join(","),")}"].join("")),t.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------"),new Function("compile",e.join("\n"))(r.bind(void 0,t))}},"./node_modules/d/index.js":
/*!*********************************!*\
  !*** ./node_modules/d/index.js ***!
  \*********************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! es5-ext/object/assign */"./node_modules/es5-ext/object/assign/index.js"),i=n(/*! es5-ext/object/normalize-options */"./node_modules/es5-ext/object/normalize-options.js"),o=n(/*! es5-ext/object/is-callable */"./node_modules/es5-ext/object/is-callable.js"),a=n(/*! es5-ext/string/#/contains */"./node_modules/es5-ext/string/#/contains/index.js");(t.exports=function(t,e){var n,o,u,s,l;return arguments.length<2||"string"!=typeof t?(s=e,e=t,t=null):s=arguments[2],null==t?(n=u=!0,o=!1):(n=a.call(t,"c"),o=a.call(t,"e"),u=a.call(t,"w")),l={value:e,configurable:n,enumerable:o,writable:u},s?r(i(s),l):l}).gs=function(t,e,n){var u,s,l,f;return"string"!=typeof t?(l=n,n=e,e=t,t=null):l=arguments[3],null==e?e=void 0:o(e)?null==n?n=void 0:o(n)||(l=n,n=void 0):(l=e,e=n=void 0),null==t?(u=!0,s=!1):(u=a.call(t,"c"),s=a.call(t,"e")),f={get:e,set:n,configurable:u,enumerable:s},l?r(i(l),f):f}},"./node_modules/double-bits/double.js":
/*!********************************************!*\
  !*** ./node_modules/double-bits/double.js ***!
  \********************************************/
/*! no static exports found */function(t,e,n){(function(e){var n=!1;if("undefined"!=typeof Float64Array){var r=new Float64Array(1),i=new Uint32Array(r.buffer);if(r[0]=1,n=!0,1072693248===i[1]){t.exports=function(t){return r[0]=t,[i[0],i[1]]},t.exports.pack=function(t,e){return i[0]=t,i[1]=e,r[0]},t.exports.lo=function(t){return r[0]=t,i[0]},t.exports.hi=function(t){return r[0]=t,i[1]}}else if(1072693248===i[0]){t.exports=function(t){return r[0]=t,[i[1],i[0]]},t.exports.pack=function(t,e){return i[1]=t,i[0]=e,r[0]},t.exports.lo=function(t){return r[0]=t,i[1]},t.exports.hi=function(t){return r[0]=t,i[0]}}else n=!1}if(!n){var o=new e(8);t.exports=function(t){return o.writeDoubleLE(t,0,!0),[o.readUInt32LE(0,!0),o.readUInt32LE(4,!0)]},t.exports.pack=function(t,e){return o.writeUInt32LE(t,0,!0),o.writeUInt32LE(e,4,!0),o.readDoubleLE(0,!0)},t.exports.lo=function(t){return o.writeDoubleLE(t,0,!0),o.readUInt32LE(0,!0)},t.exports.hi=function(t){return o.writeDoubleLE(t,0,!0),o.readUInt32LE(4,!0)}}t.exports.sign=function(e){return t.exports.hi(e)>>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var n=t.exports.lo(e),r=t.exports.hi(e),i=1048575&r;return 2146435072&r&&(i+=1<<20),[n,i]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}}).call(this,n(/*! ./../buffer/index.js */"./node_modules/buffer/index.js").Buffer)},"./node_modules/dup/dup.js":
/*!*********************************!*\
  !*** ./node_modules/dup/dup.js ***!
  \*********************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var n,r;for(n=new Array(t),r=0;r<t;++r)n[r]=e;return n}(0|t,e);break;case"object":if("number"==typeof t.length)return function t(e,n,r){var i=0|e[r];if(i<=0)return[];var o,a=new Array(i);if(r===e.length-1)for(o=0;o<i;++o)a[o]=n;else for(o=0;o<i;++o)a[o]=t(e,n,r+1);return a}(t,e,0)}return[]}},"./node_modules/eases/cubic-in-out.js":
/*!********************************************!*\
  !*** ./node_modules/eases/cubic-in-out.js ***!
  \********************************************/
/*! no static exports found */function(t,e){t.exports=function(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}},"./node_modules/edges-to-adjacency-list/e2a.js":
/*!*****************************************************!*\
  !*** ./node_modules/edges-to-adjacency-list/e2a.js ***!
  \*****************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){var n=t.length;if("number"!=typeof e){e=0;for(var i=0;i<n;++i){var o=t[i];e=Math.max(e,o[0],o[1])}e=1+(0|e)}e|=0;for(var a=new Array(e),i=0;i<e;++i)a[i]=[];for(var i=0;i<n;++i){var o=t[i];a[o[0]].push(o[1]),a[o[1]].push(o[0])}for(var u=0;u<e;++u)r(a[u],function(t,e){return t-e});return a};var r=n(/*! uniq */"./node_modules/uniq/uniq.js")},"./node_modules/es5-ext/function/noop.js":
/*!***********************************************!*\
  !*** ./node_modules/es5-ext/function/noop.js ***!
  \***********************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(){}},"./node_modules/es5-ext/object/assign/index.js":
/*!*****************************************************!*\
  !*** ./node_modules/es5-ext/object/assign/index.js ***!
  \*****************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=n(/*! ./is-implemented */"./node_modules/es5-ext/object/assign/is-implemented.js")()?Object.assign:n(/*! ./shim */"./node_modules/es5-ext/object/assign/shim.js")},"./node_modules/es5-ext/object/assign/is-implemented.js":
/*!**************************************************************!*\
  !*** ./node_modules/es5-ext/object/assign/is-implemented.js ***!
  \**************************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},"./node_modules/es5-ext/object/assign/shim.js":
/*!****************************************************!*\
  !*** ./node_modules/es5-ext/object/assign/shim.js ***!
  \****************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ../keys */"./node_modules/es5-ext/object/keys/index.js"),i=n(/*! ../valid-value */"./node_modules/es5-ext/object/valid-value.js"),o=Math.max;t.exports=function(t,e){var n,a,u,s=o(arguments.length,2);for(t=Object(i(t)),u=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},a=1;a<s;++a)e=arguments[a],r(e).forEach(u);if(void 0!==n)throw n;return t}},"./node_modules/es5-ext/object/is-callable.js":
/*!****************************************************!*\
  !*** ./node_modules/es5-ext/object/is-callable.js ***!
  \****************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t){return"function"==typeof t}},"./node_modules/es5-ext/object/is-value.js":
/*!*************************************************!*\
  !*** ./node_modules/es5-ext/object/is-value.js ***!
  \*************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ../function/noop */"./node_modules/es5-ext/function/noop.js")();t.exports=function(t){return t!==r&&null!==t}},"./node_modules/es5-ext/object/keys/index.js":
/*!***************************************************!*\
  !*** ./node_modules/es5-ext/object/keys/index.js ***!
  \***************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=n(/*! ./is-implemented */"./node_modules/es5-ext/object/keys/is-implemented.js")()?Object.keys:n(/*! ./shim */"./node_modules/es5-ext/object/keys/shim.js")},"./node_modules/es5-ext/object/keys/is-implemented.js":
/*!************************************************************!*\
  !*** ./node_modules/es5-ext/object/keys/is-implemented.js ***!
  \************************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},"./node_modules/es5-ext/object/keys/shim.js":
/*!**************************************************!*\
  !*** ./node_modules/es5-ext/object/keys/shim.js ***!
  \**************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ../is-value */"./node_modules/es5-ext/object/is-value.js"),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},"./node_modules/es5-ext/object/normalize-options.js":
/*!**********************************************************!*\
  !*** ./node_modules/es5-ext/object/normalize-options.js ***!
  \**********************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./is-value */"./node_modules/es5-ext/object/is-value.js"),i=Array.prototype.forEach,o=Object.create;t.exports=function(t){var e=o(null);return i.call(arguments,function(t){r(t)&&function(t,e){var n;for(n in t)e[n]=t[n]}(Object(t),e)}),e}},"./node_modules/es5-ext/object/valid-callable.js":
/*!*******************************************************!*\
  !*** ./node_modules/es5-ext/object/valid-callable.js ***!
  \*******************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},"./node_modules/es5-ext/object/valid-value.js":
/*!****************************************************!*\
  !*** ./node_modules/es5-ext/object/valid-value.js ***!
  \****************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! ./is-value */"./node_modules/es5-ext/object/is-value.js");t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},"./node_modules/es5-ext/string/#/contains/index.js":
/*!*********************************************************!*\
  !*** ./node_modules/es5-ext/string/#/contains/index.js ***!
  \*********************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=n(/*! ./is-implemented */"./node_modules/es5-ext/string/#/contains/is-implemented.js")()?String.prototype.contains:n(/*! ./shim */"./node_modules/es5-ext/string/#/contains/shim.js")},"./node_modules/es5-ext/string/#/contains/is-implemented.js":
/*!******************************************************************!*\
  !*** ./node_modules/es5-ext/string/#/contains/is-implemented.js ***!
  \******************************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},"./node_modules/es5-ext/string/#/contains/shim.js":
/*!********************************************************!*\
  !*** ./node_modules/es5-ext/string/#/contains/shim.js ***!
  \********************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},"./node_modules/event-emitter/index.js":
/*!*********************************************!*\
  !*** ./node_modules/event-emitter/index.js ***!
  \*********************************************/
/*! no static exports found */function(t,e,n){"use strict";var r,i,o,a,u,s,l,f=n(/*! d */"./node_modules/d/index.js"),c=n(/*! es5-ext/object/valid-callable */"./node_modules/es5-ext/object/valid-callable.js"),h=Function.prototype.apply,p=Function.prototype.call,d=Object.create,m=Object.defineProperty,g=Object.defineProperties,v=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};u={on:r=function(t,e){var n;return c(e),v.call(this,"__ee__")?n=this.__ee__:(n=y.value=d(null),m(this,"__ee__",y),y.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:i=function(t,e){var n,i;return c(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),h.call(e,this,arguments)}),n.__eeOnceListener__=e,this},off:o=function(t,e){var n,r,i,o;if(c(e),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:a=function(t){var e,n,r,i,o;if(v.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;r=i[e];++e)h.call(r,this,o)}else switch(arguments.length){case 1:p.call(i,this);break;case 2:p.call(i,this,arguments[1]);break;case 3:p.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];h.call(i,this,o)}}},s={on:f(r),once:f(i),off:f(o),emit:f(a)},l=g({},s),t.exports=e=function(t){return null==t?d(l):g(Object(t),s)},e.methods=u},"./node_modules/functional-red-black-tree/rbtree.js":
/*!**********************************************************!*\
  !*** ./node_modules/functional-red-black-tree/rbtree.js ***!
  \**********************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t){return new l(t||d,null)};var r=0,i=1;function o(t,e,n,r,i,o){this._color=t,this.key=e,this.value=n,this.left=r,this.right=i,this._count=o}function a(t){return new o(t._color,t.key,t.value,t.left,t.right,t._count)}function u(t,e){return new o(t,e.key,e.value,e.left,e.right,e._count)}function s(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function l(t,e){this._compare=t,this.root=e}var f=l.prototype;function c(t,e){this.tree=t,this._stack=e}Object.defineProperty(f,"keys",{get:function(){var t=[];return this.forEach(function(e,n){t.push(e)}),t}}),Object.defineProperty(f,"values",{get:function(){var t=[];return this.forEach(function(e,n){t.push(n)}),t}}),Object.defineProperty(f,"length",{get:function(){return this.root?this.root._count:0}}),f.insert=function(t,e){for(var n=this._compare,a=this.root,f=[],c=[];a;){var h=n(t,a.key);f.push(a),c.push(h),a=h<=0?a.left:a.right}f.push(new o(r,t,e,null,null,1));for(var p=f.length-2;p>=0;--p){a=f[p];c[p]<=0?f[p]=new o(a._color,a.key,a.value,f[p+1],a.right,a._count+1):f[p]=new o(a._color,a.key,a.value,a.left,f[p+1],a._count+1)}for(p=f.length-1;p>1;--p){var d=f[p-1];a=f[p];if(d._color===i||a._color===i)break;var m=f[p-2];if(m.left===d)if(d.left===a){if(!(g=m.right)||g._color!==r){if(m._color=r,m.left=d.right,d._color=i,d.right=m,f[p-2]=d,f[p-1]=a,s(m),s(d),p>=3)(v=f[p-3]).left===m?v.left=d:v.right=d;break}d._color=i,m.right=u(i,g),m._color=r,p-=1}else{if(!(g=m.right)||g._color!==r){if(d.right=a.left,m._color=r,m.left=a.right,a._color=i,a.left=d,a.right=m,f[p-2]=a,f[p-1]=d,s(m),s(d),s(a),p>=3)(v=f[p-3]).left===m?v.left=a:v.right=a;break}d._color=i,m.right=u(i,g),m._color=r,p-=1}else if(d.right===a){if(!(g=m.left)||g._color!==r){if(m._color=r,m.right=d.left,d._color=i,d.left=m,f[p-2]=d,f[p-1]=a,s(m),s(d),p>=3)(v=f[p-3]).right===m?v.right=d:v.left=d;break}d._color=i,m.left=u(i,g),m._color=r,p-=1}else{var g;if(!(g=m.left)||g._color!==r){var v;if(d.left=a.right,m._color=r,m.right=a.left,a._color=i,a.right=d,a.left=m,f[p-2]=a,f[p-1]=d,s(m),s(d),s(a),p>=3)(v=f[p-3]).right===m?v.right=a:v.left=a;break}d._color=i,m.left=u(i,g),m._color=r,p-=1}}return f[0]._color=i,new l(n,f[0])},f.forEach=function(t,e,n){if(this.root)switch(arguments.length){case 1:return function t(e,n){var r;if(n.left&&(r=t(e,n.left)))return r;return(r=e(n.key,n.value))||(n.right?t(e,n.right):void 0)}(t,this.root);case 2:return function t(e,n,r,i){if(n(e,i.key)<=0){var o;if(i.left&&(o=t(e,n,r,i.left)))return o;if(o=r(i.key,i.value))return o}if(i.right)return t(e,n,r,i.right)}(e,this._compare,t,this.root);case 3:if(this._compare(e,n)>=0)return;return function t(e,n,r,i,o){var a,u=r(e,o.key),s=r(n,o.key);if(u<=0){if(o.left&&(a=t(e,n,r,i,o.left)))return a;if(s>0&&(a=i(o.key,o.value)))return a}if(s>0&&o.right)return t(e,n,r,i,o.right)}(e,n,this._compare,t,this.root)}},Object.defineProperty(f,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new c(this,t)}}),Object.defineProperty(f,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new c(this,t)}}),f.at=function(t){if(t<0)return new c(this,[]);for(var e=this.root,n=[];;){if(n.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new c(this,n);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new c(this,[])},f.ge=function(t){for(var e=this._compare,n=this.root,r=[],i=0;n;){var o=e(t,n.key);r.push(n),o<=0&&(i=r.length),n=o<=0?n.left:n.right}return r.length=i,new c(this,r)},f.gt=function(t){for(var e=this._compare,n=this.root,r=[],i=0;n;){var o=e(t,n.key);r.push(n),o<0&&(i=r.length),n=o<0?n.left:n.right}return r.length=i,new c(this,r)},f.lt=function(t){for(var e=this._compare,n=this.root,r=[],i=0;n;){var o=e(t,n.key);r.push(n),o>0&&(i=r.length),n=o<=0?n.left:n.right}return r.length=i,new c(this,r)},f.le=function(t){for(var e=this._compare,n=this.root,r=[],i=0;n;){var o=e(t,n.key);r.push(n),o>=0&&(i=r.length),n=o<0?n.left:n.right}return r.length=i,new c(this,r)},f.find=function(t){for(var e=this._compare,n=this.root,r=[];n;){var i=e(t,n.key);if(r.push(n),0===i)return new c(this,r);n=i<=0?n.left:n.right}return new c(this,[])},f.remove=function(t){var e=this.find(t);return e?e.remove():this},f.get=function(t){for(var e=this._compare,n=this.root;n;){var r=e(t,n.key);if(0===r)return n.value;n=r<=0?n.left:n.right}};var h=c.prototype;function p(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t,e){return t<e?-1:t>e?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new c(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),n=t[t.length-1];e[e.length-1]=new o(n._color,n.key,n.value,n.left,n.right,n._count);for(var f=t.length-2;f>=0;--f){(n=t[f]).left===t[f+1]?e[f]=new o(n._color,n.key,n.value,e[f+1],n.right,n._count):e[f]=new o(n._color,n.key,n.value,n.left,e[f+1],n._count)}if((n=e[e.length-1]).left&&n.right){var c=e.length;for(n=n.left;n.right;)e.push(n),n=n.right;var h=e[c-1];e.push(new o(n._color,h.key,h.value,n.left,n.right,n._count)),e[c-1].key=n.key,e[c-1].value=n.value;for(f=e.length-2;f>=c;--f)n=e[f],e[f]=new o(n._color,n.key,n.value,n.left,e[f+1],n._count);e[c-1].left=e[c]}if((n=e[e.length-1])._color===r){var d=e[e.length-2];d.left===n?d.left=null:d.right===n&&(d.right=null),e.pop();for(f=0;f<e.length;++f)e[f]._count--;return new l(this.tree._compare,e[0])}if(n.left||n.right){n.left?p(n,n.left):n.right&&p(n,n.right),n._color=i;for(f=0;f<e.length-1;++f)e[f]._count--;return new l(this.tree._compare,e[0])}if(1===e.length)return new l(this.tree._compare,null);for(f=0;f<e.length;++f)e[f]._count--;var m=e[e.length-2];return function(t){for(var e,n,o,l,f=t.length-1;f>=0;--f){if(e=t[f],0===f)return void(e._color=i);if((n=t[f-1]).left===e){if((o=n.right).right&&o.right._color===r)return l=(o=n.right=a(o)).right=a(o.right),n.right=o.left,o.left=n,o.right=l,o._color=n._color,e._color=i,n._color=i,l._color=i,s(n),s(o),f>1&&((c=t[f-2]).left===n?c.left=o:c.right=o),void(t[f-1]=o);if(o.left&&o.left._color===r)return l=(o=n.right=a(o)).left=a(o.left),n.right=l.left,o.left=l.right,l.left=n,l.right=o,l._color=n._color,n._color=i,o._color=i,e._color=i,s(n),s(o),s(l),f>1&&((c=t[f-2]).left===n?c.left=l:c.right=l),void(t[f-1]=l);if(o._color===i){if(n._color===r)return n._color=i,void(n.right=u(r,o));n.right=u(r,o);continue}o=a(o),n.right=o.left,o.left=n,o._color=n._color,n._color=r,s(n),s(o),f>1&&((c=t[f-2]).left===n?c.left=o:c.right=o),t[f-1]=o,t[f]=n,f+1<t.length?t[f+1]=e:t.push(e),f+=2}else{if((o=n.left).left&&o.left._color===r)return l=(o=n.left=a(o)).left=a(o.left),n.left=o.right,o.right=n,o.left=l,o._color=n._color,e._color=i,n._color=i,l._color=i,s(n),s(o),f>1&&((c=t[f-2]).right===n?c.right=o:c.left=o),void(t[f-1]=o);if(o.right&&o.right._color===r)return l=(o=n.left=a(o)).right=a(o.right),n.left=l.right,o.right=l.left,l.right=n,l.left=o,l._color=n._color,n._color=i,o._color=i,e._color=i,s(n),s(o),s(l),f>1&&((c=t[f-2]).right===n?c.right=l:c.left=l),void(t[f-1]=l);if(o._color===i){if(n._color===r)return n._color=i,void(n.left=u(r,o));n.left=u(r,o);continue}var c;o=a(o),n.left=o.right,o.right=n,o._color=n._color,n._color=r,s(n),s(o),f>1&&((c=t[f-2]).right===n?c.right=o:c.left=o),t[f-1]=o,t[f]=n,f+1<t.length?t[f+1]=e:t.push(e),f+=2}}}(e),m.left===n?m.left=null:m.right=null,new l(this.tree._compare,e[0])},Object.defineProperty(h,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var n=this.tree.root;return n?n._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var r=e.length-2;r>=0;--r)e[r+1]===e[r].right&&(++t,e[r].left&&(t+=e[r].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var n=new Array(e.length),r=e[e.length-1];n[n.length-1]=new o(r._color,r.key,t,r.left,r.right,r._count);for(var i=e.length-2;i>=0;--i)(r=e[i]).left===e[i+1]?n[i]=new o(r._color,r.key,r.value,n[i+1],r.right,r._count):n[i]=new o(r._color,r.key,r.value,r.left,n[i+1],r._count);return new l(this.tree._compare,n[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},"./node_modules/gamma/index.js":
/*!*************************************!*\
  !*** ./node_modules/gamma/index.js ***!
  \*************************************/
/*! no static exports found */function(t,e){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],r=607/128,i=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function o(t){if(t<0)return Number("0/0");for(var e=i[0],n=i.length-1;n>0;--n)e+=i[n]/(t+n);var o=t+r+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(o)-o+Math.log(e)-Math.log(t)}t.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(o(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var a=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,e+.5)*Math.exp(-a)*r},t.exports.log=o},"./node_modules/gl-mat4/adjoint.js":
/*!*****************************************!*\
  !*** ./node_modules/gl-mat4/adjoint.js ***!
  \*****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],l=e[7],f=e[8],c=e[9],h=e[10],p=e[11],d=e[12],m=e[13],g=e[14],v=e[15];return t[0]=u*(h*v-p*g)-c*(s*v-l*g)+m*(s*p-l*h),t[1]=-(r*(h*v-p*g)-c*(i*v-o*g)+m*(i*p-o*h)),t[2]=r*(s*v-l*g)-u*(i*v-o*g)+m*(i*l-o*s),t[3]=-(r*(s*p-l*h)-u*(i*p-o*h)+c*(i*l-o*s)),t[4]=-(a*(h*v-p*g)-f*(s*v-l*g)+d*(s*p-l*h)),t[5]=n*(h*v-p*g)-f*(i*v-o*g)+d*(i*p-o*h),t[6]=-(n*(s*v-l*g)-a*(i*v-o*g)+d*(i*l-o*s)),t[7]=n*(s*p-l*h)-a*(i*p-o*h)+f*(i*l-o*s),t[8]=a*(c*v-p*m)-f*(u*v-l*m)+d*(u*p-l*c),t[9]=-(n*(c*v-p*m)-f*(r*v-o*m)+d*(r*p-o*c)),t[10]=n*(u*v-l*m)-a*(r*v-o*m)+d*(r*l-o*u),t[11]=-(n*(u*p-l*c)-a*(r*p-o*c)+f*(r*l-o*u)),t[12]=-(a*(c*g-h*m)-f*(u*g-s*m)+d*(u*h-s*c)),t[13]=n*(c*g-h*m)-f*(r*g-i*m)+d*(r*h-i*c),t[14]=-(n*(u*g-s*m)-a*(r*g-i*m)+d*(r*s-i*u)),t[15]=n*(u*h-s*c)-a*(r*h-i*c)+f*(r*s-i*u),t}},"./node_modules/gl-mat4/clone.js":
/*!***************************************!*\
  !*** ./node_modules/gl-mat4/clone.js ***!
  \***************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},"./node_modules/gl-mat4/copy.js":
/*!**************************************!*\
  !*** ./node_modules/gl-mat4/copy.js ***!
  \**************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},"./node_modules/gl-mat4/create.js":
/*!****************************************!*\
  !*** ./node_modules/gl-mat4/create.js ***!
  \****************************************/
/*! no static exports found */function(t,e){t.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},"./node_modules/gl-mat4/determinant.js":
/*!*********************************************!*\
  !*** ./node_modules/gl-mat4/determinant.js ***!
  \*********************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],u=t[6],s=t[7],l=t[8],f=t[9],c=t[10],h=t[11],p=t[12],d=t[13],m=t[14],g=t[15];return(e*a-n*o)*(c*g-h*m)-(e*u-r*o)*(f*g-h*d)+(e*s-i*o)*(f*m-c*d)+(n*u-r*a)*(l*g-h*p)-(n*s-i*a)*(l*m-c*p)+(r*s-i*u)*(l*d-f*p)}},"./node_modules/gl-mat4/fromQuat.js":
/*!******************************************!*\
  !*** ./node_modules/gl-mat4/fromQuat.js ***!
  \******************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,u=r+r,s=i+i,l=n*a,f=r*a,c=r*u,h=i*a,p=i*u,d=i*s,m=o*a,g=o*u,v=o*s;return t[0]=1-c-d,t[1]=f+v,t[2]=h-g,t[3]=0,t[4]=f-v,t[5]=1-l-d,t[6]=p+m,t[7]=0,t[8]=h+g,t[9]=p-m,t[10]=1-l-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},"./node_modules/gl-mat4/fromRotationTranslation.js":
/*!*********************************************************!*\
  !*** ./node_modules/gl-mat4/fromRotationTranslation.js ***!
  \*********************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=r+r,s=i+i,l=o+o,f=r*u,c=r*s,h=r*l,p=i*s,d=i*l,m=o*l,g=a*u,v=a*s,y=a*l;return t[0]=1-(p+m),t[1]=c+y,t[2]=h-v,t[3]=0,t[4]=c-y,t[5]=1-(f+m),t[6]=d+g,t[7]=0,t[8]=h+v,t[9]=d-g,t[10]=1-(f+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}},"./node_modules/gl-mat4/frustum.js":
/*!*****************************************!*\
  !*** ./node_modules/gl-mat4/frustum.js ***!
  \*****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r,i,o,a){var u=1/(n-e),s=1/(i-r),l=1/(o-a);return t[0]=2*o*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*s,t[6]=0,t[7]=0,t[8]=(n+e)*u,t[9]=(i+r)*s,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t}},"./node_modules/gl-mat4/identity.js":
/*!******************************************!*\
  !*** ./node_modules/gl-mat4/identity.js ***!
  \******************************************/
/*! no static exports found */function(t,e){t.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},"./node_modules/gl-mat4/index.js":
/*!***************************************!*\
  !*** ./node_modules/gl-mat4/index.js ***!
  \***************************************/
/*! no static exports found */function(t,e,n){t.exports={create:n(/*! ./create */"./node_modules/gl-mat4/create.js"),clone:n(/*! ./clone */"./node_modules/gl-mat4/clone.js"),copy:n(/*! ./copy */"./node_modules/gl-mat4/copy.js"),identity:n(/*! ./identity */"./node_modules/gl-mat4/identity.js"),transpose:n(/*! ./transpose */"./node_modules/gl-mat4/transpose.js"),invert:n(/*! ./invert */"./node_modules/gl-mat4/invert.js"),adjoint:n(/*! ./adjoint */"./node_modules/gl-mat4/adjoint.js"),determinant:n(/*! ./determinant */"./node_modules/gl-mat4/determinant.js"),multiply:n(/*! ./multiply */"./node_modules/gl-mat4/multiply.js"),translate:n(/*! ./translate */"./node_modules/gl-mat4/translate.js"),scale:n(/*! ./scale */"./node_modules/gl-mat4/scale.js"),rotate:n(/*! ./rotate */"./node_modules/gl-mat4/rotate.js"),rotateX:n(/*! ./rotateX */"./node_modules/gl-mat4/rotateX.js"),rotateY:n(/*! ./rotateY */"./node_modules/gl-mat4/rotateY.js"),rotateZ:n(/*! ./rotateZ */"./node_modules/gl-mat4/rotateZ.js"),fromRotationTranslation:n(/*! ./fromRotationTranslation */"./node_modules/gl-mat4/fromRotationTranslation.js"),fromQuat:n(/*! ./fromQuat */"./node_modules/gl-mat4/fromQuat.js"),frustum:n(/*! ./frustum */"./node_modules/gl-mat4/frustum.js"),perspective:n(/*! ./perspective */"./node_modules/gl-mat4/perspective.js"),perspectiveFromFieldOfView:n(/*! ./perspectiveFromFieldOfView */"./node_modules/gl-mat4/perspectiveFromFieldOfView.js"),ortho:n(/*! ./ortho */"./node_modules/gl-mat4/ortho.js"),lookAt:n(/*! ./lookAt */"./node_modules/gl-mat4/lookAt.js"),str:n(/*! ./str */"./node_modules/gl-mat4/str.js")}},"./node_modules/gl-mat4/invert.js":
/*!****************************************!*\
  !*** ./node_modules/gl-mat4/invert.js ***!
  \****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],l=e[7],f=e[8],c=e[9],h=e[10],p=e[11],d=e[12],m=e[13],g=e[14],v=e[15],y=n*u-r*a,_=n*s-i*a,b=n*l-o*a,x=r*s-i*u,w=r*l-o*u,M=i*l-o*s,j=f*m-c*d,k=f*g-h*d,A=f*v-p*d,z=c*g-h*m,E=c*v-p*m,S=h*v-p*g,T=y*S-_*E+b*z+x*A-w*k+M*j;if(!T)return null;return T=1/T,t[0]=(u*S-s*E+l*z)*T,t[1]=(i*E-r*S-o*z)*T,t[2]=(m*M-g*w+v*x)*T,t[3]=(h*w-c*M-p*x)*T,t[4]=(s*A-a*S-l*k)*T,t[5]=(n*S-i*A+o*k)*T,t[6]=(g*b-d*M-v*_)*T,t[7]=(f*M-h*b+p*_)*T,t[8]=(a*E-u*A+l*j)*T,t[9]=(r*A-n*E-o*j)*T,t[10]=(d*w-m*b+v*y)*T,t[11]=(c*b-f*w-p*y)*T,t[12]=(u*k-a*z-s*j)*T,t[13]=(n*z-r*k+i*j)*T,t[14]=(m*_-d*x-g*y)*T,t[15]=(f*x-c*_+h*y)*T,t}},"./node_modules/gl-mat4/lookAt.js":
/*!****************************************!*\
  !*** ./node_modules/gl-mat4/lookAt.js ***!
  \****************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./identity */"./node_modules/gl-mat4/identity.js");t.exports=function(t,e,n,i){var o,a,u,s,l,f,c,h,p,d,m=e[0],g=e[1],v=e[2],y=i[0],_=i[1],b=i[2],x=n[0],w=n[1],M=n[2];if(Math.abs(m-x)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(v-M)<1e-6)return r(t);c=m-x,h=g-w,p=v-M,d=1/Math.sqrt(c*c+h*h+p*p),o=_*(p*=d)-b*(h*=d),a=b*(c*=d)-y*p,u=y*h-_*c,(d=Math.sqrt(o*o+a*a+u*u))?(o*=d=1/d,a*=d,u*=d):(o=0,a=0,u=0);s=h*u-p*a,l=p*o-c*u,f=c*a-h*o,(d=Math.sqrt(s*s+l*l+f*f))?(s*=d=1/d,l*=d,f*=d):(s=0,l=0,f=0);return t[0]=o,t[1]=s,t[2]=c,t[3]=0,t[4]=a,t[5]=l,t[6]=h,t[7]=0,t[8]=u,t[9]=f,t[10]=p,t[11]=0,t[12]=-(o*m+a*g+u*v),t[13]=-(s*m+l*g+f*v),t[14]=-(c*m+h*g+p*v),t[15]=1,t}},"./node_modules/gl-mat4/multiply.js":
/*!******************************************!*\
  !*** ./node_modules/gl-mat4/multiply.js ***!
  \******************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],l=e[6],f=e[7],c=e[8],h=e[9],p=e[10],d=e[11],m=e[12],g=e[13],v=e[14],y=e[15],_=n[0],b=n[1],x=n[2],w=n[3];return t[0]=_*r+b*u+x*c+w*m,t[1]=_*i+b*s+x*h+w*g,t[2]=_*o+b*l+x*p+w*v,t[3]=_*a+b*f+x*d+w*y,_=n[4],b=n[5],x=n[6],w=n[7],t[4]=_*r+b*u+x*c+w*m,t[5]=_*i+b*s+x*h+w*g,t[6]=_*o+b*l+x*p+w*v,t[7]=_*a+b*f+x*d+w*y,_=n[8],b=n[9],x=n[10],w=n[11],t[8]=_*r+b*u+x*c+w*m,t[9]=_*i+b*s+x*h+w*g,t[10]=_*o+b*l+x*p+w*v,t[11]=_*a+b*f+x*d+w*y,_=n[12],b=n[13],x=n[14],w=n[15],t[12]=_*r+b*u+x*c+w*m,t[13]=_*i+b*s+x*h+w*g,t[14]=_*o+b*l+x*p+w*v,t[15]=_*a+b*f+x*d+w*y,t}},"./node_modules/gl-mat4/ortho.js":
/*!***************************************!*\
  !*** ./node_modules/gl-mat4/ortho.js ***!
  \***************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r,i,o,a){var u=1/(e-n),s=1/(r-i),l=1/(o-a);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*u,t[13]=(i+r)*s,t[14]=(a+o)*l,t[15]=1,t}},"./node_modules/gl-mat4/perspective.js":
/*!*********************************************!*\
  !*** ./node_modules/gl-mat4/perspective.js ***!
  \*********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r,i){var o=1/Math.tan(e/2),a=1/(r-i);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+r)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*r*a,t[15]=0,t}},"./node_modules/gl-mat4/perspectiveFromFieldOfView.js":
/*!************************************************************!*\
  !*** ./node_modules/gl-mat4/perspectiveFromFieldOfView.js ***!
  \************************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),u=Math.tan(e.rightDegrees*Math.PI/180),s=2/(a+u),l=2/(i+o);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-u)*s*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}},"./node_modules/gl-mat4/rotate.js":
/*!****************************************!*\
  !*** ./node_modules/gl-mat4/rotate.js ***!
  \****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r){var i,o,a,u,s,l,f,c,h,p,d,m,g,v,y,_,b,x,w,M,j,k,A,z,E=r[0],S=r[1],T=r[2],C=Math.sqrt(E*E+S*S+T*T);if(Math.abs(C)<1e-6)return null;E*=C=1/C,S*=C,T*=C,i=Math.sin(n),o=Math.cos(n),a=1-o,u=e[0],s=e[1],l=e[2],f=e[3],c=e[4],h=e[5],p=e[6],d=e[7],m=e[8],g=e[9],v=e[10],y=e[11],_=E*E*a+o,b=S*E*a+T*i,x=T*E*a-S*i,w=E*S*a-T*i,M=S*S*a+o,j=T*S*a+E*i,k=E*T*a+S*i,A=S*T*a-E*i,z=T*T*a+o,t[0]=u*_+c*b+m*x,t[1]=s*_+h*b+g*x,t[2]=l*_+p*b+v*x,t[3]=f*_+d*b+y*x,t[4]=u*w+c*M+m*j,t[5]=s*w+h*M+g*j,t[6]=l*w+p*M+v*j,t[7]=f*w+d*M+y*j,t[8]=u*k+c*A+m*z,t[9]=s*k+h*A+g*z,t[10]=l*k+p*A+v*z,t[11]=f*k+d*A+y*z,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},"./node_modules/gl-mat4/rotateX.js":
/*!*****************************************!*\
  !*** ./node_modules/gl-mat4/rotateX.js ***!
  \*****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],u=e[6],s=e[7],l=e[8],f=e[9],c=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[4]=o*i+l*r,t[5]=a*i+f*r,t[6]=u*i+c*r,t[7]=s*i+h*r,t[8]=l*i-o*r,t[9]=f*i-a*r,t[10]=c*i-u*r,t[11]=h*i-s*r,t}},"./node_modules/gl-mat4/rotateY.js":
/*!*****************************************!*\
  !*** ./node_modules/gl-mat4/rotateY.js ***!
  \*****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],u=e[2],s=e[3],l=e[8],f=e[9],c=e[10],h=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=o*i-l*r,t[1]=a*i-f*r,t[2]=u*i-c*r,t[3]=s*i-h*r,t[8]=o*r+l*i,t[9]=a*r+f*i,t[10]=u*r+c*i,t[11]=s*r+h*i,t}},"./node_modules/gl-mat4/rotateZ.js":
/*!*****************************************!*\
  !*** ./node_modules/gl-mat4/rotateZ.js ***!
  \*****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],u=e[2],s=e[3],l=e[4],f=e[5],c=e[6],h=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=o*i+l*r,t[1]=a*i+f*r,t[2]=u*i+c*r,t[3]=s*i+h*r,t[4]=l*i-o*r,t[5]=f*i-a*r,t[6]=c*i-u*r,t[7]=h*i-s*r,t}},"./node_modules/gl-mat4/scale.js":
/*!***************************************!*\
  !*** ./node_modules/gl-mat4/scale.js ***!
  \***************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},"./node_modules/gl-mat4/str.js":
/*!*************************************!*\
  !*** ./node_modules/gl-mat4/str.js ***!
  \*************************************/
/*! no static exports found */function(t,e){t.exports=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}},"./node_modules/gl-mat4/translate.js":
/*!*******************************************!*\
  !*** ./node_modules/gl-mat4/translate.js ***!
  \*******************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r,i,o,a,u,s,l,f,c,h,p,d,m=n[0],g=n[1],v=n[2];e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],l=e[6],f=e[7],c=e[8],h=e[9],p=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=s,t[6]=l,t[7]=f,t[8]=c,t[9]=h,t[10]=p,t[11]=d,t[12]=r*m+u*g+c*v+e[12],t[13]=i*m+s*g+h*v+e[13],t[14]=o*m+l*g+p*v+e[14],t[15]=a*m+f*g+d*v+e[15]);return t}},"./node_modules/gl-mat4/transpose.js":
/*!*******************************************!*\
  !*** ./node_modules/gl-mat4/transpose.js ***!
  \*******************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],u=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=u}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}},"./node_modules/gl-vec4/add.js":
/*!*************************************!*\
  !*** ./node_modules/gl-vec4/add.js ***!
  \*************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}},"./node_modules/gl-vec4/clone.js":
/*!***************************************!*\
  !*** ./node_modules/gl-vec4/clone.js ***!
  \***************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},"./node_modules/gl-vec4/copy.js":
/*!**************************************!*\
  !*** ./node_modules/gl-vec4/copy.js ***!
  \**************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},"./node_modules/gl-vec4/create.js":
/*!****************************************!*\
  !*** ./node_modules/gl-vec4/create.js ***!
  \****************************************/
/*! no static exports found */function(t,e){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},"./node_modules/gl-vec4/distance.js":
/*!******************************************!*\
  !*** ./node_modules/gl-vec4/distance.js ***!
  \******************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+o*o)}},"./node_modules/gl-vec4/divide.js":
/*!****************************************!*\
  !*** ./node_modules/gl-vec4/divide.js ***!
  \****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}},"./node_modules/gl-vec4/dot.js":
/*!*************************************!*\
  !*** ./node_modules/gl-vec4/dot.js ***!
  \*************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},"./node_modules/gl-vec4/fromValues.js":
/*!********************************************!*\
  !*** ./node_modules/gl-vec4/fromValues.js ***!
  \********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}},"./node_modules/gl-vec4/index.js":
/*!***************************************!*\
  !*** ./node_modules/gl-vec4/index.js ***!
  \***************************************/
/*! no static exports found */function(t,e,n){t.exports={create:n(/*! ./create */"./node_modules/gl-vec4/create.js"),clone:n(/*! ./clone */"./node_modules/gl-vec4/clone.js"),fromValues:n(/*! ./fromValues */"./node_modules/gl-vec4/fromValues.js"),copy:n(/*! ./copy */"./node_modules/gl-vec4/copy.js"),set:n(/*! ./set */"./node_modules/gl-vec4/set.js"),add:n(/*! ./add */"./node_modules/gl-vec4/add.js"),subtract:n(/*! ./subtract */"./node_modules/gl-vec4/subtract.js"),multiply:n(/*! ./multiply */"./node_modules/gl-vec4/multiply.js"),divide:n(/*! ./divide */"./node_modules/gl-vec4/divide.js"),min:n(/*! ./min */"./node_modules/gl-vec4/min.js"),max:n(/*! ./max */"./node_modules/gl-vec4/max.js"),scale:n(/*! ./scale */"./node_modules/gl-vec4/scale.js"),scaleAndAdd:n(/*! ./scaleAndAdd */"./node_modules/gl-vec4/scaleAndAdd.js"),distance:n(/*! ./distance */"./node_modules/gl-vec4/distance.js"),squaredDistance:n(/*! ./squaredDistance */"./node_modules/gl-vec4/squaredDistance.js"),length:n(/*! ./length */"./node_modules/gl-vec4/length.js"),squaredLength:n(/*! ./squaredLength */"./node_modules/gl-vec4/squaredLength.js"),negate:n(/*! ./negate */"./node_modules/gl-vec4/negate.js"),inverse:n(/*! ./inverse */"./node_modules/gl-vec4/inverse.js"),normalize:n(/*! ./normalize */"./node_modules/gl-vec4/normalize.js"),dot:n(/*! ./dot */"./node_modules/gl-vec4/dot.js"),lerp:n(/*! ./lerp */"./node_modules/gl-vec4/lerp.js"),random:n(/*! ./random */"./node_modules/gl-vec4/random.js"),transformMat4:n(/*! ./transformMat4 */"./node_modules/gl-vec4/transformMat4.js"),transformQuat:n(/*! ./transformQuat */"./node_modules/gl-vec4/transformQuat.js")}},"./node_modules/gl-vec4/inverse.js":
/*!*****************************************!*\
  !*** ./node_modules/gl-vec4/inverse.js ***!
  \*****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},"./node_modules/gl-vec4/length.js":
/*!****************************************!*\
  !*** ./node_modules/gl-vec4/length.js ***!
  \****************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)}},"./node_modules/gl-vec4/lerp.js":
/*!**************************************!*\
  !*** ./node_modules/gl-vec4/lerp.js ***!
  \**************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r){var i=e[0],o=e[1],a=e[2],u=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=u+r*(n[3]-u),t}},"./node_modules/gl-vec4/max.js":
/*!*************************************!*\
  !*** ./node_modules/gl-vec4/max.js ***!
  \*************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}},"./node_modules/gl-vec4/min.js":
/*!*************************************!*\
  !*** ./node_modules/gl-vec4/min.js ***!
  \*************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}},"./node_modules/gl-vec4/multiply.js":
/*!******************************************!*\
  !*** ./node_modules/gl-vec4/multiply.js ***!
  \******************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}},"./node_modules/gl-vec4/negate.js":
/*!****************************************!*\
  !*** ./node_modules/gl-vec4/negate.js ***!
  \****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},"./node_modules/gl-vec4/normalize.js":
/*!*******************************************!*\
  !*** ./node_modules/gl-vec4/normalize.js ***!
  \*******************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;a>0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a);return t}},"./node_modules/gl-vec4/random.js":
/*!****************************************!*\
  !*** ./node_modules/gl-vec4/random.js ***!
  \****************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./normalize */"./node_modules/gl-vec4/normalize.js"),i=n(/*! ./scale */"./node_modules/gl-vec4/scale.js");t.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),r(t,t),i(t,t,e),t}},"./node_modules/gl-vec4/scale.js":
/*!***************************************!*\
  !*** ./node_modules/gl-vec4/scale.js ***!
  \***************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}},"./node_modules/gl-vec4/scaleAndAdd.js":
/*!*********************************************!*\
  !*** ./node_modules/gl-vec4/scaleAndAdd.js ***!
  \*********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}},"./node_modules/gl-vec4/set.js":
/*!*************************************!*\
  !*** ./node_modules/gl-vec4/set.js ***!
  \*************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}},"./node_modules/gl-vec4/squaredDistance.js":
/*!*************************************************!*\
  !*** ./node_modules/gl-vec4/squaredDistance.js ***!
  \*************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}},"./node_modules/gl-vec4/squaredLength.js":
/*!***********************************************!*\
  !*** ./node_modules/gl-vec4/squaredLength.js ***!
  \***********************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}},"./node_modules/gl-vec4/subtract.js":
/*!******************************************!*\
  !*** ./node_modules/gl-vec4/subtract.js ***!
  \******************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}},"./node_modules/gl-vec4/transformMat4.js":
/*!***********************************************!*\
  !*** ./node_modules/gl-vec4/transformMat4.js ***!
  \***********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}},"./node_modules/gl-vec4/transformQuat.js":
/*!***********************************************!*\
  !*** ./node_modules/gl-vec4/transformQuat.js ***!
  \***********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],u=n[1],s=n[2],l=n[3],f=l*r+u*o-s*i,c=l*i+s*r-a*o,h=l*o+a*i-u*r,p=-a*r-u*i-s*o;return t[0]=f*l+p*-a+c*-s-h*-u,t[1]=c*l+p*-u+h*-a-f*-s,t[2]=h*l+p*-s+f*-u-c*-a,t[3]=e[3],t}},"./node_modules/ieee754/index.js":
/*!***************************************!*\
  !*** ./node_modules/ieee754/index.js ***!
  \***************************************/
/*! no static exports found */function(t,e){e.read=function(t,e,n,r,i){var o,a,u=8*i-r-1,s=(1<<u)-1,l=s>>1,f=-7,c=n?i-1:0,h=n?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-f)-1,p>>=-f,f+=u;f>0;o=256*o+t[e+c],c+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,u,s,l=8*o-i-1,f=(1<<l)-1,c=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+c>=1?h/s:h*Math.pow(2,1-c))*s>=2&&(a++,s/=2),a+c>=f?(u=0,a=f):a+c>=1?(u=(e*s-1)*Math.pow(2,i),a+=c):(u=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&u,p+=d,u/=256,i-=8);for(a=a<<i|u,l+=i;l>0;t[n+p]=255&a,p+=d,a/=256,l-=8);t[n+p-d]|=128*m}},"./node_modules/interval-tree-1d/interval-tree.js":
/*!********************************************************!*\
  !*** ./node_modules/interval-tree-1d/interval-tree.js ***!
  \********************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! binary-search-bounds */"./node_modules/interval-tree-1d/node_modules/binary-search-bounds/search-bounds.js"),i=0,o=1;function a(t,e,n,r,i){this.mid=t,this.left=e,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(e?e.count:0)+(n?n.count:0)+r.length}t.exports=function(t){if(!t||0===t.length)return new _(null);return new _(y(t))};var u=a.prototype;function s(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function l(t,e){var n=y(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function f(t,e){var n=t.intervals([]);n.push(e),l(t,n)}function c(t,e){var n=t.intervals([]),r=n.indexOf(e);return r<0?i:(n.splice(r,1),l(t,n),o)}function h(t,e,n){for(var r=0;r<t.length&&t[r][0]<=e;++r){var i=n(t[r]);if(i)return i}}function p(t,e,n){for(var r=t.length-1;r>=0&&t[r][1]>=e;--r){var i=n(t[r]);if(i)return i}}function d(t,e){for(var n=0;n<t.length;++n){var r=e(t[n]);if(r)return r}}function m(t,e){return t-e}function g(t,e){var n=t[0]-e[0];return n||t[1]-e[1]}function v(t,e){var n=t[1]-e[1];return n||t[0]-e[0]}function y(t){if(0===t.length)return null;for(var e=[],n=0;n<t.length;++n)e.push(t[n][0],t[n][1]);e.sort(m);var r=e[e.length>>1],i=[],o=[],u=[];for(n=0;n<t.length;++n){var s=t[n];s[1]<r?i.push(s):r<s[0]?o.push(s):u.push(s)}var l=u,f=u.slice();return l.sort(g),f.sort(v),new a(r,y(i),y(o),l,f)}function _(t){this.root=t}u.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},u.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?f(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?f(this,t):this.right.insert(t):this.right=y([t]);else{var n=r.ge(this.leftPoints,t,g),i=r.ge(this.rightPoints,t,v);this.leftPoints.splice(n,0,t),this.rightPoints.splice(i,0,t)}},u.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){return this.left?4*(this.right?this.right.count:0)>3*(e-1)?c(this,t):2===(l=this.left.remove(t))?(this.left=null,this.count-=1,o):(l===o&&(this.count-=1),l):i}else{if(!(t[0]>this.mid)){if(1===this.count)return this.leftPoints[0]===t?2:i;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,a=this.left;a.right;)n=a,a=a.right;if(n===this)a.right=this.right;else{var u=this.left;l=this.right;n.count-=a.count,n.right=a.left,a.left=u,a.right=l}s(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?s(this,this.left):s(this,this.right);return o}for(u=r.ge(this.leftPoints,t,g);u<this.leftPoints.length&&this.leftPoints[u][0]===t[0];++u)if(this.leftPoints[u]===t){this.count-=1,this.leftPoints.splice(u,1);for(l=r.ge(this.rightPoints,t,v);l<this.rightPoints.length&&this.rightPoints[l][1]===t[1];++l)if(this.rightPoints[l]===t)return this.rightPoints.splice(l,1),o}return i}return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(l=this.right.remove(t))?(this.right=null,this.count-=1,o):(l===o&&(this.count-=1),l):i;var l}},u.queryPoint=function(t,e){if(t<this.mid){if(this.left)if(n=this.left.queryPoint(t,e))return n;return h(this.leftPoints,t,e)}if(t>this.mid){var n;if(this.right)if(n=this.right.queryPoint(t,e))return n;return p(this.rightPoints,t,e)}return d(this.leftPoints,e)},u.queryInterval=function(t,e,n){var r;if(t<this.mid&&this.left&&(r=this.left.queryInterval(t,e,n)))return r;if(e>this.mid&&this.right&&(r=this.right.queryInterval(t,e,n)))return r;return e<this.mid?h(this.leftPoints,e,n):t>this.mid?p(this.rightPoints,t,n):d(this.leftPoints,n)};var b=_.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new a(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==i}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},"./node_modules/interval-tree-1d/node_modules/binary-search-bounds/search-bounds.js":
/*!******************************************************************************************!*\
  !*** ./node_modules/interval-tree-1d/node_modules/binary-search-bounds/search-bounds.js ***!
  \******************************************************************************************/
/*! no static exports found */function(t,e,n){"use strict";function r(t,e,n,r,i,o){var a=["function ",t,"(a,l,h,",r.join(","),"){",o?"":"var i=",n?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return o?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),n?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),o?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,n,i){return new Function([r("A","x"+t+"y",e,["y"],!1,i),r("B","x"+t+"y",e,["y"],!0,i),r("P","c(x,y)"+t+"0",e,["y","c"],!1,i),r("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",n,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",n].join(""))()}t.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},"./node_modules/invert-permutation/index.js":
/*!**************************************************!*\
  !*** ./node_modules/invert-permutation/index.js ***!
  \**************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){e=e||new Array(t.length);for(var n=0;n<t.length;++n)e[t[n]]=n;return e}},"./node_modules/iota-array/iota.js":
/*!*****************************************!*\
  !*** ./node_modules/iota-array/iota.js ***!
  \*****************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=n;return e}},"./node_modules/is-buffer/index.js":
/*!*****************************************!*\
  !*** ./node_modules/is-buffer/index.js ***!
  \*****************************************/
/*! no static exports found */function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},"./node_modules/isarray/index.js":
/*!***************************************!*\
  !*** ./node_modules/isarray/index.js ***!
  \***************************************/
/*! no static exports found */function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},"./node_modules/mouse-change/mouse-listen.js":
/*!***************************************************!*\
  !*** ./node_modules/mouse-change/mouse-listen.js ***!
  \***************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){e||(e=t,t=window);var n=0,i=0,o=0,a={shift:!1,alt:!1,control:!1,meta:!1},u=!1;function s(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==a.alt,a.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==a.shift,a.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==a.control,a.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==a.meta,a.meta=!!t.metaKey),e}function l(t,u){var l=r.x(u),f=r.y(u);"buttons"in u&&(t=0|u.buttons),(t!==n||l!==i||f!==o||s(u))&&(n=0|t,i=l||0,o=f||0,e&&e(n,i,o,a))}function f(t){l(0,t)}function c(){(n||i||o||a.shift||a.alt||a.meta||a.control)&&(i=o=0,n=0,a.shift=a.alt=a.control=a.meta=!1,e&&e(0,0,0,a))}function h(t){s(t)&&e&&e(n,i,o,a)}function p(t){0===r.buttons(t)?l(0,t):l(n,t)}function d(t){l(n|r.buttons(t),t)}function m(t){l(n&~r.buttons(t),t)}function g(){u||(u=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",f),t.addEventListener("mouseenter",f),t.addEventListener("mouseout",f),t.addEventListener("mouseover",f),t.addEventListener("blur",c),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",c),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}g();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return u},set:function(e){e?g():u&&(u=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",f),t.removeEventListener("mouseenter",f),t.removeEventListener("mouseout",f),t.removeEventListener("mouseover",f),t.removeEventListener("blur",c),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",c),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h)))},enumerable:!0},buttons:{get:function(){return n},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return o},enumerable:!0},mods:{get:function(){return a},enumerable:!0}}),v};var r=n(/*! mouse-event */"./node_modules/mouse-event/mouse.js")},"./node_modules/mouse-event-offset/index.js":
/*!**************************************************!*\
  !*** ./node_modules/mouse-event-offset/index.js ***!
  \**************************************************/
/*! no static exports found */function(t,e){var n={left:0,top:0};t.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,o=t.clientY||0,a=function(t){return t===window||t===document||t===document.body?n:t.getBoundingClientRect()}(e);return r[0]=i-a.left,r[1]=o-a.top,r}},"./node_modules/mouse-event/mouse.js":
/*!*******************************************!*\
  !*** ./node_modules/mouse-event/mouse.js ***!
  \*******************************************/
/*! no static exports found */function(t,e,n){"use strict";function r(t){return t.target||t.srcElement||window}e.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<<e-1}else if("button"in t){var e;if(1===(e=t.button))return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0},e.element=r,e.x=function(t){if("object"==typeof t){if("offsetX"in t)return t.offsetX;var e=r(t).getBoundingClientRect();return t.clientX-e.left}return 0},e.y=function(t){if("object"==typeof t){if("offsetY"in t)return t.offsetY;var e=r(t).getBoundingClientRect();return t.clientY-e.top}return 0}},"./node_modules/ndarray-extract-contour/contour.js":
/*!*********************************************************!*\
  !*** ./node_modules/ndarray-extract-contour/contour.js ***!
  \*********************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! typedarray-pool */"./node_modules/typedarray-pool/pool.js");function i(t){return"a"+t}function o(t){return"d"+t}function a(t,e){return"c"+t+"_"+e}function u(t){return"s"+t}function s(t,e){return"t"+t+"_"+e}function l(t){return"o"+t}function f(t){return"x"+t}function c(t){return"p"+t}function h(t,e){return"d"+t+"_"+e}function p(t){return"i"+t}function d(t,e){return"u"+t+"_"+e}function m(t){return"b"+t}function g(t){return"y"+t}function v(t){return"e"+t}function y(t){return"v"+t}t.exports=function(t){function e(t){throw new Error("ndarray-extract-contour: "+t)}"object"!=typeof t&&e("Must specify arguments");var n=t.order;Array.isArray(n)||e("Must specify order");var A=t.arrayArguments||1;A<1&&e("Must have at least one array argument");var z=t.scalarArguments||0;z<0&&e("Scalar arg count must be > 0");"function"!=typeof t.vertex&&e("Must specify vertex creation function");"function"!=typeof t.cell&&e("Must specify cell creation function");"function"!=typeof t.phase&&e("Must specify phase function");for(var E=t.getters||[],S=new Array(A),T=0;T<A;++T)E.indexOf(T)>=0?S[T]=!0:S[T]=!1;return function(t,e,n,A,z,E){var S=E.length,T=z.length;if(T<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var C="extractContour"+z.join("_"),P=[],O=[],N=[],I=0;I<S;++I)N.push(i(I));for(var I=0;I<A;++I)N.push(f(I));for(var I=0;I<T;++I)O.push(u(I)+"="+i(0)+".shape["+I+"]|0");for(var I=0;I<S;++I){O.push(o(I)+"="+i(I)+".data",l(I)+"="+i(I)+".offset|0");for(var D=0;D<T;++D)O.push(s(I,D)+"="+i(I)+".stride["+D+"]|0")}for(var I=0;I<S;++I){O.push(c(I)+"="+l(I)),O.push(a(I,0));for(var D=1;D<1<<T;++D){for(var L=[],R=0;R<T;++R)D&1<<R&&L.push("-"+s(I,R));O.push(h(I,D)+"=("+L.join("")+")|0"),O.push(a(I,D)+"=0")}}for(var I=0;I<S;++I)for(var D=0;D<T;++D){var B=[s(I,z[D])];D>0&&B.push(s(I,z[D-1])+"*"+u(z[D-1])),O.push(d(I,z[D])+"=("+B.join("-")+")|0")}for(var I=0;I<T;++I)O.push(p(I)+"=0");O.push(x+"=0");for(var F=["2"],I=T-2;I>=0;--I)F.push(u(z[I]));O.push(w+"=("+F.join("*")+")|0",b+"=mallocUint32("+w+")",_+"=mallocUint32("+w+")",M+"=0"),O.push(m(0)+"=0");for(var D=1;D<1<<T;++D){for(var q=[],U=[],R=0;R<T;++R)D&1<<R&&(0===U.length?q.push("1"):q.unshift(U.join("*"))),U.push(u(z[R]));var Y="";q[0].indexOf(u(z[T-2]))<0&&(Y="-");var H=k(T,D,z);O.push(v(H)+"=(-"+q.join("-")+")|0",g(H)+"=("+Y+q.join("-")+")|0",m(H)+"=0")}function V(t,e){P.push("for(",p(z[t]),"=",e,";",p(z[t]),"<",u(z[t]),";","++",p(z[t]),"){")}function Z(t){for(var e=0;e<S;++e)P.push(c(e),"+=",d(e,z[t]),";");P.push("}")}function W(){for(var t=1;t<1<<T;++t)P.push(j,"=",v(t),";",v(t),"=",g(t),";",g(t),"=",j,";")}O.push(y(0)+"=0",j+"=0"),function t(e,n){if(e<0)return void function(t){for(var e=0;e<S;++e)E[e]?P.push(a(e,0),"=",o(e),".get(",c(e),");"):P.push(a(e,0),"=",o(e),"[",c(e),"];");for(var n=[],e=0;e<S;++e)n.push(a(e,0));for(var e=0;e<A;++e)n.push(f(e));P.push(m(0),"=",b,"[",M,"]=phase(",n.join(),");");for(var r=1;r<1<<T;++r)P.push(m(r),"=",b,"[",M,"+",v(r),"];");for(var i=[],r=1;r<1<<T;++r)i.push("("+m(0)+"!=="+m(r)+")");P.push("if(",i.join("||"),"){");for(var u=[],e=0;e<T;++e)u.push(p(e));for(var e=0;e<S;++e){u.push(a(e,0));for(var r=1;r<1<<T;++r)E[e]?P.push(a(e,r),"=",o(e),".get(",c(e),"+",h(e,r),");"):P.push(a(e,r),"=",o(e),"[",c(e),"+",h(e,r),"];"),u.push(a(e,r))}for(var e=0;e<1<<T;++e)u.push(m(e));for(var e=0;e<A;++e)u.push(f(e));P.push("vertex(",u.join(),");",y(0),"=",_,"[",M,"]=",x,"++;");for(var s=(1<<T)-1,l=m(s),r=0;r<T;++r)if(0==(t&~(1<<r))){for(var d=s^1<<r,g=m(d),w=[],j=d;j>0;j=j-1&d)w.push(_+"["+M+"+"+v(j)+"]");w.push(y(0));for(var j=0;j<S;++j)1&r?w.push(a(j,s),a(j,d)):w.push(a(j,d),a(j,s));1&r?w.push(l,g):w.push(g,l);for(var j=0;j<A;++j)w.push(f(j));P.push("if(",l,"!==",g,"){","face(",w.join(),")}")}P.push("}",M,"+=1;")}(n);!function(t){for(var e=t-1;e>=0;--e)V(e,0);for(var n=[],e=0;e<S;++e)E[e]?n.push(o(e)+".get("+c(e)+")"):n.push(o(e)+"["+c(e)+"]");for(var e=0;e<A;++e)n.push(f(e));P.push(b,"[",M,"++]=phase(",n.join(),");");for(var e=0;e<t;++e)Z(e);for(var r=0;r<S;++r)P.push(c(r),"+=",d(r,z[t]),";")}(e);P.push("if(",u(z[e]),">0){",p(z[e]),"=1;");t(e-1,n|1<<z[e]);for(var r=0;r<S;++r)P.push(c(r),"+=",d(r,z[e]),";");e===T-1&&(P.push(M,"=0;"),W());V(e,2);t(e-1,n);e===T-1&&(P.push("if(",p(z[T-1]),"&1){",M,"=0;}"),W());Z(e);P.push("}")}(T-1,0),P.push("freeUint32(",_,");freeUint32(",b,");");var Q=["'use strict';","function ",C,"(",N.join(),"){","var ",O.join(),";",P.join(""),"}","return ",C].join("");return new Function("vertex","face","phase","mallocUint32","freeUint32",Q)(t,e,n,r.mallocUint32,r.freeUint32)}(t.vertex,t.cell,t.phase,z,n,S)};var _="V",b="P",x="N",w="Q",M="X",j="T";function k(t,e,n){for(var r=0,i=0;i<t;++i)e&1<<i&&(r|=1<<n[i]);return r}},"./node_modules/ndarray/ndarray.js":
/*!*****************************************!*\
  !*** ./node_modules/ndarray/ndarray.js ***!
  \*****************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! iota-array */"./node_modules/iota-array/iota.js"),i=n(/*! is-buffer */"./node_modules/is-buffer/index.js"),o="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function u(){var t,e=this.stride,n=new Array(e.length);for(t=0;t<n.length;++t)n[t]=[Math.abs(e[t]),t];n.sort(a);var r=new Array(n.length);for(t=0;t<r.length;++t)r[t]=n[t][1];return r}function s(t,e){var n=["View",e,"d",t].join("");e<0&&(n="View_Nil"+t);var i="generic"===t;if(-1===e){var o="function "+n+"(a){this.data=a;};var proto="+n+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+n+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+n+"(a){return new "+n+"(a);}";return new Function(o)()}if(0===e){o="function "+n+"(a,d) {this.data = a;this.offset = d};var proto="+n+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+n+"_copy() {return new "+n+"(this.data,this.offset)};proto.pick=function "+n+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+n+"_get(){return "+(i?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+n+"_set(v){return "+(i?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+n+"(a,b,c,d){return new "+n+"(a,d)}";return new Function("TrivialArray",o)(l[t][0])}o=["'use strict'"];var a=r(e),s=a.map(function(t){return"i"+t}),f="this.offset+"+a.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),c=a.map(function(t){return"b"+t}).join(","),h=a.map(function(t){return"c"+t}).join(",");o.push("function "+n+"(a,"+c+","+h+",d){this.data=a","this.shape=["+c+"]","this.stride=["+h+"]","this.offset=d|0}","var proto="+n+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),o.push("Object.defineProperty(proto,'size',{get:function "+n+"_size(){return "+a.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),e<4?(o.push("function "+n+"_order(){"),2===e?o.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+n+"_set("+s.join(",")+",v){"),i?o.push("return this.data.set("+f+",v)}"):o.push("return this.data["+f+"]=v}"),o.push("proto.get=function "+n+"_get("+s.join(",")+"){"),i?o.push("return this.data.get("+f+")}"):o.push("return this.data["+f+"]}"),o.push("proto.index=function "+n+"_index(",s.join(),"){return "+f+"}"),o.push("proto.hi=function "+n+"_hi("+s.join(",")+"){return new "+n+"(this.data,"+a.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+a.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=a.map(function(t){return"a"+t+"=this.shape["+t+"]"}),d=a.map(function(t){return"c"+t+"=this.stride["+t+"]"});o.push("proto.lo=function "+n+"_lo("+s.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+d.join(","));for(var m=0;m<e;++m)o.push("if(typeof i"+m+"==='number'&&i"+m+">=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");o.push("return new "+n+"(this.data,"+a.map(function(t){return"a"+t}).join(",")+","+a.map(function(t){return"c"+t}).join(",")+",b)}"),o.push("proto.step=function "+n+"_step("+s.join(",")+"){var "+a.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+a.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m<e;++m)o.push("if(typeof i"+m+"==='number'){d=i"+m+"|0;if(d<0){c+=b"+m+"*(a"+m+"-1);a"+m+"=ceil(-a"+m+"/d)}else{a"+m+"=ceil(a"+m+"/d)}b"+m+"*=d}");o.push("return new "+n+"(this.data,"+a.map(function(t){return"a"+t}).join(",")+","+a.map(function(t){return"b"+t}).join(",")+",c)}");var g=new Array(e),v=new Array(e);for(m=0;m<e;++m)g[m]="a[i"+m+"]",v[m]="b[i"+m+"]";o.push("proto.transpose=function "+n+"_transpose("+s+"){"+s.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+n+"(this.data,"+g.join(",")+","+v.join(",")+",this.offset)}"),o.push("proto.pick=function "+n+"_pick("+s+"){var a=[],b=[],c=this.offset");for(m=0;m<e;++m)o.push("if(typeof i"+m+"==='number'&&i"+m+">=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+a.map(function(t){return"shape["+t+"]"}).join(",")+","+a.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(l[t],u)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};t.exports=function(t,e,n,r){if(void 0===t)return(0,l.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var a=e.length;if(void 0===n){n=new Array(a);for(var u=a-1,f=1;u>=0;--u)n[u]=f,f*=e[u]}if(void 0===r)for(r=0,u=0;u<a;++u)n[u]<0&&(r-=(e[u]-1)*n[u]);for(var c=function(t){if(i(t))return"buffer";if(o)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}(t),h=l[c];h.length<=a+1;)h.push(s(c,h.length-1));return(0,h[a+1])(t,e,n,r)}},"./node_modules/nextafter/nextafter.js":
/*!*********************************************!*\
  !*** ./node_modules/nextafter/nextafter.js ***!
  \*********************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! double-bits */"./node_modules/double-bits/double.js"),i=Math.pow(2,-1074),o=-1>>>0;t.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var n=r.hi(t),a=r.lo(t);e>t==t>0?a===o?(n+=1,a=0):a+=1:0===a?(a=o,n-=1):a-=1;return r.pack(a,n)}},"./node_modules/permutation-parity/permutation-sign.js":
/*!*************************************************************!*\
  !*** ./node_modules/permutation-parity/permutation-sign.js ***!
  \*************************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t){var e=t.length;if(e<r){for(var n=1,o=0;o<e;++o)for(var a=0;a<o;++a)if(t[o]<t[a])n=-n;else if(t[o]===t[a])return 0;return n}for(var u=i.mallocUint8(e),o=0;o<e;++o)u[o]=0;for(var n=1,o=0;o<e;++o)if(!u[o]){var s=1;u[o]=1;for(var a=t[o];a!==o;a=t[a]){if(u[a])return i.freeUint8(u),0;s+=1,u[a]=1}1&s||(n=-n)}return i.freeUint8(u),n};var r=32,i=n(/*! typedarray-pool */"./node_modules/typedarray-pool/pool.js")},"./node_modules/permutation-rank/index.js":
/*!************************************************!*\
  !*** ./node_modules/permutation-rank/index.js ***!
  \************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! typedarray-pool */"./node_modules/typedarray-pool/pool.js"),i=n(/*! invert-permutation */"./node_modules/invert-permutation/index.js");e.rank=function(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var n,o,a,u=r.mallocUint32(e),s=r.mallocUint32(e),l=0;for(i(t,s),a=0;a<e;++a)u[a]=t[a];for(a=e-1;a>0;--a)o=s[a],n=u[a],u[a]=u[o],u[o]=n,s[a]=s[n],s[n]=o,l=(l+n)*a;return r.freeUint32(s),r.freeUint32(u),l},e.unrank=function(t,e,n){switch(t){case 0:return n||[];case 1:return n?(n[0]=0,n):[0];case 2:return n?(e?(n[0]=0,n[1]=1):(n[0]=1,n[1]=0),n):e?[0,1]:[1,0]}var r,i,o,a=1;for((n=n||new Array(t))[0]=0,o=1;o<t;++o)n[o]=o,a=a*o|0;for(o=t-1;o>0;--o)e=e-(r=e/a|0)*a|0,a=a/o|0,i=0|n[o],n[o]=0|n[r],n[r]=0|i;return n}},"./node_modules/planar-dual/loops.js":
/*!*******************************************!*\
  !*** ./node_modules/planar-dual/loops.js ***!
  \*******************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){for(var n=0|e.length,i=t.length,o=[new Array(n),new Array(n)],a=0;a<n;++a)o[0][a]=[],o[1][a]=[];for(var a=0;a<i;++a){var u=t[a];o[0][u[0]].push(u),o[1][u[1]].push(u)}for(var s=[],a=0;a<n;++a)o[0][a].length+o[1][a].length===0&&s.push([a]);function l(t,e){var n=o[e][t[e]];n.splice(n.indexOf(t),1)}function f(t,n,i){for(var a,u,s,f=0;f<2;++f)if(o[f][n].length>0){a=o[f][n][0],s=f;break}u=a[1^s];for(var c=0;c<2;++c)for(var h=o[c][n],p=0;p<h.length;++p){var d=h[p],m=d[1^c],g=r(e[t],e[n],e[u],e[m]);g>0&&(a=d,u=m,s=c)}return i?u:(a&&l(a,s),u)}function c(t,n){var i=o[n][t][0],a=[t];l(i,n);for(var u=i[1^n];;){for(;u!==t;)a.push(u),u=f(a[a.length-2],u,!1);if(o[0][t].length+o[1][t].length===0)break;var s=a[a.length-1],c=t,h=a[1],p=f(s,c,!0);if(r(e[s],e[c],e[h],e[p])<0)break;a.push(t),u=f(s,c)}return a}function h(t,e){return e[1]===e[e.length-1]}for(var a=0;a<n;++a)for(var p=0;p<2;++p){for(var d=[];o[p][a].length>0;){o[0][a].length;var m=c(a,p);h(d,m)?d.push.apply(d,m):(d.length>0&&s.push(d),d=m)}d.length>0&&s.push(d)}return s};var r=n(/*! compare-angle */"./node_modules/compare-angle/cmpangle.js")},"./node_modules/planar-graph-to-polyline/lib/trim-leaves.js":
/*!******************************************************************!*\
  !*** ./node_modules/planar-graph-to-polyline/lib/trim-leaves.js ***!
  \******************************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){for(var n=r(t,e.length),i=new Array(e.length),o=new Array(e.length),a=[],u=0;u<e.length;++u){var s=n[u].length;o[u]=s,i[u]=!0,s<=1&&a.push(u)}for(;a.length>0;){var l=a.pop();i[l]=!1;for(var f=n[l],u=0;u<f.length;++u){var c=f[u];0==--o[c]&&a.push(c)}}for(var h=new Array(e.length),p=[],u=0;u<e.length;++u)if(i[u]){var l=p.length;h[u]=l,p.push(e[u])}else h[u]=-1;for(var d=[],u=0;u<t.length;++u){var m=t[u];i[m[0]]&&i[m[1]]&&d.push([h[m[0]],h[m[1]]])}return[d,p]};var r=n(/*! edges-to-adjacency-list */"./node_modules/edges-to-adjacency-list/e2a.js")},"./node_modules/planar-graph-to-polyline/pg2pl.js":
/*!********************************************************!*\
  !*** ./node_modules/planar-graph-to-polyline/pg2pl.js ***!
  \********************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){var n=l(t,e);t=n[0];for(var c=(e=n[1]).length,h=(t.length,r(t,e.length)),p=0;p<c;++p)if(h[p].length%2==1)throw new Error("planar-graph-to-polyline: graph must be manifold");var d=i(t,e);for(var m=(d=d.filter(function(t){for(var n=t.length,r=[0],i=0;i<n;++i){var o=e[t[i]],s=e[t[(i+1)%n]],l=a(-o[0],o[1]),f=a(-o[0],s[1]),c=a(s[0],o[1]),h=a(s[0],s[1]);r=u(r,u(u(l,f),u(c,h)))}return r[r.length-1]>0})).length,g=new Array(m),v=new Array(m),p=0;p<m;++p){g[p]=p;var y=new Array(m),_=d[p].map(function(t){return e[t]}),b=o([_]),x=0;t:for(var w=0;w<m;++w)if(y[w]=0,p!==w){for(var M=d[w],j=M.length,k=0;k<j;++k){var A=b(e[M[k]]);if(0!==A){A<0&&(y[w]=1,x+=1);continue t}}y[w]=1,x+=1}v[p]=[x,p,y]}v.sort(function(t,e){return e[0]-t[0]});for(var p=0;p<m;++p)for(var y=v[p],z=y[1],E=y[2],w=0;w<m;++w)E[w]&&(g[w]=z);for(var S=function(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=[];return e}(m),p=0;p<m;++p)S[p].push(g[p]),S[g[p]].push(p);for(var T={},C=f(c,!1),p=0;p<m;++p)for(var M=d[p],j=M.length,w=0;w<j;++w){var P=M[w],O=M[(w+1)%j],N=Math.min(P,O)+":"+Math.max(P,O);if(N in T){var I=T[N];S[I].push(p),S[p].push(I),C[P]=C[O]=!0}else T[N]=p}function D(t){for(var e=t.length,n=0;n<e;++n)if(!C[t[n]])return!1;return!0}for(var L=[],R=f(m,-1),p=0;p<m;++p)g[p]!==p||D(d[p])?R[p]=-1:(L.push(p),R[p]=0);var n=[];for(;L.length>0;){var B=L.pop(),F=S[B];s(F,function(t,e){return t-e});var q,U=F.length,Y=R[B];if(0===Y){var M=d[B];q=[M]}for(var p=0;p<U;++p){var H=F[p];if(!(R[H]>=0)&&(R[H]=1^Y,L.push(H),0===Y)){var M=d[H];D(M)||(M.reverse(),q.push(M))}}0===Y&&n.push(q)}return n};var r=n(/*! edges-to-adjacency-list */"./node_modules/edges-to-adjacency-list/e2a.js"),i=n(/*! planar-dual */"./node_modules/planar-dual/loops.js"),o=n(/*! point-in-big-polygon */"./node_modules/point-in-big-polygon/pnp-big.js"),a=n(/*! two-product */"./node_modules/two-product/two-product.js"),u=n(/*! robust-sum */"./node_modules/robust-sum/robust-sum.js"),s=n(/*! uniq */"./node_modules/uniq/uniq.js"),l=n(/*! ./lib/trim-leaves */"./node_modules/planar-graph-to-polyline/lib/trim-leaves.js");function f(t,e){for(var n=new Array(t),r=0;r<t;++r)n[r]=e;return n}},"./node_modules/point-in-big-polygon/node_modules/binary-search-bounds/search-bounds.js":
/*!**********************************************************************************************!*\
  !*** ./node_modules/point-in-big-polygon/node_modules/binary-search-bounds/search-bounds.js ***!
  \**********************************************************************************************/
/*! no static exports found */function(t,e,n){"use strict";function r(t,e,n,r,i,o){var a=["function ",t,"(a,l,h,",r.join(","),"){",o?"":"var i=",n?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return o?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),n?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),o?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,n,i){return new Function([r("A","x"+t+"y",e,["y"],!1,i),r("B","x"+t+"y",e,["y"],!0,i),r("P","c(x,y)"+t+"0",e,["y","c"],!1,i),r("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",n,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",n].join(""))()}t.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},"./node_modules/point-in-big-polygon/pnp-big.js":
/*!******************************************************!*\
  !*** ./node_modules/point-in-big-polygon/pnp-big.js ***!
  \******************************************************/
/*! no static exports found */function(t,e,n){t.exports=function(t){for(var e=t.length,n=[],o=[],u=0;u<e;++u)for(var f=t[u],c=f.length,h=c-1,p=0;p<c;h=p++){var d=f[h],m=f[p];d[0]===m[0]?o.push([d,m]):n.push([d,m])}if(0===n.length)return 0===o.length?l:function(t){return function(e){return t(e[0],e[1])?0:1}}(s(o));var g=i(n),v=function(t,e){return function(n){var i=a.le(e,n[0]);if(i<0)return 1;var o=t[i];if(!o){if(!(i>0&&e[i]===n[0]))return 1;o=t[i-1]}for(var u=1;o;){var s=o.key,l=r(n,s[0],s[1]);if(s[0][0]<s[1][0])if(l<0)o=o.left;else{if(!(l>0))return 0;u=-1,o=o.right}else if(l>0)o=o.left;else{if(!(l<0))return 0;u=1,o=o.right}}return u}}(g.slabs,g.coordinates);return 0===o.length?v:function(t,e){return function(n){return t(n[0],n[1])?0:e(n)}}(s(o),v)};var r=n(/*! robust-orientation */"./node_modules/robust-orientation/orientation.js")[3],i=n(/*! slab-decomposition */"./node_modules/slab-decomposition/slabs.js"),o=n(/*! interval-tree-1d */"./node_modules/interval-tree-1d/interval-tree.js"),a=n(/*! binary-search-bounds */"./node_modules/point-in-big-polygon/node_modules/binary-search-bounds/search-bounds.js");function u(){return!0}function s(t){for(var e={},n=0;n<t.length;++n){var r=t[n],i=r[0][0],a=r[0][1],s=r[1][1],l=[Math.min(a,s),Math.max(a,s)];i in e?e[i].push(l):e[i]=[l]}var f={},c=Object.keys(e);for(n=0;n<c.length;++n){var h=e[c[n]];f[c[n]]=o(h)}return function(t){return function(e,n){var r=t[e];return!!r&&!!r.queryPoint(n,u)}}(f)}function l(t){return 1}},"./node_modules/rat-vec/add.js":
/*!*************************************!*\
  !*** ./node_modules/rat-vec/add.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! big-rat/add */"./node_modules/big-rat/add.js");t.exports=function(t,e){for(var n=t.length,i=new Array(n),o=0;o<n;++o)i[o]=r(t[o],e[o]);return i}},"./node_modules/rat-vec/index.js":
/*!***************************************!*\
  !*** ./node_modules/rat-vec/index.js ***!
  \***************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t){for(var e=new Array(t.length),n=0;n<t.length;++n)e[n]=r(t[n]);return e};var r=n(/*! big-rat */"./node_modules/big-rat/index.js")},"./node_modules/rat-vec/muls.js":
/*!**************************************!*\
  !*** ./node_modules/rat-vec/muls.js ***!
  \**************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! big-rat */"./node_modules/big-rat/index.js"),i=n(/*! big-rat/mul */"./node_modules/big-rat/mul.js");t.exports=function(t,e){for(var n=r(e),o=t.length,a=new Array(o),u=0;u<o;++u)a[u]=i(t[u],n);return a}},"./node_modules/rat-vec/sub.js":
/*!*************************************!*\
  !*** ./node_modules/rat-vec/sub.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! big-rat/sub */"./node_modules/big-rat/sub.js");t.exports=function(t,e){for(var n=t.length,i=new Array(n),o=0;o<n;++o)i[o]=r(t[o],e[o]);return i}},"./node_modules/regl/dist/regl.js":
/*!****************************************!*\
  !*** ./node_modules/regl/dist/regl.js ***!
  \****************************************/
/*! no static exports found */function(t,e,n){t.exports=function(){function t(t,e){this.id=q++,this.type=t,this.data=e}function e(t){return"["+function t(e){if(0===e.length)return[];var n=e.charAt(0),r=e.charAt(e.length-1);if(1<e.length&&n===r&&('"'===n||"'"===n))return['"'+e.substr(1,e.length-2).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];if(n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e))return t(e.substr(0,n.index)).concat(t(n[1])).concat(t(e.substr(n.index+n[0].length)));if(1===(n=e.split(".")).length)return['"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];for(e=[],r=0;r<n.length;++r)e=e.concat(t(n[r]));return e}(t).join("][")+"]"}function n(t){return"string"==typeof t?t.split():t}function r(t){return"string"==typeof t?document.querySelector(t):t}function i(t){var e,i,o,a,u=t||{};t={};var s=[],l=[],f="undefined"==typeof window?1:window.devicePixelRatio,c=!1,h=function(t){},p=function(){};if("string"==typeof u?e=document.querySelector(u):"object"==typeof u&&("string"==typeof u.nodeName&&"function"==typeof u.appendChild&&"function"==typeof u.getBoundingClientRect?e=u:"function"==typeof u.drawArrays||"function"==typeof u.drawElements?o=(a=u).canvas:("gl"in u?a=u.gl:"canvas"in u?o=r(u.canvas):"container"in u&&(i=r(u.container)),"attributes"in u&&(t=u.attributes),"extensions"in u&&(s=n(u.extensions)),"optionalExtensions"in u&&(l=n(u.optionalExtensions)),"onDone"in u&&(h=u.onDone),"profile"in u&&(c=!!u.profile),"pixelRatio"in u&&(f=+u.pixelRatio))),e&&("canvas"===e.nodeName.toLowerCase()?o=e:i=e),!a){if(!o){if(!(e=function(t,e,n){function r(){var e=window.innerWidth,r=window.innerHeight;t!==document.body&&(r=t.getBoundingClientRect(),e=r.right-r.left,r=r.bottom-r.top),i.width=n*e,i.height=n*r,F(i.style,{width:e+"px",height:r+"px"})}var i=document.createElement("canvas");return F(i.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(i),t===document.body&&(i.style.position="absolute",F(t.style,{margin:0,padding:0})),window.addEventListener("resize",r,!1),r(),{canvas:i,onDestroy:function(){window.removeEventListener("resize",r),t.removeChild(i)}}}(i||document.body,0,f)))return null;o=e.canvas,p=e.onDestroy}a=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(o,t)}return a?{gl:a,canvas:o,container:i,extensions:s,optionalExtensions:l,pixelRatio:f,profile:c,onDone:h,onDestroy:p}:(p(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function o(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function a(t){var e,n;return e=(65535<t)<<4,e|=n=(255<(t>>>=e))<<3,(e|=n=(15<(t>>>=n))<<2)|(n=(3<(t>>>=n))<<1)|t>>>n>>1}function u(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=n[a(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){n[a(t.byteLength)>>2].push(t)}var n=o(8,function(){return[]});return{alloc:t,free:e,allocType:function(e,n){var r=null;switch(e){case 5120:r=new Int8Array(t(n),0,n);break;case 5121:r=new Uint8Array(t(n),0,n);break;case 5122:r=new Int16Array(t(2*n),0,n);break;case 5123:r=new Uint16Array(t(2*n),0,n);break;case 5124:r=new Int32Array(t(4*n),0,n);break;case 5125:r=new Uint32Array(t(4*n),0,n);break;case 5126:r=new Float32Array(t(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){e(t.buffer)}}}function s(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||W(t.data))}function l(t,e,n,r,i,o){for(var a=0;a<e;++a)for(var u=t[a],s=0;s<n;++s)for(var l=u[s],f=0;f<r;++f)i[o++]=l[f]}function f(t){return 0|G[Object.prototype.toString.call(t)]}function c(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function h(t,e,n,r,i,o,a){for(var u=0,s=0;s<n;++s)for(var l=0;l<r;++l)t[u++]=e[i*s+o*l+a]}function p(t,e,n,r){function i(e){this.id=l++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,n.profile&&(this.stats={size:0})}function o(e,n,r){e.byteLength=n.byteLength,t.bufferData(e.type,n,r)}function a(t,e,n,r,i,a){if(t.usage=n,Array.isArray(e)){if(t.dtype=r||5126,0<e.length)if(Array.isArray(e[0])){i=tt(e);for(var u=r=1;u<i.length;++u)r*=i[u];t.dimension=r,e=J(e,i,t.dtype),o(t,e,n),a?t.persistentData=e:V.freeType(e)}else"number"==typeof e[0]?(t.dimension=i,c(i=V.allocType(t.dtype,e.length),e),o(t,i,n),a?t.persistentData=i:V.freeType(i)):W(e[0])&&(t.dimension=e[0].length,t.dtype=r||f(e[0])||5126,e=J(e,[e.length,e[0].length],t.dtype),o(t,e,n),a?t.persistentData=e:V.freeType(e))}else if(W(e))t.dtype=r||f(e),t.dimension=i,o(t,e,n),a&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(s(e)){i=e.shape;var l=e.stride,u=e.offset,p=0,d=0,m=0,g=0;1===i.length?(p=i[0],d=1,m=l[0],g=0):2===i.length&&(p=i[0],d=i[1],m=l[0],g=l[1]),t.dtype=r||f(e.data)||5126,t.dimension=d,h(i=V.allocType(t.dtype,p*d),e.data,p,d,m,g,u),o(t,i,n),a?t.persistentData=i:V.freeType(i)}}function u(n){e.bufferCount--;for(var i=0;i<r.state.length;++i){var o=r.state[i];o.buffer===n&&(t.disableVertexAttribArray(i),o.buffer=null)}t.deleteBuffer(n.buffer),n.buffer=null,delete p[n.id]}var l=0,p={};i.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},i.prototype.destroy=function(){u(this)};var d=[];return n.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(p).forEach(function(e){t+=p[e].stats.size}),t}),{create:function(r,o,l,d){function m(e){var r=35044,i=null,o=0,u=0,l=1;return Array.isArray(e)||W(e)||s(e)?i=e:"number"==typeof e?o=0|e:e&&("data"in e&&(i=e.data),"usage"in e&&(r=$[e.usage]),"type"in e&&(u=K[e.type]),"dimension"in e&&(l=0|e.dimension),"length"in e&&(o=0|e.length)),g.bind(),i?a(g,i,r,u,l,d):(o&&t.bufferData(g.type,o,r),g.dtype=u||5121,g.usage=r,g.dimension=l,g.byteLength=o),n.profile&&(g.stats.size=g.byteLength*et[g.dtype]),m}e.bufferCount++;var g=new i(o);return p[g.id]=g,l||m(r),m._reglType="buffer",m._buffer=g,m.subdata=function(e,n){var r,i=0|(n||0);if(g.bind(),W(e))t.bufferSubData(g.type,i,e);else if(Array.isArray(e)){if(0<e.length)if("number"==typeof e[0]){var o=V.allocType(g.dtype,e.length);c(o,e),t.bufferSubData(g.type,i,o),V.freeType(o)}else(Array.isArray(e[0])||W(e[0]))&&(r=tt(e),o=J(e,r,g.dtype),t.bufferSubData(g.type,i,o),V.freeType(o))}else if(s(e)){r=e.shape;var a=e.stride,u=o=0,l=0,p=0;1===r.length?(o=r[0],u=1,l=a[0],p=0):2===r.length&&(o=r[0],u=r[1],l=a[0],p=a[1]),r=Array.isArray(e.data)?g.dtype:f(e.data),h(r=V.allocType(r,o*u),e.data,o,u,l,p,e.offset),t.bufferSubData(g.type,i,r),V.freeType(r)}return m},n.profile&&(m.stats=g.stats),m.destroy=function(){u(g)},m},createStream:function(t,e){var n=d.pop();return n||(n=new i(t)),n.bind(),a(n,e,35040,0,1,!1),n},destroyStream:function(t){d.push(t)},clear:function(){Q(p).forEach(u),d.forEach(u)},getBuffer:function(t){return t&&t._buffer instanceof i?t._buffer:null},restore:function(){Q(p).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})},_initBuffer:a}}function d(t,e,n,r){function i(t){this.id=l++,u[this.id]=this,this.buffer=t,this.primType=4,this.type=this.vertCount=0}function o(r,i,o,a,u,l,f){if(r.buffer.bind(),i){var c=f;f||W(i)&&(!s(i)||W(i.data))||(c=e.oes_element_index_uint?5125:5123),n._initBuffer(r.buffer,i,o,c,3)}else t.bufferData(34963,l,o),r.buffer.dtype=c||5121,r.buffer.usage=o,r.buffer.dimension=3,r.buffer.byteLength=l;if(c=f,!f){switch(r.buffer.dtype){case 5121:case 5120:c=5121;break;case 5123:case 5122:c=5123;break;case 5125:case 5124:c=5125}r.buffer.dtype=c}r.type=c,0>(i=u)&&(i=r.buffer.byteLength,5123===c?i>>=1:5125===c&&(i>>=2)),r.vertCount=i,i=a,0>a&&(i=4,1===(a=r.buffer.dimension)&&(i=0),2===a&&(i=1),3===a&&(i=4)),r.primType=i}function a(t){r.elementsCount--,delete u[t.id],t.buffer.destroy(),t.buffer=null}var u={},l=0,f={uint8:5121,uint16:5123};e.oes_element_index_uint&&(f.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var c=[];return{create:function(t,e){function u(t){if(t)if("number"==typeof t)l(t),c.primType=4,c.vertCount=0|t,c.type=5121;else{var e=null,n=35044,r=-1,i=-1,a=0,h=0;Array.isArray(t)||W(t)||s(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(n=$[t.usage]),"primitive"in t&&(r=nt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=f[t.type]),"length"in t?a=0|t.length:(a=i,5123===h||5122===h?a*=2:5125!==h&&5124!==h||(a*=4))),o(c,e,n,r,i,a,h)}else l(),c.primType=4,c.vertCount=0,c.type=5121;return u}var l=n.create(null,34963,!0),c=new i(l._buffer);return r.elementsCount++,u(t),u._reglType="elements",u._elements=c,u.subdata=function(t,e){return l.subdata(t,e),u},u.destroy=function(){a(c)},u},createStream:function(t){var e=c.pop();return e||(e=new i(n.create(null,34963,!0,!1)._buffer)),o(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){Q(u).forEach(a)}}}function m(t){for(var e=V.allocType(5123,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(1/0===t[n])e[n]=31744;else if(-1/0===t[n])e[n]=64512;else{rt[0]=t[n];var r=it[0],i=r>>>31<<15,o=(r<<1>>>24)-127,r=r>>13&1023;e[n]=-24>o?i:-14>o?i+(r+1024>>-14-o):15<o?i+31744:i+(o+15<<10)+r}return e}function g(t){return Array.isArray(t)||W(t)}function v(t){return"[object "+t+"]"}function y(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function _(t){return!(!Array.isArray(t)||0===t.length||!g(t[0]))}function b(t){return Object.prototype.toString.call(t)}function x(t){if(!t)return!1;var e=b(t);return 0<=pt.indexOf(e)||y(t)||_(t)||s(t)}function w(t,e){36193===t.type?(t.data=m(e),V.freeType(e)):t.data=e}function M(t,e,n,r,i,o){if(t=void 0!==mt[t]?mt[t]:ut[t]*dt[e],o&&(t*=6),i){for(r=0;1<=n;)r+=t*n*n,n/=2;return r}return t*n*r}function j(t,e,n,r,i,o,a){function u(){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 l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function f(t,e){if("object"==typeof e&&e){"premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=U[e.colorSpace]),"type"in e&&(t.type=Y[e.type]);var n=t.width,r=t.height,i=t.channels,o=!1;"shape"in e?(n=e.shape[0],r=e.shape[1],3===e.shape.length&&(i=e.shape[2],o=!0)):("radius"in e&&(n=r=e.radius),"width"in e&&(n=e.width),"height"in e&&(r=e.height),"channels"in e&&(i=e.channels,o=!0)),t.width=0|n,t.height=0|r,t.channels=0|i,n=!1,"format"in e&&(n=e.format,r=t.internalformat=H[n],t.format=it[r],n in Y&&!("type"in e)&&(t.type=Y[n]),n in Z&&(t.compressed=!0),n=!0),!o&&n?t.channels=ut[t.format]:o&&!n&&t.channels!==at[t.format]&&(t.format=t.internalformat=at[t.channels])}}function c(e){t.pixelStorei(37440,e.flipY),t.pixelStorei(37441,e.premultiplyAlpha),t.pixelStorei(37443,e.colorSpace),t.pixelStorei(3317,e.unpackAlignment)}function h(){u.call(this),this.yOffset=this.xOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function p(t,e){var n=null;if(x(e)?n=e:e&&(f(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),x(e.data)&&(n=e.data)),e.copy){var r=i.viewportWidth,o=i.viewportHeight;t.width=t.width||r-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0}else if(n){if(W(n))t.channels=t.channels||4,t.data=n,"type"in e||5121!==t.type||(t.type=0|G[Object.prototype.toString.call(n)]);else if(y(n)){switch(t.channels=t.channels||4,o=(r=n).length,t.type){case 5121:case 5123:case 5125:case 5126:(o=V.allocType(t.type,o)).set(r),t.data=o;break;case 36193:t.data=m(r)}t.alignment=1,t.needsFree=!0}else if(s(n)){r=n.data,Array.isArray(r)||5121!==t.type||(t.type=0|G[Object.prototype.toString.call(r)]);var a,u,l,c,o=n.shape,h=n.stride;3===o.length?(l=o[2],c=h[2]):c=l=1,a=o[0],u=o[1],o=h[0],h=h[1],t.alignment=1,t.width=a,t.height=u,t.channels=l,t.format=t.internalformat=at[l],t.needsFree=!0,a=c,n=n.offset,l=t.width,c=t.height,u=t.channels;for(var p=V.allocType(36193===t.type?5126:t.type,l*c*u),d=0,v=0;v<c;++v)for(var M=0;M<l;++M)for(var j=0;j<u;++j)p[d++]=r[o*M+h*v+a*j+n];w(t,p)}else if(b(n)===st||b(n)===lt)b(n)===st?t.element=n:t.element=n.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(b(n)===ft)t.element=n,t.width=n.width,t.height=n.height,t.channels=4;else if(b(n)===ct)t.element=n,t.width=n.naturalWidth,t.height=n.naturalHeight,t.channels=4;else if(b(n)===ht)t.element=n,t.width=n.videoWidth,t.height=n.videoHeight,t.channels=4;else if(_(n)){for(r=t.width||n[0].length,o=t.height||n.length,h=t.channels,h=g(n[0][0])?h||n[0][0].length:h||1,a=X.shape(n),l=1,c=0;c<a.length;++c)l*=a[c];l=V.allocType(36193===t.type?5126:t.type,l),X.flatten(n,a,"",l),w(t,l),t.alignment=1,t.width=r,t.height=o,t.channels=h,t.format=t.internalformat=at[h],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4}function d(e,n,i,o,a){var u=e.element,s=e.data,l=e.internalformat,f=e.format,h=e.type,p=e.width,d=e.height;c(e),u?t.texSubImage2D(n,a,i,o,f,h,u):e.compressed?t.compressedTexSubImage2D(n,a,i,o,l,p,d,s):e.needsCopy?(r(),t.copyTexSubImage2D(n,a,i,o,e.xOffset,e.yOffset,p,d)):t.texSubImage2D(n,a,i,o,p,d,f,h,s)}function v(){return pt.pop()||new h}function j(t){t.needsFree&&V.freeType(t.data),h.call(t),pt.push(t)}function k(t,e,n){var r=t.images[0]=v();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function A(t,e){var n=null;if(x(e))l(n=t.images[0]=v(),t),p(n,e),t.mipmask=1;else if(f(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)l(n=t.images[i]=v(),t),n.width>>=i,n.height>>=i,p(n,r[i]),t.mipmask|=1<<i;else l(n=t.images[0]=v(),t),p(n,e),t.mipmask=1;l(t,t.images[0])}function z(e,n){for(var i=e.images,o=0;o<i.length&&i[o];++o){var a=i[o],u=n,s=o,l=a.element,f=a.data,h=a.internalformat,p=a.format,d=a.type,m=a.width,g=a.height,v=a.channels;c(a),l?t.texImage2D(u,s,p,p,d,l):a.compressed?t.compressedTexImage2D(u,s,h,m,g,0,f):a.needsCopy?(r(),t.copyTexImage2D(u,s,p,a.xOffset,a.yOffset,m,g,0)):((a=!f)&&(f=V.zero.allocType(d,m*g*v)),t.texImage2D(u,s,p,m,g,0,p,d,f),a&&f&&V.zero.freeType(f))}}function E(){var t=dt.pop()||new function(){u.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)};u.call(t);for(var e=t.mipmask=0;16>e;++e)t.images[e]=null;return t}function S(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&j(e[n]),e[n]=null;dt.push(t)}function T(){this.magFilter=this.minFilter=9728,this.wrapT=this.wrapS=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function C(t,e){"min"in e&&(t.minFilter=q[e.min],0<=ot.indexOf(t.minFilter)&&!("faces"in e)&&(t.genMipmaps=!0)),"mag"in e&&(t.magFilter=B[e.mag]);var n=t.wrapS,r=t.wrapT;if("wrap"in e){var i=e.wrap;"string"==typeof i?n=r=R[i]:Array.isArray(i)&&(n=R[i[0]],r=R[i[1]])}else"wrapS"in e&&(n=R[e.wrapS]),"wrapT"in e&&(r=R[e.wrapT]);if(t.wrapS=n,t.wrapT=r,"anisotropic"in e&&(t.anisotropic=e.anisotropic),"mipmap"in e){switch(n=!1,typeof e.mipmap){case"string":t.mipmapHint=L[e.mipmap],n=t.genMipmaps=!0;break;case"boolean":n=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,n=!0}!n||"min"in e||(t.minFilter=9984)}}function P(n,r){t.texParameteri(r,10241,n.minFilter),t.texParameteri(r,10240,n.magFilter),t.texParameteri(r,10242,n.wrapS),t.texParameteri(r,10243,n.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(r,34046,n.anisotropic),n.genMipmaps&&(t.hint(33170,n.mipmapHint),t.generateMipmap(r))}function O(e){u.call(this),this.mipmask=0,this.internalformat=6408,this.id=mt++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new T,a.profile&&(this.stats={size:0})}function N(e){t.activeTexture(33984),t.bindTexture(e.target,e.texture)}function I(){var e=yt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(3553,null)}function D(e){var n=e.texture,r=e.unit,i=e.target;0<=r&&(t.activeTexture(33984+r),t.bindTexture(i,null),yt[r]=null),t.deleteTexture(n),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete gt[e.id],o.textureCount--}var L={"don't care":4352,"dont care":4352,nice:4354,fast:4353},R={repeat:10497,clamp:33071,mirror:33648},B={nearest:9728,linear:9729},q=F({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},B),U={none:0,browser:37444},Y={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},H={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},Z={};e.ext_srgb&&(H.srgb=35904,H.srgba=35906),e.oes_texture_float&&(Y.float32=Y.float=5126),e.oes_texture_half_float&&(Y.float16=Y["half float"]=36193),e.webgl_depth_texture&&(F(H,{depth:6402,"depth stencil":34041}),F(Y,{uint16:5123,uint32:5125,"depth stencil":34042})),e.webgl_compressed_texture_s3tc&&F(Z,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),e.webgl_compressed_texture_atc&&F(Z,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),e.webgl_compressed_texture_pvrtc&&F(Z,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),e.webgl_compressed_texture_etc1&&(Z["rgb etc1"]=36196);var K=Array.prototype.slice.call(t.getParameter(34467));Object.keys(Z).forEach(function(t){var e=Z[t];0<=K.indexOf(e)&&(H[t]=e)});var $=Object.keys(H);n.textureFormats=$;var J=[];Object.keys(H).forEach(function(t){J[H[t]]=t});var tt=[];Object.keys(Y).forEach(function(t){tt[Y[t]]=t});var et=[];Object.keys(B).forEach(function(t){et[B[t]]=t});var nt=[];Object.keys(q).forEach(function(t){nt[q[t]]=t});var rt=[];Object.keys(R).forEach(function(t){rt[R[t]]=t});var it=$.reduce(function(t,e){var n=H[e];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n?t[n]=n:32855===n||0<=e.indexOf("rgba")?t[n]=6408:t[n]=6407,t},{}),pt=[],dt=[],mt=0,gt={},vt=n.maxTextureUnits,yt=Array(vt).map(function(){return null});return F(O.prototype,{bind:function(){this.bindCount+=1;var e=this.unit;if(0>e){for(var n=0;n<vt;++n){var r=yt[n];if(r){if(0<r.bindCount)continue;r.unit=-1}yt[n]=this,e=n;break}a.profile&&o.maxTextureUnits<e+1&&(o.maxTextureUnits=e+1),this.unit=e,t.activeTexture(33984+e),t.bindTexture(this.target,this.texture)}return e},unbind:function(){--this.bindCount},decRef:function(){0>=--this.refCount&&D(this)}}),a.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys(gt).forEach(function(e){t+=gt[e].stats.size}),t}),{create2D:function(e,n){function r(t,e){var n=i.texInfo;T.call(n);var o=E();return"number"==typeof t?k(o,0|t,"number"==typeof e?0|e:0|t):t?(C(n,t),A(o,t)):k(o,1,1),n.genMipmaps&&(o.mipmask=(o.width<<1)-1),i.mipmask=o.mipmask,l(i,o),i.internalformat=o.internalformat,r.width=o.width,r.height=o.height,N(i),z(o,3553),P(n,3553),I(),S(o),a.profile&&(i.stats.size=M(i.internalformat,i.type,o.width,o.height,n.genMipmaps,!1)),r.format=J[i.internalformat],r.type=tt[i.type],r.mag=et[n.magFilter],r.min=nt[n.minFilter],r.wrapS=rt[n.wrapS],r.wrapT=rt[n.wrapT],r}var i=new O(3553);return gt[i.id]=i,o.textureCount++,r(e,n),r.subimage=function(t,e,n,o){e|=0,n|=0,o|=0;var a=v();return l(a,i),a.width=0,a.height=0,p(a,t),a.width=a.width||(i.width>>o)-e,a.height=a.height||(i.height>>o)-n,N(i),d(a,3553,e,n,o),I(),j(a),r},r.resize=function(e,n){var o=0|e,u=0|n||o;if(o===i.width&&u===i.height)return r;r.width=i.width=o,r.height=i.height=u,N(i);for(var s,l=i.channels,f=i.type,c=0;i.mipmask>>c;++c){var h=o>>c,p=u>>c;if(!h||!p)break;s=V.zero.allocType(f,h*p*l),t.texImage2D(3553,c,i.format,h,p,0,i.format,i.type,s),s&&V.zero.freeType(s)}return I(),a.profile&&(i.stats.size=M(i.internalformat,i.type,o,u,!1,!1)),r},r._reglType="texture2d",r._texture=i,a.profile&&(r.stats=i.stats),r.destroy=function(){i.decRef()},r},createCube:function(e,n,r,i,u,s){function c(t,e,n,r,i,o){var u,s=h.texInfo;for(T.call(s),u=0;6>u;++u)m[u]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)A(m[0],t),A(m[1],e),A(m[2],n),A(m[3],r),A(m[4],i),A(m[5],o);else if(C(s,t),f(h,t),"faces"in t)for(t=t.faces,u=0;6>u;++u)l(m[u],h),A(m[u],t[u]);else for(u=0;6>u;++u)A(m[u],t)}else for(t=0|t||1,u=0;6>u;++u)k(m[u],t,t);for(l(h,m[0]),h.mipmask=s.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,h.internalformat=m[0].internalformat,c.width=m[0].width,c.height=m[0].height,N(h),u=0;6>u;++u)z(m[u],34069+u);for(P(s,34067),I(),a.profile&&(h.stats.size=M(h.internalformat,h.type,c.width,c.height,s.genMipmaps,!0)),c.format=J[h.internalformat],c.type=tt[h.type],c.mag=et[s.magFilter],c.min=nt[s.minFilter],c.wrapS=rt[s.wrapS],c.wrapT=rt[s.wrapT],u=0;6>u;++u)S(m[u]);return c}var h=new O(34067);gt[h.id]=h,o.cubeCount++;var m=Array(6);return c(e,n,r,i,u,s),c.subimage=function(t,e,n,r,i){n|=0,r|=0,i|=0;var o=v();return l(o,h),o.width=0,o.height=0,p(o,e),o.width=o.width||(h.width>>i)-n,o.height=o.height||(h.height>>i)-r,N(h),d(o,34069+t,n,r,i),I(),j(o),c},c.resize=function(e){if((e|=0)!==h.width){c.width=h.width=e,c.height=h.height=e,N(h);for(var n=0;6>n;++n)for(var r=0;h.mipmask>>r;++r)t.texImage2D(34069+n,r,h.format,e>>r,e>>r,0,h.format,h.type,null);return I(),a.profile&&(h.stats.size=M(h.internalformat,h.type,c.width,c.height,!1,!0)),c}},c._reglType="textureCube",c._texture=h,a.profile&&(c.stats=h.stats),c.destroy=function(){h.decRef()},c},clear:function(){for(var e=0;e<vt;++e)t.activeTexture(33984+e),t.bindTexture(3553,null),yt[e]=null;Q(gt).forEach(D),o.cubeCount=0,o.textureCount=0},getTexture:function(t){return null},restore:function(){Q(gt).forEach(function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var n=0;32>n;++n)if(0!=(e.mipmask&1<<n))if(3553===e.target)t.texImage2D(3553,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);else for(var r=0;6>r;++r)t.texImage2D(34069+r,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);P(e.texInfo,e.target)})}}}function k(t,e,n,r,i,o){function a(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=t=0;e?(t=e.width,r=e.height):n&&(t=n.width,r=n.height),this.width=t,this.height=r}function u(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function s(t,e,n){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function l(e,n){n&&(n.texture?t.framebufferTexture2D(36160,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,n.renderbuffer._renderbuffer.renderbuffer))}function f(t){var e=3553,n=null,r=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?n=i:"textureCube"===t?n=i:"renderbuffer"===t&&(r=i,e=36161),new a(e,n,r)}function c(t,e,n,o,u){return n?((t=r.create2D({width:t,height:e,format:o,type:u}))._texture.refCount=0,new a(3553,t,null)):((t=i.create({width:t,height:e,format:o}))._renderbuffer.refCount=0,new a(36161,null,t))}function h(t){return t&&(t.texture||t.renderbuffer)}function p(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n))}function d(){this.id=M++,j[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(t){t.colorAttachments.forEach(u),u(t.depthAttachment),u(t.stencilAttachment),u(t.depthStencilAttachment)}function g(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,o.framebufferCount--,delete j[e.id]}function v(e){var r;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(r=0;r<i.length;++r)l(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)t.framebufferTexture2D(36160,36064+r,3553,null,0);t.framebufferTexture2D(36160,33306,3553,null,0),t.framebufferTexture2D(36160,36096,3553,null,0),t.framebufferTexture2D(36160,36128,3553,null,0),l(36096,e.depthAttachment),l(36128,e.stencilAttachment),l(33306,e.depthStencilAttachment),t.checkFramebufferStatus(36160),t.bindFramebuffer(36160,_.next?_.next.framebuffer:null),_.cur=_.next,t.getError()}function y(t,e){function n(t,e){var i,o=0,a=0,u=!0,l=!0;i=null;var p=!0,d="rgba",g="uint8",y=1,_=null,w=null,M=null,j=!1;"number"==typeof t?(o=0|t,a=0|e||o):t?("shape"in t?(a=t.shape,o=a[0],a=a[1]):("radius"in t&&(o=a=t.radius),"width"in t&&(o=t.width),"height"in t&&(a=t.height)),("color"in t||"colors"in t)&&(i=t.color||t.colors,Array.isArray(i)),i||("colorCount"in t&&(y=0|t.colorCount),"colorTexture"in t&&(p=!!t.colorTexture,d="rgba4"),"colorType"in t&&(g=t.colorType,!p)&&("half float"===g||"float16"===g?d="rgba16f":"float"!==g&&"float32"!==g||(d="rgba32f")),"colorFormat"in t&&(d=t.colorFormat,0<=b.indexOf(d)?p=!0:0<=x.indexOf(d)&&(p=!1))),("depthTexture"in t||"depthStencilTexture"in t)&&(j=!(!t.depthTexture&&!t.depthStencilTexture)),"depth"in t&&("boolean"==typeof t.depth?u=t.depth:(_=t.depth,l=!1)),"stencil"in t&&("boolean"==typeof t.stencil?l=t.stencil:(w=t.stencil,u=!1)),"depthStencil"in t&&("boolean"==typeof t.depthStencil?u=l=t.depthStencil:(M=t.depthStencil,l=u=!1))):o=a=1;var k=null,A=null,z=null,E=null;if(Array.isArray(i))k=i.map(f);else if(i)k=[f(i)];else for(k=Array(y),i=0;i<y;++i)k[i]=c(o,a,p,d,g);for(o=o||k[0].width,a=a||k[0].height,_?A=f(_):u&&!l&&(A=c(o,a,j,"depth","uint32")),w?z=f(w):l&&!u&&(z=c(o,a,!1,"stencil","uint8")),M?E=f(M):!_&&!w&&l&&u&&(E=c(o,a,j,"depth stencil","depth stencil")),u=null,i=0;i<k.length;++i)s(k[i]),k[i]&&k[i].texture&&(l=yt[k[i].texture._texture.format]*_t[k[i].texture._texture.type],null===u&&(u=l));return s(A),s(z),s(E),m(r),r.width=o,r.height=a,r.colorAttachments=k,r.depthAttachment=A,r.stencilAttachment=z,r.depthStencilAttachment=E,n.color=k.map(h),n.depth=h(A),n.stencil=h(z),n.depthStencil=h(E),n.width=r.width,n.height=r.height,v(r),n}var r=new d;return o.framebufferCount++,n(t,e),F(n,{resize:function(t,e){var i=0|t,o=0|e||i;if(i===r.width&&o===r.height)return n;for(var a=r.colorAttachments,u=0;u<a.length;++u)p(a[u],i,o);return p(r.depthAttachment,i,o),p(r.stencilAttachment,i,o),p(r.depthStencilAttachment,i,o),r.width=n.width=i,r.height=n.height=o,v(r),n},_reglType:"framebuffer",_framebuffer:r,destroy:function(){g(r),m(r)},use:function(t){_.setFBO({framebuffer:n},t)}})}var _={cur:null,next:null,dirty:!1,setFBO:null},b=["rgba"],x=["rgba4","rgb565","rgb5 a1"];e.ext_srgb&&x.push("srgba"),e.ext_color_buffer_half_float&&x.push("rgba16f","rgb16f"),e.webgl_color_buffer_float&&x.push("rgba32f");var w=["uint8"];e.oes_texture_half_float&&w.push("half float","float16"),e.oes_texture_float&&w.push("float","float32");var M=0,j={};return F(_,{getFramebuffer:function(t){return"function"==typeof t&&"framebuffer"===t._reglType&&(t=t._framebuffer)instanceof d?t:null},create:y,createCube:function(t){function e(t){var i,o={color:null},a=0,u=null;i="rgba";var s="uint8",l=1;if("number"==typeof t?a=0|t:t?("shape"in t?a=t.shape[0]:("radius"in t&&(a=0|t.radius),"width"in t?a=0|t.width:"height"in t&&(a=0|t.height)),("color"in t||"colors"in t)&&(u=t.color||t.colors,Array.isArray(u)),u||("colorCount"in t&&(l=0|t.colorCount),"colorType"in t&&(s=t.colorType),"colorFormat"in t&&(i=t.colorFormat)),"depth"in t&&(o.depth=t.depth),"stencil"in t&&(o.stencil=t.stencil),"depthStencil"in t&&(o.depthStencil=t.depthStencil)):a=1,u)if(Array.isArray(u))for(t=[],i=0;i<u.length;++i)t[i]=u[i];else t=[u];else for(t=Array(l),u={radius:a,format:i,type:s},i=0;i<l;++i)t[i]=r.createCube(u);for(o.color=Array(t.length),i=0;i<t.length;++i)l=t[i],a=a||l.width,o.color[i]={target:34069,data:t[i]};for(i=0;6>i;++i){for(l=0;l<t.length;++l)o.color[l].target=34069+i;0<i&&(o.depth=n[0].depth,o.stencil=n[0].stencil,o.depthStencil=n[0].depthStencil),n[i]?n[i](o):n[i]=y(o)}return F(e,{width:a,height:a,color:t})}var n=Array(6);return e(t),F(e,{faces:n,resize:function(t){var r=0|t;if(r===e.width)return e;var i=e.color;for(t=0;t<i.length;++t)i[t].resize(r);for(t=0;6>t;++t)n[t].resize(r);return e.width=e.height=r,e},_reglType:"framebufferCube",destroy:function(){n.forEach(function(t){t.destroy()})}})},clear:function(){Q(j).forEach(g)},restore:function(){Q(j).forEach(function(e){e.framebuffer=t.createFramebuffer(),v(e)})}})}function A(){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 z(t,e,n,r){function i(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function o(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function a(n,r,i){var o=(i=35632===n?l:f)[r];if(!o){var a=e.str(r),o=t.createShader(n);t.shaderSource(o,a),t.compileShader(o),i[r]=o}return o}function u(t,e){this.id=p++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],r.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function s(n,u){var s,l;s=a(35632,n.fragId),l=a(35633,n.vertId);var f=n.program=t.createProgram();t.attachShader(f,s),t.attachShader(f,l),t.linkProgram(f);var c=t.getProgramParameter(f,35718);r.profile&&(n.stats.uniformsCount=c);var h=n.uniforms;for(s=0;s<c;++s)if(l=t.getActiveUniform(f,s))if(1<l.size)for(var p=0;p<l.size;++p){var d=l.name.replace("[0]","["+p+"]");o(h,new i(d,e.id(d),t.getUniformLocation(f,d),l))}else o(h,new i(l.name,e.id(l.name),t.getUniformLocation(f,l.name),l));for(c=t.getProgramParameter(f,35721),r.profile&&(n.stats.attributesCount=c),h=n.attributes,s=0;s<c;++s)(l=t.getActiveAttrib(f,s))&&o(h,new i(l.name,e.id(l.name),t.getAttribLocation(f,l.name),l))}var l={},f={},c={},h=[],p=0;return r.profile&&(n.getMaxUniformsCount=function(){var t=0;return h.forEach(function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);Q(l).forEach(e),l={},Q(f).forEach(e),f={},h.forEach(function(e){t.deleteProgram(e.program)}),h.length=0,c={},n.shaderCount=0},program:function(t,e,r){var i=c[e];i||(i=c[e]={});var o=i[t];return o||(o=new u(e,t),n.shaderCount++,s(o),i[t]=o,h.push(o)),o},restore:function(){l={},f={};for(var t=0;t<h.length;++t)s(h[t])},shader:a,frag:-1,vert:-1}}function E(t,e,n,r,i,o,a){function u(i){var o;o=null===e.next?5121:e.next.colorAttachments[0].texture._texture.type;var a=0,u=0,s=r.framebufferWidth,l=r.framebufferHeight,f=null;return W(i)?f=i:i&&(a=0|i.x,u=0|i.y,s=0|(i.width||r.framebufferWidth-a),l=0|(i.height||r.framebufferHeight-u),f=i.data||null),n(),i=s*l*4,f||(5121===o?f=new Uint8Array(i):5126===o&&(f=f||new Float32Array(i))),t.pixelStorei(3333,4),t.readPixels(a,u,s,l,6408,o,f),f}return function(t){return t&&"framebuffer"in t?function(t){var n;return e.setFBO({framebuffer:t.framebuffer},function(){n=u(t)}),n}(t):u(t)}}function S(t){return Array.prototype.slice.call(t)}function T(t){return S(t).join("")}function C(){function t(){var t=[],e=[];return F(function(){t.push.apply(t,S(arguments))},{def:function(){var r="v"+n++;return e.push(r),0<arguments.length&&(t.push(r,"="),t.push.apply(t,S(arguments)),t.push(";")),r},toString:function(){return T([0<e.length?"var "+e+";":"",T(t)])}})}function e(){function e(t,e){r(t,e,"=",n.def(t,e),";")}var n=t(),r=t(),i=n.toString,o=r.toString;return F(function(){n.apply(n,S(arguments))},{def:n.def,entry:n,exit:r,save:e,set:function(t,r,i){e(t,r),n(t,r,"=",i,";")},toString:function(){return i()+o()}})}var n=0,r=[],i=[],o=t(),a={};return{global:o,link:function(t){for(var e=0;e<i.length;++e)if(i[e]===t)return r[e];return e="g"+n++,r.push(e),i.push(t),e},block:t,proc:function(t,n){function r(){var t="a"+i.length;return i.push(t),t}var i=[];n=n||0;for(var o=0;o<n;++o)r();var o=e(),u=o.toString;return a[t]=F(o,{arg:r,toString:function(){return T(["function(",i.join(),"){",u(),"}"])}})},scope:e,cond:function(){var t=T(arguments),n=e(),r=e(),i=n.toString,o=r.toString;return F(n,{then:function(){return n.apply(n,S(arguments)),this},else:function(){return r.apply(r,S(arguments)),this},toString:function(){var e=o();return e&&(e="else{"+e+"}"),T(["if(",t,"){",i(),"}",e])}})},compile:function(){var t=['"use strict";',o,"return {"];Object.keys(a).forEach(function(e){t.push('"',e,'":',a[e].toString(),",")}),t.push("}");var e=T(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,r.concat(e)).apply(null,i)}}}function P(t){return Array.isArray(t)||W(t)||s(t)}function O(t){return t.sort(function(t,e){return"viewport"===t?-1:"viewport"===e?1:t<e?-1:1})}function N(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function I(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function D(t){return new N(!1,!1,!1,t)}function L(t,e){var n=t.type;return 0===n?new N(!0,1<=(n=t.data.length),2<=n,e):4===n?new N((n=t.data).thisDep,n.contextDep,n.propDep,e):new N(3===n,2===n,1===n,e)}function R(t,e,n,r,i,a,u,s,l,f,c,h,p,d,m){function v(t){return t.replace(".","_")}function y(t,e,n){var r=v(t);rt.push(t),et[r]=tt[r]=!!n,it[r]=e}function _(t,e,n){var r=v(t);rt.push(t),Array.isArray(n)?(tt[r]=n.slice(),et[r]=n.slice()):tt[r]=et[r]=n,ot[r]=e}function b(){var t=C(),n=t.link,r=t.global;t.id=st++,t.batchId="0";var i=n(at),o=t.shared={props:"a0"};Object.keys(at).forEach(function(t){o[t]=r.def(i,".",t)});var a=t.next={},u=t.current={};Object.keys(ot).forEach(function(t){Array.isArray(tt[t])&&(a[t]=r.def(o.next,".",t),u[t]=r.def(o.current,".",t))});var s=t.constants={};Object.keys(ut).forEach(function(t){s[t]=r.def(JSON.stringify(ut[t]))}),t.invoke=function(e,r){switch(r.type){case 0:var i=["this",o.context,o.props,t.batchId];return e.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return e.def(o.props,r.data);case 2:return e.def(o.context,r.data);case 3:return e.def("this",r.data);case 4:return r.data.append(t,e),r.data.ref}},t.attribCache={};var l={};return t.scopeAttrib=function(t){if((t=e.id(t))in l)return l[t];var r=f.scope[t];return r||(r=f.scope[t]=new X),l[t]=n(r)},t}function x(t,e){var n=t.static,r=t.dynamic;if("framebuffer"in n){var i=n.framebuffer;return i?(i=s.getFramebuffer(i),D(function(t,e){var n=t.link(i),r=t.shared;return e.set(r.framebuffer,".next",n),r=r.context,e.set(r,".framebufferWidth",n+".width"),e.set(r,".framebufferHeight",n+".height"),n})):D(function(t,e){var n=t.shared;return e.set(n.framebuffer,".next","null"),n=n.context,e.set(n,".framebufferWidth",n+".drawingBufferWidth"),e.set(n,".framebufferHeight",n+".drawingBufferHeight"),"null"})}if("framebuffer"in r){var o=r.framebuffer;return L(o,function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,n=e.def(i,".getFramebuffer(",n,")");return e.set(i,".next",n),r=r.context,e.set(r,".framebufferWidth",n+"?"+n+".width:"+r+".drawingBufferWidth"),e.set(r,".framebufferHeight",n+"?"+n+".height:"+r+".drawingBufferHeight"),n})}return null}function w(t){function n(t){if(t in r){var n=e.id(r[t]);return(t=D(function(){return n})).id=n,t}if(t in i){var o=i[t];return L(o,function(t,e){var n=t.invoke(e,o);return e.def(t.shared.strings,".id(",n,")")})}return null}var r=t.static,i=t.dynamic,o=n("frag"),a=n("vert"),u=null;return I(o)&&I(a)?(u=c.program(a.id,o.id),t=D(function(t,e){return t.link(u)})):t=new N(o&&o.thisDep||a&&a.thisDep,o&&o.contextDep||a&&a.contextDep,o&&o.propDep||a&&a.propDep,function(t,e){var n,r,i=t.shared.shader;return n=o?o.append(t,e):e.def(i,".","frag"),r=a?a.append(t,e):e.def(i,".","vert"),e.def(i+".program("+r+","+n+")")}),{frag:o,vert:a,progVar:t,program:u}}function M(t,e){function n(t,e){if(t in r){var n=0|r[t];return D(function(t,r){return e&&(t.OFFSET=n),n})}if(t in i){var a=i[t];return L(a,function(t,n){var r=t.invoke(n,a);return e&&(t.OFFSET=r),r})}return e&&o?D(function(t,e){return t.OFFSET="0",0}):null}var r=t.static,i=t.dynamic,o=function(){if("elements"in r){var t=r.elements;P(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t));var e=D(function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r}return e.ELEMENTS=null});return e.value=t,e}if("elements"in i){var n=i.elements;return L(n,function(t,e){var r=t.shared,i=r.isBufferArgs,r=r.elements,o=t.invoke(e,n),a=e.def("null"),i=e.def(i,"(",o,")"),o=t.cond(i).then(a,"=",r,".createStream(",o,");").else(a,"=",r,".getElements(",o,");");return e.entry(o),e.exit(t.cond(i).then(r,".destroyStream(",a,");")),t.ELEMENTS=a})}return null}(),u=n("offset",!0);return{elements:o,primitive:function(){if("primitive"in r){var t=r.primitive;return D(function(e,n){return nt[t]})}if("primitive"in i){var e=i.primitive;return L(e,function(t,n){var r=t.constants.primTypes,i=t.invoke(n,e);return n.def(r,"[",i,"]")})}return o?I(o)?o.value?D(function(t,e){return e.def(t.ELEMENTS,".primType")}):D(function(){return 4}):new N(o.thisDep,o.contextDep,o.propDep,function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)}):null}(),count:function(){if("count"in r){var t=0|r.count;return D(function(){return t})}if("count"in i){var e=i.count;return L(e,function(t,n){return t.invoke(n,e)})}return o?I(o)?o?u?new N(u.thisDep,u.contextDep,u.propDep,function(t,e){return e.def(t.ELEMENTS,".vertCount-",t.OFFSET)}):D(function(t,e){return e.def(t.ELEMENTS,".vertCount")}):D(function(){return-1}):new N(o.thisDep||u.thisDep,o.contextDep||u.contextDep,o.propDep||u.propDep,function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}):null}(),instances:n("instances",!1),offset:u}}function j(t,n){var r=t.static,o=t.dynamic,a={};return Object.keys(r).forEach(function(t){var n=r[t],o=e.id(t),u=new X;if(P(n))u.state=1,u.buffer=i.getBuffer(i.create(n,34962,!1,!0)),u.type=0;else{var s=i.getBuffer(n);if(s)u.state=1,u.buffer=s,u.type=0;else if("constant"in n){var l=n.constant;u.buffer="null",u.state=2,"number"==typeof l?u.x=l:bt.forEach(function(t,e){e<l.length&&(u[t]=l[e])})}else{var s=P(n.buffer)?i.getBuffer(i.create(n.buffer,34962,!1,!0)):i.getBuffer(n.buffer),f=0|n.offset,c=0|n.stride,h=0|n.size,p=!!n.normalized,d=0;"type"in n&&(d=K[n.type]),n=0|n.divisor,u.buffer=s,u.state=1,u.size=h,u.normalized=p,u.type=d||s.dtype,u.offset=f,u.stride=c,u.divisor=n}}a[t]=D(function(t,e){var n=t.attribCache;if(o in n)return n[o];var r={isStream:!1};return Object.keys(u).forEach(function(t){r[t]=u[t]}),u.buffer&&(r.buffer=t.link(u.buffer),r.type=r.type||r.buffer+".dtype"),n[o]=r})}),Object.keys(o).forEach(function(t){var e=o[t];a[t]=L(e,function(t,n){function r(t){n(s[t],"=",i,".",t,"|0;")}var i=t.invoke(n,e),o=t.shared,a=o.isBufferArgs,u=o.buffer,s={isStream:n.def(!1)},l=new X;l.state=1,Object.keys(l).forEach(function(t){s[t]=n.def(""+l[t])});var f=s.buffer,c=s.type;return n("if(",a,"(",i,")){",s.isStream,"=true;",f,"=",u,".createStream(",34962,",",i,");",c,"=",f,".dtype;","}else{",f,"=",u,".getBuffer(",i,");","if(",f,"){",c,"=",f,".dtype;",'}else if("constant" in ',i,"){",s.state,"=",2,";","if(typeof "+i+'.constant === "number"){',s[bt[0]],"=",i,".constant;",bt.slice(1).map(function(t){return s[t]}).join("="),"=0;","}else{",bt.map(function(t,e){return s[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",a,"(",i,".buffer)){",f,"=",u,".createStream(",34962,",",i,".buffer);","}else{",f,"=",u,".getBuffer(",i,".buffer);","}",c,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",f,".dtype;",s.normalized,"=!!",i,".normalized;"),r("size"),r("offset"),r("stride"),r("divisor"),n("}}"),n.exit("if(",s.isStream,"){",u,".destroyStream(",f,");","}"),s})}),a}function k(t,e,n,r,i){var a=x(t),u=function(t,e,n){function r(t){if(t in i){var n=i[t];t=!0;var r,a,u=0|n.x,s=0|n.y;return"width"in n?r=0|n.width:t=!1,"height"in n?a=0|n.height:t=!1,new N(!t&&e&&e.thisDep,!t&&e&&e.contextDep,!t&&e&&e.propDep,function(t,e){var i=t.shared.context,o=r;"width"in n||(o=e.def(i,".","framebufferWidth","-",u));var l=a;return"height"in n||(l=e.def(i,".","framebufferHeight","-",s)),[u,s,o,l]})}if(t in o){var l=o[t];return t=L(l,function(t,e){var n=t.invoke(e,l),r=t.shared.context,i=e.def(n,".x|0"),o=e.def(n,".y|0"),a=e.def('"width" in ',n,"?",n,".width|0:","(",r,".","framebufferWidth","-",i,")"),n=e.def('"height" in ',n,"?",n,".height|0:","(",r,".","framebufferHeight","-",o,")");return[i,o,a,n]}),e&&(t.thisDep=t.thisDep||e.thisDep,t.contextDep=t.contextDep||e.contextDep,t.propDep=t.propDep||e.propDep),t}return e?new N(e.thisDep,e.contextDep,e.propDep,function(t,e){var n=t.shared.context;return[0,0,e.def(n,".","framebufferWidth"),e.def(n,".","framebufferHeight")]}):null}var i=t.static,o=t.dynamic;if(t=r("viewport")){var a=t;t=new N(t.thisDep,t.contextDep,t.propDep,function(t,e){var n=a.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n})}return{viewport:t,scissor_box:r("scissor.box")}}(t,a),s=M(t),l=function(t,e){var n=t.static,r=t.dynamic,i={};return rt.forEach(function(t){function e(e,o){if(t in n){var u=e(n[t]);i[a]=D(function(){return u})}else if(t in r){var s=r[t];i[a]=L(s,function(t,e){return o(t,e,t.invoke(e,s))})}}var a=v(t);switch(t){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 e(function(t){return t},function(t,e,n){return n});case"depth.func":return e(function(t){return Mt[t]},function(t,e,n){return e.def(t.constants.compareFuncs,"[",n,"]")});case"depth.range":return e(function(t){return t},function(t,e,n){return[e.def("+",n,"[0]"),e=e.def("+",n,"[1]")]});case"blend.func":return e(function(t){return[wt["srcRGB"in t?t.srcRGB:t.src],wt["dstRGB"in t?t.dstRGB:t.dst],wt["srcAlpha"in t?t.srcAlpha:t.src],wt["dstAlpha"in t?t.dstAlpha:t.dst]]},function(t,e,n){function r(t,r){return e.def('"',t,r,'" in ',n,"?",n,".",t,r,":",n,".",t)}t=t.constants.blendFuncs;var i=r("src","RGB"),o=r("dst","RGB"),a=(i=e.def(t,"[",i,"]"),e.def(t,"[",r("src","Alpha"),"]"));return[i,o=e.def(t,"[",o,"]"),a,t=e.def(t,"[",r("dst","Alpha"),"]")]});case"blend.equation":return e(function(t){return"string"==typeof t?[G[t],G[t]]:"object"==typeof t?[G[t.rgb],G[t.alpha]]:void 0},function(t,e,n){var r=t.constants.blendEquations,i=e.def(),o=e.def();return(t=t.cond("typeof ",n,'==="string"')).then(i,"=",o,"=",r,"[",n,"];"),t.else(i,"=",r,"[",n,".rgb];",o,"=",r,"[",n,".alpha];"),e(t),[i,o]});case"blend.color":return e(function(t){return o(4,function(e){return+t[e]})},function(t,e,n){return o(4,function(t){return e.def("+",n,"[",t,"]")})});case"stencil.mask":return e(function(t){return 0|t},function(t,e,n){return e.def(n,"|0")});case"stencil.func":return e(function(t){return[Mt[t.cmp||"keep"],t.ref||0,"mask"in t?t.mask:-1]},function(t,e,n){return[t=e.def('"cmp" in ',n,"?",t.constants.compareFuncs,"[",n,".cmp]",":",7680),e.def(n,".ref|0"),e=e.def('"mask" in ',n,"?",n,".mask|0:-1")]});case"stencil.opFront":case"stencil.opBack":return e(function(e){return["stencil.opBack"===t?1029:1028,jt[e.fail||"keep"],jt[e.zfail||"keep"],jt[e.zpass||"keep"]]},function(e,n,r){function i(t){return n.def('"',t,'" in ',r,"?",o,"[",r,".",t,"]:",7680)}var o=e.constants.stencilOps;return["stencil.opBack"===t?1029:1028,i("fail"),i("zfail"),i("zpass")]});case"polygonOffset.offset":return e(function(t){return[0|t.factor,0|t.units]},function(t,e,n){return[e.def(n,".factor|0"),e=e.def(n,".units|0")]});case"cull.face":return e(function(t){var e=0;return"front"===t?e=1028:"back"===t&&(e=1029),e},function(t,e,n){return e.def(n,'==="front"?',1028,":",1029)});case"lineWidth":return e(function(t){return t},function(t,e,n){return n});case"frontFace":return e(function(t){return kt[t]},function(t,e,n){return e.def(n+'==="cw"?2304:2305')});case"colorMask":return e(function(t){return t.map(function(t){return!!t})},function(t,e,n){return o(4,function(t){return"!!"+n+"["+t+"]"})});case"sample.coverage":return e(function(t){return["value"in t?t.value:1,!!t.invert]},function(t,e,n){return[e.def('"value" in ',n,"?+",n,".value:1"),e=e.def("!!",n,".invert")]})}}),i}(t),f=w(t),c=u.viewport;return c&&(l.viewport=c),c=v("scissor.box"),(u=u[c])&&(l[c]=u),u=0<Object.keys(l).length,(a={framebuffer:a,draw:s,shader:f,state:l,dirty:u}).profile=function(t){var e,n=t.static;if(t=t.dynamic,"profile"in n){var r=!!n.profile;(e=D(function(t,e){return r})).enable=r}else if("profile"in t){var i=t.profile;e=L(i,function(t,e){return t.invoke(e,i)})}return e}(t),a.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach(function(t){var e,r=n[t];if("number"==typeof r||"boolean"==typeof r)e=D(function(){return r});else if("function"==typeof r){var a=r._reglType;"texture2d"===a||"textureCube"===a?e=D(function(t){return t.link(r)}):"framebuffer"!==a&&"framebufferCube"!==a||(e=D(function(t){return t.link(r.color[0])}))}else g(r)&&(e=D(function(t){return t.global.def("[",o(r.length,function(t){return r[t]}),"]")}));e.value=r,i[t]=e}),Object.keys(r).forEach(function(t){var e=r[t];i[t]=L(e,function(t,n){return t.invoke(n,e)})}),i}(n),a.attributes=j(e),a.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach(function(t){var n=e[t];r[t]=D(function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)})}),Object.keys(n).forEach(function(t){var e=n[t];r[t]=L(e,function(t,n){return t.invoke(n,e)})}),r}(r),a}function A(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach(function(o){e.save(r,"."+o),i(r,".",o,"=",n[o].append(t,e),";")}),e(i)}function z(t,e,n,r){var i,o=t.shared,a=o.gl,u=o.framebuffer;J&&(i=e.def(o.extensions,".webgl_draw_buffers"));var s=t.constants,o=s.drawBuffer,s=s.backBuffer;t=n?n.append(t,e):e.def(u,".next"),r||e("if(",t,"!==",u,".cur){"),e("if(",t,"){",a,".bindFramebuffer(",36160,",",t,".framebuffer);"),J&&e(i,".drawBuffersWEBGL(",o,"[",t,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),J&&e(i,".drawBuffersWEBGL(",s,");"),e("}",u,".cur=",t,";"),r||e("}")}function E(t,e,n){var r=t.shared,i=r.gl,a=t.current,u=t.next,s=r.current,l=r.next,f=t.cond(s,".dirty");rt.forEach(function(e){var r,c;if(!((e=v(e))in n.state))if(e in u){r=u[e],c=a[e];var h=o(tt[e].length,function(t){return f.def(r,"[",t,"]")});f(t.cond(h.map(function(t,e){return t+"!=="+c+"["+e+"]"}).join("||")).then(i,".",ot[e],"(",h,");",h.map(function(t,e){return c+"["+e+"]="+t}).join(";"),";"))}else r=f.def(l,".",e),h=t.cond(r,"!==",s,".",e),f(h),e in it?h(t.cond(r).then(i,".enable(",it[e],");").else(i,".disable(",it[e],");"),s,".",e,"=",r,";"):h(i,".",ot[e],"(",r,");",s,".",e,"=",r,";")}),0===Object.keys(n.state).length&&f(s,".dirty=false;"),e(f)}function S(t,e,n,r){var i=t.shared,o=t.current,a=i.current,u=i.gl;O(Object.keys(n)).forEach(function(i){var s=n[i];if(!r||r(s)){var l=s.append(t,e);if(it[i]){var f=it[i];I(s)?e(u,l?".enable(":".disable(",f,");"):e(t.cond(l).then(u,".enable(",f,");").else(u,".disable(",f,");")),e(a,".",i,"=",l,";")}else if(g(l)){var c=o[i];e(u,".",ot[i],"(",l,");",l.map(function(t,e){return c+"["+e+"]="+t}).join(";"),";")}else e(u,".",ot[i],"(",l,");",a,".",i,"=",l,";")}})}function T(t,e){$&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function R(t,e,n,r,i){function o(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function a(t){l=e.def(),t(l,"=",o(),";"),"string"==typeof i?t(h,".count+=",i,";"):t(h,".count++;"),d&&(r?(f=e.def(),t(f,"=",m,".getNumPendingQueries();")):t(m,".beginQuery(",h,");"))}function u(t){t(h,".cpuTime+=",o(),"-",l,";"),d&&(r?t(m,".pushScopeStats(",f,",",m,".getNumPendingQueries(),",h,");"):t(m,".endQuery();"))}function s(t){var n=e.def(p,".profile");e(p,".profile=",t,";"),e.exit(p,".profile=",n,";")}var l,f,c=t.shared,h=t.stats,p=c.current,m=c.timer;if(n=n.profile){if(I(n))return void(n.enable?(a(e),u(e.exit),s("true")):s("false"));s(n=n.append(t,e))}else n=e.def(p,".profile");a(c=t.block()),e("if(",n,"){",c,"}"),u(t=t.block()),e.exit("if(",n,"){",t,"}")}function B(t,e,n,r,i){function o(n,r,i){function o(){e("if(!",f,".buffer){",s,".enableVertexAttribArray(",l,");}");var n,o=i.type;n=i.size?e.def(i.size,"||",r):r,e("if(",f,".type!==",o,"||",f,".size!==",n,"||",p.map(function(t){return f+"."+t+"!=="+i[t]}).join("||"),"){",s,".bindBuffer(",34962,",",c,".buffer);",s,".vertexAttribPointer(",[l,n,o,i.normalized,i.stride,i.offset],");",f,".type=",o,";",f,".size=",n,";",p.map(function(t){return f+"."+t+"="+i[t]+";"}).join(""),"}"),$&&(o=i.divisor,e("if(",f,".divisor!==",o,"){",t.instancing,".vertexAttribDivisorANGLE(",[l,o],");",f,".divisor=",o,";}"))}function u(){e("if(",f,".buffer){",s,".disableVertexAttribArray(",l,");","}if(",bt.map(function(t,e){return f+"."+t+"!=="+h[e]}).join("||"),"){",s,".vertexAttrib4f(",l,",",h,");",bt.map(function(t,e){return f+"."+t+"="+h[e]+";"}).join(""),"}")}var s=a.gl,l=e.def(n,".location"),f=e.def(a.attributes,"[",l,"]");n=i.state;var c=i.buffer,h=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];1===n?o():2===n?u():(e("if(",n,"===",1,"){"),o(),e("}else{"),u(),e("}"))}var a=t.shared;r.forEach(function(r){var a,u=r.name,s=n.attributes[u];if(s){if(!i(s))return;a=s.append(t,e)}else{if(!i(At))return;var l=t.scopeAttrib(u);a={},Object.keys(new X).forEach(function(t){a[t]=e.def(l,".",t)})}o(t.link(r),function(t){switch(t){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}}(r.info.type),a)})}function F(t,n,r,i,a){for(var u,s=t.shared,l=s.gl,f=0;f<i.length;++f){var c,h=i[f],p=h.name,d=h.info.type,m=r.uniforms[p],h=t.link(h)+".location";if(m){if(!a(m))continue;if(I(m)){if(p=m.value,35678===d||35680===d)d=t.link(p._texture||p.color[0]._texture),n(l,".uniform1i(",h,",",d+".bind());"),n.exit(d,".unbind();");else if(35674===d||35675===d||35676===d)p=t.global.def("new Float32Array(["+Array.prototype.slice.call(p)+"])"),m=2,35675===d?m=3:35676===d&&(m=4),n(l,".uniformMatrix",m,"fv(",h,",false,",p,");");else{switch(d){case 5126:u="1f";break;case 35664:u="2f";break;case 35665:u="3f";break;case 35666:u="4f";break;case 35670:case 5124:u="1i";break;case 35671:case 35667:u="2i";break;case 35672:case 35668:u="3i";break;case 35673:u="4i";break;case 35669:u="4i"}n(l,".uniform",u,"(",h,",",g(p)?Array.prototype.slice.call(p):p,");")}continue}c=m.append(t,n)}else{if(!a(At))continue;c=n.def(s.uniforms,"[",e.id(p),"]")}switch(35678===d?n("if(",c,"&&",c,'._reglType==="framebuffer"){',c,"=",c,".color[0];","}"):35680===d&&n("if(",c,"&&",c,'._reglType==="framebufferCube"){',c,"=",c,".color[0];","}"),p=1,d){case 35678:case 35680:d=n.def(c,"._texture"),n(l,".uniform1i(",h,",",d,".bind());"),n.exit(d,".unbind();");continue;case 5124:case 35670:u="1i";break;case 35667:case 35671:u="2i",p=2;break;case 35668:case 35672:u="3i",p=3;break;case 35669:case 35673:u="4i",p=4;break;case 5126:u="1f";break;case 35664:u="2f",p=2;break;case 35665:u="3f",p=3;break;case 35666:u="4f",p=4;break;case 35674:u="Matrix2fv";break;case 35675:u="Matrix3fv";break;case 35676:u="Matrix4fv"}if(n(l,".uniform",u,"(",h,","),"M"===u.charAt(0)){var h=Math.pow(d-35674+2,2),v=t.global.def("new Float32Array(",h,")");n("false,(Array.isArray(",c,")||",c," instanceof Float32Array)?",c,":(",o(h,function(t){return v+"["+t+"]="+c+"["+t+"]"}),",",v,")")}else n(1<p?o(p,function(t){return c+"["+t+"]"}):c);n(");")}}function q(t,e,n,r){function i(i){var o=h[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(c,".",i)}function o(){function t(){n(s,".drawElementsInstancedANGLE(",[d,g,v,m+"<<(("+v+"-5121)>>1)",u],");")}function e(){n(s,".drawArraysInstancedANGLE(",[d,m,g,u],");")}p?y?t():(n("if(",p,"){"),t(),n("}else{"),e(),n("}")):e()}function a(){function t(){n(f+".drawElements("+[d,g,v,m+"<<(("+v+"-5121)>>1)"]+");")}function e(){n(f+".drawArrays("+[d,m,g]+");")}p?y?t():(n("if(",p,"){"),t(),n("}else{"),e(),n("}")):e()}var u,s,l=t.shared,f=l.gl,c=l.draw,h=r.draw,p=function(){var i=h.elements,o=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(t,o)):i=o.def(c,".","elements"),i&&o("if("+i+")"+f+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),d=i("primitive"),m=i("offset"),g=function(){var i=h.count,o=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(t,o)):i=o.def(c,".","count"),i}();if("number"==typeof g){if(0===g)return}else n("if(",g,"){"),n.exit("}");$&&(u=i("instances"),s=t.instancing);var v=p+".type",y=h.elements&&I(h.elements);$&&("number"!=typeof u||0<=u)?"string"==typeof u?(n("if(",u,">0){"),o(),n("}else if(",u,"<0){"),a(),n("}")):o():a()}function Y(t,e,n,r,i){return e=b(),i=e.proc("body",i),$&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,n,r),e.compile().body}function H(t,e,n,r){T(t,e),B(t,e,n,r.attributes,function(){return!0}),F(t,e,n,r.uniforms,function(){return!0}),q(t,e,e,n)}function V(t,e,n,r){function i(){return!0}t.batchId="a1",T(t,e),B(t,e,n,r.attributes,i),F(t,e,n,r.uniforms,i),q(t,e,e,n)}function Z(t,e,n,r){function i(t){return t.contextDep&&a||t.propDep}function o(t){return!i(t)}T(t,e);var a=n.contextDep,u=e.def(),s=e.def();t.shared.props=s,t.batchId=u;var l=t.scope(),f=t.scope();e(l.entry,"for(",u,"=0;",u,"<","a1",";++",u,"){",s,"=","a0","[",u,"];",f,"}",l.exit),n.needsContext&&A(t,f,n.context),n.needsFramebuffer&&z(t,f,n.framebuffer),S(t,f,n.state,i),n.profile&&i(n.profile)&&R(t,f,n,!1,!0),r?(B(t,l,n,r.attributes,o),B(t,f,n,r.attributes,i),F(t,l,n,r.uniforms,o),F(t,f,n,r.uniforms,i),q(t,l,f,n)):(e=t.global.def("{}"),r=n.shader.progVar.append(t,f),s=f.def(r,".id"),l=f.def(e,"[",s,"]"),f(t.shared.gl,".useProgram(",r,".program);","if(!",l,"){",l,"=",e,"[",s,"]=",t.link(function(e){return Y(V,t,n,e,2)}),"(",r,");}",l,".call(this,a0[",u,"],",u,");"))}function W(t,n){function r(e){var r=n.shader[e];r&&i.set(o.shader,"."+e,r.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var o=t.shared,a=o.current;A(t,i,n.context),n.framebuffer&&n.framebuffer.append(t,i),O(Object.keys(n.state)).forEach(function(e){var r=n.state[e].append(t,i);g(r)?r.forEach(function(n,r){i.set(t.next[e],"["+r+"]",n)}):i.set(o.next,"."+e,r)}),R(t,i,n,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(e){var r=n.draw[e];r&&i.set(o.draw,"."+e,""+r.append(t,i))}),Object.keys(n.uniforms).forEach(function(r){i.set(o.uniforms,"["+e.id(r)+"]",n.uniforms[r].append(t,i))}),Object.keys(n.attributes).forEach(function(e){var r=n.attributes[e].append(t,i),o=t.scopeAttrib(e);Object.keys(new X).forEach(function(t){i.set(o,"."+t,r[t])})}),r("vert"),r("frag"),0<Object.keys(n.state).length&&(i(a,".dirty=true;"),i.exit(a,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}function Q(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!g(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(U.isDynamic(t[e[n]]))return!0;return!1}}(r)){var i=t.global,o=Object.keys(r),a=!1,u=!1,s=!1,l=t.global.def("{}");o.forEach(function(e){var n=r[e];if(U.isDynamic(n))"function"==typeof n&&(n=r[e]=U.unbox(n)),e=L(n,null),a=a||e.thisDep,s=s||e.propDep,u=u||e.contextDep;else{switch(i(l,".",e,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(t.link(n))}i(";")}}),e.dynamic[n]=new U.DynamicVariable(4,{thisDep:a,contextDep:u,propDep:s,ref:l,append:function(t,e){o.forEach(function(n){var i=r[n];U.isDynamic(i)&&(i=t.invoke(e,i),e(l,".",n,"=",i,";"))})}}),delete e.static[n]}}var X=f.Record,G={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(G.min=32775,G.max=32776);var $=n.angle_instanced_arrays,J=n.webgl_draw_buffers,tt={dirty:!0,profile:m.profile},et={},rt=[],it={},ot={};y("dither",3024),y("blend.enable",3042),_("blend.color","blendColor",[0,0,0,0]),_("blend.equation","blendEquationSeparate",[32774,32774]),_("blend.func","blendFuncSeparate",[1,0,1,0]),y("depth.enable",2929,!0),_("depth.func","depthFunc",513),_("depth.range","depthRange",[0,1]),_("depth.mask","depthMask",!0),_("colorMask","colorMask",[!0,!0,!0,!0]),y("cull.enable",2884),_("cull.face","cullFace",1029),_("frontFace","frontFace",2305),_("lineWidth","lineWidth",1),y("polygonOffset.enable",32823),_("polygonOffset.offset","polygonOffset",[0,0]),y("sample.alpha",32926),y("sample.enable",32928),_("sample.coverage","sampleCoverage",[1,!1]),y("stencil.enable",2960),_("stencil.mask","stencilMask",-1),_("stencil.func","stencilFunc",[519,0,-1]),_("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),_("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),y("scissor.enable",3089),_("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),_("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var at={gl:t,context:p,strings:e,next:et,current:tt,draw:h,elements:a,buffer:i,shader:c,attributes:f.state,uniforms:l,framebuffer:s,extensions:n,timer:d,isBufferArgs:P},ut={primTypes:nt,compareFuncs:Mt,blendFuncs:wt,blendEquations:G,stencilOps:jt,glTypes:K,orientationType:kt};J&&(ut.backBuffer=[1029],ut.drawBuffer=o(r.maxDrawbuffers,function(t){return 0===t?[0]:o(t,function(t){return 36064+t})}));var st=0;return{next:et,current:tt,procs:function(){var t=b(),e=t.proc("poll"),n=t.proc("refresh"),i=t.block();e(i),n(i);var a,u=t.shared,s=u.gl,l=u.next,f=u.current;i(f,".dirty=false;"),z(t,e),z(t,n,null,!0),$&&(a=t.link($));for(var c=0;c<r.maxAttributes;++c){var h=n.def(u.attributes,"[",c,"]"),p=t.cond(h,".buffer");p.then(s,".enableVertexAttribArray(",c,");",s,".bindBuffer(",34962,",",h,".buffer.buffer);",s,".vertexAttribPointer(",c,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(s,".disableVertexAttribArray(",c,");",s,".vertexAttrib4f(",c,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),n(p),$&&n(a,".vertexAttribDivisorANGLE(",c,",",h,".divisor);")}return Object.keys(it).forEach(function(r){var o=it[r],a=i.def(l,".",r),u=t.block();u("if(",a,"){",s,".enable(",o,")}else{",s,".disable(",o,")}",f,".",r,"=",a,";"),n(u),e("if(",a,"!==",f,".",r,"){",u,"}")}),Object.keys(ot).forEach(function(r){var a,u,c=ot[r],h=tt[r],p=t.block();p(s,".",c,"("),g(h)?(c=h.length,a=t.global.def(l,".",r),u=t.global.def(f,".",r),p(o(c,function(t){return a+"["+t+"]"}),");",o(c,function(t){return u+"["+t+"]="+a+"["+t+"];"}).join("")),e("if(",o(c,function(t){return a+"["+t+"]!=="+u+"["+t+"]"}).join("||"),"){",p,"}")):(a=i.def(l,".",r),u=i.def(f,".",r),p(a,");",f,".",r,"=",a,";"),e("if(",a,"!==",u,"){",p,"}")),n(p)}),t.compile()}(),compile:function(t,e,n,r,i){var o=b();return o.stats=o.link(i),Object.keys(e.static).forEach(function(t){Q(o,e,t)}),xt.forEach(function(e){Q(o,t,e)}),n=k(t,e,n,r),function(t,e){var n=t.proc("draw",1);T(t,n),A(t,n,e.context),z(t,n,e.framebuffer),E(t,n,e),S(t,n,e.state),R(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)H(t,n,e,e.shader.program);else{var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link(function(n){return Y(H,t,e,n,1)}),"(",r,");",a,".call(this,a0);"))}0<Object.keys(e.state).length&&n(t.shared.current,".dirty=true;")}(o,n),W(o,n),function(t,e){function n(t){return t.contextDep&&i||t.propDep}var r=t.proc("batch",2);t.batchId="0",T(t,r);var i=!1,o=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(A(t,r,e.context),o=!1);var a=!1;if((u=e.framebuffer)?(u.propDep?i=a=!0:u.contextDep&&i&&(a=!0),a||z(t,r,u)):z(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),E(t,r,e),S(t,r,e.state,function(t){return!n(t)}),e.profile&&n(e.profile)||R(t,r,e,!1,"a1"),e.contextDep=i,e.needsContext=o,e.needsFramebuffer=a,(o=e.shader.progVar).contextDep&&i||o.propDep)Z(t,r,e,null);else if(o=o.append(t,r),r(t.shared.gl,".useProgram(",o,".program);"),e.shader.program)Z(t,r,e,e.shader.program);else{var u=t.global.def("{}"),a=r.def(o,".id"),s=r.def(u,"[",a,"]");r(t.cond(s).then(s,".call(this,a0,a1);").else(s,"=",u,"[",a,"]=",t.link(function(n){return Y(Z,t,e,n,2)}),"(",o,");",s,".call(this,a0,a1);"))}0<Object.keys(e.state).length&&r(t.shared.current,".dirty=true;")}(o,n),o.compile()}}}function B(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}var F=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t},q=0,U={DynamicVariable:t,define:function(n,r){return new t(n,e(r+""))},isDynamic:function(e){return"function"==typeof e&&!e._reglType||e instanceof t},unbox:function(e,n){return"function"==typeof e?new t(0,e):e},accessor:e},Y={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},H="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},V=u();V.zero=u();var Z=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,i=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){o=t.createTexture(),t.bindTexture(3553,o),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var a=t.createFramebuffer();if(t.bindFramebuffer(36160,a),t.framebufferTexture2D(36160,36064,3553,o,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var u=V.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,u),t.getError()?o=!1:(t.deleteFramebuffer(a),t.deleteTexture(o),o=1===u[0]),V.freeType(u)}}return u=!0,u=t.createTexture(),a=V.allocType(5121,36),t.activeTexture(33984),t.bindTexture(34067,u),t.texImage2D(34069,0,6408,3,3,0,6408,5121,a),V.freeType(a),t.bindTexture(34067,null),t.deleteTexture(u),u=!t.getError(),{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter(function(t){return!!e[t]}),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:u}},W=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},Q=function(t){return Object.keys(t).map(function(e){return t[e]})},X={shape:function(t){for(var e=[];t.length;t=t[0])e.push(t.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o<e.length;++o)i*=e[o];else i=0;switch(n=r||V.allocType(n,i),e.length){case 0:break;case 1:for(r=e[0],e=0;e<r;++e)n[e]=t[e];break;case 2:for(r=e[0],e=e[1],o=i=0;o<r;++o)for(var a=t[o],u=0;u<e;++u)n[i++]=a[u];break;case 3:l(t,e[0],e[1],e[2],n,0);break;default:!function t(e,n,r,i,o){for(var a=1,u=r+1;u<n.length;++u)a*=n[u];var s=n[r];if(4==n.length-r){var f=n[r+1],c=n[r+2];for(n=n[r+3],u=0;u<s;++u)l(e[u],f,c,n,i,o),o+=a}else for(u=0;u<s;++u)t(e[u],n,r+1,i,o),o+=a}(t,e,0,n,0)}return n}},G={"[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},K={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},$={dynamic:35048,stream:35040,static:35044},J=X.flatten,tt=X.shape,et=[];et[5120]=1,et[5122]=2,et[5124]=4,et[5121]=1,et[5123]=2,et[5125]=4,et[5126]=4;var nt={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},rt=new Float32Array(1),it=new Uint32Array(rt.buffer),ot=[9984,9986,9985,9987],at=[0,6409,6410,6407,6408],ut={};ut[6409]=ut[6406]=ut[6402]=1,ut[34041]=ut[6410]=2,ut[6407]=ut[35904]=3,ut[6408]=ut[35906]=4;var st=v("HTMLCanvasElement"),lt=v("CanvasRenderingContext2D"),ft=v("ImageBitmap"),ct=v("HTMLImageElement"),ht=v("HTMLVideoElement"),pt=Object.keys(G).concat([st,lt,ft,ct,ht]),dt=[];dt[5121]=1,dt[5126]=4,dt[36193]=2,dt[5123]=2,dt[5125]=4;var mt=[];mt[32854]=2,mt[32855]=2,mt[36194]=2,mt[34041]=4,mt[33776]=.5,mt[33777]=.5,mt[33778]=1,mt[33779]=1,mt[35986]=.5,mt[35987]=1,mt[34798]=1,mt[35840]=.5,mt[35841]=.25,mt[35842]=.5,mt[35843]=.25,mt[36196]=.5;var gt=[];gt[32854]=2,gt[32855]=2,gt[36194]=2,gt[33189]=2,gt[36168]=1,gt[34041]=4,gt[35907]=4,gt[34836]=16,gt[34842]=8,gt[34843]=6;var vt=function(t,e,n,r,i){function o(t){this.id=l++,this.refCount=1,this.renderbuffer=t,this.format=32854,this.height=this.width=0,i.profile&&(this.stats={size:0})}function a(e){var n=e.renderbuffer;t.bindRenderbuffer(36161,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete f[e.id],r.renderbufferCount--}var u={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(u.srgba=35907),e.ext_color_buffer_half_float&&(u.rgba16f=34842,u.rgb16f=34843),e.webgl_color_buffer_float&&(u.rgba32f=34836);var s=[];Object.keys(u).forEach(function(t){s[u[t]]=t});var l=0,f={};return o.prototype.decRef=function(){0>=--this.refCount&&a(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:function(e,n){function a(e,n){var r=0,o=0,f=32854;if("object"==typeof e&&e?("shape"in e?(o=e.shape,r=0|o[0],o=0|o[1]):("radius"in e&&(r=o=0|e.radius),"width"in e&&(r=0|e.width),"height"in e&&(o=0|e.height)),"format"in e&&(f=u[e.format])):"number"==typeof e?(r=0|e,o="number"==typeof n?0|n:r):e||(r=o=1),r!==l.width||o!==l.height||f!==l.format)return a.width=l.width=r,a.height=l.height=o,l.format=f,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,f,r,o),i.profile&&(l.stats.size=gt[l.format]*l.width*l.height),a.format=s[l.format],a}var l=new o(t.createRenderbuffer());return f[l.id]=l,r.renderbufferCount++,a(e,n),a.resize=function(e,n){var r=0|e,o=0|n||r;return r===l.width&&o===l.height?a:(a.width=l.width=r,a.height=l.height=o,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,l.format,r,o),i.profile&&(l.stats.size=gt[l.format]*l.width*l.height),a)},a._reglType="renderbuffer",a._renderbuffer=l,i.profile&&(a.stats=l.stats),a.destroy=function(){l.decRef()},a},clear:function(){Q(f).forEach(a)},restore:function(){Q(f).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}},yt=[];yt[6408]=4,yt[6407]=3;var _t=[];_t[5121]=1,_t[5126]=4,_t[36193]=2;var bt=["x","y","z","w"],xt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),wt={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},Mt={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},jt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},kt={cw:2304,ccw:2305},At=new N(!1,!1,!1,function(){});return function(t){function e(){if(0===X.length)w&&w.update(),J=null;else{J=Y.next(e),c();for(var t=X.length-1;0<=t;--t){var n=X[t];n&&n(C,null,0)}g.flush(),w&&w.update()}}function n(){!J&&0<X.length&&(J=Y.next(e))}function r(){J&&(Y.cancel(e),J=null)}function o(t){t.preventDefault(),r(),G.forEach(function(t){t()})}function a(t){g.getError(),y.restore(),I.restore(),O.restore(),D.restore(),L.restore(),q.restore(),w&&w.restore(),V.procs.refresh(),n(),K.forEach(function(t){t()})}function u(t){function e(t){var e={},n={};return Object.keys(t).forEach(function(r){var i=t[r];U.isDynamic(i)?n[r]=U.unbox(i,r):e[r]=i}),{dynamic:n,static:e}}var n=e(t.context||{}),r=e(t.uniforms||{}),i=e(t.attributes||{}),o=e(function(t){function e(t){if(t in n){var e=n[t];delete n[t],Object.keys(e).forEach(function(r){n[t+"."+r]=e[r]})}}var n=F({},t);return delete n.uniforms,delete n.attributes,delete n.context,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),e("blend"),e("depth"),e("cull"),e("stencil"),e("polygonOffset"),e("scissor"),e("sample"),n}(t));t={gpuTime:0,cpuTime:0,count:0};var n=V.compile(o,i,r,n,t),a=n.draw,u=n.batch,s=n.scope,l=[];return F(function(t,e){var n;if("function"==typeof t)return s.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)s.call(this,null,e,n);else{if(!Array.isArray(t))return s.call(this,t,e,0);for(n=0;n<t.length;++n)s.call(this,t[n],e,n)}else if("number"==typeof t){if(0<t)return u.call(this,function(t){for(;l.length<t;)l.push(null);return l}(0|t),0|t)}else{if(!Array.isArray(t))return a.call(this,t);if(t.length)return u.call(this,t,t.length)}},{stats:t})}function s(t,e){var n=0;V.procs.poll();var r=e.color;r&&(g.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(g.clearDepth(+e.depth),n|=256),"stencil"in e&&(g.clearStencil(0|e.stencil),n|=1024),g.clear(n)}function l(t){return X.push(t),n(),{cancel:function(){var e=B(X,t);X[e]=function t(){var e=B(X,t);X[e]=X[X.length-1],--X.length,0>=X.length&&r()}}}}function f(){var t=W.viewport,e=W.scissor_box;t[0]=t[1]=e[0]=e[1]=0,C.viewportWidth=C.framebufferWidth=C.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,C.viewportHeight=C.framebufferHeight=C.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function c(){C.tick+=1,C.time=m(),f(),V.procs.poll()}function h(){f(),V.procs.refresh(),w&&w.update()}function m(){return(H()-M)/1e3}if(!(t=i(t)))return null;var g=t.gl,v=g.getContextAttributes();g.isContextLost();var y=function(t,e){function n(e){var n;e=e.toLowerCase();try{n=r[e]=t.getExtension(e)}catch(t){}return!!n}for(var r={},i=0;i<e.extensions.length;++i){var o=e.extensions[i];if(!n(o))return e.onDestroy(),e.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(n),{extensions:r,restore:function(){Object.keys(r).forEach(function(t){if(!n(t))throw Error("(regl): error restoring extension "+t)})}}}(g,t);if(!y)return null;var _=function(){var t={"":0},e=[""];return{id:function(n){var r=t[n];return r||(r=t[n]=e.length,e.push(n),r)},str:function(t){return e[t]}}}(),b={bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},x=y.extensions,w=function(t,e){function n(t,e,n){var r=a.pop()||new function(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null};r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,u.push(r)}var r=e.ext_disjoint_timer_query;if(!r)return null;var i=[],o=[],a=[],u=[],s=[],l=[];return{beginQuery:function(t){var e=i.pop()||r.createQueryEXT();r.beginQueryEXT(35007,e),o.push(e),n(o.length-1,o.length,t)},endQuery:function(){r.endQueryEXT(35007)},pushScopeStats:n,update:function(){var t,e;if(0!==(t=o.length)){l.length=Math.max(l.length,t+1),s.length=Math.max(s.length,t+1),s[0]=0;var n=l[0]=0;for(e=t=0;e<o.length;++e){var f=o[e];r.getQueryObjectEXT(f,34919)?(n+=r.getQueryObjectEXT(f,34918),i.push(f)):o[t++]=f,s[e+1]=n,l[e+1]=t}for(o.length=t,e=t=0;e<u.length;++e){var n=u[e],c=n.startQueryIndex,f=n.endQueryIndex;n.sum+=s[f]-s[c],c=l[c],(f=l[f])===c?(n.stats.gpuTime+=n.sum/1e6,a.push(n)):(n.startQueryIndex=c,n.endQueryIndex=f,u[t++]=n)}u.length=t}},getNumPendingQueries:function(){return o.length},clear:function(){i.push.apply(i,o);for(var t=0;t<i.length;t++)r.deleteQueryEXT(i[t]);o.length=0,i.length=0},restore:function(){o.length=0,i.length=0}}}(0,x),M=H(),S=g.drawingBufferWidth,T=g.drawingBufferHeight,C={tick:0,time:0,viewportWidth:S,viewportHeight:T,framebufferWidth:S,framebufferHeight:T,drawingBufferWidth:S,drawingBufferHeight:T,pixelRatio:t.pixelRatio},P=Z(g,x),S=function(t,e,n,r){for(t=n.maxAttributes,e=Array(t),n=0;n<t;++n)e[n]=new A;return{Record:A,scope:{},state:e}}(g,x,P),O=p(g,b,t,S),N=d(g,x,O,b),I=z(g,_,b,t),D=j(g,x,P,function(){V.procs.poll()},C,b,t),L=vt(g,x,0,b,t),q=k(g,x,P,D,L,b),V=R(g,_,x,P,O,N,0,q,{},S,I,{elements:null,primitive:4,count:-1,offset:0,instances:-1},C,w,t),_=E(g,q,V.procs.poll,C),W=V.next,Q=g.canvas,X=[],G=[],K=[],$=[t.onDestroy],J=null;Q&&(Q.addEventListener("webglcontextlost",o,!1),Q.addEventListener("webglcontextrestored",a,!1));var tt=q.setFBO=u({framebuffer:U.define.call(null,1,"framebuffer")});return h(),v=F(u,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;6>e;++e)tt(F({framebuffer:t.framebuffer.faces[e]},t),s);else tt(t,s);else s(0,t)},prop:U.define.bind(null,1),context:U.define.bind(null,2),this:U.define.bind(null,3),draw:u({}),buffer:function(t){return O.create(t,34962,!1,!1)},elements:function(t){return N.create(t,!1)},texture:D.create2D,cube:D.createCube,renderbuffer:L.create,framebuffer:q.create,framebufferCube:q.createCube,attributes:v,frame:l,on:function(t,e){var n;switch(t){case"frame":return l(e);case"lost":n=G;break;case"restore":n=K;break;case"destroy":n=$}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e){n[t]=n[n.length-1],n.pop();break}}}},limits:P,hasExtension:function(t){return 0<=P.extensions.indexOf(t.toLowerCase())},read:_,destroy:function(){X.length=0,r(),Q&&(Q.removeEventListener("webglcontextlost",o),Q.removeEventListener("webglcontextrestored",a)),I.clear(),q.clear(),L.clear(),D.clear(),N.clear(),O.clear(),w&&w.clear(),$.forEach(function(t){t()})},_gl:g,_refresh:h,poll:function(){c(),w&&w.update()},now:m,stats:b}),t.onDone(null,v),v}}()},"./node_modules/robust-in-sphere/in-sphere.js":
/*!****************************************************!*\
  !*** ./node_modules/robust-in-sphere/in-sphere.js ***!
  \****************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! two-product */"./node_modules/two-product/two-product.js"),i=n(/*! robust-sum */"./node_modules/robust-sum/robust-sum.js"),o=n(/*! robust-subtract */"./node_modules/robust-subtract/robust-diff.js"),a=n(/*! robust-scale */"./node_modules/robust-scale/robust-scale.js"),u=6;function s(t,e){for(var n=new Array(t.length-1),r=1;r<t.length;++r)for(var i=n[r-1]=new Array(t.length-1),o=0,a=0;o<t.length;++o)o!==e&&(i[a++]=t[r][o]);return n}function l(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function f(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var n=t.split("[");return["w",e.substr(1),"m",n[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return f(e,t)}function c(t){return!0&t?"-":""}function h(t){if(2===t.length)return[["diff(",f(t[0][0],t[1][1]),",",f(t[1][0],t[0][1]),")"].join("")];for(var e=[],n=0;n<t.length;++n)e.push(["scale(",l(h(s(t,n))),",",c(n),t[0][n],")"].join(""));return e}function p(t,e){for(var n=[],r=0;r<e-2;++r)n.push(["prod(m",t,"[",r,"],m",t,"[",r,"])"].join(""));return l(n)}function d(t){for(var e=[],n=[],u=function(t){for(var e=new Array(t),n=0;n<t;++n){e[n]=new Array(t);for(var r=0;r<t;++r)e[n][r]=["m",r,"[",t-n-2,"]"].join("")}return e}(t),f=0;f<t;++f)u[0][f]="1",u[t-1][f]="w"+f;for(f=0;f<t;++f)0==(1&f)?e.push.apply(e,h(s(u,f))):n.push.apply(n,h(s(u,f)));var c=l(e),d=l(n),m="exactInSphere"+t,g=[];for(f=0;f<t;++f)g.push("m"+f);var v=["function ",m,"(",g.join(),"){"];for(f=0;f<t;++f){v.push("var w",f,"=",p(f,t),";");for(var y=0;y<t;++y)y!==f&&v.push("var w",f,"m",y,"=scale(w",f,",m",y,"[0]);")}return v.push("var p=",c,",n=",d,",d=diff(p,n);return d[d.length-1];}return ",m),new Function("sum","diff","prod","scale",v.join(""))(i,o,r,a)}var m=[function(){return 0},function(){return 0},function(){return 0}];!function(){for(;m.length<=u;)m.push(d(m.length));for(var e=[],n=["slow"],r=0;r<=u;++r)e.push("a"+r),n.push("o"+r);var i=["function testInSphere(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=u;++r)i.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere"),n.push(i.join(""));var o=Function.apply(void 0,n);for(t.exports=o.apply(void 0,[function(t){var e=m[t.length];return e||(e=m[t.length]=d(t.length)),e.apply(void 0,t)}].concat(m)),r=0;r<=u;++r)t.exports[r]=m[r]}()},"./node_modules/robust-orientation/orientation.js":
/*!********************************************************!*\
  !*** ./node_modules/robust-orientation/orientation.js ***!
  \********************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! two-product */"./node_modules/two-product/two-product.js"),i=n(/*! robust-sum */"./node_modules/robust-sum/robust-sum.js"),o=n(/*! robust-scale */"./node_modules/robust-scale/robust-scale.js"),a=n(/*! robust-subtract */"./node_modules/robust-subtract/robust-diff.js"),u=5;function s(t,e){for(var n=new Array(t.length-1),r=1;r<t.length;++r)for(var i=n[r-1]=new Array(t.length-1),o=0,a=0;o<t.length;++o)o!==e&&(i[a++]=t[r][o]);return n}function l(t){return 1&t?"-":""}function f(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",f(t.slice(0,e)),",",f(t.slice(e)),")"].join("")}function c(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],n=0;n<t.length;++n)e.push(["scale(",f(c(s(t,n))),",",l(n),t[0][n],")"].join(""));return e}function h(t){for(var e=[],n=[],u=function(t){for(var e=new Array(t),n=0;n<t;++n){e[n]=new Array(t);for(var r=0;r<t;++r)e[n][r]=["m",r,"[",t-n-1,"]"].join("")}return e}(t),l=[],h=0;h<t;++h)0==(1&h)?e.push.apply(e,c(s(u,h))):n.push.apply(n,c(s(u,h))),l.push("m"+h);var p=f(e),d=f(n),m="orientation"+t+"Exact",g=["function ",m,"(",l.join(),"){var p=",p,",n=",d,",d=sub(p,n);return d[d.length-1];};return ",m].join("");return new Function("sum","prod","scale","sub",g)(i,r,o,a)}var p=h(3),d=h(4),m=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){var r,i=(t[1]-n[1])*(e[0]-n[0]),o=(t[0]-n[0])*(e[1]-n[1]),a=i-o;if(i>0){if(o<=0)return a;r=i+o}else{if(!(i<0))return a;if(o>=0)return a;r=-(i+o)}var u=3.3306690738754716e-16*r;return a>=u||a<=-u?a:p(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],a=n[0]-r[0],u=t[1]-r[1],s=e[1]-r[1],l=n[1]-r[1],f=t[2]-r[2],c=e[2]-r[2],h=n[2]-r[2],p=o*l,m=a*s,g=a*u,v=i*l,y=i*s,_=o*u,b=f*(p-m)+c*(g-v)+h*(y-_),x=7.771561172376103e-16*((Math.abs(p)+Math.abs(m))*Math.abs(f)+(Math.abs(g)+Math.abs(v))*Math.abs(c)+(Math.abs(y)+Math.abs(_))*Math.abs(h));return b>x||-b>x?b:d(t,e,n,r)}];!function(){for(;m.length<=u;)m.push(h(m.length));for(var e=[],n=["slow"],r=0;r<=u;++r)e.push("a"+r),n.push("o"+r);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=u;++r)i.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),n.push(i.join(""));var o=Function.apply(void 0,n);for(t.exports=o.apply(void 0,[function(t){var e=m[t.length];return e||(e=m[t.length]=h(t.length)),e.apply(void 0,t)}].concat(m)),r=0;r<=u;++r)t.exports[r]=m[r]}()},"./node_modules/robust-product/product.js":
/*!************************************************!*\
  !*** ./node_modules/robust-product/product.js ***!
  \************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! robust-sum */"./node_modules/robust-sum/robust-sum.js"),i=n(/*! robust-scale */"./node_modules/robust-scale/robust-scale.js");t.exports=function(t,e){if(1===t.length)return i(e,t[0]);if(1===e.length)return i(t,e[0]);if(0===t.length||0===e.length)return[0];var n=[0];if(t.length<e.length)for(var o=0;o<t.length;++o)n=r(n,i(e,t[o]));else for(var o=0;o<e.length;++o)n=r(n,i(t,e[o]));return n}},"./node_modules/robust-scale/robust-scale.js":
/*!***************************************************!*\
  !*** ./node_modules/robust-scale/robust-scale.js ***!
  \***************************************************/
/*! no static exports found */function(t,e,n){"use strict";var r=n(/*! two-product */"./node_modules/two-product/two-product.js"),i=n(/*! two-sum */"./node_modules/two-sum/two-sum.js");t.exports=function(t,e){var n=t.length;if(1===n){var o=r(t[0],e);return o[0]?o:[o[1]]}var a=new Array(2*n),u=[.1,.1],s=[.1,.1],l=0;r(t[0],e,u),u[0]&&(a[l++]=u[0]);for(var f=1;f<n;++f){r(t[f],e,s);var c=u[1];i(c,s[0],u),u[0]&&(a[l++]=u[0]);var h=s[1],p=u[1],d=h+p,m=d-h,g=p-m;u[1]=d,g&&(a[l++]=g)}u[1]&&(a[l++]=u[1]);0===l&&(a[l++]=0);return a.length=l,a}},"./node_modules/robust-segment-intersect/segseg.js":
/*!*********************************************************!*\
  !*** ./node_modules/robust-segment-intersect/segseg.js ***!
  \*********************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n,i){var o=r(t,n,i),a=r(e,n,i);if(o>0&&a>0||o<0&&a<0)return!1;var u=r(n,t,e),s=r(i,t,e);if(u>0&&s>0||u<0&&s<0)return!1;if(0===o&&0===a&&0===u&&0===s)return function(t,e,n,r){for(var i=0;i<2;++i){var o=t[i],a=e[i],u=Math.min(o,a),s=Math.max(o,a),l=n[i],f=r[i],c=Math.min(l,f),h=Math.max(l,f);if(h<u||s<c)return!1}return!0}(t,e,n,i);return!0};var r=n(/*! robust-orientation */"./node_modules/robust-orientation/orientation.js")[3]},"./node_modules/robust-subtract/robust-diff.js":
/*!*****************************************************!*\
  !*** ./node_modules/robust-subtract/robust-diff.js ***!
  \*****************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);if(i)return[i,n];return[n]}(t[0],-e[0]);var i,o,a=new Array(n+r),u=0,s=0,l=0,f=Math.abs,c=t[s],h=f(c),p=-e[l],d=f(p);h<d?(o=c,(s+=1)<n&&(c=t[s],h=f(c))):(o=p,(l+=1)<r&&(p=-e[l],d=f(p)));s<n&&h<d||l>=r?(i=c,(s+=1)<n&&(c=t[s],h=f(c))):(i=p,(l+=1)<r&&(p=-e[l],d=f(p)));var m,g,v=i+o,y=v-i,_=o-y,b=_,x=v;for(;s<n&&l<r;)h<d?(i=c,(s+=1)<n&&(c=t[s],h=f(c))):(i=p,(l+=1)<r&&(p=-e[l],d=f(p))),(_=(o=b)-(y=(v=i+o)-i))&&(a[u++]=_),b=x-((m=x+v)-(g=m-x))+(v-g),x=m;for(;s<n;)(_=(o=b)-(y=(v=(i=c)+o)-i))&&(a[u++]=_),b=x-((m=x+v)-(g=m-x))+(v-g),x=m,(s+=1)<n&&(c=t[s]);for(;l<r;)(_=(o=b)-(y=(v=(i=p)+o)-i))&&(a[u++]=_),b=x-((m=x+v)-(g=m-x))+(v-g),x=m,(l+=1)<r&&(p=-e[l]);b&&(a[u++]=b);x&&(a[u++]=x);u||(a[u++]=0);return a.length=u,a}},"./node_modules/robust-sum/robust-sum.js":
/*!***********************************************!*\
  !*** ./node_modules/robust-sum/robust-sum.js ***!
  \***********************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);if(i)return[i,n];return[n]}(t[0],e[0]);var i,o,a=new Array(n+r),u=0,s=0,l=0,f=Math.abs,c=t[s],h=f(c),p=e[l],d=f(p);h<d?(o=c,(s+=1)<n&&(c=t[s],h=f(c))):(o=p,(l+=1)<r&&(p=e[l],d=f(p)));s<n&&h<d||l>=r?(i=c,(s+=1)<n&&(c=t[s],h=f(c))):(i=p,(l+=1)<r&&(p=e[l],d=f(p)));var m,g,v=i+o,y=v-i,_=o-y,b=_,x=v;for(;s<n&&l<r;)h<d?(i=c,(s+=1)<n&&(c=t[s],h=f(c))):(i=p,(l+=1)<r&&(p=e[l],d=f(p))),(_=(o=b)-(y=(v=i+o)-i))&&(a[u++]=_),b=x-((m=x+v)-(g=m-x))+(v-g),x=m;for(;s<n;)(_=(o=b)-(y=(v=(i=c)+o)-i))&&(a[u++]=_),b=x-((m=x+v)-(g=m-x))+(v-g),x=m,(s+=1)<n&&(c=t[s]);for(;l<r;)(_=(o=b)-(y=(v=(i=p)+o)-i))&&(a[u++]=_),b=x-((m=x+v)-(g=m-x))+(v-g),x=m,(l+=1)<r&&(p=e[l]);b&&(a[u++]=b);x&&(a[u++]=x);u||(a[u++]=0);return a.length=u,a}},"./node_modules/simplicial-complex/node_modules/bit-twiddle/twiddle.js":
/*!*****************************************************************************!*\
  !*** ./node_modules/simplicial-complex/node_modules/bit-twiddle/twiddle.js ***!
  \*****************************************************************************/
/*! no static exports found */function(t,e,n){"use strict";"use restrict";function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t<e)},e.max=function(t,e){return t^(t^e)&-(t<e)},e.isPow2=function(t){return!(t&t-1||!t)},e.log2=function(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var n=e,r=e,i=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=1&n,--i;t[e]=r<<i&255}}(i),e.reverse=function(t){return i[255&t]<<24|i[t>>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,n){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(n=1227133513&((n=3272356035&((n=251719695&((n=4278190335&((n&=1023)|n<<16))|n<<8))|n<<4))|n<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},"./node_modules/simplicial-complex/node_modules/union-find/index.js":
/*!**************************************************************************!*\
  !*** ./node_modules/simplicial-complex/node_modules/union-find/index.js ***!
  \**************************************************************************/
/*! no static exports found */function(t,e,n){"use strict";"use restrict";function r(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}t.exports=r,r.prototype.length=function(){return this.roots.length},r.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},r.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var n=e[t];e[t]=e[n],t=n}return t},r.prototype.link=function(t,e){var n=this.find(t),r=this.find(e);if(n!==r){var i=this.ranks,o=this.roots,a=i[n],u=i[r];a<u?o[n]=r:u<a?o[r]=n:(o[r]=n,++i[n])}}},"./node_modules/simplicial-complex/topology.js":
/*!*****************************************************!*\
  !*** ./node_modules/simplicial-complex/topology.js ***!
  \*****************************************************/
/*! no static exports found */function(t,e,n){"use strict";"use restrict";var r=n(/*! bit-twiddle */"./node_modules/simplicial-complex/node_modules/bit-twiddle/twiddle.js"),i=n(/*! union-find */"./node_modules/simplicial-complex/node_modules/union-find/index.js");function o(t,e){var n=t.length,r=t.length-e.length,i=Math.min;if(r)return r;switch(n){case 0:return 0;case 1:return t[0]-e[0];case 2:return(u=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],a=e[0]+e[1];if(u=o+t[2]-(a+e[2]))return u;var u,s=i(t[0],t[1]),l=i(e[0],e[1]);return(u=i(s,t[2])-i(l,e[2]))||i(s+t[2],o)-i(l+e[2],a);default:var f=t.slice(0);f.sort();var c=e.slice(0);c.sort();for(var h=0;h<n;++h)if(r=f[h]-c[h])return r;return 0}}function a(t,e){return o(t[0],e[0])}function u(t,e){if(e){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=[t[i],e[i]];r.sort(a);for(i=0;i<n;++i)t[i]=r[i][0],e[i]=r[i][1];return t}return t.sort(o),t}function s(t){if(0===t.length)return[];for(var e=1,n=t.length,r=1;r<n;++r){var i=t[r];if(o(i,t[r-1])){if(r===e){e++;continue}t[e++]=i}}return t.length=e,t}function l(t,e){for(var n=0,r=t.length-1,i=-1;n<=r;){var a=n+r>>1,u=o(t[a],e);u<=0?(0===u&&(i=a),n=a+1):u>0&&(r=a-1)}return i}function f(t,e){for(var n=new Array(t.length),i=0,a=n.length;i<a;++i)n[i]=[];for(var u=[],s=(i=0,e.length);i<s;++i)for(var f=e[i],c=f.length,h=1,p=1<<c;h<p;++h){u.length=r.popCount(h);for(var d=0,m=0;m<c;++m)h&1<<m&&(u[d++]=f[m]);var g=l(t,u);if(!(g<0))for(;n[g++].push(i),!(g>=t.length||0!==o(t[g],u)););}return n}function c(t,e){if(e<0)return[];for(var n=[],i=(1<<e+1)-1,o=0;o<t.length;++o)for(var a=t[o],s=i;s<1<<a.length;s=r.nextCombination(s)){for(var l=new Array(e+1),f=0,c=0;c<a.length;++c)s&1<<c&&(l[f++]=a[c]);n.push(l)}return u(n)}e.dimension=function(t){for(var e=0,n=Math.max,r=0,i=t.length;r<i;++r)e=n(e,t[r].length);return e-1},e.countVertices=function(t){for(var e=-1,n=Math.max,r=0,i=t.length;r<i;++r)for(var o=t[r],a=0,u=o.length;a<u;++a)e=n(e,o[a]);return e+1},e.cloneCells=function(t){for(var e=new Array(t.length),n=0,r=t.length;n<r;++n)e[n]=t[n].slice(0);return e},e.compareCells=o,e.normalize=u,e.unique=s,e.findCell=l,e.incidence=f,e.dual=function(t,e){if(!e)return f(s(c(t,0)),t);for(var n=new Array(e),r=0;r<e;++r)n[r]=[];r=0;for(var i=t.length;r<i;++r)for(var o=t[r],a=0,u=o.length;a<u;++a)n[o[a]].push(r);return n},e.explode=function(t){for(var e=[],n=0,r=t.length;n<r;++n)for(var i=t[n],o=0|i.length,a=1,s=1<<o;a<s;++a){for(var l=[],f=0;f<o;++f)a>>>f&1&&l.push(i[f]);e.push(l)}return u(e)},e.skeleton=c,e.boundary=function(t){for(var e=[],n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length;o<a;++o){for(var s=new Array(i.length-1),l=0,f=0;l<a;++l)l!==o&&(s[f++]=i[l]);e.push(s)}return u(e)},e.connectedComponents=function(t,e){return e?function(t,e){for(var n=new i(e),r=0;r<t.length;++r)for(var o=t[r],a=0;a<o.length;++a)for(var u=a+1;u<o.length;++u)n.link(o[a],o[u]);var s=[],l=n.ranks;for(r=0;r<l.length;++r)l[r]=-1;for(r=0;r<t.length;++r){var f=n.find(t[r][0]);l[f]<0?(l[f]=s.length,s.push([t[r].slice(0)])):s[l[f]].push(t[r].slice(0))}return s}(t,e):function(t){for(var e=s(u(c(t,0))),n=new i(e.length),r=0;r<t.length;++r)for(var o=t[r],a=0;a<o.length;++a)for(var f=l(e,[o[a]]),h=a+1;h<o.length;++h)n.link(f,l(e,[o[h]]));var p=[],d=n.ranks;for(r=0;r<d.length;++r)d[r]=-1;for(r=0;r<t.length;++r){var m=n.find(l(e,[t[r][0]]));d[m]<0?(d[m]=p.length,p.push([t[r].slice(0)])):p[d[m]].push(t[r].slice(0))}return p}(t)}},"./node_modules/simplify-planar-graph/simplify.js":
/*!********************************************************!*\
  !*** ./node_modules/simplify-planar-graph/simplify.js ***!
  \********************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n){for(var o=e.length,a=t.length,u=new Array(o),s=new Array(o),l=new Array(o),f=new Array(o),c=0;c<o;++c)u[c]=s[c]=-1,l[c]=1/0,f[c]=!1;for(var c=0;c<a;++c){var h=t[c];if(2!==h.length)throw new Error("Input must be a graph");var p=h[1],d=h[0];-1!==s[d]?s[d]=-2:s[d]=p,-1!==u[p]?u[p]=-2:u[p]=d}function m(t){if(f[t])return 1/0;var n=u[t],i=s[t];return n<0||i<0?1/0:function(t,e,n){var i=Math.abs(r(t,e,n)),o=Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2));return i/o}(e[t],e[n],e[i])}function g(t,e){var n=j[t],r=j[e];j[t]=r,j[e]=n,k[n]=e,k[r]=t}function v(t){return l[j[t]]}function y(t){return 1&t?t-1>>1:(t>>1)-1}function _(t){for(var e=v(t);;){var n=e,r=2*t+1,i=2*(t+1),o=t;if(r<z){var a=v(r);a<n&&(o=r,n=a)}if(i<z){var u=v(i);u<n&&(o=i)}if(o===t)return t;g(t,o),t=o}}function b(t){for(var e=v(t);t>0;){var n=y(t);if(n>=0){var r=v(n);if(e<r){g(t,n),t=n;continue}}return t}}function x(){if(z>0){var t=j[0];return g(0,z-1),z-=1,_(0),t}return-1}function w(t,e){var n=j[t];return l[n]===e?t:(l[n]=-1/0,b(t),x(),l[n]=e,b((z+=1)-1))}function M(t){if(!f[t]){f[t]=!0;var e=u[t],n=s[t];u[n]>=0&&(u[n]=e),s[e]>=0&&(s[e]=n),k[e]>=0&&w(k[e],m(e)),k[n]>=0&&w(k[n],m(n))}}for(var j=[],k=new Array(o),c=0;c<o;++c){var A=l[c]=m(c);A<1/0?(k[c]=j.length,j.push(c)):k[c]=-1}for(var z=j.length,c=z>>1;c>=0;--c)_(c);for(;;){var E=x();if(E<0||l[E]>n)break;M(E)}for(var S=[],c=0;c<o;++c)f[c]||(k[c]=S.length,S.push(e[c].slice()));S.length;function T(t,e){if(t[e]<0)return e;var n=e,r=e;do{var i=t[r];if(!f[r]||i<0||i===r)break;if(i=t[r=i],!f[r]||i<0||i===r)break;r=i,n=t[n]}while(n!==r);for(var o=e;o!==r;o=t[o])t[o]=r;return r}var C=[];return t.forEach(function(t){var e=T(u,t[0]),n=T(s,t[1]);if(e>=0&&n>=0&&e!==n){var r=k[e],i=k[n];r!==i&&C.push([r,i])}}),i.unique(i.normalize(C)),{positions:S,edges:C}};var r=n(/*! robust-orientation */"./node_modules/robust-orientation/orientation.js"),i=n(/*! simplicial-complex */"./node_modules/simplicial-complex/topology.js")},"./node_modules/slab-decomposition/lib/order-segments.js":
/*!***************************************************************!*\
  !*** ./node_modules/slab-decomposition/lib/order-segments.js ***!
  \***************************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){var n,o,a,u;if(e[0][0]<e[1][0])n=e[0],o=e[1];else{if(!(e[0][0]>e[1][0]))return i(e,t);n=e[1],o=e[0]}if(t[0][0]<t[1][0])a=t[0],u=t[1];else{if(!(t[0][0]>t[1][0]))return-i(t,e);a=t[1],u=t[0]}var s=r(n,o,u),l=r(n,o,a);if(s<0){if(l<=0)return s}else if(s>0){if(l>=0)return s}else if(l)return l;if(s=r(u,a,o),l=r(u,a,n),s<0){if(l<=0)return s}else if(s>0){if(l>=0)return s}else if(l)return l;return o[0]-u[0]};var r=n(/*! robust-orientation */"./node_modules/robust-orientation/orientation.js");function i(t,e){var n,i,o,a;if(e[0][0]<e[1][0])n=e[0],i=e[1];else{if(!(e[0][0]>e[1][0])){var u=Math.min(t[0][1],t[1][1]),s=Math.max(t[0][1],t[1][1]),l=Math.min(e[0][1],e[1][1]),f=Math.max(e[0][1],e[1][1]);return s<l?s-l:u>f?u-f:s-f}n=e[1],i=e[0]}t[0][1]<t[1][1]?(o=t[0],a=t[1]):(o=t[1],a=t[0]);var c=r(i,n,o);return c||((c=r(i,n,a))||a-i)}},"./node_modules/slab-decomposition/node_modules/binary-search-bounds/search-bounds.js":
/*!********************************************************************************************!*\
  !*** ./node_modules/slab-decomposition/node_modules/binary-search-bounds/search-bounds.js ***!
  \********************************************************************************************/
/*! no static exports found */function(t,e,n){"use strict";function r(t,e,n,r,i,o){var a=["function ",t,"(a,l,h,",r.join(","),"){",o?"":"var i=",n?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return o?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),n?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),o?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,n,i){return new Function([r("A","x"+t+"y",e,["y"],!1,i),r("B","x"+t+"y",e,["y"],!0,i),r("P","c(x,y)"+t+"0",e,["y","c"],!1,i),r("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",n,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",n].join(""))()}t.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},"./node_modules/slab-decomposition/slabs.js":
/*!**************************************************!*\
  !*** ./node_modules/slab-decomposition/slabs.js ***!
  \**************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t){for(var e=t.length,n=2*e,r=new Array(n),o=0;o<e;++o){var s=t[o],l=s[0][0]<s[1][0];r[2*o]=new c(s[0][0],s,l,o),r[2*o+1]=new c(s[1][0],s,!l,o)}r.sort(function(t,e){var n=t.x-e.x;return n||((n=t.create-e.create)||Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1]))});for(var h=i(a),p=[],d=[],m=[],o=0;o<n;){for(var g=r[o].x,v=[];o<n;){var y=r[o];if(y.x!==g)break;o+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]<y.segment[1][1]?(v.push(new f(y.segment[0][1],y.index,!0,!0)),v.push(new f(y.segment[1][1],y.index,!1,!1))):(v.push(new f(y.segment[1][1],y.index,!0,!1)),v.push(new f(y.segment[0][1],y.index,!1,!0)))):h=y.create?h.insert(y.segment,y.index):h.remove(y.segment)}p.push(h.root),d.push(g),m.push(v)}return new u(p,d,m)};var r=n(/*! binary-search-bounds */"./node_modules/slab-decomposition/node_modules/binary-search-bounds/search-bounds.js"),i=n(/*! functional-red-black-tree */"./node_modules/functional-red-black-tree/rbtree.js"),o=n(/*! robust-orientation */"./node_modules/robust-orientation/orientation.js"),a=n(/*! ./lib/order-segments */"./node_modules/slab-decomposition/lib/order-segments.js");function u(t,e,n){this.slabs=t,this.coordinates=e,this.horizontal=n}function s(t,e){return t.y-e}function l(t,e){for(var n=null;t;){var r,i,a=t.key;a[0][0]<a[1][0]?(r=a[0],i=a[1]):(r=a[1],i=a[0]);var u=o(r,i,e);if(u<0)t=t.left;else if(u>0)if(e[0]!==a[1][0])n=t,t=t.right;else{if(s=l(t.right,e))return s;t=t.left}else{if(e[0]!==a[1][0])return t;var s;if(s=l(t.right,e))return s;t=t.left}}return n}function f(t,e,n,r){this.y=t,this.index=e,this.start=n,this.closed=r}function c(t,e,n,r){this.x=t,this.segment=e,this.create=n,this.index=r}u.prototype.castUp=function(t){var e=r.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var n=l(this.slabs[e],t),i=-1;if(n&&(i=n.value),this.coordinates[e]===t[0]){var u=null;if(n&&(u=n.key),e>0){var f=l(this.slabs[e-1],t);f&&(u?a(f.key,u)>0&&(u=f.key,i=f.value):(i=f.value,u=f.key))}var c=this.horizontal[e];if(c.length>0){var h=r.ge(c,t[1],s);if(h<c.length){var p=c[h];if(t[1]===p.y){if(p.closed)return p.index;for(;h<c.length-1&&c[h+1].y===t[1];)if((p=c[h+=1]).closed)return p.index;if(p.y===t[1]&&!p.start){if((h+=1)>=c.length)return i;p=c[h]}}if(p.start)if(u){var d=o(u[0],u[1],[t[0],p.y]);u[0][0]>u[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},"./node_modules/surface-nets/surfacenets.js":
/*!**************************************************!*\
  !*** ./node_modules/surface-nets/surfacenets.js ***!
  \**************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var n=o(t,e),r=n.length,i=new Array(r),a=new Array(r),u=0;u<r;++u)i[u]=[n[u]],a[u]=[u];return{positions:i,cells:a}}(t,e);var n=t.order.join()+"-"+t.dtype,u=a[n],e=+e||0;u||(u=a[n]=function(t,e){var n=t.length,o=["'use strict';"],a="surfaceNets"+t.join("_")+"d"+e;o.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&o.push("getters:[0],");for(var u=[],s=[],l=0;l<n;++l)u.push("d"+l),s.push("d"+l);for(var l=0;l<1<<n;++l)u.push("v"+l),s.push("v"+l);for(var l=0;l<1<<n;++l)u.push("p"+l),s.push("p"+l);u.push("a","b","c"),s.push("a","c"),o.push("vertex:function vertexFunc(",u.join(),"){");for(var f=[],l=0;l<1<<n;++l)f.push("(p"+l+"<<"+l+")");o.push("var m=(",f.join("+"),")|0;if(m===0||m===",(1<<(1<<n))-1,"){return}");var c=[],h=[];1<<(1<<n)<=128?(o.push("switch(m){"),h=o):o.push("switch(m>>>7){");for(var l=0;l<1<<(1<<n);++l){if(1<<(1<<n)>128&&l%128==0){c.length>0&&h.push("}}");var p="vExtra"+c.length;o.push("case ",l>>>7,":",p,"(m&0x7f,",s.join(),");break;"),h=["function ",p,"(m,",s.join(),"){switch(m){"],c.push(h)}h.push("case ",127&l,":");for(var d=new Array(n),m=new Array(n),g=new Array(n),v=new Array(n),y=0,_=0;_<n;++_)d[_]=[],m[_]=[],g[_]=0,v[_]=0;for(var _=0;_<1<<n;++_)for(var b=0;b<n;++b){var x=_^1<<b;if(!(x>_)&&!(l&1<<x)!=!(l&1<<_)){var w=1;l&1<<x?m[b].push("v"+x+"-v"+_):(m[b].push("v"+_+"-v"+x),w=-w),w<0?(d[b].push("-v"+_+"-v"+x),g[b]+=2):(d[b].push("v"+_+"+v"+x),g[b]-=2),y+=1;for(var M=0;M<n;++M)M!==b&&(x&1<<M?v[M]+=1:v[M]-=1)}}for(var j=[],b=0;b<n;++b)if(0===d[b].length)j.push("d"+b+"-0.5");else{var k="";g[b]<0?k=g[b]+"*c":g[b]>0&&(k="+"+g[b]+"*c");var A=d[b].length/y*.5,z=.5+v[b]/y*.5;j.push("d"+b+"-"+z+"-"+A+"*("+d[b].join("+")+k+")/("+m[b].join("+")+")")}h.push("a.push([",j.join(),"]);","break;")}o.push("}},"),c.length>0&&h.push("}}");for(var E=[],l=0;l<1<<n-1;++l)E.push("v"+l);E.push("c0","c1","p0","p1","a","b","c"),o.push("cell:function cellFunc(",E.join(),"){");var S=i(n-1);o.push("if(p0){b.push(",S.map(function(t){return"["+t.map(function(t){return"v"+t})+"]"}).join(),")}else{b.push(",S.map(function(t){var e=t.slice();return e.reverse(),"["+e.map(function(t){return"v"+t})+"]"}).join(),")}}});function ",a,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",a,";");for(var l=0;l<c.length;++l)o.push(c[l].join(""));return new Function("genContour",o.join(""))(r)}(t.order,t.dtype));return u(t,e)};var r=n(/*! ndarray-extract-contour */"./node_modules/ndarray-extract-contour/contour.js"),i=n(/*! triangulate-hypercube */"./node_modules/triangulate-hypercube/triangulate-cube.js"),o=n(/*! zero-crossings */"./node_modules/zero-crossings/zc.js");var a={}},"./node_modules/triangulate-hypercube/triangulate-cube.js":
/*!****************************************************************!*\
  !*** ./node_modules/triangulate-hypercube/triangulate-cube.js ***!
  \****************************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(o(t+1)),n=[],a=0;a<e;++a){for(var u=r.unrank(t,a),s=[0],l=0,f=0;f<u.length;++f)l+=1<<u[f],s.push(l);i(u)<1&&(s[0]=l,s[t]=0),n.push(s)}return n};var r=n(/*! permutation-rank */"./node_modules/permutation-rank/index.js"),i=n(/*! permutation-parity */"./node_modules/permutation-parity/permutation-sign.js"),o=n(/*! gamma */"./node_modules/gamma/index.js")},"./node_modules/two-product/two-product.js":
/*!*************************************************!*\
  !*** ./node_modules/two-product/two-product.js ***!
  \*************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n){var i=t*e,o=r*t,a=o-(o-t),u=t-a,s=r*e,l=s-(s-e),f=e-l,c=u*f-(i-a*l-u*l-a*f);if(n)return n[0]=c,n[1]=i,n;return[c,i]};var r=+(Math.pow(2,27)+1)},"./node_modules/two-sum/two-sum.js":
/*!*****************************************!*\
  !*** ./node_modules/two-sum/two-sum.js ***!
  \*****************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n){var r=t+e,i=r-t,o=e-i,a=t-(r-i);if(n)return n[0]=a+o,n[1]=r,n;return[a+o,r]}},"./node_modules/typedarray-pool/pool.js":
/*!**********************************************!*\
  !*** ./node_modules/typedarray-pool/pool.js ***!
  \**********************************************/
/*! no static exports found */function(t,e,n){"use strict";(function(t,r){var i=n(/*! bit-twiddle */"./node_modules/bit-twiddle/twiddle.js"),o=n(/*! dup */"./node_modules/dup/dup.js");t.__TYPEDARRAY_POOL||(t.__TYPEDARRAY_POOL={UINT8:o([32,0]),UINT16:o([32,0]),UINT32:o([32,0]),INT8:o([32,0]),INT16:o([32,0]),INT32:o([32,0]),FLOAT:o([32,0]),DOUBLE:o([32,0]),DATA:o([32,0]),UINT8C:o([32,0]),BUFFER:o([32,0])});var a="undefined"!=typeof Uint8ClampedArray,u=t.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=o([32,0])),u.BUFFER||(u.BUFFER=o([32,0]));var s=u.DATA,l=u.BUFFER;function f(t){if(t){var e=t.length||t.byteLength,n=i.log2(e);s[n].push(t)}}function c(t){t=i.nextPow2(t);var e=i.log2(t),n=s[e];return n.length>0?n.pop():new ArrayBuffer(t)}function h(t){return new Uint8Array(c(t),0,t)}function p(t){return new Uint16Array(c(2*t),0,t)}function d(t){return new Uint32Array(c(4*t),0,t)}function m(t){return new Int8Array(c(t),0,t)}function g(t){return new Int16Array(c(2*t),0,t)}function v(t){return new Int32Array(c(4*t),0,t)}function y(t){return new Float32Array(c(4*t),0,t)}function _(t){return new Float64Array(c(8*t),0,t)}function b(t){return a?new Uint8ClampedArray(c(t),0,t):h(t)}function x(t){return new DataView(c(t),0,t)}function w(t){t=i.nextPow2(t);var e=i.log2(t),n=l[e];return n.length>0?n.pop():new r(t)}e.free=function(t){if(r.isBuffer(t))l[i.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,n=0|i.log2(e);s[n].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeInt8=e.freeInt16=e.freeInt32=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){f(t.buffer)},e.freeArrayBuffer=f,e.freeBuffer=function(t){l[i.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return c(t);switch(e){case"uint8":return h(t);case"uint16":return p(t);case"uint32":return d(t);case"int8":return m(t);case"int16":return g(t);case"int32":return v(t);case"float":case"float32":return y(t);case"double":case"float64":return _(t);case"uint8_clamped":return b(t);case"buffer":return w(t);case"data":case"dataview":return x(t);default:return null}return null},e.mallocArrayBuffer=c,e.mallocUint8=h,e.mallocUint16=p,e.mallocUint32=d,e.mallocInt8=m,e.mallocInt16=g,e.mallocInt32=v,e.mallocFloat32=e.mallocFloat=y,e.mallocFloat64=e.mallocDouble=_,e.mallocUint8Clamped=b,e.mallocDataView=x,e.mallocBuffer=w,e.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.UINT8C[t].length=0,s[t].length=0,l[t].length=0}}).call(this,n(/*! ./../webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"),n(/*! ./../buffer/index.js */"./node_modules/buffer/index.js").Buffer)},"./node_modules/underscore/underscore.js":
/*!***********************************************!*\
  !*** ./node_modules/underscore/underscore.js ***!
  \***********************************************/
/*! no static exports found */function(t,e,n){var r;(function(){var n=this,i=n._,o=Array.prototype,a=Object.prototype,u=Function.prototype,s=o.push,l=o.slice,f=a.toString,c=a.hasOwnProperty,h=Array.isArray,p=Object.keys,d=u.bind,m=Object.create,g=function(){},v=function(t){return t instanceof v?t:this instanceof v?void(this._wrapped=t):new v(t)};void 0!==t&&t.exports&&(e=t.exports=v),e._=v,v.VERSION="1.8.3";var y=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},_=function(t,e,n){return null==t?v.identity:v.isFunction(t)?y(t,e,n):v.isObject(t)?v.matcher(t):v.property(t)};v.iteratee=function(t,e){return _(t,e,1/0)};var b=function(t,e){return function(n){var r=arguments.length;if(r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),u=a.length,s=0;s<u;s++){var l=a[s];e&&void 0!==n[l]||(n[l]=o[l])}return n}},x=function(t){if(!v.isObject(t))return{};if(m)return m(t);g.prototype=t;var e=new g;return g.prototype=null,e},w=function(t){return function(e){return null==e?void 0:e[t]}},M=Math.pow(2,53)-1,j=w("length"),k=function(t){var e=j(t);return"number"==typeof e&&e>=0&&e<=M};function A(t){return function(e,n,r,i){n=y(n,i,4);var o=!k(e)&&v.keys(e),a=(o||e).length,u=t>0?0:a-1;return arguments.length<3&&(r=e[o?o[u]:u],u+=t),function(e,n,r,i,o,a){for(;o>=0&&o<a;o+=t){var u=i?i[o]:o;r=n(r,e[u],u,e)}return r}(e,n,r,o,u,a)}}v.each=v.forEach=function(t,e,n){var r,i;if(e=y(e,n),k(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=v.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},v.map=v.collect=function(t,e,n){e=_(e,n);for(var r=!k(t)&&v.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var u=r?r[a]:a;o[a]=e(t[u],u,t)}return o},v.reduce=v.foldl=v.inject=A(1),v.reduceRight=v.foldr=A(-1),v.find=v.detect=function(t,e,n){var r;if(void 0!==(r=k(t)?v.findIndex(t,e,n):v.findKey(t,e,n))&&-1!==r)return t[r]},v.filter=v.select=function(t,e,n){var r=[];return e=_(e,n),v.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},v.reject=function(t,e,n){return v.filter(t,v.negate(_(e)),n)},v.every=v.all=function(t,e,n){e=_(e,n);for(var r=!k(t)&&v.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},v.some=v.any=function(t,e,n){e=_(e,n);for(var r=!k(t)&&v.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},v.contains=v.includes=v.include=function(t,e,n,r){return k(t)||(t=v.values(t)),("number"!=typeof n||r)&&(n=0),v.indexOf(t,e,n)>=0},v.invoke=function(t,e){var n=l.call(arguments,2),r=v.isFunction(e);return v.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},v.pluck=function(t,e){return v.map(t,v.property(e))},v.where=function(t,e){return v.filter(t,v.matcher(e))},v.findWhere=function(t,e){return v.find(t,v.matcher(e))},v.max=function(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e&&null!=t)for(var u=0,s=(t=k(t)?t:v.values(t)).length;u<s;u++)(r=t[u])>o&&(o=r);else e=_(e,n),v.each(t,function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},v.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e&&null!=t)for(var u=0,s=(t=k(t)?t:v.values(t)).length;u<s;u++)(r=t[u])<o&&(o=r);else e=_(e,n),v.each(t,function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)});return o},v.shuffle=function(t){for(var e,n=k(t)?t:v.values(t),r=n.length,i=Array(r),o=0;o<r;o++)(e=v.random(0,o))!==o&&(i[o]=i[e]),i[e]=n[o];return i},v.sample=function(t,e,n){return null==e||n?(k(t)||(t=v.values(t)),t[v.random(t.length-1)]):v.shuffle(t).slice(0,Math.max(0,e))},v.sortBy=function(t,e,n){return e=_(e,n),v.pluck(v.map(t,function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};var z=function(t){return function(e,n,r){var i={};return n=_(n,r),v.each(e,function(r,o){var a=n(r,o,e);t(i,r,a)}),i}};v.groupBy=z(function(t,e,n){v.has(t,n)?t[n].push(e):t[n]=[e]}),v.indexBy=z(function(t,e,n){t[n]=e}),v.countBy=z(function(t,e,n){v.has(t,n)?t[n]++:t[n]=1}),v.toArray=function(t){return t?v.isArray(t)?l.call(t):k(t)?v.map(t,v.identity):v.values(t):[]},v.size=function(t){return null==t?0:k(t)?t.length:v.keys(t).length},v.partition=function(t,e,n){e=_(e,n);var r=[],i=[];return v.each(t,function(t,n,o){(e(t,n,o)?r:i).push(t)}),[r,i]},v.first=v.head=v.take=function(t,e,n){if(null!=t)return null==e||n?t[0]:v.initial(t,t.length-e)},v.initial=function(t,e,n){return l.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},v.last=function(t,e,n){if(null!=t)return null==e||n?t[t.length-1]:v.rest(t,Math.max(0,t.length-e))},v.rest=v.tail=v.drop=function(t,e,n){return l.call(t,null==e||n?1:e)},v.compact=function(t){return v.filter(t,v.identity)};var E=function(t,e,n,r){for(var i=[],o=0,a=r||0,u=j(t);a<u;a++){var s=t[a];if(k(s)&&(v.isArray(s)||v.isArguments(s))){e||(s=E(s,e,n));var l=0,f=s.length;for(i.length+=f;l<f;)i[o++]=s[l++]}else n||(i[o++]=s)}return i};function S(t){return function(e,n,r){n=_(n,r);for(var i=j(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}function T(t,e,n){return function(r,i,o){var a=0,u=j(r);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+u,a):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(l.call(r,a,u),v.isNaN))>=0?o+a:-1;for(o=t>0?a:u-1;o>=0&&o<u;o+=t)if(r[o]===i)return o;return-1}}v.flatten=function(t,e){return E(t,e,!1)},v.without=function(t){return v.difference(t,l.call(arguments,1))},v.uniq=v.unique=function(t,e,n,r){v.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=_(n,r));for(var i=[],o=[],a=0,u=j(t);a<u;a++){var s=t[a],l=n?n(s,a,t):s;e?(a&&o===l||i.push(s),o=l):n?v.contains(o,l)||(o.push(l),i.push(s)):v.contains(i,s)||i.push(s)}return i},v.union=function(){return v.uniq(E(arguments,!0,!0))},v.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=j(t);r<i;r++){var o=t[r];if(!v.contains(e,o)){for(var a=1;a<n&&v.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},v.difference=function(t){var e=E(arguments,!0,!0,1);return v.filter(t,function(t){return!v.contains(e,t)})},v.zip=function(){return v.unzip(arguments)},v.unzip=function(t){for(var e=t&&v.max(t,j).length||0,n=Array(e),r=0;r<e;r++)n[r]=v.pluck(t,r);return n},v.object=function(t,e){for(var n={},r=0,i=j(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},v.findIndex=S(1),v.findLastIndex=S(-1),v.sortedIndex=function(t,e,n,r){for(var i=(n=_(n,r,1))(e),o=0,a=j(t);o<a;){var u=Math.floor((o+a)/2);n(t[u])<i?o=u+1:a=u}return o},v.indexOf=T(1,v.findIndex,v.sortedIndex),v.lastIndexOf=T(-1,v.findLastIndex),v.range=function(t,e,n){null==e&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i};var C=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=x(t.prototype),a=t.apply(o,i);return v.isObject(a)?a:o};v.bind=function(t,e){if(d&&t.bind===d)return d.apply(t,l.call(arguments,1));if(!v.isFunction(t))throw new TypeError("Bind must be called on a function");var n=l.call(arguments,2),r=function(){return C(t,r,e,this,n.concat(l.call(arguments)))};return r},v.partial=function(t){var e=l.call(arguments,1),n=function(){for(var r=0,i=e.length,o=Array(i),a=0;a<i;a++)o[a]=e[a]===v?arguments[r++]:e[a];for(;r<arguments.length;)o.push(arguments[r++]);return C(t,n,this,this,o)};return n},v.bindAll=function(t){var e,n,r=arguments.length;if(r<=1)throw new Error("bindAll must be passed function names");for(e=1;e<r;e++)t[n=arguments[e]]=v.bind(t[n],t);return t},v.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return v.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},v.delay=function(t,e){var n=l.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},v.defer=v.partial(v.delay,v,1),v.throttle=function(t,e,n){var r,i,o,a=null,u=0;n||(n={});var s=function(){u=!1===n.leading?0:v.now(),a=null,o=t.apply(r,i),a||(r=i=null)};return function(){var l=v.now();u||!1!==n.leading||(u=l);var f=e-(l-u);return r=this,i=arguments,f<=0||f>e?(a&&(clearTimeout(a),a=null),u=l,o=t.apply(r,i),a||(r=i=null)):a||!1===n.trailing||(a=setTimeout(s,f)),o}},v.debounce=function(t,e,n){var r,i,o,a,u,s=function(){var l=v.now()-a;l<e&&l>=0?r=setTimeout(s,e-l):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=v.now();var l=n&&!r;return r||(r=setTimeout(s,e)),l&&(u=t.apply(o,i),o=i=null),u}},v.wrap=function(t,e){return v.partial(e,t)},v.negate=function(t){return function(){return!t.apply(this,arguments)}},v.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},v.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},v.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},v.once=v.partial(v.before,2);var P=!{toString:null}.propertyIsEnumerable("toString"),O=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function N(t,e){var n=O.length,r=t.constructor,i=v.isFunction(r)&&r.prototype||a,o="constructor";for(v.has(t,o)&&!v.contains(e,o)&&e.push(o);n--;)(o=O[n])in t&&t[o]!==i[o]&&!v.contains(e,o)&&e.push(o)}v.keys=function(t){if(!v.isObject(t))return[];if(p)return p(t);var e=[];for(var n in t)v.has(t,n)&&e.push(n);return P&&N(t,e),e},v.allKeys=function(t){if(!v.isObject(t))return[];var e=[];for(var n in t)e.push(n);return P&&N(t,e),e},v.values=function(t){for(var e=v.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},v.mapObject=function(t,e,n){e=_(e,n);for(var r,i=v.keys(t),o=i.length,a={},u=0;u<o;u++)a[r=i[u]]=e(t[r],r,t);return a},v.pairs=function(t){for(var e=v.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},v.invert=function(t){for(var e={},n=v.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},v.functions=v.methods=function(t){var e=[];for(var n in t)v.isFunction(t[n])&&e.push(n);return e.sort()},v.extend=b(v.allKeys),v.extendOwn=v.assign=b(v.keys),v.findKey=function(t,e,n){e=_(e,n);for(var r,i=v.keys(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r},v.pick=function(t,e,n){var r,i,o={},a=t;if(null==a)return o;v.isFunction(e)?(i=v.allKeys(a),r=y(e,n)):(i=E(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var u=0,s=i.length;u<s;u++){var l=i[u],f=a[l];r(f,l,a)&&(o[l]=f)}return o},v.omit=function(t,e,n){if(v.isFunction(e))e=v.negate(e);else{var r=v.map(E(arguments,!1,!1,1),String);e=function(t,e){return!v.contains(r,e)}}return v.pick(t,e,n)},v.defaults=b(v.allKeys,!0),v.create=function(t,e){var n=x(t);return e&&v.extendOwn(n,e),n},v.clone=function(t){return v.isObject(t)?v.isArray(t)?t.slice():v.extend({},t):t},v.tap=function(t,e){return e(t),t},v.isMatch=function(t,e){var n=v.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0};var I=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof v&&(t=t._wrapped),e instanceof v&&(e=e._wrapped);var i=f.call(t);if(i!==f.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,u=e.constructor;if(a!==u&&!(v.isFunction(a)&&a instanceof a&&v.isFunction(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var s=n.length;s--;)if(n[s]===t)return r[s]===e;if(n.push(t),r.push(e),o){if((s=t.length)!==e.length)return!1;for(;s--;)if(!I(t[s],e[s],n,r))return!1}else{var l,c=v.keys(t);if(s=c.length,v.keys(e).length!==s)return!1;for(;s--;)if(l=c[s],!v.has(e,l)||!I(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0};v.isEqual=function(t,e){return I(t,e)},v.isEmpty=function(t){return null==t||(k(t)&&(v.isArray(t)||v.isString(t)||v.isArguments(t))?0===t.length:0===v.keys(t).length)},v.isElement=function(t){return!(!t||1!==t.nodeType)},v.isArray=h||function(t){return"[object Array]"===f.call(t)},v.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},v.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){v["is"+t]=function(e){return f.call(e)==="[object "+t+"]"}}),v.isArguments(arguments)||(v.isArguments=function(t){return v.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(v.isFunction=function(t){return"function"==typeof t||!1}),v.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},v.isNaN=function(t){return v.isNumber(t)&&t!==+t},v.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===f.call(t)},v.isNull=function(t){return null===t},v.isUndefined=function(t){return void 0===t},v.has=function(t,e){return null!=t&&c.call(t,e)},v.noConflict=function(){return n._=i,this},v.identity=function(t){return t},v.constant=function(t){return function(){return t}},v.noop=function(){},v.property=w,v.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},v.matcher=v.matches=function(t){return t=v.extendOwn({},t),function(e){return v.isMatch(e,t)}},v.times=function(t,e,n){var r=Array(Math.max(0,t));e=y(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},v.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},v.now=Date.now||function(){return(new Date).getTime()};var D={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},L=v.invert(D),R=function(t){var e=function(e){return t[e]},n="(?:"+v.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};v.escape=R(D),v.unescape=R(L),v.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),v.isFunction(r)?r.call(t):r};var B=0;v.uniqueId=function(t){var e=++B+"";return t?t+e:e},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,Y=function(t){return"\\"+q[t]};v.template=function(t,e,n){!e&&n&&(e=n),e=v.defaults({},e,v.templateSettings);var r=RegExp([(e.escape||F).source,(e.interpolate||F).source,(e.evaluate||F).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,u){return o+=t.slice(i,u).replace(U,Y),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var u=function(t){return a.call(this,t,v)},s=e.variable||"obj";return u.source="function("+s+"){\n"+o+"}",u},v.chain=function(t){var e=v(t);return e._chain=!0,e};var H=function(t,e){return t._chain?v(e).chain():e};v.mixin=function(t){v.each(v.functions(t),function(e){var n=v[e]=t[e];v.prototype[e]=function(){var t=[this._wrapped];return s.apply(t,arguments),H(this,n.apply(v,t))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];v.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],H(this,n)}}),v.each(["concat","join","slice"],function(t){var e=o[t];v.prototype[t]=function(){return H(this,e.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},void 0===(r=function(){return v}.apply(e,[]))||(t.exports=r)}).call(this)},"./node_modules/union-find/index.js":
/*!******************************************!*\
  !*** ./node_modules/union-find/index.js ***!
  \******************************************/
/*! no static exports found */function(t,e,n){"use strict";"use restrict";function r(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}t.exports=r;var i=r.prototype;Object.defineProperty(i,"length",{get:function(){return this.roots.length}}),i.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},i.find=function(t){for(var e=t,n=this.roots;n[t]!==t;)t=n[t];for(;n[e]!==t;){var r=n[e];n[e]=t,e=r}return t},i.link=function(t,e){var n=this.find(t),r=this.find(e);if(n!==r){var i=this.ranks,o=this.roots,a=i[n],u=i[r];a<u?o[n]=r:u<a?o[r]=n:(o[r]=n,++i[n])}}},"./node_modules/uniq/uniq.js":
/*!***********************************!*\
  !*** ./node_modules/uniq/uniq.js ***!
  \***********************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n){return 0===t.length?t:e?(n||t.sort(e),function(t,e){for(var n=1,r=t.length,i=t[0],o=t[0],a=1;a<r;++a)if(o=i,e(i=t[a],o)){if(a===n){n++;continue}t[n++]=i}return t.length=n,t}(t,e)):(n||t.sort(),function(t){for(var e=1,n=t.length,r=t[0],i=t[0],o=1;o<n;++o,i=r)if(i=r,(r=t[o])!==i){if(o===e){e++;continue}t[e++]=r}return t.length=e,t}(t))}},"./node_modules/util-extend/extend.js":
/*!********************************************!*\
  !*** ./node_modules/util-extend/extend.js ***!
  \********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){if(!e||"object"!=typeof e)return t;var n=Object.keys(e),r=n.length;for(;r--;)t[n[r]]=e[n[r]];return t}},"./node_modules/vectorize-text/index.js":
/*!**********************************************!*\
  !*** ./node_modules/vectorize-text/index.js ***!
  \**********************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){"object"==typeof e&&null!==e||(e={});return r(t,e.canvas||i,e.context||o,e)};var r=n(/*! ./lib/vtext */"./node_modules/vectorize-text/lib/vtext.js"),i=null,o=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,o=i.getContext("2d"))},"./node_modules/vectorize-text/lib/vtext.js":
/*!**************************************************!*\
  !*** ./node_modules/vectorize-text/lib/vtext.js ***!
  \**************************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e,n,r){var o=r.size||64,a=r.font||"normal";return n.font=o+"px "+a,n.textAlign="start",n.textBaseline="alphabetic",n.direction="ltr",c(function(t,e,n,r){var o=0|Math.ceil(e.measureText(n).width+2*r);if(o>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*r;t.height<a&&(t.height=a),e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff",e.fillText(n,r,2*r);var u=e.getImageData(0,0,o,a);return i(u.data,[a,o,4]).pick(-1,-1,0).transpose(1,0)}(e,n,t,o),r,o)},t.exports.processPixels=c;var r=n(/*! surface-nets */"./node_modules/surface-nets/surfacenets.js"),i=n(/*! ndarray */"./node_modules/ndarray/ndarray.js"),o=n(/*! simplify-planar-graph */"./node_modules/simplify-planar-graph/simplify.js"),a=n(/*! clean-pslg */"./node_modules/clean-pslg/clean-pslg.js"),u=n(/*! cdt2d */"./node_modules/cdt2d/cdt2d.js"),s=n(/*! planar-graph-to-polyline */"./node_modules/planar-graph-to-polyline/pg2pl.js");function l(t,e){var n=r(t,128);return e?o(n.cells,n.positions,.25):{edges:n.cells,positions:n.positions}}function f(t,e,n,r){var i=l(t,r),o=function(t,e,n){for(var r=e.textAlign||"start",i=e.textBaseline||"alphabetic",o=[1<<30,1<<30],a=[0,0],u=t.length,s=0;s<u;++s)for(var l=t[s],f=0;f<2;++f)o[f]=0|Math.min(o[f],l[f]),a[f]=0|Math.max(a[f],l[f]);var c=0;switch(r){case"center":c=-.5*(o[0]+a[0]);break;case"right":case"end":c=-a[0];break;case"left":case"start":c=-o[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+r+"'")}var h=0;switch(i){case"hanging":case"top":h=-o[1];break;case"middle":h=-.5*(o[1]+a[1]);break;case"alphabetic":case"ideographic":h=-3*n;break;case"bottom":h=-a[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var p=1/n;return"lineHeight"in e?p*=+e.lineHeight:"width"in e?p=e.width/(a[0]-o[0]):"height"in e&&(p=e.height/(a[1]-o[1])),t.map(function(t){return[p*(t[0]+c),p*(t[1]+h)]})}(i.positions,e,n),f=i.edges,c="ccw"===e.orientation;if(a(o,f),e.polygons||e.polygon||e.polyline){for(var h=s(f,o),p=new Array(h.length),d=0;d<h.length;++d){for(var m=h[d],g=new Array(m.length),v=0;v<m.length;++v){for(var y=m[v],_=new Array(y.length),b=0;b<y.length;++b)_[b]=o[y[b]].slice();c&&_.reverse(),g[v]=_}p[d]=g}return p}return e.triangles||e.triangulate||e.triangle?{cells:u(o,f,{delaunay:!1,exterior:!1,interior:!0}),positions:o}:{edges:f,positions:o}}function c(t,e,n){try{return f(t,e,n,!0)}catch(t){}try{return f(t,e,n,!1)}catch(t){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},"./node_modules/webpack/buildin/global.js":
/*!***********************************!*\
  !*** (webpack)/buildin/global.js ***!
  \***********************************/
/*! no static exports found */function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},"./node_modules/webpack/buildin/module.js":
/*!***********************************!*\
  !*** (webpack)/buildin/module.js ***!
  \***********************************/
/*! no static exports found */function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},"./node_modules/xtend/mutable.js":
/*!***************************************!*\
  !*** ./node_modules/xtend/mutable.js ***!
  \***************************************/
/*! no static exports found */function(t,e){t.exports=function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)n.call(r,i)&&(t[i]=r[i])}return t};var n=Object.prototype.hasOwnProperty},"./node_modules/zero-crossings/lib/zc-core.js":
/*!****************************************************!*\
  !*** ./node_modules/zero-crossings/lib/zc-core.js ***!
  \****************************************************/
/*! no static exports found */function(t,e,n){t.exports=n(/*! cwise-compiler */"./node_modules/cwise-compiler/compiler.js")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n        var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n        var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n        if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n          _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n        }\n      }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},"./node_modules/zero-crossings/zc.js":
/*!*******************************************!*\
  !*** ./node_modules/zero-crossings/zc.js ***!
  \*******************************************/
/*! no static exports found */function(t,e,n){"use strict";t.exports=function(t,e){var n=[];return e=+e||0,r(t.hi(t.shape[0]-1),n,e),n};var r=n(/*! ./lib/zc-core */"./node_modules/zero-crossings/lib/zc-core.js")},"./src/cameras/camera_interaction.js":
/*!*******************************************!*\
  !*** ./src/cameras/camera_interaction.js ***!
  \*******************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! gl-vec4 */"./node_modules/gl-vec4/index.js");t.exports=function(t,e,n,i,o,a,u,s,l){switch(e.type){case"wheel":e.dsx=e.dsy=Math.exp(-e.dy/100),e.dx=e.dy=0}if(e.buttons||-1!==["wheel","touch","pinch"].indexOf(e.type)){var f=t.x.inst_zoom,c=t.x.pan_by_zoom,h=t.x.pan_by_drag,p=t.y.inst_zoom,d=t.y.pan_by_zoom,m=t.y.pan_by_drag;"row-labels"===n&&(f=1,h=0,c=0),"col-labels"===n&&(p=1,m=0,d=0),"static"===n&&(f=1,h=0,c=0,p=1,m=0,d=0),e.preventDefault(),s[0]=f,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=p,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=c+h,s[13]=d+m,s[14]=0,s[15]=1,o.multiply(s,s,l),o.multiply(s,i,s),o.multiply(a,s,a)}var g=r.transformMat4([],r.transformMat4([],[e.x0,e.y0,0,1],i),o.invert([],a));e.x=g[0],e.y=g[1],u.emit("move",e)}},"./src/cameras/custom_camera_2d.js":
/*!*****************************************!*\
  !*** ./src/cameras/custom_camera_2d.js ***!
  \*****************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../interactions/interaction-events */"./src/interactions/interaction-events.js"),i=n(/*! xtend/mutable */"./node_modules/xtend/mutable.js"),o=n(/*! gl-mat4 */"./node_modules/gl-mat4/index.js"),a=n(/*! event-emitter */"./node_modules/event-emitter/index.js"),u=n(/*! ./camera_interaction */"./src/cameras/camera_interaction.js");o.viewport=function(t,e,n,r,i,o,a){return t[0]=.5*r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=.5*i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=.5*(a-o),t[11]=0,t[12]=e+.5*r,t[13]=n+.5*i,t[14]=.5*(a+o),t[15]=1,t},t.exports=function(t,e,n,s,l){var f=i({element:(n=n||{}).element||t._gl.canvas},n||{}).element,c=!0,h=f===window?function(){return f.innerWidth}:function(){return f.offsetWidth},p=f===window?function(){return f.innerHeight}:function(){return f.offsetHeight},d=void 0===n.xrange?[-1,1]:n.xrange,m=void 0===n.yrange?[-1,1]:n.yrange,g=void 0===n.aspectRatio?1:n.aspectRatio,v=h(),y=p(),_=.5*(d[1]+d[0])+e.shift_camera.x,b=.5*(m[1]+m[0])+e.shift_camera.y,x=.5*(d[1]-d[0]),w=x/g/v*y,M=o.identity([]);M[0]=1/x,M[5]=1/w,M[12]=-_/x,M[13]=-b/w;var j=o.identity([]),k=o.identity([]);function A(){v=h(),y=p(),o.viewport(j,0,y,v,-y,0,1),o.invert(k,j)}A();var z=[],E=new a;r({element:f}).on("interactionstart",function(t){t.preventDefault()}).on("interactionend",function(t){t.preventDefault()}).on("interaction",function(t){e.viz_interact&&u(s,t,l,k,o,M,E,z,j)});var S=t({context:{view:t.prop("view")}});return{draw:function(t){S({view:M},function(){t({dirty:c})}),c=!1},on:function(t,e){E.on(t,e)},off:function(t,e){E.off(t,e)},taint:function(){c=!0},resize:function(){A(),M[5]=M[0]*g*v/y,c=!0}}}},"./src/cameras/make_cameras.js":
/*!*************************************!*\
  !*** ./src/cameras/make_cameras.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./custom_camera_2d */"./src/cameras/custom_camera_2d.js");t.exports=function(t,e){var n=e.zoom_data;const i={};var o={xrange:[-1,1],yrange:[-1,1]};return i.mat=r(t,e,o,n,"matrix"),i["row-labels"]=r(t,e,o,n,"row-labels"),i["col-labels"]=r(t,e,o,n,"col-labels"),i.static=r(t,e,o,n,"static"),i}},"./src/cats/generate_cat_data.js":
/*!***************************************!*\
  !*** ./src/cats/generate_cat_data.js ***!
  \***************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){s={};var n,r,i,o=[],a=t.network[e+"_nodes"][0],u=_.keys(a),s={};_.each(u,function(t){t.indexOf("cat-")>=0&&(n=a[t],i=parseInt(t.split("cat-")[1],10),r=n.indexOf(": ")>=0?n.split(": ")[0]:t,s[i]=r)});var l,f=_.keys(s).sort();return _.each(f,function(t){(l={}).cat_title=s[t],l.cats=[],o.push(l)}),o}},"./src/cats/make_cat_args.js":
/*!***********************************!*\
  !*** ./src/cats/make_cat_args.js ***!
  \***********************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../draws/mat3_transform */"./src/draws/mat3_transform.js"),i=n(/*! ./../colors/color_to_rgba */"./src/colors/color_to_rgba.js");t.exports=function(t,e,n,o){var a,u,s,l="cat-"+String(o),f=i("purple",.95),c=e["num_"+n];"col"===n?(u=e.heat_size.x,s=e.mat_size.y,a=u/.5/c):(u=e.heat_size.y,s=e.mat_size.x,a=e.heat_size.y/.5/c);for(var h=-s-.04+.025*(o+1),p=[],d=0;d<c;d++){var m,g=e.network[n+"_nodes"][d][l];if("cat_colors"in e.network)if(l in e.network.cat_colors[n])try{m=e.network.cat_colors[n][l][g]}catch(t){m="white"}else m="white";else m="white";p[d]=i(m,1)}const v=t.buffer({length:c,usage:"dynamic"});v(p),e.color_arr=p;var y,_=r.scaling(2,1);"row"===n?y=0:"col"===n&&(y=Math.PI/2);var b=r.rotation(y);return{vert:"\n      precision highp float;\n      attribute vec2 ini_position;\n      attribute vec2 cat_pos_att_inst;\n      attribute vec2 cat_pos_att_new;\n      attribute vec4 color_att;\n      uniform float interp_uni;\n      uniform bool run_animation;\n\n\n      uniform mat3 mat_rotate;\n      uniform mat3 scale_y;\n      uniform mat4 zoom;\n      uniform float top_offset;\n\n      varying vec3 new_position;\n      varying vec3 vec_translate;\n      varying vec2 cat_pos;\n\n      // pass varying variable to fragment from vector\n      varying vec4 color_vary;\n\n      void main () {\n\n        new_position = vec3(ini_position, 0);\n\n        // interpolate between the two positions using the interpolate uniform\n        if (run_animation == true){\n          cat_pos = mix(cat_pos_att_inst, cat_pos_att_new, interp_uni);\n        } else {\n          cat_pos = cat_pos_att_inst;\n        }\n\n        vec_translate = vec3(top_offset, cat_pos[0], 0);\n\n        // rotate translated triangles\n        new_position = mat_rotate * ( new_position + vec_translate ) ;\n\n        // depth is being set to 0.45\n        gl_Position = zoom * vec4( vec2(new_position), 0.45, 1);\n\n        // pass attribute (in vert) to varying in frag\n        color_vary = color_att;\n\n      }\n    ",frag:"\n\n      precision mediump float;\n      uniform vec4 triangle_color;\n\n      // use the varying being passed from the vertex shader\n      varying vec4 color_vary;\n\n      // color triangle red\n      void main () {\n\n        // gl_FragColor = vec4(0.6, 0.6, 0.6, opacity_vary);\n\n        // defining the triangle color using a uniform\n        // gl_FragColor = triangle_color;\n\n        // define the triangle color using a varying\n        gl_FragColor = color_vary;\n      }\n\n    ",attributes:{ini_position:[[.04,a/2],[.02,a/2],[.04,-a/2],[.02,-a/2],[.04,-a/2],[.02,a/2]],cat_pos_att_inst:{buffer:t.buffer(e.cat_arrs.inst[n][o]),divisor:1},cat_pos_att_new:{buffer:t.buffer(e.cat_arrs.new[n][o]),divisor:1},color_att:{buffer:v,divisor:1}},uniforms:{zoom:function(t){return t.view},mat_rotate:b,scale_y:_,top_offset:h,triangle_color:f,interp_uni:(t,e)=>Math.max(0,Math.min(1,e.interp_prop)),run_animation:t.prop("run_animation")},count:6,instances:c,depth:{enable:!0,mask:!0,func:"less",range:[0,1]}}}},"./src/cats/make_cat_position_array.js":
/*!*********************************************!*\
  !*** ./src/cats/make_cat_position_array.js ***!
  \*********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r){var i,o,a=t["num_"+e];"col"===e?i=(o=t.heat_size.x)/.5/a:(o=t.heat_size.y,i=t.heat_size.y/.5/a);var u,s=[];for(u=0;u<a;u++){var l,f;"row"==e?(l=a-t.network[e+"_nodes"][u][r]-1,f=-(t.mat_size.y-t.heat_size.y)):(l=t.network[e+"_nodes"][u][r],f=t.mat_size.x-t.heat_size.x),s[u]=[o-i/2-l*i+f,0]}return s}},"./src/colors/color_table.js":
/*!***********************************!*\
  !*** ./src/colors/color_table.js ***!
  \***********************************/
/*! no static exports found */function(t,e){t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],transparent:[0,0,0,0],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],rebeccapurple:[102,51,153,1]}},"./src/colors/color_to_rgba.js":
/*!*************************************!*\
  !*** ./src/colors/color_to_rgba.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./color_table.js */"./src/colors/color_table.js");t.exports=function(t,e=1){var n;if(t in r){var i=r[t];i.push(e),n=[i[0],i[1],i[2],e]}else{var o;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(t))3==(o=t.substring(1).split("")).length&&(o=[o[0],o[0],o[1],o[1],o[2],o[2]]),n=[((o="0x"+o.join(""))>>16&255)/256,(o>>8&255)/256,(255&o)/256,e];else n=[0,0,0,e]}return n}},"./src/control_panel/build_control_panel.js":
/*!**************************************************!*\
  !*** ./src/control_panel/build_control_panel.js ***!
  \**************************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../reorders/run_reorder */"./src/reorders/run_reorder.js");n(/*! ./../../img/graham_cracker_144.png */"./img/graham_cracker_144.png");t.exports=function(t,e){var n=d3.select(e.params.root+" .control-container")[0][0],i=e.params.viz_width,o=d3.select(n).style("height","135px").style("width",i+"px").append("svg").style("height","135px").style("width",i+"px");o.append("rect").style("height","135px").style("width",i+"px").style("position","absolute").style("fill","white").attr("class","control-panel-background");o.append("rect").style("height","1px").style("width",i+"px").style("position","absolute").style("stroke","#eee").style("stroke-width",3).attr("transform",function(){return"translate( 0, 134)"});var a={height:32,width:63,buffer:12};a.x_trans=a.width+a.buffer,a.fs=12;var u={row:{},col:{}};u.row.x_trans=65,u.col.x_trans=65;u.col.y_trans=47,u.row.y_trans=u.col.y_trans+a.height+a.buffer;var s=["clust","sum","var","disp","alpha"];o.append("text").classed("reorder_title",!0).text("reorder".toUpperCase()).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",400).style("font-size",a.fs).style("text-anchor","middle").style("stroke","#47515b").style("alignment-baseline","middle").style("letter-spacing","2px").style("cursor","default").style("-webkit-user-select","none").attr("transform",function(){return"translate( 247, "+(47-2*a.buffer+2)+")"}),o.append("rect").style("height","1px").style("width",function(){return(s.length+1)*a.width-a.buffer}).style("position","absolute").style("stroke","#eee").style("stroke-width",2).attr("transform",function(){return"translate( "+(a.x_trans-a.buffer+1)+", "+(47-a.buffer+2)+")"}),_.each(["row","col"],function(n){o.append("g").attr("transform",function(){return"translate(0, "+u[n].y_trans+")"}).append("text").classed("reorder_title",!0).text(n.toUpperCase()).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",400).style("font-size",a.fs).style("text-anchor","middle").style("stroke","#47515b").style("alignment-baseline","middle").style("letter-spacing","2px").style("cursor","default").style("-webkit-user-select","none").attr("transform","translate(30, "+a.height/2+")");var i=o.append("g");i.classed(n+"-reorder-buttons",!0);var l=i.selectAll("g").data(s).enter().append("g").attr("transform",function(t,e){return"translate("+(a.x_trans*e+u[n].x_trans)+", "+u[n].y_trans+")"}).on("click",function(i){var o=i.replace("sum","rank").replace("var","rankvar");e.params.inst_order[n]!=o&&"disp"!=o&&(r(t,e,n,i),d3.select(e.params.root+" ."+n+"-reorder-buttons").selectAll("rect").style("stroke","#eee"),d3.select(this).select("rect").style("stroke","red"))});l.append("rect").style("height",a.height).style("width",a.width).style("fill","white").style("rx",10).style("ry",10).style("stroke",function(t){return e.params.inst_order[n]==t?"red":"#eee"}).style("stroke-width",2.5),l.append("text").classed("button-name",!0).text(function(t){return t.toUpperCase()}).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",400).style("font-size",a.fs).style("text-anchor","middle").style("stroke","#47515b").style("alignment-baseline","middle").style("letter-spacing","2px").style("cursor","default").style("-webkit-user-select","none").attr("transform","translate("+a.width/2+", "+a.height/2+")")})}},"./src/dendrogram/make_dendro_args.js":
/*!********************************************!*\
  !*** ./src/dendrogram/make_dendro_args.js ***!
  \********************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../draws/mat3_transform */"./src/draws/mat3_transform.js"),i=n(/*! ./../colors/color_to_rgba */"./src/colors/color_to_rgba.js");t.exports=function(t,e,n){var o,a,u,s,l=i("#eee",1);"row"===n?(o=0,a=e.heat_size.y,u=e.mat_size.x,s=-(e.mat_size.y-e.heat_size.y)):"col"===n&&(o=Math.PI/2,a=e.heat_size.x,u=e.mat_size.y,s=e.mat_size.x-e.heat_size.x);for(var f=e["num_"+n],c=1/f*(a/.5),h=u/.5*.5,p=[],d=0;d<f;d++)p[d]=a-c/2-d*c;const m=t.buffer({length:f,type:"float",usage:"dynamic"});m(p);var g=r.scaling(1,1);return{vert:"\n      precision highp float;\n      attribute vec2 position;\n      attribute float y_offset_att;\n\n      uniform mat3 mat_rotate;\n      uniform mat3 mat_scale;\n      uniform mat4 zoom;\n      uniform float x_offset;\n      uniform float y_shift;\n\n      varying vec3 new_position;\n      varying vec3 vec_translate;\n\n      void main () {\n\n        new_position = vec3(position, 0);\n\n        vec_translate = vec3(x_offset, y_offset_att + y_shift, 0);\n\n        // new_position = mat_rotate * mat_scale * new_position + vec_translate;\n        new_position = mat_rotate * ( mat_scale * new_position + vec_translate ) ;\n\n        // depth is being set to 0.45\n        gl_Position = zoom * vec4(new_position[0], new_position[1], 0.40, 1);\n\n      }\n    ",frag:"\n\n      precision highp float;\n      uniform vec4 triangle_color;\n\n      // color triangle red\n      void main () {\n        // gl_FragColor = vec4(0.0, 1, 0.0, 1);\n        gl_FragColor = triangle_color;\n      }\n\n    ",attributes:{position:[[0,c/2],[.0125,0],[0,-c/2]],y_offset_att:{buffer:m,divisor:1}},uniforms:{zoom:function(t){return t.view},mat_rotate:r.rotation(o),mat_scale:g,x_offset:h,y_shift:s,triangle_color:l},count:3,instances:f,depth:{enable:!0,mask:!0,func:"less",range:[0,1]}}}},"./src/draws/draw_axis_components.js":
/*!*******************************************!*\
  !*** ./src/draws/draw_axis_components.js ***!
  \*******************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../matrix_labels/make_col_text_args */"./src/matrix_labels/make_col_text_args.js"),i=n(/*! ./../matrix_labels/make_row_text_args */"./src/matrix_labels/make_row_text_args.js"),o=n(/*! ./../params/calc_viz_area */"./src/params/calc_viz_area.js"),a=n(/*! ./../matrix_labels/calc_text_triangles */"./src/matrix_labels/calc_text_triangles.js"),u=n(/*! ./../matrix_labels/make_viz_aid_tri_args */"./src/matrix_labels/make_viz_aid_tri_args.js"),s=n(/*! ./interp_fun */"./src/draws/interp_fun.js");t.exports=function(t,e,n,l=!1){var f;f="col"===n?"x":"y",e.cameras[n+"-labels"].draw(()=>{var c;(e.viz_aid_tri_args[n]=u(t,e,n),t(e.viz_aid_tri_args[n])(),_.each(e.cat_args[n],function(n){t(n)({interp_prop:s(e),run_animation:e.animation.running})}),t(e.dendro_args[n])(),c="col"===n?r(t,e,e.zoom_function):i(t,e,e.zoom_function),l)?e["num_"+n]/e.zoom_data[f].total_zoom<e.max_num_text&&(o(e),e["num_"+n]>e.max_num_text&&(e.text_triangles.draw[n]=a(e,n)),t(c)(e.text_triangles.draw[n])):0!=e.text_triangles.draw[n]&&t(c)(e.text_triangles.draw[n])})}},"./src/draws/draw_commands.js":
/*!************************************!*\
  !*** ./src/draws/draw_commands.js ***!
  \************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./draw_matrix_components */"./src/draws/draw_matrix_components.js"),i=n(/*! ./draw_axis_components */"./src/draws/draw_axis_components.js"),o=n(/*! ./draw_tooltip_components */"./src/draws/draw_tooltip_components.js"),a=n(/*! ./draw_spillover_components */"./src/draws/draw_spillover_components.js");t.exports=function(t,e){r(t,e),i(t,e,"row",e.slow_draw),i(t,e,"col",e.slow_draw),a(t,e),e.show_tooltip&&e.in_bounds_tooltip&&o(t,e),e.slow_draw&&(e.slow_draw=!1),e.show_tooltip&&(e.show_tooltip=!1)}},"./src/draws/draw_matrix_components.js":
/*!*********************************************!*\
  !*** ./src/draws/draw_matrix_components.js ***!
  \*********************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./interp_fun */"./src/draws/interp_fun.js");t.exports=function(t,e){e.cameras.mat.draw(()=>{t(e.matrix_args.regl_props.rects)({interp_prop:r(e),run_animation:e.animation.running})})}},"./src/draws/draw_spillover_components.js":
/*!************************************************!*\
  !*** ./src/draws/draw_spillover_components.js ***!
  \************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){e.cameras.static.draw(()=>{var n=e.spillover_args,r=e.spillover_triangles;t(n.mat_sides)(r.mat_sides),t(n.cats)(r.cats),t(n.mat_corners)(r.mat_corners),t(n.label_corners)(r.label_corners)})}},"./src/draws/draw_tooltip_components.js":
/*!**********************************************!*\
  !*** ./src/draws/draw_tooltip_components.js ***!
  \**********************************************/
/*! no static exports found */function(t,e,n){const r=n(/*! ./../tooltip/make_tooltip_text_args */"./src/tooltip/make_tooltip_text_args.js");var i=n(/*! ./../tooltip/calc_tooltip_background_triangles */"./src/tooltip/calc_tooltip_background_triangles.js");t.exports=function(t,e){e.cameras.static.draw(()=>{var n,o,a=e.tooltip_args,u=i(t,e);t(a)(u),n=r(t,e,3),o=e.mouseover.text_triangles["line-1"],t(n)(o),e.cat_num.col>0&&(n=r(t,e,1.5),o=e.mouseover.text_triangles["line-2"],t(n)(o))})}},"./src/draws/interp_fun.js":
/*!*********************************!*\
  !*** ./src/draws/interp_fun.js ***!
  \*********************************/
/*! no static exports found */function(t,e,n){const r=n(/*! eases/cubic-in-out */"./node_modules/eases/cubic-in-out.js");t.exports=function(t){return r((t.time-t.animation.last_switch_time)/t.animation.switch_duration)}},"./src/draws/mat3_transform.js":
/*!*************************************!*\
  !*** ./src/draws/mat3_transform.js ***!
  \*************************************/
/*! no static exports found */function(t,e){t.exports={translation:function(t,e){return[1,0,0,0,1,0,t,e,1]},rotation:function(t){var e=Math.cos(t),n=Math.sin(t);return[e,-n,0,n,e,0,0,0,1]},scaling:function(t,e){return[t,0,0,0,e,0,0,0,1]}}},"./src/draws/run_viz.js":
/*!******************************!*\
  !*** ./src/draws/run_viz.js ***!
  \******************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../params/initialize_params */"./src/params/initialize_params.js"),i=n(/*! ./draw_commands */"./src/draws/draw_commands.js");_=n(/*! underscore */"./node_modules/underscore/underscore.js");var o=n(/*! ./../interactions/final_mouseover_frame */"./src/interactions/final_mouseover_frame.js"),a=n(/*! ./../interactions/final_interaction_frame */"./src/interactions/final_interaction_frame.js"),u=n(/*! ./../matrix_labels/update_text_triangle_order */"./src/matrix_labels/update_text_triangle_order.js"),s=n(/*! ./../matrix_labels/get_ordered_labels */"./src/matrix_labels/get_ordered_labels.js");t.exports=function(t,e){var n=r(t,e);n.first_frame=!0;return t.frame(function({time:e}){n.time=e,n.animation.loop=0,n.animation.run_switch?(n.animation.run_switch=!1,n.animation.last_switch_time=e,n.animation.running=!0):n.time>n.animation.last_switch_time+n.animation.switch_duration&&!0===n.animation.running&&(n.animation.running=!1,n.animation.run_switch=!1,n.matrix_args.regl_props.rects.attributes.pos_att_ini={buffer:t.buffer(n.arrs.position_arr.new),divisor:1},_.each(["row","col"],function(e){for(var r=0;r<n.cat_num[e];r++)n.cat_args[e][r].attributes.cat_pos_att_inst={buffer:t.buffer(n.cat_arrs.new[e][r]),divisor:1};n.inst_order[e]=n.new_order[e]}),_.each(["row","col"],function(t){n.text_triangles.draw[t]=u(n,t)}),s(n)),1==n.still_interacting||1==n.initialize_viz||n.animation.running?(n.zoom_data.x.total_int=n.zoom_data.x.total_int+1,i(t,n),setTimeout(a,100,t,n),n.initialize_viz=!1,n.animation.time_remain>0&&(n.animation.time_remain=n.animation.time_remain-1)):1==n.still_mouseover?(n.zoom_data.x.total_mouseover=n.zoom_data.x.total_mouseover+1,n.remove_tooltip_frame&&(n.show_tooltip=!1,i(t,n)),n.remove_tooltip_frame&&(n.remove_tooltip_frame=!1),setTimeout(o,100,t,n)):(n.slow_draw||n.show_tooltip)&&(i(t,n),n.remove_tooltip_frame=!0,n.show_tooltip&&(n.show_tooltip=!1))}),n}},"./src/interactions/final_interaction_frame.js":
/*!*****************************************************!*\
  !*** ./src/interactions/final_interaction_frame.js ***!
  \*****************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){e.zoom_data.x.total_int=e.zoom_data.x.total_int-1,0==e.zoom_data.x.total_int&&0==e.initialize_viz&&(0==e.first_frame?(e.slow_draw=!0,e.zoom_data.x.total_mouseover):e.first_frame=!1)}},"./src/interactions/final_mouseover_frame.js":
/*!***************************************************!*\
  !*** ./src/interactions/final_mouseover_frame.js ***!
  \***************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){e.zoom_data.x.total_mouseover=e.zoom_data.x.total_mouseover-1,0==e.zoom_data.x.total_mouseover&&0==e.still_mouseover&&(e.show_tooltip=!0)}},"./src/interactions/find_mouseover_element.js":
/*!****************************************************!*\
  !*** ./src/interactions/find_mouseover_element.js ***!
  \****************************************************/
/*! no static exports found */function(t,e,n){const r=n(/*! vectorize-text */"./node_modules/vectorize-text/index.js");var i=n(/*! ./restrict_rel_min */"./src/interactions/restrict_rel_min.js");t.exports=function(t,e,n){var o={textAlign:"right",textBaseline:"middle",triangles:!0,size:e.font_detail,font:'"Open Sans", verdana, arial, sans-serif'},a=e.viz_dim.heat;e.zoom_data.x.cursor_position=n.x0,e.zoom_data.y.cursor_position=n.y0;var u={};u.x=e.viz_dim.canvas.width*e.offcenter.x/2,u.y=e.viz_dim.canvas.height*e.offcenter.y/2;var s={};if(s.x=n.x0-a.x.min-u.x,s.y=n.y0-a.y.min-u.y,s.x=i(s.x,a.width,e.zoom_data.x),s.y=i(s.y,a.height,e.zoom_data.y),s.x<a.width&&s.y<a.height){var l,f=Math.floor(s.y/e.tile_pix_height),c=Math.floor(s.x/e.tile_pix_width);e.mouseover.row_name=e.ordered_labels.rows[f],e.mouseover.col_name=e.ordered_labels.cols[c],e.mouseover.row_name.includes(": ")&&(e.mouseover.row_name=e.mouseover.row_name.split(": ")[1]),e.mouseover.col_name.includes(": ")&&(e.mouseover.col_name=e.mouseover.col_name.split(": ")[1]),0==e.cat_num.col?(l=e.mouseover.row_name+" and "+e.mouseover.col_name,e.mouseover.text_triangles["line-1"]=r(l,o),e.mouseover.text_triangles["line-1"].offset=[0,0]):(l=e.mouseover.row_name+" and "+e.mouseover.col_name,e.mouseover.text_triangles["line-1"]=r(l,o),e.mouseover.text_triangles["line-1"].offset=[0,0],e.mouseover.col_cat=e.ordered_labels.col_cats[c],l=e.mouseover.col_cat,e.mouseover.text_triangles["line-2"]=r(l,o),e.mouseover.text_triangles["line-2"].offset=[0,0]),e.in_bounds_tooltip=!0}else e.in_bounds_tooltip=!1}},"./src/interactions/interaction-events.js":
/*!************************************************!*\
  !*** ./src/interactions/interaction-events.js ***!
  \************************************************/
/*! no static exports found */function(t,e,n){t.exports=function(t){var e,n,l=r({element:window,constrainZoom:!1},t||{}),f=u({}),c=l.element,h=!1,p=[null,null],d=[null,null],m=!1,g=0,v={},y=0,_={},b=o(c,function(t,e,n,r){y=t,_=r});function x(t,e){return t.preventDefault=e.preventDefault.bind(e),t.stopPropagation=e.stopPropagation.bind(e),t}function w(t){var e=this.getBoundingClientRect();v.type="wheel",v.buttons=y,v.mods=_,v.x0=t.x-e.left,v.y0=t.y-e.top,v.dx=t.deltaX,v.dy=t.deltaY,v.dz=t.deltaZ,v.dsx=1,v.dsy=1,v.dsz=1,v.theta=0,v.dtheta=0,f.emit("interaction",x(v,t))}function M(t){e=i.x(t),n=i.y(t),v.type="mousedown",v.buttons=y,v.mods=_,v.x0=e,v.y0=n,v.dx=0,v.dy=0,v.dz=0,v.dsx=1,v.dsy=1,v.dsz=1,v.theta=0,v.dtheta=0,f.emit("interactionend",x(v,t))}function j(t){var r=i.x(t),o=i.y(t);v.type="mousemove",v.buttons=y,v.mods=_,v.x0=r,v.y0=o,v.dx=r-e,v.dy=o-n,v.dz=0,v.dsx=1,v.dsy=1,v.dsz=1,v.theta=0,v.dtheta=0,e=r,n=o,f.emit("interaction",x(v,t))}function k(t){for(var e=t.identifier,n=0;n<d.length;n++)if(d[n]&&d[n].touch&&d[n].touch.identifier===e)return n;return-1}function A(t){p=[null,null];for(var e=0;e<t.changedTouches.length;e++){var n=t.changedTouches[e],r=n.identifier,i=k(r);if(-1===i&&g<2){var o=0===g,u=d[0]?1:0,l=new s;d[u]=l,g+=1,l.touch=n,a(n,c,l.position),o||(m=!1)}}g>0&&(v.type=1===g?"touchstart":"pinchstart",v.buttons=0,v.mods={},v.x0=0,v.y0=0,v.dx=0,v.dy=0,v.dz=0,v.dsx=1,v.dsy=1,v.dsz=1,v.theta=0,v.dtheta=0,f.emit("interactionstart",x(v,t)))}function z(t){for(var e,n=!1,r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];-1!==(e=k(i))&&(n=!0,d[e].touch=i,a(i,c,d[e].position))}if(n)if(1===g){for(e=0;e<d.length&&!d[e];e++);if(d[e]&&p[e]){var o=d[e].position[0],u=d[e].position[1],s=o-p[e][0],l=u-p[e][1];v.type="touch",v.buttons=0,v.mods={},v.x0=o,v.y0=u,v.dx=s,v.dy=l,v.dz=0,v.dsx=1,v.dsy=1,v.dsz=1,v.theta=0,v.dtheta=0,f.emit("interaction",x(v,t))}}else if(2===g&&p[0]&&p[1]){var h=p[0],m=p[1],y=m[0]-h[0],_=m[1]-h[1],b=d[0].position,w=d[1].position,M=w[0]-b[0],j=w[1]-b[1],A=Math.sqrt(y*y+_*_),z=Math.atan2(_,y),E=Math.sqrt(M*M+j*j),S=Math.atan2(j,M),T=.5*(m[0]+h[0]),C=.5*(m[1]+h[1]);s=.5*(w[0]+b[0]-h[0]-m[0]),l=.5*(w[1]+b[1]-h[1]-m[1]);var P=E/A,O=S-z;v.type="pinch",v.buttons=0,v.mods={},v.x0=T,v.y0=C,v.dx=s,v.dy=l,v.dz=0,v.dsx=P,v.dsy=P,v.dsz=1,v.theta=S,v.dtheta=O,f.emit("interaction",x(v,t))}d[0]&&(p[0]=d[0].position.slice()),d[1]&&(p[1]=d[1].position.slice())}function E(t){for(var e=0;e<t.changedTouches.length;e++){var n=t.changedTouches[e],r=k(n);-1!==r&&(d[r]=null,g-=1)}m||2===g||(m=!0),g<2&&(v.type=0===g?"touchend":"pinchend",v.buttons=0,v.mods={},v.x0=0,v.y0=0,v.dx=0,v.dy=0,v.dz=0,v.dsx=1,v.dsy=1,v.dsz=1,v.theta=0,v.dtheta=0,f.emit("interactionend",x(v,t)))}function S(){h||(h=!0,b.enabled=!0,c.addEventListener("wheel",w,!1),c.addEventListener("mousedown",M,!1),c.addEventListener("mousemove",j,!1),c.addEventListener("touchstart",A,!1),c.addEventListener("touchmove",z,!1),c.addEventListener("touchend",E,!1),c.addEventListener("touchcancel",E,!1))}return S(),f.enable=S,f.disable=function(){h&&(h=!1,b.enabled=!1,c.removeEventListener("wheel",w,!1),c.removeEventListener("mousedown",M,!1),c.removeEventListener("mousemove",j,!1),c.removeEventListener("touchstart",A,!1),c.removeEventListener("touchmove",z,!1),c.removeEventListener("touchend",E,!1),c.removeEventListener("touchcancel",E,!1))},f};var r=n(/*! util-extend */"./node_modules/util-extend/extend.js"),i=n(/*! mouse-event */"./node_modules/mouse-event/mouse.js"),o=n(/*! mouse-change */"./node_modules/mouse-change/mouse-listen.js"),a=n(/*! mouse-event-offset */"./node_modules/mouse-event-offset/index.js"),u=n(/*! event-emitter */"./node_modules/event-emitter/index.js");function s(){this.position=[0,0],this.touch=null}},"./src/interactions/keep_track_of_interactions.js":
/*!********************************************************!*\
  !*** ./src/interactions/keep_track_of_interactions.js ***!
  \********************************************************/
/*! no static exports found */function(t,e){t.exports=function(t){0==t.still_interacting&&(t.still_interacting=!0,setTimeout(function(){t.still_interacting=!1},1e3))}},"./src/interactions/keep_track_of_mouseovers.js":
/*!******************************************************!*\
  !*** ./src/interactions/keep_track_of_mouseovers.js ***!
  \******************************************************/
/*! no static exports found */function(t,e){t.exports=function(t){0==t.still_mouseover&&(t.still_mouseover=!0,setTimeout(function(){t.still_mouseover=!1},1e3))}},"./src/interactions/restrict_rel_min.js":
/*!**********************************************!*\
  !*** ./src/interactions/restrict_rel_min.js ***!
  \**********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){return(t=t/n.total_zoom-n.total_pan_min)<0?t=0:t>e&&(t=e),t}},"./src/interactions/track_interaction_zoom_data.js":
/*!*********************************************************!*\
  !*** ./src/interactions/track_interaction_zoom_data.js ***!
  \*********************************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../zoom/zoom_rules_low_mat */"./src/zoom/zoom_rules_low_mat.js"),i=n(/*! ./find_mouseover_element */"./src/interactions/find_mouseover_element.js"),o=n(/*! ./keep_track_of_interactions */"./src/interactions/keep_track_of_interactions.js"),a=n(/*! ./keep_track_of_mouseovers */"./src/interactions/keep_track_of_mouseovers.js");t.exports=function(t,e,n){var u=e.zoom_data,s=e.zoom_restrict,l=e.viz_dim;if(n.buttons||-1!==["wheel","touch","pinch"].indexOf(n.type)){switch(n.type){case"wheel":n.dsx=n.dsy=Math.exp(-n.dy/100),n.dx=n.dy=0}var f;u.x.inst_zoom=n.dsx,u.x.pan_by_drag=n.dx,u.x.cursor_position=n.x0,u.y.inst_zoom=n.dsy,u.y.pan_by_drag=n.dy,u.y.cursor_position=n.y0,u.y.total_zoom<s.y.ratio?(u.x.inst_zoom=1,(f=u.y.total_zoom*u.y.inst_zoom)>s.y.ratio&&(u.x.inst_zoom=f/s.y.ratio)):u.x.total_zoom<s.x.ratio&&(u.y.inst_zoom=1,(f=u.x.total_zoom*u.x.inst_zoom)>s.x.ratio&&(u.x.inst_zoom=f/s.x.ratio)),u.x=r(e,s.x,u.x,l.heat.x,l.mat.x,"x"),u.y=r(e,s.y,u.y,l.heat.y,l.mat.y,"y"),o(e)}else"mousemove"===n.type&&(a(e),i(t,e,n))}},"./src/main.js":
/*!*********************!*\
  !*** ./src/main.js ***!
  \*********************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./draws/run_viz */"./src/draws/run_viz.js"),i=n(/*! ./control_panel/build_control_panel */"./src/control_panel/build_control_panel.js");t.exports=function(t){var e=t.network,o=t.container;d3.select(o).append("div").attr("class","control-container").style("cursor","default"),d3.select(o).append("div").attr("class","canvas-container").style("cursor","default");var a=d3.select(o).select(".canvas-container")[0][0],u=t.viz_height,s=t.viz_width;d3.select(a).style("height",u+"px").style("width",s+"px");var l=n(/*! regl */"./node_modules/regl/dist/regl.js")({extensions:["angle_instanced_arrays"],container:a}),f=r(l,e),c={};return c.params=f,c.params.viz_height=u,c.params.viz_width=s,c.params.root="#"+t.container.id,c.params.canvas_root=c.params.root+" .canvas-container",c.params.container=t.container,c.params.canvas_container=a,i(l,c),c}},"./src/matrix_cells/calc_row_downsampled_mat.js":
/*!******************************************************!*\
  !*** ./src/matrix_cells/calc_row_downsampled_mat.js ***!
  \******************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e=!1){var n=t.mat_data;if(e){n=(n=t.mat_data).slice(0,5);var r=[];_.each(n,function(t){t=t.slice(0,3),r.push(t)}),t.mat_data=r,t.is_downsampled=!0}}},"./src/matrix_cells/make_matrix_args.js":
/*!**********************************************!*\
  !*** ./src/matrix_cells/make_matrix_args.js ***!
  \**********************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./make_position_arr */"./src/matrix_cells/make_position_arr.js"),i=n(/*! ./make_opacity_arr */"./src/matrix_cells/make_opacity_arr.js");t.exports=function(t,e){e.arrs={},e.arrs.opacity_arr=i(e),e.arrs.position_arr={},e.arrs.position_arr.ini=r(e,e.inst_order.row,e.inst_order.col),e.arrs.position_arr.new=r(e,e.new_order.row,e.new_order.col);var n=t.buffer({type:"float",usage:"dynamic"})(e.arrs.opacity_arr),o=e.tile_width,a=e.tile_height,u=[[o,0],[o,a],[0,a],[o,0],[0,0],[0,a]],s=e.arrs.position_arr.ini.length,l=e.zoom_function,f={vert:"\n    precision highp float;\n    attribute vec2 position;\n    attribute vec2 pos_att_ini, pos_att_new;\n    attribute float opacity_att;\n    uniform mat4 zoom;\n    uniform bool run_animation;\n    uniform float interp_uni;\n    varying vec2 pos;\n\n    // pass varying variables to fragment from vector\n    varying float opacity_vary;\n\n    void main() {\n\n      // interpolate between the two positions using the interpolate uniform\n      if (run_animation == true){\n        pos = mix(pos_att_ini, pos_att_new, interp_uni);\n      } else {\n        pos = pos_att_ini;\n      }\n\n      gl_Position = zoom *\n                    vec4( position.x + pos.x,\n                          position.y + pos.y,\n                          0.75,\n                          1\n                        );\n\n      // pass attribute (in vert) to varying in frag\n      opacity_vary = opacity_att;\n\n    }",frag:"\n    precision highp float;\n\n    // use the varying being passed from the vertex shader\n    varying float opacity_vary;\n\n    void main() {\n\n      if (opacity_vary > 0.0){\n        gl_FragColor = vec4(1, 0, 0, abs(opacity_vary));\n      } else {\n        gl_FragColor = vec4(0, 0, 1, abs(opacity_vary));\n      }\n\n    }",attributes:{position:u,pos_att_ini:{buffer:t.buffer(e.arrs.position_arr.ini),divisor:1},pos_att_new:{buffer:t.buffer(e.arrs.position_arr.new),divisor:1},opacity_att:{buffer:n,divisor:1}},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:1,dstRGB:"one minus src alpha",dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},count:6,uniforms:{zoom:l,interp_uni:(t,e)=>Math.max(0,Math.min(1,e.interp_prop)),run_animation:t.prop("run_animation")},instances:s,depth:{enable:!1}},c={regl_props:{}};return c.regl_props.rects=f,c}},"./src/matrix_cells/make_opacity_arr.js":
/*!**********************************************!*\
  !*** ./src/matrix_cells/make_opacity_arr.js ***!
  \**********************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=t.mat_data,n=[].concat.apply([],e),r=_.max(n,function(t){return Math.abs(t)}),i=d3.scale.linear(),o=r;return i.domain([-o,o]).range([-1,1]).clamp(!0),n=n.map(function(t){return i(t)})}},"./src/matrix_cells/make_position_arr.js":
/*!***********************************************!*\
  !*** ./src/matrix_cells/make_position_arr.js ***!
  \***********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r=t.network,i=t.mat_data.length,o=t.mat_data[0].length,a={};a.x=t.mat_size.x,a.y=t.mat_size.y;var u=Array(o).fill().map(function(e,n){return n/o*(t.heat_size.x/.5)-(a.x-2*(a.x-t.heat_size.x))}),s=Array(i).fill().map(function(e,n){return-n/i*(t.heat_size.y/.5)+a.y-1/i/(.5/t.heat_size.y)-2*(a.y-t.heat_size.y)}),l={};l.x_arr=u,l.y_arr=s;var f,c,h=r.row_nodes,p=r.col_nodes;return t.row_positions=_.range(h.length),Array(i*o).fill().map(function(r,a){var u=a%o,s=Math.floor(a/o);t.is_downsampled?(f=s,c=u):(f=i-1-h[s][e],c=o-1-p[u][n]);var d=l.y_arr[f],m=l.x_arr[c];return t.row_positions[s]=d,[m,d]})}},"./src/matrix_labels/calc_text_triangles.js":
/*!**************************************************!*\
  !*** ./src/matrix_labels/calc_text_triangles.js ***!
  \**************************************************/
/*! no static exports found */function(t,e,n){const r=n(/*! vectorize-text */"./node_modules/vectorize-text/index.js");t.exports=function(t,e){var n,i=t.inst_order[e],o=t.new_order[e],a=t.network[e+"_nodes"],u=t["num_"+e],s={textAlign:"left",triangles:!0,size:t.font_detail,font:'"Open Sans", verdana, arial, sans-serif'};"col"===e?(n="x",s.textAlign="left",s.textBaseline="bottom"):(n="y",s.textAlign="right",s.textBaseline="middle");var l,f,c=t.canvas_pos[n+"_arr"],h=[],p=t.viz_area,d={};return _.each(a,function(a,m){if(_.each(["inst","new"],function(n){f="inst"===n?i:o,"col"===e?(l=t.network[e+"_nodes"][m][f],d[n]=c[u-1-l]+.5/u):(l=u-1-t.network[e+"_nodes"][m][f],d[n]=c[l]+.5/u)}),d.inst>p[n+"_min"]&&d.inst<p[n+"_max"]){var g,v=a.name;v.indexOf(": ")>=0&&(v=a.name.split(": ")[1]),v in t.text_triangles[e]?g=t.text_triangles[e][v]:(g=r(v,s),t.text_triangles[e][v]=g),g.inst_offset=[0,d.inst],g.new_offset=[0,d.new],h.push(g);var y={};y.y=d.inst,y.name=v}}),h}},"./src/matrix_labels/get_ordered_labels.js":
/*!*************************************************!*\
  !*** ./src/matrix_labels/get_ordered_labels.js ***!
  \*************************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e,n={},r=t.network.row_nodes,i=t.network.col_nodes;n.rows=[],n.cols=[],n.col_cats=[],_.each(r,function(r){e=t.num_row-1-r[t.inst_order.row],n.rows[e]=r.name});var o=!1;t.cat_num.col>0&&(o=!0),_.each(i,function(r){e=t.num_col-1-r[t.inst_order.col],n.cols[e]=r.name,o&&(n.col_cats[e]=r["cat-0"])}),t.ordered_labels=n}},"./src/matrix_labels/make_col_text_args.js":
/*!*************************************************!*\
  !*** ./src/matrix_labels/make_col_text_args.js ***!
  \*************************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../draws/mat3_transform */"./src/draws/mat3_transform.js"),i=n(/*! ./../draws/interp_fun */"./src/draws/interp_fun.js");t.exports=function(t,e,n){var o=e.heat_size.x/e.num_col;e.text_scale.col=d3.scale.linear().domain([1,10]).range([1,10/e.allowable_zoom_factor.col]);var a=e.num_col/5;e.text_scale.col=d3.scale.linear().domain([1,e.max_zoom]).range([1,a]);var u=e.num_col,s=1/e.num_col*e.zoom_data.x.total_zoom,l=e.text_zoom.col.max_webgl_fs;s>l&&(u*=s/l);var f=r.rotation(Math.PI/4),c=r.scaling(1,e.zoom_data.x.total_zoom),h=o,p=-.5*(o/Math.sqrt(2));return{vert:"\n      precision mediump float;\n      attribute vec2 position;\n      uniform mat4 zoom;\n      uniform vec2 inst_offset;\n      uniform vec2 new_offset;\n      uniform float y_offset;\n      uniform float scale_text;\n      uniform mat3 mat_rotate;\n      uniform mat3 text_y_scale;\n      uniform float total_zoom;\n      uniform float col_width;\n      varying vec3 rotated_text;\n      varying vec3 position_cols;\n      uniform float heat_size;\n      varying vec3 xy_positions;\n      varying float x_position;\n      varying float y_position;\n      uniform float shift_text_out;\n      uniform float shift_text_right;\n      uniform float shift_text_up;\n      uniform float shift_heat;\n      uniform float interp_uni;\n      uniform bool run_animation;\n      varying vec2 mixed_offset;\n\n      // last value is a sort-of zoom\n      void main () {\n\n        // rotate, reduce size, stretch in y, and give text triangles positions\n        // shifting text up in the original text triangle units\n        rotated_text = text_y_scale *\n                       mat_rotate *\n                       vec3(position.y/scale_text, position.x/scale_text, 0.0);\n\n        // the y position is constant for all column labels\n        //---------------------------------------------------------------\n        // working on shifting text up\n        //---------------------------------------------------------------\n        y_position = y_offset;\n\n        // the x position varies for all column labelss\n        //---------------------------------------------------------------\n        // interpolate between the two positions using the interpolate uniform\n        if (run_animation){\n          mixed_offset = mix(inst_offset, new_offset , interp_uni);\n        } else {\n          mixed_offset = inst_offset;\n        }\n\n        // mixed_offset = inst_offset;\n\n        x_position = (mixed_offset[1] * 2.0 * heat_size + shift_heat + shift_text_right);\n\n        position_cols = vec3( x_position, y_position, 0.10);\n\n        xy_positions = rotated_text + position_cols;\n\n        // reverse y position to get words to be upright\n        ////////////////////////////\n        // vec4: x, y, depth, zoom\n        ////////////////////////////\n        gl_Position = zoom * vec4( xy_positions, 1.0);\n\n      }",frag:"\n      precision mediump float;\n      void main () {\n        gl_FragColor = vec4(0.2, 0.2, 0.2, 1.0);\n      }",attributes:{position:t.prop("positions")},elements:t.prop("cells"),uniforms:{zoom:n,inst_offset:t.prop("inst_offset"),new_offset:t.prop("new_offset"),scale_text:u,y_offset:e.mat_size.y,heat_size:e.heat_size.x,shift_heat:e.mat_size.x-e.heat_size.x,shift_text_right:h,shift_text_out:0,shift_text_up:p,mat_rotate:f,text_y_scale:c,total_zoom:e.zoom_data.x.total_zoom,col_width:o,interp_uni:()=>Math.max(0,Math.min(1,i(e))),run_animation:e.animation.running},depth:{enable:!0,mask:!0,func:"less",range:[0,1]}}}},"./src/matrix_labels/make_row_text_args.js":
/*!*************************************************!*\
  !*** ./src/matrix_labels/make_row_text_args.js ***!
  \*************************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../draws/mat3_transform */"./src/draws/mat3_transform.js"),i=n(/*! ./../draws/interp_fun */"./src/draws/interp_fun.js");t.exports=function(t,e,n){var o=e.num_row,a=1/e.num_row*e.zoom_data.y.total_zoom,u=e.text_zoom.row.max_webgl_fs;a>u&&(o*=a/u);var s=r.rotation(Math.PI/2),l=e.mat_size.x+.02;return{vert:"\n      precision mediump float;\n      attribute vec2 position;\n      uniform mat4 zoom;\n      uniform vec2 inst_offset;\n      uniform vec2 new_offset;\n      uniform float x_offset;\n      uniform float scale_text;\n      uniform float total_zoom;\n      uniform mat3 mat_rotate;\n      uniform float heat_size;\n      varying float x_position;\n      varying float y_position;\n      uniform float shift_heat;\n      uniform float interp_uni;\n      uniform bool run_animation;\n      varying vec2 mixed_offset;\n\n      // vec3 tmp = vec3(1,1,1);\n\n      // last value is a sort-of zoom\n      void main () {\n\n        // reverse y position to get words to be upright\n\n        // the x position is constant for all row labels\n        //------------------------------------------------------\n        // total_zoom stretches out row labels horizontally\n        // then text is offset to the left side of the heatmap\n        //------------------------------------------------------\n        x_position = position.x/scale_text * total_zoom - x_offset;\n\n        // the y position varies for all row labels\n        //------------------------------------------------------\n        // shift by offset and then uniformly shift down by s\n        // shift_heat\n        //------------------------------------------------------\n        // interpolate between the two positions using the interpolate uniform\n        if (run_animation){\n          mixed_offset = mix(inst_offset, new_offset , interp_uni);\n        } else {\n          mixed_offset = inst_offset;\n        }\n\n        // mixed_offset = inst_offset;\n\n        y_position = -position.y/scale_text + 2.0 * heat_size * mixed_offset[1] - shift_heat ;\n\n        gl_Position = zoom *\n                      vec4(x_position,\n                           y_position,\n                           0.50,\n                           1.0);\n      }",frag:"\n      precision mediump float;\n      void main () {\n        gl_FragColor = vec4(0.2, 0.2, 0.2, 1.0);\n      }",attributes:{position:t.prop("positions")},elements:t.prop("cells"),uniforms:{zoom:n,inst_offset:t.prop("inst_offset"),new_offset:t.prop("new_offset"),scale_text:o,x_offset:l,heat_size:e.heat_size.y,shift_heat:e.mat_size.y-e.heat_size.y,total_zoom:e.zoom_data.y.total_zoom,mat_rotate:s,interp_uni:()=>Math.max(0,Math.min(1,i(e))),run_animation:e.animation.running},depth:{enable:!0,mask:!0,func:"less",range:[0,1]}}}},"./src/matrix_labels/make_viz_aid_tri_args.js":
/*!****************************************************!*\
  !*** ./src/matrix_labels/make_viz_aid_tri_args.js ***!
  \****************************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../draws/mat3_transform */"./src/draws/mat3_transform.js"),i=n(/*! ./../colors/color_to_rgba */"./src/colors/color_to_rgba.js"),o=n(/*! ./make_viz_aid_tri_pos_arr */"./src/matrix_labels/make_viz_aid_tri_pos_arr.js"),a=n(/*! ./../draws/interp_fun */"./src/draws/interp_fun.js");t.exports=function(t,e,n){var u,s,l,f,c=i("#eee",1),h=e["num_"+n];"col"===n?(u=(l=e.heat_size.x)/h*e.zoom_data.x.total_zoom,s=l/h,f=-e.mat_size.y-u):(u=.0125,s=(l=e.heat_size.y)/h,f=-e.mat_size.x-u);var p,d=o(e,n,e.inst_order[n]),m=o(e,n,e.new_order[n]),g=r.scaling(2,1);"row"===n?p=0:"col"===n&&(p=Math.PI/2);var v=r.rotation(p),y=e.zoom_data.x.total_zoom;return{vert:"\n      precision highp float;\n      attribute vec2 ini_position;\n      attribute float tri_offset_att_inst;\n      attribute float tri_offset_att_new;\n\n      uniform mat3 mat_rotate;\n      uniform mat3 scale_y;\n      uniform mat4 zoom;\n      uniform float top_offset;\n      uniform float total_zoom;\n      uniform float interp_uni;\n      uniform bool run_animation;\n\n      varying vec3 new_position;\n      varying vec3 vec_translate;\n      varying vec2 viz_aid_pos;\n\n      void main () {\n\n        new_position = vec3(ini_position, 0);\n\n        // interpolate between the two positions using the interpolate uniform\n        if (run_animation){\n          viz_aid_pos = mix(vec2(tri_offset_att_inst, 0), vec2(tri_offset_att_new, 0), interp_uni);\n        } else{\n          viz_aid_pos = vec2(tri_offset_att_inst, 0);\n        }\n\n        vec_translate = vec3(top_offset, viz_aid_pos);\n\n        // rotate translated triangles\n        new_position = mat_rotate * ( new_position + vec_translate ) ;\n\n        // depth is being set to 0.45\n        gl_Position = zoom * vec4( vec2(new_position), 0.45, 1);\n\n      }\n    ",frag:"\n\n      precision highp float;\n      uniform vec4 triangle_color;\n\n      // color triangle red\n      void main () {\n\n        // defining the triangle color using a uniform\n        gl_FragColor = triangle_color;\n\n      }\n\n    ",attributes:{ini_position:[[u,s],[0,0],[u,-s]],tri_offset_att_inst:{buffer:t.buffer(d),divisor:1},tri_offset_att_new:{buffer:t.buffer(m),divisor:1}},uniforms:{zoom:function(t){return t.view},mat_rotate:v,scale_y:g,top_offset:f,triangle_color:c,total_zoom:y,interp_uni:()=>Math.max(0,Math.min(1,a(e))),run_animation:e.animation.running},count:3,instances:h,depth:{enable:!0,mask:!0,func:"less",range:[0,1]}}}},"./src/matrix_labels/make_viz_aid_tri_pos_arr.js":
/*!*******************************************************!*\
  !*** ./src/matrix_labels/make_viz_aid_tri_pos_arr.js ***!
  \*******************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n){var r,i,o=t["num_"+e];i="col"===e?(r=t.heat_size.x)/o:(r=t.heat_size.y)/o;var a,u=[];for(a=0;a<o;a++){var s,l;"row"==e?(s=o-t.network[e+"_nodes"][a][n]-1,l=-(t.mat_size.y-t.heat_size.y)):(s=t.network[e+"_nodes"][a][n],l=t.mat_size.x-t.heat_size.x),u[a]=r-i-2*s*i+l}return u}},"./src/matrix_labels/update_text_triangle_order.js":
/*!*********************************************************!*\
  !*** ./src/matrix_labels/update_text_triangle_order.js ***!
  \*********************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){var n,r,i,o=t.inst_order[e],a=t.new_order[e],u=t.text_triangles.draw[e],s=t["num_"+e];n="col"===e?"x":"y";var l={},f=t.canvas_pos[n+"_arr"];return _.each(u,function(n,u){_.each(["inst","new"],function(n){i="inst"===n?o:a,"col"===e?(r=t.network[e+"_nodes"][u][i],l[n]=f[s-1-r]+.5/s):(r=s-1-t.network[e+"_nodes"][u][i],l[n]=f[r]+.5/s)}),n.inst_offset=[0,l.inst],n.new_offset=[0,l.new]}),u}},"./src/params/calc_alpha_order.js":
/*!****************************************!*\
  !*** ./src/params/calc_alpha_order.js ***!
  \****************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../utils/utils_clust */"./src/utils/utils_clust.js");t.exports=function(t){var e,n;return _.each(["row","col"],function(i){var o=t[i+"_nodes"];e=r.pluck(o,"name"),t[i+"_node_names"]=e,n=e.sort(),_.map(o,function(t){var r=e.length-n.indexOf(t.name)-1;t.alpha=r})}),t}},"./src/params/calc_row_and_col_canvas_positions.js":
/*!*********************************************************!*\
  !*** ./src/params/calc_row_and_col_canvas_positions.js ***!
  \*********************************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=t.num_col,n=t.num_row,r={};r.x=t.center.x,r.y=t.center.y;var i=Array(e).fill().map(function(t,n){return n/e-r.x}),o=Array(n).fill().map(function(t,e){return-e/n+r.y-1/n}),a={};return a.x_arr=i,a.y_arr=o,a}},"./src/params/calc_viz_area.js":
/*!*************************************!*\
  !*** ./src/params/calc_viz_area.js ***!
  \*************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=t.zoom_data,n=t.viz_dim.heat.width,r=t.viz_dim.heat.height,i=t.pix_to_webgl,o={};o.x_min=-e.x.total_pan_min,o.x_max=n+e.x.total_pan_max,o.y_min=-e.y.total_pan_min,o.y_max=r+e.y.total_pan_max;var a={};a.x_min=i.x(o.x_min)-0,a.x_max=i.x(o.x_max)+0,a.y_max=i.y(o.y_min)-0,a.y_min=i.y(o.y_max)+0,t.viz_area=a}},"./src/params/calc_viz_dim.js":
/*!************************************!*\
  !*** ./src/params/calc_viz_dim.js ***!
  \************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! xtend/mutable */"./node_modules/xtend/mutable.js");t.exports=function(t,e){var n=n||{},i=r({element:n.element||t._gl.canvas},n||{}).element,o={canvas:{}};_.each(["width","height"],function(t){o.canvas[t]=Number.parseFloat(d3.select(i).style(t).replace("px",""))}),o.mat={},o.mat.width=e.mat_size.x*o.canvas.width,o.mat.height=e.mat_size.y*o.canvas.height,o.mat.x={},o.mat.x.min=o.canvas.width/2-o.mat.width/2,o.mat.x.max=o.canvas.width/2+o.mat.width/2,o.mat.y={},o.mat.y.min=o.canvas.height/2-o.mat.height/2,o.mat.y.max=o.canvas.height/2+o.mat.height/2,o.heat={},o.heat.width=e.heat_size.x*o.canvas.width,o.heat.height=e.heat_size.y*o.canvas.height;var a={};return a.x=(o.mat.width-o.heat.width)/2,o.heat.x={},o.heat.x.min=o.canvas.width/2-o.heat.width/2+a.x,o.heat.x.max=o.canvas.width/2+o.heat.width/2,a.y=(o.mat.height-o.heat.height)/2,o.heat.y={},o.heat.y.min=o.canvas.height/2-o.heat.height/2+a.y,o.heat.y.max=o.canvas.height/2+o.heat.height/2+a.y,o}},"./src/params/initialize_params.js":
/*!*****************************************!*\
  !*** ./src/params/initialize_params.js ***!
  \*****************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./calc_row_and_col_canvas_positions */"./src/params/calc_row_and_col_canvas_positions.js"),i=n(/*! ./../matrix_labels/calc_text_triangles */"./src/matrix_labels/calc_text_triangles.js"),o=n(/*! ./calc_viz_dim */"./src/params/calc_viz_dim.js"),a=n(/*! ./../zoom/ini_zoom_data */"./src/zoom/ini_zoom_data.js"),u=n(/*! ./../zoom/ini_zoom_restrict */"./src/zoom/ini_zoom_restrict.js"),s=n(/*! ./../zoom/zoom_rules_high_mat */"./src/zoom/zoom_rules_high_mat.js"),l=n(/*! ./../cameras/make_cameras */"./src/cameras/make_cameras.js"),f=n(/*! ./../spillover/calc_spillover_triangles */"./src/spillover/calc_spillover_triangles.js"),c=n(/*! ./../matrix_cells/make_matrix_args */"./src/matrix_cells/make_matrix_args.js"),h=n(/*! ./../dendrogram/make_dendro_args */"./src/dendrogram/make_dendro_args.js"),p=n(/*! ./../spillover/make_spillover_args */"./src/spillover/make_spillover_args.js"),d=n(/*! ./calc_viz_area */"./src/params/calc_viz_area.js"),m=n(/*! ./../matrix_cells/calc_row_downsampled_mat */"./src/matrix_cells/calc_row_downsampled_mat.js"),g=n(/*! ./../cats/make_cat_args */"./src/cats/make_cat_args.js"),v=n(/*! ./../cats/generate_cat_data */"./src/cats/generate_cat_data.js"),y=n(/*! ./../matrix_labels/get_ordered_labels */"./src/matrix_labels/get_ordered_labels.js"),b=n(/*! ./../tooltip/make_tooltip_background_args */"./src/tooltip/make_tooltip_background_args.js"),x=n(/*! ./../cats/make_cat_position_array */"./src/cats/make_cat_position_array.js"),w=n(/*! ./calc_alpha_order */"./src/params/calc_alpha_order.js");t.exports=function(t,e){var n={time:0,viz_interact:!0,animation:{}};n.animation.time_remain=0,n.animation.loop=n.time%5,n.animation.running=!1,n.animation.run_switch=!1,n.animation.last_switch_time=0,n.animation.switch_duration=3,n.initialize_viz=!0,n.first_frame=!0,e=w(e),n.network=e;n.zoom_function=function(t){return t.view},n.still_interacting=!1,n.still_mouseover=!1,n.mat_data=e.mat,n.mat_size={},n.mat_size.x=.8,n.mat_size.y=.8,n.cat_data={},n.cat_data.row=v(n,"row"),n.cat_data.col=v(n,"col"),n.cat_num={},n.cat_num.row=n.cat_data.row.length,n.cat_num.col=n.cat_data.col.length,n.cat_room={},n.cat_room.x=.015,n.cat_room.y=.015,n.heat_size={},n.heat_size.x=n.mat_size.x-n.cat_room.x*n.cat_num.row,n.heat_size.y=n.mat_size.y-n.cat_room.y*n.cat_num.col,n.num_row=n.mat_data.length,n.num_col=n.mat_data[0].length,n.tile_width=n.heat_size.x/.5/n.num_col,n.tile_height=n.heat_size.y/.5/n.num_row,n.center={},n.center.x=.5,n.center.y=.5,n.offcenter={};n.offcenter.x=.075,n.offcenter.y=.075,n.shift_camera={},n.shift_camera.x=-.075,n.shift_camera.y=.075,n.slow_draw=!1,n.zoom_data=a(),n.canvas_pos=r(n),n.text_triangles={},n.text_triangles.row={},n.text_triangles.col={};n.is_downsampled=!1,m(n,!1),n.inst_order={},n.inst_order.row="clust",n.inst_order.col="clust",n.new_order={},n.new_order.row="clust",n.new_order.col="clust",n.viz_aid_tri_args={},n.cat_args={},n.cat_args.row=[],n.cat_args.col=[],n.cat_arrs={},n.cat_arrs.inst={},n.cat_arrs.inst.row={},n.cat_arrs.inst.col={},n.cat_arrs.new={},n.cat_arrs.new.row={},n.cat_arrs.new.col={},_.each(["row","col"],function(e){for(var r=0;r<n.cat_num[e];r++)n.cat_arrs.inst[e][r]=x(n,e,r,n.inst_order[e]),n.cat_arrs.new[e][r]=x(n,e,r,n.new_order[e]),n.cat_args[e][r]=g(t,n,e,r)}),n.dendro_args={},n.dendro_args.row=h(t,n,"row"),n.dendro_args.col=h(t,n,"col");var M={},j=[1,1,1,1];n.spill_depth={},n.spill_depth.mat_sides=.5,M.mat_sides=p(t,n.spill_depth.mat_sides,j),n.spill_depth.cats=.5,M.cats=p(t,n.spill_depth.cats,j),n.spill_depth.mat_corners=.2,M.mat_corners=p(t,n.spill_depth.mat_corners,j),n.spill_depth.label_corners=.001,M.label_corners=p(t,n.spill_depth.label_corners,j),n.spillover_args=M,n.show_tooltip=!1,n.remove_tooltip_frame=!0,n.in_bounds_tooltip=!1,n.tooltip={},n.tooltip.background_opacity=.75,n.tooltip_args=b(t,n,1e-4,[0,0,0,n.tooltip.background_opacity]),n.viz_dim=o(t,n);var k,A={},z=n.viz_dim.heat.width,E=n.viz_dim.heat.height;n.tile_pix_width=n.viz_dim.heat.width/n.num_col,n.tile_pix_height=n.viz_dim.heat.height/n.num_row,A.x=d3.scale.linear(),A.x.domain([0,z]).range([-.5,.5]).clamp(!0),A.y=d3.scale.linear(),A.y.domain([0,E]).range([.5,-.5]).clamp(!0),y(n),n.mouseover={},n.mouseover.row_name=null,n.mouseover.col_name=null,n.mouseover.text_triangles={},n.pix_to_webgl=A,n.text_zoom={},n.text_zoom.row={},n.text_zoom.row.scaled_num=n.num_row,n.text_zoom.row.reference=n.text_zoom.row.scaled_num,n.text_zoom.row.factor=1,n.text_zoom.row.max_webgl_fs=.05,n.text_zoom.col={},n.text_zoom.col.scaled_num=n.num_col,n.text_zoom.col.reference=n.text_zoom.col.scaled_num,n.text_zoom.col.factor=1,n.text_zoom.col.max_webgl_fs=.06,n.font_detail=20,d(n),n.max_num_text=75,n.text_triangles.draw={},_.each(["row","col"],function(t){n["num_"+t]>n.max_num_text?n.text_triangles.draw[t]=!1:n.text_triangles.draw[t]=i(n,t)}),k=n.num_col<n.num_row?n.num_col:n.num_row,n.max_zoom=k/4,n.zoom_restrict=u(n),s(t,n),n.cameras=l(t,n),n.spillover_triangles=f(n),window.addEventListener("resize",n.cameras.mat.resize),window.addEventListener("resize",n.cameras["row-labels"].resize),n.matrix_args=c(t,n);var S=d3.scale.linear().domain([10,1e3]).range([2,30]);return n.allowable_zoom_factor={},n.allowable_zoom_factor.col=S(n.num_col),n.allowable_zoom_factor.row=S(n.num_col),n.text_scale={},n.cat_colors=n.network.cat_colors,n}},"./src/reorders/reorder_cat_args.js":
/*!******************************************!*\
  !*** ./src/reorders/reorder_cat_args.js ***!
  \******************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../cats/make_cat_position_array */"./src/cats/make_cat_position_array.js");t.exports=function(t,e){var n=e.params;_.each(["row","col"],function(e){for(var i=0;i<n.cat_num[e];i++)n.cat_arrs.new[e][i]=r(n,e,i,n.new_order[e]),n.cat_args[e][i].attributes.cat_pos_att_new={buffer:t.buffer(n.cat_arrs.new[e][i]),divisor:1}})}},"./src/reorders/reorder_matrix_args.js":
/*!*********************************************!*\
  !*** ./src/reorders/reorder_matrix_args.js ***!
  \*********************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../matrix_cells/make_position_arr */"./src/matrix_cells/make_position_arr.js");t.exports=function(t,e){var n=e.params;n.arrs.position_arr.new=r(n,n.new_order.row,n.new_order.col),n.matrix_args.regl_props.rects.attributes.pos_att_new={buffer:t.buffer(n.arrs.position_arr.new),divisor:1}}},"./src/reorders/run_reorder.js":
/*!*************************************!*\
  !*** ./src/reorders/run_reorder.js ***!
  \*************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./reorder_cat_args */"./src/reorders/reorder_cat_args.js"),i=n(/*! ./reorder_matrix_args */"./src/reorders/reorder_matrix_args.js"),o=n(/*! ./../matrix_labels/update_text_triangle_order */"./src/matrix_labels/update_text_triangle_order.js");t.exports=function(t,e,n,a){var u=e.params,s=a.replace("sum","rank").replace("var","rankvar");u.animation.run_switch=!0,u.new_order[n]=s,i(t,e),r(t,e),0!=e.params.text_triangles.draw[n]&&u["num_"+n]<u.max_num_text?u.text_triangles.draw[n]=o(u,n):u.text_triangles.draw[n]=!1}},"./src/spillover/calc_spillover_triangles.js":
/*!***************************************************!*\
  !*** ./src/spillover/calc_spillover_triangles.js ***!
  \***************************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=t.viz_dim,n=t.mat_size,r=t.heat_size,i=e.canvas.height/e.canvas.width,o={};o.x=n.x/i,o.y=n.y/i;var a={};a.x=r.x/i,a.y=r.y/i;var u={},s={};return s.x=t.mat_size.x-t.heat_size.x,s.y=t.mat_size.y-t.heat_size.y,u.mat_sides=[{pos:[[-1,1],[-n.x+t.offcenter.x,-1],[-1,-1]]},{pos:[[-1,1],[-n.x+t.offcenter.x,1],[-n.x+t.offcenter.x,-1]]},{pos:[[1,1],[n.x+t.offcenter.x,-1],[1,-1]]},{pos:[[1,1],[n.x+t.offcenter.x,1],[n.x+t.offcenter.x,-1]]},{pos:[[-n.x+t.offcenter.x,1],[-n.x+t.offcenter.x,o.y-t.offcenter.y],[n.x+t.offcenter.x,1]]},{pos:[[n.x+t.offcenter.x,1],[n.x+t.offcenter.x,o.y-t.offcenter.y],[-n.x+t.offcenter.x,o.y-t.offcenter.y]]},{pos:[[-n.x+t.offcenter.x,-1],[-n.x+t.offcenter.x,-o.y-t.offcenter.y],[n.x+t.offcenter.x,-1]]},{pos:[[n.x+t.offcenter.x,-1],[n.x+t.offcenter.x,-o.y-t.offcenter.y],[-n.x+t.offcenter.x,-o.y-t.offcenter.y]]}],u.cats=[{pos:[[r.x+s.x+t.offcenter.x,o.y-t.offcenter.y],[-r.x+s.x+t.offcenter.x,a.y-s.y-t.offcenter.y],[r.x+s.x+t.offcenter.x,a.y-s.y-t.offcenter.y]]},{pos:[[-r.x+s.x+t.offcenter.x,o.y-t.offcenter.y],[n.x+t.offcenter.x,o.y-t.offcenter.y],[-r.x+s.x+t.offcenter.x,a.y-s.y-t.offcenter.y]]},{pos:[[-n.x+t.offcenter.x,-o.y-t.offcenter.y],[-n.x+t.offcenter.x,a.y-s.y-t.offcenter.y],[-r.x+s.x+t.offcenter.x,a.y-s.y-t.offcenter.y]]},{pos:[[-n.x+t.offcenter.x,-o.y-t.offcenter.y],[-r.x+s.x+t.offcenter.x,-o.y-t.offcenter.y],[-r.x+s.x+t.offcenter.x,a.y-s.y-t.offcenter.y]]}],u.mat_corners=[{pos:[[-1,1],[-r.x+s.x+t.offcenter.x,a.y-s.y-t.offcenter.y],[-1,a.y-s.y-t.offcenter.y]]},{pos:[[-1,1],[-r.x+s.x+t.offcenter.x,1],[-r.x+s.x+t.offcenter.x,a.y-s.y-t.offcenter.y]]},{pos:[[-1,-1],[-n.x+t.offcenter.x,-o.y-t.offcenter.y],[-1,-o.y-t.offcenter.y]]},{pos:[[-1,-1],[-n.x+t.offcenter.x,-1],[-n.x+t.offcenter.x,-o.y-t.offcenter.y]]},{pos:[[1,1],[n.x+t.offcenter.x,o.y-t.offcenter.y],[1,o.y-t.offcenter.y]]},{pos:[[1,1],[n.x+t.offcenter.x,1],[n.x+t.offcenter.x,o.y-t.offcenter.y]]},{pos:[[1,-1],[n.x+t.offcenter.x,-o.y-t.offcenter.y],[1,-o.y-t.offcenter.y]]},{pos:[[1,-1],[n.x+t.offcenter.x,-1],[n.x+t.offcenter.x,-o.y-t.offcenter.y]]}],u.label_corners=[{pos:[[-1,1],[-r.x+s.x+t.offcenter.x,a.y-s.y-t.offcenter.y],[-1,a.y-s.y-t.offcenter.y]]},{pos:[[-1,1],[-r.x+s.x+t.offcenter.x,1],[-r.x+s.x+t.offcenter.x,a.y-s.y-t.offcenter.y]]},{pos:[[-1,-1],[-r.x+s.x+t.offcenter.x,-o.y-t.offcenter.y],[-1,-o.y-t.offcenter.y]]},{pos:[[-1,-1],[-r.x+s.x+t.offcenter.x,-1],[-r.x+s.x+t.offcenter.x,-o.y-t.offcenter.y]]},{pos:[[1,o.y+1-n.y-2*t.offcenter.x],[n.x+t.offcenter.x,o.y-t.offcenter.y],[1,o.y-t.offcenter.y]]},{pos:[[1,o.y-t.offcenter.y],[n.x+t.offcenter.x,a.y-s.y-t.offcenter.y],[1,a.y-s.y-t.offcenter.y]]},{pos:[[n.x+t.offcenter.x,o.y-t.offcenter.y],[1,o.y-t.offcenter.y],[n.x+t.offcenter.x,a.y-s.y-t.offcenter.y]]},{pos:[[1,-1],[n.x+t.offcenter.x,-o.y-t.offcenter.y],[1,-o.y-t.offcenter.y]]},{pos:[[1,-1],[n.x+t.offcenter.x,-1],[n.x+t.offcenter.x,-o.y-t.offcenter.y]]}],u}},"./src/spillover/make_spillover_args.js":
/*!**********************************************!*\
  !*** ./src/spillover/make_spillover_args.js ***!
  \**********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n=[1,1,1,1]){return{frag:"\n    precision mediump float;\n    uniform vec4 color;\n    void main () {\n      gl_FragColor = color;\n    }",vert:"\n    precision mediump float;\n    attribute vec2 position;\n    uniform float inst_depth;\n    void main () {\n      // positioned further up (matrix is lower at 0.)\n      gl_Position = vec4(position, inst_depth, 1);\n    }",attributes:{position:t.prop("pos")},uniforms:{color:n,inst_depth:e},count:3,depth:{enable:!0,mask:!0,func:"less",range:[0,1]}}}},"./src/tooltip/calc_tooltip_background_triangles.js":
/*!**********************************************************!*\
  !*** ./src/tooltip/calc_tooltip_background_triangles.js ***!
  \**********************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e){var n=e.zoom_data.x.cursor_position/e.viz_dim.canvas.width*2,r=e.zoom_data.y.cursor_position/e.viz_dim.canvas.height*2;return[{pos:[[-1+n-.5,1-r+.1],[-1+n,1-r],[-1+n-.5,1-r]]},{pos:[[-1+n-.5,1-r+.1],[-1+n,1-r+.1],[-1+n,1-r]]}]}},"./src/tooltip/make_tooltip_background_args.js":
/*!*****************************************************!*\
  !*** ./src/tooltip/make_tooltip_background_args.js ***!
  \*****************************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r){return{frag:"\n    precision mediump float;\n    uniform vec4 color;\n    void main () {\n      gl_FragColor = color;\n    }",vert:"\n    precision mediump float;\n    attribute vec2 position;\n    uniform float inst_depth;\n    void main () {\n      // positioned further up (matrix is lower at 0.)\n      gl_Position = vec4(position, inst_depth, 1);\n    }",attributes:{position:t.prop("pos")},uniforms:{color:r,inst_depth:n},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:1,dstRGB:"one minus src alpha",dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},count:3}}},"./src/tooltip/make_tooltip_text_args.js":
/*!***********************************************!*\
  !*** ./src/tooltip/make_tooltip_text_args.js ***!
  \***********************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n=2.5){var r=e.zoom_data.x.cursor_position/e.viz_dim.canvas.width*2-1,i=1-e.zoom_data.y.cursor_position/e.viz_dim.canvas.height*2;return{vert:"\n      precision mediump float;\n      attribute vec2 position;\n      uniform float scale_text;\n      varying float x_position;\n      varying float y_position;\n      uniform float inst_depth;\n      uniform float offset_x;\n      uniform float offset_y;\n      uniform float line_offset;\n\n      void main () {\n\n        x_position =  (position.x - 1.0)/scale_text + offset_x;\n        y_position = -(position.y - line_offset)/scale_text + offset_y;\n\n        gl_Position =\n                      vec4(\n                           x_position,\n                           y_position,\n                           inst_depth,\n                           1.0);\n      }",frag:"\n      precision mediump float;\n      void main () {\n        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n      }",attributes:{position:t.prop("positions")},elements:t.prop("cells"),uniforms:{scale_text:40,inst_depth:1e-5,offset_x:r,offset_y:i,line_offset:n},depth:{enable:!0,mask:!0,func:"less",range:[0,1]}}}},"./src/utils/utils_clust.js":
/*!**********************************!*\
  !*** ./src/utils/utils_clust.js ***!
  \**********************************/
/*! no static exports found */function(t,e,n){var r=n(/*! underscore */"./node_modules/underscore/underscore.js");t.exports={normal_name:function(t){return t.name.replace(/_/g," ").split("#")[0]},is_supported_order:function(t){return"ini"===t||"clust"===t||"rank_var"===t||"rank"===t||"class"===t||"alpha"==t},has:function(t,e){return null!=t&&hasOwnProperty.call(t,e)},property:function(t){return function(e){return null==e?void 0:e[t]}},pluck:function(t,e){if(window._){if("function"==typeof r.pluck)return r.pluck(t,e);if("function"==typeof r.map)return r.map(t,this.property(e))}else if(t.map&&"function"==typeof t.map)return t.map(this.property(e))},is_undefined:function(t){return void 0===t},extend:function(t,e){for(var n in t=t||{},e)"object"==typeof e[n]?t[n]=this.extend(t[n],e[n]):t[n]=e[n];return t}}},"./src/zoom/ini_zoom_data.js":
/*!***********************************!*\
  !*** ./src/zoom/ini_zoom_data.js ***!
  \***********************************/
/*! no static exports found */function(t,e){t.exports=function(){var t={};return _.each(["x","y"],function(e){var n={total_zoom:1,cursor_position:0,total_pan_min:0,total_pan_max:0,pan_room:0,pan_by_zoom:0,pan_by_drag:0,inst_zoom:1,filter_zoom:1,prev_restrict:!1,zoom_step:10,show_text:!1,still_zooming:!1,total_int:0,total_mouseover:0};t[e]=n}),t}},"./src/zoom/ini_zoom_restrict.js":
/*!***************************************!*\
  !*** ./src/zoom/ini_zoom_restrict.js ***!
  \***************************************/
/*! no static exports found */function(t,e){t.exports=function(t){var e=t.num_row,n=t.num_col,r=t.max_zoom,i={x:{}};i.x.max=r,i.x.min=1,i.x.ratio=1,i.y={},i.y.max=r,i.y.min=1,i.y.ratio=1;var o=n/t.viz_dim.heat.width/(e/t.viz_dim.heat.height);return e>n?(i.y.max=i.y.max*(1/o),i.y.ratio=1/o):n>e&&(i.x.max=i.x.max*o,i.x.ratio=o),i}},"./src/zoom/zoom_rules_high_mat.js":
/*!*****************************************!*\
  !*** ./src/zoom/zoom_rules_high_mat.js ***!
  \*****************************************/
/*! no static exports found */function(t,e,n){var r=n(/*! ./../interactions/interaction-events */"./src/interactions/interaction-events.js"),i=n(/*! xtend/mutable */"./node_modules/xtend/mutable.js"),o=n(/*! ./../interactions/track_interaction_zoom_data */"./src/interactions/track_interaction_zoom_data.js");t.exports=function(t,e){var n=n||{},a=i({element:n.element||t._gl.canvas},n||{}).element;r({element:a}).on("interaction",function(n){e.viz_interact?o(t,e,n):n.buttons})}},"./src/zoom/zoom_rules_low_mat.js":
/*!****************************************!*\
  !*** ./src/zoom/zoom_rules_low_mat.js ***!
  \****************************************/
/*! no static exports found */function(t,e){t.exports=function(t,e,n,r,i,o){var a;a="x"===o?t.viz_dim.canvas.width*t.offcenter[o]/2:t.viz_dim.canvas.height*t.offcenter[o]/2;var u=_.clone(n),s=e.max,l=e.min;1==n.total_zoom&&n.inst_zoom<1&&(n.inst_zoom=1);var f=n.total_zoom*n.inst_zoom;f<s&&f>l?n.total_zoom=f:f>=s?n.inst_zoom<1?n.total_zoom=n.total_zoom*n.inst_zoom:(n.inst_zoom=s/n.total_zoom,n.total_zoom=s):f<=l&&(n.inst_zoom>1?n.total_zoom=n.total_zoom*n.inst_zoom:(n.inst_zoom=l/n.total_zoom,n.total_zoom=l));var c=i.max-r.max;n.inst_zoom>1&&(n.pan_by_drag=0),n.pan_by_drag>0&&n.total_pan_min+n.pan_by_drag>=0&&(n.pan_by_drag=-n.total_pan_min),n.pan_by_drag<0&&n.total_pan_max-n.pan_by_drag>=0&&(n.pan_by_drag=n.total_pan_max),n.cursor_position<r.min+a?n.cursor_position=r.min+a:n.cursor_position>r.max+c+a&&(n.cursor_position=r.max+c+a);var h=n.cursor_position-r.min-a;h<0?h=0:h>r.max&&(h=r.max);var p=r.max+c-n.cursor_position+a;p<0?p=0:p>r.max+c&&(p=r.max+c);var d=n.inst_zoom-1;n.pbz_relative_min=-d*h,n.pbz_relative_max=-d*p;var m=n.total_pan_min+n.pan_by_drag/n.total_zoom+n.pbz_relative_min/n.total_zoom,g=n.total_pan_max+-n.pan_by_drag/n.total_zoom+n.pbz_relative_max/n.total_zoom,v=!1;n.total_pan_min>=0&&n.total_pan_max>=0&&(v=!0);var y=!1;if(m>1e-4&&g>1e-4&&(y=!0),m<=1e-4&&g<=1e-4&&(n.pan_by_zoom=-d*n.cursor_position,n.total_pan_min=m,n.total_pan_max=g,n.prev_restrict=!1),m>1e-4){n.pan_by_zoom=-d*(r.min+a)-n.total_pan_min*n.total_zoom,n.total_pan_min=0;var b=-d*(r.max-r.min+a);n.total_pan_max=n.total_pan_max+b/n.total_zoom,1==v&&(n.pan_by_zoom=0,n.total_pan_max=0),n.prev_restrict="min"}if(g>1e-4){n.pan_by_zoom=-d*(r.max+c+a)+n.total_pan_max*n.total_zoom,n.total_pan_max=0;var x=-d*(r.max+c-r.min+a);n.total_pan_min=n.total_pan_min+x/n.total_zoom,1==v&&(n.pan_by_zoom=0,n.total_pan_min=0),n.prev_restrict="max"}return y&&("min"===u.prev_restrict?n.pan_by_zoom=-d*(r.min+a):"max"===u.prev_restrict&&(n.pan_by_zoom=-d*(r.max+c+a))),n}},0:
/*!************************!*\
  !*** buffer (ignored) ***!
  \************************/
/*! no static exports found */function(t,e){}})},function(t,e,n){var r,i;!function(){var o={version:"3.5.17"},a=[].slice,u=function(t){return a.call(t)},s=this.document;function l(t){return t&&(t.ownerDocument||t.document||t).documentElement}function f(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(s)try{u(s.documentElement.childNodes)[0].nodeType}catch(t){u=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),s)try{s.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var c=this.Element.prototype,h=c.setAttribute,p=c.setAttributeNS,d=this.CSSStyleDeclaration.prototype,m=d.setProperty;c.setAttribute=function(t,e){h.call(this,t,e+"")},c.setAttributeNS=function(t,e,n){p.call(this,t,e,n+"")},d.setProperty=function(t,e,n){m.call(this,t,e+"",n)}}function g(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function v(t){return null===t?NaN:+t}function y(t){return!isNaN(t)}function _(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}o.ascending=g,o.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},o.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&n>r&&(n=r)}return n},o.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&r>n&&(n=r)}return n},o.extent=function(t,e){var n,r,i,o=-1,a=t.length;if(1===arguments.length){for(;++o<a;)if(null!=(r=t[o])&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),i<r&&(i=r))}else{for(;++o<a;)if(null!=(r=e.call(t,t[o],o))&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=e.call(t,t[o],o))&&(n>r&&(n=r),i<r&&(i=r))}return[n,i]},o.sum=function(t,e){var n,r=0,i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)y(n=+t[o])&&(r+=n);else for(;++o<i;)y(n=+e.call(t,t[o],o))&&(r+=n);return r},o.mean=function(t,e){var n,r=0,i=t.length,o=-1,a=i;if(1===arguments.length)for(;++o<i;)y(n=v(t[o]))?r+=n:--a;else for(;++o<i;)y(n=v(e.call(t,t[o],o)))?r+=n:--a;if(a)return r/a},o.quantile=function(t,e){var n=(t.length-1)*e+1,r=Math.floor(n),i=+t[r-1],o=n-r;return o?i+o*(t[r]-i):i},o.median=function(t,e){var n,r=[],i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)y(n=v(t[a]))&&r.push(n);else for(;++a<i;)y(n=v(e.call(t,t[a],a)))&&r.push(n);if(r.length)return o.quantile(r.sort(g),.5)},o.variance=function(t,e){var n,r,i=t.length,o=0,a=0,u=-1,s=0;if(1===arguments.length)for(;++u<i;)y(n=v(t[u]))&&(a+=(r=n-o)*(n-(o+=r/++s)));else for(;++u<i;)y(n=v(e.call(t,t[u],u)))&&(a+=(r=n-o)*(n-(o+=r/++s)));if(s>1)return a/(s-1)},o.deviation=function(){var t=o.variance.apply(this,arguments);return t?Math.sqrt(t):t};var b=_(g);function x(t){return t.length}o.bisectLeft=b.left,o.bisect=o.bisectRight=b.right,o.bisector=function(t){return _(1===t.length?function(e,n){return g(t(e),n)}:t)},o.shuffle=function(t,e,n){(o=arguments.length)<3&&(n=t.length,o<2&&(e=0));for(var r,i,o=n-e;o;)i=Math.random()*o--|0,r=t[o+e],t[o+e]=t[i+e],t[i+e]=r;return t},o.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},o.pairs=function(t){for(var e=0,n=t.length-1,r=t[0],i=new Array(n<0?0:n);e<n;)i[e]=[r,r=t[++e]];return i},o.transpose=function(t){if(!(i=t.length))return[];for(var e=-1,n=o.min(t,x),r=new Array(n);++e<n;)for(var i,a=-1,u=r[e]=new Array(i);++a<i;)u[a]=t[a][e];return r},o.zip=function(){return o.transpose(arguments)},o.keys=function(t){var e=[];for(var n in t)e.push(n);return e},o.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},o.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},o.merge=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(n=new Array(a);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n};var w=Math.abs;function M(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function j(){this._=Object.create(null)}o.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("infinite range");var r,i=[],o=function(t){var e=1;for(;t*e%1;)e*=10;return e}(w(n)),a=-1;if(t*=o,e*=o,(n*=o)<0)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)<e;)i.push(r/o);return i},o.map=function(t,e){var n=new j;if(t instanceof j)t.forEach(function(t,e){n.set(t,e)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(1===arguments.length)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e.call(t,r=t[i],i),r)}else for(var a in t)n.set(a,t[a]);return n};var k="__proto__",A="\0";function z(t){return(t+="")===k||t[0]===A?A+t:t}function E(t){return(t+="")[0]===A?t.slice(1):t}function S(t){return z(t)in this._}function T(t){return(t=z(t))in this._&&delete this._[t]}function C(){var t=[];for(var e in this._)t.push(E(e));return t}function P(){var t=0;for(var e in this._)++t;return t}function O(){for(var t in this._)return!1;return!0}function N(){this._=Object.create(null)}function I(t){return t}function D(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function L(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=R.length;n<r;++n){var i=R[n]+e;if(i in t)return i}}M(j,{has:S,get:function(t){return this._[z(t)]},set:function(t,e){return this._[z(t)]=e},remove:T,keys:C,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:E(e),value:this._[e]});return t},size:P,empty:O,forEach:function(t){for(var e in this._)t.call(this,E(e),this._[e])}}),o.nest=function(){var t,e,n={},r=[],i=[];function a(i,o,u){if(u>=r.length)return e?e.call(n,o):t?o.sort(t):o;for(var s,l,f,c,h=-1,p=o.length,d=r[u++],m=new j;++h<p;)(c=m.get(s=d(l=o[h])))?c.push(l):m.set(s,[l]);return i?(l=i(),f=function(t,e){l.set(t,a(i,e,u))}):(l={},f=function(t,e){l[t]=a(i,e,u)}),m.forEach(f),l}return n.map=function(t,e){return a(e,t,0)},n.entries=function(t){return function t(e,n){if(n>=r.length)return e;var o=[],a=i[n++];return e.forEach(function(e,r){o.push({key:e,values:t(r,n)})}),a?o.sort(function(t,e){return a(t.key,e.key)}):o}(a(o.map,t,0),0)},n.key=function(t){return r.push(t),n},n.sortKeys=function(t){return i[r.length-1]=t,n},n.sortValues=function(e){return t=e,n},n.rollup=function(t){return e=t,n},n},o.set=function(t){var e=new N;if(t)for(var n=0,r=t.length;n<r;++n)e.add(t[n]);return e},M(N,{has:S,add:function(t){return this._[z(t+="")]=!0,t},remove:T,values:C,size:P,empty:O,forEach:function(t){for(var e in this._)t.call(this,E(e))}}),o.behavior={},o.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r<i;)t[n=arguments[r]]=D(t,e,e[n]);return t};var R=["webkit","ms","moz","Moz","o","O"];function B(){}function F(){}function q(t){var e=[],n=new j;function r(){for(var n,r=e,i=-1,o=r.length;++i<o;)(n=r[i].on)&&n.apply(this,arguments);return t}return r.on=function(r,i){var o,a=n.get(r);return arguments.length<2?a&&a.on:(a&&(a.on=null,e=e.slice(0,o=e.indexOf(a)).concat(e.slice(o+1)),n.remove(r)),i&&e.push(n.set(r,{on:i})),t)},r}function U(){o.event.preventDefault()}function Y(){for(var t,e=o.event;t=e.sourceEvent;)e=t;return e}function H(t){for(var e=new F,n=0,r=arguments.length;++n<r;)e[arguments[n]]=q(e);return e.of=function(n,r){return function(i){try{var a=i.sourceEvent=o.event;i.target=t,o.event=i,e[i.type].apply(n,r)}finally{o.event=a}}},e}o.dispatch=function(){for(var t=new F,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=q(t);return t},F.prototype.on=function(t,e){var n=t.indexOf("."),r="";if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},o.event=null,o.requote=function(t){return t.replace(V,"\\$&")};var V=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Z={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]};function W(t){return Z(t,K),t}var Q=function(t,e){return e.querySelector(t)},X=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var n=t.matches||t[L(t,"matchesSelector")];return(G=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(Q=function(t,e){return Sizzle(t,e)[0]||null},X=Sizzle,G=Sizzle.matchesSelector),o.selection=function(){return o.select(s.documentElement)};var K=o.selection.prototype=[];function $(t){return"function"==typeof t?t:function(){return Q(t,this)}}function J(t){return"function"==typeof t?t:function(){return X(t,this)}}K.select=function(t){var e,n,r,i,o=[];t=$(t);for(var a=-1,u=this.length;++a<u;){o.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=-1,l=r.length;++s<l;)(i=r[s])?(e.push(n=t.call(i,i.__data__,s,a)),n&&"__data__"in i&&(n.__data__=i.__data__)):e.push(null)}return W(o)},K.selectAll=function(t){var e,n,r=[];t=J(t);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],s=-1,l=a.length;++s<l;)(n=a[s])&&(r.push(e=u(t.call(n,n.__data__,s,i))),e.parentNode=n);return W(r)};var tt="http://www.w3.org/1999/xhtml",et={svg:"http://www.w3.org/2000/svg",xhtml:tt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function nt(t,e){return t=o.ns.qualify(t),null==e?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof e?t.local?function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}:function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}:t.local?function(){this.setAttributeNS(t.space,t.local,e)}:function(){this.setAttribute(t,e)}}function rt(t){return t.trim().replace(/\s+/g," ")}function it(t){return new RegExp("(?:^|\\s+)"+o.requote(t)+"(?:\\s+|$)","g")}function ot(t){return(t+"").trim().split(/^|\s+/)}function at(t,e){var n=(t=ot(t).map(ut)).length;return"function"==typeof e?function(){for(var r=-1,i=e.apply(this,arguments);++r<n;)t[r](this,i)}:function(){for(var r=-1;++r<n;)t[r](this,e)}}function ut(t){var e=it(t);return function(n,r){if(i=n.classList)return r?i.add(t):i.remove(t);var i=n.getAttribute("class")||"";r?(e.lastIndex=0,e.test(i)||n.setAttribute("class",rt(i+" "+t))):n.setAttribute("class",rt(i.replace(e," ")))}}function st(t,e,n){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}:function(){this.style.setProperty(t,e,n)}}function lt(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}:function(){this[t]=e}}function ft(t){return"function"==typeof t?t:(t=o.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){var e=this.ownerDocument,n=this.namespaceURI;return n===tt&&e.documentElement.namespaceURI===tt?e.createElement(t):e.createElementNS(n,t)}}function ct(){var t=this.parentNode;t&&t.removeChild(this)}function ht(t){return{__data__:t}}function pt(t){return function(){return G(this,t)}}function dt(t,e){for(var n=0,r=t.length;n<r;n++)for(var i,o=t[n],a=0,u=o.length;a<u;a++)(i=o[a])&&e(i,a,n);return t}function mt(t){return Z(t,gt),t}o.ns={prefix:et,qualify:function(t){var e=t.indexOf(":"),n=t;return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),et.hasOwnProperty(n)?{space:et[n],local:t}:t}},K.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=o.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(nt(e,t[e]));return this}return this.each(nt(t,e))},K.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=ot(t)).length,i=-1;if(e=n.classList){for(;++i<r;)if(!e.contains(t[i]))return!1}else for(e=n.getAttribute("class");++i<r;)if(!it(t[i]).test(e))return!1;return!0}for(e in t)this.each(at(e,t[e]));return this}return this.each(at(t,e))},K.style=function(t,e,n){var r=arguments.length;if(r<3){if("string"!=typeof t){for(n in r<2&&(e=""),t)this.each(st(n,t[n],e));return this}if(r<2){var i=this.node();return f(i).getComputedStyle(i,null).getPropertyValue(t)}n=""}return this.each(st(t,e,n))},K.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(lt(e,t[e]));return this}return this.each(lt(t,e))},K.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},K.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},K.append=function(t){return t=ft(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},K.insert=function(t,e){return t=ft(t),e=$(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},K.remove=function(){return this.each(ct)},K.data=function(t,e){var n,r,i=-1,o=this.length;if(!arguments.length){for(t=new Array(o=(n=this[0]).length);++i<o;)(r=n[i])&&(t[i]=r.__data__);return t}function a(t,n){var r,i,o,a=t.length,f=n.length,c=Math.min(a,f),h=new Array(f),p=new Array(f),d=new Array(a);if(e){var m,g=new j,v=new Array(a);for(r=-1;++r<a;)(i=t[r])&&(g.has(m=e.call(i,i.__data__,r))?d[r]=i:g.set(m,i),v[r]=m);for(r=-1;++r<f;)(i=g.get(m=e.call(n,o=n[r],r)))?!0!==i&&(h[r]=i,i.__data__=o):p[r]=ht(o),g.set(m,!0);for(r=-1;++r<a;)r in v&&!0!==g.get(v[r])&&(d[r]=t[r])}else{for(r=-1;++r<c;)i=t[r],o=n[r],i?(i.__data__=o,h[r]=i):p[r]=ht(o);for(;r<f;++r)p[r]=ht(n[r]);for(;r<a;++r)d[r]=t[r]}p.update=h,p.parentNode=h.parentNode=d.parentNode=t.parentNode,u.push(p),s.push(h),l.push(d)}var u=mt([]),s=W([]),l=W([]);if("function"==typeof t)for(;++i<o;)a(n=this[i],t.call(n,n.parentNode.__data__,i));else for(;++i<o;)a(n=this[i],t);return s.enter=function(){return u},s.exit=function(){return l},s},K.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},K.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=pt(t));for(var o=0,a=this.length;o<a;o++){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var u=0,s=n.length;u<s;u++)(r=n[u])&&t.call(r,r.__data__,u,o)&&e.push(r)}return W(i)},K.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,r=this[t],i=r.length-1,o=r[i];--i>=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},K.sort=function(t){t=function(t){arguments.length||(t=g);return function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},K.each=function(t){return dt(this,function(e,n,r){t.call(e,e.__data__,n,r)})},K.call=function(t){var e=u(arguments);return t.apply(e[0]=this,e),this},K.empty=function(){return!this.node()},K.node=function(){for(var t=0,e=this.length;t<e;t++)for(var n=this[t],r=0,i=n.length;r<i;r++){var o=n[r];if(o)return o}return null},K.size=function(){var t=0;return dt(this,function(){++t}),t};var gt=[];function vt(t,e,n){var r="__on"+t,i=t.indexOf("."),a=_t;i>0&&(t=t.slice(0,i));var s=yt.get(t);function l(){var e=this[r];e&&(this.removeEventListener(t,e,e.$),delete this[r])}return s&&(t=s,a=bt),i?e?function(){var i=a(e,u(arguments));l.call(this),this.addEventListener(t,this[r]=i,i.$=n),i._=e}:l:e?B:function(){var e,n=new RegExp("^__on([^.]+)"+o.requote(t)+"$");for(var r in this)if(e=r.match(n)){var i=this[r];this.removeEventListener(e[1],i,i.$),delete this[r]}}}o.selection.enter=mt,o.selection.enter.prototype=gt,gt.append=K.append,gt.empty=K.empty,gt.node=K.node,gt.call=K.call,gt.size=K.size,gt.select=function(t){for(var e,n,r,i,o,a=[],u=-1,s=this.length;++u<s;){r=(i=this[u]).update,a.push(e=[]),e.parentNode=i.parentNode;for(var l=-1,f=i.length;++l<f;)(o=i[l])?(e.push(r[l]=n=t.call(i.parentNode,o.__data__,l,u)),n.__data__=o.__data__):e.push(null)}return W(a)},gt.insert=function(t,e){return arguments.length<2&&(e=function(t){var e,n;return function(r,i,o){var a,u=t[o].update,s=u.length;for(o!=n&&(n=o,e=0),i>=e&&(e=i+1);!(a=u[e])&&++e<s;);return a}}(this)),K.insert.call(this,t,e)},o.select=function(t){var e;return"string"==typeof t?(e=[Q(t,s)]).parentNode=s.documentElement:(e=[t]).parentNode=l(t),W([e])},o.selectAll=function(t){var e;return"string"==typeof t?(e=u(X(t,s))).parentNode=s.documentElement:(e=u(t)).parentNode=null,W([e])},K.on=function(t,e,n){var r=arguments.length;if(r<3){if("string"!=typeof t){for(n in r<2&&(e=!1),t)this.each(vt(n,t[n],e));return this}if(r<2)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(vt(t,e,n))};var yt=o.map({mouseenter:"mouseover",mouseleave:"mouseout"});function _t(t,e){return function(n){var r=o.event;o.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{o.event=r}}}function bt(t,e){var n=_t(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||n.call(this,t)}}s&&yt.forEach(function(t){"on"+t in s&&yt.remove(t)});var xt,wt=0;function Mt(t){var e=".dragsuppress-"+ ++wt,n="click"+e,r=o.select(f(t)).on("touchmove"+e,U).on("dragstart"+e,U).on("selectstart"+e,U);if(null==xt&&(xt=!("onselectstart"in t)&&L(t.style,"userSelect")),xt){var i=l(t).style,a=i[xt];i[xt]="none"}return function(t){if(r.on(e,null),xt&&(i[xt]=a),t){var o=function(){r.on(n,null)};r.on(n,function(){U(),o()},!0),setTimeout(o,0)}}}o.mouse=function(t){return kt(t,Y())};var jt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function kt(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();if(jt<0){var i=f(t);if(i.scrollX||i.scrollY){var a=(n=o.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();jt=!(a.f||a.e),n.remove()}}return jt?(r.x=e.pageX,r.y=e.pageY):(r.x=e.clientX,r.y=e.clientY),[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var u=t.getBoundingClientRect();return[e.clientX-u.left-t.clientLeft,e.clientY-u.top-t.clientTop]}function At(){return o.event.changedTouches[0].identifier}o.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=Y().changedTouches),e)for(var r,i=0,o=e.length;i<o;++i)if((r=e[i]).identifier===n)return kt(t,r)},o.behavior.drag=function(){var t=H(i,"drag","dragstart","dragend"),e=null,n=a(B,o.mouse,f,"mousemove","mouseup"),r=a(At,o.touch,I,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",r)}function a(n,r,i,a,u){return function(){var s,l=o.event.target.correspondingElement||o.event.target,f=this.parentNode,c=t.of(this,arguments),h=0,p=n(),d=".drag"+(null==p?"":"-"+p),m=o.select(i(l)).on(a+d,function(){var t,e,n=r(f,p);if(!n)return;t=n[0]-v[0],e=n[1]-v[1],h|=t|e,v=n,c({type:"drag",x:n[0]+s[0],y:n[1]+s[1],dx:t,dy:e})}).on(u+d,function(){if(!r(f,p))return;m.on(a+d,null).on(u+d,null),g(h),c({type:"dragend"})}),g=Mt(l),v=r(f,p);s=e?[(s=e.apply(this,arguments)).x-v[0],s.y-v[1]]:[0,0],c({type:"dragstart"})}}return i.origin=function(t){return arguments.length?(e=t,i):e},o.rebind(i,t,"on")},o.touches=function(t,e){return arguments.length<2&&(e=Y().touches),e?u(e).map(function(e){var n=kt(t,e);return n.identifier=e.identifier,n}):[]};var zt=1e-6,Et=zt*zt,St=Math.PI,Tt=2*St,Ct=Tt-zt,Pt=St/2,Ot=St/180,Nt=180/St;function It(t){return t>0?1:t<0?-1:0}function Dt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function Lt(t){return t>1?0:t<-1?St:Math.acos(t)}function Rt(t){return t>1?Pt:t<-1?-Pt:Math.asin(t)}function Bt(t){return((t=Math.exp(t))+1/t)/2}function Ft(t){return(t=Math.sin(t/2))*t}var qt=Math.SQRT2;o.interpolateZoom=function(t,e){var n,r,i=t[0],o=t[1],a=t[2],u=e[0],s=e[1],l=e[2],f=u-i,c=s-o,h=f*f+c*c;if(h<Et)r=Math.log(l/a)/qt,n=function(t){return[i+t*f,o+t*c,a*Math.exp(qt*t*r)]};else{var p=Math.sqrt(h),d=(l*l-a*a+4*h)/(2*a*2*p),m=(l*l-a*a-4*h)/(2*l*2*p),g=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(m*m+1)-m);r=(v-g)/qt,n=function(t){var e=t*r,n=Bt(g),u=a/(2*p)*(n*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(qt*e+g)-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+u*f,o+u*c,a*n/Bt(qt*e+g)]}}return n.duration=1e3*r,n},o.behavior.zoom=function(){var t,e,n,r,i,a,u,l,c,h={x:0,y:0,k:1},p=[960,500],d=Ht,m=250,g=0,v="mousedown.zoom",y="mousemove.zoom",_="mouseup.zoom",b="touchstart.zoom",x=H(w,"zoomstart","zoom","zoomend");function w(t){t.on(v,C).on(Yt+".zoom",O).on("dblclick.zoom",N).on(b,P)}function M(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function j(t){h.k=Math.max(d[0],Math.min(d[1],t))}function k(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function A(t,n,r,i){t.__chart__={x:h.x,y:h.y,k:h.k},j(Math.pow(2,i)),k(e=n,r),t=o.select(t),m>0&&(t=t.transition().duration(m)),t.call(w.event)}function z(){u&&u.domain(a.range().map(function(t){return(t-h.x)/h.k}).map(a.invert)),c&&c.domain(l.range().map(function(t){return(t-h.y)/h.k}).map(l.invert))}function E(t){g++||t({type:"zoomstart"})}function S(t){z(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function T(t){--g||(t({type:"zoomend"}),e=null)}function C(){var t=this,e=x.of(t,arguments),n=0,r=o.select(f(t)).on(y,function(){n=1,k(o.mouse(t),i),S(e)}).on(_,function(){r.on(y,null).on(_,null),a(n),T(e)}),i=M(o.mouse(t)),a=Mt(t);pu.call(t),E(e)}function P(){var t,e=this,n=x.of(e,arguments),r={},a=0,u=".zoom-"+o.event.changedTouches[0].identifier,s="touchmove"+u,l="touchend"+u,f=[],c=o.select(e),p=Mt(e);function d(){var n=o.touches(e);return t=h.k,n.forEach(function(t){t.identifier in r&&(r[t.identifier]=M(t))}),n}function m(){var t=o.event.target;o.select(t).on(s,g).on(l,y),f.push(t);for(var n=o.event.changedTouches,u=0,c=n.length;u<c;++u)r[n[u].identifier]=null;var p=d(),m=Date.now();if(1===p.length){if(m-i<500){var v=p[0];A(e,v,r[v.identifier],Math.floor(Math.log(h.k)/Math.LN2)+1),U()}i=m}else if(p.length>1){v=p[0];var _=p[1],b=v[0]-_[0],x=v[1]-_[1];a=b*b+x*x}}function g(){var u,s,l,f,c=o.touches(e);pu.call(e);for(var h=0,p=c.length;h<p;++h,f=null)if(l=c[h],f=r[l.identifier]){if(s)break;u=l,s=f}if(f){var d=(d=l[0]-u[0])*d+(d=l[1]-u[1])*d,m=a&&Math.sqrt(d/a);u=[(u[0]+l[0])/2,(u[1]+l[1])/2],s=[(s[0]+f[0])/2,(s[1]+f[1])/2],j(m*t)}i=null,k(u,s),S(n)}function y(){if(o.event.touches.length){for(var t=o.event.changedTouches,e=0,i=t.length;e<i;++e)delete r[t[e].identifier];for(var a in r)return void d()}o.selectAll(f).on(u,null),c.on(v,C).on(b,P),p(),T(n)}m(),E(n),c.on(v,null).on(b,m)}function O(){var i=x.of(this,arguments);r?clearTimeout(r):(pu.call(this),t=M(e=n||o.mouse(this)),E(i)),r=setTimeout(function(){r=null,T(i)},50),U(),j(Math.pow(2,.002*Ut())*h.k),k(e,t),S(i)}function N(){var t=o.mouse(this),e=Math.log(h.k)/Math.LN2;A(this,t,M(t),o.event.shiftKey?Math.ceil(e)-1:Math.floor(e)+1)}return Yt||(Yt="onwheel"in s?(Ut=function(){return-o.event.deltaY*(o.event.deltaMode?120:1)},"wheel"):"onmousewheel"in s?(Ut=function(){return o.event.wheelDelta},"mousewheel"):(Ut=function(){return-o.event.detail},"MozMousePixelScroll")),w.event=function(t){t.each(function(){var t=x.of(this,arguments),n=h;gu?o.select(this).transition().each("start.zoom",function(){h=this.__chart__||{x:0,y:0,k:1},E(t)}).tween("zoom:zoom",function(){var r=p[0],i=p[1],a=e?e[0]:r/2,u=e?e[1]:i/2,s=o.interpolateZoom([(a-h.x)/h.k,(u-h.y)/h.k,r/h.k],[(a-n.x)/n.k,(u-n.y)/n.k,r/n.k]);return function(e){var n=s(e),i=r/n[2];this.__chart__=h={x:a-n[0]*i,y:u-n[1]*i,k:i},S(t)}}).each("interrupt.zoom",function(){T(t)}).each("end.zoom",function(){T(t)}):(this.__chart__=h,E(t),S(t),T(t))})},w.translate=function(t){return arguments.length?(h={x:+t[0],y:+t[1],k:h.k},z(),w):[h.x,h.y]},w.scale=function(t){return arguments.length?(h={x:h.x,y:h.y,k:null},j(+t),z(),w):h.k},w.scaleExtent=function(t){return arguments.length?(d=null==t?Ht:[+t[0],+t[1]],w):d},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],w):p},w.duration=function(t){return arguments.length?(m=+t,w):m},w.x=function(t){return arguments.length?(u=t,a=t.copy(),h={x:0,y:0,k:1},w):u},w.y=function(t){return arguments.length?(c=t,l=t.copy(),h={x:0,y:0,k:1},w):c},o.rebind(w,x,"on")};var Ut,Yt,Ht=[0,1/0];function Vt(){}function Zt(t,e,n){return this instanceof Zt?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof Zt?new Zt(t.h,t.s,t.l):de(""+t,me,Zt):new Zt(t,e,n)}o.color=Vt,Vt.prototype.toString=function(){return this.rgb()+""},o.hsl=Zt;var Wt=Zt.prototype=new Vt;function Qt(t,e,n){var r,i;function o(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=2*(n=n<0?0:n>1?1:n)-(i=n<=.5?n*(1+e):n+e-n*e),new le(o(t+120),o(t),o(t-120))}function Xt(t,e,n){return this instanceof Xt?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof Xt?new Xt(t.h,t.c,t.l):oe(t instanceof $t?t.l:(t=ge((t=o.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Xt(t,e,n)}Wt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Zt(this.h,this.s,this.l/t)},Wt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Zt(this.h,this.s,t*this.l)},Wt.rgb=function(){return Qt(this.h,this.s,this.l)},o.hcl=Xt;var Gt=Xt.prototype=new Vt;function Kt(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new $t(n,Math.cos(t*=Ot)*e,Math.sin(t)*e)}function $t(t,e,n){return this instanceof $t?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof $t?new $t(t.l,t.a,t.b):t instanceof Xt?Kt(t.h,t.c,t.l):ge((t=le(t)).r,t.g,t.b):new $t(t,e,n)}Gt.brighter=function(t){return new Xt(this.h,this.c,Math.min(100,this.l+Jt*(arguments.length?t:1)))},Gt.darker=function(t){return new Xt(this.h,this.c,Math.max(0,this.l-Jt*(arguments.length?t:1)))},Gt.rgb=function(){return Kt(this.h,this.c,this.l).rgb()},o.lab=$t;var Jt=18,te=.95047,ee=1,ne=1.08883,re=$t.prototype=new Vt;function ie(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;return new le(se(3.2404542*(i=ae(i)*te)-1.5371385*(r=ae(r)*ee)-.4985314*(o=ae(o)*ne)),se(-.969266*i+1.8760108*r+.041556*o),se(.0556434*i-.2040259*r+1.0572252*o))}function oe(t,e,n){return t>0?new Xt(Math.atan2(n,e)*Nt,Math.sqrt(e*e+n*n),t):new Xt(NaN,NaN,t)}function ae(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ue(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function se(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function le(t,e,n){return this instanceof le?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof le?new le(t.r,t.g,t.b):de(""+t,le,Qt):new le(t,e,n)}function fe(t){return new le(t>>16,t>>8&255,255&t)}function ce(t){return fe(t)+""}re.brighter=function(t){return new $t(Math.min(100,this.l+Jt*(arguments.length?t:1)),this.a,this.b)},re.darker=function(t){return new $t(Math.max(0,this.l-Jt*(arguments.length?t:1)),this.a,this.b)},re.rgb=function(){return ie(this.l,this.a,this.b)},o.rgb=le;var he=le.prototype=new Vt;function pe(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function de(t,e,n){var r,i,o,a=0,u=0,s=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(ye(i[0]),ye(i[1]),ye(i[2]))}return(o=_e.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&o)>>4,a|=a>>4,u=240&o,u|=u>>4,s=15&o,s|=s<<4):7===t.length&&(a=(16711680&o)>>16,u=(65280&o)>>8,s=255&o)),e(a,u,s))}function me(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),u=a-o,s=(a+o)/2;return u?(i=s<.5?u/(a+o):u/(2-a-o),r=t==a?(e-n)/u+(e<n?6:0):e==a?(n-t)/u+2:(t-e)/u+4,r*=60):(r=NaN,i=s>0&&s<1?0:r),new Zt(r,i,s)}function ge(t,e,n){var r=ue((.4124564*(t=ve(t))+.3575761*(e=ve(e))+.1804375*(n=ve(n)))/te),i=ue((.2126729*t+.7151522*e+.072175*n)/ee);return $t(116*i-16,500*(r-i),200*(i-ue((.0193339*t+.119192*e+.9503041*n)/ne)))}function ve(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ye(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}he.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&e<i&&(e=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new le(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new le(i,i,i)},he.darker=function(t){return new le((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},he.hsl=function(){return me(this.r,this.g,this.b)},he.toString=function(){return"#"+pe(this.r)+pe(this.g)+pe(this.b)};var _e=o.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function be(t){return"function"==typeof t?t:function(){return t}}function xe(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),we(e,n,t,r)}}function we(t,e,n,r){var i={},a=o.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,f=null;function c(){var t,e=l.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(l)||e>=200&&e<300||304===e){try{t=n.call(i,l)}catch(t){return void a.error.call(i,t)}a.load.call(i,t)}else a.error.call(i,l)}return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=c:l.onreadystatechange=function(){l.readyState>3&&c()},l.onprogress=function(t){var e=o.event;o.event=t;try{a.progress.call(i,l)}finally{o.event=e}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",i):e},i.responseType=function(t){return arguments.length?(f=t,i):f},i.response=function(t){return n=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(u(arguments)))}}),i.send=function(n,r,o){if(2===arguments.length&&"function"==typeof r&&(o=r,r=null),l.open(n,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var u in s)l.setRequestHeader(u,s[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=f&&(l.responseType=f),null!=o&&i.on("error",o).on("load",function(t){o(null,t)}),a.beforesend.call(i,l),l.send(null==r?null:r),i},i.abort=function(){return l.abort(),i},o.rebind(i,a,"on"),null==r?i:i.get(function(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}(r))}_e.forEach(function(t,e){_e.set(t,fe(e))}),o.functor=be,o.xhr=xe(I),o.dsv=function(t,e){var n=new RegExp('["'+t+"\n]"),r=t.charCodeAt(0);function i(t,n,r){arguments.length<3&&(r=n,n=null);var i=we(t,e,null==n?o:a(n),r);return i.row=function(t){return arguments.length?i.response(null==(n=t)?o:a(t)):n},i}function o(t){return i.parse(t.responseText)}function a(t){return function(e){return i.parse(e.responseText,t)}}function u(e){return e.map(s).join(t)}function s(t){return n.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var n;return i.parseRows(t,function(t,r){if(n)return n(t,r-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,n){return e(i(t),n)}:i})},i.parseRows=function(t,e){var n,i,o={},a={},u=[],s=t.length,l=0,f=0;function c(){if(l>=s)return a;if(i)return i=!1,o;var e=l;if(34===t.charCodeAt(e)){for(var n=e;n++<s;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}return l=n+2,13===(u=t.charCodeAt(n+1))?(i=!0,10===t.charCodeAt(n+2)&&++l):10===u&&(i=!0),t.slice(e+1,n).replace(/""/g,'"')}for(;l<s;){var u,f=1;if(10===(u=t.charCodeAt(l++)))i=!0;else if(13===u)i=!0,10===t.charCodeAt(l)&&(++l,++f);else if(u!==r)continue;return t.slice(e,l-f)}return t.slice(e)}for(;(n=c())!==a;){for(var h=[];n!==o&&n!==a;)h.push(n),n=c();e&&null==(h=e(h,f++))||u.push(h)}return u},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var n=new N,r=[];return e.forEach(function(t){for(var e in t)n.has(e)||r.push(n.add(e))}),[r.map(s).join(t)].concat(e.map(function(e){return r.map(function(t){return s(e[t])}).join(t)})).join("\n")},i.formatRows=function(t){return t.map(u).join("\n")},i},o.csv=o.dsv(",","text/csv"),o.tsv=o.dsv("\t","text/tab-separated-values");var Me,je,ke,Ae,ze=this[L(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function Ee(t,e,n){var r=arguments.length;r<2&&(e=0),r<3&&(n=Date.now());var i={c:t,t:n+e,n:null};return je?je.n=i:Me=i,je=i,ke||(Ae=clearTimeout(Ae),ke=1,ze(Se)),i}function Se(){var t=Te(),e=Ce()-t;e>24?(isFinite(e)&&(clearTimeout(Ae),Ae=setTimeout(Se,e)),ke=0):(ke=1,ze(Se))}function Te(){for(var t=Date.now(),e=Me;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ce(){for(var t,e=Me,n=1/0;e;)e.c?(e.t<n&&(n=e.t),e=(t=e).n):e=t?t.n=e.n:Me=e.n;return je=t,n}function Pe(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}o.timer=function(){Ee.apply(this,arguments)},o.timer.flush=function(){Te(),Ce()},o.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Oe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(function(t,e){var n=Math.pow(10,3*w(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}});o.formatPrefix=function(t,e){var n=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=o.round(t,Pe(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Oe[8+n/3]};var Ne=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ie=o.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=o.round(t,Pe(t,e))).toFixed(Math.max(0,Math.min(20,Pe(t*(1+1e-15),e))))}});function De(t){return t+""}var Le=o.time={},Re=Date;function Be(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Be.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Fe.setUTCDate.apply(this._,arguments)},setDay:function(){Fe.setUTCDay.apply(this._,arguments)},setFullYear:function(){Fe.setUTCFullYear.apply(this._,arguments)},setHours:function(){Fe.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Fe.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Fe.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Fe.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Fe.setUTCSeconds.apply(this._,arguments)},setTime:function(){Fe.setTime.apply(this._,arguments)}};var Fe=Date.prototype;function qe(t,e,n){function r(e){var n=t(e),r=o(n,1);return e-n<r-e?n:r}function i(n){return e(n=t(new Re(n-1)),1),n}function o(t,n){return e(t=new Re(+t),n),t}function a(t,r,o){var a=i(t),u=[];if(o>1)for(;a<r;)n(a)%o||u.push(new Date(+a)),e(a,1);else for(;a<r;)u.push(new Date(+a)),e(a,1);return u}t.floor=t,t.round=r,t.ceil=i,t.offset=o,t.range=a;var u=t.utc=Ue(t);return u.floor=u,u.round=Ue(r),u.ceil=Ue(i),u.offset=Ue(o),u.range=function(t,e,n){try{Re=Be;var r=new Be;return r._=t,a(r,e,n)}finally{Re=Date}},t}function Ue(t){return function(e,n){try{Re=Be;var r=new Be;return r._=e,t(r,n)._}finally{Re=Date}}}Le.year=qe(function(t){return(t=Le.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Le.years=Le.year.range,Le.years.utc=Le.year.utc.range,Le.day=qe(function(t){var e=new Re(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Le.days=Le.day.range,Le.days.utc=Le.day.utc.range,Le.dayOfYear=function(t){var e=Le.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=Le[t]=qe(function(t){return(t=Le.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=Le.year(t).getDay();return Math.floor((Le.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});Le[t+"s"]=n.range,Le[t+"s"].utc=n.utc.range,Le[t+"OfYear"]=function(t){var n=Le.year(t).getDay();return Math.floor((Le.dayOfYear(t)+(n+e)%7)/7)}}),Le.week=Le.sunday,Le.weeks=Le.sunday.range,Le.weeks.utc=Le.sunday.utc.range,Le.weekOfYear=Le.sundayOfYear;var Ye={"-":"",_:" ",0:"0"},He=/^\s*\d+/,Ve=/^%/;function Ze(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function We(t){return new RegExp("^(?:"+t.map(o.requote).join("|")+")","i")}function Qe(t){for(var e=new j,n=-1,r=t.length;++n<r;)e.set(t[n].toLowerCase(),n);return e}function Xe(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ge(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n));return r?(t.U=+r[0],n+r[0].length):-1}function Ke(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n));return r?(t.W=+r[0],n+r[0].length):-1}function $e(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Je(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.y=function(t){return t+(t>68?1900:2e3)}(+r[0]),n+r[0].length):-1}function tn(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function en(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function nn(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function rn(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function on(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function an(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function un(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function sn(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ln(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=w(e)/60|0,i=w(e)%60;return n+Ze(r,"0",2)+Ze(i,"0",2)}function fn(t,e,n){Ve.lastIndex=0;var r=Ve.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function cn(t){for(var e=t.length,n=-1;++n<e;)t[n][0]=this(t[n][0]);return function(e){for(var n=0,r=t[n];!r[1](e);)r=t[++n];return r[0](e)}}o.locale=function(t){return{numberFormat:function(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,a=r&&n?function(t,e){for(var i=t.length,o=[],a=0,u=r[0],s=0;i>0&&u>0&&(s+u+1>e&&(u=Math.max(1,e-s)),o.push(t.substring(i-=u,i+u)),!((s+=u+1)>e));)u=r[a=(a+1)%r.length];return o.reverse().join(n)}:I;return function(t){var n=Ne.exec(t),r=n[1]||" ",u=n[2]||">",s=n[3]||"-",l=n[4]||"",f=n[5],c=+n[6],h=n[7],p=n[8],d=n[9],m=1,g="",v="",y=!1,_=!0;switch(p&&(p=+p.substring(1)),(f||"0"===r&&"="===u)&&(f=r="0",u="="),d){case"n":h=!0,d="g";break;case"%":m=100,v="%",d="f";break;case"p":m=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+d.toLowerCase());case"c":_=!1;case"d":y=!0,p=0;break;case"s":m=-1,d="r"}"$"===l&&(g=i[0],v=i[1]),"r"!=d||p||(d="g"),null!=p&&("g"==d?p=Math.max(1,Math.min(21,p)):"e"!=d&&"f"!=d||(p=Math.max(0,Math.min(20,p)))),d=Ie.get(d)||De;var b=f&&h;return function(t){var n=v;if(y&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(m<0){var l=o.formatPrefix(t,p);t=l.scale(t),n=l.symbol+v}else t*=m;var x,w,M=(t=d(t,p)).lastIndexOf(".");if(M<0){var j=_?t.lastIndexOf("e"):-1;j<0?(x=t,w=""):(x=t.substring(0,j),w=t.substring(j))}else x=t.substring(0,M),w=e+t.substring(M+1);!f&&h&&(x=a(x,1/0));var k=g.length+x.length+w.length+(b?0:i.length),A=k<c?new Array(k=c-k+1).join(r):"";return b&&(x=a(A+x,A.length?c-w.length:1/0)),i+=g,t=x+w,("<"===u?i+t+A:">"===u?A+i+t:"^"===u?A.substring(0,k>>=1)+i+t+A.substring(k):i+(b?t:A+t))+n}}}(t),timeFormat:function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,u=t.shortDays,s=t.months,l=t.shortMonths;function f(t){var e=t.length;function n(n){for(var r,i,o,a=[],u=-1,s=0;++u<e;)37===t.charCodeAt(u)&&(a.push(t.slice(s,u)),null!=(i=Ye[r=t.charAt(++u)])&&(r=t.charAt(++u)),(o=x[r])&&(r=o(n,null==i?"e"===r?" ":"0":i)),a.push(r),s=u+1);return a.push(t.slice(s,u)),a.join("")}return n.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(c(n,t,e,0)!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var r=null!=n.Z&&Re!==Be,i=new(r?Be:Re);return"j"in n?i.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),i.setFullYear(n.y,0,1),i.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(i.getDay()+5)%7:n.w+7*n.U-(i.getDay()+6)%7)):i.setFullYear(n.y,n.m,n.d),i.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),r?i._:i},n.toString=function(){return t},n}function c(t,e,n,r){for(var i,o,a,u=0,s=e.length,l=n.length;u<s;){if(r>=l)return-1;if(37===(i=e.charCodeAt(u++))){if(a=e.charAt(u++),!(o=w[a in Ye?e.charAt(u++):a])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}f.utc=function(t){var e=f(t);function n(t){try{var n=new(Re=Be);return n._=t,e(n)}finally{Re=Date}}return n.parse=function(t){try{Re=Be;var n=e.parse(t);return n&&n._}finally{Re=Date}},n.toString=e.toString,n},f.multi=f.utc.multi=cn;var h=o.map(),p=We(a),d=Qe(a),m=We(u),g=Qe(u),v=We(s),y=Qe(s),_=We(l),b=Qe(l);i.forEach(function(t,e){h.set(t.toLowerCase(),e)});var x={a:function(t){return u[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:f(e),d:function(t,e){return Ze(t.getDate(),e,2)},e:function(t,e){return Ze(t.getDate(),e,2)},H:function(t,e){return Ze(t.getHours(),e,2)},I:function(t,e){return Ze(t.getHours()%12||12,e,2)},j:function(t,e){return Ze(1+Le.dayOfYear(t),e,3)},L:function(t,e){return Ze(t.getMilliseconds(),e,3)},m:function(t,e){return Ze(t.getMonth()+1,e,2)},M:function(t,e){return Ze(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return Ze(t.getSeconds(),e,2)},U:function(t,e){return Ze(Le.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ze(Le.mondayOfYear(t),e,2)},x:f(n),X:f(r),y:function(t,e){return Ze(t.getFullYear()%100,e,2)},Y:function(t,e){return Ze(t.getFullYear()%1e4,e,4)},Z:ln,"%":function(){return"%"}},w={a:function(t,e,n){m.lastIndex=0;var r=m.exec(e.slice(n));return r?(t.w=g.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){p.lastIndex=0;var r=p.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){_.lastIndex=0;var r=_.exec(e.slice(n));return r?(t.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){v.lastIndex=0;var r=v.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,e,n){return c(t,x.c.toString(),e,n)},d:nn,e:nn,H:on,I:on,j:rn,L:sn,m:en,M:an,p:function(t,e,n){var r=h.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)},S:un,U:Ge,w:Xe,W:Ke,x:function(t,e,n){return c(t,x.x.toString(),e,n)},X:function(t,e,n){return c(t,x.X.toString(),e,n)},y:Je,Y:$e,Z:tn,"%":fn};return f}(t)}};var hn=o.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function pn(){}o.format=hn.numberFormat,o.geo={},pn.prototype={s:0,t:0,add:function(t){mn(t,this.t,dn),mn(dn.s,this.s,this),this.s?this.t+=dn.t:this.s=dn.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var dn=new pn;function mn(t,e,n){var r=n.s=t+e,i=r-t,o=r-i;n.t=t-o+(e-i)}function gn(t,e){t&&yn.hasOwnProperty(t.type)&&yn[t.type](t,e)}o.geo.stream=function(t,e){t&&vn.hasOwnProperty(t.type)?vn[t.type](t,e):gn(t,e)};var vn={Feature:function(t,e){gn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)gn(n[r].geometry,e)}},yn={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){_n(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)_n(n[r],e,0)},Polygon:function(t,e){bn(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)bn(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)gn(n[r],e)}};function _n(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function bn(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)_n(t[n],e,1);e.polygonEnd()}o.geo.area=function(t){return xn=0,o.geo.stream(t,Nn),xn};var xn,wn,Mn,jn,kn,An,zn,En,Sn,Tn,Cn,Pn,On=new pn,Nn={sphere:function(){xn+=4*St},point:B,lineStart:B,lineEnd:B,polygonStart:function(){On.reset(),Nn.lineStart=In},polygonEnd:function(){var t=2*On;xn+=t<0?4*St+t:t,Nn.lineStart=Nn.lineEnd=Nn.point=B}};function In(){var t,e,n,r,i;function o(t,e){e=e*Ot/2+St/4;var o=(t*=Ot)-n,a=o>=0?1:-1,u=a*o,s=Math.cos(e),l=Math.sin(e),f=i*l,c=r*s+f*Math.cos(u),h=f*a*Math.sin(u);On.add(Math.atan2(h,c)),n=t,r=s,i=l}Nn.point=function(a,u){Nn.point=o,n=(t=a)*Ot,r=Math.cos(u=(e=u)*Ot/2+St/4),i=Math.sin(u)},Nn.lineEnd=function(){o(t,e)}}function Dn(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function Ln(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Rn(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Bn(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Fn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function qn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Un(t){return[Math.atan2(t[1],t[0]),Rt(t[2])]}function Yn(t,e){return w(t[0]-e[0])<zt&&w(t[1]-e[1])<zt}o.geo.bounds=function(){var t,e,n,r,i,a,u,s,l,f,c,h={point:p,lineStart:m,lineEnd:g,polygonStart:function(){h.point=v,h.lineStart=y,h.lineEnd=_,l=0,Nn.polygonStart()},polygonEnd:function(){Nn.polygonEnd(),h.point=p,h.lineStart=m,h.lineEnd=g,On<0?(t=-(n=180),e=-(r=90)):l>zt?r=90:l<-zt&&(e=-90),c[0]=t,c[1]=n}};function p(i,o){f.push(c=[t=i,n=i]),o<e&&(e=o),o>r&&(r=o)}function d(o,a){var u=Dn([o*Ot,a*Ot]);if(s){var l=Rn(s,u),f=Rn([l[1],-l[0],0],l);qn(f),f=Un(f);var c=o-i,h=c>0?1:-1,d=f[0]*Nt*h,m=w(c)>180;if(m^(h*i<d&&d<h*o))(g=f[1]*Nt)>r&&(r=g);else if(m^(h*i<(d=(d+360)%360-180)&&d<h*o)){var g;(g=-f[1]*Nt)<e&&(e=g)}else a<e&&(e=a),a>r&&(r=a);m?o<i?b(t,o)>b(t,n)&&(n=o):b(o,n)>b(t,n)&&(t=o):n>=t?(o<t&&(t=o),o>n&&(n=o)):o>i?b(t,o)>b(t,n)&&(n=o):b(o,n)>b(t,n)&&(t=o)}else p(o,a);s=u,i=o}function m(){h.point=d}function g(){c[0]=t,c[1]=n,h.point=p,s=null}function v(t,e){if(s){var n=t-i;l+=w(n)>180?n+(n>0?360:-360):n}else a=t,u=e;Nn.point(t,e),d(t,e)}function y(){Nn.lineStart()}function _(){v(a,u),Nn.lineEnd(),w(l)>zt&&(t=-(n=180)),c[0]=t,c[1]=n,s=null}function b(t,e){return(e-=t)<0?e+360:e}function x(t,e){return t[0]-e[0]}function M(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(i){if(r=n=-(t=e=1/0),f=[],o.geo.stream(i,h),l=f.length){f.sort(x);for(var a=1,u=[m=f[0]];a<l;++a)M((p=f[a])[0],m)||M(p[1],m)?(b(m[0],p[1])>b(m[0],m[1])&&(m[1]=p[1]),b(p[0],m[1])>b(m[0],m[1])&&(m[0]=p[0])):u.push(m=p);for(var s,l,p,d=-1/0,m=(a=0,u[l=u.length-1]);a<=l;m=p,++a)p=u[a],(s=b(m[1],p[0]))>d&&(d=s,t=p[0],n=m[1])}return f=c=null,t===1/0||e===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,e],[n,r]]}}(),o.geo.centroid=function(t){wn=Mn=jn=kn=An=zn=En=Sn=Tn=Cn=Pn=0,o.geo.stream(t,Hn);var e=Tn,n=Cn,r=Pn,i=e*e+n*n+r*r;return i<Et&&(e=zn,n=En,r=Sn,Mn<zt&&(e=jn,n=kn,r=An),(i=e*e+n*n+r*r)<Et)?[NaN,NaN]:[Math.atan2(n,e)*Nt,Rt(r/Math.sqrt(i))*Nt]};var Hn={sphere:B,point:Vn,lineStart:Wn,lineEnd:Qn,polygonStart:function(){Hn.lineStart=Xn},polygonEnd:function(){Hn.lineStart=Wn}};function Vn(t,e){t*=Ot;var n=Math.cos(e*=Ot);Zn(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function Zn(t,e,n){jn+=(t-jn)/++wn,kn+=(e-kn)/wn,An+=(n-An)/wn}function Wn(){var t,e,n;function r(r,i){r*=Ot;var o=Math.cos(i*=Ot),a=o*Math.cos(r),u=o*Math.sin(r),s=Math.sin(i),l=Math.atan2(Math.sqrt((l=e*s-n*u)*l+(l=n*a-t*s)*l+(l=t*u-e*a)*l),t*a+e*u+n*s);Mn+=l,zn+=l*(t+(t=a)),En+=l*(e+(e=u)),Sn+=l*(n+(n=s)),Zn(t,e,n)}Hn.point=function(i,o){i*=Ot;var a=Math.cos(o*=Ot);t=a*Math.cos(i),e=a*Math.sin(i),n=Math.sin(o),Hn.point=r,Zn(t,e,n)}}function Qn(){Hn.point=Vn}function Xn(){var t,e,n,r,i;function o(t,e){t*=Ot;var o=Math.cos(e*=Ot),a=o*Math.cos(t),u=o*Math.sin(t),s=Math.sin(e),l=r*s-i*u,f=i*a-n*s,c=n*u-r*a,h=Math.sqrt(l*l+f*f+c*c),p=n*a+r*u+i*s,d=h&&-Lt(p)/h,m=Math.atan2(h,p);Tn+=d*l,Cn+=d*f,Pn+=d*c,Mn+=m,zn+=m*(n+(n=a)),En+=m*(r+(r=u)),Sn+=m*(i+(i=s)),Zn(n,r,i)}Hn.point=function(a,u){t=a,e=u,Hn.point=o,a*=Ot;var s=Math.cos(u*=Ot);n=s*Math.cos(a),r=s*Math.sin(a),i=Math.sin(u),Zn(n,r,i)},Hn.lineEnd=function(){o(t,e),Hn.lineEnd=Qn,Hn.point=Vn}}function Gn(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Kn(){return!0}function $n(t,e,n,r,i){var o=[],a=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],r=t[e];if(Yn(n,r)){i.lineStart();for(var u=0;u<e;++u)i.point((n=t[u])[0],n[1]);i.lineEnd()}else{var s=new tr(n,t,null,!0),l=new tr(n,null,s,!1);s.o=l,o.push(s),a.push(l),l=new tr(r,null,s=new tr(r,t,null,!1),!0),s.o=l,o.push(s),a.push(l)}}}),a.sort(e),Jn(o),Jn(a),o.length){for(var u=0,s=n,l=a.length;u<l;++u)a[u].e=s=!s;for(var f,c,h=o[0];;){for(var p=h,d=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(u=0,l=f.length;u<l;++u)i.point((c=f[u])[0],c[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(d)for(u=(f=p.p.z).length-1;u>=0;--u)i.point((c=f[u])[0],c[1]);else r(p.x,p.p.x,-1,i);p=p.p}f=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function Jn(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function tr(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function er(t,e,n,r){return function(i,a){var u,s=e(a),l=i.invert(r[0],r[1]),f={point:c,lineStart:p,lineEnd:d,polygonStart:function(){f.point=b,f.lineStart=x,f.lineEnd=w,u=[],m=[]},polygonEnd:function(){f.point=c,f.lineStart=p,f.lineEnd=d,u=o.merge(u);var t=function(t,e){var n=t[0],r=t[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;On.reset();for(var u=0,s=e.length;u<s;++u){var l=e[u],f=l.length;if(f)for(var c=l[0],h=c[0],p=c[1]/2+St/4,d=Math.sin(p),m=Math.cos(p),g=1;;){g===f&&(g=0);var v=(t=l[g])[0],y=t[1]/2+St/4,_=Math.sin(y),b=Math.cos(y),x=v-h,w=x>=0?1:-1,M=w*x,j=M>St,k=d*_;if(On.add(Math.atan2(k*w*Math.sin(M),m*b+k*Math.cos(M))),o+=j?x+w*Tt:x,j^h>=n^v>=n){var A=Rn(Dn(c),Dn(t));qn(A);var z=Rn(i,A);qn(z);var E=(j^x>=0?-1:1)*Rt(z[2]);(r>E||r===E&&(A[0]||A[1]))&&(a+=j^x>=0?1:-1)}if(!g++)break;h=v,d=_,m=b,c=t}}return(o<-zt||o<zt&&On<-zt)^1&a}(l,m);u.length?(_||(a.polygonStart(),_=!0),$n(u,ir,t,n,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),u=m=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function c(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&a.point(e,n)}function h(t,e){var n=i(t,e);s.point(n[0],n[1])}function p(){f.point=h,s.lineStart()}function d(){f.point=c,s.lineEnd()}var m,g,v=rr(),y=e(v),_=!1;function b(t,e){g.push([t,e]);var n=i(t,e);y.point(n[0],n[1])}function x(){y.lineStart(),g=[]}function w(){b(g[0][0],g[0][1]),y.lineEnd();var t,e=y.clean(),n=v.buffer(),r=n.length;if(g.pop(),m.push(g),g=null,r)if(1&e){var i,o=-1;if((r=(t=n[0]).length-1)>0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o<r;)a.point((i=t[o])[0],i[1]);a.lineEnd()}}else r>1&&2&e&&n.push(n.pop().concat(n.shift())),u.push(n.filter(nr))}return f}}function nr(t){return t.length>1}function rr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:B,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function ir(t,e){return((t=t.x)[0]<0?t[1]-Pt-zt:Pt-t[1])-((e=e.x)[0]<0?e[1]-Pt-zt:Pt-e[1])}var or=er(Kn,function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var u=o>0?St:-St,s=w(o-n);w(s-St)<zt?(t.point(n,r=(r+a)/2>0?Pt:-Pt),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),e=0):i!==u&&s>=St&&(w(n-i)<zt&&(n-=i*zt),w(o-u)<zt&&(o-=u*zt),r=function(t,e,n,r){var i,o,a=Math.sin(t-n);return w(a)>zt?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=o,r=a),i=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Pt,r.point(-St,i),r.point(0,i),r.point(St,i),r.point(St,0),r.point(St,-i),r.point(0,-i),r.point(-St,-i),r.point(-St,0),r.point(-St,i);else if(w(t[0]-e[0])>zt){var o=t[0]<e[0]?St:-St;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])},[-St,-St/2]);function ar(t,e,n,r){return function(i){var o,a=i.a,u=i.b,s=a.x,l=a.y,f=0,c=1,h=u.x-s,p=u.y-l;if(o=t-s,h||!(o>0)){if(o/=h,h<0){if(o<f)return;o<c&&(c=o)}else if(h>0){if(o>c)return;o>f&&(f=o)}if(o=n-s,h||!(o<0)){if(o/=h,h<0){if(o>c)return;o>f&&(f=o)}else if(h>0){if(o<f)return;o<c&&(c=o)}if(o=e-l,p||!(o>0)){if(o/=p,p<0){if(o<f)return;o<c&&(c=o)}else if(p>0){if(o>c)return;o>f&&(f=o)}if(o=r-l,p||!(o<0)){if(o/=p,p<0){if(o>c)return;o>f&&(f=o)}else if(p>0){if(o<f)return;o<c&&(c=o)}return f>0&&(i.a={x:s+f*h,y:l+f*p}),c<1&&(i.b={x:s+c*h,y:l+c*p}),i}}}}}}var ur=1e9;function sr(t,e,n,r){return function(s){var l,f,c,h,p,d,m,g,v,y,_,b=s,x=rr(),w=ar(t,e,n,r),M={point:A,lineStart:function(){M.point=z,f&&f.push(c=[]);y=!0,v=!1,m=g=NaN},lineEnd:function(){l&&(z(h,p),d&&v&&x.rejoin(),l.push(x.buffer()));M.point=A,v&&s.lineEnd()},polygonStart:function(){s=x,l=[],f=[],_=!0},polygonEnd:function(){s=b,l=o.merge(l);var e=function(t){for(var e=0,n=f.length,r=t[1],i=0;i<n;++i)for(var o,a=1,u=f[i],s=u.length,l=u[0];a<s;++a)o=u[a],l[1]<=r?o[1]>r&&Dt(l,o,t)>0&&++e:o[1]<=r&&Dt(l,o,t)<0&&--e,l=o;return 0!==e}([t,r]),n=_&&e,i=l.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),j(null,null,1,s),s.lineEnd()),i&&$n(l,a,e,j,s),s.polygonEnd()),l=f=c=null}};function j(o,a,s,l){var f=0,c=0;if(null==o||(f=i(o,s))!==(c=i(a,s))||u(o,a)<0^s>0)do{l.point(0===f||3===f?t:n,f>1?r:e)}while((f=(f+s+4)%4)!==c);else l.point(a[0],a[1])}function k(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function A(t,e){k(t,e)&&s.point(t,e)}function z(t,e){var n=k(t=Math.max(-ur,Math.min(ur,t)),e=Math.max(-ur,Math.min(ur,e)));if(f&&c.push([t,e]),y)h=t,p=e,d=n,y=!1,n&&(s.lineStart(),s.point(t,e));else if(n&&v)s.point(t,e);else{var r={a:{x:m,y:g},b:{x:t,y:e}};w(r)?(v||(s.lineStart(),s.point(r.a.x,r.a.y)),s.point(r.b.x,r.b.y),n||s.lineEnd(),_=!1):n&&(s.lineStart(),s.point(t,e),_=!1)}m=t,g=e,v=n}return M};function i(r,i){return w(r[0]-t)<zt?i>0?0:3:w(r[0]-n)<zt?i>0?2:1:w(r[1]-e)<zt?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}}function lr(t){var e=0,n=St/3,r=Cr(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*St/180,n=t[1]*St/180):[e/St*180,n/St*180]},i}function fr(t,e){var n=Math.sin(t),r=(n+Math.sin(e))/2,i=1+n*(2*r-n),o=Math.sqrt(i)/r;function a(t,e){var n=Math.sqrt(i-2*r*Math.sin(e))/r;return[n*Math.sin(t*=r),o-n*Math.cos(t)]}return a.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/r,Rt((i-(t*t+n*n)*r*r)/(2*r))]},a}o.geo.clipExtent=function(){var t,e,n,r,i,o,a={stream:function(t){return i&&(i.valid=!1),(i=o(t)).valid=!0,i},extent:function(u){return arguments.length?(o=sr(t=+u[0][0],e=+u[0][1],n=+u[1][0],r=+u[1][1]),i&&(i.valid=!1,i=null),a):[[t,e],[n,r]]}};return a.extent([[0,0],[960,500]])},(o.geo.conicEqualArea=function(){return lr(fr)}).raw=fr,o.geo.albers=function(){return o.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},o.geo.albersUsa=function(){var t,e,n,r,i=o.geo.albers(),a=o.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=o.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(e,n){t=[e,n]}};function l(i){var o=i[0],a=i[1];return t=null,e(o,a),t||(n(o,a),t)||r(o,a),t}return l.invert=function(t){var e=i.scale(),n=i.translate(),r=(t[0]-n[0])/e,o=(t[1]-n[1])/e;return(o>=.12&&o<.234&&r>=-.425&&r<-.214?a:o>=.166&&o<.234&&r>=-.214&&r<-.115?u:i).invert(t)},l.stream=function(t){var e=i.stream(t),n=a.stream(t),r=u.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},l.precision=function(t){return arguments.length?(i.precision(t),a.precision(t),u.precision(t),l):i.precision()},l.scale=function(t){return arguments.length?(i.scale(t),a.scale(.35*t),u.scale(t),l.translate(i.translate())):i.scale()},l.translate=function(t){if(!arguments.length)return i.translate();var o=i.scale(),f=+t[0],c=+t[1];return e=i.translate(t).clipExtent([[f-.455*o,c-.238*o],[f+.455*o,c+.238*o]]).stream(s).point,n=a.translate([f-.307*o,c+.201*o]).clipExtent([[f-.425*o+zt,c+.12*o+zt],[f-.214*o-zt,c+.234*o-zt]]).stream(s).point,r=u.translate([f-.205*o,c+.212*o]).clipExtent([[f-.214*o+zt,c+.166*o+zt],[f-.115*o-zt,c+.234*o-zt]]).stream(s).point,l},l.scale(1070)};var cr,hr,pr,dr,mr,gr,vr={point:B,lineStart:B,lineEnd:B,polygonStart:function(){hr=0,vr.lineStart=yr},polygonEnd:function(){vr.lineStart=vr.lineEnd=vr.point=B,cr+=w(hr/2)}};function yr(){var t,e,n,r;function i(t,e){hr+=r*t-n*e,n=t,r=e}vr.point=function(o,a){vr.point=i,t=n=o,e=r=a},vr.lineEnd=function(){i(t,e)}}var _r={point:function(t,e){t<pr&&(pr=t);t>mr&&(mr=t);e<dr&&(dr=e);e>gr&&(gr=e)},lineStart:B,lineEnd:B,polygonStart:B,polygonEnd:B};function br(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var xr,wr={point:Mr,lineStart:jr,lineEnd:kr,polygonStart:function(){wr.lineStart=Ar},polygonEnd:function(){wr.point=Mr,wr.lineStart=jr,wr.lineEnd=kr}};function Mr(t,e){jn+=t,kn+=e,++An}function jr(){var t,e;function n(n,r){var i=n-t,o=r-e,a=Math.sqrt(i*i+o*o);zn+=a*(t+n)/2,En+=a*(e+r)/2,Sn+=a,Mr(t=n,e=r)}wr.point=function(r,i){wr.point=n,Mr(t=r,e=i)}}function kr(){wr.point=Mr}function Ar(){var t,e,n,r;function i(t,e){var i=t-n,o=e-r,a=Math.sqrt(i*i+o*o);zn+=a*(n+t)/2,En+=a*(r+e)/2,Sn+=a,Tn+=(a=r*t-n*e)*(n+t),Cn+=a*(r+e),Pn+=3*a,Mr(n=t,r=e)}wr.point=function(o,a){wr.point=i,Mr(t=n=o,e=r=a)},wr.lineEnd=function(){i(t,e)}}function zr(t){var e=.5,n=Math.cos(30*Ot),r=16;function i(e){return(r?function(e){var n,i,a,u,s,l,f,c,h,p,d,m,g={point:v,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=y}};function v(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){c=NaN,g.point=_,e.lineStart()}function _(n,i){var a=Dn([n,i]),u=t(n,i);o(c,h,f,p,d,m,c=u[0],h=u[1],f=n,p=a[0],d=a[1],m=a[2],r,e),e.point(c,h)}function b(){g.point=v,e.lineEnd()}function x(){y(),g.point=w,g.lineEnd=M}function w(t,e){_(n=t,e),i=c,a=h,u=p,s=d,l=m,g.point=_}function M(){o(c,h,f,p,d,m,i,a,n,u,s,l,r,e),g.lineEnd=b,b()}return g}:function(e){return Sr(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})})(e)}function o(r,i,a,u,s,l,f,c,h,p,d,m,g,v){var y=f-r,_=c-i,b=y*y+_*_;if(b>4*e&&g--){var x=u+p,M=s+d,j=l+m,k=Math.sqrt(x*x+M*M+j*j),A=Math.asin(j/=k),z=w(w(j)-1)<zt||w(a-h)<zt?(a+h)/2:Math.atan2(M,x),E=t(z,A),S=E[0],T=E[1],C=S-r,P=T-i,O=_*C-y*P;(O*O/b>e||w((y*C+_*P)/b-.5)>.3||u*p+s*d+l*m<n)&&(o(r,i,a,u,s,l,S,T,z,x/=k,M/=k,j,g,v),v.point(S,T),o(S,T,z,x,M,j,f,c,h,p,d,m,g,v))}}return i.precision=function(t){return arguments.length?(r=(e=t*t)>0&&16,i):Math.sqrt(e)},i}function Er(t){this.stream=t}function Sr(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Tr(t){return Cr(function(){return t})()}function Cr(t){var e,n,r,i,a,u,s=zr(function(t,n){return[(t=e(t,n))[0]*l+i,a-t[1]*l]}),l=150,f=480,c=250,h=0,p=0,d=0,m=0,g=0,v=or,y=I,_=null,b=null;function x(t){return[(t=r(t[0]*Ot,t[1]*Ot))[0]*l+i,a-t[1]*l]}function M(t){return(t=r.invert((t[0]-i)/l,(a-t[1])/l))&&[t[0]*Nt,t[1]*Nt]}function j(){r=Gn(n=Ir(d,m,g),e);var t=e(h,p);return i=f-t[0]*l,a=c+t[1]*l,k()}function k(){return u&&(u.valid=!1,u=null),x}return x.stream=function(t){return u&&(u.valid=!1),(u=Pr(v(n,s(y(t))))).valid=!0,u},x.clipAngle=function(t){return arguments.length?(v=null==t?(_=t,or):function(t){var e=Math.cos(t),n=e>0,r=w(e)>zt;return er(i,function(t){var e,u,s,l,f;return{lineStart:function(){l=s=!1,f=1},point:function(c,h){var p,d=[c,h],m=i(c,h),g=n?m?0:a(c,h):m?a(c+(c<0?St:-St),h):0;if(!e&&(l=s=m)&&t.lineStart(),m!==s&&(p=o(e,d),(Yn(e,p)||Yn(d,p))&&(d[0]+=zt,d[1]+=zt,m=i(d[0],d[1]))),m!==s)f=0,m?(t.lineStart(),p=o(d,e),t.point(p[0],p[1])):(p=o(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(r&&e&&n^m){var v;g&u||!(v=o(d,e,!0))||(f=0,n?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||e&&Yn(e,d)||t.point(d[0],d[1]),e=d,s=m,u=g},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return f|(l&&s)<<1}}},Br(t,6*Ot),n?[0,-t]:[-St,t-St]);function i(t,n){return Math.cos(t)*Math.cos(n)>e}function o(t,n,r){var i=[1,0,0],o=Rn(Dn(t),Dn(n)),a=Ln(o,o),u=o[0],s=a-u*u;if(!s)return!r&&t;var l=e*a/s,f=-e*u/s,c=Rn(i,o),h=Fn(i,l);Bn(h,Fn(o,f));var p=c,d=Ln(h,p),m=Ln(p,p),g=d*d-m*(Ln(h,h)-1);if(!(g<0)){var v=Math.sqrt(g),y=Fn(p,(-d-v)/m);if(Bn(y,h),y=Un(y),!r)return y;var _,b=t[0],x=n[0],M=t[1],j=n[1];x<b&&(_=b,b=x,x=_);var k=x-b,A=w(k-St)<zt;if(!A&&j<M&&(_=M,M=j,j=_),A||k<zt?A?M+j>0^y[1]<(w(y[0]-b)<zt?M:j):M<=y[1]&&y[1]<=j:k>St^(b<=y[0]&&y[0]<=x)){var z=Fn(p,(-d+v)/m);return Bn(z,h),[y,Un(z)]}}}function a(e,r){var i=n?t:St-t,o=0;return e<-i?o|=1:e>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}}((_=+t)*Ot),k()):_},x.clipExtent=function(t){return arguments.length?(b=t,y=t?sr(t[0][0],t[0][1],t[1][0],t[1][1]):I,k()):b},x.scale=function(t){return arguments.length?(l=+t,j()):l},x.translate=function(t){return arguments.length?(f=+t[0],c=+t[1],j()):[f,c]},x.center=function(t){return arguments.length?(h=t[0]%360*Ot,p=t[1]%360*Ot,j()):[h*Nt,p*Nt]},x.rotate=function(t){return arguments.length?(d=t[0]%360*Ot,m=t[1]%360*Ot,g=t.length>2?t[2]%360*Ot:0,j()):[d*Nt,m*Nt,g*Nt]},o.rebind(x,s,"precision"),function(){return e=t.apply(this,arguments),x.invert=e.invert&&M,j()}}function Pr(t){return Sr(t,function(e,n){t.point(e*Ot,n*Ot)})}function Or(t,e){return[t,e]}function Nr(t,e){return[t>St?t-Tt:t<-St?t+Tt:t,e]}function Ir(t,e,n){return t?e||n?Gn(Lr(t),Rr(e,n)):Lr(t):e||n?Rr(e,n):Nr}function Dr(t){return function(e,n){return[(e+=t)>St?e-Tt:e<-St?e+Tt:e,n]}}function Lr(t){var e=Dr(t);return e.invert=Dr(-t),e}function Rr(t,e){var n=Math.cos(t),r=Math.sin(t),i=Math.cos(e),o=Math.sin(e);function a(t,e){var a=Math.cos(e),u=Math.cos(t)*a,s=Math.sin(t)*a,l=Math.sin(e),f=l*n+u*r;return[Math.atan2(s*i-f*o,u*n-l*r),Rt(f*i+s*o)]}return a.invert=function(t,e){var a=Math.cos(e),u=Math.cos(t)*a,s=Math.sin(t)*a,l=Math.sin(e),f=l*i-s*o;return[Math.atan2(s*i+l*o,u*n+f*r),Rt(f*n-u*r)]},a}function Br(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,u){var s=a*e;null!=i?(i=Fr(n,i),o=Fr(n,o),(a>0?i<o:i>o)&&(i+=a*Tt)):(i=t+a*Tt,o=t-.5*s);for(var l,f=i;a>0?f>o:f<o;f-=s)u.point((l=Un([n,-r*Math.cos(f),-r*Math.sin(f)]))[0],l[1])}}function Fr(t,e){var n=Dn(e);n[0]-=t,qn(n);var r=Lt(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-zt)%(2*Math.PI)}function qr(t,e,n){var r=o.range(t,e-zt,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function Ur(t,e,n){var r=o.range(t,e-zt,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function Yr(t){return t.source}function Hr(t){return t.target}o.geo.path=function(){var t,e,n,r,i,a=4.5;function u(t){return t&&("function"==typeof a&&r.pointRadius(+a.apply(this,arguments)),i&&i.valid||(i=n(r)),o.geo.stream(t,i)),r.result()}function s(){return i=null,u}return u.area=function(t){return cr=0,o.geo.stream(t,n(vr)),cr},u.centroid=function(t){return jn=kn=An=zn=En=Sn=Tn=Cn=Pn=0,o.geo.stream(t,n(wr)),Pn?[Tn/Pn,Cn/Pn]:Sn?[zn/Sn,En/Sn]:An?[jn/An,kn/An]:[NaN,NaN]},u.bounds=function(t){return mr=gr=-(pr=dr=1/0),o.geo.stream(t,n(_r)),[[pr,dr],[mr,gr]]},u.projection=function(e){return arguments.length?(n=(t=e)?e.stream||function(t){var e=zr(function(e,n){return t([e*Nt,n*Nt])});return function(t){return Pr(e(t))}}(e):I,s()):t},u.context=function(t){return arguments.length?(r=null==(e=t)?new function(){var t=br(4.5),e=[],n={point:r,lineStart:function(){n.point=i},lineEnd:a,polygonStart:function(){n.lineEnd=u},polygonEnd:function(){n.lineEnd=a,n.point=r},pointRadius:function(e){return t=br(e),n},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function r(n,r){e.push("M",n,",",r,t)}function i(t,r){e.push("M",t,",",r),n.point=o}function o(t,n){e.push("L",t,",",n)}function a(){n.point=r}function u(){e.push("Z")}return n}:new function(t){var e=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:a,polygonStart:function(){n.lineEnd=u},polygonEnd:function(){n.lineEnd=a,n.point=r},pointRadius:function(t){return e=t,n},result:B};function r(n,r){t.moveTo(n+e,r),t.arc(n,r,e,0,Tt)}function i(e,r){t.moveTo(e,r),n.point=o}function o(e,n){t.lineTo(e,n)}function a(){n.point=r}function u(){t.closePath()}return n}(t),"function"!=typeof a&&r.pointRadius(a),s()):e},u.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(r.pointRadius(+t),+t),u):a},u.projection(o.geo.albersUsa()).context(null)},o.geo.transform=function(t){return{stream:function(e){var n=new Er(e);for(var r in t)n[r]=t[r];return n}}},Er.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},o.geo.projection=Tr,o.geo.projectionMutator=Cr,(o.geo.equirectangular=function(){return Tr(Or)}).raw=Or.invert=Or,o.geo.rotation=function(t){function e(e){return(e=t(e[0]*Ot,e[1]*Ot))[0]*=Nt,e[1]*=Nt,e}return t=Ir(t[0]%360*Ot,t[1]*Ot,t.length>2?t[2]*Ot:0),e.invert=function(e){return(e=t.invert(e[0]*Ot,e[1]*Ot))[0]*=Nt,e[1]*=Nt,e},e},Nr.invert=Or,o.geo.circle=function(){var t,e,n=[0,0],r=6;function i(){var t="function"==typeof n?n.apply(this,arguments):n,r=Ir(-t[0]*Ot,-t[1]*Ot,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=r(t,e)),t[0]*=Nt,t[1]*=Nt}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(n=t,i):n},i.angle=function(n){return arguments.length?(e=Br((t=+n)*Ot,r*Ot),i):t},i.precision=function(n){return arguments.length?(e=Br(t*Ot,(r=+n)*Ot),i):r},i.angle(90)},o.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Ot,i=t[1]*Ot,o=e[1]*Ot,a=Math.sin(r),u=Math.cos(r),s=Math.sin(i),l=Math.cos(i),f=Math.sin(o),c=Math.cos(o);return Math.atan2(Math.sqrt((n=c*a)*n+(n=l*f-s*c*u)*n),s*f+l*c*u)},o.geo.graticule=function(){var t,e,n,r,i,a,u,s,l,f,c,h,p=10,d=p,m=90,g=360,v=2.5;function y(){return{type:"MultiLineString",coordinates:_()}}function _(){return o.range(Math.ceil(r/m)*m,n,m).map(c).concat(o.range(Math.ceil(s/g)*g,u,g).map(h)).concat(o.range(Math.ceil(e/p)*p,t,p).filter(function(t){return w(t%m)>zt}).map(l)).concat(o.range(Math.ceil(a/d)*d,i,d).filter(function(t){return w(t%g)>zt}).map(f))}return y.lines=function(){return _().map(function(t){return{type:"LineString",coordinates:t}})},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(h(u).slice(1),c(n).reverse().slice(1),h(s).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.majorExtent(t).minorExtent(t):y.minorExtent()},y.majorExtent=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],u=+t[1][1],r>n&&(t=r,r=n,n=t),s>u&&(t=s,s=u,u=t),y.precision(v)):[[r,s],[n,u]]},y.minorExtent=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),y.precision(v)):[[e,a],[t,i]]},y.step=function(t){return arguments.length?y.majorStep(t).minorStep(t):y.minorStep()},y.majorStep=function(t){return arguments.length?(m=+t[0],g=+t[1],y):[m,g]},y.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],y):[p,d]},y.precision=function(o){return arguments.length?(v=+o,l=qr(a,i,90),f=Ur(e,t,v),c=qr(s,u,90),h=Ur(r,n,v),y):v},y.majorExtent([[-180,-90+zt],[180,90-zt]]).minorExtent([[-180,-80-zt],[180,80+zt]])},o.geo.greatArc=function(){var t,e,n=Yr,r=Hr;function i(){return{type:"LineString",coordinates:[t||n.apply(this,arguments),e||r.apply(this,arguments)]}}return i.distance=function(){return o.geo.distance(t||n.apply(this,arguments),e||r.apply(this,arguments))},i.source=function(e){return arguments.length?(n=e,t="function"==typeof e?null:e,i):n},i.target=function(t){return arguments.length?(r=t,e="function"==typeof t?null:t,i):r},i.precision=function(){return arguments.length?i:0},i},o.geo.interpolate=function(t,e){return function(t,e,n,r){var i=Math.cos(e),o=Math.sin(e),a=Math.cos(r),u=Math.sin(r),s=i*Math.cos(t),l=i*Math.sin(t),f=a*Math.cos(n),c=a*Math.sin(n),h=2*Math.asin(Math.sqrt(Ft(r-e)+i*a*Ft(n-t))),p=1/Math.sin(h),d=h?function(t){var e=Math.sin(t*=h)*p,n=Math.sin(h-t)*p,r=n*s+e*f,i=n*l+e*c,a=n*o+e*u;return[Math.atan2(i,r)*Nt,Math.atan2(a,Math.sqrt(r*r+i*i))*Nt]}:function(){return[t*Nt,e*Nt]};return d.distance=h,d}(t[0]*Ot,t[1]*Ot,e[0]*Ot,e[1]*Ot)},o.geo.length=function(t){return xr=0,o.geo.stream(t,Vr),xr};var Vr={sphere:B,point:B,lineStart:function(){var t,e,n;function r(r,i){var o=Math.sin(i*=Ot),a=Math.cos(i),u=w((r*=Ot)-t),s=Math.cos(u);xr+=Math.atan2(Math.sqrt((u=a*Math.sin(u))*u+(u=n*o-e*a*s)*u),e*o+n*a*s),t=r,e=o,n=a}Vr.point=function(i,o){t=i*Ot,e=Math.sin(o*=Ot),n=Math.cos(o),Vr.point=r},Vr.lineEnd=function(){Vr.point=Vr.lineEnd=B}},lineEnd:B,polygonStart:B,polygonEnd:B};function Zr(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),o=t(r*i);return[o*i*Math.sin(e),o*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,r*a),Math.asin(r&&n*o/r)]},n}var Wr=Zr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(o.geo.azimuthalEqualArea=function(){return Tr(Wr)}).raw=Wr;var Qr=Zr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},I);function Xr(t,e){var n=Math.cos(t),r=function(t){return Math.tan(St/4+t/2)},i=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(r(e)/r(t)),o=n*Math.pow(r(t),i)/i;if(!i)return $r;function a(t,e){o>0?e<-Pt+zt&&(e=-Pt+zt):e>Pt-zt&&(e=Pt-zt);var n=o/Math.pow(r(e),i);return[n*Math.sin(i*t),o-n*Math.cos(i*t)]}return a.invert=function(t,e){var n=o-e,r=It(i)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/i,2*Math.atan(Math.pow(o/r,1/i))-Pt]},a}function Gr(t,e){var n=Math.cos(t),r=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),i=n/r+t;if(w(r)<zt)return Or;function o(t,e){var n=i-e;return[n*Math.sin(r*t),i-n*Math.cos(r*t)]}return o.invert=function(t,e){var n=i-e;return[Math.atan2(t,n)/r,i-It(r)*Math.sqrt(t*t+n*n)]},o}(o.geo.azimuthalEquidistant=function(){return Tr(Qr)}).raw=Qr,(o.geo.conicConformal=function(){return lr(Xr)}).raw=Xr,(o.geo.conicEquidistant=function(){return lr(Gr)}).raw=Gr;var Kr=Zr(function(t){return 1/t},Math.atan);function $r(t,e){return[t,Math.log(Math.tan(St/4+e/2))]}function Jr(t){var e,n=Tr(t),r=n.scale,i=n.translate,o=n.clipExtent;return n.scale=function(){var t=r.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.translate=function(){var t=i.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.clipExtent=function(t){var a=o.apply(n,arguments);if(a===n){if(e=null==t){var u=St*r(),s=i();o([[s[0]-u,s[1]-u],[s[0]+u,s[1]+u]])}}else e&&(a=null);return a},n.clipExtent(null)}(o.geo.gnomonic=function(){return Tr(Kr)}).raw=Kr,$r.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Pt]},(o.geo.mercator=function(){return Jr($r)}).raw=$r;var ti=Zr(function(){return 1},Math.asin);(o.geo.orthographic=function(){return Tr(ti)}).raw=ti;var ei=Zr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function ni(t,e){return[Math.log(Math.tan(St/4+e/2)),-t]}function ri(t){return t[0]}function ii(t){return t[1]}function oi(t){for(var e=t.length,n=[0,1],r=2,i=2;i<e;i++){for(;r>1&&Dt(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function ai(t,e){return t[0]-e[0]||t[1]-e[1]}(o.geo.stereographic=function(){return Tr(ei)}).raw=ei,ni.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Pt]},(o.geo.transverseMercator=function(){var t=Jr(ni),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90])}).raw=ni,o.geom={},o.geom.hull=function(t){var e=ri,n=ii;if(arguments.length)return r(t);function r(t){if(t.length<3)return[];var r,i=be(e),o=be(n),a=t.length,u=[],s=[];for(r=0;r<a;r++)u.push([+i.call(this,t[r],r),+o.call(this,t[r],r),r]);for(u.sort(ai),r=0;r<a;r++)s.push([u[r][0],-u[r][1]]);var l=oi(u),f=oi(s),c=f[0]===l[0],h=f[f.length-1]===l[l.length-1],p=[];for(r=l.length-1;r>=0;--r)p.push(t[u[l[r]][2]]);for(r=+c;r<f.length-h;++r)p.push(t[u[f[r]][2]]);return p}return r.x=function(t){return arguments.length?(e=t,r):e},r.y=function(t){return arguments.length?(n=t,r):n},r},o.geom.polygon=function(t){return Z(t,ui),t};var ui=o.geom.polygon.prototype=[];function si(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function li(t,e,n,r){var i=t[0],o=n[0],a=e[0]-i,u=r[0]-o,s=t[1],l=n[1],f=e[1]-s,c=r[1]-l,h=(u*(s-l)-c*(i-o))/(c*a-u*f);return[i+h*a,s+h*f]}function fi(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}ui.area=function(){for(var t,e=-1,n=this.length,r=this[n-1],i=0;++e<n;)t=r,r=this[e],i+=t[1]*r[0]-t[0]*r[1];return.5*i},ui.centroid=function(t){var e,n,r=-1,i=this.length,o=0,a=0,u=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++r<i;)e=u,u=this[r],n=e[0]*u[1]-u[0]*e[1],o+=(e[0]+u[0])*n,a+=(e[1]+u[1])*n;return[o*t,a*t]},ui.clip=function(t){for(var e,n,r,i,o,a,u=fi(t),s=-1,l=this.length-fi(this),f=this[l-1];++s<l;){for(e=t.slice(),t.length=0,i=this[s],o=e[(r=e.length-u)-1],n=-1;++n<r;)si(a=e[n],f,i)?(si(o,f,i)||t.push(li(o,a,f,i)),t.push(a)):si(o,f,i)&&t.push(li(o,a,f,i)),o=a;u&&t.push(t[0]),f=i}return t};var ci,hi,pi,di,mi,gi=[],vi=[];function yi(t){var e=gi.pop()||new function(){Ii(this),this.edge=this.site=this.circle=null};return e.site=t,e}function _i(t){zi(t),pi.remove(t),gi.push(t),Ii(t)}function bi(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},o=t.P,a=t.N,u=[t];_i(t);for(var s=o;s.circle&&w(n-s.circle.x)<zt&&w(r-s.circle.cy)<zt;)o=s.P,u.unshift(s),_i(s),s=o;u.unshift(s),zi(s);for(var l=a;l.circle&&w(n-l.circle.x)<zt&&w(r-l.circle.cy)<zt;)a=l.N,u.push(l),_i(l),l=a;u.push(l),zi(l);var f,c=u.length;for(f=1;f<c;++f)l=u[f],s=u[f-1],Pi(l.edge,s.site,l.site,i);s=u[0],(l=u[c-1]).edge=Ti(s.site,l.site,null,i),Ai(s),Ai(l)}function xi(t){for(var e,n,r,i,o=t.x,a=t.y,u=pi._;u;)if((r=wi(u,a)-o)>zt)u=u.L;else{if(!((i=o-Mi(u,a))>zt)){r>-zt?(e=u.P,n=u):i>-zt?(e=u,n=u.N):e=n=u;break}if(!u.R){e=u;break}u=u.R}var s=yi(t);if(pi.insert(e,s),e||n){if(e===n)return zi(e),n=yi(e.site),pi.insert(s,n),s.edge=n.edge=Ti(e.site,s.site),Ai(e),void Ai(n);if(n){zi(e),zi(n);var l=e.site,f=l.x,c=l.y,h=t.x-f,p=t.y-c,d=n.site,m=d.x-f,g=d.y-c,v=2*(h*g-p*m),y=h*h+p*p,_=m*m+g*g,b={x:(g*y-p*_)/v+f,y:(h*_-m*y)/v+c};Pi(n.edge,l,d,b),s.edge=Ti(l,t,null,b),n.edge=Ti(t,d,null,b),Ai(e),Ai(n)}else s.edge=Ti(e.site,s.site)}}function wi(t,e){var n=t.site,r=n.x,i=n.y,o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;var u=(n=a.site).x,s=n.y,l=s-e;if(!l)return u;var f=u-r,c=1/o-1/l,h=f/l;return c?(-h+Math.sqrt(h*h-2*c*(f*f/(-2*l)-s+l/2+i-o/2)))/c+r:(r+u)/2}function Mi(t,e){var n=t.N;if(n)return wi(n,e);var r=t.site;return r.y===e?r.x:1/0}function ji(t){this.site=t,this.edges=[]}function ki(t,e){return e.angle-t.angle}function Ai(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var a=i.x,u=i.y,s=r.x-a,l=r.y-u,f=o.x-a,c=2*(s*(g=o.y-u)-l*f);if(!(c>=-Et)){var h=s*s+l*l,p=f*f+g*g,d=(g*h-l*p)/c,m=(s*p-f*h)/c,g=m+u,v=vi.pop()||new function(){Ii(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=i,v.x=d+a,v.y=g+Math.sqrt(d*d+m*m),v.cy=g,t.circle=v;for(var y=null,_=mi._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){y=_.P;break}_=_.L}else{if(!_.R){y=_;break}_=_.R}mi.insert(y,v),y||(di=v)}}}}function zi(t){var e=t.circle;e&&(e.P||(di=e.N),mi.remove(e),vi.push(e),Ii(e),t.circle=null)}function Ei(t,e){var n=t.b;if(n)return!0;var r,i,o=t.a,a=e[0][0],u=e[1][0],s=e[0][1],l=e[1][1],f=t.l,c=t.r,h=f.x,p=f.y,d=c.x,m=c.y,g=(h+d)/2,v=(p+m)/2;if(m===p){if(g<a||g>=u)return;if(h>d){if(o){if(o.y>=l)return}else o={x:g,y:s};n={x:g,y:l}}else{if(o){if(o.y<s)return}else o={x:g,y:l};n={x:g,y:s}}}else if(i=v-(r=(h-d)/(m-p))*g,r<-1||r>1)if(h>d){if(o){if(o.y>=l)return}else o={x:(s-i)/r,y:s};n={x:(l-i)/r,y:l}}else{if(o){if(o.y<s)return}else o={x:(l-i)/r,y:l};n={x:(s-i)/r,y:s}}else if(p<m){if(o){if(o.x>=u)return}else o={x:a,y:r*a+i};n={x:u,y:r*u+i}}else{if(o){if(o.x<a)return}else o={x:u,y:r*u+i};n={x:a,y:r*a+i}}return t.a=o,t.b=n,!0}function Si(t,e){this.l=t,this.r=e,this.a=this.b=null}function Ti(t,e,n,r){var i=new Si(t,e);return ci.push(i),n&&Pi(i,t,e,n),r&&Pi(i,e,t,r),hi[t.i].edges.push(new Oi(i,t,e)),hi[e.i].edges.push(new Oi(i,e,t)),i}function Ci(t,e,n){var r=new Si(t,null);return r.a=e,r.b=n,ci.push(r),r}function Pi(t,e,n,r){t.a||t.b?t.l===n?t.b=r:t.a=r:(t.a=r,t.l=e,t.r=n)}function Oi(t,e,n){var r=t.a,i=t.b;this.edge=t,this.site=e,this.angle=n?Math.atan2(n.y-e.y,n.x-e.x):t.l===e?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function Ni(){this._=null}function Ii(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Di(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Li(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Ri(t){for(;t.L;)t=t.L;return t}function Bi(t,e){var n,r,i,o=t.sort(Fi).pop();for(ci=[],hi=new Array(t.length),pi=new Ni,mi=new Ni;;)if(i=di,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))o.x===n&&o.y===r||(hi[o.i]=new ji(o),xi(o),n=o.x,r=o.y),o=t.pop();else{if(!i)break;bi(i.arc)}e&&(function(t){for(var e,n=ci,r=ar(t[0][0],t[0][1],t[1][0],t[1][1]),i=n.length;i--;)(!Ei(e=n[i],t)||!r(e)||w(e.a.x-e.b.x)<zt&&w(e.a.y-e.b.y)<zt)&&(e.a=e.b=null,n.splice(i,1))}(e),function(t){for(var e,n,r,i,o,a,u,s,l,f,c=t[0][0],h=t[1][0],p=t[0][1],d=t[1][1],m=hi,g=m.length;g--;)if((o=m[g])&&o.prepare())for(s=(u=o.edges).length,a=0;a<s;)r=(f=u[a].end()).x,i=f.y,e=(l=u[++a%s].start()).x,n=l.y,(w(r-e)>zt||w(i-n)>zt)&&(u.splice(a,0,new Oi(Ci(o.site,f,w(r-c)<zt&&d-i>zt?{x:c,y:w(e-c)<zt?n:d}:w(i-d)<zt&&h-r>zt?{x:w(n-d)<zt?e:h,y:d}:w(r-h)<zt&&i-p>zt?{x:h,y:w(e-h)<zt?n:p}:w(i-p)<zt&&r-c>zt?{x:w(n-p)<zt?e:c,y:p}:null),o.site,null)),++s)}(e));var a={cells:hi,edges:ci};return pi=mi=ci=hi=null,a}function Fi(t,e){return e.y-t.y||e.x-t.x}ji.prototype.prepare=function(){for(var t,e=this.edges,n=e.length;n--;)(t=e[n].edge).b&&t.a||e.splice(n,1);return e.sort(ki),e.length},Oi.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Ni.prototype={insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Ri(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Di(this,n),n=(t=n).U),n.C=!1,r.C=!0,Li(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Li(this,n),n=(t=n).U),n.C=!1,r.C=!0,Di(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,a=t.R;if(n=o?a?Ri(a):o:a,i?i.L===t?i.L=n:i.R=n:this._=n,o&&a?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==a?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=a,a.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Di(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Li(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Di(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Li(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Di(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Li(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},o.geom.voronoi=function(t){var e=ri,n=ii,r=e,i=n,o=qi;if(t)return a(t);function a(t){var e=new Array(t.length),n=o[0][0],r=o[0][1],i=o[1][0],a=o[1][1];return Bi(u(t),o).cells.forEach(function(o,u){var s=o.edges,l=o.site;(e[u]=s.length?s.map(function(t){var e=t.start();return[e.x,e.y]}):l.x>=n&&l.x<=i&&l.y>=r&&l.y<=a?[[n,a],[i,a],[i,r],[n,r]]:[]).point=t[u]}),e}function u(t){return t.map(function(t,e){return{x:Math.round(r(t,e)/zt)*zt,y:Math.round(i(t,e)/zt)*zt,i:e}})}return a.links=function(t){return Bi(u(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},a.triangles=function(t){var e=[];return Bi(u(t)).cells.forEach(function(n,r){for(var i,o=n.site,a=n.edges.sort(ki),u=-1,s=a.length,l=a[s-1].edge,f=l.l===o?l.r:l.l;++u<s;)l,i=f,f=(l=a[u].edge).l===o?l.r:l.l,r<i.i&&r<f.i&&Ui(o,i,f)<0&&e.push([t[r],t[i.i],t[f.i]])}),e},a.x=function(t){return arguments.length?(r=be(e=t),a):e},a.y=function(t){return arguments.length?(i=be(n=t),a):n},a.clipExtent=function(t){return arguments.length?(o=null==t?qi:t,a):o===qi?null:o},a.size=function(t){return arguments.length?a.clipExtent(t&&[[0,0],t]):o===qi?null:o&&o[1]},a};var qi=[[-1e6,-1e6],[1e6,1e6]];function Ui(t,e,n){return(t.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-t.y)}function Yi(t){return t.x}function Hi(t){return t.y}function Vi(t,e){t=o.rgb(t),e=o.rgb(e);var n=t.r,r=t.g,i=t.b,a=e.r-n,u=e.g-r,s=e.b-i;return function(t){return"#"+pe(Math.round(n+a*t))+pe(Math.round(r+u*t))+pe(Math.round(i+s*t))}}function Zi(t,e){var n,r={},i={};for(n in t)n in e?r[n]=Ki(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function Wi(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Qi(t,e){var n,r,i,o=Xi.lastIndex=Gi.lastIndex=0,a=-1,u=[],s=[];for(t+="",e+="";(n=Xi.exec(t))&&(r=Gi.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:Wi(n,r)})),o=Gi.lastIndex;return o<e.length&&(i=e.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var n,r=0;r<e;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})}o.geom.delaunay=function(t){return o.geom.voronoi().triangles(t)},o.geom.quadtree=function(t,e,n,r,i){var o,a=ri,u=ii;if(o=arguments.length)return a=Yi,u=Hi,3===o&&(i=n,r=e,n=e=0),s(t);function s(t){var s,l,f,c,h,p,d,m,g,v=be(a),y=be(u);if(null!=e)p=e,d=n,m=r,g=i;else if(m=g=-(p=d=1/0),l=[],f=[],h=t.length,o)for(c=0;c<h;++c)(s=t[c]).x<p&&(p=s.x),s.y<d&&(d=s.y),s.x>m&&(m=s.x),s.y>g&&(g=s.y),l.push(s.x),f.push(s.y);else for(c=0;c<h;++c){var _=+v(s=t[c],c),b=+y(s,c);_<p&&(p=_),b<d&&(d=b),_>m&&(m=_),b>g&&(g=b),l.push(_),f.push(b)}var x=m-p,M=g-d;function j(t,e,n,r,i,o,a,u){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var s=t.x,l=t.y;if(null!=s)if(w(s-n)+w(l-r)<.01)k(t,e,n,r,i,o,a,u);else{var f=t.point;t.x=t.y=t.point=null,k(t,f,s,l,i,o,a,u),k(t,e,n,r,i,o,a,u)}else t.x=n,t.y=r,t.point=e}else k(t,e,n,r,i,o,a,u)}function k(t,e,n,r,i,o,a,u){var s=.5*(i+a),l=.5*(o+u),f=n>=s,c=r>=l,h=c<<1|f;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){j(A,t,+v(t,++c),+y(t,c),p,d,m,g)}}),f?i=s:a=s,c?o=l:u=l,j(t,e,n,r,i,o,a,u)}x>M?g=d+x:m=p+M;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){j(A,t,+v(t,++c),+y(t,c),p,d,m,g)}};if(A.visit=function(t){!function t(e,n,r,i,o,a){if(!e(n,r,i,o,a)){var u=.5*(r+o),s=.5*(i+a),l=n.nodes;l[0]&&t(e,l[0],r,i,u,s),l[1]&&t(e,l[1],u,i,o,s),l[2]&&t(e,l[2],r,s,u,a),l[3]&&t(e,l[3],u,s,o,a)}}(t,A,p,d,m,g)},A.find=function(t){return function(t,e,n,r,i,o,a){var u,s=1/0;return function t(l,f,c,h,p){if(!(f>o||c>a||h<r||p<i)){if(d=l.point){var d,m=e-l.x,g=n-l.y,v=m*m+g*g;if(v<s){var y=Math.sqrt(s=v);r=e-y,i=n-y,o=e+y,a=n+y,u=d}}for(var _=l.nodes,b=.5*(f+h),x=.5*(c+p),w=(n>=x)<<1|e>=b,M=w+4;w<M;++w)if(l=_[3&w])switch(3&w){case 0:t(l,f,c,b,x);break;case 1:t(l,b,c,h,x);break;case 2:t(l,f,x,b,p);break;case 3:t(l,b,x,h,p)}}}(t,r,i,o,a),u}(A,t[0],t[1],p,d,m,g)},c=-1,null==e){for(;++c<h;)j(A,t[c],l[c],f[c],p,d,m,g);--c}else t.forEach(A.add);return l=f=t=s=null,A}return s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(u=t,s):u},s.extent=function(t){return arguments.length?(null==t?e=n=r=i=null:(e=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),s):null==e?null:[[e,n],[r,i]]},s.size=function(t){return arguments.length?(null==t?e=n=r=i=null:(e=n=0,r=+t[0],i=+t[1]),s):null==e?null:[r-e,i-n]},s},o.interpolateRgb=Vi,o.interpolateObject=Zi,o.interpolateNumber=Wi,o.interpolateString=Qi;var Xi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gi=new RegExp(Xi.source,"g");function Ki(t,e){for(var n,r=o.interpolators.length;--r>=0&&!(n=o.interpolators[r](t,e)););return n}function $i(t,e){var n,r=[],i=[],o=t.length,a=e.length,u=Math.min(t.length,e.length);for(n=0;n<u;++n)r.push(Ki(t[n],e[n]));for(;n<o;++n)i[n]=t[n];for(;n<a;++n)i[n]=e[n];return function(t){for(n=0;n<u;++n)i[n]=r[n](t);return i}}o.interpolate=Ki,o.interpolators=[function(t,e){var n=typeof e;return("string"===n?_e.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?Vi:Qi:e instanceof Vt?Vi:Array.isArray(e)?$i:"object"===n&&isNaN(e)?Zi:Wi)(t,e)}],o.interpolateArray=$i;var Ji=function(){return I},to=o.map({linear:Ji,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return io},cubic:function(){return oo},sin:function(){return uo},exp:function(){return so},circle:function(){return lo},elastic:function(t,e){var n;arguments.length<2&&(e=.45);arguments.length?n=e/Tt*Math.asin(1/t):(t=1,n=e/4);return function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Tt/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return fo}}),eo=o.map({in:I,out:no,"in-out":ro,"out-in":function(t){return ro(no(t))}});function no(t){return function(e){return 1-t(1-e)}}function ro(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function io(t){return t*t}function oo(t){return t*t*t}function ao(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}function uo(t){return 1-Math.cos(t*Pt)}function so(t){return Math.pow(2,10*(t-1))}function lo(t){return 1-Math.sqrt(1-t*t)}function fo(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function co(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function ho(t){var e=[t.a,t.b],n=[t.c,t.d],r=mo(e),i=po(e,n),o=mo(function(t,e,n){return t[0]+=n*e[0],t[1]+=n*e[1],t}(n,e,-i))||0;e[0]*n[1]<n[0]*e[1]&&(e[0]*=-1,e[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Nt,this.translate=[t.e,t.f],this.scale=[r,o],this.skew=o?Math.atan2(i,o)*Nt:0}function po(t,e){return t[0]*e[0]+t[1]*e[1]}function mo(t){var e=Math.sqrt(po(t,t));return e&&(t[0]/=e,t[1]/=e),e}o.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=to.get(n)||Ji,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}((r=eo.get(r)||I)(n.apply(null,a.call(arguments,1))))},o.interpolateHcl=function(t,e){t=o.hcl(t),e=o.hcl(e);var n=t.h,r=t.c,i=t.l,a=e.h-n,u=e.c-r,s=e.l-i;isNaN(u)&&(u=0,r=isNaN(r)?e.c:r);isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:a<-180&&(a+=360);return function(t){return Kt(n+a*t,r+u*t,i+s*t)+""}},o.interpolateHsl=function(t,e){t=o.hsl(t),e=o.hsl(e);var n=t.h,r=t.s,i=t.l,a=e.h-n,u=e.s-r,s=e.l-i;isNaN(u)&&(u=0,r=isNaN(r)?e.s:r);isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:a<-180&&(a+=360);return function(t){return Qt(n+a*t,r+u*t,i+s*t)+""}},o.interpolateLab=function(t,e){t=o.lab(t),e=o.lab(e);var n=t.l,r=t.a,i=t.b,a=e.l-n,u=e.a-r,s=e.b-i;return function(t){return ie(n+a*t,r+u*t,i+s*t)+""}},o.interpolateRound=co,o.transform=function(t){var e=s.createElementNS(o.ns.prefix.svg,"g");return(o.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new ho(n?n.matrix:go)})(t)},ho.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var go={a:1,b:0,c:0,d:1,e:0,f:0};function vo(t){return t.length?t.pop()+",":""}function yo(t,e){var n=[],r=[];return t=o.transform(t),e=o.transform(e),function(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var i=n.push("translate(",null,",",null,")");r.push({i:i-4,x:Wi(t[0],e[0])},{i:i-2,x:Wi(t[1],e[1])})}else(e[0]||e[1])&&n.push("translate("+e+")")}(t.translate,e.translate,n,r),function(t,e,n,r){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(vo(n)+"rotate(",null,")")-2,x:Wi(t,e)})):e&&n.push(vo(n)+"rotate("+e+")")}(t.rotate,e.rotate,n,r),function(t,e,n,r){t!==e?r.push({i:n.push(vo(n)+"skewX(",null,")")-2,x:Wi(t,e)}):e&&n.push(vo(n)+"skewX("+e+")")}(t.skew,e.skew,n,r),function(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var i=n.push(vo(n)+"scale(",null,",",null,")");r.push({i:i-4,x:Wi(t[0],e[0])},{i:i-2,x:Wi(t[1],e[1])})}else 1===e[0]&&1===e[1]||n.push(vo(n)+"scale("+e+")")}(t.scale,e.scale,n,r),t=e=null,function(t){for(var e,i=-1,o=r.length;++i<o;)n[(e=r[i]).i]=e.x(t);return n.join("")}}function _o(t,e){return e=(e-=t=+t)||1/e,function(n){return(n-t)/e}}function bo(t,e){return e=(e-=t=+t)||1/e,function(n){return Math.max(0,Math.min(1,(n-t)/e))}}function xo(t){for(var e=t.source,n=t.target,r=function(t,e){if(t===e)return t;var n=wo(t),r=wo(e),i=n.pop(),o=r.pop(),a=null;for(;i===o;)a=i,i=n.pop(),o=r.pop();return a}(e,n),i=[e];e!==r;)e=e.parent,i.push(e);for(var o=i.length;n!==r;)i.splice(o,0,n),n=n.parent;return i}function wo(t){for(var e=[],n=t.parent;null!=n;)e.push(t),t=n,n=n.parent;return e.push(t),e}function Mo(t){t.fixed|=2}function jo(t){t.fixed&=-7}function ko(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Ao(t){t.fixed&=-5}o.interpolateTransform=yo,o.layout={},o.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n<r;)e.push(xo(t[n]));return e}},o.layout.chord=function(){var t,e,n,r,i,a,u,s={},l=0;function f(){var s,f,h,p,d,m={},g=[],v=o.range(r),y=[];for(t=[],e=[],s=0,p=-1;++p<r;){for(f=0,d=-1;++d<r;)f+=n[p][d];g.push(f),y.push(o.range(r)),s+=f}for(i&&v.sort(function(t,e){return i(g[t],g[e])}),a&&y.forEach(function(t,e){t.sort(function(t,r){return a(n[e][t],n[e][r])})}),s=(Tt-l*r)/s,f=0,p=-1;++p<r;){for(h=f,d=-1;++d<r;){var _=v[p],b=y[_][d],x=n[_][b],w=f,M=f+=x*s;m[_+"-"+b]={index:_,subindex:b,startAngle:w,endAngle:M,value:x}}e[_]={index:_,startAngle:h,endAngle:f,value:g[_]},f+=l}for(p=-1;++p<r;)for(d=p-1;++d<r;){var j=m[p+"-"+d],k=m[d+"-"+p];(j.value||k.value)&&t.push(j.value<k.value?{source:k,target:j}:{source:j,target:k})}u&&c()}function c(){t.sort(function(t,e){return u((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return s.matrix=function(i){return arguments.length?(r=(n=i)&&n.length,t=e=null,s):n},s.padding=function(n){return arguments.length?(l=n,t=e=null,s):l},s.sortGroups=function(n){return arguments.length?(i=n,t=e=null,s):i},s.sortSubgroups=function(e){return arguments.length?(a=e,t=null,s):a},s.sortChords=function(e){return arguments.length?(u=e,t&&c(),s):u},s.chords=function(){return t||f(),t},s.groups=function(){return e||f(),e},s},o.layout.force=function(){var t,e,n,r,i,a,u={},s=o.dispatch("start","tick","end"),l=[1,1],f=.9,c=zo,h=Eo,p=-30,d=So,m=.1,g=.64,v=[],y=[];function _(t){return function(e,n,r,i){if(e.point!==t){var o=e.cx-t.x,a=e.cy-t.y,u=i-n,s=o*o+a*a;if(u*u/g<s){if(s<d){var l=e.charge/s;t.px-=o*l,t.py-=a*l}return!0}if(e.point&&s&&s<d){l=e.pointCharge/s;t.px-=o*l,t.py-=a*l}}return!e.charge}}function b(t){t.px=o.event.x,t.py=o.event.y,u.resume()}return u.tick=function(){if((n*=.99)<.005)return t=null,s.end({type:"end",alpha:n=0}),!0;var e,u,c,h,d,g,b,x,w,M=v.length,j=y.length;for(u=0;u<j;++u)h=(c=y[u]).source,(g=(x=(d=c.target).x-h.x)*x+(w=d.y-h.y)*w)&&(x*=g=n*i[u]*((g=Math.sqrt(g))-r[u])/g,w*=g,d.x-=x*(b=h.weight+d.weight?h.weight/(h.weight+d.weight):.5),d.y-=w*b,h.x+=x*(b=1-b),h.y+=w*b);if((b=n*m)&&(x=l[0]/2,w=l[1]/2,u=-1,b))for(;++u<M;)(c=v[u]).x+=(x-c.x)*b,c.y+=(w-c.y)*b;if(p)for(!function t(e,n,r){var i=0,o=0;e.charge=0;if(!e.leaf)for(var a,u=e.nodes,s=u.length,l=-1;++l<s;)null!=(a=u[l])&&(t(a,n,r),e.charge+=a.charge,i+=a.charge*a.cx,o+=a.charge*a.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var f=n*r[e.point.index];e.charge+=e.pointCharge=f,i+=f*e.point.x,o+=f*e.point.y}e.cx=i/e.charge;e.cy=o/e.charge}(e=o.geom.quadtree(v),n,a),u=-1;++u<M;)(c=v[u]).fixed||e.visit(_(c));for(u=-1;++u<M;)(c=v[u]).fixed?(c.x=c.px,c.y=c.py):(c.x-=(c.px-(c.px=c.x))*f,c.y-=(c.py-(c.py=c.y))*f);s.tick({type:"tick",alpha:n})},u.nodes=function(t){return arguments.length?(v=t,u):v},u.links=function(t){return arguments.length?(y=t,u):y},u.size=function(t){return arguments.length?(l=t,u):l},u.linkDistance=function(t){return arguments.length?(c="function"==typeof t?t:+t,u):c},u.distance=u.linkDistance,u.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,u):h},u.friction=function(t){return arguments.length?(f=+t,u):f},u.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,u):p},u.chargeDistance=function(t){return arguments.length?(d=t*t,u):Math.sqrt(d)},u.gravity=function(t){return arguments.length?(m=+t,u):m},u.theta=function(t){return arguments.length?(g=t*t,u):Math.sqrt(g)},u.alpha=function(e){return arguments.length?(e=+e,n?e>0?n=e:(t.c=null,t.t=NaN,t=null,s.end({type:"end",alpha:n=0})):e>0&&(s.start({type:"start",alpha:n=e}),t=Ee(u.tick)),u):n},u.start=function(){var t,e,n,o=v.length,s=y.length,f=l[0],d=l[1];for(t=0;t<o;++t)(n=v[t]).index=t,n.weight=0;for(t=0;t<s;++t)"number"==typeof(n=y[t]).source&&(n.source=v[n.source]),"number"==typeof n.target&&(n.target=v[n.target]),++n.source.weight,++n.target.weight;for(t=0;t<o;++t)n=v[t],isNaN(n.x)&&(n.x=m("x",f)),isNaN(n.y)&&(n.y=m("y",d)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(r=[],"function"==typeof c)for(t=0;t<s;++t)r[t]=+c.call(this,y[t],t);else for(t=0;t<s;++t)r[t]=c;if(i=[],"function"==typeof h)for(t=0;t<s;++t)i[t]=+h.call(this,y[t],t);else for(t=0;t<s;++t)i[t]=h;if(a=[],"function"==typeof p)for(t=0;t<o;++t)a[t]=+p.call(this,v[t],t);else for(t=0;t<o;++t)a[t]=p;function m(n,r){if(!e){for(e=new Array(o),l=0;l<o;++l)e[l]=[];for(l=0;l<s;++l){var i=y[l];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var a,u=e[t],l=-1,f=u.length;++l<f;)if(!isNaN(a=u[l][n]))return a;return Math.random()*r}return u.resume()},u.resume=function(){return u.alpha(.1)},u.stop=function(){return u.alpha(0)},u.drag=function(){if(e||(e=o.behavior.drag().origin(I).on("dragstart.force",Mo).on("drag.force",b).on("dragend.force",jo)),!arguments.length)return e;this.on("mouseover.force",ko).on("mouseout.force",Ao).call(e)},o.rebind(u,s,"on")};var zo=20,Eo=1,So=1/0;function To(t,e){return o.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=Do,t}function Co(t,e){for(var n=[t];null!=(t=n.pop());)if(e(t),(i=t.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}function Po(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(o=t.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)n.push(o[a]);for(;null!=(t=r.pop());)e(t)}function Oo(t){return t.children}function No(t){return t.value}function Io(t,e){return e.value-t.value}function Do(t){return o.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}o.layout.hierarchy=function(){var t=Io,e=Oo,n=No;function r(i){var o,a=[i],u=[];for(i.depth=0;null!=(o=a.pop());)if(u.push(o),(l=e.call(r,o,o.depth))&&(s=l.length)){for(var s,l,f;--s>=0;)a.push(f=l[s]),f.parent=o,f.depth=o.depth+1;n&&(o.value=0),o.children=l}else n&&(o.value=+n.call(r,o,o.depth)||0),delete o.children;return Po(i,function(e){var r,i;t&&(r=e.children)&&r.sort(t),n&&(i=e.parent)&&(i.value+=e.value)}),u}return r.sort=function(e){return arguments.length?(t=e,r):t},r.children=function(t){return arguments.length?(e=t,r):e},r.value=function(t){return arguments.length?(n=t,r):n},r.revalue=function(t){return n&&(Co(t,function(t){t.children&&(t.value=0)}),Po(t,function(t){var e;t.children||(t.value=+n.call(r,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},r},o.layout.partition=function(){var t=o.layout.hierarchy(),e=[1,1];function n(n,r){var i=t.call(this,n,r);return function t(e,n,r,i){var o=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,o&&(a=o.length)){var a,u,s,l=-1;for(r=e.value?r/e.value:0;++l<a;)t(u=o[l],n,s=u.value*r,i),n+=s}}(i[0],0,e[0],e[1]/function t(e){var n=e.children,r=0;if(n&&(i=n.length))for(var i,o=-1;++o<i;)r=Math.max(r,t(n[o]));return 1+r}(i[0])),i}return n.size=function(t){return arguments.length?(e=t,n):e},To(n,t)},o.layout.pie=function(){var t=Number,e=Lo,n=0,r=Tt,i=0;function a(u){var s,l=u.length,f=u.map(function(e,n){return+t.call(a,e,n)}),c=+("function"==typeof n?n.apply(this,arguments):n),h=("function"==typeof r?r.apply(this,arguments):r)-c,p=Math.min(Math.abs(h)/l,+("function"==typeof i?i.apply(this,arguments):i)),d=p*(h<0?-1:1),m=o.sum(f),g=m?(h-l*d)/m:0,v=o.range(l),y=[];return null!=e&&v.sort(e===Lo?function(t,e){return f[e]-f[t]}:function(t,n){return e(u[t],u[n])}),v.forEach(function(t){y[t]={data:u[t],value:s=f[t],startAngle:c,endAngle:c+=s*g+d,padAngle:p}}),y}return a.value=function(e){return arguments.length?(t=e,a):t},a.sort=function(t){return arguments.length?(e=t,a):e},a.startAngle=function(t){return arguments.length?(n=t,a):n},a.endAngle=function(t){return arguments.length?(r=t,a):r},a.padAngle=function(t){return arguments.length?(i=t,a):i},a};var Lo={};function Ro(t){return t.x}function Bo(t){return t.y}function Fo(t,e,n){t.y0=e,t.y=n}o.layout.stack=function(){var t=I,e=Yo,n=Ho,r=Fo,i=Ro,a=Bo;function u(s,l){if(!(p=s.length))return s;var f=s.map(function(e,n){return t.call(u,e,n)}),c=f.map(function(t){return t.map(function(t,e){return[i.call(u,t,e),a.call(u,t,e)]})}),h=e.call(u,c,l);f=o.permute(f,h),c=o.permute(c,h);var p,d,m,g,v=n.call(u,c,l),y=f[0].length;for(m=0;m<y;++m)for(r.call(u,f[0][m],g=v[m],c[0][m][1]),d=1;d<p;++d)r.call(u,f[d][m],g+=c[d-1][m][1],c[d][m][1]);return s}return u.values=function(e){return arguments.length?(t=e,u):t},u.order=function(t){return arguments.length?(e="function"==typeof t?t:qo.get(t)||Yo,u):e},u.offset=function(t){return arguments.length?(n="function"==typeof t?t:Uo.get(t)||Ho,u):n},u.x=function(t){return arguments.length?(i=t,u):i},u.y=function(t){return arguments.length?(a=t,u):a},u.out=function(t){return arguments.length?(r=t,u):r},u};var qo=o.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(Vo),a=t.map(Zo),u=o.range(r).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,f=[],c=[];for(e=0;e<r;++e)n=u[e],s<l?(s+=a[n],f.push(n)):(l+=a[n],c.push(n));return c.reverse().concat(f)},reverse:function(t){return o.range(t.length).reverse()},default:Yo}),Uo=o.map({silhouette:function(t){var e,n,r,i=t.length,o=t[0].length,a=[],u=0,s=[];for(n=0;n<o;++n){for(e=0,r=0;e<i;e++)r+=t[e][n][1];r>u&&(u=r),a.push(r)}for(n=0;n<o;++n)s[n]=(u-a[n])/2;return s},wiggle:function(t){var e,n,r,i,o,a,u,s,l,f=t.length,c=t[0],h=c.length,p=[];for(p[0]=s=l=0,n=1;n<h;++n){for(e=0,i=0;e<f;++e)i+=t[e][n][1];for(e=0,o=0,u=c[n][0]-c[n-1][0];e<f;++e){for(r=0,a=(t[e][n][1]-t[e][n-1][1])/(2*u);r<e;++r)a+=(t[r][n][1]-t[r][n-1][1])/u;o+=a*t[e][n][1]}p[n]=s-=i?o/i*u:0,s<l&&(l=s)}for(n=0;n<h;++n)p[n]-=l;return p},expand:function(t){var e,n,r,i=t.length,o=t[0].length,a=1/i,u=[];for(n=0;n<o;++n){for(e=0,r=0;e<i;e++)r+=t[e][n][1];if(r)for(e=0;e<i;e++)t[e][n][1]/=r;else for(e=0;e<i;e++)t[e][n][1]=a}for(n=0;n<o;++n)u[n]=0;return u},zero:Ho});function Yo(t){return o.range(t.length)}function Ho(t){for(var e=-1,n=t[0].length,r=[];++e<n;)r[e]=0;return r}function Vo(t){for(var e,n=1,r=0,i=t[0][1],o=t.length;n<o;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function Zo(t){return t.reduce(Wo,0)}function Wo(t,e){return t+e[1]}function Qo(t,e){return Xo(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Xo(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function Go(t){return[o.min(t),o.max(t)]}function Ko(t,e){return t.value-e.value}function $o(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function Jo(t,e){t._pack_next=e,e._pack_prev=t}function ta(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function ea(t){if((e=t.children)&&(s=e.length)){var e,n,r,i,o,a,u,s,l=1/0,f=-1/0,c=1/0,h=-1/0;if(e.forEach(na),(n=e[0]).x=-n.r,n.y=0,_(n),s>1&&((r=e[1]).x=r.r,r.y=0,_(r),s>2))for(ia(n,r,i=e[2]),_(i),$o(n,i),n._pack_prev=i,$o(i,r),r=n._pack_next,o=3;o<s;o++){ia(n,r,i=e[o]);var p=0,d=1,m=1;for(a=r._pack_next;a!==r;a=a._pack_next,d++)if(ta(a,i)){p=1;break}if(1==p)for(u=n._pack_prev;u!==a._pack_prev&&!ta(u,i);u=u._pack_prev,m++);p?(d<m||d==m&&r.r<n.r?Jo(n,r=a):Jo(n=u,r),o--):($o(n,i),r=i,_(i))}var g=(l+f)/2,v=(c+h)/2,y=0;for(o=0;o<s;o++)(i=e[o]).x-=g,i.y-=v,y=Math.max(y,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=y,e.forEach(ra)}function _(t){l=Math.min(t.x-t.r,l),f=Math.max(t.x+t.r,f),c=Math.min(t.y-t.r,c),h=Math.max(t.y+t.r,h)}}function na(t){t._pack_next=t._pack_prev=t}function ra(t){delete t._pack_next,delete t._pack_prev}function ia(t,e,n){var r=t.r+n.r,i=e.x-t.x,o=e.y-t.y;if(r&&(i||o)){var a=e.r+n.r,u=i*i+o*o,s=.5+((r*=r)-(a*=a))/(2*u),l=Math.sqrt(Math.max(0,2*a*(r+u)-(r-=u)*r-a*a))/(2*u);n.x=t.x+s*i+l*o,n.y=t.y+s*o-l*i}else n.x=t.x+r,n.y=t.y}function oa(t,e){return t.parent==e.parent?1:2}function aa(t){var e=t.children;return e.length?e[0]:t.t}function ua(t){var e,n=t.children;return(e=n.length)?n[e-1]:t.t}function sa(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function la(t,e,n){return t.a.parent===e.parent?t.a:n}function fa(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function ca(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return i<0&&(n+=i/2,i=0),o<0&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function ha(t){var e=t[0],n=t[t.length-1];return e<n?[e,n]:[n,e]}function pa(t){return t.rangeExtent?t.rangeExtent():ha(t.range())}function da(t,e,n,r){var i=n(t[0],t[1]),o=r(e[0],e[1]);return function(t){return o(i(t))}}function ma(t,e){var n,r=0,i=t.length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function ga(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:va}o.layout.histogram=function(){var t=!0,e=Number,n=Go,r=Qo;function i(i,a){for(var u,s,l=[],f=i.map(e,this),c=n.call(this,f,a),h=r.call(this,c,f,a),p=(a=-1,f.length),d=h.length-1,m=t?1:1/p;++a<d;)(u=l[a]=[]).dx=h[a+1]-(u.x=h[a]),u.y=0;if(d>0)for(a=-1;++a<p;)(s=f[a])>=c[0]&&s<=c[1]&&((u=l[o.bisect(h,s,1,d)-1]).y+=m,u.push(i[a]));return l}return i.value=function(t){return arguments.length?(e=t,i):e},i.range=function(t){return arguments.length?(n=be(t),i):n},i.bins=function(t){return arguments.length?(r="number"==typeof t?function(e){return Xo(e,t)}:be(t),i):r},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},o.layout.pack=function(){var t,e=o.layout.hierarchy().sort(Ko),n=0,r=[1,1];function i(i,o){var a=e.call(this,i,o),u=a[0],s=r[0],l=r[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(u.x=u.y=0,Po(u,function(t){t.r=+f(t.value)}),Po(u,ea),n){var c=n*(t?1:Math.max(2*u.r/s,2*u.r/l))/2;Po(u,function(t){t.r+=c}),Po(u,ea),Po(u,function(t){t.r-=c})}return function t(e,n,r,i){var o=e.children;e.x=n+=i*e.x;e.y=r+=i*e.y;e.r*=i;if(o)for(var a=-1,u=o.length;++a<u;)t(o[a],n,r,i)}(u,s/2,l/2,t?1:1/Math.max(2*u.r/s,2*u.r/l)),a}return i.size=function(t){return arguments.length?(r=t,i):r},i.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,i):t},i.padding=function(t){return arguments.length?(n=+t,i):n},To(i,e)},o.layout.tree=function(){var t=o.layout.hierarchy().sort(null).value(null),e=oa,n=[1,1],r=null;function i(i,o){var l=t.call(this,i,o),f=l[0],c=function(t){var e,n={A:null,children:[t]},r=[n];for(;null!=(e=r.pop());)for(var i,o=e.children,a=0,u=o.length;a<u;++a)r.push((o[a]=i={_:o[a],parent:e,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}(f);if(Po(c,a),c.parent.m=-c.z,Co(c,u),r)Co(f,s);else{var h=f,p=f,d=f;Co(f,function(t){t.x<h.x&&(h=t),t.x>p.x&&(p=t),t.depth>d.depth&&(d=t)});var m=e(h,p)/2-h.x,g=n[0]/(p.x+e(p,h)/2+m),v=n[1]/(d.depth||1);Co(f,function(t){t.x=(t.x+m)*g,t.y=t.depth*v})}return l}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n.length){!function(t){var e,n=0,r=0,i=t.children,o=i.length;for(;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,n,r){if(n){for(var i,o=t,a=t,u=n,s=o.parent.children[0],l=o.m,f=a.m,c=u.m,h=s.m;u=ua(u),o=aa(o),u&&o;)s=aa(s),(a=ua(a)).a=t,(i=u.z+c-o.z-l+e(u._,o._))>0&&(sa(la(u,t,r),t,i),l+=i,f+=i),c+=u.m,l+=o.m,h+=s.m,f+=a.m;u&&!ua(a)&&(a.t=u,a.m+=c-f),o&&!aa(s)&&(s.t=o,s.m+=l-h,r=t)}return r}(t,i,t.parent.A||r[0])}function u(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(r=null==(n=t)?s:null,i):r?null:n},i.nodeSize=function(t){return arguments.length?(r=null==(n=t)?null:s,i):r?n:null},To(i,t)},o.layout.cluster=function(){var t=o.layout.hierarchy().sort(null).value(null),e=oa,n=[1,1],r=!1;function i(i,a){var u,s=t.call(this,i,a),l=s[0],f=0;Po(l,function(t){var n=t.children;n&&n.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),t.y=function(t){return 1+o.max(t,function(t){return t.y})}(n)):(t.x=u?f+=e(t,u):0,t.y=0,u=t)});var c=function t(e){var n=e.children;return n&&n.length?t(n[0]):e}(l),h=function t(e){var n,r=e.children;return r&&(n=r.length)?t(r[n-1]):e}(l),p=c.x-e(c,h)/2,d=h.x+e(h,c)/2;return Po(l,r?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(r=null==(n=t),i):r?null:n},i.nodeSize=function(t){return arguments.length?(r=null!=(n=t),i):r?n:null},To(i,t)},o.layout.treemap=function(){var t,e=o.layout.hierarchy(),n=Math.round,r=[1,1],i=null,a=fa,u=!1,s="squarify",l=.5*(1+Math.sqrt(5));function f(t,e){for(var n,r,i=-1,o=t.length;++i<o;)r=(n=t[i]).value*(e<0?0:e),n.area=isNaN(r)||r<=0?0:r}function c(t){var e=t.children;if(e&&e.length){var n,r,i,o=a(t),u=[],l=e.slice(),h=1/0,m="slice"===s?o.dx:"dice"===s?o.dy:"slice-dice"===s?1&t.depth?o.dy:o.dx:Math.min(o.dx,o.dy);for(f(l,o.dx*o.dy/t.value),u.area=0;(i=l.length)>0;)u.push(n=l[i-1]),u.area+=n.area,"squarify"!==s||(r=p(u,m))<=h?(l.pop(),h=r):(u.area-=u.pop().area,d(u,m,o,!1),m=Math.min(o.dx,o.dy),u.length=u.area=0,h=1/0);u.length&&(d(u,m,o,!0),u.length=u.area=0),e.forEach(c)}}function h(t){var e=t.children;if(e&&e.length){var n,r=a(t),i=e.slice(),o=[];for(f(i,r.dx*r.dy/t.value),o.area=0;n=i.pop();)o.push(n),o.area+=n.area,null!=n.z&&(d(o,n.z?r.dx:r.dy,r,!i.length),o.length=o.area=0);e.forEach(h)}}function p(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,u=t.length;++a<u;)(n=t[a].area)&&(n<o&&(o=n),n>i&&(i=n));return e*=e,(r*=r)?Math.max(e*i*l/r,r/(e*o*l)):1/0}function d(t,e,r,i){var o,a=-1,u=t.length,s=r.x,l=r.y,f=e?n(t.area/e):0;if(e==r.dx){for((i||f>r.dy)&&(f=r.dy);++a<u;)(o=t[a]).x=s,o.y=l,o.dy=f,s+=o.dx=Math.min(r.x+r.dx-s,f?n(o.area/f):0);o.z=!0,o.dx+=r.x+r.dx-s,r.y+=f,r.dy-=f}else{for((i||f>r.dx)&&(f=r.dx);++a<u;)(o=t[a]).x=s,o.y=l,o.dx=f,l+=o.dy=Math.min(r.y+r.dy-l,f?n(o.area/f):0);o.z=!1,o.dy+=r.y+r.dy-l,r.x+=f,r.dx-=f}}function m(n){var i=t||e(n),o=i[0];return o.x=o.y=0,o.value?(o.dx=r[0],o.dy=r[1]):o.dx=o.dy=0,t&&e.revalue(o),f([o],o.dx*o.dy/o.value),(t?h:c)(o),u&&(t=i),i}return m.size=function(t){return arguments.length?(r=t,m):r},m.padding=function(t){if(!arguments.length)return i;function e(e){return ca(e,t)}var n;return a=null==(i=t)?fa:"function"==(n=typeof t)?function(e){var n=t.call(m,e,e.depth);return null==n?fa(e):ca(e,"number"==typeof n?[n,n,n,n]:n)}:"number"===n?(t=[t,t,t,t],e):e,m},m.round=function(t){return arguments.length?(n=t?Math.round:Number,m):n!=Number},m.sticky=function(e){return arguments.length?(u=e,t=null,m):u},m.ratio=function(t){return arguments.length?(l=t,m):l},m.mode=function(t){return arguments.length?(s=t+"",m):s},To(m,e)},o.random={normal:function(t,e){var n=arguments.length;return n<2&&(e=1),n<1&&(t=0),function(){var n,r,i;do{i=(n=2*Math.random()-1)*n+(r=2*Math.random()-1)*r}while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=o.random.normal.apply(o,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=o.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;n<t;n++)e+=Math.random();return e}}},o.scale={};var va={floor:I,ceil:I};function ya(t,e,n,r){var i=[],a=[],u=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++u<=s;)i.push(n(t[u-1],t[u])),a.push(r(e[u-1],e[u]));return function(e){var n=o.bisect(t,e,1,s)-1;return a[n](i[n](e))}}function _a(t,e){return o.rebind(t,e,"range","rangeRound","interpolate","clamp")}function ba(t,e){return ma(t,ga(xa(t,e)[2])),ma(t,ga(xa(t,e)[2])),t}function xa(t,e){null==e&&(e=10);var n=ha(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function wa(t,e){return o.range.apply(o,xa(t,e))}function Ma(t,e,n){var r=xa(t,e);if(n){var i=Ne.exec(n);if(i.shift(),"s"===i[8]){var a=o.formatPrefix(Math.max(w(r[0]),w(r[1])));return i[7]||(i[7]="."+ka(a.scale(r[2]))),i[8]="f",n=o.format(i.join("")),function(t){return n(a.scale(t))+a.symbol}}i[7]||(i[7]="."+function(t,e){var n=ka(e[2]);return t in ja?Math.abs(n-ka(Math.max(w(e[0]),w(e[1]))))+ +("e"!==t):n-2*("%"===t)}(i[8],r)),n=i.join("")}else n=",."+ka(r[2])+"f";return o.format(n)}o.scale.linear=function(){return function t(e,n,r,i){var o,a;function u(){var t=Math.min(e.length,n.length)>2?ya:da,u=i?bo:_o;return o=t(e,n,u,r),a=t(n,e,u,Ki),s}function s(t){return o(t)}s.invert=function(t){return a(t)};s.domain=function(t){return arguments.length?(e=t.map(Number),u()):e};s.range=function(t){return arguments.length?(n=t,u()):n};s.rangeRound=function(t){return s.range(t).interpolate(co)};s.clamp=function(t){return arguments.length?(i=t,u()):i};s.interpolate=function(t){return arguments.length?(r=t,u()):r};s.ticks=function(t){return wa(e,t)};s.tickFormat=function(t,n){return Ma(e,t,n)};s.nice=function(t){return ba(e,t),u()};s.copy=function(){return t(e,n,r,i)};return u()}([0,1],[0,1],Ki,!1)};var ja={s:1,g:1,p:1,r:1,e:1};function ka(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}o.scale.log=function(){return function t(e,n,r,i){function a(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function u(t){return r?Math.pow(n,t):-Math.pow(n,-t)}function s(t){return e(a(t))}s.invert=function(t){return u(e.invert(t))};s.domain=function(t){return arguments.length?(r=t[0]>=0,e.domain((i=t.map(Number)).map(a)),s):i};s.base=function(t){return arguments.length?(n=+t,e.domain(i.map(a)),s):n};s.nice=function(){var t=ma(i.map(a),r?Math:za);return e.domain(t),i=t.map(u),s};s.ticks=function(){var t=ha(i),e=[],o=t[0],s=t[1],l=Math.floor(a(o)),f=Math.ceil(a(s)),c=n%1?2:n;if(isFinite(f-l)){if(r){for(;l<f;l++)for(var h=1;h<c;h++)e.push(u(l)*h);e.push(u(l))}else for(e.push(u(l));l++<f;)for(var h=c-1;h>0;h--)e.push(u(l)*h);for(l=0;e[l]<o;l++);for(f=e.length;e[f-1]>s;f--);e=e.slice(l,f)}return e};s.tickFormat=function(t,e){if(!arguments.length)return Aa;arguments.length<2?e=Aa:"function"!=typeof e&&(e=o.format(e));var r=Math.max(1,n*t/s.ticks().length);return function(t){var i=t/u(Math.round(a(t)));return i*n<n-.5&&(i*=n),i<=r?e(t):""}};s.copy=function(){return t(e.copy(),n,r,i)};return _a(s,e)}(o.scale.linear().domain([0,1]),10,!0,[1,10])};var Aa=o.format(".0e"),za={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Ea(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}o.scale.pow=function(){return function t(e,n,r){var i=Ea(n),o=Ea(1/n);function a(t){return e(i(t))}a.invert=function(t){return o(e.invert(t))};a.domain=function(t){return arguments.length?(e.domain((r=t.map(Number)).map(i)),a):r};a.ticks=function(t){return wa(r,t)};a.tickFormat=function(t,e){return Ma(r,t,e)};a.nice=function(t){return a.domain(ba(r,t))};a.exponent=function(t){return arguments.length?(i=Ea(n=t),o=Ea(1/n),e.domain(r.map(i)),a):n};a.copy=function(){return t(e.copy(),n,r)};return _a(a,e)}(o.scale.linear(),1,[0,1])},o.scale.sqrt=function(){return o.scale.pow().exponent(.5)},o.scale.ordinal=function(){return function t(e,n){var r,i,a;function u(t){return i[((r.get(t)||("range"===n.t?r.set(t,e.push(t)):NaN))-1)%i.length]}function s(t,n){return o.range(e.length).map(function(e){return t+n*e})}u.domain=function(t){if(!arguments.length)return e;e=[],r=new j;for(var i,o=-1,a=t.length;++o<a;)r.has(i=t[o])||r.set(i,e.push(i));return u[n.t].apply(u,n.a)};u.range=function(t){return arguments.length?(i=t,a=0,n={t:"range",a:arguments},u):i};u.rangePoints=function(t,r){arguments.length<2&&(r=0);var o=t[0],l=t[1],f=e.length<2?(o=(o+l)/2,0):(l-o)/(e.length-1+r);return i=s(o+f*r/2,f),a=0,n={t:"rangePoints",a:arguments},u};u.rangeRoundPoints=function(t,r){arguments.length<2&&(r=0);var o=t[0],l=t[1],f=e.length<2?(o=l=Math.round((o+l)/2),0):(l-o)/(e.length-1+r)|0;return i=s(o+Math.round(f*r/2+(l-o-(e.length-1+r)*f)/2),f),a=0,n={t:"rangeRoundPoints",a:arguments},u};u.rangeBands=function(t,r,o){arguments.length<2&&(r=0),arguments.length<3&&(o=r);var l=t[1]<t[0],f=t[l-0],c=t[1-l],h=(c-f)/(e.length-r+2*o);return i=s(f+h*o,h),l&&i.reverse(),a=h*(1-r),n={t:"rangeBands",a:arguments},u};u.rangeRoundBands=function(t,r,o){arguments.length<2&&(r=0),arguments.length<3&&(o=r);var l=t[1]<t[0],f=t[l-0],c=t[1-l],h=Math.floor((c-f)/(e.length-r+2*o));return i=s(f+Math.round((c-f-(e.length-r)*h)/2),h),l&&i.reverse(),a=Math.round(h*(1-r)),n={t:"rangeRoundBands",a:arguments},u};u.rangeBand=function(){return a};u.rangeExtent=function(){return ha(n.a[0])};u.copy=function(){return t(e,n)};return u.domain(e)}([],{t:"range",a:[[]]})},o.scale.category10=function(){return o.scale.ordinal().range(Sa)},o.scale.category20=function(){return o.scale.ordinal().range(Ta)},o.scale.category20b=function(){return o.scale.ordinal().range(Ca)},o.scale.category20c=function(){return o.scale.ordinal().range(Pa)};var Sa=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ce),Ta=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ce),Ca=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ce),Pa=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ce);function Oa(){return 0}o.scale.quantile=function(){return function t(e,n){var r;function i(){var t=0,i=n.length;for(r=[];++t<i;)r[t-1]=o.quantile(e,t/i);return a}function a(t){if(!isNaN(t=+t))return n[o.bisect(r,t)]}a.domain=function(t){return arguments.length?(e=t.map(v).filter(y).sort(g),i()):e};a.range=function(t){return arguments.length?(n=t,i()):n};a.quantiles=function(){return r};a.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?r[t-1]:e[0],t<r.length?r[t]:e[e.length-1]]};a.copy=function(){return t(e,n)};return i()}([],[])},o.scale.quantize=function(){return function t(e,n,r){var i,o;function a(t){return r[Math.max(0,Math.min(o,Math.floor(i*(t-e))))]}function u(){return i=r.length/(n-e),o=r.length-1,a}a.domain=function(t){return arguments.length?(e=+t[0],n=+t[t.length-1],u()):[e,n]};a.range=function(t){return arguments.length?(r=t,u()):r};a.invertExtent=function(t){return[t=(t=r.indexOf(t))<0?NaN:t/i+e,t+1/i]};a.copy=function(){return t(e,n,r)};return u()}(0,1,[0,1])},o.scale.threshold=function(){return function t(e,n){function r(t){if(t<=t)return n[o.bisect(e,t)]}r.domain=function(t){return arguments.length?(e=t,r):e};r.range=function(t){return arguments.length?(n=t,r):n};r.invertExtent=function(t){return t=n.indexOf(t),[e[t-1],e[t]]};r.copy=function(){return t(e,n)};return r}([.5],[0,1])},o.scale.identity=function(){return function t(e){function n(t){return+t}n.invert=n;n.domain=n.range=function(t){return arguments.length?(e=t.map(n),n):e};n.ticks=function(t){return wa(e,t)};n.tickFormat=function(t,n){return Ma(e,t,n)};n.copy=function(){return t(e)};return n}([0,1])},o.svg={},o.svg.arc=function(){var t=Ia,e=Da,n=Oa,r=Na,i=La,o=Ra,a=Ba;function u(){var u=Math.max(0,+t.apply(this,arguments)),l=Math.max(0,+e.apply(this,arguments)),f=i.apply(this,arguments)-Pt,c=o.apply(this,arguments)-Pt,h=Math.abs(c-f),p=f>c?0:1;if(l<u&&(d=l,l=u,u=d),h>=Ct)return s(l,p)+(u?s(u,1-p):"")+"Z";var d,m,g,v,y,_,b,x,w,M,j,k,A=0,z=0,E=[];if((v=(+a.apply(this,arguments)||0)/2)&&(g=r===Na?Math.sqrt(u*u+l*l):+r.apply(this,arguments),p||(z*=-1),l&&(z=Rt(g/l*Math.sin(v))),u&&(A=Rt(g/u*Math.sin(v)))),l){y=l*Math.cos(f+z),_=l*Math.sin(f+z),b=l*Math.cos(c-z),x=l*Math.sin(c-z);var S=Math.abs(c-f-2*z)<=St?0:1;if(z&&Fa(y,_,b,x)===p^S){var T=(f+c)/2;y=l*Math.cos(T),_=l*Math.sin(T),b=x=null}}else y=_=0;if(u){w=u*Math.cos(c-A),M=u*Math.sin(c-A),j=u*Math.cos(f+A),k=u*Math.sin(f+A);var C=Math.abs(f-c+2*A)<=St?0:1;if(A&&Fa(w,M,j,k)===1-p^C){var P=(f+c)/2;w=u*Math.cos(P),M=u*Math.sin(P),j=k=null}}else w=M=0;if(h>zt&&(d=Math.min(Math.abs(l-u)/2,+n.apply(this,arguments)))>.001){m=u<l^p?0:1;var O=d,N=d;if(h<St){var I=null==j?[w,M]:null==b?[y,_]:li([y,_],[j,k],[b,x],[w,M]),D=y-I[0],L=_-I[1],R=b-I[0],B=x-I[1],F=1/Math.sin(Math.acos((D*R+L*B)/(Math.sqrt(D*D+L*L)*Math.sqrt(R*R+B*B)))/2),q=Math.sqrt(I[0]*I[0]+I[1]*I[1]);N=Math.min(d,(u-q)/(F-1)),O=Math.min(d,(l-q)/(F+1))}if(null!=b){var U=qa(null==j?[w,M]:[j,k],[y,_],l,O,p),Y=qa([b,x],[w,M],l,O,p);d===O?E.push("M",U[0],"A",O,",",O," 0 0,",m," ",U[1],"A",l,",",l," 0 ",1-p^Fa(U[1][0],U[1][1],Y[1][0],Y[1][1]),",",p," ",Y[1],"A",O,",",O," 0 0,",m," ",Y[0]):E.push("M",U[0],"A",O,",",O," 0 1,",m," ",Y[0])}else E.push("M",y,",",_);if(null!=j){var H=qa([y,_],[j,k],u,-N,p),V=qa([w,M],null==b?[y,_]:[b,x],u,-N,p);d===N?E.push("L",V[0],"A",N,",",N," 0 0,",m," ",V[1],"A",u,",",u," 0 ",p^Fa(V[1][0],V[1][1],H[1][0],H[1][1]),",",1-p," ",H[1],"A",N,",",N," 0 0,",m," ",H[0]):E.push("L",V[0],"A",N,",",N," 0 0,",m," ",H[0])}else E.push("L",w,",",M)}else E.push("M",y,",",_),null!=b&&E.push("A",l,",",l," 0 ",S,",",p," ",b,",",x),E.push("L",w,",",M),null!=j&&E.push("A",u,",",u," 0 ",C,",",1-p," ",j,",",k);return E.push("Z"),E.join("")}function s(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return u.innerRadius=function(e){return arguments.length?(t=be(e),u):t},u.outerRadius=function(t){return arguments.length?(e=be(t),u):e},u.cornerRadius=function(t){return arguments.length?(n=be(t),u):n},u.padRadius=function(t){return arguments.length?(r=t==Na?Na:be(t),u):r},u.startAngle=function(t){return arguments.length?(i=be(t),u):i},u.endAngle=function(t){return arguments.length?(o=be(t),u):o},u.padAngle=function(t){return arguments.length?(a=be(t),u):a},u.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Pt;return[Math.cos(r)*n,Math.sin(r)*n]},u};var Na="auto";function Ia(t){return t.innerRadius}function Da(t){return t.outerRadius}function La(t){return t.startAngle}function Ra(t){return t.endAngle}function Ba(t){return t&&t.padAngle}function Fa(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function qa(t,e,n,r,i){var o=t[0]-e[0],a=t[1]-e[1],u=(i?r:-r)/Math.sqrt(o*o+a*a),s=u*a,l=-u*o,f=t[0]+s,c=t[1]+l,h=e[0]+s,p=e[1]+l,d=(f+h)/2,m=(c+p)/2,g=h-f,v=p-c,y=g*g+v*v,_=n-r,b=f*p-h*c,x=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*y-b*b)),w=(b*v-g*x)/y,M=(-b*g-v*x)/y,j=(b*v+g*x)/y,k=(-b*g+v*x)/y,A=w-d,z=M-m,E=j-d,S=k-m;return A*A+z*z>E*E+S*S&&(w=j,M=k),[[w-s,M-l],[w*n/_,M*n/_]]}function Ua(t){var e=ri,n=ii,r=Kn,i=Ha,o=i.key,a=.7;function u(o){var u,s=[],l=[],f=-1,c=o.length,h=be(e),p=be(n);function d(){s.push("M",i(t(l),a))}for(;++f<c;)r.call(this,u=o[f],f)?l.push([+h.call(this,u,f),+p.call(this,u,f)]):l.length&&(d(),l=[]);return l.length&&d(),s.length?s.join(""):null}return u.x=function(t){return arguments.length?(e=t,u):e},u.y=function(t){return arguments.length?(n=t,u):n},u.defined=function(t){return arguments.length?(r=t,u):r},u.interpolate=function(t){return arguments.length?(o="function"==typeof t?i=t:(i=Ya.get(t)||Ha).key,u):o},u.tension=function(t){return arguments.length?(a=t,u):a},u}o.svg.line=function(){return Ua(I)};var Ya=o.map({linear:Ha,"linear-closed":Va,step:function(t){var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];for(;++e<n;)i.push("H",(r[0]+(r=t[e])[0])/2,"V",r[1]);n>1&&i.push("H",r[0]);return i.join("")},"step-before":Za,"step-after":Wa,basis:Ga,"basis-open":function(t){if(t.length<4)return Ha(t);var e,n=[],r=-1,i=t.length,o=[0],a=[0];for(;++r<3;)e=t[r],o.push(e[0]),a.push(e[1]);n.push(Ka(tu,o)+","+Ka(tu,a)),--r;for(;++r<i;)e=t[r],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),eu(n,o,a);return n.join("")},"basis-closed":function(t){var e,n,r=-1,i=t.length,o=i+4,a=[],u=[];for(;++r<4;)n=t[r%i],a.push(n[0]),u.push(n[1]);e=[Ka(tu,a),",",Ka(tu,u)],--r;for(;++r<o;)n=t[r%i],a.shift(),a.push(n[0]),u.shift(),u.push(n[1]),eu(e,a,u);return e.join("")},bundle:function(t,e){var n=t.length-1;if(n)for(var r,i,o=t[0][0],a=t[0][1],u=t[n][0]-o,s=t[n][1]-a,l=-1;++l<=n;)r=t[l],i=l/n,r[0]=e*r[0]+(1-e)*(o+i*u),r[1]=e*r[1]+(1-e)*(a+i*s);return Ga(t)},cardinal:function(t,e){return t.length<3?Ha(t):t[0]+Qa(t,Xa(t,e))},"cardinal-open":function(t,e){return t.length<4?Ha(t):t[1]+Qa(t.slice(1,-1),Xa(t,e))},"cardinal-closed":function(t,e){return t.length<3?Va(t):t[0]+Qa((t.push(t[0]),t),Xa([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Ha(t):t[0]+Qa(t,function(t){var e,n,r,i,o=[],a=function(t){var e=0,n=t.length-1,r=[],i=t[0],o=t[1],a=r[0]=nu(i,o);for(;++e<n;)r[e]=(a+(a=nu(i=o,o=t[e+1])))/2;return r[e]=a,r}(t),u=-1,s=t.length-1;for(;++u<s;)e=nu(t[u],t[u+1]),w(e)<zt?a[u]=a[u+1]=0:(n=a[u]/e,r=a[u+1]/e,(i=n*n+r*r)>9&&(i=3*e/Math.sqrt(i),a[u]=i*n,a[u+1]=i*r));u=-1;for(;++u<=s;)i=(t[Math.min(s,u+1)][0]-t[Math.max(0,u-1)][0])/(6*(1+a[u]*a[u])),o.push([i||0,a[u]*i||0]);return o}(t))}});function Ha(t){return t.length>1?t.join("L"):t+"Z"}function Va(t){return t.join("L")+"Z"}function Za(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("V",(r=t[e])[1],"H",r[0]);return i.join("")}function Wa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r=t[e])[0],"V",r[1]);return i.join("")}function Qa(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Ha(t);var n=t.length!=e.length,r="",i=t[0],o=t[1],a=e[0],u=a,s=1;if(n&&(r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],i=t[1],s=2),e.length>1){u=e[1],o=t[s],s++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-u[0])+","+(o[1]-u[1])+","+o[0]+","+o[1];for(var l=2;l<e.length;l++,s++)o=t[s],u=e[l],r+="S"+(o[0]-u[0])+","+(o[1]-u[1])+","+o[0]+","+o[1]}if(n){var f=t[s];r+="Q"+(o[0]+2*u[0]/3)+","+(o[1]+2*u[1]/3)+","+f[0]+","+f[1]}return r}function Xa(t,e){for(var n,r=[],i=(1-e)/2,o=t[0],a=t[1],u=1,s=t.length;++u<s;)n=o,o=a,a=t[u],r.push([i*(a[0]-n[0]),i*(a[1]-n[1])]);return r}function Ga(t){if(t.length<3)return Ha(t);var e=1,n=t.length,r=t[0],i=r[0],o=r[1],a=[i,i,i,(r=t[1])[0]],u=[o,o,o,r[1]],s=[i,",",o,"L",Ka(tu,a),",",Ka(tu,u)];for(t.push(t[n-1]);++e<=n;)r=t[e],a.shift(),a.push(r[0]),u.shift(),u.push(r[1]),eu(s,a,u);return t.pop(),s.push("L",r),s.join("")}function Ka(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Ya.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var $a=[0,2/3,1/3,0],Ja=[0,1/3,2/3,0],tu=[0,1/6,2/3,1/6];function eu(t,e,n){t.push("C",Ka($a,e),",",Ka($a,n),",",Ka(Ja,e),",",Ka(Ja,n),",",Ka(tu,e),",",Ka(tu,n))}function nu(t,e){return(e[1]-t[1])/(e[0]-t[0])}function ru(t){for(var e,n,r,i=-1,o=t.length;++i<o;)n=(e=t[i])[0],r=e[1]-Pt,e[0]=n*Math.cos(r),e[1]=n*Math.sin(r);return t}function iu(t){var e=ri,n=ri,r=0,i=ii,o=Kn,a=Ha,u=a.key,s=a,l="L",f=.7;function c(u){var c,h,p,d=[],m=[],g=[],v=-1,y=u.length,_=be(e),b=be(r),x=e===n?function(){return h}:be(n),w=r===i?function(){return p}:be(i);function M(){d.push("M",a(t(g),f),l,s(t(m.reverse()),f),"Z")}for(;++v<y;)o.call(this,c=u[v],v)?(m.push([h=+_.call(this,c,v),p=+b.call(this,c,v)]),g.push([+x.call(this,c,v),+w.call(this,c,v)])):m.length&&(M(),m=[],g=[]);return m.length&&M(),d.length?d.join(""):null}return c.x=function(t){return arguments.length?(e=n=t,c):n},c.x0=function(t){return arguments.length?(e=t,c):e},c.x1=function(t){return arguments.length?(n=t,c):n},c.y=function(t){return arguments.length?(r=i=t,c):i},c.y0=function(t){return arguments.length?(r=t,c):r},c.y1=function(t){return arguments.length?(i=t,c):i},c.defined=function(t){return arguments.length?(o=t,c):o},c.interpolate=function(t){return arguments.length?(u="function"==typeof t?a=t:(a=Ya.get(t)||Ha).key,s=a.reverse||a,l=a.closed?"M":"L",c):u},c.tension=function(t){return arguments.length?(f=t,c):f},c}function ou(t){return t.radius}function au(t){return[t.x,t.y]}function uu(){return 64}function su(){return"circle"}function lu(t){var e=Math.sqrt(t/St);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}o.svg.line.radial=function(){var t=Ua(ru);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Za.reverse=Wa,Wa.reverse=Za,o.svg.area=function(){return iu(I)},o.svg.area.radial=function(){var t=iu(ru);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},o.svg.chord=function(){var t=Yr,e=Hr,n=ou,r=La,i=Ra;function o(n,r){var i=a(this,t,n,r),o=a(this,e,n,r);return"M"+i.p0+u(i.r,i.p1,i.a1-i.a0)+(function(t,e){return t.a0==e.a0&&t.a1==e.a1}(i,o)?s(i.r,i.p1,i.r,i.p0):s(i.r,i.p1,o.r,o.p0)+u(o.r,o.p1,o.a1-o.a0)+s(o.r,o.p1,i.r,i.p0))+"Z"}function a(t,e,o,a){var u=e.call(t,o,a),s=n.call(t,u,a),l=r.call(t,u,a)-Pt,f=i.call(t,u,a)-Pt;return{r:s,a0:l,a1:f,p0:[s*Math.cos(l),s*Math.sin(l)],p1:[s*Math.cos(f),s*Math.sin(f)]}}function u(t,e,n){return"A"+t+","+t+" 0 "+ +(n>St)+",1 "+e}function s(t,e,n,r){return"Q 0,0 "+r}return o.radius=function(t){return arguments.length?(n=be(t),o):n},o.source=function(e){return arguments.length?(t=be(e),o):t},o.target=function(t){return arguments.length?(e=be(t),o):e},o.startAngle=function(t){return arguments.length?(r=be(t),o):r},o.endAngle=function(t){return arguments.length?(i=be(t),o):i},o},o.svg.diagonal=function(){var t=Yr,e=Hr,n=au;function r(r,i){var o=t.call(this,r,i),a=e.call(this,r,i),u=(o.y+a.y)/2,s=[o,{x:o.x,y:u},{x:a.x,y:u},a];return"M"+(s=s.map(n))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return r.source=function(e){return arguments.length?(t=be(e),r):t},r.target=function(t){return arguments.length?(e=be(t),r):e},r.projection=function(t){return arguments.length?(n=t,r):n},r},o.svg.diagonal.radial=function(){var t=o.svg.diagonal(),e=au,n=t.projection;return t.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]-Pt;return[n*Math.cos(r),n*Math.sin(r)]}}(e=t)):e},t},o.svg.symbol=function(){var t=su,e=uu;function n(n,r){return(fu.get(t.call(this,n,r))||lu)(e.call(this,n,r))}return n.type=function(e){return arguments.length?(t=be(e),n):t},n.size=function(t){return arguments.length?(e=be(t),n):e},n};var fu=o.map({circle:lu,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*hu)),n=e*hu;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/cu),n=e*cu/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/cu),n=e*cu/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});o.svg.symbolTypes=fu.keys();var cu=Math.sqrt(3),hu=Math.tan(30*Ot);K.transition=function(t){for(var e,n,r=gu||++_u,i=wu(t),o=[],a=vu||{time:Date.now(),ease:ao,delay:0,duration:250},u=-1,s=this.length;++u<s;){o.push(e=[]);for(var l=this[u],f=-1,c=l.length;++f<c;)(n=l[f])&&Mu(n,f,i,r,a),e.push(n)}return mu(o,i,r)},K.interrupt=function(t){return this.each(null==t?pu:du(wu(t)))};var pu=du(wu());function du(t){return function(){var e,n,r;(e=this[t])&&(r=e[n=e.active])&&(r.timer.c=null,r.timer.t=NaN,--e.count?delete e[n]:delete this[t],e.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function mu(t,e,n){return Z(t,yu),t.namespace=e,t.id=n,t}var gu,vu,yu=[],_u=0;function bu(t,e,n,r){var i=t.id,o=t.namespace;return dt(t,"function"==typeof n?function(t,a,u){t[o][i].tween.set(e,r(n.call(t,t.__data__,a,u)))}:(n=r(n),function(t){t[o][i].tween.set(e,n)}))}function xu(t){return null==t&&(t=""),function(){this.textContent=t}}function wu(t){return null==t?"__transition__":"__transition_"+t+"__"}function Mu(t,e,n,r,i){var o,a,u,s,l,f=t[n]||(t[n]={active:0,count:0}),c=f[r];function h(n){var i=f.active,h=f[i];for(var d in h&&(h.timer.c=null,h.timer.t=NaN,--f.count,delete f[i],h.event&&h.event.interrupt.call(t,t.__data__,h.index)),f)if(+d<r){var m=f[d];m.timer.c=null,m.timer.t=NaN,--f.count,delete f[d]}a.c=p,Ee(function(){return a.c&&p(n||1)&&(a.c=null,a.t=NaN),1},0,o),f.active=r,c.event&&c.event.start.call(t,t.__data__,e),l=[],c.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&l.push(r)}),s=c.ease,u=c.duration}function p(i){for(var o=i/u,a=s(o),h=l.length;h>0;)l[--h].call(t,a);if(o>=1)return c.event&&c.event.end.call(t,t.__data__,e),--f.count?delete f[r]:delete t[n],1}c||(o=i.time,a=Ee(function(t){var e=c.delay;if(a.t=e+o,e<=t)return h(t-e);a.c=h},0,o),c=f[r]={tween:new j,time:o,timer:a,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++f.count)}yu.call=K.call,yu.empty=K.empty,yu.node=K.node,yu.size=K.size,o.transition=function(t,e){return t&&t.transition?gu?t.transition(e):t:o.selection().transition(t)},o.transition.prototype=yu,yu.select=function(t){var e,n,r,i=this.id,o=this.namespace,a=[];t=$(t);for(var u=-1,s=this.length;++u<s;){a.push(e=[]);for(var l=this[u],f=-1,c=l.length;++f<c;)(r=l[f])&&(n=t.call(r,r.__data__,f,u))?("__data__"in r&&(n.__data__=r.__data__),Mu(n,f,o,i,r[o][i]),e.push(n)):e.push(null)}return mu(a,o,i)},yu.selectAll=function(t){var e,n,r,i,o,a=this.id,u=this.namespace,s=[];t=J(t);for(var l=-1,f=this.length;++l<f;)for(var c=this[l],h=-1,p=c.length;++h<p;)if(r=c[h]){o=r[u][a],n=t.call(r,r.__data__,h,l),s.push(e=[]);for(var d=-1,m=n.length;++d<m;)(i=n[d])&&Mu(i,d,u,a,o),e.push(i)}return mu(s,u,a)},yu.filter=function(t){var e,n,r=[];"function"!=typeof t&&(t=pt(t));for(var i=0,o=this.length;i<o;i++){r.push(e=[]);for(var a,u=0,s=(a=this[i]).length;u<s;u++)(n=a[u])&&t.call(n,n.__data__,u,i)&&e.push(n)}return mu(r,this.namespace,this.id)},yu.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):dt(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})},yu.attr=function(t,e){if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var n="transform"==t?yo:Ki,r=o.ns.qualify(t);function i(){this.removeAttribute(r)}function a(){this.removeAttributeNS(r.space,r.local)}return bu(this,"attr."+t,e,r.local?function(t){return null==t?a:(t+="",function(){var e,i=this.getAttributeNS(r.space,r.local);return i!==t&&(e=n(i,t),function(t){this.setAttributeNS(r.space,r.local,e(t))})})}:function(t){return null==t?i:(t+="",function(){var e,i=this.getAttribute(r);return i!==t&&(e=n(i,t),function(t){this.setAttribute(r,e(t))})})})},yu.attrTween=function(t,e){var n=o.ns.qualify(t);return this.tween("attr."+t,n.local?function(t,r){var i=e.call(this,t,r,this.getAttributeNS(n.space,n.local));return i&&function(t){this.setAttributeNS(n.space,n.local,i(t))}}:function(t,r){var i=e.call(this,t,r,this.getAttribute(n));return i&&function(t){this.setAttribute(n,i(t))}})},yu.style=function(t,e,n){var r=arguments.length;if(r<3){if("string"!=typeof t){for(n in r<2&&(e=""),t)this.style(n,t[n],e);return this}n=""}function i(){this.style.removeProperty(t)}return bu(this,"style."+t,e,function(e){return null==e?i:(e+="",function(){var r,i=f(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(r=Ki(i,e),function(e){this.style.setProperty(t,r(e),n)})})})},yu.styleTween=function(t,e,n){return arguments.length<3&&(n=""),this.tween("style."+t,function(r,i){var o=e.call(this,r,i,f(this).getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),n)}})},yu.text=function(t){return bu(this,"text",t,xu)},yu.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},yu.ease=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].ease:("function"!=typeof t&&(t=o.ease.apply(o,arguments)),dt(this,function(r){r[n][e].ease=t}))},yu.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:dt(this,"function"==typeof t?function(r,i,o){r[n][e].delay=+t.call(r,r.__data__,i,o)}:(t=+t,function(r){r[n][e].delay=t}))},yu.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:dt(this,"function"==typeof t?function(r,i,o){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,o))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))},yu.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=vu,a=gu;try{gu=n,dt(this,function(e,i,o){vu=e[r][n],t.call(e,e.__data__,i,o)})}finally{vu=i,gu=a}}else dt(this,function(i){var a=i[r][n];(a.event||(a.event=o.dispatch("start","end","interrupt"))).on(t,e)});return this},yu.transition=function(){for(var t,e,n,r=this.id,i=++_u,o=this.namespace,a=[],u=0,s=this.length;u<s;u++){a.push(t=[]);for(var l,f=0,c=(l=this[u]).length;f<c;f++)(e=l[f])&&Mu(e,f,o,i,{time:(n=e[o][r]).time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration}),t.push(e)}return mu(a,o,i)},o.svg.axis=function(){var t,e=o.scale.linear(),n=ju,r=6,i=6,a=3,s=[10],l=null;function f(u){u.each(function(){var u,f=o.select(this),c=this.__chart__||e,h=this.__chart__=e.copy(),p=null==l?h.ticks?h.ticks.apply(h,s):h.domain():l,d=null==t?h.tickFormat?h.tickFormat.apply(h,s):I:t,m=f.selectAll(".tick").data(p,h),g=m.enter().insert("g",".domain").attr("class","tick").style("opacity",zt),v=o.transition(m.exit()).style("opacity",zt).remove(),y=o.transition(m.order()).style("opacity",1),_=Math.max(r,0)+a,b=pa(h),x=f.selectAll(".domain").data([0]),w=(x.enter().append("path").attr("class","domain"),o.transition(x));g.append("line"),g.append("text");var M,j,k,A,z=g.select("line"),E=y.select("line"),S=m.select("text").text(d),T=g.select("text"),C=y.select("text"),P="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(u=Au,M="x",k="y",j="x2",A="y2",S.attr("dy",P<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+P*i+"V0H"+b[1]+"V"+P*i)):(u=zu,M="y",k="x",j="y2",A="x2",S.attr("dy",".32em").style("text-anchor",P<0?"end":"start"),w.attr("d","M"+P*i+","+b[0]+"H0V"+b[1]+"H"+P*i)),z.attr(A,P*r),T.attr(k,P*_),E.attr(j,0).attr(A,P*r),C.attr(M,0).attr(k,P*_),h.rangeBand){var O=h,N=O.rangeBand()/2;c=h=function(t){return O(t)+N}}else c.rangeBand?c=h:v.call(u,h,c);g.call(u,c,h),y.call(u,h,h)})}return f.scale=function(t){return arguments.length?(e=t,f):e},f.orient=function(t){return arguments.length?(n=t in ku?t+"":ju,f):n},f.ticks=function(){return arguments.length?(s=u(arguments),f):s},f.tickValues=function(t){return arguments.length?(l=t,f):l},f.tickFormat=function(e){return arguments.length?(t=e,f):t},f.tickSize=function(t){var e=arguments.length;return e?(r=+t,i=+arguments[e-1],f):r},f.innerTickSize=function(t){return arguments.length?(r=+t,f):r},f.outerTickSize=function(t){return arguments.length?(i=+t,f):i},f.tickPadding=function(t){return arguments.length?(a=+t,f):a},f.tickSubdivide=function(){return arguments.length&&f},f};var ju="bottom",ku={top:1,right:1,bottom:1,left:1};function Au(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function zu(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}o.svg.brush=function(){var t,e,n=H(h,"brushstart","brush","brushend"),r=null,i=null,a=[0,0],u=[0,0],s=!0,l=!0,c=Su[0];function h(t){t.each(function(){var t=o.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",g).on("touchstart.brush",g),e=t.selectAll(".background").data([0]);e.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=t.selectAll(".resize").data(c,I);n.exit().remove(),n.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Eu[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",h.empty()?"none":null);var a,u=o.transition(t),s=o.transition(e);r&&(a=pa(r),s.attr("x",a[0]).attr("width",a[1]-a[0]),d(u)),i&&(a=pa(i),s.attr("y",a[0]).attr("height",a[1]-a[0]),m(u)),p(u)})}function p(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+a[+/e$/.test(t)]+","+u[+/^s/.test(t)]+")"})}function d(t){t.select(".extent").attr("x",a[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",a[1]-a[0])}function m(t){t.select(".extent").attr("y",u[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",u[1]-u[0])}function g(){var c,g,v=this,y=o.select(o.event.target),_=n.of(v,arguments),b=o.select(v),x=y.datum(),w=!/^(n|s)$/.test(x)&&r,M=!/^(e|w)$/.test(x)&&i,j=y.classed("extent"),k=Mt(v),A=o.mouse(v),z=o.select(f(v)).on("keydown.brush",function(){32==o.event.keyCode&&(j||(c=null,A[0]-=a[1],A[1]-=u[1],j=2),U())}).on("keyup.brush",function(){32==o.event.keyCode&&2==j&&(A[0]+=a[1],A[1]+=u[1],j=0,U())});if(o.event.changedTouches?z.on("touchmove.brush",T).on("touchend.brush",P):z.on("mousemove.brush",T).on("mouseup.brush",P),b.interrupt().selectAll("*").interrupt(),j)A[0]=a[0]-A[0],A[1]=u[0]-A[1];else if(x){var E=+/w$/.test(x),S=+/^n/.test(x);g=[a[1-E]-A[0],u[1-S]-A[1]],A[0]=a[E],A[1]=u[S]}else o.event.altKey&&(c=A.slice());function T(){var t=o.mouse(v),e=!1;g&&(t[0]+=g[0],t[1]+=g[1]),j||(o.event.altKey?(c||(c=[(a[0]+a[1])/2,(u[0]+u[1])/2]),A[0]=a[+(t[0]<c[0])],A[1]=u[+(t[1]<c[1])]):c=null),w&&C(t,r,0)&&(d(b),e=!0),M&&C(t,i,1)&&(m(b),e=!0),e&&(p(b),_({type:"brush",mode:j?"move":"resize"}))}function C(n,r,i){var o,f,h=pa(r),p=h[0],d=h[1],m=A[i],g=i?u:a,v=g[1]-g[0];if(j&&(p-=m,d-=v+m),o=(i?l:s)?Math.max(p,Math.min(d,n[i])):n[i],j?f=(o+=m)+v:(c&&(m=Math.max(p,Math.min(d,2*c[i]-o))),m<o?(f=o,o=m):f=m),g[0]!=o||g[1]!=f)return i?e=null:t=null,g[0]=o,g[1]=f,!0}function P(){T(),b.style("pointer-events","all").selectAll(".resize").style("display",h.empty()?"none":null),o.select("body").style("cursor",null),z.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),k(),_({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),o.select("body").style("cursor",y.style("cursor")),_({type:"brushstart"}),T()}return h.event=function(r){r.each(function(){var r=n.of(this,arguments),i={x:a,y:u,i:t,j:e},s=this.__chart__||i;this.__chart__=i,gu?o.select(this).transition().each("start.brush",function(){t=s.i,e=s.j,a=s.x,u=s.y,r({type:"brushstart"})}).tween("brush:brush",function(){var n=$i(a,i.x),o=$i(u,i.y);return t=e=null,function(t){a=i.x=n(t),u=i.y=o(t),r({type:"brush",mode:"resize"})}}).each("end.brush",function(){t=i.i,e=i.j,r({type:"brush",mode:"resize"}),r({type:"brushend"})}):(r({type:"brushstart"}),r({type:"brush",mode:"resize"}),r({type:"brushend"}))})},h.x=function(t){return arguments.length?(c=Su[!(r=t)<<1|!i],h):r},h.y=function(t){return arguments.length?(c=Su[!r<<1|!(i=t)],h):i},h.clamp=function(t){return arguments.length?(r&&i?(s=!!t[0],l=!!t[1]):r?s=!!t:i&&(l=!!t),h):r&&i?[s,l]:r?s:i?l:null},h.extent=function(n){var o,s,l,f,c;return arguments.length?(r&&(o=n[0],s=n[1],i&&(o=o[0],s=s[0]),t=[o,s],r.invert&&(o=r(o),s=r(s)),s<o&&(c=o,o=s,s=c),o==a[0]&&s==a[1]||(a=[o,s])),i&&(l=n[0],f=n[1],r&&(l=l[1],f=f[1]),e=[l,f],i.invert&&(l=i(l),f=i(f)),f<l&&(c=l,l=f,f=c),l==u[0]&&f==u[1]||(u=[l,f])),h):(r&&(t?(o=t[0],s=t[1]):(o=a[0],s=a[1],r.invert&&(o=r.invert(o),s=r.invert(s)),s<o&&(c=o,o=s,s=c))),i&&(e?(l=e[0],f=e[1]):(l=u[0],f=u[1],i.invert&&(l=i.invert(l),f=i.invert(f)),f<l&&(c=l,l=f,f=c))),r&&i?[[o,l],[s,f]]:r?[o,s]:i&&[l,f])},h.clear=function(){return h.empty()||(a=[0,0],u=[0,0],t=e=null),h},h.empty=function(){return!!r&&a[0]==a[1]||!!i&&u[0]==u[1]},o.rebind(h,n,"on")};var Eu={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Su=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Tu=Le.format=hn.timeFormat,Cu=Tu.utc,Pu=Cu("%Y-%m-%dT%H:%M:%S.%LZ");function Ou(t){return t.toISOString()}function Nu(t,e,n){function r(e){return t(e)}function i(t,n){var r=(t[1]-t[0])/n,i=o.bisect(Du,r);return i==Du.length?[e.year,xa(t.map(function(t){return t/31536e6}),n)[2]]:i?e[r/Du[i-1]<Du[i]/r?i-1:i]:[Bu,xa(t,n)[2]]}return r.invert=function(e){return Iu(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain(e),r):t.domain().map(Iu)},r.nice=function(t,e){var n=r.domain(),o=ha(n),a=null==t?i(o,10):"number"==typeof t&&i(o,t);function u(n){return!isNaN(n)&&!t.range(n,Iu(+n+1),e).length}return a&&(t=a[0],e=a[1]),r.domain(ma(n,e>1?{floor:function(e){for(;u(e=t.floor(e));)e=Iu(e-1);return e},ceil:function(e){for(;u(e=t.ceil(e));)e=Iu(+e+1);return e}}:t))},r.ticks=function(t,e){var n=ha(r.domain()),o=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(n[0],Iu(+n[1]+1),e<1?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Nu(t.copy(),e,n)},_a(r,t)}function Iu(t){return new Date(t)}Tu.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ou:Pu,Ou.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ou.toString=Pu.toString,Le.second=qe(function(t){return new Re(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Le.seconds=Le.second.range,Le.seconds.utc=Le.second.utc.range,Le.minute=qe(function(t){return new Re(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Le.minutes=Le.minute.range,Le.minutes.utc=Le.minute.utc.range,Le.hour=qe(function(t){var e=t.getTimezoneOffset()/60;return new Re(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Le.hours=Le.hour.range,Le.hours.utc=Le.hour.utc.range,Le.month=qe(function(t){return(t=Le.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Le.months=Le.month.range,Le.months.utc=Le.month.utc.range;var Du=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Lu=[[Le.second,1],[Le.second,5],[Le.second,15],[Le.second,30],[Le.minute,1],[Le.minute,5],[Le.minute,15],[Le.minute,30],[Le.hour,1],[Le.hour,3],[Le.hour,6],[Le.hour,12],[Le.day,1],[Le.day,2],[Le.week,1],[Le.month,1],[Le.month,3],[Le.year,1]],Ru=Tu.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Kn]]),Bu={range:function(t,e,n){return o.range(Math.ceil(t/n)*n,+e,n).map(Iu)},floor:I,ceil:I};Lu.year=Le.year,Le.scale=function(){return Nu(o.scale.linear(),Lu,Ru)};var Fu=Lu.map(function(t){return[t[0].utc,t[1]]}),qu=Cu.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Kn]]);function Uu(t){return JSON.parse(t.responseText)}function Yu(t){var e=s.createRange();return e.selectNode(s.body),e.createContextualFragment(t.responseText)}Fu.year=Le.year.utc,Le.scale.utc=function(){return Nu(o.scale.linear(),Fu,qu)},o.text=xe(function(t){return t.responseText}),o.json=function(t,e){return we(t,"application/json",Uu,e)},o.html=function(t,e){return we(t,"text/html",Yu,e)},o.xml=xe(function(t){return t.responseXML}),this.d3=o,void 0===(i="function"==typeof(r=o)?r.call(e,n,e,t):r)||(t.exports=i)}()}])});
//# sourceMappingURL=embed-bundle.js.map