moodmeter/plotly-1.31.2.min.js

80 lines
2.2 MiB
JavaScript
Raw Normal View History

2017-12-04 21:47:24 +01:00
/**
* plotly.js v1.31.2
* Copyright 2012-2017, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};e[o][0].call(c.exports,function(t){var r=e[o][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),i={"X,X div":"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-siz
;return!0}function g(t,e,r){d(t,e,!0)&&h(t,e,r,"notDeepStrictEqual",g)}function v(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function y(t){var e;try{t()}catch(t){e=t}return e}function b(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=y(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&h(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&x.isError(i),s=!t&&i&&!r;if((o&&a&&v(i,r)||s)&&h(i,r,"Got unwanted exception"+n),t&&i&&r&&!v(i,r)||!t&&i)throw i}var x=t("util/"),_=Object.prototype.hasOwnProperty,w=Array.prototype.slice,M=function(){return"foo"===function(){}.name}(),k=e.exports=f,A=/\s*function\s+([^\(\s]*)\s*/;k.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=c(this),this.generatedMessage=!0);var e=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},x.inherits(k.AssertionError,Error),k.fail=h,k.ok=f,k.equal=function(t,e,r){t!=e&&h(t,e,r,"==",k.equal)},k.notEqual=function(t,e,r){t==e&&h(t,e,r,"!=",k.notEqual)},k.deepEqual=function(t,e,r){d(t,e,!1)||h(t,e,r,"deepEqual",k.deepEqual)},k.deepStrictEqual=function(t,e,r){d(t,e,!0)||h(t,e,r,"deepStrictEqual",k.deepStrictEqual)},k.notDeepEqual=function(t,e,r){d(t,e,!1)&&h(t,e,r,"notDeepEqual",k.notDeepEqual)},k.notDeepStrictEqual=g,k.strictEqual=function(t,e,r){t!==e&&h(t,e,r,"===",k.strictEqual)},k.notStrictEqual=function(t,e,r){t===e&&h(t,e,r,"!==",k.notStrictEqual)},k.throws=function(t,e,r){b(!0,t,e,r)},k.doesNotThrow=function(t,e,r){b(!1,t,e,r)},k.ifError=function(t){if(t)throw t};var T=Object.keys||function(t){var e=[];for(var r in t)_.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":549}],48:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],49:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}function i(t,e){for(var r=e.length,i=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=t[l][o];i[o]=s}i[r]=new Array(r+1);for(var o=0;o<=r;++o)i[r][o]=1;for(var u=new Array(r+1),o=0;o<r;++o)u[o]=e[o];u[r]=1;var c=a(i,u),h=n(c[r+1]);0===h&&(h=1);for(var f=new Array(r+1),o=0;o<=r;++o)f[o]=n(c[o])/h;return f}e.exports=i;var a=t("robust-linear-solve")},{"robust-linear-solve":507}],50:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":60}],51:[function(t,e,r){"use strict";function n(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}e.exports=n},{}],52:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]),t[1].mul(e[0]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":60}],53:[function(t,e,r){"use strict";function n(t,e){if(i(t))return e?u(t,n(e)):[t[0].clone(),t[1].clone()];var r,c,h=0;if(a(t))r=t.clone();else if("string"==typeof t)r=s(t);else{if(0===t)return[o(0),o(1)];if(t===Math.floor(t))r=o(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),h-=256;r=o(t)}}if(i(e))r.mul(e[1]),c=e[0].clone();else if(a(e))c=e.clone();else if("string"==typeof e)c=s(e);else if(e)if(e===Math.floor(e))c=o(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h+=256;c=o(e)}else c=o(1);return h>0?r=r.ushln(h):h<0&&(c=c.ushln(-h)),l(r,c)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),u=t("./div");e.exports=n},{"./div":52,"./is-rat":54,"./lib/is-bn":58,"./lib/num-to-bn":59,"./lib/rationalize":60,"./lib/str-to-bn":61}],54:[function(t,e,r){"use strict";function n(t)
i=i+Math.imul(L,ft)|0,i=i+Math.imul(C,ht)|0,a=a+Math.imul(C,ft)|0,n=n+Math.imul(T,pt)|0,i=i+Math.imul(T,mt)|0,i=i+Math.imul(S,pt)|0,a=a+Math.imul(S,mt)|0;var Ct=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(j,at),i=Math.imul(j,ot),i=i+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(O,lt)|0,i=i+Math.imul(O,ut)|0,i=i+Math.imul(R,lt)|0,a=a+Math.imul(R,ut)|0,n=n+Math.imul(z,ht)|0,i=i+Math.imul(z,ft)|0,i=i+Math.imul(D,ht)|0,a=a+Math.imul(D,ft)|0,n=n+Math.imul(L,pt)|0,i=i+Math.imul(L,mt)|0,i=i+Math.imul(C,pt)|0,a=a+Math.imul(C,mt)|0;var It=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,lt),i=Math.imul(j,ut),i=i+Math.imul(N,lt)|0,a=Math.imul(N,ut),n=n+Math.imul(O,ht)|0,i=i+Math.imul(O,ft)|0,i=i+Math.imul(R,ht)|0,a=a+Math.imul(R,ft)|0,n=n+Math.imul(z,pt)|0,i=i+Math.imul(z,mt)|0,i=i+Math.imul(D,pt)|0,a=a+Math.imul(D,mt)|0;var zt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(j,ht),i=Math.imul(j,ft),i=i+Math.imul(N,ht)|0,a=Math.imul(N,ft),n=n+Math.imul(O,pt)|0,i=i+Math.imul(O,mt)|0,i=i+Math.imul(R,pt)|0,a=a+Math.imul(R,mt)|0;var Dt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(j,pt),i=Math.imul(j,mt),i=i+Math.imul(N,pt)|0,a=Math.imul(N,mt);var Pt=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=It,l[16]=zt,l[17]=Dt,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};Math.imul||(k=u),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?k(this,t,e):r<63?u(this,t,e):r<1024?c(this,t,e):h(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},f.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},f.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o<a;o++)n[o]=e[t[o]],i[o]=r[t[o]]},f.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var h=l,f=u,d=0;d<o;d++){var p=r[c+d],m=n[c+d],g=r[c+d+o],v=n[c+d+o],y=h*g-f*v;v=h*v+f*g,g=y,r[c+d]=p+g,n[c+d]=m+v,r[c+d+o]=p-g,n[c+d+o]=m-v,d!==s&&(y=l*h-u*f,f=l*f+u*h,h=y)}},f.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},f.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},f.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},f.prototype.convert13b=function(t,e,r,i){for(var a=0,o=0;o<e;o++)a+=0|t[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===a),n(0==(-8192&a))},f.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},f.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,a,s,l,n,i),this.transform(u,a,c,h,n,i);for(var d=0;d<n;d++){var p=s[d]*c[d]-l[d]*h[d];l[d]=s[d]*h[d]+l[d]*c[d],s[d]=p}return this.conjugate(s,l,n),this.transform(s,l,f,a,n,i),this.conjugate(f,a,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),h(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i
;for(var A=o;A<s;++A){var T=A+M,S=b*A;x[y++]=l[S+_],x[y++]=-T,x[y++]=l[S+w],x[y++]=T}for(var A=c;A<h;++A){var T=A+k,E=b*A;x[y++]=g[E+_],x[y++]=-T}var L=y>>>1;f(x,L);for(var C=0,A=0;A<L;++A){var I=0|x[2*A+1];if(I<0){var T=-I,z=!1;if(T>=d?(z=!n,T-=d):(z=!!n,T-=1),z)a(p,m,C++,T);else{var D=v[T],P=b*T,O=g[P+e+1],R=g[P+e+1+t];t:for(var F=0;F<C;++F){var j=p[F],N=b*j;if(!(R<l[N+e+1]||l[N+e+1+t]<O)){for(var B=e+2;B<t;++B)if(g[P+B+t]<l[N+B]||l[N+B+t]<g[P+B])continue t;var U,V=u[j];if(void 0!==(U=n?r(D,V):r(V,D)))return U}}}}else i(p,m,C--,I-M)}}function u(t,e,r,n,i,a,o,s,l,u,c){for(var h=0,m=2*t,g=e,v=e+t,y=n;y<i;++y){var b=y+d,_=m*y;x[h++]=a[_+g],x[h++]=-b,x[h++]=a[_+v],x[h++]=b}for(var y=s;y<l;++y){var b=y+1,w=m*y;x[h++]=u[w+g],x[h++]=-b}var M=h>>>1;f(x,M);for(var k=0,y=0;y<M;++y){var A=0|x[2*y+1];if(A<0){var b=-A;if(b>=d)p[k++]=b-d;else{b-=1;var T=c[b],S=m*b,E=u[S+e+1],L=u[S+e+1+t];t:for(var C=0;C<k;++C){var I=p[C],z=o[I];if(z===T)break;var D=m*I;if(!(L<a[D+e+1]||a[D+e+1+t]<E)){for(var P=e+2;P<t;++P)if(u[S+P+t]<a[D+P]||a[D+P+t]<u[S+P])continue t;var O=r(z,T);if(void 0!==O)return O}}}}else{for(var b=A-d,C=k-1;C>=0;--C)if(p[C]===b){for(var P=C+1;P<k;++P)p[P-1]=p[P];break}--k}}}e.exports={init:n,sweepBipartite:o,sweepComplete:s,scanBipartite:l,scanComplete:u};var c=t("typedarray-pool"),h=t("bit-twiddle"),f=t("./sort"),d=1<<28,p=c.mallocInt32(1024),m=c.mallocInt32(1024),g=c.mallocInt32(1024),v=c.mallocInt32(1024),y=c.mallocInt32(1024),b=c.mallocInt32(1024),x=c.mallocDouble(8192)},{"./sort":75,"bit-twiddle":67,"typedarray-pool":541}],77:[function(t,e,r){"use strict";function n(t){if(t>Z)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?h(t,e,r):"string"==typeof t?u(t,e):f(t)}function o(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 s(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}function l(t){return o(t),n(t<0?0:0|d(t))}function u(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=0|m(t,e),a=n(r),o=a.write(t,e);return o!==r&&(a=a.slice(0,o)),a}function c(t){for(var e=t.length<0?0:0|d(t.length),r=n(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function h(t,e,r){if(e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),n.__proto__=i.prototype,n}function f(t){if(i.isBuffer(t)){var e=0|d(t.length),r=n(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(G(t)||"length"in t)return"number"!=typeof t.length||Y(t.length)?n(0):c(t);if("Buffer"===t.type&&Array.isArray(t.data))return c(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=Z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Z.toString(16)+" bytes");return 0|t}function p(t){return+t!=t&&(t=0),i.alloc(+t)}function m(t,e){if(i.isBuffer(t))return t.length;if(G(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return B(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.len
function f(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=t[n],a=e[i[0]],o=e[i[1]];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}else for(var n=0;n<t.length;++n){var i=t[n],a=i[0],o=i[1];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}r?t.sort(h):t.sort(c);for(var s=1,n=1;n<t.length;++n){var l=t[n-1],u=t[n];(u[0]!==l[0]||u[1]!==l[1]||r&&u[2]!==l[2])&&(t[s++]=u)}t.length=s}}function d(t,e,r){var n=u(t,[],a(t));return f(e,n,r),!!n}function p(t,e,r){var n=i(t,e),c=o(t,e,n),h=a(t),d=s(t,e,n,h),p=l(t,e,c,d,r),m=u(t,p,h);return f(e,m,r),!!m||(c.length>0||d.length>0)}function m(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a<e.length;++a){var o=e[a];i[a]=[o[0],o[1],r[a]]}e=i}for(var s=d(t,e,!!r);p(t,e,!!r);)s=!0;if(r&&s){n.length=0,r.length=0;for(var a=0;a<e.length;++a){var o=e[a];n.push([o[0],o[1]]),r.push(o[2])}}return s}e.exports=m;var g=t("union-find"),v=t("box-intersect"),y=t("robust-segment-intersect"),b=t("big-rat"),x=t("big-rat/cmp"),_=t("big-rat/to-float"),w=t("rat-vec"),M=t("nextafter"),k=t("./lib/rat-seg-intersect")},{"./lib/rat-seg-intersect":90,"big-rat":53,"big-rat/cmp":51,"big-rat/to-float":65,"box-intersect":70,nextafter:468,"rat-vec":495,"robust-segment-intersect":511,"union-find":542}],90:[function(t,e,r){"use strict";function n(t,e){return s(a(t[0],e[1]),a(t[1],e[0]))}function i(t,e,r,i){var a=u(e,t),s=u(i,r),f=n(a,s);if(0===l(f))return null;var d=u(t,r),p=n(s,d),m=o(p,f),g=h(a,m);return c(t,g)}e.exports=i;var a=t("big-rat/mul"),o=t("big-rat/div"),s=t("big-rat/sub"),l=t("big-rat/sign"),u=t("rat-vec/sub"),c=t("rat-vec/add"),h=t("rat-vec/muls")},{"big-rat/div":52,"big-rat/mul":62,"big-rat/sign":63,"big-rat/sub":64,"rat-vec/add":494,"rat-vec/muls":496,"rat-vec/sub":497}],91:[function(t,e,r){(function(t){var r=function(){"use strict";function e(r,n,i,a){function s(r,i){if(null===r)return null;if(0==i)return r;var h,f;if("object"!=typeof r)return r;if(e.__isArray(r))h=[];else if(e.__isRegExp(r))h=new RegExp(r.source,o(r)),r.lastIndex&&(h.lastIndex=r.lastIndex);else if(e.__isDate(r))h=new Date(r.getTime());else{if(c&&t.isBuffer(r))return h=new t(r.length),r.copy(h),h;void 0===a?(f=Object.getPrototypeOf(r),h=Object.create(f)):(h=Object.create(a),f=a)}if(n){var d=l.indexOf(r);if(-1!=d)return u[d];l.push(r),u.push(h)}for(var p in r){var m;f&&(m=Object.getOwnPropertyDescriptor(f,p)),m&&null==m.set||(h[p]=s(r[p],i-1))}return h}"object"==typeof n&&(i=n.depth,a=n.prototype,n.filter,n=n.circular);var l=[],u=[],c=void 0!==t;return void 0===n&&(n=!0),void 0===i&&(i=1/0),s(r,i)}function r(t){return Object.prototype.toString.call(t)}function n(t){return"object"==typeof t&&"[object Date]"===r(t)}function i(t){return"object"==typeof t&&"[object Array]"===r(t)}function a(t){return"object"==typeof t&&"[object RegExp]"===r(t)}function o(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return e.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},e.__objToStr=r,e.__isDate=n,e.__isArray=i,e.__isRegExp=a,e.__getRegExpFlags=o,e}();"object"==typeof e&&e.exports&&(e.exports=r)}).call(this,t("buffer").Buffer)},{buffer:77}],92:[function(t,e,r){"use strict";function n(t,e){null==e&&(e=!0);var r=t[0],n=t[1],i=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,n*=255,i*=255,o*=255),r=255&a(r,0,255),n=255&a(n,0,255),i=255&a(i,0,255),o=255&a(o,0,255),16777216*r+(n<<16)+(i<<8)+o}function i(t,e){t=+t;var r=t>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}var a=t("clamp");e.exports=n,e.exports.to=n,e.exports.from=i},{clamp:88}],93:[function(t,e,r){"use strict";e.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
cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],109:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+h*r[d]+f*n[d];return a}return u*t+c*e+h*r+f*n}e.exports=i,e.exports.derivative=n},{}],110:[function(t,e,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.
if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l<u;)if(r=(t=s[l]).type)o[r]=a(o[r],t.name,e);else if(null==e)for(r in o)o[r]=a(o[r],t.name,null);return this}for(;++l<u;)if((r=(t=s[l]).type)&&(r=i(o[r],t.name)))return r}},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new r(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(n=this._[t],a=0,r=n.length;a<r;++a)n[a].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}},t.dispatch=e,Object.defineProperty(t,"__esModule",{value:!0})})},{}],118:[function(e,r,n){!function(i,a){"object"==typeof n&&void 0!==r?a(n,e("d3-quadtree"),e("d3-collection"),e("d3-dispatch"),e("d3-timer")):"function"==typeof t&&t.amd?t(["exports","d3-quadtree","d3-collection","d3-dispatch","d3-timer"],a):a(i.d3=i.d3||{},i.d3,i.d3,i.d3,i.d3)}(this,function(t,e,r,n,i){"use strict";function a(t){return t.x+t.vx}function o(t){return t.y+t.vy}function s(t){return t.index}function l(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function u(t){return t.x}function c(t){return t.y}var h=function(t,e){function r(){var r,i,a=n.length,o=0,s=0;for(r=0;r<a;++r)i=n[r],o+=i.x,s+=i.y;for(o=o/a-t,s=s/a-e,r=0;r<a;++r)i=n[r],i.x-=o,i.y-=s}var n;return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r},f=function(t){return function(){return t}},d=function(){return 1e-6*(Math.random()-.5)},p=function(t){function r(){function t(t,e,r,n,i){var a=t.data,o=t.r,s=m+o;{if(!a)return e>f+s||n<f-s||r>p+s||i<p-s;if(a.index>h.index){var l=f-a.x-a.vx,c=p-a.y-a.vy,v=l*l+c*c;v<s*s&&(0===l&&(l=d(),v+=l*l),0===c&&(c=d(),v+=c*c),v=(s-(v=Math.sqrt(v)))/v*u,h.vx+=(l*=v)*(s=(o*=o)/(g+o)),h.vy+=(c*=v)*s,a.vx-=l*(s=1-s),a.vy-=c*s)}}}for(var r,i,h,f,p,m,g,v=s.length,y=0;y<c;++y)for(i=e.quadtree(s,a,o).visitAfter(n),r=0;r<v;++r)h=s[r],m=l[h.index],g=m*m,f=h.x+h.vx,p=h.y+h.vy,i.visit(t)}function n(t){if(t.data)return t.r=l[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e<n;++e)r=s[e],l[r.index]=+t(r,e,s)}}var s,l,u=1,c=1;return"function"!=typeof t&&(t=f(null==t?1:+t)),r.initialize=function(t){s=t,i()},r.iterations=function(t){return arguments.length?(c=+t,r):c},r.strength=function(t){return arguments.length?(u=+t,r):u},r.radius=function(e){return arguments.length?(t="function"==typeof e?e:f(+e),i(),r):t},r},m=function(t){function e(t){return 1/Math.min(p[t.source.index],p[t.target.index])}function n(e){for(var r=0,n=t.length;r<b;++r)for(var i,a,o,s,l,h,f,p=0;p<n;++p)i=t[p],a=i.source,o=i.target,s=o.x+o.vx-a.x-a.vx||d(),l=o.y+o.vy-a.y-a.vy||d(),h=Math.sqrt(s*s+l*l),h=(h-c[p])/h*e*u[p],s*=h,l*=h,o.vx-=s*(f=m[p]),o.vy-=l*f,a.vx+=s*(f=1-f),a.vy+=l*f}function i(){if(h){var e,n,i=h.length,s=t.length,f=r.map(h,g);for(e=0,p=new Array(i);e<s;++e)n=t[e],n.index=e,"object"!=typeof n.source&&(n.source=l(f,n.source)),"object"!=typeof n.target&&(n.target=l(f,n.target)),p[n.source.index]=(p[n.source.index]||0)+1,p[n.target.index]=(p[n.target.index]||0)+1;for(e=0,m=new Array(s);e<s;++e)n=t[e],m[e]=p[n.source.index]/(p[n.source.index]+p[n.target.index]);u=new Array(s),a(),c=new Array(s),o()}}function a(){if(h)for(var e=0,r=t.length;e<r;++e)u[e]=+v(t[e],e,t)}function o(){if(h)for(var e=0,r=t.length;e<r;++e)c[e]=+y(t[e],e,t)}var u,c,h,p,m,g=s,v=e,y=f(30),b=1;return null==t&&(t=[]),n.initialize=function(t){h=t,i()},n.links=function(e){return arguments.length?(t=e,i(),n):t},n.id=function(t){return arguments.length?(g=t,n):g},n.iterations=function(t){return arguments.length?(b=+t,n):b},n.strength=function(t){return arguments.length?(v="function"==typeof t?t:f(+t),a(),n):v},n.distance=function(t){return arguments.length?(y="function"==typeof t?t:f(+t),o(),n):y},
function Et(t){return"function"==typeof t?t:function(){return t}}function Lt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Ct(e,r,t,n)}}function Ct(t,e,r,n){function i(){var t,e=l.status;if(!e&&zt(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=uo.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=uo.event;uo.event=t;try{o.progress.call(a,l)}finally{uo.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ho(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},uo.rebind(a,o,"on"),null==n?a:a.get(It(n))}function It(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function zt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Dt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i=r+e,a={c:t,t:i,n:null};return as?as.n=a:is=a,as=a,os||(ss=clearTimeout(ss),os=1,ls(Pt)),a}function Pt(){var t=Ot(),e=Rt()-t;e>24?(isFinite(e)&&(clearTimeout(ss),ss=setTimeout(Pt,e)),os=0):(os=1,ls(Pt))}function Ot(){for(var t=Date.now(),e=is;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Rt(){for(var t,e=is,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:is=e.n;return as=t,r}function Ft(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function jt(t,e){var r=Math.pow(10,3*xo(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Nt(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:x;return function(t){var r=cs.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",u=r[5],c=+r[6],h=r[7],f=r[8],d=r[9],p=1,m="",g="",v=!1,y=!0;switch(f&&(f=+f.substring(1)),(u||"0"===n&&"="===o)&&(u=n="0",o="="),d){case"n":h=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):"e"!=d&&"f"!=d||(f=Math.max(0,Math.min(20,f)))),d=hs.get(d)||Bt;var b=u&&h;return function(t){var r=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=uo.formatPrefix(t,f);t=l.scale(t),r=l.symbol+g}else t*=p;t=d(t,f);var x,_,w=t.lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(x=t,_=""):(x=t.substring(0,M),_=t.substring(M))}else x=t.substring(0,w),_=e+t.substring(w+1);!u&&h&&(x=a(x,1/0));var k=m.length+x.length+_.length+(b?0:i.length),A=k<c?new Array(k=c-k+1).join(n):"";return b&&(x=a(A+x,A.length?c-_.length:1/0)),i+=m,t=x+_,("<"===o?i+t+A:">"===o?A+i+t:"^"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(b?t:A+t))+r}}}function Bt(t){return t+""}function Ut(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Vt(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r<n-e?r:n}function i(r){return e(r
x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function Qr(t,e){this.l=t,this.r=e,this.a=this.b=null}function $r(t,e,r,n){var i=new Qr(t,e);return rl.push(i),r&&en(i,t,e,r),n&&en(i,e,t,n),nl[t.i].edges.push(new rn(i,t,e)),nl[e.i].edges.push(new rn(i,e,t)),i}function tn(t,e,r){var n=new Qr(t,null);return n.a=e,n.b=r,rl.push(n),n}function en(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function rn(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function nn(){this._=null}function an(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function on(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function sn(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function ln(t){for(;t.L;)t=t.L;return t}function un(t,e){var r,n,i,a=t.sort(cn).pop();for(rl=[],nl=new Array(t.length),il=new nn,ol=new nn;;)if(i=al,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(nl[a.i]=new qr(a),Ur(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;Br(i.arc)}e&&(Jr(e),Gr(e));var o={cells:nl,edges:rl};return il=ol=rl=nl=null,o}function cn(t,e){return e.y-t.y||e.x-t.x}function hn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function fn(t){return t.x}function dn(t){return t.y}function pn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function mn(t,e,r,n,i,a){if(!t(e,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=e.nodes;l[0]&&mn(t,l[0],r,n,o,s),l[1]&&mn(t,l[1],o,n,i,s),l[2]&&mn(t,l[2],r,s,o,a),l[3]&&mn(t,l[3],o,s,i,a)}}function gn(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,h,f,d){if(!(c>a||h>o||f<n||d<i)){if(p=u.point){var p,m=e-u.x,g=r-u.y,v=m*m+g*g;if(v<l){var y=Math.sqrt(l=v);n=e-y,i=r-y,a=e+y,o=r+y,s=p}}for(var b=u.nodes,x=.5*(c+f),_=.5*(h+d),w=e>=x,M=r>=_,k=M<<1|w,A=k+4;k<A;++k)if(u=b[3&k])switch(3&k){case 0:t(u,c,h,x,_);break;case 1:t(u,x,h,f,_);break;case 2:t(u,c,_,x,d);break;case 3:t(u,x,_,f,d)}}}(t,n,i,a,o),s}function vn(t,e){t=uo.rgb(t),e=uo.rgb(e);var r=t.r,n=t.g,i=t.b,a=e.r-r,o=e.g-n,s=e.b-i;return function(t){return"#"+wt(Math.round(r+a*t))+wt(Math.round(n+o*t))+wt(Math.round(i+s*t))}}function yn(t,e){var r,n={},i={};for(r in t)r in e?n[r]=_n(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function bn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function xn(t,e){var r,n,i,a=cl.lastIndex=hl.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=cl.exec(t))&&(n=hl.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:bn(r,n)})),a=hl.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}function _n(t,e){for(var r,n=uo.interpolators.length;--n>=0&&!(r=uo.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(_n(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}function Mn(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function kn(t){return function(e){return 1-t(1-e)}}function An(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function Sn(t){return t*t*t}function En(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Ln(t){return function(e){return Math.pow(e,t)}}function Cn(t){return 1-Math.cos(t*Vo)}function In(t){return Math.pow(2,10*(t-1))}function zn(t){return 1-Math.sqrt(1-t*t)}function Dn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bo*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bo/e)}}function Pn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function On(t){return t<1/2.75?7.5625*t*t:t<2/2.
for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=_(t,e,e[r]);return t};var Mo=["webkit","ms","moz","Moz","o","O"];uo.dispatch=function(){for(var t=new k,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=A(t);return t},k.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},uo.event=null,uo.requote=function(t){return t.replace(ko,"\\$&")};var ko=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ao={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},To=function(t,e){return e.querySelector(t)},So=function(t,e){return e.querySelectorAll(t)},Eo=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(Eo=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(To=function(t,e){return Sizzle(t,e)[0]||null},So=Sizzle,Eo=Sizzle.matchesSelector),uo.selection=function(){return uo.select(fo.documentElement)};var Lo=uo.selection.prototype=[];Lo.select=function(t){var e,r,n,i,a=[];t=C(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&"__data__"in i&&(r.__data__=i.__data__)):e.push(null)}return L(a)},Lo.selectAll=function(t){var e,r,n=[];t=I(t);for(var i=-1,a=this.length;++i<a;)for(var o=this[i],s=-1,l=o.length;++s<l;)(r=o[s])&&(n.push(e=ho(t.call(r,r.__data__,s,i))),e.parentNode=r);return L(n)};var Co="http://www.w3.org/1999/xhtml",Io={svg:"http://www.w3.org/2000/svg",xhtml:Co,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};uo.ns={prefix:Io,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Io.hasOwnProperty(r)?{space:Io[r],local:t}:t}},Lo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=uo.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(z(e,t[e]));return this}return this.each(z(t,e))},Lo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=O(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute("class");++i<n;)if(!P(t[i]).test(e))return!1;return!0}for(e in t)this.each(R(e,t[e]));return this}return this.each(R(t,e))},Lo.style=function(t,e,r){var i=arguments.length;if(i<3){if("string"!=typeof t){i<2&&(e="");for(r in t)this.each(j(r,t[r],e));return this}if(i<2){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(j(t,e,r))},Lo.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(N(e,t[e]));return this}return this.each(N(t,e))},Lo.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},Lo.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},Lo.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Lo.insert=function(t,e){return t=B(t),e=C(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Lo.remove=function(){return this.each(U)},Lo.data=function(t,e){function r(t,r){var n,i,a,o=t.length,c=r.length,f=Math.min(o,c),d=new Array(c),p=new Array(c),m=new Array(o);if(e){var g,v=new h,y=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(v.has(g=e.call(i,i.__data__,n))?m[n]=i:v.set(g,i),y[n]=g);for(n=-1;++n<c;)(i=v.get(g=e.call(r,a=r[n],n)))?!0!==i&&(d[n]=i,i.__data__=a):p[n]=V(a),v.set(g,!0);for(n=-1;++n<o;)n in y&&!0!==v.get(y[n])&&(m[n]=t[
return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,c=yr(s,o,90),h=br(n,r,y),f=yr(u,l,90),d=br(a,i,y),t):y},t.majorExtent([[-180,-90+Fo],[180,90-Fo]]).minorExtent([[-180,-80-Fo],[180,80+Fo]])},uo.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=xr,i=_r;return t.distance=function(){return uo.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},uo.geo.interpolate=function(t,e){return wr(t[0]*Ho,t[1]*Ho,e[0]*Ho,e[1]*Ho)},uo.geo.length=function(t){return Xs=0,uo.geo.stream(t,Zs),Xs};var Xs,Zs={sphere:M,point:M,lineStart:Mr,lineEnd:M,polygonStart:M,polygonEnd:M},Js=kr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(uo.geo.azimuthalEqualArea=function(){return sr(Js)}).raw=Js;var Ks=kr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(uo.geo.azimuthalEquidistant=function(){return sr(Ks)}).raw=Ks,(uo.geo.conicConformal=function(){return Ye(Ar)}).raw=Ar,(uo.geo.conicEquidistant=function(){return Ye(Tr)}).raw=Tr;var Qs=kr(function(t){return 1/t},Math.atan);(uo.geo.gnomonic=function(){return sr(Qs)}).raw=Qs,Sr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Vo]},(uo.geo.mercator=function(){return Er(Sr)}).raw=Sr;var $s=kr(function(){return 1},Math.asin);(uo.geo.orthographic=function(){return sr($s)}).raw=$s;var tl=kr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(uo.geo.stereographic=function(){return sr(tl)}).raw=tl,Lr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Vo]},(uo.geo.transverseMercator=function(){var t=Er(Lr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Lr,uo.geom={},uo.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Et(r),a=Et(n),o=t.length,s=[],l=[];for(e=0;e<o;e++)s.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(s.sort(Dr),e=0;e<o;e++)l.push([s[e][0],-s[e][1]]);var u=zr(s),c=zr(l),h=c[0]===u[0],f=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+h;e<c.length-f;++e)d.push(t[s[c[e]][2]]);return d}var r=Cr,n=Ir;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},uo.geom.polygon=function(t){return Ao(t,el),t};var el=uo.geom.polygon.prototype=[];el.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},el.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},el.clip=function(t){for(var e,r,n,i,a,o,s=Rr(t),l=-1,u=this.length-Rr(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)o=e[r],Pr(o,c,i)?(Pr(a,c,i)||t.push(Or(a,o,c,i)),t.push(o)):Pr(a,c,i)&&t.push(Or(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var rl,nl,il,al,ol,sl=[],ll=[];qr.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)t=e[r].edge,t.b&&t.a||e.splice(r,1);return e.sort(Yr),e.length},rn.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}},nn.prototype={insert:function(t,e){var r,n,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;r=t}else this._?(t=ln(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)n=r.U,r===n.L?(i=n.R,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(on(this,r),t=r,r=t.U),r.C=!1,n.C=!0,sn(this,n))):(i=n.L,i&&i.
return t&&t.transition?jl?t.transition(e):t:uo.selection().transition(t)},uo.transition.prototype=Ul,Ul.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=C(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?("__data__"in n&&(r.__data__=n.__data__),eo(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return Ka(o,a,i)},Ul.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=I(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],f=-1,d=h.length;++f<d;)if(n=h[f]){a=n[s][o],r=t.call(n,n.__data__,f,u),l.push(e=[]);for(var p=-1,m=r.length;++p<m;)(i=r[p])&&eo(i,p,s,o,a),e.push(i)}return Ka(l,s,o)},Ul.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=H(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]);for(var r=this[a],s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return Ka(i,this.namespace,this.id)},Ul.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):G(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},Ul.attr=function(t,e){function r(){this.removeAttribute(s)}function n(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?r:(t+="",function(){var e,r=this.getAttribute(s);return r!==t&&(e=o(r,t),function(t){this.setAttribute(s,e(t))})})}function a(t){return null==t?n:(t+="",function(){var e,r=this.getAttributeNS(s.space,s.local);return r!==t&&(e=o(r,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var o="transform"==t?Zn:_n,s=uo.ns.qualify(t);return Qa(this,"attr."+t,e,s.local?a:i)},Ul.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(i));return n&&function(t){this.setAttribute(i,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(i.space,i.local));return n&&function(t){this.setAttributeNS(i.space,i.local,n(t))}}var i=uo.ns.qualify(t);return this.tween("attr."+t,i.local?n:r)},Ul.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+="",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=_n(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var o=arguments.length;if(o<3){if("string"!=typeof t){o<2&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Qa(this,"style."+t,e,a)},Ul.styleTween=function(t,e,r){function i(i,a){var o=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Ul.text=function(t){return Qa(this,"text",t,$a)},Ul.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Ul.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=uo.ease.apply(uo,arguments)),G(this,function(n){n[r][e].ease=t}))},Ul.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:G(this,"function"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},Ul.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:G(this,"function"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},Ul.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var i=Nl,a=jl;try{jl=r,G(this,function(e,i,a){Nl=e[n][r],t.call(e,e.__data__,i,a)})}finally{Nl=i,jl=a}}else G(this,function(i){var a=i[n][r];(a.event||(a.event=uo.dispatch("start","end","interrupt"))).on(t,e)});return this},Ul.transition=function(){for(var t,e,r,n,i=this.id,a=++Vl,o=this.namespace,s=[],l=0,u=this.length;l<u;l++){s.push(t=[]);for(var e=this[l],c=0,h=e.length;c<h;c++)(r=e[c])&&(n=r[o][i],eo(r,c,o,a,{time:n.time,e
r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],130:[function(t,e,r){"use strict";function n(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}e.exports=n},{}],131:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],132:[function(t,e,r){"use strict";function n(t){return new Function("f","var p = (f && f.properties || {}); return "+i(t))}function i(t){if(!t)return"true";var e=t[0];return t.length<=1?"any"===e?"false":"true":"("+("=="===e?o(t[1],t[2],"===",!1):"!="===e?o(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?o(t[1],t[2],e,!0):"any"===e?s(t.slice(1),"||"):"all"===e?s(t.slice(1),"&&"):"none"===e?c(s(t.slice(1),"||")):"in"===e?l(t[1],t.slice(2)):"!in"===e?c(l(t[1],t.slice(2))):"has"===e?u(t[1]):"!has"===e?c(u([t[1]])):"true")+")"}function a(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function o(t,e,r,n){var i=a(t),o="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+o+"&&":"")+i+r+o}function s(t,e){return t.map(i).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(h)),n=a(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function u(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function h(t,e){return t<e?-1:t>e?1:0}e.exports=n;var f=["Unknown","Point","LineString","Polygon"]},{}],133:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}function a(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if("number"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if("number"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state
;u&1<<c&&(h=s,f=a,d=l,p=o),h[c]=r[0][c],f[c]=r[1][c],i[c]>0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t("./lib/text.js"),u=t("./lib/lines.js"),c=t("./lib/background.js"),h=t("./lib/cube.js"),f=t("./lib/ticks.js"),d=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=i.prototype;p.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),s=!1,c=!1;if("bounds"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(c=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,c=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),c=!0,s=!0,this._firstInit=!1),c&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),s=!0),s){for(var d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?s=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(s=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||s)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=l(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&s&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=u(this.gl,this.bounds,this.ticks))};var m=[new a,new a,new a],g=[0,0,0],v={model:d,view:d,projection:d};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var y=[0,0,0],b=[0,0,0],x=[0,0,0];p.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||d,i=t.view||d,a=t.projection||d,s=this.bounds,l=h(r,i,a,s),u=l.cubeEdges,c=l.axis,f=i[12],p=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*f+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=c[k];for(var A=m,k=0;k<3;++k)o(m[k],k,this.bounds,u,c);for(var e=this.gl,T=g,k=0;k<3;++k)this.backgroundEnable[k]?T[k]=c[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(var k=0;k<3;++k){var S=[0,0,0];c[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(var k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);for(var I=n(y,A[k].primalMinor),z=n(b,A[k].mirrorMinor),D=this.lineTickLength,E=0;E<3;++E){var P=M/r[5*E];I[E]*=D[E]*P,z[E]*=D[E]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,I,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio)
vertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi;\nattribute vec2 positionLo;\nattribute vec2 pixelOffset;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo, pixelScale;\n\nvec2 project(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n return (posHi + trHi) * scHi\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo;\n}\n\nvoid main() {\n vec3 scrPosition = vec3(\n project(scaleHi, translateHi, scaleLo, translateLo, positionHi, positionLo),\n 1);\n gl_Position = vec4(\n scrPosition.xy + scrPosition.z * pixelScale * pixelOffset,\n 0,\n scrPosition.z);\n}\n",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"}},{}],161:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=f[n],a=0;a<i.length;++a){var o=i[a];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}function o(t){var e=t.gl,r=s(e),i=l(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),a=u(e);a.attributes.position.location=0,a.attributes.color.location=1,a.attributes.offset.location=2;var o=new n(e,r,i,a);return o.update(t),o}e.exports=o;var s=t("gl-buffer"),l=t("gl-vao"),u=t("./shaders/index"),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h=n.prototype;h.isOpaque=function(){return this.opacity>=1},h.isTransparent=function(){return this.opacity<1},h.drawTransparent=h.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var f=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();h.update=function(t){t=t||{},"lineWidth"in t&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var u=0;u<3;++u){this.lineOffset[u]=l;t:for(var c=0;c<s;++c){for(var h=r[c],f=0;f<3;++f)if(isNaN(h[f])||!isFinite(h[f]))continue t;var d=n[c],p=e[u];if(Array.isArray(p[0])&&(p=e[c]),3===p.length&&(p=[p[0],p[1],p[2],1]),!isNaN(d[0][u])&&!isNaN(d[1][u])){if(d[0][u]<0){var m=h.slice();m[u]+=d[0][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}if(d[1][u]>0){var m=h.slice();m[u]+=d[1][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(o)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":163,"gl-buffer":156,"gl-vao":271}],162:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0
for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function s(t){var e=t.gl||t.scene&&t.scene.gl,r=m(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var n=g(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=l(e),a=u(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),s=d(new Array(1024),[256,1,4]),h=0;h<1024;++h)s.data[h]=255;var f=c(e,s);f.wrap=e.REPEAT;var p=new o(e,r,n,i,a,f);return p.update(t),p}e.exports=s;var l=t("gl-buffer"),u=t("gl-vao"),c=t("gl-texture2d"),h=t("glsl-read-float"),f=t("binary-search-bounds"),d=t("ndarray"),p=t("./lib/shaders"),m=p.createShader,g=p.createPickShader,v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=o.prototype;y.isTransparent=function(){return this.opacity<1},y.isOpaque=function(){return this.opacity>=1},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],u=[],c=[],h=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e<a.length;++e){var v=a[e-1],y=a[e];for(u.push(h),c.push(v.slice()),r=0;r<3;++r){if(isNaN(v[r])||isNaN(y[r])||!isFinite(v[r])||!isFinite(y[r])){if(!i&&l.length>0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1],x[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=h;if(h+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],v[0],v[1],v[2],h,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],h,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),u.push(h),c.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=c,this.arcLength=u,"dashes"in t){var k=t.dashes,A=k.slice();for(A.unshift(0),e=1;e<A.length;++e)A[e]=A[e-1]+A[e];var T=d(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)T.set(e,0,r,0);1&f.le(A,A[A.length-1]*e/255)?T.set(e,0,0,0):T.set(e,0,0,255)}this.texture.setPixels(T)}}},y.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},y.pick=function(t){if(!t)retu
;return c=SIMD.Float32x4.shuffle(r,n,0,1,4,5),s=SIMD.Float32x4.shuffle(i,a,0,1,4,5),o=SIMD.Float32x4.shuffle(c,s,0,2,4,6),s=SIMD.Float32x4.shuffle(s,c,1,3,5,7),c=SIMD.Float32x4.shuffle(r,n,2,3,6,7),u=SIMD.Float32x4.shuffle(i,a,2,3,6,7),l=SIMD.Float32x4.shuffle(c,u,0,2,4,6),u=SIMD.Float32x4.shuffle(u,c,1,3,5,7),c=SIMD.Float32x4.mul(l,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.mul(s,c),f=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,c),h),f=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),f),f=SIMD.Float32x4.swizzle(f,2,3,0,1),c=SIMD.Float32x4.mul(s,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),h),p=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),p),p=SIMD.Float32x4.swizzle(p,2,3,0,1),c=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,3,0,1),u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),l=SIMD.Float32x4.swizzle(l,2,3,0,1),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),h),d=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),d),d=SIMD.Float32x4.swizzle(d,2,3,0,1),c=SIMD.Float32x4.mul(o,s),c=SIMD.Float32x4.swizzle(c,1,0,3,2),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(l,c),p),c=SIMD.Float32x4.swizzle(c,2,3,0,1),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(l,c)),c=SIMD.Float32x4.mul(o,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),d),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),f),d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.mul(o,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),f),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),p),SIMD.Float32x4.store(t,0,h),SIMD.Float32x4.store(t,4,f),SIMD.Float32x4.store(t,8,d),SIMD.Float32x4.store(t,12,p),t},i.adjoint=n.USE_SIMD?i.SIMD.adjoint:i.scalar.adjoint,i.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*a)*(h*g-f*m)-(e*s-n*a)*(c*g-f*p)+(e*l-i*a)*(c*m-h*p)+(r*s-n*o)*(u*g-f*d)-(r*l-i*o)*(u*m-h*d)+(n*l-i*s)*(u*p-c*d)},i.SIMD.multiply=function(t,e,r){var n=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4.load(r,0),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,3,3,3,3),o))));SIMD.Float32x4.store(t,0,l);var u=SIMD.Float32x4.load(r,4),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,3,3,3,3),o))));SIMD.Float32x4.store(t,4,c);var h=SIMD.Float32x4.load(r,8),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,3,3,3,3),o))));SIMD.Float32x4.store(t,8,f);var d=SIMD.Float32x4.load(r,12),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,3,3,3,3),o))));return SIMD.Float
t[3]=1/e[3],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}(),i.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},e.exports=i},{"./common.js":194}],203:[function(t,e,r){"use strict";function n(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=t[4*n+i]*e[n];return r}function i(t,e,r,i,a){for(var o=n(i,n(r,n(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*a[0]*(1+o[0]),.5*a[1]*(1-o[1])]}function a(t,e){if(2===t.length){for(var r=0,n=0,i=0;i<2;++i)r+=Math.pow(e[i]-t[0][i],2),n+=Math.pow(e[i]-t[1][i],2);return r=Math.sqrt(r),n=Math.sqrt(n),r+n<1e-6?[1,0]:[n/(r+n),r/(n+r)]}if(3===t.length){var a=[0,0];return u(t[0],t[1],t[2],e,a),l(t,a)}return[]}function o(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;o<3;++o)r[o]+=a*i[o];return r}function s(t,e,r,n,s,l){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),c=0;c<t.length;++c)u[c]=i(t[c],r,n,s,l);for(var h=0,f=1/0,c=0;c<u.length;++c){for(var d=0,p=0;p<2;++p)d+=Math.pow(u[c][p]-e[p],2);d<f&&(f=d,h=c)}for(var m=a(u,e),g=0,c=0;c<3;++c){if(m[c]<-.001||m[c]>1.0001)return null;g+=m[c]}return Math.abs(g-1)>.001?null:[h,o(t,m),m]}var l=t("barycentric"),u=t("polytope-closest-point/lib/closest_point_2d.js");e.exports=s},{barycentric:49,"polytope-closest-point/lib/closest_point_2d.js":486}],204:[function(t,e,r){var n="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}";r.meshShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define G
i=t.labelSize[a],e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.labelCount[a]=Math.floor(o.length/3)-this.labelOffset[a]}for(this.titleOffset=Math.floor(o.length/3),n=s(t.titleFont,t.title).data,i=t.titleSize,e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.titleCount=Math.floor(o.length/3)-this.titleOffset,this.vbo.update(o)},c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":209,"binary-search-bounds":211,"gl-buffer":156,"gl-shader":212,"text-cache":532}],211:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84}],212:[function(t,e,r){"use strict";function n(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t("./lib/create-uniforms"),s=t("./lib/create-attributes"),l=t("./lib/reflect"),u=t("./lib/shader-cache"),c=t("./lib/runtime-reflect"),h=t("./lib/GLError"),f=n.prototype;f.bind=function(){this.program||this._relink();var t,e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},f.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},f.update=function(t,e,r,n){function a(){d.program=u.program(p,d._vref,d._fref,_,w);for(var t=0;t<r.length;++t)E[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var f=t;t=f.vertex,e=f.fragment,r=f.uniforms,n=f.attributes}var d=this,p=d.gl,m=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),m&&m.dispose(),d.vertShader=d._vref.shader;var g=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),g&&g.dispose(),d.fragShader=d._fref.shader,!r||!n){var v=p.createProgram();if(p.attachShader(v,d.fragShader),p.attachShader(v,d.vertShader),p.linkProgram(v),!p.getProgramParameter(v,p.LINK_STATUS)){var y=p.getProgramInfoLog(v);throw new h(y,"Error linking program:"+y)}r=r||c.uniforms(p,v),n=n||c.attributes(p,v),p.deleteProgram(v)}n=n.slice(),n.sort(i);var b,x=[],_=[],w=[];for(b=0;b<n.length;++b){var M=n[b];if(M.type.indexOf("mat")>=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T<k;++T)A[T]=w.length,_.push(M.name+"["+T+"]"),"number"==typeof M.location?w.push(M.location+T):Array.isArray(M.location)&&M.location.length===k&&"number"==typeof M.location[T]?w.push(0|M.location[T]):w.push(-1);x.push({name:M.name,type:M.type,locations:A})}else x.push({name:M.name,type:M.type,locations:[w.length]}),_.push(M.name),"number"==typeof M.location?w.push(0|M.location):w.push(-1)}var S=0;for(b=0;b<w.length;++b)if(w[b]<0){for(;w.indexOf(S)>=0;)S+=1;w[b]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,x,w),Object.defineProperty(d,"uniforms",o(p,d,r,E))},e.exports=a},{"./lib/GLError":213,"./lib/create-attributes":214,"./lib/create-uniforms":215,"./lib/reflect":216,"./lib/runtime-reflect":217,"./lib/shader-cache":218}],213:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],214:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],u=[],c=0;c<a;++c)l.push("x"+c),u.push("x"+c);l.push("if(x0.length===void 0){return gl.vertexAttrib"+a+"f(v,"+u.join()+")}else{return gl.vertexAttrib"+a+"fv(v,x0)}");var h=Function.apply(null,l),f=new n(t,e,r,i,a,h
"./GLError":224,dup:214}],226:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{"./GLError":224,"./reflect":227,dup:215}],227:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{dup:216}],228:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],229:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{"./GLError":224,dup:218,"gl-format-compiler-error":165,"weakmap-shim":562}],230:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}function i(t,e){var r,n=0,i=t.length>>>1;for(r=0;r<i;r++){var a=t[2*r],o=t[2*r+1];a>=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}function a(t,e){var r=t.gl,i=s(r),a=s(r),l=o(r,u.pointVertex,u.pointFragment),c=o(r,u.pickVertex,u.pickFragment),h=new n(t,i,a,l,c);return h.update(e),t.addObject(h),h}var o=t("gl-shader"),s=t("gl-buffer"),l=t("typedarray-pool"),u=t("./lib/shader");e.exports=a;var c=n.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){function e(e,r){return e in t?t[e]:r}var r;t=t||{},this.sizeMin=e("sizeMin",.5),this.sizeMax=e("sizeMax",20),this.color=e("color",[1,0,0,1]).slice(),this.areaRatio=e("areaRatio",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.blend=e("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,o=t.positions,s=i?o:l.mallocFloat32(o.length),u=a?t.idToIndex:l.mallocInt32(n);if(i||s.set(o),!a)for(s.set(o),r=0;r<n;r++)u[r]=r;this.points=o,this.offsetBuffer.update(s),this.pickBuffer.update(u),i||l.free(s),a||l.free(u),this.pointCount=n,this.pickOffset=0},c.unifiedDraw=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=void 0!==r,a=n?this.pickShader:this.shader,o=this.plot.gl,s=this.plot.dataBox;if(0===this.pointCount)return r;var l=s[2]-s[0],u=s[3]-s[1],c=i(this.points,s),h=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/l,t[4]=2/u,t[6]=-2*s[0]/l-1,t[7]=-2*s[1]/u-1,this.offsetBuffer.bind(),a.bind(),a.attributes.position.pointer(),a.uniforms.matrix=t,a.uniforms.color=this.color,a.uniforms.borderColor=this.borderColor,a.uniforms.pointCloud=h<5,a.uniforms.pointSize=h,a.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),a.attributes.pickId.pointer(o.UNSIGNED_BYTE),a.uniforms.pickOffset=e,this.pickOffset=r);var f=o.getParameter(o.BLEND),d=o.getParameter(o.DITHER);return f&&!this.blend&&o.disable(o.BLEND),d&&o.disable(o.DITHER),o.drawArrays(o.POINTS,0,this.pointCount),f&&!this.blend&&o.enable(o.BLEND),d&&o.enable(o.DITHER),r+this.pointCount}}(),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r<n||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":222,"gl-buffer":156,"gl-shader":223,"typedarray-pool":541}],231:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return a=u*d+c*p+h*m+f*g,a<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t}e.exports=n},{}],232:[function(t,e,r){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * sc
d.pickGroup=e.pickId/255,d.pixelRatio=e.pixelRatio;for(var _=0;_<3;++_)if(h[_]&&e.projectOpacity[_]<1===n){d.scale=e.projectScale[_],d.opacity=e.projectOpacity[_];for(var L=S,C=0;C<16;++C)L[C]=0;for(var C=0;C<4;++C)L[5*C]=1;L[5*_]=0,o[_]<0?L[12+_]=y[0][_]:L[12+_]=y[1][_],v(L,p,L),d.model=L;var I=(_+1)%3,z=(_+2)%3,D=s(M),P=s(k);D[I]=1,P[z]=1;var O=i(g,m,p,l(A,D)),R=i(g,m,p,l(T,P));if(Math.abs(O[1])>Math.abs(R[1])){var F=O;O=R,R=F,F=D,D=P,P=F;var j=I;I=z,z=j}O[0]<0&&(D[I]=-1),R[1]>0&&(P[z]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*I+C],2),B+=Math.pow(p[4*z+C],2);D[I]/=Math.sqrt(N),P[z]/=Math.sqrt(B),d.axes[0]=D,d.axes[1]=P,d.fragClipBounds[0]=u(E,b[0],_,-1e8),d.fragClipBounds[1]=u(E,b[1],_,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function f(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=z,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}h(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),h=p(e),f=p(e),d=m(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new o(e,r,n,i,u,c,h,f,d,a,s,l);return g.update(t),g}var p=t("gl-buffer"),m=t("gl-vao"),g=t("typedarray-pool"),v=t("gl-mat4/multiply"),y=t("./lib/shaders"),b=t("./lib/glyphs"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],k=[0,0,0],A=[0,0,0,1],T=[0,0,0,1],S=x.slice(),E=[0,0,0],L=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],I=[1e8,1e8,1e8],z=[C,I];_.draw=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){f(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,h=t.angle,f=t.lineColor,d=0,p=0,m=0,v=n.length;t:for(var y
;var d=t("bit-twiddle"),p=t("gl-buffer"),m=t("gl-vao"),g=t("gl-texture2d"),v=t("typedarray-pool"),y=t("colormap"),b=t("ndarray-ops"),x=t("ndarray-pack"),_=t("ndarray"),w=t("surface-nets"),M=t("gl-mat4/multiply"),k=t("gl-mat4/invert"),A=t("binary-search-bounds"),T=t("ndarray-gradient"),S=t("./lib/shaders"),E=S.createShader,L=S.createContourShader,C=S.createPickShader,I=S.createPickContourShader,z=40,D=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],O=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var t=0;t<3;++t){var e=O[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var R=256,F=a.prototype;F.isTransparent=function(){return this.opacity<1},F.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},F.pickSlots=1,F.setPickBase=function(t){this.pickId=t};var j=[0,0,0],N={showSurface:!1,showContour:!1,projections:[D.slice(),D.slice(),D.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:D,view:D,projection:D,inverseModel:D.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},U=D.slice(),V=[1,0,0,0,1,0,0,0,1];F.draw=function(t){return s.call(this,t,!1)},F.drawTransparent=function(t){return s.call(this,t,!0)};var H={model:D,view:D,projection:D,inverseModel:D,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};F.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=H;r.model=t.model||D,r.view=t.view||D,r.projection=t.projection||D,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var u=this._contourVAO;for(u.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=O[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(l.uniforms.height=this.contourLevels[a][n],u.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(l.uniforms.model=s.projections[n],l.uniforms.clipBounds=s.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){l.uniforms.permutation=O[a],e.lineWidth(this.contourWidth[a]);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(l.uniforms.height=this.contourLevels[a][c],u.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}u.unbind()}},F.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?a:1-a,f=0;f<2;++f)for(var d=f?l:1-l,p=i+c,m=s+f,g=h*d,v=0;v<3;++v)u[v]+=this._field[v].get(p,m)*g;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=A.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]<this.contourLevels[b].length-1){var x=this.contourLevels[b][y[b]],_=this.contourLevels[b][y[b]+1];Math.abs(x-u[b])>Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v
e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],283:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":284}],284:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D",
fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n
"../util/unbundle_jsonlint":307,"./validate_enum":313}],315:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate"),o=t("./validate_object"),s=t("./validate_array"),l=t("./validate_number");e.exports=function(t){function e(t){var e=[],a=t.value;return e=e.concat(s({key:t.key,value:a,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:r})),"array"===i(a)&&0===a.length&&e.push(new n(t.key,a,"array must have at least one stop")),e}function r(t){var e=[],r=t.value,s=t.key;if("array"!==i(r))return[new n(s,r,"array expected, %s found",i(r))];if(2!==r.length)return[new n(s,r,"array length %d expected, length %d found",2,r.length)];var f=i(r[0]);if(c||(c=f),f!==c)return[new n(s,r,"%s stop key type must match previous stop key type %s",f,c)];if("object"===f){if(void 0===r[0].zoom)return[new n(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new n(s,r,"object stop key must have value")];e=e.concat(o({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:u}}))}else e=e.concat((d?l:u)({key:s+"[0]",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e=e.concat(a({key:s+"[1]",value:r[1],valueSpec:h,style:t.style,styleSpec:t.styleSpec})),"number"===i(r[0])&&("piecewise-constant"===h.function&&r[0]%1!=0&&e.push(new n(s+"[0]",r[0],"zoom level for piecewise-constant functions must be an integer")),0!==t.arrayIndex&&r[0]<t.array[t.arrayIndex-1][0]&&e.push(new n(s+"[0]",r[0],"array stops must appear in ascending order"))),e}function u(t){var e=[],r=i(t.value);return"number"!==r&&"string"!==r&&"array"!==r&&e.push(new n(t.key,t.value,"property value must be a number, string or array")),e}var c,h=t.valueSpec,f=void 0!==t.value.property||"object"===c,d=void 0===t.value.property||"object"===c,p=o({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:e}});return t.styleSpec.$version>=8&&(f&&!t.valueSpec["property-function"]?p.push(new n(t.key,t.value,"property functions not supported")):d&&!t.valueSpec["zoom-function"]&&p.push(new n(t.key,t.value,"zoom functions not supported"))),p}},{"../error/validation_error":304,"../util/get_type":306,"./validate":308,"./validate_array":309,"./validate_number":319,"./validate_object":320}],316:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":304,"./validate_string":323}],317:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),u=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,h=t.style,f=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;m<t.arrayIndex;m++){var g=h.layers[m];i(g.id)===i(r.id)&&e.push(new n(c,r.id,'duplicate layer id "%s", previously used at line %d',r.id,g.id.__line__))}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new n(c,r[t],'"%s" is prohibited for ref layers',t))});var v;h.layers.forEach(function(t){t.id==p&&(v=t)}),v?v.ref?e.push(new n(c,r.ref,"ref cannot reference another ref layer")):d=i(v.type):e.push(new n(c,r.ref,'ref layer "%s" not found',p))}else if("background"!==d)if(r.source){var y=h.sources&&h.sources[r.source];y?"vector"==y.type&&"raster"==d?e.push(new n(c,r.source,'layer "%s" requires a raster source',r.id)):"raster"==y.type&&"raster"!=d?e.push(new n(c,r.source,'layer "%s" requires a vector source',r.id)):"vector"!=y.type||r["source-layer"]||e.push(new n(c,r,'layer "%s" must specify
;var y=[p.fragmentPragmas.define[v],"attribute","{precision}","{type}",m].join(" ")+";\n";p.fragmentPragmas.define[v]=g,p.vertexPragmas.define[v]=g+y,p.vertexPragmas.initialize[v]=[v,"=",m,"/",u.multiplier.toFixed(1)].join(" ")+";\n"}else{for(var b="u_"+m.slice(2)+"_t",x=d.getPaintValueStopZoomLevels(u.paintProperty),_=0;_<x.length&&x[_]<t.zoom;)_++;for(var w=Math.max(0,Math.min(x.length-4,_-2)),M=[],k=0;k<4;k++)M.push(x[Math.min(w+k,x.length-1)]);g=["varying","{precision}","{type}",v].join(" ")+";\n",p.vertexPragmas.define[v]=g+["uniform","lowp","float",b].join(" ")+";\n",p.fragmentPragmas.define[v]=g,p.uniforms.push(c.extend({},u,{name:b,getValue:o(u,w),components:1}));var A=u.components;if(1===A)p.attributes.push(c.extend({},u,{getValue:a(u,M),isFunction:!0,components:4*A})),p.vertexPragmas.define[v]+=["attribute","{precision}","vec4",m].join(" ")+";\n",p.vertexPragmas.initialize[v]=[v,"=","evaluate_zoom_function_1("+m+", "+b+")","/",u.multiplier.toFixed(1)].join(" ")+";\n";else{for(var T=[],S=0;S<4;S++)T.push(m+S),p.attributes.push(c.extend({},u,{getValue:a(u,[M[S]]),isFunction:!0,name:m+S})),p.vertexPragmas.define[v]+=["attribute","{precision}","{type}",m+S].join(" ")+";\n";p.vertexPragmas.initialize[v]=[v," = ","evaluate_zoom_function_4("+T.join(", ")+", "+b+")","/",u.multiplier.toFixed(1)].join(" ")+";\n"}}}}}return e}function a(t,e){return function(r,n,i){if(1===e.length)return t.getValue(r,c.extend({},n,{zoom:e[0]}),i);for(var a=[],o=0;o<e.length;o++){var s=e[o];a.push(t.getValue(r,c.extend({},n,{zoom:s}),i)[0])}return a}}function o(t,e){return function(r,n){var i=r.getPaintInterpolationT(t.paintProperty,n.zoom);return[Math.max(0,Math.min(4,i-e))]}}var s=t("feature-filter"),l=t("./array_group"),u=t("./buffer_group"),c=t("../util/util"),h=t("../util/struct_array"),f=t("assert");e.exports=n,n.create=function(e){return new({fill:t("./bucket/fill_bucket"),line:t("./bucket/line_bucket"),circle:t("./bucket/circle_bucket"),symbol:t("./bucket/symbol_bucket")}[e.layer.type])(e)},n.EXTENT=8192,n.prototype.populateArrays=function(){this.createArrays(),this.recalculateStyleLayers();for(var t=0;t<this.features.length;t++)this.addFeature(this.features[t]);this.trimArrays()},n.prototype.prepareArrayGroup=function(t,e){var r=this.arrayGroups[t],n=r.length&&r[r.length-1];return n&&n.hasCapacityFor(e)||(n=new l({layoutVertexArrayType:this.programInterfaces[t].layoutVertexArrayType,elementArrayType:this.programInterfaces[t].elementArrayType,elementArrayType2:this.programInterfaces[t].elementArrayType2,paintVertexArrayTypes:this.paintVertexArrayTypes[t]}),n.index=r.length,r.push(n)),n},n.prototype.createArrays=function(){this.arrayGroups={},this.paintVertexArrayTypes={};for(var t in this.programInterfaces){this.arrayGroups[t]=[];var e=this.paintVertexArrayTypes[t]={},r=this.paintAttributes[t];for(var i in r)e[i]=new n.VertexArrayType(r[i].attributes)}},n.prototype.destroy=function(t){for(var e in this.bufferGroups)for(var r=this.bufferGroups[e],n=0;n<r.length;n++)r[n].destroy(t)},n.prototype.trimArrays=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)e[r].trim()},n.prototype.isEmpty=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)if(!e[r].isEmpty())return!1;return!0},n.prototype.getTransferables=function(t){for(var e in this.arrayGroups)for(var r=this.arrayGroups[e],n=0;n<r.length;n++)r[n].getTransferables(t)},n.prototype.setUniforms=function(t,e,r,n,i){for(var a=this.paintAttributes[e][n.id].uniforms,o=0;o<a.length;o++){var s=a[o],l=r[s.name];t["uniform"+s.components+"fv"](l,s.getValue(n,i))}},n.prototype.serialize=function(){return{layerId:this.layer.id,zoom:this.zoom,arrays:c.mapObject(this.arrayGroups,function(t){return t.map(function(t){return t.serialize()})}),paintVertexArrayTypes:c.mapObject(this.paintVertexArrayTypes,function(t){return c.mapObject(t,function(t){return t.serialize()})}),childLayerIds:this.childLayers.map(function(t){return t.id})}},n.prototype.createFilter=function(){this.filter||(this.filter=s(this.layer.filter))};var d={la
;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":442}],340:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":339}],341:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),u=t("../source/tile_coord"),c=t("../data/bucket").EXTENT,h=t("gl-matrix"),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(e<t.minzoom)return[];e>t.maxzoom&&(e=t.maxzoom);var n=this,i=n.locationCoordinate(n.center)._zoomTo(e),o=new a(i.column-.5,i.row-.5);return u.cover(e,[n.pointCoordinate(new a(0,0))._zoomTo(e),n.pointCoordinate(new a(n.width,0))._zoomTo(e),n.pointCoordinate(new a(n.width,n.height))._zoomTo(e),n.pointCoordinate(ne
i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),o.enable(o.DEPTH_TEST),e.map.showCollisionBoxes&&s(t,e,r,n)}}function i(t,e,r,n,i,o,s,l,u,c,h,f,d,p,m){for(var g=0;g<n.length;g++){var v=e.getTile(n[g]),y=v.getBucket(r);if(y){var b=y.bufferGroups,x=i?b.glyph:b.icon;x.length&&(t.enableTileClippingMask(n[g]),a(t,r,n[g].posMatrix,v,y,x,i,i||y.sdfIcons,!i&&y.iconsNeedLinear,i?y.adjustedTextSize:y.adjustedIconSize,y.fontstack,o,s,l,u,c,h,f,d,p,m))}}}function a(t,e,r,n,i,a,s,u,c,h,f,d,p,m,g,v,y,b,x,_,w){var M,k,A,T=t.gl,S=t.transform,E="map"===m,L="map"===g,C=s?24:1,I=v/C;if(L?(k=l(n,1,t.transform.zoom)*I,A=1/Math.cos(S._pitch),M=[k,k]):(k=t.transform.altitude*I,A=1,M=[S.pixelsToGLUnits[0]*k,S.pixelsToGLUnits[1]*k]),s||t.style.sprite.loaded()){var z=t.useProgram(u?"sdf":"icon");if(T.uniformMatrix4fv(z.u_matrix,!1,t.translatePosMatrix(r,n,d,p)),T.uniform1i(z.u_rotate_with_map,E),T.uniform1i(z.u_pitch_with_map,L),T.uniform2fv(z.u_extrude_scale,M),T.activeTexture(T.TEXTURE0),T.uniform1i(z.u_texture,0),s){var D=f&&t.glyphSource.getGlyphAtlas(f);if(!D)return;D.updateTexture(T),T.uniform2f(z.u_texsize,D.width/4,D.height/4)}else{var P=t.options.rotating||t.options.zooming,O=1!==I||o.devicePixelRatio!==t.spriteAtlas.pixelRatio||c,R=L||t.transform.pitch;t.spriteAtlas.bind(T,u||P||O||R),T.uniform2f(z.u_texsize,t.spriteAtlas.width/4,t.spriteAtlas.height/4)}var F=Math.log(v/h)/Math.LN2||0;T.uniform1f(z.u_zoom,10*(t.transform.zoom-F)),T.activeTexture(T.TEXTURE1),t.frameHistory.bind(T),T.uniform1i(z.u_fadetexture,1);var j;if(u){var N=.105*C/v/o.devicePixelRatio;if(y){T.uniform1f(z.u_gamma,(1.19*x/I/8+N)*A),T.uniform4fv(z.u_color,b),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,(6-y/I)/8);for(var B=0;B<a.length;B++)j=a[B],j.vaos[e.id].bind(T,z,j.layoutVertexBuffer,j.elementBuffer),T.drawElements(T.TRIANGLES,3*j.elementBuffer.length,T.UNSIGNED_SHORT,0)}T.uniform1f(z.u_gamma,N*A),T.uniform4fv(z.u_color,w),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,.75),T.uniform1f(z.u_pitch,S.pitch/360*2*Math.PI),T.uniform1f(z.u_bearing,S.bearing/360*2*Math.PI),T.uniform1f(z.u_aspect_ratio,S.width/S.height);for(var U=0;U<a.length;U++)j=a[U],j.vaos[e.id].bind(T,z,j.layoutVertexBuffer,j.elementBuffer),T.drawElements(T.TRIANGLES,3*j.elementBuffer.length,T.UNSIGNED_SHORT,0)}else{T.uniform1f(z.u_opacity,_);for(var V=0;V<a.length;V++)j=a[V],j.vaos[e.id].bind(T,z,j.layoutVertexBuffer,j.elementBuffer),T.drawElements(T.TRIANGLES,3*j.elementBuffer.length,T.UNSIGNED_SHORT,0)}}}var o=t("../util/browser"),s=t("./draw_collision_debug"),l=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":363,"../util/browser":426,"./draw_collision_debug":347}],353:[function(t,e,r){"use strict";function n(){this.changeTimes=new Float64Array(256),this.changeOpacities=new Uint8Array(256),this.opacities=new Uint8ClampedArray(256),this.array=new Uint8Array(this.opacities.buffer),this.fadeDuration=300,this.previousZoom=0,this.firstFrame=!0}e.exports=n,n.prototype.record=function(t){var e=Date.now();this.firstFrame&&(e=0,this.firstFrame=!1),t=Math.floor(10*t);var r;if(t<this.previousZoom)for(r=t+1;r<=this.previousZoom;r++)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];else for(r=t;r>this.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=e-this.changeTimes[r],i=n/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+i:this.changeOpacities[r]-i}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t
;if(e=this._tiles[r.id],e||(e=this._cache.get(r.id))&&this._redoPlacement&&this._redoPlacement(e),!e){var n=t.z,i=n>this.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,c=0;c<t.length;c++){var f=t[c];n=Math.min(n,f.column),a=Math.min(a,f.row),o=Math.max(o,f.column),s=Math.max(s,f.row)}for(var p=0;p<r.length;p++){var m=this._tiles[r[p]],g=u.fromID(r[p]),v=[i(g,m.sourceMaxZoom,new h(n,a,l)),i(g,m.sourceMaxZoom,new h(o,s,l))];if(v[0].x<d&&v[0].y<d&&v[1].x>=0&&v[1].y>=0){for(var y=[],b=0;b<t.length;b++)y.push(i(g,m.sourceMaxZoom,t[b]));var x=e[m.coord.id];void 0===x&&(x=e[m.coord.id]={tile:m,coord:g,queryGeometry:[],scale:Math.pow(2,this.transform.zoom-m.coord.z)}),x.queryGeometry.push(y)}}var _=[];for(var w in e)_.push(e[w]);return _},redoPlacement:function(){for(var t=this.getIds(),e=0;e<t.length;e++){this.getTileByID(t[e]).redoPlacement(this)}},getVisibleCoordinates:function(){return this.getRenderableIds().map(u.fromID)}})},{"../data/bucket":329,"../geo/coordinate":338,"../util/evented":434,"../util/lru_cache":438,"../util/util":442,"./source":366,"./tile":368,"./tile_coord":369}],368:[function(t,e,r){"use strict";function n(t,e,r){this.coord=t,this.uid=a.uniqueId(),this.uses=0,this.tileSize=e,this.sourceMaxZoom=r,this.buckets={},this.state="loading"}function i(t,e){if(e){for(var r={},n=0;n<t.length;n++){var i=e.getLayer(t[n].layerId);if(i){var s=o.create(a.extend({layer:i,childLayers:t[n].childLayerIds.map(e.getLayer.bind(e)).filter(function(t){return t})},t[n]));r[s.id]=s}}return r}}var a=t("../util/util"),o=t("../data/bucket"),s=t("../data/feature_index"),l=t("vector-tile"),u=t("pbf"),c=t("../util/vectortile_to_geojson"),h=t("feature-filter"),f=t("../symbol/collision_tile"),d=t("../symbol/collision_box"),p=t("../symbol/symbol_instances"),m=t("../symbol/symbol_quads");e.exports=n,n.prototype={loadVectorData:function(t,e){this.state="loaded",t&&(this.collisionBoxArray=new d(t.collisionBoxArray),this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.symbolInstancesArray=new p(t.symbolInstancesArray),this.symbolQuadsArray=new m(t.symbolQuadsArray),this.featureIndex=new s(t.featureIndex,t.rawTileData,this.collisionTile),this.rawTileData=t.rawTileData,this.buckets=i(t.buckets,e))},reloadSymbolData:function(t,e,r){if("unloaded"!==this.state){this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile);for(var n in this.buckets){var o=this.buckets[n];"symbol"===o.type&&(o.destroy(e.gl),delete this.buckets[n])}a.extend(this.buckets,i(t.buckets,r))}},unloadVectorData:function(t){for(var e in this.buckets){this.buckets[e].destroy(t.gl)}this.collisionBoxArray=null,this.symbolQuadsArray=null,this.symbolInstancesArray=null,this.collisionTile=null,this.featureIndex=null,this.rawTileData=null,this.buckets=null,this.state="unloaded"},redoPlacement:function(t){function e(e,r){this.reloadSymbolData(r,t.map.painter,t.map.style),t.fire("tile.load",{tile:this}),this.state="loaded",this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}if("loaded"!==this.state||"reloading"===this.state)return void(this.redoWhenDone=!0);this.state="reloading",t.dispatcher.send("redo placement",{uid:this.uid,source:t.id,angle:t.map.transform.angle,pitch:t.map.transform.pitch,showCollisionBoxes:t.map.showCollisionBoxes},e.bind(this),this.workerID)},getBucket:function(t){return this.buckets&&this.buckets[t.ref||t.id]},querySourceFeatures:function(t,e){if
e&&e.filter&&this._handleErrors(g.filter,"queryRenderedFeatures.filter",e.filter,!0);var i={};if(e&&e.layers)for(var a=0;a<e.layers.length;a++){var o=e.layers[a];i[this._layers[o].source]=!0}var s=[];for(var l in this.sources)if(!e.layers||i[l]){var u=this.sources[l],c=y.rendered(u,this._layers,t,e,r,n);s.push(c)}return this._flattenRenderedFeatures(s)},querySourceFeatures:function(t,e){e&&e.filter&&this._handleErrors(g.filter,"querySourceFeatures.filter",e.filter,!0);var r=this.sources[t];return r?y.source(r,e):[]},addSourceType:function(t,e,r){return v.getType(t)?r(new Error('A source type called "'+t+'" already exists.')):(v.setType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("load worker source",{name:t,url:e.workerSourceURL},r):r(null,null))},_handleErrors:function(t,e,r,n,i){var a=n?g.throwErrors:g.emitErrors,o=t.call(g,c.extend({key:e,style:this.serialize(),value:r,styleSpec:x},i));return a.call(g,this,o)},_remove:function(){this.dispatcher.remove()},_reloadSource:function(t){this.sources[t].reload()},_updateSources:function(t){for(var e in this.sources)this.sources[e].update(t)},_redoPlacement:function(){for(var t in this.sources)this.sources[t].redoPlacement&&this.sources[t].redoPlacement()},_forwardSourceEvent:function(t){this.fire("source."+t.type,c.extend({source:t.target.getSource()},t))},_forwardTileEvent:function(t){this.fire(t.type,c.extend({source:t.target},t))},_forwardLayerEvent:function(t){this.fire("layer."+t.type,c.extend({layer:{id:t.target.id}},t))},"get sprite json":function(t,e){var r=this.sprite;r.loaded()?e(null,{sprite:r.data,retina:r.retina}):r.on("load",function(){e(null,{sprite:r.data,retina:r.retina})})},"get icons":function(t,e){var r=this.sprite,n=this.spriteAtlas;r.loaded()?(n.setSprite(r),n.addIcons(t.icons,e)):r.on("load",function(){n.setSprite(r),n.addIcons(t.icons,e)})},"get glyphs":function(t,e){function r(t,r,n){t&&console.error(t),a[n]=r,0===--i&&e(null,a)}var n=t.stacks,i=Object.keys(n).length,a={};for(var o in n)this.glyphSource.getSimpleGlyphs(o,n[o],t.uid,r)}})},{"../render/line_atlas":354,"../source/query_features":364,"../source/source":366,"../source/source_cache":367,"../symbol/glyph_source":399,"../symbol/sprite_atlas":404,"../util/ajax":425,"../util/browser":426,"../util/dispatcher":433,"../util/evented":434,"../util/mapbox":439,"../util/util":442,"./animation_loop":375,"./image_sprite":376,"./style_function":380,"./style_layer":381,"./style_spec":388,"./validate_style":390}],379:[function(t,e,r){"use strict";function n(t,e){this.value=s.clone(e),this.isFunction=a.isFunctionDefinition(e),this.json=JSON.stringify(this.value);var r="color"===t.type&&this.value?o(this.value):e;if(this.calculate=a[t.function||"piecewise-constant"](r),this.isFeatureConstant=this.calculate.isFeatureConstant,this.isZoomConstant=this.calculate.isZoomConstant,"piecewise-constant"===t.function&&t.transition&&(this.calculate=i(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var n=[],l=this.value.stops,u=0;u<this.value.stops.length;u++){var c=l[u][0].zoom;this.stopZoomLevels.indexOf(c)<0&&(this.stopZoomLevels.push(c),n.push([c,n.length]))}this.calculateInterpolationT=a.interpolated({stops:n,base:e.base})}}function i(t){return function(e,r){var n,i,a,o=e.zoom,s=e.zoomHistory,l=e.duration,u=o%1,c=Math.min((Date.now()-s.lastIntegerZoomTime)/l,1),h=1;return o>s.lastIntegerZoom?(n=u+(1-u)*c,h*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-c)*u,a=t({zoom:o},r),i=t({zoom:o+1},r),h/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:h,to:a,toScale:1,t:n}}}var a=t("./style_function"),o=t("./parse_color"),s=t("../util/util");e.exports=n},{"../util/util":442,"./parse_color":377,"./style_function":380}],380:[function(t,e,r){"use strict";var n=t("mapbox-gl-function");r.interpolated=function(t){var e=n.interpolated(t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r["piecewise-constant"]=function(t){var e=n["piecewise-constant"](t),r=function(t,r){return e(t&&t.zoom,r||{})};return
function l(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],u=(-n*(o+1)+.5)*a+s[1],c=0;c<t.length;c++)t[c].x+=l,t[c].y+=u}function u(t,e){if(!t||!t.rect)return null;var r=e["icon-offset"][0],n=e["icon-offset"][1],i=r-t.width/2,a=i+t.width,o=n-t.height/2;return new c(t,o,o+t.height,i,a)}function c(t,e,r,n,i){this.image=t,this.top=e,this.bottom=r,this.left=n,this.right=i}e.exports={shapeText:a,shapeIcon:u};var h={32:!0,8203:!0},f={32:!0,38:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0}},{}],404:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.bin=new o(t,e),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0}function i(t,e,r,n,i,a,o,s,l,u,c){var h,f,d=n*e+r,p=s*a+o;if(c)for(p-=a,f=-1;f<=u;f++,d=((f+u)%u+n)*e+r,p+=a)for(h=-1;h<=l;h++)i[p+h]=t[d+(h+l)%l];else for(f=0;f<u;f++,d+=e,p+=a)for(h=0;h<l;h++)i[p+h]=t[d+h]}function a(t,e,r,n,i){this.rect=t,this.width=e,this.height=r,this.sdf=n,this.pixelRatio=i}var o=t("shelf-pack"),s=t("../util/browser"),l=t("../util/util");e.exports=n,n.prototype.allocateImage=function(t,e){t/=this.pixelRatio,e/=this.pixelRatio;var r=t+2+(4-(t+2)%4),n=e+2+(4-(e+2)%4),i=this.bin.packOne(r,n);return i||(l.warnOnce("SpriteAtlas out of space."),null)},n.prototype.getImage=function(t,e){if(this.images[t])return this.images[t];if(!this.sprite)return null;var r=this.sprite.getSpritePosition(t);if(!r.width||!r.height)return null;var n=this.allocateImage(r.width,r.height);if(!n)return null;var i=new a(n,r.width/r.pixelRatio,r.height/r.pixelRatio,r.sdf,r.pixelRatio/this.pixelRatio);return this.images[t]=i,this.copy(n,r,e),i},n.prototype.getPosition=function(t,e){var r=this.getImage(t,e),n=r&&r.rect;if(!n)return null;var i=r.width*r.pixelRatio,a=r.height*r.pixelRatio;return{size:[r.width,r.height],tl:[(n.x+1)/this.width,(n.y+1)/this.height],br:[(n.x+1+i)/this.width,(n.y+1+a)/this.height]}},n.prototype.allocate=function(){if(!this.data){var t=Math.floor(this.width*this.pixelRatio),e=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(t*e);for(var r=0;r<this.data.length;r++)this.data[r]=0}},n.prototype.copy=function(t,e,r){if(this.sprite.img.data){var n=new Uint32Array(this.sprite.img.data.buffer);this.allocate();var a=this.data;i(n,this.sprite.img.width,e.x,e.y,a,this.width*this.pixelRatio,(t.x+1)*this.pixelRatio,(t.y+1)*this.pixelRatio,e.width,e.height,r),this.dirty=!0}},n.prototype.setSprite=function(t){t&&(this.pixelRatio=s.devicePixelRatio>1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r<t.length;r++)this.getImage(t[r]);e(null,this.images)},n.prototype.bind=function(t,e){var r=!1;this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r=!0);var n=e?t.LINEAR:t.NEAREST;n!==this.filter&&(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n),this.filter=n),this.dirty&&(this.allocate(),r?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width*this.pixelRatio,this.height*this.pixelRatio,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width*this.pixelRatio,this.height*this.pixelRatio,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)),this.dirty=!1)}},{"../util/browser":426,"../util/util":442,"shelf-pack":514}],405:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"glyphQuadStartIndex"},{type:"Uint16",name:"glyphQuadEndIndex"},{type:"Uint16",name:"iconQuadStartIndex"},{type:"Uint16",name:"iconQuadEndIndex"},{type:"Int16",name:"anchorPointX"},{type:"Int16",n
document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(u.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(u,{originalEvent:t})}else{var c=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":c&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,u=(n[0]-i[0])/1e3,c=n[2];if(0===u||a===s)return void r.snapToNorth({},{originalEvent:t});var h=.15*l/u;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=a+h*f/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:f,easing:o,around:r.unproject(c)},{originalEvent:t})},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":428,"../../util/util":442}],420:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":442}],421:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),u=t("../util/dom"),c=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),b=t("point-geometry"),x=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if(t=a.extend({},_,t),t.workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.
t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",o.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}function a(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?u.extend({},t,{access_token:o.ACCESS_TOKEN}):t}var o=t("./config"),s=t("./browser"),l=t("url"),u=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==l.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=l.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,l.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=l.parse(t,!0);if(!e)return t;if("mapbox:"!==l.parse(e).protocol)return t;var i=s.supportsWebp?".webp":"$1",o=s.devicePixelRatio>=2||512===r?"@2x":"";return l.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,o+i),query:a(n.query)})}},{"./browser":426,"./config":431,"./util":442,url:545}],440:[function(t,e,r){"use strict";function n(t){function e(){f.apply(this,arguments)}function r(){d.apply(this,arguments),this.members=e.prototype.members}var n=JSON.stringify(t);if(g[n])return g[n];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(f.prototype);var s=0,u=0,v=["Uint8"];return e.prototype.members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},p(r.name.length),p(r.type in m),v.indexOf(r.type)<0&&v.push(r.type);var n=o(r.type);u=Math.max(u,n),r.offset=s=a(s,Math.max(t.alignment,n));for(var i=0;i<r.components;i++)Object.defineProperty(e.prototype,r.name+(1===r.components?"":i),{get:c(r,i),set:h(r,i)});return s+=n*r.components,r}),e.prototype.alignment=t.alignment,e.prototype.size=a(s,Math.max(u,t.alignment)),r.serialize=i,r.prototype=Object.create(d.prototype),r.prototype.StructType=e,r.prototype.bytesPerElement=e.prototype.size,r.prototype.emplaceBack=l(e.prototype.members,e.prototype.size),r.prototype._usedTypes=v,g[n]=r,r}function i(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function a(t,e){return Math.ceil(t/e)*e}function o(t){return m[t].BYTES_PER_ELEMENT}function s(t){return t.toLowerCase()}function l(t,e){for(var r=[],n=[],i="var i = this.length;\nthis.resize(this.length + 1);\n",a=0;a<t.length;a++){var l=t[a],u=o(l.type);r.indexOf(u)<0&&(r.push(u),i+="var o"+u.toFixed(0)+" = i * "+(e/u).toFixed(0)+";\n");for(var c=0;c<l.components;c++){var h="v"+n.length,f="o"+u.toFixed(0)+" + "+(l.offset/u+c).toFixed(0);i+="this."+s(l.type)+"["+f+"] = "+h+";\n",n.push(h)}}return i+="return i;",new Function(n,i)}function u(t,e){var r="this._pos"+o(t.type).toFixed(0),n=(t.offset/o(t.type)+e).toFixed(0),i=r+" + "+n;return"this._structArray."+s(t.type)+"["+i+"]"}function c(t,e){return new Function([],"return "+u(t,e)+";")}function h(t,e){return new Function(["x"],u(t,e)+" = x;")}function f(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function d(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var p=t("assert");e.exports=n;var m={Int8:Int8Array,Uint8:Uint8Array,Uint8Clamped:Uint8ClampedArray,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array,Float64:Float64Array},g={};d.prototype.DEFAULT_CAPACITY=128,d.prototype.RESIZE_MULTIPLIER=5,
"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 a=t.getters||[],o=new Array(n),s=0;s<n;++s)a.indexOf(s)>=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",M="P",k="N",A="Q",T="X",S="T"},{"typedarray-pool":541}],457:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_4_arg1_=_inline_4_arg2_.apply(void 0,_inline_4_arg0_)}",args:[{name:"_inline_4_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_4_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":113}],458:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;r<t;++r)e.push("out",r,"s=0.5*(inp",r,"l-inp",r,"r);");for(var n=["array"],i=["junk"],r=0;r<t;++r){n.push("array"),i.push("out"+r+"s");var a=o(t);a[r]=-1,n.push({array:0,offset:a.slice()}),a[r]=1,n.push({array:0,offset:a.slice()}),i.push("inp"+r+"l","inp"+r+"r")}return l[t]=s({args:n,pre:c,post:c,body:{body:e.join(""),args:i.map(function(t){return{name:t,lvalue:0===t.indexOf("out"),rvalue:0===t.indexOf("inp"),count:"junk"!==t|0}}),thisVars:[],localVars:[]},funcName:"fdTemplate"+t})}function i(t){var e=t.join(),r=u[e];if(r)return r;for(var i=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],o=0;o<1<<i;++o){for(var s=[],c=0;c<i;++c)o&1<<c&&s.push(c+1);for(var d=0;d<1<<s.length;++d){for(var p=s.slice(),c=0;c<s.length;++c)d&1<<c&&(p[c]=-p[c]);!function(e){for(var r=i-e.length,n=[],o=[],s=[],l=0;l<i;++l)e.indexOf(l+1)>=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(u=""),r>0){a.push("if(1");for(var l=0;l<i;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");a.push("){grad",r,"(src.pick(",s.join(),")",u);for(var l=0;l<i;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",u);a.push(");")}for(var l=0;l<e.length;++l){var c=Math.abs(e[l])-1,h="dst.pick("+s.join()+","+c+")"+u;switch(t[c]){case"clamp":var f=s.slice(),d=s.slice();e[l]<0?f[c]="s["+c+"]-2":d[c]="1",0===r?a.push("if(s[",c,"]>1){dst.set(",s.join(),",",c,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>1){diff(",h,",src.pick(",f.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",h,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",c,",0);"):a.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[c]="s["+c+"]-2",m[c]="0"):(p[c]="s["+c+"]-1",m[c]="1"),0===r?a.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>2){diff(",h,",src.pick(",p.join(),")",u,",src.pick(",m.join(),")",u,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}(p)}}a.push("return dst;};return gradient");for(var m=["diff","zero"],g=[h,f],o=1;o<=i;++o)m.push("grad"+o),g.push(n(o));m.push(a.join(""));var v=Function.apply(void 0,m),r=v.apply(void 0,g);return l[e]=r,r}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;n<e.dimension;++n)if(t.shape[n]!==e.shape[n])throw new Error("ndarray-gradient: shape mismatch");
var a="function "+r+"(a){this.data=a;};var proto="+r+".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 "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",o=new Function(a);return o()}if(0===e){var a="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".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 "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",o=new Function("TrivialArray",a);return o(h[t][0])}var a=["'use strict'"],s=l(e),u=s.map(function(t){return"i"+t}),c="this.offset+"+s.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),f=s.map(function(t){return"b"+t}).join(","),d=s.map(function(t){return"c"+t}).join(",");a.push("function "+r+"(a,"+f+","+d+",d){this.data=a","this.shape=["+f+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),a.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?a.push("proto.order=[0]"):(a.push("Object.defineProperty(proto,'order',{get:"),e<4?(a.push("function "+r+"_order(){"),2===e?a.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.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];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?a.push("return this.data.set("+c+",v)}"):a.push("return this.data["+c+"]=v}"),a.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?a.push("return this.data.get("+c+")}"):a.push("return this.data["+c+"]}"),a.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),a.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),m=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+m.join(","));for(var g=0;g<e;++g)a.push("if(typeof i"+g+"==='number'&&i"+g+">=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var g=0;g<e;++g)a.push("if(typeof i"+g+"==='number'){d=i"+g+"|0;if(d<0){c+=b"+g+"*(a"+g+"-1);a"+g+"=ceil(-a"+g+"/d)}else{a"+g+"=ceil(a"+g+"/d)}b"+g+"*=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"b"+t}).join(",")+",c)}");for(var v=new Array(e),y=new Array(e),g=0;g<e;++g)v[g]="a[i"+g+"]",y[g]="b[i"+g+"]";a.push("proto.transpose=function "+r+"_transpose("+u+"){"+u.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;
;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),h=t("uniq"),f=t("./lib/trim-leaves")},{"./lib/trim-leaves":482,"edges-to-adjacency-list":127,"planar-dual":481,"point-in-big-polygon":485,"robust-sum":513,"two-product":539,uniq:543}],484:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],485:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return!!i&&!!i.queryPoint(r,n)}}function a(t){for(var e={},r=0;r<t.length;++r){var n=t[r],a=n[0][0],o=n[0][1],s=n[1][1],l=[Math.min(o,s),Math.max(o,s)];a in e?e[a].push(l):e[a]=[l]}for(var u={},c=Object.keys(e),r=0;r<c.length;++r){var h=e[c[r]];u[c[r]]=d(h)}return i(u)}function o(t,e){return function(r){var n=p.le(e,r[0]);if(n<0)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=h(r,o[0],o[1]);if(o[0][0]<o[1][0])if(s<0)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(s<0))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;i<e;++i)for(var c=t[i],h=c.length,d=h-1,p=0;p<h;d=p++){var m=c[d],g=c[p];m[0]===g[0]?n.push([m,g]):r.push([m,g])}if(0===r.length)return 0===n.length?s:l(a(n));var v=f(r),y=o(v.slabs,v.coordinates);return 0===n.length?y:u(a(n),y)}e.exports=c;var h=t("robust-orientation")[3],f=t("slab-decomposition"),d=t("interval-tree-1d"),p=t("binary-search-bounds")},{"binary-search-bounds":66,"interval-tree-1d":291,"robust-orientation":508,"slab-decomposition":525}],486:[function(t,e,r){"use strict";function n(t,e,r,n,s){i.length<n.length&&(i=new Float64Array(n.length),a=new Float64Array(n.length),o=new Float64Array(n.length));for(var l=0;l<n.length;++l)i[l]=t[l]-n[l],a[l]=e[l]-t[l],o[l]=r[l]-t[l];for(var u=0,c=0,h=0,f=0,d=0,p=0,l=0;l<n.length;++l){var m=a[l],g=o[l],v=i[l];u+=m*m,c+=m*g,h+=g*g,f+=v*m,d+=v*g,p+=v*v}var y,b=Math.abs(u*h-c*c),x=c*d-h*f,_=c*f-u*d;if(x+_<=b)if(x<0)_<0&&f<0?(_=0,-f>=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p)):(x=0,d>=0?(_=0,y=p):-d>=h?(_=1,y=h+2*d+p):(_=-d/h,y=d*_+p));else if(_<0)_=0,f>=0?(x=0,y=p):-f>=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p);else{var w=1/b;x*=w,_*=w,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p}else{var M,k,A,T;x<0?(M=c
u.vertCount=0,u.type=Ge;return a}var o=r.create(null,Je,!0),u=new i(o._buffer);return n.elementsCount++,a(t),a._reglType="elements",a._elements=u,a.subdata=function(t,e){return o.subdata(t,e),a},a.destroy=function(){l(u)},a}var c={},h=0,f={uint8:Ge,uint16:We};e.oes_element_index_uint&&(f.uint32=Ze),i.prototype.bind=function(){this.buffer.bind()};var d=[];return{create:u,createStream:a,destroyStream:o,getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){xe(c).forEach(l)}}}function pt(t){for(var e=Le.allocType(er,t.length),r=0;r<t.length;++r)if(isNaN(t[r]))e[r]=65535;else if(t[r]===1/0)e[r]=31744;else if(t[r]===-1/0)e[r]=64512;else{$e[0]=t[r];var n=tr[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function mt(t){return Array.isArray(t)||Qt(t)}function gt(t){return"[object "+t+"]"}function vt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function yt(t){return!!Array.isArray(t)&&!(0===t.length||!mt(t[0]))}function bt(t){return Object.prototype.toString.call(t)}function xt(t){return bt(t)===dn}function _t(t){return bt(t)===pn}function wt(t){return bt(t)===mn}function Mt(t){return bt(t)===gn}function kt(t){if(!t)return!1;var e=bt(t);return vn.indexOf(e)>=0||(vt(t)||yt(t)||Z(t))}function At(t){return 0|Kt[Object.prototype.toString.call(t)]}function Tt(t,e){var r=e.length;switch(t.type){case Or:case Rr:case Fr:case jr:var n=Le.allocType(t.type,r);n.set(e),t.data=n;break;case wr:t.data=pt(e);break;default:de.raise("unsupported texture type, must specify a typed array")}}function St(t,e){return Le.allocType(t.type===wr?jr:t.type,e)}function Et(t,e){t.type===wr?(t.data=pt(e),Le.freeType(e)):t.data=e}function Lt(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,u=o*s*l,c=St(t,u),h=0,f=0;f<s;++f)for(var d=0;d<o;++d)for(var p=0;p<l;++p)c[h++]=e[r*d+n*f+i*p+a];Et(t,c)}function Ct(t,e,r,n,i,a){var o;if(o=void 0!==bn[t]?bn[t]:fn[t]*yn[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function It(t,e,r,n,i,a,o){function s(){this.internalformat=or,this.format=or,this.type=Or,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=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 u(t,n){if("object"==typeof n&&n){if("premultiplyAlpha"in n&&(de.type(n.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=n.premultiplyAlpha),"flipY"in n&&(de.type(n.flipY,"boolean","invalid texture flip"),t.flipY=n.flipY),"alignment"in n&&(de.oneOf(n.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=n.alignment),"colorSpace"in n&&(de.parameter(n.colorSpace,j,"invalid colorSpace"),t.colorSpace=j[n.colorSpace]),"type"in n){var i=n.type;de(e.oes_texture_float||!("float"===i||"float32"===i),"you must enable the OES_texture_float extension in order to use floating point textures."),de(e.oes_texture_half_float||!("half float"===i||"float16"===i),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),de(e.webgl_depth_texture||!("uint16"===i||"uint32"===i||"depth stencil"===i),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(i,N,"invalid texture type"),t.type=N[i]}var a=t.width,o=t.height,s=t.channels,l=!1;"shape"in n?(de(Array.isArray(n.shape)&&n.shape.length>=2,"shape must be an array"),a=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],de(s>0&&s<=4,"invalid number of channels"),l=!0),de(a>=0&&a<=r.maxTextureSize,"invalid width"),de(o>=0&&o<=r.maxTextureSize,"invalid height")):("radius"in n&&(a=o=n.radius,de(a>=0&&a<=r.maxTextureSize,"invalid radius")),"width"in n&&(a=n.width,de
n(t,e,"=",r.def(t,e),";")}var r=e(),n=e(),i=r.toString,a=n.toString;return $t(function(){r.apply(r,jt(arguments))},{def:r.def,entry:r,exit:n,save:t,set:function(e,n,i){t(e,n),r(e,n,"=",i,";")},toString:function(){return i()+a()}})}function n(){var t=Nt(arguments),e=r(),n=r(),i=e.toString,a=n.toString;return $t(e,{then:function(){return e.apply(e,jt(arguments)),this},else:function(){return n.apply(n,jt(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),Nt(["if(",t,"){",i(),"}",e])}})}function i(t,e){function n(){var t="a"+i.length;return i.push(t),t}var i=[];e=e||0;for(var a=0;a<e;++a)n();var o=r(),s=o.toString;return c[t]=$t(o,{arg:n,toString:function(){return Nt(["function(",i.join(),"){",s(),"}"])}})}function a(){var t=['"use strict";',u,"return {"];Object.keys(c).forEach(function(e){t.push('"',e,'":',c[e].toString(),",")}),t.push("}");var e=Nt(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,s.concat(e)).apply(null,l)}var o=0,s=[],l=[],u=e(),c={};return{global:u,link:t,block:e,proc:i,scope:r,cond:n,compile:a}}function Ut(t){return Array.isArray(t)||Qt(t)||Z(t)}function Vt(t){return t.sort(function(t,e){return t===zi?-1:e===zi?1:t<e?-1:1})}function Ht(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function qt(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Gt(t){return new Ht(!1,!1,!1,t)}function Yt(t,e){var r=t.type;if(r===ei){var n=t.data.length;return new Ht(!0,n>=1,n>=2,e)}if(r===ai){var i=t.data;return new Ht(i.thisDep,i.contextDep,i.propDep,e)}return new Ht(r===ii,r===ni,r===ri,e)}function Wt(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p){function m(t){return t.replace(".","_")}function g(t,e,r){var n=m(t);et.push(t),tt[n]=$[n]=!!r,rt[n]=e}function v(t,e,r){var n=m(t);et.push(t),Array.isArray(r)?($[n]=r.slice(),tt[n]=r.slice()):$[n]=tt[n]=r,nt[n]=e}function y(){var t=Bt(),r=t.link,n=t.global;t.id=ot++,t.batchId="0";var i=r(it),a=t.shared={props:"a0"};Object.keys(it).forEach(function(t){a[t]=n.def(i,".",t)}),de.optional(function(){t.CHECK=r(de),t.commandStr=de.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},at.invalidBlendCombinations=Ua});var o=t.next={},s=t.current={};Object.keys(nt).forEach(function(t){Array.isArray($[t])&&(o[t]=n.def(a.next,".",t),s[t]=n.def(a.current,".",t))});var l=t.constants={};Object.keys(at).forEach(function(t){l[t]=n.def(JSON.stringify(at[t]))}),t.invoke=function(e,n){switch(n.type){case ei:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case ri:return e.def(a.props,n.data);case ni:return e.def(a.context,n.data);case ii:return e.def("this",n.data);case ai:return n.data.append(t,e),n.data.ref}},t.attribCache={};var c={};return t.scopeAttrib=function(t){var n=e.id(t);if(n in c)return c[n];var i=u.scope[n];return i||(i=u.scope[n]=new X),c[n]=r(i)},t}function b(t){var e,r=t.static,n=t.dynamic;if(Di in r){var i=!!r[Di];e=Gt(function(t,e){return i}),e.enable=i}else if(Di in n){var a=n[Di];e=Yt(a,function(t,e){return t.invoke(e,a)})}return e}function x(t,e){var r=t.static,n=t.dynamic;if(Pi in r){var i=r[Pi];return i?(i=s.getFramebuffer(i),de.command(i,"invalid framebuffer object"),Gt(function(t,e){var r=t.link(i),n=t.shared;e.set(n.framebuffer,".next",r);var a=n.context;return e.set(a,"."+Vi,r+".width"),e.set(a,"."+Hi,r+".height"),r})):Gt(function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+Vi,n+"."+Yi),e.set(n,"."+Hi,n+"."+Wi),"null"})}if(Pi in n){var a=n[Pi];return Yt(a,function(t,e){var r=t.invoke(e,a),n=t.shared,i=n.framebuffer,o=e.def(i,".getFramebuffer(",r,")");de.optional(function(){t.assert(e,"!"+r+"||"+o,"invalid framebuffer object")}),e.set(i,".next",o);var s=n.context;return e.set(s,"."+Vi,o+"?"+o+".width:"+s+"."+Yi),e.set(s,"."+Hi,o+"?"+o+".height:"+s+"."+Wi),o})}return null}function _(t,e,r){function n(t){if(t in i){var n=i[t];de.commandType(n,"object","invalid "+t,r.commandStr);var o,s,l=
r.profile&&i(r.profile)&&P(t,c,r,!1,!0),n)O(t,u,r,n.attributes,a),O(t,c,r,n.attributes,i),R(t,u,r,n.uniforms,a),R(t,c,r,n.uniforms,i),F(t,u,c,r);else{var h=t.global.def("{}"),f=r.shader.progVar.append(t,c),d=c.def(f,".id"),p=c.def(h,"[",d,"]");c(t.shared.gl,".useProgram(",f,".program);","if(!",p,"){",p,"=",h,"[",d,"]=",t.link(function(e){return j(U,t,r,e,2)}),"(",f,");}",p,".call(this,a0[",s,"],",s,");")}}function H(t,e){function r(t){return t.contextDep&&i||t.propDep}var n=t.proc("batch",2);t.batchId="0",D(t,n);var i=!1,a=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(L(t,n,e.context),a=!1);var o=e.framebuffer,s=!1;o?(o.propDep?i=s=!0:o.contextDep&&i&&(s=!0),s||C(t,n,o)):C(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),I(t,n,e),z(t,n,e.state,function(t){return!r(t)}),e.profile&&r(e.profile)||P(t,n,e,!1,"a1"),e.contextDep=i,e.needsContext=a,e.needsFramebuffer=s;var l=e.shader.progVar;if(l.contextDep&&i||l.propDep)V(t,n,e,null);else{var u=l.append(t,n);if(n(t.shared.gl,".useProgram(",u,".program);"),e.shader.program)V(t,n,e,e.shader.program);else{var c=t.global.def("{}"),h=n.def(u,".id"),f=n.def(c,"[",h,"]");n(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",c,"[",h,"]=",t.link(function(r){return j(V,t,e,r,2)}),"(",u,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}function q(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;L(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),Vt(Object.keys(r.state)).forEach(function(e){var n=r.state[e],o=n.append(t,i);mt(o)?o.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,o)}),P(t,i,r,!0,!0),[Fi,Bi,Ni,Ui,ji].forEach(function(e){var n=r.draw[e];n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new X).forEach(function(t){i.set(a,"."+t,n[t])})}),n(Oi),n(Ri),Object.keys(r.state).length>0&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}function G(t){if("object"==typeof t&&!mt(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(ge.isDynamic(t[e[r]]))return!0;return!1}}function Y(t,e,r){function n(t,e){o.forEach(function(r){var n=i[r];if(ge.isDynamic(n)){var a=t.invoke(e,n);e(c,".",r,"=",a,";")}})}var i=e.static[r];if(i&&G(i)){var a=t.global,o=Object.keys(i),s=!1,l=!1,u=!1,c=t.global.def("{}");o.forEach(function(e){var r=i[e];if(ge.isDynamic(r)){"function"==typeof r&&(r=i[e]=ge.unbox(r));var n=Yt(r,null);s=s||n.thisDep,u=u||n.propDep,l=l||n.contextDep}else{switch(a(c,".",e,"="),typeof r){case"number":a(r);break;case"string":a('"',r,'"');break;case"object":Array.isArray(r)&&a("[",r.join(),"]");break;default:a(t.link(r))}a(";")}}),e.dynamic[r]=new ge.DynamicVariable(ai,{thisDep:s,contextDep:l,propDep:u,ref:c,append:n}),delete e.static[r]}}function W(t,e,r,n,i){var a=y();a.stats=a.link(i),Object.keys(e.static).forEach(function(t){Y(a,e,t)}),Xi.forEach(function(e){Y(a,t,e)});var o=E(t,e,r,n,a);return B(a,o),q(a,o),H(a,o),a.compile()}var X=u.Record,Z={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(Z.min=Ca,Z.max=Ia);var K=r.angle_instanced_arrays,Q=r.webgl_draw_buffers,$={dirty:!0,profile:p.profile},tt={},et=[],rt={},nt={};g(oi,ea),g(si,ta),v(li,"blendColor",[0,0,0,0]),v(ui,"blendEquationSeparate",[Ra,Ra]),v(ci,"blendFuncSeparate",[Oa,Pa,Oa,Pa]),g(hi,na,!0),v(fi,"depthFunc",Fa),v(di,"depthRange",[0,1]),v(pi,"depthMask",!0),v(mi,mi,[!0,!0,!0,!0]),g(gi,$i),v(vi,"cullFace",Sa),v(yi,yi,La),v(bi,bi,1),g(xi,aa),v(_i,"polygonOffset",[0,0]),g(wi,oa),g(Mi,sa),v(ki,"sampleCoverage",[1,!1]),g(Ai,ra),v(Ti,"stencilMask",-1),v(Si,"stencilFunc",[za,0,-1]),v(Ei,"stencilOpSeparate",[Ta,Da,Da,Da]),v(Li,"stencilOpSeparate",[Sa,Da,Da,Da]),g(Ci,ia),v(Ii,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),v(zi,zi,[0,0,t.dra
510:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;i(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;c<r;++c){i(t[c],e,l);var h=s[1];a(h,l[0],s),s[0]&&(o[u++]=s[0]);var f=l[1],d=s[1],p=f+d,m=p-f,g=d-m;s[1]=p,g&&(o[u++]=g)}return s[1]&&(o[u++]=s[1]),0===u&&(o[u++]=0),o.length=u,o}var i=t("two-product"),a=t("two-sum");e.exports=n},{"two-product":539,"two-sum":540}],511:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],h=Math.min(u,c);if(Math.max(u,c)<s||l<h)return!1}return!0}function i(t,e,r,i){var o=a(t,r,i),s=a(e,r,i);if(o>0&&s>0||o<0&&s<0)return!1;var l=a(r,t,e),u=a(i,t,e);return!(l>0&&u>0||l<0&&u<0)&&(0!==o||0!==s||0!==l||0!==u||n(t,e,r,i))}e.exports=i;var a=t("robust-orientation")[3]},{"robust-orientation":508}],512:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=-e[h],g=f(m);p<g?(o=d,(c+=1)<r&&(d=t[c],p=f(d))):(o=m,(h+=1)<i&&(m=-e[h],g=f(m))),c<r&&p<g||h>=i?(a=d,(c+=1)<r&&(d=t[c],p=f(d))):(a=m,(h+=1)<i&&(m=-e[h],g=f(m)));for(var v,y,b,x,_,w=a+o,M=w-a,k=o-M,A=k,T=w;c<r&&h<i;)p<g?(a=d,(c+=1)<r&&(d=t[c],p=f(d))):(a=m,(h+=1)<i&&(m=-e[h],g=f(m))),o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),v=T+w,y=v-T,b=v-y,x=w-y,_=T-b,A=_+x,T=v;for(;c<r;)a=d,o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),v=T+w,y=v-T,b=v-y,x=w-y,_=T-b,A=_+x,T=v,(c+=1)<r&&(d=t[c]);for(;h<i;)a=m,o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),v=T+w,y=v-T,b=v-y,x=w-y,_=T-b,A=_+x,T=v,(h+=1)<i&&(m=-e[h]);return A&&(l[u++]=A),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],513:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=e[h],g=f(m);p<g?(o=d,(c+=1)<r&&(d=t[c],p=f(d))):(o=m,(h+=1)<i&&(m=e[h],g=f(m))),c<r&&p<g||h>=i?(a=d,(c+=1)<r&&(d=t[c],p=f(d))):(a=m,(h+=1)<i&&(m=e[h],g=f(m)));for(var v,y,b,x,_,w=a+o,M=w-a,k=o-M,A=k,T=w;c<r&&h<i;)p<g?(a=d,(c+=1)<r&&(d=t[c],p=f(d))):(a=m,(h+=1)<i&&(m=e[h],g=f(m))),o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),v=T+w,y=v-T,b=v-y,x=w-y,_=T-b,A=_+x,T=v;for(;c<r;)a=d,o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),v=T+w,y=v-T,b=v-y,x=w-y,_=T-b,A=_+x,T=v,(c+=1)<r&&(d=t[c]);for(;h<i;)a=m,o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),v=T+w,y=v-T,b=v-y,x=w-y,_=T-b,A=_+x,T=v,(h+=1)<i&&(m=e[h]);return A&&(l[u++]=A),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],514:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ShelfPack=i()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=1+(0|this.stats[t])}}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,n,i,a=[],o=0;o<t.length;o++)if(r=t[o].w||t[o].width,n=t[o].h||t[o].height,r&&n){if(!(i=this.packOne(r,n)))continue;e.inPlace&&(t[o].x=i.x,t[o].y=i.y),a.push(i)}if(this.shelves.length>0){for(var s=0,l=0,u=0;u<this.shelves.length;u++){var c=this.shelves[u];l+=c.h,s=Math.max(c.w-c.free,s)}this.resize(s,l)}return a},t.prototype.packOne=function(t,r){for(var n,i,a=0,o={shelf:-1,waste:1/0},s=0;s<this.shelves.length;s++){if(n=this.shelves[s],a+=n.h,r===n.h&&t<=n.free)return this.count(r),n.alloc(t,r);r>n.h||t>n.free||r<n.h&&t<=n.free&&(i=n.h-r)<o.waste&&(o.waste=i,o.shelf=s)}if(-1!==o.shelf)return n=this.shelves[o.shelf],this.count(r),n.alloc(t,r);if(r<=this.h-a&&t<=this.w)return n=new e(a,this.w,r),this.shelves.push(n),this.count(r),n.alloc(t,r);if(this.autoResize){var l,u,c,h;return l=u=this.h,c=h=this.w,(c<=l||t>c)&&(h=2*Math.max(t,c)),(l<c||r>l)&&(u=2*Math.max(r,l)),this.resize(h,u),this.pa
for(;n[s+1]<a;)s++;e[a]=(a-r[s])*(a-r[s])+t[r[s]]}}e.exports=n;var o=1e20;n.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=e.data,n=0;n<this.size*this.size;n++){var a=r[4*n+3]/255;this.gridOuter[n]=1===a?0:0===a?o:Math.pow(Math.max(0,.5-a),2),this.gridInner[n]=1===a?o:0===a?0:Math.pow(Math.max(0,a-.5),2)}for(i(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),i(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var s=this.gridOuter[n]-this.gridInner[n],l=Math.max(0,Math.min(255,Math.round(255-255*(s/this.radius+this.cutoff))));r[4*n+0]=l,r[4*n+1]=l,r[4*n+2]=l,r[4*n+3]=255}return e}},{}],534:[function(e,r,n){!function(e){function n(t,e){if(t=t||"",e=e||{},t instanceof n)return t;if(!(this instanceof n))return new n(t,e);var r=i(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=V(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=V(this._r)),this._g<1&&(this._g=V(this._g)),this._b<1&&(this._b=V(this._b)),this._ok=r.ok,this._tc_id=U++}function i(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,o=null,l=!1,c=!1;return"string"==typeof t&&(t=F(t)),"object"==typeof t&&(R(t.r)&&R(t.g)&&R(t.b)?(e=a(t.r,t.g,t.b),l=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):R(t.h)&&R(t.s)&&R(t.v)?(n=D(t.s),i=D(t.v),e=u(t.h,n,i),l=!0,c="hsv"):R(t.h)&&R(t.s)&&R(t.l)&&(n=D(t.s),o=D(t.l),e=s(t.h,n,o),l=!0,c="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=T(r),{ok:l,format:t.format||c,r:H(255,q(e.r,0)),g:H(255,q(e.g,0)),b:H(255,q(e.b,0)),a:r}}function a(t,e,r){return{r:255*S(t,255),g:255*S(e,255),b:255*S(r,255)}}function o(t,e,r){t=S(t,255),e=S(e,255),r=S(r,255);var n,i,a=q(t,e,r),o=H(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,l:s}}function s(t,e,r){function n(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;if(t=S(t,360),e=S(e,100),r=S(r,100),0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function l(t,e,r){t=S(t,255),e=S(e,255),r=S(r,255);var n,i,a=q(t,e,r),o=H(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function u(t,r,n){t=6*S(t,360),r=S(r,100),n=S(n,100);var i=e.floor(t),a=t-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),u=i%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}function c(t,e,r,n){var i=[z(V(t).toString(16)),z(V(e).toString(16)),z(V(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function h(t,e,r,n,i){var a=[z(V(t).toString(16)),z(V(e).toString(16)),z(V(r).toString(16)),z(P(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function f(t,e,r,n){return[z(P(n)),z(V(t).toString(16)),z(V(e).toString(16)),z(V(r).toString(16))].join("")}function d(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s-=e/100,r.s=E(r.s),n(r)}function p(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s+=e/100,r.s=E(r.s),n(r)}function m(t){return n(t).desaturate(100)}function g(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l+=e/100,r.l=E(r.l),n(r)}function v(t,e){e=0===e?0:e||10;var r=n(t).toRgb();return r.r=q(0,H(255,r.r-V(-e/100*255))),r.g=q(0,H(255,r.g-V(-e/100*255))),r.b=q(0,H(255,r.b-V(-e/100*255))),n(r)}function y(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l-=e/100,r.l=E(r.l),n(r)}function b(t,e){var r=n(t).toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,n(r)}function x(t){var e=n(t).toHsl();return e.h=(e.h+180)%
if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return u(t);case"int8":return c(t);case"int16":return h(t);case"int32":return f(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return m(t);case"buffer":return v(t);case"data":case"dataview":return g(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=h,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=m,r.mallocDataView=g,r.mallocBuffer=v,r.clearCache=function(){for(var t=0;t<32;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,M[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":67,buffer:77,dup:125}],542:[function(t,e,r){"use strict";"use restrict";function n(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}e.exports=n;var i=n.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,r=this.roots;r[t]!==t;)t=r[t];for(;r[e]!==t;){var n=r[e];r[e]=t,e=n}return t},i.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},{}],543:[function(t,e,r){"use strict";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;o<n;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;a<r;++a,i=n)if(i=n,(n=t[a])!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],544:[function(t,e,r){function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}e.exports=n,n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){void 0===e&&(e=1e-6);var r,n,i,a,o;for(i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if(r=0,n=1,(i=t)<r)return r;if(i>n)return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],545:[function(t,e,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&u.isObject(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}function a(t){return u.isString(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)}function o(t,e){return i(t,!1,!0).resolve(e)}function s(t,e){return t?i(t,!1,!0).resolveObject(e):e}var l=t("punycode"),u=t("./util");r.parse=i,r.resolve=o,r.resolveObject=s,r.format=a,r.Url=n;var c=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"goph
;var l,u=new s,c=void 0,h=!1;return l=o?function(t,e){return u.set(t,e),u.has(t)||(c||(c=new x),c.set(t,e)),this}:function(t,e){if(h)try{u.set(t,e)}catch(r){c||(c=new x),c.set___(t,e)}else u.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(e)},has___:{value:i(r)},set___:{value:i(l)},delete___:{value:i(n)},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");h=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],560:[function(t,e,r){function n(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:i(e,t)}}var i=t("./hidden-store.js");e.exports=n},{"./hidden-store.js":561}],561:[function(t,e,r){function n(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}e.exports=n},{}],562:[function(t,e,r){function n(){var t=i();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}var i=t("./create-store.js");e.exports=n},{"./create-store.js":560}],563:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":147}],564:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),u=0,c=l.length;u<c;u++){var h=l[u],f=a[h].exports;if(f===t||f&&f.default===t){s=h;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var d={},u=0,c=l.length;u<c;u++){var h=l[u];d[h]=h}i[s]=[Function(["require","module","exports"],"("+t+")(self)"),d]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[s]=s,i[p]=[Function(["require"],"var f = require("+ o(s) +");(f.default ? f.default : f)(self);"),m];var g={};r(p);var v="("+n+")({"+Object.keys(g).map(function(t){return o(t)+":["+i[t][0]+","+o(i[t][1])+"]"}).join(",")+"},{},["+o(p)+"])",y=window.URL||window.webkitURL||window.mozURL||window.msURL,b=new Blob([v],{type:"text/javascript"});if(e&&e.bare)return b;var x=y.createObjectURL(b),_=new Worker(x);return _.objectURL=x,_}},{}],565:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],566:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.WhooTS=e.WhooTS||{})}(this,function(t){function e(t,e,n,i,a,o){return o=o||{},t+"?"+["bbox="+r(n,i,a),"format="+(o.format||"image/png"),"service="+(o.service||"WMS"),"version="+(o.version||"1.1.1"),"request="+(o.request||"GetMap"),"srs="+(o.srs||"EPSG:3857"),"width="+(o.width||256),"height="+(o.height||256),"layers="+e].join("&")}function r(t,e,r){e=Math.pow(2,r)-e-1;var i=n(256*t,256*e,r),a=n(256*(t+1),256*(e+1),r);return i[0]+","+i[1]+","+a[0]+","+a[1]}function n(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}t.getURL=e,t.getTileBBox=r,t.getMercCoords=n,Object.defineProperty(t,"__esModule",{value:!0})})},{}],567:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=p[i.year-p[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-
s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance(),r=e.fromJD(t),n=r.year(),a=r.dayOfYear(),o=n+56;this._createMissingCalendarData(o);for(var s=9,l=this.NEPALI_CALENDAR_DATA[o][0],u=this.NEPALI_CALENDAR_DATA[o][s]-l+1;a>u;)s++,s>12&&(s=1,o++),u+=this.NEPALI_CALENDAR_DATA[o][s];var c=this.NEPALI_CALENDAR_DATA[o][s]-(u-a);return this.newDate(o,s,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r<t+2;r++)void 0===this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=e)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30
return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),l(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(
fill:i.rgb(r.arrowcolor),"stroke-width":0}))}var l,u,c,h,f=t.node(),d=a[r.arrowhead||0],p=(r.arrowwidth||1)*r.arrowsize,m=e.indexOf("start")>=0,g=e.indexOf("end")>=0,v=d.backoff*p+r.standoff;if("line"===f.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var y=l.x-u.x,b=l.y-u.y;if(c=Math.atan2(b,y),h=c+Math.PI,v){if(v*v>y*y+b*b)return void o();var x=v*Math.cos(c),_=v*Math.sin(c);m&&(l.x-=x,l.y-=_,t.attr({x1:l.x,y1:l.y})),g&&(u.x+=x,u.y+=_,t.attr({x2:u.x,y2:u.y}))}}else if("path"===f.nodeName){var w=f.getTotalLength(),M="";if(w<v)return void o();if(m){var k=f.getPointAtLength(0),A=f.getPointAtLength(.1);c=Math.atan2(k.y-A.y,k.x-A.x),l=f.getPointAtLength(Math.min(v,w)),v&&(M="0px,"+v+"px,")}if(g){var T=f.getPointAtLength(w),S=f.getPointAtLength(w-.1);if(h=Math.atan2(T.y-S.y,T.x-S.x),u=f.getPointAtLength(Math.max(0,w-v)),v){var E=M?2*v:v;M+=w-E+"px,"+w+"px"}}else M&&(M+=w+"px");M&&t.style("stroke-dasharray",M)}m&&s(l,c),g&&s(u,h)}},{"../color":604,"./arrow_paths":586,d3:122}],595:[function(t,e,r){"use strict";var n=t("./draw"),i=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:i.hasClickToShow,onClick:i.onClick,convertCoords:t("./convert_coords")}},{"./attributes":587,"./calc_autorange":588,"./click":589,"./convert_coords":591,"./defaults":592,"./draw":593}],596:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../plot_api/edit_types").overrideAll;e.exports=i({_isLinkedToArray:"annotation",visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,arrowsize:n.arrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents},"calc","from-root")},{"../../plot_api/edit_types":756,"../annotations/attributes":587}],597:[function(t,e,r){"use strict";function n(t,e){var r=e.fullSceneLayout,n=r.domain,o=e.fullLayout._size,s={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},i.extendFlat(t._xa,s),a.setConvert(t._xa),t._xa._offset=o.l+n.x[0]*o.w,t._xa.l2p=function(){return.5*(1+t.pdata[0]/t.pdata[3])*o.w*(n.x[1]-n.x[0])},t._ya={},i.extendFlat(t._ya,s),a.setConvert(t._ya),t._ya._offset=o.t+(1-n.y[1])*o.h,t._ya.l2p=function(){return.5*(1-t.pdata[1]/t.pdata[3])*o.h*(n.y[1]-n.y[0])}}var i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t){for(var e=t.fullSceneLayout,r=e.annotations,i=0;i<r.length;i++)n(r[i],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":728,"../../plots/cartesian/axes":772}],598:[function(t,e,r){"use strict";function n(t,e,r,n,o){function u(r,n){return i.coerce(t,e,l,r,n)}function c(t){var n=t+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(e,i,u,t,t,.5)}return u("visible",!o.itemIsNotPlainObject)?(s(t,e,n.fullLayout,u),c("x"),c("y"),c("z"),i.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",u("xanchor"),u("yanchor"),u("xshift"),u("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",u("ax",-10),u("ay",-30),i.noneOrAll(t,e,["ax","ay"])),e):e}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/array_container_defaults"),s=t("../annotations/common_defaults"),l=t("./attributes");e.exports=function(t,e,r){o(t,e,{name:"annotations",handleItemDefaults:n,fullLayout:r.fullLayout})}},{"../../lib":728,"../../plots/array_container_defaults":769,"../../plots/cartesian/axes":772,"../annotations/common_defaults":590,"./attributes":596}],599:[function(t,e,r){"use strict";var n=t("../annotations/draw").dr
Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],623:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}},{}],624:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":728}],625:[function(t,e,r){"use strict";function n(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function i(t){t._dragging=!1,t._replotPending&&l.plot(t)}function a(t){return o(t.changedTouches?t.changedTouches[0]:t,document.body)}var o=t("mouse-event-offset"),s=t("has-hover"),l=t("../../plotly"),u=t("../../lib"),c=t("../../plots/cartesian/constants"),h=t("../../constants/interactions"),f=e.exports={};f.align=t("./align"),f.getCursor=t("./cursor");var d=t("./unhover");f.unhover=d.wrapped,f.unhoverRaw=d.raw,f.init=function(t){function e(e){if(!e.buttons||2!==e.buttons){y._dragged=!1,y._dragging=!0;var i=a(e);return l=i[0],d=i[1],v=e.target,p=(new Date).getTime(),p-y._mouseDownTime<x?b+=1:(b=1,y._mouseDownTime=p),t.prepFn&&t.prepFn(e,l,d),s?(g=n(),g.style.cursor=window.getComputedStyle(_).cursor):(g=document,m=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(_).cursor),document.addEventListener("mousemove",r),document.addEventListener("mouseup",o),document.addEventListener("touchmove",r),document.addEventListener("touchend",o),u.pauseEvent(e)}}function r(e){var r=a(e),n=r[0]-l,i=r[1]-d,o=t.minDrag||c.MINDRAG;return Math.abs(n)<o&&(n=0),Math.abs(i)<o&&(i=0),(n||i)&&(y._dragged=!0,f.unhover(y)),t.moveFn&&t.moveFn(n,i,y._dragged),u.pauseEvent(e)}function o(e){if(document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",o),s?u.removeElement(g):m&&(g.documentElement.style.cursor=m,m=null),!y._dragging)return void(y._dragged=!1);if(y._dragging=!1,(new Date).getTime()-y._mouseDownTime>x&&(b=Math.max(b-1,1)),t.doneFn&&t.doneFn(y._dragged,b,e),!y._dragged){var n;try{n=new MouseEvent("click",e)}catch(t){var l=a(e);n=document.createEvent("MouseEvents"),n.initMouseEvent("click",e.bubble
;i<=r.distance&&(r.index=n,r.distance=i)}return r},r.inbox=function(t,e){return t*e<0||0===t?a.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0},r.appendArrayPointValue=function(t,e,r){var n=e._arrayAttrs;if(n)for(var a=0;a<n.length;a++){var o,s=n[a];if(o="ids"===s?"id":"locations"===s?"location":s,void 0===t[o]){var l=i.nestedProperty(e,s).get();Array.isArray(r)?Array.isArray(l)&&Array.isArray(l[r[0]])&&(t[o]=l[r[0]][r[1]]):t[o]=l[r]}}}},{"../../lib":728,"./constants":640}],643:[function(t,e,r){"use strict";function n(t,e,r,n){if(("pie"===r||"sankey"===r)&&!n)return void t.emit("plotly_hover",{event:e.originalEvent,points:[e]});r||(r="xy");var f=Array.isArray(r)?r:[r],m=t._fullLayout,v=m._plots||[],k=v[r];if(k){var A=k.overlays.map(function(t){return t.id});f=f.concat(A)}for(var T=f.length,S=new Array(T),E=new Array(T),L=0;L<T;L++){var C=f[L],I=v[C];if(I)S[L]=x.getFromId(t,I.xaxis._id),E[L]=x.getFromId(t,I.yaxis._id);else{var z=m[C]._subplot;S[L]=z.xaxis,E[L]=z.yaxis}}var D=e.hovermode||m.hovermode;if(-1===["x","y","closest"].indexOf(D)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return b.unhoverRaw(t,e);var P,O,R,F,j,N,B,U,V,H,q,G,Y,W=[],X=[];if(Array.isArray(e))for(D="array",R=0;R<e.length;R++)j=t.calcdata[e[R].curveNumber||0],"skip"!==j[0].trace.hoverinfo&&X.push(j);else{for(F=0;F<t.calcdata.length;F++)j=t.calcdata[F],N=j[0].trace,"skip"!==N.hoverinfo&&-1!==f.indexOf(w.getSubplot(N))&&X.push(j);var Z,J,K=!e.target;if(K)Z="xpx"in e?e.xpx:S[0]._length/2,J="ypx"in e?e.ypx:E[0]._length/2;else{if(!1===p.triggerHandler(t,"plotly_beforehover",e))return;var Q=e.target.getBoundingClientRect();if(Z=e.clientX-Q.left,J=e.clientY-Q.top,Z<0||Z>Q.width||J<0||J>Q.height)return b.unhoverRaw(t,e)}if(P="xval"in e?w.flat(f,e.xval):w.p2c(S,Z),O="yval"in e?w.flat(f,e.yval):w.p2c(E,J),!h(P[0])||!h(O[0]))return d.warn("Fx.hover failed",e,t),b.unhoverRaw(t,e)}var $=1/0;for(F=0;F<X.length;F++)if((j=X[F])&&j[0]&&j[0].trace&&!0===j[0].trace.visible&&(N=j[0].trace,-1===["carpet","contourcarpet"].indexOf(N._module.name))){if(B=w.getSubplot(N),U=f.indexOf(B),V=D,G={cd:j,trace:N,xa:S[U],ya:E[U],index:!1,distance:Math.min($,M.MAXDIST),color:y.defaultLine,name:N.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},m[B]&&(G.subplot=m[B]._subplot),Y=W.length,"array"===V){var tt=e[F];"pointNumber"in tt?(G.index=tt.pointNumber,V="closest"):(V="","xval"in tt&&(H=tt.xval,V="x"),"yval"in tt&&(q=tt.yval,V=V?"closest":"y"))}else H=P[U],q=O[U];if(N._module&&N._module.hoverPoints){var et=N._module.hoverPoints(G,H,q,V);if(et)for(var rt,nt=0;nt<et.length;nt++)rt=et[nt],h(rt.x0)&&h(rt.y0)&&W.push(s(rt,D))}else d.log("Unrecognized trace type in hover:",N);"closest"===D&&W.length>Y&&(W.splice(0,Y),$=W[0].distance)}if(0===W.length)return b.unhoverRaw(t,e);W.sort(function(t,e){return t.distance-e.distance});var it=t._hoverdata,at=[];for(R=0;R<W.length;R++){var ot=W[R],st={data:ot.trace._input,fullData:ot.trace,curveNumber:ot.trace.index,pointNumber:ot.index};ot.trace._module.eventData?st=ot.trace._module.eventData(st,ot):(st.x=ot.xVal,st.y=ot.yVal,st.xaxis=ot.xa,st.yaxis=ot.ya,void 0!==ot.zLabelVal&&(st.z=ot.zLabelVal)),w.appendArrayPointValue(st,ot.trace,ot.index),at.push(st)}if(t._hoverdata=at,u(t,e,it)&&m._hasCartesian){l(W,{hovermode:D,fullLayout:m,container:m._hoverlayer,outerContainer:m._paperdiv})}var lt="y"===D&&X.length>1,ut=y.combine(m.plot_bgcolor||y.background,m.paper_bgcolor),ct={hovermode:D,rotateLabels:lt,bgColor:ut,container:m._hoverlayer,outerContainer:m._paperdiv,commonLabelOpts:m.hoverlabel},ht=i(W,ct,t);if(a(W,lt?"xa":"ya"),o(ht,lt),e.target&&e.target.tagName){var ft=_.getComponentMethod("annotations","hasClickToShow")(t,at);g(c.select(e.target),ft?"pointer":"")}e.target&&!n&&u(t,e,it)&&(it&&t.emit("plotly_unhover",{event:e,points:it}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:P,yvals:O}))}function i(t,e,r){var n,i,a=e.hovermode,o=e.rotateLabels,s=e.bgColor,l=e.container,u=e.outerContainer,h=e.commonLabelOpts||{},f=e.fontFamily||M.HOVERFONT,d=e.fontSize|
;z.enter().append("g").attr("class","traces"),z.exit().remove(),z.call(M,t).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(i,t)});var D=0!==k.enter().size();D&&(o(t,I,z),s(t));var P=r.width,O=r.height;o(t,I,z),v.height>O?l(t):s(t);var R=r._size,F=R.l+R.w*v.x,j=R.t+R.h*(1-v.y);A.isRightAnchor(v)?F-=v.width:A.isCenterAnchor(v)&&(F-=v.width/2),A.isBottomAnchor(v)?j-=v.height:A.isMiddleAnchor(v)&&(j-=v.height/2);var N=v.width,B=R.w;N>B?(F=R.l,N=B):(F+N>P&&(F=P-N),F<0&&(F=0),N=Math.min(P-F,v.width));var U=v.height,V=R.h;U>V?(j=R.t,U=V):(j+U>O&&(j=O-U),j<0&&(j=0),U=Math.min(O-j,v.height)),m.setTranslate(k,F,j);var H,q,G=U-b.scrollBarHeight-2*b.scrollBarMargin,Y=v.height-U;if(v.height<=U||t._context.staticPlot)E.attr({width:N-v.borderwidth,height:U-v.borderwidth,x:v.borderwidth/2,y:v.borderwidth/2}),m.setTranslate(L,0,0),S.select("rect").attr({width:N-2*v.borderwidth,height:U-2*v.borderwidth,x:v.borderwidth,y:v.borderwidth}),L.call(m.setClipUrl,a);else{H=b.scrollBarMargin,q=L.attr("data-scroll")||0,E.attr({width:N-2*v.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-v.borderwidth,x:v.borderwidth/2,y:v.borderwidth/2}),S.select("rect").attr({width:N-2*v.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-2*v.borderwidth,x:v.borderwidth,y:v.borderwidth-q}),L.call(m.setClipUrl,a),D&&e(H,q),k.on("wheel",null),k.on("wheel",function(){q=h.constrain(L.attr("data-scroll")-u.event.deltaY/G*Y,-Y,0),H=b.scrollBarMargin-q/Y*G,e(H,q),0!==q&&q!==-Y&&u.event.preventDefault()}),C.on(".drag",null),L.on(".drag",null);var W=u.behavior.drag().on("drag",function(){H=h.constrain(u.event.y-b.scrollBarHeight/2,b.scrollBarMargin,b.scrollBarMargin+G),q=-(H-b.scrollBarMargin)/G*Y,e(H,q)});C.call(W),L.call(W)}if(t._context.edits.legendPosition){var X,Z,J,K;k.classed("cursor-move",!0),p.init({element:k.node(),gd:t,prepFn:function(){var t=m.getTranslate(k);J=t.x,K=t.y},moveFn:function(t,e){var r=J+t,n=K+e;m.setTranslate(k,r,n),X=p.align(r,0,R.l,R.l+R.w,v.xanchor),Z=p.align(n,0,R.t+R.h,R.t,v.yanchor)},doneFn:function(e,n,i){if(e&&void 0!==X&&void 0!==Z)c.relayout(t,{"legend.x":X,"legend.y":Z});else{var a=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});a.size()>0&&(1===n?k._clickTimeout=setTimeout(function(){y(a,t,n)},T):2===n&&(k._clickTimeout&&clearTimeout(k._clickTimeout),y(a,t,n)))}}})}}}},{"../../constants/alignment":701,"../../constants/interactions":706,"../../lib":728,"../../lib/svg_text_utils":750,"../../plotly":767,"../../plots/plots":831,"../../registry":846,"../color":604,"../dragelement":625,"../drawing":628,"./anchor_utils":654,"./constants":656,"./get_legend_data":659,"./handle_click":660,"./helpers":661,"./style":663,d3:122}],659:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),u=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+h;l.push(n),s[n]=[[r]],h++}}var a,o,s={},l=[],u=!1,c={},h=0;for(a=0;a<t.length;a++){var f=t[a],d=f[0],p=d.trace,m=p.legendgroup;if(i.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,"pie"))for(c[m]||(c[m]={}),o=0;o<f.length;o++){var g=f[o].label;c[m][g]||(r(m,{label:g,color:f[o].color,i:f[o].i,trace:p}),c[m][g]=!0)}else r(m,d)}if(!l.length)return[];var v,y,b=l.length;if(u&&i.isGrouped(e))for(y=new Array(b),a=0;a<b;a++)v=s[l[a]],y[a]=i.isReversed(e)?v.reverse():v;else{for(y=[new Array(b)],a=0;a<b;a++)v=s[l[a]][0],y[0][i.isReversed(e)?b-a-1:a]=v;b=1}return e._lgroupsLength=b,y}},{"../../registry":846,"./helpers":661}],660:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../lib"),a=t("../../registry"),o=!0;e.exports=function(t,e,r){function s(t,e,r){var n=_.indexOf(t),i=x[e];return i||(i=x[e]=[]),-1===_.indexOf(t)&&(_.push(t),n=_.length-1),i[n]=r,n}function l(t,e){var r=t._fullInput;if(a.hasTransform(r,"groupby")){var n=w[r.index]
o._input.range=o.range=n.getAutoRange(a))}}},{"../../plots/cartesian/axes":772,"./constants":677}],677:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskColor:"rgba(0,0,0,0.4)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],678:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(t,e){return n.coerce(o,l,i,t,e)}if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var o=t[r].rangeslider,s=e[r],l=s.rangeslider={};if(a("visible")){if(a("bgcolor",e.plot_bgcolor),a("bordercolor"),a("borderwidth"),a("thickness"),a("autorange",!s.isValidRange(o.range)),a("range"),l.range){var u=l.range,c=s.range;u[0]=s.l2r(Math.min(s.r2l(u[0]),s.r2l(c[0]))),u[1]=s.l2r(Math.max(s.r2l(u[1]),s.r2l(c[1])))}s.cleanRange("rangeslider.range"),l._input=o}}}},{"../../lib":728,"./attributes":675}],679:[function(t,e,r){"use strict";function n(t){var e=w.list({_fullLayout:t},"x",!0),r=A.name,n=[];if(t._has("gl2d"))return n;for(var i=0;i<e.length;i++){var a=e[i];a[r]&&a[r].visible&&n.push(a)}return n}function i(t,e,r,n){var i=t.select("rect."+A.slideBoxClassName).node(),o=t.select("rect."+A.grabAreaMinClassName).node(),s=t.select("rect."+A.grabAreaMaxClassName).node();t.on("mousedown",function(){function l(l){var u,c,y,b=+l.clientX-f;switch(h){case i:y="ew-resize",u=p+b,c=g+b;break;case o:y="col-resize",u=p+b,c=g;break;case s:y="col-resize",u=p,c=g+b;break;default:y="ew-resize",u=d,c=d+b}if(c<u){var x=c;c=u,u=x}n._pixelMin=u,n._pixelMax=c,k(m.select(v),y),a(t,e,r,n)}function u(){v.removeEventListener("mousemove",l),v.removeEventListener("mouseup",u),y.removeElement(v)}var c=m.event,h=c.target,f=c.clientX,d=f-t.node().getBoundingClientRect().left,p=n.d2p(r._rl[0]),g=n.d2p(r._rl[1]),v=M.coverSlip();v.addEventListener("mousemove",l),v.addEventListener("mouseup",u)})}function a(t,e,r,n){function i(t){return r.l2r(y.constrain(t,n._rl[0],n._rl[1]))}var a=i(n.p2d(n._pixelMin)),o=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){g.relayout(e,r._name+".range",[a,o])})}function o(t,e,r,n){function i(t){return y.constrain(t,0,n._width)}function a(t){return y.constrain(t,-o,n._width+o)}var o=A.handleWidth/2,s=i(n.d2p(r._rl[0])),l=i(n.d2p(r._rl[1]));t.select("rect."+A.slideBoxClassName).attr("x",s).attr("width",l-s),t.select("rect."+A.maskMinClassName).attr("width",s),t.select("rect."+A.maskMaxClassName).attr("x",l).attr("width",n._width-l);var u=Math.round(a(s-o))-.5,c=Math.round(a(l-o))+.5;t.select("g."+A.grabberMinClassName).attr("transform","translate("+u+",0.5)"),t.select("g."+A.grabberMaxClassName).attr("transform","translate("+c+",0.5)")}function s(t,e,r,n){var i=t.selectAll("rect."+A.bgClassName).data([0]);i.enter().append("rect").classed(A.bgClassName,!0).attr({x:0,y:0,"shape-rendering":"crispEdges"});var a=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,o=-n._offsetShift,s=b.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:"translate("+o+","+o+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":s})}function l(t,e,r,n){var i=e._fullLayout,a=i._topdefs.selectAll("#"+n._clipId).data([0]);a.enter().append("clipPath").attr("id",n._clipId).append("rect").attr({x:0,y:0}),a.select("rect").attr({width:n._width,height:n._height})}function u(t,e,r,n){var i=w.getSubplots(e,r),a=e.calcdata,o=t.selectAll("g."+A.rangePlotClassName).data(i,y.identity);o.enter().append("g").attr("class",fun
return e.attr("transform",M?"rotate("+[M.rotate,w.x,w.y]+") translate(0, "+M.offset+")":null),e.style({"font-family":T,"font-size":n.round(S,2)+"px",fill:u.rgb(E),opacity:L*u.opacity(E),"font-weight":o.fontWeight}).attr(w).call(c.convertToTspans,t),o.previousPromises(t)}function m(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&I){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,u=i(_.pad)?_.pad:2,c=l.bBox(e.node()),h={left:0,top:0,right:A.width,bottom:A.height},f=_.maxShift||(h[_.side]-c[_.side])*("left"===_.side||"top"===_.side?-1:1);if(f<0)r=f;else{var d=_.offsetLeft||0,p=_.offsetTop||0;c.left-=d,c.right-=d,c.top-=p,c.bottom-=p,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,o*(t[_.side]-c[a])+u))}),r=Math.min(f,r)}if(r>0||f<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,b=r.traceIndex,x=r.dfltName,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,A=t._fullLayout,T=v.titlefont.family,S=v.titlefont.size,E=v.titlefont.color,L=1,C=!1,I=v.title.trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var z=t._context.edits[g];""===I&&(L=0),I.match(f)&&(L=.2,C=!0,z||(I=""));var D=I||z;k||(k=A._infolayer.selectAll(".g-"+e).data([0]),k.enter().append("g").classed("g-"+e,!0));var P=k.selectAll("text").data(D?[0]:[]);if(P.enter().append("text"),P.text(I).attr("class",e),P.exit().remove(),D){P.call(d);var O="Click to enter "+x+" title";z&&(I?P.on(".opacity",null):function(){L=0,C=!0,I=O,P.text(I).on("mouseover.opacity",function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})}(),P.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)})),P.classed("js-placeholder",C)}}},{"../../constants/interactions":706,"../../lib":728,"../../lib/svg_text_utils":750,"../../plotly":767,"../../plots/plots":831,"../color":604,"../drawing":628,d3:122,"fast-isnumeric":131}],695:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:l,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":717,"../../plot_api/edit_types":756,"../../plots/font_attributes":796,"../../plots/pad_attributes":830,"../color/attributes":603}],696:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",
;"y"===r?f=O(m):"m"===r?f=R(m):"d"===r?(a=O(m),f=F(m)):(a=j(m),f=s(t,r))}return f+(a?"\n"+a:"")};var N=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=m(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+N);return l.setUTCMonth(l.getUTCMonth()+e)+i-N},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c<t.length;c++)if(i=t[c],d(i)){if(!(i%y))if(u)try{r=u.fromJD(i/y+w),1===r.day()?1===r.month()?a++:o++:s++}catch(t){}else r=new Date(i),1===r.getUTCDate()?0===r.getUTCMonth()?a++:o++:s++}else l++;o+=a,s+=o;var h=t.length-l;return{exactYears:a/h,exactMonths:o/h,exactDays:s/h}}},{"../constants/numerical":707,"../registry":846,"./loggers":732,"./mod":734,d3:122,"fast-isnumeric":131}],715:[function(t,e,r){"use strict";e.exports=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t}},{}],716:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,i){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,i),e.emit(n,i),r.emit(n,i)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;l<o.length;l++)o[l](r);return i=s(r),void 0!==n?n:i},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=i},{events:129}],717:[function(t,e,r){"use strict";function n(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}function i(t,e,r,s){var l,u,c,h,f,d,p=t[0],m=t.length;if(2===m&&o(p)&&o(t[1])&&0===p.length){if(n(t[1],p))return p;p.splice(0,p.length)}for(var g=1;g<m;g++){l=t[g];for(u in l)c=p[u],h=l[u],s&&o(h)?p[u]=h:e&&h&&(a(h)||(f=o(h)))?(f?(f=!1,d=c&&o(c)?c:[]):d=c&&a(c)?c:{},p[u]=i([d,h],e,r,s)):(void 0!==h||r)&&(p[u]=h)}return p}var a=t("./is_plain_object.js"),o=Array.isArray;r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":730}],718:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,i=0;i<t.length;i++){var a=t[i];1!==e[a]&&(e[a]=1,r[n++]=a)}return r}},{}],719:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];!0===n.visible&&e.push(n)}return e}},{}],720:[function(t,e,r){"use strict";function n(t,e){return(0,l[t])(e)}function i(t){for(var e=0;e<s.length;e++){var r=s[e];if(new RegExp(a[r]).test(t.trim().toLowerCase()))return r}return o.warn("Unrecognized country name: "+t+"."),!1}var a=t("country-regex"),o=t("../lib"),s=Object.keys(a),l={"ISO-3":o.identity,"USA-states":o.identity,"country names":i};r.locationToFeature=function(t,e,r){var i=n(t,e);if(i){for(var a=0;a<r.length;a++){var s=r[a];if(s.id===i)return s}o.warn(["Location with id",i,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}},{"../lib":728,"country-regex":107}],721:[function(t,e,r){"use strict";var n=t("../constants/numerical").BADNUM;r.calcTraceToLineCoords=function(t){for(var e=t[0].trace,r=e.connectgaps,i=[],a=[],o=0;o<t.length;o++){var s=t[o],l=
;if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())f.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function s(t,e){if(!t)return"";for(var r=0;r<e.length;r++){var n=e[r];t=t.replace(n.regExp,n.sub)}return t}function l(t){return s(t,A)}function u(t,e){function r(){c++;var e=document.createElementNS(d.svg,"tspan");h.select(e).attr({class:"line",dy:c*m+"em"}),t.appendChild(e),a=e;var r=u;if(u=[{node:e}],r.length>1)for(var i=1;i<r.length;i++)n(r[i])}function n(t){var e,r=t.type,n={};if("a"===r){e="a";var o=t.target,s=t.href,l=t.popup;s&&(n={"xlink:xlink:show":"_blank"===o||"_"!==o.charAt(0)?"new":"replace",target:o,"xlink:xlink:href":s},l&&(n.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+l+'");return false;'))}else e="tspan";t.style&&(n.style=t.style);var c=document.createElementNS(d.svg,e);if("sup"===r||"sub"===r){i(a,w),a.appendChild(c);var f=document.createElementNS(d.svg,"tspan");i(f,w),h.select(f).attr("dy",_[r]),n.dy=x[r],a.appendChild(c),a.appendChild(f)}else a.appendChild(c);h.select(c).attr(n),a=t.node=c,u.push(t)}function i(t,e){t.appendChild(document.createTextNode(e))}e=l(e).replace(T," ");var a,s=!1,u=[],c=-1;L.test(e)?r():(a=t,u=[{node:t}]);for(var p=e.split(S),g=0;g<p.length;g++){var v=p[g],y=v.match(E),k=y&&y[2].toLowerCase(),A=b[k];if("br"===k)r();else if(void 0===A)i(a,v);else if(y[1])!function(t){if(1===u.length)return void f.log("Ignoring unexpected end tag </"+t+">.",e);var r=u.pop();t!==r.type&&f.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),a=u[u.length-1].node}(k);else{var O=y[4],R={type:k},F=o(O,C);if(F?(F=F.replace(P,"$1 fill:"),A&&(F+=";"+A)):A&&(F=A),F&&(R.style=F),"a"===k){s=!0;var j=o(O,I);if(j){var N=document.createElement("a");N.href=j,-1!==M.indexOf(N.protocol)&&(R.href=encodeURI(j),R.target=o(O,z)||"_blank",R.popup=o(O,D))}}n(R)}}return s}function c(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var h=t("d3"),f=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings"),m=t("../constants/alignment").LINE_SPACING,g=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,i){function o(){c.empty()||(f=t.attr("class")+"-math",c.select("svg."+f).remove()),t.text("").style("white-space","pre"),u(t.node(),s)&&t.style("pointer-events","all"),r.positionText(t),i&&i.call(t)}var s=t.text(),l=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&s.match(g),c=h.select(t.node().parentNode);if(!c.empty()){var f=t.attr("class")?t.attr("class").split(" ")[0]:"text";return f+="-math",c.selectAll("svg."+f).remove(),c.selectAll("g."+f+"-group").remove(),t.style("display",null).attr({"data-unformatted":s,"data-math":"N"}),l?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10);a(l[2],{fontSize:r},function(a,l,u){c.selectAll("svg."+f).remove(),c.selectAll("g."+f+"-group").remove();var h=a&&a.select("svg");if(!h||!h.node())return o(),void e();var d=c.append("g").classed(f+"-group",!0).attr({"pointer-events":"none","data-unformatted":s,"data-math":"Y"});d.node().appendChild(h.node()),l&&l.node()&&h.node().insertBefore(l.node().cloneNode(!0),h.node().firstChild),h.attr({class:f,height:u.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black";h.select("g").attr({fill:p,stroke:p});var m=n(h,"width"),g=n(h,"height"),v=+t.a
;return t.layout.autosize&&S.plotAutoSize(t,t.layout,u),(e.height||e.width||u.width!==ct||u.height!==ht)&&(y.calc=!0),(y.plot||y.calc)&&(y.layoutReplot=!0),{flags:y,undoit:x,redoit:b,eventData:w.extendDeep({},b)}}function v(t){var e=y.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];y.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=w.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(D.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0);var a=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=a.append("g").classed("imagelayer",!0),r._shapeUpperLayer=a.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var y=t("d3"),b=t("fast-isnumeric"),x=t("has-hover"),_=t("../plotly"),w=t("../lib"),M=t("../lib/events"),k=t("../lib/queue"),A=t("../registry"),T=t("./plot_schema"),S=t("../plots/plots"),E=t("../plots/polar"),L=t("../plots/cartesian/graph_interact"),C=t("../components/drawing"),I=t("../components/color"),z=t("../components/errorbars"),D=t("../constants/xmlns_namespaces"),P=t("../lib/svg_text_utils"),O=t("./manage_arrays"),R=t("./helpers"),F=t("./subroutines"),j=t("./edit_types"),N=t("../plots/cartesian/constants"),B=t("../plots/cartesian/constraints"),U=B.enforce,V=B.clean,H=t("../plots/cartesian/axis_ids");_.plot=function(t,e,r,n){function i(){if(m)return _.addFrames(t,m)}function s(){for(var e=x._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return w.syncOrAsync([F.layoutStyles],t)}function l(){var e,r,n,i=t.calcdata;for(A.getComponentMethod("legend","draw")(t),A.getComponentMethod("rangeselector","draw")(t),A.getComponentMethod("sliders","draw")(t),A.getComponentMethod("updatemenus","draw")(t),e=0;e<i.length;e++)r=i[e],n=r[0].trace,!0===n.visible&&n._module.colorbar?n._module.colorbar(t,r):S.autoMargin(t,"cb"+n.uid);return S.doAutoMargin(t),S.previousPromises(t)}function u(){if(JSON.stringify(x._size)!==E)return w.syncOrAsync([l,F.layoutStyles],t)}function c(){if(!k)return void U(t);var e,r,n,i=S.getSubplotIds(x,"cartesian"),a=x._modules,o=[];for(n=0;n<a.length;n++)w.pushUnique(o,a[n].setPositions);if(o.length)for(r=0;r<i.length;r++)for(e=x._plots[i[r]],n=0;n<o.length;n++)o[n](t,e);return z.calc(t),w.syncOrAsync([A.getComponentMethod("shapes","calcAutorange"),A.getComponentMethod("annotations","calcAutorange"),h,A.getComponentMethod("rangeslider","calcAutorange")],t)}function h(){if(!t._transitioning){for(var e=_.Axes.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];V(t,n),_.Axes.doAutoRange(n)}U(t)
function r(t){return!(t in e)||a.validate(e[t],u[t])}function n(t,r){return a.coerce(e,v,u,t,r)}function h(){return new Promise(function(t){setTimeout(t,o.getDelay(k._fullLayout))})}function f(){return new Promise(function(t,e){var r=s(k,y,_),n=k._fullLayout.width,o=k._fullLayout.height;if(i.purge(k),document.body.removeChild(k),"svg"===y)return t(M?r:"data:image/svg+xml,"+encodeURIComponent(r));var u=document.createElement("canvas");u.id=a.randstr(),l({format:y,width:n,height:o,scale:_,canvas:u,svg:r,promise:!0}).then(t).catch(e)})}function d(t){return M?t.replace(c,""):t}e=e||{};var p,m,g;if(a.isPlainObject(t)?(p=t.data||[],m=t.layout||{},g=t.config||{}):(t=a.getGraphDiv(t),p=a.extendDeep([],t.data),m=a.extendDeep({},t.layout),g=t._context),!r("width")||!r("height"))throw new Error("Height and width should be pixel values.");if(!r("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={},y=n("format"),b=n("width"),x=n("height"),_=n("scale"),w=n("setBackground"),M=n("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=a.extendFlat({},m);b&&(A.width=b),x&&(A.height=x);var T=a.extendFlat({},g,{staticPlot:!0,setBackground:w}),S=o.getRedrawFunc(k);return new Promise(function(t,e){i.plot(k,p,A,T).then(S).then(h).then(f).then(function(e){t(d(e))}).catch(function(t){e(t)})})}var i=t("../plotly"),a=t("../lib"),o=t("../snapshot/helpers"),s=t("../snapshot/tosvg"),l=t("../snapshot/svgtoimg"),u={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}},c=/^data:image\/\w+;base64,/;e.exports=n},{"../lib":728,"../plotly":767,"../snapshot/helpers":850,"../snapshot/svgtoimg":852,"../snapshot/tosvg":854}],766:[function(t,e,r){"use strict";function n(t,e,r,i,a,u){u=u||[];for(var c=Object.keys(t),f=0;f<c.length;f++){var d=c[f];if("transforms"!==d){var g=u.slice();g.push(d);var v=t[d],y=e[d],b=l(r,d),x="info_array"===(b||{}).valType,_="colorscale"===(b||{}).valType;if(s(r,d))if(p(v)&&p(y))n(v,y,b,i,a,g);else if(b.items&&!x&&m(v)){var w,M,k=b.items,A=k[Object.keys(k)[0]],T=[];for(w=0;w<y.length;w++){var S=y[w]._index||w;M=g.slice(),M.push(S),p(v[S])&&p(y[w])&&(T.push(S),n(v[S],y[w],A,i,a,M))}for(w=0;w<v.length;w++)M=g.slice(),M.push(w),p(v[w])?-1===T.indexOf(w)&&i.push(o("unused",a,M)):i.push(o("object",a,M,v[w]))}else!p(v)&&p(y)?i.push(o("object",a,g,v)):m(v)||!m(y)||x||_?d in e?h.validate(v,b)?"enumerated"===b.valType&&(b.coerceNumber&&v!==+y||v!==y)&&i.push(o("dynamic",a,g,v,y)):i.push(o("value",a,g,v)):i.push(o("unused",a,g,v)):i.push(o("array",a,g,v));else i.push(o("schema",a,g))}}return i}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,i=t.traces[n].layoutAttributes;i&&h.extendFlat(t.layout.layoutAttributes,i)}return t.layout.layoutAttributes}function a(t){return m(t)?"In data trace "+t[1]+", ":"In "+t+", "}function o(t,e,r,n,i){r=r||"";var a,o;m(e)?(a=e[0],o=e[1]):(a=e,o=null);var s=c(r),l=g[t](e,s,n,i);return h.log(l),{code:t,container:a,trace:o,path:r,astr:s,msg:l}}function s(t,e){var r=u(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function l(t,e){return t[u(e).keyMinusId]}function u(t){var e=t.match(v);return{keyMinusId:e&&e[1],id:e&&e[2]}}function c(t){if(!m(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}var h=t("../lib"),f=t("../plots/plots"),d=t("./plot_schema"),p=h.isPlainObject,m=Array.isArray;e.exports=function(t,e){var r,a,s=d.get(),l=[],u={};m(t)?(u.data=h.extendDeep([],t),r=t):(u.data=[],r=[],l.push(o("array","data"))),p(e)?(u.layout=h.extendDeep({},e),a=e):(u.layout={},a={},arguments.length>1&&l.push(o("object","layout"))),f.supplyDefaults(u);for(var c=u._fullData,g=r.length,v=0;v<g;v++){var y=r[v],b=["data",v];if(p(y)){var x=c[v],_=x.type,w=s.traces[_].attributes;w.type={v
}]:[]);y.enter().append("path").classed(I,1).classed("zl",1).classed("crisp",1).attr("d",c),y.attr("transform",d).call(E.stroke,u.zerolinecolor||E.defaultLine).style("stroke-width",R+"px"),y.exit().remove()}}var u,c=t._fullLayout,h=!1;if("object"==typeof e)u=e,e=u._id,h=!0;else if(u=B.getFromId(t,e),"redraw"===e&&c._paper.selectAll("g.subplot").each(function(t){var e=c._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+n._id+"tick").remove(),e.gridlayer.selectAll("path").remove(),e.zerolinelayer.selectAll("path").remove(),c._infolayer.select(".g-"+r._id+"title").remove(),c._infolayer.select(".g-"+n._id+"title").remove()}),!e||"redraw"===e)return A.syncOrAsync(B.list(t,"",!0).map(function(r){return function(){if(r._id){var n=B.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice(),r._rl=A.simpleMap(r._r,r.r2l)),n}}}));u.tickformat||(-1===["none","e","E","power","SI","B"].indexOf(u.exponentformat)&&(u.exponentformat="e"),-1===["all","first","last","none"].indexOf(u.showexponent)&&(u.showexponent="all")),u.setScale();var f,d,p,m,g,v=e.charAt(0),y=B.counterLetter(e),b=B.calcTicks(u),x=function(t){return[t.text,t.x,u.mirror].join("_")},_=e+"tick",C=e+"grid",I=e+"zl",z=(u.linewidth||1)/2,D="outside"===u.ticks?u.ticklen:0,P=0,O=L.crispRound(t,u.gridwidth,1),R=L.crispRound(t,u.zerolinewidth,O),F=L.crispRound(t,u.tickwidth,1);if(u._counterangle&&"outside"===u.ticks){var j=u._counterangle*Math.PI/180;D=u.ticklen*Math.cos(j)+1,P=u.ticklen*Math.sin(j)}if(u.showticklabels&&("outside"===u.ticks||u.showline)&&(D+=.2*u.tickfont.size),"x"===v)f=["bottom","top"],d=function(t){return"translate("+u.l2p(t.x)+",0)"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else{if("y"!==v)return void A.warn("Unrecognized doTicks axis:",e);f=["left","right"],d=function(t){return"translate(0,"+u.l2p(t.x)+")"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e}}var U=u.side||f[0],H=[-1,1,U===f[1]?1:-1];if("inside"!==u.ticks==("x"===v)&&(H=H.map(function(t){return-t})),u.visible){var q=b.filter(n);if(h){if(i(u._axislayer,p(u._pos+z*H[2],H[2]*u.ticklen)),u._counteraxis){l({gridlayer:u._gridlayer,zerolinelayer:u._zerolinelayer},u._counteraxis)}return a(u._axislayer,u._pos)}m=B.getSubplots(t,u);var G=m.map(function(t){var e=c._plots[t];if(c._has("cartesian")){var r=e[v+"axislayer"],n=u._linepositions[t]||[],o=e[y+"axis"],s=o._id===u.anchor,h=[!1,!1,!1],d="";if("allticks"===u.mirror?h=[!0,!0,!1]:s&&("ticks"===u.mirror?h=[!0,!0,!1]:h[f.indexOf(U)]=!0),u.mirrors)for(g=0;g<2;g++){var m=u.mirrors[o._id+f[g]];"ticks"!==m&&"labels"!==m||(h[g]=!0)}return void 0!==n[2]&&(h[2]=!0),h.forEach(function(t,e){var r=n[e],i=H[e];t&&M(r)&&(d+=p(r+z*i,i*u.ticklen))}),i(r,d),l(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return G.length?Promise.all(G):0}},B.swap=function(t,e){for(var r=y(t,e),n=0;n<r.length;n++)x(t,r[n].x,r[n].y)}},{"../../components/color":604,"../../components/drawing":628,"../../components/titles":694,"../../constants/alignment":701,"../../constants/numerical":707,"../../lib":728,"../../lib/svg_text_utils":750,"../../registry":846,"./axis_autotype":773,"./axis_ids":775,"./layout_attributes":783,"./layout_defaults":784,"./set_convert":789,d3:122,"fast-isnumeric":131}],773:[function(t,e,r){"use strict";function n(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(o(t[e]))return!0;return!1}function i(t,e){for(var r,n=0,i=0,a=Math.max(1,(t.length-1)/1e3),l=0;l<t.length;l+=a)r=t[Math.round(l)],s.isDateTime(r,e)&&(n+=1),o(r)&&(i+=1);return n>2*i}function a(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a<t.length;a+=r)e=t[Math.round(a)],s.cleanNumber(e)!==l?n++:"string"==typeof e&&""!==e&&"None"!==e&&i++;return i>2*n}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return i(t,e)?"date":a(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":
dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:o({},a,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},hoverformat:{valType:"string",dflt:"",editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"layoutstyle"},linecolor:{valType:"color",dflt:i.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:{valType:"boolean",editType:"ticks"},gridcolor:{valType:"color",dflt:i.lightLine,editType:"ticks"},gridwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:i.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()],editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks"}}}},{"../../components/color/attributes":603,"../../components/drawing/attributes":627,"../../lib/extend":717,"../font_attributes":796,"./constants":777}],784:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("../layout_attributes"),s=t("./constants"),l=t("./layout_attributes"),u=t("./type_defaults"),c=t("./axis_defaults"),h=t("./constraint_defaults"),f=t("./position_defaults"),d=t("./axis_ids");e.exports=function(t,e,r){function p(t,e){return Number(t.substr(5)||1)-Number(e.substr(5)||1)}function m(t,e){return i.coerce(N,B,l,t,e)}function g(t){var e={x:P,y:D}[t];return i.simpleMap(e,d.name2id)}var v,y=Object.keys(t),b=[],x=[],_=[],w=[],M=[],k=[],A={},T={};for(v=0;v<r.length;v++){var S,E,L=r[v];if(n.traceIs(L,"cartesian"))S=b,E=x;else{if(!n.traceIs(L,"gl2d"))continue;S=_,E=w}var C=d.id2name(L.xaxis),I=d.id2name(L.yaxis);if(n.traceIs(L,"carpet")&&("carpet"!==L.type||L._cheater)||C&&i.pushUnique(k,C),"carpet"===L.type&&L._cheater&&C&&i.pushUnique(M,C),C&&-1===S.indexOf(C)&&S.push(C),I&&-1===E.indexOf(I)&&E.push(I),n.traceIs(L,"2dMap")&&(A[C]=!0,A[I]=!0),n.traceIs(L,"oriented")){T["h"===L.orientation?I:C]=!0}}if(!e._has("gl3d")&&!e._has("geo"))for(v=0;v<y.length;v++){var z=y[v];-1===_.indexOf(z)&&-1===b.indexOf(z)&&s.xAxisMatch.test(z)?b.push(z):-1===w.indexOf(z)&&-1===x.indexOf(z)&&s.yAxisMatch.test(z)&&x.push(z)}b.length&&x.length&&i.pushUnique(e._basePlotModules,n.subplotsRegistry.cartesian);var D=b.concat(_).sort(p),P=x.concat(w).sort(p),O=D.concat(P),R=a.background;D.length&&P.length&&(R=i.coerce(t,e,o,"plot_bgcolor"));var F,j,N,B,U=a.combine(R,e.paper_bgcolor),V={x:g("
;for(var n=0;n<t.length;n++)if("choropleth"===t[n][0].trace.type){this.hasChoropleth=!0;break}this.viewInitial||this.saveViewInitial(r),this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),d.generalUpdatePerTraceModule(this,t,r);var i=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=i.selectAll(".point"),this.dataPoints.text=i.selectAll("text"),this.dataPaths.line=i.selectAll(".js-line");var a=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=a.selectAll("path"),this.render()}},_.updateProjection=function(t,e){var r=t._size,n=e.domain,a=e.projection,s=a.rotation||{},c=e.center||{},h=this.projection=i(e);h.center([c.lon-s.lon,c.lat-s.lat]).rotate([-s.lon,-s.lat,s.roll]).parallels(a.parallels);var f=[[r.l+r.w*n.x[0],r.t+r.h*(1-n.y[1])],[r.l+r.w*n.x[1],r.t+r.h*(1-n.y[0])]],d=e.lonaxis,p=e.lataxis,m=o(d.range,p.range);h.fitExtent(f,m);var g=this.bounds=h.getBounds(m),v=this.fitScale=h.scale(),y=h.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var b=this.graphDiv,x=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},M=0;M<x.length;M++)w[this.id+"."+x[M]]=null;return this.viewInitial=null,u.warn(_),b._promises.push(l.relayout(b,w)),_}var k=this.midPt=[(g[0][0]+g[1][0])/2,(g[0][1]+g[1][1])/2];if(h.scale(a.scale*v).translate([y[0]+(k[0]-y[0]),y[1]+(k[1]-y[1])]).clipExtent(g),e._isAlbersUsa){var A=h([c.lon,c.lat]),T=h.translate();h.translate([T[0]-(A[0]-T[0]),T[1]-(A[1]-T[1])])}},_.updateBaseLayers=function(t,e){function r(t){return"lonaxis"===t||"lataxis"===t}function n(t){return Boolean(y.lineLayers[t])}function i(t){return Boolean(y.fillLayers[t])}var o=this,l=o.topojson,u=o.layers,f=o.basePaths,d=this.hasChoropleth?y.layersForChoropleth:y.layers,p=d.filter(function(t){return n(t)||i(t)?e["show"+t]:!r(t)||e[t].showgrid}),m=o.framework.selectAll(".layer").data(p,String);m.exit().each(function(t){delete u[t],delete f[t],s.select(this).remove()}),m.enter().append("g").attr("class",function(t){return"layer "+t}).each(function(t){var e=u[t]=s.select(this);"bg"===t?o.bgRect=e.append("rect").style("pointer-events","all"):r(t)?f[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):n(t)?f[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):i(t)&&(f[t]=e.append("path").style("stroke","none"))}),m.order(),m.each(function(t){var o=f[t],s=y.layerNameToAdjective[t];"frame"===t?o.datum(y.sphereSVG):n(t)||i(t)?o.datum(x(l,l.objects[t])):r(t)&&o.datum(a(t,e)).call(c.stroke,e[t].gridcolor).call(h.dashLine,"",e[t].gridwidth),n(t)?o.call(c.stroke,e[s+"color"]).call(h.dashLine,"",e[s+"width"]):i(t)&&o.call(c.fill,e[s+"color"])})},_.updateDims=function(t,e){var r=this.bounds,n=(e.framewidth||0)/2,i=r[0][0]-n,a=r[0][1]-n,o=r[1][0]-i+n,s=r[1][1]-a+n;h.setRect(this.clipRect,i,a,o,s),this.bgRect.call(h.setRect,i,a,o,s).call(c.fill,e.bgcolor),this.xaxis._offset=i,this.xaxis._length=o,this.yaxis._offset=a,this.yaxis._length=s},_.updateFx=function(t,e){function r(){var t=i.viewInitial,e={};for(var r in t)e[i.id+"."+r]=t[r];l.relayout(a,e),a.emit("plotly_doubleclick",null)}function n(t){return i.projection.invert([t[0]+i.xaxis._offset,t[1]+i.yaxis._offset])}var i=this,a=i.graphDiv,o=i.bgRect,u=t.dragmode;if(!i.isStatic){if("pan"===u)o.node().onmousedown=null,o.call(v(i,e)),o.on("dblclick.zoom",r);else if("select"===u||"lasso"===u){o.on(".zoom",null);var c;"select"===u?c=function(t,e){(t.range={})[i.id]=[n([e.xmin,e.ymin]),n([e.xmax,e.ymax])]}:"lasso"===u&&(c=function(t,e,r){(t.lassoPoints={})[i.id]=r.filtered.map(n)});var h={element:i.bgRect.node(),gd:a,plotinfo:{xaxis:i.xaxis,yaxis:i.yaxis,fillRangeItems:c},xaxes:[i.xaxis],yaxes:[i.yaxis],subplot:i.id};h.prepFn=function(t,e,r){g(t,e,r,h,u)},h.doneFn=function(e,r){2===r&&t._zoomlayer.selectAll(".select-outline").remove()},m.init(h)}o.on("mousemove",function(){var t=i.projection.in
;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":726,"../../lib/str2rgbarray":749,"../cartesian/axes":772,"../plots":831}],808:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("./scene2d"),a=t("../plots"),o=t("../../constants/xmlns_namespaces"),s=t("../cartesian/constants"),l=t("../cartesian"),u=t("../../components/fx/layout_attributes");r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=s.idRegex,r.attrRegex=s.attrRegex,r.attributes=t("../cartesian/attributes"),r.layoutAttrOverrides=n(l.layoutAttributes,"plot","from-root"),r.baseLayoutAttrOverrides=n({plot_bgcolor:a.layoutAttributes.plot_bgcolor,hoverlabel:u.hoverlabel},"plot","nested"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=a.getSubplotIds(e,"gl2d"),o=0;o<n.length;o++){var s=n[o],l=e._plots[s],u=a.getSubplotData(r,"gl2d",s),c=l._scene2d;void 0===c&&(c=new i({id:s,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),l._scene2d=c),c.plot(u,t.calcdata,e,t.layout)}},r.clean=function(t,e,r,n){for(var i=a.getSubplotIds(n,"gl2d"),o=0;o<i.length;o++){var s=i[o],u=n._plots[s];if(u._scene2d){0===a.getSubplotData(t,"gl2d",s).length&&(u._scene2d.destroy(),delete n._plots[s])}}l.clean.apply(this,arguments)},r.drawFramework=function(t){t._context.staticPlot||l.drawFramework(t)},r.toSVG=function(t){for(var e=t._fullLayout,r=a.getSubplotIds(e,"gl2d"),n=0;n<r.length;n++){var i=e._plots[r[n]],s=i._scene2d,l=s.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":l,x:0,y:0,width:"100%",height:"100%",preserveAspectRatio:"none"}),s.destroy()}},r.updateFx=function(t){for(var e=a.getSubplotIds(t,"gl2d"),r=0;r<e.length;r++){t._plots[e[r]]._scene2d.updateFx(t.dragmode)}}},{"../../components/fx/layout_attributes":646,"../../constants/xmlns_namespaces":709,"../../plot_api/edit_types":756,"../cartesian":782,"../cartesian/attributes":771,"../cartesian/constants":777,"../plots":831,"./scene2d":809}],809:[function(t,e,r){"use strict";function n(t,e){this.container=t.container,this.graphDiv=t.graphDiv,this.pixelRatio=t.plotGlPixelRatio||window.devicePixelRatio,this.id=t.id,this.staticPlot=!!t.staticPlot,this.scrollZoom=this.graphDiv._context.scrollZoom,this.fullData=null,this.updateRefs(e),this.makeFramework(),this.glplotOptions=p(this),this.glplotOptions.merge(e),this.glplot=c(this.glplotOptions),this.camera=m(this),this.traces={},this.spikes=h(this.glplot),this.selectBox=f(this.glplot,{innerFill:!1,outerFill:!0}),this.lastButtonState=0,this.pickResult=null,this.isMouseOver=!0,this.bounds=[1/0,1/0,-1/0,-1/0],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}function i(t,e){for(var r=0;r<2;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;a<n.length;++a)if(n[a].x!==i[a].x)return!0}return!1}var a,o,s=t("../../registry"),l=t("../../plots/cartesian/axes"),u=t("../../components/fx"),c=t("gl-plot2d"),h=t("gl-spikes2d"),f=t("gl-select-box"),d=t("webgl-context"),p=t("./convert"),m=t("./camera"),g=t("../../lib/html2unicode"),v=t("../../lib/show_no_webgl_msg"),y=t("../../plots/cartesian/constraints"),b=y.enforce,x=y.clean,_=["xaxis","yaxis"];e.exports=n;var w=n.prototype;w.makeFramework=function(){if(this.staticPlot){if(!(o||(a=document.createElement("canvas"),o=d({canvas:a,preserveDrawingBuffer:!1,premultipliedAlpha:!0,antialias:!0}))))throw new Error("Error creating static canvas/context for image server");this.canvas=a,this.gl=o}else{var t=document.createElement("canvas"),e=d({canvas:t,premultipliedAlpha:!0});e||v(this),this.canvas=t,this.gl=e}var r=this.canvas;r.style.width="100%",r.style.height="100%",r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style["pointer-events"]="none",this.updateSize(r),r.className+="user-select-none";var n=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");n.style.position="absolute",n.style.top=n.style.left="0px",n.style.width=n.style.height="100%",n.style["z-index"]=20,n.style["pointer
;t.camera=x(t.container,{center:[s.center.x,s.center.y,s.center.z],eye:[s.eye.x,s.eye.y,s.eye.z],up:[s.up.x,s.up.y,s.up.z],zoomMin:.1,zoomMax:100,mode:"orbit"})}return t.glplot.camera=t.camera,t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=n.bind(null,t),t.traces={},!0}function a(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.position="absolute",a.style.top=a.style.left="0px",a.style.width=a.style.height="100%",a.style["z-index"]=20,a.style["pointer-events"]="none",r.appendChild(a),this.svgContainer=a,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=w(e[this.id]),this.spikeOptions=M(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=p.getComponentMethod("annotations3d","convert"),this.drawAnnotations=p.getComponentMethod("annotations3d","draw"),i(this,e)}function o(t,e,r,n,i){for(var a,o=0;o<e.length;++o)if(Array.isArray(e[o]))for(var s=0;s<e[o].length;++s)a=t.d2l(e[o][s],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a));else a=t.d2l(e[o],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a))}function s(t,e,r){var n=t.fullSceneLayout;o(n.xaxis,e.x,0,r,e.xcalendar),o(n.yaxis,e.y,1,r,e.ycalendar),o(n.zaxis,e.z,2,r,e.zcalendar)}function l(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}function u(t){return{up:{x:t.up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]}}}var c,h,f=t("gl-plot3d"),d=t("webgl-context"),p=t("../../registry"),m=t("../../lib"),g=t("../../plots/cartesian/axes"),v=t("../../components/fx"),y=t("../../lib/str2rgbarray"),b=t("../../lib/show_no_webgl_msg"),x=t("./camera"),_=t("./project"),w=t("./layout/convert"),M=t("./layout/spikes"),k=t("./layout/tick_marks"),A=a.prototype;A.recoverContext=function(){function t(){return r.isContextLost()?void requestAnimationFrame(t):i(e,e.fullLayout,n,r)?void e.plot.apply(e,e.plotArgs):void m.error("Catastrophic and unrecoverable WebGL error. Context lost.")}var e=this,r=this.glplot.gl,n=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(t)};var T=["xaxis","yaxis","zaxis"];A.plot=function(t,e,r){if(this.plotArgs=[t,e,r],!this.glplot.contextLost){var n,i,a,o,l,u,c=e[this.id],h=r[this.id];c.bgcolor?this.glplot.clearColor=y(c.bgcolor):this.glplot.clearColor=[0,0,0,0],this.glplot.snapToData=!0,this.fullLayout=e,this.fullSceneLayout=c,this.glplotLayout=c,this.axesOptions.merge(c),this.spikeOptions.merge(c),this.setCamera(c.camera),this.updateFx(c.dragmode,c.hovermode),this.glplot.update({}),this.setConvert(l),t?Array.isArray(t)||(t=[t]):t=[];var f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(a=0;a<t.length;++a)n=t[a],!0===n.visible&&s(this,n,f);var d=[1,1,1];for(o=0;o<3;++o)f[0][o]>f[1][o]?d[o]=1:f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=d,this.convertAnnotations(this),a=0;a<t.length;++a)n=t[a],!0===n.visible&&(i=this.traces[n.uid],i?i.update(n):(i=n._module.plot(this,n),this.traces[n.uid]=i),i.name=n.name);var p=Object.keys(this.traces);t:for(a=0;a<p.length;++a){for(o=0;o<t.length;++o)if(t[o].uid===p[a]&&!0===t[o].visible)continue t;i=this.traces[p[a]],i.dispose(),delete this.traces[p[a]]}this.glplot.objects.sort(function(t,e){return t._trace.data.index-e._trace.data.index});var m=[[0,0,0],[0,0,0]],g=[],v={};for(a=0;a<3;++a){if(l=c[T[a]],u=l.type,u in v?(v[u].acc*=d[a],v[u].count+=1):v[u]={acc:d[a],count:1},l.autorange){m[0][a]=1/0,m[1][a]=-1/0;var b=this.glplot.objects,x=this.fullSceneLayout.annotations||[],_=l._name.charAt(0);for(o=0;o<b.length;o++){var w=b[o].bounds;m[0][a]=Math.min(m[0][a],w[0][a]/d[a]),m[1][a]=Math.max(m[1][a
u._hasClipOnAxisFalse=!1;for(var m=0;m<t.length;m++){var g=t[m];if(g.xaxis===u.xaxis._id&&g.yaxis===u.yaxis._id&&!1===g.cliponaxis){u._hasClipOnAxisFalse=!0;break}}}var v=c.Axes.list(s,null,!0);for(i=0;i<v.length;i++){var y=v[i],b=null;y.overlaying&&(b=c.Axes.getFromId(s,y.overlaying))&&b.overlaying&&(y.overlaying=!1,b=null),y._mainAxis=b||y,b&&(y.domain=b.domain.slice()),y._anchorAxis="free"===y.anchor?null:c.Axes.getFromId(s,y.anchor)}},g.clearExpandedTraceDefaultColors=function(t){function e(t,e,i,a){n[a]=e,n.length=a+1,"color"===t.valType&&void 0===t.dflt&&r.push(n.join("."))}var r,n,i;for(n=[],r=t._module._colorAttrs,r||(t._module._colorAttrs=r=[],h.crawl(t._module.attributes,e)),i=0;i<r.length;i++){d.nestedProperty(t,"_input."+r[i]).get()||d.nestedProperty(t,r[i]).set(null)}},g.supplyDataDefaults=function(t,e,r,n){function i(t){e.push(t);var r=t._module;r&&(d.pushUnique(u,r),d.pushUnique(c,t._module.basePlotModule),h++)}var o,s,l,u=n._modules=[],c=n._basePlotModules=[],h=0;n._transformModules=[];var p={},m=[];for(o=0;o<t.length;o++){if(l=t[o],s=g.supplyTraceDefaults(l,h,n,o),s.index=o,s._input=l,s._expandedIndex=h,s.transforms&&s.transforms.length)for(var v=a(s,e,r,n),y=0;y<v.length;y++){var x=v[y],_=g.supplyTraceDefaults(x,h,n,o);b(_,x),x.uid=_.uid=s.uid+y,_.index=o,_._input=l,_._fullInput=s,_._expandedIndex=h,_._expandedInput=x,i(_)}else s._fullInput=s,s._expandedInput=s,i(s);f.traceIs(s,"carpetAxis")&&(p[s.carpet]=s),f.traceIs(s,"carpetDependent")&&m.push(o)}for(o=0;o<m.length;o++)if(s=e[m[o]],s.visible){var w=p[s.carpet];s._carpet=w,w&&w.visible?(s.xaxis=w.xaxis,s.yaxis=w.yaxis):s.visible=!1}},g.supplyAnimationDefaults=function(t){function e(e,r){return d.coerce(t||{},n,v,e,r)}t=t||{};var r,n={};if(e("mode"),e("direction"),e("fromcurrent"),Array.isArray(t.frame))for(n.frame=[],r=0;r<t.frame.length;r++)n.frame[r]=g.supplyAnimationFrameDefaults(t.frame[r]||{});else n.frame=g.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(n.transition=[],r=0;r<t.transition.length;r++)n.transition[r]=g.supplyAnimationTransitionDefaults(t.transition[r]||{});else n.transition=g.supplyAnimationTransitionDefaults(t.transition||{});return n},g.supplyAnimationFrameDefaults=function(t){function e(e,n){return d.coerce(t||{},r,v.frame,e,n)}var r={};return e("duration"),e("redraw"),r},g.supplyAnimationTransitionDefaults=function(t){function e(e,n){return d.coerce(t||{},r,v.transition,e,n)}var r={};return e("duration"),e("easing"),r},g.supplyFrameDefaults=function(t){function e(e,n){return d.coerce(t,r,y,e,n)}var r={};return e("group"),e("name"),e("traces"),e("baseframe"),e("data"),e("layout"),r},g.supplyTraceDefaults=function(t,e,r,n){function i(e,r){return d.coerce(t,o,g.attributes,e,r)}function a(e,r){if(g.traceIs(o,e))return d.coerce(t,o,g.subplotsRegistry[e].attributes,r)}var o={},s=p.defaults[e%p.defaults.length],l=i("visible");i("type"),i("uid"),i("name","trace "+n);for(var u=Object.keys(x),c=0;c<u.length;c++){var h=u[c];if(-1===["cartesian","gl2d"].indexOf(h)){var m=x[h].attr;m&&a(h,m)}}if(l){i("customdata"),i("ids");var v=g.getModule(o);o._module=v,g.traceIs(o,"showLegend")&&(i("showlegend"),i("legendgroup")),f.getComponentMethod("fx","supplyDefaults")(t,o,s,r),v&&(v.supplyDefaults(t,o,s,r),d.coerceHoverinfo(t,o,r)),g.traceIs(o,"noOpacity")||i("opacity"),a("cartesian","xaxis"),a("cartesian","yaxis"),a("gl2d","xaxis"),a("gl2d","yaxis"),g.traceIs(o,"notLegendIsolatable")&&(o.visible=!!o.visible),g.supplyTransformDefaults(t,o,r)}return o},g.supplyTransformDefaults=function(t,e,r){var n=r._globalTransforms||[],i=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var a=t.transforms||[],o=n.concat(a),s=e.transforms=[],l=0;l<o.length;l++){var u,c=o[l],h=c.type,f=_[h],p=!(c._module&&c._module===f),m=f&&"function"==typeof f.transform;f||d.warn("Unrecognized transform type "+h+"."),f&&f.supplyDefaults&&(p||m)?(u=f.supplyDefaults(c,e,r,t),u.type=h,u._module=f,d.pushUnique(i,f)):u=d.extendFlat({},c),s.push(u)}},g.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return d.coerce(t,e,g.la
n===r.length-1&&(t[e]=a),t[e]},t))},s.PolyChart=function(){function t(){var t=e[0].geometryConfig,r=t.container;"string"==typeof r&&(r=n.select(r)),r.datum(e).each(function(e,r){function a(e,r){return{r:t.radialScale(e[1]),t:(t.angularScale(e[0])+t.orientation)*Math.PI/180}}function o(t){return{x:t.r*Math.cos(t.t),y:t.r*Math.sin(t.t)}}var s=!!e[0].data.yStack,l=e.map(function(t,e){return s?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],h={};h.bar=function(r,i,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+u(e[0]))+")"}})},h.dot=function(t,r,i){var s=t[2]?[t[0],t[1]+t[2]]:t,l=n.svg.symbol().size(e[i].data.dotSize).type(e[i].data.dotType)(t,r);n.select(this).attr({class:"mark dot",d:l,transform:function(t,e){var r=o(a(s));return"translate("+[r.x,r.y]+")"}})};var f=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});h.line=function(r,i,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(n.select(this).each(h.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:g.stroke(r,i,a)}).attr({class:"mark dot"}),!(i>0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:f(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return g.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return g.stroke(r,i,a)},"stroke-width":function(t,e){return g["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return g["stroke-dasharray"](r,i,a)},opacity:function(t,e){return g.opacity(r,i,a)},display:function(t,e){return g.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var g={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return i[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},v=n.select(this).selectAll("g.layer").data(l);v.enter().append("g").attr({class:"layer"});var y=v.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(g).each(h[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e=[s.PolyChart.defaultConfig()],r=n.dispatch("hover"),i={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),a(e[r],s.PolyChart.defaultConfig()),a(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},s.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=func
;for(var i in r.componentsRegistry)o(i,t.name)},r.registerComponent=function(t){var e=t.name;r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&c(r.layoutArrayContainers,e),n(t));for(var s in r.modules)i(e,s);for(var l in r.subplotsRegistry)o(e,l);for(var u in r.transformsRegistry)a(e,u);t.schema&&t.schema.layout&&d(m,t.schema.layout)},r.registerTransform=function(t){r.transformsRegistry[t.name]=t;for(var e in r.componentsRegistry)a(e,t.name)},r.getModule=function(t){if(void 0!==t.r)return l.warn("Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",t),!1;var e=r.modules[s(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=s(t)))return!1;var n=r.modules[t];return n||(t&&"area"!==t&&l.log("Unrecognized trace type "+t+"."),n=r.modules[p.type.dflt]),!!n.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],i=0;i<n.length;i++)n[i].type===e&&r.push(i);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n?n[e]||u:u}},{"./lib/extend":717,"./lib/loggers":732,"./lib/noop":736,"./lib/push_unique":740,"./plots/attributes":770,"./plots/layout_attributes":822}],847:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function i(t){return["xaxis","yaxis","zaxis"].indexOf(t.slice(0,5))>-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,u=t.layout,c=l([],a),h=l({},u,n(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var d=Object.keys(h);for(r=0;r<d.length;r++)i(d[r])&&(h[d[r]].title="");for(r=0;r<c.length;r++){var p=c[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),"pie"===p.type&&(p.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)h.annotations.push(e.annotations[r]);var m=o.getSubplotIds(h,"gl3d");if(m.length){var g={};for("thumbnail"===e.tileClass&&(g={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<m.length;r++){var v=h[m[r]];v.xaxis||(v.xaxis={}),v.yaxis||(v.yaxis={}),v.zaxis||(v.zaxis={}),s(v.xaxis,g),s(v.yaxis,g),s(v.zaxis,g),v._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var b={gd:y,td:y,layout:h,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:f.mapboxAccessToken}};return"transparent"!==e.setBackground&&(b.config.setBackground=e.setBackground||"opaque"),b.gd.defaultLayout=n(e.tileClass),b}},{"../lib":728,"../plots/plots":831}],848:[function(t,e,r){"use strict";function n(t,e){return e=e||{},e.format=e.format||"png",new Promise(function(r,n){t._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),a.isIE()&&"svg"!==e.format&&n(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var s=i(t,e),l=e.filename||t.fn||"newplot";l+="."+e.format,s.then(function(e){return t._snapshotInProgress=!1,o(e,l)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var i=t("../plot_api/to_image"),a=t("../lib"),o=t("./filesaver");e.exports=n},{"../lib":728,"../plot_api/to_image":765,"./filesaver":849}],849:[function(t,e,r){"use strict";var n=function(t,e){var r=document.createElement("a"),n="download"in r,i=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);return new Promise(
"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../components/color"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}var u,c=l("y"),h=l("x");if(c&&c.length)u="v",h||l("x0");else{if(!h||!h.length)return void(e.visible=!1);u="h",l("y0")}i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],s),l("orientation",u),l("line.color",(t.marker||{}).color||r),l("line.width",2),l("fillcolor",a.addOpacity(e.line.color,.5)),l("whiskerwidth"),l("boxmean");var f=n.coerce2(t,e,o,"marker.outliercolor"),d=l("marker.line.outliercolor"),p=f||d?l("boxpoints","suspectedoutliers"):l("boxpoints");p&&(l("jitter","all"===p?.3:0),l("pointpos","all"===p?-1.5:0),l("marker.symbol"),l("marker.opacity"),l("marker.size"),l("marker.color",e.line.color),l("marker.line.color"),l("marker.line.width"),"suspectedoutliers"===p&&(l("marker.line.outliercolor",e.marker.color),l("marker.line.outlierwidth")))}},{"../../components/color":604,"../../lib":728,"../../registry":846,"./attributes":869}],872:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../components/fx"),o=t("../../components/color");e.exports=function(t,e,r,s){var l,u,c,h,f,d,p,m,g,v=t.cd,y=v[0].trace,b=v[0].t,x=t.xa,_=t.ya,w=[];if(h="closest"===s?2.5*b.bdPos:b.bdPos,"h"===y.orientation?(l=function(t){return a.inbox(t.min-e,t.max-e)},u=function(t){var e=t.pos+b.bPos-r;return a.inbox(e-h,e+h)},f="y",d=_,m="x",g=x):(l=function(t){var r=t.pos+b.bPos-e;return a.inbox(r-h,r+h)},u=function(t){return a.inbox(t.min-r,t.max-r)},f="x",d=x,m="y",g=_),c=a.getDistanceFunction(s,l,u),a.getClosest(v,c,t),!1!==t.index){var M=v[t.index],k=y.line.color,A=(y.marker||{}).color;o.opacity(k)&&y.line.width?t.color=k:o.opacity(A)&&y.boxpoints?t.color=A:t.color=y.fillcolor,t[f+"0"]=d.c2p(M.pos+b.bPos-b.bdPos,!0),t[f+"1"]=d.c2p(M.pos+b.bPos+b.bdPos,!0),n.tickText(d,d.c2l(M.pos),"hover").text,t[f+"LabelVal"]=M.pos;var T,S,E={},L=["med","min","q1","q3","max"];y.boxmean&&L.push("mean"),y.boxpoints&&[].push.apply(L,["lf","uf"]);for(var C=0;C<L.length;C++)(T=L[C])in M&&!(M[T]in E)&&(E[M[T]]=!0,p=g.c2p(M[T],!0),S=i.extendFlat({},t),S[m+"0"]=S[m+"1"]=p,S[m+"LabelVal"]=M[T],S.attr=T,"mean"===T&&"sd"in M&&"sd"===y.boxmean&&(S[m+"err"]=M.sd),t.name="",w.push(S));return w}}},{"../../components/color":604,"../../components/fx":645,"../../lib":728,"../../plots/cartesian/axes":772}],873:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="box",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","oriented","box","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":782,"./attributes":869,"./calc":870,"./defaults":871,"./hover":872,"./layout_attributes":874,"./layout_defaults":875,"./plot":876,"./set_positions":877,"./style":878}],874:[function(t,e,r){"use strict";e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}},{}],875:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function o(r,n){return i.coerce(t,e,a,r,n)}for(var s,l=0;l<r.length;l++)if(n.traceIs(r[l],"box")){s=!0;break}s&&(o("boxmode"),o("boxgap"),o("boxgroupgap"))}},{"../../lib":728,"../../registry":846,"./layout_attributes":874}],876:[function(t,e,r){"use strict";function n(){l=2e9}function i(){var t=l;return l=(69069*l+1)%4294967296,Math.abs(l-t)<429496729?i():l/4294967296}var a=t("d3"),o=t("../../lib"),s=t("../../components/drawing"),l=2e9;e.exports=function(t,e,r){var l,u,c=t._fullLayout,h=e.xaxis,f=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").
;var g=p*p,v=g*p,y=1-p,b=y*y,x=b*y,_=m*m,w=_*m,M=1-m,k=M*M,A=k*M;for(h=0;h<t.length;h++)c=t[h],i=x*c[d][f]+3*(b*p*c[d][f+1]+y*g*c[d][f+2])+v*c[d][f+3],s=x*c[d+1][f]+3*(b*p*c[d+1][f+1]+y*g*c[d+1][f+2])+v*c[d+1][f+3],l=x*c[d+2][f]+3*(b*p*c[d+2][f+1]+y*g*c[d+2][f+2])+v*c[d+2][f+3],u=x*c[d+3][f]+3*(b*p*c[d+3][f+1]+y*g*c[d+3][f+2])+v*c[d+3][f+3],e[h]=A*i+3*(k*m*s+M*_*l)+w*u;return e}:n?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-d));f*=3;var g=p*p,v=g*p,y=1-p,b=y*y,x=b*y,_=1-m;for(c=0;c<t.length;c++)h=t[c],i=_*h[d][f]+m*h[d+1][f],s=_*h[d][f+1]+m*h[d+1][f+1],l=_*h[d][f+2]+m*h[d+1][f+1],u=_*h[d][f+3]+m*h[d+1][f+1],e[c]=x*i+3*(b*p*s+y*g*l)+v*u;return e}:i?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-d));d*=3;var g=m*m,v=g*m,y=1-m,b=y*y,x=b*y,_=1-p;for(c=0;c<t.length;c++)h=t[c],i=_*h[d][f]+p*h[d][f+1],s=_*h[d+1][f]+p*h[d+1][f+1],l=_*h[d+2][f]+p*h[d+2][f+1],u=_*h[d+3][f]+p*h[d+3][f+1],e[c]=x*i+3*(b*m*s+y*g*l)+v*u;return e}:function(e,r,n){e||(e=[]);var i,s,l,u,c=Math.max(0,Math.min(Math.floor(r),a)),h=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-c)),d=Math.max(0,Math.min(1,n-h)),p=1-d,m=1-f;for(l=0;l<t.length;l++)u=t[l],i=m*u[h][c]+f*u[h][c+1],s=m*u[h+1][c]+f*u[h+1][c+1],e[l]=p*i+d*s;return e}}},{}],900:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./xy_defaults"),a=t("./ab_defaults"),o=t("./set_convert"),s=t("./attributes"),l=t("../../components/color/attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,s,r,i)}e._clipPathId="clip"+e.uid+"carpet";var h=c("color",l.defaultLine);if(n.coerceFont(c,"font"),c("carpet"),a(t,e,u,c,h),!e.a||!e.b)return void(e.visible=!1);e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0);var f=i(t,e,c);o(e),e._cheater&&c("cheaterslope"),f||(e.visible=!1)}},{"../../components/color/attributes":603,"../../lib":728,"./ab_defaults":883,"./attributes":885,"./set_convert":909,"./xy_defaults":911}],901:[function(t,e,r){"use strict";e.exports=function(t){return Array.isArray(t[0])}},{}],902:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.plot=t("./plot"),n.calc=t("./calc"),n.animatable=!0,n.moduleType="trace",n.name="carpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","carpetAxis","notLegendIsolatable"],n.meta={},e.exports=n},{"../../plots/cartesian":782,"./attributes":885,"./calc":889,"./defaults":900,"./plot":908}],903:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r,n=t._fullData.length,i=0;i<n;i++){var a=t._fullData[i];if(a.index!==e.index&&("carpet"===a.type&&(r||(r=a),a.carpet===e.carpet)))return a}return r}},{}],904:[function(t,e,r){"use strict";e.exports=function(t,e,r){if(0===t.length)return"";var n,i=[],a=r?3:1;for(n=0;n<t.length;n+=a)i.push(t[n]+","+e[n]),r&&n<t.length-a&&(i.push("C"),i.push([t[n+1]+","+e[n+1],t[n+2]+","+e[n+2]+" "].join(" ")));return i.join(r?"":"L")}},{}],905:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;for(Array.isArray(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],n=0;n<e.length;n++)t[n]=r(e[n]);return t}},{}],906:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i;for(Array.isArray(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],n=0;n<e.length;n++)for(Array.isArray(t[n])?t[n].length>e.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i<e[0].length;i++)t[n][i]=r(e[n][i]);return t}},{}],907:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i[0]*t.dpdx(e),s=i[1]*t.dpdy(r),l=1,u=1;if(a){var c=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),f=(i[0]*a[0]+i[1]*a[1])/c/h;u=Math.max(0,f)}var d=180*Math.atan2(s,o)/Math.PI;return d<-90?(d+=180,l=-l):d>90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}}},{}],908:[function(t,e,r){"use strict";function n(t,e,r){var n=
left:Math.max(o[0][0],0),right:Math.min(o[2][0],_),top:Math.max(o[0][1],0),bottom:Math.min(o[2][1],M)};k.middle=(k.top+k.bottom)/2,k.center=(k.left+k.right)/2;var A=Math.sqrt(_*_+M*M),T=w.LABELDISTANCE*A/Math.max(1,e.length/w.LABELINCREASE);h.each(function(t){var e=r.calcTextOpts(t.level,b,x,n);f.select(this).selectAll("path").each(function(){var t=this,n=d.getVisibleSegment(t,k,e.height/2);if(n&&!(n.len<(e.width+e.height)*w.LABELMIN))for(var i=Math.min(Math.ceil(n.len/T),w.LABELMAX),a=0;a<i;a++){var o=r.findBestTextLocation(t,n,e,y,k);if(!o)break;r.addLabelData(o,e,y,v)}})}),x.remove(),r.drawLabels(g,y,n,m,c?v:null)}u&&!l&&h.remove()}function u(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,u=Math.cos(l)*i,c=Math.sin(l)*i,h=(o>n.center?n.right-o:o-n.left)/(u+Math.abs(Math.sin(l)*a)),f=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(c)+Math.cos(l)*a);if(h<1||f<1)return 1/0;var p=M.EDGECOST*(1/(h-1)+1/(f-1));p+=M.ANGLECOST*l*l;for(var m=o-u,g=s-c,v=o+u,y=s+c,b=0;b<r.length;b++){var x=r[b],_=Math.cos(x.theta)*x.width/2,w=Math.sin(x.theta)*x.width/2,k=2*d.segmentDistance(m,g,v,y,x.x-_,x.y-w,x.x+_,x.y+w)/(e.height+x.height),A=x.level===e.level,T=A?M.SAMELEVELDISTANCE:1;if(k<=T)return 1/0;p+=M.NEIGHBORCOST*(A?M.SAMELEVELFACTOR:1)/(k-T)}return p}function c(t,e,r,n,i){var a="clip"+n.trace.uid,o=r.selectAll("#"+a).data(n.trace.connectgaps?[]:[0]);if(o.enter().append("clipPath").classed("contourclip",!0).attr("id",a),o.exit().remove(),!1===n.trace.connectgaps){var l={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:n.x,y:n.y,z:h(n),smoothing:0};b([l]),x([l]);var u=s(l,i),c=o.selectAll("path").data([0]);c.enter().append("path"),c.attr("d",u)}else a=null;t.call(p.setClipUrl,a),e.plot.selectAll(".hm"+n.trace.uid).call(p.setClipUrl,a)}function h(t){var e,r,n=t.trace._emptypoints,i=[],a=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<a;e++)i.push(s.slice());for(e=0;e<n.length;e++)r=n[e],i[r[0]][r[1]]=0;return t.zmask=i,i}var f=t("d3"),d=t("../../lib"),p=t("../../components/drawing"),m=t("../../lib/svg_text_utils"),g=t("../../plots/cartesian/axes"),v=t("../../plots/cartesian/set_convert"),y=t("../heatmap/plot"),b=t("./make_crossings"),x=t("./find_all_paths"),_=t("./end_plus"),w=t("./constants"),M=w.LABELOPTIMIZER;r.plot=function(t,e,r){for(var i=0;i<r.length;i++)n(t,e,r[i])},r.makeContourGroup=function(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n},r.createLines=function(t,e,r){var n=r[0].smoothing,i=t.selectAll("g.contourlevel").data(e?r:[]);if(i.exit().remove(),i.enter().append("g").classed("contourlevel",!0),e){var a=i.selectAll("path.openline").data(function(t){return t.pedgepaths||t.edgepaths});a.exit().remove(),a.enter().append("path").classed("openline",!0),a.attr("d",function(t){return p.smoothopen(t,n)}).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke");var o=i.selectAll("path.closedline").data(function(t){return t.ppaths||t.paths});o.exit().remove(),o.enter().append("path").classed("closedline",!0),o.attr("d",function(t){return p.smoothclosed(t,n)}).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke")}return i},r.createLineClip=function(t,e,r,n){var i=e?"clipline"+n:null,a=r.selectAll("#"+i).data(e?[0]:[]);return a.exit().remove(),a.enter().append("clipPath").classed("contourlineclip",!0).attr("id",i),p.setClipUrl(t,i),a},r.labelFormatter=function(t,e,r){if(t.labelformat)return f.format(t.labelformat);var n;return e?n=e.axis:(n={type:"linear",_separators:".,",_id:"ycontour",nticks:(t.end-t.start)/t.size,showexponent:"all",range:[t.start,t.end]},v(n,r),g.calcTicks(n),n._tmin=null,n._tmax=null),function(t){return g.tickText(n,t).text}},r.calcTextOpts=function(t,e,r,n){var i=e(t);r.text(i).call(m.convertToTspans,n);var a=p.bBox(r.node(),!0);return{text:i,width:a.width,height:a.height,level:t,dy:(a.top+a.bottom)/2}},r.findBestTextLocation=function(t,e,r,n,i){var a,o,s,l,c,h=r.width;e.isClosed?(o=e.len/M.INITIALSEAR
;var S=y[h][c];b&&!b[h][c]&&(S=void 0);var E;return Array.isArray(f.text)&&Array.isArray(f.text[h])&&(E=f.text[h][c]),[i.extendFlat(t,{index:[h,c],distance:a+10,x0:M,x1:k,y0:A,y1:T,xLabelVal:l,yLabelVal:u,zLabelVal:S,text:E})]}}},{"../../components/fx":645,"../../lib":728}],957:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="heatmap",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap"],n.meta={},e.exports=n},{"../../plots/cartesian":782,"./attributes":948,"./calc":949,"./colorbar":951,"./defaults":953,"./hover":956,"./plot":961,"./style":962}],958:[function(t,e,r){"use strict";function n(t){return.5-.25*Math.min(1,.5*t)}function i(t,e,r){var n,i,a,s,l,u,c,h,f,d,p,m,g,v=0;for(s=0;s<e.length;s++){for(n=e[s],i=n[0],a=n[1],p=t[i][a],d=0,f=0,l=0;l<4;l++)u=o[l],(c=t[i+u[0]])&&void 0!==(h=c[a+u[1]])&&(0===d?m=g=h:(m=Math.min(m,h),g=Math.max(g,h)),f++,d+=h);if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][a]=d/f,void 0===p?f<4&&(v=1):(t[i][a]=(1+r)*t[i][a]-r*p,g>m&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o<e.length;o++)s=e[o],t[s[0]][s[1]]=r[s[0]][s[1]];else i(t,e);for(o=0;o<e.length&&!(e[o][2]<4);o++);for(e=e.slice(o),o=0;o<100&&l>.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":728}],959:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,u,c=[],h=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!f&&"category"!==o.type){var p=e.length;if(!(p<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)c=e.slice(0,a);else if(1===a)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],u=1;u<p;u++)c.push(.5*(e[u-1]+e[u]));c.push(1.5*e[p-1]-.5*e[p-2])}if(p<a){var m=c[c.length-1],g=m-c[c.length-2];for(u=p;u<a;u++)m+=g,c.push(m)}}else{l=i||1;var v=t[o._id.charAt(0)+"calendar"];for(s=f||"category"===o.type?o.r2c(r,0,v)||0:Array.isArray(e)&&1===e.length?e[0]:void 0===r?0:o.d2c(r,0,v),u=h||d?0:-.5;u<a;u++)c.push(s+l*u)}return c}},{"../../registry":846}],960:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0,r=0;r<t.length;r++)e=Math.max(e,t[r].length);return e}},{}],961:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){var r=e.length-2,n=o.constrain(o.findBin(t,e),0,r),i=e[n],a=e[n+1],s=o.constrain(n+(t-i)/(a-i)-.5,0,r),l=Math.round(s),u=Math.abs(s-l);return s&&s!==r&&u?{bin0:l,frac:u,bin1:Math.round(l+u/(s-l))}:{bin0:l,bin1:l,frac:0}}function c(t,e){if(void 0!==t){var r=q(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),rt+=e,nt+=r[0]*e,it+=r[1]*e,at+=r[2]*e,r}return[0,0,0,0]}function h(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}var f=r[0].trace,d=f.uid,p=e.xaxis,m=e.yaxis,g=t._fullLayout,v="hm"+d;if(g._paper.selectAll(".contour"+d).remove(),g._infolayer.selectAll("g.rangeslider-container").selectAll(".contour"+d).remove(),!0!==f.visible)return g._paper.selectAll("."+v).remove(),void g._infolayer.selectAll(".cb"+d).remove();var y,b,x,_,w,M,k=r[0].z,A=r[0].x,T=r[0].y,S=a.traceIs(f,"contour"),E=S?"best":f.zsmooth,L=k.length,C=u(k),I=!1,z=!1;for(M=0;void 0===y&&M<A.length-1;)y=p.c2p(A[M]),M++;for(M=A.length-1;void 0===b&&M>0;)b=p.c2p(A[M]),M--;for(b<y&&(x=b,b=y,y=x,I=!0),M=0;void 0===_&&M<T.length-1;)_=m.c2p(T[M]),M++;for(M=T.length-1;void 0===w&&M>0;)w=m.c2p(T[M]),M--;if(w<_&&(x=_,_=w,w=x,z=!0),S&&(A=r[0].xfill,T=r[0].yfill),"fast"!==E){var D="best"===E?0:.5;y=Math.max(-D*p._length,y),b=Math.min((1+D)*p._length,b),_=Math.max(-D*m._length,_),w=Math.min((1+D)*m._length,w)}var P=Math.round(b-y),O=Math.round(w-_),R=P<=0||O<=0,F=e.plot.select(".imagelayer").selectAll("g.hm."+v).data(R?[]:[0]);if(F.enter().append("g").classed("hm",!0).classed(v,!0),F.exit().remove
return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),h=u(["i","j","k"]);if(!c)return void(e.visible=!1);h&&h.forEach(function(t){for(var e=0;e<t.length;++e)t[e]|=0}),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","contour.show","contour.color","contour.width","colorscale","reversescale","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(t){l(t)}),"intensity"in t?(l("intensity"),a(t,e,s,l,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?l("facecolor"):"vertexcolor"in t?l("vertexcolor"):l("color",r))}},{"../../components/colorscale/defaults":613,"../../lib":728,"../../registry":846,"./attributes":984}],989:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.colorbar=t("./colorbar"),n.plot=t("./convert"),n.moduleType="trace",n.name="mesh3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d"],n.meta={},e.exports=n},{"../../plots/gl3d":811,"./attributes":984,"./calc":985,"./colorbar":986,"./convert":987,"./defaults":988}],990:[function(t,e,r){"use strict";function n(t){return{name:{valType:"string",editType:"style"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},line:{color:i({},s.color,{dflt:t}),width:s.width,dash:o,editType:"style"},editType:"style"}}var i=t("../../lib").extendFlat,a=t("../scatter/attributes"),o=t("../../components/drawing/attributes").dash,s=a.line;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",dflt:[],editType:"calc"},high:{valType:"data_array",dflt:[],editType:"calc"},low:{valType:"data_array",dflt:[],editType:"calc"},close:{valType:"data_array",dflt:[],editType:"calc"},line:{width:i({},s.width,{}),dash:i({},o,{}),editType:"style"},increasing:n("#3D9970"),decreasing:n("#FF4136"),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calcIfAutorange"}}},{"../../components/drawing/attributes":627,"../../lib":728,"../scatter/attributes":1031}],991:[function(t,e,r){"use strict";function n(t,e,r,n){o(t,e,r,n),r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".line.dash",e.line.dash)}var i=t("../../lib"),a=t("./ohlc_defaults"),o=t("./direction_defaults"),s=t("./attributes"),l=t("./helpers");e.exports=function(t,e,r,o){function u(r,n){return i.coerce(t,e,s,r,n)}if(l.pushDummyTransformOpts(t,e),0===a(t,e,u,o))return void(e.visible=!1);u("line.width"),u("line.dash"),n(t,e,u,"increasing"),n(t,e,u,"decreasing"),u("text"),u("tickwidth")}},{"../../lib":728,"./attributes":990,"./direction_defaults":992,"./helpers":993,"./ohlc_defaults":995}],992:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){r(n+".showlegend"),!1===t.showlegend&&(e[n].showlegend=!1),r(n+".name",e.name+" - "+n)}},{}],993:[function(t,e,r){"use strict";function n(t){function e(t,e){return t===e?e>o?a=!0:e<o&&(a=!1):a=t<e,o=e,a}function r(t,r){return i(t)&&i(r)&&e(+t,+r)}function n(t,r){return i(t)&&i(r)&&!e(+t,+r)}var a=!0,o=null;return"increasing"===t?r:n}var i=t("fast-isnumeric"),a=t("../../lib");r.pushDummyTransformOpts=function(t,e){var r={type:e.type,_ephemeral:!0};Array.isArray(t.transforms)?t.transforms.push(r):t.transforms=[r]},r.clearEphemeralTransformOpts=function(t){var e=t.transforms;if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]._ephemeral&&e.splice(r,1);0===e.length&&delete t.transforms}},r.copyOHLC=function(t,e){t.open&&(e.open=t.open),t.high&&(e.high=t.high),t.low&&(e.low=t.low),t.close&&(e.close=t.close)},r.makeTransform=function(t,e,r){var n=a.extendFlat([],t.transforms);return n[e.transformIndex]={type:t.type,direction:r,open:t.open,high:t.high,low:t.low,close:t.close},n},r.getFilterFn=function(t){return
}).attr("height",function(t){return t.model.canvasHeight}).style("width",function(t){return t.model.width+2*v.overdrag+"px"}).style("height",function(t){return t.model.height+"px"}).style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var D=e.selectAll("."+v.cn.parcoords).data(E,_);D.exit().remove(),D.enter().append("g").classed(v.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(o),D.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var P=D.selectAll("."+v.cn.parcoordsControlView).data(w,_);P.enter().append("g").classed(v.cn.parcoordsControlView,!0).style("box-sizing","content-box"),P.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var O=P.selectAll("."+v.cn.yAxis).data(function(t){return t.dimensions},_);O.enter().append("g").classed(v.cn.yAxis,!0).each(function(t){I.dimensions.push(t)}),P.each(function(t){c(O,t)}),C.each(function(t){t.lineLayer=g(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,v.scatter),t.viewModel[t.key]=t.lineLayer,I.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),O.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),O.call(b.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;S=!1,T||(t.x=Math.max(-v.overdrag,Math.min(t.model.width+v.overdrag,b.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,O.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),c(O,e),O.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),b.select(this).attr("transform","translate("+t.x+", 0)"),O.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;if(T)return void("ending"===T&&(T=!1));t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,c(O,e),b.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),S=!0,i&&i.axesMoved&&i.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),O.exit().remove();var R=O.selectAll("."+v.cn.axisOverlays).data(w,_);R.enter().append("g").classed(v.cn.axisOverlays,!0),R.selectAll("."+v.cn.axis).remove();var F=R.selectAll("."+v.cn.axis).data(w,_);F.enter().append("g").classed(v.cn.axis,!0),F.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();b.select(this).call(b.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),x.font(F.selectAll("text"),t.model.tickFont)}),F.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),F.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=R.selectAll("."+v.cn.axisHeading).data(w,_);j.enter().append("g").classed(v.cn.axisHeading,!0);var N=j.selectAll("."+v.cn.axisTitle).data(w,_);N.enter().append("text").classed(v.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-sel
return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)};e.node.label.some(h)&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":604,"../../components/color/attributes":603,"../../lib":728,"./attributes":1022,tinycolor2:534}],1027:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1022,"./base_plot":1023,"./calc":1024,"./defaults":1026,"./plot":1028}],1028:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function u(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function c(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+b.sankeyNode).filter(l(t)).call(u)}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(b.sankeyNode).filter(l(t)).call(c)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),b=t("./constants").cn;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=function(e,r){var n=r.link;n.originalEvent=p.event,t._hoverdata=[n],g.click(t,{target:!0})},y=function(e,r,n){var i=r.link;i.originalEvent=p.event,p.select(e).call(h.bind(0,r,n,!0)),g.hover(t,i,"sankey")},x=function(e,i){var s=i.link.trace,l=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),c=u.left+u.width/2,h=u.top+u.height/2,f=g.loneHover({x:c-l.left,y:h-l.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",["Source:",i.link.source.label].join(" "),["Target:",i.link.target.label].join(" ")].filter(n).join("<br>"),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x<c?"right":"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(f,.65),o(f)},_=function(e,n,i){p.select(e).call(f.bind(0,n,i,!0)),t.emit("plotly_unhover",{event:p.event,points:[n.link]}),g.loneUnhover(r._hoverlayer.node())},w=function(e,r,n){var i=r.node;i.originalEvent=p.event,t._hoverdata=[i],p.select(e).call(c,r,n),g.click(t,{target:!0})},M=function(e,r,n){var i=r.node;i.originalEvent=p.event,p.select(e).call(u,r,n),g.hover(t,i,"sankey")},k=function(e,i){var s=i.node.trace,l=p.select(e).select("."+b.nodeRect),u=t._fullLayout._paperdiv.node().getBoundingClientRect(),c=l.node().getBoundingClientRect(),h=c.left-2-u.left,f=c.right+2-u.left,m=c.top+c.height/4-u.top,v=g.loneHover({x0:h,x1:f,y:m,name:p.format(i.valueFormat)(i.node.value)+i.valueSuffix,text:[i.node.label,["Incoming flow count:",i.node.targetLinks.length].join(" "),["Outgoing flow count:",i.node.sourceLinks.length].join(" ")].filter(n).join("<br>"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),f
-1!==["tonextx","tonexty","tonext"].indexOf(i.fill)&&(i._prevtrace=a,a&&(a._nexttrace=i)),a=i):i._prevtrace=i._nexttrace=null}},{}],1047:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,i=e.sizemin||0,a="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=a(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":131}],1048:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c,h=o.isBubble(t),f=(t.line||{}).color;if(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",h?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=f&&!Array.isArray(f)&&e.marker.color!==f?f:h?n.background:n.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",h?1:0)),h&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":604,"../../components/colorscale/defaults":613,"../../components/colorscale/has_colorscale":617,"./subtypes":1052}],1049:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),n._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(l.setClipUrl,r.layerClipId)})}function i(t,e,r,n,i,f,p){function m(t){return M?t.transition():t}function g(t){return t.filter(function(t){return t.vis})}function v(t){return t.id}function y(t){if(t.ids)return v}function b(){return!1}function x(e){var n,i,a,u=e[0].trace,h=o.select(this),f=c.hasMarkers(u),d=c.hasText(u),p=y(u),v=b,x=b;f&&(v=u.marker.maxdisplayed||u._needsCull?g:s.identity),d&&(x=u.marker.maxdisplayed||u._needsCull?g:s.identity),i=h.selectAll("path.point"),n=i.data(v,p);var _=n.enter().append("path").classed("point",!0);M&&_.call(l.pointStyle,u,t).call(l.translatePoints,k,A).style("opacity",0).transition().style("opacity",1);var w=f&&l.tryColorscale(u.marker,""),T=f&&l.tryColorscale(u.marker,"line");n.order(),n.each(function(e){var n=o.select(this),i=m(n);a=l.translatePoint(e,i,k,A),a?(l.singlePointStyle(e,i,u,w,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,k,A),u.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),M?n.exit().transition().style("opacity",0).remove():n.exit().remove(),i=h.selectAll("g"),n=i.data(x,p),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=m(e.select("text"));a=l.translatePoint(t,n,k,A),a?r.layerClipId&&l.hideOutsideRangePoint(t,e,k,A):e.remove()}),n.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=k.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){m(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,k=r.xaxis,A=r.yaxis,T=n[0].trace,S=T.line,E=o.select(f);if(E.call(u.plot,r,p),!0===T.visible){m(E).style("opacity",T.opacity);var L,C,I=T.fill.charAt(T.fill.length-1);"x"!==I&&"y"!==I&&(I=""),n[0].node3=E;var z="",D=[],P=T._prevtrace;P&&(z=P._prevRevpath||"",C=P._nextFill,D=P._polygons);var O,R,F,j,N,B,U,V,H,q="",G="",Y=[],W=s.noop;if(L=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(C&&C.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(S.sha
n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":800,"../scatter/colorbar":1034,"./attributes":1069,"./calc":1070,"./defaults":1071,"./event_data":1072,"./hover":1073,"./plot":1075,"./select":1076}],1075:[function(t,e,r){"use strict";function n(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=c(r,e),i=r.locationmode,a=0;a<t.length;a++){var o=t[a],s=h(i,o.loc,n);o.lonlat=s?s.properties.ct:[u,u]}}function i(t){var e=t.layers.frontplot.selectAll(".trace.scattergeo");e.style("opacity",function(t){return t[0].trace.opacity}),e.each(function(e){var r=e[0].trace,n=a.select(this);n.selectAll("path.point").call(o.pointStyle,r,t.graphDiv),n.selectAll("text").call(o.textPointStyle,r,t.graphDiv)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=a.select(this),r=t.trace,n=r.line||{};e.call(s.stroke,n.color).call(o.dashLine,n.dash||"",n.width||0),"none"!==r.fill&&e.call(s.fill,r.fillcolor)})}var a=t("d3"),o=t("../../components/drawing"),s=t("../../components/color"),l=t("../../lib"),u=t("../../constants/numerical").BADNUM,c=t("../../lib/topojson_utils").getTopojsonFeatures,h=t("../../lib/geo_location_utils").locationToFeature,f=t("../../lib/geojson_utils"),d=t("../scatter/subtypes");e.exports=function(t,e){function r(t){return t[0].trace.uid}function o(t,e){t.lonlat[0]===u&&a.select(e).remove()}for(var s=0;s<e.length;s++)n(e[s],t.topojson);var c=t.layers.frontplot.select(".scatterlayer").selectAll("g.trace.scattergeo").data(e,r);c.enter().append("g").attr("class","trace scattergeo"),c.exit().remove(),c.selectAll("*").remove(),c.each(function(t){var e=t[0].node3=a.select(this),r=t[0].trace;if(d.hasLines(r)||"none"!==r.fill){var n=f.calcTraceToLineCoords(t),i="none"!==r.fill?f.makePolygon(n):f.makeLine(n);e.selectAll("path.js-line").data([{geojson:i,trace:r}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}d.hasMarkers(r)&&e.selectAll("path.point").data(l.identity).enter().append("path").classed("point",!0).each(function(t){o(t,this)}),d.hasText(r)&&e.selectAll("g").data(l.identity).enter().append("g").append("text").each(function(t){o(t,this)})}),i(t)}},{"../../components/color":604,"../../components/drawing":628,"../../constants/numerical":707,"../../lib":728,"../../lib/geo_location_utils":720,"../../lib/geojson_utils":721,"../../lib/topojson_utils":753,"../scatter/subtypes":1052,d3:122}],1076:[function(t,e,r){"use strict";var n=t("../scatter/subtypes"),i=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a,o,s,l,u=t.cd,c=t.xaxis,h=t.yaxis,f=[],d=u[0].trace,p=u[0].node3;if(!n.hasMarkers(d)&&!n.hasText(d))return[];var m=d.marker,g=Array.isArray(m.opacity)?1:m.opacity;if(!1===e)for(l=0;l<u.length;l++)u[l].dim=0;else for(l=0;l<u.length;l++)r=u[l],a=r.lonlat,o=c.c2p(a),s=h.c2p(a),e.contains([o,s])?(f.push({pointNumber:l,lon:a[0],lat:a[1]}),r.dim=0):r.dim=1;return p.selectAll("path.point").style("opacity",function(t){return((t.mo+1||g+1)-1)*(t.dim?i:1)}),p.selectAll("text").style("opacity",function(t){return t.dim?i:1}),f}},{"../../constants/interactions":706,"../scatter/subtypes":1052}],1077:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),a=t("../../constants/gl2d_dashes"),o=t("../../constants/gl2d_markers"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,u=n.line,c=n.marker,h=c.line,f=e.exports=l({x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:s({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:u.color,width:u.width,dash:{valType:"enumerated",values:Object.keys(a),dflt:"solid"}},marker:s({},i("marker"),{symbol:{valType:"enumerated",values:Object.keys(o),dflt:"circle",arrayOk:!0},size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,showscale:c.showscale,colorbar:c.colorbar,line:s({},i("marker.line"),
"../scatter/fillcolor_defaults":1039,"../scatter/line_defaults":1043,"../scatter/line_shape_defaults":1045,"../scatter/marker_defaults":1048,"../scatter/subtypes":1052,"../scatter/text_defaults":1053,"./attributes":1091}],1094:[function(t,e,r){"use strict";var n=t("../scatter/hover"),i=t("../../plots/cartesian/axes");e.exports=function(t,e,r,a){function o(t,e){y.push(t._hovertitle+": "+i.tickText(t,e,"hover").text)}var s=n(t,e,r,a);if(s&&!1!==s[0].index){var l=s[0];if(void 0===l.index){var u=1-l.y0/t.ya._length,c=t.xa._length,h=c*u/2,f=c-h;return l.x0=Math.max(Math.min(l.x0,f),h),l.x1=Math.max(Math.min(l.x1,f),h),s}var d=l.cd[l.index];l.a=d.a,l.b=d.b,l.c=d.c,l.xLabelVal=void 0,l.yLabelVal=void 0;var p=l.trace,m=p._ternary,g=d.hi||p.hoverinfo,v=g.split("+"),y=[];return-1!==v.indexOf("all")&&(v=["a","b","c"]),-1!==v.indexOf("a")&&o(m.aaxis,d.a),-1!==v.indexOf("b")&&o(m.baxis,d.b),-1!==v.indexOf("c")&&o(m.caxis,d.c),l.extraText=y.join("<br>"),s}}},{"../../plots/cartesian/axes":772,"../scatter/hover":1041}],1095:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":839,"../scatter/colorbar":1034,"./attributes":1091,"./calc":1092,"./defaults":1093,"./hover":1094,"./plot":1096,"./select":1097,"./style":1098}],1096:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},a=0;a<e.length;a++)e[a][0].trace._ternary=t;n(t.graphDiv,i,e)}},{"../scatter/plot":1049}],1097:[function(t,e,r){arguments[4][1067][0].apply(r,arguments)},{"../scatter/select":1050,dup:1067}],1098:[function(t,e,r){arguments[4][1068][0].apply(r,arguments)},{"../scatter/style":1051,dup:1068}],1099:[function(t,e,r){"use strict";function n(t){return{valType:"boolean",dflt:!1}}function i(t){return{show:{valType:"boolean",dflt:!1},project:{x:n("x"),y:n("y"),z:n("z")},color:{valType:"color",dflt:a.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:a.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var a=t("../../components/color"),o=t("../../components/colorscale/attributes"),s=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat,u=t("../../plot_api/edit_types").overrideAll,c=e.exports=u({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:o.zauto,cmin:o.zmin,cmax:o.zmax,colorscale:o.colorscale,autocolorscale:l({},o.autocolorscale,{dflt:!1}),reversescale:o.reversescale,showscale:o.showscale,colorbar:s,contours:{x:i("x"),y:i("y"),z:i("z")},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:l({},o.zauto,{}),zmin:l({},o.zmin,{}),zmax:l({},o.zmax,{})}},"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"},{"../../components/color":604,"../../components/colorbar/attributes":605,"../../components/colorscale/attributes":609,"../../lib/extend":717,"../../plot_api/edit_types":756}],1100:[function(t,e,r){"use strict";var n=t("../../components/colors
e.calcdata.columnDragInProgress=!1,_(r,e,0),b(t,n,n.columns.map(function(t){return t.xIndex}))})),c.each(function(e){U.setClipUrl(N.select(this),i(t,e))});var h=c.selectAll("."+j.cn.columnBlock).data(Y.splitToPanels,B.keyFun);h.enter().append("g").classed(j.cn.columnBlock,!0).attr("id",function(t){return t.key}),h.style("cursor",function(t){return t.dragHandle?"ew-resize":t.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var f=h.filter(M),d=h.filter(w);d.call(N.behavior.drag().origin(function(t){return N.event.stopPropagation(),t}).on("drag",S(t,l,-1)).on("dragend",function(){})),s(t,l,f,h),s(t,l,d,h);var p=l.selectAll("."+j.cn.scrollAreaClip).data(B.repeat,B.keyFun);p.enter().append("clipPath").classed(j.cn.scrollAreaClip,!0).attr("id",function(e){return n(t,e)});var m=p.selectAll("."+j.cn.scrollAreaClipRect).data(B.repeat,B.keyFun);m.enter().append("rect").classed(j.cn.scrollAreaClipRect,!0).attr("x",-j.overdrag).attr("y",-j.uplift).attr("fill","none"),m.attr("width",function(t){return t.width+2*j.overdrag}).attr("height",function(t){return t.height+j.uplift}),c.selectAll("."+j.cn.columnBoundary).data(B.repeat,B.keyFun).enter().append("g").classed(j.cn.columnBoundary,!0);var g=c.selectAll("."+j.cn.columnBoundaryClippath).data(B.repeat,B.keyFun);g.enter().append("clipPath").classed(j.cn.columnBoundaryClippath,!0),g.attr("id",function(e){return i(t,e)});var v=g.selectAll("."+j.cn.columnBoundaryRect).data(B.repeat,B.keyFun);v.enter().append("rect").classed(j.cn.columnBoundaryRect,!0).attr("fill","none"),v.attr("width",function(t){return t.columnWidth}).attr("height",function(t){return t.calcdata.height+j.uplift}),T(null,d,l)}},{"../../components/color":604,"../../components/drawing":628,"../../lib":728,"../../lib/gup":725,"../../lib/svg_text_utils":750,"./constants":1108,"./data_preparation_helper":1109,"./data_split_helpers":1110,d3:122}],1114:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.enabled){for(var a=n.target,o=u.nestedProperty(e,a),s=o.get(),c=l.getDataConversions(t,e,a,s),h=i(n,c),f=new Array(r.length),d=0;d<r.length;d++)f[d]=h(s,r[d]);o.set(f)}}function i(t,e){var r=t.func,n=e.d2c,i=e.c2d;switch(r){case"count":return a;case"first":return o;case"last":return s;case"sum":return function(t,e){for(var r=0,a=0;a<e.length;a++){var o=n(t[e[a]]);o!==h&&(r+=o)}return i(r)};case"avg":return function(t,e){for(var r=0,a=0,o=0;o<e.length;o++){var s=n(t[e[o]]);s!==h&&(r+=s,a++)}return a?i(r/a):h};case"min":return function(t,e){for(var r=1/0,a=0;a<e.length;a++){var o=n(t[e[a]]);o!==h&&(r=Math.min(r,o))}return r===1/0?h:i(r)};case"max":return function(t,e){for(var r=-1/0,a=0;a<e.length;a++){var o=n(t[e[a]]);o!==h&&(r=Math.max(r,o))}return r===-1/0?h:i(r)};case"median":return function(t,e){for(var r=[],a=0;a<e.length;a++){var o=n(t[e[a]]);o!==h&&r.push(o)}if(!r.length)return h;r.sort();var s=(r.length-1)/2;return i((r[Math.floor(s)]+r[Math.ceil(s)])/2)};case"mode":return function(t,e){for(var r={},a=0,o=h,s=0;s<e.length;s++){var l=n(t[e[s]]);if(l!==h){var u=r[l]=(r[l]||0)+1;u>a&&(a=u,o=l)}}return a?i(o):h};case"rms":return function(t,e){for(var r=0,a=0,o=0;o<e.length;o++){var s=n(t[e[o]]);s!==h&&(r+=s*s,a++)}return a?i(Math.sqrt(r/a)):h};case"stddev":return function(e,r){var i,a=0,o=0,s=1,l=h;for(i=0;i<r.length&&l===h;i++)l=n(e[r[i]]);if(l===h)return h;for(;i<r.length;i++){var u=n(e[r[i]]);if(u!==h){var c=u-l;a+=c,o+=c*c,s++}}var f="sample"===t.funcmode?s-1:s;return f?Math.sqrt((o-a*a/s)/f):0}}}function a(t,e){return e.length}function o(t,e){return t[e[0]]}function s(t,e){return t[e[e.length-1]]}var l=t("../plots/cartesian/axes"),u=t("../lib"),c=t("../plot_api/plot_schema"),h=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var f=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last"],d