forked from plotly/plotly.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotly-gl3d.min.js
38 lines (38 loc) · 975 KB
/
plotly-gl3d.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* plotly.js (gl3d - minified) v1.15.0
* Copyright 2012-2016, 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 e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(t,e,r){"use strict";var n=t("../src/plotly"),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-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-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var o in i){var a=o.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.Lib.addStyleRule(a,i[o])}},{"../src/plotly":362}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",ascent:850,descent:-150},home:{width:928.6,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",ascent:850,descent:-150},"camera-retro":{width:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",ascent:850,descent:-150},zoombox:{width:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",ascent:850,descent:-150},pan:{width:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",ascent:850,descent:-150},zoom_plus:{width:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",ascent:850,descent:-150},plotlylogo:{width:1542,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",ascent:850,descent:-150},"z-axis":{width:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",ascent:850,descent:-150},"3d_rotate":{width:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",ascent:850,descent:-150},camera:{width:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",ascent:850,descent:-150},movie:{width:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",ascent:850,descent:-150},question:{width:857.1,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",ascent:850,descent:-150},disk:{width:857.1,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",ascent:850,descent:-150},lasso:{width:1031,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",ascent:850,descent:-150},selectbox:{width:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",ascent:850,descent:-150}}},{}],3:[function(t,e,r){e.exports=t("../src/core")},{"../src/core":334}],4:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scatter3d"),t("./surface"),t("./mesh3d")]),e.exports=n},{"./core":3,"./mesh3d":5,"./scatter3d":6,"./surface":7}],5:[function(t,e,r){e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":416}],6:[function(t,e,r){e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":446}],7:[function(t,e,r){e.exports=t("../src/traces/surface")},{"../src/traces/surface":452}],8:[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 o(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=0;return e}function a(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if("number"==typeof t){var n=o(t);return new i(n,n,0)}return new i(t,o(t.length),0);case 2:if("number"==typeof e){var n=o(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new i(t,e,r)}}e.exports=a;var s=t("cubic-hermite"),l=t("binary-search-bounds"),u=i.prototype;u.flush=function(t){var e=l.gt(this._time,t)-1;0>=e||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},u.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),o=this._scratch[0],a=this._state,u=this._velocity,c=this.dimension,f=this.bounds;if(0>i)for(var h=c-1,d=0;c>d;++d,--h)o[d]=a[h];else if(i>=r-1)for(var h=a.length-1,p=t-e[r-1],d=0;c>d;++d,--h)o[d]=a[h]+p*u[h];else{for(var h=c*(i+1)-1,g=e[i],v=e[i+1],m=v-g||1,y=this._scratch[1],b=this._scratch[2],x=this._scratch[3],_=this._scratch[4],w=!0,d=0;c>d;++d,--h)y[d]=a[h],x[d]=u[h]*m,b[d]=a[h+c],_[d]=u[h+c]*m,w=w&&y[d]===b[d]&&x[d]===_[d]&&0===x[d];if(w)for(var d=0;c>d;++d)o[d]=y[d];else s(y,x,b,_,(t-g)/m,o)}for(var A=f[0],M=f[1],d=0;c>d;++d)o[d]=n(A[d],M[d],o[d]);return o},u.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],o=this._state,a=this._velocity,u=this.dimension;if(n>=r-1)for(var c=o.length-1,f=(t-e[r-1],0);u>f;++f,--c)i[f]=a[c];else{for(var c=u*(n+1)-1,h=e[n],d=e[n+1],p=d-h||1,g=this._scratch[1],v=this._scratch[2],m=this._scratch[3],y=this._scratch[4],b=!0,f=0;u>f;++f,--c)g[f]=o[c],m[f]=a[c]*p,v[f]=o[c+u],y[f]=a[c+u]*p,b=b&&g[f]===v[f]&&m[f]===y[f]&&0===m[f];if(b)for(var f=0;u>f;++f)i[f]=0;else{s.derivative(g,m,v,y,(t-h)/p,i);for(var f=0;u>f;++f)i[f]/=p}}return i},u.lastT=function(){var t=this._time;return t[t.length-1]},u.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,o=this._velocity,a=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1];this._time.push(e,t);for(var c=0;2>c;++c)for(var f=0;r>f;++f)i.push(i[a++]),o.push(0);this._time.push(t);for(var f=r;f>0;--f)i.push(n(l[f-1],u[f-1],arguments[f])),o.push(0)}},u.push=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,o=this._velocity,a=i.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],f=s>1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=n(u[h-1],c[h-1],arguments[h]);i.push(d),o.push((d-i[a++])*f)}}},u.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,i=this._velocity,o=this.bounds,a=o[0],s=o[1];this._time.push(t);for(var l=e;l>0;--l)r.push(n(a[l-1],s[l-1],arguments[l])),i.push(0)}},u.move=function(t){var e=this.lastT(),r=this.dimension;if(!(e>=t||arguments.length!==r+1)){var i=this._state,o=this._velocity,a=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,f=c>1e-6?1/c:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];i.push(n(l[h-1],u[h-1],i[a++]+d)),o.push(d*f)}}},u.idle=function(t){var e=this.lastT();if(!(e>t)){var r=this.dimension,i=this._state,o=this._velocity,a=i.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var f=r-1;f>=0;--f)i.push(n(l[f],u[f],i[a]+c*o[a])),o.push(0),a+=1}}},{"binary-search-bounds":9,"cubic-hermite":10}],9:[function(t,e,r){"use strict";function n(t,e,r,n,i,o){var a=["function ",t,"(a,l,h,",n.join(","),"){",o?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return o?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),o?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){var o=new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""));return o()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],10:[function(t,e,r){"use strict";function n(t,e,r,n,i,o){var a=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){o||(o=new Array(t.length));for(var c=t.length-1;c>=0;--c)o[c]=a*t[c]+s*e[c]+l*r[c]+u*n[c];return o}return a*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,o){var a=i-1,s=i*i,l=a*a,u=(1+2*i)*l,c=i*l,f=s*(3-2*i),h=s*a;if(t.length){o||(o=new Array(t.length));for(var d=t.length-1;d>=0;--d)o[d]=u*t[d]+c*e[d]+f*r[d]+h*n[d];return o}return u*t+c*e+f*r+h*n}e.exports=i,e.exports.derivative=n},{}],11:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],l=r[2];return t[0]=i*l-o*s,t[1]=o*a-n*l,t[2]=n*s-i*a,t}e.exports=n},{}],12:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],13:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],14:[function(t,e,r){function n(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}e.exports=n},{}],15:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}e.exports=n},{}],16:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-(1/0),1/0]}function i(t){t=t||{};var e=t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new n(e)}var o=t("binary-search-bounds"),a=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),u=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),f=t("gl-mat4/lookAt"),h=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var g=n.prototype;g.recalcMatrix=function(t){var e=this._time,r=o.le(e,t),n=this.computedMatrix;if(!(0>r)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;16>u;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,f=this.prevMatrix,h=!0,u=0;16>u;++u)f[u]=i[l++];for(var p=this.nextMatrix,u=0;16>u;++u)p[u]=i[l++],h=h&&f[u]===p[u];if(1e-6>c||h)for(var u=0;16>u;++u)n[u]=f[u];else a(n,f,p,(t-e[r])/c)}var g=this.computedUp;g[0]=n[1],g[1]=n[5],g[2]=n[6],d(g,g);var v=this.computedInverse;s(v,n);var m=this.computedEye,y=v[15];m[0]=v[12]/y,m[1]=v[13]/y,m[2]=v[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;3>u;++u)b[u]=m[u]-n[2+4*u]*x}},g.idle=function(t){if(!(t<this.lastT())){for(var e=this._components,r=e.length-16,n=0;16>n;++n)e.push(e[r++]);this._time.push(t)}},g.flush=function(t){var e=o.gt(this._time,t)-2;0>e||(this._time.slice(0,e),this._components.slice(0,16*e))},g.lastT=function(){return this._time[this._time.length-1]},g.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,f(this.computedMatrix,e,r,n));for(var i=0,o=0;3>o;++o)i+=Math.pow(r[o]-e[o],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},g.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&u(i,i,e),r&&l(i,i,r),n&&c(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var v=[0,0,0];g.pan=function(t,e,r,n){v[0]=-(e||0),v[1]=-(r||0),v[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;h(i,i,v),this.setMatrix(t,s(i,i))},g.translate=function(t,e,r,n){v[0]=e||0,v[1]=r||0,v[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;h(i,i,v),this.setMatrix(t,i)},g.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;16>r;++r)this._components.push(e[r])}},g.setDistance=function(t,e){this.computedRadius[0]=e},g.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},g.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":17,"gl-mat4/invert":120,"gl-mat4/lookAt":121,"gl-mat4/rotateX":125,"gl-mat4/rotateY":126,"gl-mat4/rotateZ":127,"gl-mat4/scale":128,"gl-mat4/translate":129,"gl-vec3/normalize":15,"mat4-interpolate":18}],17:[function(t,e,r){arguments[4][9][0].apply(r,arguments)},{dup:9}],18:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,h.translate,h.scale,h.skew,h.perspective,h.quaternion),o=u(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return i&&o?(s(p.translate,h.translate,d.translate,n),s(p.skew,h.skew,d.skew,n),s(p.scale,h.scale,d.scale,n),s(p.perspective,h.perspective,d.perspective,n),f(p.quaternion,h.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0):!1}function i(){return{translate:o(),scale:o(1),skew:o(),perspective:a(),quaternion:a()}}function o(t){return[t||0,t||0,t||0]}function a(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),f=t("quat-slerp"),h=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":116,"gl-vec3/lerp":14,"mat4-decompose":19,"mat4-recompose":21,"quat-slerp":22}],19:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function o(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var a=t("./normalize"),s=t("gl-mat4/create"),l=t("gl-mat4/clone"),u=t("gl-mat4/determinant"),c=t("gl-mat4/invert"),f=t("gl-mat4/transpose"),h={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},d=s(),p=s(),g=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],m=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!a(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(u(p)<1e-8))return!1;var x=d[3],_=d[7],w=d[11],A=d[12],M=d[13],k=d[14],T=d[15];if(0!==x||0!==_||0!==w){g[0]=x,g[1]=_,g[2]=w,g[3]=T;var E=c(p,p);if(!E)return!1;f(p,p),n(y,g,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=A,e[1]=M,e[2]=k,i(v,d),r[0]=h.length(v[0]),h.normalize(v[0],v[0]),s[0]=h.dot(v[0],v[1]),o(v[1],v[1],v[0],1,-s[0]),r[1]=h.length(v[1]),h.normalize(v[1],v[1]),s[0]/=r[1],s[1]=h.dot(v[0],v[2]),o(v[2],v[2],v[0],1,-s[1]),s[2]=h.dot(v[1],v[2]),o(v[2],v[2],v[1],1,-s[2]),r[2]=h.length(v[2]),h.normalize(v[2],v[2]),s[1]/=r[2],s[2]/=r[2],h.cross(m,v[1],v[2]),h.dot(v[0],m)<0)for(var L=0;3>L;L++)r[L]*=-1,v[L][0]*=-1,v[L][1]*=-1,v[L][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[1][2]&&(b[0]=-b[0]),v[0][2]>v[2][0]&&(b[1]=-b[1]),v[1][0]>v[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":20,"gl-mat4/clone":114,"gl-mat4/create":115,"gl-mat4/determinant":116,"gl-mat4/invert":120,"gl-mat4/transpose":130,"gl-vec3/cross":11,"gl-vec3/dot":12,"gl-vec3/length":13,"gl-vec3/normalize":15}],20:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;16>i;i++)t[i]=e[i]*n;return!0}},{}],21:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,o,a,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=a[0],t[7]=a[1],t[11]=a[2],t[15]=a[3],n.identity(i),0!==o[2]&&(i[9]=o[2],n.multiply(t,t,i)),0!==o[1]&&(i[9]=0,i[8]=o[1],n.multiply(t,t,i)),0!==o[0]&&(i[8]=0,i[4]=o[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":115,"gl-mat4/fromRotationTranslation":118,"gl-mat4/identity":119,"gl-mat4/multiply":122,"gl-mat4/scale":128,"gl-mat4/translate":129}],22:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":23}],23:[function(t,e,r){function n(t,e,r,n){var i,o,a,s,l,u=e[0],c=e[1],f=e[2],h=e[3],d=r[0],p=r[1],g=r[2],v=r[3];return o=u*d+c*p+f*g+h*v,0>o&&(o=-o,d=-d,p=-p,g=-g,v=-v),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,l=Math.sin(n*i)/a):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*f+l*g,t[3]=s*h+l*v,t}e.exports=n},{}],24:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s,l,u){var c=e+o+u;if(f>0){var f=Math.sqrt(c+1);t[0]=.5*(a-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-o)/f,t[3]=.5*f}else{var h=Math.max(e,o,u),f=Math.sqrt(2*h-c+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(a-l)/f):o>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+a)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(a+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}e.exports=n},{}],25:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function o(t,e){var r=e[0],n=e[1],o=e[2],a=e[3],s=i(r,n,o,a);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=o/s,t[3]=a/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function a(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),o(r,r);var i=new a(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),f=t("gl-mat4/invert"),h=t("./lib/quatFromFrame"),d=a.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;o(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,a=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],a[0]=r[1],a[1]=r[5],a[2]=r[9];for(var l=0;3>l;++l){for(var u=0,f=0;3>f;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var o=this.computedMatrix,a=o[1],s=o[5],l=o[9],u=n(a,s,l);a/=u,s/=u,l/=u;var c=o[0],f=o[4],h=o[8],d=c*a+f*s+h*l;c-=a*d,f-=s*d,h-=l*d;var p=n(c,f,h);c/=p,f/=p,h/=p;var g=o[2],v=o[6],m=o[10],y=g*a+v*s+m*l,b=g*c+v*f+m*h;g-=y*a+b*c,v-=y*s+b*f,m-=y*l+b*h;var x=n(g,v,m);g/=x,v/=x,m/=x;var _=c*e+a*r,w=f*e+s*r,A=h*e+l*r;this.center.move(t,_,w,A);var M=Math.exp(this.computedRadius[0]);M=Math.max(1e-4,M+i),this.radius.set(t,Math.log(M))},d.rotate=function(t,e,r,o){this.recalcMatrix(t),e=e||0,r=r||0;var a=this.computedMatrix,s=a[0],l=a[4],u=a[8],c=a[1],f=a[5],h=a[9],d=a[2],p=a[6],g=a[10],v=e*s+r*c,m=e*l+r*f,y=e*u+r*h,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),A=i(b,x,_,w);A>1e-6?(b/=A,x/=A,_/=A,w/=A):(b=x=_=0,w=1);var M=this.computedRotation,k=M[0],T=M[1],E=M[2],L=M[3],S=k*w+L*b+T*_-E*x,C=T*w+L*x+E*b-k*_,P=E*w+L*_+k*x-T*b,R=L*w-k*b-T*x-E*_;if(o){b=d,x=p,_=g;var N=Math.sin(o)/n(b,x,_);b*=N,x*=N,_*=N,w=Math.cos(e),S=S*w+R*b+C*_-P*x,C=C*w+R*x+P*b-S*_,P=P*w+R*_+S*x-C*b,R=R*w-S*b-C*x-P*_}var z=i(S,C,P,R);z>1e-6?(S/=z,C/=z,P/=z,R/=z):(S=C=P=0,R=1),this.rotation.set(t,S,C,P,R)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var a=this.computedRotation;h(a,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),o(a,a),this.rotation.set(t,a[0],a[1],a[2],a[3]);for(var s=0,l=0;3>l;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;h(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),o(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;f(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":24,"filtered-vector":8,"gl-mat4/fromQuat":117,"gl-mat4/invert":120,"gl-mat4/lookAt":121}],26:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t){return Math.min(1,Math.max(-1,t))}function o(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var o=0,a=0,s=0;3>s;++s)o+=t[s]*t[s],a+=i[s]*t[s];for(var s=0;3>s;++s)i[s]-=a/o*t[s];return h(i,i),i}function a(t,e,r,n,i,o,a,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([o]),this.angle=l([a,s]),this.angle.bounds=[[-(1/0),-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),
this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;16>u;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||o(r),s=t.radius||1,l=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),h(r,r),i=[].slice.call(i,0,3),h(i,i),"eye"in t){var c=t.eye,p=[c[0]-e[0],c[1]-e[1],c[2]-e[2]];f(i,p,r),n(i[0],i[1],i[2])<1e-6?i=o(r):h(i,i),s=n(p[0],p[1],p[2]);var g=d(r,p)/s,v=d(i,p)/s;u=Math.acos(g),l=Math.acos(v)}return s=Math.log(s),new a(t.zoomMin,t.zoomMax,e,r,i,s,l,u)}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),f=t("gl-vec3/cross"),h=t("gl-vec3/normalize"),d=t("gl-vec3/dot"),p=a.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,o=0,a=0;3>a;++a)o+=e[a]*r[a],i+=e[a]*e[a];for(var s=Math.sqrt(i),l=0,a=0;3>a;++a)r[a]-=e[a]*o/i,l+=r[a]*r[a],e[a]/=s;for(var u=Math.sqrt(l),a=0;3>a;++a)r[a]/=u;var c=this.computedToward;f(c,e,r),h(c,c);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],g=this.computedAngle[1],v=Math.cos(p),m=Math.sin(p),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=v*y,w=m*y,A=b,M=-v*b,k=-m*b,T=y,E=this.computedEye,L=this.computedMatrix,a=0;3>a;++a){var S=_*r[a]+w*c[a]+A*e[a];L[4*a+1]=M*r[a]+k*c[a]+T*e[a],L[4*a+2]=S,L[4*a+3]=0}var C=L[1],P=L[5],R=L[9],N=L[2],z=L[6],I=L[10],O=P*I-R*z,j=R*N-C*I,D=C*z-P*N,F=n(O,j,D);O/=F,j/=F,D/=F,L[0]=O,L[4]=j,L[8]=D;for(var a=0;3>a;++a)E[a]=x[a]+L[2+4*a]*d;for(var a=0;3>a;++a){for(var l=0,B=0;3>B;++B)l+=L[a+4*B]*E[B];L[12+a]=-l}L[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++n)e[n]=r[n];return e}return r};var g=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;g[0]=i[2],g[1]=i[6],g[2]=i[10];for(var o=this.computedUp,a=this.computedRight,s=this.computedToward,l=0;3>l;++l)i[4*l]=o[l],i[4*l+1]=a[l],i[4*l+2]=s[l];c(i,i,n,g);for(var l=0;3>l;++l)o[l]=i[4*l],a[l]=i[4*l+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,a[0],a[1],a[2])}},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var o=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),o[1]),s=o[5],l=o[9],u=n(a,s,l);a/=u,s/=u,l/=u;var c=o[0],f=o[4],h=o[8],d=c*a+f*s+h*l;c-=a*d,f-=s*d,h-=l*d;var p=n(c,f,h);c/=p,f/=p,h/=p;var g=c*e+a*r,v=f*e+s*r,m=h*e+l*r;this.center.move(t,g,v,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,o){var a=1;"number"==typeof r&&(a=0|r),(0>a||a>3)&&(a=1);var s=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[a],c=e[a+4],f=e[a+8];if(o){var h=Math.abs(l),d=Math.abs(c),p=Math.abs(f),g=Math.max(h,d,p);h===g?(l=0>l?-1:1,c=f=0):p===g?(f=0>f?-1:1,l=c=0):(c=0>c?-1:1,l=f=0)}else{var v=n(l,c,f);l/=v,c/=v,f/=v}var m=e[s],y=e[s+4],b=e[s+8],x=m*l+y*c+b*f;m-=l*x,y-=c*x,b-=f*x;var _=n(m,y,b);m/=_,y/=_,b/=_;var w=c*b-f*y,A=f*m-l*b,M=l*y-c*m,k=n(w,A,M);w/=k,A/=k,M/=k,this.center.jump(t,H,G,X),this.radius.idle(t),this.up.jump(t,l,c,f),this.right.jump(t,m,y,b);var T,E;if(2===a){var L=e[1],S=e[5],C=e[9],P=L*m+S*y+C*b,R=L*w+S*A+C*M;T=0>O?-Math.PI/2:Math.PI/2,E=Math.atan2(R,P)}else{var N=e[2],z=e[6],I=e[10],O=N*l+z*c+I*f,j=N*m+z*y+I*b,D=N*w+z*A+I*M;T=Math.asin(i(O)),E=Math.atan2(D,j)}this.angle.jump(t,E,T),this.recalcMatrix(t);var F=e[2],B=e[6],U=e[10],V=this.computedMatrix;u(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,X=V[14]/q,Y=Math.exp(this.computedRadius[0]);this.center.jump(t,H-F*Y,G-B*Y,X-U*Y)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,o){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter,o=o||this.computedUp;var a=o[0],s=o[1],l=o[2],u=n(a,s,l);if(!(1e-6>u)){a/=u,s/=u,l/=u;var c=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=n(c,f,h);if(!(1e-6>d)){c/=d,f/=d,h/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=a*g+s*v+l*m;g-=y*a,v-=y*s,m-=y*l;var b=n(g,v,m);if(!(.01>b&&(g=s*h-l*f,v=l*c-a*h,m=a*f-s*c,b=n(g,v,m),1e-6>b))){g/=b,v/=b,m/=b,this.up.set(t,a,s,l),this.right.set(t,g,v,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*m-l*v,_=l*g-a*m,w=a*v-s*g,A=n(x,_,w);x/=A,_/=A,w/=A;var M=a*c+s*f+l*h,k=g*c+v*f+m*h,T=x*c+_*f+w*h,E=Math.asin(i(M)),L=Math.atan2(T,k),S=this.angle._state,C=S[S.length-1],P=S[S.length-2];C%=2*Math.PI;var R=Math.abs(C+2*Math.PI-L),N=Math.abs(C-L),z=Math.abs(C-2*Math.PI-L);N>R&&(C+=2*Math.PI),N>z&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,P),this.angle.set(t,L,E)}}}}},{"filtered-vector":8,"gl-mat4/invert":120,"gl-mat4/rotate":124,"gl-vec3/cross":11,"gl-vec3/dot":12,"gl-vec3/normalize":15}],27:[function(t,e,r){"use strict";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function i(t){t=t||{};var e=t.eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=o(),f=a(),h=s();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),new n({turntable:c,orbit:f,matrix:h},u)}e.exports=i;var o=t("turntable-camera-controller"),a=t("orbit-camera-controller"),s=t("matrix-camera-controller"),l=n.prototype,u=[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]];u.forEach(function(t){for(var e=t[0],r=[],n=0;n<t[1];++n)r.push("a"+n);var i="var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i]."+t[0]+"("+r.join()+")}";l[e]=Function.apply(null,r.concat(i))}),l.recalcMatrix=function(t){this._active.recalcMatrix(t)},l.getDistance=function(t){return this._active.getDistance(t)},l.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},l.lastT=function(){return this._active.lastT()},l.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(0>e)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},l.getMode=function(){return this._mode}},{"matrix-camera-controller":16,"orbit-camera-controller":25,"turntable-camera-controller":26}],28:[function(t,e,r){function n(t,e){return o(i(t,e))}e.exports=n;var i=t("alpha-complex"),o=t("simplicial-complex-boundary")},{"alpha-complex":29,"simplicial-complex-boundary":32}],29:[function(t,e,r){"use strict";function n(t,e){return i(e).filter(function(r){for(var n=new Array(r.length),i=0;i<r.length;++i)n[i]=e[r[i]];return o(n)*t<1})}e.exports=n;var i=t("delaunay-triangulate"),o=t("circumradius")},{circumradius:30,"delaunay-triangulate":101}],30:[function(t,e,r){function n(t){for(var e=i(t),r=0,n=0;n<t.length;++n)for(var o=t[n],a=0;a<e.length;++a)r+=Math.pow(o[a]-e[a],2);return Math.sqrt(r/t.length)}e.exports=n;var i=t("circumcenter")},{circumcenter:31}],31:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=t.length,i=0;n>i;++i)r+=t[i]*e[i];return r}function i(t){var e=t.length;if(0===e)return[];var r=(t[0].length,a([t.length+1,t.length+1],1)),i=a([t.length+1],1);r[e][e]=0;for(var o=0;e>o;++o){for(var l=0;o>=l;++l)r[l][o]=r[o][l]=2*n(t[o],t[l]);i[o]=n(t[o],t[o])}for(var u=s(r,i),c=0,f=u[e+1],o=0;o<f.length;++o)c+=f[o];for(var h=new Array(e),o=0;e>o;++o){for(var f=u[o],d=0,l=0;l<f.length;++l)d+=f[l];h[o]=d/c}return h}function o(t){if(0===t.length)return[];for(var e=t[0].length,r=a([e]),n=i(t),o=0;o<t.length;++o)for(var s=0;e>s;++s)r[s]+=t[o][s]*n[o];return r}var a=t("dup"),s=t("robust-linear-solve");o.barycenetric=i,e.exports=o},{dup:102,"robust-linear-solve":222}],32:[function(t,e,r){"use strict";function n(t){return o(i(t))}e.exports=n;var i=t("boundary-cells"),o=t("reduce-simplicial-complex")},{"boundary-cells":33,"reduce-simplicial-complex":36}],33:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;e>n;++n)r+=t[n].length;for(var i=new Array(r),o=0,n=0;e>n;++n)for(var a=t[n],s=a.length,l=0;s>l;++l)for(var u=i[o++]=new Array(s-1),c=1;s>c;++c)u[c-1]=a[(l+c)%s];return i}e.exports=n},{}],34:[function(t,e,r){"use strict";function n(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;r>n;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}e.exports=n},{}],35:[function(t,e,r){"use strict";function n(t,e){return i(t,e)||o(t)-o(e)}var i=t("compare-cell"),o=t("cell-orientation");e.exports=n},{"cell-orientation":34,"compare-cell":89}],36:[function(t,e,r){"use strict";function n(t){t.sort(o);for(var e=t.length,r=0,n=0;e>n;++n){var s=t[n],l=a(s);if(0!==l){if(r>0){var u=t[r-1];if(0===i(s,u)&&a(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t("compare-cell"),o=t("compare-oriented-cell"),a=t("cell-orientation");e.exports=n},{"cell-orientation":34,"compare-cell":89,"compare-oriented-cell":35}],37:[function(t,e,r){"use strict";var n=function(){function t(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t}function e(t,e,r){for(var n=(e-t)/Math.max(r-1,1),i=[],o=0;r>o;o++)i.push(t+o*n);return i}function r(){for(var t=[].slice.call(arguments),e=t.map(function(t){return t.length}),r=Math.min.apply(null,e),n=[],i=0;r>i;i++){n[i]=[];for(var o=0;o<t.length;++o)n[i][o]=t[o][i]}return n}function n(t,e,r){for(var n=Math.min.apply(null,[t.length,e.length,r.length]),i=[],o=0;n>o;o++)i.push([t[o],e[o],r[o]]);return i}function i(t){function e(t){for(var n=0;n<t.length;n++)Array.isArray(t[n])?e(t[n],r):r+=t[n]}var r=0;return e(t,r),r}function o(t){for(var e=[],r=0;r<t.length;++r){e[r]=[];for(var n=0;n<t[r].length;++n)e[r][n]=t[r][n]}return e}function a(t){for(var e=[],r=0;r<t.length;++r)e[r]=t[r];return e}function s(t,e){if(t.length!==e.length)return!1;for(var r=t.length;r--;)if(t[r]!==e[r])return!1;return!0}function l(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):f.test(t)&&(n=t.match(h),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3])),!e)for(var i=0;3>i;++i)r[i]=r[i]/255;return r}function u(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):f.test(t)&&(n=t.match(h),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3]),n[4]?r[3]=parseFloat(n[4]):r[3]=1),!e)for(var i=0;3>i;++i)r[i]=r[i]/255;return r}var c={},f=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,.*)?\)$/,h=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(.*)?\)$/;return c.isPlainObject=t,c.linspace=e,c.zip3=n,c.sum=i,c.zip=r,c.isEqual=s,c.copy2D=o,c.copy1D=a,c.str2RgbArray=l,c.str2RgbaArray=u,c};e.exports=n()},{}],38:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}var i=32;r.INT_BITS=i,r.INT_MAX=2147483647,r.INT_MIN=-1<<i-1,r.sign=function(t){return(t>0)-(0>t)},r.abs=function(t){var e=t>>i-1;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(e>t)},r.max=function(t,e){return t^(t^e)&-(e>t)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,e|=r,e|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var o=new Array(256);!function(t){for(var e=0;256>e;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(o),r.reverse=function(t){return o[255&t]<<24|o[t>>>8&255]<<16|o[t>>>16&255]<<8|o[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],39:[function(t,e,r){(function(e){"use strict";function n(){try{var t=new Uint8Array(1);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function i(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t){return this instanceof o?(o.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof t?a(this,t):"string"==typeof t?s(this,t,arguments.length>1?arguments[1]:"utf8"):l(this,t)):arguments.length>1?new o(t,arguments[1]):new o(t)}function a(t,e){if(t=g(t,0>e?0:0|v(e)),!o.TYPED_ARRAY_SUPPORT)for(var r=0;e>r;r++)t[r]=0;return t}function s(t,e,r){"string"==typeof r&&""!==r||(r="utf8");var n=0|y(e,r);return t=g(t,n),t.write(e,r),t}function l(t,e){if(o.isBuffer(e))return u(t,e);if(Q(e))return c(t,e);if(null==e)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(e.buffer instanceof ArrayBuffer)return f(t,e);if(e instanceof ArrayBuffer)return h(t,e)}return e.length?d(t,e):p(t,e)}function u(t,e){var r=0|v(e.length);return t=g(t,r),e.copy(t,0,0,r),t}function c(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function f(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function h(t,e){return e.byteLength,o.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=o.prototype):t=f(t,new Uint8Array(e)),t}function d(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function p(t,e){var r,n=0;"Buffer"===e.type&&Q(e.data)&&(r=e.data,n=0|v(r.length)),t=g(t,n);for(var i=0;n>i;i+=1)t[i]=255&r[i];return t}function g(t,e){o.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=o.prototype):t.length=e;var r=0!==e&&e<=o.poolSize>>>1;return r&&(t.parent=$),t}function v(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function m(t,e){if(!(this instanceof m))return new m(t,e);var r=new o(t,e);return delete r.parent,r}function y(t,e){"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if(e=0|e,r=void 0===r||r===1/0?this.length:0|r,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return S(this,e,r);case"binary":return C(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function x(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;n>a;a++){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[r+a]=s}return a}function _(t,e,r,n){return Y(q(e,t.length-r),t,r,n)}function w(t,e,r,n){return Y(H(e),t,r,n)}function A(t,e,r,n){return w(t,e,r,n)}function M(t,e,r,n){return Y(X(e),t,r,n)}function k(t,e,r,n){return Y(G(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?W.fromByteArray(t):W.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;r>i;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(r>=i+s){var l,u,c,f;switch(s){case 1:128>o&&(a=o);break;case 2:l=t[i+1],128===(192&l)&&(f=(31&o)<<6|63&l,f>127&&(a=f));break;case 3:l=t[i+1],u=t[i+2],128===(192&l)&&128===(192&u)&&(f=(15&o)<<12|(63&l)<<6|63&u,f>2047&&(55296>f||f>57343)&&(a=f));break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(f=(15&o)<<18|(63&l)<<12|(63&u)<<6|63&c,f>65535&&1114112>f&&(a=f))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return L(n)}function L(t){var e=t.length;if(K>=e)return String.fromCharCode.apply(String,t);for(var r="",n=0;e>n;)r+=String.fromCharCode.apply(String,t.slice(n,n+=K));return r}function S(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function P(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=e;r>o;o++)i+=V(t[o]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function N(t,e,r){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function z(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>i||a>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range")}function I(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);o>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);o>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function j(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("index out of range");if(0>r)throw new RangeError("index out of range")}function D(t,e,r,n,i){return i||j(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return i||j(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function B(t){if(t=U(t).replace(J,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function U(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function V(t){return 16>t?"0"+t.toString(16):t.toString(16)}function q(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;n>a;a++){if(r=t.charCodeAt(a),r>55295&&57344>r){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(56320>r){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,128>r){if((e-=1)<0)break;o.push(r)}else if(2048>r){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e}function G(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);a++)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function X(t){return W.toByteArray(B(t))}function Y(t,e,r,n){for(var i=0;n>i&&!(i+r>=e.length||i>=t.length);i++)e[i+r]=t[i];return i}var W=t("base64-js"),Z=t("ieee754"),Q=t("isarray");r.Buffer=o,r.SlowBuffer=m,r.INSPECT_MAX_BYTES=50,o.poolSize=8192;var $={};o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),o._augment=function(t){return t.__proto__=o.prototype,t},o.TYPED_ARRAY_SUPPORT?(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})):(o.prototype.length=void 0,o.prototype.parent=void 0),o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);a>i&&t[i]===e[i];)++i;return i!==a&&(r=t[i],n=e[i]),n>r?-1:r>n?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Q(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new o(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;r++)e+=t[r].length;var n=new o(e),i=0;for(r=0;r<t.length;r++){var a=t[r];a.copy(n,i),i+=a.length}return n},o.byteLength=y,o.prototype._isBuffer=!0,o.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(this,0,t):b.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:0===o.compare(this,t)},o.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},o.prototype.compare=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:o.compare(this,t)},o.prototype.indexOf=function(t,e){function r(t,e,r){for(var n=-1,i=0;r+i<t.length;i++)if(t[r+i]===e[-1===n?0:i-n]){if(-1===n&&(n=i),i-n+1===e.length)return r+n}else n=-1;return-1}if(e>2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(0>e&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(o.isBuffer(t))return r(this,t,e);if("number"==typeof t)return o.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):r(this,[t],e);throw new TypeError("val must be string, number or Buffer")},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var i=n;n=e,e=0|r,r=i}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"binary":return A(this,t,e,r);case"base64":return M(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;o.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),t>e&&(e=t);var n;if(o.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=o.prototype;else{var i=e-t;n=new o(i,void 0);for(var a=0;i>a;a++)n[a]=this[a+t]}return n.length&&(n.parent=this.parent||this),n},o.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||N(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},o.prototype.readUIntBE=function(t,e,r){t=0|t,e=0|e,r||N(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||N(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||N(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),Z.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),Z.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),Z.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),Z.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||z(this,t,e,r,Math.pow(2,8*r),0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},o.prototype.writeUIntBE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||z(this,t,e,r,Math.pow(2,8*r),0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},o.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);z(this,t,e,r,i-1,-i)}var o=0,a=1,s=0>t?1:0;for(this[e]=255&t;++o<r&&(a*=256);)this[e+o]=(t/a>>0)-s&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);z(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0>t?1:0;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=(t/a>>0)-s&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||z(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&r>n&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,a=n-r;if(this===t&&e>r&&n>e)for(i=a-1;i>=0;i--)t[i+e]=this[i+r];else if(1e3>a||!o.TYPED_ARRAY_SUPPORT)for(i=0;a>i;i++)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},o.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new RangeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>r||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=q(t.toString()),o=i.length;for(n=e;r>n;n++)this[n]=i[n%o]}return this}};var J=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":40,ieee754:41,isarray:42}],40:[function(t,e,r){"use strict";function n(){var t,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=e.length;for(t=0;r>t;t++)l[t]=e[t];for(t=0;r>t;++t)u[e.charCodeAt(t)]=t;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63}function i(t){var e,r,n,i,o,a,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[s-2]?2:"="===t[s-1]?1:0,a=new c(3*s/4-o),n=o>0?s-4:s;var l=0;for(e=0,r=0;n>e;e+=4,r+=3)i=u[t.charCodeAt(e)]<<18|u[t.charCodeAt(e+1)]<<12|u[t.charCodeAt(e+2)]<<6|u[t.charCodeAt(e+3)],a[l++]=(16711680&i)>>16,a[l++]=(65280&i)>>8,a[l++]=255&i;return 2===o?(i=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,
a[l++]=255&i):1===o&&(i=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,a[l++]=i>>8&255,a[l++]=255&i),a}function o(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}function a(t,e,r){for(var n,i=[],a=e;r>a;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(o(n));return i.join("")}function s(t){for(var e,r=t.length,n=r%3,i="",o=[],s=16383,u=0,c=r-n;c>u;u+=s)o.push(a(t,u,u+s>c?c:u+s));return 1===n?(e=t[r-1],i+=l[e>>2],i+=l[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=l[e>>10],i+=l[e>>4&63],i+=l[e<<2&63],i+="="),o.push(i),o.join("")}r.toByteArray=i,r.fromByteArray=s;var l=[],u=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],41:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+f],f+=h,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:(d?-1:1)*(1/0);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,f=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),e+=a+f>=1?h/l:h*Math.pow(2,1-f),e*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*l-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+d]=255&a,d+=p,a/=256,u-=8);t[r+d-p]|=128*g}},{}],42:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],43:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function o(t){return"number"==typeof t}function a(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!o(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,o,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],s(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),r.apply(this,o)}else if(a(r))for(o=Array.prototype.slice.call(arguments,1),u=r.slice(),n=u.length,l=0;n>l;l++)u[l].apply(this,o);return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?a(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,a(this._events[t])&&!this._events[t].warned&&(r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(0>n)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){var e;return e=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)}},{}],44:[function(t,e,r){function n(){c=!1,s.length?u=s.concat(u):f=-1,u.length&&i()}function i(){if(!c){var t=setTimeout(n);c=!0;for(var e=u.length;e;){for(s=u,u=[];++f<e;)s&&s[f].run();f=-1,e=u.length}s=null,c=!1,clearTimeout(t)}}function o(t,e){this.fun=t,this.array=e}function a(){}var s,l=e.exports={},u=[],c=!1,f=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new o(t,e)),1!==u.length||c||setTimeout(i,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=a,l.addListener=a,l.once=a,l.off=a,l.removeListener=a,l.removeAllListeners=a,l.emit=a,l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],45:[function(t,e,r){"use strict";function n(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function i(t,e){return t[0]-e[0]||t[1]-e[1]}function o(t){return t.map(n).sort(i)}function a(t,e,r){return e in t?t[e]:r}function s(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var n=!!a(r,"delaunay",!0),i=!!a(r,"interior",!0),s=!!a(r,"exterior",!0),h=!!a(r,"infinity",!1);if(!i&&!s||0===t.length)return[];var d=l(t,e);if(n||i!==s||h){for(var p=u(t.length,o(e)),g=0;g<d.length;++g){var v=d[g];p.addTriangle(v[0],v[1],v[2])}return n&&c(t,p),s?i?h?f(p,0,h):p.cells():f(p,1,h):f(p,-1)}return d}var l=t("./lib/monotone"),u=t("./lib/triangulation"),c=t("./lib/delaunay"),f=t("./lib/filter");e.exports=s},{"./lib/delaunay":46,"./lib/filter":47,"./lib/monotone":48,"./lib/triangulation":49}],46:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var s=e.opposite(n,i);if(!(0>s)){if(n>i){var l=n;n=i,i=l,l=a,a=s,s=l}e.isConstraint(n,i)||o(t[n],t[i],t[a],t[s])<0&&r.push(n,i)}}function i(t,e){for(var r=[],i=t.length,a=e.stars,s=0;i>s;++s)for(var l=a[s],u=1;u<l.length;u+=2){var c=l[u];if(!(s>c||e.isConstraint(s,c))){for(var f=l[u-1],h=-1,d=1;d<l.length;d+=2)if(l[d-1]===c){h=l[d];break}0>h||o(t[s],t[c],t[f],t[h])<0&&r.push(s,c)}}for(;r.length>0;){for(var c=r.pop(),s=r.pop(),f=-1,h=-1,l=a[s],p=1;p<l.length;p+=2){var g=l[p-1],v=l[p];g===c?h=v:v===c&&(f=g)}0>f||0>h||o(t[s],t[c],t[f],t[h])>=0||(e.flip(s,c),n(t,e,r,f,s,h),n(t,e,r,s,h,f),n(t,e,r,h,c,f),n(t,e,r,c,f,h))}}var o=t("robust-in-sphere")[4];t("binary-search-bounds");e.exports=i},{"binary-search-bounds":50,"robust-in-sphere":51}],47:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=o,this.boundary=a}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function o(t,e){for(var r=t.cells(),o=r.length,a=0;o>a;++a){var s=r[a],l=s[0],u=s[1],c=s[2];c>u?l>u&&(s[0]=u,s[1]=c,s[2]=l):l>c&&(s[0]=c,s[1]=l,s[2]=u)}r.sort(i);for(var f=new Array(o),a=0;a<f.length;++a)f[a]=0;var h=[],d=[],p=new Array(3*o),g=new Array(3*o),v=null;e&&(v=[]);for(var m=new n(r,p,g,f,h,d,v),a=0;o>a;++a)for(var s=r[a],y=0;3>y;++y){var l=s[y],u=s[(y+1)%3],b=p[3*a+y]=m.locate(u,l,t.opposite(u,l)),x=g[3*a+y]=t.isConstraint(l,u);0>b&&(x?d.push(a):(h.push(a),f[a]=1),e&&v.push([u,l,-1]))}return m}function a(t,e,r){for(var n=0,i=0;i<t.length;++i)e[i]===r&&(t[n++]=t[i]);return t.length=n,t}function s(t,e,r){var n=o(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;for(var i=1,s=n.active,l=n.next,u=n.flags,c=n.cells,f=n.constraint,h=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;for(var p=(c[d],0);3>p;++p){var g=h[3*d+p];g>=0&&0===u[g]&&(f[3*d+p]?l.push(g):(s.push(g),u[g]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var m=a(c,u,e);return r?m.concat(n.boundary):m}var l=t("binary-search-bounds");e.exports=s;var u=n.prototype;u.locate=function(){var t=[0,0,0];return function(e,r,n){var o=e,a=r,s=n;return n>r?e>r&&(o=r,a=n,s=e):e>n&&(o=n,a=e,s=r),0>o?-1:(t[0]=o,t[1]=a,t[2]=s,l.eq(this.cells,t,i))}}()},{"binary-search-bounds":50}],48:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function i(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function o(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r?r:t.type!==p&&(r=d(t.a,t.b,e.b))?r:t.idx-e.idx}function a(t,e){return d(t.a,t.b,e)}function s(t,e,r,n,i){for(var o=h.lt(e,n,a),s=h.gt(e,n,a),l=o;s>l;++l){for(var u=e[l],c=u.lowerIds,f=c.length;f>1&&d(r[c[f-2]],r[c[f-1]],n)>0;)t.push([c[f-1],c[f-2],i]),f-=1;c.length=f,c.push(i);for(var p=u.upperIds,f=p.length;f>1&&d(r[p[f-2]],r[p[f-1]],n)<0;)t.push([p[f-2],p[f-1],i]),f-=1;p.length=f,p.push(i)}}function l(t,e){var r;return(r=t.a[0]<e.a[0]?d(t.a,t.b,e.a):d(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?d(t.a,t.b,e.b):d(e.b,e.a,t.b),r||t.idx-e.idx)}function u(t,e,r){var i=h.le(t,r,l),o=t[i],a=o.upperIds,s=a[a.length-1];o.upperIds=[s],t.splice(i+1,0,new n(r.a,r.b,r.idx,[s],a))}function c(t,e,r){var n=r.a;r.a=r.b,r.b=n;var i=h.eq(t,r,l),o=t[i],a=t[i-1];a.upperIds=o.upperIds,t.splice(i,1)}function f(t,e){for(var r=t.length,a=e.length,l=[],f=0;r>f;++f)l.push(new i(t[f],null,p,f));for(var f=0;a>f;++f){var h=e[f],d=t[h[0]],m=t[h[1]];d[0]<m[0]?l.push(new i(d,m,v,f),new i(m,d,g,f)):d[0]>m[0]&&l.push(new i(m,d,v,f),new i(d,m,g,f))}l.sort(o);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],f=0,_=l.length;_>f;++f){var w=l[f],A=w.type;A===p?s(x,b,t,w.a,w.idx):A===v?u(b,t,w):c(b,t,w)}return x}var h=t("binary-search-bounds"),d=t("robust-orientation")[3],p=0,g=1,v=2;e.exports=f},{"binary-search-bounds":50,"robust-orientation":225}],49:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;i>n;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}function o(t,e){for(var r=new Array(t),i=0;t>i;++i)r[i]=[];return new n(r,e)}var a=t("binary-search-bounds");e.exports=o;var s=n.prototype;s.isConstraint=function(){function t(t,e){return t[0]-e[0]||t[1]-e[1]}var e=[0,0];return function(r,n){return e[0]=Math.min(r,n),e[1]=Math.max(r,n),a.eq(this.edges,e,t)>=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;i>n;n+=2)if(r[n]===t)return r[n-1];return-1},s.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},s.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],o=0,a=i.length;a>o;o+=2)e.push([i[o],i[o+1]]);return e},s.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],o=0,a=i.length;a>o;o+=2){var s=i[o],l=i[o+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{"binary-search-bounds":50}],50:[function(t,e,r){"use strict";function n(t,e,r,n,i){var o=["function ",t,"(a,l,h,",n.join(","),"){",i?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a[m]"];return i?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),i?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){var o=new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""));return o()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],51:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),o=0,a=0;o<t.length;++o)o!==e&&(i[a++]=t[n][o]);return r}function i(t){for(var e=new Array(t),r=0;t>r;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m",n,"[",t-r-2,"]"].join("")}return e}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function a(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return a(e,t)}function s(t){return t&!0?"-":""}function l(t){if(2===t.length)return[["diff(",a(t[0][0],t[1][1]),",",a(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",o(l(n(t,r))),",",s(r),t[0][r],")"].join(""));return e}function u(t,e){for(var r=[],n=0;e-2>n;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return o(r)}function c(t){for(var e=[],r=[],a=i(t),s=0;t>s;++s)a[0][s]="1",a[t-1][s]="w"+s;for(var s=0;t>s;++s)0===(1&s)?e.push.apply(e,l(n(a,s))):r.push.apply(r,l(n(a,s)));for(var c=o(e),f=o(r),h="exactInSphere"+t,d=[],s=0;t>s;++s)d.push("m"+s);for(var p=["function ",h,"(",d.join(),"){"],s=0;t>s;++s){p.push("var w",s,"=",u(s,t),";");for(var g=0;t>g;++g)g!==s&&p.push("var w",s,"m",g,"=scale(w",s,",m",g,"[0]);")}p.push("var p=",c,",n=",f,",d=diff(p,n);return d[d.length-1];}return ",h);var x=new Function("sum","diff","prod","scale",p.join(""));return x(m,y,v,b)}function f(){return 0}function h(){return 0}function d(){return 0}function p(t){var e=_[t.length];return e||(e=_[t.length]=c(t.length)),e.apply(void 0,t)}function g(){for(;_.length<=x;)_.push(c(_.length));for(var t=[],r=["slow"],n=0;x>=n;++n)t.push("a"+n),r.push("o"+n);for(var i=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;x>=n;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere"),r.push(i.join(""));var o=Function.apply(void 0,r);e.exports=o.apply(void 0,[p].concat(_));for(var n=0;x>=n;++n)e.exports[n]=_[n]}var v=t("two-product"),m=t("robust-sum"),y=t("robust-subtract"),b=t("robust-scale"),x=6,_=[f,h,d];g()},{"robust-scale":226,"robust-subtract":227,"robust-sum":228,"two-product":240}],52:[function(t,e,r){"use strict";function n(t){var e=x(t),r=b(y(e),t);return 0>r?[e,w(e,1/0)]:r>0?[w(e,-(1/0)),e]:[e,e]}function i(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var i=e[n],o=t[i[0]],a=t[i[1]];r[n]=[Math.min(o[0],a[0]),Math.min(o[1],a[1]),Math.max(o[0],a[0]),Math.max(o[1],a[1])]}return r}function o(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[n[0],n[1],n[0],n[1]]}return e}function a(t,e,r){var n=[];return v(r,function(r,i){var o=e[r],a=e[i];if(o[0]!==a[0]&&o[0]!==a[1]&&o[1]!==a[0]&&o[1]!==a[1]){var s=t[o[0]],l=t[o[1]],u=t[a[0]],c=t[a[1]];m(s,l,u,c)&&n.push([r,i])}}),n}function s(t,e,r,n){var i=[];return v(r,n,function(r,n){var o=e[r];if(o[0]!==n&&o[1]!==n){var a=t[n],s=t[o[0]],l=t[o[1]];m(s,l,a,a)&&i.push([r,n])}}),i}function l(t,e,r,n,i){function o(e){if(e>=t.length)return a[e-t.length];var r=t[e];return[y(r[0]),y(r[1])]}for(var a=[],s=0;s<r.length;++s){var l=r[s],u=l[0],c=l[1],f=e[u],h=e[c],d=A(_(t[f[0]]),_(t[f[1]]),_(t[h[0]]),_(t[h[1]]));if(d){var p=a.length+t.length;a.push(d),n.push([u,p],[c,p])}}n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=o(t[1]),n=o(e[1]);return b(r[0],n[0])||b(r[1],n[1])});for(var s=n.length-1;s>=0;--s){var g=n[s],u=g[0],v=e[u],m=v[0],x=v[1],w=t[m],M=t[x];if((w[0]-M[0]||w[1]-M[1])<0){var k=m;m=x,x=k}v[0]=m;var T,E=v[1]=g[1];for(i&&(T=v[2]);s>0&&n[s-1][0]===u;){var g=n[--s],L=g[1];i?e.push([E,L,T]):e.push([E,L]),E=L}i?e.push([E,x,T]):e.push([E,x])}return a}function u(t,e,r){for(var i=t.length+e.length,o=new g(i),a=r,s=0;s<e.length;++s){var l=e[s],u=n(l[0]),c=n(l[1]);a.push([u[0],c[0],u[1],c[1]]),t.push([x(l[0]),x(l[1])])}v(a,function(t,e){o.link(t,e)});for(var f=0,h=!0,d=new Array(i),s=0;i>s;++s){var p=o.find(s);p===s?(d[s]=f,t[f++]=t[s]):(h=!1,d[s]=-1)}if(t.length=f,h)return null;for(var s=0;i>s;++s)d[s]<0&&(d[s]=d[o.find(s)]);return d}function c(t,e){return t[0]-e[0]||t[1]-e[1]}function f(t,e){var r=t[0]-e[0]||t[1]-e[1];return r?r:t[2]<e[2]?-1:t[2]>e[2]?1:0}function h(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=t[n],o=e[i[0]],a=e[i[1]];i[0]=Math.min(o,a),i[1]=Math.max(o,a)}else for(var n=0;n<t.length;++n){var i=t[n],o=i[0],a=i[1];i[0]=Math.min(o,a),i[1]=Math.max(o,a)}r?t.sort(f):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=i(t,e),c=a(t,e,n),f=o(t),d=s(t,e,n,f),p=l(t,e,c,d,r),g=u(t,p,f);return h(e,g,r),g?!0:c.length>0||d.length>0}function p(t,e,r){var n,i=!1;if(r){n=e;for(var o=new Array(e.length),a=0;a<e.length;++a){var s=e[a];o[a]=[s[0],s[1],r[a]]}e=o}for(;d(t,e,!!r);)i=!0;if(r&&i){n.length=0,r.length=0;for(var a=0;a<e.length;++a){var s=e[a];n.push([s[0],s[1]]),r.push(s[2])}}return i}e.exports=p;var g=t("union-find"),v=t("box-intersect"),m=(t("compare-cell"),t("robust-segment-intersect")),y=t("big-rat"),b=t("big-rat/cmp"),x=t("big-rat/to-float"),_=t("rat-vec"),w=t("nextafter"),A=t("./lib/rat-seg-intersect")},{"./lib/rat-seg-intersect":53,"big-rat":57,"big-rat/cmp":55,"big-rat/to-float":70,"box-intersect":71,"compare-cell":89,nextafter:79,"rat-vec":81,"robust-segment-intersect":84,"union-find":85}],53:[function(t,e,r){"use strict";function n(t,e){return s(o(t[0],e[1]),o(t[1],e[0]))}function i(t,e,r,i){var o=u(e,t),s=u(i,r),h=n(o,s);if(0===l(h))return null;var d=u(t,r),p=n(s,d),g=a(p,h);return c(t,f(o,g))}e.exports=i;var o=t("big-rat/mul"),a=t("big-rat/div"),s=t("big-rat/sub"),l=t("big-rat/sign"),u=t("rat-vec/sub"),c=t("rat-vec/add"),f=t("rat-vec/muls");t("big-rat/to-float")},{"big-rat/div":56,"big-rat/mul":66,"big-rat/sign":68,"big-rat/sub":69,"big-rat/to-float":70,"rat-vec/add":80,"rat-vec/muls":82,"rat-vec/sub":83}],54:[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":64}],55:[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},{}],56:[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":64}],57:[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,f=0;if(o(t))r=t.clone();else if("string"==typeof t)r=s(t);else{if(0===t)return[a(0),a(1)];if(t===Math.floor(t))r=a(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),f-=256;r=a(t)}}if(i(e))r.mul(e[1]),c=e[0].clone();else if(o(e))c=e.clone();else if("string"==typeof e)c=s(e);else if(e)if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f+=256;c=a(e)}else c=a(1);return f>0?r=r.shln(f):0>f&&(c=c.shln(-f)),l(r,c)}var i=t("./is-rat"),o=t("./lib/is-bn"),a=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),u=t("./div");e.exports=n},{"./div":56,"./is-rat":58,"./lib/is-bn":62,"./lib/num-to-bn":63,"./lib/rationalize":64,"./lib/str-to-bn":65}],58:[function(t,e,r){"use strict";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t("./lib/is-bn");e.exports=n},{"./lib/is-bn":62}],59:[function(t,e,r){"use strict";function n(t){return t.cmp(new i(0))}var i=t("bn.js");e.exports=n},{"bn.js":67}],60:[function(t,e,r){"use strict";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var n=0,i=0;e>i;i++){var o=r[i];n+=o*Math.pow(67108864,i)}return t.sign?-n:n}e.exports=n},{}],61:[function(t,e,r){"use strict";function n(t){var e=o(i.lo(t));if(32>e)return e;var r=o(i.hi(t));return r>20?52:r+32}var i=t("double-bits"),o=t("bit-twiddle").countTrailingZeros;e.exports=n},{"bit-twiddle":38,"double-bits":78}],62:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&Boolean(t.words)}t("bn.js");e.exports=n},{"bn.js":67}],63:[function(t,e,r){"use strict";function n(t){var e=o.exponent(t);return 52>e?new i(t):new i(t*Math.pow(2,52-e)).shln(e-52)}var i=t("bn.js"),o=t("double-bits");e.exports=n},{"bn.js":67,"double-bits":78}],64:[function(t,e,r){"use strict";function n(t,e){var r=o(t),n=o(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];0>n&&(t=t.neg(),e=e.neg());var a=t.gcd(e);return a.cmpn(1)?[t.div(a),e.div(a)]:[t,e]}var i=t("./num-to-bn"),o=t("./bn-sign");e.exports=n},{"./bn-sign":59,"./num-to-bn":63}],65:[function(t,e,r){"use strict";function n(t){return new i(t)}var i=t("bn.js");e.exports=n},{"bn.js":67}],66:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":64}],67:[function(t,e,r){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,"le"!==e&&"be"!==e||(r=e,e=10),void(null!==t&&this._init(t||0,e||10,r||"be")))}function o(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;i>o;o++){var a=t.charCodeAt(o)-48;n<<=4,n|=a>=49&&54>=a?a-49+10:a>=17&&22>=a?a-17+10:15&a}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;o>a;a++){var s=t.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function s(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function u(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function c(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function f(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function h(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function d(t){h.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26,i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&36>=e),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.sign=!0),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){0>t&&(this.sign=!0,t=-t),67108864>t?(this.words=[67108863&t],this.length=1):4503599627370496>t?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(9007199254740992>t),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o=0;if("be"===n)for(var i=t.length-1,a=0;i>=0;i-=3){var s=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,o+=24,o>=26&&(o-=26,a++)}else if("le"===n)for(var i=0,a=0;i<t.length;i+=3){var s=t[i]|t[i+1]<<8|t[i+2]<<16;this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,o+=24,o>=26&&(o-=26,a++)}return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;for(var n=0,r=t.length-6,i=0;r>=e;r-=6){var a=o(t,r,r+6);this.words[i]|=a<<n&67108863,this.words[i+1]|=a>>>26-n&4194303,n+=24,n>=26&&(n-=26,i++)}if(r+6!==e){var a=o(t,e,r+6);this.words[i]|=a<<n&67108863,this.words[i+1]|=a>>>26-n&4194303}this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;67108863>=i;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,l=Math.min(o,o-s)+r,u=0,c=r;l>c;c+=n)u=a(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){for(var f=1,u=a(t,c,t.length,e),c=0;s>c;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.sign=this.sign,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],v=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){if(t=t||10,16===t||"hex"===t){for(var n="",i=0,e=0|e||1,o=0,a=0;a<this.length;a++){var s=this.words[a],l=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,n=0!==o||a!==this.length-1?p[6-l.length]+l+n:l+n,i+=2,i>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!==0;)n="0"+n;return this.sign&&(n="-"+n),n}if(t===(0|t)&&t>=2&&36>=t){var u=g[t],c=v[t],n="",f=this.clone();for(f.sign=!1;0!==f.cmpn(0);){var h=f.modn(c).toString(t);f=f.idivn(c),n=0!==f.cmpn(0)?p[u-h.length]+h+n:h+n}return 0===this.cmpn(0)&&(n="0"+n),this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t){this.strip();var e=new Array(this.byteLength());e[0]=0;var r=this.clone();if("le"!==t)for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[e.length-n-1]=i}else for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[n]=i}return e},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},i.prototype.bitLength=function(){var t=0,e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},i.prototype.ior=function(t){for(this.sign=this.sign||t.sign;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.iand=function(t){this.sign=this.sign&&t.sign;var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.ixor=function(t){this.sign=this.sign||t.sign;var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return e?this.words[n]=this.words[n]|1<<i:this.words[n]=this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var e=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign){t.sign=!1;var e=this.isub(t);return t.sign=!0,e._normSign()}var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++){var e=r.words[o]+n.words[o]+i;this.words[o]=67108863&e,i=e>>>26}for(;0!==i&&o<r.length;o++){var e=r.words[o]+i;this.words[o]=67108863&e,i=e>>>26}if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(t){if(t.sign&&!this.sign){t.sign=!1;var e=this.sub(t);return t.sign=!0,e}if(!t.sign&&this.sign){this.sign=!1;var e=t.sub(this);return this.sign=!0,e}return this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var o=0,a=0;a<i.length;a++){var e=n.words[a]-i.words[a]+o;o=e>>26,this.words[a]=67108863&e}for(;0!==o&&a<n.length;a++){var e=n.words[a]+o;o=e>>26,this.words[a]=67108863&e}if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.sign=!0),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)},i.prototype._smallMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;
for(var r=0,n=0;n<e.length-1;n++){for(var i=r>>>26,o=67108863&r,a=Math.min(n,t.length-1),s=Math.max(0,n-this.length+1);a>=s;s++){var l=n-s,u=0|this.words[l],c=0|t.words[s],f=u*c,h=67108863&f;i=i+(f/67108864|0)|0,h=h+o|0,o=67108863&h,i=i+(h>>>26)|0}e.words[n]=o,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i<e.length-1;i++){var o=n;n=0;for(var a=67108863&r,s=Math.min(i,t.length-1),l=Math.max(0,i-this.length+1);s>=l;l++){var u=i-l,c=0|this.words[u],f=0|t.words[l],h=c*f,d=67108863&h;o=o+(h/67108864|0)|0,d=d+a|0,a=67108863&d,o=o+(d>>>26)|0,n+=o>>>26,o&=67108863}e.words[i]=a,r=o,o=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){var r;return r=this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,o=0,a=Math.min(n,r-1),s=Math.max(0,n-e+1);a>=s;s++){var l=n-s,u=this.words[l],c=t.words[s],f=u*c,h=67108863&f;i+=f/67108864|0,h+=o,o=67108863&h,i+=h>>>26}this.words[n]=o,this.words[n+1]+=i,i=0}for(var i=0,l=1;l<this.length;l++){var d=this.words[l]+i;this.words[l]=67108863&d,i=d>>>26}return this.strip()},i.prototype.imuln=function(t){r("number"==typeof t);for(var e=0,n=0;n<this.length;n++){var i=this.words[n]*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!==e){for(var o=0,a=0;a<this.length;a++){var s=this.words[a]&i,l=this.words[a]-s<<e;this.words[a]=l|o,o=s>>>26-e}o&&(this.words[a]=o,this.length++)}if(0!==n){for(var a=this.length-1;a>=0;a--)this.words[a+n]=this.words[a];for(var a=0;n>a;a++)this.words[a]=0;this.length+=n}return this.strip()},i.prototype.ishrn=function(t,e,n){r("number"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,l=n;if(i-=a,i=Math.max(0,i),l){for(var u=0;a>u;u++)l.words[u]=this.words[u];l.length=a}if(0===a);else if(this.length>a){this.length-=a;for(var u=0;u<this.length;u++)this.words[u]=this.words[u+a]}else this.words[0]=0,this.length=1;for(var c=0,u=this.length-1;u>=0&&(0!==c||u>=i);u--){var f=this.words[u];this.words[u]=c<<26-o|f>>>o,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return!1;var o=this.words[n];return!!(o&i)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),0>t?this.isubn(-t):this.sign?1===this.length&&this.words[0]<t?(this.words[0]=t-this.words[0],this.sign=!1,this):(this.sign=!1,this.isubn(t),this.sign=!0,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),0>t)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.sign=!1,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,o=t.length+n;if(this.words.length<o){for(var a=new Array(o),i=0;i<this.length;i++)a[i]=this.words[i];this.words=a}else i=this.length;for(this.length=Math.max(this.length,o);i<this.length;i++)this.words[i]=0;for(var s=0,i=0;i<t.length;i++){var l=this.words[i+n]+s,u=t.words[i]*e;l-=67108863&u,s=(l>>26)-(u/67108864|0),this.words[i+n]=67108863&l}for(;i<this.length-n;i++){var l=this.words[i+n]+s;s=l>>26,this.words[i+n]=67108863&l}if(0===s)return this.strip();r(-1===s),s=0;for(var i=0;i<this.length;i++){var l=-this.words[i]+s;s=l>>26,this.words[i]=67108863&l}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),o=t,a=o.words[o.length-1],s=this._countBits(a);r=26-s,0!==r&&(o=o.shln(r),n.ishln(r),a=o.words[o.length-1]);var l,u=n.length-o.length;if("mod"!==e){l=new i(null),l.length=u+1,l.words=new Array(l.length);for(var c=0;c<l.length;c++)l.words[c]=0}var f=n.clone()._ishlnsubmul(o,1,u);f.sign||(n=f,l&&(l.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*n.words[o.length+h]+n.words[o.length+h-1];for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,h);n.sign;)d--,n.sign=!1,n._ishlnsubmul(o,1,h),0!==n.cmpn(0)&&(n.sign=!n.sign);l&&(l.words[h]=d)}return l&&l.strip(),n.strip(),"div"!==e&&0!==r&&n.ishrn(r),{div:l?l:null,mod:n}},i.prototype.divmod=function(t,e){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var n,o,a=this.neg().divmod(t,e);return"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=0===a.mod.cmpn(0)?a.mod:t.sub(a.mod)),{div:n,mod:o}}if(!this.sign&&t.sign){var n,a=this.divmod(t.neg(),e);return"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),e):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div").div},i.prototype.mod=function(t){return this.divmod(t,"mod").mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?e.mod.isub(t):e.mod,n=t.shrn(1),i=t.andln(1),o=r.cmp(n);return 0>o||1===i&&0===o?e.div:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(67108863>=t);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(67108863>=t);for(var e=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var o=new i(1),a=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&n.isEven();)e.ishrn(1),n.ishrn(1),++u;for(var c=n.clone(),f=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.ishrn(1),o.isEven()&&a.isEven()?(o.ishrn(1),a.ishrn(1)):(o.iadd(c).ishrn(1),a.isub(f).ishrn(1));for(;n.isEven();)n.ishrn(1),s.isEven()&&l.isEven()?(s.ishrn(1),l.ishrn(1)):(s.iadd(c).ishrn(1),l.isub(f).ishrn(1));e.cmp(n)>=0?(e.isub(n),o.isub(s),a.isub(l)):(n.isub(e),s.isub(o),l.isub(a))}return{a:s,b:l,gcd:n.ishln(u)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var o=new i(1),a=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(;e.isEven();)e.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(s).ishrn(1);for(;n.isEven();)n.ishrn(1),a.isEven()?a.ishrn(1):a.iadd(s).ishrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a)):(n.isub(e),a.isub(o))}return 0===e.cmpn(1)?o:a},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;for(var n=0;e.isEven()&&r.isEven();n++)e.ishrn(1),r.ishrn(1);for(;;){for(;e.isEven();)e.ishrn(1);for(;r.isEven();)r.ishrn(1);var i=e.cmp(r);if(0>i){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.ishln(n)},i.prototype.invm=function(t){return this.egcd(t).a.mod(t)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n){for(var o=this.length;n+1>o;o++)this.words[o]=0;return this.words[n]|=i,this.length=n+1,this}for(var a=i,o=n;0!==a&&o<this.length;o++){var s=this.words[o];s+=a,a=s>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},i.prototype.cmpn=function(t){var e=0>t;if(e&&(t=-t),this.sign&&!e)return-1;if(!this.sign&&e)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var n=this.words[0];r=n===t?0:t>n?-1:1}return this.sign&&(r=-r),r},i.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var e=this.ucmp(t);return this.sign?-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=this.words[r],i=t.words[r];if(n!==i){i>n?e=-1:n>i&&(e=1);break}}return e},i.red=function(t){return new h(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};s.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},s.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength();while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},s.prototype.split=function(t,e){t.ishrn(this.n,0,e)},s.prototype.imulK=function(t){return t.imul(this.k)},n(l,s),l.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;n>i;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];e.words[e.length++]=o&r;for(var i=10;i<t.length;i++){var a=t.words[i];t.words[i-10]=(a&r)<<4|o>>>22,o=a}t.words[i-10]=o>>>22,t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e,r=0,n=0;n<t.length;n++){var i=t.words[n];e=64*i,r+=977*i,e+=r/67108864|0,r&=67108863,t.words[n]=r,r=e}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(u,s),n(c,s),n(f,s),f.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*t.words[r]+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function y(t){if(m[t])return m[t];var y;if("k256"===t)y=new l;else if("p224"===t)y=new u;else if("p192"===t)y=new c;else{if("p25519"!==t)throw new Error("Unknown prime "+t);y=new f}return m[t]=y,y},h.prototype._verify1=function(t){r(!t.sign,"red works only with positives"),r(t.red,"red works only with red numbers")},h.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},h.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},h.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},h.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},h.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},h.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},h.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},h.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.shln(e))},h.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},h.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},h.prototype.isqr=function(t){return this.imul(t,t)},h.prototype.sqr=function(t){return this.mul(t,t)},h.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new i(1)).ishrn(2),o=this.pow(t,n);return o}for(var a=this.m.subn(1),s=0;0!==a.cmpn(0)&&0===a.andln(1);)s++,a.ishrn(1);r(0!==a.cmpn(0));var l=new i(1).toRed(this),u=l.redNeg(),c=this.m.subn(1).ishrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var h=this.pow(f,a),o=this.pow(t,a.addn(1).ishrn(1)),d=this.pow(t,a),p=s;0!==d.cmp(l);){for(var g=d,v=0;0!==g.cmp(l);v++)g=g.redSqr();r(p>v);var m=this.pow(h,new i(1).ishln(p-v-1));o=o.redMul(m),h=m.redSqr(),d=d.redMul(h),p=v}return o},h.prototype.invm=function(t){var e=t._invmp(this.m);return e.sign?(e.sign=!1,this.imod(e).redNeg()):this.imod(e)},h.prototype.pow=function(t,e){var r=[];if(0===e.cmpn(0))return new i(1);for(var n=e.clone();0!==n.cmpn(0);)r.push(n.andln(1)),n.ishrn(1);for(var o=t,a=0;a<r.length&&0===r[a];a++,o=this.sqr(o));if(++a<r.length)for(var n=this.sqr(o);a<r.length;a++,n=this.sqr(n))0!==r[a]&&(o=this.mul(o,n));return o},h.prototype.convertTo=function(t){var e=t.mod(this.m);return e===t?e.clone():e},h.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new d(t)},n(d,h),d.prototype.convertTo=function(t){return this.imod(t.shln(this.shift))},d.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},d.prototype.imul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).ishrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},d.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).ishrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},d.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof e||e,this)},{}],68:[function(t,e,r){"use strict";function n(t){return i(t[0])*i(t[1])}var i=t("./lib/bn-sign");e.exports=n},{"./lib/bn-sign":59}],69:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":64}],70:[function(t,e,r){"use strict";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.divmod(r),a=n.div,s=i(a),l=n.mod;if(0===l.cmpn(0))return s;if(s){var u=o(s)+4,c=i(l.shln(u).divRound(r));return 0>s&&(c=-c),s+c*Math.pow(2,-u)}var f=r.bitLength()-l.bitLength()+53,c=i(l.shln(f).divRound(r));return 1023>f?c*Math.pow(2,-f):(c*=Math.pow(2,-1023),c*Math.pow(2,1023-f))}var i=t("./lib/bn-to-num"),o=t("./lib/ctz");e.exports=n},{"./lib/bn-to-num":60,"./lib/ctz":61}],71:[function(t,e,r){"use strict";function n(t,e){for(var r=0;t>r;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function i(t,e,r,i){for(var o=0,a=0,s=0,l=t.length;l>s;++s){var u=t[s];if(!n(e,u)){for(var c=0;2*e>c;++c)r[o++]=u[c];i[a++]=s}}return a}function o(t,e,r,n){var o=t.length,a=e.length;if(!(0>=o||0>=a)){var s=t[0].length>>>1;if(!(0>=s)){var l,u=f.mallocDouble(2*s*o),c=f.mallocInt32(o);if(o=i(t,s,u,c),o>0){if(1===s&&n)h.init(o),l=h.sweepComplete(s,r,0,o,u,c,0,o,u,c);else{var p=f.mallocDouble(2*s*a),g=f.mallocInt32(a);a=i(e,s,p,g),a>0&&(h.init(o+a),l=1===s?h.sweepBipartite(s,r,0,o,u,c,0,a,p,g):d(s,r,n,o,u,c,a,p,g),f.free(p),f.free(g))}f.free(u),f.free(c)}return l}}}function a(t,e){c.push([t,e])}function s(t){return c=[],o(t,t,a,!0),c}function l(t,e){return c=[],o(t,e,a,!1),c}function u(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return"function"==typeof e?o(t,t,e,!0):l(t,e);case 3:return o(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}e.exports=u;var c,f=t("typedarray-pool"),h=t("./lib/sweep"),d=t("./lib/intersect")},{"./lib/intersect":73,"./lib/sweep":77,"typedarray-pool":242}],72:[function(t,e,r){"use strict";function n(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",n,"(",w.join(),"){","var ",u,"=2*",o,";"],l="for(var i="+c+","+p+"="+u+"*"+c+";i<"+f+";++i,"+p+"+="+u+"){var x0="+h+"["+a+"+"+p+"],x1="+h+"["+a+"+"+p+"+"+o+"],xi="+d+"[i];",A="for(var j="+g+","+b+"="+u+"*"+g+";j<"+v+";++j,"+b+"+="+u+"){var y0="+m+"["+a+"+"+b+"],"+(r?"y1="+m+"["+a+"+"+b+"+"+o+"],":"")+"yi="+y+"[j];";return t?i.push(l,_,":",A):i.push(A,_,":",l),r?i.push("if(y1<x0||x1<y0)continue;"):e?i.push("if(y0<=x0||x1<y0)continue;"):i.push("if(y0<x0||x1<y0)continue;"),i.push("for(var k="+a+"+1;k<"+o+";++k){var r0="+h+"[k+"+p+"],r1="+h+"[k+"+o+"+"+p+"],b0="+m+"[k+"+b+"],b1="+m+"[k+"+o+"+"+b+"];if(r1<b0||b1<r0)continue "+_+";}var "+x+"="+s+"("),e?i.push("yi,xi"):i.push("xi,yi"),i.push(");if("+x+"!==void 0)return "+x+";}}}"),{name:n,code:i.join("")}}function i(t){function e(e,r){var o=n(e,r,t);i.push(o.code),a.push("return "+o.name+"("+w.join()+");")}var r="bruteForce"+(t?"Full":"Partial"),i=[],o=w.slice();t||o.splice(3,0,l);var a=["function "+r+"("+o.join()+"){"];a.push("if("+f+"-"+c+">"+v+"-"+g+"){"),t?(e(!0,!1),a.push("}else{"),e(!1,!1)):(a.push("if("+l+"){"),e(!0,!0),a.push("}else{"),e(!0,!1),a.push("}}else{if("+l+"){"),e(!1,!0),a.push("}else{"),e(!1,!1),a.push("}")),a.push("}}return "+r);var s=i.join("")+a.join(""),u=new Function(s);return u()}var o="d",a="ax",s="vv",l="fp",u="es",c="rs",f="re",h="rb",d="ri",p="rp",g="bs",v="be",m="bb",y="bi",b="bp",x="rv",_="Q",w=[o,a,s,c,f,h,d,g,v,m,y];r.partial=i(!1),r.full=i(!0)},{}],73:[function(t,e,r){"use strict";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(k*r);L.length<n&&(l.free(L),L=l.mallocInt32(n));var i=u.nextPow2(T*r);i>S&&(l.free(S),S=l.mallocDouble(i))}function i(t,e,r,n,i,o,a,s,l){var u=k*t;L[u]=e,L[u+1]=r,L[u+2]=n,L[u+3]=i,L[u+4]=o,L[u+5]=a;var c=T*t;S[c]=s,S[c+1]=l}function o(t,e,r,n,i,o,a,s,l,u,c){var f=2*t,h=l*f,d=u[h+e];t:for(var p=i,g=i*f;o>p;++p,g+=f){var v=a[g+e],m=a[g+e+t];if(!(v>d||d>m||n&&d===v)){for(var y=s[p],b=e+1;t>b;++b){var v=a[g+b],m=a[g+b+t],x=u[h+b],_=u[h+b+t];if(x>m||v>_)continue t}var w;if(w=n?r(c,y):r(y,c),void 0!==w)return w}}}function a(t,e,r,n,i,o,a,s,l,u){var c=2*t,f=s*c,h=l[f+e];t:for(var d=n,p=n*c;i>d;++d,p+=c){var g=a[d];if(g!==u){var v=o[p+e],m=o[p+e+t];if(!(v>h||h>m)){for(var y=e+1;t>y;++y){var v=o[p+y],m=o[p+y+t],b=l[f+y],x=l[f+y+t];if(b>m||v>x)continue t}var _=r(g,u);if(void 0!==_)return _}}}}function s(t,e,r,s,l,u,c,g,E){n(t,s+c);var C,P=0,R=2*t;for(i(P++,0,0,s,0,c,r?16:0,-(1/0),1/0),r||i(P++,0,0,c,0,s,1,-(1/0),1/0);P>0;){P-=1;var N=P*k,z=L[N],I=L[N+1],O=L[N+2],j=L[N+3],D=L[N+4],F=L[N+5],B=P*T,U=S[B],V=S[B+1],q=1&F,H=!!(16&F),G=l,X=u,Y=g,W=E;if(q&&(G=g,X=E,Y=l,W=u),!(2&F&&(O=_(t,z,I,O,G,X,V),I>=O)||4&F&&(I=w(t,z,I,O,G,X,U),I>=O))){var Z=O-I,Q=D-j;if(H){if(y>t*Z*(Z+Q)){if(C=d.scanComplete(t,z,e,I,O,G,X,j,D,Y,W),void 0!==C)return C;continue}}else{if(t*Math.min(Z,Q)<v){if(C=f(t,z,e,q,I,O,G,X,j,D,Y,W),void 0!==C)return C;continue}if(m>t*Z*Q){if(C=d.scanBipartite(t,z,e,q,I,O,G,X,j,D,Y,W),void 0!==C)return C;continue}}var $=b(t,z,I,O,G,X,U,V);if($>I)if(v>t*($-I)){if(C=h(t,z+1,e,I,$,G,X,j,D,Y,W),void 0!==C)return C}else if(z===t-2){if(C=q?d.sweepBipartite(t,e,j,D,Y,W,I,$,G,X):d.sweepBipartite(t,e,I,$,G,X,j,D,Y,W),void 0!==C)return C}else i(P++,z+1,I,$,j,D,q,-(1/0),1/0),i(P++,z+1,j,D,I,$,1^q,-(1/0),1/0);if(O>$){var K=p(t,z,j,D,Y,W),J=Y[R*K+z],tt=x(t,z,K,D,Y,W,J);if(D>tt&&i(P++,z,$,O,tt,D,(4|q)+(H?16:0),J,V),K>j&&i(P++,z,$,O,j,K,(2|q)+(H?16:0),U,J),K+1===tt){if(C=H?a(t,z,e,$,O,G,X,K,Y,W[K]):o(t,z,e,q,$,O,G,X,K,Y,W[K]),void 0!==C)return C}else if(tt>K){var et;if(H){if(et=A(t,z,$,O,G,X,J),et>$){var rt=x(t,z,$,et,G,X,J);if(z===t-2){if(rt>$&&(C=d.sweepComplete(t,e,$,rt,G,X,K,tt,Y,W),void 0!==C))return C;if(et>rt&&(C=d.sweepBipartite(t,e,rt,et,G,X,K,tt,Y,W),void 0!==C))return C}else rt>$&&i(P++,z+1,$,rt,K,tt,16,-(1/0),1/0),et>rt&&(i(P++,z+1,rt,et,K,tt,0,-(1/0),1/0),i(P++,z+1,K,tt,rt,et,1,-(1/0),1/0))}}else et=q?M(t,z,$,O,G,X,J):A(t,z,$,O,G,X,J),et>$&&(z===t-2?C=q?d.sweepBipartite(t,e,K,tt,Y,W,$,et,G,X):d.sweepBipartite(t,e,$,et,G,X,K,tt,Y,W):(i(P++,z+1,$,et,K,tt,q,-(1/0),1/0),i(P++,z+1,K,tt,$,et,1^q,-(1/0),1/0)))}}}}}e.exports=s;var l=t("typedarray-pool"),u=t("bit-twiddle"),c=t("./brute"),f=c.partial,h=c.full,d=t("./sweep"),p=t("./median"),g=t("./partition"),v=128,m=1<<22,y=1<<22,b=g("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),x=g("lo===p0",["p0"]),_=g("lo<p0",["p0"]),w=g("hi<=p0",["p0"]),A=g("lo<=p0&&p0<=hi",["p0"]),M=g("lo<p0&&p0<=hi",["p0"]),k=6,T=2,E=1024,L=l.mallocInt32(E),S=l.mallocDouble(E)},{"./brute":72,"./median":74,"./partition":75,"./sweep":77,"bit-twiddle":38,"typedarray-pool":242}],74:[function(t,e,r){"use strict";function n(t,e,r,n,i,o){for(var a=2*t,s=a*(r+1)+e,l=r+1;n>l;++l,s+=a)for(var u=i[s],c=l,f=a*(l-1);c>r&&i[f+e]>u;--c,f-=a){for(var h=f,d=f+a,p=0;a>p;++p,++h,++d){var g=i[h];i[h]=i[d],i[d]=g}var v=o[c];o[c]=o[c-1],o[c-1]=v}}function i(t,e,r,i,o,l){if(r+1>=i)return r;for(var u=r,c=i,f=i+r>>>1,h=2*t,d=f,p=o[h*f+e];c>u;){if(s>c-u){n(t,e,u,c,o,l),p=o[h*f+e];break}var g=c-u,v=Math.random()*g+u|0,m=o[h*v+e],y=Math.random()*g+u|0,b=o[h*y+e],x=Math.random()*g+u|0,_=o[h*x+e];b>=m?_>=b?(d=y,p=b):m>=_?(d=v,p=m):(d=x,p=_):b>=_?(d=y,p=b):_>=m?(d=v,p=m):(d=x,p=_);for(var w=h*(c-1),A=h*d,M=0;h>M;++M,++w,++A){var k=o[w];o[w]=o[A],o[A]=k}var T=l[c-1];l[c-1]=l[d],l[d]=T,d=a(t,e,u,c-1,o,l,p);for(var w=h*(c-1),A=h*d,M=0;h>M;++M,++w,++A){var k=o[w];o[w]=o[A],o[A]=k}var T=l[c-1];if(l[c-1]=l[d],l[d]=T,d>f){for(c=d-1;c>u&&o[h*(c-1)+e]===p;)c-=1;c+=1}else{if(!(f>d))break;for(u=d+1;c>u&&o[h*u+e]===p;)u+=1}}return a(t,e,r,f,o,l,o[h*f+e])}e.exports=i;var o=t("./partition"),a=o("lo<p0",["p0"]),s=8},{"./partition":75}],75:[function(t,e,r){"use strict";function n(t,e){var r="abcdef".split("").concat(e),n=[];return t.indexOf("lo")>=0&&n.push("lo=e[k+n]"),t.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(i.replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}e.exports=n;var i="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],76:[function(t,e,r){"use strict";function n(t,e){4*h>=e?i(0,e-1,t):f(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;e>=i;++i){for(var o=r[n++],a=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(o>u)break;if(u===o&&a>c)break;r[l]=u,r[l+1]=c,l-=2}r[l]=o,r[l+1]=a}}function o(t,e,r){t*=2,e*=2;var n=r[t],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function a(t,e,r){t*=2,e*=2,r[t]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){t*=2,e*=2,r*=2;var i=n[t],o=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=o}function l(t,e,r,n,i){t*=2,e*=2,i[t]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function u(t,e,r){t*=2,e*=2;var n=r[t],i=r[e];return i>n?!1:n===i?r[t+1]>r[e+1]:!0}function c(t,e,r,n){t*=2;var i=n[t];return e>i?!0:i===e?n[t+1]<r:!1}function f(t,e,r){var n=(e-t+1)/6|0,d=t+n,p=e-n,g=t+e>>1,v=g-n,m=g+n,y=d,b=v,x=g,_=m,w=p,A=t+1,M=e-1,k=0;u(y,b,r)&&(k=y,y=b,b=k),u(_,w,r)&&(k=_,_=w,w=k),u(y,x,r)&&(k=y,y=x,x=k),u(b,x,r)&&(k=b,b=x,x=k),u(y,_,r)&&(k=y,y=_,_=k),u(x,_,r)&&(k=x,x=_,_=k),u(b,w,r)&&(k=b,b=w,w=k),u(b,x,r)&&(k=b,b=x,x=k),u(_,w,r)&&(k=_,_=w,w=k);for(var T=r[2*b],E=r[2*b+1],L=r[2*_],S=r[2*_+1],C=2*y,P=2*x,R=2*w,N=2*d,z=2*g,I=2*p,O=0;2>O;++O){var j=r[C+O],D=r[P+O],F=r[R+O];r[N+O]=j,r[z+O]=D,r[I+O]=F}a(v,t,r),a(m,e,r);for(var B=A;M>=B;++B)if(c(B,T,E,r))B!==A&&o(B,A,r),++A;else if(!c(B,L,S,r))for(;;){if(c(M,L,S,r)){c(M,T,E,r)?(s(B,A,M,r),++A,--M):(o(B,M,r),--M);break}if(--M<B)break}l(t,A-1,T,E,r),l(e,M+1,L,S,r),h>=A-2-t?i(t,A-2,r):f(t,A-2,r),h>=e-(M+2)?i(M+2,e,r):f(M+2,e,r),h>=M-A?i(A,M,r):f(A,M,r)}e.exports=n;var h=32},{}],77:[function(t,e,r){"use strict";function n(t){var e=f.nextPow2(t);g.length<e&&(c.free(g),g=c.mallocInt32(e)),v.length<e&&(c.free(v),v=c.mallocInt32(e)),m.length<e&&(c.free(m),m=c.mallocInt32(e)),y.length<e&&(c.free(y),y=c.mallocInt32(e)),b.length<e&&(c.free(b),b=c.mallocInt32(e)),x.length<e&&(c.free(x),x=c.mallocInt32(e));var r=8*e;_.length<r&&(c.free(_),_=c.mallocDouble(r))}function i(t,e,r,n){var i=e[n],o=t[r-1];t[i]=o,e[o]=i}function o(t,e,r,n){t[r]=n,e[n]=r}function a(t,e,r,n,a,s,l,u,c,f){for(var p=0,b=2*t,x=t-1,w=b-1,A=r;n>A;++A){var M=s[A],k=b*A;_[p++]=a[k+x],_[p++]=-(M+1),_[p++]=a[k+w],_[p++]=M}for(var A=l;u>A;++A){var M=f[A]+d,T=b*A;_[p++]=c[T+x],_[p++]=-M,_[p++]=c[T+w],_[p++]=M}var E=p>>>1;h(_,E);for(var L=0,S=0,A=0;E>A;++A){var C=0|_[2*A+1];if(C>=d)C=C-d|0,i(m,y,S--,C);else if(C>=0)i(g,v,L--,C);else if(-d>=C){C=-C-d|0;for(var P=0;L>P;++P){var R=e(g[P],C);if(void 0!==R)return R}o(m,y,S++,C)}else{C=-C-1|0;for(var P=0;S>P;++P){var R=e(C,m[P]);if(void 0!==R)return R}o(g,v,L++,C)}}}function s(t,e,r,n,a,s,l,u,c,f){for(var d=0,p=2*t,w=t-1,A=p-1,M=r;n>M;++M){var k=s[M]+1<<1,T=p*M;_[d++]=a[T+w],_[d++]=-k,_[d++]=a[T+A],_[d++]=k}for(var M=l;u>M;++M){var k=f[M]+1<<1,E=p*M;_[d++]=c[E+w],_[d++]=1|-k,_[d++]=c[E+A],_[d++]=1|k}var L=d>>>1;h(_,L);for(var S=0,C=0,P=0,M=0;L>M;++M){var R=0|_[2*M+1],N=1&R;if(L-1>M&&R>>1===_[2*M+3]>>1&&(N=2,M+=1),0>R){for(var z=-(R>>1)-1,I=0;P>I;++I){var O=e(b[I],z);if(void 0!==O)return O}if(0!==N)for(var I=0;S>I;++I){var O=e(g[I],z);if(void 0!==O)return O}if(1!==N)for(var I=0;C>I;++I){var O=e(m[I],z);if(void 0!==O)return O}0===N?o(g,v,S++,z):1===N?o(m,y,C++,z):2===N&&o(b,x,P++,z)}else{var z=(R>>1)-1;0===N?i(g,v,S--,z):1===N?i(m,y,C--,z):2===N&&i(b,x,P--,z)}}}function l(t,e,r,n,a,s,l,u,c,f,p,m){var y=0,b=2*t,x=e,w=e+t,A=1,M=1;n?M=d:A=d;for(var k=a;s>k;++k){var T=k+A,E=b*k;_[y++]=l[E+x],_[y++]=-T,_[y++]=l[E+w],_[y++]=T}for(var k=c;f>k;++k){var T=k+M,L=b*k;_[y++]=p[L+x],_[y++]=-T}var S=y>>>1;h(_,S);for(var C=0,k=0;S>k;++k){var P=0|_[2*k+1];if(0>P){var T=-P,R=!1;if(T>=d?(R=!n,T-=d):(R=!!n,T-=1),R)o(g,v,C++,T);else{var N=m[T],z=b*T,I=p[z+e+1],O=p[z+e+1+t];t:for(var j=0;C>j;++j){var D=g[j],F=b*D;if(!(O<l[F+e+1]||l[F+e+1+t]<I)){for(var B=e+2;t>B;++B)if(p[z+B+t]<l[F+B]||l[F+B+t]<p[z+B])continue t;var U,V=u[D];if(U=n?r(N,V):r(V,N),void 0!==U)return U}}}}else i(g,v,C--,P-A)}}function u(t,e,r,n,i,o,a,s,l,u,c){for(var f=0,p=2*t,v=e,m=e+t,y=n;i>y;++y){var b=y+d,x=p*y;_[f++]=o[x+v],_[f++]=-b,_[f++]=o[x+m],_[f++]=b}for(var y=s;l>y;++y){var b=y+1,w=p*y;_[f++]=u[w+v],_[f++]=-b}var A=f>>>1;h(_,A);for(var M=0,y=0;A>y;++y){var k=0|_[2*y+1];if(0>k){var b=-k;if(b>=d)g[M++]=b-d;else{b-=1;var T=c[b],E=p*b,L=u[E+e+1],S=u[E+e+1+t];t:for(var C=0;M>C;++C){var P=g[C],R=a[P];if(R===T)break;var N=p*P;if(!(S<o[N+e+1]||o[N+e+1+t]<L)){for(var z=e+2;t>z;++z)if(u[E+z+t]<o[N+z]||o[N+z+t]<u[E+z])continue t;var I=r(R,T);if(void 0!==I)return I}}}}else{for(var b=k-d,C=M-1;C>=0;--C)if(g[C]===b){for(var z=C+1;M>z;++z)g[z-1]=g[z];break}--M}}}e.exports={init:n,sweepBipartite:a,sweepComplete:s,scanBipartite:l,scanComplete:u};var c=t("typedarray-pool"),f=t("bit-twiddle"),h=t("./sort"),d=1<<28,p=1024,g=c.mallocInt32(p),v=c.mallocInt32(p),m=c.mallocInt32(p),y=c.mallocInt32(p),b=c.mallocInt32(p),x=c.mallocInt32(p),_=c.mallocDouble(8*p)},{"./sort":76,"bit-twiddle":38,"typedarray-pool":242}],78:[function(t,e,r){(function(t){function r(t,e){return d[0]=t,d[1]=e,h[0]}function n(t){return h[0]=t,d[0]}function i(t){return h[0]=t,d[1]}function o(t,e){return d[1]=t,d[0]=e,h[0]}function a(t){return h[0]=t,d[1]}function s(t){return h[0]=t,d[0]}function l(t,e){return p.writeUInt32LE(t,0,!0),p.writeUInt32LE(e,4,!0),p.readDoubleLE(0,!0)}function u(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(0,!0)}function c(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(4,!0)}var f=!1;if("undefined"!=typeof Float64Array){var h=new Float64Array(1),d=new Uint32Array(h.buffer);h[0]=1,f=!0,1072693248===d[1]?(e.exports=function(t){return h[0]=t,[d[0],d[1]]},e.exports.pack=r,e.exports.lo=n,e.exports.hi=i):1072693248===d[0]?(e.exports=function(t){return h[0]=t,[d[1],d[0]]},e.exports.pack=o,e.exports.lo=a,e.exports.hi=s):f=!1}if(!f){var p=new t(8);e.exports=function(t){return p.writeDoubleLE(t,0,!0),[p.readUInt32LE(0,!0),p.readUInt32LE(4,!0)]},e.exports.pack=l,e.exports.lo=u,e.exports.hi=c}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){var r=e.exports.hi(t);return(r<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){var r=e.exports.hi(t);return!(2146435072&r)}}).call(this,t("buffer").Buffer)},{buffer:39}],79:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return 0>e?-o:o;var r=i.hi(t),n=i.lo(t);return e>t==t>0?n===a?(r+=1,n=0):n+=1:0===n?(n=a,r-=1):n-=1,i.pack(n,r)}var i=t("double-bits"),o=Math.pow(2,-1074),a=-1>>>0;e.exports=n},{"double-bits":78}],80:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),o=0;r>o;++o)n[o]=i(t[o],e[o]);return n}var i=t("big-rat/add");e.exports=n},{"big-rat/add":54}],81:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=i(t[r]);return e}e.exports=n;var i=t("big-rat")},{"big-rat":57}],82:[function(t,e,r){"use strict";function n(t,e){for(var r=i(e),n=t.length,a=new Array(n),s=0;n>s;++s)a[s]=o(t[s],r);return a}var i=t("big-rat"),o=t("big-rat/mul");e.exports=n},{"big-rat":57,"big-rat/mul":66}],83:[function(t,e,r){
"use strict";function n(t,e){for(var r=t.length,n=new Array(r),o=0;r>o;++o)n[o]=i(t[o],e[o]);return n}var i=t("big-rat/sub");e.exports=n},{"big-rat/sub":69}],84:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=0;2>i;++i){var o=t[i],a=e[i],s=Math.min(o,a),l=Math.max(o,a),u=r[i],c=n[i],f=Math.min(u,c),h=Math.max(u,c);if(s>h||f>l)return!1}return!0}function i(t,e,r,i){var a=o(t,r,i),s=o(e,r,i);if(a>0&&s>0||0>a&&0>s)return!1;var l=o(r,t,e),u=o(i,t,e);return l>0&&u>0||0>l&&0>u?!1:0===a&&0===s&&0===l&&0===u?n(t,e,r,i):!0}e.exports=i;var o=t("robust-orientation")[3]},{"robust-orientation":225}],85:[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;t>e;++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,o=this.roots,a=i[r],s=i[n];s>a?o[r]=n:a>s?o[n]=r:(o[n]=r,++i[r])}}},{}],86:[function(t,e,r){(function(t){var r=function(){"use strict";function e(r,n,i,o){function s(r,i){if(null===r)return null;if(0==i)return r;var l,h;if("object"!=typeof r)return r;if(e.__isArray(r))l=[];else if(e.__isRegExp(r))l=new RegExp(r.source,a(r)),r.lastIndex&&(l.lastIndex=r.lastIndex);else if(e.__isDate(r))l=new Date(r.getTime());else{if(f&&t.isBuffer(r))return l=new t(r.length),r.copy(l),l;"undefined"==typeof o?(h=Object.getPrototypeOf(r),l=Object.create(h)):(l=Object.create(o),h=o)}if(n){var d=u.indexOf(r);if(-1!=d)return c[d];u.push(r),c.push(l)}for(var p in r){var g;h&&(g=Object.getOwnPropertyDescriptor(h,p)),g&&null==g.set||(l[p]=s(r[p],i-1))}return l}var l;"object"==typeof n&&(i=n.depth,o=n.prototype,l=n.filter,n=n.circular);var u=[],c=[],f="undefined"!=typeof t;return"undefined"==typeof n&&(n=!0),"undefined"==typeof 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 o(t){return"object"==typeof t&&"[object RegExp]"===r(t)}function a(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=o,e.__getRegExpFlags=a,e}();"object"==typeof e&&e.exports&&(e.exports=r)}).call(this,t("buffer").Buffer)},{buffer:39}],87:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}]}},{}],88:[function(t,e,r){"use strict";function n(t){for(var e,r="#",n=0;3>n;++n)e=t[n],e=e.toString(16),r+=("00"+e).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var o=t("arraytools"),a=t("clone"),s=t("./colorScales");e.exports=function(t){var e,r,l,u,c,f,h,d,p,g,v,m,y,b=[],x=[],_=[],w=[];if(o.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",h=t.colormap,h||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!s[h])throw Error(h+" not a supported colorscale");f=a(s[h])}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);f=a(h)}if(f.length>p)throw new Error(h+" map requires nshades to be at least size "+f.length);for(v=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:a(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=f.map(function(t){return Math.round(t.index*p)}),v[0]<0&&(v[0]=0),v[1]<0&&(v[0]=0),v[0]>1&&(v[0]=1),v[1]>1&&(v[0]=1),y=0;y<e.length;++y)m=f[y].index,r=f[y].rgb,4===r.length&&r[3]>=0&&r[3]<=1||(r[3]=v[0]+(v[1]-v[0])*m);for(y=0;y<e.length-1;++y)c=e[y+1]-e[y],l=f[y].rgb,u=f[y+1].rgb,b=b.concat(o.linspace(l[0],u[0],c)),x=x.concat(o.linspace(l[1],u[1],c)),_=_.concat(o.linspace(l[2],u[2],c)),w=w.concat(o.linspace(l[3],u[3],c));return b=b.map(Math.round),x=x.map(Math.round),_=_.map(Math.round),g=o.zip(b,x,_,w),"hex"===d&&(g=g.map(n)),"rgbaString"===d&&(g=g.map(i)),g}},{"./colorScales":87,arraytools:37,clone:86}],89:[function(t,e,r){function n(t,e){return t-e}function i(t,e){var r=t.length,i=t.length-e.length;if(i)return i;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||o(t[0],t[1])-o(e[0],e[1]);case 3:var a=t[0]+t[1],s=e[0]+e[1];if(i=a+t[2]-(s+e[2]))return i;var l=o(t[0],t[1]),u=o(e[0],e[1]);return o(l,t[2])-o(u,e[2])||o(l+t[2],a)-o(u+e[2],s);case 4:var c=t[0],f=t[1],h=t[2],d=t[3],p=e[0],g=e[1],v=e[2],m=e[3];return c+f+h+d-(p+g+v+m)||o(c,f,h,d)-o(p,g,v,m,p)||o(c+f,c+h,c+d,f+h,f+d,h+d)-o(p+g,p+v,p+m,g+v,g+m,v+m)||o(c+f+h,c+f+d,c+h+d,f+h+d)-o(p+g+v,p+g+m,p+v+m,g+v+m);default:for(var y=t.slice().sort(n),b=e.slice().sort(n),x=0;r>x;++x)if(i=y[x]-b[x])return i;return 0}}e.exports=i;var o=Math.min},{}],90:[function(t,e,r){"use strict";function n(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?i(t):2===r?o(t):a(t,r)}var i=t("./lib/ch1d"),o=t("./lib/ch2d"),a=t("./lib/chnd");e.exports=n},{"./lib/ch1d":91,"./lib/ch2d":92,"./lib/chnd":93}],91:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return r>e?[[e],[r]]:e>r?[[r],[e]]:[[e]]}e.exports=n},{}],92:[function(t,e,r){"use strict";function n(t){var e=i(t),r=e.length;if(2>=r)return[];for(var n=new Array(r),o=e[r-1],a=0;r>a;++a){var s=e[a];n[a]=[o,s],o=s}return n}e.exports=n;var i=t("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":95}],93:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];for(var o=e.length,i=0;r>i;++i)e.indexOf(i)<0&&(n[o++]=t[i]);return n}function i(t,e){for(var r=t.length,n=e.length,i=0;r>i;++i)for(var o=t[i],a=0;a<o.length;++a){var s=o[a];if(n>s)o[a]=e[s];else{s-=n;for(var l=0;n>l;++l)s>=e[l]&&(s+=1);o[a]=s}}return t}function o(t,e){try{return a(t,!0)}catch(r){var o=s(t);if(o.length<=e)return[];var l=n(t,o),u=a(l,!0);return i(u,o)}}e.exports=o;var a=t("incremental-convex-hull"),s=t("affine-hull")},{"affine-hull":94,"incremental-convex-hull":201}],94:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(e+1),n=0;n<t.length;++n)r[n]=t[n];for(var n=0;n<=t.length;++n){for(var i=t.length;e>=i;++i){for(var a=new Array(e),s=0;e>s;++s)a[s]=Math.pow(i+1-n,s);r[i]=a}var l=o.apply(void 0,r);if(l)return!0}return!1}function i(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,i=[t[0]],o=[0],a=1;e>a;++a)if(i.push(t[a]),n(i,r)){if(o.push(a),o.length===r+1)return o}else i.pop();return o}e.exports=i;var o=t("robust-orientation")},{"robust-orientation":225}],95:[function(t,e,r){"use strict";function n(t){var e=t.length;if(3>e){for(var r=new Array(e),n=0;e>n;++n)r[n]=n;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var o=new Array(e),n=0;e>n;++n)o[n]=n;o.sort(function(e,r){var n=t[e][0]-t[r][0];return n?n:t[e][1]-t[r][1]});for(var a=[o[0],o[1]],s=[o[0],o[1]],n=2;e>n;++n){for(var l=o[n],u=t[l],c=a.length;c>1&&i(t[a[c-2]],t[a[c-1]],u)<=0;)c-=1,a.pop();for(a.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+a.length-2),f=0,n=0,h=a.length;h>n;++n)r[f++]=a[n];for(var d=s.length-2;d>0;--d)r[f++]=s[d];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":225}],96:[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.body=null,this.post=null,this.debug=!1}function i(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i<r.length;++i){var a=r[i];if("array"===a||"object"==typeof a&&a.blockIndices){if(e.argTypes[i]="array",e.arrayArgs.push(i),e.arrayBlockIndices.push(a.blockIndices?a.blockIndices:0),e.shimArgs.push("array"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array args");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===a){if(e.indexArgs.push(i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array index");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array index");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array shape");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof a||!a.offset)throw new Error("cwise: Unknown argument type "+r[i]);e.argTypes[i]="offset",e.offsetArgs.push({array:a.array,offset:a.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,o(e)}var o=t("./lib/thunk.js");e.exports=i},{"./lib/thunk.js":98}],97:[function(t,e,r){"use strict";function n(t,e,r){var n,i,o=t.length,a=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;o>n;++n)u.push(["i",n,"=0"].join(""));for(i=0;a>i;++i)for(n=0;o>n;++n)f=c,c=t[n],0===n?u.push(["d",i,"s",n,"=t",i,"p",c].join("")):u.push(["d",i,"s",n,"=(t",i,"p",c,"-s",f,"*t",i,"p",f,")"].join(""));for(l.push("var "+u.join(",")),n=o-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(l.push(r),n=0;o>n;++n){for(f=c,c=t[n],i=0;a>i;++i)l.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r,i){for(var o=e.length,a=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;a>c;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=t;o>c;++c)u.push(["for(var j"+c+"=SS[",e[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(var c=0;a>c;++c){for(var f=["offset"+c],h=t;o>h;++h)f.push(["j",h,"*t",c,"p",e[h]].join(""));u.push(["p",c,"=(",f.join("+"),")"].join(""))}u.push(n(e,r,i));for(var c=t;o>c;++c)u.push("}");return u.join("\n")}function o(t){for(var e=0,r=t[0].length;r>e;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}function a(t,e,r){for(var n=t.body,i=[],o=[],a=0;a<t.args.length;++a){var s=t.args[a];if(!(s.count<=0)){var l=new RegExp(s.name,"g"),u="",c=e.arrayArgs.indexOf(a);switch(e.argTypes[a]){case"offset":var f=e.offsetArgIndex.indexOf(a),h=e.offsetArgs[f];c=h.array,u="+q"+f;case"array":u="p"+c+u;var d="l"+a,p="a"+c;if(0===e.arrayBlockIndices[c])1===s.count?"generic"===r[c]?s.lvalue?(i.push(["var ",d,"=",p,".get(",u,")"].join("")),n=n.replace(l,d),o.push([p,".set(",u,",",d,")"].join(""))):n=n.replace(l,[p,".get(",u,")"].join("")):n=n.replace(l,[p,"[",u,"]"].join("")):"generic"===r[c]?(i.push(["var ",d,"=",p,".get(",u,")"].join("")),n=n.replace(l,d),s.lvalue&&o.push([p,".set(",u,",",d,")"].join(""))):(i.push(["var ",d,"=",p,"[",u,"]"].join("")),n=n.replace(l,d),s.lvalue&&o.push([p,"[",u,"]=",d].join("")));else{for(var g=[s.name],v=[u],m=0;m<Math.abs(e.arrayBlockIndices[c]);m++)g.push("\\s*\\[([^\\]]+)\\]"),v.push("$"+(m+1)+"*t"+c+"b"+m);if(l=new RegExp(g.join(""),"g"),u=v.join("+"),"generic"===r[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[p,"[",u,"]"].join(""))}break;case"scalar":n=n.replace(l,"Y"+e.scalarArgs.indexOf(a));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[i.join("\n"),n,o.join("\n")].join("\n").trim()}function s(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var i=t[n],o=i.match(/\d+/);o=o?o[0]:"",0===i.charAt(0)?e[n]="u"+i.charAt(1)+o:e[n]=i.charAt(0)+o,n>0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}function l(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,l=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),f=0;f<t.arrayArgs.length;++f)c[f]=e[2*f],l[f]=e[2*f+1];for(var h=[],d=[],p=[],g=[],v=[],f=0;f<t.arrayArgs.length;++f){t.arrayBlockIndices[f]<0?(p.push(0),g.push(r),h.push(r),d.push(r+t.arrayBlockIndices[f])):(p.push(t.arrayBlockIndices[f]),g.push(t.arrayBlockIndices[f]+r),h.push(0),d.push(t.arrayBlockIndices[f]));for(var m=[],y=0;y<l[f].length;y++)p[f]<=l[f][y]&&l[f][y]<g[f]&&m.push(l[f][y]-p[f]);v.push(m)}for(var b=["SS"],x=["'use strict'"],_=[],y=0;r>y;++y)_.push(["s",y,"=SS[",y,"]"].join(""));for(var f=0;f<t.arrayArgs.length;++f){b.push("a"+f),b.push("t"+f),b.push("p"+f);for(var y=0;r>y;++y)_.push(["t",f,"p",y,"=t",f,"[",p[f]+y,"]"].join(""));for(var y=0;y<Math.abs(t.arrayBlockIndices[f]);++y)_.push(["t",f,"b",y,"=t",f,"[",h[f]+y,"]"].join(""))}for(var f=0;f<t.scalarArgs.length;++f)b.push("Y"+f);if(t.shapeArgs.length>0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var w=new Array(r),f=0;r>f;++f)w[f]="0";_.push(["index=[",w.join(","),"]"].join(""))}for(var f=0;f<t.offsetArgs.length;++f){for(var A=t.offsetArgs[f],M=[],y=0;y<A.offset.length;++y)0!==A.offset[y]&&(1===A.offset[y]?M.push(["t",A.array,"p",y].join("")):M.push([A.offset[y],"*t",A.array,"p",y].join("")));0===M.length?_.push("q"+f+"=0"):_.push(["q",f,"=",M.join("+")].join(""))}var k=u([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));_=_.concat(k),x.push("var "+_.join(","));for(var f=0;f<t.arrayArgs.length;++f)x.push("p"+f+"|=0");t.pre.body.length>3&&x.push(a(t.pre,t,c));var T=a(t.body,t,c),E=o(v);r>E?x.push(i(E,v[0],t,T)):x.push(n(v[0],t,T)),t.post.body.length>3&&x.push(a(t.post,t,c)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+x.join("\n")+"\n----------");var L=[t.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",E,s(c)].join(""),S=new Function(["function ",L,"(",b.join(","),"){",x.join("\n"),"} return ",L].join(""));return S()}var u=t("uniq");e.exports=l},{uniq:243}],98:[function(t,e,r){"use strict";function n(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c<t.arrayArgs.length;++c){var f=t.arrayArgs[c];r.push(["t",f,"=array",f,".dtype,","r",f,"=array",f,".order"].join("")),o.push("t"+f),o.push("r"+f),a.push("t"+f),a.push("r"+f+".join()"),s.push("array"+f+".data"),s.push("array"+f+".stride"),s.push("array"+f+".offset|0"),c>0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;c<t.scalarArgs.length;++c)s.push("scalar"+t.scalarArgs[c]);r.push(["type=[",a.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),e.push("var "+r.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",o.join(","),"])}","return proc(",s.join(","),")}"].join("")),t.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------");var h=new Function("compile",e.join("\n"));return h(i.bind(void 0,t))}var i=t("./compile.js");e.exports=n},{"./compile.js":97}],99:[function(t,e,r){e.exports=t("cwise-compiler")},{"cwise-compiler":96}],100:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return e>t?-1:t>e?1:t>=e?0:NaN}function o(t){return null===t?NaN:+t}function a(t){return!isNaN(t)}function s(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);i>n;){var o=n+i>>>1;t(e[o],r)<0?n=o+1:i=o}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);i>n;){var o=n+i>>>1;t(e[o],r)>0?i=o:n=o+1}return n}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function f(){this._=Object.create(null)}function h(t){return(t+="")===Aa||t[0]===Ma?Ma+t:t}function d(t){return(t+="")[0]===Ma?t.slice(1):t}function p(t){return h(t)in this._}function g(t){return(t=h(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(d(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function x(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=ka.length;n>r;++r){var i=ka[r]+e;if(i in t)return i}}function A(){}function M(){}function k(t){function e(){for(var e,n=r,i=-1,o=n.length;++i<o;)(e=n[i].on)&&e.apply(this,arguments);return t}var r=[],n=new f;return e.on=function(e,i){var o,a=n.get(e);return arguments.length<2?a&&a.on:(a&&(a.on=null,r=r.slice(0,o=r.indexOf(a)).concat(r.slice(o+1)),n.remove(e)),i&&r.push(n.set(e,{on:i})),t)},e}function T(){ca.event.preventDefault()}function E(){for(var t,e=ca.event;t=e.sourceEvent;)e=t;return e}function L(t){for(var e=new M,r=0,n=arguments.length;++r<n;)e[arguments[r]]=k(e);return e.of=function(r,n){return function(i){try{var o=i.sourceEvent=ca.event;i.target=t,ca.event=i,e[i.type].apply(r,n)}finally{ca.event=o}}},e}function S(t){return Ea(t,Pa),t}function C(t){return"function"==typeof t?t:function(){return La(t,this)}}function P(t){return"function"==typeof t?t:function(){return Sa(t,this)}}function R(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function a(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function s(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=ca.ns.qualify(t),null==e?t.local?n:r:"function"==typeof e?t.local?s:a:t.local?o:i}function N(t){return t.trim().replace(/\s+/g," ")}function z(t){return new RegExp("(?:^|\\s+)"+ca.requote(t)+"(?:\\s+|$)","g")}function I(t){return(t+"").trim().split(/^|\s+/)}function O(t,e){function r(){for(var r=-1;++r<i;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<i;)t[r](this,n)}t=I(t).map(j);var i=t.length;return"function"==typeof e?n:r}function j(t){var e=z(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(i)||r.setAttribute("class",N(i+" "+t))):r.setAttribute("class",N(i.replace(e," ")))}}function D(t,e,r){function n(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,r)}function o(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:"function"==typeof e?o:i}function F(t,e){function r(){delete this[t]}function n(){this[t]=e}function i(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:"function"==typeof e?i:n}function B(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r===Ra&&e.documentElement.namespaceURI===Ra?e.createElement(t):e.createElementNS(r,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=ca.ns.qualify(t)).local?r:e}function U(){var t=this.parentNode;t&&t.removeChild(this)}function V(t){return{__data__:t}}function q(t){return function(){return Ca(this,t)}}function H(t){return arguments.length||(t=i),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function G(t,e){for(var r=0,n=t.length;n>r;r++)for(var i,o=t[r],a=0,s=o.length;s>a;a++)(i=o[a])&&e(i,a,r);return t}function X(t){return Ea(t,za),t}function Y(t){var e,r;return function(n,i,o){var a,s=t[o].update,l=s.length;for(o!=r&&(r=o,e=0),i>=e&&(e=i+1);!(a=s[e])&&++e<l;);return a}}function W(t,e,r){function n(){var e=this[a];e&&(this.removeEventListener(t,e,e.$),delete this[a])}function i(){var i=l(e,ha(arguments));n.call(this),this.addEventListener(t,this[a]=i,i.$=r),i._=e}function o(){var e,r=new RegExp("^__on([^.]+)"+ca.requote(t)+"$");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}var a="__on"+t,s=t.indexOf("."),l=Z;s>0&&(t=t.slice(0,s));var u=Ia.get(t);return u&&(t=u,l=Q),s?e?i:n:e?A:o}function Z(t,e){return function(r){var n=ca.event;ca.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{ca.event=n}}}function Q(t,e){var r=Z(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function $(t){var r=".dragsuppress-"+ ++ja,i="click"+r,o=ca.select(n(t)).on("touchmove"+r,T).on("dragstart"+r,T).on("selectstart"+r,T);if(null==Oa&&(Oa="onselectstart"in t?!1:w(t.style,"userSelect")),Oa){var a=e(t).style,s=a[Oa];a[Oa]="none"}return function(t){if(o.on(r,null),Oa&&(a[Oa]=s),t){var e=function(){o.on(i,null)};o.on(i,function(){T(),e()},!0),setTimeout(e,0)}}}function K(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Da){var o=n(t);if(o.scrollX||o.scrollY){r=ca.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=r[0][0].getScreenCTM();Da=!(a.f||a.e),r.remove()}}return Da?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function J(){return ca.event.changedTouches[0].identifier}function tt(t){return t>0?1:0>t?-1:0}function et(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function rt(t){return t>1?0:-1>t?Ua:Math.acos(t)}function nt(t){return t>1?Ha:-1>t?-Ha:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function ot(t){return((t=Math.exp(t))+1/t)/2}function at(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,r){return this instanceof ut?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):At(""+t,Mt,ut):new ut(t,e,r)}function ct(t,e,r){function n(t){return t>360?t-=360:0>t&&(t+=360),60>t?o+(a-o)*t/60:180>t?a:240>t?o+(a-o)*(240-t)/60:o}function i(t){return Math.round(255*n(t))}var o,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,r=0>r?0:r>1?1:r,a=.5>=r?r*(1+e):r+e-r*e,o=2*r-a,new bt(i(t+120),i(t),i(t-120))}function ft(t,e,r){return this instanceof ft?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof dt?gt(t.l,t.a,t.b):gt((t=kt((t=ca.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,r)}function ht(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new dt(r,Math.cos(t*=Ga)*e,Math.sin(t)*e)}function dt(t,e,r){return this instanceof dt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ft?ht(t.h,t.c,t.l):kt((t=bt(t)).r,t.g,t.b):new dt(t,e,r)}function pt(t,e,r){var n=(t+16)/116,i=n+e/500,o=n-r/200;return i=vt(i)*rs,n=vt(n)*ns,o=vt(o)*is,new bt(yt(3.2404542*i-1.5371385*n-.4985314*o),yt(-.969266*i+1.8760108*n+.041556*o),yt(.0556434*i-.2040259*n+1.0572252*o))}function gt(t,e,r){return t>0?new ft(Math.atan2(r,e)*Xa,Math.sqrt(e*e+r*r),t):new ft(NaN,NaN,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,e,r){return this instanceof bt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):At(""+t,bt,ct):new bt(t,e,r)}function xt(t){return new bt(t>>16,t>>8&255,255&t)}function _t(t){return xt(t)+""}function wt(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function At(t,e,r){var n,i,o,a=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Et(i[0]),Et(i[1]),Et(i[2]))}return(o=ss.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&o)>>4,a=a>>4|a,s=240&o,s=s>>4|s,l=15&o,l=l<<4|l):7===t.length&&(a=(16711680&o)>>16,s=(65280&o)>>8,l=255&o)),e(a,s,l))}function Mt(t,e,r){var n,i,o=Math.min(t/=255,e/=255,r/=255),a=Math.max(t,e,r),s=a-o,l=(a+o)/2;return s?(i=.5>l?s/(a+o):s/(2-a-o),n=t==a?(e-r)/s+(r>e?6:0):e==a?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&1>l?0:n),new ut(n,i,l)}function kt(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=mt((.4124564*t+.3575761*e+.1804375*r)/rs),i=mt((.2126729*t+.7151522*e+.072175*r)/ns),o=mt((.0193339*t+.119192*e+.9503041*r)/is);return dt(116*i-16,500*(n-i),200*(i-o))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Et(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Lt(t){return"function"==typeof t?t:function(){return t}}function St(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&&Rt(l)||e>=200&&300>e||304===e){try{t=r.call(o,l)}catch(n){return void a.error.call(o,n)}a.load.call(o,t)}else a.error.call(o,l)}var o={},a=ca.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=ca.event;ca.event=t;try{a.progress.call(o,l)}finally{ca.event=e}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return r=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(ha(arguments)))}}),o.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&&o.on("error",i).on("load",function(t){i(null,t)}),a.beforesend.call(o,l),l.send(null==n?null:n),o},o.abort=function(){return l.abort(),o},ca.rebind(o,a,"on"),null==n?o:o.get(Pt(n))}function Pt(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function Rt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Nt(t,e,r){var n=arguments.length;2>n&&(e=0),3>n&&(r=Date.now());var i=r+e,o={c:t,t:i,n:null};return us?us.n=o:ls=o,us=o,cs||(fs=clearTimeout(fs),cs=1,hs(zt)),o}function zt(){
var t=It(),e=Ot()-t;e>24?(isFinite(e)&&(clearTimeout(fs),fs=setTimeout(zt,e)),cs=0):(cs=1,hs(zt))}function It(){for(var t=Date.now(),e=ls;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ot(){for(var t,e=ls,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:ls=e.n;return us=t,r}function jt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Dt(t,e){var r=Math.pow(10,3*wa(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Ft(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,o=n&&r?function(t,e){for(var i=t.length,o=[],a=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),o.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[a=(a+1)%n.length];return o.reverse().join(r)}:x;return function(t){var r=ps.exec(t),n=r[1]||" ",a=r[2]||">",s=r[3]||"-",l=r[4]||"",u=r[5],c=+r[6],f=r[7],h=r[8],d=r[9],p=1,g="",v="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(u||"0"===n&&"="===a)&&(u=n="0",a="="),d){case"n":f=!0,d="g";break;case"%":p=100,v="%",d="f";break;case"p":p=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+d.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(g=i[0],v=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=gs.get(d)||Bt;var b=u&&f;return function(t){var r=v;if(m&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===s?"":s;if(0>p){var l=ca.formatPrefix(t,h);t=l.scale(t),r=l.symbol+v}else t*=p;t=d(t,h);var x,_,w=t.lastIndexOf(".");if(0>w){var A=y?t.lastIndexOf("e"):-1;0>A?(x=t,_=""):(x=t.substring(0,A),_=t.substring(A))}else x=t.substring(0,w),_=e+t.substring(w+1);!u&&f&&(x=o(x,1/0));var M=g.length+x.length+_.length+(b?0:i.length),k=c>M?new Array(M=c-M+1).join(n):"";return b&&(x=o(k+x,k.length?c-_.length:1/0)),i+=g,t=x+_,("<"===a?i+t+k:">"===a?k+i+t:"^"===a?k.substring(0,M>>=1)+i+t+k.substring(M):i+(b?t:k+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=o(r,1);return n-e>e-r?r:n}function i(r){return e(r=t(new ms(r-1)),1),r}function o(t,r){return e(t=new ms(+t),r),t}function a(t,n,o){var a=i(t),s=[];if(o>1)for(;n>a;)r(a)%o||s.push(new Date(+a)),e(a,1);else for(;n>a;)s.push(new Date(+a)),e(a,1);return s}function s(t,e,r){try{ms=Ut;var n=new Ut;return n._=t,a(n,e,r)}finally{ms=Date}}t.floor=t,t.round=n,t.ceil=i,t.offset=o,t.range=a;var l=t.utc=qt(t);return l.floor=l,l.round=qt(n),l.ceil=qt(i),l.offset=qt(o),l.range=s,t}function qt(t){return function(e,r){try{ms=Ut;var n=new Ut;return n._=e,t(n,r)._}finally{ms=Date}}}function Ht(t){function e(t){function e(e){for(var r,i,o,a=[],s=-1,l=0;++s<n;)37===t.charCodeAt(s)&&(a.push(t.slice(l,s)),null!=(i=bs[r=t.charAt(++s)])&&(r=t.charAt(++s)),(o=L[r])&&(r=o(e,null==i?"e"===r?" ":"0":i)),a.push(r),l=s+1);return a.push(t.slice(l,s)),a.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=r(n,t,e,0);if(i!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var o=null!=n.Z&&ms!==Ut,a=new(o?Ut:ms);return"j"in n?a.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),a.setFullYear(n.y,0,1),a.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(a.getDay()+5)%7:n.w+7*n.U-(a.getDay()+6)%7)):a.setFullYear(n.y,n.m,n.d),a.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),o?a._:a},e.toString=function(){return t},e}function r(t,e,r,n){for(var i,o,a,s=0,l=e.length,u=r.length;l>s;){if(n>=u)return-1;if(i=e.charCodeAt(s++),37===i){if(a=e.charAt(s++),o=S[a in bs?e.charAt(s++):a],!o||(n=o(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=A.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=E.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){M.lastIndex=0;var n=M.exec(e.slice(r));return n?(t.m=k.get(n[0].toLowerCase()),r+n[0].length):-1}function s(t,e,n){return r(t,L.c.toString(),e,n)}function l(t,e,n){return r(t,L.x.toString(),e,n)}function u(t,e,n){return r(t,L.X.toString(),e,n)}function c(t,e,r){var n=b.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var f=t.dateTime,h=t.date,d=t.time,p=t.periods,g=t.days,v=t.shortDays,m=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{ms=Ut;var e=new ms;return e._=t,n(e)}finally{ms=Date}}var n=e(t);return r.parse=function(t){try{ms=Ut;var e=n.parse(t);return e&&e._}finally{ms=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ce;var b=ca.map(),x=Xt(g),_=Yt(g),w=Xt(v),A=Yt(v),M=Xt(m),k=Yt(m),T=Xt(y),E=Yt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var L={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(f),d:function(t,e){return Gt(t.getDate(),e,2)},e:function(t,e){return Gt(t.getDate(),e,2)},H:function(t,e){return Gt(t.getHours(),e,2)},I:function(t,e){return Gt(t.getHours()%12||12,e,2)},j:function(t,e){return Gt(1+vs.dayOfYear(t),e,3)},L:function(t,e){return Gt(t.getMilliseconds(),e,3)},m:function(t,e){return Gt(t.getMonth()+1,e,2)},M:function(t,e){return Gt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Gt(t.getSeconds(),e,2)},U:function(t,e){return Gt(vs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Gt(vs.mondayOfYear(t),e,2)},x:e(h),X:e(d),y:function(t,e){return Gt(t.getFullYear()%100,e,2)},Y:function(t,e){return Gt(t.getFullYear()%1e4,e,4)},Z:le,"%":function(){return"%"}},S={a:n,A:i,b:o,B:a,c:s,d:re,e:re,H:ie,I:ie,j:ne,L:se,m:ee,M:oe,p:c,S:ae,U:Zt,w:Wt,W:Qt,x:l,X:u,y:Kt,Y:$t,Z:Jt,"%":ue};return e}function Gt(t,e,r){var n=0>t?"-":"",i=(n?-t:t)+"",o=i.length;return n+(r>o?new Array(r-o+1).join(e)+i:i)}function Xt(t){return new RegExp("^(?:"+t.map(ca.requote).join("|")+")","i")}function Yt(t){for(var e=new f,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Wt(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Zt(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Qt(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function $t(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Kt(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+2));return n?(t.y=te(+n[0]),r+n[0].length):-1}function Jt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function te(t){return t+(t>68?1900:2e3)}function ee(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ie(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function oe(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ae(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function se(t,e,r){xs.lastIndex=0;var n=xs.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function le(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=wa(e)/60|0,i=wa(e)%60;return r+Gt(n,"0",2)+Gt(i,"0",2)}function ue(t,e,r){_s.lastIndex=0;var n=_s.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ce(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}function fe(){}function he(t,e,r){var n=r.s=t+e,i=n-t,o=n-i;r.t=t-o+(e-i)}function de(t,e){t&&ks.hasOwnProperty(t.type)&&ks[t.type](t,e)}function pe(t,e,r){var n,i=-1,o=t.length-r;for(e.lineStart();++i<o;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function ge(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pe(t[r],e,1);e.polygonEnd()}function ve(){function t(t,e){t*=Ga,e=e*Ga/2+Ua/4;var r=t-n,a=r>=0?1:-1,s=a*r,l=Math.cos(e),u=Math.sin(e),c=o*u,f=i*l+c*Math.cos(s),h=c*a*Math.sin(s);Es.add(Math.atan2(h,f)),n=t,i=l,o=u}var e,r,n,i,o;Ls.point=function(a,s){Ls.point=t,n=(e=a)*Ga,i=Math.cos(s=(r=s)*Ga/2+Ua/4),o=Math.sin(s)},Ls.lineEnd=function(){t(e,r)}}function me(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function be(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function xe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Ae(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function Me(t,e){return wa(t[0]-e[0])<Fa&&wa(t[1]-e[1])<Fa}function ke(t,e){t*=Ga;var r=Math.cos(e*=Ga);Te(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Te(t,e,r){++Ss,Ps+=(t-Ps)/Ss,Rs+=(e-Rs)/Ss,Ns+=(r-Ns)/Ss}function Ee(){function t(t,i){t*=Ga;var o=Math.cos(i*=Ga),a=o*Math.cos(t),s=o*Math.sin(t),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=r*l-n*s)*u+(u=n*a-e*l)*u+(u=e*s-r*a)*u),e*a+r*s+n*l);Cs+=u,zs+=u*(e+(e=a)),Is+=u*(r+(r=s)),Os+=u*(n+(n=l)),Te(e,r,n)}var e,r,n;Bs.point=function(i,o){i*=Ga;var a=Math.cos(o*=Ga);e=a*Math.cos(i),r=a*Math.sin(i),n=Math.sin(o),Bs.point=t,Te(e,r,n)}}function Le(){Bs.point=ke}function Se(){function t(t,e){t*=Ga;var r=Math.cos(e*=Ga),a=r*Math.cos(t),s=r*Math.sin(t),l=Math.sin(e),u=i*l-o*s,c=o*a-n*l,f=n*s-i*a,h=Math.sqrt(u*u+c*c+f*f),d=n*a+i*s+o*l,p=h&&-rt(d)/h,g=Math.atan2(h,d);js+=p*u,Ds+=p*c,Fs+=p*f,Cs+=g,zs+=g*(n+(n=a)),Is+=g*(i+(i=s)),Os+=g*(o+(o=l)),Te(n,i,o)}var e,r,n,i,o;Bs.point=function(a,s){e=a,r=s,Bs.point=t,a*=Ga;var l=Math.cos(s*=Ga);n=l*Math.cos(a),i=l*Math.sin(a),o=Math.sin(s),Te(n,i,o)},Bs.lineEnd=function(){t(e,r),Bs.lineEnd=Le,Bs.point=ke}}function Ce(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return r=e.invert(r,n),r&&t.invert(r[0],r[1])}),r}function Pe(){return!0}function Re(t,e,r,n,i){var o=[],a=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Me(r,n)){i.lineStart();for(var s=0;e>s;++s)i.point((r=t[s])[0],r[1]);return void i.lineEnd()}var l=new ze(r,t,null,!0),u=new ze(r,null,l,!1);l.o=u,o.push(l),a.push(u),l=new ze(n,t,null,!1),u=new ze(n,null,l,!0),l.o=u,o.push(l),a.push(u)}}),a.sort(e),Ne(o),Ne(a),o.length){for(var s=0,l=r,u=a.length;u>s;++s)a[s].e=l=!l;for(var c,f,h=o[0];;){for(var d=h,p=!0;d.v;)if((d=d.n)===h)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var s=0,u=c.length;u>s;++s)i.point((f=c[s])[0],f[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1])}else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Ne(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function ze(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Ie(t,e,r,n){return function(i,o){function a(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&o.point(e,r)}function s(t,e){var r=i(t,e);v.point(r[0],r[1])}function l(){y.point=s,v.lineStart()}function u(){y.point=a,v.lineEnd()}function c(t,e){g.push([t,e]);var r=i(t,e);x.point(r[0],r[1])}function f(){x.lineStart(),g=[]}function h(){c(g[0][0],g[0][1]),x.lineEnd();var t,e=x.clean(),r=b.buffer(),n=r.length;if(g.pop(),p.push(g),g=null,n)if(1&e){t=r[0];var i,n=t.length-1,a=-1;if(n>0){for(_||(o.polygonStart(),_=!0),o.lineStart();++a<n;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(Oe))}var d,p,g,v=e(o),m=i.invert(n[0],n[1]),y={point:a,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=f,y.lineEnd=h,d=[],p=[]},polygonEnd:function(){y.point=a,y.lineStart=l,y.lineEnd=u,d=ca.merge(d);var t=Ve(m,p);d.length?(_||(o.polygonStart(),_=!0),Re(d,De,t,r,o)):t&&(_||(o.polygonStart(),_=!0),o.lineStart(),r(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),d=p=null},sphere:function(){o.polygonStart(),o.lineStart(),r(null,null,1,o),o.lineEnd(),o.polygonEnd()}},b=je(),x=e(b),_=!1;return y}}function Oe(t){return t.length>1}function je(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:A,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function De(t,e){return((t=t.x)[0]<0?t[1]-Ha-Fa:Ha-t[1])-((e=e.x)[0]<0?e[1]-Ha-Fa:Ha-e[1])}function Fe(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?Ua:-Ua,l=wa(o-r);wa(l-Ua)<Fa?(t.point(r,n=(n+a)/2>0?Ha:-Ha),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),e=0):i!==s&&l>=Ua&&(wa(r-i)<Fa&&(r-=i*Fa),wa(o-s)<Fa&&(o-=s*Fa),n=Be(r,n,o,a),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=o,n=a),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}function Be(t,e,r,n){var i,o,a=Math.sin(t-r);return wa(a)>Fa?Math.atan((Math.sin(e)*(o=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+n)/2}function Ue(t,e,r,n){var i;if(null==t)i=r*Ha,n.point(-Ua,i),n.point(0,i),n.point(Ua,i),n.point(Ua,0),n.point(Ua,-i),n.point(0,-i),n.point(-Ua,-i),n.point(-Ua,0),n.point(-Ua,i);else if(wa(t[0]-e[0])>Fa){var o=t[0]<e[0]?Ua:-Ua;i=r*o/2,n.point(-o,i),n.point(0,i),n.point(o,i)}else n.point(e[0],e[1])}function Ve(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],o=0,a=0;Es.reset();for(var s=0,l=e.length;l>s;++s){var u=e[s],c=u.length;if(c)for(var f=u[0],h=f[0],d=f[1]/2+Ua/4,p=Math.sin(d),g=Math.cos(d),v=1;;){v===c&&(v=0),t=u[v];var m=t[0],y=t[1]/2+Ua/4,b=Math.sin(y),x=Math.cos(y),_=m-h,w=_>=0?1:-1,A=w*_,M=A>Ua,k=p*b;if(Es.add(Math.atan2(k*w*Math.sin(A),g*x+k*Math.cos(A))),o+=M?_+w*Va:_,M^h>=r^m>=r){var T=be(me(f),me(t));we(T);var E=be(i,T);we(E);var L=(M^_>=0?-1:1)*nt(E[2]);(n>L||n===L&&(T[0]||T[1]))&&(a+=M^_>=0?1:-1)}if(!v++)break;h=m,p=b,g=x,f=t}}return(-Fa>o||Fa>o&&0>Es)^1&a}function qe(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function r(t){var r,o,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,h){var d,p=[f,h],g=e(f,h),v=a?g?0:i(f,h):g?i(f+(0>f?Ua:-Ua),h):0;if(!r&&(u=l=g)&&t.lineStart(),g!==l&&(d=n(r,p),(Me(r,d)||Me(p,d))&&(p[0]+=Fa,p[1]+=Fa,g=e(p[0],p[1]))),g!==l)c=0,g?(t.lineStart(),d=n(p,r),t.point(d[0],d[1])):(d=n(r,p),t.point(d[0],d[1]),t.lineEnd()),r=d;else if(s&&r&&a^g){var m;v&o||!(m=n(p,r,!0))||(c=0,a?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||r&&Me(r,p)||t.point(p[0],p[1]),r=p,l=g,o=v},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=me(t),i=me(e),a=[1,0,0],s=be(n,i),l=ye(s,s),u=s[0],c=l-u*u;if(!c)return!r&&t;var f=o*l/c,h=-o*u/c,d=be(a,s),p=_e(a,f),g=_e(s,h);xe(p,g);var v=d,m=ye(p,v),y=ye(v,v),b=m*m-y*(ye(p,p)-1);if(!(0>b)){var x=Math.sqrt(b),_=_e(v,(-m-x)/y);if(xe(_,p),_=Ae(_),!r)return _;var w,A=t[0],M=e[0],k=t[1],T=e[1];A>M&&(w=A,A=M,M=w);var E=M-A,L=wa(E-Ua)<Fa,S=L||Fa>E;if(!L&&k>T&&(w=k,k=T,T=w),S?L?k+T>0^_[1]<(wa(_[0]-A)<Fa?k:T):k<=_[1]&&_[1]<=T:E>Ua^(A<=_[0]&&_[0]<=M)){var C=_e(v,(-m+x)/y);return xe(C,p),[_,Ae(C)]}}}function i(e,r){var n=a?t:Ua-t,i=0;return-n>e?i|=1:e>n&&(i|=2),-n>r?i|=4:r>n&&(i|=8),i}var o=Math.cos(t),a=o>0,s=wa(o)>Fa,l=vr(t,6*Ga);return Ie(e,r,l,a?[0,-t]:[-Ua,t-Ua])}function He(t,e,r,n){return function(i){var o,a=i.a,s=i.b,l=a.x,u=a.y,c=s.x,f=s.y,h=0,d=1,p=c-l,g=f-u;if(o=t-l,p||!(o>0)){if(o/=p,0>p){if(h>o)return;d>o&&(d=o)}else if(p>0){if(o>d)return;o>h&&(h=o)}if(o=r-l,p||!(0>o)){if(o/=p,0>p){if(o>d)return;o>h&&(h=o)}else if(p>0){if(h>o)return;d>o&&(d=o)}if(o=e-u,g||!(o>0)){if(o/=g,0>g){if(h>o)return;d>o&&(d=o)}else if(g>0){if(o>d)return;o>h&&(h=o)}if(o=n-u,g||!(0>o)){if(o/=g,0>g){if(o>d)return;o>h&&(h=o)}else if(g>0){if(h>o)return;d>o&&(d=o)}return h>0&&(i.a={x:l+h*p,y:u+h*g}),1>d&&(i.b={x:l+d*p,y:u+d*g}),i}}}}}}function Ge(t,e,r,n){function i(n,i){return wa(n[0]-t)<Fa?i>0?0:3:wa(n[0]-r)<Fa?i>0?2:1:wa(n[1]-e)<Fa?i>0?1:0:i>0?3:2}function o(t,e){return a(t.x,e.x)}function a(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,r=v.length,n=t[1],i=0;r>i;++i)for(var o,a=1,s=v[i],l=s.length,u=s[0];l>a;++a)o=s[a],u[1]<=n?o[1]>n&&et(u,o,t)>0&&++e:o[1]<=n&&et(u,o,t)<0&&--e,u=o;return 0!==e}function u(o,s,l,u){var c=0,f=0;if(null==o||(c=i(o,l))!==(f=i(s,l))||a(o,s)<0^l>0){do u.point(0===c||3===c?t:r,c>1?n:e);while((c=(c+l+4)%4)!==f)}else u.point(s[0],s[1])}function c(i,o){return i>=t&&r>=i&&o>=e&&n>=o}function f(t,e){c(t,e)&&s.point(t,e)}function h(){S.point=p,v&&v.push(m=[]),M=!0,A=!1,_=w=NaN}function d(){g&&(p(y,b),x&&A&&E.rejoin(),g.push(E.buffer())),S.point=f,A&&s.lineEnd()}function p(t,e){t=Math.max(-Vs,Math.min(Vs,t)),e=Math.max(-Vs,Math.min(Vs,e));var r=c(t,e);if(v&&m.push([t,e]),M)y=t,b=e,x=r,M=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&A)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};L(n)?(A||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),k=!1):r&&(s.lineStart(),s.point(t,e),k=!1)}_=t,w=e,A=r}var g,v,m,y,b,x,_,w,A,M,k,T=s,E=je(),L=He(t,e,r,n),S={point:f,lineStart:h,lineEnd:d,polygonStart:function(){s=E,g=[],v=[],k=!0},polygonEnd:function(){s=T,g=ca.merge(g);var e=l([t,n]),r=k&&e,i=g.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&Re(g,o,e,u,s),s.polygonEnd()),g=v=m=null}};return S}}function Xe(t){var e=0,r=Ua/3,n=lr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Ua/180,r=t[1]*Ua/180):[e/Ua*180,r/Ua*180]},i}function Ye(t,e){function r(t,e){var r=Math.sqrt(o-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),a-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,o=1+n*(2*i-n),a=Math.sqrt(o)/i;return r.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/i,nt((o-(t*t+r*r)*i*i)/(2*i))]},r}function We(){function t(t,e){Hs+=i*t-n*e,n=t,i=e}var e,r,n,i;Zs.point=function(o,a){Zs.point=t,e=n=o,r=i=a},Zs.lineEnd=function(){t(e,r)}}function Ze(t,e){Gs>t&&(Gs=t),t>Ys&&(Ys=t),Xs>e&&(Xs=e),e>Ws&&(Ws=e)}function Qe(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e),s.point=r}function r(t,e){a.push("L",t,",",e)}function n(){s.point=t}function i(){a.push("Z")}var o=$e(4.5),a=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return o=$e(t),s},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return s}function $e(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ke(t,e){Ps+=t,Rs+=e,++Ns}function Je(){function t(t,n){var i=t-e,o=n-r,a=Math.sqrt(i*i+o*o);zs+=a*(e+t)/2,Is+=a*(r+n)/2,Os+=a,Ke(e=t,r=n)}var e,r;$s.point=function(n,i){$s.point=t,Ke(e=n,r=i)}}function tr(){$s.point=Ke}function er(){function t(t,e){var r=t-n,o=e-i,a=Math.sqrt(r*r+o*o);zs+=a*(n+t)/2,Is+=a*(i+e)/2,Os+=a,a=i*t-n*e,js+=a*(n+t),Ds+=a*(i+e),Fs+=3*a,Ke(n=t,i=e)}var e,r,n,i;$s.point=function(o,a){$s.point=t,Ke(e=n=o,r=i=a)},$s.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+a,r),t.arc(e,r,a,0,Va)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function o(){t.closePath()}var a=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return a=t,s},result:A};return s}function nr(t){function e(t){return(s?n:r)(t)}function r(e){return ar(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){b=NaN,M.point=o,e.lineStart()}function o(r,n){var o=me([r,n]),a=t(r,n);i(b,x,y,_,w,A,b=a[0],x=a[1],y=r,_=o[0],w=o[1],A=o[2],s,e),e.point(b,x)}function a(){M.point=r,e.lineEnd()}function l(){n(),M.point=u,M.lineEnd=c}function u(t,e){o(f=t,h=e),d=b,p=x,g=_,v=w,m=A,M.point=o}function c(){i(b,x,y,_,w,A,d,p,f,g,v,m,s,e),M.lineEnd=a,a()}var f,h,d,p,g,v,m,y,b,x,_,w,A,M={point:r,lineStart:n,lineEnd:a,polygonStart:function(){e.polygonStart(),M.lineStart=l},polygonEnd:function(){e.polygonEnd(),M.lineStart=n}};return M}function i(e,r,n,s,l,u,c,f,h,d,p,g,v,m){var y=c-e,b=f-r,x=y*y+b*b;if(x>4*o&&v--){var _=s+d,w=l+p,A=u+g,M=Math.sqrt(_*_+w*w+A*A),k=Math.asin(A/=M),T=wa(wa(A)-1)<Fa||wa(n-h)<Fa?(n+h)/2:Math.atan2(w,_),E=t(T,k),L=E[0],S=E[1],C=L-e,P=S-r,R=b*C-y*P;(R*R/x>o||wa((y*C+b*P)/x-.5)>.3||a>s*d+l*p+u*g)&&(i(e,r,n,s,l,u,L,S,T,_/=M,w/=M,A,v,m),m.point(L,S),i(L,S,T,_,w,A,c,f,h,d,p,g,v,m))}}var o=.5,a=Math.cos(30*Ga),s=16;return e.precision=function(t){return arguments.length?(s=(o=t*t)>0&&16,e):Math.sqrt(o)},e}function ir(t){var e=nr(function(e,r){return t([e*Xa,r*Xa])});return function(t){return ur(e(t))}}function or(t){this.stream=t}function ar(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sr(t){return lr(function(){return t})()}function lr(t){function e(t){return t=s(t[0]*Ga,t[1]*Ga),[t[0]*h+l,u-t[1]*h]}function r(t){return t=s.invert((t[0]-l)/h,(u-t[1])/h),t&&[t[0]*Xa,t[1]*Xa]}function n(){s=Ce(a=hr(m,y,b),o);var t=o(g,v);return l=d-t[0]*h,u=p+t[1]*h,i()}function i(){return c&&(c.valid=!1,c=null),e}var o,a,s,l,u,c,f=nr(function(t,e){return t=o(t,e),[t[0]*h+l,u-t[1]*h]}),h=150,d=480,p=250,g=0,v=0,m=0,y=0,b=0,_=Us,w=x,A=null,M=null;return e.stream=function(t){return c&&(c.valid=!1),c=ur(_(a,f(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(A=t,Us):qe((A=+t)*Ga),i()):A},e.clipExtent=function(t){return arguments.length?(M=t,w=t?Ge(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):M},e.scale=function(t){return arguments.length?(h=+t,n()):h},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],n()):[d,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Ga,v=t[1]%360*Ga,n()):[g*Xa,v*Xa]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Ga,y=t[1]%360*Ga,b=t.length>2?t[2]%360*Ga:0,n()):[m*Xa,y*Xa,b*Xa]},ca.rebind(e,f,"precision"),function(){return o=t.apply(this,arguments),e.invert=o.invert&&r,n()}}function ur(t){return ar(t,function(e,r){t.point(e*Ga,r*Ga)})}function cr(t,e){return[t,e]}function fr(t,e){return[t>Ua?t-Va:-Ua>t?t+Va:t,e]}function hr(t,e,r){return t?e||r?Ce(pr(t),gr(e,r)):pr(t):e||r?gr(e,r):fr}function dr(t){return function(e,r){return e+=t,[e>Ua?e-Va:-Ua>e?e+Va:e,r]}}function pr(t){var e=dr(t);return e.invert=dr(-t),e}function gr(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*n+s*i;return[Math.atan2(l*o-c*a,s*n-u*i),nt(c*o+l*a)]}var n=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*o-l*a;return[Math.atan2(l*o+u*a,s*n+c*i),nt(c*n-s*i)]},r}function vr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,o,a,s){var l=a*e;null!=i?(i=mr(r,i),o=mr(r,o),(a>0?o>i:i>o)&&(i+=a*Va)):(i=t+a*Va,o=t-.5*l);for(var u,c=i;a>0?c>o:o>c;c-=l)s.point((u=Ae([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function mr(t,e){var r=me(e);r[0]-=t,we(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Fa)%(2*Math.PI)}function yr(t,e,r){var n=ca.range(t,e-Fa,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function br(t,e,r){var n=ca.range(t,e-Fa,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function xr(t){return t.source}function _r(t){return t.target}function wr(t,e,r,n){var i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),u=i*Math.sin(t),c=a*Math.cos(r),f=a*Math.sin(r),h=2*Math.asin(Math.sqrt(st(n-e)+i*a*st(r-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,r=Math.sin(h-t)*d,n=r*l+e*c,i=r*u+e*f,a=r*o+e*s;return[Math.atan2(i,n)*Xa,Math.atan2(a,Math.sqrt(n*n+i*i))*Xa]}:function(){return[t*Xa,e*Xa]};return p.distance=h,p}function Ar(){function t(t,i){var o=Math.sin(i*=Ga),a=Math.cos(i),s=wa((t*=Ga)-e),l=Math.cos(s);Ks+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=n*o-r*a*l)*s),r*o+n*a*l),e=t,r=o,n=a}var e,r,n;Js.point=function(i,o){e=i*Ga,r=Math.sin(o*=Ga),n=Math.cos(o),Js.point=t},Js.lineEnd=function(){Js.point=Js.lineEnd=A}}function Mr(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),o=t(n*i);return[o*i*Math.sin(e),o*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,n*a),Math.asin(n&&r*o/n)]},r}function kr(t,e){function r(t,e){a>0?-Ha+Fa>e&&(e=-Ha+Fa):e>Ha-Fa&&(e=Ha-Fa);var r=a/Math.pow(i(e),o);return[r*Math.sin(o*t),a-r*Math.cos(o*t)]}var n=Math.cos(t),i=function(t){return Math.tan(Ua/4+t/2)},o=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),a=n*Math.pow(i(t),o)/o;return o?(r.invert=function(t,e){var r=a-e,n=tt(o)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/o,2*Math.atan(Math.pow(a/n,1/o))-Ha]},r):Er}function Tr(t,e){function r(t,e){var r=o-e;return[r*Math.sin(i*t),o-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),o=n/i+t;return wa(i)<Fa?cr:(r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,o-tt(i)*Math.sqrt(t*t+r*r)]},r)}function Er(t,e){return[t,Math.log(Math.tan(Ua/4+e/2))]}function Lr(t){var e,r=sr(t),n=r.scale,i=r.translate,o=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=i.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var a=o.apply(r,arguments);if(a===r){if(e=null==t){var s=Ua*n(),l=i();o([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(a=null);return a},r.clipExtent(null)}function Sr(t,e){return[Math.log(Math.tan(Ua/4+e/2)),-t]}function Cr(t){return t[0]}function Pr(t){return t[1]}function Rr(t){for(var e=t.length,r=[0,1],n=2,i=2;e>i;i++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Nr(t,e){return t[0]-e[0]||t[1]-e[1]}function zr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Ir(t,e,r,n){var i=t[0],o=r[0],a=e[0]-i,s=n[0]-o,l=t[1],u=r[1],c=e[1]-l,f=n[1]-u,h=(s*(l-u)-f*(i-o))/(f*a-s*c);return[i+h*a,l+h*c]}function Or(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function jr(){on(this),this.edge=this.site=this.circle=null}function Dr(t){var e=fl.pop()||new jr;return e.site=t,e}function Fr(t){Zr(t),ll.remove(t),fl.push(t),on(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},o=t.P,a=t.N,s=[t];Fr(t);for(var l=o;l.circle&&wa(r-l.circle.x)<Fa&&wa(n-l.circle.cy)<Fa;)o=l.P,s.unshift(l),Fr(l),l=o;s.unshift(l),Zr(l);for(var u=a;u.circle&&wa(r-u.circle.x)<Fa&&wa(n-u.circle.cy)<Fa;)a=u.N,s.push(u),Fr(u),u=a;s.push(u),Zr(u);var c,f=s.length;for(c=1;f>c;++c)u=s[c],l=s[c-1],en(u.edge,l.site,u.site,i);l=s[0],u=s[f-1],u.edge=Jr(l.site,u.site,null,i),Wr(l),Wr(u)}function Ur(t){for(var e,r,n,i,o=t.x,a=t.y,s=ll._;s;)if(n=Vr(s,a)-o,n>Fa)s=s.L;else{if(i=o-qr(s,a),!(i>Fa)){n>-Fa?(e=s.P,r=s):i>-Fa?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Dr(t);if(ll.insert(e,l),e||r){if(e===r)return Zr(e),r=Dr(e.site),ll.insert(l,r),l.edge=r.edge=Jr(e.site,l.site),Wr(e),void Wr(r);if(!r)return void(l.edge=Jr(e.site,l.site));Zr(e),Zr(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=r.site,g=p.x-c,v=p.y-f,m=2*(h*v-d*g),y=h*h+d*d,b=g*g+v*v,x={x:(v*y-d*b)/m+c,y:(h*b-g*y)/m+f};en(r.edge,u,p,x),l.edge=Jr(u,t,null,x),r.edge=Jr(t,p,null,x),Wr(e),Wr(r)}}function Vr(t,e){var r=t.site,n=r.x,i=r.y,o=i-e;if(!o)return n;var a=t.P;if(!a)return-(1/0);r=a.site;var s=r.x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/o-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-o/2)))/f+n:(n+s)/2}function qr(t,e){var r=t.N;if(r)return Vr(r,e);var n=t.site;return n.y===e?n.x:1/0}function Hr(t){this.site=t,this.edges=[]}function Gr(t){for(var e,r,n,i,o,a,s,l,u,c,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],g=sl,v=g.length;v--;)if(o=g[v],o&&o.prepare())for(s=o.edges,l=s.length,a=0;l>a;)c=s[a].end(),n=c.x,i=c.y,u=s[++a%l].start(),e=u.x,r=u.y,(wa(n-e)>Fa||wa(i-r)>Fa)&&(s.splice(a,0,new rn(tn(o.site,c,wa(n-f)<Fa&&p-i>Fa?{x:f,y:wa(e-f)<Fa?r:p}:wa(i-p)<Fa&&h-n>Fa?{x:wa(r-p)<Fa?e:h,y:p}:wa(n-h)<Fa&&i-d>Fa?{x:h,y:wa(e-h)<Fa?r:d}:wa(i-d)<Fa&&n-f>Fa?{x:wa(r-d)<Fa?e:f,y:d}:null),o.site,null)),++l)}function Xr(t,e){return e.angle-t.angle}function Yr(){on(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wr(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,o=r.site;if(n!==o){var a=i.x,s=i.y,l=n.x-a,u=n.y-s,c=o.x-a,f=o.y-s,h=2*(l*f-u*c);if(!(h>=-Ba)){var d=l*l+u*u,p=c*c+f*f,g=(f*d-u*p)/h,v=(l*p-c*d)/h,f=v+s,m=hl.pop()||new Yr;m.arc=t,m.site=i,m.x=g+a,m.y=f+Math.sqrt(g*g+v*v),m.cy=f,t.circle=m;for(var y=null,b=cl._;b;)if(m.y<b.y||m.y===b.y&&m.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}cl.insert(y,m),y||(ul=m)}}}}function Zr(t){var e=t.circle;e&&(e.P||(ul=e.N),cl.remove(e),hl.push(e),on(e),t.circle=null)}function Qr(t){for(var e,r=al,n=He(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)e=r[i],(!$r(e,t)||!n(e)||wa(e.a.x-e.b.x)<Fa&&wa(e.a.y-e.b.y)<Fa)&&(e.a=e.b=null,r.splice(i,1))}function $r(t,e){var r=t.b;if(r)return!0;var n,i,o=t.a,a=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,f=t.r,h=c.x,d=c.y,p=f.x,g=f.y,v=(h+p)/2,m=(d+g)/2;if(g===d){if(a>v||v>=s)return;if(h>p){if(o){if(o.y>=u)return}else o={x:v,y:l};r={x:v,y:u}}else{if(o){if(o.y<l)return}else o={x:v,y:u};r={x:v,y:l}}}else if(n=(h-p)/(g-d),i=m-n*v,-1>n||n>1)if(h>p){if(o){if(o.y>=u)return}else o={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(o){if(o.y<l)return}else o={x:(u-i)/n,y:u};r={x:(l-i)/n,y:l}}else if(g>d){if(o){if(o.x>=s)return}else o={x:a,y:n*a+i};r={x:s,y:n*s+i}}else{if(o){if(o.x<a)return}else o={x:s,y:n*s+i};r={x:a,y:n*a+i}}return t.a=o,t.b=r,!0}function Kr(t,e){this.l=t,this.r=e,this.a=this.b=null}function Jr(t,e,r,n){var i=new Kr(t,e);return al.push(i),r&&en(i,t,e,r),n&&en(i,e,t,n),sl[t.i].edges.push(new rn(i,t,e)),sl[e.i].edges.push(new rn(i,e,t)),i}function tn(t,e,r){var n=new Kr(t,null);return n.a=e,n.b=r,al.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 on(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function an(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,o=t.sort(cn).pop();for(al=[],sl=new Array(t.length),ll=new nn,cl=new nn;;)if(i=ul,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))o.x===r&&o.y===n||(sl[o.i]=new Hr(o),Ur(o),r=o.x,n=o.y),o=t.pop();else{if(!i)break;Br(i.arc)}e&&(Qr(e),Gr(e));var a={cells:sl,edges:al};return ll=cl=al=sl=null,a}function cn(t,e){return e.y-t.y||e.x-t.x}function fn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function hn(t){return t.x}function dn(t){return t.y}function pn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function gn(t,e,r,n,i,o){if(!t(e,r,n,i,o)){var a=.5*(r+i),s=.5*(n+o),l=e.nodes;l[0]&&gn(t,l[0],r,n,a,s),l[1]&&gn(t,l[1],a,n,i,s),l[2]&&gn(t,l[2],r,s,a,o),l[3]&&gn(t,l[3],a,s,i,o)}}function vn(t,e,r,n,i,o,a){var s,l=1/0;return function u(t,c,f,h,d){if(!(c>o||f>a||n>h||i>d)){if(p=t.point){var p,g=e-t.x,v=r-t.y,m=g*g+v*v;if(l>m){var y=Math.sqrt(l=m);n=e-y,i=r-y,o=e+y,a=r+y,s=p}}for(var b=t.nodes,x=.5*(c+h),_=.5*(f+d),w=e>=x,A=r>=_,M=A<<1|w,k=M+4;k>M;++M)if(t=b[3&M])switch(3&M){
case 0:u(t,c,f,x,_);break;case 1:u(t,x,f,h,_);break;case 2:u(t,c,_,x,d);break;case 3:u(t,x,_,h,d)}}}(t,n,i,o,a),s}function mn(t,e){t=ca.rgb(t),e=ca.rgb(e);var r=t.r,n=t.g,i=t.b,o=e.r-r,a=e.g-n,s=e.b-i;return function(t){return"#"+wt(Math.round(r+o*t))+wt(Math.round(n+a*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,o=pl.lastIndex=gl.lastIndex=0,a=-1,s=[],l=[];for(t+="",e+="";(r=pl.exec(t))&&(n=gl.exec(e));)(i=n.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,l.push({i:a,x:bn(r,n)})),o=gl.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=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;e>n;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}function _n(t,e){for(var r,n=ca.interpolators.length;--n>=0&&!(r=ca.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],i=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(r=0;s>r;++r)n.push(_n(t[r],e[r]));for(;o>r;++r)i[r]=t[r];for(;a>r;++r)i[r]=e[r];return function(t){for(r=0;s>r;++r)i[r]=n[r](t);return i}}function An(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function Mn(t){return function(e){return 1-t(1-e)}}function kn(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function En(t){return t*t*t}function Ln(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(.5>t?r:3*(t-e)+r-.75)}function Sn(t){return function(e){return Math.pow(e,t)}}function Cn(t){return 1-Math.cos(t*Ha)}function Pn(t){return Math.pow(2,10*(t-1))}function Rn(t){return 1-Math.sqrt(1-t*t)}function Nn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Va*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Va/e)}}function zn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function In(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function On(t,e){t=ca.hcl(t),e=ca.hcl(e);var r=t.h,n=t.c,i=t.l,o=e.h-r,a=e.c-n,s=e.l-i;return isNaN(a)&&(a=0,n=isNaN(n)?e.c:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:-180>o&&(o+=360),function(t){return ht(r+o*t,n+a*t,i+s*t)+""}}function jn(t,e){t=ca.hsl(t),e=ca.hsl(e);var r=t.h,n=t.s,i=t.l,o=e.h-r,a=e.s-n,s=e.l-i;return isNaN(a)&&(a=0,n=isNaN(n)?e.s:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:-180>o&&(o+=360),function(t){return ct(r+o*t,n+a*t,i+s*t)+""}}function Dn(t,e){t=ca.lab(t),e=ca.lab(e);var r=t.l,n=t.a,i=t.b,o=e.l-r,a=e.a-n,s=e.b-i;return function(t){return pt(r+o*t,n+a*t,i+s*t)+""}}function Fn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Vn(e),i=Un(e,r),o=Vn(qn(r,e,-i))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,i*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*Xa,this.translate=[t.e,t.f],this.scale=[n,o],this.skew=o?Math.atan2(i,o)*Xa:0}function Un(t,e){return t[0]*e[0]+t[1]*e[1]}function Vn(t){var e=Math.sqrt(Un(t,t));return e&&(t[0]/=e,t[1]/=e),e}function qn(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function Hn(t){return t.length?t.pop()+",":""}function Gn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:bn(t[0],e[0])},{i:i-2,x:bn(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}function Xn(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Hn(r)+"rotate(",null,")")-2,x:bn(t,e)})):e&&r.push(Hn(r)+"rotate("+e+")")}function Yn(t,e,r,n){t!==e?n.push({i:r.push(Hn(r)+"skewX(",null,")")-2,x:bn(t,e)}):e&&r.push(Hn(r)+"skewX("+e+")")}function Wn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Hn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:bn(t[0],e[0])},{i:i-2,x:bn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Hn(r)+"scale("+e+")")}function Zn(t,e){var r=[],n=[];return t=ca.transform(t),e=ca.transform(e),Gn(t.translate,e.translate,r,n),Xn(t.rotate,e.rotate,r,n),Yn(t.skew,e.skew,r,n),Wn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,o=n.length;++i<o;)r[(e=n[i]).i]=e.x(t);return r.join("")}}function Qn(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function $n(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Kn(t){for(var e=t.source,r=t.target,n=ti(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var o=i.length;r!==n;)i.splice(o,0,r),r=r.parent;return i}function Jn(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function ti(t,e){if(t===e)return t;for(var r=Jn(t),n=Jn(e),i=r.pop(),o=n.pop(),a=null;i===o;)a=i,i=r.pop(),o=n.pop();return a}function ei(t){t.fixed|=2}function ri(t){t.fixed&=-7}function ni(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ii(t){t.fixed&=-5}function oi(t,e,r){var n=0,i=0;if(t.charge=0,!t.leaf)for(var o,a=t.nodes,s=a.length,l=-1;++l<s;)o=a[l],null!=o&&(oi(o,e,r),t.charge+=o.charge,n+=o.charge*o.cx,i+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=e*r[t.point.index];t.charge+=t.pointCharge=u,n+=u*t.point.x,i+=u*t.point.y}t.cx=n/t.charge,t.cy=i/t.charge}function ai(t,e){return ca.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=hi,t}function si(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function li(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(o=t.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)r.push(o[a]);for(;null!=(t=n.pop());)e(t)}function ui(t){return t.children}function ci(t){return t.value}function fi(t,e){return e.value-t.value}function hi(t){return ca.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function di(t){return t.x}function pi(t){return t.y}function gi(t,e,r){t.y0=e,t.y=r}function vi(t){return ca.range(t.length)}function mi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function yi(t){for(var e,r=1,n=0,i=t[0][1],o=t.length;o>r;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function bi(t){return t.reduce(xi,0)}function xi(t,e){return t+e[1]}function _i(t,e){return wi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wi(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,o=[];++r<=e;)o[r]=i*r+n;return o}function Ai(t){return[ca.min(t),ca.max(t)]}function Mi(t,e){return t.value-e.value}function ki(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ti(t,e){t._pack_next=e,e._pack_prev=t}function Ei(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Li(t){function e(t){c=Math.min(t.x-t.r,c),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(u=r.length)){var r,n,i,o,a,s,l,u,c=1/0,f=-(1/0),h=1/0,d=-(1/0);if(r.forEach(Si),n=r[0],n.x=-n.r,n.y=0,e(n),u>1&&(i=r[1],i.x=i.r,i.y=0,e(i),u>2))for(o=r[2],Ri(n,i,o),e(o),ki(n,o),n._pack_prev=o,ki(o,i),i=n._pack_next,a=3;u>a;a++){Ri(n,i,o=r[a]);var p=0,g=1,v=1;for(s=i._pack_next;s!==i;s=s._pack_next,g++)if(Ei(s,o)){p=1;break}if(1==p)for(l=n._pack_prev;l!==s._pack_prev&&!Ei(l,o);l=l._pack_prev,v++);p?(v>g||g==v&&i.r<n.r?Ti(n,i=s):Ti(n=l,i),a--):(ki(n,o),i=o,e(o))}var m=(c+f)/2,y=(h+d)/2,b=0;for(a=0;u>a;a++)o=r[a],o.x-=m,o.y-=y,b=Math.max(b,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=b,r.forEach(Ci)}}function Si(t){t._pack_next=t._pack_prev=t}function Ci(t){delete t._pack_next,delete t._pack_prev}function Pi(t,e,r,n){var i=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n,i)for(var o=-1,a=i.length;++o<a;)Pi(i[o],e,r,n)}function Ri(t,e,r){var n=t.r+r.r,i=e.x-t.x,o=e.y-t.y;if(n&&(i||o)){var a=e.r+r.r,s=i*i+o*o;a*=a,n*=n;var l=.5+(n-a)/(2*s),u=Math.sqrt(Math.max(0,2*a*(n+s)-(n-=s)*n-a*a))/(2*s);r.x=t.x+l*i+u*o,r.y=t.y+l*o-u*i}else r.x=t.x+n,r.y=t.y}function Ni(t,e){return t.parent==e.parent?1:2}function zi(t){var e=t.children;return e.length?e[0]:t.t}function Ii(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Oi(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function ji(t){for(var e,r=0,n=0,i=t.children,o=i.length;--o>=0;)e=i[o],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function Di(t,e,r){return t.a.parent===e.parent?t.a:r}function Fi(t){return 1+ca.max(t,function(t){return t.y})}function Bi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ui(t){var e=t.children;return e&&e.length?Ui(e[0]):t}function Vi(t){var e,r=t.children;return r&&(e=r.length)?Vi(r[e-1]):t}function qi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Hi(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return 0>i&&(r+=i/2,i=0),0>o&&(n+=o/2,o=0),{x:r,y:n,dx:i,dy:o}}function Gi(t){var e=t[0],r=t[t.length-1];return r>e?[e,r]:[r,e]}function Xi(t){return t.rangeExtent?t.rangeExtent():Gi(t.range())}function Yi(t,e,r,n){var i=r(t[0],t[1]),o=n(e[0],e[1]);return function(t){return o(i(t))}}function Wi(t,e){var r,n=0,i=t.length-1,o=t[n],a=t[i];return o>a&&(r=n,n=i,i=r,r=o,o=a,a=r),t[n]=e.floor(o),t[i]=e.ceil(a),t}function Zi(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:Tl}function Qi(t,e,r,n){var i=[],o=[],a=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<=s;)i.push(r(t[a-1],t[a])),o.push(n(e[a-1],e[a]));return function(e){var r=ca.bisect(t,e,1,s)-1;return o[r](i[r](e))}}function $i(t,e,r,n){function i(){var i=Math.min(t.length,e.length)>2?Qi:Yi,l=n?$n:Qn;return a=i(t,e,l,r),s=i(e,t,l,_n),o}function o(t){return a(t)}var a,s;return o.invert=function(t){return s(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},o.range=function(t){return arguments.length?(e=t,i()):e},o.rangeRound=function(t){return o.range(t).interpolate(Fn)},o.clamp=function(t){return arguments.length?(n=t,i()):n},o.interpolate=function(t){return arguments.length?(r=t,i()):r},o.ticks=function(e){return eo(t,e)},o.tickFormat=function(e,r){return ro(t,e,r)},o.nice=function(e){return Ji(t,e),i()},o.copy=function(){return $i(t,e,r,n)},i()}function Ki(t,e){return ca.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Ji(t,e){return Wi(t,Zi(to(t,e)[2])),Wi(t,Zi(to(t,e)[2])),t}function to(t,e){null==e&&(e=10);var r=Gi(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),o=e/n*i;return.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function eo(t,e){return ca.range.apply(ca,to(t,e))}function ro(t,e,r){var n=to(t,e);if(r){var i=ps.exec(r);if(i.shift(),"s"===i[8]){var o=ca.formatPrefix(Math.max(wa(n[0]),wa(n[1])));return i[7]||(i[7]="."+no(o.scale(n[2]))),i[8]="f",r=ca.format(i.join("")),function(t){return r(o.scale(t))+o.symbol}}i[7]||(i[7]="."+io(i[8],n)),r=i.join("")}else r=",."+no(n[2])+"f";return ca.format(r)}function no(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function io(t,e){var r=no(e[2]);return t in El?Math.abs(r-no(Math.max(wa(e[0]),wa(e[1]))))+ +("e"!==t):r-2*("%"===t)}function oo(t,e,r,n){function i(t){return(r?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}return a.invert=function(e){return o(t.invert(e))},a.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),a):n},a.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),a):e},a.nice=function(){var e=Wi(n.map(i),r?Math:Sl);return t.domain(e),n=e.map(o),a},a.ticks=function(){var t=Gi(n),a=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(c-u)){if(r){for(;c>u;u++)for(var h=1;f>h;h++)a.push(o(u)*h);a.push(o(u))}else for(a.push(o(u));u++<c;)for(var h=f-1;h>0;h--)a.push(o(u)*h);for(u=0;a[u]<s;u++);for(c=a.length;a[c-1]>l;c--);a=a.slice(u,c)}return a},a.tickFormat=function(t,r){if(!arguments.length)return Ll;arguments.length<2?r=Ll:"function"!=typeof r&&(r=ca.format(r));var n=Math.max(1,e*t/a.ticks().length);return function(t){var a=t/o(Math.round(i(t)));return e-.5>a*e&&(a*=e),n>=a?r(t):""}},a.copy=function(){return oo(t.copy(),e,r,n)},Ki(a,t)}function ao(t,e,r){function n(e){return t(i(e))}var i=so(e),o=so(1/e);return n.invert=function(e){return o(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(i)),n):r},n.ticks=function(t){return eo(r,t)},n.tickFormat=function(t,e){return ro(r,t,e)},n.nice=function(t){return n.domain(Ji(r,t))},n.exponent=function(a){return arguments.length?(i=so(e=a),o=so(1/e),t.domain(r.map(i)),n):e},n.copy=function(){return ao(t.copy(),e,r)},Ki(n,t)}function so(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function lo(t,e){function r(r){return o[((i.get(r)||("range"===e.t?i.set(r,t.push(r)):NaN))-1)%o.length]}function n(e,r){return ca.range(t.length).map(function(t){return e+r*t})}var i,o,a;return r.domain=function(n){if(!arguments.length)return t;t=[],i=new f;for(var o,a=-1,s=n.length;++a<s;)i.has(o=n[a])||i.set(o,t.push(o));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(o=t,a=0,e={t:"range",a:arguments},r):o},r.rangePoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=(l+u)/2,0):(u-l)/(t.length-1+s);return o=n(l+c*s/2,c),a=0,e={t:"rangePoints",a:arguments},r},r.rangeRoundPoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(t.length-1+s)|0;return o=n(l+Math.round(c*s/2+(u-l-(t.length-1+s)*c)/2),c),a=0,e={t:"rangeRoundPoints",a:arguments},r},r.rangeBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],f=i[1-u],h=(f-c)/(t.length-s+2*l);return o=n(c+h*l,h),u&&o.reverse(),a=h*(1-s),e={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],f=i[1-u],h=Math.floor((f-c)/(t.length-s+2*l));return o=n(c+Math.round((f-c-(t.length-s)*h)/2),h),u&&o.reverse(),a=Math.round(h*(1-s)),e={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return a},r.rangeExtent=function(){return Gi(e.a[0])},r.copy=function(){return lo(t,e)},r.domain(t)}function uo(t,e){function r(){var r=0,i=e.length;for(s=[];++r<i;)s[r-1]=ca.quantile(t,r/i);return n}function n(t){return isNaN(t=+t)?void 0:e[ca.bisect(s,t)]}var s;return n.domain=function(e){return arguments.length?(t=e.map(o).filter(a).sort(i),r()):t},n.range=function(t){return arguments.length?(e=t,r()):e},n.quantiles=function(){return s},n.invertExtent=function(r){return r=e.indexOf(r),0>r?[NaN,NaN]:[r>0?s[r-1]:t[0],r<s.length?s[r]:t[t.length-1]]},n.copy=function(){return uo(t,e)},r()}function co(t,e,r){function n(e){return r[Math.max(0,Math.min(a,Math.floor(o*(e-t))))]}function i(){return o=r.length/(e-t),a=r.length-1,n}var o,a;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],i()):[t,e]},n.range=function(t){return arguments.length?(r=t,i()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=0>e?NaN:e/o+t,[e,e+1/o]},n.copy=function(){return co(t,e,r)},i()}function fo(t,e){function r(r){return r>=r?e[ca.bisect(t,r)]:void 0}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return fo(t,e)},r}function ho(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return eo(t,e)},e.tickFormat=function(e,r){return ro(t,e,r)},e.copy=function(){return ho(t)},e}function po(){return 0}function go(t){return t.innerRadius}function vo(t){return t.outerRadius}function mo(t){return t.startAngle}function yo(t){return t.endAngle}function bo(t){return t&&t.padAngle}function xo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function _o(t,e,r,n,i){var o=t[0]-e[0],a=t[1]-e[1],s=(i?n:-n)/Math.sqrt(o*o+a*a),l=s*a,u=-s*o,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,v=h-c,m=d-f,y=v*v+m*m,b=r-n,x=c*d-h*f,_=(0>m?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,A=(-x*v-m*_)/y,M=(x*m+v*_)/y,k=(-x*v+m*_)/y,T=w-p,E=A-g,L=M-p,S=k-g;return T*T+E*E>L*L+S*S&&(w=M,A=k),[[w-l,A-u],[w*r/b,A*r/b]]}function wo(t){function e(e){function a(){u.push("M",o(t(c),s))}for(var l,u=[],c=[],f=-1,h=e.length,d=Lt(r),p=Lt(n);++f<h;)i.call(this,l=e[f],f)?c.push([+d.call(this,l,f),+p.call(this,l,f)]):c.length&&(a(),c=[]);return c.length&&a(),u.length?u.join(""):null}var r=Cr,n=Pr,i=Pe,o=Ao,a=o.key,s=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(a="function"==typeof t?o=t:(o=Il.get(t)||Ao).key,e):a},e.tension=function(t){return arguments.length?(s=t,e):s},e}function Ao(t){return t.length>1?t.join("L"):t+"Z"}function Mo(t){return t.join("L")+"Z"}function ko(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&i.push("H",n[0]),i.join("")}function To(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("V",(n=t[e])[1],"H",n[0]);return i.join("")}function Eo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n=t[e])[0],"V",n[1]);return i.join("")}function Lo(t,e){return t.length<4?Ao(t):t[1]+Po(t.slice(1,-1),Ro(t,e))}function So(t,e){return t.length<3?Mo(t):t[0]+Po((t.push(t[0]),t),Ro([t[t.length-2]].concat(t,[t[1]]),e))}function Co(t,e){return t.length<3?Ao(t):t[0]+Po(t,Ro(t,e))}function Po(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Ao(t);var r=t.length!=e.length,n="",i=t[0],o=t[1],a=e[0],s=a,l=1;if(r&&(n+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],i=t[1],l=2),e.length>1){s=e[1],o=t[l],l++,n+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u<e.length;u++,l++)o=t[l],s=e[u],n+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}if(r){var c=t[l];n+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+c[0]+","+c[1]}return n}function Ro(t,e){for(var r,n=[],i=(1-e)/2,o=t[0],a=t[1],s=1,l=t.length;++s<l;)r=o,o=a,a=t[s],n.push([i*(a[0]-r[0]),i*(a[1]-r[1])]);return n}function No(t){if(t.length<3)return Ao(t);var e=1,r=t.length,n=t[0],i=n[0],o=n[1],a=[i,i,i,(n=t[1])[0]],s=[o,o,o,n[1]],l=[i,",",o,"L",jo(Dl,a),",",jo(Dl,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),Do(l,a,s);return t.pop(),l.push("L",n),l.join("")}function zo(t){if(t.length<4)return Ao(t);for(var e,r=[],n=-1,i=t.length,o=[0],a=[0];++n<3;)e=t[n],o.push(e[0]),a.push(e[1]);for(r.push(jo(Dl,o)+","+jo(Dl,a)),--n;++n<i;)e=t[n],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Do(r,o,a);return r.join("")}function Io(t){for(var e,r,n=-1,i=t.length,o=i+4,a=[],s=[];++n<4;)r=t[n%i],a.push(r[0]),s.push(r[1]);for(e=[jo(Dl,a),",",jo(Dl,s)],--n;++n<o;)r=t[n%i],a.shift(),a.push(r[0]),s.shift(),s.push(r[1]),Do(e,a,s);return e.join("")}function Oo(t,e){var r=t.length-1;if(r)for(var n,i,o=t[0][0],a=t[0][1],s=t[r][0]-o,l=t[r][1]-a,u=-1;++u<=r;)n=t[u],i=u/r,n[0]=e*n[0]+(1-e)*(o+i*s),n[1]=e*n[1]+(1-e)*(a+i*l);return No(t)}function jo(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Do(t,e,r){t.push("C",jo(Ol,e),",",jo(Ol,r),",",jo(jl,e),",",jo(jl,r),",",jo(Dl,e),",",jo(Dl,r))}function Fo(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Bo(t){for(var e=0,r=t.length-1,n=[],i=t[0],o=t[1],a=n[0]=Fo(i,o);++e<r;)n[e]=(a+(a=Fo(i=o,o=t[e+1])))/2;return n[e]=a,n}function Uo(t){for(var e,r,n,i,o=[],a=Bo(t),s=-1,l=t.length-1;++s<l;)e=Fo(t[s],t[s+1]),wa(e)<Fa?a[s]=a[s+1]=0:(r=a[s]/e,n=a[s+1]/e,i=r*r+n*n,i>9&&(i=3*e/Math.sqrt(i),a[s]=i*r,a[s+1]=i*n));for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([i||0,a[s]*i||0]);return o}function Vo(t){return t.length<3?Ao(t):t[0]+Po(t,Uo(t))}function qo(t){for(var e,r,n,i=-1,o=t.length;++i<o;)e=t[i],r=e[0],n=e[1]-Ha,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Ho(t){function e(e){function l(){g.push("M",s(t(m),f),c,u(t(v.reverse()),f),"Z")}for(var h,d,p,g=[],v=[],m=[],y=-1,b=e.length,x=Lt(r),_=Lt(i),w=r===n?function(){return d}:Lt(n),A=i===o?function(){return p}:Lt(o);++y<b;)a.call(this,h=e[y],y)?(v.push([d=+x.call(this,h,y),p=+_.call(this,h,y)]),m.push([+w.call(this,h,y),+A.call(this,h,y)])):v.length&&(l(),v=[],m=[]);return v.length&&l(),g.length?g.join(""):null}var r=Cr,n=Cr,i=0,o=Pr,a=Pe,s=Ao,l=s.key,u=s,c="L",f=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=o=t,e):o},e.y0=function(t){return arguments.length?(i=t,e):i},e.y1=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(l="function"==typeof t?s=t:(s=Il.get(t)||Ao).key,u=s.reverse||s,c=s.closed?"M":"L",e):l},e.tension=function(t){return arguments.length?(f=t,e):f},e}function Go(t){return t.radius}function Xo(t){return[t.x,t.y]}function Yo(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Ha;return[r*Math.cos(n),r*Math.sin(n)]}}function Wo(){return 64}function Zo(){return"circle"}function Qo(t){var e=Math.sqrt(t/Ua);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function $o(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Ko(t,e,r){return Ea(t,Gl),t.namespace=e,t.id=r,t}function Jo(t,e,r,n){var i=t.id,o=t.namespace;return G(t,"function"==typeof r?function(t,a,s){t[o][i].tween.set(e,n(r.call(t,t.__data__,a,s)))}:(r=n(r),function(t){t[o][i].tween.set(e,r)}))}function ta(t){return null==t&&(t=""),function(){this.textContent=t}}function ea(t){return null==t?"__transition__":"__transition_"+t+"__"}function ra(t,e,r,n,i){function o(t){var e=g.delay;return u.t=e+l,t>=e?a(t-e):void(u.c=a)}function a(r){var i=p.active,o=p[i];o&&(o.timer.c=null,o.timer.t=NaN,--p.count,delete p[i],o.event&&o.event.interrupt.call(t,t.__data__,o.index));for(var a in p)if(n>+a){var f=p[a];f.timer.c=null,f.timer.t=NaN,--p.count,delete p[a]}u.c=s,Nt(function(){return u.c&&s(r||1)&&(u.c=null,u.t=NaN),1},0,l),p.active=n,g.event&&g.event.start.call(t,t.__data__,e),d=[],g.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&d.push(n)}),h=g.ease,c=g.duration}function s(i){for(var o=i/c,a=h(o),s=d.length;s>0;)d[--s].call(t,a);return o>=1?(g.event&&g.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1):void 0}var l,u,c,h,d,p=t[r]||(t[r]={active:0,count:0}),g=p[n];g||(l=i.time,u=Nt(o,0,l),g=p[n]={tween:new f,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function na(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function ia(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function oa(t){return t.toISOString()}function aa(t,e,r){function n(e){return t(e)}function i(t,r){var n=t[1]-t[0],i=n/r,o=ca.bisect(tu,i);return o==tu.length?[e.year,to(t.map(function(t){return t/31536e6}),r)[2]]:o?e[i/tu[o-1]<tu[o]/i?o-1:o]:[nu,to(t,r)[2]]}return n.invert=function(e){return sa(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(sa)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,sa(+r+1),e).length}var o=n.domain(),a=Gi(o),s=null==t?i(a,10):"number"==typeof t&&i(a,t);return s&&(t=s[0],e=s[1]),n.domain(Wi(o,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=sa(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=sa(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Gi(n.domain()),o=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(r[0],sa(+r[1]+1),1>e?1:e)},n.tickFormat=function(){return r},n.copy=function(){return aa(t.copy(),e,r)},Ki(n,t)}function sa(t){return new Date(t)}function la(t){return JSON.parse(t.responseText)}function ua(t){var e=da.createRange();return e.selectNode(da.body),e.createContextualFragment(t.responseText)}var ca={version:"3.5.16"},fa=[].slice,ha=function(t){return fa.call(t)},da=this.document;if(da)try{ha(da.documentElement.childNodes)[0].nodeType}catch(pa){ha=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),da)try{da.createElement("DIV").style.setProperty("opacity",0,"")}catch(ga){var va=this.Element.prototype,ma=va.setAttribute,ya=va.setAttributeNS,ba=this.CSSStyleDeclaration.prototype,xa=ba.setProperty;va.setAttribute=function(t,e){ma.call(this,t,e+"")},va.setAttributeNS=function(t,e,r){ya.call(this,t,e,r+"")},ba.setProperty=function(t,e,r){xa.call(this,t,e+"",r)}}ca.ascending=i,ca.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:NaN},ca.min=function(t,e){var r,n,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<o;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<o;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<o;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},ca.max=function(t,e){var r,n,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<o;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<o;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<o;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},ca.extent=function(t,e){var r,n,i,o=-1,a=t.length;if(1===arguments.length){for(;++o<a;)if(null!=(n=t[o])&&n>=n){r=i=n;break}for(;++o<a;)null!=(n=t[o])&&(r>n&&(r=n),n>i&&(i=n))}else{for(;++o<a;)if(null!=(n=e.call(t,t[o],o))&&n>=n){r=i=n;break}for(;++o<a;)null!=(n=e.call(t,t[o],o))&&(r>n&&(r=n),n>i&&(i=n))}return[r,i]},ca.sum=function(t,e){var r,n=0,i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)a(r=+t[o])&&(n+=r);else for(;++o<i;)a(r=+e.call(t,t[o],o))&&(n+=r);return n},ca.mean=function(t,e){var r,n=0,i=t.length,s=-1,l=i;if(1===arguments.length)for(;++s<i;)a(r=o(t[s]))?n+=r:--l;else for(;++s<i;)a(r=o(e.call(t,t[s],s)))?n+=r:--l;return l?n/l:void 0},ca.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],o=r-n;return o?i+o*(t[n]-i):i},ca.median=function(t,e){var r,n=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)a(r=o(t[l]))&&n.push(r);else for(;++l<s;)a(r=o(e.call(t,t[l],l)))&&n.push(r);return n.length?ca.quantile(n.sort(i),.5):void 0},ca.variance=function(t,e){var r,n,i=t.length,s=0,l=0,u=-1,c=0;if(1===arguments.length)for(;++u<i;)a(r=o(t[u]))&&(n=r-s,s+=n/++c,l+=n*(r-s));else for(;++u<i;)a(r=o(e.call(t,t[u],u)))&&(n=r-s,s+=n/++c,l+=n*(r-s));return c>1?l/(c-1):void 0},ca.deviation=function(){var t=ca.variance.apply(this,arguments);return t?Math.sqrt(t):t};var _a=s(i);ca.bisectLeft=_a.left,ca.bisect=ca.bisectRight=_a.right,ca.bisector=function(t){return s(1===t.length?function(e,r){return i(t(e),r)}:t)},ca.shuffle=function(t,e,r){(o=arguments.length)<3&&(r=t.length,2>o&&(e=0));for(var n,i,o=r-e;o;)i=Math.random()*o--|0,n=t[o+e],t[o+e]=t[i+e],t[i+e]=n;return t},ca.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},ca.pairs=function(t){for(var e,r=0,n=t.length-1,i=t[0],o=new Array(0>n?0:n);n>r;)o[r]=[e=i,i=t[++r]];return o},ca.transpose=function(t){if(!(i=t.length))return[];for(var e=-1,r=ca.min(t,l),n=new Array(r);++e<r;)for(var i,o=-1,a=n[e]=new Array(i);++o<i;)a[o]=t[o][e];return n},ca.zip=function(){return ca.transpose(arguments)},ca.keys=function(t){var e=[];for(var r in t)e.push(r);return e},ca.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},ca.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},ca.merge=function(t){for(var e,r,n,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(r=new Array(a);--i>=0;)for(n=t[i],e=n.length;--e>=0;)r[--a]=n[e];return r};var wa=Math.abs;ca.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r===1/0)throw new Error("infinite range");var n,i=[],o=u(wa(r)),a=-1;if(t*=o,e*=o,r*=o,0>r)for(;(n=t+r*++a)>e;)i.push(n/o);else for(;(n=t+r*++a)<e;)i.push(n/o);return i},ca.map=function(t,e){var r=new f;if(t instanceof f)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,i=-1,o=t.length;if(1===arguments.length)for(;++i<o;)r.set(i,t[i]);else for(;++i<o;)r.set(e.call(t,n=t[i],i),n)}else for(var a in t)r.set(a,t[a]);return r};var Aa="__proto__",Ma="\x00";c(f,{has:p,get:function(t){return this._[h(t)]},set:function(t,e){return this._[h(t)]=e},remove:g,keys:v,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:d(e),value:this._[e]});return t},size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e),this._[e])}}),ca.nest=function(){function t(e,a,s){if(s>=o.length)return n?n.call(i,a):r?a.sort(r):a;for(var l,u,c,h,d=-1,p=a.length,g=o[s++],v=new f;++d<p;)(h=v.get(l=g(u=a[d])))?h.push(u):v.set(l,[u]);return e?(u=e(),c=function(r,n){u.set(r,t(e,n,s))}):(u={},c=function(r,n){u[r]=t(e,n,s)}),v.forEach(c),u}function e(t,r){if(r>=o.length)return t;var n=[],i=a[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},o=[],a=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(ca.map,r,0),0)},i.key=function(t){return o.push(t),i},i.sortKeys=function(t){return a[o.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},ca.set=function(t){var e=new b;if(t)for(var r=0,n=t.length;n>r;++r)e.add(t[r]);return e},c(b,{has:p,add:function(t){return this._[h(t+="")]=!0,t},remove:g,values:v,size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}}),ca.behavior={},ca.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=_(t,e,e[r]);return t};var ka=["webkit","ms","moz","Moz","o","O"];ca.dispatch=function(){for(var t=new M,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=k(t);return t},M.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}},ca.event=null,ca.requote=function(t){return t.replace(Ta,"\\$&")};var Ta=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ea={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},La=function(t,e){return e.querySelector(t)},Sa=function(t,e){return e.querySelectorAll(t)},Ca=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(Ca=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(La=function(t,e){return Sizzle(t,e)[0]||null},Sa=Sizzle,Ca=Sizzle.matchesSelector),ca.selection=function(){return ca.select(da.documentElement)};var Pa=ca.selection.prototype=[];Pa.select=function(t){var e,r,n,i,o=[];t=C(t);for(var a=-1,s=this.length;++a<s;){o.push(e=[]),e.parentNode=(n=this[a]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,a)),r&&"__data__"in i&&(r.__data__=i.__data__)):e.push(null)}return S(o)},Pa.selectAll=function(t){var e,r,n=[];t=P(t);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],s=-1,l=a.length;++s<l;)(r=a[s])&&(n.push(e=ha(t.call(r,r.__data__,s,i))),e.parentNode=r);return S(n)};var Ra="http://www.w3.org/1999/xhtml",Na={svg:"http://www.w3.org/2000/svg",xhtml:Ra,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ca.ns={prefix:Na,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Na.hasOwnProperty(r)?{space:Na[r],local:t}:t}},Pa.attr=function(t,e){
if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=ca.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(R(e,t[e]));return this}return this.each(R(t,e))},Pa.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=I(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(!z(t[i]).test(e))return!1;return!0}for(e in t)this.each(O(e,t[e]));return this}return this.each(O(t,e))},Pa.style=function(t,e,r){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(r in t)this.each(D(r,t[r],e));return this}if(2>i){var o=this.node();return n(o).getComputedStyle(o,null).getPropertyValue(t)}r=""}return this.each(D(t,e,r))},Pa.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))},Pa.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},Pa.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},Pa.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Pa.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)})},Pa.remove=function(){return this.each(U)},Pa.data=function(t,e){function r(t,r){var n,i,o,a=t.length,c=r.length,h=Math.min(a,c),d=new Array(c),p=new Array(c),g=new Array(a);if(e){var v,m=new f,y=new Array(a);for(n=-1;++n<a;)(i=t[n])&&(m.has(v=e.call(i,i.__data__,n))?g[n]=i:m.set(v,i),y[n]=v);for(n=-1;++n<c;)(i=m.get(v=e.call(r,o=r[n],n)))?i!==!0&&(d[n]=i,i.__data__=o):p[n]=V(o),m.set(v,!0);for(n=-1;++n<a;)n in y&&m.get(y[n])!==!0&&(g[n]=t[n])}else{for(n=-1;++n<h;)i=t[n],o=r[n],i?(i.__data__=o,d[n]=i):p[n]=V(o);for(;c>n;++n)p[n]=V(r[n]);for(;a>n;++n)g[n]=t[n]}p.update=d,p.parentNode=d.parentNode=g.parentNode=t.parentNode,s.push(p),l.push(d),u.push(g)}var n,i,o=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(n=this[0]).length);++o<a;)(i=n[o])&&(t[o]=i.__data__);return t}var s=X([]),l=S([]),u=S([]);if("function"==typeof t)for(;++o<a;)r(n=this[o],t.call(n,n.parentNode.__data__,o));else for(;++o<a;)r(n=this[o],t);return l.enter=function(){return s},l.exit=function(){return u},l},Pa.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Pa.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=q(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]),e.parentNode=(r=this[o]).parentNode;for(var s=0,l=r.length;l>s;s++)(n=r[s])&&t.call(n,n.__data__,s,o)&&e.push(n)}return S(i)},Pa.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,o=n[i];--i>=0;)(r=n[i])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},Pa.sort=function(t){t=H.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Pa.each=function(t){return G(this,function(e,r,n){t.call(e,e.__data__,r,n)})},Pa.call=function(t){var e=ha(arguments);return t.apply(e[0]=this,e),this},Pa.empty=function(){return!this.node()},Pa.node=function(){for(var t=0,e=this.length;e>t;t++)for(var r=this[t],n=0,i=r.length;i>n;n++){var o=r[n];if(o)return o}return null},Pa.size=function(){var t=0;return G(this,function(){++t}),t};var za=[];ca.selection.enter=X,ca.selection.enter.prototype=za,za.append=Pa.append,za.empty=Pa.empty,za.node=Pa.node,za.call=Pa.call,za.size=Pa.size,za.select=function(t){for(var e,r,n,i,o,a=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,a.push(e=[]),e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(o=i[u])?(e.push(n[u]=r=t.call(i.parentNode,o.__data__,u,s)),r.__data__=o.__data__):e.push(null)}return S(a)},za.insert=function(t,e){return arguments.length<2&&(e=Y(this)),Pa.insert.call(this,t,e)},ca.select=function(t){var r;return"string"==typeof t?(r=[La(t,da)],r.parentNode=da.documentElement):(r=[t],r.parentNode=e(t)),S([r])},ca.selectAll=function(t){var e;return"string"==typeof t?(e=ha(Sa(t,da)),e.parentNode=da.documentElement):(e=ha(t),e.parentNode=null),S([e])},Pa.on=function(t,e,r){var n=arguments.length;if(3>n){if("string"!=typeof t){2>n&&(e=!1);for(r in t)this.each(W(r,t[r],e));return this}if(2>n)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(W(t,e,r))};var Ia=ca.map({mouseenter:"mouseover",mouseleave:"mouseout"});da&&Ia.forEach(function(t){"on"+t in da&&Ia.remove(t)});var Oa,ja=0;ca.mouse=function(t){return K(t,E())};var Da=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ca.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=E().changedTouches),e)for(var n,i=0,o=e.length;o>i;++i)if((n=e[i]).identifier===r)return K(t,n)},ca.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function e(t,e,n,o,a){return function(){function s(){var t,r,n=e(h,g);n&&(t=n[0]-b[0],r=n[1]-b[1],p|=t|r,b=n,d({type:"drag",x:n[0]+u[0],y:n[1]+u[1],dx:t,dy:r}))}function l(){e(h,g)&&(m.on(o+v,null).on(a+v,null),y(p),d({type:"dragend"}))}var u,c=this,f=ca.event.target.correspondingElement||ca.event.target,h=c.parentNode,d=r.of(c,arguments),p=0,g=t(),v=".drag"+(null==g?"":"-"+g),m=ca.select(n(f)).on(o+v,s).on(a+v,l),y=$(f),b=e(h,g);i?(u=i.apply(c,arguments),u=[u.x-b[0],u.y-b[1]]):u=[0,0],d({type:"dragstart"})}}var r=L(t,"drag","dragstart","dragend"),i=null,o=e(A,ca.mouse,n,"mousemove","mouseup"),a=e(J,ca.touch,x,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},ca.rebind(t,r,"on")},ca.touches=function(t,e){return arguments.length<2&&(e=E().touches),e?ha(e).map(function(e){var r=K(t,e);return r.identifier=e.identifier,r}):[]};var Fa=1e-6,Ba=Fa*Fa,Ua=Math.PI,Va=2*Ua,qa=Va-Fa,Ha=Ua/2,Ga=Ua/180,Xa=180/Ua,Ya=Math.SQRT2,Wa=2,Za=4;ca.interpolateZoom=function(t,e){var r,n,i=t[0],o=t[1],a=t[2],s=e[0],l=e[1],u=e[2],c=s-i,f=l-o,h=c*c+f*f;if(Ba>h)n=Math.log(u/a)/Ya,r=function(t){return[i+t*c,o+t*f,a*Math.exp(Ya*t*n)]};else{var d=Math.sqrt(h),p=(u*u-a*a+Za*h)/(2*a*Wa*d),g=(u*u-a*a-Za*h)/(2*u*Wa*d),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Ya,r=function(t){var e=t*n,r=ot(v),s=a/(Wa*d)*(r*at(Ya*e+v)-it(v));return[i+s*c,o+s*f,a*r/ot(Ya*e+v)]}}return r.duration=1e3*n,r},ca.behavior.zoom=function(){function t(t){t.on(P,f).on($a+".zoom",d).on("dblclick.zoom",p).on(z,h)}function e(t){return[(t[0]-M.x)/M.k,(t[1]-M.y)/M.k]}function r(t){return[t[0]*M.k+M.x,t[1]*M.k+M.y]}function i(t){M.k=Math.max(E[0],Math.min(E[1],t))}function o(t,e){e=r(e),M.x+=t[0]-e[0],M.y+=t[1]-e[1]}function a(e,r,n,a){e.__chart__={x:M.x,y:M.y,k:M.k},i(Math.pow(2,a)),o(v=r,n),e=ca.select(e),S>0&&(e=e.transition().duration(S)),e.call(t.event)}function s(){_&&_.domain(x.range().map(function(t){return(t-M.x)/M.k}).map(x.invert)),A&&A.domain(w.range().map(function(t){return(t-M.y)/M.k}).map(w.invert))}function l(t){C++||t({type:"zoomstart"})}function u(t){s(),t({type:"zoom",scale:M.k,translate:[M.x,M.y]})}function c(t){--C||(t({type:"zoomend"}),v=null)}function f(){function t(){s=1,o(ca.mouse(i),h),u(a)}function r(){f.on(R,null).on(N,null),d(s),c(a)}var i=this,a=I.of(i,arguments),s=0,f=ca.select(n(i)).on(R,t).on(N,r),h=e(ca.mouse(i)),d=$(i);Hl.call(i),l(a)}function h(){function t(){var t=ca.touches(p);return d=M.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=e(t))}),t}function r(){var e=ca.event.target;ca.select(e).on(x,n).on(_,s),w.push(e);for(var r=ca.event.changedTouches,i=0,o=r.length;o>i;++i)v[r[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(500>u-b){var c=l[0];a(p,c,v[c.identifier],Math.floor(Math.log(M.k)/Math.LN2)+1),T()}b=u}else if(l.length>1){var c=l[0],f=l[1],h=c[0]-f[0],d=c[1]-f[1];m=h*h+d*d}}function n(){var t,e,r,n,a=ca.touches(p);Hl.call(p);for(var s=0,l=a.length;l>s;++s,n=null)if(r=a[s],n=v[r.identifier]){if(e)break;t=r,e=n}if(n){var c=(c=r[0]-t[0])*c+(c=r[1]-t[1])*c,f=m&&Math.sqrt(c/m);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],i(f*d)}b=null,o(t,e),u(g)}function s(){if(ca.event.touches.length){for(var e=ca.event.changedTouches,r=0,n=e.length;n>r;++r)delete v[e[r].identifier];for(var i in v)return void t()}ca.selectAll(w).on(y,null),A.on(P,f).on(z,h),k(),c(g)}var d,p=this,g=I.of(p,arguments),v={},m=0,y=".zoom-"+ca.event.changedTouches[0].identifier,x="touchmove"+y,_="touchend"+y,w=[],A=ca.select(p),k=$(p);r(),l(g),A.on(P,null).on(z,r)}function d(){var t=I.of(this,arguments);y?clearTimeout(y):(Hl.call(this),g=e(v=m||ca.mouse(this)),l(t)),y=setTimeout(function(){y=null,c(t)},50),T(),i(Math.pow(2,.002*Qa())*M.k),o(v,g),u(t)}function p(){var t=ca.mouse(this),r=Math.log(M.k)/Math.LN2;a(this,t,e(t),ca.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var g,v,m,y,b,x,_,w,A,M={x:0,y:0,k:1},k=[960,500],E=Ka,S=250,C=0,P="mousedown.zoom",R="mousemove.zoom",N="mouseup.zoom",z="touchstart.zoom",I=L(t,"zoomstart","zoom","zoomend");return $a||($a="onwheel"in da?(Qa=function(){return-ca.event.deltaY*(ca.event.deltaMode?120:1)},"wheel"):"onmousewheel"in da?(Qa=function(){return ca.event.wheelDelta},"mousewheel"):(Qa=function(){return-ca.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=I.of(this,arguments),e=M;Vl?ca.select(this).transition().each("start.zoom",function(){M=this.__chart__||{x:0,y:0,k:1},l(t)}).tween("zoom:zoom",function(){var r=k[0],n=k[1],i=v?v[0]:r/2,o=v?v[1]:n/2,a=ca.interpolateZoom([(i-M.x)/M.k,(o-M.y)/M.k,r/M.k],[(i-e.x)/e.k,(o-e.y)/e.k,r/e.k]);return function(e){var n=a(e),s=r/n[2];this.__chart__=M={x:i-n[0]*s,y:o-n[1]*s,k:s},u(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)}):(this.__chart__=M,l(t),u(t),c(t))})},t.translate=function(e){return arguments.length?(M={x:+e[0],y:+e[1],k:M.k},s(),t):[M.x,M.y]},t.scale=function(e){return arguments.length?(M={x:M.x,y:M.y,k:null},i(+e),s(),t):M.k},t.scaleExtent=function(e){return arguments.length?(E=null==e?Ka:[+e[0],+e[1]],t):E},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(k=e&&[+e[0],+e[1]],t):k},t.duration=function(e){return arguments.length?(S=+e,t):S},t.x=function(e){return arguments.length?(_=e,x=e.copy(),M={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(A=e,w=e.copy(),M={x:0,y:0,k:1},t):A},ca.rebind(t,I,"on")};var Qa,$a,Ka=[0,1/0];ca.color=lt,lt.prototype.toString=function(){return this.rgb()+""},ca.hsl=ut;var Ja=ut.prototype=new lt;Ja.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,this.l/t)},Ja.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,t*this.l)},Ja.rgb=function(){return ct(this.h,this.s,this.l)},ca.hcl=ft;var ts=ft.prototype=new lt;ts.brighter=function(t){return new ft(this.h,this.c,Math.min(100,this.l+es*(arguments.length?t:1)))},ts.darker=function(t){return new ft(this.h,this.c,Math.max(0,this.l-es*(arguments.length?t:1)))},ts.rgb=function(){return ht(this.h,this.c,this.l).rgb()},ca.lab=dt;var es=18,rs=.95047,ns=1,is=1.08883,os=dt.prototype=new lt;os.brighter=function(t){return new dt(Math.min(100,this.l+es*(arguments.length?t:1)),this.a,this.b)},os.darker=function(t){return new dt(Math.max(0,this.l-es*(arguments.length?t:1)),this.a,this.b)},os.rgb=function(){return pt(this.l,this.a,this.b)},ca.rgb=bt;var as=bt.prototype=new lt;as.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&i>e&&(e=i),r&&i>r&&(r=i),n&&i>n&&(n=i),new bt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new bt(i,i,i)},as.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new bt(t*this.r,t*this.g,t*this.b)},as.hsl=function(){return Mt(this.r,this.g,this.b)},as.toString=function(){return"#"+wt(this.r)+wt(this.g)+wt(this.b)};var ss=ca.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ss.forEach(function(t,e){ss.set(t,xt(e))}),ca.functor=Lt,ca.xhr=St(x),ca.dsv=function(t,e){function r(t,r,o){arguments.length<3&&(o=r,r=null);var a=Ct(t,e,null==r?n:i(r),o);return a.row=function(t){return arguments.length?a.response(null==(r=t)?n:i(t)):r},a}function n(t){return r.parse(t.responseText)}function i(t){return function(e){return r.parse(e.responseText,t)}}function o(e){return e.map(a).join(t)}function a(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,r){return e(i(t),r)}:i})},r.parseRows=function(t,e){function r(){if(c>=u)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<u;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}c=r+2;var n=t.charCodeAt(r+1);return 13===n?(i=!0,10===t.charCodeAt(r+2)&&++c):10===n&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u>c;){var n=t.charCodeAt(c++),s=1;if(10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(c)&&(++c,++s);else if(n!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var n,i,o={},a={},s=[],u=t.length,c=0,f=0;(n=r())!==a;){for(var h=[];n!==o&&n!==a;)h.push(n),n=r();e&&null==(h=e(h,f++))||s.push(h)}return s},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new b,i=[];return e.forEach(function(t){for(var e in t)n.has(e)||i.push(n.add(e))}),[i.map(a).join(t)].concat(e.map(function(e){return i.map(function(t){return a(e[t])}).join(t)})).join("\n")},r.formatRows=function(t){return t.map(o).join("\n")},r},ca.csv=ca.dsv(",","text/csv"),ca.tsv=ca.dsv(" ","text/tab-separated-values");var ls,us,cs,fs,hs=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};ca.timer=function(){Nt.apply(this,arguments)},ca.timer.flush=function(){It(),Ot()},ca.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ds=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Dt);ca.formatPrefix=function(t,e){var r=0;return(t=+t)&&(0>t&&(t*=-1),e&&(t=ca.round(t,jt(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),ds[8+r/3]};var ps=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,gs=ca.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=ca.round(t,jt(t,e))).toFixed(Math.max(0,Math.min(20,jt(t*(1+1e-15),e))))}}),vs=ca.time={},ms=Date;Ut.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){ys.setUTCDate.apply(this._,arguments)},setDay:function(){ys.setUTCDay.apply(this._,arguments)},setFullYear:function(){ys.setUTCFullYear.apply(this._,arguments)},setHours:function(){ys.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){ys.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){ys.setUTCMinutes.apply(this._,arguments)},setMonth:function(){ys.setUTCMonth.apply(this._,arguments)},setSeconds:function(){ys.setUTCSeconds.apply(this._,arguments)},setTime:function(){ys.setTime.apply(this._,arguments)}};var ys=Date.prototype;vs.year=Vt(function(t){return t=vs.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),vs.years=vs.year.range,vs.years.utc=vs.year.utc.range,vs.day=Vt(function(t){var e=new ms(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),vs.days=vs.day.range,vs.days.utc=vs.day.utc.range,vs.dayOfYear=function(t){var e=vs.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=vs[t]=Vt(function(t){return(t=vs.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=vs.year(t).getDay();return Math.floor((vs.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});vs[t+"s"]=r.range,vs[t+"s"].utc=r.utc.range,vs[t+"OfYear"]=function(t){var r=vs.year(t).getDay();return Math.floor((vs.dayOfYear(t)+(r+e)%7)/7)}}),vs.week=vs.sunday,vs.weeks=vs.sunday.range,vs.weeks.utc=vs.sunday.utc.range,vs.weekOfYear=vs.sundayOfYear;var bs={"-":"",_:" ",0:"0"},xs=/^\s*\d+/,_s=/^%/;ca.locale=function(t){return{numberFormat:Ft(t),timeFormat:Ht(t)}};var ws=ca.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ca.format=ws.numberFormat,ca.geo={},fe.prototype={s:0,t:0,add:function(t){he(t,this.t,As),he(As.s,this.s,this),this.s?this.t+=As.t:this.s=As.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var As=new fe;ca.geo.stream=function(t,e){t&&Ms.hasOwnProperty(t.type)?Ms[t.type](t,e):de(t,e)};var Ms={Feature:function(t,e){de(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)de(r[n].geometry,e)}},ks={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){pe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)pe(r[n],e,0)},Polygon:function(t,e){ge(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)ge(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)de(r[n],e)}};ca.geo.area=function(t){return Ts=0,ca.geo.stream(t,Ls),Ts};var Ts,Es=new fe,Ls={sphere:function(){Ts+=4*Ua},point:A,lineStart:A,lineEnd:A,polygonStart:function(){Es.reset(),Ls.lineStart=ve},polygonEnd:function(){var t=2*Es;Ts+=0>t?4*Ua+t:t,Ls.lineStart=Ls.lineEnd=Ls.point=A}};ca.geo.bounds=function(){function t(t,e){b.push(x=[c=t,h=t]),f>e&&(f=e),e>d&&(d=e)}function e(e,r){var n=me([e*Ga,r*Ga]);if(m){var i=be(m,n),o=[i[1],-i[0],0],a=be(o,i);we(a),a=Ae(a);var l=e-p,u=l>0?1:-1,g=a[0]*Xa*u,v=wa(l)>180;if(v^(g>u*p&&u*e>g)){var y=a[1]*Xa;y>d&&(d=y)}else if(g=(g+360)%360-180,v^(g>u*p&&u*e>g)){var y=-a[1]*Xa;f>y&&(f=y)}else f>r&&(f=r),r>d&&(d=r);v?p>e?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e):h>=c?(c>e&&(c=e),e>h&&(h=e)):e>p?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e)}else t(e,r);m=n,p=e}function r(){_.point=e}function n(){x[0]=c,x[1]=h,_.point=t,m=null}function i(t,r){if(m){var n=t-p;y+=wa(n)>180?n+(n>0?360:-360):n}else g=t,v=r;Ls.point(t,r),e(t,r)}function o(){Ls.lineStart()}function a(){i(g,v),Ls.lineEnd(),wa(y)>Fa&&(c=-(h=180)),x[0]=c,x[1]=h,m=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,f,h,d,p,g,v,m,y,b,x,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=i,_.lineStart=o,_.lineEnd=a,y=0,Ls.polygonStart()},polygonEnd:function(){Ls.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,0>Es?(c=-(h=180),f=-(d=90)):y>Fa?d=90:-Fa>y&&(f=-90),x[0]=c,x[1]=h}};return function(t){d=h=-(c=f=1/0),b=[],ca.geo.stream(t,_);var e=b.length;if(e){b.sort(l);for(var r,n=1,i=b[0],o=[i];e>n;++n)r=b[n],u(r[0],i)||u(r[1],i)?(s(i[0],r[1])>s(i[0],i[1])&&(i[1]=r[1]),s(r[0],i[1])>s(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(var a,r,p=-(1/0),e=o.length-1,n=0,i=o[e];e>=n;i=r,++n)r=o[n],(a=s(i[1],r[0]))>p&&(p=a,c=r[0],h=i[1])}return b=x=null,c===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,f],[h,d]]}}(),ca.geo.centroid=function(t){Ss=Cs=Ps=Rs=Ns=zs=Is=Os=js=Ds=Fs=0,ca.geo.stream(t,Bs);var e=js,r=Ds,n=Fs,i=e*e+r*r+n*n;return Ba>i&&(e=zs,r=Is,n=Os,Fa>Cs&&(e=Ps,r=Rs,n=Ns),i=e*e+r*r+n*n,Ba>i)?[NaN,NaN]:[Math.atan2(r,e)*Xa,nt(n/Math.sqrt(i))*Xa]};var Ss,Cs,Ps,Rs,Ns,zs,Is,Os,js,Ds,Fs,Bs={sphere:A,point:ke,lineStart:Ee,lineEnd:Le,polygonStart:function(){Bs.lineStart=Se},polygonEnd:function(){Bs.lineStart=Ee}},Us=Ie(Pe,Fe,Ue,[-Ua,-Ua/2]),Vs=1e9;ca.geo.clipExtent=function(){var t,e,r,n,i,o,a={stream:function(t){return i&&(i.valid=!1),i=o(t),i.valid=!0,i},extent:function(s){return arguments.length?(o=Ge(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),a):[[t,e],[r,n]]}};return a.extent([[0,0],[960,500]])},(ca.geo.conicEqualArea=function(){return Xe(Ye)}).raw=Ye,ca.geo.albers=function(){return ca.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ca.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];return e=null,r(o,a),e||(n(o,a),e)||i(o,a),e}var e,r,n,i,o=ca.geo.albers(),a=ca.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=ca.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=o.scale(),r=o.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&.234>i&&n>=-.425&&-.214>n?a:i>=.166&&.234>i&&n>=-.214&&-.115>n?s:o).invert(t)},t.stream=function(t){var e=o.stream(t),r=a.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(o.precision(e),a.precision(e),s.precision(e),t):o.precision()},t.scale=function(e){return arguments.length?(o.scale(e),a.scale(.35*e),s.scale(e),t.translate(o.translate())):o.scale()},t.translate=function(e){if(!arguments.length)return o.translate();var u=o.scale(),c=+e[0],f=+e[1];return r=o.translate(e).clipExtent([[c-.455*u,f-.238*u],[c+.455*u,f+.238*u]]).stream(l).point,n=a.translate([c-.307*u,f+.201*u]).clipExtent([[c-.425*u+Fa,f+.12*u+Fa],[c-.214*u-Fa,f+.234*u-Fa]]).stream(l).point,i=s.translate([c-.205*u,f+.212*u]).clipExtent([[c-.214*u+Fa,f+.166*u+Fa],[c-.115*u-Fa,f+.234*u-Fa]]).stream(l).point,t},t.scale(1070)};var qs,Hs,Gs,Xs,Ys,Ws,Zs={point:A,lineStart:A,lineEnd:A,polygonStart:function(){Hs=0,Zs.lineStart=We},polygonEnd:function(){Zs.lineStart=Zs.lineEnd=Zs.point=A,qs+=wa(Hs/2)}},Qs={point:Ze,lineStart:A,lineEnd:A,polygonStart:A,polygonEnd:A},$s={point:Ke,lineStart:Je,lineEnd:tr,polygonStart:function(){$s.lineStart=er},polygonEnd:function(){$s.point=Ke,$s.lineStart=Je,$s.lineEnd=tr}};ca.geo.path=function(){function t(t){return t&&("function"==typeof s&&o.pointRadius(+s.apply(this,arguments)),a&&a.valid||(a=i(o)),ca.geo.stream(t,a)),o.result()}function e(){return a=null,t}var r,n,i,o,a,s=4.5;return t.area=function(t){return qs=0,ca.geo.stream(t,i(Zs)),qs},t.centroid=function(t){return Ps=Rs=Ns=zs=Is=Os=js=Ds=Fs=0,ca.geo.stream(t,i($s)),Fs?[js/Fs,Ds/Fs]:Os?[zs/Os,Is/Os]:Ns?[Ps/Ns,Rs/Ns]:[NaN,NaN]},t.bounds=function(t){return Ys=Ws=-(Gs=Xs=1/0),ca.geo.stream(t,i(Qs)),[[Gs,Xs],[Ys,Ws]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||ir(t):x,e()):r},t.context=function(t){return arguments.length?(o=null==(n=t)?new Qe:new rr(t),"function"!=typeof s&&o.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(o.pointRadius(+e),+e),t):s},t.projection(ca.geo.albersUsa()).context(null)},ca.geo.transform=function(t){return{stream:function(e){var r=new or(e);for(var n in t)r[n]=t[n];return r}}},or.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ca.geo.projection=sr,ca.geo.projectionMutator=lr,(ca.geo.equirectangular=function(){return sr(cr)}).raw=cr.invert=cr,ca.geo.rotation=function(t){function e(e){return e=t(e[0]*Ga,e[1]*Ga),e[0]*=Xa,e[1]*=Xa,e}return t=hr(t[0]%360*Ga,t[1]*Ga,t.length>2?t[2]*Ga:0),e.invert=function(e){return e=t.invert(e[0]*Ga,e[1]*Ga),e[0]*=Xa,e[1]*=Xa,e},e},fr.invert=cr,ca.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=hr(-t[0]*Ga,-t[1]*Ga,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Xa,t[1]*=Xa}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=vr((e=+n)*Ga,i*Ga),t):e},t.precision=function(n){return arguments.length?(r=vr(e*Ga,(i=+n)*Ga),t):i},t.angle(90)},ca.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ga,i=t[1]*Ga,o=e[1]*Ga,a=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((r=f*a)*r+(r=u*c-l*f*s)*r),l*c+u*f*s)},ca.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ca.range(Math.ceil(o/v)*v,i,v).map(h).concat(ca.range(Math.ceil(u/m)*m,l,m).map(d)).concat(ca.range(Math.ceil(n/p)*p,r,p).filter(function(t){return wa(t%v)>Fa}).map(c)).concat(ca.range(Math.ceil(s/g)*g,a,g).filter(function(t){return wa(t%m)>Fa}).map(f))}var r,n,i,o,a,s,l,u,c,f,h,d,p=10,g=p,v=90,m=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(d(l).slice(1),h(i).reverse().slice(1),d(u).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(o=+e[0][0],i=+e[1][0],u=+e[0][1],l=+e[1][1],o>i&&(e=o,o=i,i=e),u>l&&(e=u,u=l,l=e),t.precision(y)):[[o,u],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],a=+e[1][1],n>r&&(e=n,n=r,r=e),s>a&&(e=s,s=a,a=e),t.precision(y)):[[n,s],[r,a]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],m=+e[1],t):[v,m]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(y=+e,c=yr(s,a,90),f=br(n,r,y),h=yr(u,l,90),d=br(o,i,y),t):y},t.majorExtent([[-180,-90+Fa],[180,90-Fa]]).minorExtent([[-180,-80-Fa],[180,80+Fa]])},ca.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 ca.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},ca.geo.interpolate=function(t,e){return wr(t[0]*Ga,t[1]*Ga,e[0]*Ga,e[1]*Ga)},ca.geo.length=function(t){return Ks=0,ca.geo.stream(t,Js),Ks};var Ks,Js={sphere:A,point:A,lineStart:Ar,lineEnd:A,polygonStart:A,polygonEnd:A},tl=Mr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ca.geo.azimuthalEqualArea=function(){return sr(tl)}).raw=tl;var el=Mr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(ca.geo.azimuthalEquidistant=function(){return sr(el)}).raw=el,(ca.geo.conicConformal=function(){return Xe(kr)}).raw=kr,(ca.geo.conicEquidistant=function(){return Xe(Tr)}).raw=Tr;var rl=Mr(function(t){return 1/t},Math.atan);(ca.geo.gnomonic=function(){return sr(rl)}).raw=rl,Er.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ha]},(ca.geo.mercator=function(){return Lr(Er)}).raw=Er;var nl=Mr(function(){return 1},Math.asin);(ca.geo.orthographic=function(){return sr(nl)}).raw=nl;var il=Mr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ca.geo.stereographic=function(){return sr(il)}).raw=il,Sr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ha]},(ca.geo.transverseMercator=function(){var t=Lr(Sr),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=Sr,ca.geom={},ca.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Lt(r),o=Lt(n),a=t.length,s=[],l=[];for(e=0;a>e;e++)s.push([+i.call(this,t[e],e),+o.call(this,t[e],e),e]);for(s.sort(Nr),e=0;a>e;e++)l.push([s[e][0],-s[e][1]]);var u=Rr(s),c=Rr(l),f=c[0]===u[0],h=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=+f;e<c.length-h;++e)d.push(t[s[c[e]][2]]);return d}var r=Cr,n=Pr;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)},ca.geom.polygon=function(t){return Ea(t,ol),t};var ol=ca.geom.polygon.prototype=[];ol.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},ol.centroid=function(t){var e,r,n=-1,i=this.length,o=0,a=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],o+=(e[0]+s[0])*r,a+=(e[1]+s[1])*r;return[o*t,a*t]},ol.clip=function(t){for(var e,r,n,i,o,a,s=Or(t),l=-1,u=this.length-Or(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],o=e[(n=e.length-s)-1],r=-1;++r<n;)a=e[r],zr(a,c,i)?(zr(o,c,i)||t.push(Ir(o,a,c,i)),t.push(a)):zr(o,c,i)&&t.push(Ir(o,a,c,i)),o=a;s&&t.push(t[0]),c=i}return t};var al,sl,ll,ul,cl,fl=[],hl=[];Hr.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(Xr),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&&(an(this,r),t=r,r=t.U),r.C=!1,n.C=!0,sn(this,n))):(i=n.L,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(sn(this,r),t=r,r=t.U),r.C=!1,n.C=!0,an(this,n))),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,o=t.L,a=t.R;if(r=o?a?ln(a):o:a,i?i.L===t?i.L=r:i.R=r:this._=r,o&&a?(n=r.C,r.C=t.C,r.L=o,o.U=r,r!==a?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=a,a.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(e=i.R,e.C&&(e.C=!1,i.C=!0,an(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,sn(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,an(this,i),t=this._;break}}else if(e=i.L,e.C&&(e.C=!1,i.C=!0,sn(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,an(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,sn(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},ca.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=s[0][0],i=s[0][1],o=s[1][0],a=s[1][1];return un(r(t),s).cells.forEach(function(r,s){var l=r.edges,u=r.site,c=e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=n&&u.x<=o&&u.y>=i&&u.y<=a?[[n,a],[o,a],[o,i],[n,i]]:[];c.point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/Fa)*Fa,y:Math.round(a(t,e)/Fa)*Fa,i:e}})}var n=Cr,i=Pr,o=n,a=i,s=dl;return t?e(t):(e.links=function(t){return un(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return un(r(t)).cells.forEach(function(r,n){for(var i,o,a=r.site,s=r.edges.sort(Xr),l=-1,u=s.length,c=s[u-1].edge,f=c.l===a?c.r:c.l;++l<u;)i=c,o=f,c=s[l].edge,f=c.l===a?c.r:c.l,n<o.i&&n<f.i&&fn(a,o,f)<0&&e.push([t[n],t[o.i],t[f.i]])}),e},e.x=function(t){return arguments.length?(o=Lt(n=t),e):n},e.y=function(t){return arguments.length?(a=Lt(i=t),e):i},e.clipExtent=function(t){return arguments.length?(s=null==t?dl:t,e):s===dl?null:s},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===dl?null:s&&s[1]},e)};var dl=[[-1e6,-1e6],[1e6,1e6]];ca.geom.delaunay=function(t){return ca.geom.voronoi().triangles(t)},ca.geom.quadtree=function(t,e,r,n,i){function o(t){function o(t,e,r,n,i,o,a,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(wa(l-r)+wa(c-n)<.01)u(t,e,r,n,i,o,a,s);else{var f=t.point;t.x=t.y=t.point=null,u(t,f,l,c,i,o,a,s),u(t,e,r,n,i,o,a,s)}else t.x=r,t.y=n,t.point=e}else u(t,e,r,n,i,o,a,s)}function u(t,e,r,n,i,a,s,l){var u=.5*(i+s),c=.5*(a+l),f=r>=u,h=n>=c,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=pn()),f?i=u:s=u,h?a=c:l=c,o(t,e,r,n,i,a,s,l)}var c,f,h,d,p,g,v,m,y,b=Lt(s),x=Lt(l);if(null!=e)g=e,v=r,m=n,y=i;else if(m=y=-(g=v=1/0),f=[],h=[],p=t.length,a)for(d=0;p>d;++d)c=t[d],c.x<g&&(g=c.x),c.y<v&&(v=c.y),c.x>m&&(m=c.x),c.y>y&&(y=c.y),f.push(c.x),h.push(c.y);else for(d=0;p>d;++d){var _=+b(c=t[d],d),w=+x(c,d);g>_&&(g=_),v>w&&(v=w),_>m&&(m=_),w>y&&(y=w),f.push(_),h.push(w)}var A=m-g,M=y-v;A>M?y=v+A:m=g+M;var k=pn();if(k.add=function(t){o(k,t,+b(t,++d),+x(t,d),g,v,m,y)},k.visit=function(t){gn(t,k,g,v,m,y)},k.find=function(t){return vn(k,t[0],t[1],g,v,m,y)},d=-1,null==e){for(;++d<p;)o(k,t[d],f[d],h[d],g,v,m,y);--d}else t.forEach(k.add);return f=h=t=c=null,k}var a,s=Cr,l=Pr;return(a=arguments.length)?(s=hn,l=dn,3===a&&(i=r,n=e,r=e=0),o(t)):(o.x=function(t){return arguments.length?(s=t,o):s},o.y=function(t){return arguments.length?(l=t,o):l},o.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),o):null==e?null:[[e,r],[n,i]]},o.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),o):null==e?null:[n-e,i-r]},o)},ca.interpolateRgb=mn,ca.interpolateObject=yn,ca.interpolateNumber=bn,ca.interpolateString=xn;var pl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gl=new RegExp(pl.source,"g");ca.interpolate=_n,ca.interpolators=[function(t,e){var r=typeof e;return("string"===r?ss.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?mn:xn:e instanceof lt?mn:Array.isArray(e)?wn:"object"===r&&isNaN(e)?yn:bn)(t,e)}],ca.interpolateArray=wn;var vl=function(){return x},ml=ca.map({linear:vl,poly:Sn,quad:function(){return Tn},cubic:function(){return En},sin:function(){return Cn},exp:function(){return Pn},circle:function(){return Rn},elastic:Nn,back:zn,bounce:function(){return In}}),yl=ca.map({"in":x,out:Mn,"in-out":kn,"out-in":function(t){return kn(Mn(t))}});ca.ease=function(t){var e=t.indexOf("-"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=ml.get(r)||vl,n=yl.get(n)||x,An(n(r.apply(null,fa.call(arguments,1))))},ca.interpolateHcl=On,ca.interpolateHsl=jn,ca.interpolateLab=Dn,ca.interpolateRound=Fn,ca.transform=function(t){var e=da.createElementNS(ca.ns.prefix.svg,"g");return(ca.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:bl)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var bl={a:1,b:0,c:0,d:1,e:0,f:0};ca.interpolateTransform=Zn,ca.layout={},ca.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Kn(t[r]));return e}},ca.layout.chord=function(){function t(){var t,u,f,h,d,p={},g=[],v=ca.range(o),m=[];for(r=[],n=[],t=0,h=-1;++h<o;){for(u=0,d=-1;++d<o;)u+=i[h][d];g.push(u),m.push(ca.range(o)),t+=u}for(a&&v.sort(function(t,e){return a(g[t],g[e])}),s&&m.forEach(function(t,e){t.sort(function(t,r){return s(i[e][t],i[e][r])})}),t=(Va-c*o)/t,u=0,h=-1;++h<o;){for(f=u,d=-1;++d<o;){var y=v[h],b=m[y][d],x=i[y][b],_=u,w=u+=x*t;p[y+"-"+b]={index:y,subindex:b,startAngle:_,endAngle:w,value:x}}n[y]={index:y,startAngle:f,endAngle:u,value:g[y]},u+=c}for(h=-1;++h<o;)for(d=h-1;++d<o;){var A=p[h+"-"+d],M=p[d+"-"+h];(A.value||M.value)&&r.push(A.value<M.value?{source:M,target:A}:{source:A,target:M})}l&&e()}function e(){r.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,i,o,a,s,l,u={},c=0;return u.matrix=function(t){return arguments.length?(o=(i=t)&&i.length,r=n=null,u):i},u.padding=function(t){return arguments.length?(c=t,r=n=null,u):c},u.sortGroups=function(t){return arguments.length?(a=t,r=n=null,u):a},u.sortSubgroups=function(t){return arguments.length?(s=t,r=null,u):s},u.sortChords=function(t){return arguments.length?(l=t,r&&e(),u):l},u.chords=function(){return r||t(),r},u.groups=function(){return n||t(),n},u},ca.layout.force=function(){function t(t){return function(e,r,n,i){if(e.point!==t){var o=e.cx-t.x,a=e.cy-t.y,s=i-r,l=o*o+a*a;if(l>s*s/m){if(g>l){var u=e.charge/l;t.px-=o*u,t.py-=a*u}return!0}if(e.point&&l&&g>l){var u=e.pointCharge/l;t.px-=o*u,t.py-=a*u}}return!e.charge}}function e(t){t.px=ca.event.x,t.py=ca.event.y,l.resume()}var r,n,i,o,a,s,l={},u=ca.dispatch("start","tick","end"),c=[1,1],f=.9,h=xl,d=_l,p=-30,g=wl,v=.1,m=.64,y=[],b=[];return l.tick=function(){if((i*=.99)<.005)return r=null,u.end({type:"end",alpha:i=0}),!0;var e,n,l,h,d,g,m,x,_,w=y.length,A=b.length;for(n=0;A>n;++n)l=b[n],h=l.source,d=l.target,x=d.x-h.x,_=d.y-h.y,(g=x*x+_*_)&&(g=i*a[n]*((g=Math.sqrt(g))-o[n])/g,x*=g,_*=g,d.x-=x*(m=h.weight+d.weight?h.weight/(h.weight+d.weight):.5),d.y-=_*m,h.x+=x*(m=1-m),h.y+=_*m);if((m=i*v)&&(x=c[0]/2,_=c[1]/2,n=-1,m))for(;++n<w;)l=y[n],l.x+=(x-l.x)*m,l.y+=(_-l.y)*m;if(p)for(oi(e=ca.geom.quadtree(y),i,s),n=-1;++n<w;)(l=y[n]).fixed||e.visit(t(l));for(n=-1;++n<w;)l=y[n],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*f,l.y-=(l.py-(l.py=l.y))*f);u.tick({type:"tick",alpha:i})},l.nodes=function(t){return arguments.length?(y=t,l):y},l.links=function(t){return arguments.length?(b=t,l):b},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,l):h},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,l):d},l.friction=function(t){return arguments.length?(f=+t,l):f},l.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(g=t*t,l):Math.sqrt(g)},l.gravity=function(t){return arguments.length?(v=+t,l):v},l.theta=function(t){return arguments.length?(m=t*t,l):Math.sqrt(m)},l.alpha=function(t){return arguments.length?(t=+t,i?t>0?i=t:(r.c=null,r.t=NaN,r=null,u.end({type:"end",alpha:i=0})):t>0&&(u.start({type:"start",alpha:i=t}),r=Nt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;i>l;++l)r[l]=[];for(l=0;u>l;++l){var o=b[l];r[o.source.index].push(o.target),r[o.target.index].push(o.source)}}for(var a,s=r[e],l=-1,c=s.length;++l<c;)if(!isNaN(a=s[l][t]))return a;return Math.random()*n}var e,r,n,i=y.length,u=b.length,f=c[0],g=c[1];for(e=0;i>e;++e)(n=y[e]).index=e,n.weight=0;for(e=0;u>e;++e)n=b[e],"number"==typeof n.source&&(n.source=y[n.source]),"number"==typeof n.target&&(n.target=y[n.target]),++n.source.weight,++n.target.weight;for(e=0;i>e;++e)n=y[e],isNaN(n.x)&&(n.x=t("x",f)),isNaN(n.y)&&(n.y=t("y",g)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(o=[],"function"==typeof h)for(e=0;u>e;++e)o[e]=+h.call(this,b[e],e);else for(e=0;u>e;++e)o[e]=h;if(a=[],"function"==typeof d)for(e=0;u>e;++e)a[e]=+d.call(this,b[e],e);else for(e=0;u>e;++e)a[e]=d;if(s=[],"function"==typeof p)for(e=0;i>e;++e)s[e]=+p.call(this,y[e],e);else for(e=0;i>e;++e)s[e]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return n||(n=ca.behavior.drag().origin(x).on("dragstart.force",ei).on("drag.force",e).on("dragend.force",ri)),arguments.length?void this.on("mouseover.force",ni).on("mouseout.force",ii).call(n):n},ca.rebind(l,u,"on")};var xl=20,_l=1,wl=1/0;ca.layout.hierarchy=function(){function t(i){var o,a=[i],s=[];for(i.depth=0;null!=(o=a.pop());)if(s.push(o),(u=r.call(t,o,o.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)a.push(c=u[l]),c.parent=o,c.depth=o.depth+1;n&&(o.value=0),o.children=u}else n&&(o.value=+n.call(t,o,o.depth)||0),delete o.children;return li(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=fi,r=ui,n=ci;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(si(e,function(t){t.children&&(t.value=0)}),li(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},ca.layout.partition=function(){function t(e,r,n,i){var o=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,o&&(a=o.length)){var a,s,l,u=-1;for(n=e.value?n/e.value:0;++u<a;)t(s=o[u],r,l=s.value*n,i),r+=l}}function e(t){var r=t.children,n=0;if(r&&(i=r.length))for(var i,o=-1;++o<i;)n=Math.max(n,e(r[o]));return 1+n}function r(r,o){var a=n.call(this,r,o);return t(a[0],0,i[0],i[1]/e(a[0])),a}var n=ca.layout.hierarchy(),i=[1,1];return r.size=function(t){return arguments.length?(i=t,r):i},ai(r,n)},ca.layout.pie=function(){function t(a){var s,l=a.length,u=a.map(function(r,n){return+e.call(t,r,n)}),c=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof i?i.apply(this,arguments):i)-c,h=Math.min(Math.abs(f)/l,+("function"==typeof o?o.apply(this,arguments):o)),d=h*(0>f?-1:1),p=ca.sum(u),g=p?(f-l*d)/p:0,v=ca.range(l),m=[];return null!=r&&v.sort(r===Al?function(t,e){return u[e]-u[t]}:function(t,e){return r(a[t],a[e])}),v.forEach(function(t){m[t]={data:a[t],value:s=u[t],startAngle:c,endAngle:c+=s*g+d,padAngle:h}}),m}var e=Number,r=Al,n=0,i=Va,o=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(o=e,t):o},t};var Al={};ca.layout.stack=function(){function t(s,l){if(!(h=s.length))return s;var u=s.map(function(r,n){return e.call(t,r,n)}),c=u.map(function(e){return e.map(function(e,r){return[o.call(t,e,r),a.call(t,e,r)]})}),f=r.call(t,c,l);u=ca.permute(u,f),c=ca.permute(c,f);var h,d,p,g,v=n.call(t,c,l),m=u[0].length;for(p=0;m>p;++p)for(i.call(t,u[0][p],g=v[p],c[0][p][1]),d=1;h>d;++d)i.call(t,u[d][p],g+=c[d-1][p][1],c[d][p][1]);return s}var e=x,r=vi,n=mi,i=gi,o=di,a=pi;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r="function"==typeof e?e:Ml.get(e)||vi,t):r},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:kl.get(e)||mi,t):n},t.x=function(e){return arguments.length?(o=e,t):o},t.y=function(e){return arguments.length?(a=e,t):a},t.out=function(e){return arguments.length?(i=e,t):i},t};var Ml=ca.map({"inside-out":function(t){var e,r,n=t.length,i=t.map(yi),o=t.map(bi),a=ca.range(n).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;n>e;++e)r=a[e],l>s?(s+=o[r],u.push(r)):(l+=o[r],c.push(r));return c.reverse().concat(u)},reverse:function(t){return ca.range(t.length).reverse()},"default":vi}),kl=ca.map({silhouette:function(t){var e,r,n,i=t.length,o=t[0].length,a=[],s=0,l=[];for(r=0;o>r;++r){for(e=0,n=0;i>e;e++)n+=t[e][r][1];n>s&&(s=n),a.push(n)}for(r=0;o>r;++r)l[r]=(s-a[r])/2;return l},wiggle:function(t){var e,r,n,i,o,a,s,l,u,c=t.length,f=t[0],h=f.length,d=[];for(d[0]=l=u=0,r=1;h>r;++r){for(e=0,i=0;c>e;++e)i+=t[e][r][1];for(e=0,o=0,s=f[r][0]-f[r-1][0];c>e;++e){for(n=0,a=(t[e][r][1]-t[e][r-1][1])/(2*s);e>n;++n)a+=(t[n][r][1]-t[n][r-1][1])/s;o+=a*t[e][r][1]}d[r]=l-=i?o/i*s:0,u>l&&(u=l)}for(r=0;h>r;++r)d[r]-=u;return d},expand:function(t){var e,r,n,i=t.length,o=t[0].length,a=1/i,s=[];for(r=0;o>r;++r){for(e=0,n=0;i>e;e++)n+=t[e][r][1];if(n)for(e=0;i>e;e++)t[e][r][1]/=n;else for(e=0;i>e;e++)t[e][r][1]=a}for(r=0;o>r;++r)s[r]=0;return s},zero:mi});ca.layout.histogram=function(){function t(t,o){for(var a,s,l=[],u=t.map(r,this),c=n.call(this,u,o),f=i.call(this,c,u,o),o=-1,h=u.length,d=f.length-1,p=e?1:1/h;++o<d;)a=l[o]=[],a.dx=f[o+1]-(a.x=f[o]),a.y=0;if(d>0)for(o=-1;++o<h;)s=u[o],s>=c[0]&&s<=c[1]&&(a=l[ca.bisect(f,s,1,d)-1],a.y+=p,a.push(t[o]));return l}var e=!0,r=Number,n=Ai,i=_i;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=Lt(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return wi(t,e)}:Lt(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},ca.layout.pack=function(){function t(t,o){var a=r.call(this,t,o),s=a[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,li(s,function(t){t.r=+c(t.value)}),li(s,Li),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;li(s,function(t){t.r+=f}),li(s,Li),li(s,function(t){t.r-=f})}return Pi(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),a}var e,r=ca.layout.hierarchy().sort(Mi),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},ai(t,r)},ca.layout.tree=function(){function t(t,i){var c=a.call(this,t,i),f=c[0],h=e(f);if(li(h,r),h.parent.m=-h.z,si(h,n),u)si(f,o);else{var d=f,p=f,g=f;si(f,function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>g.depth&&(g=t)});var v=s(d,p)/2-d.x,m=l[0]/(p.x+s(p,d)/2+v),y=l[1]/(g.depth||1);si(f,function(t){t.x=(t.x+v)*m,t.y=t.depth*y})}return c}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,o=e.children,a=0,s=o.length;s>a;++a)n.push((o[a]=i={_:o[a],parent:e,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){ji(t);var o=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+s(t._,n._),t.m=t.z-o):t.z=o}else n&&(t.z=n.z+s(t._,n._));t.parent.A=i(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,r){if(e){for(var n,i=t,o=t,a=e,l=i.parent.children[0],u=i.m,c=o.m,f=a.m,h=l.m;a=Ii(a),i=zi(i),a&&i;)l=zi(l),o=Ii(o),o.a=t,n=a.z+f-i.z-u+s(a._,i._),n>0&&(Oi(Di(a,t,r),t,n),u+=n,c+=n),f+=a.m,u+=i.m,h+=l.m,c+=o.m;a&&!Ii(o)&&(o.t=a,o.m+=f-c),i&&!zi(l)&&(l.t=i,l.m+=u-h,r=t)}return r}function o(t){t.x*=l[0],t.y=t.depth*l[1]}var a=ca.layout.hierarchy().sort(null).value(null),s=Ni,l=[1,1],u=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(u=null==(l=e)?o:null,t):u?null:l},t.nodeSize=function(e){return arguments.length?(u=null==(l=e)?null:o,t):u?l:null},ai(t,a)},ca.layout.cluster=function(){function t(t,o){var a,s=e.call(this,t,o),l=s[0],u=0;li(l,function(t){var e=t.children;e&&e.length?(t.x=Bi(e),t.y=Fi(e)):(t.x=a?u+=r(t,a):0,t.y=0,a=t)});var c=Ui(l),f=Vi(l),h=c.x-r(c,f)/2,d=f.x+r(f,c)/2;return li(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(d-h)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=ca.layout.hierarchy().sort(null).value(null),r=Ni,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},ai(t,e)},ca.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,o=t.length;++i<o;)n=(r=t[i]).value*(0>e?0:e),r.area=isNaN(n)||0>=n?0:n}function e(r){var o=r.children;if(o&&o.length){var a,s,l,u=f(r),c=[],h=o.slice(),p=1/0,g="slice"===d?u.dx:"dice"===d?u.dy:"slice-dice"===d?1&r.depth?u.dy:u.dx:Math.min(u.dx,u.dy);for(t(h,u.dx*u.dy/r.value),c.area=0;(l=h.length)>0;)c.push(a=h[l-1]),c.area+=a.area,"squarify"!==d||(s=n(c,g))<=p?(h.pop(),p=s):(c.area-=c.pop().area,i(c,g,u,!1),g=Math.min(u.dx,u.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,g,u,!0),c.length=c.area=0),o.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var o,a=f(e),s=n.slice(),l=[];for(t(s,a.dx*a.dy/e.value),l.area=0;o=s.pop();)l.push(o),l.area+=o.area,null!=o.z&&(i(l,o.z?a.dx:a.dy,a,!s.length),l.length=l.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,i=0,o=1/0,a=-1,s=t.length;++a<s;)(r=t[a].area)&&(o>r&&(o=r),r>i&&(i=r));return n*=n,e*=e,n?Math.max(e*i*p/n,n/(e*o*p)):1/0}function i(t,e,r,n){var i,o=-1,a=t.length,s=r.x,u=r.y,c=e?l(t.area/e):0;if(e==r.dx){for((n||c>r.dy)&&(c=r.dy);++o<a;)i=t[o],i.x=s,i.y=u,i.dy=c,s+=i.dx=Math.min(r.x+r.dx-s,c?l(i.area/c):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=c,r.dy-=c}else{for((n||c>r.dx)&&(c=r.dx);++o<a;)i=t[o],i.x=s,i.y=u,i.dx=c,u+=i.dy=Math.min(r.y+r.dy-u,c?l(i.area/c):0);i.z=!1,i.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function o(n){var i=a||s(n),o=i[0];return o.x=o.y=0,o.value?(o.dx=u[0],o.dy=u[1]):o.dx=o.dy=0,a&&s.revalue(o),t([o],o.dx*o.dy/o.value),(a?r:e)(o),h&&(a=i),i}var a,s=ca.layout.hierarchy(),l=Math.round,u=[1,1],c=null,f=qi,h=!1,d="squarify",p=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(u=t,o):u},o.padding=function(t){function e(e){var r=t.call(o,e,e.depth);return null==r?qi(e):Hi(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return Hi(e,t)}if(!arguments.length)return c;var n;return f=null==(c=t)?qi:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,o},o.round=function(t){return arguments.length?(l=t?Math.round:Number,o):l!=Number},o.sticky=function(t){return arguments.length?(h=t,a=null,o):h},o.ratio=function(t){return arguments.length?(p=t,o):p},o.mode=function(t){return arguments.length?(d=t+"",o):d},ai(o,s)},ca.random={normal:function(t,e){var r=arguments.length;return 2>r&&(e=1),1>r&&(t=0),function(){var r,n,i;do r=2*Math.random()-1,n=2*Math.random()-1,i=r*r+n*n;while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=ca.random.normal.apply(ca,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ca.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;t>r;r++)e+=Math.random();return e}}},ca.scale={};var Tl={floor:x,ceil:x};ca.scale.linear=function(){return $i([0,1],[0,1],_n,!1)};var El={s:1,g:1,p:1,r:1,e:1};ca.scale.log=function(){return oo(ca.scale.linear().domain([0,1]),10,!0,[1,10])};var Ll=ca.format(".0e"),Sl={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};ca.scale.pow=function(){return ao(ca.scale.linear(),1,[0,1])},ca.scale.sqrt=function(){return ca.scale.pow().exponent(.5)},ca.scale.ordinal=function(){return lo([],{t:"range",a:[[]]})},ca.scale.category10=function(){return ca.scale.ordinal().range(Cl)},ca.scale.category20=function(){return ca.scale.ordinal().range(Pl)},ca.scale.category20b=function(){return ca.scale.ordinal().range(Rl)},ca.scale.category20c=function(){return ca.scale.ordinal().range(Nl)};var Cl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Pl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),Rl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Nl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);ca.scale.quantile=function(){return uo([],[])},ca.scale.quantize=function(){return co(0,1,[0,1])},ca.scale.threshold=function(){return fo([.5],[0,1])},ca.scale.identity=function(){return ho([0,1])},ca.svg={},ca.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),u=Math.max(0,+n.apply(this,arguments)),c=a.apply(this,arguments)-Ha,f=s.apply(this,arguments)-Ha,h=Math.abs(f-c),d=c>f?0:1;if(t>u&&(p=u,u=t,t=p),h>=qa)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,g,v,m,y,b,x,_,w,A,M,k,T=0,E=0,L=[];if((m=(+l.apply(this,arguments)||0)/2)&&(v=o===zl?Math.sqrt(t*t+u*u):+o.apply(this,arguments),d||(E*=-1),u&&(E=nt(v/u*Math.sin(m))),t&&(T=nt(v/t*Math.sin(m)))),u){y=u*Math.cos(c+E),b=u*Math.sin(c+E),x=u*Math.cos(f-E),_=u*Math.sin(f-E);var S=Math.abs(f-c-2*E)<=Ua?0:1;if(E&&xo(y,b,x,_)===d^S){var C=(c+f)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(t){w=t*Math.cos(f-T),A=t*Math.sin(f-T),M=t*Math.cos(c+T),k=t*Math.sin(c+T);var P=Math.abs(c-f+2*T)<=Ua?0:1;if(T&&xo(w,A,M,k)===1-d^P){var R=(c+f)/2;w=t*Math.cos(R),A=t*Math.sin(R),M=k=null}}else w=A=0;if(h>Fa&&(p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){g=u>t^d?0:1;var N=p,z=p;if(Ua>h){var I=null==M?[w,A]:null==x?[y,b]:Ir([y,b],[M,k],[x,_],[w,A]),O=y-I[0],j=b-I[1],D=x-I[0],F=_-I[1],B=1/Math.sin(Math.acos((O*D+j*F)/(Math.sqrt(O*O+j*j)*Math.sqrt(D*D+F*F)))/2),U=Math.sqrt(I[0]*I[0]+I[1]*I[1]);z=Math.min(p,(t-U)/(B-1)),N=Math.min(p,(u-U)/(B+1))}if(null!=x){var V=_o(null==M?[w,A]:[M,k],[y,b],u,N,d),q=_o([x,_],[w,A],u,N,d);p===N?L.push("M",V[0],"A",N,",",N," 0 0,",g," ",V[1],"A",u,",",u," 0 ",1-d^xo(V[1][0],V[1][1],q[1][0],q[1][1]),",",d," ",q[1],"A",N,",",N," 0 0,",g," ",q[0]):L.push("M",V[0],"A",N,",",N," 0 1,",g," ",q[0])}else L.push("M",y,",",b);if(null!=M){var H=_o([y,b],[M,k],t,-z,d),G=_o([w,A],null==x?[y,b]:[x,_],t,-z,d);p===z?L.push("L",G[0],"A",z,",",z," 0 0,",g," ",G[1],"A",t,",",t," 0 ",d^xo(G[1][0],G[1][1],H[1][0],H[1][1]),",",1-d," ",H[1],"A",z,",",z," 0 0,",g," ",H[0]):L.push("L",G[0],"A",z,",",z," 0 0,",g," ",H[0])}else L.push("L",w,",",A)}else L.push("M",y,",",b),null!=x&&L.push("A",u,",",u," 0 ",S,",",d," ",x,",",_),L.push("L",w,",",A),null!=M&&L.push("A",t,",",t," 0 ",P,",",1-d," ",M,",",k);return L.push("Z"),L.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var r=go,n=vo,i=po,o=zl,a=mo,s=yo,l=bo;return t.innerRadius=function(e){return arguments.length?(r=Lt(e),t):r},t.outerRadius=function(e){return arguments.length?(n=Lt(e),t):n},t.cornerRadius=function(e){return arguments.length?(i=Lt(e),t):i},t.padRadius=function(e){return arguments.length?(o=e==zl?zl:Lt(e),t):o},t.startAngle=function(e){return arguments.length?(a=Lt(e),t):a},t.endAngle=function(e){return arguments.length?(s=Lt(e),t):s},t.padAngle=function(e){return arguments.length?(l=Lt(e),t):l},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-Ha;return[Math.cos(e)*t,Math.sin(e)*t]},t};var zl="auto";ca.svg.line=function(){return wo(x)};var Il=ca.map({linear:Ao,"linear-closed":Mo,step:ko,"step-before":To,"step-after":Eo,basis:No,"basis-open":zo,"basis-closed":Io,bundle:Oo,cardinal:Co,"cardinal-open":Lo,"cardinal-closed":So,monotone:Vo});Il.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ol=[0,2/3,1/3,0],jl=[0,1/3,2/3,0],Dl=[0,1/6,2/3,1/6];ca.svg.line.radial=function(){var t=wo(qo);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},To.reverse=Eo,Eo.reverse=To,ca.svg.area=function(){return Ho(x)},ca.svg.area.radial=function(){var t=Ho(qo);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},ca.svg.chord=function(){function t(t,s){var l=e(this,o,t,s),u=e(this,a,t,s);return"M"+l.p0+n(l.r,l.p1,l.a1-l.a0)+(r(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+n(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+"Z"}function e(t,e,r,n){var i=e.call(t,r,n),o=s.call(t,i,n),a=l.call(t,i,n)-Ha,c=u.call(t,i,n)-Ha;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return"A"+t+","+t+" 0 "+ +(r>Ua)+",1 "+e}function i(t,e,r,n){return"Q 0,0 "+n}var o=xr,a=_r,s=Go,l=mo,u=yo;return t.radius=function(e){return arguments.length?(s=Lt(e),t):s},t.source=function(e){return arguments.length?(o=Lt(e),t):o},t.target=function(e){return arguments.length?(a=Lt(e),t):a},t.startAngle=function(e){return arguments.length?(l=Lt(e),t):l},t.endAngle=function(e){return arguments.length?(u=Lt(e),t):u},t},ca.svg.diagonal=function(){function t(t,i){var o=e.call(this,t,i),a=r.call(this,t,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];return l=l.map(n),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=xr,r=_r,n=Xo;return t.source=function(r){return arguments.length?(e=Lt(r),t):e},t.target=function(e){return arguments.length?(r=Lt(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},ca.svg.diagonal.radial=function(){var t=ca.svg.diagonal(),e=Xo,r=t.projection;return t.projection=function(t){return arguments.length?r(Yo(e=t)):e},t},ca.svg.symbol=function(){function t(t,n){return(Fl.get(e.call(this,t,n))||Qo)(r.call(this,t,n))}var e=Zo,r=Wo;return t.type=function(r){return arguments.length?(e=Lt(r),t):e},t.size=function(e){return arguments.length?(r=Lt(e),t):r},t};var Fl=ca.map({circle:Qo,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Ul)),r=e*Ul;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Bl),r=e*Bl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Bl),r=e*Bl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});ca.svg.symbolTypes=Fl.keys();var Bl=Math.sqrt(3),Ul=Math.tan(30*Ga);Pa.transition=function(t){for(var e,r,n=Vl||++Xl,i=ea(t),o=[],a=ql||{time:Date.now(),ease:Ln,delay:0,duration:250},s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;)(r=u[c])&&ra(r,c,i,n,a),e.push(r)}return Ko(o,i,n)},Pa.interrupt=function(t){return this.each(null==t?Hl:$o(ea(t)))};var Vl,ql,Hl=$o(ea()),Gl=[],Xl=0;Gl.call=Pa.call,Gl.empty=Pa.empty,Gl.node=Pa.node,Gl.size=Pa.size,ca.transition=function(t,e){return t&&t.transition?Vl?t.transition(e):t:ca.selection().transition(t)},ca.transition.prototype=Gl,Gl.select=function(t){var e,r,n,i=this.id,o=this.namespace,a=[];t=C(t);for(var s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?("__data__"in n&&(r.__data__=n.__data__),ra(r,c,o,i,n[o][i]),e.push(r)):e.push(null)}return Ko(a,o,i)},Gl.selectAll=function(t){var e,r,n,i,o,a=this.id,s=this.namespace,l=[];t=P(t);for(var u=-1,c=this.length;++u<c;)for(var f=this[u],h=-1,d=f.length;++h<d;)if(n=f[h]){o=n[s][a],r=t.call(n,n.__data__,h,u),l.push(e=[]);for(var p=-1,g=r.length;++p<g;)(i=r[p])&&ra(i,p,s,a,o),e.push(i)}return Ko(l,s,a)},Gl.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=q(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);for(var r=this[o],s=0,l=r.length;l>s;s++)(n=r[s])&&t.call(n,n.__data__,s,o)&&e.push(n)}return Ko(i,this.namespace,this.id)},Gl.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)})},Gl.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=a(r,t),function(t){this.setAttribute(s,e(t))})})}function o(t){return null==t?n:(t+="",function(){var e,r=this.getAttributeNS(s.space,s.local);return r!==t&&(e=a(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 a="transform"==t?Zn:_n,s=ca.ns.qualify(t);return Jo(this,"attr."+t,e,s.local?o:i)},Gl.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=ca.ns.qualify(t);return this.tween("attr."+t,i.local?n:r)},Gl.style=function(t,e,r){function i(){this.style.removeProperty(t)}function o(e){return null==e?i:(e+="",function(){var i,o=n(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=_n(o,e),function(e){this.style.setProperty(t,i(e),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Jo(this,"style."+t,e,o)},Gl.styleTween=function(t,e,r){function i(i,o){var a=e.call(this,i,o,n(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Gl.text=function(t){return Jo(this,"text",t,ta)},Gl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Gl.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=ca.ease.apply(ca,arguments)),G(this,function(n){n[r][e].ease=t}))},Gl.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,o){n[r][e].delay=+t.call(n,n.__data__,i,o)}:(t=+t,function(n){n[r][e].delay=t}))},Gl.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,o){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,o))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},Gl.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var i=ql,o=Vl;try{Vl=r,G(this,function(e,i,o){ql=e[n][r],t.call(e,e.__data__,i,o)})}finally{ql=i,Vl=o}}else G(this,function(i){var o=i[n][r];(o.event||(o.event=ca.dispatch("start","end","interrupt"))).on(t,e)});return this},Gl.transition=function(){for(var t,e,r,n,i=this.id,o=++Xl,a=this.namespace,s=[],l=0,u=this.length;u>l;l++){s.push(t=[]);for(var e=this[l],c=0,f=e.length;f>c;c++)(r=e[c])&&(n=r[a][i],ra(r,c,a,o,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return Ko(s,a,o)},ca.svg.axis=function(){function t(t){t.each(function(){var t,u=ca.select(this),c=this.__chart__||r,f=this.__chart__=r.copy(),h=null==l?f.ticks?f.ticks.apply(f,s):f.domain():l,d=null==e?f.tickFormat?f.tickFormat.apply(f,s):x:e,p=u.selectAll(".tick").data(h,f),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Fa),v=ca.transition(p.exit()).style("opacity",Fa).remove(),m=ca.transition(p.order()).style("opacity",1),y=Math.max(i,0)+a,b=Xi(f),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),ca.transition(_));g.append("line"),g.append("text");var A,M,k,T,E=g.select("line"),L=m.select("line"),S=p.select("text").text(d),C=g.select("text"),P=m.select("text"),R="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=na,A="x",k="y",M="x2",T="y2",S.attr("dy",0>R?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+R*o+"V0H"+b[1]+"V"+R*o)):(t=ia,A="y",k="x",M="y2",T="x2",S.attr("dy",".32em").style("text-anchor",0>R?"end":"start"),w.attr("d","M"+R*o+","+b[0]+"H0V"+b[1]+"H"+R*o)),E.attr(T,R*i),C.attr(k,R*y),L.attr(M,0).attr(T,R*i),P.attr(A,0).attr(k,R*y),f.rangeBand){var N=f,z=N.rangeBand()/2;c=f=function(t){return N(t)+z}}else c.rangeBand?c=f:v.call(t,f,c);g.call(t,c,f),m.call(t,f,f)})}var e,r=ca.scale.linear(),n=Yl,i=6,o=6,a=3,s=[10],l=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Wl?e+"":Yl,t):n},t.ticks=function(){return arguments.length?(s=ha(arguments),t):s},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(i=+e,o=+arguments[r-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(o=+e,t):o},t.tickPadding=function(e){return arguments.length?(a=+e,t):a},t.tickSubdivide=function(){return arguments.length&&t},t};var Yl="bottom",Wl={top:1,right:1,bottom:1,left:1};ca.svg.brush=function(){function t(n){n.each(function(){var n=ca.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=n.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=n.selectAll(".resize").data(g,x);s.exit().remove(),s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Zl[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",t.empty()?"none":null);var l,f=ca.transition(n),h=ca.transition(a);u&&(l=Xi(u),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(f)),c&&(l=Xi(c),h.attr("y",l[0]).attr("height",l[1]-l[0]),i(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function o(){function o(){32==ca.event.keyCode&&(S||(b=null,P[0]-=f[1],P[1]-=h[1],S=2),T())}function g(){32==ca.event.keyCode&&2==S&&(P[0]+=f[1],P[1]+=h[1],S=0,T())}function v(){var t=ca.mouse(_),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),S||(ca.event.altKey?(b||(b=[(f[0]+f[1])/2,(h[0]+h[1])/2]),P[0]=f[+(t[0]<b[0])],P[1]=h[+(t[1]<b[1])]):b=null),E&&m(t,u,0)&&(r(M),n=!0),L&&m(t,c,1)&&(i(M),n=!0),n&&(e(M),A({type:"brush",mode:S?"move":"resize"}))}function m(t,e,r){var n,i,o=Xi(e),l=o[0],u=o[1],c=P[r],g=r?h:f,v=g[1]-g[0];return S&&(l-=c,u-=v+c),n=(r?p:d)?Math.max(l,Math.min(u,t[r])):t[r],S?i=(n+=c)+v:(b&&(c=Math.max(l,Math.min(u,2*b[r]-n))),n>c?(i=n,n=c):i=c),g[0]!=n||g[1]!=i?(r?s=null:a=null,g[0]=n,g[1]=i,!0):void 0}function y(){v(),M.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),ca.select("body").style("cursor",null),R.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),C(),A({type:"brushend"})}var b,x,_=this,w=ca.select(ca.event.target),A=l.of(_,arguments),M=ca.select(_),k=w.datum(),E=!/^(n|s)$/.test(k)&&u,L=!/^(e|w)$/.test(k)&&c,S=w.classed("extent"),C=$(_),P=ca.mouse(_),R=ca.select(n(_)).on("keydown.brush",o).on("keyup.brush",g);if(ca.event.changedTouches?R.on("touchmove.brush",v).on("touchend.brush",y):R.on("mousemove.brush",v).on("mouseup.brush",y),M.interrupt().selectAll("*").interrupt(),S)P[0]=f[0]-P[0],P[1]=h[0]-P[1];else if(k){var N=+/w$/.test(k),z=+/^n/.test(k);x=[f[1-N]-P[0],h[1-z]-P[1]],P[0]=f[N],P[1]=h[z]}else ca.event.altKey&&(b=P.slice());M.style("pointer-events","none").selectAll(".resize").style("display",null),ca.select("body").style("cursor",w.style("cursor")),A({type:"brushstart"}),v()}var a,s,l=L(t,"brushstart","brush","brushend"),u=null,c=null,f=[0,0],h=[0,0],d=!0,p=!0,g=Ql[0];return t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:f,y:h,i:a,j:s},r=this.__chart__||e;this.__chart__=e,Vl?ca.select(this).transition().each("start.brush",function(){a=r.i,s=r.j,f=r.x,h=r.y,t({type:"brushstart"})}).tween("brush:brush",function(){var r=wn(f,e.x),n=wn(h,e.y);return a=s=null,function(i){f=e.x=r(i),h=e.y=n(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i,s=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(u=e,g=Ql[!u<<1|!c],t):u},t.y=function(e){return arguments.length?(c=e,g=Ql[!u<<1|!c],t):c},t.clamp=function(e){return arguments.length?(u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e),t):u&&c?[d,p]:u?d:c?p:null},t.extent=function(e){var r,n,i,o,l;return arguments.length?(u&&(r=e[0],n=e[1],c&&(r=r[0],n=n[0]),a=[r,n],u.invert&&(r=u(r),n=u(n)),r>n&&(l=r,r=n,n=l),r==f[0]&&n==f[1]||(f=[r,n])),c&&(i=e[0],o=e[1],u&&(i=i[1],o=o[1]),s=[i,o],c.invert&&(i=c(i),o=c(o)),i>o&&(l=i,i=o,o=l),i==h[0]&&o==h[1]||(h=[i,o])),t):(u&&(a?(r=a[0],n=a[1]):(r=f[0],n=f[1],u.invert&&(r=u.invert(r),n=u.invert(n)),r>n&&(l=r,r=n,n=l))),c&&(s?(i=s[0],o=s[1]):(i=h[0],o=h[1],c.invert&&(i=c.invert(i),o=c.invert(o)),i>o&&(l=i,i=o,o=l))),u&&c?[[r,i],[n,o]]:u?[r,n]:c&&[i,o])},t.clear=function(){return t.empty()||(f=[0,0],h=[0,0],a=s=null),t},t.empty=function(){return!!u&&f[0]==f[1]||!!c&&h[0]==h[1]},ca.rebind(t,l,"on")};var Zl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ql=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],$l=vs.format=ws.timeFormat,Kl=$l.utc,Jl=Kl("%Y-%m-%dT%H:%M:%S.%LZ");$l.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?oa:Jl,oa.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},oa.toString=Jl.toString,vs.second=Vt(function(t){return new ms(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),vs.seconds=vs.second.range,vs.seconds.utc=vs.second.utc.range,vs.minute=Vt(function(t){return new ms(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),vs.minutes=vs.minute.range,vs.minutes.utc=vs.minute.utc.range,vs.hour=Vt(function(t){var e=t.getTimezoneOffset()/60;return new ms(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),vs.hours=vs.hour.range,vs.hours.utc=vs.hour.utc.range,vs.month=Vt(function(t){return t=vs.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),vs.months=vs.month.range,vs.months.utc=vs.month.utc.range;var tu=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],eu=[[vs.second,1],[vs.second,5],[vs.second,15],[vs.second,30],[vs.minute,1],[vs.minute,5],[vs.minute,15],[vs.minute,30],[vs.hour,1],[vs.hour,3],[vs.hour,6],[vs.hour,12],[vs.day,1],[vs.day,2],[vs.week,1],[vs.month,1],[vs.month,3],[vs.year,1]],ru=$l.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Pe]]),nu={range:function(t,e,r){return ca.range(Math.ceil(t/r)*r,+e,r).map(sa)},floor:x,ceil:x};eu.year=vs.year,vs.scale=function(){return aa(ca.scale.linear(),eu,ru)};var iu=eu.map(function(t){return[t[0].utc,t[1]]}),ou=Kl.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Pe]]);iu.year=vs.year.utc,vs.scale.utc=function(){return aa(ca.scale.linear(),iu,ou)},ca.text=St(function(t){return t.responseText}),ca.json=function(t,e){return Ct(t,"application/json",la,e)},ca.html=function(t,e){return Ct(t,"text/html",ua,e)},ca.xml=St(function(t){return t.responseXML}),"function"==typeof t&&t.amd?(this.d3=ca,t(ca)):"object"==typeof r&&r.exports?r.exports=ca:this.d3=ca}()},{}],101:[function(t,e,r){"use strict";function n(t,e){this.point=t,this.index=e}function i(t,e){for(var r=t.point,n=e.point,i=r.length,o=0;i>o;++o){var a=n[o]-r[o];if(a)return a}return 0}function o(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map(function(t,e){return[t[0],e]});n.sort(function(t,e){return t[0]-e[0]});for(var i=new Array(t-1),o=1;t>o;++o){var a=n[o-1],s=n[o];i[o-1]=[a[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[t-1][1],-1]),i}function a(t,e){var r=t.length;if(0===r)return[];var a=t[0].length;if(1>a)return[];if(1===a)return o(r,t,e);for(var u=new Array(r),c=1,f=0;r>f;++f){for(var h=t[f],d=new Array(a+1),p=0,g=0;a>g;++g){var v=h[g];d[g]=v,p+=v*v}d[a]=p,u[f]=new n(d,f),c=Math.max(p,c)}l(u,i),r=u.length;for(var m=new Array(r+a+1),y=new Array(r+a+1),b=(a+1)*(a+1)*c,x=new Array(a+1),f=0;a>=f;++f)x[f]=0;x[a]=b,m[0]=x.slice(),y[0]=-1;for(var f=0;a>=f;++f){var d=x.slice();d[f]=1,m[f+1]=d,y[f+1]=-1}for(var f=0;r>f;++f){var _=u[f];m[f+a+1]=_.point,y[f+a+1]=_.index}var w=s(m,!1);if(w=e?w.filter(function(t){for(var e=0,r=0;a>=r;++r){var n=y[t[r]];if(0>n&&++e>=2)return!1;t[r]=n}return!0}):w.filter(function(t){for(var e=0;a>=e;++e){var r=y[t[e]];if(0>r)return!1;t[e]=r}return!0}),1&a)for(var f=0;f<w.length;++f){var _=w[f],d=_[0];_[0]=_[1],_[1]=d}return w}var s=t("incremental-convex-hull"),l=t("uniq");e.exports=a},{"incremental-convex-hull":201,uniq:243}],102:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(0>=i)return[];var o,a=new Array(i);if(r===t.length-1)for(o=0;i>o;++o)a[o]=e;else for(o=0;i>o;++o)a[o]=n(t,e,r+1);return a}function i(t,e){var r,n;for(r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function o(t,e){switch("undefined"==typeof e&&(e=0),typeof t){case"number":if(t>0)return i(0|t,e);break;case"object":if("number"==typeof t.length)return n(t,e,0)}return[]}e.exports=o},{}],103:[function(e,r,n){(function(n,i){(function(){"use strict";function o(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return"function"==typeof t}function s(t){X=t}function l(t){Q=t}function u(){return function(){n.nextTick(p)}}function c(){return function(){G(p)}}function f(){var t=0,e=new J(p),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function h(){var t=new MessageChannel;return t.port1.onmessage=p,function(){t.port2.postMessage(0)}}function d(){return function(){setTimeout(p,1)}}function p(){for(var t=0;Z>t;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}Z=0}function g(){try{var t=e,r=t("vertx");return G=r.runOnLoop||r.runOnContext,c()}catch(n){return d()}}function v(t,e){var r=this,n=r._state;if(n===at&&!t||n===st&&!e)return this;var i=new this.constructor(y),o=r._result;if(n){var a=arguments[n-1];Q(function(){z(n,i,a,o)})}else C(r,i,t,e);return i}function m(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(y);return T(r,t),r}function y(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function x(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(e){return lt.error=e,lt}}function w(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function A(t,e,r){Q(function(t){var n=!1,i=w(r,e,function(r){n||(n=!0,e!==r?T(t,r):L(t,r))},function(e){n||(n=!0,S(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,S(t,i))},t)}function M(t,e){e._state===at?L(t,e._result):e._state===st?S(t,e._result):C(e,void 0,function(e){T(t,e)},function(e){S(t,e)})}function k(t,e,r){e.constructor===t.constructor&&r===nt&&constructor.resolve===it?M(t,e):r===lt?S(t,lt.error):void 0===r?L(t,e):a(r)?A(t,e,r):L(t,e)}function T(t,e){t===e?S(t,b()):o(e)?k(t,e,_(e)):L(t,e)}function E(t){t._onerror&&t._onerror(t._result),P(t)}function L(t,e){t._state===ot&&(t._result=e,t._state=at,0!==t._subscribers.length&&Q(P,t))}function S(t,e){t._state===ot&&(t._state=st,t._result=e,Q(E,t))}function C(t,e,r,n){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+at]=r,i[o+st]=n,0===o&&t._state&&Q(P,t)}function P(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,i,o=t._result,a=0;a<e.length;a+=3)n=e[a],i=e[a+r],n?z(r,n,i,o):i(o);t._subscribers.length=0}}function R(){this.error=null}function N(t,e){try{return t(e)}catch(r){return ut.error=r,ut}}function z(t,e,r,n){var i,o,s,l,u=a(r);if(u){if(i=N(r,n),i===ut?(l=!0,o=i.error,i=null):s=!0,e===i)return void S(e,x())}else i=n,s=!0;e._state!==ot||(u&&s?T(e,i):l?S(e,o):t===at?L(e,i):t===st&&S(e,i))}function I(t,e){try{e(function(e){T(t,e)},function(e){S(t,e)})}catch(r){S(t,r)}}function O(t){return new gt(this,t).promise}function j(t){function e(t){T(i,t)}function r(t){S(i,t)}var n=this,i=new n(y);if(!W(t))return S(i,new TypeError("You must pass an array to race.")),i;for(var o=t.length,a=0;i._state===ot&&o>a;a++)C(n.resolve(t[a]),void 0,e,r);return i}function D(t){var e=this,r=new e(y);return S(r,t),r}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function B(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this._id=dt++,this._state=void 0,this._result=void 0,this._subscribers=[],y!==t&&("function"!=typeof t&&F(),this instanceof U?I(this,t):B())}function V(t,e){this._instanceConstructor=t,this.promise=new t(y),Array.isArray(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?L(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&L(this.promise,this._result))):S(this.promise,this._validationError())}function q(){var t;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=t.Promise;r&&"[object Promise]"===Object.prototype.toString.call(r.resolve())&&!r.cast||(t.Promise=pt)}var H;H=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G,X,Y,W=H,Z=0,Q=function(t,e){rt[Z]=t,rt[Z+1]=e,Z+=2,2===Z&&(X?X(p):Y())},$="undefined"!=typeof window?window:void 0,K=$||{},J=K.MutationObserver||K.WebKitMutationObserver,tt="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);Y=tt?u():J?f():et?h():void 0===$&&"function"==typeof e?g():d();var nt=v,it=m,ot=void 0,at=1,st=2,lt=new R,ut=new R,ct=O,ft=j,ht=D,dt=0,pt=U;U.all=ct,U.race=ft,U.resolve=it,U.reject=ht,U._setScheduler=s,U._setAsap=l,U._asap=Q,U.prototype={constructor:U,then:nt,"catch":function(t){return this.then(null,t)}};var gt=V;V.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},V.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===ot&&t>r;r++)this._eachEntry(e[r],r)},V.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===it){var i=_(t);if(i===nt&&t._state!==ot)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(r===pt){var o=new r(y);k(o,t,i),this._willSettleAt(o,e)}else this._willSettleAt(new r(function(e){e(t)}),e)}else this._willSettleAt(n(t),e)},V.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===ot&&(this._remaining--,t===st?S(n,r):this._result[e]=r),0===this._remaining&&L(n,this._result)},V.prototype._willSettleAt=function(t,e){var r=this;C(t,void 0,function(t){r._settledAt(at,e,t)},function(t){r._settledAt(st,e,t)})};var vt=q,mt={Promise:pt,polyfill:vt};"function"==typeof t&&t.amd?t(function(){return mt}):"undefined"!=typeof r&&r.exports?r.exports=mt:"undefined"!=typeof this&&(this.ES6Promise=mt),vt()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:44}],104:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;r>n;n++)if(e=t.charCodeAt(n),(9>e||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(8192>e||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(t=+t,0===t&&n(r))return!1}else if("number"!==e)return!1;return 1>t-t}},{}],105:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}function i(t,e,r,n,i,o){var a=i.length*i.BYTES_PER_ELEMENT;if(0>o)return t.bufferData(e,i,n),a;if(a+o>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,o,i),r}function o(t,e){for(var r=l.malloc(t.length,e),n=t.length,i=0;n>i;++i)r[i]=t[i];return r}function a(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var o=t.createBuffer(),a=new n(t,r,o,0,i);return a.update(e),a}var l=t("typedarray-pool"),u=t("ndarray-ops"),c=t("ndarray"),f=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],h=n.prototype;h.bind=function(){this.gl.bindBuffer(this.type,this.handle)},h.unbind=function(){this.gl.bindBuffer(this.type,null)},h.dispose=function(){this.gl.deleteBuffer(this.handle)},h.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&"undefined"!=typeof t.shape){var r=t.dtype;if(f.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var n=gl.getExtension("OES_element_index_uint");r=n&&"uint16"!==r?"uint32":"uint16"}if(r===t.dtype&&a(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=l.malloc(t.size,r),h=c(s,t.shape);u.assign(h,t),0>e?this.length=i(this.gl,this.type,this.length,this.usage,s,e):this.length=i(this.gl,this.type,this.length,this.usage,s.subarray(0,t.size),e),l.free(s)}}else if(Array.isArray(t)){var d;d=this.type===this.gl.ELEMENT_ARRAY_BUFFER?o(t,"uint16"):o(t,"float32"),0>e?this.length=i(this.gl,this.type,this.length,this.usage,d,e):this.length=i(this.gl,this.type,this.length,this.usage,d.subarray(0,t.length),e),l.free(d)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");t=0|t,0>=t&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:219,"ndarray-ops":218,"typedarray-pool":242}],106:[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;3>r;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function o(t,e,r,n){for(var i=h[n],o=0;o<i.length;++o){var a=i[o];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],a[0],a[1],a[2])}return i.length}function a(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}]),o=u(e);o.attributes.position.location=0,o.attributes.color.location=1,o.attributes.offset.location=2;var a=new n(e,r,i,o);return a.update(t),a}e.exports=a;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],f=n.prototype;f.isOpaque=function(){return this.opacity>=1},f.isTransparent=function(){return this.opacity<1},f.drawTransparent=f.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 o=n[12],a=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*o+i[7]*a+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var f=0;3>f;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var h=function(){for(var t=new Array(3),e=0;3>e;++e){for(var r=[],n=1;2>=n;++n)for(var i=-1;1>=i;i+=2){var o=(n+e)%3,a=[0,0,0];a[o]=i,r.push(a)}t[e]=r}return t}();f.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 a=[],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;3>u;++u){this.lineOffset[u]=l;t:for(var c=0;s>c;++c){for(var f=r[c],h=0;3>h;++h)if(isNaN(f[h])||!isFinite(f[h]))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 g=f.slice();g[u]+=d[0][u],a.push(f[0],f[1],f[2],p[0],p[1],p[2],p[3],0,0,0,g[0],g[1],g[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,g),l+=2+o(a,g,p,u)}if(d[1][u]>0){var g=f.slice();g[u]+=d[1][u],a.push(f[0],f[1],f[2],p[0],p[1],p[2],p[3],0,0,0,g[0],g[1],g[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,g),l+=2+o(a,g,p,u)}}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(a)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":107,"gl-buffer":105,"gl-vao":192}],107:[function(t,e,r){"use strict";var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}",o="precision mediump float;\n#define GLSLIFY 1\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = opacity * fragColor;\n}";e.exports=function(t){return n(t,i,o,null,[{name:"position",type:"vec3"},{name:"offset",type:"vec3"},{name:"color",type:"vec4"}])}},{"gl-shader":164}],108:[function(t,e,r){"use strict";function n(t){var e=t.getParameter(t.FRAMEBUFFER_BINDING),r=t.getParameter(t.RENDERBUFFER_BINDING),n=t.getParameter(t.TEXTURE_BINDING_2D);return[e,r,n]}function i(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function o(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);y=new Array(r+1);for(var n=0;r>=n;++n){for(var i=new Array(r),o=0;n>o;++o)i[o]=t.COLOR_ATTACHMENT0+o;for(var o=n;r>o;++o)i[o]=t.NONE;y[n]=i}}function a(t){switch(t){case p:throw new Error("gl-fbo: Framebuffer unsupported");case g:throw new Error("gl-fbo: Framebuffer incomplete attachment");case v:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case m:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function s(t,e,r,n,i,o){if(!n)return null;var a=d(t,e,r,i,n);return a.magFilter=t.NEAREST,a.minFilter=t.NEAREST,a.mipSamples=1,a.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,a.handle,0),a}function l(t,e,r,n,i){var o=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,o),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,o),o}function u(t){var e=n(t.gl),r=t.gl,o=t.handle=r.createFramebuffer(),u=t._shape[0],c=t._shape[1],f=t.color.length,h=t._ext,d=t._useStencil,p=t._useDepth,g=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,o);for(var v=0;f>v;++v)t.color[v]=s(r,u,c,g,r.RGBA,r.COLOR_ATTACHMENT0+v);0===f?(t._color_rb=l(r,u,c,r.RGBA4,r.COLOR_ATTACHMENT0),h&&h.drawBuffersWEBGL(y[0])):f>1&&h.drawBuffersWEBGL(y[f]);var m=r.getExtension("WEBGL_depth_texture");m?d?t.depth=s(r,u,c,m.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(r,u,c,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(r,u,c,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(r,u,c,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(r,u,c,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var v=0;v<t.color.length;++v)t.color[v].dispose(),t.color[v]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),i(r,e),a(b)}i(r,e)}function c(t,e,r,n,i,o,a,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var l=0;i>l;++l)this.color[l]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=o,this._useStencil=a;var c=this,f=[0|e,0|r];Object.defineProperties(f,{0:{get:function(){return c._shape[0]},set:function(t){return c.width=t}},1:{get:function(){return c._shape[1]},set:function(t){return c.height=t}}}),this._shapeVector=f,u(this)}function f(t,e,r){if(t._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(t._shape[0]!==e||t._shape[1]!==r){var o=t.gl,s=o.getParameter(o.MAX_RENDERBUFFER_SIZE);if(0>e||e>s||0>r||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(o),u=0;u<t.color.length;++u)t.color[u].shape=t._shape;t._color_rb&&(o.bindRenderbuffer(o.RENDERBUFFER,t._color_rb),o.renderbufferStorage(o.RENDERBUFFER,o.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(o.bindRenderbuffer(o.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&o.renderbufferStorage(o.RENDERBUFFER,o.STENCIL_INDEX,t._shape[0],t._shape[1])),o.bindFramebuffer(o.FRAMEBUFFER,t.handle);var c=o.checkFramebufferStatus(o.FRAMEBUFFER);c!==o.FRAMEBUFFER_COMPLETE&&(t.dispose(),i(o,l),a(c)),i(o,l)}}function h(t,e,r,n){p||(p=t.FRAMEBUFFER_UNSUPPORTED,g=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,v=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,m=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var i=t.getExtension("WEBGL_draw_buffers");if(!y&&i&&o(t,i),Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]),"number"!=typeof e)throw new Error("gl-fbo: Missing shape parameter");var a=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(0>e||e>a||0>r||r>a)throw new Error("gl-fbo: Parameters are too large for FBO");n=n||{};var s=1;if("color"in n){if(s=Math.max(0|n.color,0),0>s)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(s>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");
if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+s+" draw buffers")}}var l=t.UNSIGNED_BYTE,u=t.getExtension("OES_texture_float");if(n.float&&s>0){if(!u)throw new Error("gl-fbo: Context does not support floating point textures");l=t.FLOAT}else n.preferFloat&&s>0&&u&&(l=t.FLOAT);var f=!0;"depth"in n&&(f=!!n.depth);var h=!1;return"stencil"in n&&(h=!!n.stencil),new c(t,e,r,l,s,f,h,i)}var d=t("gl-texture2d");e.exports=h;var p,g,v,m,y=null,b=c.prototype;Object.defineProperties(b,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return f(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t=0|t,f(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t=0|t,f(this,this._shape[0],t),t},enumerable:!1}}),b.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},b.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e<this.color.length;++e)this.color[e].dispose(),this.color[e]=null;this._color_rb&&(t.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{"gl-texture2d":188}],109:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvoid main() {\n vec4 projected = projection * view * model * vec4(position, 1.0);\n vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\n vec2 tangent = normalize(screenShape * tangentClip.xy);\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\n\n gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1_0(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",s=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return n(t,i,o,null,s)},r.createPickShader=function(t){return n(t,i,a,null,s)}},{"gl-shader":164}],110:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0;3>n;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;3>r;++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 o(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function a(t,e,r,n,i,o){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=o,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=g(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=v(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),o=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]),f=0;1024>f;++f)s.data[f]=255;var h=c(e,s);h.wrap=e.REPEAT;var p=new a(e,r,n,i,o,h);return p.update(t),p}e.exports=s;var l=t("gl-buffer"),u=t("gl-vao"),c=t("gl-texture2d"),f=t("glsl-read-float"),h=t("binary-search-bounds"),d=t("ndarray"),p=t("./lib/shaders"),g=p.createShader,v=p.createPickShader,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=a.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||m,view:t.view||m,projection:t.projection||m,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||m,view:t.view||m,projection:t.projection||m,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 o=t.position||t.positions;if(o){var a=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],u=[],c=[],f=0,p=0,g=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],v=!1;t:for(e=1;e<o.length;++e){var m=o[e-1],y=o[e];for(u.push(f),c.push(m.slice()),r=0;3>r;++r){if(isNaN(m[r])||isNaN(y[r])||!isFinite(m[r])||!isFinite(y[r])){if(!i&&l.length>0){for(var b=0;24>b;++b)l.push(l[l.length-12]);p+=2,v=!0}continue t}g[0][r]=Math.min(g[0][r],m[r],y[r]),g[1][r]=Math.max(g[1][r],m[r],y[r])}var x,_;Array.isArray(a[0])?(x=a[e-1],_=a[e]):x=_=a,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 A=f;if(f+=n(m,y),v){for(r=0;2>r;++r)l.push(m[0],m[1],m[2],y[0],y[1],y[2],A,w,x[0],x[1],x[2],x[3]);p+=2,v=!1}l.push(m[0],m[1],m[2],y[0],y[1],y[2],A,w,x[0],x[1],x[2],x[3],m[0],m[1],m[2],y[0],y[1],y[2],A,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],m[0],m[1],m[2],f,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],m[0],m[1],m[2],f,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),u.push(f),c.push(o[o.length-1].slice()),this.bounds=g,this.vertexCount=p,this.points=c,this.arcLength=u,"dashes"in t){var M=t.dashes,k=M.slice();for(k.unshift(0),e=1;e<k.length;++e)k[e]=k[e-1]+k[e];var T=d(new Array(1024),[256,1,4]);for(e=0;256>e;++e){for(r=0;4>r;++r)T.set(e,0,r,0);1&h.le(k,k[k.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)return null;if(t.id!==this.pickId)return null;var e=f(t.value[0],t.value[1],t.value[2],0),r=h.le(this.arcLength,e);if(0>r)return null;if(r===this.arcLength.length-1)return new o(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],a=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),s=1-a,l=[0,0,0],u=0;3>u;++u)l[u]=s*n[u]+a*i[u];var c=Math.min(.5>a?r:r+1,this.points.length-1);return new o(e,l,c,this.points[c])}},{"./lib/shaders":109,"binary-search-bounds":111,"gl-buffer":105,"gl-texture2d":188,"gl-vao":192,"glsl-read-float":112,ndarray:219}],111:[function(t,e,r){arguments[4][9][0].apply(r,arguments)},{dup:9}],112:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,o[0]}e.exports=n;var i=new Uint8Array(4),o=new Float32Array(i.buffer)},{}],113:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=c*a-s*u,h=-c*o+s*l,d=u*o-a*l,p=r*f+n*h+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*a)*p,t[3]=h*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*o)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(a*r-n*o)*p,t):null}e.exports=n},{}],114:[function(t,e,r){function n(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}e.exports=n},{}],115:[function(t,e,r){function n(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],116:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],v=t[15],m=e*a-r*o,y=e*s-n*o,b=e*l-i*o,x=r*s-n*a,_=r*l-i*a,w=n*l-i*s,A=u*p-c*d,M=u*g-f*d,k=u*v-h*d,T=c*g-f*p,E=c*v-h*p,L=f*v-h*g;return m*L-y*E+b*T+x*k-_*M+w*A}e.exports=n},{}],117:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,l=i+i,u=r*a,c=n*a,f=n*s,h=i*a,d=i*s,p=i*l,g=o*a,v=o*s,m=o*l;return t[0]=1-f-p,t[1]=c+m,t[2]=h-v,t[3]=0,t[4]=c-m,t[5]=1-u-p,t[6]=d+g,t[7]=0,t[8]=h+v,t[9]=d-g,t[10]=1-u-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],118:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=n+n,l=i+i,u=o+o,c=n*s,f=n*l,h=n*u,d=i*l,p=i*u,g=o*u,v=a*s,m=a*l,y=a*u;return t[0]=1-(d+g),t[1]=f+y,t[2]=h-m,t[3]=0,t[4]=f-y,t[5]=1-(c+g),t[6]=p+v,t[7]=0,t[8]=h+m,t[9]=p-v,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}e.exports=n},{}],119:[function(t,e,r){function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],120:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=r*s-n*a,b=r*l-i*a,x=r*u-o*a,_=n*l-i*s,w=n*u-o*s,A=i*u-o*l,M=c*g-f*p,k=c*v-h*p,T=c*m-d*p,E=f*v-h*g,L=f*m-d*g,S=h*m-d*v,C=y*S-b*L+x*E+_*T-w*k+A*M;return C?(C=1/C,t[0]=(s*S-l*L+u*E)*C,t[1]=(i*L-n*S-o*E)*C,t[2]=(g*A-v*w+m*_)*C,t[3]=(h*w-f*A-d*_)*C,t[4]=(l*T-a*S-u*k)*C,t[5]=(r*S-i*T+o*k)*C,t[6]=(v*x-p*A-m*b)*C,t[7]=(c*A-h*x+d*b)*C,t[8]=(a*L-s*T+u*M)*C,t[9]=(n*T-r*L-o*M)*C,t[10]=(p*w-g*x+m*y)*C,t[11]=(f*x-c*w-d*y)*C,t[12]=(s*k-a*E-l*M)*C,t[13]=(r*E-n*k+i*M)*C,t[14]=(g*b-p*_-v*y)*C,t[15]=(c*_-f*b+h*y)*C,t):null}e.exports=n},{}],121:[function(t,e,r){function n(t,e,r,n){var o,a,s,l,u,c,f,h,d,p,g=e[0],v=e[1],m=e[2],y=n[0],b=n[1],x=n[2],_=r[0],w=r[1],A=r[2];return Math.abs(g-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(m-A)<1e-6?i(t):(f=g-_,h=v-w,d=m-A,p=1/Math.sqrt(f*f+h*h+d*d),f*=p,h*=p,d*=p,o=b*d-x*h,a=x*f-y*d,s=y*h-b*f,p=Math.sqrt(o*o+a*a+s*s),p?(p=1/p,o*=p,a*=p,s*=p):(o=0,a=0,s=0),l=h*s-d*a,u=d*o-f*s,c=f*a-h*o,p=Math.sqrt(l*l+u*u+c*c),p?(p=1/p,l*=p,u*=p,c*=p):(l=0,u=0,c=0),t[0]=o,t[1]=l,t[2]=f,t[3]=0,t[4]=a,t[5]=u,t[6]=h,t[7]=0,t[8]=s,t[9]=c,t[10]=d,t[11]=0,t[12]=-(o*g+a*v+s*m),t[13]=-(l*g+u*v+c*m),t[14]=-(f*g+h*v+d*m),t[15]=1,t)}var i=t("./identity");e.exports=n},{"./identity":119}],122:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*f+w*g,t[1]=b*i+x*l+_*h+w*v,t[2]=b*o+x*u+_*d+w*m,t[3]=b*a+x*c+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*f+w*g,t[5]=b*i+x*l+_*h+w*v,t[6]=b*o+x*u+_*d+w*m,t[7]=b*a+x*c+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*f+w*g,t[9]=b*i+x*l+_*h+w*v,t[10]=b*o+x*u+_*d+w*m,t[11]=b*a+x*c+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*f+w*g,t[13]=b*i+x*l+_*h+w*v,t[14]=b*o+x*u+_*d+w*m,t[15]=b*a+x*c+_*p+w*y,t}e.exports=n},{}],123:[function(t,e,r){function n(t,e,r,n,i){var o=1/Math.tan(e/2),a=1/(n-i);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*a,t[15]=0,t}e.exports=n},{}],124:[function(t,e,r){function n(t,e,r,n){var i,o,a,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_,w,A,M,k,T,E,L=n[0],S=n[1],C=n[2],P=Math.sqrt(L*L+S*S+C*C);return Math.abs(P)<1e-6?null:(P=1/P,L*=P,S*=P,C*=P,i=Math.sin(r),o=Math.cos(r),a=1-o,s=e[0],l=e[1],u=e[2],c=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],v=e[9],m=e[10],y=e[11],b=L*L*a+o,x=S*L*a+C*i,_=C*L*a-S*i,w=L*S*a-C*i,A=S*S*a+o,M=C*S*a+L*i,k=L*C*a+S*i,T=S*C*a-L*i,E=C*C*a+o,t[0]=s*b+f*x+g*_,t[1]=l*b+h*x+v*_,t[2]=u*b+d*x+m*_,t[3]=c*b+p*x+y*_,t[4]=s*w+f*A+g*M,t[5]=l*w+h*A+v*M,t[6]=u*w+d*A+m*M,t[7]=c*w+p*A+y*M,t[8]=s*k+f*T+g*E,t[9]=l*k+h*T+v*E,t[10]=u*k+d*T+m*E,t[11]=c*k+p*T+y*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}e.exports=n},{}],125:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*n,t[5]=a*i+c*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=u*i-o*n,t[9]=c*i-a*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t}e.exports=n},{}],126:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=e[8],c=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-u*n,t[1]=a*i-c*n,t[2]=s*i-f*n,t[3]=l*i-h*n,t[8]=o*n+u*i,t[9]=a*n+c*i,t[10]=s*n+f*i,t[11]=l*n+h*i,t}e.exports=n},{}],127:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=e[4],c=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*n,t[1]=a*i+c*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=u*i-o*n,t[5]=c*i-a*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t}e.exports=n},{}],128:[function(t,e,r){function n(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}e.exports=n},{}],129:[function(t,e,r){function n(t,e,r){var n,i,o,a,s,l,u,c,f,h,d,p,g=r[0],v=r[1],m=r[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=n*g+s*v+f*m+e[12],t[13]=i*g+l*v+h*m+e[13],t[14]=o*g+u*v+d*m+e[14],t[15]=a*g+c*v+p*m+e[15]),t}e.exports=n},{}],130:[function(t,e,r){function n(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}e.exports=n},{}],131:[function(t,e,r){"use strict";function n(t,e){for(var r=[0,0,0,0],n=0;4>n;++n)for(var i=0;4>i;++i)r[i]+=t[4*n+i]*e[n];return r}function i(t,e,r,i,o){for(var a=n(i,n(r,n(e,[t[0],t[1],t[2],1]))),s=0;3>s;++s)a[s]/=a[3];return[.5*o[0]*(1+a[0]),.5*o[1]*(1-a[1])]}function o(t,e){if(2===t.length){for(var r=0,n=0,i=0;2>i;++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),1e-6>r+n?[1,0]:[n/(r+n),r/(n+r)]}if(3===t.length){var o=[0,0];return u(t[0],t[1],t[2],e,o),l(t,o)}return[]}function a(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],o=e[n],a=0;3>a;++a)r[a]+=o*i[a];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 f=0,h=1/0,c=0;c<u.length;++c){for(var d=0,p=0;2>p;++p)d+=Math.pow(u[c][p]-e[p],2);h>d&&(h=d,f=c)}for(var g=o(u,e),v=0,c=0;3>c;++c){if(g[c]<-.001||g[c]>1.0001)return null;v+=g[c]}return Math.abs(v-1)>.001?null:[f,a(t,g),g]}var l=t("barycentric"),u=t("polytope-closest-point/lib/closest_point_2d.js");e.exports=s},{barycentric:134,"polytope-closest-point/lib/closest_point_2d.js":136}],132:[function(t,e,r){var n="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}",i="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution_2_0(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\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 if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}",a="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",s="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}",l="precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",u="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",c="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}",f="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",h="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",d="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n";r.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:f,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:h,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{}],133:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_,w,A,M,k,T){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=o,this.pointPickShader=a,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=m,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=A,this.pointIds=x,this.pointVAO=M,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=T,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=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.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=I,this._view=I,this._projection=I,this._resolution=[1,1]}function i(t){for(var e=M({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;256>n;++n){for(var i=e[n],o=0;3>o;++o)r[4*n+o]=i[o];r[4*n+3]=255*i[3]}return A(r,[256,256,4],[4,0,1])}function o(t,e,r){for(var n=new Array(e),i=0;e>i;++i)n[i]=0;for(var o=t.length,i=0;o>i;++i)for(var a=t[i],s=0;s<a.length;++s)n[a[s]]=r[i];return n}function a(t){for(var e=t.length,r=new Array(e),n=0;e>n;++n)r[n]=t[n][2];return r}function s(t){var e=v(t,S);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function l(t){var e=v(t,C);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function u(t){var e=v(t,P);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function c(t){var e=v(t,R);return e.attributes.position.location=0,e.attributes.id.location=1,e}function f(t){var e=v(t,N);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function h(t){var e=v(t,z);return e.attributes.position.location=0,e}function d(t){var e=t.gl,r=s(e),i=l(e),o=u(e),a=c(e),d=f(e),p=h(e),g=b(e,A(new Uint8Array([255,255,255,255]),[1,1,4]));g.generateMipmap(),g.minFilter=e.LINEAR_MIPMAP_LINEAR,g.magFilter=e.LINEAR;var v=m(e),x=m(e),_=m(e),w=m(e),M=m(e),k=y(e,[{buffer:v,type:e.FLOAT,size:3},{buffer:M,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:x,type:e.FLOAT,size:4},{buffer:_,type:e.FLOAT,size:2},{buffer:w,type:e.FLOAT,size:3}]),T=m(e),E=m(e),L=m(e),S=m(e),C=y(e,[{buffer:T,type:e.FLOAT,size:3},{buffer:S,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:E,type:e.FLOAT,size:4},{buffer:L,type:e.FLOAT,size:2}]),P=m(e),R=m(e),N=m(e),z=m(e),I=m(e),O=y(e,[{buffer:P,type:e.FLOAT,size:3},{buffer:I,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:R,type:e.FLOAT,size:4},{buffer:N,type:e.FLOAT,size:2},{buffer:z,type:e.FLOAT,size:1}]),j=m(e),D=y(e,[{buffer:j,type:e.FLOAT,size:3}]),F=new n(e,g,r,i,o,a,d,p,v,M,x,_,w,k,T,S,E,L,C,P,I,R,N,z,O,j,D);return F.update(t),F}var p=1e-6,g=1e-6,v=t("gl-shader"),m=t("gl-buffer"),y=t("gl-vao"),b=t("gl-texture2d"),x=t("normals"),_=t("gl-mat4/multiply"),w=t("gl-mat4/invert"),A=t("ndarray"),M=t("colormap"),k=t("simplicial-complex-contour"),T=t("typedarray-pool"),E=t("./lib/shaders"),L=t("./lib/closest-point"),S=E.meshShader,C=E.wireShader,P=E.pointShader,R=E.pickShader,N=E.pointPickShader,z=E.contourShader,I=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],O=n.prototype;O.isOpaque=function(){return this.opacity>=1},O.isTransparent=function(){return this.opacity<1},O.pickSlots=1,O.setPickBase=function(t){this.pickId=t},O.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=k(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,o=r.length,a=T.mallocFloat32(6*o),s=0,l=0;o>l;++l)for(var u=r[l],c=0;2>c;++c){var f=u[0];2===u.length&&(f=u[c]);for(var h=n[f][0],d=n[f][1],p=i[f],g=1-p,v=this.positions[h],m=this.positions[d],y=0;3>y;++y)a[s++]=p*v[y]+g*m[y]}this.contourCount=s/3|0,this.contourPositions.update(a.subarray(0,s)),T.free(a)},O.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"contourEnable"in t&&(this.contourEnable=t.contourEnable),"contourColor"in t&&(this.contourColor=t.contourColor),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),t.texture?(this.texture.dispose(),this.texture=b(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(i(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var s=[],l=[],u=[],c=[],f=[],h=[],d=[],v=[],m=[],y=[],_=[],w=[],A=[],M=[];this.cells=r,this.positions=n;var k=t.vertexNormals,T=t.cellNormals,E=void 0===t.vertexNormalsEpsilon?p:t.vertexNormalsEpsilon,L=void 0===t.faceNormalsEpsilon?g:t.faceNormalsEpsilon;t.useFacetNormals&&!T&&(T=x.faceNormals(r,n,L)),T||k||(k=x.vertexNormals(r,n,E));var S=t.vertexColors,C=t.cellColors,P=t.meshColor||[1,1,1,1],R=t.vertexUVs,N=t.vertexIntensity,z=t.cellUVs,I=t.cellIntensity,O=1/0,j=-(1/0);if(!R&&!z)if(N)for(var D=0;D<N.length;++D){var F=N[D];O=Math.min(O,F),j=Math.max(j,F)}else if(I)for(var D=0;D<I.length;++D){var F=I[D];O=Math.min(O,F),j=Math.max(j,F)}else for(var D=0;D<n.length;++D){var F=n[D][2];O=Math.min(O,F),j=Math.max(j,F)}N?this.intensity=N:I?this.intensity=o(r,n.length,I):this.intensity=a(n);var B=t.pointSizes,U=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(var D=0;D<n.length;++D)for(var V=n[D],q=0;3>q;++q)!isNaN(V[q])&&isFinite(V[q])&&(this.bounds[0][q]=Math.min(this.bounds[0][q],V[q]),this.bounds[1][q]=Math.max(this.bounds[1][q],V[q]));var H=0,G=0,X=0;t:for(var D=0;D<r.length;++D){var Y=r[D];switch(Y.length){case 1:for(var W=Y[0],V=n[W],q=0;3>q;++q)if(isNaN(V[q])||!isFinite(V[q]))continue t;y.push(V[0],V[1],V[2]);var Z;Z=S?S[W]:C?C[D]:P,3===Z.length?_.push(Z[0],Z[1],Z[2],1):_.push(Z[0],Z[1],Z[2],Z[3]);var Q;Q=R?R[W]:N?[(N[W]-O)/(j-O),0]:z?z[D]:I?[(I[D]-O)/(j-O),0]:[(V[2]-O)/(j-O),0],w.push(Q[0],Q[1]),B?A.push(B[W]):A.push(U),M.push(D),X+=1;break;case 2:for(var q=0;2>q;++q)for(var W=Y[q],V=n[W],$=0;3>$;++$)if(isNaN(V[$])||!isFinite(V[$]))continue t;
for(var q=0;2>q;++q){var W=Y[q],V=n[W];h.push(V[0],V[1],V[2]);var Z;Z=S?S[W]:C?C[D]:P,3===Z.length?d.push(Z[0],Z[1],Z[2],1):d.push(Z[0],Z[1],Z[2],Z[3]);var Q;Q=R?R[W]:N?[(N[W]-O)/(j-O),0]:z?z[D]:I?[(I[D]-O)/(j-O),0]:[(V[2]-O)/(j-O),0],v.push(Q[0],Q[1]),m.push(D)}G+=1;break;case 3:for(var q=0;3>q;++q)for(var W=Y[q],V=n[W],$=0;3>$;++$)if(isNaN(V[$])||!isFinite(V[$]))continue t;for(var q=0;3>q;++q){var W=Y[q],V=n[W];s.push(V[0],V[1],V[2]);var Z;Z=S?S[W]:C?C[D]:P,3===Z.length?l.push(Z[0],Z[1],Z[2],1):l.push(Z[0],Z[1],Z[2],Z[3]);var Q;Q=R?R[W]:N?[(N[W]-O)/(j-O),0]:z?z[D]:I?[(I[D]-O)/(j-O),0]:[(V[2]-O)/(j-O),0],c.push(Q[0],Q[1]);var K;K=k?k[W]:T[D],u.push(K[0],K[1],K[2]),f.push(D)}H+=1}}this.pointCount=X,this.edgeCount=G,this.triangleCount=H,this.pointPositions.update(y),this.pointColors.update(_),this.pointUVs.update(w),this.pointSizes.update(A),this.pointIds.update(new Uint32Array(M)),this.edgePositions.update(h),this.edgeColors.update(d),this.edgeUVs.update(v),this.edgeIds.update(new Uint32Array(m)),this.trianglePositions.update(s),this.triangleColors.update(l),this.triangleUVs.update(c),this.triangleNormals.update(u),this.triangleIds.update(new Uint32Array(f))}},O.drawTransparent=O.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||I,n=t.view||I,i=t.projection||I,o=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],a=0;3>a;++a)o[0][a]=Math.max(o[0][a],this.clipBounds[0][a]),o[1][a]=Math.min(o[1][a],this.clipBounds[1][a]);var s={model:r,view:n,projection:i,clipBounds:o,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var l=new Array(16);_(l,s.view,s.model),_(l,s.projection,l),w(l,l);for(var a=0;3>a;++a)s.eyePosition[a]=l[12+a]/l[15];for(var u=l[15],a=0;3>a;++a)u+=this.lightPosition[a]*l[4*a+3];for(var a=0;3>a;++a){for(var c=l[12+a],f=0;3>f;++f)c+=l[4*f+a]*this.lightPosition[f];s.lightPosition[a]=c/u}if(this.triangleCount>0){var h=this.triShader;h.bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var h=this.lineShader;h.bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var h=this.pointShader;h.bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var h=this.contourShader;h.bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},O.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||I,n=t.view||I,i=t.projection||I,o=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],a=0;3>a;++a)o[0][a]=Math.max(o[0][a],this.clipBounds[0][a]),o[1][a]=Math.min(o[1][a],this.clipBounds[1][a]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:o,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},O.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),o=0;o<r.length;++o)i[o]=n[r[o]];var a=L(i,[t.coord[0],this._resolution[1]-t.coord[1]],this._model,this._view,this._projection,this._resolution);if(!a)return null;for(var s=a[2],l=0,o=0;o<r.length;++o)l+=s[o]*this.intensity[r[o]];return{position:a[1],index:r[a[0]],cell:r,cellId:e,intensity:l,dataCoordinate:this.positions[r[a[0]]]}},O.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},e.exports=d},{"./lib/closest-point":131,"./lib/shaders":132,colormap:88,"gl-buffer":105,"gl-mat4/invert":120,"gl-mat4/multiply":122,"gl-shader":164,"gl-texture2d":188,"gl-vao":192,ndarray:219,normals:135,"simplicial-complex-contour":137,"typedarray-pool":242}],134:[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),a=0;r>a;++a){for(var s=new Array(r+1),l=0;r>=l;++l)s[l]=t[l][a];i[a]=s}i[r]=new Array(r+1);for(var a=0;r>=a;++a)i[r][a]=1;for(var u=new Array(r+1),a=0;r>a;++a)u[a]=e[a];u[r]=1;var c=o(i,u),f=n(c[r+1]);0===f&&(f=1);for(var h=new Array(r+1),a=0;r>=a;++a)h[a]=n(c[a])/f;return h}e.exports=i;var o=t("robust-linear-solve")},{"robust-linear-solve":222}],135:[function(t,e,r){var n=1e-6,i=1e-6;r.vertexNormals=function(t,e,r){for(var i=e.length,o=new Array(i),a=void 0===r?n:r,s=0;i>s;++s)o[s]=[0,0,0];for(var s=0;s<t.length;++s)for(var l=t[s],u=0,c=l[l.length-1],f=l[0],h=0;h<l.length;++h){u=c,c=f,f=l[(h+1)%l.length];for(var d=e[u],p=e[c],g=e[f],v=new Array(3),m=0,y=new Array(3),b=0,x=0;3>x;++x)v[x]=d[x]-p[x],m+=v[x]*v[x],y[x]=g[x]-p[x],b+=y[x]*y[x];if(m*b>a)for(var _=o[c],w=1/Math.sqrt(m*b),x=0;3>x;++x){var A=(x+1)%3,M=(x+2)%3;_[x]+=w*(y[A]*v[M]-y[M]*v[A])}}for(var s=0;i>s;++s){for(var _=o[s],k=0,x=0;3>x;++x)k+=_[x]*_[x];if(k>a)for(var w=1/Math.sqrt(k),x=0;3>x;++x)_[x]*=w;else for(var x=0;3>x;++x)_[x]=0}return o},r.faceNormals=function(t,e,r){for(var n=t.length,o=new Array(n),a=void 0===r?i:r,s=0;n>s;++s){for(var l=t[s],u=new Array(3),c=0;3>c;++c)u[c]=e[l[c]];for(var f=new Array(3),h=new Array(3),c=0;3>c;++c)f[c]=u[1][c]-u[0][c],h[c]=u[2][c]-u[0][c];for(var d=new Array(3),p=0,c=0;3>c;++c){var g=(c+1)%3,v=(c+2)%3;d[c]=f[g]*h[v]-f[v]*h[g],p+=d[c]*d[c]}p=p>a?1/Math.sqrt(p):0;for(var c=0;3>c;++c)d[c]*=p;o[s]=d}return o}},{}],136:[function(t,e,r){"use strict";function n(t,e,r,n,s){i.length<n.length&&(i=new Float64Array(n.length),o=new Float64Array(n.length),a=new Float64Array(n.length));for(var l=0;l<n.length;++l)i[l]=t[l]-n[l],o[l]=e[l]-t[l],a[l]=r[l]-t[l];for(var u=0,c=0,f=0,h=0,d=0,p=0,l=0;l<n.length;++l){var g=o[l],v=a[l],m=i[l];u+=g*g,c+=g*v,f+=v*v,h+=m*g,d+=m*v,p+=m*m}var y,b=Math.abs(u*f-c*c),x=c*d-f*h,_=c*h-u*d;if(b>=x+_)if(0>x)0>_&&0>h?(_=0,-h>=u?(x=1,y=u+2*h+p):(x=-h/u,y=h*x+p)):(x=0,d>=0?(_=0,y=p):-d>=f?(_=1,y=f+2*d+p):(_=-d/f,y=d*_+p));else if(0>_)_=0,h>=0?(x=0,y=p):-h>=u?(x=1,y=u+2*h+p):(x=-h/u,y=h*x+p);else{var w=1/b;x*=w,_*=w,y=x*(u*x+c*_+2*h)+_*(c*x+f*_+2*d)+p}else{var A,M,k,T;0>x?(A=c+h,M=f+d,M>A?(k=M-A,T=u-2*c+f,k>=T?(x=1,_=0,y=u+2*h+p):(x=k/T,_=1-x,y=x*(u*x+c*_+2*h)+_*(c*x+f*_+2*d)+p)):(x=0,0>=M?(_=1,y=f+2*d+p):d>=0?(_=0,y=p):(_=-d/f,y=d*_+p))):0>_?(A=c+d,M=u+h,M>A?(k=M-A,T=u-2*c+f,k>=T?(_=1,x=0,y=f+2*d+p):(_=k/T,x=1-_,y=x*(u*x+c*_+2*h)+_*(c*x+f*_+2*d)+p)):(_=0,0>=M?(x=1,y=u+2*h+p):h>=0?(x=0,y=p):(x=-h/u,y=h*x+p))):(k=f+d-c-h,0>=k?(x=0,_=1,y=f+2*d+p):(T=u-2*c+f,k>=T?(x=1,_=0,y=u+2*h+p):(x=k/T,_=1-x,y=x*(u*x+c*_+2*h)+_*(c*x+f*_+2*d)+p)))}for(var E=1-x-_,l=0;l<n.length;++l)s[l]=E*t[l]+x*e[l]+_*r[l];return 0>y?0:y}var i=new Float64Array(4),o=new Float64Array(4),a=new Float64Array(4);e.exports=n},{}],137:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;e>n;++n)r=0|Math.max(r,t[n].length);return r-1}function i(t,e){for(var r=t.length,n=f.mallocUint8(r),i=0;r>i;++i)n[i]=t[i]<e|0;return n}function o(t,e){for(var r=t.length,n=e*(e+1)/2*r|0,i=f.mallocUint32(2*n),o=0,a=0;r>a;++a)for(var s=t[a],e=s.length,l=0;e>l;++l)for(var u=0;l>u;++u){var d=s[u],p=s[l];i[o++]=0|Math.min(d,p),i[o++]=0|Math.max(d,p)}var g=o/2|0;h(c(i,[g,2]));for(var v=2,a=2;o>a;a+=2)i[a-2]===i[a]&&i[a-1]===i[a+1]||(i[v++]=i[a],i[v++]=i[a+1]);return c(i,[v/2|0,2])}function a(t,e,r,n){for(var i=t.data,o=t.shape[0],a=f.mallocDouble(o),s=0,l=0;o>l;++l){var u=i[2*l],h=i[2*l+1];if(r[u]!==r[h]){var d=e[u],p=e[h];i[2*s]=u,i[2*s+1]=h,a[s++]=(p-n)/(p-d)}}return t.shape[0]=s,c(a,[s])}function s(t,e){var r=f.mallocInt32(2*e),n=t.shape[0],i=t.data;r[0]=0;for(var o=0,a=0;n>a;++a){var s=i[2*a];if(s!==o){for(r[2*o+1]=a;++o<s;)r[2*o]=a,r[2*o+1]=a;r[2*o]=a}}for(r[2*o+1]=n;++o<e;)r[2*o]=r[2*o+1]=n;return r}function l(t){for(var e=0|t.shape[0],r=t.data,n=new Array(e),i=0;e>i;++i)n[i]=[r[2*i],r[2*i+1]];return n}function u(t,e,r,u){r=r||0,"undefined"==typeof u&&(u=n(t));var c=t.length;if(0===c||1>u)return{cells:[],vertexIds:[],vertexWeights:[]};var h=i(e,+r),p=o(t,u),g=a(p,e,h,+r),v=s(p,0|e.length),m=d(u)(t,p.data,v,h),y=l(p),b=[].slice.call(g.data,0,g.shape[0]);return f.free(h),f.free(p.data),f.free(g.data),f.free(v),{cells:m,vertexIds:y,vertexWeights:b}}e.exports=u;var c=t("ndarray"),f=t("typedarray-pool"),h=t("ndarray-sort"),d=t("./lib/codegen")},{"./lib/codegen":138,ndarray:219,"ndarray-sort":141,"typedarray-pool":242}],138:[function(t,e,r){"use strict";function n(t){function e(t){if(!(t.length<=0)){u.push("R.push(");for(var e=0;e<t.length;++e){var r=t[e];e>0&&u.push(","),u.push("[");for(var n=0;n<r.length;++n){var i=r[n];n>0&&u.push(","),u.push("B(C,E,c[",i[0],"],c[",i[1],"])")}u.push("]")}u.push(");")}}var r=0,n=new Array(t+1);n[0]=[[]];for(var i=1;t>=i;++i)for(var s=n[i]=a(i),l=0;l<s.length;++l)r=Math.max(r,s[i].length);for(var u=["function B(C,E,i,j){","var a=Math.min(i,j)|0,b=Math.max(i,j)|0,l=C[2*a],h=C[2*a+1];","while(l<h){","var m=(l+h)>>1,v=E[2*m+1];","if(v===b){return m}","if(b<v){h=m}else{l=m+1}","}","return l;","};","function getContour",t,"d(F,E,C,S){","var n=F.length,R=[];","for(var i=0;i<n;++i){var c=F[i],l=c.length;"],i=t+1;i>1;--i){t+1>i&&u.push("else "),u.push("if(l===",i,"){");for(var c=[],l=0;i>l;++l)c.push("(S[c["+l+"]]<<"+l+")");u.push("var M=",c.join("+"),";if(M===0||M===",(1<<i)-1,"){continue}switch(M){");for(var s=n[i-1],l=0;l<s.length;++l)u.push("case ",l,":"),e(s[l]),u.push("break;");u.push("}}")}u.push("}return R;};return getContour",t,"d");var f=new Function("pool",u.join(""));return f(o)}function i(t){var e=s[t];return e||(e=s[t]=n(t)),e}e.exports=i;var o=t("typedarray-pool"),a=t("marching-simplex-table"),s={}},{"marching-simplex-table":139,"typedarray-pool":242}],139:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=0,i===e&&(n[i]+=.5),i===r&&(n[i]+=.5);return n}function i(t,e){if(0===e||e===(1<<t+1)-1)return[];for(var r=[],i=[],o=0;t>=o;++o)if(e&1<<o){r.push(n(t,o-1,o-1)),i.push(null);for(var s=0;t>=s;++s)~e&1<<s&&(r.push(n(t,o-1,s-1)),i.push([o,s]))}var l=a(r),u=[];t:for(var o=0;o<l.length;++o){for(var c=l[o],f=[],s=0;s<c.length;++s){if(!i[c[s]])continue t;f.push(i[c[s]].slice())}u.push(f)}return u}function o(t){for(var e=1<<t+1,r=new Array(e),n=0;e>n;++n)r[n]=i(t,n);return r}e.exports=o;var a=t("convex-hull")},{"convex-hull":90}],140:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;t>r;++r)e.push("s"+r);for(var r=0;t>r;++r)e.push("n"+r);for(var r=1;t>r;++r)e.push("d"+r);for(var r=1;t>r;++r)e.push("e"+r);for(var r=1;t>r;++r)e.push("f"+r);return e}function o(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function o(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var a=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),u=n(e),c=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var f=[],h=1;h<t.length;++h)c.push("i"+h),f.push("n"+h);u?c.push("scratch=malloc("+f.join("*")+")"):c.push("scratch=new Array("+f.join("*")+")"),c.push("dptr","sptr","a","b")}else c.push("scratch");if(a.push(["function ",s,"(",l.join(","),"){var ",c.join(",")].join(""),"for(i=left+1;i<=right;++i){","j=i;ptr+=s0","cptr=ptr"),t.length>1){a.push("dptr=0;sptr=ptr");for(var h=t.length-1;h>=0;--h){var d=t[h];0!==d&&a.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}a.push("scratch[dptr++]=",r("sptr"));for(var h=0;h<t.length;++h){var d=t[h];0!==d&&a.push("sptr+=d"+d,"}")}a.push("__g:while(j-->left){","dptr=0","sptr=cptr-s0");for(var h=1;h<t.length;++h)1===h&&a.push("__l:"),a.push(["for(i",h,"=0;i",h,"<n",h,";++i",h,"){"].join(""));a.push(["a=",r("sptr"),"\nb=scratch[dptr]\nif(a<b){break __g}\nif(a>b){break __l}"].join(""));for(var h=t.length-1;h>=1;--h)a.push("sptr+=e"+h,"dptr+=f"+h,"}");a.push("dptr=cptr;sptr=cptr-s0");for(var h=t.length-1;h>=0;--h){var d=t[h];0!==d&&a.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}a.push(o("dptr",r("sptr")));for(var h=0;h<t.length;++h){var d=t[h];0!==d&&a.push(["dptr+=d",d,";sptr+=d",d].join(""),"}")}a.push("cptr-=s0\n}"),a.push("dptr=cptr;sptr=0");for(var h=t.length-1;h>=0;--h){var d=t[h];0!==d&&a.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}a.push(o("dptr","scratch[sptr++]"));for(var h=0;h<t.length;++h){var d=t[h];0!==d&&a.push("dptr+=d"+d,"}")}}else a.push("scratch="+r("ptr"),"while((j-->left)&&("+r("cptr-s0")+">scratch)){",o("cptr",r("cptr-s0")),"cptr-=s0","}",o("cptr","scratch"));if(a.push("}"),t.length>1&&u&&a.push("free(scratch)"),a.push("} return "+s),u){var p=new Function("malloc","free",a.join("\n"));return p(u[0],u[1])}var p=new Function(a.join("\n"));return p()}function a(t,e,r){function o(t){return["(offset+",t,"*s0)"].join("")}function a(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function l(e,r,n){if(1===e.length)_.push("ptr0="+o(e[0]));else for(var i=0;i<e.length;++i)_.push(["b_ptr",i,"=s0*",e[i]].join(""));r&&_.push("pivot_ptr=0"),_.push("ptr_shift=offset");for(var i=t.length-1;i>=0;--i){var a=t[i];0!==a&&_.push(["for(i",a,"=0;i",a,"<n",a,";++i",a,"){"].join(""))}if(e.length>1)for(var i=0;i<e.length;++i)_.push(["ptr",i,"=b_ptr",i,"+ptr_shift"].join(""));_.push(n),r&&_.push("++pivot_ptr");for(var i=0;i<t.length;++i){var a=t[i];0!==a&&(e.length>1?_.push("ptr_shift+=d"+a):_.push("ptr0+=d"+a),_.push("}"))}}function c(e,r,n,i){if(1===r.length)_.push("ptr0="+o(r[0]));else{for(var a=0;a<r.length;++a)_.push(["b_ptr",a,"=s0*",r[a]].join(""));_.push("ptr_shift=offset")}n&&_.push("pivot_ptr=0"),e&&_.push(e+":");for(var a=1;a<t.length;++a)_.push(["for(i",a,"=0;i",a,"<n",a,";++i",a,"){"].join(""));if(r.length>1)for(var a=0;a<r.length;++a)_.push(["ptr",a,"=b_ptr",a,"+ptr_shift"].join(""));_.push(i);for(var a=t.length-1;a>=1;--a)n&&_.push("pivot_ptr+=f"+a),r.length>1?_.push("ptr_shift+=e"+a):_.push("ptr0+=e"+a),_.push("}")}function f(){t.length>1&&M&&_.push("free(pivot1)","free(pivot2)")}function h(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++k;c(s,[n,i],!1,["comp=",a("ptr0"),"-",a("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",a(o(n)),">",a(o(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?l([e,r],!1,s("ptr0",a("ptr1"))):_.push(s(o(e),a(o(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++k;c(i,[r],!0,[e,"=",a("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",a(o(r)),"-pivot",n].join(""))}function g(e,r){t.length>1?l([e,r],!1,["tmp=",a("ptr0"),"\n",s("ptr0",a("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",o(e),"\n","ptr1=",o(r),"\n","tmp=",a("ptr0"),"\n",s("ptr0",a("ptr1")),"\n",s("ptr1","tmp")].join(""))}function v(e,r,n){t.length>1?(l([e,r,n],!1,["tmp=",a("ptr0"),"\n",s("ptr0",a("ptr1")),"\n",s("ptr1",a("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",o(e),"\n","ptr1=",o(r),"\n","ptr2=",o(n),"\n","++",r,"\n","--",n,"\n","tmp=",a("ptr0"),"\n",s("ptr0",a("ptr1")),"\n",s("ptr1",a("ptr2")),"\n",s("ptr2","tmp")].join(""))}function m(t,e){g(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s("ptr0",a("ptr1")),"\n",s("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(s(o(e),a(o(r))),s(o(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",u,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++k,":while(true){"].join("")),l([e],!0,["if(",a("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",k,"}"].join("")),_.push(n,"}")):_.push(["while(",a(o(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),A=["left","right","data","offset"].concat(i(t.length)),M=n(e),k=0;_.push(["function ",w,"(",A.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var E=[],L=1;L<t.length;++L)E.push("n"+L),T.push("i"+L);for(var L=0;8>L;++L)T.push("b_ptr"+L);T.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+E.join("*")),M?T.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):T.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else T.push("pivot1","pivot2");if(_.push("var "+T.join(",")),h(1,2),h(4,5),h(1,3),h(2,3),h(1,4),h(3,4),h(2,5),h(2,3),h(4,5),t.length>1?l(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",a("ptr1"),"\n","pivot2[pivot_ptr]=",a("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",a("ptr0"),"\n","y=",a("ptr2"),"\n","z=",a("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",a(o("el2")),"\n","pivot2=",a(o("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",a(o("el1")),"\n","y=",a(o("el3")),"\n","z=",a(o("el5")),"\n",s(o("index1"),"x"),"\n",s(o("index3"),"y"),"\n",s(o("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),g("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),v("k","less","great"),_.push("break"),_.push("}else{"),m("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),g("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--great<k){break}"),_.push("continue"),_.push("}else{"),p("comp","great",1),_.push("if(comp<0){"),v("k","less","great"),_.push("}else{"),m("k","great"),_.push("}"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),y("left","(less-1)",1),y("right","(great+1)",2),b("left","(less-2)"),b("(great+2)","right"),_.push("if(pivots_are_equal){"),f(),_.push("return"),_.push("}"),_.push("if(less<index1&&great>index5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),g("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great<k){break}"),_.push("continue"),_.push("}else{"),p("comp","great",1),_.push("if(comp<0){"),v("k","less","great"),_.push("}else{"),m("k","great"),_.push("}"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),f(),b("less","great"),_.push("}return "+w),t.length>1&&M){var S=new Function("insertionSort","malloc","free",_.join("\n"));return S(r,M[0],M[1])}var S=new Function("insertionSort",_.join("\n"));return S(r)}function s(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];r.push(["function ",n,"(",s.join(","),"){"].join(""));for(var l=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],c=0;c<t.length;++c)l.push(["s",c,"=stride[",c,"]|0,n",c,"=shape[",c,"]|0"].join(""));for(var f=new Array(t.length),h=[],c=0;c<t.length;++c){var d=t[c];0!==d&&(0===h.length?f[d]="1":f[d]=h.join("*"),h.push("n"+d))}for(var p=-1,g=-1,c=0;c<t.length;++c){var v=t[c];0!==v&&(p>0?l.push(["d",v,"=s",v,"-d",p,"*n",p].join("")):l.push(["d",v,"=s",v].join("")),p=v);var d=t.length-1-c;0!==d&&(g>0?l.push(["e",d,"=s",d,"-e",g,"*n",g,",f",d,"=",f[d],"-f",g,"*n",g].join("")):l.push(["e",d,"=s",d,",f",d,"=",f[d]].join("")),g=d)}r.push("var "+l.join(","));var m=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",u,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),b=o(t,e),x=a(t,e,b);return y(b,x)}var l=t("typedarray-pool"),u=32;e.exports=s},{"typedarray-pool":242}],141:[function(t,e,r){"use strict";function n(t){var e=t.order,r=t.dtype,n=[e,r],a=n.join(":"),s=o[a];return s||(o[a]=s=i(e,r)),s(t),t}var i=t("./lib/compile_sort.js"),o={};e.exports=n},{"./lib/compile_sort.js":140}],142:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}",o="precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}";e.exports=function(t){return n(t,i,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":164}],143:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=o({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,f=t.clientHeight,h={view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay;n.idle(e-r),n.flush(e-(100+2*r));var o=e-2*r;n.recalcMatrix(o);for(var a=!0,s=n.computedMatrix,h=0;16>h;++h)a=a&&l[h]===s[h],l[h]=s[h];var d=t.clientWidth===c&&t.clientHeight===f;return c=t.clientWidth,f=t.clientHeight,a?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(h,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){return n.setMode(t),n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return a(t,function(e,r,o,a){var s=1/t.clientHeight,l=s*(r-d),c=s*(o-p),f=h.flipX?1:-1,g=h.flipY?1:-1,v=Math.PI*h.rotateSpeed,m=i();if(1&e)a.shift?n.rotate(m,0,0,-l*v):n.rotate(m,f*v*l,-g*v*c,0);else if(2&e)n.pan(m,-h.translateSpeed*l*u,h.translateSpeed*c*u,0);else if(4&e){var y=h.zoomSpeed*c/window.innerHeight*(m-n.lastT())*50;n.pan(m,0,0,u*(Math.exp(y)-1))}d=r,p=o}),s(t,function(t,e,r){var o=h.flipX?1:-1,a=h.flipY?1:-1,s=i();if(Math.abs(t)>Math.abs(e))n.rotate(s,0,0,-t*o*Math.PI*h.rotateSpeed/window.innerWidth);else{var l=h.zoomSpeed*a*e/window.innerHeight*(s-n.lastT())/100;n.pan(s,0,0,u*(Math.exp(l)-1))}},!0),h}e.exports=n;var i=t("right-now"),o=t("3d-view"),a=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":27,"mouse-change":207,"mouse-wheel":211,"right-now":221}],144:[function(t,e,r){!function(){"use strict";function t(e){e.permitHostObjects___&&e.permitHostObjects___(t)}function r(t){return!(t.substr(0,d.length)==d&&"___"===t.substr(t.length-3))}function n(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[p];if(e&&e.key===t)return e;if(h(t)){e={key:t};try{return f(t,p,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(r){return}}}function i(t){return t.prototype=null,Object.freeze(t)}function o(){y||"undefined"==typeof console||(y=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=t);var a=!1;if("function"==typeof WeakMap){var s=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var l=new s,u=Object.freeze({});if(l.set(u,1),1===l.get(u))return void(e.exports=WeakMap);a=!0}}var c=(Object.prototype.hasOwnProperty,Object.getOwnPropertyNames),f=Object.defineProperty,h=Object.isExtensible,d="weakmap:",p=d+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var g=new ArrayBuffer(25),v=new Uint8Array(g);crypto.getRandomValues(v),p=d+"rand:"+Array.prototype.map.call(v,function(t){return(t%36).toString(36)}).join("")+"___"}if(f(Object,"getOwnPropertyNames",{value:function(t){return c(t).filter(r)}}),"getPropertyNames"in Object){var m=Object.getPropertyNames;f(Object,"getPropertyNames",{value:function(t){return m(t).filter(r)}})}!function(){var t=Object.freeze;f(Object,"freeze",{value:function(e){return n(e),t(e)}});var e=Object.seal;f(Object,"seal",{value:function(t){return n(t),e(t)}});var r=Object.preventExtensions;f(Object,"preventExtensions",{value:function(t){return n(t),r(t)}})}();var y=!1,b=0,x=function(){function t(t,e){var r,i=n(t);return i?u in i?i[u]:e:(r=s.indexOf(t),r>=0?l[r]:e)}function e(t){var e=n(t);return e?u in e:s.indexOf(t)>=0}function r(t,e){var r,i=n(t);return i?i[u]=e:(r=s.indexOf(t),r>=0?l[r]=e:(r=s.length,l[r]=e,s[r]=t)),this}function a(t){var e,r,i=n(t);return i?u in i&&delete i[u]:(e=s.indexOf(t),0>e?!1:(r=s.length-1,s[e]=void 0,l[e]=l[r],s[e]=s[r],s.length=r,l.length=r,!0))}this instanceof x||o();var s=[],l=[],u=b++;return Object.create(x.prototype,{get___:{value:i(t)},has___:{value:i(e)},set___:{value:i(r)},delete___:{value:i(a)}})};x.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},"delete":{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?!function(){function r(){function e(t,e){return c?u.has(t)?u.get(t):c.get___(t,e):u.get(t,e)}function r(t){return u.has(t)||(c?c.has___(t):!1)}function n(t){var e=!!u.delete(t);return c?c.delete___(t)||e:e}this instanceof x||o();var l,u=new s,c=void 0,f=!1;return l=a?function(t,e){return u.set(t,e),u.has(t)||(c||(c=new x),c.set(t,e)),this}:function(t,e){if(f)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___");f=!0})}})}a&&"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)}}()},{}],145:[function(t,e,r){"use strict";function n(t){var e=s.get(t);if(!e||!t.isBuffer(e._triangleBuffer.buffer)){var r=o(t,new Float32Array([-1,-1,-1,4,4,-1]));e=a(t,[{buffer:r,type:t.FLOAT,size:2}]),e._triangleBuffer=r,s.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}var i="undefined"==typeof WeakMap?t("weak-map"):WeakMap,o=t("gl-buffer"),a=t("gl-vao"),s=new i;e.exports=n},{"gl-buffer":105,"gl-vao":192,"weak-map":144}],146:[function(t,e,r){"use strict";function n(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function i(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=c(t)}function o(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function a(t,e,r,n,i){for(var o=t.primalOffset,a=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;3>c;++c)if(e!==c){var f=o,h=s,d=a,p=l;u&1<<c&&(f=s,h=o,d=l,p=a),f[c]=r[0][c],h[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"),f=t("./lib/cube.js"),h=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,o=t[n],a=this[n];(e?Array.isArray(o)&&Array.isArray(o[0]):Array.isArray(o))?this[n]=i=[r(o[0]),r(o[1]),r(o[2])]:this[n]=i=[r(o),r(o),r(o)];for(var s=0;3>s;++s)if(i[s]!==a[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),o=e.bind(this,!1,String),a=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 f=t.bounds,d=0;2>d;++d)for(var p=0;3>p;++p)f[d][p]!==this.bounds[d][p]&&(c=!0),this.bounds[d][p]=f[d][p];if("ticks"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var d=0;3>d;++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=h.create(this.bounds,this.tickSpacing),s=!0),s){for(var d=0;3>d;++d)r[d].sort(function(t,e){return t.x-e.x});h.equal(r,this.ticks)?s=!1:this.ticks=r}i("tickEnable"),o("tickFont")&&(s=!0),n("tickSize"),n("tickAngle"),n("tickPad"),a("tickColor");var g=o("labels");o("labelFont")&&(g=!0),i("labelEnable"),n("labelSize"),n("labelPad"),a("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),a("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),a("lineTickColor"),i("gridEnable"),n("gridWidth"),a("gridColor"),i("zeroEnable"),a("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),a("backgroundColor"),this._text?this._text&&(g||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 g=[new o,new o,new o],v=[0,0,0],m={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||m;for(var e=this.gl,r=t.model||d,i=t.view||d,o=t.projection||d,s=this.bounds,l=f(r,i,o,s),u=l.cubeEdges,c=l.axis,h=i[12],p=i[13],_=i[14],w=i[15],A=this.pixelRatio*(o[3]*h+o[7]*p+o[11]*_+o[15]*w)/e.drawingBufferHeight,M=0;3>M;++M)this.lastCubeProps.cubeEdges[M]=u[M],this.lastCubeProps.axis[M]=c[M];for(var k=g,M=0;3>M;++M)a(g[M],M,this.bounds,u,c);for(var e=this.gl,T=v,M=0;3>M;++M)this.backgroundEnable[M]?T[M]=c[M]:T[M]=0;this._background.draw(r,i,o,s,T,this.backgroundColor),this._lines.bind(r,i,o,this);for(var M=0;3>M;++M){var E=[0,0,0];c[M]>0?E[M]=s[1][M]:E[M]=s[0][M];for(var L=0;2>L;++L){var S=(M+1+L)%3,C=(M+1+(1^L))%3;this.gridEnable[S]&&this._lines.drawGrid(S,C,this.bounds,E,this.gridColor[S],this.gridWidth[S]*this.pixelRatio)}for(var L=0;2>L;++L){var S=(M+1+L)%3,C=(M+1+(1^L))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(S,C,this.bounds,E,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(var M=0;3>M;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,k[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,k[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);for(var P=n(y,k[M].primalMinor),R=n(b,k[M].mirrorMinor),N=this.lineTickLength,L=0;3>L;++L){var z=A/r[5*L];P[L]*=N[L]*z,R[L]*=N[L]*z}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,k[M].primalOffset,P,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,k[M].mirrorOffset,R,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}this._text.bind(r,i,o,this.pixelRatio);for(var M=0;3>M;++M){for(var I=k[M].primalMinor,O=n(x,k[M].primalOffset),L=0;3>L;++L)this.lineTickEnable[M]&&(O[L]+=A*I[L]*Math.max(this.lineTickLength[L],0)/r[5*L]);if(this.tickEnable[M]){for(var L=0;3>L;++L)O[L]+=A*I[L]*this.tickPad[L]/r[5*L];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],O,this.tickColor[M])}if(this.labelEnable[M]){for(var L=0;3>L;++L)O[L]+=A*I[L]*this.labelPad[L]/r[5*L];O[M]+=.5*(s[0][M]+s[1][M]),this._text.drawLabel(M,this.labelSize[M],this.labelAngle[M],O,this.labelColor[M])}}},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":147,"./lib/cube.js":148,"./lib/lines.js":149,"./lib/text.js":151,"./lib/ticks.js":152}],147:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}function i(t){for(var e=[],r=[],i=0,l=0;3>l;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;1>=d;d+=2){r.push(i,i+2,i+1,i+1,i+2,i+3),f[l]=d,h[l]=d;for(var p=-1;1>=p;p+=2){f[u]=p;for(var g=-1;1>=g;g+=2)f[c]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),i+=1}var v=u;u=c,c=v}var m=o(t,new Float32Array(e)),y=o(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=a(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=s(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,m,b,x)}e.exports=i;var o=t("gl-buffer"),a=t("gl-vao"),s=t("./shaders").bg,l=n.prototype;l.draw=function(t,e,r,n,i,o){for(var a=!1,s=0;3>s;++s)a=a||i[s];if(a){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:o},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":150,"gl-buffer":105,"gl-vao":192}],148:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;4>n;++n){t[n]=r[12+n];for(var i=0;3>i;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;e<g.length;++e)if(t=l.positive(t,g[e]),t.length<3)return 0;for(var r=t[0],n=r[0]/r[3],i=r[1]/r[3],o=0,e=1;e+1<t.length;++e){var a=t[e],s=t[e+1],u=a[0]/a[3],c=a[1]/a[3],f=s[0]/s[3],h=s[1]/s[3],d=u-n,p=c-i,v=f-n,m=h-i;o+=Math.abs(d*m-p*v)}return o}function o(t,e,r,o){s(c,e,t),s(c,r,c);for(var l=0,g=0;2>g;++g){d[2]=o[g][2];for(var b=0;2>b;++b){d[1]=o[b][1];for(var x=0;2>x;++x)d[0]=o[x][0],n(f[l],d,c),l+=1}}for(var _=-1,g=0;8>g;++g){for(var w=f[g][3],A=0;3>A;++A)h[g][A]=f[g][A]/w;0>w&&(0>_?_=g:h[g][2]<h[_][2]&&(_=g))}if(0>_){_=0;for(var M=0;3>M;++M){for(var k=(M+2)%3,T=(M+1)%3,E=-1,L=-1,S=0;2>S;++S){var C=S<<M,P=C+(S<<k)+(1-S<<T),R=C+(1-S<<k)+(S<<T);u(h[C],h[P],h[R],p)<0||(S?E=1:L=1)}if(0>E||0>L)L>E&&(_|=1<<M);else{for(var S=0;2>S;++S){var C=S<<M,P=C+(S<<k)+(1-S<<T),R=C+(1-S<<k)+(S<<T),N=i([f[C],f[P],f[R],f[C+(1<<k)+(1<<T)]]);S?E=N:L=N}L>E&&(_|=1<<M)}}}for(var z=7^_,I=-1,g=0;8>g;++g)g!==_&&g!==z&&(0>I?I=g:h[I][1]>h[g][1]&&(I=g));for(var O=-1,g=0;3>g;++g){var j=I^1<<g;if(j!==_&&j!==z){0>O&&(O=j);var T=h[j];T[0]<h[O][0]&&(O=j)}}for(var D=-1,g=0;3>g;++g){var j=I^1<<g;if(j!==_&&j!==z&&j!==O){0>D&&(D=j);var T=h[j];T[0]>h[D][0]&&(D=j)}}var F=v;F[0]=F[1]=F[2]=0,F[a.log2(O^I)]=I&O,F[a.log2(I^D)]=I&D;var B=7^D;B===_||B===z?(B=7^O,F[a.log2(D^B)]=B&D):F[a.log2(O^B)]=B&O;for(var U=m,V=_,M=0;3>M;++M)V&1<<M?U[M]=-1:U[M]=1;return y}e.exports=o;var a=t("bit-twiddle"),s=t("gl-mat4/multiply"),l=(t("gl-mat4/invert"),t("split-polygon")),u=t("robust-orientation"),c=new Array(16),f=(new Array(16),new Array(8)),h=new Array(8),d=new Array(3),p=[0,0,0];!function(){for(var t=0;8>t;++t)f[t]=[1,1,1,1],h[t]=[1,1,1]}();var g=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],v=[1,1,1],m=[0,0,0],y={cubeEdges:v,axis:m}},{"bit-twiddle":38,"gl-mat4/invert":120,"gl-mat4/multiply":122,"robust-orientation":225,"split-polygon":154}],149:[function(t,e,r){"use strict";function n(t){return t[0]=t[1]=t[2]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function o(t,e,r,n,i,o,a,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=o,this.gridCount=a,this.gridOffset=s}function a(t,e,r){var n=[],i=[0,0,0],a=[0,0,0],c=[0,0,0],f=[0,0,0];n.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var h=0;3>h;++h){for(var d=n.length/3|0,p=0;p<r[h].length;++p){var g=+r[h][p].x;n.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}var v=n.length/3|0;i[h]=d,a[h]=v-d;for(var d=n.length/3|0,m=0;m<r[h].length;++m){var g=+r[h][m].x;n.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}var v=n.length/3|0;c[h]=d,f[h]=v-d}var y=s(t,new Float32Array(n)),b=l(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),x=u(t);return x.attributes.position.location=0,new o(t,y,b,x,a,i,f,c)}e.exports=a;var s=t("gl-buffer"),l=t("gl-vao"),u=t("./shaders").line,c=[0,0,0],f=[0,0,0],h=[0,0,0],d=[0,0,0],p=[1,1],g=o.prototype;g.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=p,this.vao.bind()},g.drawAxisLine=function(t,e,r,o,a){var s=n(f);this.shader.uniforms.majorAxis=f,s[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=s;var l=i(d,r);l[t]+=e[0][t],this.shader.uniforms.offset=l,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=o;var u=n(h);u[(t+2)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6);var u=n(h);u[(t+1)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6)},g.drawAxisTicks=function(t,e,r,i,o){if(this.tickCount[t]){var a=n(c);a[t]=1,this.shader.uniforms.majorAxis=a,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=i,this.shader.uniforms.lineWidth=o;var s=n(h);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},g.drawGrid=function(t,e,r,o,a,s){if(this.gridCount[t]){var l=n(f);l[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=l;var u=i(d,o);u[e]+=r[0][e],this.shader.uniforms.offset=u;var p=n(c);p[t]=1,this.shader.uniforms.majorAxis=p;var g=n(h);g[t]=1,this.shader.uniforms.screenAxis=g,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=a,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},g.drawZero=function(t,e,r,o,a,s){var l=n(f);this.shader.uniforms.majorAxis=l,l[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=l;var u=i(d,o);u[t]+=r[0][t],this.shader.uniforms.offset=u;var c=n(h);c[e]=1,this.shader.uniforms.screenAxis=c,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=a,this.vao.draw(this.gl.TRIANGLES,6)},g.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{"./shaders":150,"gl-buffer":105,"gl-vao":192}],150:[function(t,e,r){"use strict";var n=t("gl-shader"),i="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * view * model * vec4(p, 1.0);\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n vec3 major = position.x * majorAxis;\n vec3 minor = position.y * minorAxis;\n\n vec3 vPosition = major + minor + offset;\n vec3 pPosition = project(vPosition);\n vec3 offset = project(vPosition + screenAxis * position.z);\n\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n",o="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}";r.line=function(t){return n(t,i,o,null,[{name:"position",type:"vec3"}])};var a="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvoid main() { \n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n mat2 planeXform = scale * mat2(cos(angle), sin(angle),\n -sin(angle), cos(angle));\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n vec4 worldPosition = model * vec4(dataPosition, 1);\n \n //Compute clip position\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n //Apply text offset in clip coordinates\n clipPosition += vec4(viewOffset, 0, 0);\n\n //Done\n gl_Position = clipPosition;\n}",s="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}";r.text=function(t){return n(t,a,s,null,[{name:"position",type:"vec3"}])};var l="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n if(dot(normal, enable) > 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}",u="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}";r.bg=function(t){return n(t,l,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":164}],151:[function(t,e,r){(function(r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function i(t,e){try{return l(t,e)}catch(r){return console.warn("error vectorizing text:",r),{cells:[],positions:[]}}}function o(t,e,r,i,o,l){var c=a(t),f=s(t,[{buffer:c,size:3}]),h=u(t);h.attributes.position.location=0;var d=new n(t,h,c,f);return d.update(e,r,i,o,l),d}e.exports=o;var a=t("gl-buffer"),s=t("gl-vao"),l=t("vectorize-text"),u=t("./shaders").text,c=window||r.global||{},f=c.__TEXT_CACHE||{};c.__TEXT_CACHE={};var h=3,d=n.prototype,p=[0,0];d.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=p},d.update=function(t,e,r,n,o){function a(t,e,r,n){var o=f[r];o||(o=f[r]={});var a=o[e];a||(a=o[e]=i(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=a.positions,c=a.cells,h=0,d=c.length;d>h;++h)for(var p=c[h],g=2;g>=0;--g){var v=u[p[g]];s.push(l*v[0],-l*v[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],u=[0,0,0],c=[0,0,0],d=[0,0,0],p=0;3>p;++p){c[p]=s.length/h|0,a(.5*(t[0][p]+t[1][p]),e[p],r),d[p]=(s.length/h|0)-c[p],l[p]=s.length/h|0;for(var g=0;g<n[p].length;++g)n[p][g].text&&a(n[p][g].x,n[p][g].text,n[p][g].font||o,n[p][g].fontSize||12);u[p]=(s.length/h|0)-l[p]}this.buffer.update(s),this.tickOffset=l,this.tickCount=u,this.labelOffset=c,this.labelCount=d};var g=[0,0,0];d.drawTicks=function(t,e,r,n,i){if(this.tickCount[t]){var o=g;o[0]=o[1]=o[2]=0,o[t]=1,this.shader.uniforms.axis=o,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}};var v=[0,0,0];d.drawLabel=function(t,e,r,n,i){this.labelCount[t]&&(this.shader.uniforms.axis=v,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},d.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t("_process"))},{"./shaders":150,_process:44,"gl-buffer":105,"gl-vao":192,"vectorize-text":244}],152:[function(t,e,r){"use strict";function n(t,e){var r=t+"",n=r.indexOf("."),i=0;n>=0&&(i=r.length-n-1);var o=Math.pow(10,i),a=Math.round(t*e*o),s=a+"";if(s.indexOf("e")>=0)return s;var l=a/o,u=a%o;0>a?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u=0|u);var c=""+l;if(0>a&&(c="-"+c),i){for(var f=""+u;f.length<i;)f="0"+f;return c+"."+f}return c}function i(t,e){for(var r=[],i=0;3>i;++i){for(var o=[],a=(.5*(t[0][i]+t[1][i]),0);a*e[i]<=t[1][i];++a)o.push({x:a*e[i],text:n(e[i],a)});for(var a=-1;a*e[i]>=t[0][i];--a)o.push({x:a*e[i],text:n(e[i],a)});r.push(o)}return r}function o(t,e){for(var r=0;3>r;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var i=t[r][n],o=e[r][n];if(i.x!==o.x||i.text!==o.text)return!1}}return!0}r.create=i,r.equal=o},{}],153:[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},{}],154:[function(t,e,r){"use strict";function n(t,e){var r=u(l(t,e),[e[e.length-1]]);return r[r.length-1]}function i(t,e,r,n){var i=n-e,o=-e/i;0>o?o=0:o>1&&(o=1);for(var a=1-o,s=t.length,l=new Array(s),u=0;s>u;++u)l[u]=o*t[u]+a*r[u];return l}function o(t,e){for(var r=[],o=[],a=n(t[t.length-1],e),s=t[t.length-1],l=t[0],u=0;u<t.length;++u,s=l){l=t[u];var c=n(l,e);if(0>a&&c>0||a>0&&0>c){var f=i(s,c,l,a);r.push(f),o.push(f.slice())}0>c?o.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),o.push(l.slice())),a=c}return{positive:r,negative:o}}function a(t,e){for(var r=[],o=n(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l<t.length;++l,a=s){s=t[l];var u=n(s,e);(0>o&&u>0||o>0&&0>u)&&r.push(i(a,u,s,o)),u>=0&&r.push(s.slice()),o=u}return r}function s(t,e){for(var r=[],o=n(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l<t.length;++l,a=s){s=t[l];var u=n(s,e);(0>o&&u>0||o>0&&0>u)&&r.push(i(a,u,s,o)),0>=u&&r.push(s.slice()),o=u}return r}var l=t("robust-dot-product"),u=t("robust-sum");e.exports=o,e.exports.positive=a,e.exports.negative=s},{"robust-dot-product":155,"robust-sum":228}],155:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t[0],e[0]),n=1;n<t.length;++n)r=o(r,i(t[n],e[n]));return r}var i=t("two-product"),o=t("robust-sum");e.exports=n},{"robust-sum":228,"two-product":240}],156:[function(t,e,r){"use strict";function n(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}function i(t,e,r,n,i){for(var o=0;3>o;++o){for(var a=p,s=g,l=0;3>l;++l)s[l]=a[l]=r[l];s[3]=a[3]=1,s[o]+=1,f(s,s,e),s[3]<0&&(t[o]=1/0),a[o]-=1,f(a,a,e),a[3]<0&&(t[o]=1/0);var u=(a[0]/a[3]-s[0]/s[3])*n,c=(a[1]/a[3]-s[1]/s[3])*i;t[o]=.25*Math.sqrt(u*u+c*c)}return t}function o(t,e,r,n,o){var f=e.model||h,p=e.view||h,g=e.projection||h,y=t.bounds,o=o||l(f,p,g,y),b=o.axis;o.edges;u(d,p,f),u(d,g,d);for(var x=v,_=0;3>_;++_)x[_].lo=1/0,x[_].hi=-(1/0),x[_].pixelsPerDataUnit=1/0;var w=a(c(d,d));c(d,d);for(var A=0;3>A;++A){var M=(A+1)%3,k=(A+2)%3,T=m;t:for(var _=0;2>_;++_){var E=[];if(b[A]<0!=!!_){T[A]=y[_][A];for(var L=0;2>L;++L){T[M]=y[L^_][M];for(var S=0;2>S;++S)T[k]=y[S^L^_][k],E.push(T.slice())}for(var L=0;L<w.length;++L){if(0===E.length)continue t;E=s.positive(E,w[L])}for(var L=0;L<E.length;++L)for(var k=E[L],C=i(m,d,k,r,n),S=0;3>S;++S)x[S].lo=Math.min(x[S].lo,k[S]),x[S].hi=Math.max(x[S].hi,k[S]),S!==A&&(x[S].pixelsPerDataUnit=Math.min(x[S].pixelsPerDataUnit,Math.abs(C[S])))}}}return x}e.exports=o;var a=t("extract-frustum-planes"),s=t("split-polygon"),l=t("./lib/cube.js"),u=t("gl-mat4/multiply"),c=t("gl-mat4/transpose"),f=t("gl-vec4/transformMat4"),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=new Float32Array(16),p=[0,0,0,1],g=[0,0,0,1],v=[new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0)],m=[0,0,0]},{"./lib/cube.js":148,"extract-frustum-planes":153,"gl-mat4/multiply":122,"gl-mat4/transpose":130,"gl-vec4/transformMat4":193,"split-polygon":154}],157:[function(t,e,r){"use strict";var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}";e.exports=function(t){return n(t,i,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":164}],158:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,o,a){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=o,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=o(t,i),u=a(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=s(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var f=new n(t,l,u,c);return f.update(e),f}var o=t("gl-buffer"),a=t("gl-vao"),s=t("./shaders/index");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=n.prototype,c=[0,0,0],f=[0,0,0],h=[0,0];u.isTransparent=function(){return!1},u.drawTransparent=function(t){},u.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,o=t.model||l,a=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var u=c,d=f,p=0;3>p;++p)i&&i[p]<0?(u[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(u[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=o,n.uniforms.view=a,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,u,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=h;for(var p=0;3>p;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},u.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},u.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":157,"gl-buffer":105,"gl-vao":192}],159:[function(t,e,r){"use strict";function n(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function i(t,e){var r=null;try{r=t.getContext("webgl",e),r||(r=t.getContext("experimental-webgl",e))}catch(n){return null}return r}function o(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(0>e){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function a(t){return"boolean"==typeof t?t:!0}function s(t){function e(){if(!_&&H.autoResize){var t=w.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*H.pixelRatio),i=0|Math.ceil(r*H.pixelRatio);if(n!==w.width||i!==w.height){w.width=n,w.height=i;var o=w.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=e+"px",o.height=r+"px",D=!0}}}function r(){for(var t=z.length,e=j.length,r=0;e>r;++r)O[r]=0;t:for(var r=0;t>r;++r){var n=z[r],i=n.pickSlots;if(i){for(var o=0;e>o;++o)if(O[o]+i<255){I[r]=o,n.setPickBase(O[o]+1),O[o]+=i;continue t}var a=h(M,q);I[r]=e,j.push(a),O.push(i),n.setPickBase(1),e+=1}else I[r]=-1}for(;e>0&&0===O[e-1];)O.pop(),j.pop().dispose()}function s(){return H.contextLost?!0:void(M.isContextLost()&&(H.contextLost=!0,H.mouseListener.enabled=!1,H.selection.object=null,H.oncontextloss&&H.oncontextloss()))}function y(){if(!s()){M.colorMask(!0,!0,!0,!0),M.depthMask(!0),M.disable(M.BLEND),M.enable(M.DEPTH_TEST);for(var t=z.length,e=j.length,r=0;e>r;++r){var n=j[r];n.shape=G,n.begin();for(var i=0;t>i;++i)if(I[i]===r){var o=z[i];o.drawPick&&(o.pixelRatio=1,o.drawPick(V))}n.end()}}}function b(){if(!s()){e();var t=H.camera.tick();V.view=H.camera.matrix,D=D||t,F=F||t,P.pixelRatio=H.pixelRatio,N.pixelRatio=H.pixelRatio;var r=z.length,n=W[0],i=W[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-(1/0);for(var a=0;r>a;++a){var l=z[a];l.pixelRatio=H.pixelRatio,l.axes=H.axes,D=D||!!l.dirty,F=F||!!l.dirty;var u=l.bounds;if(u)for(var f=u[0],h=u[1],d=0;3>d;++d)n[d]=Math.min(n[d],f[d]),i[d]=Math.max(i[d],h[d])}var g=H.bounds;if(H.autoBounds)for(var d=0;3>d;++d){if(i[d]<n[d])n[d]=-1,i[d]=1;else{n[d]===i[d]&&(n[d]-=1,i[d]+=1);var m=.05*(i[d]-n[d]);n[d]=n[d]-m,i[d]=i[d]+m}g[0][d]=n[d],g[1][d]=i[d]}for(var b=!1,d=0;3>d;++d)b=b||Z[0][d]!==g[0][d]||Z[1][d]!==g[1][d],Z[0][d]=g[0][d],Z[1][d]=g[1][d];if(b){for(var x=[0,0,0],a=0;3>a;++a)x[a]=o((g[1][a]-g[0][a])/10);P.autoTicks?P.update({bounds:g,tickSpacing:x}):P.update({bounds:g})}F=F||b,D=D||b;var _=M.drawingBufferWidth,w=M.drawingBufferHeight;q[0]=_,q[1]=w,G[0]=0|Math.max(_/H.pixelRatio,1),G[1]=0|Math.max(w/H.pixelRatio,1),v(B,H.fovy,_/w,H.zNear,H.zFar);for(var a=0;16>a;++a)U[a]=0;U[15]=1;for(var A=0,a=0;3>a;++a)A=Math.max(A,g[1][a]-g[0][a]);for(var a=0;3>a;++a)H.autoScale?U[5*a]=H.aspect[a]/(g[1][a]-g[0][a]):U[5*a]=1/A,H.autoCenter&&(U[12+a]=.5*-U[5*a]*(g[0][a]+g[1][a]));for(var a=0;r>a;++a){var l=z[a];l.axesBounds=g,H.clipToBounds&&(l.clipBounds=g)}if(T.object&&(H.snapToData?N.position=T.dataCoordinate:N.position=T.dataPosition,N.bounds=g),F&&(F=!1,y()),D){H.axesPixels=c(H.axes,V,_,w),H.onrender&&H.onrender(),M.bindFramebuffer(M.FRAMEBUFFER,null),M.viewport(0,0,_,w);var k=H.clearColor;M.clearColor(k[0],k[1],k[2],k[3]),M.clear(M.COLOR_BUFFER_BIT|M.DEPTH_BUFFER_BIT),M.depthMask(!0),M.colorMask(!0,!0,!0,!0),M.enable(M.DEPTH_TEST),M.depthFunc(M.LEQUAL),M.disable(M.BLEND),M.disable(M.CULL_FACE);var S=!1;P.enable&&(S=S||P.isTransparent(),P.draw(V)),N.axes=P,T.object&&N.draw(V),M.disable(M.CULL_FACE);for(var a=0;r>a;++a){var l=z[a];l.axes=P,l.pixelRatio=H.pixelRatio,l.isOpaque&&l.isOpaque()&&l.draw(V),l.isTransparent&&l.isTransparent()&&(S=!0)}if(S){E.shape=q,E.bind(),M.clear(M.DEPTH_BUFFER_BIT),M.colorMask(!1,!1,!1,!1),M.depthMask(!0),M.depthFunc(M.LESS),P.enable&&P.isTransparent()&&P.drawTransparent(V);for(var a=0;r>a;++a){var l=z[a];l.isOpaque&&l.isOpaque()&&l.draw(V)}M.enable(M.BLEND),M.blendEquation(M.FUNC_ADD),M.blendFunc(M.ONE,M.ONE_MINUS_SRC_ALPHA),M.colorMask(!0,!0,!0,!0),M.depthMask(!1),M.clearColor(0,0,0,0),M.clear(M.COLOR_BUFFER_BIT),P.isTransparent()&&P.drawTransparent(V);for(var a=0;r>a;++a){var l=z[a];l.isTransparent&&l.isTransparent()&&l.drawTransparent(V)}M.bindFramebuffer(M.FRAMEBUFFER,null),M.blendFunc(M.ONE,M.ONE_MINUS_SRC_ALPHA),M.disable(M.DEPTH_TEST),L.bind(),E.color[0].bind(0),L.uniforms.accumBuffer=0,p(M),M.disable(M.BLEND)}D=!1;for(var a=0;r>a;++a)z[a].dirty=!1}}}function x(){_||H.contextLost||(requestAnimationFrame(x),b())}t=t||{};var _=!1,w=(t.pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);if(!w)if(w=document.createElement("canvas"),t.container){var A=t.container;A.appendChild(w)}else document.body.appendChild(w);var M=t.gl;if(M||(M=i(w,t.glOptions||{premultipliedAlpha:!0,antialias:!0})),!M)throw new Error("webgl not supported");var k=t.bounds||[[-10,-10,-10],[10,10,10]],T=new n,E=d(M,[M.drawingBufferWidth,M.drawingBufferHeight],{preferFloat:!0}),L=m(M),S=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:"turntable"},C=t.axes||{},P=u(M,C);P.enable=!C.disable;var R=t.spikes||{},N=f(M,R),z=[],I=[],O=[],j=[],D=!0,F=!0,B=new Array(16),U=new Array(16),V={view:null,projection:B,model:U},F=!0,q=[M.drawingBufferWidth,M.drawingBufferHeight],H={gl:M,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:w,selection:T,camera:l(w,S),axes:P,axesPixels:null,spikes:N,bounds:k,objects:z,shape:q,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:a(t.autoResize),autoBounds:a(t.autoBounds),autoScale:!!t.autoScale,autoCenter:a(t.autoCenter),clipToBounds:a(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:V,oncontextloss:null,mouseListener:null},G=[M.drawingBufferWidth/H.pixelRatio|0,M.drawingBufferHeight/H.pixelRatio|0];H.autoResize&&e(),window.addEventListener("resize",e),H.update=function(t){_||(t=t||{},D=!0,F=!0)},H.add=function(t){_||(t.axes=P,z.push(t),I.push(-1),D=!0,F=!0,r())},H.remove=function(t){if(!_){var e=z.indexOf(t);0>e||(z.splice(e,1),I.pop(),D=!0,F=!0,r())}},H.dispose=function(){if(!_&&(_=!0,window.removeEventListener("resize",e),w.removeEventListener("webglcontextlost",s),H.mouseListener.enabled=!1,!H.contextLost)){P.dispose(),N.dispose();for(var t=0;t<z.length;++t)z[t].dispose();E.dispose();for(var t=0;t<j.length;++t)j[t].dispose();L.dispose(),M=null,P=null,N=null,z=[]}};var X=!1,Y=0;H.mouseListener=g(w,function(t,e,r){if(!_){var n=j.length,i=z.length,o=T.object;T.distance=1/0,T.mouse[0]=e,T.mouse[1]=r,T.object=null,T.screen=null,T.dataCoordinate=T.dataPosition=null;var a=!1;if(t&&Y)X=!0;else{X&&(F=!0),X=!1;for(var s=0;n>s;++s){var l=j[s].query(e,G[1]-r-1,H.pickRadius);if(l){if(l.distance>T.distance)continue;for(var u=0;i>u;++u){var c=z[u];if(I[u]===s){var f=c.pick(l);f&&(T.buttons=t,T.screen=l.coord,T.distance=l.distance,T.object=c,T.index=f.distance,T.dataPosition=f.position,T.dataCoordinate=f.dataCoordinate,T.data=f,a=!0)}}}}}o&&o!==T.object&&(o.highlight&&o.highlight(null),D=!0),T.object&&(T.object.highlight&&T.object.highlight(T.data),D=!0),a=a||T.object!==o,a&&H.onselect&&H.onselect(T),1&t&&!(1&Y)&&H.onclick&&H.onclick(T),Y=t}}),w.addEventListener("webglcontextlost",s);var W=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],Z=[W[0].slice(),W[1].slice()];return x(),H.redraw=function(){_||(D=!0,b())},H}e.exports=s;var l=t("3d-view-controls"),u=t("gl-axes3d"),c=t("gl-axes3d/properties"),f=t("gl-spikes3d"),h=t("gl-select-static"),d=t("gl-fbo"),p=t("a-big-triangle"),g=t("mouse-change"),v=t("gl-mat4/perspective"),m=t("./lib/shader")},{"./lib/shader":142,"3d-view-controls":143,"a-big-triangle":145,"gl-axes3d":146,"gl-axes3d/properties":156,"gl-fbo":108,"gl-mat4/perspective":123,"gl-select-static":163,"gl-spikes3d":158,"mouse-change":207}],160:[function(t,e,r){"use strict";function n(t,e){var r=o[e];if(r||(r=o[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),a=i(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-(1/0),-(1/0)]],l=0;l<n.positions.length;++l)for(var u=n.positions[l],c=0;2>c;++c)s[0][c]=Math.min(s[0][c],u[c]),s[1][c]=Math.max(s[1][c],u[c]);
return r[t]=[a,n,s]}var i=t("vectorize-text");e.exports=n;var o={}},{"vectorize-text":244}],161:[function(t,e,r){function n(t,e){var r=i(t,e),n=r.attributes;return n.position.location=0,n.color.location=1,n.glyph.location=2,n.id.location=3,r}var i=t("gl-shader"),o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n \n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",a="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n \n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",s="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) ||\n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n",l="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) ||\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = interpColor * opacity;\n }\n}\n",u="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) || \n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n }\n}",c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:o,fragment:l,attributes:c},h={vertex:a,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:o,fragment:u,attributes:c},g={vertex:a,fragment:u,attributes:c},v={vertex:s,fragment:u,attributes:c};r.createPerspective=function(t){return n(t,f)},r.createOrtho=function(t){return n(t,h)},r.createProject=function(t){return n(t,d)},r.createPickPerspective=function(t){return n(t,p)},r.createPickOrtho=function(t){return n(t,g)},r.createPickProject=function(t){return n(t,v)}},{"gl-shader":164}],162:[function(t,e,r){"use strict";function n(t,e){var r=t[0],n=t[1],i=t[2],o=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*o,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*o,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*o,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*o,t}function i(t,e,r,i){return n(i,i,r),n(i,i,e),n(i,i,t)}function o(t,e){this.index=t,this.dataCoordinate=this.position=e}function a(t,e,r,n,i,a,s,l,u,c,f,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=s,this.idBuffer=l,this.vao=u,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=f,this.pickProjectShader=h,this.points=[],this._selectResult=new o(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.dirty=!0}function s(t){return t[0]=t[1]=t[2]=0,t}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function u(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function c(t){for(var e=S,r=0;2>r;++r)for(var n=0;3>n;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}function f(t,e,r,n,o){var a,f=e.axesProject,h=e.gl,d=t.uniforms,p=r.model||x,g=r.view||x,v=r.projection||x,y=e.axesBounds,b=c(e.clipBounds);a=e.axes?e.axes.lastCubeProps.axis:[1,1,1],w[0]=2/h.drawingBufferWidth,w[1]=2/h.drawingBufferHeight,t.bind(),d.view=g,d.projection=v,d.screenSize=w,d.highlightId=e.highlightId,d.highlightScale=e.highlightScale,d.clipBounds=b,d.pickGroup=e.pickId/255,d.pixelRatio=e.pixelRatio;for(var _=0;3>_;++_)if(f[_]&&e.projectOpacity[_]<1===n){d.scale=e.projectScale[_],d.opacity=e.projectOpacity[_];for(var S=E,C=0;16>C;++C)S[C]=0;for(var C=0;4>C;++C)S[5*C]=1;S[5*_]=0,a[_]<0?S[12+_]=y[0][_]:S[12+_]=y[1][_],m(S,p,S),d.model=S;var P=(_+1)%3,R=(_+2)%3,N=s(A),z=s(M);N[P]=1,z[R]=1;var I=i(v,g,p,l(k,N)),O=i(v,g,p,l(T,z));if(Math.abs(I[1])>Math.abs(O[1])){var j=I;I=O,O=j,j=N,N=z,z=j;var D=P;P=R,R=D}I[0]<0&&(N[P]=-1),O[1]>0&&(z[R]=-1);for(var F=0,B=0,C=0;4>C;++C)F+=Math.pow(p[4*P+C],2),B+=Math.pow(p[4*R+C],2);N[P]/=Math.sqrt(F),z[R]/=Math.sqrt(B),d.axes[0]=N,d.axes[1]=z,d.fragClipBounds[0]=u(L,b[0],_,-1e8),d.fragClipBounds[1]=u(L,b[1],_,1e8),e.vao.draw(h.TRIANGLES,e.vertexCount),e.lineWidth>0&&(h.lineWidth(e.lineWidth),e.vao.draw(h.LINES,e.lineVertexCount,e.vertexCount))}}function h(t,e,r,n,i,o){var a=r.gl;if(r.vao.bind(),i===r.opacity<1||o){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/a.drawingBufferWidth,w[1]=2/a.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=R,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(a.TRIANGLES,r.vertexCount),r.lineWidth>0&&(a.lineWidth(r.lineWidth),r.vao.draw(a.LINES,r.lineVertexCount,r.vertexCount))}f(e,r,n,i,o),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),o=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),f=p(e),h=p(e),d=g(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:f,size:2,type:e.FLOAT},{buffer:h,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new a(e,r,n,i,u,c,f,h,d,o,s,l);return v.update(t),v}var p=t("gl-buffer"),g=t("gl-vao"),v=t("typedarray-pool"),m=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 _=a.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;3>t;++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;3>t;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],A=[0,0,0],M=[0,0,0],k=[0,0,0,1],T=[0,0,0,1],E=x.slice(),L=[0,0,0],S=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],P=[1e8,1e8,1e8],R=[C,P];_.draw=function(t){var e=this.useOrtho?this.orthoShader:this.shader;h(e,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){var e=this.useOrtho?this.orthoShader:this.shader;h(e,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){var e=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;h(e,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||0>e)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;3>i;++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",o=t.alignment||[0,0],a=[1/0,1/0,1/0],s=[-(1/0),-(1/0),-(1/0)],l=t.glyph,u=t.color,c=t.size,f=t.angle,h=t.lineColor,d=0,p=0,g=0,m=n.length;t:for(var y=0;m>y;++y){for(var x=n[y],_=0;3>_;++_)if(isNaN(x[_])||!isFinite(x[_]))continue t;var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var A=w[0],M=w[1],k=w[2];p+=3*A.cells.length,g+=2*M.edges.length}var T=p+g,E=v.mallocFloat(3*T),L=v.mallocFloat(4*T),S=v.mallocFloat(2*T),C=v.mallocUint32(T),P=[0,o[1]],R=0,N=p,z=[0,0,0,1],I=[0,0,0,1],O=Array.isArray(u)&&Array.isArray(u[0]),j=Array.isArray(h)&&Array.isArray(h[0]);t:for(var y=0;m>y;++y){for(var x=n[y],_=0;3>_;++_){if(isNaN(x[_])||!isFinite(x[_])){d+=1;continue t}s[_]=Math.max(s[_],x[_]),a[_]=Math.min(a[_],x[_])}var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var A=w[0],M=w[1],k=w[2];if(Array.isArray(u)){var D;if(D=O?u[y]:u,3===D.length){for(var _=0;3>_;++_)z[_]=D[_];z[3]=1}else if(4===D.length)for(var _=0;4>_;++_)z[_]=D[_]}else z[0]=z[1]=z[2]=0,z[3]=1;if(Array.isArray(h)){var D;if(D=j?h[y]:h,3===D.length){for(var _=0;3>_;++_)I[_]=D[_];I[_]=1}else if(4===D.length)for(var _=0;4>_;++_)I[_]=D[_]}else I[0]=I[1]=I[2]=0,I[3]=1;var F=.5;Array.isArray(c)?F=+c[y]:c?F=+c:this.useOrtho&&(F=12);var B=0;Array.isArray(f)?B=+f[y]:f&&(B=+f);for(var U=Math.cos(B),V=Math.sin(B),x=n[y],_=0;3>_;++_)s[_]=Math.max(s[_],x[_]),a[_]=Math.min(a[_],x[_]);o[0]<0?P[0]=o[0]*(1+k[1][0]):o[0]>0&&(P[0]=-o[0]*(1+k[0][0]));for(var q=A.cells,H=A.positions,_=0;_<q.length;++_)for(var G=q[_],X=0;3>X;++X){for(var Y=0;3>Y;++Y)E[3*R+Y]=x[Y];for(var Y=0;4>Y;++Y)L[4*R+Y]=z[Y];C[R]=d;var W=H[G[X]];S[2*R]=F*(U*W[0]-V*W[1]+P[0]),S[2*R+1]=F*(V*W[0]+U*W[1]+P[1]),R+=1}for(var q=M.edges,H=M.positions,_=0;_<q.length;++_)for(var G=q[_],X=0;2>X;++X){for(var Y=0;3>Y;++Y)E[3*N+Y]=x[Y];for(var Y=0;4>Y;++Y)L[4*N+Y]=I[Y];C[N]=d;var W=H[G[X]];S[2*N]=F*(U*W[0]-V*W[1]+P[0]),S[2*N+1]=F*(V*W[0]+U*W[1]+P[1]),N+=1}d+=1}this.vertexCount=p,this.lineVertexCount=g,this.pointBuffer.update(E),this.colorBuffer.update(L),this.glyphBuffer.update(S),this.idBuffer.update(new Uint32Array(C)),v.free(E),v.free(L),v.free(S),v.free(C),this.bounds=[a,s],this.points=n,this.pointCount=n.length}},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{"./lib/glyphs":160,"./lib/shaders":161,"gl-buffer":105,"gl-mat4/multiply":122,"gl-vao":192,"typedarray-pool":242}],163:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function i(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function o(t,e){var r=a(t,e),n=s.mallocUint8(e[0]*e[1]*4);return new i(t,r,n)}e.exports=o;var a=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),u=t("bit-twiddle").nextPow2,c=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(255>_inline_52_arg0_||255>_inline_52_arg1_||255>_inline_52_arg2_||255>_inline_52_arg3_){var _inline_52_l=_inline_52_arg4_-_inline_52_arg6_[0],_inline_52_a=_inline_52_arg5_-_inline_52_arg6_[1],_inline_52_f=_inline_52_l*_inline_52_l+_inline_52_a*_inline_52_a;_inline_52_f<this_closestD2&&(this_closestD2=_inline_52_f,this_closestX=_inline_52_arg6_[0],this_closestY=_inline_52_arg6_[1])}}",args:[{name:"_inline_52_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_52_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_52_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_52_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_52_arg4_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_52_arg5_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_52_arg6_",lvalue:!1,rvalue:!0,count:4}],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:["_inline_52_a","_inline_52_f","_inline_52_l"]},post:{body:"{return[this_closestX,this_closestY,this_closestD2]}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},debug:!1,funcName:"cwise",blockSize:64}),f=i.prototype;Object.defineProperty(f,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;r*e*4>i;++i)n[i]=255}return t}}}),f.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},f.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},f.query=function(t,e,r){if(!this.gl)return null;var i=this.fbo.shape.slice();t=0|t,e=0|e,"number"!=typeof r&&(r=1);var o=0|Math.min(Math.max(t-r,0),i[0]),a=0|Math.min(Math.max(t+r,0),i[0]),s=0|Math.min(Math.max(e-r,0),i[1]),u=0|Math.min(Math.max(e+r,0),i[1]);if(o>=a||s>=u)return null;var f=[a-o,u-s],h=l(this.buffer,[f[0],f[1],4],[4,4*i[0],1],4*(o+i[0]*s)),d=c(h.hi(f[0],f[1],1),r,r),p=d[0],g=d[1];if(0>p||Math.pow(this.radius,2)<d[2])return null;var v=h.get(p,g,0),m=h.get(p,g,1),y=h.get(p,g,2),b=h.get(p,g,3);return new n(p+o|0,g+s|0,v,[m,y,b],Math.sqrt(d[2]))},f.dispose=function(){this.gl&&(this.fbo.dispose(),s.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":38,"cwise/lib/wrapper":99,"gl-fbo":108,ndarray:219,"typedarray-pool":242}],164:[function(t,e,r){"use strict";function n(t){this.gl=t,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 o(t,e,r,i,o){var a=new n(t);return a.update(e,r,i,o),a}var a=t("./lib/create-uniforms"),s=t("./lib/create-attributes"),l=t("./lib/reflect"),u=t("./lib/shader-cache"),c=t("./lib/runtime-reflect"),f=t("./lib/GLError"),h=n.prototype;h.bind=function(){this.program||this._relink(),this.gl.useProgram(this.program)},h.dispose=function(){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},h.update=function(t,e,r,n){function o(){d.program=u.program(p,d._vref,d._fref,x,_);for(var t=0;t<r.length;++t)L[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var h=t;t=h.vertex,e=h.fragment,r=h.uniforms,n=h.attributes}var d=this,p=d.gl,g=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),g&&g.dispose(),d.vertShader=d._vref.shader;var v=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),v&&v.dispose(),d.fragShader=d._fref.shader,!r||!n){var m=p.createProgram();if(p.attachShader(m,d.fragShader),p.attachShader(m,d.vertShader),p.linkProgram(m),!p.getProgramParameter(m,p.LINK_STATUS)){var y=p.getProgramInfoLog(m);throw new f(y,"Error linking program:"+y)}r=r||c.uniforms(p,m),n=n||c.attributes(p,m),p.deleteProgram(m)}n=n.slice(),n.sort(i);for(var b=[],x=[],_=[],w=0;w<n.length;++w){var A=n[w];if(A.type.indexOf("mat")>=0){for(var M=0|A.type.charAt(A.type.length-1),k=new Array(M),T=0;M>T;++T)k[T]=_.length,x.push(A.name+"["+T+"]"),"number"==typeof A.location?_.push(A.location+T):Array.isArray(A.location)&&A.location.length===M&&"number"==typeof A.location[T]?_.push(0|A.location[T]):_.push(-1);b.push({name:A.name,type:A.type,locations:k})}else b.push({name:A.name,type:A.type,locations:[_.length]}),x.push(A.name),"number"==typeof A.location?_.push(0|A.location):_.push(-1)}for(var E=0,w=0;w<_.length;++w)if(_[w]<0){for(;_.indexOf(E)>=0;)E+=1;_[w]=E}var L=new Array(r.length);o(),d._relink=o,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",a(p,d,r,L))},e.exports=o},{"./lib/GLError":165,"./lib/create-attributes":166,"./lib/create-uniforms":167,"./lib/reflect":168,"./lib/runtime-reflect":169,"./lib/shader-cache":170}],165:[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},{}],166:[function(t,e,r){"use strict";function n(t,e,r,n,i,o){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=o}function i(t,e,r,i,o,a,s){for(var l=["gl","v"],u=[],c=0;o>c;++c)l.push("x"+c),u.push("x"+c);l.push("if(x0.length===void 0){return gl.vertexAttrib"+o+"f(v,"+u.join()+")}else{return gl.vertexAttrib"+o+"fv(v,x0)}");var f=Function.apply(null,l),h=new n(t,e,r,i,o,f);Object.defineProperty(a,s,{set:function(e){return t.disableVertexAttribArray(i[r]),f(t,i[r],e),e},get:function(){return h},enumerable:!0})}function o(t,e,r,n,o,a,s){for(var l=new Array(o),u=new Array(o),c=0;o>c;++c)i(t,e,r[c],n,o,l,c),u[c]=l[c];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;o>e;++e)u[e].location=t[e];else for(var e=0;o>e;++e)u[e].location=t+e;return t},get:function(){for(var t=new Array(o),e=0;o>e;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,a,s){e=e||t.FLOAT,i=!!i,a=a||o*o,s=s||0;for(var l=0;o>l;++l){var u=n[r[l]];t.vertexAttribPointer(u,o,e,i,a,s+l*o),t.enableVertexAttribArray(u)}};var f=new Array(o),h=t["vertexAttrib"+o+"fv"];Object.defineProperty(a,s,{set:function(e){for(var i=0;o>i;++i){var a=n[r[i]];if(t.disableVertexAttribArray(a),Array.isArray(e[0]))h.call(t,a,e[i]);else{for(var s=0;o>s;++s)f[s]=e[o*i+s];h.call(t,a,f)}}return e},get:function(){return l},enumerable:!0})}function a(t,e,r,n){for(var a={},l=0,u=r.length;u>l;++l){var c=r[l],f=c.name,h=c.type,d=c.locations;switch(h){case"bool":case"int":case"float":i(t,e,d[0],n,1,a,f);break;default:if(h.indexOf("vec")>=0){var p=h.charCodeAt(h.length-1)-48;if(2>p||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);i(t,e,d[0],n,p,a,f)}else{if(!(h.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+f+": "+h);var p=h.charCodeAt(h.length-1)-48;if(2>p||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);o(t,e,d,n,p,a,f)}}}return a}e.exports=a;var s=t("./GLError"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,o=i._gl,a=i._locations[i._index];o.vertexAttribPointer(a,i._dimension,t||o.FLOAT,!!e,r||0,n||0),o.enableVertexAttribArray(a)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":165}],167:[function(t,e,r){"use strict";function n(t){var e=new Function("y","return function(){return y}");return e(t)}function i(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function o(t,e,r,o){function l(r){var n=new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+r+"])}");return n(t,e,o)}function u(t,e,r){switch(r){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+e+"],obj"+t+")";case"float":return"gl.uniform1f(locations["+e+"],obj"+t+")";default:var n=r.indexOf("vec");if(!(n>=0&&1>=n&&r.length===4+n)){if(0===r.indexOf("mat")&&4===r.length){var i=r.charCodeAt(r.length-1)-48;if(2>i||i>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var i=r.charCodeAt(r.length-1)-48;if(2>i||i>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],o=t;o+=parseInt(n)+""===n?"["+n+"]":"."+n,"object"==typeof i?r.push.apply(r,c(o,i)):r.push([o,i])}return r}function f(e){for(var n=["return function updateProperty(obj){"],i=c("",e),a=0;a<i.length;++a){var s=i[a],l=s[0],f=s[1];o[f]&&n.push(u(l,f,r[f].type))}n.push("return obj}");var h=new Function("gl","locations",n.join("\n"));return h(t,o)}function h(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var e=t.indexOf("vec");if(e>=0&&1>=e&&t.length===4+e){var r=t.charCodeAt(t.length-1)-48;if(2>r||r>4)throw new s("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(2>r||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,i){if("object"==typeof i){var a=p(i);Object.defineProperty(t,e,{get:n(a),set:f(i),enumerable:!0,configurable:!1})}else o[i]?Object.defineProperty(t,e,{get:l(i),set:f(i),enumerable:!0,configurable:!1}):t[e]=h(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)d(e,r,t[r])}else{e={};for(var n in t)d(e,n,t[n])}return e}var g=a(r,!0);return{get:n(p(g)),set:f(g),enumerable:!0,configurable:!0}}var a=t("./reflect"),s=t("./GLError");e.exports=o},{"./GLError":165,"./reflect":168}],168:[function(t,e,r){"use strict";function n(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name,o=i.split("."),a=r,s=0;s<o.length;++s){var l=o[s].split("[");if(l.length>1){l[0]in a||(a[l[0]]=[]),a=a[l[0]];for(var u=1;u<l.length;++u){var c=parseInt(l[u]);u<l.length-1||s<o.length-1?(c in a||(u<l.length-1?a[c]=[]:a[c]={}),a=a[c]):e?a[c]=n:a[c]=t[n].type}}else s<o.length-1?(l[0]in a||(a[l[0]]={}),a=a[l[0]]):e?a[l[0]]=n:a[l[0]]=t[n].type}return r}e.exports=n},{}],169:[function(t,e,r){"use strict";function n(t,e){if(!s){var r=Object.keys(a);s={};for(var n=0;n<r.length;++n){var i=r[n];s[t[i]]=a[i]}}return s[e]}function i(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=[],o=0;r>o;++o){var a=t.getActiveUniform(e,o);if(a){var s=n(t,a.type);if(a.size>1)for(var l=0;l<a.size;++l)i.push({name:a.name.replace("[0]","["+l+"]"),type:s});else i.push({name:a.name,type:s})}}return i}function o(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=[],o=0;r>o;++o){var a=t.getActiveAttrib(e,o);a&&i.push({name:a.name,type:n(t,a.type)})}return i}r.uniforms=i,r.attributes=o;var a={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},s=null},{}],170:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=o,this.programs=[],this.cache=a}function i(t){this.gl=t,this.shaders=[{},{}],this.programs={}}function o(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(n);try{var o=f(i,r,e)}catch(a){throw console.warn("Failed to format compiler error: "+a),new c(i,"Error compiling shader:\n"+i)}throw new c(i,o.short,o.long)}return n}function a(t,e,r,n,i){var o=t.createProgram();t.attachShader(o,e),t.attachShader(o,r);for(var a=0;a<n.length;++a)t.bindAttribLocation(o,i[a],n[a]);if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var s=t.getProgramInfoLog(o);throw new c(s,"Error linking program: "+s)}return o}function s(t){var e=d.get(t);return e||(e=new i(t),d.set(t,e)),e}function l(t,e,r){return s(t).getShaderReference(e,r)}function u(t,e,r,n,i){return s(t).getProgram(e,r,n,i)}r.shader=l,r.program=u;var c=t("./GLError"),f=t("gl-format-compiler-error"),h="undefined"==typeof WeakMap?t("weakmap-shim"):WeakMap,d=new h,p=0;n.prototype.dispose=function(){if(0===--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;i>n;++n){var o=t.programs[r[n]];o&&(delete t.programs[n],e.deleteProgram(o))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var g=i.prototype;g.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],a=i[e];if(a&&r.isShader(a.shader))a.count+=1;else{var s=o(r,t,e);a=i[e]=new n(p++,e,t,s,[],1,this)}return a},g.getProgram=function(t,e,r,n){var i=[t.id,e.id,r.join(":"),n.join(":")].join("@"),o=this.programs[i];return o&&this.gl.isProgram(o)||(this.programs[i]=o=a(this.gl,t.shader,e.shader,r,n),t.programs.push(i),e.programs.push(i)),o}},{"./GLError":165,"gl-format-compiler-error":171,"weakmap-shim":181}],171:[function(t,e,r){function n(t,e,r){"use strict";var n=a(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===o.FRAGMENT_SHADER?"fragment":"vertex");for(var u=i("Error compiling %s shader %s:\n",l,n),c=i("%s%s",u,t),f=t.split("\n"),h={},d=0;d<f.length;d++){var p=f[d];if(""!==p){var g=parseInt(p.split(":")[2]);if(isNaN(g))throw new Error(i("Could not parse error: %s",p));h[g]=p}}for(var v=s(e).split("\n"),d=0;d<v.length;d++)if(h[d+3]||h[d+2]||h[d+1]){var m=v[d];if(u+=m+"\n",h[d+1]){var y=h[d+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),u+=i("^^^ %s\n\n",y)}}return{"long":u.trim(),"short":c.trim()}}var i=t("sprintf-js").sprintf,o=t("gl-constants/lookup"),a=t("glsl-shader-name"),s=t("add-line-numbers");e.exports=n},{"add-line-numbers":172,"gl-constants/lookup":175,"glsl-shader-name":176,"sprintf-js":178}],172:[function(t,e,r){function n(t,e,r){e="number"==typeof e?e:1,r=r||": ";var n=t.split(/\r?\n/),o=String(n.length+e-1).length;return n.map(function(t,n){var a=n+e,s=String(a).length,l=i(a,o-s);return l+r+t}).join("\n")}var i=t("pad-left");e.exports=n},{"pad-left":173}],173:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r="undefined"!=typeof r?r+"":" ",n(r,e)+t}},{"repeat-string":220}],174:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",
33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],175:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":174}],176:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;r<e.length;r++){var n=e[r];if("preprocessor"===n.type){var a=n.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(a&&a[2]){var s=a[1],l=a[2];return(s?o(l):l).trim()}}}}var i=t("glsl-tokenizer"),o=t("atob-lite");e.exports=n},{"atob-lite":177,"glsl-tokenizer":200}],177:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],178:[function(e,r,n){!function(e){function r(){var t=arguments[0],e=r.cache;return e[t]&&e.hasOwnProperty(t)||(e[t]=r.parse(t)),r.format.call(null,e[t],arguments)}function i(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function o(t,e){return Array(e+1).join(t)}var a={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};r.format=function(t,e){var n,s,l,u,c,f,h,d=1,p=t.length,g="",v=[],m=!0,y="";for(s=0;p>s;s++)if(g=i(t[s]),"string"===g)v[v.length]=t[s];else if("array"===g){if(u=t[s],u[2])for(n=e[d],l=0;l<u[2].length;l++){if(!n.hasOwnProperty(u[2][l]))throw new Error(r("[sprintf] property '%s' does not exist",u[2][l]));n=n[u[2][l]]}else n=u[1]?e[u[1]]:e[d++];if("function"==i(n)&&(n=n()),a.not_string.test(u[8])&&a.not_json.test(u[8])&&"number"!=i(n)&&isNaN(n))throw new TypeError(r("[sprintf] expecting number but found %s",i(n)));switch(a.number.test(u[8])&&(m=n>=0),u[8]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,u[6]?parseInt(u[6]):0);break;case"e":n=u[7]?n.toExponential(u[7]):n.toExponential();break;case"f":n=u[7]?parseFloat(n).toFixed(u[7]):parseFloat(n);break;case"g":n=u[7]?parseFloat(n).toPrecision(u[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&u[7]?n.substring(0,u[7]):n;break;case"u":n>>>=0;break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase()}a.json.test(u[8])?v[v.length]=n:(!a.number.test(u[8])||m&&!u[3]?y="":(y=m?"+":"-",n=n.toString().replace(a.sign,"")),f=u[4]?"0"===u[4]?"0":u[4].charAt(1):" ",h=u[6]-(y+n).length,c=u[6]&&h>0?o(f,h):"",v[v.length]=u[5]?y+n+c:"0"===f?y+c+n:c+y+n)}return v.join("")},r.cache={},r.parse=function(t){for(var e=t,r=[],n=[],i=0;e;){if(null!==(r=a.text.exec(e)))n[n.length]=r[0];else if(null!==(r=a.modulo.exec(e)))n[n.length]="%";else{if(null===(r=a.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){i|=1;var o=[],s=r[2],l=[];if(null===(l=a.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o[o.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=a.key_access.exec(s)))o[o.length]=l[1];else{if(null===(l=a.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=l[1]}r[2]=o}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}e=e.substring(r[0].length)}return n};var s=function(t,e,n){return n=(e||[]).slice(0),n.splice(0,0,t),r.apply(null,n)};"undefined"!=typeof n?(n.sprintf=r,n.vsprintf=s):(e.sprintf=r,e.vsprintf=s,"function"==typeof t&&t.amd&&t(function(){return{sprintf:r,vsprintf:s}}))}("undefined"==typeof window?this:window)},{}],179:[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":180}],180:[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},{}],181:[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){t(e).value=r},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":179}],182:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = beckmannSpecular_1_1(L, V, N, roughness);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = texture2D(colormap, vec2(value, value));\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",s="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n";r.createShader=function(t){var e=n(t,i,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,a,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":164}],183:[function(t,e,r){arguments[4][9][0].apply(r,arguments)},{dup:9}],184:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;t>r;++r)e.push("out",r,"s=0.5*(inp",r,"l-inp",r,"r);");for(var n=["array"],i=["junk"],r=0;t>r;++r){n.push("array"),i.push("out"+r+"s");var o=a(t);o[r]=-1,n.push({array:0,offset:o.slice()}),o[r]=1,n.push({array:0,offset:o.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){function e(e){for(var r=o-e.length,n=[],i=[],s=[],l=0;o>l;++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"),i.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+i.join()+")";if(0===n.length&&(u=""),r>0){a.push("if(1");for(var l=0;o>l;++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;o>l;++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,f="dst.pick("+s.join()+","+c+")"+u;switch(t[c]){case"clamp":var h=s.slice(),d=s.slice();e[l]<0?h[c]="s["+c+"]-2":d[c]="1",0===r?a.push("if(s[",c,"]>1){dst.set(",s.join(),",",c,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>1){diff(",f,",src.pick(",h.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",f,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",c,",0);"):a.push("zero(",f,");");break;case"wrap":var p=s.slice(),g=s.slice();e[l]<0?(p[c]="s["+c+"]-2",g[c]="0"):(p[c]="s["+c+"]-1",g[c]="1"),0===r?a.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",g.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>2){diff(",f,",src.pick(",p.join(),")",u,",src.pick(",g.join(),")",u,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}var r=t.join(),i=u[r];if(i)return i;for(var o=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],s=0;1<<o>s;++s){for(var c=[],d=0;o>d;++d)s&1<<d&&c.push(d+1);for(var p=0;p<1<<c.length;++p){for(var g=c.slice(),d=0;d<c.length;++d)p&1<<d&&(g[d]=-g[d]);e(g)}}a.push("return dst;};return gradient");for(var v=["diff","zero"],m=[f,h],s=1;o>=s;++s)v.push("grad"+s),m.push(n(s));v.push(a.join(""));var y=Function.apply(void 0,v),i=y.apply(void 0,m);return l[r]=i,i}function o(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?a(e.dimension,r):a(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");if(0===e.size)return t;if(e.dimension<=0)return t.set(0),t;var o=i(r);return o(t,e)}e.exports=o;var a=t("dup"),s=t("cwise-compiler"),l={},u={},c={body:"",args:[],thisVars:[],localVars:[]},f=s({args:["array","array","array"],pre:c,post:c,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1},{name:"left",lvalue:!1,rvalue:!0,count:1},{name:"right",lvalue:!1,rvalue:!0,count:1}],body:"out=0.5*(left-right)",thisVars:[],localVars:[]},funcName:"cdiff"}),h=s({args:["array"],pre:c,post:c,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1}],body:"out=0",thisVars:[],localVars:[]},funcName:"zero"})},{"cwise-compiler":96,dup:102}],185:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],o=t,a=1;o instanceof Array;)r.push(o.length),a*=o.length,o=o[0];return 0===r.length?n():(e||(e=n(new Float64Array(a),r)),i(e,t),e)}},{"./doConvert.js":186,ndarray:219}],186:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":96}],187:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}function i(t){var e=x([y({colormap:t,nshades:O,format:"rgba"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return b.divseq(e,255),e}function o(t,e,r,i,o,a,s,l,u,c,f,h,d,p){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=i,this._pickShader=o,this._coordinateBuffer=a,this._vao=s,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=f,this._contourVAO=h,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new n([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[_(m.mallocFloat(1024),[0,0]),_(m.mallocFloat(1024),[0,0]),_(m.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.dirty=!0}function a(t,e){var r,n,i,o=e.axes&&e.axes.lastCubeProps.axis||D,a=e.showSurface,s=e.showContour;for(r=0;3>r;++r)for(a=a||e.surfaceProject[r],n=0;3>n;++n)s=s||e.contourProject[r][n];for(r=0;3>r;++r){var l=F.projections[r];for(n=0;16>n;++n)l[n]=0;for(n=0;4>n;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(o[r]>0)][r],A(l,t.model,l);var u=F.clipBounds[r];for(i=0;2>i;++i)for(n=0;3>n;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return F.showSurface=a,F.showContour=s,F}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||N,n.view=t.view||N,n.projection=t.projection||N,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=M(n.inverseModel,n.model);for(var i=0;2>i;++i)for(var o=n.clipBounds[i],s=0;3>s;++s)o[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V;var l=U;for(A(l,n.view,n.model),A(l,n.projection,l),M(l,l),i=0;3>i;++i)n.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;3>i;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;3>i;++i){var c=l[12+i];for(s=0;3>s;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var f=a(n,this);if(f.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;3>i;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=f.projections[i],this._shader.uniforms.clipBounds=f.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(f.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;3>i;++i)for(h.uniforms.permutation=I[i],r.lineWidth(this.contourWidth[i]),s=0;s<this.contourLevels[i].length;++s)this._contourCounts[i][s]&&(s===this.highlightLevel[i]?(h.uniforms.contourColor=this.highlightColor[i],h.uniforms.contourTint=this.highlightTint[i]):0!==s&&s-1!==this.highlightLevel[i]||(h.uniforms.contourColor=this.contourColor[i],h.uniforms.contourTint=this.contourTint[i]),h.uniforms.height=this.contourLevels[i][s],d.draw(r.LINES,this._contourCounts[i][s],this._contourOffsets[i][s]));for(i=0;3>i;++i)for(h.uniforms.model=f.projections[i],h.uniforms.clipBounds=f.clipBounds[i],s=0;3>s;++s)if(this.contourProject[i][s]){h.uniforms.permutation=I[s],r.lineWidth(this.contourWidth[s]);for(var p=0;p<this.contourLevels[s].length;++p)p===this.highlightLevel[s]?(h.uniforms.contourColor=this.highlightColor[s],h.uniforms.contourTint=this.highlightTint[s]):0!==p&&p-1!==this.highlightLevel[s]||(h.uniforms.contourColor=this.contourColor[s],h.uniforms.contourTint=this.contourTint[s]),h.uniforms.height=this.contourLevels[s][p],d.draw(r.LINES,this._contourCounts[s][p],this._contourOffsets[s][p])}for(d=this._dynamicVAO,d.bind(),i=0;3>i;++i)if(0!==this._dynamicCounts[i])for(h.uniforms.model=n.model,h.uniforms.clipBounds=n.clipBounds,h.uniforms.permutation=I[i],r.lineWidth(this.dynamicWidth[i]),h.uniforms.contourColor=this.dynamicColor[i],h.uniforms.contourTint=this.dynamicTint[i],h.uniforms.height=this.dynamicLevel[i],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),s=0;3>s;++s)this.contourProject[s][i]&&(h.uniforms.model=f.projections[s],h.uniforms.clipBounds=f.clipBounds[s],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));d.unbind()}}function l(t,e){var r=e.shape.slice(),n=t.shape.slice();b.assign(t.lo(1,1).hi(r[0],r[1]),e),b.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),b.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),b.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),b.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))}function u(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function c(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function f(t){if(Array.isArray(t)){if(Array.isArray(t))return[c(t[0]),c(t[1]),c(t[2])];var e=c(t);return[e.slice(),e.slice(),e.slice()]}}function h(t){var e=t.gl,r=L(e),n=C(e),i=S(e),a=P(e),s=p(e),l=g(e,[{buffer:s,size:4,stride:R,offset:0},{buffer:s,size:3,stride:R,offset:16},{buffer:s,size:3,stride:R,offset:28}]),u=p(e),c=g(e,[{buffer:u,size:4,stride:20,offset:0},{buffer:u,size:1,stride:20,offset:16}]),f=p(e),h=g(e,[{buffer:f,size:2,type:e.FLOAT}]),d=v(e,1,O,e.RGBA,e.UNSIGNED_BYTE);d.minFilter=e.LINEAR,d.magFilter=e.LINEAR;var m=new o(e,[0,0],[[0,0,0],[0,0,0]],r,n,s,l,d,i,a,u,c,f,h),y={levels:[[],[],[]]};for(var b in t)y[b]=t[b];return y.colormap=y.colormap||"jet",m.update(y),m}e.exports=h;var d=t("bit-twiddle"),p=t("gl-buffer"),g=t("gl-vao"),v=t("gl-texture2d"),m=t("typedarray-pool"),y=t("colormap"),b=t("ndarray-ops"),x=t("ndarray-pack"),_=t("ndarray"),w=t("surface-nets"),A=t("gl-mat4/multiply"),M=t("gl-mat4/invert"),k=t("binary-search-bounds"),T=t("ndarray-gradient"),E=t("./lib/shaders"),L=E.createShader,S=E.createContourShader,C=E.createPickShader,P=E.createPickContourShader,R=40,N=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],z=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],I=[[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;3>t;++t){var e=I[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var O=265,j=o.prototype;j.isTransparent=function(){return this.opacity<1},j.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;3>t;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},j.pickSlots=1,j.setPickBase=function(t){this.pickId=t};var D=[0,0,0],F={showSurface:!1,showContour:!1,projections:[N.slice(),N.slice(),N.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:N,view:N,projection:N,inverseModel:N.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},U=N.slice(),V=[1,0,0,0,1,0,0,0,1];j.draw=function(t){return s.call(this,t,!1)},j.drawTransparent=function(t){return s.call(this,t,!0)};var q={model:N,view:N,projection:N,inverseModel:N,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]};j.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=q;r.model=t.model||N,r.view=t.view||N,r.projection=t.projection||N,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;2>n;++n)for(var i=r.clipBounds[n],o=0;3>o;++o)i[o]=Math.min(Math.max(this.clipBounds[n][o],-1e8),1e8);var s=a(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;3>n;++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(),o=0;3>o;++o)for(e.lineWidth(this.contourWidth[o]),l.uniforms.permutation=I[o],n=0;n<this.contourLevels[o].length;++n)this._contourCounts[o][n]&&(l.uniforms.height=this.contourLevels[o][n],u.draw(e.LINES,this._contourCounts[o][n],this._contourOffsets[o][n]));for(n=0;3>n;++n)for(l.uniforms.model=s.projections[n],l.uniforms.clipBounds=s.clipBounds[n],o=0;3>o;++o)if(this.contourProject[n][o]){l.uniforms.permutation=I[o],e.lineWidth(this.contourWidth[o]);for(var c=0;c<this.contourLevels[o].length;++c)this._contourCounts[o][c]&&(l.uniforms.height=this.contourLevels[o][c],u.draw(e.LINES,this._contourCounts[o][c],this._contourOffsets[o][c]))}u.unbind()}},j.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),o=n-i,a=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(a),l=a-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;2>c;++c)for(var f=c?o:1-o,h=0;2>h;++h)for(var d=h?l:1-l,p=i+c,g=s+h,v=f*d,m=0;3>m;++m)u[m]+=this._field[m].get(p,g)*v;for(var y=this._pickResult.level,b=0;3>b;++b)if(y[b]=k.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]=.5>o?i:i+1,r.index[1]=.5>l?s:s+1,r.uv[0]=n/e[0],r.uv[1]=a/e[1],m=0;3>m;++m)r.dataCoordinate[m]=this._field[m].get(r.index[0],r.index[1]);return r},j.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=u(t.contourWidth,Number)),"showContour"in t&&(this.showContour=u(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=u(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=f(t.contourColor)),"contourProject"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=f(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(m.freeFloat(this._field[2].data),this._field[2].data=m.mallocFloat(d.nextPow2(n))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var o=this.shape,a=0;2>a;++a)this._field[2].size>this._field[a].data.length&&(m.freeFloat(this._field[a].data),this._field[a].data=m.mallocFloat(this._field[2].size)),this._field[a]=_(this._field[a].data,[o[0]+2,o[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error("gl-surface: invalid coordinates for x/y");for(a=0;2>a;++a){var c=s[a];for(y=0;2>y;++y)if(c.shape[y]!==o[y])throw new Error("gl-surface: coords have incorrect shape");l(this._field[a],c)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw new Error("gl-surface: invalid ticks");for(a=0;2>a;++a){var p=h[a];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==o[a])throw new Error("gl-surface: invalid tick length");var g=_(p.data,o);g.stride[a]=p.stride[0],g.stride[1^a]=0,l(this._field[a],g)}}else{for(a=0;2>a;++a){var v=[0,0];v[a]=1,this._field[a]=_(this._field[a].data,[o[0]+2,o[1]+2],v,0)}this._field[0].set(0,0,0);for(var y=0;y<o[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(o[0]+1,0,o[0]-1),this._field[1].set(0,0,0),y=0;y<o[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,o[1]+1,o[1]-1)}var b=this._field,x=_(m.mallocFloat(3*b[2].size*2),[3,o[0]+2,o[1]+2,2]);for(a=0;3>a;++a)T(x.pick(a),b[a],"mirror");var A=_(m.mallocFloat(3*b[2].size),[o[0]+2,o[1]+2,3]);for(a=0;a<o[0]+2;++a)for(y=0;y<o[1]+2;++y){var M=x.get(0,a,y,0),k=x.get(0,a,y,1),E=x.get(1,a,y,0),L=x.get(1,a,y,1),S=x.get(2,a,y,0),C=x.get(2,a,y,1),P=E*C-L*S,R=S*k-C*M,N=M*L-k*E,I=Math.sqrt(P*P+R*R+N*N);1e-8>I?(I=Math.max(Math.abs(P),Math.abs(R),Math.abs(N)),1e-8>I?(N=1,R=P=0,I=1):I=1/I):I=1/Math.sqrt(I),A.set(a,y,0,P*I),
A.set(a,y,1,R*I),A.set(a,y,2,N*I)}m.free(x.data);var O=[1/0,1/0,1/0],j=[-(1/0),-(1/0),-(1/0)],D=1/0,F=-(1/0),B=(o[0]-1)*(o[1]-1)*6,U=m.mallocFloat(d.nextPow2(10*B)),V=0,q=0;for(a=0;a<o[0]-1;++a)t:for(y=0;y<o[1]-1;++y){for(var H=0;2>H;++H)for(var G=0;2>G;++G)for(var X=0;3>X;++X){var Y=this._field[X].get(1+a+H,1+y+G);if(isNaN(Y)||!isFinite(Y))continue t}for(X=0;6>X;++X){var W=a+z[X][0],Z=y+z[X][1],Q=this._field[0].get(W+1,Z+1),$=this._field[1].get(W+1,Z+1);Y=this._field[2].get(W+1,Z+1);var K=Y;P=A.get(W+1,Z+1,0),R=A.get(W+1,Z+1,1),N=A.get(W+1,Z+1,2),t.intensity&&(K=t.intensity.get(W,Z)),U[V++]=W,U[V++]=Z,U[V++]=Q,U[V++]=$,U[V++]=Y,U[V++]=0,U[V++]=K,U[V++]=P,U[V++]=R,U[V++]=N,O[0]=Math.min(O[0],Q),O[1]=Math.min(O[1],$),O[2]=Math.min(O[2],Y),D=Math.min(D,K),j[0]=Math.max(j[0],Q),j[1]=Math.max(j[1],$),j[2]=Math.max(j[2],Y),F=Math.max(F,K),q+=1}}for(t.intensityBounds&&(D=+t.intensityBounds[0],F=+t.intensityBounds[1]),a=6;V>a;a+=10)U[a]=(U[a]-D)/(F-D);this._vertexCount=q,this._coordinateBuffer.update(U.subarray(0,V)),m.freeFloat(U),m.free(A.data),this.bounds=[O,j],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===D&&this.intensityBounds[1]===F||(r=!0),this.intensityBounds=[D,F]}if("levels"in t){var J=t.levels;for(J=Array.isArray(J[0])?J.slice():[[],[],J],a=0;3>a;++a)J[a]=J[a].slice(),J.sort(function(t,e){return t-e});t:for(a=0;3>a;++a){if(J[a].length!==this.contourLevels[a].length){r=!0;break}for(y=0;y<J[a].length;++y)if(J[a][y]!==this.contourLevels[a][y]){r=!0;break t}}this.contourLevels=J}if(r){b=this._field,o=this.shape;for(var tt=[],et=0;3>et;++et){J=this.contourLevels[et];var rt=[],nt=[],it=[0,0,0];for(a=0;a<J.length;++a){var ot=w(this._field[et],J[a]);rt.push(tt.length/5|0),q=0;t:for(y=0;y<ot.cells.length;++y){var at=ot.cells[y];for(X=0;2>X;++X){var st=ot.positions[at[X]],lt=st[0],ut=0|Math.floor(lt),ct=lt-ut,ft=st[1],ht=0|Math.floor(ft),dt=ft-ht,pt=!1;e:for(var gt=0;3>gt;++gt){it[gt]=0;var vt=(et+gt+1)%3;for(H=0;2>H;++H){var mt=H?ct:1-ct;for(W=0|Math.min(Math.max(ut+H,0),o[0]),G=0;2>G;++G){var yt=G?dt:1-dt;if(Z=0|Math.min(Math.max(ht+G,0),o[1]),Y=2>gt?this._field[vt].get(W,Z):(this.intensity.get(W,Z)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(Y)||isNaN(Y)){pt=!0;break e}var bt=mt*yt;it[gt]+=bt*Y}}}if(pt){if(X>0){for(var xt=0;5>xt;++xt)tt.pop();q-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),q+=1}}nt.push(q)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=m.mallocFloat(tt.length);for(a=0;a<tt.length;++a)_t[a]=tt[a];this._contourBuffer.update(_t),m.freeFloat(_t)}t.colormap&&this._colorMap.setPixels(i(t.colormap))},j.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;3>t;++t)m.freeFloat(this._field[t].data)},j.highlight=function(t){if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var e=0;3>e;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;var r;if(r=this.snapToData?t.dataCoordinate:t.position,this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,o=m.mallocFloat(12*i[0]*i[1]),a=0;3>a;++a)if(this.enableDynamic[a]){this.dynamicLevel[a]=r[a];var s=(a+1)%3,l=(a+2)%3,u=this._field[a],c=this._field[s],f=this._field[l],h=(this.intensity,w(u,r[a])),d=h.cells,p=h.positions;for(this._dynamicOffsets[a]=n,e=0;e<d.length;++e)for(var g=d[e],v=0;2>v;++v){var y=p[g[v]],b=+y[0],x=0|b,_=0|Math.min(x+1,i[0]),A=b-x,M=1-A,k=+y[1],T=0|k,E=0|Math.min(T+1,i[1]),L=k-T,S=1-L,C=M*S,P=M*L,R=A*S,N=A*L,z=C*c.get(x,T)+P*c.get(x,E)+R*c.get(_,T)+N*c.get(_,E),I=C*f.get(x,T)+P*f.get(x,E)+R*f.get(_,T)+N*f.get(_,E);if(isNaN(z)||isNaN(I)){v&&(n-=1);break}o[2*n+0]=z,o[2*n+1]=I,n+=1}this._dynamicCounts[a]=n-this._dynamicOffsets[a]}else this.dynamicLevel[a]=NaN,this._dynamicCounts[a]=0;this._dynamicBuffer.update(o.subarray(0,2*n)),m.freeFloat(o)}}},{"./lib/shaders":182,"binary-search-bounds":183,"bit-twiddle":38,colormap:88,"gl-buffer":105,"gl-mat4/invert":120,"gl-mat4/multiply":122,"gl-texture2d":188,"gl-vao":192,ndarray:219,"ndarray-gradient":184,"ndarray-ops":218,"ndarray-pack":185,"surface-nets":238,"typedarray-pool":242}],188:[function(t,e,r){"use strict";function n(t){v=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],m=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],y=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function i(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(0>e||e>i||0>r||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,i,o){this.gl=t,this.handle=e,this.format=i,this.type=o,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var a=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return a._wrapS},set:function(t){return a.wrapS=t}},{get:function(){return a._wrapT},set:function(t){return a.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return a._shape[0]},set:function(t){return a.width=t}},{get:function(){return a._shape[1]},set:function(t){return a.height=t}}]),this._shapeVector=l}function a(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function s(t,e,r,n,i,o,s,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var f=0,h=0,v=a(c,l.stride.slice());"float32"===u?f=t.FLOAT:"float64"===u?(f=t.FLOAT,v=!1,u="float32"):"uint8"===u?f=t.UNSIGNED_BYTE:(f=t.UNSIGNED_BYTE,v=!1,u="uint8");var m=1;if(2===c.length)h=t.LUMINANCE,c=[c[0],c[1],1],l=d(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===c[2])h=t.ALPHA;else if(2===c[2])h=t.LUMINANCE_ALPHA;else if(3===c[2])h=t.RGB;else{if(4!==c[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=t.RGBA}m=c[2]}if(h!==t.LUMINANCE&&h!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(h=i),h!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,x=s.indexOf(n)<0;if(x&&s.push(n),f===o&&v)0===l.offset&&l.data.length===y?x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,o,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,o,l.data):x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,o,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,o,l.data.subarray(l.offset,l.offset+y));else{var _;_=o===t.FLOAT?g.mallocFloat32(y):g.mallocUint8(y);var w=d(_,c,[c[2],c[2]*c[0],1]);f===t.FLOAT&&o===t.UNSIGNED_BYTE?b(w,l):p.assign(w,l),x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,o,_.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,o,_.subarray(0,y)),o===t.FLOAT?g.freeFloat32(_):g.freeUint8(_)}}function l(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),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),e}function u(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(0>e||e>a||0>r||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var s=l(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new o(t,s,e,r,n,i)}function c(t,e,r,n){var i=l(t);return t.texImage2D(t.TEXTURE_2D,0,r,r,n,e),new o(t,i,0|e.width,0|e.height,r,n)}function f(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var s=a(n,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,s=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,s=!1,r="uint8");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=d(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");c=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,s=!1);var f,h,v=e.size;if(s)f=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var m=[n[2],n[2]*n[0],1];h=g.malloc(v,r);var y=d(h,n,m,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?p.assign(y,e):b(y,e),f=h.subarray(0,v)}var x=l(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,u,f),s||g.free(h),new o(t,x,n[0],n[1],c,u)}function h(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(v||n(t),"number"==typeof arguments[1])return u(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return u(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1];if(e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData)return c(t,e,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return f(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var d=t("ndarray"),p=t("ndarray-ops"),g=t("typedarray-pool");e.exports=h;var v=null,m=null,y=null,b=function(t,e){p.muls(t,e,255)},x=o.prototype;Object.defineProperties(x,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),m.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),m.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;2>e;++e)if(y.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t=0|t,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t=0|t,i(this,this._shape[0],t),t}}}),x.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},x.setPixels=function(t,e,r,n){var i=this.gl;if(this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0,t instanceof HTMLCanvasElement||t instanceof ImageData||t instanceof HTMLImageElement||t instanceof HTMLVideoElement){var o=this._mipLevels.indexOf(n)<0;o?(i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,this.type,t),this._mipLevels.push(n)):i.texSubImage2D(i.TEXTURE_2D,n,e,r,this.format,this.type,t)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||0>e||0>r)throw new Error("gl-texture2d: Texture dimensions are out of bounds");s(i,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:219,"ndarray-ops":218,"typedarray-pool":242}],189:[function(t,e,r){"use strict";function n(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i<r.length;++i){var o=r[i];if(o.buffer){var a=o.buffer,s=o.size||4,l=o.type||t.FLOAT,u=!!o.normalized,c=o.stride||0,f=o.offset||0;a.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,u,c,f)}else{if("number"==typeof o)t.vertexAttrib1f(i,o);else if(1===o.length)t.vertexAttrib1f(i,o[0]);else if(2===o.length)t.vertexAttrib2f(i,o[0],o[1]);else if(3===o.length)t.vertexAttrib3f(i,o[0],o[1],o[2]);else{if(4!==o.length)throw new Error("gl-vao: Invalid vertex attribute");t.vertexAttrib4f(i,o[0],o[1],o[2],o[3])}t.disableVertexAttribArray(i)}}for(;n>i;++i)t.disableVertexAttribArray(i)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(var i=0;n>i;++i)t.disableVertexAttribArray(i)}}e.exports=n},{}],190:[function(t,e,r){"use strict";function n(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}function i(t){return new n(t)}var o=t("./do-bind.js");n.prototype.bind=function(){o(this.gl,this._elements,this._attributes)},n.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=i},{"./do-bind.js":189}],191:[function(t,e,r){"use strict";function n(t,e,r,n,i,o){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=o}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}function o(t,e){return new i(t,e,e.createVertexArrayOES())}var a=t("./do-bind.js");n.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},i.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},i.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},i.prototype.update=function(t,e,r){if(this.bind(),a(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var i=0;i<t.length;++i){var o=t[i];"number"==typeof o?this._attribs.push(new n(i,1,o)):Array.isArray(o)&&this._attribs.push(new n(i,o.length,o[0],o[1],o[2],o[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=o},{"./do-bind.js":189}],192:[function(t,e,r){"use strict";function n(t,e,r,n){var a,s=t.getExtension("OES_vertex_array_object");return a=s?i(t,s):o(t),a.update(e,r,n),a}var i=t("./lib/vao-native.js"),o=t("./lib/vao-emulated.js");e.exports=n},{"./lib/vao-emulated.js":190,"./lib/vao-native.js":191}],193:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}e.exports=n},{}],194:[function(t,e,r){function n(t){function e(t){t.length&&V.push({type:A[B],data:t,position:G,line:q,column:H})}function r(t){D=0,W+=t,j=W.length;for(var e;I=W[D],j>D;){switch(e=D,B){case f:D=L();break;case h:D=E();break;case d:D=T();break;case p:D=S();break;case g:D=R();break;case w:D=P();break;case v:D=N();break;case c:D=z();break;case x:D=k();break;case u:D=M()}if(e!==D)switch(W[e]){case"\n":H=0,++q;break;default:++H}}return F+=D,W=W.slice(D),V}function n(t){return U.length&&e(U.join("")),B=_,e("(eof)"),V}function M(){return U=U.length?[]:U,"/"===O&&"*"===I?(G=F+D-1,B=f,O=I,D+1):"/"===O&&"/"===I?(G=F+D-1,B=h,O=I,D+1):"#"===I?(B=d,G=F+D,D):/\s/.test(I)?(B=x,G=F+D,D):(X=/\d/.test(I),Y=/[^\w_]/.test(I),G=F+D,B=X?g:Y?p:c,D)}function k(){return/[^\s]/g.test(I)?(e(U.join("")),B=u,D):(U.push(I),O=I,D+1)}function T(){return"\n"===I&&"\\"!==O?(e(U.join("")),B=u,D):(U.push(I),O=I,D+1)}function E(){return T()}function L(){return"/"===I&&"*"===O?(U.push(I),e(U.join("")),B=u,D+1):(U.push(I),O=I,D+1)}function S(){if("."===O&&/\d/.test(I))return B=v,D;if("/"===O&&"*"===I)return B=f,D;if("/"===O&&"/"===I)return B=h,D;if("."===I&&U.length){for(;C(U););return B=v,D}if(";"===I||")"===I||"("===I){if(U.length)for(;C(U););return e(I),B=u,D+1}var t=2===U.length&&"="!==I;if(/[\w_\d\s]/.test(I)||t){for(;C(U););return B=u,D}return U.push(I),O=I,D+1}function C(t){for(var r,n,i=0;;){if(r=o.indexOf(t.slice(0,t.length+i).join("")),n=o[r],-1===r){if(i--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),G+=n.length,U=U.slice(n.length),U.length}}function P(){return/[^a-fA-F0-9]/.test(I)?(e(U.join("")),B=u,D):(U.push(I),O=I,D+1)}function R(){return"."===I?(U.push(I),B=v,O=I,D+1):/[eE]/.test(I)?(U.push(I),B=v,O=I,D+1):"x"===I&&1===U.length&&"0"===U[0]?(B=w,U.push(I),O=I,D+1):/[^\d]/.test(I)?(e(U.join("")),B=u,D):(U.push(I),O=I,D+1)}function N(){return"f"===I&&(U.push(I),O=I,D+=1),/[eE]/.test(I)?(U.push(I),O=I,D+1):"-"===I&&/[eE]/.test(O)?(U.push(I),O=I,D+1):/[^\d]/.test(I)?(e(U.join("")),B=u,D):(U.push(I),O=I,D+1)}function z(){if(/[^\d\w_]/.test(I)){var t=U.join("");return B=Q.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:m,e(U.join("")),B=u,D}return U.push(I),O=I,D+1}var I,O,j,D=0,F=0,B=u,U=[],V=[],q=1,H=0,G=0,X=!1,Y=!1,W="";t=t||{};var Z=a,Q=i;return"300 es"===t.version&&(Z=l,Q=s),function(t){return V=[],null!==t?r(t):n()}}e.exports=n;var i=t("./lib/literals"),o=t("./lib/operators"),a=t("./lib/builtins"),s=t("./lib/literals-300es"),l=t("./lib/builtins-300es"),u=999,c=9999,f=0,h=1,d=2,p=3,g=4,v=5,m=6,y=7,b=8,x=9,_=10,w=11,A=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":196,"./lib/builtins-300es":195,"./lib/literals":198,"./lib/literals-300es":197,"./lib/operators":199}],195:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":196}],196:[function(t,e,r){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"]},{}],197:[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":198}],198:[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","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],199:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],200:[function(t,e,r){function n(t,e){var r=i(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var i=t("./index");e.exports=n},{"./index":194}],201:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function o(t,e){return c(t.vertices,e.vertices)}function a(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;t>=r;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=u[t+1];return i||(i=u),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;t>=n;++n)this.tuple[n]=this.vertices[n];var i=f[t];i||(i=f[t]=a(t)),this.orient=i}function l(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(i>=r)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),a=u.apply(void 0,o);if(0===a)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;i>=c;++c)l[c]=c;0>a&&(l[0]=1,l[1]=0);for(var f=new n(l,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2),c=0;i>=c;++c){for(var p=l.slice(),g=0;i>=g;++g)g===c&&(p[g]=-1);var v=p[0];p[0]=p[1],p[1]=v;var m=new n(p,new Array(i+1),!0);h[c]=m,d[c]=m}d[i+1]=f;for(var c=0;i>=c;++c)for(var p=h[c].vertices,y=h[c].adjacent,g=0;i>=g;++g){var b=p[g];if(0>b)y[g]=f;else for(var x=0;i>=x;++x)h[x].vertices.indexOf(b)<0&&(y[g]=h[x])}for(var _=new s(i,o,d),w=!!e,c=i+1;r>c;++c)_.insert(t[c],w);return _.boundary()}e.exports=l;var u=t("robust-orientation"),c=t("simplicial-complex").compareCells;n.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var f=[],h=s.prototype;h.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,o=this.vertices,a=[t];for(t.lastVisited=-n;a.length>0;){t=a.pop();for(var s=(t.vertices,t.adjacent),l=0;r>=l;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;r>=f;++f){var h=c[f];0>h?i[f]=e:i[f]=o[h]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&a.push(u)}}}return null},h.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,o=this.tuple,a=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[a];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;n>=c;++c)o[c]=i[l[c]];s.lastVisited=r;for(var c=0;n>=c;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=o[c];o[c]=t;var d=this.orient();if(o[c]=h,0>d){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},h.addPeaks=function(t,e){var r=this.vertices.length-1,a=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var e=f.pop(),d=e.vertices,p=e.adjacent,g=d.indexOf(r);if(!(0>g))for(var v=0;a>=v;++v)if(v!==g){var m=p[v];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var b=0,x=0;a>=x;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];var _=this.orient();if(_>0){y[b]=r,m.boundary=!1,u.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var w=m.adjacent,A=d.slice(),M=p.slice(),k=new n(A,M,!0);c.push(k);var T=w.indexOf(e);if(!(0>T)){w[T]=k,M[g]=m,A[v]=-1,M[v]=e,p[v]=k,k.flip();for(var x=0;a>=x;++x){var E=A[x];if(!(0>E||E===r)){for(var L=new Array(a-1),S=0,C=0;a>=C;++C){var P=A[C];0>P||C===x||(L[S++]=P)}h.push(new i(L,k,x))}}}}}}h.sort(o);for(var v=0;v+1<h.length;v+=2){var R=h[v],N=h[v+1],z=R.index,I=N.index;0>z||0>I||(R.cell.adjacent[R.index]=N.cell,N.cell.adjacent[N.index]=R.cell)}},h.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,o=this.tuple,a=0;i>=a;++a){var s=n.vertices[a];0>s?o[a]=t:o[a]=r[s]}var l=this.orient(o);0>l||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},h.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;n>i;++i){var o=r[i];if(o.boundary){for(var a=new Array(t),s=o.vertices,l=0,u=0,c=0;t>=c;++c)s[c]>=0?a[l++]=s[c]:u=1&c;if(u===(1&t)){var f=a[0];a[0]=a[1],a[1]=f}e.push(a)}}return e}},{"robust-orientation":225,"simplicial-complex":204}],202:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],203:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85}],204:[function(t,e,r){"use strict";"use restrict";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;i>n;++n)e=r(e,t[n].length);return e-1}function i(t){for(var e=-1,r=Math.max,n=0,i=t.length;i>n;++n)for(var o=t[n],a=0,s=o.length;s>a;++a)e=r(e,o[a]);return e+1}function o(t){for(var e=new Array(t.length),r=0,n=t.length;n>r;++r)e[r]=t[r].slice(0);return e}function a(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:var o=t[0]+t[1]-e[0]-e[1];return o?o:i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],s=e[0]+e[1];if(o=a+t[2]-(s+e[2]))return o;var l=i(t[0],t[1]),u=i(e[0],e[1]),o=i(l,t[2])-i(u,e[2]);return o?o:i(l+t[2],a)-i(u+e[2],s);default:var c=t.slice(0);c.sort();var f=e.slice(0);f.sort();for(var h=0;r>h;++h)if(n=c[h]-f[h])return n;return 0}}function s(t,e){return a(t[0],e[0])}function l(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;r>i;++i)n[i]=[t[i],e[i]];n.sort(s);for(var i=0;r>i;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(a),t}function u(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;r>n;++n){var i=t[n];if(a(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function c(t,e){for(var r=0,n=t.length-1,i=-1;n>=r;){var o=r+n>>1,s=a(t[o],e);0>=s?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i;
}function f(t,e){for(var r=new Array(t.length),n=0,i=r.length;i>n;++n)r[n]=[];for(var o=[],n=0,s=e.length;s>n;++n)for(var l=e[n],u=l.length,f=1,h=1<<u;h>f;++f){o.length=b.popCount(f);for(var d=0,p=0;u>p;++p)f&1<<p&&(o[d++]=l[p]);var g=c(t,o);if(!(0>g))for(;;)if(r[g++].push(n),g>=t.length||0!==a(t[g],o))break}return r}function h(t,e){if(!e)return f(u(p(t,0)),t,0);for(var r=new Array(e),n=0;e>n;++n)r[n]=[];for(var n=0,i=t.length;i>n;++n)for(var o=t[n],a=0,s=o.length;s>a;++a)r[o[a]].push(n);return r}function d(t){for(var e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],o=0|i.length,a=1,s=1<<o;s>a;++a){for(var u=[],c=0;o>c;++c)a>>>c&1&&u.push(i[c]);e.push(u)}return l(e)}function p(t,e){if(0>e)return[];for(var r=[],n=(1<<e+1)-1,i=0;i<t.length;++i)for(var o=t[i],a=n;a<1<<o.length;a=b.nextCombination(a)){for(var s=new Array(e+1),u=0,c=0;c<o.length;++c)a&1<<c&&(s[u++]=o[c]);r.push(s)}return l(r)}function g(t){for(var e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],o=0,a=i.length;a>o;++o){for(var s=new Array(i.length-1),u=0,c=0;a>u;++u)u!==o&&(s[c++]=i[u]);e.push(s)}return l(e)}function v(t,e){for(var r=new x(e),n=0;n<t.length;++n)for(var i=t[n],o=0;o<i.length;++o)for(var a=o+1;a<i.length;++a)r.link(i[o],i[a]);for(var s=[],l=r.ranks,n=0;n<l.length;++n)l[n]=-1;for(var n=0;n<t.length;++n){var u=r.find(t[n][0]);l[u]<0?(l[u]=s.length,s.push([t[n].slice(0)])):s[l[u]].push(t[n].slice(0))}return s}function m(t){for(var e=u(l(p(t,0))),r=new x(e.length),n=0;n<t.length;++n)for(var i=t[n],o=0;o<i.length;++o)for(var a=c(e,[i[o]]),s=o+1;s<i.length;++s)r.link(a,c(e,[i[s]]));for(var f=[],h=r.ranks,n=0;n<h.length;++n)h[n]=-1;for(var n=0;n<t.length;++n){var d=r.find(c(e,[t[n][0]]));h[d]<0?(h[d]=f.length,f.push([t[n].slice(0)])):f[h[d]].push(t[n].slice(0))}return f}function y(t,e){return e?v(t,e):m(t)}var b=t("bit-twiddle"),x=t("union-find");r.dimension=n,r.countVertices=i,r.cloneCells=o,r.compareCells=a,r.normalize=l,r.unique=u,r.findCell=c,r.incidence=f,r.dual=h,r.explode=d,r.skeleton=p,r.boundary=g,r.connectedComponents=y},{"bit-twiddle":202,"union-find":203}],205:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=r;return e}e.exports=n},{}],206:[function(t,e,r){e.exports=function(t){return!(null==t||!(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)))}},{}],207:[function(t,e,r){"use strict";function n(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==g.alt,g.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==g.shift,g.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==g.control,g.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==g.meta,g.meta=!!t.metaKey),e}function n(t,n){var o=i.x(n),a=i.y(n);"buttons"in n&&(t=0|n.buttons),(t!==h||o!==d||a!==p||r(n))&&(h=0|t,d=o||0,p=a||0,e(h,d,p,g))}function o(t){n(0,t)}function a(){(h||d||p||g.shift||g.alt||g.meta||g.control)&&(d=p=0,h=0,g.shift=g.alt=g.control=g.meta=!1,e(0,0,0,g))}function s(t){r(t)&&e(h,d,p,g)}function l(t){0===i.buttons(t)?n(0,t):n(h,t)}function u(t){n(h|i.buttons(t),t)}function c(t){n(h&~i.buttons(t),t)}function f(){v||(v=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",u),t.addEventListener("mouseup",c),t.addEventListener("mouseleave",o),t.addEventListener("mouseenter",o),t.addEventListener("mouseout",o),t.addEventListener("mouseover",o),t.addEventListener("blur",a),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",a),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}e||(e=t,t=window);var h=0,d=0,p=0,g={shift:!1,alt:!1,control:!1,meta:!1},v=!1;f();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return v},set:function(t){t&&f()},enumerable:!0},buttons:{get:function(){return h},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),m}e.exports=n;var i=t("mouse-event")},{"mouse-event":208}],208:[function(t,e,r){"use strict";function n(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<<e-1}else if("button"in t){var e=t.button;if(1===e)return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0}function i(t){return t.target||t.srcElement||window}function o(t){if("object"==typeof t){if("offsetX"in t)return t.offsetX;var e=i(t),r=e.getBoundingClientRect();return t.clientX-r.left}return 0}function a(t){if("object"==typeof t){if("offsetY"in t)return t.offsetY;var e=i(t),r=e.getBoundingClientRect();return t.clientY-r.top}return 0}r.buttons=n,r.element=i,r.x=o,r.y=a},{}],209:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],210:[function(t,e,r){"use strict";function n(t,e){var r=a(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function i(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return i(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return s;case"cm":return s/2.54;case"mm":return s/25.4;case"pt":return s/72;case"pc":return s/6}return 1}var a=t("parse-unit");e.exports=o;var s=96},{"parse-unit":209}],211:[function(t,e,r){"use strict";function n(t,e,r){"function"==typeof t&&(r=!!e,e=t,t=window);var n=i("ex",t),o=function(t){r&&t.preventDefault();var i=t.deltaX||0,o=t.deltaY||0,a=t.deltaZ||0,s=t.deltaMode,l=1;switch(s){case 1:l=n;break;case 2:l=window.innerHeight}return i*=l,o*=l,a*=l,i||o||a?e(i,o,a):void 0};return t.addEventListener("wheel",o),o}var i=t("to-px");e.exports=n},{"to-px":210}],212:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_7_arg1_=_inline_7_arg2_.apply(void 0,_inline_7_arg0_)}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_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":99}],213:[function(t,e,r){"use strict";function n(t,e){switch(e.length){case 0:break;case 1:t[0]=1/e[0];break;case 4:i(t,e);break;case 9:o(t,e);break;case 16:a(t,e);break;default:throw new Error("currently supports matrices up to 4x4")}return t}e.exports=n;var i=t("gl-mat2/invert"),o=t("gl-mat3/invert"),a=t("gl-mat4/invert")},{"gl-mat2/invert":214,"gl-mat3/invert":113,"gl-mat4/invert":120}],214:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*o-i*n;return a?(a=1/a,t[0]=o*a,t[1]=-n*a,t[2]=-i*a,t[3]=r*a,t):null}e.exports=n},{}],215:[function(t,e,r){"use strict";function n(t,e){var r=Math.floor(e),n=e-r,i=r>=0&&r<t.shape[0],o=r+1>=0&&r+1<t.shape[0],a=i?+t.get(r):0,s=o?+t.get(r+1):0;return(1-n)*a+n*s}function i(t,e,r){var n=Math.floor(e),i=e-n,o=n>=0&&n<t.shape[0],a=n+1>=0&&n+1<t.shape[0],s=Math.floor(r),l=r-s,u=s>=0&&s<t.shape[1],c=s+1>=0&&s+1<t.shape[1],f=o&&u?t.get(n,s):0,h=o&&c?t.get(n,s+1):0,d=a&&u?t.get(n+1,s):0,p=a&&c?t.get(n+1,s+1):0;return(1-l)*((1-i)*f+i*d)+l*((1-i)*h+i*p)}function o(t,e,r,n){var i=Math.floor(e),o=e-i,a=i>=0&&i<t.shape[0],s=i+1>=0&&i+1<t.shape[0],l=Math.floor(r),u=r-l,c=l>=0&&l<t.shape[1],f=l+1>=0&&l+1<t.shape[1],h=Math.floor(n),d=n-h,p=h>=0&&h<t.shape[2],g=h+1>=0&&h+1<t.shape[2],v=a&&c&&p?t.get(i,l,h):0,m=a&&f&&p?t.get(i,l+1,h):0,y=s&&c&&p?t.get(i+1,l,h):0,b=s&&f&&p?t.get(i+1,l+1,h):0,x=a&&c&&g?t.get(i,l,h+1):0,_=a&&f&&g?t.get(i,l+1,h+1):0,w=s&&c&&g?t.get(i+1,l,h+1):0,A=s&&f&&g?t.get(i+1,l+1,h+1):0;return(1-d)*((1-u)*((1-o)*v+o*y)+u*((1-o)*m+o*b))+d*((1-u)*((1-o)*x+o*w)+u*((1-o)*_+o*A))}function a(t){var e,r,n=0|t.shape.length,i=new Array(n),o=new Array(n),a=new Array(n),s=new Array(n);for(e=0;n>e;++e)r=+arguments[e+1],i[e]=Math.floor(r),o[e]=r-i[e],a[e]=0<=i[e]&&i[e]<t.shape[e],s[e]=0<=i[e]+1&&i[e]+1<t.shape[e];var l,u,c,f=0;t:for(e=0;1<<n>e;++e){for(u=1,c=t.offset,l=0;n>l;++l)if(e&1<<l){if(!s[l])continue t;u*=o[l],c+=t.stride[l]*(i[l]+1)}else{if(!a[l])continue t;u*=1-o[l],c+=t.stride[l]*i[l]}f+=u*t.data[c]}return f}function s(t,e,r,s){switch(t.shape.length){case 0:return 0;case 1:return n(t,e);case 2:return i(t,e,r);case 3:return o(t,e,r,s);default:return a.apply(void 0,arguments)}}e.exports=s,e.exports.d1=n,e.exports.d2=i,e.exports.d3=o},{}],216:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_33_arg4_)}",args:[{name:"_inline_33_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_33_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_33_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_33_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_33_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_34_arg2_(this_warped,_inline_34_arg0_),_inline_34_arg1_=_inline_34_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_34_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_34_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_34_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_34_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_34_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_37_arg2_(this_warped,_inline_37_arg0_),_inline_37_arg1_=_inline_37_arg3_(_inline_37_arg4_,this_warped[0])}",args:[{name:"_inline_37_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_37_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_37_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_37_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_37_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_40_arg2_(this_warped,_inline_40_arg0_),_inline_40_arg1_=_inline_40_arg3_(_inline_40_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_40_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_40_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_43_arg2_(this_warped,_inline_43_arg0_),_inline_43_arg1_=_inline_43_arg3_(_inline_43_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_43_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_43_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:o(t,r,n.d1,e);break;case 2:a(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":99,"ndarray-linear-interpolate":215}],217:[function(t,e,r){"use strict";function n(t,e,r){var n=e.dimension,a=o([],r);return i(t,e,function(t,e){for(var r=0;n>r;++r){t[r]=a[(n+1)*n+r];for(var i=0;n>i;++i)t[r]+=a[(n+1)*i+r]*e[i]}for(var o=a[(n+1)*(n+1)-1],i=0;n>i;++i)o+=a[(n+1)*i+n]*e[i];for(var s=1/o,r=0;n>r;++r)t[r]*=s;return t}),t}var i=t("ndarray-warp"),o=t("gl-matrix-invert");e.exports=n},{"gl-matrix-invert":213,"ndarray-warp":216}],218:[function(t,e,r){"use strict";function n(t){if(!t)return s;for(var e=0;e<t.args.length;++e){var r=t.args[e];0===e?t.args[e]={name:r,lvalue:!0,rvalue:!!t.rvalue,count:t.count||1}:t.args[e]={name:r,lvalue:!1,rvalue:!0,count:1}}return t.thisVars||(t.thisVars=[]),t.localVars||(t.localVars=[]),t}function i(t){return a({args:t.args,pre:n(t.pre),body:n(t.body),post:n(t.proc),funcName:t.funcName})}function o(t){for(var e=[],r=0;r<t.args.length;++r)e.push("a"+r);var n=new Function("P",["return function ",t.funcName,"_ndarrayops(",e.join(","),") {P(",e.join(","),");return a0}"].join(""));return n(i(t))}var a=t("cwise-compiler"),s={body:"",args:[],thisVars:[],localVars:[]},l={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;t<f.length;++t){var e=f[t];r[e]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:e}),r[e+"eq"]=o({args:["array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"})}}();var h=["max","min","atan2","pow"];!function(){for(var t=0;t<h.length;++t){var e=h[t];r[e]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e}),r[e+"s"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e+"s"}),r[e+"eq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"seq"})}}();var d=["atan2","pow"];!function(){for(var t=0;t<d.length;++t){var e=d[t];r[e+"op"]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"op"}),r[e+"ops"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"ops"}),r[e+"opeq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opeq"}),r[e+"opseq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opseq"})}}(),r.any=a({args:["array"],pre:s,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=a({args:["array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=a({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=a({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=a({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":96}],219:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(n);var i=new Array(r.length);for(t=0;t<i.length;++t)i[t]=r[t][1];return i}function o(t,e){var r=["View",e,"d",t].join("");0>e&&(r="View_Nil"+t);var n="generic"===t;if(-1===e){var o="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);}",a=new Function(o);return a()}if(0===e){var o="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)}",a=new Function("TrivialArray",o);return a(f[t][0])}var o=["'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("+"),h=s.map(function(t){return"b"+t}).join(","),d=s.map(function(t){return"c"+t}).join(",");o.push("function "+r+"(a,"+h+","+d+",d){this.data=a","this.shape=["+h+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),o.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),4>e?(o.push("function "+r+"_order(){"),2===e?o.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),o.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+"]"}),g=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});o.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+g.join(","));for(var v=0;e>v;++v)o.push("if(typeof i"+v+"==='number'&&i"+v+">=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=d}");o.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),o.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 v=0;e>v;++v)o.push("if(typeof i"+v+"==='number'){d=i"+v+"|0;if(d<0){c+=b"+v+"*(a"+v+"-1);a"+v+"=ceil(-a"+v+"/d)}else{a"+v+"=ceil(a"+v+"/d)}b"+v+"*=d}");o.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 m=new Array(e),y=new Array(e),v=0;e>v;++v)m[v]="a[i"+v+"]",y[v]="b[i"+v+"]";o.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;return new "+r+"(this.data,"+m.join(",")+","+y.join(",")+",this.offset)}"),o.push("proto.pick=function "+r+"_pick("+u+"){var a=[],b=[],c=this.offset");for(var v=0;e>v;++v)o.push("if(typeof i"+v+"==='number'&&i"+v+">=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var a=new Function("CTOR_LIST","ORDER",o.join("\n"));return a(f[t],i)}function a(t){if(u(t))return"buffer";if(c)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var i=f.array[0];return i([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=e[l]}if(void 0===n){n=0;for(var l=0;s>l;++l)r[l]<0&&(n-=(e[l]-1)*r[l])}for(var c=a(t),h=f[c];h.length<=s+1;)h.push(o(c,h.length-1));var i=h[s+1];return i(t,e,r,n)}var l=t("iota-array"),u=t("is-buffer"),c="undefined"!=typeof Float64Array,f={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=s},{"iota-array":205,"is-buffer":206}],220:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)throw new TypeError("repeat-string expects a string.");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;for(i===t&&"undefined"!=typeof i||(i=t,o="");r>o.length&&e>0&&(1&e&&(o+=t),e>>=1);)t+=t;return o.substr(0,r)}var i,o="";e.exports=n},{}],221:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],222:[function(t,e,r){"use strict";function n(t){for(var e="robustLinearSolve"+t+"d",r=["function ",e,"(A,b){return ["],n=0;t>n;++n){r.push("det([");for(var i=0;t>i;++i){i>0&&r.push(","),r.push("[");for(var o=0;t>o;++o)o>0&&r.push(","),o===n?r.push("+b[",i,"]"):r.push("+A[",i,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var a=new Function("det",r.join(""));return a(6>t?s[t]:s)}function i(){return[0]}function o(t,e){return[[e[0]],[t[0][0]]]}function a(){for(;u.length<l;)u.push(n(u.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],i=0;l>i;++i)t.push("s"+i),r.push("case ",i,":return s",i,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var o=Function.apply(void 0,t);e.exports=o.apply(void 0,u.concat([u,n]));for(var i=0;l>i;++i)e.exports[i]=u[i]}var s=t("robust-determinant"),l=6,u=[i,o];a()},{"robust-determinant":224}],223:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var o=r,a=t[i];r=o+a;var s=r-o,l=a-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;e>i;++i){var o=t[i],a=r;r=o+a;var s=r-o,l=a-s;l&&(t[u++]=l)}return t[u++]=r,t.length=u,t}e.exports=n},{}],224:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),o=0,a=0;o<t.length;++o)o!==e&&(i[a++]=t[n][o]);return r}function i(t){for(var e=new Array(t),r=0;t>r;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m[",r,"][",n,"]"].join("")}return e}function o(t){return 1&t?"-":""}function a(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r<t.length;++r)e.push(["scale(",s(n(t,r)),",",o(r),t[0][r],")"].join(""));return a(e)}function l(t){var e=new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",s(i(t)),")};return robustDeterminant",t].join(""));return e(f,h,c,d)}function u(){for(;g.length<p;)g.push(l(g.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;p>n;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var i=Function.apply(void 0,t);e.exports=i.apply(void 0,g.concat([g,l]));for(var n=0;n<g.length;++n)e.exports[n]=g[n]}var c=t("two-product"),f=t("robust-sum"),h=t("robust-scale"),d=t("robust-compress"),p=6,g=[function(){return[0]},function(t){return[t[0][0]]}];u()},{"robust-compress":223,"robust-scale":226,"robust-sum":228,"two-product":240}],225:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),o=0,a=0;o<t.length;++o)o!==e&&(i[a++]=t[n][o]);return r}function i(t){for(var e=new Array(t),r=0;t>r;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m",n,"[",t-r-1,"]"].join("");
}return e}function o(t){return 1&t?"-":""}function a(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",a(s(n(t,r))),",",o(r),t[0][r],")"].join(""));return e}function l(t){for(var e=[],r=[],o=i(t),l=[],u=0;t>u;++u)0===(1&u)?e.push.apply(e,s(n(o,u))):r.push.apply(r,s(n(o,u))),l.push("m"+u);var c=a(e),g=a(r),v="orientation"+t+"Exact",m=["function ",v,"(",l.join(),"){var p=",c,",n=",g,",d=sub(p,n);return d[d.length-1];};return ",v].join(""),y=new Function("sum","prod","scale","sub",m);return y(h,f,d,p)}function u(t){var e=_[t.length];return e||(e=_[t.length]=l(t.length)),e.apply(void 0,t)}function c(){for(;_.length<=g;)_.push(l(_.length));for(var t=[],r=["slow"],n=0;g>=n;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;g>=n;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),r.push(i.join(""));var o=Function.apply(void 0,r);e.exports=o.apply(void 0,[u].concat(_));for(var n=0;g>=n;++n)e.exports[n]=_[n]}var f=t("two-product"),h=t("robust-sum"),d=t("robust-scale"),p=t("robust-subtract"),g=5,v=1.1102230246251565e-16,m=(3+16*v)*v,y=(7+56*v)*v,b=l(3),x=l(4),_=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),o=(t[0]-r[0])*(e[1]-r[1]),a=i-o;if(i>0){if(0>=o)return a;n=i+o}else{if(!(0>i))return a;if(o>=0)return a;n=-(i+o)}var s=m*n;return a>=s||-s>=a?a:b(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],o=e[0]-n[0],a=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=o*u,p=a*l,g=a*s,v=i*u,m=i*l,b=o*s,_=c*(d-p)+f*(g-v)+h*(m-b),w=(Math.abs(d)+Math.abs(p))*Math.abs(c)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(m)+Math.abs(b))*Math.abs(h),A=y*w;return _>A||-_>A?_:x(t,e,r,n)}];c()},{"robust-scale":226,"robust-subtract":227,"robust-sum":228,"two-product":240}],226:[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 a=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;i(t[0],e,s),s[0]&&(a[u++]=s[0]);for(var c=1;r>c;++c){i(t[c],e,l);var f=s[1];o(f,l[0],s),s[0]&&(a[u++]=s[0]);var h=l[1],d=s[1],p=h+d,g=p-h,v=d-g;s[1]=p,v&&(a[u++]=v)}return s[1]&&(a[u++]=s[1]),0===u&&(a[u++]=0),a.length=u,a}var i=t("two-product"),o=t("two-sum");e.exports=n},{"two-product":240,"two-sum":241}],227:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,o=e-n,a=t-i,s=a+o;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 o,a,s=r+i,l=new Array(s),u=0,c=0,f=0,h=Math.abs,d=t[c],p=h(d),g=-e[f],v=h(g);v>p?(a=d,c+=1,r>c&&(d=t[c],p=h(d))):(a=g,f+=1,i>f&&(g=-e[f],v=h(g))),r>c&&v>p||f>=i?(o=d,c+=1,r>c&&(d=t[c],p=h(d))):(o=g,f+=1,i>f&&(g=-e[f],v=h(g)));for(var m,y,b,x,_,w=o+a,A=w-o,M=a-A,k=M,T=w;r>c&&i>f;)v>p?(o=d,c+=1,r>c&&(d=t[c],p=h(d))):(o=g,f+=1,i>f&&(g=-e[f],v=h(g))),a=k,w=o+a,A=w-o,M=a-A,M&&(l[u++]=M),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,k=_+x,T=m;for(;r>c;)o=d,a=k,w=o+a,A=w-o,M=a-A,M&&(l[u++]=M),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,k=_+x,T=m,c+=1,r>c&&(d=t[c]);for(;i>f;)o=g,a=k,w=o+a,A=w-o,M=a-A,M&&(l[u++]=M),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,k=_+x,T=m,f+=1,i>f&&(g=-e[f]);return k&&(l[u++]=k),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],228:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,o=e-n,a=t-i,s=a+o;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 o,a,s=r+i,l=new Array(s),u=0,c=0,f=0,h=Math.abs,d=t[c],p=h(d),g=e[f],v=h(g);v>p?(a=d,c+=1,r>c&&(d=t[c],p=h(d))):(a=g,f+=1,i>f&&(g=e[f],v=h(g))),r>c&&v>p||f>=i?(o=d,c+=1,r>c&&(d=t[c],p=h(d))):(o=g,f+=1,i>f&&(g=e[f],v=h(g)));for(var m,y,b,x,_,w=o+a,A=w-o,M=a-A,k=M,T=w;r>c&&i>f;)v>p?(o=d,c+=1,r>c&&(d=t[c],p=h(d))):(o=g,f+=1,i>f&&(g=e[f],v=h(g))),a=k,w=o+a,A=w-o,M=a-A,M&&(l[u++]=M),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,k=_+x,T=m;for(;r>c;)o=d,a=k,w=o+a,A=w-o,M=a-A,M&&(l[u++]=M),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,k=_+x,T=m,c+=1,r>c&&(d=t[c]);for(;i>f;)o=g,a=k,w=o+a,A=w-o,M=a-A,M&&(l[u++]=M),m=T+w,y=m-T,b=m-y,x=w-y,_=T-b,k=_+x,T=m,f+=1,i>f&&(g=e[f]);return k&&(l[u++]=k),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],229:[function(t,e,r){"use strict";function n(t){return t.split("").map(function(t){return t in i?i[t]:""}).join("")}e.exports=n;var i={" ":" ",0:"\u2070",1:"\xb9",2:"\xb2",3:"\xb3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207a","-":"\u207b",a:"\u1d43",b:"\u1d47",c:"\u1d9c",d:"\u1d48",e:"\u1d49",f:"\u1da0",g:"\u1d4d",h:"\u02b0",i:"\u2071",j:"\u02b2",k:"\u1d4f",l:"\u02e1",m:"\u1d50",n:"\u207f",o:"\u1d52",p:"\u1d56",r:"\u02b3",s:"\u02e2",t:"\u1d57",u:"\u1d58",v:"\u1d5b",w:"\u02b7",x:"\u02e3",y:"\u02b8",z:"\u1dbb"}},{}],230:[function(t,e,r){"use strict";function n(t){return"a"+t}function i(t){return"d"+t}function o(t,e){return"c"+t+"_"+e}function a(t){return"s"+t}function s(t,e){return"t"+t+"_"+e}function l(t){return"o"+t}function u(t){return"x"+t}function c(t){return"p"+t}function f(t,e){return"d"+t+"_"+e}function h(t){return"i"+t}function d(t,e){return"u"+t+"_"+e}function p(t){return"b"+t}function g(t){return"y"+t}function v(t){return"e"+t}function m(t){return"v"+t}function y(t,e,r){for(var n=0,i=0;t>i;++i)e&1<<i&&(n|=1<<r[i]);return n}function b(t,e,r,b,x,L){function S(t,e){D.push("for(",h(x[t]),"=",e,";",h(x[t]),"<",a(x[t]),";","++",h(x[t]),"){")}function C(t){for(var e=0;I>e;++e)D.push(c(e),"+=",d(e,x[t]),";");D.push("}")}function P(t){for(var e=t-1;e>=0;--e)S(e,0);for(var r=[],e=0;I>e;++e)L[e]?r.push(i(e)+".get("+c(e)+")"):r.push(i(e)+"["+c(e)+"]");for(var e=0;b>e;++e)r.push(u(e));D.push(A,"[",T,"++]=phase(",r.join(),");");for(var e=0;t>e;++e)C(e);for(var n=0;I>n;++n)D.push(c(n),"+=",d(n,x[t]),";")}function R(t){for(var e=0;I>e;++e)L[e]?D.push(o(e,0),"=",i(e),".get(",c(e),");"):D.push(o(e,0),"=",i(e),"[",c(e),"];");for(var r=[],e=0;I>e;++e)r.push(o(e,0));for(var e=0;b>e;++e)r.push(u(e));D.push(p(0),"=",A,"[",T,"]=phase(",r.join(),");");for(var n=1;1<<O>n;++n)D.push(p(n),"=",A,"[",T,"+",v(n),"];");for(var a=[],n=1;1<<O>n;++n)a.push("("+p(0)+"!=="+p(n)+")");D.push("if(",a.join("||"),"){");for(var s=[],e=0;O>e;++e)s.push(h(e));for(var e=0;I>e;++e){s.push(o(e,0));for(var n=1;1<<O>n;++n)L[e]?D.push(o(e,n),"=",i(e),".get(",c(e),"+",f(e,n),");"):D.push(o(e,n),"=",i(e),"[",c(e),"+",f(e,n),"];"),s.push(o(e,n))}for(var e=0;1<<O>e;++e)s.push(p(e));for(var e=0;b>e;++e)s.push(u(e));D.push("vertex(",s.join(),");",m(0),"=",w,"[",T,"]=",M,"++;");for(var l=(1<<O)-1,d=p(l),n=0;O>n;++n)if(0===(t&~(1<<n))){for(var g=l^1<<n,y=p(g),x=[],_=g;_>0;_=_-1&g)x.push(w+"["+T+"+"+v(_)+"]");x.push(m(0));for(var _=0;I>_;++_)1&n?x.push(o(_,l),o(_,g)):x.push(o(_,g),o(_,l));1&n?x.push(d,y):x.push(y,d);for(var _=0;b>_;++_)x.push(u(_));D.push("if(",d,"!==",y,"){","face(",x.join(),")}")}D.push("}",T,"+=1;")}function N(){for(var t=1;1<<O>t;++t)D.push(E,"=",v(t),";",v(t),"=",g(t),";",g(t),"=",E,";")}function z(t,e){if(0>t)return void R(e);P(t),D.push("if(",a(x[t]),">0){",h(x[t]),"=1;"),z(t-1,e|1<<x[t]);for(var r=0;I>r;++r)D.push(c(r),"+=",d(r,x[t]),";");t===O-1&&(D.push(T,"=0;"),N()),S(t,2),z(t-1,e),t===O-1&&(D.push("if(",h(x[O-1]),"&1){",T,"=0;}"),N()),C(t),D.push("}")}var I=L.length,O=x.length;if(2>O)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var j="extractContour"+x.join("_"),D=[],F=[],B=[],U=0;I>U;++U)B.push(n(U));for(var U=0;b>U;++U)B.push(u(U));for(var U=0;O>U;++U)F.push(a(U)+"="+n(0)+".shape["+U+"]|0");for(var U=0;I>U;++U){F.push(i(U)+"="+n(U)+".data",l(U)+"="+n(U)+".offset|0");for(var V=0;O>V;++V)F.push(s(U,V)+"="+n(U)+".stride["+V+"]|0")}for(var U=0;I>U;++U){F.push(c(U)+"="+l(U)),F.push(o(U,0));for(var V=1;1<<O>V;++V){for(var q=[],H=0;O>H;++H)V&1<<H&&q.push("-"+s(U,H));F.push(f(U,V)+"=("+q.join("")+")|0"),F.push(o(U,V)+"=0")}}for(var U=0;I>U;++U)for(var V=0;O>V;++V){var G=[s(U,x[V])];V>0&&G.push(s(U,x[V-1])+"*"+a(x[V-1])),F.push(d(U,x[V])+"=("+G.join("-")+")|0")}for(var U=0;O>U;++U)F.push(h(U)+"=0");F.push(M+"=0");for(var X=["2"],U=O-2;U>=0;--U)X.push(a(x[U]));F.push(k+"=("+X.join("*")+")|0",A+"=mallocUint32("+k+")",w+"=mallocUint32("+k+")",T+"=0"),F.push(p(0)+"=0");for(var V=1;1<<O>V;++V){for(var Y=[],W=[],H=0;O>H;++H)V&1<<H&&(0===W.length?Y.push("1"):Y.unshift(W.join("*"))),W.push(a(x[H]));var Z="";Y[0].indexOf(a(x[O-2]))<0&&(Z="-");var Q=y(O,V,x);F.push(v(Q)+"=(-"+Y.join("-")+")|0",g(Q)+"=("+Z+Y.join("-")+")|0",p(Q)+"=0")}F.push(m(0)+"=0",E+"=0"),z(O-1,0),D.push("freeUint32(",w,");freeUint32(",A,");");var $=["'use strict';","function ",j,"(",B.join(),"){","var ",F.join(),";",D.join(""),"}","return ",j].join(""),K=new Function("vertex","face","phase","mallocUint32","freeUint32",$);return K(t,e,r,_.mallocUint32,_.freeUint32)}function x(t){function e(t){throw new Error("ndarray-extract-contour: "+t)}"object"!=typeof t&&e("Must specify arguments");var r=t.order;Array.isArray(r)||e("Must specify order");var n=t.arrayArguments||1;1>n&&e("Must have at least one array argument");var i=t.scalarArguments||0;0>i&&e("Scalar arg count must be > 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var o=t.getters||[],a=new Array(n),s=0;n>s;++s)o.indexOf(s)>=0?a[s]=!0:a[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,a)}var _=t("typedarray-pool");e.exports=x;var w="V",A="P",M="N",k="Q",T="X",E="T"},{"typedarray-pool":242}],231:[function(t,e,r){function n(t){if(0>t)return Number("0/0");for(var e=s[0],r=s.length-1;r>0;--r)e+=s[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=7,o=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,s=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function l(t){if(.5>t)return Math.PI/(Math.sin(Math.PI*t)*l(1-t));if(t>100)return Math.exp(n(t));t-=1;for(var e=o[0],r=1;i+2>r;r++)e+=o[r]/(t+r);var a=t+i+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,t+.5)*Math.exp(-a)*e},e.exports.log=n},{}],232:[function(t,e,r){"use strict";function n(t){var e=t.length;if(i>e){for(var r=1,n=0;e>n;++n)for(var a=0;n>a;++a)if(t[n]<t[a])r=-r;else if(t[n]===t[a])return 0;return r}for(var s=o.mallocUint8(e),n=0;e>n;++n)s[n]=0;for(var r=1,n=0;e>n;++n)if(!s[n]){var l=1;s[n]=1;for(var a=t[n];a!==n;a=t[a]){if(s[a])return o.freeUint8(s),0;l+=1,s[a]=1}1&l||(r=-r)}return o.freeUint8(s),r}e.exports=n;var i=32,o=t("typedarray-pool")},{"typedarray-pool":242}],233:[function(t,e,r){"use strict";function n(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,n,i,s=o.mallocUint32(e),l=o.mallocUint32(e),u=0;for(a(t,l),i=0;e>i;++i)s[i]=t[i];for(i=e-1;i>0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,u=(u+r)*i;return o.freeUint32(l),o.freeUint32(s),u}function i(t,e,r){switch(t){case 0:return r?r:[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,i,o,a=1;for(r[0]=0,o=1;t>o;++o)r[o]=o,a=a*o|0;for(o=t-1;o>0;--o)n=e/a|0,e=e-n*a|0,a=a/o|0,i=0|r[o],r[o]=0|r[n],r[n]=0|i;return r}var o=t("typedarray-pool"),a=t("invert-permutation");r.rank=n,r.unrank=i},{"invert-permutation":234,"typedarray-pool":242}],234:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}e.exports=n},{}],235:[function(t,e,r){"use strict";function n(t){if(0>t)return[];if(0===t)return[[0]];for(var e=0|Math.round(a(t+1)),r=[],n=0;e>n;++n){for(var s=i.unrank(t,n),l=[0],u=0,c=0;c<s.length;++c)u+=1<<s[c],l.push(u);o(s)<1&&(l[0]=u,l[t]=0),r.push(l)}return r}e.exports=n;var i=t("permutation-rank"),o=t("permutation-parity"),a=t("gamma")},{gamma:231,"permutation-parity":232,"permutation-rank":233}],236:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":96}],237:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":236}],238:[function(t,e,r){"use strict";function n(t,e){var r=t.length,n=["'use strict';"],i="surfaceNets"+t.join("_")+"d"+e;n.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&n.push("getters:[0],");for(var o=[],l=[],u=0;r>u;++u)o.push("d"+u),l.push("d"+u);for(var u=0;1<<r>u;++u)o.push("v"+u),l.push("v"+u);for(var u=0;1<<r>u;++u)o.push("p"+u),l.push("p"+u);o.push("a","b","c"),l.push("a","c"),n.push("vertex:function vertexFunc(",o.join(),"){");for(var c=[],u=0;1<<r>u;++u)c.push("(p"+u+"<<"+u+")");n.push("var m=(",c.join("+"),")|0;if(m===0||m===",(1<<(1<<r))-1,"){return}");var f=[],h=[];128>=1<<(1<<r)?(n.push("switch(m){"),h=n):n.push("switch(m>>>7){");for(var u=0;1<<(1<<r)>u;++u){if(1<<(1<<r)>128&&u%128===0){f.length>0&&h.push("}}");var d="vExtra"+f.length;n.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;r>b;++b)p[b]=[],g[b]=[],v[b]=0,m[b]=0;for(var b=0;1<<r>b;++b)for(var x=0;r>x;++x){var _=b^1<<x;if(!(_>b)&&!(u&1<<_)!=!(u&1<<b)){var w=1;u&1<<_?g[x].push("v"+_+"-v"+b):(g[x].push("v"+b+"-v"+_),w=-w),0>w?(p[x].push("-v"+b+"-v"+_),v[x]+=2):(p[x].push("v"+b+"+v"+_),v[x]-=2),y+=1;for(var A=0;r>A;++A)A!==x&&(_&1<<A?m[A]+=1:m[A]-=1)}}for(var M=[],x=0;r>x;++x)if(0===p[x].length)M.push("d"+x+"-0.5");else{var k="";v[x]<0?k=v[x]+"*c":v[x]>0&&(k="+"+v[x]+"*c");var T=.5*(p[x].length/y),E=.5+.5*(m[x]/y);M.push("d"+x+"-"+E+"-"+T+"*("+p[x].join("+")+k+")/("+g[x].join("+")+")")}h.push("a.push([",M.join(),"]);","break;")}n.push("}},"),f.length>0&&h.push("}}");for(var L=[],u=0;1<<r-1>u;++u)L.push("v"+u);L.push("c0","c1","p0","p1","a","b","c"),n.push("cell:function cellFunc(",L.join(),"){");var S=s(r-1);n.push("if(p0){b.push(",S.map(function(t){return"["+t.map(function(t){return"v"+t})+"]"}).join(),")}else{b.push(",S.map(function(t){var e=t.slice();return e.reverse(),"["+e.map(function(t){return"v"+t})+"]"}).join(),")}}});function ",i,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",i,";");for(var u=0;u<f.length;++u)n.push(f[u].join(""));var C=new Function("genContour",n.join(""));return C(a)}function i(t,e){for(var r=l(t,e),n=r.length,i=new Array(n),o=new Array(n),a=0;n>a;++a)i[a]=[r[a]],o[a]=[a];return{positions:i,cells:o}}function o(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return i(t,e);var r=t.order.join()+"-"+t.dtype,o=u[r],e=+e||0;return o||(o=u[r]=n(t.order,t.dtype)),o(t,e)}e.exports=o;var a=t("ndarray-extract-contour"),s=t("triangulate-hypercube"),l=t("zero-crossings"),u={}},{"ndarray-extract-contour":230,"triangulate-hypercube":235,"zero-crossings":237}],239:[function(e,r,n){!function(){function e(t,r){if(t=t?t:"",r=r||{},t instanceof e)return t;if(!(this instanceof e))return new e(t,r);var i=n(t);this._originalInput=t,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=U(100*this._a)/100,this._format=r.format||i.format,this._gradientType=r.gradientType,this._r<1&&(this._r=U(this._r)),this._g<1&&(this._g=U(this._g)),this._b<1&&(this._b=U(this._b)),this._ok=i.ok,this._tc_id=F++}function n(t){var e={r:0,g:0,b:0},r=1,n=!1,o=!1;return"string"==typeof t&&(t=I(t)),"object"==typeof t&&(t.hasOwnProperty("r")&&t.hasOwnProperty("g")&&t.hasOwnProperty("b")?(e=i(t.r,t.g,t.b),n=!0,o="%"===String(t.r).substr(-1)?"prgb":"rgb"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("v")?(t.s=R(t.s),t.v=R(t.v),e=l(t.h,t.s,t.v),n=!0,o="hsv"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("l")&&(t.s=R(t.s),t.l=R(t.l),e=a(t.h,t.s,t.l),n=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=k(r),{ok:n,format:t.format||o,r:V(255,q(e.r,0)),g:V(255,q(e.g,0)),b:V(255,q(e.b,0)),a:r}}function i(t,e,r){return{r:255*T(t,255),g:255*T(e,255),b:255*T(r,255)}}function o(t,e,r){t=T(t,255),e=T(e,255),r=T(r,255);var n,i,o=q(t,e,r),a=V(t,e,r),s=(o+a)/2;if(o==a)n=i=0;else{var l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case t:n=(e-r)/l+(r>e?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 a(t,e,r){function n(t,e,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?t+6*(e-t)*r:.5>r?e:2/3>r?t+(e-t)*(2/3-r)*6:t}var i,o,a;if(t=T(t,360),e=T(e,100),r=T(r,100),0===e)i=o=a=r;else{var s=.5>r?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),o=n(l,s,t),a=n(l,s,t-1/3)}return{r:255*i,g:255*o,b:255*a}}function s(t,e,r){t=T(t,255),e=T(e,255),r=T(r,255);var n,i,o=q(t,e,r),a=V(t,e,r),s=o,l=o-a;if(i=0===o?0:l/o,o==a)n=0;else{switch(o){case t:n=(e-r)/l+(r>e?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 l(t,e,r){t=6*T(t,360),e=T(e,100),r=T(r,100);var n=B.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),l=n%6,u=[r,a,o,o,s,r][l],c=[s,r,r,a,o,o][l],f=[o,o,s,r,r,a][l];return{r:255*u,g:255*c,b:255*f}}function u(t,e,r,n){var i=[P(U(t).toString(16)),P(U(e).toString(16)),P(U(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 c(t,e,r,n){var i=[P(N(n)),P(U(t).toString(16)),P(U(e).toString(16)),P(U(r).toString(16))];return i.join("")}function f(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s-=r/100,n.s=E(n.s),e(n)}function h(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s+=r/100,n.s=E(n.s),e(n)}function d(t){return e(t).desaturate(100)}function p(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l+=r/100,n.l=E(n.l),e(n)}function g(t,r){r=0===r?0:r||10;var n=e(t).toRgb();return n.r=q(0,V(255,n.r-U(255*-(r/100)))),n.g=q(0,V(255,n.g-U(255*-(r/100)))),n.b=q(0,V(255,n.b-U(255*-(r/100)))),e(n)}function v(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l-=r/100,n.l=E(n.l),e(n)}function m(t,r){var n=e(t).toHsl(),i=(U(n.h)+r)%360;return n.h=0>i?360+i:i,e(n)}function y(t){var r=e(t).toHsl();return r.h=(r.h+180)%360,e(r)}function b(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+120)%360,s:r.s,l:r.l}),e({h:(n+240)%360,s:r.s,l:r.l})]}function x(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+90)%360,s:r.s,l:r.l}),e({h:(n+180)%360,s:r.s,l:r.l}),e({h:(n+270)%360,s:r.s,l:r.l})]}function _(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+72)%360,s:r.s,l:r.l}),e({h:(n+216)%360,s:r.s,l:r.l})]}function w(t,r,n){r=r||6,n=n||30;var i=e(t).toHsl(),o=360/n,a=[e(t)];for(i.h=(i.h-(o*r>>1)+720)%360;--r;)i.h=(i.h+o)%360,a.push(e(i));return a}function A(t,r){r=r||6;for(var n=e(t).toHsv(),i=n.h,o=n.s,a=n.v,s=[],l=1/r;r--;)s.push(e({h:i,s:o,v:a})),a=(a+l)%1;return s}function M(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function k(t){return t=parseFloat(t),(isNaN(t)||0>t||t>1)&&(t=1),t}function T(t,e){S(t)&&(t="100%");var r=C(t);return t=V(e,q(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),B.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function E(t){return V(1,q(0,t))}function L(t){return parseInt(t,16)}function S(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function C(t){return"string"==typeof t&&-1!=t.indexOf("%")}function P(t){return 1==t.length?"0"+t:""+t}function R(t){return 1>=t&&(t=100*t+"%"),t}function N(t){return Math.round(255*parseFloat(t)).toString(16)}function z(t){return L(t)/255}function I(t){t=t.replace(j,"").replace(D,"").toLowerCase();var e=!1;if(G[t])t=G[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Y.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Y.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Y.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Y.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Y.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Y.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Y.hex8.exec(t))?{a:z(r[1]),r:L(r[2]),g:L(r[3]),b:L(r[4]),format:e?"name":"hex8"}:(r=Y.hex6.exec(t))?{r:L(r[1]),g:L(r[2]),b:L(r[3]),format:e?"name":"hex"}:(r=Y.hex3.exec(t))?{r:L(r[1]+""+r[1]),g:L(r[2]+""+r[2]),b:L(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function O(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var j=/^\s+/,D=/\s+$/,F=0,B=Math,U=B.round,V=B.min,q=B.max,H=B.random;e.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n,i,o,a=this.toRgb();return t=a.r/255,e=a.g/255,r=a.b/255,n=.03928>=t?t/12.92:Math.pow((t+.055)/1.055,2.4),i=.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4),o=.03928>=r?r/12.92:Math.pow((r+.055)/1.055,2.4),.2126*n+.7152*i+.0722*o},setAlpha:function(t){return this._a=k(t),this._roundA=U(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=o(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return c(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(100*T(this._r,255))+"%",g:U(100*T(this._g,255))+"%",b:U(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+U(100*T(this._r,255))+"%, "+U(100*T(this._g,255))+"%, "+U(100*T(this._b,255))+"%)":"rgba("+U(100*T(this._r,255))+"%, "+U(100*T(this._g,255))+"%, "+U(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:X[u(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+c(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var o=e(t);n=o.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return e(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},e.fromRatio=function(t,r){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?n[i]=t[i]:n[i]=R(t[i]));t=n}return e(t,r)},e.equals=function(t,r){return t&&r?e(t).toRgbString()==e(r).toRgbString():!1},e.random=function(){return e.fromRatio({r:H(),g:H(),b:H()})},e.mix=function(t,r,n){n=0===n?0:n||50;var i,o=e(t).toRgb(),a=e(r).toRgb(),s=n/100,l=2*s-1,u=a.a-o.a;i=l*u==-1?l:(l+u)/(1+l*u),i=(i+1)/2;var c=1-i,f={r:a.r*i+o.r*c,g:a.g*i+o.g*c,b:a.b*i+o.b*c,a:a.a*s+o.a*(1-s)};return e(f)},e.readability=function(t,r){var n=e(t),i=e(r);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},e.isReadable=function(t,r,n){var i,o,a=e.readability(t,r);switch(o=!1,i=O(n),i.level+i.size){case"AAsmall":case"AAAlarge":o=a>=4.5;break;case"AAlarge":o=a>=3;break;case"AAAsmall":o=a>=7}return o},e.mostReadable=function(t,r,n){var i,o,a,s,l=null,u=0;n=n||{},o=n.includeFallbackColors,a=n.level,s=n.size;for(var c=0;c<r.length;c++)i=e.readability(t,r[c]),i>u&&(u=i,l=e(r[c]));return e.isReadable(t,l,{level:a,size:s})||!o?l:(n.includeFallbackColors=!1,e.mostReadable(t,["#fff","#000"],n))};var G=e.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},X=e.hexNames=M(G),Y=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof r&&r.exports?r.exports=e:"function"==typeof t&&t.amd?t(function(){return e}):window.tinycolor=e}()},{}],240:[function(t,e,r){"use strict";function n(t,e,r){var n=t*e,o=i*t,a=o-t,s=o-a,l=t-s,u=i*e,c=u-e,f=u-c,h=e-f,d=n-s*f,p=d-l*f,g=p-s*h,v=l*h-g;return r?(r[0]=v,r[1]=n,r):[v,n]}e.exports=n;var i=+(Math.pow(2,27)+1)},{}],241:[function(t,e,r){"use strict";function n(t,e,r){var n=t+e,i=n-t,o=n-i,a=e-i,s=t-o;return r?(r[0]=s+a,r[1]=n,r):[s+a,n]}e.exports=n},{}],242:[function(t,e,r){(function(e,n){"use strict";function i(t){if(t){var e=t.length||t.byteLength,r=y.log2(e);w[r].push(t)}}function o(t){i(t.buffer)}function a(t){var t=y.nextPow2(t),e=y.log2(t),r=w[e];return r.length>0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(a(t),0,t)}function l(t){return new Uint16Array(a(2*t),0,t)}function u(t){return new Uint32Array(a(4*t),0,t)}function c(t){return new Int8Array(a(t),0,t)}function f(t){return new Int16Array(a(2*t),0,t)}function h(t){return new Int32Array(a(4*t),0,t)}function d(t){return new Float32Array(a(4*t),0,t)}function p(t){return new Float64Array(a(8*t),0,t)}function g(t){return x?new Uint8ClampedArray(a(t),0,t):s(t)}function v(t){return new DataView(a(t),0,t)}function m(t){t=y.nextPow2(t);var e=y.log2(t),r=A[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),b=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={
UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,A=_.BUFFER;r.free=function(t){if(n.isBuffer(t))A[y.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=o,r.freeArrayBuffer=i,r.freeBuffer=function(t){A[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return a(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 f(t);case"int32":return h(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return g(t);case"buffer":return m(t);case"data":case"dataview":return v(t);default:return null}return null},r.mallocArrayBuffer=a,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=f,r.mallocInt32=h,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=g,r.mallocDataView=v,r.mallocBuffer=m,r.clearCache=function(){for(var t=0;32>t;++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,A[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":38,buffer:39,dup:102}],243:[function(t,e,r){"use strict";function n(t,e){for(var r=1,n=t.length,i=t[0],o=t[0],a=1;n>a;++a)if(o=i,i=t[a],e(i,o)){if(a===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],o=1;r>o;++o,i=n)if(i=n,n=t[o],n!==i){if(o===e){e++;continue}t[e++]=n}return t.length=e,t}function o(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=o},{}],244:[function(t,e,r){"use strict";function n(t,e){return"object"==typeof e&&null!==e||(e={}),i(t,e.canvas||o,e.context||a,e)}e.exports=n;var i=t("./lib/vtext"),o=null,a=null;"undefined"!=typeof document&&(o=document.createElement("canvas"),o.width=8192,o.height=1024,a=o.getContext("2d"))},{"./lib/vtext":245}],245:[function(t,e,r){"use strict";function n(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",o=[1<<30,1<<30],a=[0,0],s=t.length,l=0;s>l;++l)for(var u=t[l],c=0;2>c;++c)o[c]=0|Math.min(o[c],u[c]),a[c]=0|Math.max(a[c],u[c]);var f=0;switch(n){case"center":f=-.5*(o[0]+a[0]);break;case"right":case"end":f=-a[0];break;case"left":case"start":f=-o[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var h=0;switch(i){case"hanging":case"top":h=-o[1];break;case"middle":h=-.5*(o[1]+a[1]);break;case"alphabetic":case"ideographic":h=-3*r;break;case"bottom":h=-a[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var d=1/r;return"lineHeight"in e?d*=+e.lineHeight:"width"in e?d=e.width/(a[0]-o[0]):"height"in e&&(d=e.height/(a[1]-o[1])),t.map(function(t){return[d*(t[0]+f),d*(t[1]+h)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var o=3*n;t.height<o&&(t.height=o),e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff",e.fillText(r,n,2*n);var a=e.getImageData(0,0,i,o),s=c(a.data,[o,i,4]);return s.pick(-1,-1,0).transpose(1,0)}function o(t,e){var r=u(t,128);return e?f(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function a(t,e,r,i){var a=o(t,i),s=n(a.positions,e,r),l=a.edges,u="ccw"===e.orientation;if(h(s,l),e.polygons||e.polygon||e.polyline){for(var c=p(l,s),f=new Array(c.length),g=0;g<c.length;++g){for(var v=c[g],m=new Array(v.length),y=0;y<v.length;++y){for(var b=v[y],x=new Array(b.length),_=0;_<b.length;++_)x[_]=s[b[_]].slice();u&&x.reverse(),m[y]=x}f[g]=m}return f}return e.triangles||e.triangulate||e.triangle?{cells:d(s,l,{delaunay:!1,exterior:!1,interior:!0}),positions:s}:{edges:l,positions:s}}function s(t,e,r){try{return a(t,e,r,!0)}catch(n){}try{return a(t,e,r,!1)}catch(n){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function l(t,e,r,n){var o=n.size||64,a=n.font||"normal";r.font=o+"px "+a,r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr";var l=i(e,r,t,o);return s(l,n,o)}e.exports=l,e.exports.processPixels=s;var u=t("surface-nets"),c=t("ndarray"),f=t("simplify-planar-graph"),h=t("clean-pslg"),d=t("cdt2d"),p=t("planar-graph-to-polyline")},{cdt2d:45,"clean-pslg":52,ndarray:219,"planar-graph-to-polyline":258,"simplify-planar-graph":262,"surface-nets":238}],246:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),o=new Array(e.length),a=[],s=0;s<e.length;++s){var l=r[s].length;o[s]=l,n[s]=!0,1>=l&&a.push(s)}for(;a.length>0;){var u=a.pop();n[u]=!1;for(var c=r[u],s=0;s<c.length;++s){var f=c[s];0===--o[f]&&a.push(f)}}for(var h=new Array(e.length),d=[],s=0;s<e.length;++s)if(n[s]){var u=d.length;h[s]=u,d.push(e[s])}else h[s]=-1;for(var p=[],s=0;s<t.length;++s){var g=t[s];n[g[0]]&&n[g[1]]&&p.push([h[g[0]],h[g[1]]])}return[p,d]}e.exports=n;var i=t("edges-to-adjacency-list")},{"edges-to-adjacency-list":247}],247:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var n=0;r>n;++n){var o=t[n];e=Math.max(e,o[0],o[1])}e=(0|e)+1}e=0|e;for(var a=new Array(e),n=0;e>n;++n)a[n]=[];for(var n=0;r>n;++n){var o=t[n];a[o[0]].push(o[1]),a[o[1]].push(o[0])}for(var s=0;e>s;++s)i(a[s],function(t,e){return t-e});return a}e.exports=n;var i=t("uniq")},{uniq:243}],248:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=u[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,o){for(var a,s,l,c=0;2>c;++c)if(u[c][n].length>0){a=u[c][n][0],l=c;break}s=a[1^l];for(var f=0;2>f;++f)for(var h=u[f][n],d=0;d<h.length;++d){var p=h[d],g=p[1^f],v=i(e[t],e[n],e[s],e[g]);v>0&&(a=p,s=g,l=f)}return o?s:(a&&r(a,l),s)}function o(t,o){var a=u[o][t][0],s=[t];r(a,o);for(var l=a[1^o];;){for(;l!==t;)s.push(l),l=n(s[s.length-2],l,!1);if(u[0][t].length+u[1][t].length===0)break;var c=s[s.length-1],f=t,h=s[1],d=n(c,f,!0);if(i(e[c],e[f],e[h],e[d])<0)break;s.push(t),l=n(c,f)}return s}function a(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,u=[new Array(s),new Array(s)],c=0;s>c;++c)u[0][c]=[],u[1][c]=[];for(var c=0;l>c;++c){var f=t[c];u[0][f[0]].push(f),u[1][f[1]].push(f)}for(var h=[],c=0;s>c;++c)u[0][c].length+u[1][c].length===0&&h.push([c]);for(var c=0;s>c;++c)for(var d=0;2>d;++d){for(var p=[];u[d][c].length>0;){var g=(u[0][c].length,o(c,d));a(p,g)?p.push.apply(p,g):(p.length>0&&h.push(p),p=g)}p.length>0&&h.push(p)}return h}e.exports=n;var i=t("compare-angle")},{"compare-angle":249}],249:[function(t,e,r){"use strict";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),o=s(r[0],-e[0]),a=s(r[1],-e[1]),c=u(l(n,o),l(i,a));return c[c.length-1]>=0}function i(t,e,r,i){var s=o(e,r,i);if(0===s){var l=a(o(t,e,r)),u=a(o(t,e,i));if(l===u){if(0===l){var c=n(t,e,r),f=n(t,e,i);return c===f?0:c?1:-1}return 0}return 0===u?l>0?-1:n(t,e,i)?-1:1:0===l?u>0?1:n(t,e,r)?1:-1:a(u-l)}var h=o(t,e,r);if(h>0)return s>0&&o(t,e,i)>0?1:-1;if(0>h)return s>0||o(t,e,i)>0?1:-1;var d=o(t,e,i);return d>0?1:n(t,e,r)?1:-1}e.exports=i;var o=t("robust-orientation"),a=t("signum"),s=t("two-sum"),l=t("robust-product"),u=t("robust-sum")},{"robust-orientation":225,"robust-product":250,"robust-sum":228,signum:251,"two-sum":241}],250:[function(t,e,r){"use strict";function n(t,e){if(1===t.length)return o(e,t[0]);if(1===e.length)return o(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(var n=0;n<t.length;++n)r=i(r,o(e,t[n]));else for(var n=0;n<e.length;++n)r=i(r,o(t,e[n]));return r}var i=t("robust-sum"),o=t("robust-scale");e.exports=n},{"robust-scale":226,"robust-sum":228}],251:[function(t,e,r){"use strict";e.exports=function(t){return 0>t?-1:t>0?1:0}},{}],252:[function(t,e,r){arguments[4][9][0].apply(r,arguments)},{dup:9}],253:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function o(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function a(t,e){var r=t.intervals([]);r.push(e),o(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return 0>n?y:(r.splice(n,1),o(t,r),b)}function l(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var i=r(t[n]);if(i)return i}}function u(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function f(t,e){return t-e}function h(t,e){var r=t[0]-e[0];return r?r:t[1]-e[1]}function d(t,e){var r=t[1]-e[1];return r?r:t[0]-e[0]}function p(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(f);for(var i=e[e.length>>1],o=[],a=[],s=[],r=0;r<t.length;++r){var l=t[r];l[1]<i?o.push(l):i<l[0]?a.push(l):s.push(l)}var u=s,c=s.slice();return u.sort(h),c.sort(d),new n(i,p(o),p(a),u,c)}function g(t){this.root=t}function v(t){return new g(t&&0!==t.length?p(t):null)}var m=t("binary-search-bounds"),y=0,b=1,x=2;e.exports=v;var _=n.prototype;_.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},_.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?a(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?a(this,t):this.right.insert(t):this.right=p([t]);else{var r=m.ge(this.leftPoints,t,h),n=m.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},_.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return y;var r=this.right?this.right.count:0;if(4*r>3*(e-1))return s(this,t);var n=this.left.remove(t);return n===x?(this.left=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(t[0]>this.mid){if(!this.right)return y;var o=this.left?this.left.count:0;if(4*o>3*(e-1))return s(this,t);var n=this.right.remove(t);return n===x?(this.right=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(1===this.count)return this.leftPoints[0]===t?x:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var a=this,l=this.left;l.right;)a=l,l=l.right;if(a===this)l.right=this.right;else{var u=this.left,n=this.right;a.count-=l.count,a.right=l.left,l.left=u,l.right=n}i(this,l),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(var u=m.ge(this.leftPoints,t,h);u<this.leftPoints.length&&this.leftPoints[u][0]===t[0];++u)if(this.leftPoints[u]===t){this.count-=1,this.leftPoints.splice(u,1);for(var n=m.ge(this.rightPoints,t,d);n<this.rightPoints.length&&this.rightPoints[n][1]===t[1];++n)if(this.rightPoints[n]===t)return this.rightPoints.splice(n,1),b}return y},_.queryPoint=function(t,e){if(t<this.mid){if(this.left){var r=this.left.queryPoint(t,e);if(r)return r}return l(this.leftPoints,t,e)}if(t>this.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},_.queryInterval=function(t,e,r){if(t<this.mid&&this.left){var n=this.left.queryInterval(t,e,r);if(n)return n}if(e>this.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return e<this.mid?l(this.leftPoints,e,r):t>this.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var w=g.prototype;w.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},w.remove=function(t){if(this.root){var e=this.root.remove(t);return e===x&&(this.root=null),e!==y}return!1},w.queryPoint=function(t,e){return this.root?this.root.queryPoint(t,e):void 0},w.queryInterval=function(t,e,r){return e>=t&&this.root?this.root.queryInterval(t,e,r):void 0},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":252}],254:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]<e[1][0])r=e[0],n=e[1];else{if(!(e[0][0]>e[1][0])){var i=Math.min(t[0][1],t[1][1]),a=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return s>a?a-s:i>l?i-l:a-l}r=e[1],n=e[0]}var u,c;t[0][1]<t[1][1]?(u=t[0],c=t[1]):(u=t[1],c=t[0]);var f=o(n,r,u);return f?f:(f=o(n,r,c),f?f:c-n)}function i(t,e){var r,i;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0]))return n(e,t);r=e[1],i=e[0]}var a,s;if(t[0][0]<t[1][0])a=t[0],s=t[1];else{if(!(t[0][0]>t[1][0]))return-n(t,e);a=t[1],s=t[0]}var l=o(r,i,s),u=o(r,i,a);if(0>l){if(0>=u)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=o(s,a,i),u=o(s,a,r),0>l){if(0>=u)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]}e.exports=i;var o=t("robust-orientation")},{"robust-orientation":225}],255:[function(t,e,r){"use strict";function n(t,e,r,n,i,o){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=o}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function o(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function a(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){var r=l(t,e.left);if(r)return r}var r=t(e.key,e.value);return r?r:e.right?l(t,e.right):void 0}function u(t,e,r,n){var i=e(t,n.key);if(0>=i){if(n.left){var o=u(t,e,r,n.left);if(o)return o}var o=r(n.key,n.value);if(o)return o}return n.right?u(t,e,r,n.right):void 0}function c(t,e,r,n,i){var o,a=r(t,i.key),s=r(e,i.key);if(0>=a){if(i.left&&(o=c(t,e,r,n,i.left)))return o;if(s>0&&(o=n(i.key,i.value)))return o}return s>0&&i.right?c(t,e,r,n,i.right):void 0}function f(t,e){this.tree=t,this._stack=e}function h(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=m);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===v){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=m,r._color=m,s._color=m,a(r),a(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===v){if(n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=m,n._color=m,e._color=m,a(r),a(n),a(s),l>1){var u=t[l-2];u.left===r?u.left=s:u.right=s}return void(t[l-1]=s)}if(n._color===m){if(r._color===v)return r._color=m,void(r.right=o(v,n));r.right=o(v,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=v,a(r),a(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}else{if(n=r.left,n.left&&n.left._color===v){if(n=r.left=i(n),s=n.left=i(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=m,r._color=m,s._color=m,a(r),a(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===v){if(n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=m,n._color=m,e._color=m,a(r),a(n),a(s),l>1){var u=t[l-2];u.right===r?u.right=s:u.left=s}return void(t[l-1]=s)}if(n._color===m){if(r._color===v)return r._color=m,void(r.left=o(v,n));r.left=o(v,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=v,a(r),a(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}}}function p(t,e){return e>t?-1:t>e?1:0}function g(t){return new s(t||p,null)}e.exports=g;var v=0,m=1,y=s.prototype;Object.defineProperty(y,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,"length",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],u=[];i;){var c=r(t,i.key);l.push(i),u.push(c),i=0>=c?i.left:i.right}l.push(new n(v,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){var i=l[f];u[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(var f=l.length-1;f>1;--f){var h=l[f-1],i=l[f];if(h._color===m||i._color===m)break;var d=l[f-2];if(d.left===h)if(h.left===i){var p=d.right;if(!p||p._color!==v){if(d._color=v,d.left=h.right,h._color=m,h.right=d,l[f-2]=h,l[f-1]=i,a(d),a(h),f>=3){var g=l[f-3];g.left===d?g.left=h:g.right=h}break}h._color=m,d.right=o(m,p),d._color=v,f-=1}else{var p=d.right;if(!p||p._color!==v){if(h.right=i.left,d._color=v,d.left=i.right,i._color=m,i.left=h,i.right=d,l[f-2]=i,l[f-1]=h,a(d),a(h),a(i),f>=3){var g=l[f-3];g.left===d?g.left=i:g.right=i}break}h._color=m,d.right=o(m,p),d._color=v,f-=1}else if(h.right===i){var p=d.left;if(!p||p._color!==v){if(d._color=v,d.right=h.left,h._color=m,h.left=d,l[f-2]=h,l[f-1]=i,a(d),a(h),f>=3){var g=l[f-3];g.right===d?g.right=h:g.left=h}break}h._color=m,d.left=o(m,p),d._color=v,f-=1}else{var p=d.left;if(!p||p._color!==v){if(h.left=i.right,d._color=v,d.right=i.left,i._color=m,i.right=h,i.left=d,l[f-2]=i,l[f-1]=h,a(d),a(h),a(i),f>=3){var g=l[f-3];g.right===d?g.right=i:g.left=i}break}h._color=m,d.left=o(m,p),d._color=v,f-=1}}return l[0]._color=m,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),y.at=function(t){if(0>t)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new f(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new f(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var o=e(t,r.key);n.push(r),0>=o&&(i=n.length),r=0>=o?r.left:r.right}return n.length=i,new f(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var o=e(t,r.key);n.push(r),0>o&&(i=n.length),r=0>o?r.left:r.right}return n.length=i,new f(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var o=e(t,r.key);n.push(r),o>0&&(i=n.length),r=0>=o?r.left:r.right}return n.length=i,new f(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var o=e(t,r.key);n.push(r),o>=0&&(i=n.length),r=0>o?r.left:r.right}return n.length=i,new f(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=0>=i?r.left:r.right}return new f(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=0>=n?r.left:r.right}};var b=f.prototype;Object.defineProperty(b,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new f(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var o=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var a=e[o-1];e.push(new n(r._color,a.key,a.value,r.left,r.right,r._count)),e[o-1].key=r.key,e[o-1].value=r.value;for(var i=e.length-2;i>=o;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[o-1].left=e[o]}if(r=e[e.length-1],r._color===v){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i<e.length;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(r.left||r.right){r.left?h(r,r.left):r.right&&h(r,r.right),r._color=m;for(var i=0;i<e.length-1;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(1===e.length)return new s(this.tree._compare,null);for(var i=0;i<e.length;++i)e[i]._count--;var u=e[e.length-2];return d(e),u.left===r?u.left=null:u.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(b,"key",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].key:void 0},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].value:void 0},enumerable:!0}),Object.defineProperty(b,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),b.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var o=e.length-2;o>=0;--o)i=e[o],i.left===e[o+1]?r[o]=new n(i._color,i.key,i.value,r[o+1],i.right,i._count):r[o]=new n(i._color,i.key,i.value,i.left,r[o+1],i._count);return new s(this.tree._compare,r[0])},b.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],256:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function o(t,e){for(var r=null;t;){var n,i,a=t.key;a[0][0]<a[1][0]?(n=a[0],i=a[1]):(n=a[1],i=a[0]);var s=f(n,i,e);if(0>s)t=t.left;else if(s>0)if(e[0]!==a[1][0])r=t,t=t.right;else{var l=o(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==a[1][0])return t;var l=o(t.right,e);if(l)return l;t=t.left}}return r}function a(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),o=0;e>o;++o){var l=t[o],u=l[0][0]<l[1][0];i[2*o]=new s(l[0][0],l,u,o),i[2*o+1]=new s(l[1][0],l,!u,o)}i.sort(function(t,e){var r=t.x-e.x;return r?r:(r=t.create-e.create,r?r:Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1]))});for(var f=c(h),d=[],p=[],g=[],o=0;r>o;){for(var v=i[o].x,m=[];r>o;){var y=i[o];if(y.x!==v)break;o+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]<y.segment[1][1]?(m.push(new a(y.segment[0][1],y.index,!0,!0)),m.push(new a(y.segment[1][1],y.index,!1,!1))):(m.push(new a(y.segment[1][1],y.index,!0,!1)),m.push(new a(y.segment[0][1],y.index,!1,!0)))):f=y.create?f.insert(y.segment,y.index):f.remove(y.segment)}d.push(f.root),p.push(v),g.push(m)}return new n(d,p,g)}e.exports=l;var u=t("binary-search-bounds"),c=t("functional-red-black-tree"),f=t("robust-orientation"),h=t("./lib/order-segments"),d=n.prototype;d.castUp=function(t){var e=u.le(this.coordinates,t[0]);if(0>e)return-1;var r=(this.slabs[e],o(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var a=null;if(r&&(a=r.key),e>0){var s=o(this.slabs[e-1],t);s&&(a?h(s.key,a)>0&&(a=s.key,n=s.value):(n=s.value,a=s.key))}var l=this.horizontal[e];if(l.length>0){var c=u.ge(l,t[1],i);if(c<l.length){var d=l[c];if(t[1]===d.y){if(d.closed)return d.index;for(;c<l.length-1&&l[c+1].y===t[1];)if(c+=1,d=l[c],d.closed)return d.index;if(d.y===t[1]&&!d.start){if(c+=1,c>=l.length)return n;d=l[c]}}if(d.start)if(a){var p=f(a[0],a[1],[t[0],d.y]);a[0][0]>a[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":254,"binary-search-bounds":252,"functional-red-black-tree":255,"robust-orientation":225}],257:[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):!1}}function o(t){for(var e={},r=0;r<t.length;++r){var n=t[r],o=n[0][0],a=n[0][1],s=n[1][1],l=[Math.min(a,s),Math.max(a,s)];o in e?e[o].push(l):e[o]=[l]}for(var u={},c=Object.keys(e),r=0;r<c.length;++r){var f=e[c[r]];u[c[r]]=d(f)}return i(u)}function a(t,e){return function(r){var n=p.le(e,r[0]);if(0>n)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var o=1;i;){var a=i.key,s=f(r,a[0],a[1]);if(a[0][0]<a[1][0])if(0>s)i=i.left;else{if(!(s>0))return 0;o=-1,i=i.right}else if(s>0)i=i.left;else{if(!(0>s))return 0;o=1,i=i.right}}return o}}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;e>i;++i)for(var c=t[i],f=c.length,d=f-1,p=0;f>p;d=p++){var g=c[d],v=c[p];g[0]===v[0]?n.push([g,v]):r.push([g,v])}if(0===r.length)return 0===n.length?s:l(o(n));var m=h(r),y=a(m.slabs,m.coordinates);return 0===n.length?y:u(o(n),y)}e.exports=c;var f=t("robust-orientation")[3],h=t("slab-decomposition"),d=t("interval-tree-1d"),p=t("binary-search-bounds")},{"binary-search-bounds":252,"interval-tree-1d":253,"robust-orientation":225,"slab-decomposition":256}],258:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=[];return e}function o(t,e){function r(t){for(var r=t.length,n=[0],i=0;r>i;++i){var o=e[t[i]],a=e[t[(i+1)%r]],s=u(-o[0],o[1]),l=u(-o[0],a[1]),f=u(a[0],o[1]),h=u(a[0],a[1]);n=c(n,c(c(s,l),c(f,h)))}return n[n.length-1]>0}function o(t){for(var e=t.length,r=0;e>r;++r)if(!z[t[r]])return!1;return!0}var d=h(t,e);t=d[0],e=d[1];for(var p=e.length,g=(t.length,a(t,e.length)),v=0;p>v;++v)if(g[v].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var m=s(t,e);m=m.filter(r);for(var y=m.length,b=new Array(y),x=new Array(y),v=0;y>v;++v){b[v]=v;var _=new Array(y),w=m[v].map(function(t){return e[t]}),A=l([w]),M=0;t:for(var k=0;y>k;++k)if(_[k]=0,v!==k){for(var T=m[k],E=T.length,L=0;E>L;++L){var S=A(e[T[L]]);if(0!==S){0>S&&(_[k]=1,M+=1);continue t}}_[k]=1,M+=1}x[v]=[M,v,_]}x.sort(function(t,e){return e[0]-t[0]});for(var v=0;y>v;++v)for(var _=x[v],C=_[1],P=_[2],k=0;y>k;++k)P[k]&&(b[k]=C);for(var R=i(y),v=0;y>v;++v)R[v].push(b[v]),R[b[v]].push(v);for(var N={},z=n(p,!1),v=0;y>v;++v)for(var T=m[v],E=T.length,k=0;E>k;++k){var I=T[k],O=T[(k+1)%E],j=Math.min(I,O)+":"+Math.max(I,O);if(j in N){var D=N[j];R[D].push(v),R[v].push(D),z[I]=z[O]=!0}else N[j]=v}for(var F=[],B=n(y,-1),v=0;y>v;++v)b[v]!==v||o(m[v])?B[v]=-1:(F.push(v),B[v]=0);for(var d=[];F.length>0;){var U=F.pop(),V=R[U];f(V,function(t,e){return t-e});var q,H=V.length,G=B[U];if(0===G){var T=m[U];q=[T]}for(var v=0;H>v;++v){var X=V[v];if(!(B[X]>=0)&&(B[X]=1^G,F.push(X),0===G)){var T=m[X];o(T)||(T.reverse(),q.push(T))}}0===G&&d.push(q)}return d}e.exports=o;var a=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),f=t("uniq"),h=t("./lib/trim-leaves")},{"./lib/trim-leaves":246,"edges-to-adjacency-list":247,"planar-dual":248,"point-in-big-polygon":257,"robust-sum":228,"two-product":240,uniq:243}],259:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],260:[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;t>e;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,o=this.roots,a=i[r],s=i[n];s>a?o[r]=n:a>s?o[n]=r:(o[n]=r,++i[r])}}},{}],261:[function(t,e,r){arguments[4][204][0].apply(r,arguments)},{"bit-twiddle":259,dup:204,"union-find":260}],262:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.abs(o(t,e,r)),i=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return n/i}function i(t,e,r){function i(t){if(x[t])return 1/0;var r=m[t],i=y[t];return 0>r||0>i?1/0:n(e[t],e[r],e[i])}function o(t,e){var r=k[t],n=k[e];k[t]=n,k[e]=r,T[r]=e,T[n]=t}function s(t){return b[k[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function u(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(L>n){var l=s(n);r>l&&(a=n,r=l)}if(L>i){var u=s(i);r>u&&(a=i)}if(a===t)return t;o(t,a),t=a}}function c(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){var n=s(r);if(n>e){o(t,r),t=r;continue}}return t}}function f(){if(L>0){var t=k[0];return o(0,L-1),L-=1,u(0),t}return-1}function h(t,e){var r=k[t];return b[r]===e?t:(b[r]=-(1/0),c(t),f(),b[r]=e,L+=1,c(L-1))}function d(t){if(!x[t]){x[t]=!0;var e=m[t],r=y[t];m[r]>=0&&(m[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&h(T[e],i(e)),T[r]>=0&&h(T[r],i(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||0>i||i===n)break;if(n=i,i=t[n],!x[n]||0>i||i===n)break;n=i,r=t[r]}while(r!==n);for(var o=e;o!==n;o=t[o])t[o]=n;return n}for(var g=e.length,v=t.length,m=new Array(g),y=new Array(g),b=new Array(g),x=new Array(g),_=0;g>_;++_)m[_]=y[_]=-1,b[_]=1/0,x[_]=!1;for(var _=0;v>_;++_){var w=t[_];if(2!==w.length)throw new Error("Input must be a graph");var A=w[1],M=w[0];-1!==y[M]?y[M]=-2:y[M]=A,-1!==m[A]?m[A]=-2:m[A]=M}for(var k=[],T=new Array(g),_=0;g>_;++_){var E=b[_]=i(_);1/0>E?(T[_]=k.length,k.push(_)):T[_]=-1}for(var L=k.length,_=L>>1;_>=0;--_)u(_);for(;;){var S=f();if(0>S||b[S]>r)break;d(S)}for(var C=[],_=0;g>_;++_)x[_]||(T[_]=C.length,C.push(e[_].slice()));var P=(C.length,[]);return t.forEach(function(t){var e=p(m,t[0]),r=p(y,t[1]);if(e>=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&P.push([n,i])}}),a.unique(a.normalize(P)),{positions:C,edges:P}}e.exports=i;var o=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":225,"simplicial-complex":261}],263:[function(t,e,r){"use strict";e.exports=["",{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",
backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],264:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),o=t("../../plots/cartesian/constants"),a=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:!0,text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:a({},i,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},ax:{valType:"number",dflt:-10},ay:{valType:"number",dflt:-30},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",o.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",o.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":339,"../../plots/cartesian/constants":370,"../../plots/font_attributes":383,"./arrow_paths":263}],265:[function(t,e,r){"use strict";function n(t,e){function r(e,r){return u.coerce(t,n,v.layoutAttributes,e,r)}var n={};r("opacity"),r("align"),r("bgcolor");var i=r("bordercolor"),o=f.opacity(i);r("borderpad");var a=r("borderwidth"),s=r("showarrow");s&&(r("arrowcolor",o?n.bordercolor:f.defaultLine),r("arrowhead"),r("arrowsize"),r("arrowwidth",2*(o&&a||1)),r("ax"),r("ay"),r("axref"),r("ayref"),u.noneOrAll(t,n,["ax","ay"])),r("text",s?" ":"new text"),r("textangle"),u.coerceFont(r,"font",e.font);for(var l=["x","y"],h=0;2>h;h++){var d=l[h],p={_fullLayout:e},g=c.coerceRef(t,n,p,d),m=c.coerceARef(t,n,p,d),y=.5;if("paper"!==g){var b=c.getFromId(p,g);if(y=b.range[0]+y*(b.range[1]-b.range[0]),-1!==["date","category"].indexOf(b.type)&&"string"==typeof t[d]){var x;if("date"===b.type){if(x=u.dateTime2ms(t[d]),x!==!1&&(t[d]=x),m===g){var _=u.dateTime2ms(t["a"+d]);_!==!1&&(t["a"+d]=_)}}else(b._categories||[]).length&&(x=b._categories.indexOf(t[d]),-1!==x&&(t[d]=x))}}r(d,y),s||r(d+"anchor")}return u.noneOrAll(t,n,["x","y"]),n}function i(t){var e=t._fullLayout;e.annotations.forEach(function(e){var r=c.getFromId(t,e.xref),n=c.getFromId(t,e.yref);if(r||n){var i=(e._xsize||0)/2,o=e._xshift||0,a=(e._ysize||0)/2,s=e._yshift||0,l=i-o,u=i+o,f=a-s,h=a+s;if(e.showarrow){var d=3*e.arrowsize*e.arrowwidth;l=Math.max(l,d),u=Math.max(u,d),f=Math.max(f,d),h=Math.max(h,d)}r&&r.autorange&&c.expand(r,[r.l2c(e.x)],{ppadplus:u,ppadminus:l}),n&&n.autorange&&c.expand(n,[n.l2c(e.y)],{ppadplus:h,ppadminus:f})}})}function o(t,e,r,n,i,o,a,s){var l=r-t,u=i-t,c=a-i,f=n-e,h=o-e,d=s-o,p=l*d-c*f;if(0===p)return null;var g=(u*d-c*h)/p,v=(u*f-l*h)/p;return 0>v||v>1||0>g||g>1?null:{x:t+l*g,y:e+f*g}}var a=t("d3"),s=t("fast-isnumeric"),l=t("../../plotly"),u=t("../../lib"),c=t("../../plots/cartesian/axes"),f=t("../color"),h=t("../drawing"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),g=t("../dragelement"),v=e.exports={};v.ARROWPATHS=t("./arrow_paths"),v.layoutAttributes=t("./attributes"),v.supplyLayoutDefaults=function(t,e){for(var r=t.annotations||[],i=e.annotations=[],o=0;o<r.length;o++)i.push(n(r[o]||{},e))},v.drawAll=function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)v.draw(t,r);return l.Plots.previousPromises(t)},v.add=function(t){var e=t._fullLayout.annotations.length;l.relayout(t,"annotations["+e+"]","add")},v.draw=function(t,e,r,i){function m(t){return t.call(h.font,J).attr({"text-anchor":{left:"start",right:"end"}[U.align]||"middle"}),d.convertToTspans(t,y),t}function y(){function r(t,e){return"auto"===e&&(e=1/3>t?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}tt.selectAll("tspan.line").attr({y:0,x:0});var n=W.select(".annotation-math-group"),i=!n.empty(),s=h.bBox((i?n:tt).node()),d=s.width,m=s.height,y=Math.round(d+2*$),b=Math.round(m+2*$);U._w=d,U._h=m;var x=!1;if(["x","y"].forEach(function(e){var n,i=U[e+"ref"]||e,o=c.getFromId(t,i),a=(G+("x"===e?0:90))*Math.PI/180,s=y*Math.abs(Math.cos(a))+b*Math.abs(Math.sin(a)),l=U[e+"anchor"];if(o){if(!o.autorange&&(U[e]-o.range[0])*(U[e]-o.range[1])>0&&(U["a"+e+"ref"]===i?(U["a"+e]-o.range[0])*(U["a"+e]-o.range[1])>0&&(x=!0):x=!0,x))return;H[e]=o._offset+o.l2p(U[e]),n=.5}else n=U[e],"y"===e&&(n=1-n),H[e]="x"===e?S.l+S.w*n:S.t+S.h*n;var u=0;U["a"+e+"ref"]===i?H["aa"+e]=o._offset+o.l2p(U["a"+e]):(u=U.showarrow?U["a"+e]:s*r(n,l),H[e]+=u),U["_"+e+"type"]=o&&o.type,U["_"+e+"size"]=s,U["_"+e+"shift"]=u}),x)return void W.remove();var w,A;U.showarrow&&(w=U.axref===U.xref?H.x:u.constrain(H.x-U.ax,1,_.width-1),A=U.ayref===U.yref?H.y:u.constrain(H.y-U.ay,1,_.height-1)),H.x=u.constrain(H.x,1,_.width-1),H.y=u.constrain(H.y,1,_.height-1);var M=$-s.top,k=$-s.left;i?n.select("svg").attr({x:$-1,y:$}):(tt.attr({x:k,y:M}),tt.selectAll("tspan.line").attr({y:M,x:k})),K.call(h.setRect,Z/2,Z/2,y-Z,b-Z);var T=0,E=0;T=U.axref===U.xref?Math.round(H.aax-y/2):Math.round(H.x-y/2),E=U.ayref===U.yref?Math.round(H.aay-b/2):Math.round(H.y-b/2),W.call(u.setTranslate,T,E);var L="annotations["+e+"]",C=function(r,n){a.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i,s;i=U.axref===U.xref?H.aax+r:H.x+r,s=U.ayref===U.yref?H.aay+n:H.y+n;var c=u.rotationXYMatrix(G,i,s),h=u.apply2DTransform(c),d=u.apply2DTransform2(c),p=K.attr("width")/2,m=K.attr("height")/2,y=[[i-p,s-m,i-p,s+m],[i-p,s+m,i+p,s+m],[i+p,s+m,i+p,s-m],[i+p,s-m,i-p,s-m]].map(d);if(!y.reduce(function(t,e){return t^!!o(w,A,w+1e6,A+1e6,e[0],e[1],e[2],e[3])},!1)){y.forEach(function(t){var e=o(i,s,w,A,t[0],t[1],t[2],t[3]);e&&(i=e.x,s=e.y)});var b=U.arrowwidth,x=U.arrowcolor,_=X.append("g").style({opacity:f.opacity(x)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),M=_.append("path").attr("d","M"+i+","+s+"L"+w+","+A).style("stroke-width",b+"px").call(f.stroke,f.rgb(x));v.arrowhead(M,U.arrowhead,"end",U.arrowsize);var k=_.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(i-w)+","+(s-A),transform:"translate("+w+","+A+")"}).style("stroke-width",b+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");if(t._context.editable){var T,E,C;g.init({element:k.node(),prepFn:function(){var t=u.getTranslate(W);E=t.x,C=t.y,T={},V&&V.autorange&&(T[V._name+".autorange"]=!0),q&&q.autorange&&(T[q._name+".autorange"]=!0)},moveFn:function(t,e){_.attr("transform","translate("+t+","+e+")");var r=h(E,C),n=r[0]+t,i=r[1]+e;W.call(u.setTranslate,n,i),T[L+".x"]=V?U.x+t/V._m:(w+t-S.l)/S.w,T[L+".y"]=q?U.y+e/q._m:1-(A+e-S.t)/S.h,U.axref===U.xref&&(T[L+".ax"]=V?U.ax+t/V._m:(w+t-S.l)/S.w),U.ayref===U.yref&&(T[L+".ay"]=q?U.ay+e/q._m:1-(A+e-S.t)/S.h),Y.attr({transform:"rotate("+G+","+n+","+i+")"})},doneFn:function(e){if(e){l.relayout(t,T);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};U.showarrow&&C(0,0);var P=u.rotationXYMatrix(G,H.x,H.y),R=u.apply2DTransform(P);if(t._context.editable){var N,z,I;g.init({element:W.node(),prepFn:function(){var t=u.getTranslate(W);N=t.x,z=t.y,I={}},moveFn:function(t,e){W.call(u.setTranslate,N+t,z+e);var r="pointer";if(U.showarrow)U.axref===U.xref?I[L+".ax"]=V.p2l(V.l2p(U.ax)+t):I[L+".ax"]=U.ax+t,U.ayref===U.yref?I[L+".ay"]=q.p2l(q.l2p(U.ay)+e):I[L+".ay"]=U.ay+e,C(t,e);else{if(V)I[L+".x"]=U.x+t/V._m;else{var n=U._xsize/S.w,i=U.x+U._xshift/S.w-n/2;I[L+".x"]=g.align(i+t/S.w,n,0,1,U.xanchor)}if(q)I[L+".y"]=U.y+e/q._m;else{var o=U._ysize/S.h,a=U.y-U._yshift/S.h-o/2;I[L+".y"]=g.align(a-e/S.h,o,0,1,U.yanchor)}V&&q||(r=g.getCursor(V?.5:I[L+".x"],q?.5:I[L+".y"],U.xanchor,U.yanchor))}var s=R(N,z),l=s[0]+t,c=s[1]+e;W.call(u.setTranslate,N+t,z+e),Y.attr({transform:"rotate("+G+","+l+","+c+")"}),p(W,r)},doneFn:function(e){if(p(W),e){l.relayout(t,I);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var b,x=t.layout,_=t._fullLayout;if(!s(e)||-1===e){if(!e&&Array.isArray(i))return x.annotations=i,v.supplyLayoutDefaults(x,_),void v.drawAll(t);if("remove"===i)return delete x.annotations,_.annotations=[],void v.drawAll(t);if(r&&"add"!==i){for(b=0;b<_.annotations.length;b++)v.draw(t,b,r,i);return}e=_.annotations.length,_.annotations.push({})}if(!r&&i){if("remove"===i){for(_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove(),_.annotations.splice(e,1),x.annotations.splice(e,1),b=e;b<_.annotations.length;b++)_._infolayer.selectAll('.annotation[data-index="'+(b+1)+'"]').attr("data-index",String(b)),v.draw(t,b);return}if("add"===i||u.isPlainObject(i)){_.annotations.splice(e,0,{});var w=u.isPlainObject(i)?u.extendFlat({},i):{text:"New text"};for(x.annotations?x.annotations.splice(e,0,w):x.annotations=[w],b=_.annotations.length-1;b>e;b--)_._infolayer.selectAll('.annotation[data-index="'+(b-1)+'"]').attr("data-index",String(b)),v.draw(t,b)}}_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var A=x.annotations[e],M=_.annotations[e];if(A){var k={xref:A.xref,yref:A.yref},T={};"string"==typeof r&&r?T[r]=i:u.isPlainObject(r)&&(T=r);var E=Object.keys(T);for(b=0;b<E.length;b++){var L=E[b];u.nestedProperty(A,L).set(T[L])}var S=_._size,C=["x","y"];for(b=0;2>b;b++){var P=C[b];if(void 0===T[P]&&void 0!==A[P]){var R=c.getFromId(t,c.coerceRef(k,{},t,P)),N=c.getFromId(t,c.coerceRef(A,{},t,P)),z=A[P],I=M["_"+P+"type"];if(void 0!==T[P+"ref"]){var O="auto"===A[P+"anchor"],j="x"===P?S.w:S.h,D=(M["_"+P+"size"]||0)/(2*j);if(R&&N)z=(z-R.range[0])/(R.range[1]-R.range[0]),z=N.range[0]+z*(N.range[1]-N.range[0]);else if(R){if(z=(z-R.range[0])/(R.range[1]-R.range[0]),z=R.domain[0]+z*(R.domain[1]-R.domain[0]),O){var F=z+D,B=z-D;2/3>z+B?z=B:z+F>4/3&&(z=F)}}else N&&(O&&(1/3>z?z+=D:z>2/3&&(z-=D)),z=(z-N.domain[0])/(N.domain[1]-N.domain[0]),z=N.range[0]+z*(N.range[1]-N.range[0]))}N&&N===R&&I&&("log"===I&&"log"!==N.type?z=Math.pow(10,z):"log"!==I&&"log"===N.type&&(z=z>0?Math.log(z)/Math.LN10:void 0)),A[P]=z}}var U=n(A,_);_.annotations[e]=U;var V=c.getFromId(t,U.xref),q=c.getFromId(t,U.yref),H={x:0,y:0},G=+U.textangle||0,X=_._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",U.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:A,fullAnnotation:U})}),Y=X.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),W=Y.append("g"),Z=U.borderwidth,Q=U.borderpad,$=Z+Q,K=W.append("rect").attr("class","bg").style("stroke-width",Z+"px").call(f.stroke,U.bordercolor).call(f.fill,U.bgcolor),J=U.font,tt=W.append("text").classed("annotation",!0).attr("data-unformatted",U.text).text(U.text);t._context.editable?tt.call(d.makeEditable,W).call(m).on("edit",function(r){U.text=r,this.attr({"data-unformatted":U.text}),this.call(m);var n={};n["annotations["+e+"].text"]=U.text,V&&V.autorange&&(n[V._name+".autorange"]=!0),q&&q.autorange&&(n[q._name+".autorange"]=!0),l.relayout(t,n)}):tt.call(m),Y.attr({transform:"rotate("+G+","+H.x+","+H.y+")"}).call(h.setPosition,H.x,H.y)}},v.arrowhead=function(t,e,r,n){s(n)||(n=1);var i=t.node(),o=v.ARROWPATHS[e||0];if(o){"string"==typeof r&&r||(r="end");var l,u,c,d,p=(h.getPx(t,"stroke-width")||1)*n,g=t.style("stroke")||f.defaultLine,m=t.style("stroke-opacity")||1,y=r.indexOf("start")>=0,b=r.indexOf("end")>=0,x=o.backoff*p;if("line"===i.nodeName){if(l={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")},c=Math.atan2(l.y-u.y,l.x-u.x),d=c+Math.PI,x){var _=x*Math.cos(c),w=x*Math.sin(c);y&&(l.x-=_,l.y-=w,t.attr({x1:l.x,y1:l.y})),b&&(u.x+=_,u.y+=w,t.attr({x2:u.x,y2:u.y}))}}else if("path"===i.nodeName){var A=i.getTotalLength(),M="";if(y){var k=i.getPointAtLength(0),T=i.getPointAtLength(.1);c=Math.atan2(k.y-T.y,k.x-T.x),l=i.getPointAtLength(Math.min(x,A)),x&&(M="0px,"+x+"px,")}if(b){var E=i.getPointAtLength(A),L=i.getPointAtLength(A-.1);if(d=Math.atan2(E.y-L.y,E.x-L.x),u=i.getPointAtLength(Math.max(0,A-x)),x){var S=M?2*x:x;M+=A-S+"px,"+A+"px"}}else M&&(M+=A+"px");M&&t.style("stroke-dasharray",M)}var C=function(r,n){e>5&&(n=0),a.select(i.parentElement).append("path").attr({"class":t.attr("class"),d:o.path,transform:"translate("+r.x+","+r.y+")rotate("+180*n/Math.PI+")scale("+p+")"}).style({fill:g,opacity:m,"stroke-width":0})};y&&C(l,c),b&&C(u,d)}},v.calcAutorange=function(t){var e=t._fullLayout,r=e.annotations;if(r.length&&t._fullData.length){var n={};r.forEach(function(t){n[t.xref]=!0,n[t.yref]=!0});var o=c.list(t).filter(function(t){return t.autorange&&n[t._id]});if(o.length)return u.syncOrAsync([v.drawAll,i],t)}}},{"../../lib":342,"../../lib/setcursor":351,"../../lib/svg_text_utils":355,"../../plotly":362,"../../plots/cartesian/axes":365,"../color":267,"../dragelement":288,"../drawing":290,"./arrow_paths":263,"./attributes":264,d3:100,"fast-isnumeric":104}],266:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.lightFraction=1e3/11},{}],267:[function(t,e,r){"use strict";function n(t){if(o(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var a=0;a<n.length;a++){if(!n[a].length)return t;if(n[a]=Number(n[a]),!(n[a]>=0))return t;if(3===a)n[a]>1&&(n[a]=1);else if(n[a]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),o=t("fast-isnumeric"),a=e.exports={},s=t("./attributes");a.defaults=s.defaults,a.defaultLine=s.defaultLine,a.lightLine=s.lightLine,a.background=s.background,a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(i(t))},a.opacity=function(t){return t?i(t).getAlpha():0},a.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||a.background).toRgb(),o=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},s={r:o.r*(1-r.a)+r.r*r.a,g:o.g*(1-r.a)+r.g*r.a,b:o.b*(1-r.a)+r.b*r.a};return i(s).toRgbString()},a.stroke=function(t,e){var r=i(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=i(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,i,o,s=Object.keys(t);for(e=0;e<s.length;e++)if(i=s[e],o=t[i],"color"===i.substr(i.length-5))if(Array.isArray(o))for(r=0;r<o.length;r++)o[r]=n(o[r]);else t[i]=n(o);else if("colorscale"===i.substr(i.length-10)&&Array.isArray(o))for(r=0;r<o.length;r++)Array.isArray(o[r])&&(o[r][1]=n(o[r][1]));else if(Array.isArray(o)){var l=o[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<o.length;r++)a.clean(o[r])}else o&&"object"==typeof o&&a.clean(o)}}},{"./attributes":266,"fast-isnumeric":104,tinycolor2:239}],268:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),o=t("../../lib/extend").extendFlat;e.exports={thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:o({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:o({},i,{}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},{"../../lib/extend":339,"../../plots/cartesian/layout_attributes":374,"../../plots/font_attributes":383}],269:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),a=t("../../plots/cartesian/tick_label_defaults"),s=t("./attributes");e.exports=function(t,e,r){function l(t,e){return n.coerce(c,u,s,t,e)}var u=e.colorbar={},c=t.colorbar||{},f=l("thicknessmode");l("thickness","fraction"===f?30/(r.width-r.margin.l-r.margin.r):30);var h=l("lenmode");l("len","fraction"===h?1:r.height-r.margin.t-r.margin.b),l("x"),l("xanchor"),l("xpad"),l("y"),l("yanchor"),l("ypad"),n.noneOrAll(c,u,["x","y"]),l("outlinecolor"),l("outlinewidth"),l("bordercolor"),l("borderwidth"),l("bgcolor"),i(c,u,l,"linear"),a(c,u,l,"linear",{outerTicks:!1,font:r.font,noHover:!0}),o(c,u,l,"linear",{outerTicks:!1,font:r.font,noHover:!0}),l("title"),n.coerceFont(l,"titlefont",r.font),l("titleside")}},{"../../lib":342,"../../plots/cartesian/tick_label_defaults":380,"../../plots/cartesian/tick_mark_defaults":381,"../../plots/cartesian/tick_value_defaults":382,"./attributes":268}],270:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),o=t("../../plotly"),a=t("../../plots/plots"),s=t("../../plots/cartesian/axes"),l=t("../dragelement"),u=t("../../lib"),c=t("../../lib/extend").extendFlat,f=t("../../lib/setcursor"),h=t("../drawing"),d=t("../color"),p=t("../titles"),g=t("../../plots/cartesian/axis_defaults"),v=t("../../plots/cartesian/position_defaults"),m=t("../../plots/cartesian/layout_attributes"),y=t("./attributes");e.exports=function(t,e){function r(){function y(t,e){return u.coerce($,K,m,t,e)}function _(){if(-1!==["top","bottom"].indexOf(x.titleside)){var e=it.select(".cbtitle"),r=e.select("text"),o=[-x.outlinewidth/2,x.outlinewidth/2],a=e.select(".h"+K._id+"title-math-group").node(),l=15.6;if(r.node()&&(l=1.3*parseInt(r.style("font-size"),10)),a?(at=h.bBox(a).height,at>l&&(o[1]-=(at-l)/2)):r.node()&&!r.classed("js-placeholder")&&(at=h.bBox(e.node()).height),at){if(at+=5,"top"===x.titleside)K.domain[1]-=at/k.h,o[1]*=-1;else{K.domain[0]+=at/k.h;var c=Math.max(1,r.selectAll("tspan.line").size());o[1]+=(1-c)*l}e.attr("transform","translate("+o+")"),K.setScale()}}it.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(k.h*(1-K.domain[1]))+")");var f=it.select(".cbfills").selectAll("rect.cbfill").data(S);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?E[0]:(S[e]+S[e-1])/2,e===S.length-1?E[1]:(S[e]+S[e+1])/2].map(K.c2p).map(Math.round);e!==S.length-1&&(r[1]+=r[1]>r[0]?1:-1);var o=P(t).replace("e-",""),a=i(o).toHexString();n.select(this).attr({x:X,width:Math.max(F,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:a})});var d=it.select(".cblines").selectAll("path.cbline").data(x.line.color&&x.line.width?L:[]);return d.enter().append("path").classed("cbline",!0),d.exit().remove(),d.each(function(t){n.select(this).attr("d","M"+X+","+(Math.round(K.c2p(t))+x.line.width/2%1)+"h"+F).call(h.lineGroupStyle,x.line.width,C(t),x.line.dash)}),K._axislayer.selectAll("g."+K._id+"tick,path").remove(),K._pos=X+F+(x.outlinewidth||0)/2-("outside"===x.ticks?1:0),K.side="right",u.syncOrAsync([function(){return s.doTicks(t,K,!0)},function(){if(-1===["top","bottom"].indexOf(x.titleside)){var e=K.titlefont.size,r=K._offset+K._length/2,i=k.l+(K.position||0)*k.w+("right"===K.side?10+e*(K.showticklabels?1:.5):-10-e*(K.showticklabels?.5:0));w("h"+K._id+"title",{avoid:{selection:n.select(t).selectAll("g."+K._id+"tick"),side:x.titleside,offsetLeft:k.l,offsetTop:k.t,maxShift:M.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function w(e,r){var n,i=b();n=a.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var o={propContainer:K,propName:n,traceIndex:i.index,dfltName:"colorscale",containerGroup:it.select(".cbtitle")},s="h"===e.charAt(0)?e.substr(1):"h"+e;it.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(t,e,c(o,r||{}))}function A(){var r=F+x.outlinewidth/2+h.bBox(K._axislayer.node()).width;if(O=ot.select("text"),O.node()&&!O.classed("js-placeholder")){var n,i=ot.select(".h"+K._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(x.titleside)?h.bBox(i).width:h.bBox(ot.node()).right-X-k.l,r=Math.max(r,n)}var o=2*x.xpad+r+x.borderwidth+x.outlinewidth/2,s=Z-Q;it.select(".cbbg").attr({x:X-x.xpad-(x.borderwidth+x.outlinewidth)/2,y:Q-H,width:Math.max(o,2),height:Math.max(s+2*H,2)}).call(d.fill,x.bgcolor).call(d.stroke,x.bordercolor).style({"stroke-width":x.borderwidth}),it.selectAll(".cboutline").attr({x:X,y:Q+x.ypad+("top"===x.titleside?at:0),width:Math.max(F,2),height:Math.max(s-2*x.ypad-at,2)}).call(d.stroke,x.outlinecolor).style({fill:"None","stroke-width":x.outlinewidth});var l=({center:.5,right:1}[x.xanchor]||0)*o;it.attr("transform","translate("+(k.l-l)+","+k.t+")"),a.autoMargin(t,e,{x:x.x,y:x.y,l:o*({right:1,center:.5}[x.xanchor]||0),r:o*({left:1,center:.5}[x.xanchor]||0),t:s*({bottom:1,middle:.5}[x.yanchor]||0),b:s*({top:1,middle:.5}[x.yanchor]||0)})}var M=t._fullLayout,k=M._size;if("function"!=typeof x.fillcolor&&"function"!=typeof x.line.color)return void M._infolayer.selectAll("g."+e).remove();var T,E=n.extent(("function"==typeof x.fillcolor?x.fillcolor:x.line.color).domain()),L=[],S=[],C="function"==typeof x.line.color?x.line.color:function(){return x.line.color},P="function"==typeof x.fillcolor?x.fillcolor:function(){return x.fillcolor},R=x.levels.end+x.levels.size/100,N=x.levels.size,z=1.001*E[0]-.001*E[1],I=1.001*E[1]-.001*E[0];for(T=x.levels.start;0>(T-R)*N;T+=N)T>z&&I>T&&L.push(T);if("function"==typeof x.fillcolor)if(x.filllevels)for(R=x.filllevels.end+x.filllevels.size/100,N=x.filllevels.size,T=x.filllevels.start;0>(T-R)*N;T+=N)T>E[0]&&T<E[1]&&S.push(T);else S=L.map(function(t){return t-x.levels.size/2}),S.push(S[S.length-1]+x.levels.size);else x.fillcolor&&"string"==typeof x.fillcolor&&(S=[0]);x.levels.size<0&&(L.reverse(),S.reverse());var O,j=M.height-M.margin.t-M.margin.b,D=M.width-M.margin.l-M.margin.r,F=Math.round(x.thickness*("fraction"===x.thicknessmode?D:1)),B=F/k.w,U=Math.round(x.len*("fraction"===x.lenmode?j:1)),V=U/k.h,q=x.xpad/k.w,H=(x.borderwidth+x.outlinewidth)/2,G=x.ypad/k.h,X=Math.round(x.x*k.w+x.xpad),Y=x.x-B*({middle:.5,right:1}[x.xanchor]||0),W=x.y+V*(({top:-.5,bottom:.5}[x.yanchor]||0)-.5),Z=Math.round(k.h*(1-W)),Q=Z-U,$={type:"linear",range:E,tickmode:x.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,showticklabels:x.showticklabels,tickfont:x.tickfont,tickangle:x.tickangle,tickformat:x.tickformat,exponentformat:x.exponentformat,showexponent:x.showexponent,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,title:x.title,titlefont:x.titlefont,anchor:"free",position:1},K={},J={letter:"y",font:M.font,noHover:!0};if(g($,K,y,J),v($,K,y,J),K._id="y"+e,K._gd=t,K.position=x.x+q+B,r.axis=K,-1!==["top","bottom"].indexOf(x.titleside)&&(K.titleside=x.titleside,K.titlex=x.x+q,K.titley=W+("top"===x.titleside?V-G:G)),x.line.color&&"auto"===x.tickmode){K.tickmode="linear",K.tick0=x.levels.start;var tt=x.levels.size,et=u.constrain((Z-Q)/50,4,15)+1,rt=(E[1]-E[0])/((x.nticks||et)*tt);if(rt>1){var nt=Math.pow(10,Math.floor(Math.log(rt)/Math.LN10));tt*=nt*u.roundUp(rt/nt,[2,5,10]),(Math.abs(x.levels.start)/x.levels.size+1e-6)%1<2e-6&&(K.tick0=0)}K.dtick=tt}K.domain=[W+G,W+V-G],K.setScale();var it=M._infolayer.selectAll("g."+e).data([0]);it.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),it.attr("transform","translate("+Math.round(k.l)+","+Math.round(k.t)+")");var ot=it.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(k.l)+",-"+Math.round(k.t)+")");K._axislayer=it.select(".cbaxis");var at=0;if(-1!==["top","bottom"].indexOf(x.titleside)){var st,lt=k.l+(x.x+q)*k.w,ut=K.titlefont.size;st="top"===x.titleside?(1-(W+V-G))*k.h+k.t+3+.75*ut:(1-(W+G))*k.h+k.t-3-.25*ut,w(K._id+"title",{attributes:{x:lt,y:st,"text-anchor":"start"}})}var ct=u.syncOrAsync([a.previousPromises,_,a.previousPromises,A],t);if(ct&&ct.then&&(t._promises||[]).push(ct),t._context.editable){var ft,ht,dt;l.init({element:it.node(),prepFn:function(){ft=it.attr("transform"),f(it)},moveFn:function(t,e){it.attr("transform",ft+" translate("+t+","+e+")"),ht=l.align(Y+t/k.w,B,0,1,x.xanchor),dt=l.align(W-e/k.h,V,0,1,x.yanchor);var r=l.getCursor(ht,dt,x.xanchor,x.yanchor);f(it,r)},doneFn:function(e){f(it),e&&void 0!==ht&&void 0!==dt&&o.restyle(t,{"colorbar.x":ht,"colorbar.y":dt},b().index)}})}return ct}function b(){var r,n,i=e.substr(2);for(r=0;r<t._fullData.length;r++)if(n=t._fullData[r],n.uid===i)return n}var x={};return Object.keys(y).forEach(function(t){x[t]=null}),x.fillcolor=null,x.line={color:null,width:null,dash:null},x.levels={start:null,end:null,size:null},x.filllevels=null,Object.keys(x).forEach(function(t){r[t]=function(e){return arguments.length?(x[t]=u.isPlainObject(x[t])?u.extendFlat(x[t],e):e,r):x[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=x,r}},{"../../lib":342,"../../lib/extend":339,"../../lib/setcursor":351,"../../plotly":362,"../../plots/cartesian/axes":365,"../../plots/cartesian/axis_defaults":366,"../../plots/cartesian/layout_attributes":374,"../../plots/cartesian/position_defaults":377,"../../plots/plots":398,"../color":267,"../dragelement":288,"../drawing":290,"../titles":330,"./attributes":268,d3:100,tinycolor2:239}],271:[function(t,e,r){"use strict";e.exports=function(t){return"object"==typeof t.colorbar&&null!==t.colorbar}},{}],272:[function(t,e,r){"use strict";r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.draw=t("./draw"),r.hasColorbar=t("./has_colorbar")},{"./attributes":268,"./defaults":269,"./draw":270,"./has_colorbar":271}],273:[function(t,e,r){"use strict";e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0}}},{}],274:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./scales"),o=t("./flip_scale");e.exports=function(t,e,r,a){var s,l;r?(s=n.nestedProperty(t,r).get(),l=n.nestedProperty(t._input,r).get()):(s=t,l=t._input);var u=s[a+"auto"],c=s[a+"min"],f=s[a+"max"],h=s.colorscale;u===!1&&void 0!==c||(c=n.aggNums(Math.min,null,e)),u===!1&&void 0!==f||(f=n.aggNums(Math.max,null,e)),c===f&&(c-=.5,f+=.5),s[a+"min"]=c,s[a+"max"]=f,l[a+"min"]=c,l[a+"max"]=f,s.autocolorscale&&(h=0>c*f?i.RdBu:c>=0?i.Reds:i.Blues,l.colorscale=h,s.reversescale&&(h=o(h)),s.colorscale=h)}},{"../../lib":342,"./flip_scale":278,"./scales":285}],275:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{}),cmax:i({},n.zmax,{}),cmin:i({},n.zmin,{}),autocolorscale:i({},n.autocolorscale,{}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":339,"./attributes":273,"./scales.js":285}],276:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":285}],277:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),o=t("../colorbar/has_colorbar"),a=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,u,c){var f=c.prefix,h=c.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,g=f?i.nestedProperty(e,d).get()||{}:e,v=p[h+"min"],m=p[h+"max"],y=p.colorscale,b=n(v)&&n(m)&&m>v;u(f+h+"auto",!b),u(f+h+"min"),u(f+h+"max");var x;void 0!==y&&(x=!s(y)),u(f+"autocolorscale",x);var _=u(f+"colorscale"),w=u(f+"reversescale");if(w&&(g.colorscale=l(_)),"marker.line."!==f){var A;f&&(A=o(p));var M=u(f+"showscale",A);M&&a(p,g,r)}}},{"../../lib":342,"../colorbar/defaults":269,"../colorbar/has_colorbar":271,"./flip_scale":278,"./is_valid_scale":282,"fast-isnumeric":104}],278:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,o=0;i>=0;i--,o++)e=t[i],n[o]=[1-e[0],e[1]];return n}},{}],279:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),o=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e):e}},{"./default_scale":276,"./is_valid_scale_array":283,"./scales":285}],280:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),o=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,a=r.color,s=!1;if(Array.isArray(a))for(var l=0;l<a.length;l++)if(n(a[l])){s=!0;break}return"object"==typeof r&&null!==r&&(s||r.showscale===!0||n(r.cmin)&&n(r.cmax)||o(r.colorscale)||"object"==typeof r.colorbar&&null!==r.colorbar)}},{"../../lib":342,"./is_valid_scale":282,"fast-isnumeric":104}],281:[function(t,e,r){"use strict";r.scales=t("./scales"),r.defaultScale=t("./default_scale"),r.attributes=t("./attributes"),r.handleDefaults=t("./defaults"),r.calc=t("./calc"),r.hasColorscale=t("./has_colorscale"),r.isValidScale=t("./is_valid_scale"),r.getScale=t("./get_scale"),r.flipScale=t("./flip_scale"),r.makeScaleFunction=t("./make_scale_function")},{"./attributes":273,"./calc":274,"./default_scale":276,"./defaults":277,"./flip_scale":278,"./get_scale":279,"./has_colorscale":280,"./is_valid_scale":282,"./make_scale_function":284,"./scales":285}],282:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]?!0:i(t)}},{"./is_valid_scale_array":283,"./scales":285}],283:[function(t,e,r){"use strict";var n=t("tinycolor2");e.exports=function(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!==+t[0][0]||1!==+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var i=t[r];if(2!==i.length||+i[0]<e||!n(i[1]).isValid())return!1;e=+i[0]}return!0}},{tinycolor2:239}],284:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),o=t("fast-isnumeric"),a=t("../../lib"),s=t("../color");e.exports=function(t,e,r){for(var l,u=t.length,c=new Array(u),f=new Array(u),h=0;u>h;h++)l=t[h],c[h]=e+l[0]*(r-e),f[h]=i(l[1]).toRgb();
var d=n.scale.linear().domain(c).interpolate(n.interpolateObject).range(f);return function(t){if(o(t)){var n=a.constrain(t,e,r),l=d(n);return i(l).toRgbString()}return i(t).isValid()?t:s.defaultLine}}},{"../../lib":342,"../color":267,d3:100,"fast-isnumeric":104,tinycolor2:239}],285:[function(t,e,r){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],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"]]}},{}],286:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var o=(t-r)/(n-r),a=o+e/(n-r),s=(o+a)/2;return"left"===i||"bottom"===i?o:"center"===i||"middle"===i?s:"right"===i||"top"===i?a:2/3-s>o?o:a>4/3-s?a:s}},{}],287:[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,o){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":342}],288:[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&&o.plot(t)}var o=t("../../plotly"),a=t("../../lib"),s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){function e(e){return t.element.onmousemove=p,g._dragged=!1,g._dragging=!0,u=e.clientX,c=e.clientY,d=e.target,f=(new Date).getTime(),f-g._mouseDownTime<m?v+=1:(v=1,g._mouseDownTime=f),t.prepFn&&t.prepFn(e,u,c),h=n(),h.onmousemove=r,h.onmouseup=o,h.onmouseout=o,h.style.cursor=window.getComputedStyle(t.element).cursor,a.pauseEvent(e)}function r(e){var r=e.clientX-u,n=e.clientY-c,i=t.minDrag||s.MINDRAG;return Math.abs(r)<i&&(r=0),Math.abs(n)<i&&(n=0),(r||n)&&(g._dragged=!0,l.unhover(g)),t.moveFn&&t.moveFn(r,n,g._dragged),a.pauseEvent(e)}function o(e){if(p=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),h.onmousemove=null,h.onmouseup=null,h.onmouseout=null,a.removeElement(h),!g._dragging)return void(g._dragged=!1);if(g._dragging=!1,(new Date).getTime()-g._mouseDownTime>m&&(v=Math.max(v-1,1)),t.doneFn&&t.doneFn(g._dragged,v),!g._dragged){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),d.dispatchEvent(r)}return i(g),g._dragged=!1,a.pauseEvent(e)}var u,c,f,h,d,p,g=a.getPlotDiv(t.element)||{},v=1,m=s.DBLCLICKDELAY;g._mouseDownTime||(g._mouseDownTime=0),p=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"}},{"../../lib":342,"../../plotly":362,"../../plots/cartesian/constants":370,"./align":286,"./cursor":287,"./unhover":289}],289:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=e.exports={};i.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,r)},i.raw=function(t,e){var r=t._fullLayout;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}},{"../../lib/events":338}],290:[function(t,e,r){"use strict";function n(t,e,r,n){var o=t[0]-e[0],a=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(o*o+a*a,x/2),c=Math.pow(s*s+l*l,x/2),f=(c*c*o-u*u*s)*n,h=(c*c*a-u*u*l)*n,d=3*c*(u+c),p=3*u*(u+c);return[[i.round(e[0]+(d&&f/d),2),i.round(e[1]+(d&&h/d),2)],[i.round(e[0]-(p&&f/p),2),i.round(e[1]-(p&&h/p),2)]]}var i=t("d3"),o=t("fast-isnumeric"),a=t("../../plots/plots"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../traces/scatter/subtypes"),d=t("../../traces/scatter/make_bubble_size_func"),p=e.exports={};p.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},p.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},p.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},p.setRect=function(t,e,r,n,i){t.call(p.setPosition,e,r).call(p.setSize,n,i)},p.translatePoints=function(t,e,r){t.each(function(t){var n=t.xp||e.c2p(t.x),a=t.yp||r.c2p(t.y),s=i.select(this);o(n)&&o(a)?"text"===this.nodeName?s.attr("x",n).attr("y",a):s.attr("transform","translate("+n+","+a+")"):s.remove()})},p.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},p.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:1>e?1:Math.round(e):r||0},p.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},a=e||o.width||0,l=n||o.dash||"";i.select(this).call(s.stroke,r||o.color).call(p.dashLine,l,a)})},p.dashLine=function(t,e,r){var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},p.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=i.select(this);try{r.call(s.fill,e[0].trace.fillcolor)}catch(n){u.error(n,t),r.remove()}})};var g=t("./symbol_defs");p.symbolNames=[],p.symbolFuncs=[],p.symbolNeedLines={},p.symbolNoDot={},p.symbolList=[],Object.keys(g).forEach(function(t){var e=g[t];p.symbolList=p.symbolList.concat([e.n,t,e.n+100,t+"-open"]),p.symbolNames[e.n]=t,p.symbolFuncs[e.n]=e.f,e.needLine&&(p.symbolNeedLines[e.n]=!0),e.noDot?p.symbolNoDot[e.n]=!0:p.symbolList=p.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var v=p.symbolNames.length,m="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";p.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=p.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=v||t>=400?0:Math.floor(Math.max(t,0))},p.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=r.line;if(a.traceIs(e,"symbols")){var o=d(e);t.attr("d",function(t){var n;n="various"===t.ms||"various"===r.size?3:h.isBubble(e)?o(t.ms):(r.size||6)/2,t.mrc=n;var i=p.symbolNumber(t.mx||r.symbol)||0,a=i%100;return t.om=i%200>=100,p.symbolFuncs[a](n)+(i>=200?m:"")}).style("opacity",function(t){return(t.mo+1||r.opacity+1)-1})}var l=(e._input||{}).marker||{},u=p.tryColorscale(r,l,""),c=p.tryColorscale(r,l,"line.");t.each(function(t){var e,o,a;t.so?(a=n.outlierwidth,o=n.outliercolor,e=r.outliercolor):(a=(t.mlw+1||n.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,o="mlc"in t?t.mlcc=c(t.mlc):Array.isArray(n.color)?s.defaultLine:n.color,e="mc"in t?t.mcc=u(t.mc):Array.isArray(r.color)?s.defaultLine:r.color||"rgba(0,0,0,0)");var l=i.select(this);t.om?l.call(s.stroke,e).style({"stroke-width":(a||1)+"px",fill:"none"}):(l.style("stroke-width",a+"px").call(s.fill,e),a&&l.call(s.stroke,o))})}},p.tryColorscale=function(t,e,r){var n=u.nestedProperty(t,r+"color").get(),i=u.nestedProperty(t,r+"colorscale").get(),a=u.nestedProperty(t,r+"cauto").get(),s=u.nestedProperty(t,r+"cmin"),c=u.nestedProperty(t,r+"cmax"),f=s.get(),h=c.get();return i&&Array.isArray(n)?(!a&&o(f)&&o(h)||(f=1/0,h=-(1/0),n.forEach(function(t){o(t)&&(f>t&&(f=+t),t>h&&(h=+t))}),f>h&&(f=0,h=1),s.set(f),c.set(h),u.nestedProperty(e,r+"cmin").set(f),u.nestedProperty(e,r+"cmax").set(h)),l.makeScaleFunction(i,f,h)):u.identity};var y={start:1,end:-1,middle:0,bottom:1,top:-1},b=1.3;p.textPointStyle=function(t,e){t.each(function(t){var r=i.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var a=t.tp||e.textposition,s=-1!==a.indexOf("top")?"top":-1!==a.indexOf("bottom")?"bottom":"middle",l=-1!==a.indexOf("left")?"end":-1!==a.indexOf("right")?"start":"middle",u=t.ts||e.textfont.size,f=t.mrc?t.mrc/.8+1:0;u=o(u)&&u>0?u:0,r.call(p.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr("text-anchor",l).text(n).call(c.convertToTspans);var h=i.select(this.parentNode),d=r.selectAll("tspan.line"),g=((d[0].length||1)-1)*b+1,v=y[l]*f,m=.75*u+y[s]*f+(y[s]-1)*g*u/2;h.attr("transform","translate("+v+","+m+")"),g>1&&d.attr({x:r.attr("x"),y:r.attr("y")})})};var x=.5;p.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,i="M"+t[0],o=[];for(r=1;r<t.length-1;r++)o.push(n(t[r-1],t[r],t[r+1],e));for(i+="Q"+o[0][0]+" "+t[1],r=2;r<t.length-1;r++)i+="C"+o[r-2][1]+" "+o[r-1][0]+" "+t[r];return i+="Q"+o[t.length-3][1]+" "+t[t.length-1]},p.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,i="M"+t[0],o=t.length-1,a=[n(t[o],t[0],t[1],e)];for(r=1;o>r;r++)a.push(n(t[r-1],t[r],t[r+1],e));for(a.push(n(t[o-1],t[o],t[0],e)),r=1;o>=r;r++)i+="C"+a[r-1][1]+" "+a[r][0]+" "+t[r];return i+="C"+a[o][1]+" "+a[0][0]+" "+t[0]+"Z"};var _={hv:function(t,e){return"H"+i.round(e[0],2)+"V"+i.round(e[1],2)},vh:function(t,e){return"V"+i.round(e[1],2)+"H"+i.round(e[0],2)},hvh:function(t,e){return"H"+i.round((t[0]+e[0])/2,2)+"V"+i.round(e[1],2)+"H"+i.round(e[0],2)},vhv:function(t,e){return"V"+i.round((t[1]+e[1])/2,2)+"H"+i.round(e[0],2)+"V"+i.round(e[1],2)}},w=function(t,e){return"L"+i.round(e[0],2)+","+i.round(e[1],2)};p.steps=function(t){var e=_[t]||w;return function(t){for(var r="M"+i.round(t[0][0],2)+","+i.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},p.makeTester=function(t){var e=i.select("body").selectAll("#js-plotly-tester").data([0]);e.enter().append("svg").attr("id","js-plotly-tester").attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"});var r=e.selectAll(".js-reference-point").data([0]);r.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),e.node()._cache||(e.node()._cache={}),t._tester=e,t._testref=r};var A=[],M=1e4;p.bBox=function(t){var e=t.attributes["data-bb"];if(e&&e.value)return u.extendFlat({},A[e.value]);var r=i.select("#js-plotly-tester"),n=r.node(),o=t.cloneNode(!0);n.appendChild(o),i.select(o).attr({x:0,y:0,transform:""});var a=o.getBoundingClientRect(),s=r.select(".js-reference-point").node().getBoundingClientRect();n.removeChild(o);var l={height:a.height,width:a.width,left:a.left-s.left,top:a.top-s.top,right:a.right-s.left,bottom:a.bottom-s.top};return A.length>=M&&(i.selectAll("[data-bb]").attr("data-bb",null),A=[]),t.setAttribute("data-bb",A.length),A.push(l),u.extendFlat({},l)},p.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=i.select("base");n.size()&&n.attr("href")&&(r=window.location.href+r),t.attr("clip-path","url("+r+")")}},{"../../constants/xmlns_namespaces":333,"../../lib":342,"../../lib/svg_text_utils":355,"../../plots/plots":398,"../../traces/scatter/make_bubble_size_func":433,"../../traces/scatter/subtypes":438,"../color":267,"../colorscale":281,"./symbol_defs":291,d3:100,"fast-isnumeric":104}],291:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,o="l-"+e+",-"+e,a="l-"+e+","+e;return"M0,"+e+r+i+o+i+o+a+o+a+r+a+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),o=n.round(t*-.309,2),a=n.round(.809*t,2);return"M"+e+","+o+"L"+r+","+a+"H-"+r+"L-"+e+","+o+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),o=n.round(.363*e,2),a=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),u=n.round(.118*e,2),c=n.round(.809*e,2),f=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+o+","+u+"L"+a+","+c+"L0,"+f+"L-"+a+","+c+"L-"+o+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),o=n.round(4*t,2),a="A "+o+","+o+" 0 0 1 ";return"M-"+e+","+r+a+e+","+r+a+"0,-"+i+a+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),o=n.round(4*t,2),a="A "+o+","+o+" 0 0 1 ";return"M"+e+",-"+r+a+"-"+e+",-"+r+a+"0,"+i+a+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:100}],292:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],293:[function(t,e,r){"use strict";function n(t,e,r,n){var o=e["error_"+n]||{},l=o.visible&&-1!==["linear","log"].indexOf(r.type),u=[];if(l){for(var c=s(o),f=0;f<t.length;f++){var h=t[f],d=h[n];if(i(r.c2l(d))){var p=c(d,f);if(i(p[0])&&i(p[1])){var g=h[n+"s"]=d-p[0],v=h[n+"h"]=d+p[1];u.push(g,v)}}}a.expand(r,u,{padded:!0})}}var i=t("fast-isnumeric"),o=t("../../plots/plots"),a=t("../../plots/cartesian/axes"),s=t("./compute_error");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var i=e[r],s=i[0].trace;if(o.traceIs(s,"errorBarsOK")){var l=a.getFromId(t,s.xaxis),u=a.getFromId(t,s.yaxis);n(i,s,l,"x"),n(i,s,u,"y")}}}},{"../../plots/cartesian/axes":365,"../../plots/plots":398,"./compute_error":294,"fast-isnumeric":104}],294:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var i=t.array,o=t.arrayminus;return r||void 0===o?function(t,e){var r=+i[e];return[r,r]}:function(t,e){return[+o[e],+i[e]]}}var a=n(e,t.value),s=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=a(t);return[e,e]}:function(t){return[s(t),a(t)]}}},{}],295:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,s){function l(t,e){return o.coerce(f,c,a,t,e)}var u="error_"+s.axis,c=e[u]={},f=t[u]||{},h=void 0!==f.array||void 0!==f.value||"sqrt"===f.type,d=l("visible",h);if(d!==!1){var p=l("type","array"in f?"data":"percent"),g=!0;if("sqrt"!==p&&(g=l("symmetric",!(("data"===p?"arrayminus":"valueminus")in f))),"data"===p){var v=l("array");if(v||(c.array=[]),l("traceref"),!g){var m=l("arrayminus");m||(c.arrayminus=[]),l("tracerefminus")}}else"percent"!==p&&"constant"!==p||(l("value"),g||l("valueminus"));var y="copy_"+s.inherit+"style";if(s.inherit){var b=e["error_"+s.inherit];(b||{}).visible&&l(y,!(f.color||n(f.thickness)||n(f.width)))}s.inherit&&c[y]||(l("color",r),l("thickness"),l("width",i.traceIs(e,"gl3d")?0:4))}}},{"../../lib":342,"../../plots/plots":398,"./attributes":292,"fast-isnumeric":104}],296:[function(t,e,r){"use strict";var n=e.exports={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.calcFromTrace=function(t,e){for(var r=t.x||[],i=t.y,o=r.length||i.length,a=new Array(o),s=0;o>s;s++)a[s]={x:r[s],y:i[s]};return a[0].trace=t,n.calc({calcdata:[a],_fullLayout:e}),a},n.plot=t("./plot"),n.style=t("./style"),n.hoverInfo=function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"./attributes":292,"./calc":293,"./defaults":295,"./plot":297,"./style":298}],297:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),o(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),o(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var i=t("d3"),o=t("fast-isnumeric"),a=t("../../lib"),s=t("../../traces/scatter/subtypes");e.exports=function(t,e){var r=e.x(),l=e.y();t.each(function(t){var e=t[0].trace,u=e.error_x||{},c=e.error_y||{},f=s.hasMarkers(e)&&e.marker.maxdisplayed>0;if(c.visible||u.visible){var h=i.select(this).selectAll("g.errorbar").data(a.identity);h.enter().append("g").classed("errorbar",!0),h.each(function(t){var e=i.select(this),a=n(t,r,l);if(!f||t.vis){var s;if(c.visible&&o(a.x)&&o(a.yh)&&o(a.ys)){var h=c.width;s="M"+(a.x-h)+","+a.yh+"h"+2*h+"m-"+h+",0V"+a.ys,a.noYS||(s+="m-"+h+",0h"+2*h),e.append("path").classed("yerror",!0).attr("d",s)}if(u.visible&&o(a.y)&&o(a.xh)&&o(a.xs)){var d=(u.copy_ystyle?c:u).width;s="M"+a.xh+","+(a.y-d)+"v"+2*d+"m0,-"+d+"H"+a.xs,a.noXS||(s+="m0,-"+d+"v"+2*d),e.append("path").classed("xerror",!0).attr("d",s)}}})}})}},{"../../lib":342,"../../traces/scatter/subtypes":438,d3:100,"fast-isnumeric":104}],298:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},o=e.error_x||{},a=n.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),o.copy_ystyle&&(o=r),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(i.stroke,o.color)})}},{"../color":267,d3:100}],299:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:!0,source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"number",dflt:0},y:{valType:"number",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":370}],300:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,a,r,n)}e=e||{},n("source"),n("layer"),n("x"),n("y"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var s=0;2>s;s++){var l={_fullLayout:r},u=["x","y"][s];i.coerceRef(t,e,l,u,"paper")}return e}var i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("./attributes");e.exports=function(t,e){if(t.images&&Array.isArray(t.images))for(var r=t.images,i=e.images=[],o=0;o<r.length;o++){var a=r[o];if(a.source){var s=n(r[o]||{},i[o]||{},e);i.push(s)}}}},{"../../lib":342,"../../plots/cartesian/axes":365,"./attributes":299}],301:[function(t,e,r){"use strict";var n=t("d3"),i=t("../drawing"),o=t("../../plots/cartesian/axes");e.exports=function(t){function e(e){var r=n.select(this),i=new Promise(function(t){function n(){r.remove(),t()}var i=new Image;i.setAttribute("crossOrigin","anonymous"),i.onerror=n,i.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var e=t.getContext("2d");e.drawImage(this,0,0);var n=t.toDataURL("image/png");r.attr("xlink:href",n)},r.on("error",n),r.on("load",t),i.src=e.source});t._promises.push(i)}function r(e){var r=n.select(this),a=o.getFromId(t,e.xref),l=o.getFromId(t,e.yref),u=s._size,c=a?Math.abs(a.l2p(e.sizex)-a.l2p(0)):e.sizex*u.w,f=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*u.h,h=c*d.x[e.xanchor].offset+u.l,p=f*d.y[e.yanchor].offset+u.t,g=d.x[e.xanchor].sizing+d.y[e.yanchor].sizing,v=(a?a.l2p(e.x):e.x*u.w)+h,m=(l?l.l2p(e.y):u.h-e.y*u.h)+p;switch(e.sizing){case"fill":g+=" slice";break;case"stretch":g="none"}r.attr({x:v,y:m,width:c,height:f,preserveAspectRatio:g,opacity:e.opacity});var y=a?a._id:"",b=l?l._id:"",x=y+b;r.call(i.setClipUrl,"clip"+s._uid+x)}function a(t,e){return t.source+e}var s=t._fullLayout,l=[],u=[],c=[];if(s.images){for(var f=0;f<s.images.length;f++){var h=s.images[f];"below"===h.layer&&"paper"!==h.xref&&"paper"!==h.yref?u.push(h):"above"===h.layer?l.push(h):c.push(h)}var d={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-0.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-0.5},bottom:{sizing:"YMax",offset:-1}}},p=s._imageLowerLayer.selectAll("image").data(c,a),g=s._imageSubplotLayer.selectAll("image").data(u,a),v=s._imageUpperLayer.selectAll("image").data(l,a);p.enter().append("image").each(e),g.enter().append("image").each(e),v.enter().append("image").each(e),p.exit().remove(),g.exit().remove(),v.exit().remove(),p.each(r),g.each(r),v.each(r)}}},{"../../plots/cartesian/axes":365,"../drawing":290,d3:100}],302:[function(t,e,r){"use strict";var n=t("./draw"),i=t("./defaults"),o=t("./attributes");e.exports={draw:n,layoutAttributes:o,supplyLayoutDefaults:i}},{"./attributes":299,"./defaults":300,"./draw":301}],303:[function(t,e,r){"use strict";r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],304:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:o({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":339,"../../plots/font_attributes":383,"../color/attributes":266}],305:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],306:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/plots"),o=t("./attributes"),a=t("./helpers");e.exports=function(t,e,r){function s(t,e){return n.coerce(h,d,o,t,e)}for(var l,u,c,f,h=t.legend||{},d=e.legend={},p=0,g="normal",v=0;v<r.length;v++){var m=r[v];a.legendGetsTrace(m)&&(p++,i.traceIs(m,"pie")&&p++),(i.traceIs(m,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(m.fill))&&(g=a.isGrouped({traceorder:g})?"grouped+reversed":"reversed"),void 0!==m.legendgroup&&""!==m.legendgroup&&(g=a.isReversed({traceorder:g})?"reversed+grouped":"grouped")}var y=n.coerce(t,e,i.layoutAttributes,"showlegend",p>1);if(y!==!1){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),n.coerceFont(s,"font",e.font),s("orientation"),"h"===d.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(l=0,c="left",u=1.1,f="bottom"):(l=0,c="left",u=-.1,f="top")}s("traceorder",g),a.isGrouped(e.legend)&&s("tracegroupgap"),s("x",l),s("xanchor",c),s("y",u),s("yanchor",f),n.noneOrAll(h,d,["x","y"])}}},{"../../lib":342,"../../plots/plots":398,"./attributes":304,"./helpers":309}],307:[function(t,e,r){"use strict";function n(t,e){function r(r){c.util.convertToTspans(r,function(){
r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(o,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,s=h.traceIs(a,"pie"),l=a.index,u=s?n.label:a.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr({x:40,y:0,"data-unformatted":u}).style("text-anchor","start").classed("user-select-none",!0).call(p.font,i.legend.font).text(u),e._context.editable&&!s?f.call(c.util.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t=" "),c.restyle(e,"name",t,l)}):f.call(r)}function i(t,e){var r=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!e._dragged){var n,i,o=t.data()[0][0],a=e._fullData,s=o.trace,l=s.legendgroup,u=[];if(h.traceIs(s,"pie")){var f=o.label,d=r.indexOf(f);-1===d?r.push(f):r.splice(d,1),c.relayout(e,"hiddenlabels",r)}else{if(""===l)u=[s.index];else for(var p=0;p<a.length;p++)n=a[p],n.legendgroup===l&&u.push(n.index);i=s.visible===!0?"legendonly":!0,c.restyle(e,"visible",i,u)}}})}function o(t,e){var r,n,i=t.data()[0][0],o=t.selectAll(".legendtoggle"),a=t.select("g[class*=math-group]"),s=e._fullLayout.legend,l=1.3*s.font.size;if(!i.trace.showlegend)return void t.remove();if(a.node()){var u=p.bBox(a.node());r=u.height,n=u.width,f.setTranslate(a,0,r/4)}else{var c=t.selectAll(".legendtext"),h=t.selectAll(".legendtext>tspan"),d=h[0].length||1;r=l*d,n=c.node()&&p.bBox(c.node()).width;var g=l*(.3+(1-d)/2);c.attr("y",g),h.attr("y",g)}r=Math.max(r,16)+3,o.attr({x:0,y:-r/2,height:r}),i.height=r,i.width=n}function a(t,e,r){var n=t._fullLayout,i=n.legend,o=i.borderwidth,a=b.isGrouped(i);if(b.isVertical(i))a&&e.each(function(t,e){f.setTranslate(this,0,e*i.tracegroupgap)}),i.width=0,i.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;f.setTranslate(this,o,5+o+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*o,i.height+=10+2*o,a&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),r.selectAll(".legendtoggle").attr("width",(t._context.editable?0:i.width)+40),i.width=Math.ceil(i.width),i.height=Math.ceil(i.height);else if(a){i.width=0,i.height=0;for(var s=[i.width],l=e.data(),c=0,h=l.length;h>c;c++){var d=l[c].map(function(t){return t[0].width}),p=40+Math.max.apply(null,d);i.width+=i.tracegroupgap+p,s.push(i.width)}e.each(function(t,e){f.setTranslate(this,s[e],0)}),e.each(function(){var t=u.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;f.setTranslate(this,0,5+o+r+n/2),r+=n}),i.height=Math.max(i.height,r)}),i.height+=10+2*o,i.width+=2*o,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.selectAll(".legendtoggle").attr("width",t._context.editable?0:i.width)}else i.width=0,i.height=0,r.each(function(t){var e=t[0],r=40+e.width,n=i.tracegroupgap||5;f.setTranslate(this,o+i.width,5+o+e.height/2),i.width+=n+r,i.height=Math.max(i.height,e.height)}),i.width+=2*o,i.height+=10+2*o,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.selectAll(".legendtoggle").attr("width",t._context.editable?0:i.width)}function s(t){var e=t._fullLayout,r=e.legend,n="left";x.isRightAnchor(r)?n="right":x.isCenterAnchor(r)&&(n="center");var i="top";x.isBottomAnchor(r)?i="bottom":x.isMiddleAnchor(r)&&(i="middle"),h.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[i]||0),t:r.height*({bottom:1,middle:.5}[i]||0)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";x.isRightAnchor(r)?n="right":x.isCenterAnchor(r)&&(n="center"),h.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var u=t("d3"),c=t("../../plotly"),f=t("../../lib"),h=t("../../plots/plots"),d=t("../dragelement"),p=t("../drawing"),g=t("../color"),v=t("./constants"),m=t("./get_legend_data"),y=t("./style"),b=t("./helpers"),x=t("./anchor_utils");e.exports=function(t){function e(t,e){T.attr("data-scroll",e).call(f.setTranslate,0,e),E.call(p.setRect,D,t,v.scrollBarWidth,v.scrollBarHeight),M.select("rect").attr({y:b.borderwidth-e})}var r=t._fullLayout,o="legend"+r._uid;if(r._infolayer&&t.calcdata){var b=r.legend,_=r.showlegend&&m(t.calcdata,b),w=r.hiddenlabels||[];if(!r.showlegend||!_.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+o).remove(),void h.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({"class":"legend","pointer-events":"all"});var M=r._topdefs.selectAll("#"+o).data([0]);M.enter().append("clipPath").attr("id",o).append("rect");var k=A.selectAll("rect.bg").data([0]);k.enter().append("rect").attr({"class":"bg","shape-rendering":"crispEdges"}),k.call(g.stroke,b.bordercolor),k.call(g.fill,b.bgcolor),k.style("stroke-width",b.borderwidth+"px");var T=A.selectAll("g.scrollbox").data([0]);T.enter().append("g").attr("class","scrollbox");var E=A.selectAll("rect.scrollbar").data([0]);E.enter().append("rect").attr({"class":"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var L=T.selectAll("g.groups").data(_);L.enter().append("g").attr("class","groups"),L.exit().remove();var S=L.selectAll("g.traces").data(f.identity);S.enter().append("g").attr("class","traces"),S.exit().remove(),S.call(y).style("opacity",function(t){var e=t[0].trace;return h.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(i,t)});var C=0!==A.enter().size();C&&(a(t,L,S),s(t));var P=0,R=r.width,N=0,z=r.height;a(t,L,S),b.height>z?l(t):s(t);var I=r._size,O=I.l+I.w*b.x,j=I.t+I.h*(1-b.y);x.isRightAnchor(b)?O-=b.width:x.isCenterAnchor(b)&&(O-=b.width/2),x.isBottomAnchor(b)?j-=b.height:x.isMiddleAnchor(b)&&(j-=b.height/2);var D=b.width,F=I.w;D>F?(O=I.l,D=F):(O+D>R&&(O=R-D),P>O&&(O=P),D=Math.min(R-O,b.width));var B=b.height,U=I.h;B>U?(j=I.t,B=U):(j+B>z&&(j=z-B),N>j&&(j=N),B=Math.min(z-j,b.height)),f.setTranslate(A,O,j);var V,q,H=B-v.scrollBarHeight-2*v.scrollBarMargin,G=b.height-B;if(b.height<=B||t._context.staticPlot)k.attr({width:D-b.borderwidth,height:B-b.borderwidth,x:b.borderwidth/2,y:b.borderwidth/2}),f.setTranslate(T,0,0),M.select("rect").attr({width:D-2*b.borderwidth,height:B-2*b.borderwidth,x:b.borderwidth,y:b.borderwidth}),T.call(p.setClipUrl,o);else{V=v.scrollBarMargin,q=T.attr("data-scroll")||0,k.attr({width:D-2*b.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-b.borderwidth,x:b.borderwidth/2,y:b.borderwidth/2}),M.select("rect").attr({width:D-2*b.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-2*b.borderwidth,x:b.borderwidth,y:b.borderwidth-q}),T.call(p.setClipUrl,o),C&&e(V,q),A.on("wheel",null),A.on("wheel",function(){q=f.constrain(T.attr("data-scroll")-u.event.deltaY/H*G,-G,0),V=v.scrollBarMargin-q/G*H,e(V,q),u.event.preventDefault()}),E.on(".drag",null),T.on(".drag",null);var X=u.behavior.drag().on("drag",function(){V=f.constrain(u.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+H),q=-(V-v.scrollBarMargin)/H*G,e(V,q)});E.call(X),T.call(X)}if(t._context.editable){var Y,W,Z,Q;A.classed("cursor-move",!0),d.init({element:A.node(),prepFn:function(){var t=f.getTranslate(A);Z=t.x,Q=t.y},moveFn:function(t,e){var r=Z+t,n=Q+e;f.setTranslate(A,r,n),Y=d.align(r,0,I.l,I.l+I.w,b.xanchor),W=d.align(n,0,I.t+I.h,I.t,b.yanchor)},doneFn:function(e){e&&void 0!==Y&&void 0!==W&&c.relayout(t,{"legend.x":Y,"legend.y":W})}})}}}},{"../../lib":342,"../../plotly":362,"../../plots/plots":398,"../color":267,"../dragelement":288,"../drawing":290,"./anchor_utils":303,"./constants":305,"./get_legend_data":308,"./helpers":309,"./style":311,d3:100}],308:[function(t,e,r){"use strict";var n=t("../../plots/plots"),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"+f;l.push(n),s[n]=[[r]],f++}}var o,a,s={},l=[],u=!1,c={},f=0;for(o=0;o<t.length;o++){var h=t[o],d=h[0],p=d.trace,g=p.legendgroup;if(i.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,"pie"))for(c[g]||(c[g]={}),a=0;a<h.length;a++){var v=h[a].label;c[g][v]||(r(g,{label:v,color:h[a].color,i:h[a].i,trace:p}),c[g][v]=!0)}else r(g,d)}if(!l.length)return[];var m,y,b=l.length;if(u&&i.isGrouped(e))for(y=new Array(b),o=0;b>o;o++)m=s[l[o]],y[o]=i.isReversed(e)?m.reverse():m;else{for(y=[new Array(b)],o=0;b>o;o++)m=s[l[o]][0],y[0][i.isReversed(e)?b-o-1:o]=m;b=1}return e._lgroupsLength=b,y}},{"../../plots/plots":398,"./helpers":309}],309:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{"../../plots/plots":398}],310:[function(t,e,r){"use strict";var n=e.exports={};n.layoutAttributes=t("./attributes"),n.supplyLayoutDefaults=t("./defaults"),n.draw=t("./draw"),n.style=t("./style")},{"./attributes":304,"./defaults":306,"./draw":307,"./style":311}],311:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=d.hasLines(e),i=l.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(f.fillGroupStyle);var o=l.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);o.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),o.exit().remove(),o.call(f.lineGroupStyle)}function i(t){function e(t,e,r){var n=u.nestedProperty(a,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(i<r[0])return r[0];if(i>r[1])return r[1]}return i}function r(t){return t[0]}var n,i,o=t[0],a=o.trace,s=d.hasMarkers(a),c=d.hasText(a),h=d.hasLines(a);if(s||c||h){var p={},g={};s&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",u.mean,[.2,1]),p.ms=e("marker.size",u.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",u.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(g.line={width:e("line.width",r,[0,10])}),c&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[u.minExtend(o,p)],i=u.minExtend(a,g)}var v=l.select(this).select("g.legendpoints"),m=v.selectAll("path.scatterpts").data(s?n:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(f.pointStyle,i),s&&(n[0].mrc=3);var y=v.selectAll("g.pointtext").data(c?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(f.textPointStyle,i)}function o(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=l.select(this).select("g.legendpoints").selectAll("path.legendbar").data(c.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=(t.mlw+1||n.width+1)-1,i=l.select(this);i.style("stroke-width",e+"px").call(h.fill,t.mc||r.color),e&&i.call(h.stroke,t.mlc||n.color)})}function a(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendbox").data(c.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(t){var r=(t.lw+1||e.line.width+1)-1,n=l.select(this);n.style("stroke-width",r+"px").call(h.fill,t.fc||e.fillcolor),r&&n.call(h.stroke,t.lc||e.line.color)})}function s(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendpie").data(c.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(p,t[0],e)}var l=t("d3"),u=t("../../lib"),c=t("../../plots/plots"),f=t("../drawing"),h=t("../color"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=l.select(this),r=e.selectAll("g.legendfill").data([t]);r.enter().append("g").classed("legendfill",!0);var n=e.selectAll("g.legendlines").data([t]);n.enter().append("g").classed("legendlines",!0);var i=e.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.style("opacity",t[0].trace.opacity),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(o).each(a).each(s).each(n).each(i)}},{"../../lib":342,"../../plots/plots":398,"../../traces/pie/style_one":417,"../../traces/scatter/subtypes":438,"../color":267,"../drawing":290,d3:100}],312:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,a={};if("zoom"===n){for(var s,l,c="in"===i?.5:2,f=(1+c)/2,h=(1-c)/2,d=u.Axes.list(t,null,!0),p=0;p<d.length;p++)if(s=d[p],!s.fixedrange)if(l=s._name,"auto"===i)a[l+".autorange"]=!0;else if("reset"===i)if(void 0===s._rangeInitial)a[l+".autorange"]=!0;else{var g=s._rangeInitial.slice();a[l+".range[0]"]=g[0],a[l+".range[1]"]=g[1]}else{var v=s.range;a[l+".range[0]"]=f*v[0]+h*v[1],a[l+".range[1]"]=f*v[1]+h*v[0]}}else"hovermode"!==n||"x"!==i&&"y"!==i||(i=o._isHoriz?"y":"x",r.setAttribute("data-val",i)),a[n]=i;u.relayout(t,a)}function i(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,a=u.Plots.getSubplotIds(o,"gl3d"),s={},l=n.split("."),c=0;c<a.length;c++)s[a[c]+"."+l[1]]=i;u.relayout(t,s)}function o(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=t._fullLayout,o=u.Plots.getSubplotIds(i,"gl3d"),a=0;a<o.length;a++){var s=o[a],l=i[s],c=l._scene;"resetDefault"===n?c.setCameraToDefault():"resetLastSave"===n&&c.setCamera(l.camera)}}function a(t,e){var r=e.currentTarget,n=r._previousVal||!1,i=t.layout,o=t._fullLayout,a=u.Plots.getSubplotIds(o,"gl3d"),s=["xaxis","yaxis","zaxis"],l=["showspikes","spikesides","spikethickness","spikecolor"],f={},h={},d={};if(n)d=c.extendDeep(i,n),r._previousVal=null;else{d={"allaxes.showspikes":!1};for(var p=0;p<a.length;p++){var g=a[p],v=o[g],m=f[g]={};m.hovermode=v.hovermode,d[g+".hovermode"]=!1;for(var y=0;3>y;y++){var b=s[y];h=m[b]={};for(var x=0;x<l.length;x++){var _=l[x];h[_]=v[b][_]}}}r._previousVal=c.extendDeep({},f)}u.relayout(t,d)}function s(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,a=u.Plots.getSubplotIds(o,"geo"),s=0;s<a.length;s++){var l=o[a[s]]._geo;if("zoom"===n){var c=l.projection.scale(),f="in"===i?2*c:.5*c;l.projection.scale(f),l.zoom.scale(f),l.render()}else"reset"===n&&l.zoomReset()}}function l(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var n=t._fullLayout.hovermode?!1:e;u.relayout(t,"hovermode",n)}var u=t("../../plotly"),c=t("../../lib"),f=t("../../snapshot/download"),h=t("../../../build/ploticon"),d=e.exports={};d.toImage={name:"toImage",title:"Download plot as a png",icon:h.camera,click:function(t){var e="png";c.notifier("Taking snapshot - this may take a few seconds","long"),c.isIE()&&(c.notifier("IE only supports svg. Changing format to svg.","long"),e="svg"),f(t,{format:e}).then(function(t){c.notifier("Snapshot succeeded - "+t,"long")}).catch(function(){c.notifier("Sorry there was a problem downloading your snapshot!","long")})}},d.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:h.disk,click:function(t){u.Plots.sendDataToCloud(t)}},d.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:h.zoombox,click:n},d.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:h.pan,click:n},d.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:h.selectbox,click:n},d.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:h.lasso,click:n},d.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:h.zoom_plus,click:n},d.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:h.zoom_minus,click:n},d.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:h.autoscale,click:n},d.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:h.home,click:n},d.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:h.tooltip_basic,gravity:"ne",click:n},d.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:h.tooltip_compare,gravity:"ne",click:n},d.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:h.zoombox,click:i},d.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:h.pan,click:i},d.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:h["3d_rotate"],click:i},d.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:h["z-axis"],click:i},d.resetCameraDefault3d={name:"resetCameraDefault3d",title:"Reset camera to default",attr:"resetDefault",icon:h.home,click:o},d.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:h.movie,click:o},d.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:h.tooltip_basic,gravity:"ne",click:a},d.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:h.zoom_plus,click:s},d.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:h.zoom_minus,click:s},d.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:h.autoscale,click:s},d.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:h.tooltip_basic,gravity:"ne",click:l},d.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:h.tooltip_basic,gravity:"ne",click:l},d.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:h.tooltip_basic,gravity:"ne",click:l},d.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:h.tooltip_basic,gravity:"ne",click:function(t,e){l(t),a(t,e)}},d.resetViews={name:"resetViews",title:"Reset views",icon:h.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),n(t,e),r.setAttribute("data-attr","resetLastSave"),o(t,e)}}},{"../../../build/ploticon":2,"../../lib":342,"../../plotly":362,"../../snapshot/download":406}],313:[function(t,e,r){"use strict";function n(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}function i(t,e){var r=t._fullLayout,i=new n({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&o.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}var o=t("d3"),a=t("../../lib"),s=t("../../../build/ploticon"),l=n.prototype;l.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context;"hover"===r.displayModeBar?this.element.className="modebar modebar--hover":this.element.className="modebar";var n=!this.hasButtons(e),i=this.hasLogo!==r.displaylogo;(n||i)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},l.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)}),e.element.appendChild(r)})},l.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},l.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var n=t.title;void 0===n&&(n=t.name),(n||0===n)&&r.setAttribute("data-title",n),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var i=t.val;void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i));var o=t.click;if("function"!=typeof o)throw new Error("must provide button 'click' function in button config");return r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&r.classList.add("active"),r.appendChild(this.createIcon(t.icon||s.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},l.createIcon=function(t){var e=t.ascent-t.descent,r="http://www.w3.org/2000/svg",n=document.createElementNS(r,"svg"),i=document.createElementNS(r,"path");return n.setAttribute("height","1em"),n.setAttribute("width",t.width/e+"em"),n.setAttribute("viewBox",[0,0,t.width,e].join(" ")),i.setAttribute("d",t.path),i.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),n.appendChild(i),n},l.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute("data-val")||!0,i=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=o.select(t);if(s)i===r&&l.classed("active",!l.classed("active"));else{var u=null===i?i:a.nestedProperty(e,i).get();l.classed("active",u===n)}})},l.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},l.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title","Produced with Plotly"),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(s.plotlylogo)),t.appendChild(e),t},l.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},l.destroy=function(){a.removeElement(this.container.querySelector(".modebar"))},e.exports=i},{"../../../build/ploticon":2,"../../lib":342,d3:100}],314:[function(t,e,r){"use strict";function n(t,e,r){function n(t){for(var r=[],n=0;n<t.length;n++){var i=t[n];-1===e.indexOf(i)&&r.push(f[i])}v.push(r)}var s=t._fullLayout,l=t._fullData,u=s._has("cartesian"),c=s._has("gl3d"),h=s._has("geo"),d=s._has("pie"),p=s._has("gl2d"),g=s._has("ternary"),v=[];if(n(["toImage","sendDataToCloud"]),(u||p||d||g)+h+c>1)return n(["resetViews","toggleHover"]),a(v,r);c&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),h&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var m=i(s),y=[];return((u||p)&&!m||g)&&(y=["zoom2d","pan2d"]),(u||g)&&o(l)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!u&&!p||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):u?n(["hoverClosestCartesian","hoverCompareCartesian"]):d&&n(["hoverClosestPie"]),a(v,r)}function i(t){for(var e=l.Axes.list({_fullLayout:t},null,!0),r=!0,n=0;n<e.length;n++)if(!e[n].fixedrange){r=!1;break}return r}function o(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&("scatter"===n.type||"scatterternary"===n.type?(u.hasMarkers(n)||u.hasText(n))&&(e=!0):e=!0)}return e}function a(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}function s(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var i=r[n];if("string"==typeof i){if(void 0===f[i])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=f[i]}}return t}var l=t("../../plotly"),u=t("../../traces/scatter/subtypes"),c=t("./"),f=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,i=e._modeBar;if(!r.displayModeBar)return void(i&&(i.destroy(),delete e._modeBar));if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var o,a=r.modeBarButtons;o=Array.isArray(a)&&a.length?s(a):n(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),i?i.update(t,o):e._modeBar=c(t,o)}},{"../../plotly":362,"../../traces/scatter/subtypes":438,"./":313,"./buttons":312}],315:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),o=t("../../lib/extend").extendFlat,a=t("./button_attributes");a=o(a,{_isLinkedToArray:!0}),e.exports={visible:{valType:"boolean"},buttons:a,x:{valType:"number",min:-2,max:3},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom"},font:o({},n,{}),bgcolor:{valType:"color",dflt:i.lightLine},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0}}},{"../../lib/extend":339,"../../plots/font_attributes":383,"../color/attributes":266,"./button_attributes":316}],316:[function(t,e,r){"use strict";e.exports={step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward"},count:{valType:"number",min:0,dflt:1},label:{valType:"string"}}},{}],317:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,activeColor:"#d3d3d3"}},{}],318:[function(t,e,r){"use strict";function n(t,e){function r(t,e){return o.coerce(n,i,s,t,e)}for(var n,i,a=t.buttons||[],l=e.buttons=[],u=0;u<a.length;u++){n=a[u],i={};var c=r("step");"all"!==c&&(r("stepmode"),r("count")),r("label"),l.push(i)}return l}function i(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,o=0;o<n.length;o++)i=Math.max(e[n[o]].domain[1],i);return[t.domain[0],i+l.yPad]}var o=t("../../lib"),a=t("./attributes"),s=t("./button_attributes"),l=t("./constants");e.exports=function(t,e,r,s){function l(t,e){return o.coerce(u,c,a,t,e)}var u=t.rangeselector||{},c=e.rangeselector={},f=n(u,c),h=l("visible",f.length>0);if(h){var d=i(e,r,s);l("x",d[0]),l("y",d[1]),o.noneOrAll(t,e,["x","y"]),l("xanchor"),l("yanchor"),o.coerceFont(l,"font",r.font),l("bgcolor"),l("bordercolor"),l("borderwidth")}}},{"../../lib":342,"./attributes":315,"./button_attributes":316,"./constants":317}],319:[function(t,e,r){"use strict";function n(t){for(var e=m.list(t,"x",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}function i(t){return t._id}function o(t,e,r){if("all"===e.step)return t.autorange===!0;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}function a(t,e,r){var n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("selector-rect",!0),n.attr("shape-rendering","crispEdges"),n.attr({rx:b.rx,ry:b.ry}),n.call(p.stroke,e.bordercolor).call(p.fill,s(e,r)).style("stroke-width",e.borderwidth+"px")}function s(t,e){return e.isActive||e.isHovered?b.activeColor:t.bgcolor}function l(t,e,r){function n(t){v.convertToTspans(t)}var i=t.selectAll("text").data([0]);i.enter().append("text").classed("selector-text",!0).classed("user-select-none",!0),i.attr("text-anchor","middle"),i.call(g.font,e.font).text(u(r)).call(n)}function u(t){return t.label?t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}function c(t,e,r,n){r.width=0,r.height=0;var i=r.borderwidth;e.each(function(){var t=f.select(this),e=t.select(".selector-text"),n=e.selectAll("tspan"),i=1.3*r.font.size,o=n[0].length||1,a=Math.max(i*o,16)+3;r.height=Math.max(r.height,a)}),e.each(function(){var t=f.select(this),e=t.select(".selector-rect"),n=t.select(".selector-text"),o=n.selectAll("tspan"),a=n.node()&&g.bBox(n.node()).width,s=1.3*r.font.size,l=o[0].length||1,u=Math.max(a+10,b.minButtonWidth);t.attr("transform","translate("+(i+r.width)+","+i+")"),e.attr({x:0,y:0,width:u,height:r.height});var c={x:u/2,y:r.height/2-(l-1)*s/2+3};n.attr(c),o.attr(c),r.width+=u+5}),e.selectAll("rect").attr("height",r.height);var o=t._fullLayout._size;r.lx=o.l+o.w*r.x,r.ly=o.t+o.h*(1-r.y);var a="left";y.isRightAnchor(r)&&(r.lx-=r.width,a="right"),y.isCenterAnchor(r)&&(r.lx-=r.width/2,a="center");var s="top";y.isBottomAnchor(r)&&(r.ly-=r.height,s="bottom"),y.isMiddleAnchor(r)&&(r.ly-=r.height/2,s="middle"),r.width=Math.ceil(r.width),r.height=Math.ceil(r.height),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),d.autoMargin(t,n+"-range-selector",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[a]||0),r:r.width*({left:1,center:.5}[a]||0),b:r.height*({top:1,middle:.5}[s]||0),t:r.height*({bottom:1,middle:.5}[s]||0)})}var f=t("d3"),h=t("../../plotly"),d=t("../../plots/plots"),p=t("../color"),g=t("../drawing"),v=t("../../lib/svg_text_utils"),m=t("../../plots/cartesian/axis_ids"),y=t("../legend/anchor_utils"),b=t("./constants"),x=t("./get_update_object");e.exports=function(t){var e=t._fullLayout,r=e._infolayer.selectAll(".rangeselector").data(n(t),i);r.enter().append("g").classed("rangeselector",!0),r.exit().remove(),r.style({cursor:"pointer","pointer-events":"all"}),r.each(function(e){var r=f.select(this),n=e,i=n.rangeselector,s=r.selectAll("g.button").data(i.buttons);s.enter().append("g").classed("button",!0),s.exit().remove(),s.each(function(e){var r=f.select(this),s=x(n,e);e.isActive=o(n,e,s),r.call(a,i,e),r.call(l,i,e),r.on("click",function(){t._dragged||h.relayout(t,s)}),r.on("mouseover",function(){e.isHovered=!0,r.call(a,i,e)}),r.on("mouseout",function(){e.isHovered=!1,r.call(a,i,e)})}),c(t,s,i,n._name),r.attr("transform","translate("+i.lx+","+i.ly+")")})}},{"../../lib/svg_text_utils":355,"../../plotly":362,"../../plots/cartesian/axis_ids":367,"../../plots/plots":398,"../color":267,"../drawing":290,"../legend/anchor_utils":303,"./constants":317,"./get_update_object":320,d3:100}],320:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range,o=new Date(n[1]),a=e.step,s=e.count;switch(e.stepmode){case"backward":r=i.time[a].offset(o,-s).getTime();break;case"todate":var l=i.time[a].offset(o,-(s-1));r=i.time[a].floor(l).getTime()}var u=n[1];return[r,u]}var i=t("d3");e.exports=function(t,e){var r=t._name,i={};if("all"===e.step)i[r+".autorange"]=!0;else{var o=n(t,e);i[r+".range[0]"]=o[0],i[r+".range[1]"]=o[1]}return i}},{d3:100}],321:[function(t,e,r){"use strict";r.attributes=t("./attributes"),r.supplyLayoutDefaults=t("./defaults"),r.draw=t("./draw")},{"./attributes":315,"./defaults":318,"./draw":319}],322:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background},bordercolor:{valType:"color",dflt:n.defaultLine},borderwidth:{valType:"integer",dflt:0,min:0},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},thickness:{valType:"number",dflt:.15,min:0,max:1},visible:{valType:"boolean",dflt:!0}}},{"../color/attributes":266}],323:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("../../constants/xmlns_namespaces").svg,s=t("./helpers"),l=t("./range_plot");e.exports=function(t){function e(t){var e=d.range[0],r=d.range[1],n=r-e,i=t/p*n+e;
return i=o.constrain(i,e,r)}function r(t,e){t=t||-(1/0),e=e||1/0;var r=d.range[0],n=d.range[1],i=n-r,o=(t-r)/i*p,a=(e-r)/i*p;c(o,a)}function u(e,r){window.requestAnimationFrame?window.requestAnimationFrame(function(){n.relayout(t,"xaxis.range",[e,r])}):setTimeout(function(){n.relayout(t,"xaxis.range",[e,r])},16)}function c(t,e){if(t=o.constrain(t,0,p),e=o.constrain(e,0,p),t>e){var r=e;e=t,t=r}s.setAttributes(w,{"data-min":t,"data-max":e}),s.setAttributes(N,{x:t,width:e-t}),s.setAttributes(k,{width:t}),s.setAttributes(T,{x:e,width:p-e}),s.setAttributes(E,{transform:"translate("+(t-v-1)+")"}),s.setAttributes(C,{transform:"translate("+e+")"})}var f=t._fullLayout,h=f._infolayer.selectAll("g.range-slider"),d=f.xaxis.rangeslider,p=f._size.w,g=(f.height-f.margin.b-f.margin.t)*d.thickness,v=2,m=Math.floor(d.borderwidth/2),y=f.margin.l,b=f.height-g-f.margin.b,x=0,_=p,w=document.createElementNS(a,"g");s.setAttributes(w,{"class":"range-slider","data-min":x,"data-max":_,"pointer-events":"all",transform:"translate("+y+","+b+")"});var A=document.createElementNS(a,"rect"),M=d.borderwidth%2===0?d.borderwidth:d.borderwidth-1;s.setAttributes(A,{fill:d.bgcolor,stroke:d.bordercolor,"stroke-width":d.borderwidth,height:g+M,width:p+M,transform:"translate(-"+m+", -"+m+")","shape-rendering":"crispEdges"});var k=document.createElementNS(a,"rect");s.setAttributes(k,{x:0,width:x,height:g,fill:"rgba(0,0,0,0.4)"});var T=document.createElementNS(a,"rect");s.setAttributes(T,{x:_,width:p-_,height:g,fill:"rgba(0,0,0,0.4)"});var E=document.createElementNS(a,"g"),L=document.createElementNS(a,"rect"),S=document.createElementNS(a,"rect");s.setAttributes(E,{transform:"translate("+(x-v-1)+")"}),s.setAttributes(L,{width:10,height:g,x:-6,fill:"transparent",cursor:"col-resize"}),s.setAttributes(S,{width:v,height:g/2,y:g/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(E,[S,L]);var C=document.createElementNS(a,"g"),P=document.createElementNS(a,"rect"),R=document.createElementNS(a,"rect");s.setAttributes(C,{transform:"translate("+_+")"}),s.setAttributes(P,{width:10,height:g,x:-2,fill:"transparent",cursor:"col-resize"}),s.setAttributes(R,{width:v,height:g/2,y:g/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(C,[R,P]);var N=document.createElementNS(a,"rect");s.setAttributes(N,{x:x,width:_-x,height:g,cursor:"ew-resize",fill:"transparent"}),w.addEventListener("mousedown",function(t){function r(t){var r,n,f=+t.clientX-o;switch(i){case N:w.style.cursor="ew-resize",r=+s+f,n=+l+f,c(r,n),u(e(r),e(n));break;case L:w.style.cursor="col-resize",r=+s+f,n=+l,c(r,n),u(e(r),e(n));break;case P:w.style.cursor="col-resize",r=+s,n=+l+f,c(r,n),u(e(r),e(n));break;default:w.style.cursor="ew-resize",r=a,n=a+f,c(r,n),u(e(r),e(n))}}function n(){window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n),w.style.cursor="auto"}var i=t.target,o=t.clientX,a=o-w.getBoundingClientRect().left,s=w.getAttribute("data-min"),l=w.getAttribute("data-max");window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)}),d.range||(d.range=i.getAutoRange(f.xaxis));var z=l(t,p,g);s.appendChildren(w,[A,z,k,T,N,E,C]),r(f.xaxis.range[0],f.xaxis.range[1]),h.data([0]).enter().append(function(){return d.setRange=r,w})}},{"../../constants/xmlns_namespaces":333,"../../lib":342,"../../plotly":362,"../../plots/cartesian/axes":365,"./helpers":325,"./range_plot":327}],324:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,o){function a(t,e){return n.coerce(s,l,i,t,e)}if(t[r].rangeslider){var s="object"==typeof t[r].rangeslider?t[r].rangeslider:{},l=e[r].rangeslider={};if(a("bgcolor"),a("bordercolor"),a("borderwidth"),a("thickness"),a("visible"),a("range"),l.range&&!e[r].autorange){var u=l.range,c=e[r].range;u[0]=Math.min(u[0],c[0]),u[1]=Math.max(u[1],c[1])}else e[r]._needsExpand=!0;l.visible&&o.forEach(function(t){var r=e[t]||{};r.fixedrange=!0,e[t]=r})}}},{"../../lib":342,"./attributes":322}],325:[function(t,e,r){"use strict";r.setAttributes=function(t,e){for(var r in e)t.setAttribute(r,e[r])},r.appendChildren=function(t,e){for(var r=0;r<e.length;r++)e[r]&&t.appendChild(e[r])}},{}],326:[function(t,e,r){"use strict";function n(t){if(t._fullLayout.xaxis){var e=t._fullLayout,r=e._infolayer.selectAll("g.range-slider"),n=e.xaxis.rangeslider;if(!n||!n.visible)return r.data([]).exit().remove(),void i.autoMargin(t,"range-slider");var a=(e.height-e.margin.b-e.margin.t)*n.thickness,s=Math.floor(n.borderwidth/2);0!==r[0].length||e._has("gl2d")||o(t);var l=e.xaxis._boundingBox?e.xaxis._boundingBox.height:0;i.autoMargin(t,"range-slider",{x:0,y:0,l:0,r:0,t:0,b:a+e.margin.b+l,pad:15+2*s})}}var i=t("../../plots/plots"),o=t("./create_slider"),a=t("./defaults");e.exports={draw:n,supplyLayoutDefaults:a}},{"../../plots/plots":398,"./create_slider":323,"./defaults":324}],327:[function(t,e,r){"use strict";function n(t,e){for(var r=e.makeCalcdata(t||[],e._id[0]),n=0;n<r.length;n++)r[n]=e.c2l(r[n]);return r}function i(t,e,r,n){var i,o,f;if(t.line){i=document.createElementNS(c,"path");var h=l.smoothopen(e,t.line.smoothing||0);u.setAttributes(i,{d:h,fill:"none",stroke:t.line?t.line.color:"transparent","stroke-width":t.line.width/2||1,opacity:1})}if(t.marker){o=document.createElementNS(c,"g");var d=e.map(function(e,r){var n,i=document.createElementNS(c,"g"),o=document.createElementNS(c,"path");return n=Array.isArray(t.marker.size)?"number"==typeof t.marker.size[r]?Math.max(t.marker.size[r]/(t.marker.sizeref||1)/15,0):0:Math.max(t.marker.size/15,2),u.setAttributes(o,{d:s[t.marker.symbol].f(n),fill:t.marker.color,stroke:t.marker.line.color,"stroke-width":t.marker.line.width,opacity:t.marker.opacity}),u.setAttributes(i,{transform:"translate("+e[0]+","+e[1]+")"}),i.appendChild(o),i});u.appendChildren(o,d)}if("none"!==t.fill){switch(f=document.createElementNS(c,"path"),t.fill){case"tozeroy":e.unshift([e[0][0],n]),e.push([e[e.length-1][0],n]);break;case"tozerox":e.unshift([0,e[e.length-1][1]]);break;default:a.warn("Fill type "+t.fill+" not supported for range slider! (yet...)")}var p=l.smoothopen(e,t.line.smoothing||0);u.setAttributes(f,{d:p,fill:t.fillcolor||"transparent"})}return[i,o,f]}var o=t("d3"),a=t("../../lib"),s=t("../drawing/symbol_defs"),l=t("../drawing"),u=t("./helpers"),c=t("../../constants/xmlns_namespaces").svg;e.exports=function f(t,e,r){var s=t._fullLayout,h=t._fullData,d=s.xaxis,p=s.yaxis,g=d.rangeslider.range[0],v=d.rangeslider.range[1],m=p.range[0],y=p.range[1],b=document.createElementNS(c,"path");b.setAttribute("d",["M0,0",e+",0",e+","+r,"0,"+r,"Z"].join(" "));var x=document.createElementNS(c,"clipPath");x.setAttribute("id","range-clip-path"),x.appendChild(b);var _=document.createElementNS(c,"defs");_.appendChild(x);var f=document.createElementNS(c,"g");o.select(f).call(l.setClipUrl,"range-clip-path"),f.appendChild(_);for(var w=["scatter"],A=0;A<h.length;A++){var M=h[A],k=[];if(w.indexOf(M.type)<0)a.warn("Trace type "+M.type+" not supported for range slider!");else{for(var T=n(M,d),E=n(M,p),L=0;L<T.length;L++){var S=e*(T[L]-g)/(v-g),C=r*(1-(E[L]-m)/(y-m));isNaN(S)||isNaN(C)||k.push([S,C])}u.appendChildren(f,i(M,k,e,r))}}return f}},{"../../constants/xmlns_namespaces":333,"../../lib":342,"../drawing":290,"../drawing/symbol_defs":291,"./helpers":325,d3:100}],328:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes"),o=t("../../lib/extend").extendFlat,a=i.line;e.exports={_isLinkedToArray:!0,type:{valType:"enumerated",values:["circle","rect","path","line"]},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},xref:o({},n.xref,{}),x0:{valType:"any"},x1:{valType:"any"},yref:o({},n.yref,{}),y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string"},opacity:{valType:"number",min:0,max:1,dflt:1},line:{color:a.color,width:a.width,dash:a.dash},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"}}},{"../../lib/extend":339,"../../traces/scatter/attributes":419,"../annotations/attributes":264}],329:[function(t,e,r){"use strict";function n(t,e){function r(e,r){return M.coerce(t,n,C.layoutAttributes,e,r)}var n={};r("layer"),r("opacity"),r("fillcolor"),r("line.color"),r("line.width"),r("line.dash");for(var i=t.path?"path":"rect",a=r("type",i),s=["x","y"],l=0;2>l;l++){var u=s[l],c={_fullLayout:e},f=k.coerceRef(t,n,c,u);if("path"!==a){var h=.25,d=.75;if("paper"!==f){var p=k.getFromId(c,f),g=o(p);h=g(p.range[0]+h*(p.range[1]-p.range[0])),d=g(p.range[0]+d*(p.range[1]-p.range[0]))}r(u+"0",h),r(u+"1",d)}}return"path"===a?r("path"):M.noneOrAll(t,n,["x0","x1","y0","y1"]),n}function i(t){return"category"===t.type?t.c2l:t.d2l}function o(t){return"category"===t.type?t.l2c:t.l2d}function a(t,e){t.layout.shapes=e,C.supplyLayoutDefaults(t.layout,t._fullLayout),C.drawAll(t)}function s(t){delete t.layout.shapes,t._fullLayout.shapes=[],C.drawAll(t)}function l(t,e,r){for(var n=0;n<t._fullLayout.shapes.length;n++)C.draw(t,n,e,r)}function u(t,e){d(t,e).selectAll('[data-index="'+e+'"]').remove(),t._fullLayout.shapes.splice(e,1),t.layout.shapes.splice(e,1);for(var r=e;r<t._fullLayout.shapes.length;r++)d(t,r).selectAll('[data-index="'+(r+1)+'"]').attr("data-index",r),C.draw(t,r)}function c(t,e,r){t._fullLayout.shapes.splice(e,0,{});var n=M.isPlainObject(r)?M.extendFlat({},r):{text:"New text"};t.layout.shapes?t.layout.shapes.splice(e,0,n):t.layout.shapes=[n];for(var i=t._fullLayout.shapes.length-1;i>e;i--)d(t,i).selectAll('[data-index="'+(i-1)+'"]').attr("data-index",i),C.draw(t,i)}function f(t,e,r,a){function s(r){var n={"data-index":e,"fill-rule":"evenodd",d:b(t,C)},i=C.line.width?C.line.color:"rgba(0,0,0,0)",o=r.append("path").attr(n).style("opacity",C.opacity).call(T.stroke,i).call(T.fill,C.fillcolor).call(E.dashLine,C.line.dash,C.line.width);P&&o.call(E.setClipUrl,"clip"+t._fullLayout._uid+P),t._context.editable&&h(t,o,C,e)}var l,u;d(t,e).selectAll('[data-index="'+e+'"]').remove();var c=t.layout.shapes[e];if(c){var f={xref:c.xref,yref:c.yref},g={};"string"==typeof r&&r?g[r]=a:M.isPlainObject(r)&&(g=r);var v=Object.keys(g);for(l=0;l<v.length;l++){var m=v[l];M.nestedProperty(c,m).set(g[m])}var y=["x0","x1","y0","y1"];for(l=0;4>l;l++){var x=y[l];if(void 0===g[x]&&void 0!==c[x]){var _,w=x.charAt(0),A=k.getFromId(t,k.coerceRef(f,{},t,w)),L=k.getFromId(t,k.coerceRef(c,{},t,w)),S=c[x];void 0!==g[w+"ref"]&&(A?(_=i(A)(S),S=(_-A.range[0])/(A.range[1]-A.range[0])):S=(S-L.domain[0])/(L.domain[1]-L.domain[0]),L?(_=L.range[0]+S*(L.range[1]-L.range[0]),S=o(L)(_)):S=A.domain[0]+S*(A.domain[1]-A.domain[0])),c[x]=S}}var C=n(c,t._fullLayout);t._fullLayout.shapes[e]=C;var P;if("below"!==C.layer)P=(C.xref+C.yref).replace(/paper/g,""),s(t._fullLayout._shapeUpperLayer);else if("paper"===C.xref&&"paper"===C.yref)P="",s(t._fullLayout._shapeLowerLayer);else{var R,N=t._fullLayout._plots||{},z=Object.keys(N);for(l=0,u=z.length;u>l;l++)R=N[z[l]],P=z[l],p(t,C,R)&&s(R.shapelayer)}}}function h(t,e,r,n){function i(t){var r=$.right-$.left,n=$.bottom-$.top,i=t.clientX-$.left,o=t.clientY-$.top,a=r>W&&n>Z&&!t.shiftKey?L.getCursor(i/r,1-o/n):"move";S(e,a),Y=a.split("-")[0]}function o(e){U=k.getFromId(t,r.xref),V=k.getFromId(t,r.yref),q=m(t,U),H=m(t,V,!0),G=y(t,U),X=y(t,V,!0);var o="shapes["+n+"]";"path"===r.type?(F=r.path,B=o+".path"):(c=q(r.x0),f=H(r.y0),h=q(r.x1),d=H(r.y1),p=o+".x0",g=o+".y0",_=o+".x1",w=o+".y1"),h>c?(E=c,N=o+".x0",j="x0",C=h,z=o+".x1",D="x1"):(E=h,N=o+".x1",j="x1",C=c,z=o+".x0",D="x0"),d>f?(M=f,P=o+".y0",I="y0",T=d,R=o+".y1",O="y1"):(M=d,P=o+".y1",I="y1",T=f,R=o+".y0",O="y0"),u={},i(e),Q.moveFn="move"===Y?s:l}function a(r){S(e),r&&A.relayout(t,u)}function s(n,i){if("path"===r.type){var o=function(t){return G(q(t)+n)};U&&"date"===U.type&&(o=v(o));var a=function(t){return X(H(t)+i)};V&&"date"===V.type&&(a=v(a)),r.path=x(F,o,a),u[B]=r.path}else u[p]=r.x0=G(c+n),u[g]=r.y0=X(f+i),u[_]=r.x1=G(h+n),u[w]=r.y1=X(d+i);e.attr("d",b(t,r))}function l(n,i){if("path"===r.type){var o=function(t){return G(q(t)+n)};U&&"date"===U.type&&(o=v(o));var a=function(t){return X(H(t)+i)};V&&"date"===V.type&&(a=v(a)),r.path=x(F,o,a),u[B]=r.path}else{var s=~Y.indexOf("n")?M+i:M,l=~Y.indexOf("s")?T+i:T,c=~Y.indexOf("w")?E+n:E,f=~Y.indexOf("e")?C+n:C;l-s>Z&&(u[P]=r[I]=X(s),u[R]=r[O]=X(l)),f-c>W&&(u[N]=r[j]=G(c),u[z]=r[D]=G(f))}e.attr("d",b(t,r))}var u,c,f,h,d,p,g,_,w,M,T,E,C,P,R,N,z,I,O,j,D,F,B,U,V,q,H,G,X,Y,W=10,Z=10,Q={setCursor:i,element:e.node(),prepFn:o,doneFn:a},$=Q.element.getBoundingClientRect();L.init(Q)}function d(t,e){var r=t._fullLayout.shapes[e],n=t._fullLayout._shapeUpperLayer;return r?"below"===r.layer&&(n="paper"===r.xref&&"paper"===r.yref?t._fullLayout._shapeLowerLayer:t._fullLayout._shapeSubplotLayer):M.log("getShapeLayer: undefined shape: index",e),n}function p(t,e,r){var n=A.Axes.getFromId(t,r.id,"x")._id,i=A.Axes.getFromId(t,r.id,"y")._id,o="below"===e.layer,a=n===e.xref||i===e.yref,s=!!r.shapelayer;return o&&a&&s}function g(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}}function v(t){return function(e){return t(e).replace(" ","_")}}function m(t,e,r){var n,o=t._fullLayout._size;if(e){var a=i(e);n=function(t){return e._offset+e.l2p(a(t,!0))},"date"===e.type&&(n=g(n))}else n=r?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return n}function y(t,e,r){var n,i=t._fullLayout._size;if(e){var a=o(e);n=function(t){return a(e.p2l(t-e._offset))}}else n=r?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return n}function b(t,e){var r,n,o,a,s=e.type,l=k.getFromId(t,e.xref),u=k.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(r=i(l),n=function(t){return l._offset+l.l2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(o=i(u),a=function(t){return u._offset+u.l2p(o(t,!0))}):a=function(t){return c.t+c.h*(1-t)},"path"===s)return l&&"date"===l.type&&(n=g(n)),u&&"date"===u.type&&(a=g(a)),C.convertPath(e.path,n,a);var f=n(e.x0),h=n(e.x1),d=a(e.y0),p=a(e.y1);if("line"===s)return"M"+f+","+d+"L"+h+","+p;if("rect"===s)return"M"+f+","+d+"H"+h+"V"+p+"H"+f+"Z";var v=(f+h)/2,m=(d+p)/2,y=Math.abs(v-f),b=Math.abs(m-d),x="A"+y+","+b,_=v+y+","+m,w=v+","+(m-b);return"M"+_+x+" 0 1,1 "+w+x+" 0 0,1 "+_+"Z"}function x(t,e,r){return t.replace(P,function(t){var n=0,i=t.charAt(0),o=N[i],a=z[i],s=I[i],l=t.substr(1).replace(R,function(t){return n>=s?t:(o[n]?t=e(t):a[n]&&(t=r(t)),n++,t)});return i+l})}function _(t,e,r,n,i){var o="category"===t.type?Number:t.d2c;if(void 0!==e)return[o(e),o(r)];if(n){var a,s,l,u,c,f=1/0,h=-(1/0),d=n.match(P);for("date"===t.type&&(o=g(o)),a=0;a<d.length;a++)s=d[a],l=i[s.charAt(0)].drawn,void 0!==l&&(u=d[a].substr(1).match(R),!u||u.length<l||(c=o(u[l]),f>c&&(f=c),c>h&&(h=c)));return h>=f?[f,h]:void 0}}var w=t("fast-isnumeric"),A=t("../../plotly"),M=t("../../lib"),k=t("../../plots/cartesian/axes"),T=t("../color"),E=t("../drawing"),L=t("../dragelement"),S=t("../../lib/setcursor"),C=e.exports={};C.layoutAttributes=t("./attributes"),C.supplyLayoutDefaults=function(t,e){for(var r=t.shapes||[],i=e.shapes=[],o=0;o<r.length;o++)i.push(n(r[o]||{},e))},C.drawAll=function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayer.selectAll("path").remove();for(var r=0;r<e.shapes.length;r++)C.draw(t,r)},C.add=function(t){var e=t._fullLayout.shapes.length;A.relayout(t,"shapes["+e+"]","add")},C.draw=function(t,e,r,n){if(!w(e)||-1===e){if(!e&&Array.isArray(n))return void a(t,n);if("remove"===n)return void s(t);if(r&&"add"!==n)return void l(t,r,n);e=t._fullLayout.shapes.length,t._fullLayout.shapes.push({})}if(!r&&n){if("remove"===n)return void u(t,e);("add"===n||M.isPlainObject(n))&&c(t,e,n)}f(t,e,r,n)};var P=/[MLHVQCTSZ][^MLHVQCTSZ]*/g,R=/[^\s,]+/g,N={M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},z={M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},I={M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0};C.convertPath=function(t,e,r){return t.replace(P,function(t){var n=0,i=t.charAt(0),o=N[i],a=z[i],s=I[i],l=t.substr(1).replace(R,function(t){return o[n]?t=e(t):a[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),M.log("Ignoring extra params in segment "+t)),i+l})},C.calcAutorange=function(t){var e,r,n,i,o,a=t._fullLayout,s=a.shapes;if(s.length&&t._fullData.length)for(e=0;e<s.length;e++)r=s[e],n=r.line.width/2,"paper"!==r.xref&&(i=k.getFromId(t,r.xref),o=_(i,r.x0,r.x1,r.path,N),o&&k.expand(i,o,{ppad:n})),"paper"!==r.yref&&(i=k.getFromId(t,r.yref),o=_(i,r.y0,r.y1,r.path,z),o&&k.expand(i,o,{ppad:n}))}},{"../../lib":342,"../../lib/setcursor":351,"../../plotly":362,"../../plots/cartesian/axes":365,"../color":267,"../dragelement":288,"../drawing":290,"./attributes":328,"fast-isnumeric":104}],330:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=t("../../plotly"),a=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),u=t("../color"),c=t("../../lib/svg_text_utils"),f=e.exports={};f.draw=function(t,e,r){function f(t){s.syncOrAsync([h,d],t)}function h(e){return e.attr("transform",_?"rotate("+[_.rotate,x.x,x.y]+") translate(0, "+_.offset+")":null),e.style({"font-family":M,"font-size":n.round(k,2)+"px",fill:u.rgb(T),opacity:E*u.opacity(T),"font-weight":a.fontWeight}).attr(x).call(c.convertToTspans).attr(x),e.selectAll("tspan.line").attr(x),a.previousPromises(t)}function d(t){var e=n.select(t.node().parentNode);if(b&&b.selection&&b.side&&S){e.attr("transform",null);var r=0,o={left:"right",right:"left",top:"bottom",bottom:"top"}[b.side],a=-1!==["left","top"].indexOf(b.side)?-1:1,u=i(b.pad)?b.pad:2,c=l.bBox(e.node()),f={left:0,top:0,right:A.width,bottom:A.height},h=b.maxShift||(f[b.side]-c[b.side])*("left"===b.side||"top"===b.side?-1:1);if(0>h?r=h:(c.left-=b.offsetLeft,c.right-=b.offsetLeft,c.top-=b.offsetTop,c.bottom-=b.offsetTop,b.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,a*(t[b.side]-c[o])+u))}),r=Math.min(h,r)),r>0||0>h){var d={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[b.side];e.attr("transform","translate("+d+")")}}}function p(){E=0,L=!0,S=P,A._infolayer.select("."+e).attr({"data-unformatted":S}).text(S).on("mouseover.opacity",function(){n.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(1e3).style("opacity",0)})}var g=r.propContainer,v=r.propName,m=r.traceIndex,y=r.dfltName,b=r.avoid||{},x=r.attributes,_=r.transform,w=r.containerGroup,A=t._fullLayout,M=g.titlefont.family,k=g.titlefont.size,T=g.titlefont.color,E=1,L=!1,S=g.title.trim();""===S&&(E=0),S.match(/Click to enter .+ title/)&&(E=.2,L=!0),w||(w=A._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var C=w.selectAll("text").data([0]);C.enter().append("text"),C.text(S).attr("class",e),C.attr({"data-unformatted":S}).call(f);var P="Click to enter "+y+" title";t._context.editable?(S||p(),C.call(c.makeEditable).on("edit",function(e){void 0!==m?o.restyle(t,v,e,m):o.relayout(t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(x).selectAll("tspan.line").attr(x)})):S&&!S.match(/Click to enter .+ title/)||C.remove(),C.classed("js-placeholder",L)}},{"../../lib":342,"../../lib/svg_text_utils":355,"../../plotly":362,"../../plots/plots":398,"../color":267,"../drawing":290,d3:100,"fast-isnumeric":104}],331:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],332:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],333:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],334:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.15.0",r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=n.register,r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=n.Snapshot,r.PlotSchema=n.PlotSchema,r.Queue=n.Queue,r.d3=t("d3")},{"../build/ploticon":2,"./plot_api/set_plot_config":359,"./plot_api/to_image":360,"./plot_api/validate":361,"./plotly":362,"./snapshot/download":406,d3:100}],335:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],336:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),o=t("./nested_property"),a=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),/^([2-9]|[1-9][0-9]+)$/);r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)}},"boolean":{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;n.strict!==!0&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(a(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;return"string"==typeof t&&t.substr(0,n)===r&&s.test(t.substr(n))?void e.set(t):void e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r?!0:"string"!=typeof t?!1:!(t.substr(0,n)!==r||!s.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),o=0;o<i.length;){var a=i[o];-1===n.flags.indexOf(a)||i.indexOf(a)<o?i.splice(o,1):o++}i.length?e.set(i.join("+")):e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,i){if(!Array.isArray(t))return void e.set(n);var o=i.items,a=[];n=Array.isArray(n)?n:[];for(var s=0;s<o.length;s++)r.coerce(t,a,o,"["+s+"]",n[s]);e.set(a)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var n=e.items;if(t.length!==n.length)return!1;for(var i=0;i<n.length;i++){var o=r.validate(t[i],e.items[i]);if(!o)return!1}return!0}}},r.coerce=function(t,e,n,i,a){var s=o(n,i).get(),l=o(t,i),u=o(e,i),c=l.get();return void 0===a&&(a=s.dflt),s.arrayOk&&Array.isArray(c)?(u.set(c),c):(r.valObjects[s.valType].coerceFunction(c,u,a,s),u.get())},r.coerce2=function(t,e,n,i,a){var s=o(t,i),l=r.coerce(t,e,n,i,a);return s.get()?l:!1},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.validate=function(t,e){var n=r.valObjects[e.valType];if(e.arrayOk&&Array.isArray(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var i={},o=i,a={set:function(t){o=t}};return n.coerceFunction(t,a,i,e),o!==i}},{"../components/colorscale/get_scale":279,"../components/colorscale/scales":285,"./nested_property":346,"fast-isnumeric":104,tinycolor2:239}],337:[function(t,e,r){"use strict";function n(t,e){return String(t+Math.pow(10,e)).substr(1)}function i(t){var e;return e=b.test(t)?"Y":"y",e+=x.test(t)?"b":""}function o(t){var e;return e=w.test(t)?_.test(t)?"I":"H":"D"}var a=t("d3"),s=t("fast-isnumeric"),l=t("../lib");r.dateTime2ms=function(t){try{if(t.getTime)return+t}catch(e){return!1}var r,n,i,o,a=String(t).split(" ");if(a.length>2)return!1;var l=a[0].split("-");if(l.length>3||3!==l.length&&a[1])return!1;if(4===l[0].length)r=Number(l[0]);else{if(2!==l[0].length)return!1;var u=(new Date).getFullYear();r=((Number(l[0])-u+70)%100+200)%100+u-70}return s(r)?1===l.length?new Date(r,0,1).getTime():(n=Number(l[1])-1,l[1].length>2||!(n>=0&&11>=n)?!1:2===l.length?new Date(r,n,1).getTime():(i=Number(l[2]),l[2].length>2||!(i>=1&&31>=i)?!1:(i=new Date(r,n,i).getTime(),a[1]?(l=a[1].split(":"),l.length>3?!1:(o=Number(l[0]),l[0].length>2||!(o>=0&&23>=o)?!1:(i+=36e5*o,1===l.length?i:(n=Number(l[1]),l[1].length>2||!(n>=0&&59>=n)?!1:(i+=6e4*n,2===l.length?i:(t=Number(l[2]),t>=0&&60>t?i+1e3*t:!1)))))):i))):!1},r.isDateTime=function(t){return r.dateTime2ms(t)!==!1},r.ms2DateTime=function(t,e){if("undefined"==typeof a)return void l.error("d3 is not defined.");e||(e=0);var r=new Date(t),i=a.time.format("%Y-%m-%d")(r);return 7776e6>e?(i+=" "+n(r.getHours(),2),432e6>e&&(i+=":"+n(r.getMinutes(),2),108e5>e&&(i+=":"+n(r.getSeconds(),2),3e5>e&&(i+="."+n(r.getMilliseconds(),3)))),i.replace(/([:\s]00)*\.?[0]*$/,"")):i};var u={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},c={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},f=a.time.format.utc,h={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(f),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(f)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(f)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){c[t].forEach(function(e){h[t].D.push(f(e)),["H","I","D"].forEach(function(r){u[r].forEach(function(n){var i=h[t][r];i.push(f(e+"~"+n)),i.push(f(n+"~"+e))})})})});var d=/[a-z]*/g,p=function(t){return t.substr(0,3)},g=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,v=/[\s,\/\-\.\(\)]+/g,m=/~?([ap])~?m(~|$)/,y=function(t,e){return e+"m "},b=/\d\d\d\d/,x=/(^|~)[a-z]{3}/,_=/[ap]m/,w=/:/,A=/q([1-4])/,M=["31~mar","30~jun","30~sep","31~dec"],k=function(t,e){return M[e-1]},T=/ ?([+\-]\d\d:?\d\d|Z)$/;r.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(d,p).replace(g,"").replace(v,"~").replace(m,y).replace(A,k).trim().replace(T,"");var e,r,n=null,a=i(t),s=o(t);e=h[a][s],r=e.length;for(var l=0;r>l&&!(n=e[l].parse(t));l++);if(!(n instanceof Date))return!1;var u=n.getTimezoneOffset();return n.setTime(n.getTime()+60*u*1e3),n}},{"../lib":342,d3:100,"fast-isnumeric":104}],338:[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;return t._ev=e,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.emit=function(r,n){"undefined"!=typeof jQuery&&jQuery(t).trigger(r,n),e.emit(r,n)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var o=t._ev;if(!o)return n;var a=o._events[e];if(!a)return n;"function"==typeof a&&(a=[a]);for(var s=a.pop(),l=0;l<a.length;l++)a[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,t}};e.exports=i},{events:43}],339:[function(t,e,r){"use strict";function n(t,e){var r,n;for(r=0;r<t.length;r++){if(n=t[r],null!==n&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}function i(t,e,r){var s,l,u,c,f,h,d,p=t[0],g=t.length;if(2===g&&a(p)&&a(t[1])&&0===p.length){if(d=n(t[1],p))return p;p.splice(0,p.length)}for(var v=1;g>v;v++){s=t[v];for(l in s)u=p[l],c=s[l],e&&c&&(o(c)||(f=a(c)))?(f?(f=!1,h=u&&a(u)?u:[]):h=u&&o(u)?u:{},p[l]=i([h,c],e,r)):("undefined"!=typeof c||r)&&(p[l]=c)}return p}var o=t("./is_plain_object.js"),a=Array.isArray;r.extendFlat=function(){return i(arguments,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0)}},{"./is_plain_object.js":343}],340:[function(t,e,r){"use strict";function n(t,e){var r=f(t);return r[3]*=e,r}function i(t){return s(t).isValid()?t:c}function o(t){return l(t)?t:h}function a(t,e,r){var a,s,l,f,d,p=t.color,g=Array.isArray(p),v=Array.isArray(e),m=[];if(a=void 0!==t.colorscale?u(t.colorscale,t.cmin,t.cmax):i,s=g?function(t,e){return void 0===t[e]?c:a(t[e])}:i,l=v?function(t,e){return void 0===t[e]?h:o(t[e])}:o,g||v)for(var y=0;r>y;y++)f=s(p,y),d=l(e,y),m[y]=n(f,d);else m=n(p,e);return m}var s=t("tinycolor2"),l=t("fast-isnumeric"),u=t("../components/colorscale/make_scale_function"),c=t("../components/color/attributes").defaultLine,f=t("./str2rgbarray"),h=1;e.exports=a},{"../components/color/attributes":266,"../components/colorscale/make_scale_function":284,"./str2rgbarray":354,"fast-isnumeric":104,tinycolor2:239}],341:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("<sup>",e))>=0;){var r=t.indexOf("</sup>",e);if(e>r)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\<br\>/g,"\n")}function o(t){return t.replace(/\<.*\>/g,"")}function a(t){for(var e=0;(e=t.indexOf("&",e))>=0;){var r=t.indexOf(";",e);if(e>r)e+=1;else{var n=u[t.slice(e+1,r)];t=n?t.slice(0,e)+n+t.slice(r+1):t.slice(0,e)+t.slice(r+1)}}return t}function s(t){return""+a(o(n(i(t))))}var l=t("superscript-text"),u={mu:"\u03bc",amp:"&",lt:"<",gt:">"};e.exports=s},{"superscript-text":229}],342:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object");var o=t("./coerce");i.valObjects=o.valObjects,i.coerce=o.coerce,i.coerce2=o.coerce2,i.coerceFont=o.coerceFont,i.validate=o.validate;var a=t("./dates");i.dateTime2ms=a.dateTime2ms,i.isDateTime=a.isDateTime,i.ms2DateTime=a.ms2DateTime,i.parseDate=a.parseDate;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.sorterDes=s.sorterDes,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t("./matrix");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t("./extend");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll;var f=t("./loggers");i.log=f.log,i.warn=f.warn,i.error=f.error,i.notifier=t("./notifier"),i.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var o=0;o<e.length;o++){var a=e[o],s=i.nestedProperty(t,a.replace("?",r)),l=i.nestedProperty(t,a.replace("?",n)),u=s.get();s.set(l.get()),l.set(u)}},i.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},i.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},i.identity=function(t){return t},i.randstr=function h(t,e,r){if(r||(r=16),void 0===e&&(e=24),0>=e)return"0";var n,i,o,a=Math.log(Math.pow(2,e))/Math.log(r),s="";for(n=2;a===1/0;n*=2)a=Math.log(Math.pow(2,e/n))/Math.log(r)*n;var l=a-Math.floor(a);for(n=0;n<Math.floor(a);n++)o=Math.floor(Math.random()*r).toString(r),
s=o+s;l&&(i=Math.pow(r,l),o=Math.floor(Math.random()*i).toString(r),s=o+s);var u=parseInt(s,r);return t&&t.indexOf(s)>-1||u!==1/0&&u>=Math.pow(2,e)?h(t,e,r):s},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},i.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var r,n,i,o,a=t.length,s=2*a,l=2*e-1,u=new Array(l),c=new Array(a);for(r=0;l>r;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;a>r;r++){for(o=0,n=0;l>n;n++)i=r+n+1-e,-a>i?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),0>i?i=-1-i:i>=a&&(i=s-1-i),o+=t[i]*u[n];c[r]=o}return c},i.syncOrAsync=function(t,e,r){function n(){return i.syncOrAsync(t,e,r)}for(var o,a;t.length;)if(a=t.splice(0,1)[0],o=a(e),o&&o.then)return o.then(n).then(void 0,i.promiseError);return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,o=!1,a=!0;for(n=0;n<r.length;n++)i=t[r[n]],void 0!==i&&null!==i?o=!0:a=!1;if(o&&!a)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},i.pushUnique=function(t,e){return e&&-1===t.indexOf(e)&&t.push(e),t},i.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),i=0;n>i;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,o,a,s=3,l=Object.keys(t);for(n=0;n<l.length;n++)o=l[n],a=t[o],"_"!==o.charAt(0)&&"function"!=typeof a&&("module"===o?r[o]=a:Array.isArray(a)?r[o]=a.slice(0,s):a&&"object"==typeof a?r[o]=i.minExtend(t[o],e[o]):r[o]=a);for(l=Object.keys(e),n=0;n<l.length;n++)o=l[n],a=e[o],"object"==typeof a&&o in r&&"object"==typeof r[o]||(r[o]=a);return r},i.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},i.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},i.getPlotDiv=function(t){for(;t&&t.removeAttribute;t=t.parentNode)if(i.isPlotDiv(t))return t},i.isPlotDiv=function(t){var e=n.select(t);return e.size()&&e.classed("js-plotly-plot")},i.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},i.addStyleRule=function(t,e){if(!i.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),i.styleSheet=r.sheet}var n=i.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):i.warn("addStyleRule failed")},i.getTranslate=function(t){var e=/.*\btranslate\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",i=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+i[0]||0,y:+i[1]||0}},i.setTranslate=function(t,e,r){var n=/(\btranslate\(.*?\);?)/,i=t.attr?"attr":"getAttribute",o=t.attr?"attr":"setAttribute",a=t[i]("transform")||"";return e=e||0,r=r||0,a=a.replace(n,"").trim(),a+=" translate("+e+", "+r+")",a=a.trim(),t[o]("transform",a),a},i.getScale=function(t){var e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",i=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+i[0]||1,y:+i[1]||1}},i.setScale=function(t,e,r){var n=/(\bscale\(.*?\);?)/,i=t.attr?"attr":"getAttribute",o=t.attr?"attr":"setAttribute",a=t[i]("transform")||"";return e=e||1,r=r||1,a=a.replace(n,"").trim(),a+=" scale("+e+", "+r+")",a=a.trim(),t[o]("transform",a),a},i.setPointGroupScale=function(t,e,r){var n,i,o;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",o=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(o,""),n+=i,n=n.trim(),this.setAttribute("transform",n)}),i},i.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob},i.objectFromPath=function(t,e){for(var r,n=t.split("."),i=r={},o=0;o<n.length;o++){var a=n[o],s=null,l=n[o].match(/(.*)\[([0-9]+)\]/);l?(a=l[1],s=l[2],r=r[a]=[],o===n.length-1?r[s]=e:r[s]={},r=r[s]):(o===n.length-1?r[a]=e:r[a]={},r=r[a])}return i},i.numSeparate=function(t,e){if("string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var r=/(\d+)(\d{3})/,n=e.charAt(0),i=e.charAt(1),o=t.split("."),a=o[0],s=o.length>1?n+o[1]:"";if(i&&(o.length>1||a.length>4))for(;r.test(a);)a=a.replace(r,"$1"+i+"$2");return a+s}},{"./coerce":336,"./dates":337,"./extend":339,"./is_plain_object":343,"./loggers":344,"./matrix":345,"./nested_property":346,"./notifier":347,"./search":350,"./stats":353,d3:100}],343:[function(t,e,r){"use strict";e.exports=function(t){return"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],344:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config"),i=e.exports={};i.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace?console.trace.apply(console,t):console.log.apply(console,t)}},i.warn=function(){if(n.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace?console.trace.apply(console,t):console.log.apply(console,t)}},i.error=function(){if(n.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);console.error.apply(console,arguments)}}},{"../plot_api/plot_config":357}],345:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;t>n;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;i>e;e++)n=Math.max(n,t[e].length);var o=new Array(n);for(e=0;n>e;e++)for(o[e]=new Array(i),r=0;i>r;r++)o[e][r]=t[r][e];return o},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,o=t.length;if(t[0].length)for(n=new Array(o),i=0;o>i;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var a=r.transposeRagged(e);for(n=new Array(a.length),i=0;i<a.length;i++)n[i]=r.dot(t,a[i])}else for(n=0,i=0;o>i;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],346:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,o,a,s,l=t;for(a=0;a<e.length-1;a++){if(r=e[a],-1===r){for(i=!0,o=[],s=0;s<l.length;s++)o[s]=n(l[s],e.slice(a+1))(),o[s]!==o[0]&&(i=!1);return i?o[0]:o}if("number"==typeof r&&!Array.isArray(l))return;if(l=l[r],"object"!=typeof l||null===l)return}if("object"==typeof l&&null!==l&&(o=l[e[a]],null!==o))return o}}function i(t,e){var r=["annotations","shapes","range","domain","buttons"],n=-1===r.indexOf(e);return Array.isArray(t)&&n}function o(t,e){return function(r){var n,o,c=t,f=[t],h=u(r)&&!i(r,e[e.length-1]);for(o=0;o<e.length-1;o++){if(n=e[o],"number"==typeof n&&!Array.isArray(c))throw"array index but container is not an array";if(-1===n){if(h=!a(c,e.slice(o+1),r))break;return}if(!s(c,n,e[o+1],h))break;if(c=c[n],"object"!=typeof c||null===c)throw"container is not an object";f.push(c)}h?(o===e.length-1&&delete c[e[o]],l(f)):c[e[o]]=r}}function a(t,e,r){var n,i=Array.isArray(r),a=!0,l=r,c=i?!1:u(r),f=e[0];for(n=0;n<t.length;n++)i&&(l=r[n%r.length],c=u(l)),c&&(a=!1),s(t,n,f,c)&&o(t[n],e)(l);return a}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;"number"==typeof r?t[e]=[]:t[e]={}}return!0}function l(t){var e,r,n,o,a;for(e=t.length-1;e>=0;e--){if(n=t[e],a=!1,Array.isArray(n))for(r=n.length-1;r>=0;r--)u(n[r])?a?n[r]=void 0:n.pop():a=!0;else if("object"==typeof n&&null!==n)for(o=Object.keys(n),a=!1,r=o.length-1;r>=0;r--)u(n[o[r]])&&!i(n[o[r]],o[r])?delete n[o[r]]:a=!0;if(a)return}}function u(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function c(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var f=t("fast-isnumeric");e.exports=function(t,e){if(f(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,a,s=0,l=e.split(".");s<l.length;){if(r=String(l[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])l[s]=r[1];else{if(0!==s)throw"bad property string";l.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),a=0;a<i.length;a++)s++,l.splice(s,0,Number(i[a]))}s++}return"object"!=typeof t?c(t,e,l):{set:o(t,l),get:n(t,l),astr:e,parts:l,obj:t}}},{"fast-isnumeric":104}],347:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=[];e.exports=function(t,e){function r(t){t.duration(700).style("opacity",0).each("end",function(t){var e=o.indexOf(t);-1!==e&&o.splice(e,1),n.select(this).remove()})}if(-1===o.indexOf(t)){o.push(t);var a=1e3;i(e)?a=e:"long"===e&&(a=3e3);var s=n.select("body").selectAll(".plotly-notifier").data([0]);s.enter().append("div").classed("plotly-notifier",!0);var l=s.selectAll(".notifier-note").data(o);l.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("×").on("click",function(){e.transition().call(r)}),e.append("p").html(t),e.transition().duration(700).style("opacity",1).transition().delay(a).call(r)})}}},{d3:100,"fast-isnumeric":104}],348:[function(t,e,r){"use strict";var n=t("./matrix").dot,i=e.exports={};i.tester=function(t){function e(t,e){var r=t[0],n=t[1];return i>r||r>o||a>n||n>s?!1:!e||!u(t)}function r(t,e){var r=t[0],l=t[1];if(i>r||r>o||a>l||l>s)return!1;var u,c,f,h,d,p=n.length,g=n[0][0],v=n[0][1],m=0;for(u=1;p>u;u++)if(c=g,f=v,g=n[u][0],v=n[u][1],h=Math.min(c,g),!(h>r||r>Math.max(c,g)||l>Math.max(f,v)))if(l<Math.min(f,v))r!==h&&m++;else{if(d=g===c?l:f+(r-c)*(v-f)/(g-c),l===d)return 1!==u||!e;d>=l&&r!==h&&m++}return m%2===1}var n=t.slice(),i=n[0][0],o=i,a=n[0][1],s=a;n.push(n[0]);for(var l=1;l<n.length;l++)i=Math.min(i,n[l][0]),o=Math.max(o,n[l][0]),a=Math.min(a,n[l][1]),s=Math.max(s,n[l][1]);var u,c=!1;return 5===n.length&&(n[0][0]===n[1][0]?n[2][0]===n[3][0]&&n[0][1]===n[3][1]&&n[1][1]===n[2][1]&&(c=!0,u=function(t){return t[0]===n[0][0]}):n[0][1]===n[1][1]&&n[2][1]===n[3][1]&&n[0][0]===n[3][0]&&n[1][0]===n[2][0]&&(c=!0,u=function(t){return t[1]===n[0][1]})),{xmin:i,xmax:o,ymin:a,ymax:s,pts:n,contains:c?e:r,isRect:c}};var o=i.isSegmentBent=function(t,e,r,i){var o,a,s,l=t[e],u=[t[r][0]-l[0],t[r][1]-l[1]],c=n(u,u),f=Math.sqrt(c),h=[-u[1]/f,u[0]/f];for(o=e+1;r>o;o++)if(a=[t[o][0]-l[0],t[o][1]-l[1]],s=n(a,u),0>s||s>c||Math.abs(n(a,h))>i)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var u=l+1;u<t.length;u++)(u===t.length-1||o(t,l,u+1,e))&&(n.push(t[u]),n.length<s-2&&(i=u,a=n.length-1),l=u)}var n=[t[0]],i=0,a=0;if(t.length>1){var s=t.pop();r(s)}return{addPt:r,raw:t,filtered:n}}},{"./matrix":345}],349:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],o=0;o<e.length;o++)r=e[o],r===t?n[o]=r:"object"==typeof r?n[o]=Array.isArray(r)?i.extendDeep([],r):i.extendDeepAll({},r):n[o]=r;return n}var i=t("../lib"),o=t("../plot_api/plot_config"),a={};a.add=function(t,e,r,n,i){var a,s;return t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?void(t.undoQueue.inSequence||(t.autoplay=!1)):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(a={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,a),t.undoQueue.index+=1):a=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,a&&(a.undo.calls.unshift(e),a.undo.args.unshift(r),a.redo.calls.push(n),a.redo.args.push(i)),void(t.undoQueue.queue.length>o.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)a.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},a.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.redo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)a.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},a.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=a},{"../lib":342,"../plot_api/plot_config":357}],350:[function(t,e,r){"use strict";function n(t,e){return e>t}function i(t,e){return e>=t}function o(t,e){return t>e}function a(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("../lib");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,f=0,h=e.length,d=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?a:o;h>f&&d++<100;)u=Math.floor((f+h)/2),c(e[u],t)?f=u+1:h=u;return d>90&&l.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,o=i/(n||1)/1e4,a=[e[0]],s=0;n>s;s++)e[s+1]>e[s]+o&&(i=Math.min(i,e[s+1]-e[s]),a.push(e[s+1]));return{vals:a,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,o=e.length-1,a=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;o>i&&a++<100;)n=u((i+o)/2),e[n]<=t?i=n+s:o=n-l;return e[i]}},{"../lib":342,"fast-isnumeric":104}],351:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],352:[function(t,e,r){"use strict";var n=t("../components/color"),i=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");return r.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../components/color":267}],353:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,o){var a,s;if(o||(o=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(o),a=0;o>a;a++)s[a]=r.aggNums(t,e,i[a]);i=s}for(a=0;o>a;a++)n(e)?n(i[a])&&(e=t(+e,+i[a])):e=i[a];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":104}],354:[function(t,e,r){"use strict";function n(t){return t=i(t),o.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),o=t("arraytools");e.exports=n},{arraytools:37,tinycolor2:239}],355:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function o(t,e,r){var n="math-output-"+l.Lib.randstr([],64),o=u.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=u.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())c.log("There was an error in the tex syntax.",t),r();else{var n=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,n)}o.remove()})}function a(t){for(var e=l.util.html_entity_decode(t),r=e.split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),r=e&&e[2].toLowerCase(),n=d[r];if(void 0!==n){var i=e[1],o=e[3],a=o.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===r){if(i)return"</a>";if("href"!==o.substr(0,4).toLowerCase())return"<a>";var s=o.substr(4).replace(/["']/g,"").replace(/=/,"").replace(/&/g,"&"),u=document.createElement("a");return u.href=s,-1===p.indexOf(u.protocol)?"<a>":'<a xlink:show="new" xlink:href="'+s+'">'}if("br"===r)return"<br>";if(i)return"sup"===r?'</tspan><tspan dy="0.42em">​</tspan>':"sub"===r?'</tspan><tspan dy="-0.21em">​</tspan>':"</tspan>";var c="<tspan";return"sup"!==r&&"sub"!==r||(c="​"+c),a&&(a=a[1].replace(/(^|;)\s*color:/,"$1 fill:"),n=(n?n+";":"")+a),c+(n?' style="'+n+'"':"")+">"}return l.util.xml_entity_encode(t).replace(/</g,"<")}),n=[],i=r.indexOf("<br>");i>0;i=r.indexOf("<br>",i+1))n.push(i);var o=0;n.forEach(function(t){for(var e=t+o,n=r.slice(0,e),i="",a=n.length-1;a>=0;a--){var s=n[a].match(/<(\/?).*>/i);if(s&&"<br>"!==n[a]){s[1]||(i=n[a]);break}}i&&(r.splice(e+1,0,i),r.splice(e,0,"</tspan>"),o+=2)});var a=r.join(""),s=a.split(/<br>/gi);return s.length>1&&(r=s.map(function(t,e){return'<tspan class="line" dy="'+1.3*e+'em">'+t+"</tspan>"})),r.join("")}function s(t,e,r){var n,i,o,a=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},o="right"===a?function(){return l.right-n.width}:"center"===a?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:o()-u.left+"px","z-index":1e3}),this}}var l=t("../plotly"),u=t("d3"),c=t("../lib"),f=t("../constants/xmlns_namespaces"),h=e.exports={};u.selection.prototype.appendSVG=function(t){for(var e=['<svg xmlns="',f.svg,'" ','xmlns:xlink="',f.xlink,'">',t,"</svg>"].join(""),r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(c.log(r.querySelector("parsererror div").textContent),null):u.select(this.node().lastChild)},h.html_entity_decode=function(t){var e=u.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),r},h.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},h.convertToTspans=function(t,e){function r(){d.empty()||(p=c.attr("class")+"-math",d.select("svg."+p).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),h=t.appendSVG(s),h||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(c)}var i=t.text(),s=a(i),c=t,f=!c.attr("data-notex")&&s.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),h=i,d=u.select(c.node().parentNode);if(!d.empty()){var p=c.attr("class")?c.attr("class").split(" ")[0]:"text";p+="-math",d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(f){var v=l.Lib.getPlotDiv(c.node());(v&&v._promises||[]).push(new Promise(function(t){c.style({visibility:"hidden"});var i={fontSize:parseInt(c.style("font-size"),10)};o(f[2],i,function(i,o,a){d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove();var s=i&&i.select("svg");if(!s||!s.node())return r(),void t();var l=d.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});l.node().appendChild(s.node()),o&&o.node()&&s.node().insertBefore(o.node().cloneNode(!0),s.node().firstChild),s.attr({"class":p,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=c.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var f=n(s,"width"),h=n(s,"height"),g=+c.attr("x")-f*{start:0,middle:.5,end:1}[c.attr("text-anchor")||"start"],v=parseInt(c.style("font-size"),10)||n(c,"height"),m=-v/4;"y"===p[0]?(l.attr({transform:"rotate("+[-90,+c.attr("x"),+c.attr("y")]+") translate("+[-f/2,m-h/2]+")"}),s.attr({x:+c.attr("x"),y:+c.attr("y")})):"l"===p[0]?s.attr({x:c.attr("x"),y:m-h/2}):"a"===p[0]?s.attr({x:0,y:m}):s.attr({x:g,y:+c.attr("y")+m-h/2}),e&&e.call(c,l),t(l)})}))}else r();return t}};var d={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},p=["http:","https:","mailto:"],g=new RegExp("</?("+Object.keys(d).join("|")+")( [^>]*)?/?>","g");h.plainText=function(t){return(t||"").replace(g," ")},h.makeEditable=function(t,e,r){function n(){o(),a.style({opacity:0});var t,e=h.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&u.select(a.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function o(){var t=u.select(l.Lib.getPlotDiv(a.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":a.style("font-family")||"Arial","font-size":a.style("font-size")||12,color:r.fill||a.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(a.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||a.attr("data-unformatted")).call(s(a,e,r)).on("blur",function(){a.text(this.textContent).style({opacity:1});var t,e=u.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&u.select(a.node().parentNode).select(t).style({opacity:0});var r=this.textContent;u.select(this).transition().duration(0).remove(),u.select(document).on("mouseup",null),c.edit.call(a,r)}).on("focus",function(){var t=this;u.select(document).on("mouseup",function(){return u.event.target===t?!1:void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===u.event.which?(a.style({opacity:1}),u.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),c.cancel.call(a,this.textContent)):(c.input.call(a,this.textContent),u.select(this).call(s(a,e,r)))}).on("keydown",function(){13===u.event.which&&this.blur()}).call(i)}r||(r={});var a=this,c=u.dispatch("edit","input","cancel"),f=u.select(this.node()).style({"pointer-events":"all"}),h=e||f;return e&&f.style({"pointer-events":"none"}),r.immediate?n():h.on("click",n),u.rebind(this,c,"on")}},{"../constants/xmlns_namespaces":333,"../lib":342,"../plotly":362,d3:100}],356:[function(t,e,r){"use strict";function n(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function i(t,e){t._fullLayout._paperdiv.style("background","white"),R.defaultConfig.setBackground(t,e)}function o(t,e){t._context||(t._context=N.extendFlat({},R.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=i:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function a(t,e,r){var n=S.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=n.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e),r&&(t.layout=r),R.micropolar.manager.fillLayout(t),"initial"===t._fullLayout.autosize&&t._context.autosizable&&(w(t,{}),t._fullLayout.autosize=r.autosize=!0),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=R.micropolar.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var o=t.framework.svg(),a=1,s=t._fullLayout.title;""!==s&&s||(a=0);var l="Click to enter title",u=function(){this.call(R.util.convertToTspans)},c=o.select(".title-group text").call(u);if(t._context.editable){c.attr({"data-unformatted":s}),s&&s!==l||(a=.2,c.attr({"data-unformatted":l}).text(l).style({opacity:a}).on("mouseover.opacity",function(){S.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){S.select(this).transition().duration(1e3).style("opacity",0)}));var f=function(){this.call(R.util.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(u),this.call(f)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};c.call(f)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),O.addLinks(t),Promise.resolve()}function s(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var n=R.Axes.list({_fullLayout:t});for(e=0;e<n.length;e++){var i=n[e];i.anchor&&"free"!==i.anchor&&(i.anchor=R.Axes.cleanId(i.anchor)),i.overlaying&&(i.overlaying=R.Axes.cleanId(i.overlaying)),i.type||(i.isdate?i.type="date":i.islog?i.type="log":i.isdate===!1&&i.islog===!1&&(i.type="linear")),"withzero"!==i.autorange&&"tozero"!==i.autorange||(i.autorange=!0,i.rangemode="tozero"),delete i.islog,delete i.isdate,delete i.categories,f(i,"domain")&&delete i.domain,void 0!==i.autotick&&(void 0===i.tickmode&&(i.tickmode=i.autotick?"auto":"linear"),delete i.autotick)}void 0===t.annotations||Array.isArray(t.annotations)||(N.warn("Annotations must be an array."),delete t.annotations);var o=(t.annotations||[]).length;for(e=0;o>e;e++){var a=t.annotations[e];a.ref&&("paper"===a.ref?(a.xref="paper",a.yref="paper"):"data"===a.ref&&(a.xref="x",a.yref="y"),delete a.ref),l(a,"xref"),l(a,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(N.warn("Shapes must be an array."),delete t.shapes);var s=(t.shapes||[]).length;for(e=0;s>e;e++){var u=t.shapes[e];l(u,"xref"),l(u,"yref")}var c=t.legend;c&&(c.x>3?(c.x=1.02,c.xanchor="left"):c.x<-2&&(c.x=-.02,c.xanchor="right"),c.y>3?(c.y=1.02,c.yanchor="bottom"):c.y<-2&&(c.y=-.02,c.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var h=O.getSubplotIds(t,"gl3d");for(e=0;e<h.length;e++){var d=t[h[e]],p=d.cameraposition;if(Array.isArray(p)&&4===p[0].length){var g=p[0],v=p[1],m=p[2],y=C([],g),b=[];for(r=0;3>r;++r)b[r]=v[e]+m*y[2+4*r];d.camera={eye:{x:b[0],y:b[1],z:b[2]},center:{x:v[0],y:v[1],z:v[2]},up:{x:y[1],y:y[5],z:y[9]}},delete d.cameraposition}}return D.clean(t),t}function l(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=R.Axes.cleanId(r,n))}function u(t,e){for(var r=[],n=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),i=0;i<t.length;i++){var o,a=t[i];if(!("uid"in a)||-1!==r.indexOf(a.uid)){var s;for(o=0;100>o&&(s=N.randstr(n),-1!==r.indexOf(s));o++);a.uid=N.randstr(n),n.push(a.uid)}if(r.push(a.uid),"histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var l=D.defaults,u=a.error_y.color||(O.traceIs(a,"bar")?D.defaultLine:l[i%l.length]);a.error_y.color=D.addOpacity(D.rgb(u),D.opacity(u)*a.error_y.opacity),delete a.error_y.opacity}if("bardir"in a&&("h"!==a.bardir||!O.traceIs(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",x(a)),delete a.bardir),"histogramy"===a.type&&x(a),"histogramx"!==a.type&&"histogramy"!==a.type||(a.type="histogram"),"scl"in a&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=R.Axes.cleanId(a.xaxis,"x")),a.yaxis&&(a.yaxis=R.Axes.cleanId(a.yaxis,"y")),O.traceIs(a,"gl3d")&&a.scene&&(a.scene=O.subplotsRegistry.gl3d.cleanId(a.scene)),O.traceIs(a,"pie")||(Array.isArray(a.textposition)?a.textposition=a.textposition.map(c):a.textposition&&(a.textposition=c(a.textposition))),O.traceIs(a,"2dMap")&&("YIGnBu"===a.colorscale&&(a.colorscale="YlGnBu"),"YIOrRd"===a.colorscale&&(a.colorscale="YlOrRd")),O.traceIs(a,"markerColorscale")&&a.marker){var h=a.marker;"YIGnBu"===h.colorscale&&(h.colorscale="YlGnBu"),"YIOrRd"===h.colorscale&&(h.colorscale="YlOrRd")}if("surface"===a.type&&N.isPlainObject(a.contours)){var d=["x","y","z"];for(o=0;o<d.length;o++){var p=a.contours[d[o]];N.isPlainObject(p)&&(p.highlightColor&&(p.highlightcolor=p.highlightColor,delete p.highlightColor),p.highlightWidth&&(p.highlightwidth=p.highlightWidth,delete p.highlightWidth))}}f(a,"line")&&delete a.line,"marker"in a&&(f(a.marker,"line")&&delete a.marker.line,f(a,"marker")&&delete a.marker),D.clean(a)}}function c(t){var e="middle",r="center";return-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right"),e+" "+r}function f(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function h(t){var e,r=R.Axes.list(t),n=t._fullData,i=t._fullLayout,o=t.calcdata=new Array(n.length);for(t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,i._piecolormap={},i._piedefaultcolorcount=0,e=0;e<r.length;e++)r[e]._categories=r[e]._initialCategories.slice();for(e=0;e<n.length;e++){var a=n[e],s=a._module,l=[];s&&a.visible===!0&&s.calc&&(l=s.calc(t,a)),Array.isArray(l)&&l[0]||(l=[{x:!1,y:!1}]),l[0].t||(l[0].t={}),l[0].trace=a,o[e]=l}}function d(t,e){var r,n,i=e+1,o=[];for(r=0;r<t.length;r++)n=t[r],0>n?o.push(i+n):o.push(n);return o}function p(t,e,r){var n,i;for(n=0;n<e.length;n++){if(i=e[n],i!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||0>i&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function g(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),p(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&p(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function v(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if(i=e[n],"object"!=typeof i||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function m(t,e,r,n){
var i=N.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!N.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");p(t,r,"indices");for(var o in e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(i&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function y(t,e,r,n){var i,o,a,s,l,u=N.isPlainObject(n),c=[];Array.isArray(r)||(r=[r]),r=d(r,t.data.length-1);for(var f in e)for(var h=0;h<r.length;h++){if(i=t.data[r[h]],a=N.nestedProperty(i,f),o=a.get(),s=e[f][h],!Array.isArray(s))throw new Error("attribute: "+f+" index: "+h+" must be an array");if(!Array.isArray(o))throw new Error("cannot extend missing or non-array attribute: "+f);l=u?n[f][h]:n,P(l)||(l=-1),c.push({prop:a,target:o,insert:s,maxp:Math.floor(l)})}return c}function b(t,e,r,n,i,o){m(t,e,r,n);for(var a,s,l,u=y(t,e,r,n),c=[],f={},h={},d=0;d<u.length;d++)s=u[d].prop,l=u[d].maxp,a=i(u[d].target,u[d].insert),l>=0&&l<a.length&&(c=o(a,l)),l=u[d].target.length,s.set(a),Array.isArray(f[s.astr])||(f[s.astr]=[]),Array.isArray(h[s.astr])||(h[s.astr]=[]),f[s.astr].push(c),h[s.astr].push(l);return{update:f,maxPoints:h}}function x(t){var e;if(N.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);N.swapAttrs(t,["error_?.copy_ystyle"]),n&&N.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if(t.hoverinfo){var i=t.hoverinfo.split("+");for(e=0;e<i.length;e++)"x"===i[e]?i[e]="y":"y"===i[e]&&(i[e]="x");t.hoverinfo=i.join("+")}}function _(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}function w(t,e){var r,n,i,o=t._fullLayout,a=t._context;if(t.emit("plotly_autosize"),t._context.fillFrame)i=window.innerWidth,n=window.innerHeight,document.body.style.overflow="hidden";else if(P(a.frameMargins)&&a.frameMargins>0){var s=_(t._boundingBoxMargins),l=s.left+s.right,u=s.bottom+s.top,c=o._container.node().getBoundingClientRect(),f=1-2*a.frameMargins;i=Math.round(f*(c.width-l)),n=Math.round(f*(c.height-u))}else r=window.getComputedStyle(t),n=parseFloat(r.height)||o.height,i=parseFloat(r.width)||o.width;return Math.abs(o.width-i)>1||Math.abs(o.height-n)>1?(o.height=t.layout.height=n,o.width=t.layout.width=i):"initial"!==o.autosize&&(delete e.autosize,o.autosize=t.layout.autosize=!0),O.sanitizeMargins(o),e}function A(t){var e=S.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"),"initial"===r.autosize&&(w(t,{}),r.autosize=!0,t.layout.autosize=!0),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-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=[];S.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=N.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(W.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),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);var o=R.Axes.getSubplots(t);o.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&M(t,o),r._has("cartesian")&&k(t,o),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0);var a=r._paper.selectAll(".layer-subplot");r._imageSubplotLayer=a.selectAll(".imagelayer"),r._shapeSubplotLayer=a.selectAll(".shapelayer");var s=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!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 l=N.syncOrAsync([T,function(){return R.Axes.doTicks(t,"redraw")},j.init],t);return l&&l.then&&t._promises.push(l),l}function M(t,e){function r(e,r){return function(){return R.Axes.getFromId(t,e,r)}}for(var n,i,o=t._fullLayout._plots={},a=0;a<e.length;a++)n=e[a],i=o[n]={},i.id=n,i.x=r(n,"x"),i.y=r(n,"y"),i.xaxis=i.x(),i.yaxis=i.y()}function k(t,e){function r(t){t.append("g").classed("imagelayer",!0),t.append("g").classed("maplayer",!0),t.append("g").classed("barlayer",!0),t.append("g").classed("boxlayer",!0),t.append("g").classed("scatterlayer",!0)}var n=t._fullLayout,i=[];n._paper.selectAll("g.subplot").data(e).enter().append("g").classed("subplot",!0).each(function(o){var a=n._plots[o],s=a.plotgroup=S.select(this).classed(o,!0),l=a.xaxis,u=a.yaxis;a.overlays=[];var c=R.Axes.getFromId(t,l.overlaying)||l;c!==l&&c.overlaying&&(c=l,l.overlaying=!1);var f=R.Axes.getFromId(t,u.overlaying)||u;f!==u&&f.overlaying&&(f=u,u.overlaying=!1);var h=c._id+f._id;if(h!==o&&-1!==e.indexOf(h))a.mainplot=h,i.push(a),l.domain=c.domain.slice(),u.domain=f.domain.slice();else{a.bg=s.append("rect").style("stroke-width",0);var d=s.append("g").classed("layer-subplot",!0);a.shapelayer=d.append("g").classed("shapelayer",!0),a.imagelayer=d.append("g").classed("imagelayer",!0),a.gridlayer=s.append("g"),a.overgrid=s.append("g"),a.zerolinelayer=s.append("g"),a.overzero=s.append("g"),a.plot=s.append("g").call(r),a.overplot=s.append("g"),a.xlines=s.append("path"),a.ylines=s.append("path"),a.overlines=s.append("g"),a.xaxislayer=s.append("g"),a.yaxislayer=s.append("g"),a.overaxes=s.append("g")}a.draglayer=n._draggers.append("g")}),i.forEach(function(t){var e=n._plots[t.mainplot];e.overlays.push(t),t.gridlayer=e.overgrid.append("g"),t.zerolinelayer=e.overzero.append("g"),t.plot=e.overplot.append("g").call(r),t.xlines=e.overlines.append("path"),t.ylines=e.overlines.append("path"),t.xaxislayer=e.overaxes.append("g"),t.yaxislayer=e.overaxes.append("g")}),e.forEach(function(t){var e=n._plots[t];e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)})}function T(t){return N.syncOrAsync([O.doAutoMargin,E],t)}function E(t){var e,r=t._fullLayout,n=r._size,i=R.Axes.list(t);for(e=0;e<i.length;e++)i[e]._linepositions={};r._paperdiv.style({width:r.width+"px",height:r.height+"px"}).selectAll(".main-svg").call(F.setSize,r.width,r.height),t._context.setBackground(t,r.paper_bgcolor);var o=[];return r._paper.selectAll("g.subplot").each(function(e){var i=r._plots[e],a=R.Axes.getFromId(t,e,"x"),s=R.Axes.getFromId(t,e,"y");a.setScale(),s.setScale(),i.bg&&i.bg.call(F.setRect,a._offset-n.p,s._offset-n.p,a._length+2*n.p,s._length+2*n.p).call(D.fill,r.plot_bgcolor),i.clipId="clip"+r._uid+e+"plot";var l=r._defs.selectAll("g.clips").selectAll("#"+i.clipId).data([0]);l.enter().append("clipPath").attr({"class":"plotclip",id:i.clipId}).append("rect"),l.selectAll("rect").attr({width:a._length,height:s._length}),i.plot.call(N.setTranslate,a._offset,s._offset),i.plot.call(F.setClipUrl,i.clipId);var u=F.crispRound(t,a.linewidth,1),c=F.crispRound(t,s.linewidth,1),f=n.p+c,h="M"+-f+",",d="h"+(a._length+2*f),p="free"===a.anchor&&-1===o.indexOf(a._id),g=n.h*(1-(a.position||0))+u/2%1,v=a.anchor===s._id&&(a.mirror||"top"!==a.side)||"all"===a.mirror||"allticks"===a.mirror||a.mirrors&&a.mirrors[s._id+"bottom"],m=s._length+n.p+u/2,y=a.anchor===s._id&&(a.mirror||"top"===a.side)||"all"===a.mirror||"allticks"===a.mirror||a.mirrors&&a.mirrors[s._id+"top"],b=-n.p-u/2,x=n.p,_=v?0:u,w=y?0:u,A=","+(-x-w)+"v"+(s._length+2*x+w+_),M="free"===s.anchor&&-1===o.indexOf(s._id),k=n.w*(s.position||0)+c/2%1,T=s.anchor===a._id&&(s.mirror||"right"!==s.side)||"all"===s.mirror||"allticks"===s.mirror||s.mirrors&&s.mirrors[a._id+"left"],E=-n.p-c/2,L=s.anchor===a._id&&(s.mirror||"right"===s.side)||"all"===s.mirror||"allticks"===s.mirror||s.mirrors&&s.mirrors[a._id+"right"],S=a._length+n.p+c/2;a._linepositions[e]=[v?m:void 0,y?b:void 0,p?g:void 0],a.anchor===s._id?a._linepositions[e][3]="top"===a.side?b:m:p&&(a._linepositions[e][3]=g),s._linepositions[e]=[T?E:void 0,L?S:void 0,M?k:void 0],s.anchor===a._id?s._linepositions[e][3]="right"===s.side?S:E:M&&(s._linepositions[e][3]=k);var C="translate("+a._offset+","+s._offset+")",P=C,z=C;p&&(P="translate("+a._offset+","+n.t+")",b+=s._offset-n.t,m+=s._offset-n.t),M&&(z="translate("+n.l+","+s._offset+")",E+=a._offset-n.l,S+=a._offset-n.l),i.xlines.attr("transform",P).attr("d",(v?h+m+d:"")+(y?h+b+d:"")+(p?h+g+d:"")||"M0,0").style("stroke-width",u+"px").call(D.stroke,a.showline?a.linecolor:"rgba(0,0,0,0)"),i.ylines.attr("transform",z).attr("d",(T?"M"+E+A:"")+(L?"M"+S+A:"")+(M?"M"+k+A:"")||"M0,0").attr("stroke-width",c+"px").call(D.stroke,s.showline?s.linecolor:"rgba(0,0,0,0)"),i.xaxislayer.attr("transform",P),i.yaxislayer.attr("transform",z),i.gridlayer.attr("transform",C),i.zerolinelayer.attr("transform",C),i.draglayer.attr("transform",C),p&&o.push(a._id),M&&o.push(s._id)}),R.Axes.makeClipPaths(t),L(t),Y(t),t._promises.length&&Promise.all(t._promises)}function L(t){var e=t._fullLayout;X.draw(t,"gtitle",{propContainer:e,propName:"title",dfltName:"Plot",attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})}var S=t("d3"),C=t("gl-mat4/fromQuat"),P=t("fast-isnumeric"),R=t("../plotly"),N=t("../lib"),z=t("../lib/events"),I=t("../lib/queue"),O=t("../plots/plots"),j=t("../plots/cartesian/graph_interact"),D=t("../components/color"),F=t("../components/drawing"),B=t("../components/errorbars"),U=t("../components/images"),V=t("../components/legend"),q=t("../components/rangeslider"),H=t("../components/rangeselector"),G=t("../components/shapes"),X=t("../components/titles"),Y=t("../components/modebar/manage"),W=t("../constants/xmlns_namespaces");R.plot=function(t,e,r,i){function l(){var e,r,n,i=t.calcdata;for(V.draw(t),H.draw(t),e=0;e<i.length;e++)r=i[e],n=r[0].trace,n.visible===!0&&n._module.colorbar?n._module.colorbar(t,r):O.autoMargin(t,"cb"+n.uid);return O.doAutoMargin(t),O.previousPromises(t)}function c(){var e=JSON.stringify(k._size)===C?[]:[l,T];return N.syncOrAsync(e.concat(j.init),t)}function f(){if(E){for(var e,r,n=O.getSubplotIds(k,"cartesian"),i=k._modules,o=0;o<n.length;o++){e=k._plots[n[o]];for(var a=0;a<i.length;a++)r=i[a],r.setPositions&&r.setPositions(t,e)}return B.calc(t),N.syncOrAsync([G.calcAutorange,R.Annotations.calcAutorange,d],t)}}function d(){for(var e=R.Axes.list(t,"",!0),r=0;r<e.length;r++)R.Axes.doAutoRange(e[r])}function p(){return R.Axes.doTicks(t,"redraw")}function g(){var e,r=t.calcdata;for(e=0;e<r.length;e++){var n=r[e][0].trace,i=n.visible===!0,o=n.uid;i&&O.traceIs(n,"2dMap")||k._paper.selectAll(".hm"+o+",.contour"+o+",#clip"+o).remove(),i&&n._module.colorbar||k._infolayer.selectAll(".cb"+o).remove()}var a=k._basePlotModules;for(e=0;e<a.length;e++)a[e].plot(t);return O.style(t),G.drawAll(t),R.Annotations.drawAll(t),O.addLinks(t),t._replotting=!1,O.previousPromises(t)}function v(){G.drawAll(t),U.draw(t),R.Annotations.drawAll(t),V.draw(t),q.draw(t),H.draw(t)}function m(){t.emit("plotly_afterplot")}t=n(t),z.init(t);var y=z.triggerHandler(t,"plotly_beforeplot",[e,r,i]);if(y===!1)return Promise.reject();e||r||N.isPlotDiv(t)||N.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),o(t,i),r||(r={}),S.select(t).classed("js-plotly-plot",!0),F.makeTester(t),t._promises=[];var b=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(u(e,t.data),b?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!b||(t.layout=s(r)),t._dragging)return t._replotPending=!0,Promise.reject();if(t._replotPending=!1,O.supplyDefaults(t),e&&e[0]&&e[0].r)return a(t,e,r);t._replotting=!0;var x=t._fullData.length>0,_=R.Axes.getSubplots(t).join(""),w=Object.keys(t._fullLayout._plots||{}).join(""),M=w===_;x?t.framework===A&&!b&&M||(t.framework=A,A(t)):M?b&&A(t):(t.framework=A,A(t)),b&&R.Axes.saveRangeInitial(t);var k=t._fullLayout,E=!t.calcdata||t.calcdata.length!==(t.data||[]).length;E&&h(t);for(var L=0;L<t.calcdata.length;L++)t.calcdata[L][0].trace=t._fullData[L];var C=JSON.stringify(k._size);return N.syncOrAsync([O.previousPromises,l,c,f,T,p,g,v],t,m),Promise.all(t._promises).then(function(){return t},function(){N.log("Clearing previous rejected promises from queue."),t._promises=[]})},R.redraw=function(t){return t=n(t),N.isPlotDiv(t)?(t.calcdata=void 0,R.plot(t).then(function(){return t.emit("plotly_redraw"),t})):void N.warn("This element is not a Plotly plot.",t)},R.newPlot=function(t,e,r,i){return t=n(t),O.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),O.purge(t),R.plot(t,e,r,i)},R.extendTraces=function Z(t,e,r,i){t=n(t);var o=b(t,e,r,i,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),a=R.redraw(t),s=[t,o.update,r,o.maxPoints];return I.add(t,R.prependTraces,s,Z,arguments),a},R.prependTraces=function Q(t,e,r,i){t=n(t);var o=b(t,e,r,i,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),a=R.redraw(t),s=[t,o.update,r,o.maxPoints];return I.add(t,R.extendTraces,s,Q,arguments),a},R.addTraces=function $(t,e,r){t=n(t);var i,o,a=[],s=R.deleteTraces,l=$,c=[t,a],f=[t,e];for(v(t,e,r),Array.isArray(e)||(e=[e]),u(e,t.data),i=0;i<e.length;i+=1)t.data.push(e[i]);for(i=0;i<e.length;i++)a.push(-e.length+i);if("undefined"==typeof r)return o=R.redraw(t),I.add(t,s,c,l,f),o;Array.isArray(r)||(r=[r]);try{g(t,a,r)}catch(h){throw t.data.splice(t.data.length-e.length,e.length),h}return I.startSequence(t),I.add(t,s,c,l,f),o=R.moveTraces(t,a,r),I.stopSequence(t),o},R.deleteTraces=function K(t,e){t=n(t);var r,i,o=[],a=R.addTraces,s=K,l=[t,o,e],u=[t,e];if("undefined"==typeof e)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(e)||(e=[e]),p(t,e,"indices"),e=d(e,t.data.length-1),e.sort(N.sorterDes),r=0;r<e.length;r+=1)i=t.data.splice(e[r],1)[0],o.push(i);var c=R.redraw(t);return I.add(t,a,l,s,u),c},R.moveTraces=function J(t,e,r){t=n(t);var i,o=[],a=[],s=J,l=J,u=[t,r,e],c=[t,e,r];if(g(t,e,r),e=Array.isArray(e)?e:[e],"undefined"==typeof r)for(r=[],i=0;i<e.length;i++)r.push(-e.length+i);for(r=Array.isArray(r)?r:[r],e=d(e,t.data.length-1),r=d(r,t.data.length-1),i=0;i<t.data.length;i++)-1===e.indexOf(i)&&o.push(t.data[i]);for(i=0;i<e.length;i++)a.push({newIndex:r[i],trace:t.data[e[i]]});for(a.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<a.length;i+=1)o.splice(a[i].newIndex,0,a[i].trace);t.data=o;var f=R.redraw(t);return I.add(t,s,u,l,c),f},R.restyle=function tt(t,e,r,i){function o(){return i.map(function(){})}function a(t){var e=R.Axes.id2name(t);-1===p.indexOf(e)&&p.push(e)}function s(t){return"LAYOUT"+t+".autorange"}function l(t){return"LAYOUT"+t+".range"}function u(e,r,n){if(Array.isArray(e))return void e.forEach(function(t){u(t,r,n)});if(!(e in h)){var a;a="LAYOUT"===e.substr(0,6)?N.nestedProperty(t.layout,e.replace("LAYOUT","")):N.nestedProperty(t.data[i[n]],e),e in T||(T[e]=o()),void 0===T[e][n]&&(T[e][n]=a.get()),void 0!==r&&a.set(r)}}t=n(t);var c,f=t._fullLayout,h={};if("string"==typeof e)h[e]=r;else{if(!N.isPlainObject(e))return N.warn("Restyle fail.",e,r,i),Promise.reject();h=e,void 0===i&&(i=r)}Object.keys(h).length&&(t.changed=!0),P(i)?i=[i]:Array.isArray(i)&&i.length||(i=t.data.map(function(t,e){return e}));var d=["mode","visible","type","orientation","fill","histfunc","histnorm","text","x","y","z","a","b","c","xtype","x0","dx","ytype","y0","dy","xaxis","yaxis","line.width","connectgaps","transpose","zsmooth","showscale","marker.showscale","zauto","marker.cauto","autocolorscale","marker.autocolorscale","colorscale","marker.colorscale","reversescale","marker.reversescale","autobinx","nbinsx","xbins","xbins.start","xbins.end","xbins.size","autobiny","nbinsy","ybins","ybins.start","ybins.end","ybins.size","autocontour","ncontours","contours","contours.coloring","error_y","error_y.visible","error_y.value","error_y.type","error_y.traceref","error_y.array","error_y.symmetric","error_y.arrayminus","error_y.valueminus","error_y.tracerefminus","error_x","error_x.visible","error_x.value","error_x.type","error_x.traceref","error_x.array","error_x.symmetric","error_x.arrayminus","error_x.valueminus","error_x.tracerefminus","swapxy","swapxyaxes","orientationaxes","marker.colors","values","labels","label0","dlabel","sort","textinfo","textposition","textfont.size","textfont.family","textfont.color","insidetextfont.size","insidetextfont.family","insidetextfont.color","outsidetextfont.size","outsidetextfont.family","outsidetextfont.color","hole","scalegroup","domain","domain.x","domain.y","domain.x[0]","domain.x[1]","domain.y[0]","domain.y[1]","tilt","tiltaxis","depth","direction","rotation","pull","line.showscale","line.cauto","line.autocolorscale","line.reversescale","marker.line.showscale","marker.line.cauto","marker.line.autocolorscale","marker.line.reversescale"];for(c=0;c<i.length;c++)if(O.traceIs(t._fullData[i[c]],"box")){d.push("name");break}var p,g=["marker","marker.size","textfont","boxpoints","jitter","pointpos","whiskerwidth","boxmean"],v=["zmin","zmax","zauto","marker.cmin","marker.cmax","marker.cauto","line.cmin","line.cmax","marker.line.cmin","marker.line.cmax","contours.start","contours.end","contours.size","contours.showlines","line","line.smoothing","line.shape","error_y.width","error_x.width","error_x.copy_ystyle","marker.maxdisplayed"],m=["type","x","y","x0","y0","orientation","xaxis","yaxis"],y=!1,b=!1,_=!1,w=!1,A=!1,M=!1,k={},T={},E={},L=["cartesian","pie","ternary"];f._basePlotModules.forEach(function(t){-1===L.indexOf(t.name)&&(y=!0)});var S=["zmin","zmax"],C=["xbins.start","xbins.end","xbins.size"],z=["ybins.start","ybins.end","ybins.size"],j=["contours.start","contours.end","contours.size"];for(var D in h){var F,B,U,q,H,G=h[D];if(k[D]=G,"LAYOUT"!==D.substr(0,6)){for("transforms"===D.substr(0,10)&&(y=!0),T[D]=o(),c=0;c<i.length;c++){if(F=t.data[i[c]],B=t._fullData[i[c]],U=N.nestedProperty(F,D),q=U.get(),H=Array.isArray(G)?G[c%G.length]:G,-1!==S.indexOf(D))u("zauto",!1,c);else if("colorscale"===D)u("autocolorscale",!1,c);else if("autocolorscale"===D)u("colorscale",void 0,c);else if("marker.colorscale"===D)u("marker.autocolorscale",!1,c);else if("marker.autocolorscale"===D)u("marker.colorscale",void 0,c);else if("zauto"===D)u(S,void 0,c);else if(-1!==C.indexOf(D))u("autobinx",!1,c);else if("autobinx"===D)u(C,void 0,c);else if(-1!==z.indexOf(D))u("autobiny",!1,c);else if("autobiny"===D)u(z,void 0,c);else if(-1!==j.indexOf(D))u("autocontour",!1,c);else if("autocontour"===D)u(j,void 0,c);else if(-1!==["x0","dx"].indexOf(D)&&B.x&&"scaled"!==B.xtype)u("xtype","scaled",c);else if(-1!==["y0","dy"].indexOf(D)&&B.y&&"scaled"!==B.ytype)u("ytype","scaled",c);else if("colorbar.thicknessmode"===D&&U.get()!==H&&-1!==["fraction","pixels"].indexOf(H)&&B.colorbar){var X=-1!==["top","bottom"].indexOf(B.colorbar.orient)?f.height-f.margin.t-f.margin.b:f.width-f.margin.l-f.margin.r;u("colorbar.thickness",B.colorbar.thickness*("fraction"===H?1/X:X),c)}else if("colorbar.lenmode"===D&&U.get()!==H&&-1!==["fraction","pixels"].indexOf(H)&&B.colorbar){var Y=-1!==["top","bottom"].indexOf(B.colorbar.orient)?f.width-f.margin.l-f.margin.r:f.height-f.margin.t-f.margin.b;u("colorbar.len",B.colorbar.len*("fraction"===H?1/Y:Y),c)}else"colorbar.tick0"===D||"colorbar.dtick"===D?u("colorbar.tickmode","linear",c):"colorbar.tickmode"===D&&u(["colorbar.tick0","colorbar.dtick"],void 0,c);if("type"===D&&"pie"===H!=("pie"===q)){var W="x",Z="y";"bar"!==H&&"bar"!==q||"h"!==F.orientation||(W="y",Z="x"),N.swapAttrs(F,["?","?src"],"labels",W),N.swapAttrs(F,["d?","?0"],"label",W),N.swapAttrs(F,["?","?src"],"values",Z),"pie"===q?(N.nestedProperty(F,"marker.color").set(N.nestedProperty(F,"marker.colors").get()),f._pielayer.selectAll("g.trace").remove()):O.traceIs(F,"cartesian")&&(N.nestedProperty(F,"marker.colors").set(N.nestedProperty(F,"marker.color").get()),E[F.xaxis||"x"]=!0,E[F.yaxis||"y"]=!0)}T[D][c]=q;var Q=["swapxy","swapxyaxes","orientation","orientationaxes"];if(-1!==Q.indexOf(D)){if("orientation"===D){if(U.set(H),U.get()===T[D][c])continue}else"orientationaxes"===D&&(F.orientation={v:"h",h:"v"}[B.orientation]);x(F)}else U.set(H)}if(-1!==["swapxyaxes","orientationaxes"].indexOf(D)&&R.Axes.swap(t,i),"orientationaxes"===D){var $=N.nestedProperty(t.layout,"hovermode");"x"===$.get()?$.set("y"):"y"===$.get()&&$.set("x")}if(-1!==i.indexOf(0)&&-1!==m.indexOf(D)&&(R.Axes.clearTypes(t,i),y=!0),-1!==["autobinx","autobiny","zauto"].indexOf(D)&&H===!1||(A=!0),(-1!==["colorbar","line"].indexOf(U.parts[0])||"marker"===U.parts[0]&&"colorbar"===U.parts[1])&&(M=!0),-1!==d.indexOf(D)){if(-1!==["orientation","type"].indexOf(D)){for(p=[],c=0;c<i.length;c++){var K=t.data[i[c]];O.traceIs(K,"cartesian")&&(a(K.xaxis||"x"),a(K.yaxis||"y"),"type"===e&&u(["autobinx","autobiny"],!0,c))}u(p.map(s),!0,0),u(p.map(l),[0,1],0)}y=!0}else-1!==v.indexOf(D)?_=!0:-1!==g.indexOf(D)&&(b=!0)}else U=N.nestedProperty(t.layout,D.replace("LAYOUT","")),T[D]=[U.get()],U.set(Array.isArray(G)?G[0]:G),y=!0}var J=Object.keys(E);t:for(c=0;c<J.length;c++){for(var et=J[c],rt=et.charAt(0),nt=rt+"axis",it=0;it<t.data.length;it++)if(O.traceIs(t.data[it],"cartesian")&&(t.data[it][nt]||rt)===et)continue t;u("LAYOUT"+R.Axes.id2name(et),null,0)}I.add(t,tt,[t,T,i],tt,[t,k,i]);var ot=!1;R.Axes.list(t).forEach(function(t){t.autorange&&(ot=!0)}),(y||w||b&&ot)&&(t.calcdata=void 0);var at;w?at=[function(){var e=t.layout;return t.layout=void 0,R.plot(t,"",e)}]:y||_||b?at=[R.plot]:(O.supplyDefaults(t),at=[O.previousPromises],A&&at.push(function(){var e,r,n;for(e=0;e<t.calcdata.length;e++)r=t.calcdata[e],n=(((r[0]||{}).trace||{})._module||{}).arraysToCalcdata,n&&n(r);return O.style(t),V.draw(t),O.previousPromises(t)}),M&&at.push(function(){return t.calcdata.forEach(function(t){if((t[0].t||{}).cb){var e=t[0].trace,r=t[0].t.cb;O.traceIs(e,"contour")&&r.line({width:e.contours.showlines!==!1?e.line.width:0,dash:e.line.dash,color:"line"===e.contours.coloring?r._opts.line.color:e.line.color}),O.traceIs(e,"markerColorscale")?r.options(e.marker.colorbar)():r.options(e.colorbar)()}}),O.previousPromises(t)}));var st=N.syncOrAsync(at,t);return st&&st.then||(st=Promise.resolve()),st.then(function(){return t.emit("plotly_restyle",N.extendDeep([],[k,i])),t})},R.relayout=function et(t,e,r){function i(t,e){if(Array.isArray(t))return void t.forEach(function(t){i(t,e)});if(!(t in v)){var r=N.nestedProperty(p,t);t in E||(E[t]=r.get()),void 0!==e&&r.set(e)}}function o(t,e){var r=R.Axes.id2name(t[e+"ref"]||e);return(g[r]||{}).autorange}function a(t){var e=t["xaxis.range"]?t["xaxis.range"][0]:t["xaxis.range[0]"],r=t["xaxis.range"]?t["xaxis.range"][1]:t["xaxis.range[1]"],n=g.xaxis&&g.xaxis.rangeslider?g.xaxis.rangeslider:{};n.visible&&(e||r?g.xaxis.rangeslider.setRange(e,r):t["xaxis.autorange"]&&g.xaxis.rangeslider.setRange())}if(t=n(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var s,l,u,c,f,h,d,p=t.layout,g=t._fullLayout,v={},m=!1,y=!1,b=!1,x=!1,_=!1,A=!1;if("string"==typeof e)v[e]=r;else{if(!N.isPlainObject(e))return N.warn("Relayout fail.",e,r),Promise.reject();v=e}for(Object.keys(v).length&&(t.changed=!0),u=Object.keys(v),l=R.Axes.list(t),d=0;d<u.length;d++){if(0===u[d].indexOf("allaxes")){for(var M=0;M<l.length;M++)f=l[M]._id.substr(1),h=-1!==f.indexOf("scene")?f+".":"",s=u[d].replace("allaxes",h+l[M]._name),v[s]||(v[s]=v[u[d]]);delete v[u[d]]}u[d].match(/^annotations\[[0-9-]+\].ref$/)&&(c=v[u[d]].split("y"),v[u[d].replace("ref","xref")]=c[0],v[u[d].replace("ref","yref")]=2===c.length?"y"+c[1]:"paper",delete v[u[d]])}var k={},E={},S=["height","width"];for(var C in v){var P=N.nestedProperty(p,C),z=v[C],j=P.parts.length,D="string"==typeof P.parts[j-1]?j-1:j-2,F=P.parts[D],B=P.parts[D-1]+"."+F,q=P.parts.slice(0,D).join("."),H=N.nestedProperty(t.layout,q).get(),G=N.nestedProperty(g,q).get();if(k[C]=z,E[C]="reverse"===F?z:P.get(),-1!==S.indexOf(C)?i("autosize",!1):"autosize"===C?i(S,void 0):B.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/)?i(q+".autorange",!1):B.match(/^[xyz]axis[0-9]*\.autorange$/)?i([q+".range[0]",q+".range[1]"],void 0):B.match(/^aspectratio\.[xyz]$/)?i(P.parts[0]+".aspectmode","manual"):B.match(/^aspectmode$/)?i([q+".x",q+".y",q+".z"],void 0):"tick0"===F||"dtick"===F?i(q+".tickmode","linear"):"tickmode"===F?i([q+".tick0",q+".dtick"],void 0):/[xy]axis[0-9]*?$/.test(F)&&!Object.keys(z||{}).length?_=!0:/[xy]axis[0-9]*\.categoryorder$/.test(B)?_=!0:/[xy]axis[0-9]*\.categoryarray/.test(B)&&(_=!0),-1!==B.indexOf("rangeslider")&&(_=!0),"type"===F&&"log"===G.type!=("log"===z)){var X=H;if(X&&X.range)if(G.autorange)"log"===z&&(X.range=X.range[1]>X.range[0]?[1,2]:[2,1]);else{var W=X.range[0],Z=X.range[1];"log"===z?(0>=W&&0>=Z&&i(q+".autorange",!0),0>=W?W=Z/1e6:0>=Z&&(Z=W/1e6),i(q+".range[0]",Math.log(W)/Math.LN10),i(q+".range[1]",Math.log(Z)/Math.LN10)):(i(q+".range[0]",Math.pow(10,W)),i(q+".range[1]",Math.pow(10,Z)))}else i(q+".autorange",!0)}if("reverse"===F)H.range?H.range.reverse():(i(q+".autorange",!0),H.range=[1,0]),G.autorange?_=!0:x=!0;else if("annotations"===P.parts[0]||"shapes"===P.parts[0]){var Q=P.parts[1],$=P.parts[0],K=p[$]||[],J=R[N.titleCase($)],tt=K[Q]||{};2===P.parts.length&&("add"===v[C]||N.isPlainObject(v[C])?E[C]="remove":"remove"===v[C]?-1===Q?(E[$]=K,delete E[C]):E[C]=tt:N.log("???",v)),!o(tt,"x")&&!o(tt,"y")||N.containsAny(C,["color","opacity","align","dash"])||(_=!0),J.draw(t,Q,P.parts.slice(2).join("."),v[C]),delete v[C]}else if("images"===P.parts[0]){var rt=N.objectFromPath(C,z);N.extendDeepAll(t.layout,rt),U.supplyLayoutDefaults(t.layout,t._fullLayout),U.draw(t)}else if("mapbox"===P.parts[0]&&"layers"===P.parts[1]){N.extendDeepAll(t.layout,N.objectFromPath(C,z));var nt=(t._fullLayout.mapbox||{}).layers||[],it=P.parts[2]+1-nt.length;for(d=0;it>d;d++)nt.push({});x=!0}else 0===P.parts[0].indexOf("scene")?x=!0:0===P.parts[0].indexOf("geo")?x=!0:0===P.parts[0].indexOf("ternary")?x=!0:!g._has("gl2d")||-1===C.indexOf("axis")&&"plot_bgcolor"!==P.parts[0]?"hiddenlabels"===C?_=!0:-1!==P.parts[0].indexOf("legend")?m=!0:-1!==C.indexOf("title")?y=!0:-1!==P.parts[0].indexOf("bgcolor")?b=!0:P.parts.length>1&&N.containsAny(P.parts[1],["tick","exponent","grid","zeroline"])?y=!0:-1!==C.indexOf(".linewidth")&&-1!==C.indexOf("axis")?y=b=!0:P.parts.length>1&&-1!==P.parts[1].indexOf("line")?b=!0:P.parts.length>1&&"mirror"===P.parts[1]?y=b=!0:"margin.pad"===C?y=b=!0:"margin"===P.parts[0]||"autorange"===P.parts[1]||"rangemode"===P.parts[1]||"type"===P.parts[1]||"domain"===P.parts[1]||C.match(/^(bar|box|font)/)?_=!0:-1!==["hovermode","dragmode"].indexOf(C)?A=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(C)&&(x=!0):x=!0,P.set(z)}I.add(t,et,[t,E],et,[t,k]),v.autosize&&(v=w(t,v)),(v.height||v.width||v.autosize)&&(_=!0);var ot=Object.keys(v),at=[O.previousPromises];if(x||_)at.push(function(){return t.layout=void 0,_&&(t.calcdata=void 0),R.plot(t,"",p)});else if(ot.length&&(O.supplyDefaults(t),g=t._fullLayout,m&&at.push(function(){return V.draw(t),O.previousPromises(t)}),b&&at.push(T),y&&at.push(function(){return R.Axes.doTicks(t,"redraw"),L(t),O.previousPromises(t)}),A)){var st;for(Y(t),R.Fx.supplyLayoutDefaults(t.layout,g,t._fullData),R.Fx.init(t),st=O.getSubplotIds(g,"gl3d"),d=0;d<st.length;d++)f=g[st[d]]._scene,f.updateFx(g.dragmode,g.hovermode);for(st=O.getSubplotIds(g,"gl2d"),d=0;d<st.length;d++)f=g._plots[st[d]]._scene2d,f.updateFx(g);for(st=O.getSubplotIds(g,"geo"),d=0;d<st.length;d++){var lt=g[st[d]]._geo;lt.updateFx(g.hovermode)}}var ut=N.syncOrAsync(at,t);return ut&&ut.then||(ut=Promise.resolve(t)),ut.then(function(){var e=N.extendDeep({},k);return a(e),t.emit("plotly_relayout",e),t})},R.purge=function(t){t=n(t);var e=t._fullLayout||{},r=t._fullData||[];return O.cleanPlot([],{},r,e),O.purge(t),z.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/color":267,"../components/drawing":290,"../components/errorbars":296,"../components/images":302,"../components/legend":310,"../components/modebar/manage":314,"../components/rangeselector":321,"../components/rangeslider":326,"../components/shapes":329,"../components/titles":330,"../constants/xmlns_namespaces":333,"../lib":342,"../lib/events":338,"../lib/queue":349,"../plotly":362,"../plots/cartesian/graph_interact":372,"../plots/plots":398,d3:100,"fast-isnumeric":104,"gl-mat4/fromQuat":117}],357:[function(t,e,r){"use strict";function n(t,e){try{t._fullLayout._paper.style("background",e)}catch(r){i.error(r)}}var i=t("../lib");e.exports={staticPlot:!1,editable:!1,queueLength:0,autosizable:!1,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1}},{"../lib":342}],358:[function(t,e,r){"use strict";function n(t){var e=m.attributes,r=u({type:t}),n=f(t),i=d(t),o={},a={};o.type=null,x(o,e),o=s(r.attributes,o,"attributes",t),void 0!==i.attributes&&x(o,i.attributes),o.type=t,o=c(o),l(o),L.traces[t]=b({},n,{attributes:o}),void 0!==r.layoutAttributes&&(a=s(r.layoutAttributes,a,"layoutAttributes",t),l(a),L.traces[t].layoutAttributes=a)}function i(){var t=m.layoutAttributes,e={};e=s(t,e,"layoutAttributes","*"),e=h(e),e=p(e),e=c(e),l(e),g(e),L.layout={layoutAttributes:e}}function o(t){var e=m.transformsRegistry[t],r={};r=s(r,e.attributes||{},"attributes","*"),r=c(r),l(r),g(r),L.transforms[t]={attributes:r}}function a(){L.defs={valObjects:y.valObjects,metaKeys:E.concat(["description","role"])}}function s(t,e,r,n){var i,o,a,l,c;return Object.keys(t).forEach(function(f){return f===w?void Object.keys(t[f]).forEach(function(l){i=u({module:t[f][l]}),void 0!==i&&(o=i[r],a=s(o,{},r,n),y.nestedProperty(e,l).set(x({},a)))}):f===A?void Object.keys(t[f]).forEach(function(i){i===n&&(l=u({module:t[f][i]}),void 0!==l&&(c=l[r],c=s(c,{},r,n),_(e,c)))}):void(e[f]=y.isPlainObject(t[f])?_({},t[f]):t[f])}),e}function l(t){function e(t){return{valType:"string"}}function r(t,r,n){P.isValObject(t)?"data_array"===t.valType?(t.role="data",n[r+"src"]=e(r)):t.arrayOk===!0&&(n[r+"src"]=e(r)):y.isPlainObject(t)&&(t.role="object")}P.crawl(t,r)}function u(t){if("type"in t)return"area"===t.type?{attributes:S}:m.getModule({type:t.type});var e=m.subplotsRegistry,r=t.module;return e[r]?e[r]:"module"in t?v[r]:void 0}function c(t){return Object.keys(t).forEach(function(e){"_"===e.charAt(0)&&-1===E.indexOf(e)&&delete t[e]}),t}function f(t){return"area"===t?{}:m.modules[t].meta||{}}function h(t){return b(t,{radialaxis:C.radialaxis,angularaxis:C.angularaxis}),b(t,C.layout),t}function d(t){if("area"===t)return{};var e=m.subplotsRegistry,r=Object.keys(e).filter(function(e){
return m.traceIs({type:t},e)})[0];return void 0===r?{}:e[r]}function p(t){var e=m.subplotsRegistry;return Object.keys(t).forEach(function(r){Object.keys(e).forEach(function(n){var i,o=e[n];o.attrRegex&&(i="cartesian"===n||"gl2d"===n?o.attrRegex.x.test(r)||o.attrRegex.y.test(r):o.attrRegex.test(r),i&&(t[r][M]=!0))})}),t}function g(t){function e(t,e,r){if(t[k]===!0){var n=e.substr(0,e.length-1);delete t[k],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"}}P.crawl(t,e)}var v=t("../plotly"),m=t("../plots/plots"),y=t("../lib"),b=y.extendFlat,x=y.extendDeep,_=y.extendDeepAll,w="_nestedModules",A="_composedModules",M="_isSubplotObj",k="_isLinkedToArray",T="_deprecated",E=[M,k,T],L={traces:{},layout:{},transforms:{},defs:{}},S=t("../plots/polar/area_attributes"),C=t("../plots/polar/axis_attributes"),P=e.exports={};P.get=function(){return m.allTypes.concat("area").forEach(n),i(),Object.keys(m.transformsRegistry).forEach(o),a(),L},P.crawl=function(t,e){Object.keys(t).forEach(function(r){var n=t[r];-1===E.indexOf(r)&&(e(n,r,t),P.isValObject(n)||y.isPlainObject(n)&&P.crawl(n,e))})},P.isValObject=function(t){return t&&void 0!==t.valType}},{"../lib":342,"../plotly":362,"../plots/plots":398,"../plots/polar/area_attributes":399,"../plots/polar/axis_attributes":400}],359:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("../lib");e.exports=function(t){return i.extendFlat(n.defaultConfig,t)}},{"../lib":342,"../plotly":362}],360:[function(t,e,r){"use strict";function n(e,r){var n=t("../snapshot"),s=new Promise(function(t,s){function l(){var t=n.getDelay(f._fullLayout);return new Promise(function(e,i){setTimeout(function(){var t=n.toSVG(f),o=document.createElement("canvas");o.id=a.randstr(),n.svgToImg({format:r.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:o,svg:t,promise:!0}).then(function(t){f&&document.body.removeChild(f),e(t)}).catch(function(t){i(t)})},t)})}r=r||{},r.format=r.format||"png";var u=function(t){return void 0===t||null===t?!0:!!(i(t)&&t>1)};u(r.width)&&u(r.height)||s(new Error("Height and width should be pixel values."));var c=n.clone(e,{format:"png",height:r.height,width:r.width}),f=c.td;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var h=n.getRedrawFunc(f);o.plot(f,c.data,c.layout,c.config).then(h).then(l).then(function(e){t(e)}).catch(function(t){s(t)})});return s}var i=t("fast-isnumeric"),o=t("../plotly"),a=t("../lib");e.exports=n},{"../lib":342,"../plotly":362,"../snapshot":408,"fast-isnumeric":104}],361:[function(t,e,r){"use strict";function n(t,e,r,i,o,u){u=u||[];for(var c=Object.keys(t),h=0;h<c.length;h++){var d=c[h];if("transforms"!==d){var v=u.slice();v.push(d);var m=t[d],y=e[d],b=l(r,d);if(s(r,d))if(p(m)&&p(y))n(m,y,b,i,o,v);else if(b.items&&g(m))for(var x=d.substr(0,d.length-1),_=0;_<m.length;_++){var w=b.items[x],A=v.slice();A.push(_),n(m[_],y[_],w,i,o,A)}else!p(m)&&p(y)?i.push(a("object",o,v,m)):!g(m)&&g(y)&&"info_array"!==b.valType?i.push(a("array",o,v,m)):d in e?f.validate(m,b)||i.push(a("value",o,v,m)):i.push(a("unused",o,v,m));else i.push(a("schema",o,v))}}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&&f.extendFlat(t.layout.layoutAttributes,i)}return t.layout.layoutAttributes}function o(t){return g(t)?"In data trace "+t[1]+", ":"In "+t+", "}function a(t,e,r,n){r=r||"";var i,o;g(e)?(i=e[0],o=e[1]):(i=e,o=null);var a=c(r),s=v[t](e,a,n);return f.log(s),{code:t,container:i,trace:o,path:r,astr:a,msg:s}}function s(t,e){var r=u(e),n=r.keyMinusId,i=r.id;return n in t&&t[n]._isSubplotObj&&i?!0:e in t}function l(t,e){var r=u(e);return t[r.keyMinusId]}function u(t){var e=/([2-9]|[1-9][0-9]+)$/,r=t.split(e)[0],n=t.substr(r.length,t.length);return{keyMinusId:r,id:n}}function c(t){if(!g(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 f=t("../lib"),h=t("../plots/plots"),d=t("./plot_schema"),p=f.isPlainObject,g=Array.isArray;e.exports=function(t,e){var r,o,s=d.get(),l=[],u={};g(t)?(u.data=f.extendDeep([],t),r=t):(u.data=[],r=[],l.push(a("array","data"))),p(e)?(u.layout=f.extendDeep({},e),o=e):(u.layout={},o={},arguments.length>1&&l.push(a("object","layout"))),h.supplyDefaults(u);for(var c=u._fullData,v=r.length,m=0;v>m;m++){var y=r[m],b=["data",m];if(p(y)){var x=c[m],_=x.type,w=s.traces[_].attributes;w.type={valType:"enumerated",values:[_]},x.visible===!1&&y.visible!==!1&&l.push(a("invisible",b)),n(y,x,w,l,b);var A=y.transforms,M=x.transforms;if(A){g(A)||l.push(a("array",b,["transforms"])),b.push("transforms");for(var k=0;k<A.length;k++){var T=["transforms",k],E=A[k].type;if(p(A[k])){var L=s.transforms[E]?s.transforms[E].attributes:{};L.type={valType:"enumerated",values:Object.keys(s.transforms)},n(A[k],M[k],L,l,b,T)}else l.push(a("object",b,T))}}}else l.push(a("object",b))}var S=u._fullLayout,C=i(s,c);return n(o,S,C,l,"layout"),0===l.length?void 0:l};var v={object:function(t,e){var r;return r="layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":o(t)+"key "+e,r+" must be linked to an object container"},array:function(t,e){var r;return r="data"===t?"The data argument":o(t)+"key "+e,r+" must be linked to an array container"},schema:function(t,e){return o(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=p(r)?"container":"key";return o(t)+n+" "+e+" did not get coerced"},invisible:function(t){return"Trace "+t[1]+" got defaulted to be not visible"},value:function(t,e,r){return[o(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}}},{"../lib":342,"../plots/plots":398,"./plot_schema":358}],362:[function(t,e,r){"use strict";t("es6-promise").polyfill();var n=r.Lib=t("./lib");r.util=t("./lib/svg_text_utils"),r.Queue=t("./lib/queue"),t("../build/plotcss"),r.MathJaxConfig=t("./fonts/mathjax_config"),r.defaultConfig=t("./plot_api/plot_config");var i=r.Plots=t("./plots/plots");r.Axes=t("./plots/cartesian/axes"),r.Fx=t("./plots/cartesian/graph_interact"),r.micropolar=t("./plots/polar/micropolar"),r.Color=t("./components/color"),r.Drawing=t("./components/drawing"),r.Colorscale=t("./components/colorscale"),r.Colorbar=t("./components/colorbar"),r.ErrorBars=t("./components/errorbars"),r.Annotations=t("./components/annotations"),r.Shapes=t("./components/shapes"),r.Legend=t("./components/legend"),r.Images=t("./components/images"),r.ModeBar=t("./components/modebar"),r.register=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var r=t[e];if(!r)throw new Error("Invalid module was attempted to be registered!");switch(r.moduleType){case"trace":i.register(r,r.name,r.categories,r.meta),i.subplotsRegistry[r.basePlotModule.name]||i.registerSubplot(r.basePlotModule);break;case"transform":if("string"!=typeof r.name)throw new Error("Transform module *name* must be a string.");var o="Transform module "+r.name;if("function"!=typeof r.transform)throw new Error(o+" is missing a *transform* function.");n.isPlainObject(r.attributes)||n.log(o+" registered without an *attributes* object."),"function"!=typeof r.supplyDefaults&&n.log(o+" registered without a *supplyDefaults* function."),i.transformsRegistry[r.name]=r;break;default:throw new Error("Invalid module was attempted to be registered!")}}},r.register(t("./traces/scatter")),t("./plot_api/plot_api"),r.PlotSchema=t("./plot_api/plot_schema"),r.Snapshot=t("./snapshot")},{"../build/plotcss":1,"./components/annotations":265,"./components/color":267,"./components/colorbar":272,"./components/colorscale":281,"./components/drawing":290,"./components/errorbars":296,"./components/images":302,"./components/legend":310,"./components/modebar":313,"./components/shapes":329,"./fonts/mathjax_config":335,"./lib":342,"./lib/queue":349,"./lib/svg_text_utils":355,"./plot_api/plot_api":356,"./plot_api/plot_config":357,"./plot_api/plot_schema":358,"./plots/cartesian/axes":365,"./plots/cartesian/graph_interact":372,"./plots/plots":398,"./plots/polar/micropolar":401,"./snapshot":408,"./traces/scatter":429,"es6-promise":103}],363:[function(t,e,r){"use strict";e.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none"],dflt:"all"},stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0}}}},{}],364:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x"},yaxis:{valType:"subplotid",dflt:"y"}}},{}],365:[function(t,e,r){"use strict";function n(t){var e,r,n=t.tickvals,i=t.ticktext,o=new Array(n.length),a=1.0001*t.range[0]-1e-4*t.range[1],l=1.0001*t.range[1]-1e-4*t.range[0],u=Math.min(a,l),c=Math.max(a,l),f=0;for(Array.isArray(i)||(i=[]),r=0;r<n.length;r++)e=t.d2l(n[r]),e>u&&c>e&&(void 0===i[r]?o[f]=T.tickText(t,e):o[f]=s(t,e,String(i[r])),f++);return f<n.length&&o.splice(f,n.length-f),o}function i(t,e,r){return e*_.roundUp(t/e,r)}function o(t){var e,r=t.dtick;if(t._tickexponent=0,b(r)||"string"==typeof r||(r=1),"category"===t.type)t._tickround=null;else if(b(r)||"L"===r.charAt(0))if("date"===t.type)r>=864e5?t._tickround="d":r>=36e5?t._tickround="H":r>=6e4?t._tickround="M":r>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(r/2)/Math.LN10);else{b(r)||(r=Number(r.substr(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var n=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(n)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((n-1)/3):t._tickexponent=n)}else"M"===r.charAt(0)?t._tickround=2===r.length?"m":"y":t._tickround=null}function a(t,e){var r=t.match(U),n=new Date(e);if(r){var i=Math.min(+r[1]||6,6),o=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,"")||"0";return y.time.format(t.replace(U,o))(n)}return y.time.format(t)(n)}function s(t,e,r){var n=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t,e,r,n){var i,o=e.x,s=t._tickround,l=new Date(o),u="";r&&t.hoverformat?i=a(t.hoverformat,o):t.tickformat?i=a(t.tickformat,o):(n&&(b(s)?s+=2:s={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[s]),"y"===s?i=I(l):"m"===s?i=O(l):(o!==t._tmin||r||(u="<br>"+I(l)),"d"===s?i=j(l):"H"===s?i=D(l):(o!==t._tmin||r||(u="<br>"+j(l)+", "+I(l)),i=F(l),"M"!==s&&(i+=B(l),"S"!==s&&(i+=h(m(o/1e3,1),t,"none",r).substr(1)))))),e.text=i+u}function u(t,e,r,n,i){var o=t.dtick,a=e.x;if(!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=h(Math.pow(10,a),t,i,n);else if(b(o)||"D"===o.charAt(0)&&m(a+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var s=Math.round(a);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10<sup>"+s+"</sup>":e.text="10<sup>\u2212"+-s+"</sup>",e.fontSize*=1.25}else e.text=h(Math.pow(10,a),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,m(a,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(0>a?.5:.25)))}}function c(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function f(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=h(e.x,t,i,n)}function h(t,e,r,n){var i=0>t,a=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,u=e.tickformat;if(n){var c={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:b(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};o(c),a=(Number(c._tickround)||0)+4,l=c._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return y.format(u)(t).replace(/-/g,"\u2212");var f=Math.pow(10,-a)/2;if("none"===s&&(l=0),t=Math.abs(t),f>t)t="0",i=!1;else{if(t+=f,l&&(t*=Math.pow(10,-l),a+=l),0===a)t=String(Math.floor(t));else if(0>a){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var h=a;0>h;h++)t+="0"}else{t=String(t);var d=t.indexOf(".")+1;d&&(t=t.substr(0,d+a).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._gd._fullLayout.separators)}if(l&&"hide"!==s){var p;p=0>l?"\u2212"+-l:"power"!==s?"+"+l:String(l),"e"===s||("SI"===s||"B"===s)&&(l>12||-15>l)?t+="e"+p:"E"===s?t+="E"+p:"power"===s?t+="×10<sup>"+p+"</sup>":"B"===s&&9===l?t+="B":"SI"!==s&&"B"!==s||(t+=V[l/3+5])}return i?"\u2212"+t:t}function d(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var o=[],a=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(a&&s){for(n=0;n<i.length;n++)-1===i[n].x.indexOf(a)&&-1===i[n].y.indexOf(s)||o.push(n);if(o.length){var l,u=i[o[0]];if(o.length>1)for(n=1;n<o.length;n++)l=i[o[n]],p(u.x,l.x),p(u.y,l.y);p(u.x,[a]),p(u.y,[s])}else i.push({x:[a],y:[s]})}}return i}function p(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function g(t,e,r){var n,i,o=[],a=[],s=t.layout;for(n=0;n<e.length;n++)o.push(T.getFromId(t,e[n]));for(n=0;n<r.length;n++)a.push(T.getFromId(t,r[n]));var l=Object.keys(o[0]),u=["anchor","domain","overlaying","position","side","tickangle"],c=["linear","log"];for(n=0;n<l.length;n++){var f=l[n],h=o[0][f],d=a[0][f],p=!0,g=!1,m=!1;if("_"!==f.charAt(0)&&"function"!=typeof h&&-1===u.indexOf(f)){for(i=1;i<o.length&&p;i++){var y=o[i][f];"type"===f&&-1!==c.indexOf(h)&&-1!==c.indexOf(y)&&h!==y?g=!0:y!==h&&(p=!1)}for(i=1;i<a.length&&p;i++){var b=a[i][f];"type"===f&&-1!==c.indexOf(d)&&-1!==c.indexOf(b)&&d!==b?m=!0:a[i][f]!==d&&(p=!1)}p&&(g&&(s[o[0]._name].type="linear"),m&&(s[a[0]._name].type="linear"),v(s,f,o,a))}}for(n=0;n<t._fullLayout.annotations.length;n++){var x=t._fullLayout.annotations[n];-1!==e.indexOf(x.xref)&&-1!==r.indexOf(x.yref)&&_.swapAttrs(s.annotations[n],["?"])}}function v(t,e,r,n){var i,o=_.nestedProperty,a=o(t[r[0]._name],e).get(),s=o(t[n[0]._name],e).get();for("title"===e&&("Click to enter X axis title"===a&&(a="Click to enter Y axis title"),"Click to enter Y axis title"===s&&(s="Click to enter X axis title")),i=0;i<r.length;i++)o(t,r[i]._name+"."+e).set(s);for(i=0;i<n.length;i++)o(t,n[i]._name+"."+e).set(a)}function m(t,e){return(t%e+e)%e}var y=t("d3"),b=t("fast-isnumeric"),x=t("../../plotly"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),A=t("../../components/titles"),M=t("../../components/color"),k=t("../../components/drawing"),T=e.exports={};T.layoutAttributes=t("./layout_attributes"),T.supplyLayoutDefaults=t("./layout_defaults"),T.setConvert=t("./set_convert");var E=t("./axis_ids");T.id2name=E.id2name,T.cleanId=E.cleanId,T.list=E.list,T.listIds=E.listIds,T.getFromId=E.getFromId,T.getFromTrace=E.getFromTrace,T.coerceRef=function(t,e,r,n,i){var o=r._fullLayout._has("gl2d")?[]:T.listIds(r,n),a=n+"ref",s={};return s[a]={valType:"enumerated",values:o.concat(["paper"]),dflt:i||o[0]||"paper"},_.coerce(t,e,s,a)},T.coerceARef=function(t,e,r,n,i){var o=r._fullLayout._has("gl2d")?[]:T.listIds(r,n),a="a"+n+"ref",s={};return s[a]={valType:"enumerated",values:o.concat(["pixel"]),dflt:i||"pixel"||o[0]},_.coerce(t,e,s,a)},T.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(T.getFromId(t,r.xaxis)||{}).type,delete(T.getFromId(t,r.yaxis)||{}).type})},T.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},T.minDtick=function(t,e,r,n){-1===["log","category"].indexOf(t.type)&&n?null===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},T.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e<t._min.length&&n===i;e++)n=Math.min(n,t._min[e].val);for(e=1;e<t._max.length&&n===i;e++)i=Math.max(i,t._max[e].val);var o,a,s,l,u,c,f,h=0,d=t.range&&t.range[1]<t.range[0];for("reversed"===t.autorange&&(d=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(a=t._min[e],o=0;o<t._max.length;o++)s=t._max[o],f=s.val-a.val,c=t._length-a.pad-s.pad,f>0&&c>0&&f/c>h&&(l=a,u=s,h=f/c);return n===i?r=d?[n+1,"normal"!==t.rangemode?0:n-1]:["normal"!==t.rangemode?0:n-1,n+1]:h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode&&l.val>=0?l={val:0,pad:0}:"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),h=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-h*l.pad,u.val+h*u.pad],r[0]===r[1]&&(r=[r[0]-1,r[0]+1]),d&&r.reverse()),r},T.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=T.getAutoRange(t);var r=t._gd.layout[t._name];r||(t._gd.layout[t._name]=r={}),r!==t&&(r.range=t.range.slice(),r.autorange=t.autorange)}},T.saveRangeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,i=0;i<r.length;i++){var o=r[i],a=void 0===o._rangeInitial,s=a||!(o.range[0]===o._rangeInitial[0]&&o.range[1]===o._rangeInitial[1]);(a&&o.autorange===!1||e&&s)&&(o._rangeInitial=o.range.slice(),n=!0)}return n};var L=Number.MAX_VALUE/2;T.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function i(r){function n(t){return b(t)&&Math.abs(t)<L}if(l=e[r],b(l)){if(f=x(r)+m,h=_(r)+m,p=l-A(r),g=l+w(r),"log"===t.type&&g/10>p&&(p=g/10),u=t.c2l(p),c=t.c2l(g),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(d=!0,a=0;a<t._min.length&&d;a++)s=t._min[a],s.val<=u&&s.pad>=h?d=!1:s.val>=u&&s.pad<=h&&(t._min.splice(a,1),a--);d&&t._min.push({val:u,pad:y&&0===u?0:h})}if(n(c)){for(d=!0,a=0;a<t._max.length&&d;a++)s=t._max[a],s.val>=c&&s.pad>=f?d=!1:s.val<=c&&s.pad<=f&&(t._max.splice(a,1),a--);d&&t._max.push({val:c,pad:y&&0===c?0:f})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var o,a,s,l,u,c,f,h,d,p,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),_=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),w=n(r.vpadplus||r.vpad),A=n(r.vpadminus||r.vpad);for(o=0;6>o;o++)i(o);for(o=v-1;o>5;o--)i(o)}},T.autoBin=function(t,e,r,n){function i(t){return(1+100*(t-d)/f.dtick)%100<2}var o=_.aggNums(Math.min,null,t),a=_.aggNums(Math.max,null,t);if("category"===e.type)return{start:o-.5,end:a+.5,size:1};var s;if(r)s=(a-o)/r;else{var l=_.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),c=u*_.roundUp(l.minDiff/u,[.9,1.9,4.9,9.9],!0);s=Math.max(c,2*_.stdev(t)/Math.pow(t.length,n?.25:.4))}var f={type:"log"===e.type?"linear":e.type,range:[o,a]};T.autoTicks(f,s);var h,d=T.tickIncrement(T.tickFirst(f),f.dtick,"reverse");if("number"==typeof f.dtick){for(var p=0,g=0,v=0,m=0,y=0;y<t.length;y++)t[y]%1===0?v++:b(t[y])||m++,i(t[y])&&p++,i(t[y]+f.dtick/2)&&g++;var x=t.length-m;if(v===x&&"date"!==e.type)f.dtick<1?d=o-.5*f.dtick:d-=.5;else if(.1*x>g&&(p>.3*x||i(o)||i(a))){var w=f.dtick/2;d+=o>d+w?w:-w}var A=1+Math.floor((a-d)/f.dtick);h=d+A*f.dtick}else for(h=d;a>=h;)h=T.tickIncrement(h,f.dtick);return{start:d,end:h,size:f.dtick}},T.calcTicks=function(t){if("array"===t.tickmode)return n(t);if("auto"===t.tickmode||!t.dtick){var e,r=t.nticks;r||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/e):(e="y"===t._id.charAt(0)?40:80,r=_.constrain(t._length/e,4,9)+1)),T.autoTicks(t,Math.abs(t.range[1]-t.range[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),o(t),t._tmin=T.tickFirst(t);var i=t.range[1]<t.range[0],a=[],s=1.0001*t.range[1]-1e-4*t.range[0];"category"===t.type&&(s=i?Math.max(-.5,s):Math.min(t._categories.length-.5,s));for(var l=t._tmin;(i?l>=s:s>=l)&&(a.push(l),!(a.length>1e3));l=T.tickIncrement(l,t.dtick,i));t._tmax=a[a.length-1];for(var u=new Array(a.length),c=0;c<a.length;c++)u[c]=T.tickText(t,a[c]);return u};var S=[2,5,10],C=[1,2,3,6,12],P=[1,2,5,10,15,30],R=[1,2,3,7,14],N=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],z=[-.301,0,.301,.699,1];T.autoTicks=function(t,e){var r;if("date"===t.type)t.tick0=new Date(2e3,0,1).getTime(),e>157788e5?(e/=315576e5,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,r,S)):e>12096e5?(e/=26298e5,t.dtick="M"+i(e,1,C)):e>432e5?(t.dtick=i(e,864e5,R),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=i(e,36e5,C):e>3e4?t.dtick=i(e,6e4,P):e>500?t.dtick=i(e,1e3,P):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,S));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var n=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/n,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,r,S)}else t.dtick=e>.3?"D2":"D1";else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,S));if(0===t.dtick&&(t.dtick=1),!b(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},T.tickIncrement=function(t,e,r){var n=r?-1:1;if(b(e))return t+n*e;var i=e.charAt(0),o=n*Number(e.substr(1));if("M"===i){var a=new Date(t);return a.setMonth(a.getMonth()+o)}if("L"===i)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===i){var s="D2"===e?z:N,l=t+.01*n,u=_.roundUp(m(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.range[1]<t.range[0],r=e?Math.floor:Math.ceil,n=1.0001*t.range[0]-1e-4*t.range[1],i=t.dtick,o=t.tick0;if(b(i)){var a=r((n-o)/i)*i+o;return"category"===t.type&&(a=_.constrain(a,0,t._categories.length-1)),a}var s,l,u,c=i.charAt(0),f=Number(i.substr(1));if("M"===c){for(s=new Date(o),n=new Date(n),l=12*(n.getFullYear()-s.getFullYear())+n.getMonth()-s.getMonth(),u=s.setMonth(s.getMonth()+(Math.round(l/f)+(e?1:-1))*f);e?u>n:n>u;)u=T.tickIncrement(u,i,e);return u}if("L"===c)return Math.log(r((Math.pow(10,n)-o)/f)*f+o)/Math.LN10;if("D"===c){var h="D2"===i?z:N,d=_.roundUp(m(n,1),h,e);return Math.floor(n)+Math.log(y.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(i)};var I=y.time.format("%Y"),O=y.time.format("%b %Y"),j=y.time.format("%b %-d"),D=y.time.format("%b %-d %Hh"),F=y.time.format("%H:%M"),B=y.time.format(":%S"),U=/%(\d?)f/g;T.tickText=function(t,e,r){function n(n){var i;return void 0===n?!0:r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i)}var i,o,a=s(t,e),h="array"===t.tickmode,d=r||h;if(h&&Array.isArray(t.ticktext)){var p=Math.abs(t.range[1]-t.range[0])/1e4;for(o=0;o<t.ticktext.length&&!(Math.abs(e-t.d2l(t.tickvals[o]))<p);o++);if(o<t.ticktext.length)return a.text=String(t.ticktext[o]),a}return i="none"!==t.exponentformat&&n(t.showexponent)?"hide":"","date"===t.type?l(t,a,r,d):"log"===t.type?u(t,a,r,d,i):"category"===t.type?c(t,a):f(t,a,r,d,i),t.tickprefix&&!n(t.showtickprefix)&&(a.text=t.tickprefix+a.text),t.ticksuffix&&!n(t.showticksuffix)&&(a.text+=t.ticksuffix),a};var V=["f","p","n","μ","m","","k","M","G","T"];T.subplotMatch=/^x([0-9]*)y([0-9]*)$/,T.getSubplots=function(t,e){function r(t,e){return-1!==t.indexOf(e._id)}var n,i,o,a=[],s=t.data||[];for(n=0;n<s.length;n++){var l=s[n];if(l.visible!==!1&&"legendonly"!==l.visible&&(x.Plots.traceIs(l,"cartesian")||x.Plots.traceIs(l,"gl2d"))){var u=l.xaxis||"x",c=l.yaxis||"y";o=u+c,-1===a.indexOf(o)&&a.push(o)}}var f=T.list(t,"",!0);for(n=0;n<f.length;n++){var h=f[n],d=h._id.charAt(0),p="free"===h.anchor?"x"===d?"y":"x":h.anchor,g=T.getFromId(t,p),v=!1;for(i=0;i<a.length;i++)if(r(a[i],h)){v=!0;break}"free"===h.anchor&&v||g&&(o="x"===d?h._id+g._id:g._id+h._id,-1===a.indexOf(o)&&a.push(o))}var m=T.subplotMatch,y=[];for(n=0;n<a.length;n++)o=a[n],m.test(o)&&y.push(o);return y.sort(function(t,e){var r=t.match(m),n=e.match(m);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?T.findSubplotsWithAxis(y,e):y},T.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],i=0;i<t.length;i++){var o=t[i];r.test(o)&&n.push(o)}return n},T.makeClipPaths=function(t){var e,r,n=t._fullLayout,i=n._defs,o={_offset:0,_length:n.width,_id:""},a={_offset:0,_length:n.height,_id:""},s=T.list(t,"x",!0),l=T.list(t,"y",!0),u=[];for(e=0;e<s.length;e++)for(u.push({x:s[e],y:a}),r=0;r<l.length;r++)0===e&&u.push({x:o,y:l[r]}),u.push({x:s[e],y:l[r]});var c=i.selectAll("g.clips").data([0]);c.enter().append("g").classed("clips",!0);var f=c.selectAll(".axesclip").data(u,function(t){return t.x._id+t.y._id});f.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+n._uid+t.x._id+t.y._id}).append("rect"),f.exit().remove(),f.each(function(t){y.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},T.doTicks=function(t,e,r){function n(t){var e=u.l2p(t.x);return e>1&&e<u._length-1}function i(t,e){var r=t.selectAll("path."+C).data("inside"===u.ticks?V:L,S);e&&u.ticks?(r.enter().append("path").classed(C,1).classed("ticks",1).classed("crisp",1).call(M.stroke,u.tickcolor).style("stroke-width",D+"px").attr("d",e),r.attr("transform",d),r.exit().remove()):r.remove()}function o(r,n){function i(t,e){t.each(function(t){var r=p(e),n=y.select(this),i=n.select(".text-math-group"),o=d(t)+(b(e)&&0!==+e?" rotate("+e+","+f(t)+","+(h(t)-t.fontSize/2)+")":"");if(i.empty()){var a=n.select("text").attr({transform:o,"text-anchor":r});a.empty()||a.selectAll("tspan.line").attr({x:a.attr("x"),y:a.attr("y")})}else{var s=k.bBox(i.node()).width*{end:-.5,start:.5}[r];i.attr("transform",o+(s?"translate("+s+",0)":""))}})}function o(){return T.length&&Promise.all(T)}function s(){if(i(c,u.tickangle),"x"===v&&!b(u.tickangle)&&("log"!==u.type||"D"!==String(u.dtick).charAt(0))){var t=[];for(c.each(function(e){var r=y.select(this),n=r.select(".text-math-group"),i=u.l2p(e.x);n.empty()&&(n=r.select("text"));var o=k.bBox(n.node());t.push({top:0,bottom:10,height:10,left:i-o.width/2,right:i+o.width/2+2,width:o.width+2})}),g=0;g<t.length-1;g++)if(_.bBoxIntersect(t[g],t[g+1])){M=30;break}if(M){var r=Math.abs((L[L.length-1].x-L[0].x)*u._m)/(L.length-1);2.5*A>r&&(M=90),i(c,M)}u._lastangle=M}return a(e),e+" done"}function l(){u._boundingBox=r.node().getBoundingClientRect()}var c=r.selectAll("g."+C).data(L,S);if(!u.showticklabels||!b(n))return c.remove(),void a(e);var f,h,p,m,x;"x"===v?(x="bottom"===B?1:-1,f=function(t){return t.dx+I*x},m=n+(z+N)*x,h=function(t){return t.dy+m+t.fontSize*("bottom"===B?1:-.5)},p=function(t){return b(t)&&0!==t&&180!==t?0>t*x?"end":"start":"middle"}):(x="right"===B?1:-1,h=function(t){return t.dy+t.fontSize/2-I*x},f=function(t){return t.dx+n+(z+N+(90===Math.abs(u.tickangle)?t.fontSize/2:0))*x},p=function(t){return b(t)&&90===Math.abs(t)?"middle":"right"===B?"start":"end"});var A=0,M=0,T=[];c.enter().append("g").classed(C,1).append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(k.setPosition,f(e),h(e)).call(k.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?T.push(t._promises.pop().then(function(){i(r,u.tickangle)})):i(r,u.tickangle)}),c.exit().remove(),c.each(function(t){A=Math.max(A,t.fontSize)}),i(c,u._lastangle||u.tickangle);var E=_.syncOrAsync([o,s,l]);return E&&E.then&&t._promises.push(E),E}function a(e){if(!r){var n,i,o,a,s=E.getFromId(t,e),l=y.select(t).selectAll("g."+e+"tick"),u={selection:l,side:s.side},f=e.charAt(0),h=t._fullLayout._size,d=1.5,p=s.titlefont.size;if(l.size()){var g=y.select(l.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/);g&&(u.offsetLeft=+g[1],u.offsetTop=+g[2])}"x"===f?(i="free"===s.anchor?{_offset:h.t+(1-(s.position||0))*h.h,_length:0}:E.getFromId(t,s.anchor),o=s._offset+s._length/2,a=i._offset+("top"===s.side?-10-p*(d+(s.showticklabels?1:0)):i._length+10+p*(d+(s.showticklabels?1.5:.5))),s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(a+=(c.height-c.margin.b-c.margin.t)*s.rangeslider.thickness+s._boundingBox.height),u.side||(u.side="bottom")):(i="free"===s.anchor?{_offset:h.l+(s.position||0)*h.w,_length:0}:E.getFromId(t,s.anchor),a=s._offset+s._length/2,o=i._offset+("right"===s.side?i._length+10+p*(d+(s.showticklabels?1:.5)):-10-p*(d+(s.showticklabels?.5:0))),n={rotate:"-90",offset:0},u.side||(u.side="left")),A.draw(t,e+"title",{propContainer:s,propName:s._name+".title",dfltName:f.toUpperCase()+" axis",avoid:u,transform:n,attributes:{x:o,y:a,"text-anchor":"middle"}})}}function s(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:x.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[v]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===v}function l(e,r,i){var o=e.gridlayer,a=e.zerolinelayer,l=e["hidegrid"+v]?[]:V,c=u._gridpath||"M0,0"+("x"===v?"v":"h")+r._length,f=o.selectAll("path."+P).data(u.showgrid===!1?[]:l,S);if(f.enter().append("path").classed(P,1).classed("crisp",1).attr("d",c).each(function(t){u.zeroline&&("linear"===u.type||"-"===u.type)&&Math.abs(t.x)<u.dtick/100&&y.select(this).remove()}),f.attr("transform",d).call(M.stroke,u.gridcolor||"#ddd").style("stroke-width",O+"px"),f.exit().remove(),a){for(var h=!1,p=0;p<t._fullData.length;p++)if(s(t._fullData[p],i)){h=!0;break}var g=u.range[0]*u.range[1]<=0&&u.zeroline&&("linear"===u.type||"-"===u.type)&&l.length&&(h||n({x:0})||!u.showline),m=a.selectAll("path."+R).data(g?[{x:0}]:[]);m.enter().append("path").classed(R,1).classed("zl",1).classed("crisp",1).attr("d",c),m.attr("transform",d).call(M.stroke,u.zerolinecolor||M.defaultLine).style("stroke-width",j+"px"),m.exit().remove()}}var u,c=t._fullLayout,f=!1;if("object"==typeof e)u=e,e=u._id,f=!0;else if(u=T.getFromId(t,e),"redraw"===e&&c._paper.selectAll("g.subplot").each(function(t){var e=c._plots[t],r=e.x(),n=e.y();e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+n._id+"tick").remove(),e.gridlayer.selectAll("path").remove(),e.zerolinelayer.selectAll("path").remove()}),!e||"redraw"===e)return _.syncOrAsync(T.list(t,"",!0).map(function(r){return function(){if(r._id){var n=T.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice()),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.range=[+u.range[0],+u.range[1]],u.setScale();var h,d,p,g,v=e.charAt(0),m=T.counterLetter(e),L=T.calcTicks(u),S=function(t){return t.text+t.x+u.mirror},C=e+"tick",P=e+"grid",R=e+"zl",N=(u.linewidth||1)/2,z=("outside"===u.ticks?u.ticklen:1)+(u.linewidth||0),I=0,O=k.crispRound(t,u.gridwidth,1),j=k.crispRound(t,u.zerolinewidth,O),D=k.crispRound(t,u.tickwidth,1);if(u._counterangle&&"outside"===u.ticks){var F=u._counterangle*Math.PI/180;z=u.ticklen*Math.cos(F)+(u.linewidth||0),I=u.ticklen*Math.sin(F)}if("x"===v)h=["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 _.warn("Unrecognized doTicks axis:",e);h=["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 B=u.side||h[0],U=[-1,1,B===h[1]?1:-1];"inside"!==u.ticks==("x"===v)&&(U=U.map(function(t){return-t}));var V=L.filter(n);if(f){if(i(u._axislayer,p(u._pos+N*U[2],U[2]*u.ticklen)),
u._counteraxis){var q={gridlayer:u._gridlayer,zerolinelayer:u._zerolinelayer};l(q,u._counteraxis)}return o(u._axislayer,u._pos)}var H=T.getSubplots(t,u).map(function(t){var e=c._plots[t];if(c._has("cartesian")){var r=e[v+"axislayer"],n=u._linepositions[t]||[],a=e[m](),s=a._id===u.anchor,f=[!1,!1,!1],d="";if("allticks"===u.mirror?f=[!0,!0,!1]:s&&("ticks"===u.mirror?f=[!0,!0,!1]:f[h.indexOf(B)]=!0),u.mirrors)for(g=0;2>g;g++){var y=u.mirrors[a._id+h[g]];"ticks"!==y&&"labels"!==y||(f[g]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],i=U[e];t&&b(r)&&(d+=p(r+N*i,i*u.ticklen))}),i(r,d),l(e,a,t),o(r,n[3])}}).filter(function(t){return t&&t.then});return H.length?Promise.all(H):0},T.swap=function(t,e){for(var r=d(t,e),n=0;n<r.length;n++)g(t,r[n].x,r[n].y)}},{"../../components/color":267,"../../components/drawing":290,"../../components/titles":330,"../../lib":342,"../../lib/svg_text_utils":355,"../../plotly":362,"./axis_ids":367,"./layout_attributes":374,"./layout_defaults":375,"./set_convert":379,d3:100,"fast-isnumeric":104}],366:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0);-1!==r.indexOf("scene")&&(r=n);var l=s(e,r,n);if(l){if("histogram"===l.type&&n==={v:"y",h:"x"}[l.orientation||"v"])return void(t.type="linear");if(o(l,n)){for(var u,c=i(l),f=[],h=0;h<e.length;h++)u=e[h],p.traceIs(u,"box")&&(u[n+"axis"]||n)===r&&(void 0!==u[c]?f.push(u[c][0]):void 0!==u.name?f.push(u.name):f.push("text"));t.type=a(f)}else t.type=a(l[n]||[l[n+"0"]])}}}function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t);return p.traceIs(t,"box")&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}function a(t){return u(t)?"date":c(t)?"category":l(t)?"linear":"-"}function s(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}function l(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(f(t[e]))return!0;return!1}function u(t){for(var e,r=0,n=0,i=Math.max(1,(t.length-1)/1e3),o=0;o<t.length;o+=i)e=t[Math.round(o)],d.isDateTime(e)&&(r+=1),f(e)&&(n+=1);return r>2*n}function c(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,o=0;o<t.length;o+=r)e=A(t[Math.round(o)]),f(e)?n++:"string"==typeof e&&""!==e&&"None"!==e&&i++;return i>2*n}var f=t("fast-isnumeric"),h=t("tinycolor2").mix,d=t("../../lib"),p=t("../plots"),g=t("../../components/color/attributes").lightFraction,v=t("./layout_attributes"),m=t("./tick_value_defaults"),y=t("./tick_mark_defaults"),b=t("./tick_label_defaults"),x=t("./category_order_defaults"),_=t("./set_convert"),w=t("./ordered_categories"),A=t("./clean_datum"),M=t("./axis_ids");e.exports=function(t,e,r,i){function o(r,n){return d.coerce2(t,e,v,r,n)}var a=i.letter,s=i.font||{},l="Click to enter "+(i.title||a.toUpperCase()+" axis")+" title";i.name&&(e._name=i.name,e._id=M.name2id(i.name));var u=r("type");"-"===u&&(n(e,i.data),"-"===e.type?e.type="linear":u=t.type=e.type),_(e);var c=r("color"),p=c===t.color?c:s.color;r("title",l),d.coerceFont(r,"titlefont",{family:s.family,size:Math.round(1.2*s.size),color:p});var A=2===(t.range||[]).length&&f(t.range[0])&&f(t.range[1]),k=r("autorange",!A);k&&r("rangemode");var T=r("range",[-1,"x"===a?6:4]);T[0]===T[1]&&(e.range=[T[0]-1,T[0]+1]),d.noneOrAll(t.range,e.range,[0,1]),r("fixedrange"),m(t,e,r,u),b(t,e,r,u,i),y(t,e,r,i),x(t,e,r);var E=o("linecolor",c),L=o("linewidth"),S=r("showline",!!E||!!L);S||(delete e.linecolor,delete e.linewidth),(S||e.ticks)&&r("mirror");var C=o("gridcolor",h(c,i.bgColor,g).toRgbString()),P=o("gridwidth"),R=r("showgrid",i.showGrid||!!C||!!P);R||(delete e.gridcolor,delete e.gridwidth);var N=o("zerolinecolor",c),z=o("zerolinewidth"),I=r("zeroline",i.showGrid||!!N||!!z);return I||(delete e.zerolinecolor,delete e.zerolinewidth),e._initialCategories="category"===u?w(a,e.categoryorder,e.categoryarray,i.data):[],e}},{"../../components/color/attributes":266,"../../lib":342,"../plots":398,"./axis_ids":367,"./category_order_defaults":368,"./clean_datum":369,"./layout_attributes":374,"./ordered_categories":376,"./set_convert":379,"./tick_label_defaults":380,"./tick_mark_defaults":381,"./tick_value_defaults":382,"fast-isnumeric":104,tinycolor2:239}],367:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,o=[],a=0;a<n.length;a++){var s=n[a];e&&s.charAt(0)!==e||i.test(s)&&o.push(r+s)}return o.sort()}var o=t._fullLayout;if(!o)return[];var a=n(o,"");if(r)return a;for(var s=i.getSubplotIds(o,"gl3d")||[],l=0;l<s.length;l++){var u=s[l];a=a.concat(n(o[u],u+"."))}return a}var i=t("../plots"),o=t("../../lib"),a=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(a.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(a.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(a.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,r){return n(t,e,r).map(function(e){return o.nestedProperty(t._fullLayout,e).get()})},r.listIds=function(t,e){return n(t,e,!0).map(r.name2id)},r.getFromId=function(t,e,n){var i=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),i[r.id2name(e)]},r.getFromTrace=function(t,e,n){var o=t._fullLayout,a=null;if(i.traceIs(e,"gl3d")){var s=e.scene;"scene"===s.substr(0,5)&&(a=o[s][n+"axis"])}else a=r.getFromId(t,e[n+"axis"]||n);return a}},{"../../lib":342,"../plots":398,"./constants":370}],368:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(n="array");var a=r("categoryorder",n);"array"===a&&r("categoryarray"),o||"array"!==a||(e.categoryorder="trace")}}},{}],369:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return i.ms2DateTime(t);if("string"!=typeof t&&!n(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){i.error(e,t)}return t}},{"../../lib":342,"fast-isnumeric":104}],370:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},BADNUM:void 0,xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50}},{}],371:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?c.ms2DateTime(n,i):"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,s.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,s.format("."+String(r)+"g")(n))}function i(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function o(t){s.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function a(t){var e=["lasso","select"];return-1!==e.indexOf(t)}var s=t("d3"),l=t("tinycolor2"),u=t("../../plotly"),c=t("../../lib"),f=t("../../lib/svg_text_utils"),h=t("../../components/color"),d=t("../../components/drawing"),p=t("../../lib/setcursor"),g=t("../../components/dragelement"),v=t("./axes"),m=t("./select"),y=t("./constants"),b=!0;e.exports=function(t,e,r,s,x,_,w,A){function M(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function k(t){t[0]=Number(t[0]),t[1]=Number(t[1])}function T(e,r,n){var i=rt.getBoundingClientRect();it=r-i.left,ot=n-i.top,at={l:it,r:it,w:0,t:ot,b:ot,h:0},st=t._hmpixcount?t._hmlumcount/t._hmpixcount:l(t._fullLayout.plot_bgcolor).getLuminance(),lt="M0,0H"+V+"V"+q+"H0V0",ut=!1,ct="xy",ft=dt.append("path").attr("class","zoombox").style({fill:st>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+pt+", "+gt+")").attr("d",lt+"Z"),ht=dt.append("path").attr("class","zoombox-corners").style({fill:h.background,stroke:h.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+pt+", "+gt+")").attr("d","M0,0Z"),E();for(var o=0;o<Q.length;o++)k(Q[o].range)}function E(){dt.selectAll(".select-outline").remove()}function L(t,e){var r=Math.max(0,Math.min(V,t+it)),n=Math.max(0,Math.min(q,e+ot)),i=Math.abs(r-it),o=Math.abs(n-ot),a=Math.floor(Math.min(o,i,G)/2);at.l=Math.min(it,r),at.r=Math.max(it,r),at.t=Math.min(ot,n),at.b=Math.max(ot,n),!K||o<Math.min(Math.max(.6*i,H),G)?H>i?(ct="",at.r=at.l,at.t=at.b,ht.attr("d","M0,0Z")):(at.t=0,at.b=q,ct="x",ht.attr("d","M"+(at.l-.5)+","+(ot-G-.5)+"h-3v"+(2*G+1)+"h3ZM"+(at.r+.5)+","+(ot-G-.5)+"h3v"+(2*G+1)+"h-3Z")):!$||i<Math.min(.6*o,G)?(at.l=0,at.r=V,ct="y",ht.attr("d","M"+(it-G-.5)+","+(at.t-.5)+"v-3h"+(2*G+1)+"v3ZM"+(it-G-.5)+","+(at.b+.5)+"v3h"+(2*G+1)+"v-3Z")):(ct="xy",ht.attr("d","M"+(at.l-3.5)+","+(at.t-.5+a)+"h3v"+-a+"h"+a+"v-3h-"+(a+3)+"ZM"+(at.r+3.5)+","+(at.t-.5+a)+"h-3v"+-a+"h"+-a+"v-3h"+(a+3)+"ZM"+(at.r+3.5)+","+(at.b+.5-a)+"h-3v"+a+"h"+-a+"v3h"+(a+3)+"ZM"+(at.l-3.5)+","+(at.b+.5-a)+"h3v"+a+"h"+a+"v3h-"+(a+3)+"Z")),at.w=at.r-at.l,at.h=at.b-at.t,ft.attr("d",lt+"M"+at.l+","+at.t+"v"+at.h+"h"+at.w+"v-"+at.h+"h-"+at.w+"Z"),ut||(ft.transition().style("fill",st>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ht.transition().style("opacity",1).duration(200),ut=!0)}function S(t,e,r){var n,i,o;for(n=0;n<t.length;n++)i=t[n],i.fixedrange||(o=i.range,i.range=[o[0]+(o[1]-o[0])*e,o[0]+(o[1]-o[0])*r])}function C(e,r){return Math.min(at.h,at.w)<2*H?(2===r&&I(),o(t)):("xy"!==ct&&"x"!==ct||S(B,at.l/V,at.r/V),"xy"!==ct&&"y"!==ct||S(U,(q-at.b)/q,(q-at.t)/q),o(t),O(ct),void(b&&t.data&&t._context.showTips&&(c.notifier("Double-click to<br>zoom back out","long"),b=!1)))}function P(e,r){var i=1===(w+A).length;if(e)O();else if(2!==r||i){if(1===r&&i){var o=w?U[0]:B[0],a="s"===w||"w"===A?0:1,s=o._name+".range["+a+"]",l=n(o,a),c="left",h="middle";if(o.fixedrange)return;w?(h="n"===w?"top":"bottom","right"===o.side&&(c="right")):"e"===A&&(c="right"),et.call(f.makeEditable,null,{immediate:!0,background:D.paper_bgcolor,text:String(l),fill:o.tickfont?o.tickfont.color:"#444",horizontalAlign:c,verticalAlign:h}).on("edit",function(e){var r="category"===o.type?o.c2l(e):o.d2l(e);void 0!==r&&u.relayout(t,s,r)})}}else I()}function R(e){function r(t,e,r){if(!t.fixedrange){k(t.range);var n=t.range,i=n[0]+(n[1]-n[0])*e;t.range=[i+(n[0]-i)*r,i+(n[1]-i)*r]}}if(t._context.scrollZoom||D._enablescrollzoom){var n=t.querySelector(".plotly");if(!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(mt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void c.log("Did not find wheel motion attributes: ",e);var o,a=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=bt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=vt[0]+vt[2]*l,f=(s.bottom-e.clientY)/s.height,h=vt[1]+vt[3]*(1-f);if(A){for(o=0;o<B.length;o++)r(B[o],l,a);vt[2]*=a,vt[0]=u-vt[2]*l}if(w){for(o=0;o<U.length;o++)r(U[o],f,a);vt[3]*=a,vt[1]=h-vt[3]*(1-f)}return j(vt),z(w,A),mt=setTimeout(function(){vt=[0,0,V,q],O()},yt),c.pauseEvent(e)}}}function N(t,e){function r(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n._r[0]-e/n._m,n._r[1]-e/n._m])}}function n(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function i(t,e,r){for(var i=1-e,o=0,a=0;a<t.length;a++){var s=t[a];s.fixedrange||(o=a,s.range[e]=s._r[i]+(s._r[e]-s._r[i])/n(r/s._length))}return t[o]._length*(t[o]._r[e]-t[o].range[e])/(t[o]._r[e]-t[o]._r[i])}return"ew"===$||"ns"===K?($&&r(B,t),K&&r(U,e),j([$?-t:0,K?-e:0,V,q]),void z(K,$)):("w"===$?t=i(B,0,t):"e"===$?t=i(B,1,-t):$||(t=0),"n"===K?e=i(U,1,e):"s"===K?e=i(U,0,-e):K||(e=0),j(["w"===$?t:0,"n"===K?e:0,V-t,q-e]),void z(K,$))}function z(e,r){function n(t){for(o=0;o<t.length;o++)t[o].fixedrange||a.push(t[o]._id)}function i(n,i){var s;for(o=0;o<n.length;o++)s=n[o],(r&&-1!==a.indexOf(s.xref)||e&&-1!==a.indexOf(s.yref))&&i.draw(t,o)}var o,a=[];for(r&&n(B),e&&n(U),o=0;o<a.length;o++)v.doTicks(t,a[o],!0);i(D.annotations||[],u.Annotations),i(D.shapes||[],u.Shapes),i(D.images||[],u.Images)}function I(){var e,r,n,i=t._context.doubleClick,o=($?B:[]).concat(K?U:[]),a={};if("autosize"===i)for(r=0;r<o.length;r++)e=o[r],e.fixedrange||(a[e._name+".autorange"]=!0);else if("reset"===i)for(r=0;r<o.length;r++)e=o[r],e._rangeInitial?(n=e._rangeInitial.slice(),a[e._name+".range[0]"]=n[0],a[e._name+".range[1]"]=n[1]):a[e._name+".autorange"]=!0;else if("reset+autosize"===i)for(r=0;r<o.length;r++)e=o[r],e.fixedrange||(void 0===e._rangeInitial||e.range[0]===e._rangeInitial[0]&&e.range[1]===e._rangeInitial[1]?a[e._name+".autorange"]=!0:(n=e._rangeInitial.slice(),a[e._name+".range[0]"]=n[0],a[e._name+".range[1]"]=n[1]));t.emit("plotly_doubleclick",null),u.relayout(t,a)}function O(e){for(var r={},n=0;n<Q.length;n++){var i=Q[n];e&&-1===e.indexOf(i._id.charAt(0))||(i._r[0]!==i.range[0]&&(r[i._name+".range[0]"]=i.range[0]),i._r[1]!==i.range[1]&&(r[i._name+".range[1]"]=i.range[1]),i.range=i._r.slice())}j([0,0,V,q]),u.relayout(t,r)}function j(t){for(var e=D._plots,r=Object.keys(e),n=0;n<r.length;n++){var i=e[r[n]],o=i.x(),a=i.y(),s=A&&-1!==B.indexOf(o)&&!o.fixedrange,l=w&&-1!==U.indexOf(a)&&!a.fixedrange,u=s?o._length/t[2]:1,f=l?a._length/t[3]:1,h=s?t[0]:0,d=l?t[1]:0,p=s?t[0]/t[2]*o._length:0,g=l?t[1]/t[3]*a._length:0,v=o._offset-p,m=a._offset-g;D._defs.selectAll("#"+i.clipId).call(c.setTranslate,h,d).call(c.setScale,1/u,1/f),i.plot.call(c.setTranslate,v,m).call(c.setScale,u,f).selectAll(".points").selectAll(".point").call(c.setPointGroupScale,1/u,1/f)}}for(var D=t._fullLayout,F=[e].concat(w&&A?e.overlays:[]),B=[e.x()],U=[e.y()],V=B[0]._length,q=U[0]._length,H=y.MINDRAG,G=y.MINZOOM,X=w+A==="nsew",Y=1;Y<F.length;Y++){var W=F[Y].x(),Z=F[Y].y();-1===B.indexOf(W)&&B.push(W),-1===U.indexOf(Z)&&U.push(Z)}var Q=B.concat(U),$=M(B,A),K=M(U,w),J=i(K+$,D.dragmode),tt=w+A+"drag",et=e.draglayer.selectAll("."+tt).data([0]);et.enter().append("rect").classed("drag",!0).classed(tt,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",e.id),et.call(d.setRect,r,s,x,_).call(p,J);var rt=et.node();if(!K&&!$&&!a(D.dragmode))return rt.onmousedown=null,rt.style.pointerEvents=X?"all":"none",rt;var nt={element:rt,gd:t,plotinfo:e,xaxes:B,yaxes:U,doubleclick:I,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;X?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan","lasso"===i?nt.minDrag=1:nt.minDrag=void 0,"zoom"===i?(nt.moveFn=L,nt.doneFn=C,T(e,r,n)):"pan"===i?(nt.moveFn=N,nt.doneFn=P,E()):a(i)&&m(e,r,n,nt,i)}};g.init(nt);var it,ot,at,st,lt,ut,ct,ft,ht,dt=t._fullLayout._zoomlayer,pt=e.x()._offset,gt=e.y()._offset,vt=[0,0,V,q],mt=null,yt=y.REDRAWDELAY,bt=e.mainplot?D._plots[e.mainplot]:e;return w.length*A.length!==1&&(void 0!==rt.onwheel?rt.onwheel=R:void 0!==rt.onmousewheel&&(rt.onmousewheel=R)),rt}},{"../../components/color":267,"../../components/dragelement":288,"../../components/drawing":290,"../../lib":342,"../../lib/setcursor":351,"../../lib/svg_text_utils":355,"../../plotly":362,"./axes":365,"./constants":370,"./select":378,d3:100,tinycolor2:239}],372:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=t.length;n>0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;n<t.length;n++)r.push(t[n].p2c(e));return r}function o(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}}function a(t,e,r){if("pie"===r)return void t.emit("plotly_hover",{points:[e]});r||(r="xy");var o=Array.isArray(r)?r:[r],a=t._fullLayout,d=a._plots||[],p=d[r];if(p){var y=p.overlays.map(function(t){return t.id});o=o.concat(y)}for(var x=o.length,M=new Array(x),k=new Array(x),T=0;x>T;T++){var E=o[T],L=d[E];if(L)M[T]=w.getFromId(t,L.xaxis._id),k[T]=w.getFromId(t,L.yaxis._id);else{var S=a[E]._subplot;M[T]=S.xaxis,k[T]=S.yaxis}}var C=e.hovermode||a.hovermode;if(-1===["x","y","closest"].indexOf(C)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return _.unhoverRaw(t,e);var P,R,N,z,I,O,j,D,F,B,U,V,q=[],H=[];if(Array.isArray(e))for(C="array",N=0;N<e.length;N++)I=t.calcdata[e[N].curveNumber||0],H.push(I);else{for(z=0;z<t.calcdata.length;z++)I=t.calcdata[z],O=I[0].trace,-1!==o.indexOf(s(O))&&H.push(I);var G,X;if(e.target&&"clientX"in e&&"clientY"in e){if(m.triggerHandler(t,"plotly_beforehover",e)===!1)return;var Y=e.target.getBoundingClientRect();if(G=e.clientX-Y.left,X=e.clientY-Y.top,0>G||G>Y.width||0>X||X>Y.height)return _.unhoverRaw(t,e)}else G="xpx"in e?e.xpx:M[0]._length/2,X="ypx"in e?e.ypx:k[0]._length/2;if(P="xval"in e?n(o,e.xval):i(M,G),R="yval"in e?n(o,e.yval):i(k,X),!g(P[0])||!g(R[0]))return v.warn("Plotly.Fx.hover failed",e,t),_.unhoverRaw(t,e)}var W=1/0;for(z=0;z<H.length;z++)if(I=H[z],I&&I[0]&&I[0].trace&&I[0].trace.visible===!0){if(O=I[0].trace,j=o.indexOf(s(O)),D=C,U={cd:I,trace:O,xa:M[j],ya:k[j],name:t.data.length>1||-1!==O.hoverinfo.indexOf("name")?O.name:void 0,index:!1,distance:Math.min(W,A.MAXDIST),color:b.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},V=q.length,"array"===D){var Z=e[z];"pointNumber"in Z?(U.index=Z.pointNumber,D="closest"):(D="","xval"in Z&&(F=Z.xval,D="x"),"yval"in Z&&(B=Z.yval,D=D?"closest":"y"))}else F=P[j],B=R[j];if(O._module&&O._module.hoverPoints){var Q=O._module.hoverPoints(U,F,B,D);if(Q)for(var $,K=0;K<Q.length;K++)$=Q[K],g($.x0)&&g($.y0)&&q.push(l($,C))}else v.log("Unrecognized trace type in hover:",O);"closest"===C&&q.length>V&&(q.splice(0,V),W=q[0].distance)}if(0===q.length)return _.unhoverRaw(t,e);var J="y"===C&&H.length>1;q.sort(function(t,e){return t.distance-e.distance});var tt=b.combine(a.plot_bgcolor||b.background,a.paper_bgcolor),et={hovermode:C,rotateLabels:J,bgColor:tt,container:a._hoverlayer,outerContainer:a._paperdiv},rt=u(q,et);c(q,J?"xa":"ya"),f(rt,J);var nt=t._hoverdata,it=[];for(N=0;N<q.length;N++){var ot=q[N],at={data:ot.trace._input,fullData:ot.trace,curveNumber:ot.trace.index,pointNumber:ot.index,x:ot.xVal,y:ot.yVal,xaxis:ot.xa,yaxis:ot.ya};void 0!==ot.zLabelVal&&(at.z=ot.zLabelVal),it.push(at)}t._hoverdata=it,h(t,e,nt)&&(nt&&t.emit("plotly_unhover",{points:nt}),t.emit("plotly_hover",{points:t._hoverdata,xaxes:M,yaxes:k,xvals:P,yvals:R}))}function s(t){return t.subplot||t.xaxis+t.yaxis}function l(t,e){t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=v.constrain(t.x0,0,t.xa._length),t.x1=v.constrain(t.x1,0,t.xa._length),t.y0=v.constrain(t.y0,0,t.ya._length),t.y1=v.constrain(t.y1,0,t.ya._length);var r;if(void 0!==t.xLabelVal){r="log"===t.xa.type&&t.xLabelVal<=0;var n=w.tickText(t.xa,t.xa.c2l(r?-t.xLabelVal:t.xLabelVal),"hover");r?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+n.text:t.xLabel=n.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){r="log"===t.ya.type&&t.yLabelVal<=0;var i=w.tickText(t.ya,t.ya.c2l(r?-t.yLabelVal:t.yLabelVal),"hover");r?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+i.text:t.yLabel=i.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var o=w.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+o+" / -"+w.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+o,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var a=w.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+a+" / -"+w.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+a,"y"===e&&(t.distance+=1)}var s=t.trace.hoverinfo;return"all"!==s&&(s=s.split("+"),-1===s.indexOf("x")&&(t.xLabel=void 0),-1===s.indexOf("y")&&(t.yLabel=void 0),-1===s.indexOf("z")&&(t.zLabel=void 0),-1===s.indexOf("text")&&(t.text=void 0),-1===s.indexOf("name")&&(t.name=void 0)),t}function u(t,e){var r,n,i=e.hovermode,o=e.rotateLabels,a=e.bgColor,s=e.container,l=e.outerContainer,u=t[0],c=u.xa,f=u.ya,h="y"===i?"yLabel":"xLabel",g=u[h],v=(String(g)||"").split(" ")[0],m=l.node().getBoundingClientRect(),_=m.top,w=m.width,M=m.height,k=u.distance<=A.MAXDIST&&("x"===i||"y"===i);for(r=0;r<t.length;r++){n=t[r].trace.hoverinfo;var E=n.split("+");if(-1===E.indexOf("all")&&-1===E.indexOf(i)){k=!1;break}}var L=s.selectAll("g.axistext").data(k?[0]:[]);L.enter().append("g").classed("axistext",!0),L.exit().remove(),L.each(function(){var e=d.select(this),r=e.selectAll("path").data([0]),n=e.selectAll("text").data([0]);r.enter().append("path").style({fill:b.defaultLine,"stroke-width":"1px",stroke:b.background}),n.enter().append("text").call(x.font,z,N,b.background).attr("data-notex",1),n.text(g).call(y.convertToTspans).call(x.setPosition,0,0).selectAll("tspan.line").call(x.setPosition,0,0),e.attr("transform","");var o=n.node().getBoundingClientRect();if("x"===i){n.attr("text-anchor","middle").call(x.setPosition,0,"top"===c.side?_-o.bottom-P-R:_-o.top+P+R).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var a="top"===c.side?"-":"";r.attr("d","M0,0L"+P+","+a+P+"H"+(R+o.width/2)+"v"+a+(2*R+o.height)+"H-"+(R+o.width/2)+"V"+a+P+"H-"+P+"Z"),e.attr("transform","translate("+(c._offset+(u.x0+u.x1)/2)+","+(f._offset+("top"===c.side?0:f._length))+")")}else{n.attr("text-anchor","right"===f.side?"start":"end").call(x.setPosition,("right"===f.side?1:-1)*(R+P),_-o.top-o.height/2).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var s="right"===f.side?"":"-";r.attr("d","M0,0L"+s+P+","+P+"V"+(R+o.height/2)+"h"+s+(2*R+o.width)+"V-"+(R+o.height/2)+"H"+s+P+"V-"+P+"Z"),e.attr("transform","translate("+(c._offset+("right"===f.side?c._length:0))+","+(f._offset+(u.y0+u.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[h]||"").split(" ")[0]===v})});var S=s.selectAll("g.hovertext").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")});return S.enter().append("g").classed("hovertext",!0).each(function(){var t=d.select(this);t.append("rect").call(b.fill,b.addOpacity(a,.8)),t.append("text").classed("name",!0).call(x.font,z,N),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(x.font,z,N)}),S.exit().remove(),S.each(function(t){var e=d.select(this).attr("transform",""),r="",n="",s=b.opacity(t.color)?t.color:b.defaultLine,l=b.combine(s,a),u=p(l).getBrightness()>128?"#000":b.background;if(t.name&&void 0===t.zLabelVal){var c=document.createElement("p");c.innerHTML=t.name,r=c.textContent||"",r.length>15&&(r=r.substr(0,12)+"...")}void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"<br>"),n+=(n?"z: ":"")+t.zLabel):k&&t[i+"Label"]===g?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"<br>":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var f=e.select("text.nums").style("fill",u).call(x.setPosition,0,0).text(n).attr("data-notex",1).call(y.convertToTspans);f.selectAll("tspan.line").call(x.setPosition,0,0);var h=e.select("text.name"),v=0;r&&r!==n?(h.style("fill",l).text(r).call(x.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),h.selectAll("tspan.line").call(x.setPosition,0,0),v=h.node().getBoundingClientRect().width+2*R):(h.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var m,A,E=f.node().getBoundingClientRect(),L=t.xa._offset+(t.x0+t.x1)/2,S=t.ya._offset+(t.y0+t.y1)/2,C=Math.abs(t.x1-t.x0),N=Math.abs(t.y1-t.y0),z=E.width+P+R+v;t.ty0=_-E.top,t.bx=E.width+2*R,t.by=E.height+2*R,t.anchor="start",t.txwidth=E.width,t.tx2width=v,t.offset=0,o?(t.pos=L,m=M>=S+N/2+z,A=S-N/2-z>=0,"top"!==t.idealAlign&&m||!A?m?(S+=N/2,t.anchor="start"):t.anchor="middle":(S-=N/2,t.anchor="end")):(t.pos=S,m=w>=L+C/2+z,A=L-C/2-z>=0,"left"!==t.idealAlign&&m||!A?m?(L+=C/2,t.anchor="start"):t.anchor="middle":(L-=C/2,t.anchor="end")),f.attr("text-anchor",t.anchor),v&&h.attr("text-anchor",t.anchor),e.attr("transform","translate("+L+","+S+")"+(o?"rotate("+T+")":""))}),S}function c(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(.01>o)){if(-.01>i){for(s=t.length-1;s>=0;s--)t[s].dp-=o;n=!1}if(n){var u=0;for(a=0;a<t.length;a++)l=t[a],l.pos+l.dp+l.size>e.pmax&&u++;for(a=t.length-1;a>=0&&!(0>=u);a--)l=t[a],l.pos>e.pmax-1&&(l.del=!0,u--);for(a=0;a<t.length&&!(0>=u);a++)if(l=t[a],l.pos<e.pmin+1)for(l.del=!0,u--,o=2*l.size,s=t.length-1;s>=0;s--)t[s].dp-=o;for(a=t.length-1;a>=0&&!(0>=u);a--)l=t[a],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,i,o,a,s,l,u,c=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?L:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,a=0;a<f.length-1;){var h=f[a],d=f[a+1],p=h[h.length-1],g=d[0];if(i=p.pos+p.dp+p.size-g.pos-g.dp+g.size,i>.01&&p.pmin===g.pmin&&p.pmax===g.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(h.push.apply(h,d),f.splice(a+1,1),u=0,s=h.length-1;s>=0;s--)u+=h[s].dp;for(o=u/h.length,s=h.length-1;s>=0;s--)h[s].dp-=o;n=!1}else a++}f.forEach(r)}for(a=f.length-1;a>=0;a--){var v=f[a];for(s=v.length-1;s>=0;s--){var m=v[s],y=t[m.i];y.offset=m.dp,y.del=m.del}}}function f(t,e){t.each(function(t){var r=d.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],a=o*(P+R),s=a+o*(t.txwidth+R),l=0,u=t.offset;"middle"===t.anchor&&(a-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-C,l=t.offset*S),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*P+l)+","+(P+u)+"v"+(t.by/2-P)+"h"+n*t.bx+"v-"+t.by+"H"+(n*P+l)+"V"+(u-P)+"Z"),i.call(x.setPosition,a+l,u+t.ty0-t.by/2+R).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(x.setPosition,s+o*R+l,u+t.ty0-t.by/2+R),r.select("rect").call(x.setRect,s+(o-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function h(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],o=t._hoverdata[n];if(i.curveNumber!==o.curveNumber||String(i.pointNumber)!==String(o.pointNumber))return!0}return!1}var d=t("d3"),p=t("tinycolor2"),g=t("fast-isnumeric"),v=t("../../lib"),m=t("../../lib/events"),y=t("../../lib/svg_text_utils"),b=t("../../components/color"),x=t("../../components/drawing"),_=t("../../components/dragelement"),w=t("./axes"),A=t("./constants"),M=t("./dragbox"),k=e.exports={};k.unhover=_.unhover,k.layoutAttributes={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}},k.supplyLayoutDefaults=function(t,e,r){function n(r,n){return v.coerce(t,e,k.layoutAttributes,r,n)}n("dragmode");var i;if(e._has("cartesian")){var o=e._isHoriz=k.isHoriz(r);i=o?"y":"x"}else i="closest";n("hovermode",i)},k.isHoriz=function(t){for(var e=!0,r=0;r<t.length;r++){var n=t[r];if("h"!==n.orientation){e=!1;break}}return e},k.init=function(t){var e=t._fullLayout;if(e._has("cartesian")&&!t._context.staticPlot){var r=Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1});r.forEach(function(r){var n=e._plots[r];if(e._has("cartesian")){var i=n.x(),o=n.y(),a=(i._linepositions[r]||[])[3],s=(o._linepositions[r]||[])[3],l=A.DRAGGERSIZE;if(g(a)&&"top"===i.side&&(a-=l),g(s)&&"right"!==o.side&&(s-=l),!n.mainplot){var u=M(t,n,0,0,i._length,o._length,"ns","ew");u.onmousemove=function(n){k.hover(t,n,r),e._lasthover=u,e._hoversubplot=r},u.onmouseout=function(e){t._dragging||_.unhover(t,e)},u.onclick=function(e){k.click(t,e)},M(t,n,-l,-l,l,l,"n","w"),M(t,n,i._length,-l,l,l,"n","e"),M(t,n,-l,o._length,l,l,"s","w"),M(t,n,i._length,o._length,l,l,"s","e")}g(a)&&("free"===i.anchor&&(a-=e._size.h*(1-o.domain[1])),M(t,n,.1*i._length,a,.8*i._length,l,"","ew"),M(t,n,0,a,.1*i._length,l,"","w"),M(t,n,.9*i._length,a,.1*i._length,l,"","e")),g(s)&&("free"===o.anchor&&(s-=e._size.w*i.domain[0]),M(t,n,s,.1*o._length,l,.8*o._length,"ns",""),M(t,n,s,.9*o._length,l,.1*o._length,"s",""),M(t,n,s,0,l,.1*o._length,"n",""))}});var n=e._hoverlayer.node();n.onmousemove=function(r){r.target=e._lasthover,k.hover(t,r,e._hoversubplot)},n.onclick=function(r){r.target=e._lasthover,k.click(t,r)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}};var T=A.YANGLE,E=Math.PI*T/180,L=1/Math.sin(E),S=Math.cos(E),C=Math.sin(E),P=A.HOVERARROWSIZE,R=A.HOVERTEXTPAD,N=A.HOVERFONTSIZE,z=A.HOVERFONT;k.hover=function(t,e,r){return"string"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+A.HOVERMINTIME?(a(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){a(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},A.HOVERMINTIME))},k.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||o(e,r):"x"===t?e:r},k.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var i=e(t[n]);i<=r.distance&&(r.index=n,r.distance=i)}return r},k.loneHover=function(t,e){var r={color:t.color||b.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=d.select(e.container),i=e.outerContainer?d.select(e.outerContainer):n,o={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||b.background,container:n,outerContainer:i},a=u([r],o);return f(a,o.rotateLabels),a.node()},k.loneUnhover=function(t){var e=t instanceof d.selection?t:d.select(t);e.selectAll("g.hovertext").remove()},k.click=function(t,e){t._hoverdata&&e&&e.target&&(t.emit("plotly_click",{points:t._hoverdata}),e.stopImmediatePropagation&&e.stopImmediatePropagation())},k.inbox=function(t,e){return 0>t*e||0===t?A.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../components/color":267,"../../components/dragelement":288,"../../components/drawing":290,"../../lib":342,"../../lib/events":338,"../../lib/svg_text_utils":355,"./axes":365,"./constants":370,"./dragbox":371,d3:100,"fast-isnumeric":104,tinycolor2:239}],373:[function(t,e,r){"use strict";var n=t("../plots"),i=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=i.idRegex,r.attrRegex=i.attrRegex,r.attributes=t("./attributes"),r.plot=function(t){function e(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],o=i[0].trace;o.xaxis+o.yaxis===e&&r.push(i)}return r}function r(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],o=i[0].trace;o._module===e&&o.visible===!0&&r.push(i)}return r}for(var i=t._fullLayout,o=n.getSubplotIds(i,"cartesian"),a=t.calcdata,s=i._modules,l=0;l<o.length;l++){var u=o[l],c=i._plots[u],f=e(a,u);c.plot&&c.plot.selectAll("g.trace").remove();for(var h=0;h<s.length;h++){var d=s[h];if("cartesian"===d.basePlotModule.name){var p=r(f,d);d.plot(t,c,p)}}}}},{"../plots":398,"./attributes":364,"./constants":370}],374:[function(t,e,r){"use strict";var n=t("../font_attributes"),i=t("../../components/color/attributes"),o=t("../../lib/extend").extendFlat,a=t("../../components/rangeslider/attributes"),s=t("../../components/rangeselector/attributes"),l=t("./constants");e.exports={color:{valType:"color",dflt:i.defaultLine},title:{
valType:"string"},titlefont:o({},n,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},rangeslider:a,rangeselector:s,fixedrange:{valType:"boolean",dflt:!1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"number",dflt:0},dtick:{valType:"any",dflt:1},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:i.defaultLine},showticklabels:{valType:"boolean",dflt:!0},tickfont:o({},n,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:i.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:i.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:i.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace"},categoryarray:{valType:"data_array"},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":266,"../../components/rangeselector/attributes":315,"../../components/rangeslider/attributes":322,"../../lib/extend":339,"../font_attributes":383,"./constants":370}],375:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../plots"),o=t("../../components/color"),a=t("../../components/rangeslider"),s=t("../../components/rangeselector"),l=t("./constants"),u=t("./layout_attributes"),c=t("./axis_defaults"),f=t("./position_defaults"),h=t("./axis_ids");e.exports=function(t,e,r){function d(t,e){var r=Number(t.substr(5)||1),n=Number(e.substr(5)||1);return r-n}var p,g=Object.keys(t),v=[],m=[],y=[],b=[],x={},_={};for(p=0;p<r.length;p++){var w,A,M=r[p];if(i.traceIs(M,"cartesian"))w=v,A=m;else{if(!i.traceIs(M,"gl2d"))continue;w=y,A=b}var k=h.id2name(M.xaxis),T=h.id2name(M.yaxis);if(k&&-1===w.indexOf(k)&&w.push(k),T&&-1===A.indexOf(T)&&A.push(T),i.traceIs(M,"2dMap")&&(x[k]=!0,x[T]=!0),i.traceIs(M,"oriented")){var E="h"===M.orientation?T:k;_[E]=!0}}var L=e._has("gl3d")||e._has("geo");if(!L)for(p=0;p<g.length;p++){var S=g[p];-1===y.indexOf(S)&&-1===v.indexOf(S)&&l.xAxisMatch.test(S)?v.push(S):-1===b.indexOf(S)&&-1===m.indexOf(S)&&l.yAxisMatch.test(S)&&m.push(S)}v.length&&m.length&&n.pushUnique(e._basePlotModules,i.subplotsRegistry.cartesian);var C=v.concat(y).sort(d),P=m.concat(b).sort(d),R=C.concat(P),N=o.background;C.length&&P.length&&(N=n.coerce(t,e,i.layoutAttributes,"plot_bgcolor"));var z=o.combine(N,e.paper_bgcolor);R.forEach(function(i){function o(t,e){return n.coerce(s,l,u,t,e)}var a=i.charAt(0),s=t[i]||{},l={},d={letter:a,font:e.font,outerTicks:x[i],showGrid:!_[i],name:i,data:r,bgColor:z},p={letter:a,counterAxes:{x:P,y:C}[a].map(h.name2id),overlayableAxes:{x:C,y:P}[a].filter(function(e){return e!==i&&!(t[e]||{}).overlaying}).map(h.name2id)};c(s,l,o,d),f(s,l,o,p),e[i]=l,t[i]||"-"===s.type||(t[i]={type:s.type})}),R.forEach(function(r){var n=r.charAt(0),i=t[r],o=e[r],l={x:P,y:C}[n];a.supplyLayoutDefaults(t,e,r,l),"x"===n&&"date"===o.type&&s.supplyLayoutDefaults(i,o,e,l)})}},{"../../components/color":267,"../../components/rangeselector":321,"../../components/rangeslider":326,"../../lib":342,"../plots":398,"./axis_defaults":366,"./axis_ids":367,"./constants":370,"./layout_attributes":374,"./position_defaults":377}],376:[function(t,e,r){"use strict";function n(t,e,r){var n,o,a,s,l,u=[],c=r.map(function(e){return e[t]}),f=i.bisector(e).left;for(n=0;n<c.length;n++)for(a=c[n],o=0;o<a.length;o++)s=a[o],null!==s&&void 0!==s&&(l=f(u,s),l<u.length-1&&u[l]===s||u.splice(l,0,s));return u}var i=t("d3");e.exports=function(t,e,r,o){switch(e){case"array":return Array.isArray(r)?r.slice():[];case"category ascending":return n(t,i.ascending,o);case"category descending":return n(t,i.descending,o);case"trace":return[];default:return[]}}},{d3:100}],377:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t,e,r,o){var a=o.counterAxes||[],s=o.overlayableAxes||[],l=o.letter,u=i.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(a),dflt:n(t.position)?"free":a[0]||"free"}},"anchor");"free"===u&&r("position"),i.coerce(t,e,{side:{valType:"enumerated",values:"x"===l?["bottom","top"]:["left","right"],dflt:"x"===l?"bottom":"left"}},"side");var c=!1;if(s.length&&(c=i.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(s),dflt:!1}},"overlaying")),!c){var f=r("domain");f[0]>f[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":342,"fast-isnumeric":104}],378:[function(t,e,r){"use strict";function n(t){return t._id}var i=t("../../lib/polygon"),o=t("../../components/color"),a=t("./axes"),s=t("./constants"),l=i.filter,u=i.tester,c=s.MINSELECT;e.exports=function(t,e,r,i,f){function h(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function d(t,e){return t-e}var p,g=i.gd._fullLayout._zoomlayer,v=i.element.getBoundingClientRect(),m=i.plotinfo.x()._offset,y=i.plotinfo.y()._offset,b=e-v.left,x=r-v.top,_=b,w=x,A="M"+b+","+x,M=i.xaxes[0]._length,k=i.yaxes[0]._length,T=i.xaxes.map(n),E=i.yaxes.map(n),L=i.xaxes.concat(i.yaxes);"lasso"===f&&(p=l([[b,x]],s.BENDPX));var S=g.selectAll("path.select-outline").data([1,2]);S.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+m+", "+y+")").attr("d",A+"Z");var C,P,R,N,z,I=g.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform","translate("+m+", "+y+")").attr("d","M0,0Z"),O=[],j=i.gd,D=[];for(C=0;C<j.calcdata.length;C++)if(P=j.calcdata[C],R=P[0].trace,R._module&&R._module.selectPoints)if(i.subplot){if(R.subplot!==i.subplot)continue;O.push({selectPoints:R._module.selectPoints,cd:P,xaxis:i.xaxes[0],yaxis:i.yaxes[0]})}else{if(-1===T.indexOf(R.xaxis))continue;if(-1===E.indexOf(R.yaxis))continue;O.push({selectPoints:R._module.selectPoints,cd:P,xaxis:a.getFromId(j,R.xaxis),yaxis:a.getFromId(j,R.yaxis)})}i.moveFn=function(t,e){var r,n;_=Math.max(0,Math.min(M,t+b)),w=Math.max(0,Math.min(k,e+x));var o=Math.abs(_-b),a=Math.abs(w-x);for("select"===f?(a<Math.min(.6*o,c)?(r=u([[b,0],[b,k],[_,k],[_,0]]),I.attr("d","M"+r.xmin+","+(x-c)+"h-4v"+2*c+"h4ZM"+(r.xmax-1)+","+(x-c)+"h4v"+2*c+"h-4Z")):o<Math.min(.6*a,c)?(r=u([[0,x],[0,w],[M,w],[M,x]]),I.attr("d","M"+(b-c)+","+r.ymin+"v-4h"+2*c+"v4ZM"+(b-c)+","+(r.ymax-1)+"v4h"+2*c+"v-4Z")):(r=u([[b,x],[b,w],[_,w],[_,x]]),I.attr("d","M0,0Z")),S.attr("d","M"+r.xmin+","+r.ymin+"H"+(r.xmax-1)+"V"+(r.ymax-1)+"H"+r.xmin+"Z")):"lasso"===f&&(p.addPt([_,w]),r=u(p.filtered),S.attr("d","M"+p.filtered.join("L")+"Z")),D=[],C=0;C<O.length;C++)N=O[C],[].push.apply(D,N.selectPoints(N,r));if(z={points:D},"select"===f){var s,l=z.range={};for(C=0;C<L.length;C++)n=L[C],s=n._id.charAt(0),l[n._id]=[n.p2d(r[s+"min"]),n.p2d(r[s+"max"])].sort(d)}else{var g=z.lassoPoints={};for(C=0;C<L.length;C++)n=L[C],g[n._id]=p.filtered.map(h(n))}i.gd.emit("plotly_selecting",z)},i.doneFn=function(t,e){if(I.remove(),t||2!==e)i.gd.emit("plotly_selected",z);else{for(S.remove(),C=0;C<O.length;C++)N=O[C],N.selectPoints(N,!1);j.emit("plotly_deselect",null)}}}},{"../../components/color":267,"../../lib/polygon":348,"./axes":365,"./constants":370}],379:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=t("../../lib"),a=t("./constants"),s=t("./clean_datum"),l=t("./axis_ids");e.exports=function(t){function e(e,r){if(e>0)return Math.log(e)/Math.LN10;if(0>=e&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*c*Math.abs(n-i))}return a.BADNUM}function r(t){return Math.pow(10,t)}function u(t){return i(t)?Number(t):a.BADNUM}var c=10;if(t.c2l="log"===t.type?e:u,t.l2c="log"===t.type?r:u,t.l2d=function(e){return t.c2d(t.l2c(e))},t.p2d=function(e){return t.l2d(t.p2l(e))},t.setScale=function(){var e,r=t._gd._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var n=l.getFromId(t._gd,t.overlaying);t.domain=n.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)i(t.range[e])||(t.range[e]=i(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return i(e)?n.round(t._b+t._m*e,2):a.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,r){return t.l2p(t.c2l(e,r))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=u,t.d2c=function(t){return t=s(t),i(t)?Number(t):a.BADNUM},t.d2l=function(e,r){return"log"===t.type?t.c2l(t.d2c(e),r):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return i(t)?o.ms2DateTime(t):a.BADNUM},t.d2c=function(t){return i(t)?Number(t):o.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var f=t.range.map(o.dateTime2ms);!i(t.range[0])&&i(f[0])&&(t.range[0]=f[0]),!i(t.range[1])&&i(f[1])&&(t.range[1]=f[1])}catch(h){o.error(h,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){null!==e&&void 0!==e&&-1===t._categories.indexOf(e)&&t._categories.push(e);var r=t._categories.indexOf(e);return-1===r?a.BADNUM:r},t.d2l=t.d2c);t.makeCalcdata=function(e,r){var n,i,o;if(r in e)for(n=e[r],i=new Array(n.length),o=0;o<n.length;o++)i[o]=t.d2c(n[o]);else{var a=r+"0"in e?t.d2c(e[r+"0"]):0,s=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],i=new Array(n.length),o=0;o<n.length;o++)i[o]=a+o*s}return i},t._min=[],t._max=[],t._minDtick=null,t._forceTick0=null}},{"../../lib":342,"./axis_ids":367,"./clean_datum":369,"./constants":370,d3:100,"fast-isnumeric":104}],380:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};return r.every(n)||1===r.length?t[r[0]]:void 0}var i=t("../../lib");e.exports=function(t,e,r,o,a){var s=n(t),l=r("tickprefix");l&&r("showtickprefix",s);var u=r("ticksuffix");u&&r("showticksuffix",s);var c=r("showticklabels");if(c){var f=a.font||{},h=e.color===t.color?e.color:f.color;if(i.coerceFont(r,"tickfont",{family:f.family,size:f.size,color:h}),r("tickangle"),"category"!==o){var d=r("tickformat");d||"date"===o||(r("showexponent",s),r("exponentformat"))}}"category"===o||a.noHover||r("hoverformat")}},{"../../lib":342}],381:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,o){var a=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color),u=r("ticks",o.outerTicks||a||s||l?"outside":"");u||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":342,"./layout_attributes":374}],382:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e,r,i){var o="auto";"array"!==t.tickmode||"log"!==i&&"date"!==i||(t.tickmode="auto"),Array.isArray(t.tickvals)?o="array":t.dtick&&n(t.dtick)&&(o="linear");var a=r("tickmode",o);if("auto"===a)r("nticks");else if("linear"===a)r("tick0"),r("dtick");else{var s=r("tickvals");void 0===s?e.tickmode="auto":r("ticktext")}}},{"fast-isnumeric":104}],383:[function(t,e,r){"use strict";e.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],384:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=o({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,f=t.clientHeight,h={keyBindingMode:"rotate",view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay,o=e-2*r;n.idle(e-r),n.recalcMatrix(o),n.flush(e-(100+2*r));for(var a=!0,s=n.computedMatrix,h=0;16>h;++h)a=a&&l[h]===s[h],l[h]=s[h];var d=t.clientWidth===c&&t.clientHeight===f;return c=t.clientWidth,f=t.clientHeight,a?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(h,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),o=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var a=i();n._active.lookAt(a,r,o,e),n._active.lookAt(a+500,r,o,[0,0,1]),n._active.flush(a)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return a(t,function(e,r,o,a){var s="rotate"===h.keyBindingMode,l="pan"===h.keyBindingMode,c="zoom"===h.keyBindingMode,f=!!a.control,g=!!a.alt,v=!!a.shift,m=!!(1&e),y=!!(2&e),b=!!(4&e),x=1/t.clientHeight,_=x*(r-d),w=x*(o-p),A=h.flipX?1:-1,M=h.flipY?1:-1,k=i(),T=Math.PI*h.rotateSpeed;if((s&&m&&!f&&!g&&!v||m&&!f&&!g&&v)&&n.rotate(k,A*T*_,-M*T*w,0),(l&&m&&!f&&!g&&!v||y||m&&f&&!g&&!v)&&n.pan(k,-h.translateSpeed*_*u,h.translateSpeed*w*u,0),c&&m&&!f&&!g&&!v||b||m&&!f&&g&&!v){var E=-h.zoomSpeed*w/window.innerHeight*(k-n.lastT())*100;n.pan(k,0,0,u*(Math.exp(E)-1))}return d=r,p=o,!0}),s(t,function(t,e){var r=h.flipX?1:-1,o=h.flipY?1:-1,a=i();if(Math.abs(t)>Math.abs(e))n.rotate(a,0,0,-t*r*Math.PI*h.rotateSpeed/window.innerWidth);else{var s=-h.zoomSpeed*o*e/window.innerHeight*(a-n.lastT())/100;n.pan(a,0,0,u*(Math.exp(s)-1))}},!0),h}e.exports=n;var i=t("right-now"),o=t("3d-view"),a=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":27,"mouse-change":207,"mouse-wheel":211,"right-now":221}],385:[function(t,e,r){"use strict";function n(t,e){for(var r=0;3>r;++r){var n=s[r];e[n]._gd=t}}var i=t("./scene"),o=t("../plots"),a=t("../../constants/xmlns_namespaces"),s=["xaxis","yaxis","zaxis"];r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,a=o.getSubplotIds(e,"gl3d");e._paperdiv.style({width:e.width+"px",height:e.height+"px"}),t._context.setBackground(t,e.paper_bgcolor);for(var s=0;s<a.length;s++){var l=a[s],u=o.getSubplotData(r,"gl3d",l),c=e[l],f=c._scene;void 0===f&&(n(t,c),f=new i({id:l,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),c._scene=f),f.plot(u,e,t.layout)}},r.clean=function(t,e,r,n){for(var i=o.getSubplotIds(n,"gl3d"),a=0;a<i.length;a++){var s=i[a];!e[s]&&n[s]._scene&&n[s]._scene.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=o.getSubplotIds(e,"gl3d"),n=e._size,i=0;i<r.length;i++){var s=e[r[i]],l=s.domain,u=s._scene,c=u.toImage("png"),f=e._glimages.append("svg:image");f.attr({xmlns:a.svg,"xlink:href":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),u.destroy()}},r.cleanId=function(t){if(t.match(/^scene[0-9]*$/)){var e=t.substr(5);return"1"===e&&(e=""),"scene"+e}},r.setConvert=t("./set_convert")},{"../../constants/xmlns_namespaces":333,"../plots":398,"./layout/attributes":386,"./layout/defaults":390,"./layout/layout_attributes":391,"./scene":395,"./set_convert":396}],386:[function(t,e,r){"use strict";e.exports={scene:{valType:"subplotid",dflt:"scene"}}},{}],387:[function(t,e,r){"use strict";var n=t("../../../components/color"),i=t("../../cartesian/layout_attributes"),o=t("../../../lib/extend").extendFlat;e.exports={showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:n.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:i.color,categoryorder:i.categoryorder,categoryarray:i.categoryarray,title:i.title,titlefont:i.titlefont,type:i.type,autorange:i.autorange,rangemode:i.rangemode,range:i.range,fixedrange:i.fixedrange,tickmode:i.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,mirror:i.mirror,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,tickfont:i.tickfont,tickangle:i.tickangle,tickprefix:i.tickprefix,showtickprefix:i.showtickprefix,ticksuffix:i.ticksuffix,showticksuffix:i.showticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,tickformat:i.tickformat,hoverformat:i.hoverformat,showline:i.showline,linecolor:i.linecolor,linewidth:i.linewidth,showgrid:i.showgrid,gridcolor:o({},i.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:i.gridwidth,zeroline:i.zeroline,zerolinecolor:i.zerolinecolor,zerolinewidth:i.zerolinewidth}},{"../../../components/color":267,"../../../lib/extend":339,"../../cartesian/layout_attributes":374}],388:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../../lib"),o=t("./axis_attributes"),a=t("../../cartesian/axis_defaults"),s=["xaxis","yaxis","zaxis"],l=function(){},u=13600/187;e.exports=function(t,e,r){function c(t,e){return i.coerce(f,h,o,t,e)}for(var f,h,d=0;d<s.length;d++){var p=s[d];f=t[p]||{},h={_id:p[0]+r.scene,_name:p},e[p]=h=a(f,h,c,{font:r.font,letter:p[0],data:r.data,showGrid:!0,bgColor:r.bgColor}),c("gridcolor",n(h.color,r.bgColor,u).toRgbString()),c("title",p[0]),h.setScale=l,c("showspikes")&&(c("spikesides"),c("spikethickness"),c("spikecolor",h.color)),c("showaxeslabels"),c("showbackground")&&c("backgroundcolor")}}},{"../../../lib":342,"../../cartesian/axis_defaults":366,"./axis_attributes":387,tinycolor2:239}],389:[function(t,e,r){"use strict";function n(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=l(this.tickPad),this._defaultLabelPad=l(this.labelPad),this._defaultLineTickLength=l(this.lineTickLength)}function i(t){var e=new n;return e.merge(t),e}var o=t("arraytools"),a=t("../../../lib/html2unicode"),s=t("../../../lib/str2rgbarray"),l=o.copy1D,u=["xaxis","yaxis","zaxis"],c=n.prototype;c.merge=function(t){for(var e=this,r=0;3>r;++r){var n=t[u[r]];e.labels[r]=a(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"log"===n.type?e.zeroEnable[r]=!1:"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:Math.PI*-n.tickangle/180),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?-1!==["ticks","all","allticks"].indexOf(n.mirror)?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1}},e.exports=i},{"../../../lib/html2unicode":341,"../../../lib/str2rgbarray":354,arraytools:37}],390:[function(t,e,r){"use strict";function n(t,e,r,n){for(var o=r("bgcolor"),l=i.combine(o,n.paper_bgcolor),u=Object.keys(a.camera),c=0;c<u.length;c++)r("camera."+u[c]+".x"),r("camera."+u[c]+".y"),r("camera."+u[c]+".z");var f=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),h=f?"manual":"auto",d=r("aspectmode",h);f||(t.aspectratio=e.aspectratio={x:1,y:1,z:1},"manual"===d&&(e.aspectmode="auto")),s(t,e,{font:n.font,scene:n.id,data:n.fullData,bgColor:l}),r("dragmode",n.getDfltFromLayout("dragmode")),r("hovermode",n.getDfltFromLayout("hovermode"))}var i=t("../../../components/color"),o=t("../../subplot_defaults"),a=t("./layout_attributes"),s=t("./axis_defaults");e.exports=function(t,e,r){function i(e){if(!s){var r=-1!==a[e].values.indexOf(t[e]);return r?t[e]:void 0}}var s=e._has("cartesian")||e._has("geo")||e._has("gl2d")||e._has("pie")||e._has("ternary");o(t,e,r,{type:"gl3d",attributes:a,handleDefaults:n,font:e.font,fullData:r,getDfltFromLayout:i,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":267,"../../subplot_defaults":404,"./axis_defaults":388,"./layout_attributes":391}],391:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t},y:{valType:"number",dflt:e},z:{valType:"number",dflt:r}}}var i=t("./axis_attributes"),o=t("../../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},camera:{up:o(n(0,0,1),{}),center:o(n(0,0,0),{}),eye:o(n(1.25,1.25,1.25),{})},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto"},aspectratio:{x:{valType:"number",min:0},y:{valType:"number",min:0},z:{valType:"number",min:0}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan"],dflt:"turntable"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest"},_deprecated:{cameraposition:{valType:"info_array"}}}},{"../../../lib/extend":339,"./axis_attributes":387}],392:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var o=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"],s=n.prototype;s.merge=function(t){for(var e=0;3>e;++e){var r=t[a[e]];this.enabled[e]=r.showspikes,this.colors[e]=o(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":354}],393:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;3>r;++r){for(var n=t[r],i=new Array(n.length),o=0;o<n.length;++o)i[o]=n[o].x;e[r]=i}return e}function i(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,i=t.fullSceneLayout,u=[[],[],[]],c=0;3>c;++c){var f=i[s[c]];if(f._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(f._length)===1/0)u[c]=[];else{f.range[0]=r[c].lo/t.dataScale[c],f.range[1]=r[c].hi/t.dataScale[c],f._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||o.Lib.constrain(f._length/40,4,9);o.Axes.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=o.Axes.calcTicks(f),g=0;g<p.length;++g)p[g].x=p[g].x*t.dataScale[c],p[g].text=a(p[g].text);u[c]=p,f.tickmode=h}}e.ticks=u;for(var c=0;3>c;++c){l[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(var g=0;2>g;++g)e.bounds[g][c]=t.glplot.bounds[g][c]}t.contourLevels=n(u)}e.exports=i;var o=t("../../../plotly"),a=t("../../../lib/html2unicode"),s=["xaxis","yaxis","zaxis"],l=[0,0,0]},{"../../../lib/html2unicode":341,"../../../plotly":362}],394:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;4>r;++r)for(n=0;4>n;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],395:[function(t,e,r){"use strict";function n(t){function e(e,r){if("string"==typeof r)return r;var n=t.fullSceneLayout[e];return g.tickText(n,n.c2l(r),"hover").text}var r,n=t.svgContainer,i=t.container.getBoundingClientRect(),o=i.width,a=i.height;n.setAttributeNS(null,"viewBox","0 0 "+o+" "+a),n.setAttributeNS(null,"width",o),n.setAttributeNS(null,"height",a),M(t),t.glplot.axes.update(t.axesOptions);for(var s=Object.keys(t.traces),l=null,u=t.glplot.selection,c=0;c<s.length;++c)r=t.traces[s[c]],r.handlePick(u)&&(l=r),r.setContourLevels&&r.setContourLevels();var f;if(null!==l){var h=x(t.glplot.cameraParams,u.dataCoordinate);r=l.data;var d=r.hoverinfo,p=e("xaxis",u.traceCoordinate[0]),m=e("yaxis",u.traceCoordinate[1]),y=e("zaxis",u.traceCoordinate[2]);if("all"!==d){var b=d.split("+");-1===b.indexOf("x")&&(p=void 0),-1===b.indexOf("y")&&(m=void 0),-1===b.indexOf("z")&&(y=void 0),-1===b.indexOf("text")&&(u.textLabel=void 0),-1===b.indexOf("name")&&(l.name=void 0)}t.fullSceneLayout.hovermode&&v.loneHover({x:(.5+.5*h[0]/h[3])*o,y:(.5-.5*h[1]/h[3])*a,xLabel:p,yLabel:m,zLabel:y,text:u.textLabel,name:l.name,color:l.color},{container:n});var _={points:[{x:p,y:m,z:y,data:r._input,fullData:r,curveNumber:r.index,pointNumber:u.data.index}]};u.buttons&&u.distance<5?t.graphDiv.emit("plotly_click",_):t.graphDiv.emit("plotly_hover",_),f=_}else v.loneUnhover(n),t.graphDiv.emit("plotly_unhover",f)}function i(t,e,r,i){var o={canvas:r,gl:i,container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1};if(t.staticMode){if(!f){c=document.createElement("canvas");try{f=c.getContext("webgl",{preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0})}catch(a){throw new Error("error creating static canvas/context for image server")}}o.pixelRatio=t.pixelRatio,o.gl=f,o.canvas=c}try{t.glplot=h(o)}catch(a){y(t)}var s=function(t){var e={};e[t.id]=u(t.camera),t.saveCamera(t.graphDiv.layout),t.graphDiv.emit("plotly_relayout",e)};if(t.glplot.canvas.addEventListener("mouseup",s.bind(null,t)),t.glplot.canvas.addEventListener("wheel",s.bind(null,t)),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",function(t){d.warn("Lost WebGL context."),t.preventDefault()}),!t.camera){var l=t.fullSceneLayout.camera;t.camera=b(t.container,{center:[l.center.x,l.center.y,l.center.z],eye:[l.eye.x,l.eye.y,l.eye.z],up:[l.up.x,l.up.y,l.up.z],zoomMin:.1,zoomMax:100,mode:"orbit"})}return t.glplot.mouseListener.enabled=!1,t.glplot.camera=t.camera,t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=n.bind(null,t),t.traces={},!0}function o(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.style.position="absolute",o.style.top=o.style.left="0px",o.style.width=o.style.height="100%",o.style["z-index"]=20,o.style["pointer-events"]="none",r.appendChild(o),this.svgContainer=o,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=A(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],!i(this,e)}function a(t,e,r,n){for(var i,o=0;o<e.length;++o)if(Array.isArray(e[o]))for(var a=0;a<e[o].length;++a)i=t.d2l(e[o][a]),!isNaN(i)&&isFinite(i)&&(n[0][r]=Math.min(n[0][r],i),n[1][r]=Math.max(n[1][r],i));else i=t.d2l(e[o]),!isNaN(i)&&isFinite(i)&&(n[0][r]=Math.min(n[0][r],i),n[1][r]=Math.max(n[1][r],i))}function s(t,e,r){var n=t.fullSceneLayout;a(n.xaxis,e.x,0,r),a(n.yaxis,e.y,1,r),a(n.zaxis,e.z,2,r)}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,f,h=t("gl-plot3d"),d=t("../../lib"),p=t("../../plots/plots"),g=t("../../plots/cartesian/axes"),v=t("../../plots/cartesian/graph_interact"),m=t("../../lib/str2rgbarray"),y=t("../../lib/show_no_webgl_msg"),b=t("./camera"),x=t("./project"),_=t("./set_convert"),w=t("./layout/convert"),A=t("./layout/spikes"),M=t("./layout/tick_marks"),k=o.prototype;
k.recoverContext=function(){function t(){return r.isContextLost()?void requestAnimationFrame(t):i(e,e.fullLayout,n,r)?void e.plot.apply(e,e.plotArgs):void d.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"];k.plot=function(t,e,r){if(this.plotArgs=[t,e,r],!this.glplot.contextLost){var n,i,o,a,l,u,c=e[this.id],f=r[this.id];for(c.bgcolor?this.glplot.clearColor=m(c.bgcolor):this.glplot.clearColor=[0,0,0,0],this.glplot.snapToData=!0,this.fullSceneLayout=c,this.glplotLayout=c,this.axesOptions.merge(c),this.spikeOptions.merge(c),this.updateFx(c.dragmode,c.hovermode),this.glplot.update({}),o=0;3>o;++o)l=c[T[o]],_(l);t?Array.isArray(t)||(t=[t]):t=[];var h=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(o=0;o<t.length;++o)n=t[o],n.visible===!0&&s(this,n,h);var d=[1,1,1];for(a=0;3>a;++a)h[0][a]>h[1][a]?d[a]=1:h[1][a]===h[0][a]?d[a]=1:d[a]=1/(h[1][a]-h[0][a]);for(this.dataScale=d,o=0;o<t.length;++o)if(n=t[o],n.visible===!0){if(i=this.traces[n.uid])i.update(n);else{var g=p.getModule(n.type);i=g.plot(this,n),this.traces[n.uid]=i}i.name=n.name}var v=Object.keys(this.traces);t:for(o=0;o<v.length;++o){for(a=0;a<t.length;++a)if(t[a].uid===v[o]&&t[a].visible===!0)continue t;i=this.traces[v[o]],i.dispose(),delete this.traces[v[o]]}var y=[[0,0,0],[0,0,0]],b=[],x={};for(o=0;3>o;++o){if(l=c[T[o]],u=l.type,u in x?(x[u].acc*=d[o],x[u].count+=1):x[u]={acc:d[o],count:1},l.autorange){for(y[0][o]=1/0,y[1][o]=-(1/0),a=0;a<this.glplot.objects.length;++a){var w=this.glplot.objects[a].bounds;y[0][o]=Math.min(y[0][o],w[0][o]/d[o]),y[1][o]=Math.max(y[1][o],w[1][o]/d[o])}if("rangemode"in l&&"tozero"===l.rangemode&&(y[0][o]=Math.min(y[0][o],0),y[1][o]=Math.max(y[1][o],0)),y[0][o]>y[1][o])y[0][o]=-1,y[1][o]=1;else{var A=y[1][o]-y[0][o];y[0][o]-=A/32,y[1][o]+=A/32}}else{var M=c[T[o]].range;y[0][o]=M[0],y[1][o]=M[1]}y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),b[o]=y[1][o]-y[0][o],this.glplot.bounds[0][o]=y[0][o]*d[o],this.glplot.bounds[1][o]=y[1][o]*d[o]}var k=[1,1,1];for(o=0;3>o;++o){l=c[T[o]],u=l.type;var E=x[u];k[o]=Math.pow(E.acc,1/E.count)/d[o]}var L,S=4;if("auto"===c.aspectmode)L=Math.max.apply(null,k)/Math.min.apply(null,k)<=S?k:[1,1,1];else if("cube"===c.aspectmode)L=[1,1,1];else if("data"===c.aspectmode)L=k;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var C=c.aspectratio;L=[C.x,C.y,C.z]}c.aspectratio.x=f.aspectratio.x=L[0],c.aspectratio.y=f.aspectratio.y=L[1],c.aspectratio.z=f.aspectratio.z=L[2],this.glplot.aspect=L;var P=c.domain||null,R=e._size||null;if(P&&R){var N=this.container.style;N.position="absolute",N.left=R.l+P.x[0]*R.w+"px",N.top=R.t+(1-P.y[1])*R.h+"px",N.width=R.w*(P.x[1]-P.x[0])+"px",N.height=R.h*(P.y[1]-P.y[0])+"px"}this.glplot.redraw()}},k.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},k.setCameraToDefault=function(){this.setCamera({eye:{x:1.25,y:1.25,z:1.25},center:{x:0,y:0,z:0},up:{x:0,y:0,z:1}})},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},k.setCamera=function(t){var e={};e[this.id]=t,this.glplot.camera.lookAt.apply(this,l(t)),this.graphDiv.emit("plotly_relayout",e)},k.saveCamera=function(t){function e(t,e,r,n){var i=["up","center","eye"],o=["x","y","z"];return e[i[r]]&&t[i[r]][o[n]]===e[i[r]][o[n]]}var r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),o=!1;if(void 0===i)o=!0;else for(var a=0;3>a;a++)for(var s=0;3>s;s++)if(!e(r,i,a,s)){o=!0;break}return o&&n.set(r),o},k.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},k.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,a=n-1;a>o;++o,--a)for(var s=0;r>s;++s)for(var l=0;4>l;++l){var u=i[4*(r*o+s)+l];i[4*(r*o+s)+l]=i[4*(r*a+s)+l],i[4*(r*a+s)+l]=u}var f=document.createElement("canvas");f.width=r,f.height=n;var h=f.getContext("2d"),d=h.createImageData(r,n);d.data.set(i),h.putImageData(d,0,0);var p;switch(t){case"jpeg":p=f.toDataURL("image/jpeg");break;case"webp":p=f.toDataURL("image/webp");break;default:p=f.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(c),p},e.exports=o},{"../../lib":342,"../../lib/show_no_webgl_msg":352,"../../lib/str2rgbarray":354,"../../plots/cartesian/axes":365,"../../plots/cartesian/graph_interact":372,"../../plots/plots":398,"./camera":384,"./layout/convert":389,"./layout/spikes":392,"./layout/tick_marks":393,"./project":394,"./set_convert":396,"gl-plot3d":159}],396:[function(t,e,r){"use strict";var n=t("../cartesian/axes"),i=function(){};e.exports=function(t){n.setConvert(t),t.setScale=i}},{"../cartesian/axes":365}],397:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("./font_attributes"),o=t("../components/color/attributes"),a=n.Lib.extendFlat;e.exports={font:{family:a({},i.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:a({},i.size,{dflt:12}),color:a({},i.color,{dflt:o.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:a({},i,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:o.background},plot_bgcolor:{valType:"color",dflt:o.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"gl3d",geo:"geo",legend:"Legend",annotations:"Annotations",shapes:"Shapes",images:"Images",ternary:"ternary",mapbox:"mapbox"}}},{"../components/color/attributes":266,"../plotly":362,"./font_attributes":383}],398:[function(t,e,r){"use strict";function n(t){return"object"==typeof t&&(t=t.type),t}function i(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#","class":"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){d.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}function o(t,e){for(var r=f.isPlainObject,n=Array.isArray,i=Object.keys(e),a=0;a<i.length;a++){var s=i[a],l=e[s],u=t[s];if("_"===s.charAt(0)||"function"==typeof l){if(s in t)continue;t[s]=l}else if(n(l)&&n(u))for(var c=0;c<l.length;c++)r(l[c])&&r(u[c])&&o(u[c],l[c]);else r(l)&&r(u)&&(o(u,l),Object.keys(u).length||delete t[s])}}function a(t,e,r){if(Array.isArray(t.transforms))for(var n=t.transforms,i=e.transforms=[],o=0;o<n.length;o++){var a,s=n[o],l=s.type,u=y[l];u||f.warn("Unrecognized transform type "+l+"."),u&&u.supplyDefaults?(a=u.supplyDefaults(s,e,r),a.type=l):a=f.extendFlat({},s),i.push(a)}}function s(t,e,r){for(var n=t.transforms,i=[t],o=0;o<n.length;o++){var a=n[o],s=a.type,l=y[s];l&&(i=l.transform(i,{transform:a,fullTrace:t,fullData:e,layout:r}))}return i}var l=t("d3"),u=t("fast-isnumeric"),c=t("../plotly"),f=t("../lib"),h=t("../components/color"),d=e.exports={},p=d.modules={},g=d.allTypes=[],v=d.allCategories={},m=d.subplotsRegistry={},y=d.transformsRegistry={};d.attributes=t("./attributes"),d.attributes.type.values=g,d.fontAttrs=t("./font_attributes"),d.layoutAttributes=t("./layout_attributes"),d.fontWeight="normal",d.register=function(t,e,r,n){if(p[e])return void f.log("Type "+e+" already registered");for(var i={},o=0;o<r.length;o++)i[r[o]]=!0,v[r[o]]=!0;p[e]={_module:t,categories:i},n&&Object.keys(n).length&&(p[e].meta=n),g.push(e)},d.getModule=function(t){if(void 0!==t.r)return f.warn("Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",t),!1;var e=p[n(t)];return e?e._module:!1},d.traceIs=function(t,e){if(t=n(t),"various"===t)return!1;var r=p[t];return r||(void 0!==t&&f.log("Unrecognized trace type "+t+"."),r=p[d.attributes.type.dflt]),!!r.categories[e]},d.registerSubplot=function(t){var e=t.name;return m[e]?void f.log("Plot type "+e+" already registered."):void(m[e]=t)},d.findSubplotIds=function(t,e){var r=[];if(void 0===d.subplotsRegistry[e])return r;for(var n=d.subplotsRegistry[e].attr,i=0;i<t.length;i++){var o=t[i];d.traceIs(o,e)&&-1===r.indexOf(o[n])&&r.push(o[n])}return r},d.getSubplotIds=function(t,e){var r=d.subplotsRegistry[e];if(void 0===r)return[];if(!("cartesian"!==e||t._has&&t._has("cartesian")))return[];if(!("gl2d"!==e||t._has&&t._has("gl2d")))return[];if("cartesian"===e||"gl2d"===e)return Object.keys(t._plots||{});for(var n=r.idRegex,i=Object.keys(t),o=[],a=0;a<i.length;a++){var s=i[a];n.test(s)&&o.push(s)}var l=r.idRoot.length;return o.sort(function(t,e){var r=+(t.substr(l)||1),n=+(e.substr(l)||1);return r-n}),o},d.getSubplotData=function(t,e,r){if(void 0===d.subplotsRegistry[e])return[];for(var n,i=d.subplotsRegistry[e].attr,o=[],a=0;a<t.length;a++)if(n=t[a],"gl2d"===e&&d.traceIs(n,"gl2d")){var s=c.Axes.subplotMatch,l="x"+r.match(s)[1],u="y"+r.match(s)[2];n[i[0]]===l&&n[i[1]]===u&&o.push(n)}else n[i]===r&&o.push(n);return o},d.redrawText=function(t){return t.data&&t.data[0]&&t.data[0].r?void 0:new Promise(function(e){setTimeout(function(){c.Annotations.drawAll(t),c.Legend.draw(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(d.previousPromises(t))},300)})},d.resize=function(t){return new Promise(function(e,r){t&&"none"!==l.select(t).style("display")||r(new Error("Resize must be passed a plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if((t._fullLayout||{}).autosize){var r=t.changed;t.autoplay=!0,c.relayout(t,{autosize:!0}),t.changed=r,e(t)}},100)})},d.previousPromises=function(t){return(t._promises||[]).length?Promise.all(t._promises).then(function(){t._promises=[]}):void 0},d.addLinks=function(t){var e=t._fullLayout,r=e._paper.selectAll("text.js-plot-link-container").data([0]);r.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:h.defaultLine,"pointer-events":"all"}).each(function(){var t=l.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)});var n=r.node(),o={y:e._paper.attr("height")-9};document.body.contains(n)&&n.getComputedTextLength()>=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),r.attr(o);var a=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&i(t,a),s.text(a.text()&&u.text()?" - ":"")},d.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=d.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},d.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},a=t._fullData||[],s=t._fullData=[],l=t.data||[];d.supplyLayoutGlobalDefaults(i,n),n._dataLength=l.length,d.supplyDataDefaults(l,s,n),n._has=d._hasPlotType.bind(n);var u=n._modules;for(e=0;e<u.length;e++){var f=u[e];f.cleanData&&f.cleanData(s)}if(a.length===l.length)for(e=0;e<s.length;e++)o(s[e],a[e]);d.supplyLayoutModuleDefaults(i,n,s),n._hasCartesian=n._has("cartesian"),n._hasGeo=n._has("geo"),n._hasGL3D=n._has("gl3d"),n._hasGL2D=n._has("gl2d"),n._hasTernary=n._has("ternary"),n._hasPie=n._has("pie"),d.cleanPlot(s,n,a,r),o(n,r),d.doAutoMargin(t);var h=c.Axes.list(t);for(e=0;e<h.length;e++){var p=h[e];p._gd=t,p.setScale()}if((t.calcdata||[]).length===s.length)for(e=0;e<s.length;e++){var g=s[e];(t.calcdata[e][0]||{}).trace=g}},d._hasPlotType=function(t){for(var e=this._basePlotModules||[],r=0;r<e.length;r++){var n=e[r];if(n.name===t)return!0}return!1},d.cleanPlot=function(t,e,r,n){var i,o,a=n._basePlotModules||[];for(i=0;i<a.length;i++){var s=a[i];s.clean&&s.clean(t,e,r,n)}var l=!!n._paper,u=!!n._infolayer;t:for(i=0;i<r.length;i++){var c=r[i],f=c.uid;for(o=0;o<t.length;o++){var h=t[o];if(f===h.uid)continue t}l&&n._paper.selectAll(".hm"+f+",.contour"+f+",#clip"+f).remove(),u&&n._infolayer.selectAll(".cb"+f).remove()}},d.supplyDataDefaults=function(t,e,r){function n(t){e.push(t);var r=t._module;r&&(f.pushUnique(i,r),f.pushUnique(o,t._module.basePlotModule),a++)}for(var i=r._modules=[],o=r._basePlotModules=[],a=0,l=0;l<t.length;l++){var u=t[l],c=d.supplyTraceDefaults(u,a,r);if(c.transforms&&c.transforms.length)for(var h=s(c,e,r),p=0;p<h.length;p++){var g=h[p],v=d.supplyTraceDefaults(g,a,r);g.uid=v.uid=c.uid+p,v.index=l,v._input=u,v._fullInput=c,v._expandedIndex=a,v._expandedInput=g,n(v)}else c.index=l,c._input=u,c._expandedIndex=a,n(c)}},d.supplyTraceDefaults=function(t,e,r){function n(e,r){return f.coerce(t,o,d.attributes,e,r)}function i(e,r){return d.traceIs(o,e)?f.coerce(t,o,d.subplotsRegistry[e].attributes,r):void 0}var o={},s=h.defaults[e%h.defaults.length],l=n("visible");n("type"),n("uid");for(var u=Object.keys(m),c=0;c<u.length;c++){var p=u[c];if(-1===["cartesian","gl2d"].indexOf(p)){var g=m[p].attr;g&&i(p,g)}}if(l){var v=d.getModule(o);o._module=v,n("hoverinfo",1===r._dataLength?"x+y+z+text":void 0),v&&v.supplyDefaults(t,o,s,r),n("name","trace "+e),d.traceIs(o,"noOpacity")||n("opacity"),i("cartesian","xaxis"),i("cartesian","yaxis"),i("gl2d","xaxis"),i("gl2d","yaxis"),d.traceIs(o,"showLegend")&&(n("showlegend"),n("legendgroup")),a(t,o,r)}return o},d.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return f.coerce(t,e,d.layoutAttributes,r,n)}var n=f.coerceFont(r,"font");r("title"),f.coerceFont(r,"titlefont",{family:n.family,size:Math.round(1.4*n.size),color:n.color});var i=r("autosize",t.width&&t.height?!1:"initial");r("width"),r("height"),r("margin.l"),r("margin.r"),r("margin.t"),r("margin.b"),r("margin.pad"),r("margin.autoexpand"),"initial"!==i&&d.sanitizeMargins(e),r("paper_bgcolor"),r("separators"),r("hidesources"),r("smith")},d.supplyLayoutModuleDefaults=function(t,e,r){var n,i;c.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(n=0;n<o.length;n++)i=o[n],"cartesian"!==i.name&&i.supplyLayoutDefaults&&i.supplyLayoutDefaults(t,e,r);var a=e._modules;for(n=0;n<a.length;n++)i=a[n],i.supplyLayoutDefaults&&i.supplyLayoutDefaults(t,e,r);var s=["Fx","Annotations","Shapes","Legend","Images"];for(n=0;n<s.length;n++)i=s[n],c[i]&&c[i].supplyLayoutDefaults(t,e,r)},d.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&e._glcontainer.remove(),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._tester,delete t._testref,delete t._promises,delete t._redrawTimer,delete t._replotting,delete t.firstscatter,delete t.hmlumcount,delete t.hmpixcount,delete t.numboxes,delete t._hoverTimer,delete t._lastHoverTime,t.removeAllListeners&&t.removeAllListeners()},d.style=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++){var n=e[r];n.style&&n.style(t)}},d.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,i=t.margin,o=r-(i.l+i.r),a=n-(i.t+i.b);0>o&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),0>a&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},d.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];t._replotting||d.doAutoMargin(t)}},d.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),a=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;return e.margin.autoexpand!==!1&&(l.base={l:{val:0,size:i},r:{val:1,size:o},t:{val:1,size:a},b:{val:0,size:s}},Object.keys(l).forEach(function(t){var r=l[t].l||{},n=l[t].b||{},c=r.val,f=r.size,h=n.val,d=n.size;Object.keys(l).forEach(function(t){if(u(f)&&l[t].r){var r=l[t].r.val,n=l[t].r.size;if(r>c){var p=(f*r+(n-e.width)*c)/(r-c),g=(n*(1-c)+(f-e.width)*(1-r))/(r-c);p>=0&&g>=0&&p+g>i+o&&(i=p,o=g)}}if(u(d)&&l[t].t){var v=l[t].t.val,m=l[t].t.size;if(v>h){var y=(d*v+(m-e.height)*h)/(v-h),b=(m*(1-h)+(d-e.height)*(1-v))/(v-h);y>=0&&b>=0&&y+b>s+a&&(s=y,a=b)}}})})),r.l=Math.round(i),r.r=Math.round(o),r.t=Math.round(a),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,t._replotting||"{}"===n||n===JSON.stringify(e._size)?void 0:c.plot(t)},d.graphJson=function(t,e,r,n,i){function o(t){if("function"==typeof t)return null;if(f.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!f.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=o(t[e])}return i}return Array.isArray(t)?t.map(o):t&&t.getTime?f.ms2DateTime(t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&d.supplyDefaults(t);var a=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l={data:(a||[]).map(function(t){var r=o(t);return e&&delete r.fit,r})};return e||(l.layout=o(s)),t.framework&&t.framework.isPolar&&(l=t.framework.getConfig()),"object"===n?l:JSON.stringify(l)}},{"../components/color":267,"../lib":342,"../plotly":362,"./attributes":363,"./font_attributes":383,"./layout_attributes":397,d3:100,"fast-isnumeric":104}],399:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":419}],400:[function(t,e,r){"use strict";function n(t,e){var r={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return o({},e,r)}var i=t("../cartesian/layout_attributes"),o=t("../../lib/extend").extendFlat,a=o({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:a,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:a}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":339,"../cartesian/layout_attributes":374}],401:[function(t,e,r){var n=t("../../plotly"),i=t("d3"),o=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},a=n.Lib.extendDeepAll;o.Axis=function(){function t(t){r=t||r;var u=l.data,f=l.layout;return("string"==typeof r||r.nodeName)&&(r=i.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+f.orientation}var u=t.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(f)};var h=0;u.forEach(function(t,e){t.color||(t.color=f.defaultColorRange[h],h=(h+1)%f.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:i.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var d=u.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),p=!1,g=d.map(function(t,e){return p=p||"undefined"!=typeof t.groupId,t});if(p){var v=i.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),m=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=o.util.sumArrays(t.r,r)}),t.values});d=i.merge(y)}d.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var b=Math.min(f.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2;b=Math.max(10,b);var x,_=[f.margin.left+b,f.margin.top+b];if(p){var w=i.max(o.util.sumArrays(o.util.arrayLast(d).r[0],o.util.arrayLast(m)));x=[0,w]}else x=i.extent(o.util.flattenArray(d.map(function(t,e){return t.r})));f.radialAxis.domain!=o.DATAEXTENT&&(x[0]=0),n=i.scale.linear().domain(f.radialAxis.domain!=o.DATAEXTENT&&f.radialAxis.domain?f.radialAxis.domain:x).range([0,b]),c.layout.radialAxis.domain=n.domain();var A,M=o.util.flattenArray(d.map(function(t,e){return t.t})),k="string"==typeof M[0];k&&(M=o.util.deduplicate(M),A=M.slice(),M=i.range(M.length),d=d.map(function(t,e){var r=t;return t.t=[M],p&&(r.yStack=t.yStack),r}));var T=d.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===d.length,E=null===f.needsEndSpacing?k||!T:f.needsEndSpacing,L=f.angularAxis.domain&&f.angularAxis.domain!=o.DATAEXTENT&&!k&&f.angularAxis.domain[0]>=0,S=L?f.angularAxis.domain:i.extent(M),C=Math.abs(M[1]-M[0]);T&&!k&&(C=0);var P=S.slice();E&&k&&(P[1]+=C);var R=f.angularAxis.ticksCount||4;R>8&&(R=R/(R/8)+R%8),f.angularAxis.ticksStep&&(R=(P[1]-P[0])/R);var N=f.angularAxis.ticksStep||(P[1]-P[0])/(R*(f.minorTicks+1));A&&(N=Math.max(Math.round(N),1)),P[2]||(P[2]=N);var z=i.range.apply(this,P);if(z=z.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=i.scale.linear().domain(P.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=E?C:0,e=i.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var I="<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>",O=(new DOMParser).parseFromString(I,"application/xml"),j=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=i.select(j)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var D,F=e.select(".chart-group"),B={fill:"none",stroke:f.tickColor},U={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){D=e.select(".legend-group").attr({transform:"translate("+[b,f.margin.top]+")"}).style({display:"block"});var V=d.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:D,elements:V,reverseOrder:f.legend.reverseOrder})})();var q=D.node().getBBox();b=Math.min(f.width-q.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,b=Math.max(10,b),_=[f.margin.left+b,f.margin.top+b],n.range([0,b]),c.layout.radialAxis.domain=n.domain(),D.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else D=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(f.width-(f.margin.left+f.margin.right+2*b+(q?q.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*b))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),f.title){var G=e.select("g.title-group text").style(U).text(f.title),X=G.node().getBBox();G.attr({x:_[0]-X.width/2,y:_[1]-b-20})}var Y=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var W=Y.selectAll("circle.grid-circle").data(n.ticks(5));W.enter().append("circle").attr({"class":"grid-circle"}).style(B),W.attr("r",n),W.exit().remove()}Y.select("circle.outside-circle").attr({r:b}).style(B);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Q=i.svg.axis().scale(n).ticks(5).tickSize(5);Y.call(Q).attr({transform:"rotate("+f.radialAxis.orientation+")"}),Y.selectAll(".domain").style(B),Y.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(U).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),Y.selectAll("g>line").style({stroke:"black"})}var $=e.select(".angular.axis-group").selectAll("g.angular-tick").data(z),K=$.enter().append("g").classed("angular-tick",!0);$.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),$.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(B),K.selectAll(".minor").style({stroke:f.minorTickColor}),$.select("line.grid-line").attr({x1:f.tickLength?b-f.tickLength:0,x2:b}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(U);var J=$.select("text.axis-text").attr({x:b+f.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=b+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?270>r&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(180>=r&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":A?A[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(U);f.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var tt=i.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));D.attr({transform:"translate("+[b+tt,f.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(d);if(rt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),d[0]||et){var nt=[];d.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=i.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),ot=[];it.forEach(function(t,e){"unstacked"===t.key?ot=ot.concat(t.values.map(function(t,e){return[t]})):ot.push(t.values)}),ot.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(o[r].defaultConfig(),t)});o[r]().config(n)()})}var at,st,lt=e.select(".guides-group"),ut=e.select(".tooltips-group"),ct=o.tooltipPanel().config({container:ut,fontSize:8})(),ft=o.tooltipPanel().config({container:ut,fontSize:8})(),ht=o.tooltipPanel().config({container:ut,hasTick:!0})();if(!k){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;at=s.invert(n);var i=o.util.convertToCartesian(b+12,r+180);ct.text(o.util.round(at)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var r=o.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),st=n.invert(o.util.getMousePos(Z).radius);var i=o.util.convertToCartesian(r,f.radialAxis.orientation);ft.text(o.util.round(st)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ht.hide(),ct.hide(),ft.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var n=i.select(this),a=n.style("fill"),s="black",l=n.style("opacity")||1;if(n.attr({"data-opacity":l}),"none"!=a){n.attr({"data-fill":a}),s=i.hsl(a).darker().toString(),n.style({fill:s,opacity:1});var u={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(u.t=A[t[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=e.node().getBoundingClientRect(),d=[f.left+f.width/2-H[0]-h.left,f.top+f.height/2-H[1]-h.top];ht.config({color:s}).text(c),ht.move(d)}else a=n.style("stroke"),n.attr({"data-stroke":a}),s=i.hsl(a).darker().toString(),n.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=i.event.which?!1:void(i.select(this).attr("data-fill")&&ht.show())}).on("mouseout.tooltip",function(t,e){ht.hide();var r=i.select(this),n=r.attr("data-fill");n?r.style({fill:n,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),h}var e,r,n,s,l={data:[],layout:{}},u={},c={},f=i.dispatch("hover"),h={};return h.render=function(e){return t(e),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)}),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return n},h.angularScale=function(t){return s},h.svg=function(){return e},i.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:i.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",
orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6,n=i.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return n},o.util.dataFromEquation=function(t,e,r){var n=e||6,o=[],a=[];i.range(0,360+n,n).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);o.push(e),a.push(i)});var s={t:o,r:a};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return i.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return i.zip(t,e).map(function(t,e){return i.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=i.mouse(t.node()),r=e[0],n=e[1],o={};return o.x=r,o.y=n,o.pos=e,o.angle=180*(Math.atan2(n,r)+Math.PI)/Math.PI,o.radius=Math.sqrt(r*r+n*n),o},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,o=t.length;o>i;i++)e=t[i],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var o=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof o&&(e.reduce(function(t,r,n){return"undefined"!=typeof t?(n===e.length-1&&delete t[r],t[r]):void 0},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=o),t[e]},t))},o.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=i.select(e)),e.datum(r).each(function(e,r){function n(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function o(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var a=!!e[0].data.yStack,l=e.map(function(t,e){return a?i.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):i.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],f={};f.bar=function(r,n,o){var a=e[o].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=a.barWidth;i.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]))+")"}})},f.dot=function(t,r,a){var s=t[2]?[t[0],t[1]+t[2]]:t,l=i.svg.symbol().size(e[a].data.dotSize).type(e[a].data.dotType)(t,r);i.select(this).attr({"class":"mark dot",d:l,transform:function(t,e){var r=o(n(s));return"translate("+[r.x,r.y]+")"}})};var h=i.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});f.line=function(r,n,o){var a=r[2]?l[o].map(function(t,e){return[t[0],t[1]+t[2]]}):l[o];if(i.select(this).each(f.dot).style({opacity:function(t,r){return+e[o].data.dotVisible},fill:v.stroke(r,n,o)}).attr({"class":"mark dot"}),!(n>0)){var s=i.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({"class":"line",d:h(a),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,n,o)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,n,o)},"stroke-width":function(t,e){return v["stroke-width"](r,n,o)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,n,o)},opacity:function(t,e){return v.opacity(r,n,o)},display:function(t,e){return v.display(r,n,o)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,g=i.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])});f.arc=function(e,r,n){i.select(this).attr({"class":"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var v={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 s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},m=i.select(this).selectAll("g.layer").data(l);m.enter().append("g").attr({"class":"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({"class":"mark"}),y.style(v).each(f[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e,r=[o.PolyChart.defaultConfig()],n=i.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),a(r[e],o.PolyChart.defaultConfig()),a(r[e],t)}),this):r},t.getColorScale=function(){return e},i.rebind(t,n,"on"),t},o.PolyChart.defaultConfig=function(){var t={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:i.scale.category20()}};return t},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},o.Legend=function(){function t(){var r=e.legendConfig,n=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=i.merge(n);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=i.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=c?r.height:u*o.length,h=s.classed("legend-group",!0),d=h.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=i.range(o.length),v=i.scale[c?"linear":"ordinal"]().domain(g).range(l),m=i.scale[c?"linear":"ordinal"]().domain(g)[c?"range":"rangePoints"]([0,f]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=i.svg.symbolTypes.indexOf(t)?i.svg.symbol().type(t).size(r)():i.svg.symbol().type("square").size(r)()};if(c){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,m(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=i.svg.axis().scale(m).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=i.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},i.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},o.tooltipPanel=function(){var t,e,r,n={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){t=n.container.selectAll("g."+s).data([0]);var i=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=i.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=i.append("text").attr({dx:n.padding+l,dy:.3*+n.fontSize}),u};return u.text=function(o){var a=i.hsl(n.color).l,s=a>=.5?"#aaa":"white",c=a>=.5?"black":"white",f=o||"";e.style({fill:c,"font-size":n.fontSize+"px"}).text(f);var h=n.padding,d=e.node().getBBox(),p={fill:n.color,stroke:s,"stroke-width":"2px"},g=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[n.hasTick?0:l,0],[l,v/4],[l,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u):void 0},u.hide=function(){return t?(t.style({display:"none"}),u):void 0},u.show=function(){return t?(t.style({display:"block"}),u):void 0},u.config=function(t){return a(n,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var n=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var i=n.indexOf(t.geometry);-1!=i&&(r.data[e].groupId=i)})}if(t.layout){var s=a({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],f={};i.entries(s.margin).forEach(function(t,e){f[c[u.indexOf(t.key)]]=t.value}),s.margin=f}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../plotly":362,"./micropolar_manager":402,d3:100}],402:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("d3"),o=t("./undo_manager"),a=e.exports={},s=n.Lib.extendDeepAll;a.framework=function(t){function e(e,o){return o&&(f=o),i.select(i.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,u||(u=n.micropolar.Axis()),c=n.micropolar.adapter.plotly().convert(r),u.config(c).render(f),t.data=r.data,t.layout=r.layout,a.fillLayout(t),r}var r,l,u,c,f,h=new o;return e.isPolar=!0,e.svg=function(){return u.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return n.micropolar.adapter.plotly().convert(u.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:u.angularScale(),r:u.radialScale()}},e.setUndoPoint=function(){var t=this,e=n.micropolar.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,l),l=n.micropolar.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},a.fillLayout=function(t){var e=i.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),o=t.framework&&t.framework.svg&&t.framework.svg(),a={width:800,height:600,paper_bgcolor:n.Color.background,_container:e,_paperdiv:r,_paper:o};t._fullLayout=s(a,t.layout)}},{"../../plotly":362,"./undo_manager":403,d3:100}],403:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n<r.length-1},getCommands:function(){return r},getPreviousCommand:function(){return r[n-1]},getIndex:function(){return n}}}},{}],404:[function(t,e,r){"use strict";var n=t("../lib"),i=t("./plots");e.exports=function(t,e,r,o){function a(t,e){return n.coerce(s,l,c,t,e)}for(var s,l,u=o.type,c=o.attributes,f=o.handleDefaults,h=o.partition||"x",d=i.findSubplotIds(r,u),p=d.length,g=0;p>g;g++){var v=d[g];s=t[v]?t[v]:t[v]={},e[v]=l={},a("domain."+h,[g/p,(g+1)/p]),a("domain."+{x:"y",y:"x"}[h]),o.id=v,f(s,l,a,o)}}},{"../lib":342,"./plots":398}],405:[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){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var o=t("../plotly"),a=o.Lib.extendFlat,s=o.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,l=t.data,u=t.layout,c=s([],l),f=s({},u,n(e.tileClass));if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(r=0;r<h.length;r++)i(h[r])&&(f[h[r]].title="");for(r=0;r<c.length;r++){var d=c[r];d.showscale=!1,d.marker&&(d.marker.showscale=!1),"pie"===d.type&&(d.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)f.annotations.push(e.annotations[r]);var p=o.Plots.getSubplotIds(f,"gl3d");if(p.length){var g={};for("thumbnail"===e.tileClass&&(g={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<p.length;r++){var v=p[r];a(f[v].xaxis,g),a(f[v].yaxis,g),a(f[v].zaxis,g),f[v]._scene=null}}var m=document.createElement("div");e.tileClass&&(m.className=e.tileClass);var y={td:m,layout:f,data:c,config:{staticPlot:void 0===e.staticPlot?!0:e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1}};return"transparent"!==e.setBackground&&(y.config.setBackground=e.setBackground||"opaque"),y.td.defaultLayout=n(e.tileClass),y}},{"../plotly":362}],406:[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.")),o.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,a(e,l)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var i=t("../plot_api/to_image"),o=t("../lib"),a=t("./filesaver");e.exports=n},{"../lib":342,"../plot_api/to_image":360,"./filesaver":407}],407:[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),o=new Promise(function(o,a){"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&a(new Error("IE < 10 unsupported")),i&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),o(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),o(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob&&(navigator.msSaveBlob(new Blob([t]),e),o(e)),a(new Error("download error"))});return o};e.exports=n},{}],408:[function(t,e,r){"use strict";function n(t){return t._has&&(t._has("gl3d")||t._has("gl2d"))?500:0}function i(t){return t.data&&t.data[0]&&t.data[0].r?void 0:function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}var o={getDelay:n,getRedrawFunc:i,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=o},{"./cloneplot":405,"./download":406,"./svgtoimg":409,"./toimage":410,"./tosvg":411}],409:[function(t,e,r){"use strict";function n(t){var e=t.emitter||new o,r=new Promise(function(n,o){var a=window.Image,s=t.svg,l=t.format||"png";if(i.isIE()&&(s=s.replace(/"/gi,"'"),s=s.replace(/(\('#)(.*)('\))/gi,'("$2")'),s=s.replace(/(\\')/gi,'"'),"svg"!==l)){var u=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return o(u),t.promise?r:e.emit("error",u)}var c=t.canvas,f=c.getContext("2d"),h=new a,d="data:image/svg+xml,"+encodeURIComponent(s);c.height=t.height||150,c.width=t.width||300,h.onload=function(){var r;switch("svg"!==l&&f.drawImage(h,0,0),l){case"jpeg":r=c.toDataURL("image/jpeg");break;case"png":r=c.toDataURL("image/png");break;case"webp":r=c.toDataURL("image/webp");break;case"svg":r=d;break;default:if(o(new Error("Image format is not jpeg, png or svg")),!t.promise)return e.emit("error","Image format is not jpeg, png or svg")}n(r),t.promise||e.emit("success",r)},h.onerror=function(r){return o(r),t.promise?void 0:e.emit("error",r)},h.src=d});return t.promise?r:e}var i=t("../lib"),o=t("events").EventEmitter;e.exports=n},{"../lib":342,events:43}],410:[function(t,e,r){"use strict";function n(t,e){function r(){var t=n.getDelay(u._fullLayout);setTimeout(function(){var t=o.Snapshot.toSVG(u),r=document.createElement("canvas");r.id=a.randstr(),s=o.Snapshot.svgToImg({format:e.format,width:u._fullLayout.width,height:u._fullLayout.height,canvas:r,emitter:s,svg:t}),s.clean=function(){u&&document.body.removeChild(u)}},t)}var n=o.Snapshot,s=new i,l=n.clone(t,{format:"png"}),u=l.td;u.style.position="absolute",u.style.left="-5000px",document.body.appendChild(u);var c=n.getRedrawFunc(u);return o.plot(u,l.data,l.layout,l.config).then(c).then(r).catch(function(t){s.emit("error",t)}),s}var i=t("events").EventEmitter,o=t("../plotly"),a=t("../lib");e.exports=n},{"../lib":342,"../plotly":362,events:43}],411:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib/svg_text_utils"),o=t("../components/drawing"),a=t("../components/color"),s=t("../constants/xmlns_namespaces");e.exports=function(t,e){var r,l=t._fullLayout,u=l._paper,c=l._toppaper;u.insert("rect",":first-child").call(o.setRect,0,0,l.width,l.height).call(a.fill,l.paper_bgcolor);var f=l._basePlotModules||[];for(r=0;r<f.length;r++){var h=f[r];h.toSVG&&h.toSVG(t)}if(c){var d=c.node().childNodes,p=Array.prototype.slice.call(d);for(r=0;r<p.length;r++){var g=p[r];g.childNodes.length&&u.node().appendChild(g)}}l._draggers&&l._draggers.remove(),u.node().style.background="",u.selectAll("text").attr("data-unformatted",null).each(function(){var t=n.select(this);if("hidden"===t.style("visibility"))return void t.remove();var e=t.style("font-family");e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(/"/g,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||u.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),u.node().setAttributeNS(s.xmlns,"xmlns",s.svg),u.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink);var v=(new window.XMLSerializer).serializeToString(u.node());return v=i.html_entity_decode(v),v=i.xml_entity_encode(v),v=v.replace(/("TOBESTRIPPED)|(TOBESTRIPPED")/g,"'")}},{"../components/color":267,"../components/drawing":290,"../constants/xmlns_namespaces":333,"../lib/svg_text_utils":355,d3:100}],412:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=t("../../lib"),a=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,u="cb"+r.uid,c=s(r.colorscale),f=r.zmin,h=r.zmax;if(i(f)||(f=o.aggNums(Math.min,null,r.z)),i(h)||(h=o.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+u).remove(),!r.showscale)return void a.autoMargin(t,u);var d=e[0].t.cb=l(t,u);d.fillcolor(n.scale.linear().domain(c.map(function(t){return f+t[0]*(h-f)})).range(c.map(function(t){return t[1]}))).filllevels({start:f,end:h,size:(h-f)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":270,"../../components/colorscale/get_scale":279,"../../lib":342,"../../plots/plots":398,d3:100,"fast-isnumeric":104}],413:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../surface/attributes"),o=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:o({},i.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:o({},i.contours.x.show,{}),color:o({},i.contours.x.color),width:o({},i.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,lightposition:{x:o({},i.lightposition.x,{dflt:1e5}),y:o({},i.lightposition.y,{dflt:1e5}),z:o({},i.lightposition.z,{dflt:0})},lighting:o({},{vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6}},i.lighting),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":273,"../../lib/extend":339,"../surface/attributes":447}],414:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=u(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function o(t){return t.map(d)}function a(t,e,r){for(var n=new Array(t.length),i=0;i<t.length;++i)n[i]=[t[i],e[i],r[i]];return n}function s(t,e){var r=t.glplot.gl,i=l({gl:r}),o=new n(t,i,e.uid);return o.update(e),t.glplot.add(i),o}var l=t("gl-mesh3d"),u=t("tinycolor2"),c=t("delaunay-triangulate"),f=t("alpha-shape"),h=t("convex-hull"),d=t("../../lib/str2rgbarray"),p=n.prototype;p.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},p.update=function(t){function e(t,e,r){return e.map(function(e){return t.d2l(e)*r})}var r=this.scene,n=r.fullSceneLayout;this.data=t;var s,l=a(e(n.xaxis,t.x,r.dataScale[0]),e(n.yaxis,t.y,r.dataScale[1]),e(n.zaxis,t.z,r.dataScale[2]));if(t.i&&t.j&&t.k)s=a(t.i,t.j,t.k);else if(0===t.alphahull)s=h(l);else if(t.alphahull>0)s=f(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolors[0],p.vertexColors=o(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=o(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":354,"alpha-shape":28,"convex-hull":90,"delaunay-triangulate":101,"gl-mesh3d":133,tinycolor2:239}],415:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorbar/defaults"),o=t("./attributes");e.exports=function(t,e,r,a){function s(r,i){return n.coerce(t,e,o,r,i)}function l(t){var e=t.map(function(t){var e=s(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=l(["x","y","z"]),c=l(["i","j","k"]);return u?(c&&c.forEach(function(t){for(var e=0;e<t.length;++e)t[e]|=0}),["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){s(t)}),"intensity"in t?(s("intensity"),s("showscale",!0)):(e.showscale=!1,"vertexcolor"in t?s("vertexcolor"):"facecolor"in t?s("facecolor"):s("color",r)),e.reversescale&&(e.colorscale=e.colorscale.map(function(t){return[1-t[0],t[1]]}).reverse()),void(e.showscale&&i(t,e,a))):void(e.visible=!1)}},{"../../components/colorbar/defaults":269,"../../lib":342,"./attributes":413}],416:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/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":385,"../heatmap/colorbar":412,"./attributes":413,"./convert":414,"./defaults":415}],417:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var o=r.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o,fill:e.color}).call(n.stroke,i)}},{"../../components/color":267}],418:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){var e=t[0].trace,r=e.marker;if(n.mergeArray(e.text,t,"tx"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf")),r&&r.line){var i=r.line;n.mergeArray(r.opacity,t,"mo"),n.mergeArray(r.symbol,t,"mx"),n.mergeArray(r.color,t,"mc"),n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw")}}},{"../../lib":342}],419:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/drawing"),o=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],
dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:o({},{symbol:{valType:"enumerated",values:i.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},line:o({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line"))},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":275,"../../components/drawing":290,"../../lib/extend":339,"./constants":424}],420:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("./subtypes"),s=t("./colorscale_calc");e.exports=function(t,e){var r,l,u,c=i.getFromId(t,e.xaxis||"x"),f=i.getFromId(t,e.yaxis||"y"),h=c.makeCalcdata(e,"x"),d=f.makeCalcdata(e,"y"),p=Math.min(h.length,d.length);c._minDtick=0,f._minDtick=0,h.length>p&&h.splice(p,h.length-p),d.length>p&&d.splice(p,d.length-p);var g={padded:!0},v={padded:!0};if(a.hasMarkers(e)){if(r=e.marker,l=r.size,Array.isArray(l)){var m={type:"linear"};i.setConvert(m),l=m.makeCalcdata(e.marker,"size"),l.length>p&&l.splice(p,l.length-p)}var y,b=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},g.ppad=v.ppad=Array.isArray(l)?l.map(y):y(l)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(a.hasMarkers(e)||a.hasText(e))||(g.padded=!1,g.ppad=0):g.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(v.padded=!1):v.tozero=!0,i.expand(c,h,g),i.expand(f,d,v);var x=new Array(p);for(u=0;p>u;u++)x[u]=n(h[u])&&n(d[u])?{x:h[u],y:d[u]}:{x:!1,y:!1};return void 0!==typeof l&&o.mergeArray(l,x,"ms"),t.firstscatter=!1,x}},{"../../lib":342,"../../plots/cartesian/axes":365,"./colorscale_calc":423,"./subtypes":438,"fast-isnumeric":104}],421:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i,o;for(e=0;e<t.length;e++)if(r=t[e],n=r.fill,"none"!==n&&"scatter"===r.type&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(i=e-1;i>=0;i--)if(o=t[i],"scatter"===o.type&&o.xaxis===r.xaxis&&o.yaxis===r.yaxis){o.opacity=void 0;break}}},{}],422:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=t("../../lib"),a=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,u=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===u||!u.showscale)return void a.autoMargin(t,c);var f=s(u.colorscale),h=u.color,d=u.cmin,p=u.cmax;i(d)||(d=o.aggNums(Math.min,null,h)),i(p)||(p=o.aggNums(Math.max,null,h));var g=e[0].t.cb=l(t,c);g.fillcolor(n.scale.linear().domain(f.map(function(t){return d+t[0]*(p-d)})).range(f.map(function(t){return t[1]}))).filllevels({start:d,end:p,size:(p-d)/254}).options(u.colorbar)()}},{"../../components/colorbar/draw":270,"../../components/colorscale/get_scale":279,"../../lib":342,"../../plots/plots":398,d3:100,"fast-isnumeric":104}],423:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),o.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":274,"../../components/colorscale/has_colorscale":280,"./subtypes":438}],424:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],425:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),o=t("./constants"),a=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function g(r,o){return n.coerce(t,e,i,r,o)}var v=s(t,e,g),m=v<o.PTS_LINESONLY?"lines+markers":"lines";if(!v)return void(e.visible=!1);g("text"),g("mode",m),a.hasLines(e)&&(u(t,e,r,p,g),c(t,e,g),g("connectgaps")),a.hasMarkers(e)&&l(t,e,r,p,g),a.hasText(e)&&f(t,e,p,g);var y=[];(a.hasMarkers(e)||a.hasText(e))&&(g("marker.maxdisplayed"),y.push("points")),g("fill"),"none"!==e.fill&&(h(t,e,r,g),a.hasLines(e)||c(t,e,g)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),g("hoveron",y.join("+")||"points"),d(t,e,r,{axis:"y"}),d(t,e,r,{axis:"x",inherit:"y"})}},{"../../components/errorbars/defaults":295,"../../lib":342,"./attributes":419,"./constants":424,"./fillcolor_defaults":426,"./line_defaults":430,"./line_shape_defaults":432,"./marker_defaults":434,"./subtypes":438,"./text_defaults":439,"./xy_defaults":440}],426:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r,i){var o=!1;if(e.marker){var a=e.marker.color,s=(e.marker.line||{}).color;a&&!Array.isArray(a)?o=a:s&&!Array.isArray(s)&&(o=s)}i("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":267}],427:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./subtypes");e.exports=function(t,e){var r,o;if("lines"===t.mode)return r=t.line.color,r&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var a=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return o=a&&n.opacity(a)?a:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"",o?n.opacity(o)<.3?n.addOpacity(o,.3):o:(r=(t.line||{}).color,r&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor)}},{"../../components/color":267,"./subtypes":438}],428:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/graph_interact"),o=t("../../plots/cartesian/constants"),a=t("../../components/errorbars"),s=t("./get_trace_color"),l=t("../../components/color");e.exports=function(t,e,r,u){var c=t.cd,f=c[0].trace,h=t.xa,d=t.ya,p=h.c2p(e),g=d.c2p(r),v=[p,g];if(-1!==f.hoveron.indexOf("points")){var m=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(h.c2p(t.x)-p)-e,1-3/e)},y=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(d.c2p(t.y)-g)-e,1-3/e)},b=function(t){var e=Math.max(3,t.mrc||0),r=h.c2p(t.x)-p,n=d.c2p(t.y)-g;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)},x=i.getDistanceFunction(u,m,y,b);if(i.getClosest(c,x,t),t.index!==!1){var _=c[t.index],w=h.c2p(_.x,!0),A=d.c2p(_.y,!0),M=_.mrc||1;return n.extendFlat(t,{color:s(f,_),x0:w-M,x1:w+M,xLabelVal:_.x,y0:A-M,y1:A+M,yLabelVal:_.y}),_.tx?t.text=_.tx:f.text&&(t.text=f.text),a.hoverInfo(_,f,t),[t]}}if(-1!==f.hoveron.indexOf("fills")&&f._polygons){var k,T,E,L,S,C,P,R,N,z=f._polygons,I=[],O=!1,j=1/0,D=-(1/0),F=1/0,B=-(1/0);for(k=0;k<z.length;k++)E=z[k],E.contains(v)&&(O=!O,I.push(E),F=Math.min(F,E.ymin),B=Math.max(B,E.ymax));if(O){F=Math.max(F,0),B=Math.min(B,d._length);var U=(F+B)/2;for(k=0;k<I.length;k++)for(L=I[k].pts,T=1;T<L.length;T++)R=L[T-1][1],N=L[T][1],R>U!=N>=U&&(C=L[T-1][0],P=L[T][0],S=C+(P-C)*(U-R)/(N-R),j=Math.min(j,S),D=Math.max(D,S));j=Math.max(j,0),D=Math.min(D,h._length);var V=l.defaultLine;return l.opacity(f.fillcolor)?V=f.fillcolor:l.opacity((f.line||{}).color)&&(V=f.line.color),n.extendFlat(t,{distance:o.MAXDIST+10,x0:j,x1:D,y0:U,y1:U,color:V}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":267,"../../components/errorbars":296,"../../lib":342,"../../plots/cartesian/constants":370,"../../plots/cartesian/graph_interact":372,"./get_trace_color":427}],429:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":373,"./arrays_to_calcdata":418,"./attributes":419,"./calc":420,"./clean_data":421,"./colorbar":422,"./defaults":425,"./hover":428,"./plot":435,"./select":436,"./style":437,"./subtypes":438}],430:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,a){var s=(t.marker||{}).color;if(a("line.color",r),n(t,"line"))i(t,e,o,a,{prefix:"line.",cLetter:"c"});else{var l=(Array.isArray(s)?!1:s)||r;a("line.color",l)}a("line.width"),a("line.dash")}},{"../../components/colorscale/defaults":277,"../../components/colorscale/has_colorscale":280}],431:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(e){var r=w.c2p(t[e].x),n=A.c2p(t[e].y);return r===L||n===L?!1:[r,n]}function i(t){var e=t[0]/w._length,r=t[1]/A._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*k}function o(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var a,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_,w=e.xaxis,A=e.yaxis,M=e.connectGaps,k=e.baseTolerance,T=e.linear,E=[],L=n.BADNUM,S=.2,C=new Array(t.length),P=0;for(a=0;a<t.length;a++)if(s=r(a)){for(P=0,C[P++]=s,a++;a<t.length;a++){if(u=r(a),!u){if(M)continue;break}if(T){if(h=o(u,s),!(h<i(u)*S)){for(p=[(u[0]-s[0])/h,(u[1]-s[1])/h],c=s,v=h,m=b=x=0,d=!1,l=u,a++;a<t.length;a++){if(f=r(a),!f){if(M)continue;break}if(g=[f[0]-s[0],f[1]-s[1]],_=g[0]*p[1]-g[1]*p[0],b=Math.min(b,_),x=Math.max(x,_),x-b>i(f))break;l=f,y=g[0]*p[0]+g[1]*p[1],y>v?(v=y,u=f,d=!1):m>y&&(m=y,c=f,d=!0)}if(d?(C[P++]=u,l!==c&&(C[P++]=c)):(c!==s&&(C[P++]=c),l!==u&&(C[P++]=u)),C[P++]=l,a>=t.length||!f)break;C[P++]=f,s=f}}else C[P++]=u}E.push(C.slice(0,P))}return E}},{"../../plots/cartesian/axes":365}],432:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],433:[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,o="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=o(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":104}],434:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),a=t("./subtypes");e.exports=function(t,e,r,s,l){var u,c=a.isBubble(t),f=(t.line||{}).color;f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&o(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u=f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine,l("marker.line.color",u),i(t,"marker.line")&&o(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode"))}},{"../../components/color":267,"../../components/colorscale/defaults":277,"../../components/colorscale/has_colorscale":280,"./subtypes":438}],435:[function(t,e,r){"use strict";function n(t,e,r){var n=e.x(),o=e.y(),a=i.extent(n.range.map(n.l2c)),s=i.extent(o.range.map(o.l2c));r.forEach(function(t,e){var n=t[0].trace;if(u.hasMarkers(n)){var i=n.marker.maxdisplayed;if(0!==i){var o=t.filter(function(t){return t.x>=a[0]&&t.x<=a[1]&&t.y>=s[0]&&t.y<=s[1]}),l=Math.ceil(o.length/i),c=0;r.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&e>r&&c++});var f=Math.round(c*l/3+Math.floor(c/3)*l/7.1);t.forEach(function(t){delete t.vis}),o.forEach(function(t,e){0===Math.round((e+f)%l)&&(t.vis=!0)})}}})}var i=t("d3"),o=t("../../lib"),a=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("../../lib/polygon").tester,u=t("./subtypes"),c=t("./arrays_to_calcdata"),f=t("./line_points");e.exports=function(t,e,r){function h(t){return t.filter(function(t){return t.vis})}n(t,e,r);var d=e.x(),p=e.y(),g=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(r);g.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2),g.call(s.plot,e);var v,m,y,b,x="",_=[];g.each(function(t){var e=t[0].trace,r=e.line,n=i.select(this);if(e.visible===!0&&(m=e.fill.charAt(e.fill.length-1),"x"!==m&&"y"!==m&&(m=""),t[0].node3=n,c(t),u.hasLines(e)||"none"!==e.fill)){var o,s,h,g,w,A="",M="";v="tozero"===e.fill.substr(0,6)||"toself"===e.fill||"to"===e.fill.substr(0,2)&&!x?n.append("path").classed("js-fill",!0):null,b&&(y=b.datum(t)),b=n.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(r.shape)?(h=a.steps(r.shape),g=a.steps(r.shape.split("").reverse().join(""))):h=g="spline"===r.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?a.smoothclosed(t.slice(1),r.smoothing):a.smoothopen(t,r.smoothing)}:function(t){return"M"+t.join("L")},w=function(t){return g(t.reverse())};var k,T=f(t,{xaxis:d,yaxis:p,connectGaps:e.connectgaps,baseTolerance:Math.max(r.width||1,3)/4,linear:"linear"===r.shape}),E=e._polygons=new Array(T.length);for(k=0;k<T.length;k++)e._polygons[k]=l(T[k]);if(T.length){var L=T[0][0],S=T[T.length-1],C=S[S.length-1];for(k=0;k<T.length;k++){var P=T[k];o=h(P),s=w(P),A?m?(A+="L"+o.substr(1),M=s+("L"+M.substr(1))):(A+="Z"+o,M=s+"Z"+M):(A=o,M=s),u.hasLines(e)&&P.length>1&&n.append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").attr("d",o)}v?L&&C&&(m?("y"===m?L[1]=C[1]=p.c2p(0,!0):"x"===m&&(L[0]=C[0]=d.c2p(0,!0)),v.attr("d",A+"L"+C+"L"+L+"Z")):v.attr("d",A+"Z")):"tonext"===e.fill.substr(0,6)&&A&&x&&("tonext"===e.fill?y.attr("d",A+"Z"+x+"Z"):y.attr("d",A+"L"+x.substr(1)+"Z"),e._polygons=e._polygons.concat(_)),x=M,_=E}}}),g.selectAll("path:not([d])").remove(),g.append("g").attr("class","points").each(function(t){var e=t[0].trace,r=i.select(this),n=u.hasMarkers(e),s=u.hasText(e);!n&&!s||e.visible!==!0?r.remove():(n&&r.selectAll("path.point").data(e.marker.maxdisplayed?h:o.identity).enter().append("path").classed("point",!0).call(a.translatePoints,d,p),s&&r.selectAll("g").data(e.marker.maxdisplayed?h:o.identity).enter().append("g").append("text").call(a.translatePoints,d,p))})}},{"../../components/drawing":290,"../../components/errorbars":296,"../../lib":342,"../../lib/polygon":348,"./arrays_to_calcdata":418,"./line_points":431,"./subtypes":438,d3:100}],436:[function(t,e,r){"use strict";var n=t("./subtypes"),i=.2;e.exports=function(t,e){var r,o,a,s,l=t.cd,u=t.xaxis,c=t.yaxis,f=[],h=l[0].trace,d=h.index,p=h.marker,g=!n.hasMarkers(h)&&!n.hasText(h);if(h.visible===!0&&!g){var v=Array.isArray(p.opacity)?1:p.opacity;if(e===!1)for(r=0;r<l.length;r++)l[r].dim=0;else for(r=0;r<l.length;r++)o=l[r],a=u.c2p(o.x),s=c.c2p(o.y),e.contains([a,s])?(f.push({curveNumber:d,pointNumber:r,x:o.x,y:o.y}),o.dim=0):o.dim=1;return l[0].node3.selectAll("path.point").style("opacity",function(t){return((t.mo+1||v+1)-1)*(t.dim?i:1)}),l[0].node3.selectAll("text").style("opacity",function(t){return t.dim?i:1}),f}}},{"./subtypes":438}],437:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),o=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(t){n.select(this).selectAll("path.point").call(i.pointStyle,t.trace||t[0].trace),n.select(this).selectAll("text").call(i.textPointStyle,t.trace||t[0].trace)}),e.selectAll("g.trace path.js-line").call(i.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(i.fillGroupStyle),e.call(o.style)}},{"../../components/drawing":290,"../../components/errorbars":296,d3:100}],438:[function(t,e,r){"use strict";e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("markers")},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return"object"==typeof t.marker&&Array.isArray(t.marker.size)}}},{}],439:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){i("textposition"),n.coerceFont(i,"textfont",r.font)}},{"../../lib":342}],440:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i=r("x"),o=r("y");if(i)o?(n=Math.min(i.length,o.length),n<i.length&&(e.x=i.slice(0,n)),n<o.length&&(e.y=o.slice(0,n))):(n=i.length,r("y0"),r("dy"));else{if(!o)return 0;n=e.y.length,r("x0"),r("dx")}return n}},{}],441:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var i=t("../scatter/attributes"),o=t("../../components/colorscale/color_attributes"),a=t("../../constants/gl_markers"),s=t("../../lib/extend").extendFlat,l=i.line,u=i.marker,c=u.line;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:s({},i.text,{}),mode:s({},i.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:n("x"),y:n("y"),z:n("z")},connectgaps:i.connectgaps,line:s({},{width:l.width,dash:l.dash,showscale:{valType:"boolean",dflt:!1}},o("line")),marker:s({},{symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:s({},u.size,{dflt:8}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:s({},u.opacity,{arrayOk:!1}),showscale:u.showscale,line:s({},{width:s({},c.width,{arrayOk:!1})},o("marker.line"))},o("marker")),textposition:s({},i.textposition,{dflt:"top center"}),textfont:i.textfont,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars",error_z:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":275,"../../constants/gl_markers":332,"../../lib/extend":339,"../scatter/attributes":419}],442:[function(t,e,r){"use strict";var n=t("../scatter/arrays_to_calcdata"),i=t("../scatter/colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(r),i(e),r}},{"../scatter/arrays_to_calcdata":418,"../scatter/colorscale_calc":423}],443:[function(t,e,r){"use strict";function n(t,e,r){if(!e||!e.visible)return null;for(var n=a(e),i=new Array(t.length),o=0;o<t.length;o++){var s=n(+t[o],o);i[o]=[-s[0]*r,s[1]*r]}return i}function i(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}function o(t,e){var r=[n(t.x,t.error_x,e[0]),n(t.y,t.error_y,e[1]),n(t.z,t.error_z,e[2])],o=i(r);if(0===o)return null;for(var a=new Array(o),s=0;o>s;s++){for(var l=[[0,0,0],[0,0,0]],u=0;3>u;u++)if(r[u])for(var c=0;2>c;c++)l[c][u]=r[u][s][c];a[s]=l}return a}var a=t("../../components/errorbars/compute_error");e.exports=o},{"../../components/errorbars/compute_error":294}],444:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,o=(r+2)%3,a=[],s=[];for(n=0;n<t.length;++n){var l=t[n];!isNaN(l[i])&&isFinite(l[i])&&!isNaN(l[o])&&isFinite(l[o])&&(a.push([l[i],l[o]]),s.push(n))}var u=m(a);for(n=0;n<u.length;++n)for(var c=u[n],f=0;f<c.length;++f)c[f]=s[c[f]];return{positions:t,cells:u,meshColor:e}}function o(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;3>i;i++){var o=t[i];o&&o.copy_zstyle!==!1&&(o=t[2]),o&&(e[i]=o.width/2,r[i]=b(o.color),n=o.thickness)}return{capSize:e,color:r,lineWidth:n}}function a(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return A[t]}function u(t,e,r,n,i){var o=null;if(Array.isArray(t)){o=[];for(var a=0;e>a;a++)void 0===t[a]?o[a]=n:o[a]=r(t[a],i)}else o=r(t,y.identity);return o}function c(t,e){var r,n,i,c,f,h,d=[],p=t.fullSceneLayout,g=t.dataScale,v=p.xaxis,m=p.yaxis,w=p.zaxis,A=e.marker,k=e.line,T=e.x||[],E=e.y||[],L=e.z||[],S=T.length;for(n=0;S>n;n++)i=v.d2l(T[n])*g[0],c=m.d2l(E[n])*g[1],f=w.d2l(L[n])*g[2],d[n]=[i,c,f];if(Array.isArray(e.text))h=e.text;else if(void 0!==e.text)for(h=new Array(S),n=0;S>n;n++)h[n]=e.text;if(r={position:d,mode:e.mode,text:h},"line"in e&&(r.lineColor=x(k,1,S),r.lineWidth=k.width,r.lineDashes=k.dash),"marker"in e){var C=_(e);r.scatterColor=x(A,1,S),r.scatterSize=u(A.size,S,s,20,C),r.scatterMarker=u(A.symbol,S,l,"\u25cf"),r.scatterLineWidth=A.line.width,r.scatterLineColor=x(A.line,1,S),r.scatterAngle=0}"textposition"in e&&(r.textOffset=a(e.textposition),r.textColor=x(e.textfont,1,S),r.textSize=u(e.textfont.size,S,y.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var P=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;3>n;++n){var R=e.projection[P[n]];(r.project[n]=R.show)&&(r.projectOpacity[n]=R.opacity,r.projectScale[n]=R.scale)}r.errorBounds=M(e,g);var N=o([e.error_x,e.error_y,e.error_z]);return r.errorColor=N.color,r.errorLineWidth=N.lineWidth,r.errorCapSize=N.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=b(e.surfacecolor),r}function f(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function h(t,e){var r=new n(t,e.uid);return r.update(e),r}var d=t("gl-line3d"),p=t("gl-scatter3d"),g=t("gl-error3d"),v=t("gl-mesh3d"),m=t("delaunay-triangulate"),y=t("../../lib"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../scatter/make_bubble_size_func"),w=t("../../constants/gl3d_dashes"),A=t("../../constants/gl_markers"),M=t("./calc_errors"),k=n.prototype;k.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},k.update=function(t){var e,r,n,o,a=this.scene.glplot.gl,s=w.solid;this.data=t;var l=c(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in w&&(s=w[l.lineDashes]),this.color=f(l.scatterColor)||f(l.lineColor),this.dataPoints=l.position,e={gl:a,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=d(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var u=t.opacity;if(t.marker&&t.marker.opacity&&(u*=t.marker.opacity),r={gl:a,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=p(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),o={gl:a,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(o):(this.textMarkers=p(o),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=g(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var h=i(l.position,l.delaunayColor,l.delaunayAxis);h.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(h):(h.gl=a,this.delaunayMesh=v(h),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=h},{"../../constants/gl3d_dashes":331,"../../constants/gl_markers":332,"../../lib":342,"../../lib/gl_format_color":340,"../../lib/str2rgbarray":354,"../scatter/make_bubble_size_func":433,"./calc_errors":443,"delaunay-triangulate":101,"gl-error3d":106,"gl-line3d":110,"gl-mesh3d":133,"gl-scatter3d":162}],445:[function(t,e,r){"use strict";function n(t,e,r){var n=0,i=r("x"),o=r("y"),a=r("z");return i&&o&&a&&(n=Math.min(i.length,o.length,a.length),n<i.length&&(e.x=i.slice(0,n)),n<o.length&&(e.y=o.slice(0,n)),n<a.length&&(e.z=a.slice(0,n))),n}var i=t("../../lib"),o=t("../scatter/subtypes"),a=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),u=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,f){function h(r,n){return i.coerce(t,e,c,r,n)}var d=n(t,e,h);if(!d)return void(e.visible=!1);h("text"),h("mode"),o.hasLines(e)&&(h("connectgaps"),s(t,e,r,f,h)),o.hasMarkers(e)&&a(t,e,r,f,h),o.hasText(e)&&l(t,e,f,h);var p=(e.line||{}).color,g=(e.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",p||g);for(var v=["x","y","z"],m=0;3>m;++m){var y="projection."+v[m];h(y+".show")&&(h(y+".opacity"),h(y+".scale"))}u(t,e,r,{axis:"z"}),u(t,e,r,{axis:"y",inherit:"z"}),u(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":295,"../../lib":342,"../scatter/line_defaults":430,"../scatter/marker_defaults":434,"../scatter/subtypes":438,"../scatter/text_defaults":439,"./attributes":441}],446:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl_markers":332,"../../plots/gl3d":385,"../scatter/colorbar":422,"./attributes":441,"./calc":442,"./convert":444,"./defaults":445}],447:[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:o.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:o.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var o=t("../../components/color"),a=t("../../components/colorscale/attributes"),s=t("../../lib/extend").extendFlat;e.exports={z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:a.zauto,cmin:a.zmin,cmax:a.zmax,colorscale:a.colorscale,autocolorscale:s({},a.autocolorscale,{dflt:!1}),reversescale:a.reversescale,showscale:a.showscale,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},_nestedModules:{colorbar:"Colorbar"},_deprecated:{zauto:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})}}},{"../../components/color":267,"../../components/colorscale/attributes":273,"../../lib/extend":339}],448:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":274}],449:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=t("../../lib"),a=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,u="cb"+r.uid,c=s(r.colorscale),f=r.cmin,h=r.cmax,d=r.surfacecolor||r.z;if(i(f)||(f=o.aggNums(Math.min,null,d)),i(h)||(h=o.aggNums(Math.max,null,d)),t._fullLayout._infolayer.selectAll("."+u).remove(),!r.showscale)return void a.autoMargin(t,u);var p=e[0].t.cb=l(t,u);p.fillcolor(n.scale.linear().domain(c.map(function(t){return f+t[0]*(h-f)})).range(c.map(function(t){return t[1]}))).filllevels({start:f,end:h,size:(h-f)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":270,"../../components/colorscale/get_scale":279,"../../lib":342,"../../plots/plots":398,d3:100,"fast-isnumeric":104}],450:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=d(t[1]),i=n.toRgb();return{index:r,rgb:[i.r,i.g,i.b,e]}})}function o(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=u(new Float32Array(r[0]*r[1]),r);return h.assign(n.lo(1,1).hi(e[0],e[1]),t),h.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),h.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),h.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),h.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}function a(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(g>e){for(var r=g/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],a=0;a<t.length;++a){var s=o(t[a]),l=u(new Float32Array(i),n);c(l,s,[r,0,0,0,r,0,0,0,1]),t[a]=l}return r}return 1}function s(t,e){var r=t.glplot.gl,i=l({
gl:r}),o=new n(t,i,e.uid);return o.update(e),t.glplot.add(i),o}var l=t("gl-surface3d"),u=t("ndarray"),c=t("ndarray-homography"),f=t("ndarray-fill"),h=t("ndarray-ops"),d=t("tinycolor2"),p=t("../../lib/str2rgbarray"),g=128,v=n.prototype;v.handlePick=function(t){if(t.object===this.surface){var e=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0])*this.scene.dataScale[0],n.yaxis.d2l(r[1])*this.scene.dataScale[1],n.zaxis.d2l(r[2])*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},v.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;3>r;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},v.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,o=this.surface,s=t.opacity,l=i(t.colorscale,s),c=t.z,h=t.x,d=t.y,g=n.xaxis,v=n.yaxis,m=n.zaxis,y=r.dataScale,b=c[0].length,x=c.length,_=[u(new Float32Array(b*x),[b,x]),u(new Float32Array(b*x),[b,x]),u(new Float32Array(b*x),[b,x])],w=_[0],A=_[1],M=r.contourLevels;this.data=t,f(_[2],function(t,e){return m.d2l(c[e][t])*y[2]}),Array.isArray(h[0])?f(w,function(t,e){return g.d2l(h[e][t])*y[0]}):f(w,function(t){return g.d2l(h[t])*y[0]}),Array.isArray(d[0])?f(A,function(t,e){return v.d2l(d[e][t])*y[1]}):f(A,function(t,e){return v.d2l(d[e])*y[1]});var k={colormap:l,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1};if(k.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var T=u(new Float32Array(b*x),[b,x]);f(T,function(e,r){return t.surfacecolor[r][e]}),_.push(T)}else k.intensityBounds[0]*=y[2],k.intensityBounds[1]*=y[2];this.dataScale=a(_),t.surfacecolor&&(k.intensity=_.pop()),"opacity"in t&&t.opacity<1&&(k.opacity=.25*t.opacity);var E=[!0,!0,!0],L=["x","y","z"];for(e=0;3>e;++e){var S=t.contours[L[e]];E[e]=S.highlight,k.showContour[e]=S.show||S.highlight,k.showContour[e]&&(k.contourProject[e]=[S.project.x,S.project.y,S.project.z],S.show?(this.showContour[e]=!0,k.levels[e]=M[e],o.highlightColor[e]=k.contourColor[e]=p(S.color),S.usecolormap?o.highlightTint[e]=k.contourTint[e]=0:o.highlightTint[e]=k.contourTint[e]=1,k.contourWidth[e]=S.width):this.showContour[e]=!1,S.highlight&&(k.dynamicColor[e]=p(S.highlightcolor),k.dynamicWidth[e]=S.highlightwidth))}k.coords=_,o.update(k),o.visible=t.visible,o.enableDynamic=E,o.snapToData=!0,"lighting"in t&&(o.ambientLight=t.lighting.ambient,o.diffuseLight=t.lighting.diffuse,o.specularLight=t.lighting.specular,o.roughness=t.lighting.roughness,o.fresnel=t.lighting.fresnel),"lightposition"in t&&(o.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),s&&1>s&&(o.supportsTransparency=!0)},v.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=s},{"../../lib/str2rgbarray":354,"gl-surface3d":187,ndarray:219,"ndarray-fill":212,"ndarray-homography":217,"ndarray-ops":218,tinycolor2:239}],451:[function(t,e,r){"use strict";function n(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}var i=t("../../lib"),o=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,a,r,n)}var u,c,f=l("z");if(!f)return void(e.visible=!1);var h=f[0].length,d=f.length;if(l("x"),l("y"),!Array.isArray(e.x))for(e.x=[],u=0;h>u;++u)e.x[u]=u;if(l("text"),!Array.isArray(e.y))for(e.y=[],u=0;d>u;++u)e.y[u]=u;["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","opacity"].forEach(function(t){l(t)});var p=l("surfacecolor");l("colorscale");var g=["x","y","z"];for(u=0;3>u;++u){var v="contours."+g[u],m=l(v+".show"),y=l(v+".highlight");if(m||y)for(c=0;3>c;++c)l(v+".project."+g[c]);m&&(l(v+".color"),l(v+".width"),l(v+".usecolormap")),y&&(l(v+".highlightcolor"),l(v+".highlightwidth"))}p||(n(t,"zmin","cmin"),n(t,"zmax","cmax"),n(t,"zauto","cauto")),o(t,e,s,l,{prefix:"",cLetter:"c"})}},{"../../components/colorscale/defaults":277,"../../lib":342,"./attributes":447}],452:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("./colorbar"),n.calc=t("./calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="surface",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","noOpacity"],n.meta={},e.exports=n},{"../../plots/gl3d":385,"./attributes":447,"./calc":448,"./colorbar":449,"./convert":450,"./defaults":451}]},{},[4])(4)});