From 427b6532b39ad34ed7da366884f858cabad3ee4f Mon Sep 17 00:00:00 2001 From: h-mayorquin Date: Tue, 30 Apr 2024 14:25:41 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20SpikeInt?= =?UTF-8?q?erface/hybrid=5Ftemplate=5Flibrary@a608a9e812589a7f93ec33c11189?= =?UTF-8?q?7a53b1986ff5=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset-manifest.json | 6 +++--- index.html | 2 +- static/js/{main.53e6c926.js => main.50676219.js} | 6 +++--- ...53e6c926.js.LICENSE.txt => main.50676219.js.LICENSE.txt} | 0 static/js/{main.53e6c926.js.map => main.50676219.js.map} | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename static/js/{main.53e6c926.js => main.50676219.js} (99%) rename static/js/{main.53e6c926.js.LICENSE.txt => main.50676219.js.LICENSE.txt} (100%) rename static/js/{main.53e6c926.js.map => main.50676219.js.map} (99%) diff --git a/asset-manifest.json b/asset-manifest.json index e056942..36a292f 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/hybrid_template_library/static/css/main.64a8db64.css", - "main.js": "/hybrid_template_library/static/js/main.53e6c926.js", + "main.js": "/hybrid_template_library/static/js/main.50676219.js", "static/js/329.fc20faf8.chunk.js": "/hybrid_template_library/static/js/329.fc20faf8.chunk.js", "static/js/466.df7a3c82.chunk.js": "/hybrid_template_library/static/js/466.df7a3c82.chunk.js", "static/js/74.bbaa2beb.chunk.js": "/hybrid_template_library/static/js/74.bbaa2beb.chunk.js", @@ -11,7 +11,7 @@ "static/js/336.781877ec.chunk.js": "/hybrid_template_library/static/js/336.781877ec.chunk.js", "index.html": "/hybrid_template_library/index.html", "main.64a8db64.css.map": "/hybrid_template_library/static/css/main.64a8db64.css.map", - "main.53e6c926.js.map": "/hybrid_template_library/static/js/main.53e6c926.js.map", + "main.50676219.js.map": "/hybrid_template_library/static/js/main.50676219.js.map", "329.fc20faf8.chunk.js.map": "/hybrid_template_library/static/js/329.fc20faf8.chunk.js.map", "466.df7a3c82.chunk.js.map": "/hybrid_template_library/static/js/466.df7a3c82.chunk.js.map", "74.bbaa2beb.chunk.js.map": "/hybrid_template_library/static/js/74.bbaa2beb.chunk.js.map", @@ -22,6 +22,6 @@ }, "entrypoints": [ "static/css/main.64a8db64.css", - "static/js/main.53e6c926.js" + "static/js/main.50676219.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 513688f..d0e72a0 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Visualization of Templates Data Base
\ No newline at end of file +Visualization of Templates Data Base
\ No newline at end of file diff --git a/static/js/main.53e6c926.js b/static/js/main.50676219.js similarity index 99% rename from static/js/main.53e6c926.js rename to static/js/main.50676219.js index 901855c..2514c72 100644 --- a/static/js/main.53e6c926.js +++ b/static/js/main.50676219.js @@ -1,3 +1,3 @@ -/*! For license information please see main.53e6c926.js.LICENSE.txt */ -(()=>{var e={1850:(e,t)=>{"use strict";t.q=function(e){var t,n=[],a=String(e||i),o=a.indexOf(r),s=0,l=!1;for(;!l;)-1===o&&(o=a.length,l=!0),!(t=a.slice(s,o).trim())&&l||n.push(t),s=o+1,o=a.indexOf(r,s);return n};var r=",",n=" ",i=""},2945:e=>{"use strict";e.exports=function(e,r){var n,i,a,o=e||"",s=r||"div",l={},A=0;for(;A{"use strict";var n=r(4851),i=r(4141),a=r(2945),o=r(5317).q,s=r(1850).q;e.exports=function(e,t,r){var i=r?function(e){var t,r=e.length,n=-1,i={};for(;++n{"use strict";var n=r(4509),i=r(5777)(n,"div");i.displayName="html",e.exports=i},7291:(e,t,r)=>{"use strict";e.exports=r(5990)},3565:e=>{"use strict";e.exports=function(e){var t="string"===typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}},9729:(e,t,r)=>{"use strict";var n=r(3565),i=r(978);e.exports=function(e){return n(e)||i(e)}},978:e=>{"use strict";e.exports=function(e){var t="string"===typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}},1174:e=>{"use strict";e.exports=function(e){var t="string"===typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}},6909:e=>{"use strict";var t;e.exports=function(e){var r,n="&"+e+";";if((t=t||document.createElement("i")).innerHTML=n,59===(r=t.textContent).charCodeAt(r.length-1)&&"semi"!==e)return!1;return r!==n&&r}},4433:(e,t,r)=>{"use strict";var n=r(2719),i=r(1257),a=r(978),o=r(1174),s=r(9729),l=r(6909);e.exports=function(e,t){var r,a,o={};t||(t={});for(a in g)r=t[a],o[a]=null===r||void 0===r?g[a]:r;(o.position.indent||o.position.start)&&(o.indent=o.position.indent||[],o.position=o.position.start);return function(e,t){var r,a,o,g,G,U,z,q,H,Y,J,K,j,V,W,Z,X,$,ee,te=t.additional,re=t.nonTerminated,ne=t.text,ie=t.reference,ae=t.warning,oe=t.textContext,se=t.referenceContext,le=t.warningContext,Ae=t.position,ce=t.indent||[],ue=e.length,ge=0,fe=-1,he=Ae.column||1,de=Ae.line||1,pe="",ye=[];"string"===typeof te&&(te=te.charCodeAt(0));Z=me(),q=ae?Ie:u,ge--,ue++;for(;++ge65535&&(Y+=c((U-=65536)>>>10|55296),U=56320|1023&U),U=Y+c(U))):V!==x&&q(M,$)),U?(ve(),Z=me(),ge=ee-1,he+=ee-j+1,ye.push(U),(X=me()).offset++,ie&&ie.call(se,U,{start:Z,end:X},e.slice(j-1,ee)),Z=X):(g=e.slice(j-1,ee),pe+=g,he+=g.length,ge=ee-1)}else 10===G&&(de++,fe++,he=0),G===G?(pe+=c(G),he++):ve();return ye.join("");function me(){return{line:de,column:he,offset:ge+(Ae.offset||0)}}function Ie(e,t){var r=me();r.column+=t,r.offset+=t,ae.call(le,F[e],r,e)}function ve(){pe&&(ye.push(pe),ne&&ne.call(oe,pe,{start:Z,end:me()}),pe="")}}(e,o)};var A={}.hasOwnProperty,c=String.fromCharCode,u=Function.prototype,g={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},f=9,h=10,d=12,p=32,y=38,m=59,I=60,v=61,E=35,C=88,B=120,b=65533,x="named",w="hexadecimal",Q="decimal",_={};_[w]=16,_[Q]=10;var S={};S[x]=s,S[Q]=a,S[w]=o;var k=1,D=2,T=3,M=4,R=5,L=6,N=7,F={};function O(e){return e>=55296&&e<=57343||e>1114111}function P(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||65535===(65535&e)||65534===(65535&e)}F[k]="Named character references must be terminated by a semicolon",F[D]="Numeric character references must be terminated by a semicolon",F[T]="Named character references cannot be empty",F[M]="Numeric character references cannot be empty",F[R]="Named character references must be known",F[L]="Numeric character references cannot be disallowed",F[N]="Numeric character references cannot be outside the permissible Unicode range"},4406:e=>{var t;self,t=function(){return function(){var e={79288:function(e,t,r){"use strict";var n=r(3400),i={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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 a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},86712:function(e,t,r){"use strict";e.exports=r(84224)},37240:function(e,t,r){"use strict";e.exports=r(51132)},29744:function(e,t,r){"use strict";e.exports=r(94456)},29352:function(e,t,r){"use strict";e.exports=r(67244)},96144:function(e,t,r){"use strict";e.exports=r(97776)},53219:function(e,t,r){"use strict";e.exports=r(61712)},4624:function(e,t,r){"use strict";e.exports=r(95856)},54543:function(e,t,r){"use strict";e.exports=r(54272)},45e3:function(e,t,r){"use strict";e.exports=r(85404)},62300:function(e,t,r){"use strict";e.exports=r(26048)},6920:function(e,t,r){"use strict";e.exports=r(66240)},10264:function(e,t,r){"use strict";e.exports=r(40448)},32016:function(e,t,r){"use strict";e.exports=r(64884)},27528:function(e,t,r){"use strict";e.exports=r(15088)},75556:function(e,t,r){"use strict";e.exports=r(76744)},39204:function(e,t,r){"use strict";e.exports=r(94704)},73996:function(e,t,r){"use strict";e.exports=r(62396)},16489:function(e,t,r){"use strict";e.exports=r(32028)},5e3:function(e,t,r){"use strict";e.exports=r(81932)},77280:function(e,t,r){"use strict";e.exports=r(45536)},33992:function(e,t,r){"use strict";e.exports=r(42600)},17600:function(e,t,r){"use strict";e.exports=r(21536)},49116:function(e,t,r){"use strict";e.exports=r(65664)},46808:function(e,t,r){"use strict";e.exports=r(29044)},36168:function(e,t,r){"use strict";e.exports=r(48928)},13792:function(e,t,r){"use strict";var n=r(32016);n.register([r(37240),r(29352),r(5e3),r(33992),r(17600),r(49116),r(6920),r(67484),r(79440),r(39204),r(83096),r(36168),r(20260),r(63560),r(65832),r(46808),r(73996),r(48824),r(89904),r(25120),r(13752),r(4340),r(62300),r(29800),r(8363),r(54543),r(86636),r(42192),r(32140),r(77280),r(89296),r(56816),r(70192),r(45e3),r(27528),r(84764),r(3920),r(50248),r(4624),r(69967),r(10264),r(86152),r(53219),r(81604),r(63796),r(29744),r(89336),r(86712),r(75556),r(16489),r(97312),r(96144)]),e.exports=n},3920:function(e,t,r){"use strict";e.exports=r(43480)},25120:function(e,t,r){"use strict";e.exports=r(6296)},4340:function(e,t,r){"use strict";e.exports=r(7404)},86152:function(e,t,r){"use strict";e.exports=r(65456)},56816:function(e,t,r){"use strict";e.exports=r(22020)},89296:function(e,t,r){"use strict";e.exports=r(29928)},20260:function(e,t,r){"use strict";e.exports=r(75792)},32140:function(e,t,r){"use strict";e.exports=r(156)},84764:function(e,t,r){"use strict";e.exports=r(45499)},48824:function(e,t,r){"use strict";e.exports=r(3296)},69967:function(e,t,r){"use strict";e.exports=r(4184)},8363:function(e,t,r){"use strict";e.exports=r(36952)},86636:function(e,t,r){"use strict";e.exports=r(38983)},70192:function(e,t,r){"use strict";e.exports=r(11572)},81604:function(e,t,r){"use strict";e.exports=r(76924)},63796:function(e,t,r){"use strict";e.exports=r(62944)},89336:function(e,t,r){"use strict";e.exports=r(95443)},67484:function(e,t,r){"use strict";e.exports=r(34864)},97312:function(e,t,r){"use strict";e.exports=r(76272)},42192:function(e,t,r){"use strict";e.exports=r(97924)},29800:function(e,t,r){"use strict";e.exports=r(15436)},63560:function(e,t,r){"use strict";e.exports=r(5621)},89904:function(e,t,r){"use strict";e.exports=r(91304)},50248:function(e,t,r){"use strict";e.exports=r(41724)},65832:function(e,t,r){"use strict";e.exports=r(31991)},79440:function(e,t,r){"use strict";e.exports=r(22869)},13752:function(e,t,r){"use strict";e.exports=r(67776)},83096:function(e,t,r){"use strict";e.exports=r(95952)},72196:function(e){"use strict";e.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},13916:function(e,t,r){"use strict";var n=r(72196),i=r(25376),a=r(33816),o=r(31780).templatedArray;r(36208),e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},90272:function(e,t,r){"use strict";var n=r(3400),i=r(54460),a=r(23816).draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=i.getFromId(e,t.xref),n=i.getFromId(e,t.yref),a=i.getRefType(t.xref),o=i.getRefType(t.yref);t._extremes={},"range"===a&&s(t,r),"range"===o&&s(t,n)}))}function s(e,t){var r,n=t._id,a=n.charAt(0),o=e[a],s=e["a"+a],l=e[a+"ref"],A=e["a"+a+"ref"],c=e["_"+a+"padplus"],u=e["_"+a+"padminus"],g={x:1,y:-1}[a]*e[a+"shift"],f=3*e.arrowsize*e.arrowwidth||0,h=f+g,d=f-g,p=3*e.startarrowsize*e.arrowwidth||0,y=p+g,m=p-g;if(A===l){var I=i.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:d}),v=i.findExtremes(t,[t.r2c(s)],{ppadplus:Math.max(c,y),ppadminus:Math.max(u,m)});r={min:[I.min[0],v.min[0]],max:[I.max[0],v.max[0]]}}else y=s?y+s:y,m=s?m-s:m,r=i.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(c,h,y),ppadminus:Math.max(u,d,m)});e._extremes[n]=r}e.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([a,o],e)}},42300:function(e,t,r){"use strict";var n=r(3400),i=r(24040),a=r(31780).arrayEditor;function o(e,t){var r,n,i,a,o,l,A,c=e._fullLayout.annotations,u=[],g=[],f=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,s,l=o(e,t),A=l.on,c=l.off.concat(l.explicitOff),u={},g=e._fullLayout.annotations;if(A.length||c.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var K=!1,j=["x","y"],V=0;V1)&&(ne===re?((fe=ie.r2fraction(t["a"+te]))<0||fe>1)&&(K=!0):K=!0),W=ie._offset+ie.r2p(t[te]),$=.5}else{var he="domain"===ge;"x"===te?(X=t[te],W=he?ie._offset+ie._length*X:W=B.l+B.w*X):(X=1-t[te],W=he?ie._offset+ie._length*X:W=B.t+B.h*X),$=t.showarrow?.5:X}if(t.showarrow){ue.head=W;var de=t["a"+te];if(ee=oe*H(.5,t.xanchor)-se*H(.5,t.yanchor),ne===re){var pe=l.getRefType(ne);"domain"===pe?("y"===te&&(de=1-de),ue.tail=ie._offset+ie._length*de):"paper"===pe?"y"===te?(de=1-de,ue.tail=B.t+B.h*de):ue.tail=B.l+B.w*de:ue.tail=ie._offset+ie.r2p(de),Z=ee}else ue.tail=W+de,Z=ee+de;ue.text=ue.tail+ee;var ye=C["x"===te?"width":"height"];if("paper"===re&&(ue.head=o.constrain(ue.head,1,ye-1)),"pixel"===ne){var me=-Math.max(ue.tail-3,ue.text),Ie=Math.min(ue.tail+3,ue.text)-ye;me>0?(ue.tail+=me,ue.text+=me):Ie>0&&(ue.tail-=Ie,ue.text-=Ie)}ue.tail+=ce,ue.head+=ce}else Z=ee=le*H($,Ae),ue.text=W+ee;ue.text+=ce,ee+=ce,Z+=ce,t["_"+te+"padplus"]=le/2+Z,t["_"+te+"padminus"]=le/2-Z,t["_"+te+"size"]=le,t["_"+te+"shift"]=ee}if(K)N.remove();else{var ve=0,Ee=0;if("left"!==t.align&&(ve=(x-v)*("center"===t.align?.5:1)),"top"!==t.valign&&(Ee=(L-E)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:P+ve-1,y:P+Ee}).call(c.setClipUrl,U?S:null,e);else{var Ce=P+Ee-d.top,Be=P+ve-d.left;Y.call(g.positionText,Be,Ce).call(c.setClipUrl,U?S:null,e)}z.select("rect").call(c.setRect,P,P,x,L),G.call(c.setRect,F/2,F/2,O-F,q-F),N.call(c.setTranslate,Math.round(k.x.text-O/2),Math.round(k.y.text-q/2)),M.attr({transform:"rotate("+D+","+k.x.text+","+k.y.text+")"});var be,xe=function(r,n){T.selectAll(".annotation-arrow-g").remove();var l=k.x.head,u=k.y.head,g=k.x.tail+r,f=k.y.tail+n,d=k.x.text+r,v=k.y.text+n,E=o.rotationXYMatrix(D,d,v),C=o.apply2DTransform(E),x=o.apply2DTransform2(E),S=+G.attr("width"),R=+G.attr("height"),L=d-.5*S,F=L+S,O=v-.5*R,P=O+R,U=[[L,O,L,P],[L,P,F,P],[F,P,F,O],[F,O,L,O]].map(x);if(!U.reduce((function(e,t){return e^!!o.segmentsIntersect(l,u,l+1e6,u+1e6,t[0],t[1],t[2],t[3])}),!1)){U.forEach((function(e){var t=o.segmentsIntersect(g,f,l,u,e[0],e[1],e[2],e[3]);t&&(g=t.x,f=t.y)}));var z=t.arrowwidth,q=t.arrowcolor,H=t.arrowside,Y=T.append("g").style({opacity:A.opacity(q)}).classed("annotation-arrow-g",!0),J=Y.append("path").attr("d","M"+g+","+f+"L"+l+","+u).style("stroke-width",z+"px").call(A.stroke,A.rgb(q));if(p(J,H,t),b.annotationPosition&&J.node().parentNode&&!a){var K=l,j=u;if(t.standoff){var V=Math.sqrt(Math.pow(l-g,2)+Math.pow(u-f,2));K+=t.standoff*(g-l)/V,j+=t.standoff*(f-u)/V}var W,Z,X=Y.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(g-K)+","+(f-j),transform:s(K,j)}).style("stroke-width",z+6+"px").call(A.stroke,"rgba(0,0,0,0)").call(A.fill,"rgba(0,0,0,0)");h.init({element:X.node(),gd:e,prepFn:function(){var e=c.getTranslate(N);W=e.x,Z=e.y,y&&y.autorange&&w(y._name+".autorange",!0),I&&I.autorange&&w(I._name+".autorange",!0)},moveFn:function(e,r){var n=C(W,Z),i=n[0]+e,a=n[1]+r;N.call(c.setTranslate,i,a),Q("x",m(y,e,"x",B,t)),Q("y",m(I,r,"y",B,t)),t.axref===t.xref&&Q("ax",m(y,e,"ax",B,t)),t.ayref===t.yref&&Q("ay",m(I,r,"ay",B,t)),Y.attr("transform",s(e,r)),M.attr({transform:"rotate("+D+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",e,_());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};t.showarrow&&xe(0,0),R&&h.init({element:N.node(),gd:e,prepFn:function(){be=M.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?Q("ax",m(y,e,"ax",B,t)):Q("ax",t.ax+e),t.ayref===t.yref?Q("ay",m(I,r,"ay",B.w,t)):Q("ay",t.ay+r),xe(e,r);else{if(a)return;var i,o;if(y)i=m(y,e,"x",B,t);else{var l=t._xsize/B.w,A=t.x+(t._xshift-t.xshift)/B.w-l/2;i=h.align(A+e/B.w,l,0,1,t.xanchor)}if(I)o=m(I,r,"y",B,t);else{var c=t._ysize/B.h,u=t.y-(t._yshift+t.yshift)/B.h-c/2;o=h.align(u-r/B.h,c,0,1,t.yanchor)}Q("x",i),Q("y",o),y&&I||(n=h.getCursor(y?.5:i,I?.5:o,t.xanchor,t.yanchor))}M.attr({transform:s(e,r)+be}),f(N,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",J(n))},doneFn:function(){f(N),i.call("_guiRelayout",e,_());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}e.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,I=t.indexOf("end")>=0,v=h.backoff*p+r.standoff,E=d.backoff*y+r.startstandoff;if("line"===f.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},c={x:+e.attr("x2"),y:+e.attr("y2")};var C=o.x-c.x,B=o.y-c.y;if(g=(u=Math.atan2(B,C))+Math.PI,v&&E&&v+E>Math.sqrt(C*C+B*B))return void R();if(v){if(v*v>C*C+B*B)return void R();var b=v*Math.cos(u),x=v*Math.sin(u);c.x+=b,c.y+=x,e.attr({x2:c.x,y2:c.y})}if(E){if(E*E>C*C+B*B)return void R();var w=E*Math.cos(u),Q=E*Math.sin(u);o.x-=w,o.y-=Q,e.attr({x1:o.x,y1:o.y})}}else if("path"===f.nodeName){var _=f.getTotalLength(),S="";if(_1){A=!0;break}}A?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+s+'"]').remove():(l._pdata=i(e.glplot.cameraParams,[t.xaxis.r2l(l.x)*r[0],t.yaxis.r2l(l.y)*r[1],t.zaxis.r2l(l.z)*r[2]]),n(e.graphDiv,l,s,e.id,l._xa,l._ya))}}},56864:function(e,t,r){"use strict";var n=r(24040),i=r(3400);e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:r(45899)}}},layoutAttributes:r(45899),handleDefaults:r(52808),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(r)for(var a=r.attrRegex,o=Object.keys(e),s=0;s=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var i=n(t||A).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.interpolate=function(e,t,r){var i=n(e).toRgb(),a=n(t).toRgb(),o={r:r*i.r+(1-r)*a.r,g:r*i.g+(1-r)*a.g,b:r*i.b+(1-r)*a.b};return n(o).toRgbString()},o.contrast=function(e,t,r){var i=n(e);return 1!==i.getAlpha()&&(i=n(o.combine(e,A))),(i.isDark()?t?i.lighten(t):A:r?i.darken(r):l).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"===typeof e){var t,r,n,i,s=Object.keys(e);for(t=0;t0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var fe=Math.pow(10,Math.floor(Math.log(ge)/Math.LN10));ce*=fe*A.roundUp(ge/fe,[2,5,10]),(Math.abs(J.start)/J.size+1e-6)%1<2e-6&&(le.tick0=0)}le.dtick=ce}le.domain=o?[oe+T/O.h,oe+$-T/O.h]:[oe+D/O.w,oe+$-D/O.w],le.setScale(),e.attr("transform",c(Math.round(O.l),Math.round(O.t)));var he,de=e.select("."+x.cbtitleunshift).attr("transform",c(-Math.round(O.l),-Math.round(O.t))),pe=le.ticklabelposition,ye=le.title.font.size,me=e.select("."+x.cbaxis),Ie=0,ve=0;function Ee(n,i){var a={propContainer:le,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:F._dfltTitle.colorbar,containerGroup:e.select("."+x.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),d.draw(r,n,u(a,i||{}))}function Ce(){var e,t;(o&&Ae||!o&&!Ae)&&("top"===z&&(e=D+O.l+ee*M,t=T+O.t+te*(1-oe-$)+3+.75*ye),"bottom"===z&&(e=D+O.l+ee*M,t=T+O.t+te*(1-oe)-3-.25*ye),"right"===z&&(t=T+O.t+te*R+3+.75*ye,e=D+O.l+ee*oe),Ee(le._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))}function Be(){if(o&&!Ae||!o&&Ae){var e,i,a=le.position||0,s=le._offset+le._length/2;if("right"===z)i=s,e=O.l+ee*a+10+ye*(le.showticklabels?1:.5);else if(e=s,"bottom"===z&&(i=O.t+te*a+10+(-1===pe.indexOf("inside")?le.tickfont.size:0)+("intside"!==le.ticks&&t.ticklen||0)),"top"===z){var l=U.text.split("
").length;i=O.t+te*a+10-W-C*ye*l}Ee((o?"h":"v")+le._id+"title",{avoid:{selection:n.select(r).selectAll("g."+le._id+"tick"),side:z,offsetTop:o?0:O.t,offsetLeft:o?O.l:0,maxShift:o?F.width:F.height},attributes:{x:e,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}}function be(){if(!o&&!Ae||o&&Ae){var a,l=e.select("."+x.cbtitle),u=l.select("text"),g=[-w/2,w/2],h=l.select(".h"+le._id+"title-math-group").node(),d=15.6;if(u.node()&&(d=parseInt(u.node().style.fontSize,10)*C),h?(a=f.bBox(h),ve=a.width,(Ie=a.height)>d&&(g[1]-=(Ie-d)/2)):u.node()&&!u.classed(x.jsPlaceholder)&&(a=f.bBox(u.node()),ve=a.width,Ie=a.height),o){if(Ie){if(Ie+=5,"top"===z)le.domain[1]-=Ie/O.h,g[1]*=-1;else{le.domain[0]+=Ie/O.h;var y=p.lineCount(u);g[1]+=(1-y)*d}l.attr("transform",c(g[0],g[1])),le.setScale()}}else ve&&("right"===z&&(le.domain[0]+=(ve+ye/2)/O.w),l.attr("transform",c(g[0],g[1])),le.setScale())}e.selectAll("."+x.cbfills+",."+x.cblines).attr("transform",o?c(0,Math.round(O.h*(1-le.domain[1]))):c(Math.round(O.w*le.domain[0]),0)),me.attr("transform",o?c(0,Math.round(-O.t)):c(Math.round(-O.l),0));var m=e.select("."+x.cbfills).selectAll("rect."+x.cbfill).attr("style","").data(j);m.enter().append("rect").classed(x.cbfill,!0).attr("style",""),m.exit().remove();var I=q.map(le.c2p).map(Math.round).sort((function(e,t){return e-t}));m.each((function(e,a){var s=[0===a?q[0]:(j[a]+j[a-1])/2,a===j.length-1?q[1]:(j[a]+j[a+1])/2].map(le.c2p).map(Math.round);o&&(s[1]=A.constrain(s[1]+(s[1]>s[0])?1:-1,I[0],I[1]));var l=n.select(this).attr(o?"x":"y",re).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(t._fillgradient)f.gradient(l,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var c=Y(e).replace("e-","");l.attr("fill",i(c).toHexString())}}));var v=e.select("."+x.cblines).selectAll("path."+x.cbline).data(G.color&&G.width?V:[]);v.enter().append("path").classed(x.cbline,!0),v.exit().remove(),v.each((function(e){var t=re,r=Math.round(le.c2p(e))+G.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+W).call(f.lineGroupStyle,G.width,H(e),G.dash)})),me.selectAll("g."+le._id+"tick,path").remove();var E=re+W+(w||0)/2-("outside"===t.ticks?1:0),B=s.calcTicks(le),b=s.getTickSigns(le)[2];return s.drawTicks(r,le,{vals:"inside"===le.ticks?s.clipEnds(le,B):B,layer:me,path:s.makeTickPath(le,E,b),transFn:s.makeTransTickFn(le)}),s.drawLabels(r,le,{vals:B,layer:me,transFn:s.makeTransTickLabelFn(le),labelFns:s.makeLabelFns(le,E)})}function xe(){var n,s=W+w/2;-1===pe.indexOf("inside")&&(n=f.bBox(me.node()),s+=o?n.width:n.height),he=de.select("text");var A=0,u=o&&"top"===z,d=!o&&"right"===z,p=0;if(he.node()&&!he.classed(x.jsPlaceholder)){var m,I=de.select(".h"+le._id+"title-math-group").node();I&&(o&&Ae||!o&&!Ae)?(A=(n=f.bBox(I)).width,m=n.height):(A=(n=f.bBox(de.node())).right-O.l-(o?re:se),m=n.bottom-O.t-(o?se:re),o||"top"!==z||(s+=n.height,p=n.height)),d&&(he.attr("transform",c(A/2+ye/2,0)),A*=2),s=Math.max(s,o?A:m)}var v=2*(o?D:T)+s+Q+w/2,C=0;!o&&U.text&&"bottom"===k&&R<=0&&(v+=C=v/2,p+=C),F._hColorbarMoveTitle=C,F._hColorbarMoveCBTitle=p;var P=Q+w,G=(o?re:se)-P/2-(o?D:0),q=(o?se:re)-(o?X:T+p-C);e.select("."+x.cbbg).attr("x",G).attr("y",q).attr(o?"width":"height",Math.max(v-C,2)).attr(o?"height":"width",Math.max(X+P,2)).call(h.fill,_).call(h.stroke,t.bordercolor).style("stroke-width",Q);var H=d?Math.max(A-10,0):0;e.selectAll("."+x.cboutline).attr("x",(o?re:se+D)+H).attr("y",(o?se+T-X:re)+(u?Ie:0)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(X-(o?2*T+Ie:2*D+H),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":w});var Y=o?ne*v:0,J=o?0:(1-ie)*v-p;if(Y=N?O.l-Y:-Y,J=L?O.t-J:-J,e.attr("transform",c(Y,J)),!o&&(Q||i(_).getAlpha()&&!i.equals(F.paper_bgcolor,_))){var K=me.selectAll("text"),j=K[0].length,V=e.select("."+x.cbbg).node(),Z=f.bBox(V),$=f.getTranslate(e),ee=2;K.each((function(e,t){var r=0,n=j-1;if(t===r||t===n){var i,a=f.bBox(this),o=f.getTranslate(this);if(t===n){var s=a.right+o.x;(i=Z.right+$.x+se-Q-ee+M-s)>0&&(i=0)}else if(t===r){var l=a.left+o.x;(i=Z.left+$.x+se+Q+ee-l)<0&&(i=0)}i&&(j<3?this.setAttribute("transform","translate("+i+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var te={},ae=B[S],oe=b[S],ce=B[k],ue=b[k],ge=v-W;o?("pixels"===g?(te.y=R,te.t=X*ce,te.b=X*ue):(te.t=te.b=0,te.yt=R+l*ce,te.yb=R-l*ue),"pixels"===E?(te.x=M,te.l=v*ae,te.r=v*oe):(te.l=ge*ae,te.r=ge*oe,te.xl=M-y*ae,te.xr=M+y*oe)):("pixels"===g?(te.x=M,te.l=X*ae,te.r=X*oe):(te.l=te.r=0,te.xl=M+l*ae,te.xr=M-l*oe),"pixels"===E?(te.y=1-R,te.t=v*ce,te.b=v*ue):(te.t=ge*ce,te.b=ge*ue,te.yt=R-y*ce,te.yb=R+y*ue));var fe=t.y<.5?"b":"t",ve=t.x<.5?"l":"r";r._fullLayout._reservedMargin[t._id]={};var Ee={r:F.width-G-Y,l:G+te.r,b:F.height-q-J,t:q+te.b};N&&L?a.autoMargin(r,t._id,te):N?r._fullLayout._reservedMargin[t._id][fe]=Ee[fe]:L||o?r._fullLayout._reservedMargin[t._id][ve]=Ee[ve]:r._fullLayout._reservedMargin[t._id][fe]=Ee[fe]}return A.syncOrAsync([a.previousPromises,Ce,be,Be,a.previousPromises,xe],r)}(r,t,e);y&&y.then&&(e._promises||[]).push(y),e._context.edits.colorbarPosition&&function(e,t,r){var n,i,a,s="v"===t.orientation,A=r._fullLayout,u=A._size;l.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),g(e)},moveFn:function(r,o){e.attr("transform",n+c(r,o)),i=l.align((s?t._uFrac:t._vFrac)+r/u.w,s?t._thickFrac:t._lenFrac,0,1,t.xanchor),a=l.align((s?t._vFrac:1-t._uFrac)-o/u.h,s?t._lenFrac:t._thickFrac,0,1,t.yanchor);var A=l.getCursor(i,a,t.xanchor,t.yanchor);g(e,A)},doneFn:function(){if(g(e),void 0!==i&&void 0!==a){var n={};n[t._propPrefix+"x"]=i,n[t._propPrefix+"y"]=a,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){a.autoMargin(e,t._id)})).remove(),t.order()}}},90553:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e){return n.isPlainObject(e.colorbar)}},55080:function(e,t,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:r(42996),supplyDefaults:r(64013),draw:r(37848).draw,hasColorbar:r(90553)}},49084:function(e,t,r){"use strict";var n=r(42996),i=r(53756).counter,a=r(95376),o=r(88304).scales;function s(e){return"`"+e+"`"}a(o),e.exports=function(e,t){e=e||"";var r,a=(t=t||{}).cLetter||"c",l=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),A="showScaleDflt"in t?t.showScaleDflt:"z"===a,c="string"===typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,u=t.editTypeOverride||"",g=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):s(g+(r={z:"z",c:"color"}[a]));var f=a+"auto",h=a+"min",d=a+"max",p=a+"mid",y=(s(g+f),s(g+h),s(g+d),{});y[h]=y[d]=void 0;var m={};m[f]=!1;var I={};return"color"===r&&(I.color={valType:"color",arrayOk:!0,editType:u||"style"},t.anim&&(I.color.anim=!0)),I[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},I[h]={valType:"number",dflt:null,editType:u||"plot",impliedEdits:m},I[d]={valType:"number",dflt:null,editType:u||"plot",impliedEdits:m},I[p]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},I.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},I.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},I.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(I.showscale={valType:"boolean",dflt:A,editType:"calc"},I.colorbar=n),t.noColorAxis||(I.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),I}},47128:function(e,t,r){"use strict";var n=r(38248),i=r(3400),a=r(94288).extractOpts;e.exports=function(e,t,r){var o,s=e._fullLayout,l=r.vals,A=r.containerStr,c=A?i.nestedProperty(t,A).get():t,u=a(c),g=!1!==u.auto,f=u.min,h=u.max,d=u.mid,p=function(){return i.aggNums(Math.min,null,l)},y=function(){return i.aggNums(Math.max,null,l)};void 0===f?f=p():g&&(f=c._colorAx&&n(f)?Math.min(f,p()):p()),void 0===h?h=y():g&&(h=c._colorAx&&n(h)?Math.max(h,y()):y()),g&&void 0!==d&&(h-d>d-f?f=d-(h-d):h-d=0?s.colorscale.sequential:s.colorscale.sequentialminus,u._sync("colorscale",o))}},95504:function(e,t,r){"use strict";var n=r(3400),i=r(94288).hasColorscale,a=r(94288).extractOpts;e.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,i){var o=i.container?n.nestedProperty(e,i.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=e[n];r[i]=[1-a[0],a[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,l=o.length,A=new Array(l),c=0;c4/3-s?o:s}},67416:function(e,t,r){"use strict";var n=r(3400),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(e,t,r,a){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*t),0,2),i[t][e]}},72760:function(e,t){"use strict";t.selectMode=function(e){return"lasso"===e||"select"===e},t.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},t.openMode=function(e){return"drawline"===e||"drawopenpath"===e},t.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},t.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},t.selectingOrDrawing=function(e){return t.freeMode(e)||t.rectMode(e)}},86476:function(e,t,r){"use strict";var n=r(29128),i=r(52264),a=r(89184),o=r(3400).removeElement,s=r(33816),l=e.exports={};l.align=r(78316),l.getCursor=r(67416);var A=r(2616);function c(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function u(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}l.unhover=A.wrapped,l.unhoverRaw=A.raw,l.init=function(e){var t,r,n,A,g,f,h,d,p=e.gd,y=1,m=p._context.doubleClickDelay,I=e.element;p._mouseDownTime||(p._mouseDownTime=0),I.style.pointerEvents="all",I.onmousedown=E,a?(I._ontouchstart&&I.removeEventListener("touchstart",I._ontouchstart),I._ontouchstart=E,I.addEventListener("touchstart",E,{passive:!1})):I.ontouchstart=E;var v=e.clampFn||function(e,t,r){return Math.abs(e)m&&(y=Math.max(y-1,1)),p._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(y,f),!d){var r;try{r=new MouseEvent("click",t)}catch(a){var n=u(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}p._dragging=!1,p._dragged=!1}else p._dragged=!1}},l.coverSlip=c},2616:function(e,t,r){"use strict";var n=r(95924),i=r(91200),a=r(52200).getGraphDiv,o=r(92456),s=e.exports={};s.wrapped=function(e,t,r){(e=a(e))._fullLayout&&i.clear(e._fullLayout._uid+o.HOVERID),s.raw(e,t,r)},s.raw=function(e,t){var r=e._fullLayout,i=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&i&&e.emit("plotly_unhover",{event:t,points:i}))}},98192:function(e,t){"use strict";t.u={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},t.c={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},43616:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=i.numberFormat,o=r(38248),s=r(49760),l=r(24040),A=r(76308),c=r(8932),u=i.strTranslate,g=r(72736),f=r(9616),h=r(84284).LINE_SPACING,d=r(13448).DESELECTDIM,p=r(43028),y=r(7152),m=r(10624).appendArrayPointValue,I=e.exports={};function v(e,t,r,n){var i=t.fillpattern,a=t.fillgradient,o=i&&I.getPatternAttr(i.shape,0,"");if(o){var s=I.getPatternAttr(i.bgcolor,0,null),l=I.getPatternAttr(i.fgcolor,0,null),c=i.fgopacity,u=I.getPatternAttr(i.size,0,8),g=I.getPatternAttr(i.solidity,0,.3),f=t.uid;I.pattern(e,"point",r,f,o,u,g,void 0,i.fillmode,s,l,c)}else if(a&&"none"!==a.type){var h,d,p=a.type,y="scatterfill-"+t.uid;n&&(y="legendfill-"+t.uid),n||void 0===a.start&&void 0===a.stop?("horizontal"===p&&(p+="reversed"),e.call(I.gradient,r,y,p,a.colorscale,"fill")):("horizontal"===p?(h={x:a.start,y:0},d={x:a.stop,y:0}):"vertical"===p&&(h={x:0,y:a.start},d={x:0,y:a.stop}),h.x=t._xA.c2p(void 0===h.x?t._extremes.x.min[0].val:h.x,!0),h.y=t._yA.c2p(void 0===h.y?t._extremes.y.min[0].val:h.y,!0),d.x=t._xA.c2p(void 0===d.x?t._extremes.x.max[0].val:d.x,!0),d.y=t._yA.c2p(void 0===d.y?t._extremes.y.max[0].val:d.y,!0),e.call(w,r,y,"linear",a.colorscale,"fill",h,d,!0,!1))}else t.fillcolor&&e.call(A.fill,t.fillcolor)}I.font=function(e,t,r,n,a,o,s){i.isPlainObject(t)&&(s=t.variant,o=t.style,a=t.weight,n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(A.fill,n),a&&e.style("font-weight",a),o&&e.style("font-style",o),s&&e.style("font-variant",s)},I.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},I.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},I.setRect=function(e,t,r,n,i){e.call(I.setPosition,t,r).call(I.setSize,n,i)},I.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),a=n.c2p(e.y);return!!(o(i)&&o(a)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",a):t.attr("transform",u(i,a)),!0)},I.translatePoints=function(e,t,r){e.each((function(e){var i=n.select(this);I.translatePoint(e,i,t,r)}))},I.hideOutsideRangePoint=function(e,t,r,n,i,a){t.attr("display",r.isPtWithinRange(e,i)&&n.isPtWithinRange(e,a)?null:"none")},I.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,i=t.yaxis;e.each((function(t){var a=t[0].trace,o=a.xcalendar,s=a.ycalendar,A=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";e.selectAll(A).each((function(e){I.hideOutsideRangePoint(e,n.select(this),r,i,o,s)}))}))}},I.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},I.singleLineStyle=function(e,t,r,n,i){t.style("fill","none");var a=(((e||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";A.stroke(t,n||a.color),I.dashLine(t,s,o)},I.lineGroupStyle=function(e,t,r,i){e.style("fill","none").each((function(e){var a=(((e||[])[0]||{}).trace||{}).line||{},o=t||a.width||0,s=i||a.dash||"";n.select(this).call(A.stroke,r||a.color).call(I.dashLine,s,o)}))},I.dashLine=function(e,t,r){r=+r||0,t=I.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},I.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},I.singleFillStyle=function(e,t){var r=n.select(e.node());v(e,((r.data()[0]||[])[0]||{}).trace||{},t,!1)},I.fillGroupStyle=function(e,t,r){e.style("stroke-width",0).each((function(e){var i=n.select(this);e[0].trace&&v(i,e[0].trace,t,r)}))};var E=r(71984);I.symbolNames=[],I.symbolFuncs=[],I.symbolBackOffs=[],I.symbolNeedLines={},I.symbolNoDot={},I.symbolNoFill={},I.symbolList=[],Object.keys(E).forEach((function(e){var t=E[e],r=t.n;I.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),I.symbolNames[r]=e,I.symbolFuncs[r]=t.f,I.symbolBackOffs[r]=t.backoff||0,t.needLine&&(I.symbolNeedLines[r]=!0),t.noDot?I.symbolNoDot[r]=!0:I.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(I.symbolNoFill[r]=!0)}));var C=I.symbolNames.length;function B(e,t,r,n){var i=e%100;return I.symbolFuncs[i](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}I.symbolNumber=function(e){if(o(e))e=+e;else if("string"===typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=I.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=C||e>=400?0:Math.floor(Math.max(e,0))};var b=a("~f"),x={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function w(e,t,r,a,o,l,c,u,g,f){var h,d=o.length;"linear"===a?h={node:"linearGradient",attrs:{x1:c.x,y1:c.y,x2:u.x,y2:u.y,gradientUnits:g?"userSpaceOnUse":"objectBoundingBox"},reversed:f}:"radial"===a&&(h={node:"radialGradient",reversed:f});for(var p=new Array(d),y=0;y=0&&void 0===e.i&&(e.i=o.i),t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?s.opacity:e.mo),n.ms2mrc){var c;c="various"===e.ms||"various"===s.size?3:n.ms2mrc(e.ms),e.mrc=c,n.selectedSizeFn&&(c=e.mrc=n.selectedSizeFn(e));var u=I.symbolNumber(e.mx||s.symbol)||0;e.om=u%200>=100;var g=te(e,r),f=H(e,r);t.attr("d",B(u,c,g,f))}var h,d,p,y=!1;if(e.so)p=l.outlierwidth,d=l.outliercolor,h=s.outliercolor;else{var m=(l||{}).width;p=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):i.isArrayOrTypedArray(l.color)?A.defaultLine:l.color,i.isArrayOrTypedArray(s.color)&&(h=A.defaultLine,y=!0),h="mc"in e?e.mcc=n.markerScale(e.mc):s.color||s.colors||"rgba(0,0,0,0)",n.selectedColorFn&&(h=n.selectedColorFn(e))}if(e.om)t.call(A.stroke,h).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=s.gradient,E=e.mgt;E?y=!0:E=v&&v.type,i.isArrayOrTypedArray(E)&&(E=E[0],x[E]||(E=0));var C=s.pattern,b=C&&I.getPatternAttr(C.shape,e.i,"");if(E&&"none"!==E){var w=e.mgc;w?y=!0:w=v.color;var Q=r.uid;y&&(Q+="-"+e.i),I.gradient(t,a,Q,E,[[0,w],[1,h]],"fill")}else if(b){var _=!1,S=C.fgcolor;!S&&o&&o.color&&(S=o.color,_=!0);var k=I.getPatternAttr(S,e.i,o&&o.color||null),D=I.getPatternAttr(C.bgcolor,e.i,null),T=C.fgopacity,M=I.getPatternAttr(C.size,e.i,8),R=I.getPatternAttr(C.solidity,e.i,.3);_=_||e.mcc||i.isArrayOrTypedArray(C.shape)||i.isArrayOrTypedArray(C.bgcolor)||i.isArrayOrTypedArray(C.fgcolor)||i.isArrayOrTypedArray(C.size)||i.isArrayOrTypedArray(C.solidity);var L=r.uid;_&&(L+="-"+e.i),I.pattern(t,"point",a,L,b,M,R,e.mcc,C.fillmode,D,k,T)}else i.isArrayOrTypedArray(h)?A.fill(t,h[e.i]):A.fill(t,h);p&&A.stroke(t,d)}},I.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=I.tryColorscale(r,""),t.lineScale=I.tryColorscale(r,"line"),l.traceIs(e,"symbols")&&(t.ms2mrc=p.isBubble(e)?y(e):function(){return(r.size||6)/2}),e.selectedpoints&&i.extendFlat(t,I.makeSelectedPointStyleFns(e)),t},I.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},o=r.marker||{},s=n.marker||{},A=a.opacity,c=o.opacity,u=s.opacity,g=void 0!==c,f=void 0!==u;(i.isArrayOrTypedArray(A)||g||f)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?g?c:t:f?u:d*t});var h=a.color,p=o.color,y=s.color;(p||y)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?p||t:y||t});var m=a.size,I=o.size,v=s.size,E=void 0!==I,C=void 0!==v;return l.traceIs(e,"symbols")&&(E||C)&&(t.selectedSizeFn=function(e){var t=e.mrc||m/2;return e.selected?E?I/2:t:C?v/2:t}),t},I.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,c=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?l||t:c||(l?t:A.addOpacity(t,d))},t},I.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=I.makeSelectedPointStyleFns(t),i=t.marker||{},a=[];r.selectedOpacityFn&&a.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&a.push((function(e,t){A.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&a.push((function(e,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);e.attr("d",B(I.symbolNumber(a),o,te(n,t),H(n,t))),n.mrc2=o})),a.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}function T(e,t,r){return r&&(e=O(e)),t?R(e[1]):M(e[0])}function M(e){var t=n.round(e,2);return Q=t,t}function R(e){var t=n.round(e,2);return _=t,t}function L(e,t,r,n){var i=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(i*i+a*a,.25),A=Math.pow(o*o+s*s,.25),c=(A*A*i-l*l*o)*n,u=(A*A*a-l*l*s)*n,g=3*A*(l+A),f=3*l*(l+A);return[[M(t[0]+(g&&c/g)),R(t[1]+(g&&u/g))],[M(t[0]-(f&&c/f)),R(t[1]-(f&&u/f))]]}I.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var o=I.makeSelectedTextStyleFns(t);a=o.selectedTextColorFn}var s=t.texttemplate,l=r._fullLayout;e.each((function(e){var o=n.select(this),A=s?i.extractOption(e,t,"txt","texttemplate"):i.extractOption(e,t,"tx","text");if(A||0===A){if(s){var c=t._module.formatLabels,u=c?c(e,t,l):{},f={};m(f,t,e.i);var h=t._meta||{};A=i.texttemplateString(A,u,l._d3locale,f,e,h)}var d=e.tp||t.textposition,p=D(e,t),y=a?a(e):e.tc||t.textfont.color;o.call(I.font,{family:e.tf||t.textfont.family,weight:e.tw||t.textfont.weight,style:e.ty||t.textfont.style,variant:e.tv||t.textfont.variant,size:p,color:y}).text(A).call(g.convertToTspans,r).call(k,d,p,e.mrc)}else o.remove()}))}},I.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=I.makeSelectedTextStyleFns(t);e.each((function(e){var i=n.select(this),a=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=D(e,t);A.fill(i,a);var c=l.traceIs(t,"bar-like");k(i,o,s,e.mrc2||e.mrc,c)}))}},I.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],i=[];for(r=1;r=A||C>=u&&C<=A)&&(B<=g&&B>=c||B>=g&&B<=c)&&(e=[C,B])}return e}I.steps=function(e){var t=N[e]||F;return function(e){for(var r="M"+M(e[0][0])+","+R(e[0][1]),n=e.length,i=1;i=1e4&&(I.savedBBoxes={},P=0),r&&(I.savedBBoxes[r]=p),P++,i.extendFlat({},p)},I.setClipUrl=function(e,t,r){e.attr("clip-path",U(t,r))},I.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},I.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=u(t,r)).trim(),e[i]("transform",a),a},I.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},I.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+t+","+r+")").trim(),e[i]("transform",a),a};var z=/\s*sc.*/;I.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(z,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var q=/translate\([^)]*\)\s*$/;function H(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}I.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(q);e=1===t&&1===r?[]:[u(o,s),"scale("+t+","+r+")",u(-o,-s)],l&&e.push(l),i.attr("transform",e.join(""))}}))},I.getMarkerStandoff=H;var Y,J,K,j,V,W,Z=Math.atan2,X=Math.cos,$=Math.sin;function ee(e,t){var r=t[0],n=t[1];return[r*X(e)-n*$(e),r*$(e)+n*X(e)]}function te(e,t){var r,n,a=e.ma;void 0===a&&((a=t.marker.angle)&&!i.isArrayOrTypedArray(a)||(a=0));var s=t.marker.angleref;if("previous"===s||"north"===s){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],n=l[1]}else{var A=t._xA,c=t._yA;if(!A||!c)return 90;r=A.c2p(e.x),n=c.c2p(e.y)}if(t._geo){var u,g=e.lonlat[0],f=e.lonlat[1],h=t._geo.project([g,f+1e-5]),d=t._geo.project([g+1e-5,f]),p=Z(d[1]-n,d[0]-r),y=Z(h[1]-n,h[0]-r);if("north"===s)u=a/180*Math.PI;else if("previous"===s){var m=g/180*Math.PI,I=f/180*Math.PI,v=Y/180*Math.PI,E=J/180*Math.PI,C=v-m,B=X(E)*$(C),b=$(E)*X(I)-X(E)*$(I)*X(C);u=-Z(B,b)-Math.PI,Y=g,J=f}var x=ee(p,[X(u),0]),w=ee(y,[$(u),0]);a=Z(x[1]+w[1],x[0]+w[0])/Math.PI*180,"previous"!==s||W===t.uid&&e.i===V+1||(a=null)}if("previous"===s&&!t._geo)if(W===t.uid&&e.i===V+1&&o(r)&&o(n)){var Q=r-K,_=n-j,S=t.line&&t.line.shape||"",k=S.slice(S.length-1);"h"===k&&(_=0),"v"===k&&(Q=0),a+=Z(_,Q)/Math.PI*180+90}else a=null}return K=r,j=n,V=e.i,W=t.uid,a}I.getMarkerAngle=te},71984:function(e,t,r){"use strict";var n,i,a,o,s=r(21984),l=r(33428).round,A="M0,0Z",c=Math.sqrt(2),u=Math.sqrt(3),g=Math.PI,f=Math.cos,h=Math.sin;function d(e){return null===e}function p(e,t,r){if((!e||e%360===0)&&!t)return r;if(a===e&&o===t&&n===r)return i;function l(e,r){var n=f(e),i=h(e),a=r[0],o=r[1]+(t||0);return[a*n-o*i,a*i+o*n]}a=e,o=t,n=r;for(var A=e/180*g,c=0,u=0,d=s(r),p="",y=0;y0,u=e._context.staticPlot;t.each((function(t){var g,f=t[0].trace,h=f.error_x||{},d=f.error_y||{};f.ids&&(g=function(e){return e.id});var p=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||h.visible||(t=[]);var y=n.select(this).selectAll("g.errorbar").data(t,g);if(y.exit().remove(),t.length){h.visible||y.selectAll("path.xerror").remove(),d.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var m=y.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(y,r.layerClipId,e),y.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};return void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0))),void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),i(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0))),n}(e,l,A);if(!p||e.vis){var a,o=t.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var g=d.width;a="M"+(r.x-g)+","+r.yh+"h"+2*g+"m-"+g+",0V"+r.ys,r.noYS||(a+="m-"+g+",0h"+2*g),o.size()?c&&(o=o.transition().duration(s.duration).ease(s.easing)):o=t.append("path").style("vector-effect",u?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var f=t.select("path.xerror");if(h.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var y=(h.copy_ystyle?d:h).width;a="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(a+="m0,-"+y+"v"+2*y),f.size()?c&&(f=f.transition().duration(s.duration).ease(s.easing)):f=t.append("path").style("vector-effect",u?"none":"non-scaling-stroke").classed("xerror",!0),f.attr("d",a)}else f.remove()}}))}}))}},92036:function(e,t,r){"use strict";var n=r(33428),i=r(76308);e.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},a=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},55756:function(e,t,r){"use strict";var n=r(25376),i=r(65460).hoverlabel,a=r(92880).extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},55056:function(e,t,r){"use strict";var n=r(3400),i=r(24040);function a(e,t,r,i){i=i||n.identity,Array.isArray(e)&&(t[0][r]=i(e))}e.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var s=0;s=0&&r.indexV[0]._length||ve<0||ve>W[0]._length)return d.unhoverRaw(e,t)}else Ie="xpx"in t?t.xpx:V[0]._length/2,ve="ypx"in t?t.ypx:W[0]._length/2;if(t.pointerX=Ie+V[0]._offset,t.pointerY=ve+W[0]._offset,re="xval"in t?m.flat(I,t.xval):m.p2c(V,Ie),ne="yval"in t?m.flat(I,t.yval):m.p2c(W,ve),!i(re[0])||!i(ne[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var be=1/0;function xe(r,n){for(ae=0;aehe&&(de.splice(0,he),be=de[0].distance),x&&0!==te&&0===de.length){fe.distance=te,fe.index=!1;var c=se._module.hoverPoints(fe,ue,ge,"closest",{hoverLayer:v._hoverlayer});if(c&&(c=c.filter((function(e){return e.spikeDistance<=te}))),c&&c.length){var u,g=c.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(g.length){var f=g[0];i(f.x0)&&i(f.y0)&&(u=Qe(f),(!ye.vLinePoint||ye.vLinePoint.spikeDistance>u.spikeDistance)&&(ye.vLinePoint=u))}var d=c.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(d.length){var p=d[0];i(p.x0)&&i(p.y0)&&(u=Qe(p),(!ye.hLinePoint||ye.hLinePoint.spikeDistance>u.spikeDistance)&&(ye.hLinePoint=u))}}}}}function we(e,t,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(e.distance)Oe-1;Pe--)qe(de[Pe]);de=Ge,De()}var He=e._hoverdata,Ye=[],Je=q(e),Ke=H(e);for(ie=0;ie1||de.length>1)||"closest"===w&&me&&de.length>1,ot=h.combine(v.plot_bgcolor||h.background,v.paper_bgcolor),st=R(de,{gd:e,hovermode:w,rotateLabels:at,bgColor:ot,container:v._hoverlayer,outerContainer:v._paper.node(),commonLabelOpts:v.hoverlabel,hoverdistance:v.hoverdistance}),lt=st.hoverLabels;if(m.isUnifiedHover(w)||(function(e,t,r,n){var i,a,o,s,l,A,c,u=t?"xa":"ya",g=t?"ya":"xa",f=0,h=1,d=e.size(),p=new Array(d),y=0,m=n.minX,I=n.maxX,v=n.minY,E=n.maxY,C=function(e){return e*r._invScaleX},B=function(e){return e*r._invScaleY};function x(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,o=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=o;i=!1}if(i){var n=0;for(s=0;st.pmax&&n++;for(s=e.length-1;s>=0&&!(n<=0);s--)(A=e[s]).pos>t.pmax-1&&(A.del=!0,n--);for(s=0;s=0;l--)e[l].dp-=o;for(s=e.length-1;s>=0&&!(n<=0);s--)(A=e[s]).pos+A.dp+A.size>t.pmax&&(A.del=!0,n--)}}}for(e.each((function(e){var n=e[u],i=e[g],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(h=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var A,c,f=N(e,t),d=e.anchor,x="end"===d?-1:1;if("middle"===d)c=(A=e.crossPos+(a?B(f.y-e.by/2):C(e.bx/2+e.tx2width/2)))+(a?B(e.by):C(e.bx));else if(a)c=(A=e.crossPos+B(Q+f.y)-B(e.by/2-Q))+B(e.by);else{var w=C(x*Q+f.x),_=w+C(x*e.bx);A=e.crossPos+Math.min(w,_),c=e.crossPos+Math.max(w,_)}a?void 0!==v&&void 0!==E&&Math.min(c,E)-Math.max(A,v)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==m&&void 0!==I&&Math.min(c,I)-Math.max(A,m)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}p[y++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?b:1)/2,pmin:s,pmax:l}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||h*(t[0].traceIndex-e[0].traceIndex)}));!i&&f<=d;){for(f++,i=!0,s=0;s.01&&S.pmin===k.pmin&&S.pmax===k.pmax){for(l=_.length-1;l>=0;l--)_[l].dp+=a;for(w.push.apply(w,_),p.splice(s+1,1),c=0,l=w.length-1;l>=0;l--)c+=w[l].dp;for(o=c/w.length,l=w.length-1;l>=0;l--)w[l].dp-=o;i=!1}else s++}p.forEach(x)}for(s=p.length-1;s>=0;s--){var D=p[s];for(l=D.length-1;l>=0;l--){var T=D[l],M=T.datum;M.offset=T.dp,M.del=T.del}}}(lt,at,v,st.commonLabelBoundingBox),F(lt,at,v._invScaleX,v._invScaleY)),l&&l.tagName){var At=y.getComponentMethod("annotations","hasClickToShow")(e,Ye);g(n.select(l),At?"pointer":"")}l&&!a&&function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=e._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(e,0,He)&&(He&&e.emit("plotly_unhover",{event:t,points:He}),e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:V,yaxes:W,xvals:re,yvals:ne}))}(e,t,r,a,l)}))},t.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var i=t.gd,a=q(i),o=H(i),s=!1,l=R(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,s=e._y0||e.y0||e.y||0,l=e._y1||e.y1||e.y||0,A=e.eventData;if(A){var c=Math.min(r,n),u=Math.max(r,n),g=Math.min(s,l),f=Math.max(s,l),d=e.trace;if(y.traceIs(d,"gl3d")){var p=i._fullLayout[d.scene]._scene.container,m=p.offsetLeft,I=p.offsetTop;c+=m,u+=m,g+=I,f+=I}A.bbox={x0:c+o,x1:u+o,y0:g+a,y1:f+a},t.inOut_bbox&&t.inOut_bbox.push(A.bbox)}else A=!1;return{color:e.color||h.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontVariant:e.fontVariant,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:A}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:t.bgColor||h.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}).hoverLabels,A=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function R(e,t){var r=t.gd,i=r._fullLayout,a=t.hovermode,s=t.rotateLabels,c=t.bgColor,g=t.container,d=t.outerContainer,p=t.commonLabelOpts||{};if(0===e.length)return[[]];var B=t.fontFamily||I.HOVERFONT,b=t.fontSize||I.HOVERFONTSIZE,x=t.fontWeight||i.font.weight,w=t.fontStyle||i.font.style,S=t.fontVariant||i.font.variant,k=e[0],D=k.xa,M=k.ya,R=a.charAt(0),N=R+"Label",F=k[N];if(void 0===F&&"multicategory"===D.type)for(var O=0;Oi.width-E&&(C=i.width-E),t.attr("d","M"+(y-C)+",0L"+(y-C+Q)+","+v+Q+"H"+E+"v"+v+(2*_+I.height)+"H"+-E+"V"+v+Q+"H"+(y-C-Q)+"Z"),y=C,W.minX=y-E,W.maxX=y+E,"top"===D.side?(W.minY=m-(2*_+I.height),W.maxY=m-_):(W.minY=m+_,W.maxY=m+(2*_+I.height))}else{var T,R,L;"right"===M.side?(T="start",R=1,L="",y=D._offset+D._length):(T="end",R=-1,L="-",y=D._offset),m=M._offset+(k.y0+k.y1)/2,s.attr("text-anchor",T),t.attr("d","M0,0L"+L+Q+","+Q+"V"+(_+I.height/2)+"h"+L+(2*_+I.width)+"V-"+(_+I.height/2)+"H"+L+Q+"V-"+Q+"Z"),W.minY=m-(_+I.height/2),W.maxY=m+(_+I.height/2),"right"===M.side?(W.minX=y+Q,W.maxX=y+Q+(2*_+I.width)):(W.minX=y-Q-(2*_+I.width),W.maxX=y-Q);var N,O=I.height/2,P=G-I.top-O,U="clip"+i._uid+"commonlabel"+M._id;if(y=0?ue:ge+de=0?ge:Be+de=0?Ae:ce+pe=0?ce:be+pe=0,"top"!==e.idealAlign&&j||!V?j?(N+=P/2,e.anchor="start"):e.anchor="middle":(N-=P/2,e.anchor="end"),e.crossPos=N;else{if(e.pos=N,j=R+O/2+W<=U,V=R-O/2-W>=0,"left"!==e.idealAlign&&j||!V)if(j)R+=O/2,e.anchor="start";else{e.anchor="middle";var Z=W/2,X=R+Z-U,$=R-Z;X>0&&(R-=X),$<0&&(R+=-$)}else R-=O/2,e.anchor="end";e.crossPos=R}E.attr("text-anchor",e.anchor),D&&k.attr("text-anchor",e.anchor),t.attr("transform",l(R,N)+(s?A(C):""))})),{hoverLabels:xe,commonLabelBoundingBox:W}}function L(e,t,r,n,i,a){var s="",l="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),s=U(e.name,e.nameLength));var A=r.charAt(0),c="x"===A?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(l+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(l+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(l+=(l?"z: ":"")+e.zLabel)):t&&e[A+"Label"]===i?l=e[c+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(l=e.yLabel):l=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(l+=(l?"
":"")+e.text),void 0!==e.extraText&&(l+=(l?"
":"")+e.extraText),a&&""===l&&!e.hovertemplate&&(""===s&&a.remove(),l=s);var u=e.hovertemplate||!1;if(u){var g=e.hovertemplateLabels||e;e[A+"Label"]!==i&&(g[A+"other"]=g[A+"Val"],g[A+"otherLabel"]=g[A+"Label"]),l=(l=o.hovertemplateString(u,g,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(M,(function(t,r){return s=U(r,e.nameLength),""}))}return[l,s]}function N(e,t){var r=0,n=e.offset;return t&&(n*=-w,r=e.offset*x),{x:r,y:n}}function F(e,t,r,i){var a=function(e){return e*r},o=function(e){return e*i};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var i=r.select("text.nums"),s=e.anchor,l="end"===s?-1:1,A=function(e){var t={start:1,end:-1,middle:0}[e.anchor],r=t*(Q+_),n=r+t*(e.txwidth+_);return"middle"===e.anchor&&(r-=e.tx2width/2,n+=e.txwidth/2+_),{alignShift:t,textShiftX:r,text2ShiftX:n}}(e),c=N(e,t),g=c.x,h=c.y,d="middle"===s;r.select("path").attr("d",d?"M-"+a(e.bx/2+e.tx2width/2)+","+o(h-e.by/2)+"h"+a(e.bx)+"v"+o(e.by)+"h-"+a(e.bx)+"Z":"M0,0L"+a(l*Q+g)+","+o(Q+h)+"v"+o(e.by/2-Q)+"h"+a(l*e.bx)+"v-"+o(e.by)+"H"+a(l*Q+g)+"V"+o(h-Q)+"Z");var p=g+A.textShiftX,y=h+e.ty0-e.by/2+_,m=e.textAlign||"auto";"auto"!==m&&("left"===m&&"start"!==s?(i.attr("text-anchor","start"),p=d?-e.bx/2-e.tx2width/2+_:-e.bx-_):"right"===m&&"end"!==s&&(i.attr("text-anchor","end"),p=d?e.bx/2-e.tx2width/2-_:e.bx+_)),i.call(u.positionText,a(p),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,a(A.text2ShiftX+A.alignShift*_+g),o(h+e.ty0-e.by/2+_)),r.select("rect").call(f.setRect,a(A.text2ShiftX+(A.alignShift-1)*e.tx2width/2+g),o(h-e.by/2-1),a(e.tx2width),o(e.by+2)))}))}function O(e,t){var r=e.index,n=e.trace||{},a=e.cd[0],s=e.cd[r]||{};function l(e){return e||i(e)&&0===e}var A=Array.isArray(r)?function(e,t){var i=o.castOption(a,r,e);return l(i)?i:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(s,n,e,t)};function c(t,r,n){var i=A(r,n);l(i)&&(e[t]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("fontWeight","htw","hoverlabel.font.weight"),c("fontStyle","hty","hoverlabel.font.style"),c("fontVariant","htv","hoverlabel.font.variant"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!isNaN(e.xerr)&&!("log"===e.xa.type&&e.xerr<=0)){var u=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+u+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+u,"x"===t&&(e.distance+=1)}if(!isNaN(e.yerr)&&!("log"===e.ya.type&&e.yerr<=0)){var g=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+g+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+g,"y"===t&&(e.distance+=1)}var f=e.hoverinfo||e.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===f.indexOf("y")&&(e.yLabel=void 0),-1===f.indexOf("z")&&(e.zLabel=void 0),-1===f.indexOf("text")&&(e.text=void 0),-1===f.indexOf("name")&&(e.name=void 0)),e}function P(e,t,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,A=r.event,c=!!t.hLinePoint,u=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),u||c){var g=h.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var d,y,m=t.hLinePoint;n=m&&m.xa,"cursor"===(i=m&&m.ya).spikesnap?(d=A.pointerX,y=A.pointerY):(d=n._offset+m.x,y=i._offset+m.y);var I,v,E=a.readability(m.color,g)<1.5?h.contrast(g):m.color,C=i.spikemode,B=i.spikethickness,b=i.spikecolor||E,x=p.getPxPosition(e,i);if(-1!==C.indexOf("toaxis")||-1!==C.indexOf("across")){if(-1!==C.indexOf("toaxis")&&(I=x,v=d),-1!==C.indexOf("across")){var w=i._counterDomainMin,Q=i._counterDomainMax;"free"===i.anchor&&(w=Math.min(w,i.position),Q=Math.max(Q,i.position)),I=l.l+w*l.w,v=l.l+Q*l.w}o.insert("line",":first-child").attr({x1:I,x2:v,y1:y,y2:y,"stroke-width":B,stroke:b,"stroke-dasharray":f.dashStyle(i.spikedash,B)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:I,x2:v,y1:y,y2:y,"stroke-width":B+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==C.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:x+("right"!==i.side?B:-B),cy:y,r:B,fill:b}).classed("spikeline",!0)}if(u){var _,S,k=t.vLinePoint;n=k&&k.xa,i=k&&k.ya,"cursor"===n.spikesnap?(_=A.pointerX,S=A.pointerY):(_=n._offset+k.x,S=i._offset+k.y);var D,T,M=a.readability(k.color,g)<1.5?h.contrast(g):k.color,R=n.spikemode,L=n.spikethickness,N=n.spikecolor||M,F=p.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(D=F,T=S),-1!==R.indexOf("across")){var O=n._counterDomainMin,P=n._counterDomainMax;"free"===n.anchor&&(O=Math.min(O,n.position),P=Math.max(P,n.position)),D=l.t+(1-P)*l.h,T=l.t+(1-O)*l.h}o.insert("line",":first-child").attr({x1:_,x2:_,y1:D,y2:T,"stroke-width":L,stroke:N,"stroke-dasharray":f.dashStyle(n.spikedash,L)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:_,x2:_,y1:D,y2:T,"stroke-width":L+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:_,cy:F-("top"!==n.side?L:-L),r:L,fill:N}).classed("spikeline",!0)}}}function G(e,t){return!t||t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint}function U(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function z(e,t,r){var n=t[e+"a"],i=t[e+"Val"],a=t.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var s=t.cd[t.index],l=s[e+"Start"];void 0===l&&(l=s[e]);var A=s[e+"End"];void 0===A&&(A=s[e]);var c=A-l;"end"===o?i+=c:"middle"===o&&(i+=c/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function q(e){return e.offsetTop+e.clientTop}function H(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),i=n.left,a=n.top,s=i+n.width,l=a+n.height,A=o.apply3DTransform(r._invTransform)(i,a),c=o.apply3DTransform(r._invTransform)(s,l),u=A[0],g=A[1],f=c[0],h=c[1];return{x:u,y:g,width:f-u,height:h-g,top:Math.min(g,h),left:Math.min(u,f),right:Math.max(u,f),bottom:Math.max(g,h)}}},16132:function(e,t,r){"use strict";var n=r(3400),i=r(76308),a=r(10624).isUnifiedHover;e.exports=function(e,t,r,o){o=o||{};var s=t.legend;function l(e){o.font[e]||(o.font[e]=s?t.legend.font[e]:t.font[e])}t&&a(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=i.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},41008:function(e,t,r){"use strict";var n=r(3400),i=r(65460);e.exports=function(e,t){function r(r,a){return void 0!==t[r]?t[r]:n.coerce(e,t,i,r,a)}return r("clickmode"),r("hoversubplots"),r("hovermode")}},93024:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(86476),o=r(10624),s=r(65460),l=r(83292);e.exports={moduleType:"component",name:"fx",constants:r(92456),schema:{layout:s},attributes:r(55756),layoutAttributes:s,supplyLayoutGlobalDefaults:r(81976),supplyDefaults:r(95448),supplyLayoutDefaults:r(88336),calc:r(55056),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return i.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return i.castOption(e,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(e){var t=i.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:r(62376)}},65460:function(e,t,r){"use strict";var n=r(92456),i=r(25376),a=i({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},88336:function(e,t,r){"use strict";var n=r(3400),i=r(65460),a=r(41008),o=r(16132);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}a(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=t._has("mapbox"),l=t._has("geo"),A=t._basePlotModules.length;"zoom"===t.dragmode&&((s||l)&&1===A||s&&l&&2===A)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},81976:function(e,t,r){"use strict";var n=r(3400),i=r(16132),a=r(65460);e.exports=function(e,t){i(e,t,(function(r,i){return n.coerce(e,t,a,r,i)}))}},12704:function(e,t,r){"use strict";var n=r(3400),i=r(53756).counter,a=r(86968).u,o=r(33816).idRegex,s=r(31780),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:a({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function A(e,t,r){var n=t[r+"axes"],i=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function c(e,t,r,n,i,a){var o=t(e+"gap",r),s=t("domain."+e);t(e+"side",n);for(var l=new Array(i),A=s[0],c=(s[1]-A)/(i-o),u=c*(1-o),g=0;g1){g||f||h||"independent"===b("pattern")&&(g=!0),p._hasSubplotGrid=g;var I,v,E="top to bottom"===b("roworder"),C=g?.2:.1,B=g?.3:.1;d&&t._splomGridDflt&&(I=t._splomGridDflt.xside,v=t._splomGridDflt.yside),p._domains={x:c("x",b,C,I,m),y:c("y",b,B,v,y,E)}}else delete t.grid}function b(e,t){return n.coerce(r,p,l,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,i,a,o,s,l,c,g=e.grid||{},f=t._subplots,h=r._hasSubplotGrid,d=r.rows,p=r.columns,y="independent"===r.pattern,m=r._axisMap={};if(h){var I=g.subplots||[];l=r.subplots=new Array(d);var v=1;for(n=0;n("legend"===e?1:0));if(!1===w&&(r[e]=void 0),(!1!==w||u.uirevision)&&(f("uirevision",r.uirevision),!1!==w)){f("borderwidth");var Q,_,S,k="h"===f("orientation"),D="paper"===f("yref"),T="paper"===f("xref"),M="left";if(k?(Q=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?D?(_=1.1,S="bottom"):(_=1,S="top"):D?(_=-.1,S="top"):(_=0,S="bottom")):(_=1,S="auto",T?Q=1.02:(Q=1,M="right")),i.coerce(u,g,{x:{valType:"number",editType:"legend",min:T?-2:0,max:T?3:1,dflt:Q}},"x"),i.coerce(u,g,{y:{valType:"number",editType:"legend",min:D?-2:0,max:D?3:1,dflt:_}},"y"),f("traceorder",E),A.isGrouped(r[e])&&f("tracegroupgap"),f("entrywidth"),f("entrywidthmode"),f("indentation"),f("itemsizing"),f("itemwidth"),f("itemclick"),f("itemdoubleclick"),f("groupclick"),f("xanchor",M),f("yanchor",S),f("valign"),i.noneOrAll(u,g,["x","y"]),f("title.text")){f("title.side",k?"left":"top");var R=i.extendFlat({},h,{size:i.bigFont(h.size)});i.coerceFont(f,"title.font",R)}}}}e.exports=function(e,t,r){var n,a=r.slice(),o=t.shapes;if(o)for(n=0;n1)}var O=h.hiddenlabels||[];if(!B&&(!h.showlegend||!Q.length))return s.selectAll("."+C).remove(),h._topdefs.select("#"+r).remove(),a.autoMargin(e,C);var P=i.ensureSingle(s,"g",C,(function(e){B||e.attr("pointer-events","all")})),G=i.ensureSingleById(h._topdefs,"clipPath",r,(function(e){e.append("rect")})),U=i.ensureSingle(P,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));U.call(c.stroke,g.bordercolor).call(c.fill,g.bgcolor).style("stroke-width",g.borderwidth+"px");var z,q=i.ensureSingle(P,"g","scrollbox"),H=g.title;g._titleWidth=0,g._titleHeight=0,H.text?((z=i.ensureSingle(q,"text",C+"titletext")).attr("text-anchor","start").call(A.font,H.font).text(H.text),S(z,q,e,g,E)):q.selectAll("."+C+"titletext").remove();var Y=i.ensureSingle(P,"rect","scrollbar",(function(e){e.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),J=q.selectAll("g.groups").data(Q);J.enter().append("g").attr("class","groups"),J.exit().remove();var K=J.selectAll("g.traces").data(i.identity);K.enter().append("g").attr("class","traces"),K.exit().remove(),K.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==O.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,g)})).call(I,e,g).each((function(){B||n.select(this).call(_,e,C)})),i.syncOrAsync([a.previousPromises,function(){return function(e,t,r,i){var a=e._fullLayout,o=T(i);i||(i=a[o]);var s=a._size,l=v.isVertical(i),c=v.isGrouped(i),u="fraction"===i.entrywidthmode,g=i.borderwidth,h=2*g,d=f.itemGap,p=i.indentation+i.itemwidth+2*d,y=2*(g+d),m=D(i),I=i.y<0||0===i.y&&"top"===m,E=i.y>1||1===i.y&&"bottom"===m,C=i.tracegroupgap,B={};i._maxHeight=Math.max(I||E?a.height/2:s.h,30);var x=0;i._width=0,i._height=0;var w=function(e){var t=0,r=0,n=e.title.side;return n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight)),[t,r]}(i);if(l)r.each((function(e){var t=e[0].height;A.setTranslate(this,g+w[0],g+w[1]+i._height+t/2+d),i._height+=t,i._width=Math.max(i._width,e[0].width)})),x=p+i._width,i._width+=d+p+h,i._height+=y,c&&(t.each((function(e,t){A.setTranslate(this,0,t*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var Q=k(i),_=i.x<0||0===i.x&&"right"===Q,S=i.x>1||1===i.x&&"left"===Q,M=E||I,R=a.width/2;i._maxWidth=Math.max(_?M&&"left"===Q?s.l+s.w:R:S?M&&"right"===Q?s.r+s.w:R:s.w,2*p);var L=0,N=0;r.each((function(e){var t=b(e,i,p);L=Math.max(L,t),N+=t})),x=null;var F=0;if(c){var O=0,P=0,G=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=b(r,i,p),a=r[0].height;A.setTranslate(this,w[0],w[1]+g+d+a/2+t),t+=a,e=Math.max(e,n),B[r[0].trace.legendgroup]=e}));var r=e+d;P>0&&r+g+P>i._maxWidth?(F=Math.max(F,P),P=0,G+=O+C,O=t):O=Math.max(O,t),A.setTranslate(this,P,G),P+=r})),i._width=Math.max(F,P)+g,i._height=G+O+y}else{var U=r.size(),z=N+h+(U-1)*d=i._maxWidth&&(F=Math.max(F,J),H=0,Y+=q,i._height+=q,q=0),A.setTranslate(this,w[0]+g+H,w[1]+g+Y+t/2+d),J=H+r+d,H+=n,q=Math.max(q,t)})),z?(i._width=H+h,i._height=q+y):(i._width=Math.max(F,J)+h,i._height+=q+y)}}i._width=Math.ceil(Math.max(i._width+w[0],i._titleWidth+2*(g+f.titlePad))),i._height=Math.ceil(Math.max(i._height+w[1],i._titleHeight+2*(g+f.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var K=e._context.edits,j=K.legendText||K.legendPosition;r.each((function(e){var t=n.select(this).select("."+o+"toggle"),r=e[0].height,a=e[0].trace.legendgroup,s=b(e,i,p);c&&""!==a&&(s=B[a]);var g=j?p:x||s;l||u||(g+=d/2),A.setRect(t,0,-r/2,g,r)}))}(e,J,K,g)},function(){var t,c,m,I,v=h._size,E=g.borderwidth,b="paper"===g.xref,w="paper"===g.yref;if(H.text&&function(e,t,r){if("top center"===t.title.side||"top right"===t.title.side){var n=t.title.font.size*d,i=0,a=e.node(),o=A.bBox(a).width;"top center"===t.title.side?i=.5*(t._width-2*r-2*f.titlePad-o):"top right"===t.title.side&&(i=t._width-2*r-2*f.titlePad-o),u.positionText(e,r+f.titlePad+i,r+n)}}(z,g,E),!B){var Q,_;Q=b?v.l+v.w*g.x-p[k(g)]*g._width:h.width*g.x-p[k(g)]*g._width,_=w?v.t+v.h*(1-g.y)-p[D(g)]*g._effHeight:h.height*(1-g.y)-p[D(g)]*g._effHeight;var S=function(e,t,r,n){var i=e._fullLayout,o=i[t],s=k(o),l=D(o),A="paper"===o.xref,c="paper"===o.yref;e._fullLayout._reservedMargin[t]={};var u=o.y<.5?"b":"t",g=o.x<.5?"l":"r",f={r:i.width-r,l:r+o._width,b:i.height-n,t:n+o._effHeight};if(A&&c)return a.autoMargin(e,t,{x:o.x,y:o.y,l:o._width*p[s],r:o._width*y[s],b:o._effHeight*y[l],t:o._effHeight*p[l]});A?e._fullLayout._reservedMargin[t][u]=f[u]:c||"v"===o.orientation?e._fullLayout._reservedMargin[t][g]=f[g]:e._fullLayout._reservedMargin[t][u]=f[u]}(e,C,Q,_);if(S)return;if(h.margin.autoexpand){var T=Q,M=_;Q=b?i.constrain(Q,0,h.width-g._width):T,_=w?i.constrain(_,0,h.height-g._effHeight):M,Q!==T&&i.log("Constrain "+C+".x to make legend fit inside graph"),_!==M&&i.log("Constrain "+C+".y to make legend fit inside graph")}A.setTranslate(P,Q,_)}if(Y.on(".drag",null),P.on("wheel",null),B||g._height<=g._maxHeight||e._context.staticPlot){var R=g._effHeight;B&&(R=g._height),U.attr({width:g._width-E,height:R-E,x:E/2,y:E/2}),A.setTranslate(q,0,0),G.select("rect").attr({width:g._width-2*E,height:R-2*E,x:E,y:E}),A.setClipUrl(q,r,e),A.setRect(Y,0,0,0,0),delete g._scrollY}else{var L,N,F,O=Math.max(f.scrollBarMinHeight,g._effHeight*g._effHeight/g._height),J=g._effHeight-O-2*f.scrollBarMargin,K=g._height-g._effHeight,j=J/K,V=Math.min(g._scrollY||0,K);U.attr({width:g._width-2*E+f.scrollBarWidth+f.scrollBarMargin,height:g._effHeight-E,x:E/2,y:E/2}),G.select("rect").attr({width:g._width-2*E+f.scrollBarWidth+f.scrollBarMargin,height:g._effHeight-2*E,x:E,y:E+V}),A.setClipUrl(q,r,e),X(V,O,j),P.on("wheel",(function(){X(V=i.constrain(g._scrollY+n.event.deltaY/J*K,0,K),O,j),0!==V&&V!==K&&n.event.preventDefault()}));var W=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;L="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,F=V})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(N="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,V=function(e,t,r){var n=(r-t)/j+e;return i.constrain(n,0,K)}(F,L,N),X(V,O,j))}));Y.call(W);var Z=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(L=e.changedTouches[0].clientY,F=V)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(N=e.changedTouches[0].clientY,V=function(e,t,r){var n=(t-r)/j+e;return i.constrain(n,0,K)}(F,L,N),X(V,O,j))}));q.call(Z)}function X(t,r,n){g._scrollY=e._fullLayout[C]._scrollY=t,A.setTranslate(q,0,-t),A.setRect(Y,g._width,f.scrollBarMargin+t*n,f.scrollBarWidth,r),G.select("rect").attr("y",E+t)}e._context.edits.legendPosition&&(P.classed("cursor-move",!0),l.init({element:P.node(),gd:e,prepFn:function(){var e=A.getTranslate(P);m=e.x,I=e.y},moveFn:function(e,r){var n=m+e,i=I+r;A.setTranslate(P,n,i),t=l.align(n,g._width,v.l,v.l+v.w,g.xanchor),c=l.align(i+g._height,-g._height,v.t+v.h,v.t,g.yanchor)},doneFn:function(){if(void 0!==t&&void 0!==c){var r={};r[C+".x"]=t,r[C+".y"]=c,o.call("_guiRelayout",e,r)}},clickFn:function(t,r){var n=s.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return r.clientX>=e.left&&r.clientX<=e.right&&r.clientY>=e.top&&r.clientY<=e.bottom}));n.size()>0&&x(e,P,n,t,r)}}))}],e)}}function b(e,t,r){var n=e[0],i=n.width,a=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===a?t._maxWidth*o:r+(o||i)}function x(e,t,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label);var A=s.triggerHandler(e,"plotly_legendclick",l);if(1===n){if(!1===A)return;t._clickTimeout=setTimeout((function(){e._fullLayout&&g(r,e,n)}),e._context.doubleClickDelay)}else 2===n&&(t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==s.triggerHandler(e,"plotly_legenddoubleclick",l)&&!1!==A&&g(r,e,n))}function w(e,t,r){var n,a,s=T(r),l=e.data()[0][0],c=l.trace,g=o.traceIs(c,"pie-like"),h=!r._inHover&&t._context.edits.legendText&&!g,d=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,a=l.groupTitle.font):(a=r.font,r.entries?n=l.text:(n=g?l.label:c.name,c._meta&&(n=i.templateString(n,c._meta))));var p=i.ensureSingle(e,"text",s+"text");p.attr("text-anchor","start").call(A.font,a).text(h?Q(n,d):n);var y=r.indentation+r.itemwidth+2*f.itemGap;u.positionText(p,y,0),h?p.call(u.makeEditable,{gd:t,text:n}).call(S,e,t,r).on("edit",(function(n){this.text(Q(n,d)).call(S,e,t,r);var a=l.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var A=o.getTransformIndices(a,"groupby"),u=A[A.length-1],g=i.keyedContainer(a,"transforms["+u+"].styles","target","value.name");g.set(l.trace._group,n),s=g.constructUpdate()}else s.name=n;return a._isShape?o.call("_guiRelayout",t,"shapes["+c.index+"].name",s.name):o.call("_guiRestyle",t,s,c.index)})):S(p,e,t,r)}function Q(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function _(e,t,r){var a,o=t._context.doubleClickDelay,s=1,l=i.ensureSingle(e,"rect",r+"toggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(c.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-t._legendMouseDownTimeo&&(s=Math.max(s-1,1)),x(t,i,e,s,n.event)}})))}function S(e,t,r,n,i){n._inHover&&e.attr("data-notex",!0),u.convertToTspans(e,r,(function(){!function(e,t,r,n){var i=e.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=e.select("g[class*=math-group]"),o=a.node(),s=T(r);r||(r=t._fullLayout[s]);var l,c,g=r.borderwidth,h=(n===E?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*d;if(o){var p=A.bBox(o);l=p.height,c=p.width,n===E?A.setTranslate(a,g,g+.75*l):A.setTranslate(a,0,.25*l)}else{var y="."+s+(n===E?"title":"")+"text",m=e.select(y),I=u.lineCount(m),v=m.node();if(l=h*I,c=v?A.bBox(v).width:0,n===E)"left"===r.title.side&&(c+=2*f.itemGap),u.positionText(m,g+f.titlePad,g+h);else{var C=2*f.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(C=f.itemGap,c-=r.indentation+r.itemwidth),u.positionText(m,C,-h*((I-1)/2-.3))}}n===E?(r._titleWidth=c,r._titleHeight=l):(i.lineHeight=h,i.height=Math.max(l,16)+3,i.width=c)}else e.remove()}(t,r,n,i)}))}function k(e){return i.isRightAnchor(e)?"right":i.isCenterAnchor(e)?"center":"left"}function D(e){return i.isBottomAnchor(e)?"bottom":i.isMiddleAnchor(e)?"middle":"top"}function T(e){return e._id||"legend"}e.exports=function(e,t){if(t)B(e,t);else{var r=e._fullLayout,i=r._legends;r._infolayer.selectAll('[class^="legend"]').each((function(){var e=n.select(this),t=e.attr("class").split(" ")[0];t.match(C)&&-1===i.indexOf(t)&&e.remove()}));for(var a=0;aQ&&(w=Q)}b[a][0]._groupMinRank=w,b[a][0]._preGroupSort=a}var _=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(b.forEach((function(e,t){e[0]._preGroupSort=t})),b.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),a=0;ar?r:e}e.exports=function(e,t,r){var y=t._fullLayout;r||(r=y.legend);var m="constant"===r.itemsizing,I=r.itemwidth,v=(I+2*f.itemGap)/2,E=o(v,0),C=function(e,t,r,n){var i;if(e+1)i=e;else{if(!(t&&t.width>0))return 0;i=t.width}return m?n:Math.min(i,r)};function B(e,a,o){var c=e[0].trace,u=c.marker||{},g=u.line||{},f=u.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",h=o?c.visible&&c.type===o:i.traceIs(c,"bar"),d=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(h?[e]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d",f).attr("transform",E),d.exit().remove(),d.each((function(e){var i=n.select(this),a=e[0],o=C(a.mlw,u.line,5,2);i.style("stroke-width",o+"px");var f=a.mcc;if(!r._inHover&&"mc"in a){var h=A(u),d=h.mid;void 0===d&&(d=(h.max+h.min)/2),f=s.tryColorscale(u,"")(d)}var y=f||a.mc||u.color,m=u.pattern,I=m&&s.getPatternAttr(m.shape,0,"");if(I){var v=s.getPatternAttr(m.bgcolor,0,null),E=s.getPatternAttr(m.fgcolor,0,null),B=m.fgopacity,b=p(m.size,8,10),x=p(m.solidity,.5,1),w="legend-"+c.uid;i.call(s.pattern,"legend",t,w,I,b,x,f,m.fillmode,v,E,B)}else i.call(l.fill,y);o&&l.stroke(i,a.mlc||g.color)}))}function b(e,r,o){var s=e[0],l=s.trace,A=o?l.visible&&l.type===o:i.traceIs(l,o),c=n.select(r).select("g.legendpoints").selectAll("path.legend"+o).data(A?[e]:[]);if(c.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",E),c.exit().remove(),c.size()){var f=l.marker||{},h=C(g(f.line.width,s.pts),f.line,5,2),d="pieLike",p=a.minExtend(l,{marker:{line:{width:h}}},d),y=a.minExtend(s,{trace:p},d);u(c,y,p,t)}}e.each((function(e){var t=n.select(this),i=a.ensureSingle(t,"g","layers");i.style("opacity",e[0].trace.opacity);var s=r.indentation,l=r.valign,A=e[0].lineHeight,c=e[0].height;if("middle"===l&&0===s||!A||!c)i.attr("transform",null);else{var u={top:1,bottom:-1}[l]*(.5*(A-c+3))||0,g=r.indentation;i.attr("transform",o(g,u))}i.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=i.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,i=e[0].trace,o=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",E).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(e,o){var c,u=n.select(this),g=A(i),f=g.colorscale,d=g.reversescale;if(f){if(!r){var p=f.length;c=0===o?f[d?p-1:0][1]:1===o?f[d?0:p-1][1]:f[Math.floor((p-1)/2)][1]}}else{var y=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(y)?y[o]||y[0]:y}u.attr("d",e[0]),c?u.call(l.fill,c):u.call((function(e){if(e.size()){var n="legendfill-"+i.uid;s.gradient(e,t,n,h(d,"radial"===r),f,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var i=e[0].trace[e[0].dir].marker;return e[0].mc=i.color,e[0].mlw=i.line.width,e[0].mlc=i.line.color,B(e,this,"waterfall")}var a=[];t.visible&&r&&(a=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",E).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),i=t[e[0]].marker,a=C(void 0,i.line,5,2);r.attr("d",e[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(e){B(e,this,"funnel")})).each((function(e){B(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",E),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=C(void 0,r.line,5,2);e.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(e,r.line.color)}else{var A=a.minExtend(r,{marker:{size:m?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,A,t)}}))})).each((function(e){b(e,this,"funnelarea")})).each((function(e){b(e,this,"pie")})).each((function(e){var r,i,o=d(e),l=o.showFill,u=o.showLine,g=o.showGradientLine,f=o.showGradientFill,p=o.anyFill,y=o.anyLine,m=e[0],v=m.trace,E=A(v),B=E.colorscale,b=E.reversescale,x=c.hasMarkers(v)||!p?"M5,0":y?"M5,-2":"M5,-3",w=n.select(this),Q=w.select(".legendfill").selectAll("path").data(l||f?[e]:[]);if(Q.enter().append("path").classed("js-fill",!0),Q.exit().remove(),Q.attr("d",x+"h"+I+"v6h-"+I+"z").call((function(e){if(e.size())if(l)s.fillGroupStyle(e,t,!0);else{var r="legendfill-"+v.uid;s.gradient(e,t,r,h(b),B,"fill")}})),u||g){var _=C(void 0,v.line,10,5);i=a.minExtend(v,{line:{width:_}}),r=[a.minExtend(m,{trace:i})]}var S=w.select(".legendlines").selectAll("path").data(u||g?[r]:[]);S.enter().append("path").classed("js-line",!0),S.exit().remove(),S.attr("d",x+(g?"l"+I+",0.0001":"h"+I)).call(u?s.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+v.uid;s.lineGroupStyle(e),s.gradient(e,t,r,h(b),B,"stroke")}})})).each((function(e){var r,i,o=d(e),l=o.anyFill,A=o.anyLine,u=o.showLine,g=o.showMarker,f=e[0],h=f.trace,p=!g&&!A&&!l&&c.hasText(h);function y(e,t,r,n){var i=a.nestedProperty(h,e).get(),o=a.isArrayOrTypedArray(i)&&t?t(i):i;if(m&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function I(e){return f._distinct&&f.index&&e[f.index]?e[f.index]:e[0]}if(g||p||u){var v={},C={};if(g){v.mc=y("marker.color",I),v.mx=y("marker.symbol",I),v.mo=y("marker.opacity",a.mean,[.2,1]),v.mlc=y("marker.line.color",I),v.mlw=y("marker.line.width",a.mean,[0,5],2),C.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var B=y("marker.size",a.mean,[2,16],12);v.ms=B,C.marker.size=B}u&&(C.line={width:y("line.width",I,[0,10],5)}),p&&(v.tx="Aa",v.tp=y("textposition",I),v.ts=10,v.tc=y("textfont.color",I),v.tf=y("textfont.family",I),v.tw=y("textfont.weight",I),v.ty=y("textfont.style",I),v.tv=y("textfont.variant",I)),r=[a.minExtend(f,v)],(i=a.minExtend(h,C)).selectedpoints=null,i.texttemplate=null}var b=n.select(this).select("g.legendpoints"),x=b.selectAll("path.scatterpts").data(g?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",E),x.exit().remove(),x.call(s.pointStyle,i,t),g&&(r[0].mrc=3);var w=b.selectAll("g.pointtext").data(p?r:[]);w.enter().append("g").classed("pointtext",!0).append("text").attr("transform",E),w.exit().remove(),w.selectAll("text").call(s.textPointStyle,i,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",E).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var i=n.select(this),a=t[r?"increasing":"decreasing"],o=C(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",E).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var i=n.select(this),a=t[r?"increasing":"decreasing"],o=C(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},66540:function(e,t,r){"use strict";r(76052),e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},44248:function(e,t,r){"use strict";var n=r(24040),i=r(7316),a=r(79811),o=r(9224),s=r(4016).eraseActiveShape,l=r(3400),A=l._,c=e.exports={};function u(e,t){var r,i,o=t.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,A=e._fullLayout,c={},u=a.list(e,null,!0),g=A._cartesianSpikesEnabled;if("zoom"===s){var f,h="in"===l?.5:2,d=(1+h)/2,p=(1-h)/2;for(i=0;i1?(T=["toggleHover"],M=["resetViews"]):y?(D=["zoomInGeo","zoomOutGeo"],T=["hoverClosestGeo"],M=["resetGeo"]):p?(T=["hoverClosest3d"],M=["resetCameraDefault3d","resetCameraLastSave3d"]):C?(D=["zoomInMapbox","zoomOutMapbox"],T=["toggleHover"],M=["resetViewMapbox"]):v?T=["hoverClosestGl2d"]:m?T=["hoverClosestPie"]:x?(T=["hoverClosestCartesian","hoverCompareCartesian"],M=["resetViewSankey"]):T=["toggleHover"],d&&(T=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),(function(e){for(var t=0;t0)){var d=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),i=0,a=0;a0?e.touches[0].clientX:0}function y(e,t,r,n){var i=o.ensureSingle(e,"rect",d.bgClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),a=n.borderwidth%2===0?n.borderwidth:n.borderwidth-1,c=-n._offsetShift,u=l.crispRound(t,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:s(c,c),"stroke-width":u}).call(A.stroke,n.bordercolor).call(A.fill,n.bgcolor)}function m(e,t,r,n){var i=t._fullLayout;o.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(e){e.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function I(e,t,r,i){var s,A=t.calcdata,c=e.selectAll("g."+d.rangePlotClassName).data(r._subplotsWith,o.identity);c.enter().append("g").attr("class",(function(e){return d.rangePlotClassName+" "+e})).call(l.setClipUrl,i._clipId,t),c.order(),c.exit().remove(),c.each((function(e,o){var l=n.select(this),c=0===o,f=g.getFromId(t,e,"y"),h=f._name,d=i[h],p={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:i.range.slice(),calendar:r.calendar},width:i._width,height:i._height,margin:{t:0,b:0,l:0,r:0}},_context:t._context};r.rangebreaks&&(p.layout.xaxis.rangebreaks=r.rangebreaks),p.layout[h]={type:f.type,domain:[0,1],range:"match"!==d.rangemode?d.range.slice():f.range.slice(),calendar:f.calendar},f.rangebreaks&&(p.layout[h].rangebreaks=f.rangebreaks),a.supplyDefaults(p);var y=p._fullLayout.xaxis,m=p._fullLayout[h];y.clearCalc(),y.setScale(),m.clearCalc(),m.setScale();var I={id:e,plotgroup:l,xaxis:y,yaxis:m,isRangePlot:!0};c?s=I:(I.mainplot="xy",I.mainplotinfo=s),u.rangePlot(t,I,function(e,t){for(var r=[],n=0;n=n.max)t=O[r+1];else if(e=n.pmax)t=O[r+1];else if(er._length||m+E<0)return;c=y+E,f=m+E;break;case l:if(v="col-resize",y+E>r._length)return;c=y+E,f=m;break;case A:if(v="col-resize",m+E<0)return;c=y,f=m+E;break;default:v="ew-resize",c=d,f=d+E}if(f=0;b--){var x=r.append("path").attr(p).style("opacity",b?.1:y).call(o.stroke,I).call(o.fill,m).call(s.dashLine,b?"solid":E,b?4+v:v);if(h(x,e,a),C){var w=l(e.layout,"selections",a);x.style({cursor:"move"});var Q={element:x.node(),plotinfo:f,gd:e,editHelpers:w,isActiveSelection:!0},_=n(A,e);i(_,x,Q)}else x.style("pointer-events",b?"all":"none");B[b]=x}var S=B[0];B[1].node().addEventListener("click",(function(){return function(e,t){if(g(e)){var r=t.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===e._fullLayout._activeSelectionIndex)return void d(e);e._fullLayout._activeSelectionIndex=n,e._fullLayout._deactivateSelection=d,u(e)}}}(e,S)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;s.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function d(e){g(e)&&e._fullLayout._activeSelectionIndex>=0&&(a(e),delete e._fullLayout._activeSelectionIndex,u(e))}e.exports={draw:u,drawOne:f,activateLastSelection:function(e){if(g(e)){var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=d,u(e)}}}},34200:function(e,t,r){"use strict";var n=r(98192).u,i=r(92880).extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},81004:function(e){"use strict";e.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},5968:function(e,t,r){"use strict";var n=r(72760).selectMode,i=r(1936).clearOutline,a=r(9856),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var a=r.getAttribute("d"),A=t.gd,c=A._fullLayout.newselection,u=t.plotinfo,g=u.xaxis,f=u.yaxis,h=t.isActiveSelection,d=t.dragmode,p=(A.layout||{}).selections||[];if(!n(d)&&void 0!==h){var y=A._fullLayout._activeSelectionIndex;if(y-1,v=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){J(e,t,a);var E=function(e,t){var r,n,i=e[0],a=-1,o=[];for(n=0;n0?function(e,t){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(i=0;i1)return!1;if((n+=t.selectedpoints.length)>1)return!1}return 1===n}(s)&&(g=Z(E))){for(o&&o.remove(),p=0;p=0})(i)&&i._fullLayout._deactivateShape(i),function(e){return e._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=f(r),l=d(r);if(s||l){var A,c,u=o.selectAll(".select-outline-"+n.id);u&&i._fullLayout._outlining&&(s&&(A=B(u,e)),A&&a.call("_guiRelayout",i,{shapes:A}),l&&!U(e)&&(c=b(u,e)),c&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:c}).then((function(){t&&x(i)}))),i._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function j(e){return e._id}function V(e,t,r,n){if(!e.calcdata)return[];var i,a,o,s=[],l=t.map(j),A=r.map(j);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(i)>-1}function X(e,t,r){var n,i;for(n=0;n-1&&t;if(!a&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,fe=te[0].yref;if(ne&&fe){var he=Ae(te);ce([k(e,ne,"x"),k(e,fe,"y")])($,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&ue(e,$),g._reselect=!1}if(!a&&g._deselect){var de=g._deselect;(function(e,t,r){for(var n=0;n=0)b._fullLayout._deactivateShape(b);else if(!I){var r=x.clickmode;S.done(we).then((function(){if(S.clear(we),2===e){for(ve.remove(),Z=0;Z<_e.length;Z++)(ee=_e[Z])._module.selectPoints(ee,!1);if(X(b,_e),K(n),ge(b),_e.length){var i=_e[0].xaxis,o=_e[0].yaxis;if(i&&o){for(var s=[],A=b._fullLayout.selections,c=0;c-1&&z(t,b,n.xaxes,n.yaxes,n.subplot,n,ve),"event"===r&&ue(b,void 0);l.click(b,t,D.id)})).catch(w.error)}},n.doneFn=function(){be.remove(),S.done(we).then((function(){S.clear(we),!Q&&W&&n.selectionDefs&&(W.subtract=Ie,n.selectionDefs.push(W),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,j)),(Q||I)&&K(n,Q),n.doneFnCompleted&&n.doneFnCompleted(Qe),v&&ue(b,ae)})).catch(w.error)}},clearOutline:I,clearSelectionsCache:K,selectOnClick:z}},46056:function(e,t,r){"use strict";var n=r(13916),i=r(25376),a=r(52904).line,o=r(98192).u,s=r(92880).extendFlat,l=r(31780).templatedArray,A=(r(36208),r(45464)),c=r(21776).ye,u=r(97728);e.exports=l("shape",{visible:s({},A.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:s({},A.legend,{editType:"calc+arraydraw"}),legendgroup:s({},A.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:s({},A.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:i({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:s({},A.legendrank,{editType:"calc+arraydraw"}),legendwidth:s({},A.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:s({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:s({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:s({},a.color,{editType:"arraydraw"}),width:s({},a.width,{editType:"calc+arraydraw"}),dash:s({},o,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:c({},{keys:Object.keys(u)}),font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})},96084:function(e,t,r){"use strict";var n=r(3400),i=r(54460),a=r(85448),o=r(65152);function s(e){return A(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function l(e){return A(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function A(e,t,r,i,s,l){var A=e/2,c=l;if("pixel"===t){var u=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],g=n.aggNums(Math.max,null,u),f=n.aggNums(Math.min,null,u),h=f<0?Math.abs(f)+A:A,d=g>0?g+A:A;return{ppad:A,ppadplus:c?h:d,ppadminus:c?d:h}}return{ppad:A}}function c(e,t,r,n,i){var s="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[s(t),s(r)];if(n){var l,A,c,u,g=1/0,f=-1/0,h=n.match(a.segmentRE);for("date"===e.type&&(s=o.decodeDate(s)),l=0;lf&&(f=u)));return f>=g?[g,f]:void 0}}e.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o=e?t-n:n-t,-180/Math.PI*Math.atan2(i,a)}(I,E,v,C):0),x.call((function(t){return t.call(o.font,b).attr({}),a.convertToTspans(t,e),t}));var U=function(e,t,r,n,i,a,o){var s,l,A,c,g=i.label.textposition,f=i.label.textangle,h=i.label.padding,d=i.type,p=Math.PI/180*a,y=Math.sin(p),m=Math.cos(p),I=i.label.xanchor,v=i.label.yanchor;if("line"===d){"start"===g?(s=e,l=t):"end"===g?(s=r,l=n):(s=(e+r)/2,l=(t+n)/2),"auto"===I&&(I="start"===g?"auto"===f?r>e?"left":re?"right":re?"right":re?"left":r1&&(2!==e.length||"Z"!==e[1][0])&&(0===k&&(e[0][0]="M"),t[S]=e,x(),w())}}()}}function z(e,r){!function(e,r){if(t.length)for(var n=0;nN&&a>F&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";d(t,l),L=l.split("-")[0]}}function ne(n){v(e)||(O&&(C=j(r.xanchor)),P&&(x=V(r.yanchor)),"path"===r.type?R=r.path:(u=O?r.x0:j(r.x0),f=P?r.y0:V(r.y0),I=O?r.x1:j(r.x1),E=P?r.y1:V(r.y1)),uE?(w=f,k="y0",Q=E,D="y1"):(w=E,k="y1",Q=f,D="y0"),re(n),le(l,r),ce(t,r,e),$.moveFn="move"===L?oe:se,$.altKey=n.altKey)}function ie(){v(e)||(d(t),Ae(l),B(t,e,r),i.call("_guiRelayout",e,c.getUpdateObj()))}function ae(){v(e)||Ae(l)}function oe(n,i){if("path"===r.type){var a=function(e){return e},o=a,c=a;O?z("xanchor",r.xanchor=W(C+n)):(o=function(e){return W(j(e)+n)},H&&"date"===H.type&&(o=y.encodeDate(o))),P?z("yanchor",r.yanchor=Z(x+i)):(c=function(e){return Z(V(e)+i)},J&&"date"===J.type&&(c=y.encodeDate(c))),z("path",r.path=b(R,o,c))}else O?z("xanchor",r.xanchor=W(C+n)):(z("x0",r.x0=W(u+n)),z("x1",r.x1=W(I+n))),P?z("yanchor",r.yanchor=Z(x+i)):(z("y0",r.y0=Z(f+i)),z("y1",r.y1=Z(E+i)));t.attr("d",m(e,r)),le(l,r),A(e,s,r,q)}function se(n,i){if(U){var a=function(e){return e},o=a,c=a;O?z("xanchor",r.xanchor=W(C+n)):(o=function(e){return W(j(e)+n)},H&&"date"===H.type&&(o=y.encodeDate(o))),P?z("yanchor",r.yanchor=Z(x+i)):(c=function(e){return Z(V(e)+i)},J&&"date"===J.type&&(c=y.encodeDate(c))),z("path",r.path=b(R,o,c))}else if(G){if("resize-over-start-point"===L){var g=u+n,h=P?f-i:f+i;z("x0",r.x0=O?g:W(g)),z("y0",r.y0=P?h:Z(h))}else if("resize-over-end-point"===L){var d=I+n,p=P?E-i:E+i;z("x1",r.x1=O?d:W(d)),z("y1",r.y1=P?p:Z(p))}}else{var v=function(e){return-1!==L.indexOf(e)},B=v("n"),Y=v("s"),K=v("w"),X=v("e"),$=B?w+i:w,ee=Y?Q+i:Q,te=K?_+n:_,re=X?S+n:S;P&&(B&&($=w-i),Y&&(ee=Q-i)),(!P&&ee-$>F||P&&$-ee>F)&&(z(k,r[k]=P?$:Z($)),z(D,r[D]=P?ee:Z(ee))),re-te>N&&(z(T,r[T]=O?te:W(te)),z(M,r[M]=O?re:W(re)))}t.attr("d",m(e,r)),le(l,r),A(e,s,r,q)}function le(e,t){function r(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]),i=1;n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":i}).classed("visual-cue",!0);var o=j(O?t.xanchor:a.midRange(r?[t.x0,t.x1]:y.extractPathCoords(t.path,p.paramIsX))),s=V(P?t.yanchor:a.midRange(r?[t.y0,t.y1]:y.extractPathCoords(t.path,p.paramIsY)));if(o=y.roundPositionForSharpStrokeRendering(o,i),s=y.roundPositionForSharpStrokeRendering(s,i),O&&P){var l="M"+(o-1-i)+","+(s-1-i)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(O){var A="M"+(o-1-i)+","+(s-9-i)+"v18 h2 v-18 Z";n.attr("d",A)}else{var c="M"+(o-9-i)+","+(s-1-i)+"h18 v2 h-18 Z";n.attr("d",c)}}(O||P)&&r()}function Ae(e){e.selectAll(".visual-cue").remove()}function ce(e,t,r){var n=t.xref,i=t.yref,a=o.getFromId(r,n),s=o.getFromId(r,i),l="";"paper"===n||a.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),g.setClipUrl(e,l?"clip"+r._fullLayout._uid+l:null,r)}h.init($),X.node().onmousemove=re}(e,F,c,t,r,L):!0===c.editable&&F.style("pointer-events",M||u.opacity(S)*_<=.5?"stroke":"all");F.node().addEventListener("click",(function(){return function(e,t){if(E(e)){var r=t.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===e._fullLayout._activeShapeIndex)return void x(e);e._fullLayout._activeShapeIndex=n,e._fullLayout._deactivateShape=x,I(e)}}}(e,F)}))}c._input&&!0===c.visible&&("above"===c.layer?w(e._fullLayout._shapeUpperLayer):"paper"===c.xref||"paper"===c.yref?w(e._fullLayout._shapeLowerLayer):"between"===c.layer?w(C.shapelayerBetween):C._hadPlotinfo?w((C.mainplotinfo||C).shapelayer):w(e._fullLayout._shapeLowerLayer))}function B(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");g.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function b(e,t,r){return e.replace(p.segmentRE,(function(e){var n=0,i=e.charAt(0),a=p.paramIsX[i],o=p.paramIsY[i],s=p.numParams[i];return i+e.substr(1).replace(p.paramRE,(function(e){return n>=s||(a[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function x(e){E(e)&&e._fullLayout._activeShapeIndex>=0&&(c(e),delete e._fullLayout._activeShapeIndex,I(e))}e.exports={draw:I,drawOne:C,eraseActiveShape:function(e){if(E(e)){c(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&lf&&(e="X"),e}));return a>f&&(h=h.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+e)),c+h}))}(r,s,A);if("pixel"===r.xsizemode){var v=s(r.xanchor);c=v+r.x0,u=v+r.x1}else c=s(r.x0),u=s(r.x1);if("pixel"===r.ysizemode){var E=A(r.yanchor);g=E-r.y0,f=E-r.y1}else g=A(r.y0),f=A(r.y1);if("line"===h)return"M"+c+","+g+"L"+u+","+f;if("rect"===h)return"M"+c+","+g+"H"+u+"V"+f+"H"+c+"Z";var C=(c+u)/2,B=(g+f)/2,b=Math.abs(C-c),x=Math.abs(B-g),w="A"+b+","+x,Q=C+b+","+B;return"M"+Q+w+" 0 1,1 "+C+","+(B-x)+w+" 0 0,1 "+Q+"Z"}},41592:function(e,t,r){"use strict";var n=r(4016);e.exports={moduleType:"component",name:"shapes",layoutAttributes:r(46056),supplyLayoutDefaults:r(43712),supplyDrawNewShapeDefaults:r(65144),includeBasePlot:r(36632)("shapes"),calcAutorange:r(96084),draw:n.draw,drawOne:n.drawOne}},97728:function(e){"use strict";function t(e,t){return t?t.d2l(e):e}function r(e,t){return t?t.l2d(e):e}function n(e,r){return t(e.x1,r)-t(e.x0,r)}function i(e,r,n){return t(e.y1,n)-t(e.y0,n)}e.exports={x0:function(e){return e.x0},x1:function(e){return e.x1},y0:function(e){return e.y0},y1:function(e){return e.y1},slope:function(e,t,r){return"line"!==e.type?void 0:i(e,0,r)/n(e,t)},dx:n,dy:i,width:function(e,t){return Math.abs(n(e,t))},height:function(e,t,r){return Math.abs(i(e,0,r))},length:function(e,t,r){return"line"!==e.type?void 0:Math.sqrt(Math.pow(n(e,t),2)+Math.pow(i(e,0,r),2))},xcenter:function(e,n){return r((t(e.x1,n)+t(e.x0,n))/2,n)},ycenter:function(e,n,i){return r((t(e.y1,i)+t(e.y0,i))/2,i)}}},89861:function(e,t,r){"use strict";var n=r(25376),i=r(66741),a=r(92880).extendDeepAll,o=r(67824).overrideAll,s=r(85656),l=r(31780).templatedArray,A=r(60876),c=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:A.gripBgActiveColor},bgcolor:{valType:"color",dflt:A.railBgColor},bordercolor:{valType:"color",dflt:A.railBorderColor},borderwidth:{valType:"number",min:0,dflt:A.railBorderWidth},ticklen:{valType:"number",min:0,dflt:A.tickLength},tickcolor:{valType:"color",dflt:A.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:A.minorTickLength}}),"arraydraw","from-root")},60876:function(e){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},8132:function(e,t,r){"use strict";var n=r(3400),i=r(51272),a=r(89861),o=r(60876).name,s=a.steps;function l(e,t,r){function o(r,i){return n.coerce(e,t,a,r,i)}for(var s=i(e,t,{name:"steps",handleItemDefaults:A}),l=0,c=0;c0&&(s=s.transition().duration(t.transition.duration).ease(t.transition.easing)),s.attr("transform",l(o-.5*u.gripWidth,t._dims.currentValueTotalHeight))}}function _(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function k(e,t,r){var n=r._dims,i=s.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(x,t,e,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function D(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,i=s.ensureSingle(e,"rect",u.railRectClass);i.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,t.bordercolor).call(a.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(i,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(e){var t=e._context.staticPlot,r=e._fullLayout,a=function(e,t){for(var r=e[u.name],n=[],i=0;i0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),i.autoMargin(e,p(t))}if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor",t?null:"ew-resize"),s.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==a.length){var A=s.selectAll("g."+u.groupClassName).data(a,y);A.enter().append("g").classed(u.groupClassName,!0),A.exit().each(l).remove();for(var c=0;c0||E<0){var w={left:[-C,0],right:[C,0],top:[0,-C],bottom:[0,C]}[v.side];r.attr("transform",l(w[0],w[1]))}}}return P.call(G),N&&(_?P.on(".opacity",null):(x=0,w=!0,P.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(g.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(g.HIDE_PLACEHOLDER).style("opacity",0)}))),P.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==I?o.call("_guiRestyle",e,y,t,I):o.call("_guiRelayout",e,y,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(G)})).on("input",(function(e){this.text(e||" ").call(u.positionText,E.x,E.y)}))),P.classed("js-placeholder",w),B}}},88444:function(e,t,r){"use strict";var n=r(25376),i=r(22548),a=r(92880).extendFlat,o=r(67824).overrideAll,s=r(66741),l=r(31780).templatedArray,A=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:A,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},73712:function(e){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},91384:function(e,t,r){"use strict";var n=r(3400),i=r(51272),a=r(88444),o=r(73712).name,s=a.buttons;function l(e,t,r){function o(r,i){return n.coerce(e,t,a,r,i)}o("visible",i(e,t,{name:"buttons",handleItemDefaults:A}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function A(e,t){function r(r,i){return n.coerce(e,t,s,r,i)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(e,t){i(e,t,{name:o,handleItemDefaults:l})}},14420:function(e,t,r){"use strict";var n=r(33428),i=r(7316),a=r(76308),o=r(43616),s=r(3400),l=r(72736),A=r(31780).arrayEditor,c=r(84284).LINE_SPACING,u=r(73712),g=r(37400);function f(e){return e._index}function h(e,t){return+e.attr(u.menuIndexAttrName)===t._index}function d(e,t,r,n,i,a,o,s){t.active=o,A(e.layout,u.name,t).applyUpdate("active",o),"buttons"===t.type?y(e,n,null,null,t):"dropdown"===t.type&&(i.attr(u.menuIndexAttrName,"-1"),p(e,n,i,a,t),s||y(e,n,i,a,t))}function p(e,t,r,n,i){var a=s.ensureSingle(t,"g",u.headerClassName,(function(e){e.style("pointer-events","all")})),l=i._dims,A=i.active,c=i.buttons[A]||u.blankHeaderOpts,g={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};a.call(m,i,c,e).call(w,i,g,f),s.ensureSingle(t,"text",u.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,i.font).text(u.arrowSymbol[i.direction])})).attr({x:l.headerWidth-u.arrowOffsetX+i.pad.l,y:l.headerHeight/2+u.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(Q,String(h(r,i)?-1:i._index)),y(e,t,r,n,i)})),a.on("mouseover",(function(){a.call(C)})),a.on("mouseout",(function(){a.call(B,i)})),o.setTranslate(t,l.lx,l.ly)}function y(e,t,r,a,o){r||(r=t).attr("pointer-events","all");var l=function(e){return-1===+e.attr(u.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,A="dropdown"===o.type?u.dropdownButtonClassName:u.buttonClassName,c=r.selectAll("g."+A).data(s.filterVisible(l)),g=c.enter().append("g").classed(A,!0),f=c.exit();"dropdown"===o.type?(g.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var h=0,p=0,y=o._dims,I=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(I?p=y.headerHeight+u.gapButtonHeader:h=y.headerWidth+u.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(p=-u.gapButtonHeader+u.gapButton-y.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-u.gapButtonHeader+u.gapButton-y.openWidth);var v={x:y.lx+h+o.pad.l,y:y.ly+p+o.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},b={l:v.x+o.borderwidth,t:v.y+o.borderwidth};c.each((function(s,l){var A=n.select(this);A.call(m,o,s,e).call(w,o,v),A.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(d(e,o,0,t,r,a,-1),i.executeAPICommand(e,s.method,s.args2)):(d(e,o,0,t,r,a,l),i.executeAPICommand(e,s.method,s.args))),e.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),A.on("mouseover",(function(){A.call(C)})),A.on("mouseout",(function(){A.call(B,o),c.call(E,o)}))})),c.call(E,o),I?(b.w=Math.max(y.openWidth,y.headerWidth),b.h=v.y-b.t):(b.w=v.x-b.l,b.h=Math.max(y.openHeight,y.headerHeight)),b.direction=o.direction,a&&(c.size()?function(e,t,r,n,i,a){var o,s,l,A=i.direction,c="up"===A||"down"===A,g=i._dims,f=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+u.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+u.headerGroupClassName).data(r,f);l.enter().append("g").classed(u.headerGroupClassName,!0);for(var A=s.ensureSingle(o,"g",u.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),c=0;cC,x=s.barLength+2*s.barPad,w=s.barWidth+2*s.barPad,Q=h,_=p+y;_+w>A&&(_=A-w);var S=this.container.selectAll("rect.scrollbar-horizontal").data(b?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),b?(this.hbar=S.attr({rx:s.barRadius,ry:s.barRadius,x:Q,y:_,width:x,height:w}),this._hbarXMin=Q+x/2,this._hbarTranslateMax=C-x):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var k=y>B,D=s.barWidth+2*s.barPad,T=s.barLength+2*s.barPad,M=h+d,R=p;M+D>l&&(M=l-D);var L=this.container.selectAll("rect.scrollbar-vertical").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),k?(this.vbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:M,y:R,width:D,height:T}),this._vbarYMin=R+T/2,this._vbarTranslateMax=B-T):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var N=this.id,F=c-.5,O=k?u+D+.5:u+.5,P=g-.5,G=b?f+w+.5:f+.5,U=o._topdefs.selectAll("#"+N).data(b||k?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",N).append("rect"),b||k?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(P),width:Math.ceil(O)-Math.floor(F),height:Math.ceil(G)-Math.floor(P)}),this.container.call(a.setClipUrl,N,this.gd),this.bg.attr({x:h,y:p,width:d,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),b||k){var z=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(z);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));b&&this.hbar.on(".drag",null).call(q),k&&this.vbar.on(".drag",null).call(q)}this.setTranslate(t,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},s.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},s.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,i=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=t+this._vbarYMin,s=a+this._vbarTranslateMax;t=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(e,t)},s.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(a.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var i=e/r;this.hbar.call(a.setTranslate,e+i*this._hbarTranslateMax,t)}if(this.vbar){var s=t/n;this.vbar.call(a.setTranslate,e,t+s*this._vbarTranslateMax)}}},84284:function(e){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},36208:function(e){"use strict";e.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},48164:function(e){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},26880:function(e){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},69104:function(e){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},99168:function(e){"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]}},87792:function(e){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},13448:function(e){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},39032:function(e){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},2264:function(e,t){"use strict";t.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],t.STYLE=t.CSS_DECLARATIONS.map((function(e){return e.join(": ")+"; "})).join("")},9616:function(e,t){"use strict";t.xmlns="http://www.w3.org/2000/xmlns/",t.svg="http://www.w3.org/2000/svg",t.xlink="http://www.w3.org/1999/xlink",t.svgAttrs={xmlns:t.svg,"xmlns:xlink":t.xlink}},64884:function(e,t,r){"use strict";t.version=r(25788).version,r(88324),r(79288);for(var n=r(24040),i=t.register=n.register,a=r(22448),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},98308:function(e,t){"use strict";t.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},t.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},t.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},t.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},t.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},t.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},11864:function(e,t,r){"use strict";var n=r(20435),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(e){return Math.abs(e[1]-e[0])>s-1e-14}function A(e,t){return a(t-e,s)}function c(e,t){if(l(t))return!0;var r,n;t[0](n=i(n,s))&&(n+=s);var a=i(e,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function u(e,t,r,n,i,a,A){i=i||0,a=a||0;var c,u,g,f,h,d=l([r,n]);function p(e,t){return[e*Math.cos(t)+i,a-e*Math.sin(t)]}d?(c=0,u=o,g=s):r=i&&e<=a);var i,a},pathArc:function(e,t,r,n,i){return u(null,e,t,r,n,i,0)},pathSector:function(e,t,r,n,i){return u(null,e,t,r,n,i,1)},pathAnnulus:function(e,t,r,n,i,a){return u(e,t,r,n,i,a,1)}}},38116:function(e,t,r){"use strict";var n=r(83160).decode,i=r(63620),a=Array.isArray,o=ArrayBuffer,s=DataView;function l(e){return o.isView(e)&&!(e instanceof s)}function A(e){return a(e)||l(e)}t.isTypedArray=l,t.isArrayOrTypedArray=A,t.isArray1D=function(e){return!A(e[0])},t.ensureArray=function(e,t){return a(e)||(e=[]),e.length=t,e};var c={u1c:"undefined"===typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:"undefined"===typeof Int8Array?void 0:Int8Array,u1:"undefined"===typeof Uint8Array?void 0:Uint8Array,i2:"undefined"===typeof Int16Array?void 0:Int16Array,u2:"undefined"===typeof Uint16Array?void 0:Uint16Array,i4:"undefined"===typeof Int32Array?void 0:Int32Array,u4:"undefined"===typeof Uint32Array?void 0:Uint32Array,f4:"undefined"===typeof Float32Array?void 0:Float32Array,f8:"undefined"===typeof Float64Array?void 0:Float64Array};function u(e){return e.constructor===ArrayBuffer}function g(e,t,r){if(A(e)){if(A(e[0])){for(var n=r,i=0;ii.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,i){e%1||!n(e)||void 0!==i.min&&ei.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!==typeof e){var i="number"===typeof e;!0!==n.strict&&i?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){i(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return i(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var i=n.regex||c(r);"string"===typeof e&&i.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"===typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"===typeof e){for(var i=e.split("+"),a=0;a=n&&e<=i?e:c}if("string"!==typeof e&&"number"!==typeof e)return c;e=String(e);var A=E(r),y=e.charAt(0);!A||"G"!==y&&"g"!==y||(e=e.substr(1),r="");var C=A&&"chinese"===r.substr(0,7),B=e.match(C?I:m);if(!B)return c;var b=B[1],x=B[3]||"1",w=Number(B[5]||1),Q=Number(B[7]||0),_=Number(B[9]||0),S=Number(B[11]||0);if(A){if(2===b.length)return c;var k;b=Number(b);try{var D=p.getComponentMethod("calendars","getCal")(r);if(C){var T="i"===x.charAt(x.length-1);x=parseInt(x,10),k=D.newDate(b,D.toMonthIndex(b,x,T),w)}else k=D.newDate(b,Number(x),w)}catch(R){return c}return k?(k.toJD()-d)*u+Q*g+_*f+S*h:c}b=2===b.length?(Number(b)+2e3-v)%100+v:Number(b),x-=1;var M=new Date(Date.UTC(2e3,x,w,Q,_));return M.setUTCFullYear(b),M.getUTCMonth()!==x||M.getUTCDate()!==w?c:M.getTime()+S*h},n=t.MIN_MS=t.dateTime2ms("-9999"),i=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(e,r){return t.dateTime2ms(e,r)!==c};var B=90*u,b=3*g,x=5*f;function w(e,t,r,n,i){if((t||r||n||i)&&(e+=" "+C(t,2)+":"+C(r,2),(n||i)&&(e+=":"+C(n,2),i))){for(var a=4;i%10===0;)a-=1,i/=10;e+="."+C(i,a)}return e}t.ms2DateTime=function(e,t,r){if("number"!==typeof e||!(e>=n&&e<=i))return c;t||(t=0);var a,o,s,A,m,I,v=Math.floor(10*l(e+.05,1)),C=Math.round(e-v/10);if(E(r)){var Q=Math.floor(C/u)+d,_=Math.floor(l(e,u));try{a=p.getComponentMethod("calendars","getCal")(r).fromJD(Q).formatDate("yyyy-mm-dd")}catch(S){a=y("G%Y-%m-%d")(new Date(C))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=t=n+u&&e<=i-u))return c;var t=Math.floor(10*l(e+.05,1)),r=new Date(Math.round(e-t/10));return w(a("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},t.cleanDate=function(e,r,n){if(e===c)return r;if(t.isJSDate(e)||"number"===typeof e&&isFinite(e)){if(E(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",e),r;if(!(e=t.ms2DateTimeLocal(+e))&&void 0!==r)return r}else if(!t.isDateTime(e,n))return s.error("unrecognized date",e),r;return e};var Q=/%\d?f/g,_=/%h/g,S={1:"1",2:"1",3:"2",4:"2"};function k(e,t,r,n){e=e.replace(Q,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(t+.05));if(e=e.replace(_,(function(){return S[r("%q")(i)]})),E(n))try{e=p.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(a){return"Invalid"}return r(e)(i)}var D=[59,59.9,59.99,59.999,59.9999];t.formatDate=function(e,t,r,n,i,a){if(i=E(i)&&i,!t)if("y"===r)t=a.year;else if("m"===r)t=a.month;else{if("d"!==r)return function(e,t){var r=l(e+.05,u),n=C(Math.floor(r/g),2)+":"+C(l(Math.floor(r/f),60),2);if("M"!==t){o(t)||(t=0);var i=(100+Math.min(l(e/h,60),D[t])).toFixed(t).substr(1);t>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(e,r)+"\n"+k(a.dayMonthYear,e,n,i);t=a.dayMonth+"\n"+a.year}return k(t,e,n,i)};var T=3*u;t.incrementMonth=function(e,t,r){r=E(r)&&r;var n=l(e,u);if(e=Math.round(e-n),r)try{var i=Math.round(e/u)+d,a=p.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return t%12?a.add(o,t,"m"):a.add(o,t/12,"y"),(o.toJD()-d)*u+n}catch(c){s.error("invalid ms "+e+" in calendar "+r)}var A=new Date(e+T);return A.setUTCMonth(A.getUTCMonth()+t)+n-T},t.findExactDates=function(e,t){for(var r,n,i=0,a=0,s=0,l=0,A=E(t)&&p.getComponentMethod("calendars","getCal")(t),c=0;c0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===s||"FJI"===s?function(e){var t;if(null===A(e))t=e;else for(t=new Array(e.length),i=0;it?r[n++]=[e[i][0]+360,e[i][1]]:i===t?(r[n++]=e[i],r[n++]=[e[i][0],-90]):r[n++]=e[i];var a=g.tester(r);a.pts.pop(),l.push(a)}:function(e){l.push(g.tester(e))},a.type){case"MultiPolygon":for(r=0;ri&&(i=A,t=l)}else t=r;return o.default(t).geometry.coordinates}(c),n.fIn=e,n.fOut=c,s.push(c)}else A.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var g=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+e)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},t.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},t.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r1||d<0||d>1?null:{x:e+l*d,y:t+u*d}}function l(e,t,r,n,i){var a=n*e+i*t;if(a<0)return n*n+i*i;if(a>r){var o=n-e,s=i-t;return o*o+s*s}var l=n*t-i*e;return l*l/r}t.segmentsIntersect=s,t.segmentDistance=function(e,t,r,n,i,a,o,A){if(s(e,t,r,n,i,a,o,A))return 0;var c=r-e,u=n-t,g=o-i,f=A-a,h=c*c+u*u,d=g*g+f*f,p=Math.min(l(c,u,h,i-e,a-t),l(c,u,h,o-e,A-t),l(g,f,d,e-i,t-a),l(g,f,d,r-i,n-a));return Math.sqrt(p)},t.getTextLocation=function(e,t,r,s){if(e===i&&s===a||(n={},i=e,a=s),n[r])return n[r];var l=e.getPointAtLength(o(r-s/2,t)),A=e.getPointAtLength(o(r+s/2,t)),c=Math.atan((A.y-l.y)/(A.x-l.x)),u=e.getPointAtLength(o(r,t)),g={x:(4*u.x+l.x+A.x)/6,y:(4*u.y+l.y+A.y)/6,theta:c};return n[r]=g,g},t.clearLocationCache=function(){i=null},t.getVisibleSegment=function(e,t,r){var n,i,a=t.left,o=t.right,s=t.top,l=t.bottom,A=0,c=e.getTotalLength(),u=c;function g(t){var r=e.getPointAtLength(t);0===t?n=r:t===c&&(i=r);var A=r.xo?r.x-o:0,u=r.yl?r.y-l:0;return Math.sqrt(A*A+u*u)}for(var f=g(A);f;){if((A+=f+r)>u)return;f=g(A)}for(f=g(u);f;){if(A>(u-=f+r))return;f=g(u)}return{min:A,max:u,len:u-A,total:c,isClosed:0===A&&u===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},t.findPointOnPath=function(e,t,r,n){for(var i,a,o,s=(n=n||{}).pathLength||e.getTotalLength(),l=n.tolerance||.001,A=n.iterationLimit||30,c=e.getPointAtLength(0)[r]>e.getPointAtLength(s)[r]?-1:1,u=0,g=0,f=s;u0?f=i:g=i,u++}return a}},33040:function(e,t,r){"use strict";var n=r(38248),i=r(49760),a=r(72160),o=r(8932),s=r(22548).defaultLine,l=r(38116).isArrayOrTypedArray,A=a(s),c=1;function u(e,t){var r=e;return r[3]*=t,r}function g(e){if(n(e))return A;var t=a(e);return t.length?t:A}function f(e){return n(e)?e:c}e.exports={formatColor:function(e,t,r){var n=e.color;n&&n._inputArray&&(n=n._inputArray);var i,s,h,d,p,y=l(n),m=l(t),I=o.extractOpts(e),v=[];if(i=void 0!==I.colorscale?o.makeColorScaleFuncFromTrace(e):g,s=y?function(e,t){return void 0===e[t]?A:a(i(e[t]))}:g,h=m?function(e,t){return void 0===e[t]?c:f(e[t])}:f,y||m)for(var E=0;E1?(r*e+r*t)/r:e+t,i=String(n).length;if(i>16){var a=String(t).length;if(i>=String(e).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},3400:function(e,t,r){"use strict";var n=r(33428),i=r(94336).E9,a=r(57624).E9,o=r(38248),s=r(39032),l=s.FP_SAFE,A=-l,c=s.BADNUM,u=e.exports={};u.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var g={};u.warnBadFormat=function(e){var t=String(e);g[t]||(g[t]=1,u.warn('encountered bad format: "'+t+'"'))},u.noFormat=function(e){return String(e)},u.numberFormat=function(e){var t;try{t=a(u.adjustFormat(e))}catch(r){return u.warnBadFormat(e),u.noFormat}return t},u.nestedProperty=r(22296),u.keyedContainer=r(37804),u.relativeAttr=r(23193),u.isPlainObject=r(63620),u.toLogRange=r(36896),u.relinkPrivateKeys=r(51528);var f=r(38116);u.isArrayBuffer=f.isArrayBuffer,u.isTypedArray=f.isTypedArray,u.isArrayOrTypedArray=f.isArrayOrTypedArray,u.isArray1D=f.isArray1D,u.ensureArray=f.ensureArray,u.concat=f.concat,u.maxRowLength=f.maxRowLength,u.minRowLength=f.minRowLength;var h=r(20435);u.mod=h.mod,u.modHalf=h.modHalf;var d=r(63064);u.valObjectMeta=d.valObjectMeta,u.coerce=d.coerce,u.coerce2=d.coerce2,u.coerceFont=d.coerceFont,u.coercePattern=d.coercePattern,u.coerceHoverinfo=d.coerceHoverinfo,u.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,u.validate=d.validate;var p=r(67555);u.dateTime2ms=p.dateTime2ms,u.isDateTime=p.isDateTime,u.ms2DateTime=p.ms2DateTime,u.ms2DateTimeLocal=p.ms2DateTimeLocal,u.cleanDate=p.cleanDate,u.isJSDate=p.isJSDate,u.formatDate=p.formatDate,u.incrementMonth=p.incrementMonth,u.dateTick0=p.dateTick0,u.dfltRange=p.dfltRange,u.findExactDates=p.findExactDates,u.MIN_MS=p.MIN_MS,u.MAX_MS=p.MAX_MS;var y=r(14952);u.findBin=y.findBin,u.sorterAsc=y.sorterAsc,u.sorterDes=y.sorterDes,u.distinctVals=y.distinctVals,u.roundUp=y.roundUp,u.sort=y.sort,u.findIndexOfMin=y.findIndexOfMin,u.sortObjectKeys=r(95376);var m=r(63084);u.aggNums=m.aggNums,u.len=m.len,u.mean=m.mean,u.median=m.median,u.midRange=m.midRange,u.variance=m.variance,u.stdev=m.stdev,u.interp=m.interp;var I=r(52248);u.init2dArray=I.init2dArray,u.transposeRagged=I.transposeRagged,u.dot=I.dot,u.translationMatrix=I.translationMatrix,u.rotationMatrix=I.rotationMatrix,u.rotationXYMatrix=I.rotationXYMatrix,u.apply3DTransform=I.apply3DTransform,u.apply2DTransform=I.apply2DTransform,u.apply2DTransform2=I.apply2DTransform2,u.convertCssMatrix=I.convertCssMatrix,u.inverseTransformMatrix=I.inverseTransformMatrix;var v=r(11864);u.deg2rad=v.deg2rad,u.rad2deg=v.rad2deg,u.angleDelta=v.angleDelta,u.angleDist=v.angleDist,u.isFullCircle=v.isFullCircle,u.isAngleInsideSector=v.isAngleInsideSector,u.isPtInsideSector=v.isPtInsideSector,u.pathArc=v.pathArc,u.pathSector=v.pathSector,u.pathAnnulus=v.pathAnnulus;var E=r(98308);u.isLeftAnchor=E.isLeftAnchor,u.isCenterAnchor=E.isCenterAnchor,u.isRightAnchor=E.isRightAnchor,u.isTopAnchor=E.isTopAnchor,u.isMiddleAnchor=E.isMiddleAnchor,u.isBottomAnchor=E.isBottomAnchor;var C=r(92348);u.segmentsIntersect=C.segmentsIntersect,u.segmentDistance=C.segmentDistance,u.getTextLocation=C.getTextLocation,u.clearLocationCache=C.clearLocationCache,u.getVisibleSegment=C.getVisibleSegment,u.findPointOnPath=C.findPointOnPath;var B=r(92880);u.extendFlat=B.extendFlat,u.extendDeep=B.extendDeep,u.extendDeepAll=B.extendDeepAll,u.extendDeepNoArrays=B.extendDeepNoArrays;var b=r(24248);u.log=b.log,u.warn=b.warn,u.error=b.error;var x=r(53756);u.counterRegex=x.counter;var w=r(91200);u.throttle=w.throttle,u.throttleDone=w.done,u.clearThrottle=w.clear;var Q=r(52200);function _(e){var t={};for(var r in e)for(var n=e[r],i=0;il||e=t)&&o(e)&&e>=0&&e%1===0},u.noop=r(16628),u.identity=r(35536),u.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},u.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},u.simpleMap=function(e,t,r,n,i){for(var a=e.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(u.warn("randstr failed uniqueness"),l):e(t,r,n,(i||0)+1):l},u.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},u.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,i,a,o=e.length,s=2*o,l=2*t-1,A=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=e[i]*A[n];c[r]=a}return c},u.syncOrAsync=function(e,t,r){var n;function i(){return u.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(i);return r&&r(t)},u.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},u.noneOrAll=function(e,t,r){if(e){var n,i,a=!1,o=!0;for(n=0;n0?t:0}))},u.fillArray=function(e,t,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(e))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var L=/^\w*$/;u.templateString=function(e,t){var r={};return e.replace(u.TEMPLATE_STRING_REGEX,(function(e,n){var i;return L.test(n)?i=t[n]:(r[n]=r[n]||u.nestedProperty(t,n).get,i=r[n]()),u.isValidTextValue(i)?i:""}))};var N={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return U.apply(N,arguments)};var F={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return U.apply(F,arguments)};var O=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,P={max:10,count:0,name:"texttemplate",parseMultDiv:!0};u.texttemplateStringForShapes=function(){return U.apply(P,arguments)};var G=/^[:|\|]/;function U(e,t,r){var n=this,a=arguments;t||(t={});var o={};return e.replace(u.TEMPLATE_STRING_REGEX,(function(e,s,l){var A="_xother"===s||"_yother"===s,c="_xother_"===s||"_yother_"===s,g="xother_"===s||"yother_"===s,f="xother"===s||"yother"===s||A||g||c,h=s;(A||c)&&(h=h.substring(1)),(g||c)&&(h=h.substring(0,h.length-1));var d,p,y,m=null,I=null;if(n.parseMultDiv){var v=function(e){var t=e.match(O);return t?{key:t[1],op:t[2],number:Number(t[3])}:{key:e,op:null,number:null}}(h);h=v.key,m=v.op,I=v.number}if(f){if(void 0===(d=t[h]))return""}else for(y=3;y=48&&o<=57,A=s>=48&&s<=57;if(l&&(n=10*n+o-48),A&&(i=10*i+s-48),!l||!A){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var z=2e9;u.seedPseudoRandom=function(){z=2e9},u.pseudoRandom=function(){var e=z;return z=(69069*z+1)%4294967296,Math.abs(z-e)<429496729?u.pseudoRandom():z/4294967296},u.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},i=u.extractOption(e,t,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(e,t,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(e){return e||0===e},u.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(A=1):A=0,u.strTranslate(i-A*(r+o),a-A*(n+s))+u.strScale(A)+(l?"rotate("+l+(t?"":" "+r+" "+n)+")":"")},u.setTransormAndDisplay=function(e,t){e.attr("transform",u.getTextTransform(t)),e.style("display",t.scale?null:"none")},u.ensureUniformFontSize=function(e,t){var r=u.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},u.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},u.bigFont=function(e){return Math.round(1.2*e)};var q=u.getFirefoxVersion(),H=null!==q&&q<86;u.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},63620:function(e){"use strict";e.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},37804:function(e,t,r){"use strict";var n=r(22296),i=/^\w*$/;e.exports=function(e,t,r,a){var o,s,l;r=r||"name",a=a||"value";var A={};t&&t.length?(l=n(e,t),s=l.get()):s=e,t=t||"";var c={};if(s)for(o=0;o2)return A[t]=2|A[t],g.set(e,null);if(u){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},a.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},a.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},30988:function(e,t,r){"use strict";var n=r(33428);e.exports=function(e,t,r){var i=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=e.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(e){e[0][a]=n.select(this)})),i}},52248:function(e,t,r){"use strict";var n=r(36524);t.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},22296:function(e,t,r){"use strict";var n=r(38248),i=r(38116).isArrayOrTypedArray;function a(e,t){return function(){var r,n,o,s,l,A=e;for(s=0;s/g),l=0;la||A===i||As)&&(!t||!l(e))}:function(e,t){var l=e[0],A=e[1];if(l===i||la||A===i||As)return!1;var c,u,g,f,h,d=r.length,p=r[0][0],y=r[0][1],m=0;for(c=1;cMath.max(u,p)||A>Math.max(g,y)))if(Ac||Math.abs(n(o,g))>i)return!0;return!1},a.filter=function(e,t){var r=[e[0]],n=0,i=0;function o(o){e.push(o);var s=r.length,l=n;r.splice(i+1);for(var A=l+1;A1&&o(e.pop()),{addPt:o,raw:e,filtered:r}}},5048:function(e,t,r){"use strict";var n=r(16576),i=r(28624);e.exports=function(e,t,a){var o=e._fullLayout,s=!0;return o._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(a);else if(!n.pick||o._has("parcoords")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||r.g.devicePixelRatio,extensions:t||[],cachedCode:a||{}})}catch(l){s=!1}n.regl||(s=!1),s&&this.addEventListener("webglcontextlost",(function(t){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:t,layer:n.key})}),!1)}})),s||n({container:o._glcontainer.node()}),s}},34296:function(e,t,r){"use strict";var n=r(38248),i=r(25928);e.exports=function(e){var t;if("string"!==typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;return"undefined"!==typeof navigator&&(e=navigator.userAgent),e&&e.headers&&"string"===typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),e}()))return!0;var r=i({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var a=t.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var A=l.substr(8).split(".")[0];if(n(A)&&(A=+A),A>=13)return!0}}return r}},52416:function(e){"use strict";e.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;ni.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}t.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-s)-1:Math.floor((e-t.start)/t.size+s);var a,o,g=0,f=t.length,h=0,d=f>1?(t[f-1]-t[0])/(f-1):1;for(o=d>=0?r?l:A:r?u:c,e+=d*s*(r?-1:1)*(d>=0?1:-1);g90&&i.log("Long binary search..."),g-1},t.sorterAsc=function(e,t){return e-t},t.sorterDes=function(e,t){return t-e},t.distinctVals=function(e){var r,n=e.slice();for(n.sort(t.sorterAsc),r=n.length-1;r>-1&&n[r]===o;r--);for(var i,a=n[r]-n[0]||1,s=a/(r||1)/1e4,l=[],A=0;A<=r;A++){var c=n[A],u=c-i;void 0===i?(l.push(c),i=c):u>s&&(a=Math.min(a,u),l.push(c),i=c)}return{vals:l,minDiff:a}},t.roundUp=function(e,t,r){for(var n,i=0,a=t.length-1,o=0,s=r?0:1,l=r?1:0,A=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},t.findIndexOfMin=function(e,t){t=t||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(r)||(r=!1),i(a[0])){for(l=new Array(o),s=0;se.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},43080:function(e,t,r){"use strict";var n=r(72160);e.exports=function(e){return e?n(e):[0,0,0,1]}},9188:function(e,t,r){"use strict";var n=r(2264),i=r(43616),a=r(3400),o=null;e.exports=function(){if(null!==o)return o;o=!1;var e=a.isIE()||a.isSafari()||a.isIOS();if(window.navigator.userAgent&&!e){var t=Array.from(n.CSS_DECLARATIONS).reverse(),r=window.CSS&&window.CSS.supports||window.supportsCSS;if("function"===typeof r)o=t.some((function(e){return r.apply(null,e)}));else{var s=i.tester.append("image").attr("style",n.STYLE),l=window.getComputedStyle(s.node()).imageRendering;o=t.some((function(e){var t=e[1];return l===t||l===t.toLowerCase()})),s.remove()}}return o}},72736:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=i.strTranslate,o=r(9616),s=r(84284).LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;t.convertToTspans=function(e,r,p){var Q=e.text(),_=!e.attr("data-notex")&&r&&r._context.typesetMath&&"undefined"!==typeof MathJax&&Q.match(l),D=n.select(e.node().parentNode);if(!D.empty()){var T=e.attr("class")?e.attr("class").split(" ")[0]:"text";return T+="-math",D.selectAll("svg."+T).remove(),D.selectAll("g."+T+"-group").remove(),e.style("display",null).attr({"data-unformatted":Q,"data-math":"N"}),_?(r&&r._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var a,o,s,l,g=parseInt((MathJax.version||"").split(".")[0]);if(2===g||3===g){var f=function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:u},displayAlign:"left"})},h=function(){o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=u},d=function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},p=function(){"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg")},y=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(A,"\\lt ").replace(c,"\\gt "))).node();return 2===g?MathJax.Hub.Typeset(a):MathJax.typeset([a])},m=function(){var t=l.select(2===g?".MathJax_SVG":".MathJax"),a=!t.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===g?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,s)}else i.log("There was an error in the tex syntax.",e),r();l.remove()},I=function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)},v=function(){"svg"!==a&&(MathJax.config.startup.output=a)},E=function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)},C=function(){MathJax.config=o};2===g?MathJax.Hub.Queue(f,d,y,m,I,E):3===g&&(h(),p(),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){y(),m(),v(),C()})))}else i.warn("No MathJax version:",MathJax.version)}(_[2],o,(function(n,i,o){D.selectAll("svg."+T).remove(),D.selectAll("g."+T+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return M(),void t();var l=D.append("g").classed(T+"-group",!0).attr({"pointer-events":"none","data-unformatted":Q,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var A=o.width,c=o.height;s.attr({class:T,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=e.node().style.fill||"black",g=s.select("g");g.attr({fill:u,stroke:u});var f=g.node().getBoundingClientRect(),h=f.width,d=f.height;(h>A||d>c)&&(s.style("overflow","hidden"),h=(f=s.node().getBoundingClientRect()).width,d=f.height);var y=+e.attr("x"),m=+e.attr("y"),I=-(r||e.node().getBoundingClientRect().height)/4;if("y"===T[0])l.attr({transform:"rotate("+[-90,y,m]+")"+a(-h/2,I-d/2)});else if("l"===T[0])m=I-d/2;else if("a"===T[0]&&0!==T.indexOf("atitle"))y=0,m=I;else{var v=e.attr("text-anchor");y-=h*("middle"===v?.5:"end"===v?1:0),m=m+I-d/2}s.attr({x:y,y:m}),p&&p.call(e,l),t(l)}))}))):M(),e}function M(){D.empty()||(T=e.attr("class")+"-math",D.select("svg."+T).remove()),e.text("").style("white-space","pre");var r=function(e,t){t=t.replace(y," ");var r,a=!1,l=[],A=-1;function c(){A++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:A*s+"em"}),e.appendChild(t),r=t;var i=l;if(l=[{node:t}],i.length>1)for(var a=1;a doesnt match end tag <"+e+">. Pretending it did match.",t),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",t)}var _=v.test(t);_?c():(r=e,l=[{node:e}]);for(var D=t.split(m),T=0;T|>|>)/g,u=[["$","$"],["\\(","\\)"]],g={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},f={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},d="\u200b",p=["http:","https:","mailto:","",void 0,":"],y=t.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,I=/<(\/?)([^ >]*)(\s+(.*))?>/i,v=//i;t.BR_TAG_ALL=//gi;var E=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,C=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,B=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,b=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function x(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var w=/(^|;)\s*color:/;t.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],i=e.split(m),a=[],o="",s=0,l=0;l3?a.push(A.substr(0,f-3)+"..."):a.push(A.substr(0,f));break}o=""}}return a.join("")};var Q={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},_=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(e){return e.replace(_,(function(e,t){return("#"===t.charAt(0)?function(e){if(!(e>1114111)){var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):Q[t])||e}))}function k(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var i=r.protocol,a=n.protocol;return-1!==p.indexOf(i)&&-1!==p.indexOf(a)?t:""}function D(e,t,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",A=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return A.bottom-n.height}:"middle"===l?function(){return A.top+(A.height-n.height)/2}:function(){return A.top},o="right"===s?function(){return A.right-n.width}:"center"===s?function(){return A.left+(A.width-n.width)/2}:function(){return A.left},function(){n=this.node().getBoundingClientRect();var e=o()-c.left,t=a()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(e,t);e=l[0],t=l[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}t.convertEntities=S,t.sanitizeHTML=function(e){e=e.replace(y," ");for(var t=document.createElement("p"),r=t,i=[],a=e.split(m),o=0;oa.ts+t?l():a.timer=setTimeout((function(){l(),a.timer=null}),t)},t.done=function(e){var t=r[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},t.clear=function(e){if(e)n(r[e]),delete r[e];else for(var i in r)t.clear(i)}},36896:function(e,t,r){"use strict";var n=r(38248);e.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},59972:function(e,t,r){"use strict";var n=e.exports={},i=r(79552).locationmodeToLayer,a=r(55712).NO;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=i[e.locationmode],n=t.objects[r];return a(t,n).features}},11680:function(e){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},6580:function(e){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},69820:function(e,t,r){"use strict";var n=r(24040);e.exports=function(e){for(var t,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=e.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},t.cleanLayout=function(e){var r,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,u=(s.subplotsRegistry.ternary||{}).attrRegex,g=(s.subplotsRegistry.gl3d||{}).attrRegex,d=Object.keys(e);for(r=0;r3?(M.x=1.02,M.xanchor="left"):M.x<-2&&(M.x=-.02,M.xanchor="right"),M.y>3?(M.y=1.02,M.yanchor="bottom"):M.y<-2&&(M.y=-.02,M.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),A.clean(e),e.template&&e.template.layout&&t.cleanLayout(e.template.layout),e},t.cleanData=function(e){for(var r=0;r0)return e.substr(0,t)}t.hasParent=function(e,t){for(var r=v(t);r;){if(r in e)return!0;r=v(r)}return!1};var E=["x","y","z"];t.clearAxisTypes=function(e,t,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",u);var m=r[""][""];if(A(m))t.set(null);else{if(!Array.isArray(m))return a.warn("Unrecognized full array edit value",u,m),!0;t.set(m)}return!d&&(g(p,y),f(e),!0)}var I,v,E,C,B,b,x,w,Q=Object.keys(r).map(Number).sort(o),_=t.get(),S=_||[],k=c(y,u).get(),D=[],T=-1,M=S.length;for(I=0;IS.length-(x?0:1))a.warn("index out of range",u,E);else if(void 0!==b)B.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",u,E),A(b)?D.push(E):x?("add"===b&&(b={}),S.splice(E,0,b),k&&k.splice(E,0,{})):a.warn("Unrecognized full object edit value",u,E,b),-1===T&&(T=E);else for(v=0;v=0;I--)S.splice(D[I],1),k&&k.splice(D[I],1);if(S.length?_||t.set(S):t.set(null),d)return!1;if(g(p,y),h!==i){var R;if(-1===T)R=Q;else{for(M=Math.max(S.length,M),R=[],I=0;I=T);I++)R.push(E);for(I=T;I=e.data.length||i<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(i,n+1)>-1||i>=0&&t.indexOf(-e.data.length+i)>-1||i<0&&t.indexOf(e.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function R(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"===typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),M(e,t,"currentIndices"),"undefined"===typeof r||Array.isArray(r)||(r=[r]),"undefined"!==typeof r&&M(e,r,"newIndices"),"undefined"!==typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function L(e,t,r,n,a){!function(e,t,r,n){var i=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))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");for(var a in M(e,r,"indices"),t){if(!Array.isArray(t[a])||t[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==t[a].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")}}(e,t,r,n);for(var l=function(e,t,r,n){var a,l,A,c,u,g=o.isPlainObject(n),f=[];for(var h in Array.isArray(r)||(r=[r]),r=T(r,e.data.length-1),t)for(var d=0;d-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(t,r){e[r]=e[t],delete e[t]}}function q(e,t,r){e=o.getGraphDiv(e),B.clearPromiseQueue(e);var n={};if("string"===typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var i=V(e,n),a=i.flags;a.calc&&(e.calcdata=void 0);var s=[g.previousPromises];a.layoutReplot?s.push(b.layoutReplot):Object.keys(n).length&&(H(e,a,i)||g.supplyDefaults(e),a.legend&&s.push(b.doLegend),a.layoutstyle&&s.push(b.layoutStyles),a.axrange&&Y(s,i.rangesAltered),a.ticks&&s.push(b.doTicksRelayout),a.modebar&&s.push(b.doModeBar),a.camera&&s.push(b.doCamera),a.colorbars&&s.push(b.doColorBars),s.push(_)),s.push(g.rehover,g.redrag,g.reselect),A.add(e,q,[e,i.undoit],q,[e,i.redoit]);var l=o.syncOrAsync(s,e);return l&&l.then||(l=Promise.resolve(e)),l.then((function(){return e.emit("plotly_relayout",i.eventData),e}))}function H(e,t,r){var n,i,a=e._fullLayout;if(!t.axrange)return!1;for(var s in t)if("axrange"!==s&&t[s])return!1;var l=function(e,t){return o.coerce(n,i,d,e,t)},A={};for(var c in r.rangesAltered){var u=f.id2name(c);if(n=e.layout[u],i=a[u],h(n,i,l,A),i._matchGroup)for(var g in i._matchGroup)if(g!==c){var p=a[f.id2name(g)];p.autorange=i.autorange,p.range=i.range.slice(),p._input.range=i.range.slice()}}return!0}function Y(e,t){var r=t?function(e){var r=[];for(var n in t){var i=f.getFromId(e,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)t[a]||r.push(a)}return f.draw(e,r,{skipTitle:!0})}:function(e){return f.draw(e,"redraw")};e.push(v,b.doAutoRangeAndConstraints,r,b.drawData,b.finalDraw)}var J=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,K=/^[xyz]axis[0-9]*\.autorange$/,j=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function V(e,t){var r,n,i,a=e.layout,l=e._fullLayout,A=l._guiEditing,g=P(l._preGUI,A),h=Object.keys(t),d=f.list(e),p=o.extendDeepAll({},t),y={};for(z(t),h=Object.keys(t),n=0;n0&&"string"!==typeof M.parts[L];)L--;var N=M.parts[L],F=M.parts[L-1]+"."+N,G=M.parts.slice(0,L).join("."),U=s(e.layout,G).get(),q=s(l,G).get(),H=M.get();if(void 0!==R){b[T]=R,Q[T]="reverse"===N?R:O(H);var Y=u.getLayoutValObject(l,M.parts);if(Y&&Y.impliedEdits&&null!==R)for(var V in Y.impliedEdits)_(o.relativeAttr(T,V),Y.impliedEdits[V]);if(-1!==["width","height"].indexOf(T))if(R){_("autosize",null);var Z="height"===T?"width":"height";_(Z,l[Z])}else l[T]=e._initialAutoSize[T];else if("autosize"===T)_("width",R?null:l.width),_("height",R?null:l.height);else if(F.match(J))D(F),s(l,G+"._inputRange").set(null);else if(F.match(K)){D(F),s(l,G+"._inputRange").set(null);var X=s(l,G).get();X._inputDomain&&(X._input.domain=X._inputDomain.slice())}else F.match(j)&&s(l,G+"._inputDomain").set(null);if("type"===N){S=U;var $="linear"===q.type&&"log"===R,ee="log"===q.type&&"linear"===R;if($||ee){if(S&&S.range)if(q.autorange)$&&(S.range=S.range[1]>S.range[0]?[1,2]:[2,1]);else{var te=S.range[0],re=S.range[1];$?(te<=0&&re<=0&&_(G+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),_(G+".range[0]",Math.log(te)/Math.LN10),_(G+".range[1]",Math.log(re)/Math.LN10)):(_(G+".range[0]",Math.pow(10,te)),_(G+".range[1]",Math.pow(10,re)))}else _(G+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[M.parts[0]]&&"radialaxis"===M.parts[1]&&delete l[M.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(e,q,R,_),c.getComponentMethod("images","convertCoords")(e,q,R,_)}else _(G+".autorange",!0),_(G+".range",null);s(l,G+"._inputRange").set(null)}else if(N.match(w)){var ne=s(l,T).get(),ie=(R||{}).type;ie&&"-"!==ie||(ie="linear"),c.getComponentMethod("annotations","convertCoords")(e,ne,ie,_),c.getComponentMethod("images","convertCoords")(e,ne,ie,_)}var ae=C.containerArrayMatch(T);if(ae){r=ae.array,n=ae.index;var oe=ae.property,se=Y||{editType:"calc"};""!==n&&""===oe&&(C.isAddVal(R)?Q[T]=null:C.isRemoveVal(R)?Q[T]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",t)),x.update(E,se),y[r]||(y[r]={});var le=y[r][n];le||(le=y[r][n]={}),le[oe]=R,delete t[T]}else"reverse"===N?(U.range?U.range.reverse():(_(G+".autorange",!0),U.range=[1,0]),q.autorange?E.calc=!0:E.plot=!0):("dragmode"===T&&(!1===R&&!1!==H||!1!==R&&!1===H)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===T&&("lasso"===R||"select"===R)&&"lasso"!==H&&"select"!==H||l._has("gl2d")?E.plot=!0:Y?x.update(E,Y):E.calc=!0,M.set(R))}}for(r in y)C.applyContainerArrayChanges(e,g(a,r),y[r],E,g)||(E.plot=!0);for(var Ae in k){var ce=(S=f.getFromId(e,Ae))&&S._constraintGroup;if(ce)for(var ue in E.calc=!0,ce)k[ue]||(f.getFromId(e,ue)._constraintShrinkable=!0)}(W(e)||t.height||t.width)&&(E.plot=!0);var ge=l.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=s(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r=i.length?i[0]:i[e]:i}function l(e){return Array.isArray(a)?e>=a.length?a[0]:a[e]:a}function A(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,c){function u(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,g.transition(e,t.frame.data,t.frame.layout,B.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function f(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&u()};t()}var h,d,p=0;function y(e){return Array.isArray(i)?p>=i.length?e.transitionOpts=i[p]:e.transitionOpts=i[0]:e.transitionOpts=i,p++,e}var m=[],I=void 0===t||null===t,v=Array.isArray(t);if(I||v||!o.isPlainObject(t)){if(I||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&bb)&&x.push(d);m=x}}m.length>0?function(t){if(0!==t.length){for(var i=0;i=0;n--)if(o.isPlainObject(t[n])){var d=t[n].name,p=(c[d]||h[d]||{}).name,y=t[n].name,m=c[p]||h[p];p&&y&&"number"===typeof y&&m&&Q<5&&(Q++,o.warn('addFrames: overwriting frame "'+(c[p]||h[p]).name+'" with a frame whose name of type "number" also equates to "'+p+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===Q&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[d]={name:d},f.push({frame:g.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:u+n})}f.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"===typeof(i=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+e._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=t[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=g.modifyFrames,c=g.modifyFrames,u=[e,s],f=[e,a];return A&&A.add(e,l,u,c,f),g.modifyFrames(e,a)},t.addTraces=function e(r,n,i){r=o.getGraphDiv(r);var a,s,l=[],c=t.deleteTraces,u=e,g=[r,l],f=[r,n];for(function(e,t,r){var n,i;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"===typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!E(o))return!1;e=a[i][o]}else e=a[i]}else e=a}}return e}function E(e){return e===Math.round(e)&&e>=0}function C(){var e,t,r={};for(e in u(r,o),n.subplotsRegistry)if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[A].type]||{}).attributes)&&r[t[2]],s=3}else{var c=e._module;if(c||(c=(n.modules[e.type||a.type.dflt]||{})._module),!c)return!1;if(!(i=(r=c.attributes)&&r[o])){var u=c.basePlotModule;u&&u.attributes&&(i=u.attributes[o])}i||(i=a[o])}return v(i,t,s)},t.getLayoutValObject=function(e,t){var r=function(e,t){var r,i,a,s,l=e._basePlotModules;if(l){var A;for(r=0;r=i&&(r._input||{})._templateitemname;s&&(o=i);var l,A=t+"["+o+"]";function c(){l={},s&&(l[A]={},l[A][a]=s)}function u(e,t){s?n.nestedProperty(l[A],e).set(t):l[A+"."+e]=t}function g(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:g,applyUpdate:function(t,r){t&&u(t,r);var i=g();for(var a in i)n.nestedProperty(e,a).set(i[a])}}}},39172:function(e,t,r){"use strict";var n=r(33428),i=r(24040),a=r(7316),o=r(3400),s=r(72736),l=r(73696),A=r(76308),c=r(43616),u=r(81668),g=r(45460),f=r(54460),h=r(84284),d=r(71888),p=d.enforce,y=d.clean,m=r(19280).doAutoRange,I="start",v="middle",E="end";function C(e,t,r){for(var n=0;n=e[1]||i[1]<=e[0])&&a[0]t[0])return!0}return!1}function B(e){var r,i,s,l,u,d,p=e._fullLayout,y=p._size,m=y.p,I=f.list(e,"",!0);if(p._paperdiv.style({width:e._context.responsive&&p.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":p.width+"px",height:e._context.responsive&&p.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":p.height+"px"}).selectAll(".main-svg").call(c.setSize,p.width,p.height),e._context.setBackground(e,p.paper_bgcolor),t.drawMainTitle(e),g.manage(e),!p._has("cartesian"))return a.previousPromises(e);function v(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-m-n:t._offset+t._length+m+n:y.t+y.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+m+n:t._offset-m-n:y.l+y.w*(e.position||0)+n%1}for(r=0;r.5?"t":"b",o=e._fullLayout.margin[a],s=0;return"paper"===t.yref?s=r+t.pad.t+t.pad.b:"container"===t.yref&&(s=function(e,t,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===e?("top"===r&&(a+=i),a+=n-t*n):("bottom"===r&&(a+=i),a+=t*n),a}(a,n,i,e._fullLayout.height,r)+t.pad.t+t.pad.b),s>o?s:0}(e,r,p);if(y>0){!function(e,t,r,n){var i="title.automargin",s=e._fullLayout.title,l=s.y>.5?"t":"b",A={x:s.x,y:s.y,t:0,b:0},c={};"paper"===s.yref&&function(e,t,r,n,i){var a="paper"===t.yref?e._fullLayout._size.h:e._fullLayout.height,s=o.isTopAnchor(t)?n:n-i,l="b"===r?a-s:s;return!(o.isTopAnchor(t)&&"t"===r||o.isBottomAnchor(t)&&"b"===r)&&lB?c.push({code:"unused",traceType:m,templateCount:C,dataCount:B}):B>C&&c.push({code:"reused",traceType:m,templateCount:C,dataCount:B})}}else c.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var a=t[n],o=d(t,n,r);i(a)?(Array.isArray(t)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),e(a,o)):Array.isArray(a)&&p(a)&&e(a,o)}}({data:f,layout:g},""),c.length)return c.map(y)}},67024:function(e,t,r){"use strict";var n=r(38248),i=r(36424),a=r(7316),o=r(3400),s=r(81792),l=r(37164),A=r(63268),c=r(25788).version,u={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(e,t){var r,g,f,h;function d(e){return!(e in t)||o.validate(t[e],u[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],g=e.layout||{},f=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),g=o.extendDeep({},e.layout),f=e._context,h=e._fullLayout||{}),!d("width")&&null!==t.width||!d("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!d("format"))throw new Error("Export format is not "+o.join2(u.format.values,", "," or ")+".");var p={};function y(e,r){return o.coerce(t,p,u,e,r)}var m=y("format"),I=y("width"),v=y("height"),E=y("scale"),C=y("setBackground"),B=y("imageDataOnly"),b=document.createElement("div");b.style.position="absolute",b.style.left="-5000px",document.body.appendChild(b);var x=o.extendFlat({},g);I?x.width=I:null===t.width&&n(h.width)&&(x.width=h.width),v?x.height=v:null===t.height&&n(h.height)&&(x.height=h.height);var w=o.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:C}),Q=s.getRedrawFunc(b);function _(){return new Promise((function(e){setTimeout(e,s.getDelay(b._fullLayout))}))}function S(){return new Promise((function(e,t){var r=l(b,m,E),n=b._fullLayout.width,u=b._fullLayout.height;function g(){i.purge(b),document.body.removeChild(b)}if("full-json"===m){var f=a.graphJson(b,!1,"keepdata","object",!0,!0);return f.version=c,f=JSON.stringify(f),g(),e(B?f:s.encodeJSON(f))}if(g(),"svg"===m)return e(B?r:s.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),A({format:m,width:n,height:u,scale:E,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){i.newPlot(b,r,x,w).then(Q).then(_).then(S).then((function(t){e(function(e){return B?e.replace(s.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},21480:function(e,t,r){"use strict";var n=r(3400),i=r(7316),a=r(73060),o=r(20556).dfltConfig,s=n.isPlainObject,l=Array.isArray,A=n.isArrayOrTypedArray;function c(e,t,r,i,a,o){o=o||[];for(var u=Object.keys(e),g=0;gI.length&&i.push(f("unused",a,y.concat(I.length)));var x,w,Q,_,S,k=I.length,D=Array.isArray(b);if(D&&(k=Math.min(k,b.length)),2===v.dimensions)for(w=0;wI[w].length&&i.push(f("unused",a,y.concat(w,I[w].length)));var T=I[w].length;for(x=0;x<(D?Math.min(T,b[w].length):T);x++)Q=D?b[w][x]:b,_=m[w][x],S=I[w][x],n.validate(_,Q)?S!==_&&S!==+_&&i.push(f("dynamic",a,y.concat(w,x),_,S)):i.push(f("value",a,y.concat(w,x),_))}else i.push(f("array",a,y.concat(w),m[w]));else for(w=0;w1&&g.push(f("object","layout"))),i.supplyDefaults(h);for(var d=h._fullData,p=r.length,y=0;y0&&Math.round(u)===u))return{vals:i};A=u}for(var g=t.calendar,f="start"===l,h="end"===l,d=e[r+"period0"],p=a(d,g)||0,y=[],m=[],I=[],v=i.length,E=0;Ex;)b=o(b,-A,g);for(;b<=x;)b=o(b,A,g);B=o(b,-A,g)}else{for(b=p+(C=Math.round((x-p)/c))*c;b>x;)b-=c;for(;b<=x;)b+=c;B=b-c}y[E]=f?B:h?b:(B+b)/2,m[E]=B,I[E]=b}return{vals:y,starts:m,ends:I}}},26720:function(e){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},19280:function(e,t,r){"use strict";var n=r(33428),i=r(38248),a=r(3400),o=r(39032).FP_SAFE,s=r(24040),l=r(43616),A=r(79811),c=A.getFromId,u=A.isLinked;function g(e,t){var r,n,i=[],o=e._fullLayout,s=h(o,t,0),l=h(o,t,1),A=p(e,t),c=A.min,u=A.max;if(0===c.length||0===u.length)return a.simpleMap(t.range,t.r2l);var g=c[0].val,d=u[0].val;for(r=1;r0&&((x=k-s(v)-l(E))>D?w/x>T&&(C=v,B=E,T=w/x):w/k>T&&(C={val:v.val,nopad:1},B={val:E.val,nopad:1},T=w/k));if(g===d){var M=g-1,R=g+1;if(_)if(0===g)i=[0,1];else{var L=(g>0?u:c).reduce((function(e,t){return Math.max(e,l(t))}),0),N=g/(1-Math.min(.5,L/k));i=g>0?[0,N]:[N,0]}else i=S?[Math.max(0,M),Math.max(1,R)]:[M,R]}else _?(C.val>=0&&(C={val:0,nopad:1}),B.val<=0&&(B={val:0,nopad:1})):S&&(C.val-T*s(C)<0&&(C={val:0,nopad:1}),B.val<=0&&(B={val:1,nopad:1})),T=(B.val-C.val-f(t,v.val,E.val))/(k-s(C)-l(B)),i=[C.val-T*s(C),B.val+T*l(B)];return i=b(i,t),t.limitRange&&t.limitRange(),m&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function f(e,t,r){var n=0;if(e.rangebreaks)for(var i=e.locateBreaks(t,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),Q=x((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=x(r.vpadplus||r.vpad),S=x(r.vpadminus||r.vpad);if(!B){if(g=1/0,f=-1/0,C)for(n=0;n0&&(g=a),a>f&&a-o&&(g=a),a>f&&a=T;n--)D(n);return{min:h,max:d,opts:r}},concatExtremes:p};var d=3;function p(e,t,r){var n,i,a,o=t._id,s=e._fullData,l=e._fullLayout,A=[],u=[];function g(e,t){for(n=0;n=r&&(A.extrapad||!o)){s=!1;break}i(t,A.val)&&A.pad<=r&&(o||!A.extrapad)&&(e.splice(l,1),l--)}if(s){var c=a&&0===t;e.push({val:t,pad:c?0:r,extrapad:!c&&o})}}function v(e){return i(e)&&Math.abs(e)=t}function B(e,t,r){return void 0===t||void 0===r||(t=e.d2l(t))<(r=e.d2l(r))}function b(e,t){if(!t||!t.autorangeoptions)return e;var r=e[0],n=e[1],i=t.autorangeoptions.include;if(void 0!==i){var o=t.d2l(r),s=t.d2l(n);a.isArrayOrTypedArray(i)||(i=[i]);for(var l=0;l=A&&(o=A,r=A),s<=A&&(s=A,n=A)}}return r=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.minallowed&&B(t,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&B(t,r.clipmin,r.clipmax)?Math.max(e,t.d2l(r.clipmin)):e}(r,t),n=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.maxallowed&&B(t,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&B(t,r.clipmin,r.clipmax)?Math.min(e,t.d2l(r.clipmax)):e}(n,t),[r,n]}},76808:function(e){"use strict";e.exports=function(e,t,r){var n,i;if(r){var a="reversed"===t||"min reversed"===t||"max reversed"===t;n=r[a?1:0],i=r[a?0:1]}var o=e("autorangeoptions.minallowed",null===i?n:void 0),s=e("autorangeoptions.maxallowed",null===n?i:void 0);void 0===o&&e("autorangeoptions.clipmin"),void 0===s&&e("autorangeoptions.clipmax"),e("autorangeoptions.include")}},54460:function(e,t,r){"use strict";var n=r(33428),i=r(38248),a=r(7316),o=r(24040),s=r(3400),l=s.strTranslate,A=r(72736),c=r(81668),u=r(76308),g=r(43616),f=r(94724),h=r(98728),d=r(39032),p=d.ONEMAXYEAR,y=d.ONEAVGYEAR,m=d.ONEMINYEAR,I=d.ONEMAXQUARTER,v=d.ONEAVGQUARTER,E=d.ONEMINQUARTER,C=d.ONEMAXMONTH,B=d.ONEAVGMONTH,b=d.ONEMINMONTH,x=d.ONEWEEK,w=d.ONEDAY,Q=w/2,_=d.ONEHOUR,S=d.ONEMIN,k=d.ONESEC,D=d.MINUS_SIGN,T=d.BADNUM,M={K:"zeroline"},R={K:"gridline",L:"path"},L={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},F={K:"tick",L:"text"},O={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},P=r(84284),G=P.MID_SHIFT,U=P.CAP_SHIFT,z=P.LINE_SPACING,q=P.OPPOSITE_SIDE,H=e.exports={};H.setConvert=r(78344);var Y=r(52976),J=r(79811),K=J.idSort,j=J.isLinked;H.id2name=J.id2name,H.name2id=J.name2id,H.cleanId=J.cleanId,H.list=J.list,H.listIds=J.listIds,H.getFromId=J.getFromId,H.getFromTrace=J.getFromTrace;var V=r(19280);H.getAutoRange=V.getAutoRange,H.findExtremes=V.findExtremes;var W=1e-4;function Z(e){var t=(e[1]-e[0])*W;return[e[0]-t,e[1]+t]}H.coerceRef=function(e,t,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],A=n+"ref",c={};return i||(i=l[0]||("string"===typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(e){return e+" domain"}))),c[A]={valType:"enumerated",values:l.concat(a?"string"===typeof a?[a]:a:[]),dflt:i},s.coerce(e,t,c,A)},H.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},H.coercePosition=function(e,t,r,n,i,a){var o,l;if("range"!==H.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var A=H.getFromId(t,n);l=r(i,a=A.fraction2r(a)),o=A.cleanPos}e[i]=o(l)},H.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?s.ensureNumber:H.getFromId(t,r).cleanPos)(e)},H.redrawComponents=function(e,t){t=t||H.listIds(e);var r=e._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),A={},c=0;cn&&g2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},H.saveRangeInitial=function(e,t){for(var r=H.list(e,"",!0),n=!1,i=0;i.3*g||c(n)||c(a))){var f=r.dtick/2;e+=e+fo){var l=Number(r.substr(1));a.exactYears>o&&l%12===0?e=H.tickIncrement(e,"M6","reverse")+1.5*w:a.exactMonths>o?e=H.tickIncrement(e,"M1","reverse")+15.5*w:e-=Q;var A=H.tickIncrement(e,r);if(A<=n)return A}return e}(m,e,y,A,a)),p=m;p<=c;)p=H.tickIncrement(p,y,!1,a);return{start:t.c2r(m,0,a),end:t.c2r(p,0,a),size:y,_dataSpan:c-A}},H.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,a=t.dtick&&i(t._tmin);if(a){var o=H.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var l=s.simpleMap(t.range,t.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(e.range=s.simpleMap(n,t.l2r),e._isMinor=!0,H.prepTicks(e,r),a){var A=i(t.dtick),c=i(e.dtick),u=A?t.dtick:+t.dtick.substring(1),g=c?e.dtick:+e.dtick.substring(1);A&&c?te(u,g)?u===2*x&&g===2*w&&(e.dtick=x):u===2*x&&g===3*w?e.dtick=x:u!==x||(t._input.minor||{}).nticks?re(u/g,2.5)?e.dtick=u/2:e.dtick=u:e.dtick=w:"M"===String(t.dtick).charAt(0)?c?e.dtick="M1":te(u,g)?u>=12&&2===g&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?te(u,g)||(e.dtick=re(u/g,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},H.prepTicks=function(e,t){var r=s.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?s.bigFont(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=s.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(a*=100),e._roughDTick=Math.abs(r[1]-r[0])/a,H.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(i(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),a=H.getTickFormat(e);if(a){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(t=_,o&&!n&&e.dtick<_&&(e.dtick=_)):/%p/.test(a)?(t=Q,o&&!n&&e.dtick=(M?0:1);R--){var L=!R;R?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var N=R?e:s.extendFlat({},e,e.minor);if(L?H.prepMinorTicks(N,e,t):H.prepTicks(N,t),"array"!==N.tickmode)if("sync"!==N.tickmode){var F=Z(c),O=F[0],P=F[1],G=i(N.dtick),U="log"===a&&!(G||"L"===N.dtick.charAt(0)),z=H.tickFirst(N,t);if(R){if(e._tmin=z,z=P:K<=P;K=H.tickIncrement(K,j,u,o)){if(R&&q++,N.rangebreaks&&!u){if(K=f)break}if(k.length>h||K===J)break;J=K;var V={value:K};R?(U&&K!==(0|K)&&(V.simpleLabel=!0),l>1&&q%l&&(V.skipLabel=!0),k.push(V)):(V.minor=!0,D.push(V))}}else k=[],d=ae(e);else R?(k=[],d=oe(e,!L)):(D=[],S=oe(e,!L))}if(M&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var W=k.map((function(e){return e.value})),X=[],$=0;$0?(a=n-1,o=n):(a=n,o=n);var s,l=e[a].value,A=e[o].value,c=Math.abs(A-l),u=r||c,g=0;u>=m?g=c>=m&&c<=p?c:y:r===v&&u>=E?g=c>=E&&c<=I?c:v:u>=b?g=c>=b&&c<=C?c:B:r===x&&u>=x?g=x:u>=w?g=w:r===Q&&u>=Q?g=Q:r===_&&u>=_&&(g=_),g>=c&&(g=c,s=!0);var f=i+g;if(t.rangebreaks&&g>0){for(var h=0,d=0;d<84;d++){var S=(d+.5)/84;t.maskBreaks(i*(1-S)+S*f)!==T&&h++}(g*=h/84)||(e[n].drop=!0),s&&c>x&&(g=c)}(g>0||0===n)&&(e[n].periodX=i+g/2)}}(k,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),se=1;"auto"===e.tickmode&&(se=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=k.length-1;r>-1;r--)if(k[r].drop)k.splice(r,1);else{k[r].value=Le(k[r].value,e);var Ae=e.c2p(k[r].value);(ie?le>Ae-se:lef||uef&&(ce.periodX=f),ue10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12===0?"y":"m";else if(t>=w&&a<=10||t>=15*w)e._tickround="d";else if(t>=S&&a<=16||t>=_)e._tickround="M";else if(t>=k&&a<=19||t>=S)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(a,o)-20,e._tickround<0&&(e._tickround=4)}}else if(i(t)||"L"===t.charAt(0)){var s=e.range.map(e.r2d||Number);i(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),A=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===e.minexponent?3:e.minexponent;Math.abs(A)>c&&(me(e.exponentformat)&&!Ie(A)?e._tickexponent=3*Math.round((A-1)/3):e._tickexponent=A)}else e._tickround=null}function pe(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontColor:n.color}}H.autoTicks=function(e,t,r){var n;function a(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=s.dateTick0(e.calendar,0);var o=2*t;if(o>y)t/=y,n=a(10),e.dtick="M"+12*he(t,n,se);else if(o>B)t/=B,e.dtick="M"+he(t,1,le);else if(o>w){if(e.dtick=he(t,w,e._hasDayOfWeekBreaks?[1,2,7,14]:ce),!r){var l=H.getTickFormat(e),A="period"===e.ticklabelmode;A&&(e._rawTick0=e.tick0),/%[uVW]/.test(l)?e.tick0=s.dateTick0(e.calendar,2):e.tick0=s.dateTick0(e.calendar,1),A&&(e._dowTick0=e.tick0)}}else o>_?e.dtick=he(t,_,le):o>S?e.dtick=he(t,S,Ae):o>k?e.dtick=he(t,k,Ae):(n=a(10),e.dtick=he(t,n,se))}else if("log"===e.type){e.tick0=0;var c=s.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,n=a(10),e.dtick="L"+he(t,n,se)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Re(e)?(e.tick0=0,n=1,e.dtick=he(t,n,fe)):(e.tick0=0,n=a(10),e.dtick=he(t,n,se));if(0===e.dtick&&(e.dtick=1),!i(e.dtick)&&"string"!==typeof e.dtick){var g=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(g)}},H.tickIncrement=function(e,t,r,a){var o=r?-1:1;if(i(t))return s.increment(e,o*t);var l=t.charAt(0),A=o*Number(t.substr(1));if("M"===l)return s.incrementMonth(e,A,a);if("L"===l)return Math.log(Math.pow(10,e)+A)/Math.LN10;if("D"===l){var c="D2"===t?ge:ue,u=e+.01*o,g=s.roundUp(s.mod(u,1),c,r);return Math.floor(u)+Math.log(n.round(Math.pow(10,g),1))/Math.LN10}throw"unrecognized dtick "+String(t)},H.tickFirst=function(e,t){var r=e.r2l||Number,a=s.simpleMap(e.range,r,void 0,void 0,t),o=a[1]=0&&r<=e._length?t:null};if(l&&s.isArrayOrTypedArray(e.ticktext)){var f=s.simpleMap(e.range,e.r2l),h=(Math.abs(f[1]-f[0])-(e._lBreaks||0))/1e4;for(a=0;a ")}else e._prevDateHead=l,A+="
"+l;t.text=A}(e,o,r,A):"log"===c?function(e,t,r,n,a){var o=e.dtick,l=t.x,A=e.tickformat,c="string"===typeof o&&o.charAt(0);if("never"===a&&(a=""),n&&"L"!==c&&(o="L3",c="L"),A||"L"===c)t.text=ve(Math.pow(10,l),e,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var u=Math.round(l),g=Math.abs(u),f=e.exponentformat;"power"===f||me(f)&&Ie(u)?(t.text=0===u?1:1===u?"10":"10"+(u>1?"":D)+g+"",t.fontSize*=1.25):("e"===f||"E"===f)&&g>2?t.text="1"+f+(u>0?"+":D)+g:(t.text=ve(Math.pow(10,l),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,s.mod(l,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(l<0?.5:.25)))}}(e,o,0,A,p):"category"===c?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r=""),t.text=String(r)}(e,o):"multicategory"===c?function(e,t,r){var n=Math.round(t.x),i=e._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?t.text=o+" - "+a:(t.text=a,t.text2=o)}(e,o,r):Re(e)?function(e,t,r,n,i){if("radians"!==e.thetaunit||r)t.text=ve(t.x,e,i,n);else{var a=t.x/180;if(0===a)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}function r(e,n){return t(n,0)?e:r(n,e%n)}function n(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}var i=n(e),a=e*i,o=Math.abs(r(a,i));return[Math.round(a/o),Math.round(i/o)]}(a);if(o[1]>=100)t.text=ve(s.deg2rad(t.x),e,i,n);else{var l=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(t.text=D+t.text)}}}}(e,o,r,A,p):function(e,t,r,n,i){"never"===i?i="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(i="hide"),t.text=ve(t.x,e,i,n)}(e,o,0,A,p),n||(e.tickprefix&&!d(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!d(e.showticksuffix)&&(o.text+=e.ticksuffix)),e.labelalias&&e.labelalias.hasOwnProperty(o.text)){var y=e.labelalias[o.text];"string"===typeof y&&(o.text=y)}return("boundaries"===e.tickson||e.showdividers)&&(o.xbnd=[g(o.x-.5),g(o.x+e.dtick-.5)]),o},H.hoverLabelText=function(e,t,r){r&&(e=s.extendFlat({},e,{hoverformat:r}));var n=s.isArrayOrTypedArray(t)?t[0]:t,i=s.isArrayOrTypedArray(t)?t[1]:void 0;if(void 0!==i&&i!==n)return H.hoverLabelText(e,n,r)+" - "+H.hoverLabelText(e,i,r);var a="log"===e.type&&n<=0,o=H.tickText(e,e.c2l(a?-n:n),"hover").text;return a?0===n?"0":D+o:o};var ye=["f","p","n","\u03bc","m","","k","M","G","T"];function me(e){return"SI"===e||"B"===e}function Ie(e){return e>14||e<-15}function ve(e,t,r,n){var a=e<0,o=t._tickround,l=r||t.exponentformat||"B",A=t._tickexponent,c=H.getTickFormat(t),u=t.separatethousands;if(n){var g={exponentformat:l,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:i(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};de(g),o=(Number(g._tickround)||0)+4,A=g._tickexponent,t.hoverformat&&(c=t.hoverformat)}if(c)return t._numFormat(c)(e).replace(/-/g,D);var f,h=Math.pow(10,-o)/2;if("none"===l&&(A=0),(e=Math.abs(e))"+f+"":"B"===l&&9===A?e+="B":me(l)&&(e+=ye[A/3+5])),a?D+e:e}function Ee(e,t){if(e){var r=Object.keys(O).reduce((function(e,r){return-1!==t.indexOf(r)&&O[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function Ce(e,t){for(var r=[],n={},i=0;i1&&r=i.min&&e=n(e))}function s(e,t){var r=null===t[0],n=null===t[1],i=a(e,t[0])>=0,o=a(e,t[1])<=0;return(r||i)&&(n||o)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=0&&i.unshift(i.splice(n,1).shift())}}));var o={false:{left:0,right:0}};return s.syncOrAsync(i.map((function(t){return function(){if(t){var n=H.getFromId(e,t);r||(r={}),r.axShifts=o,r.overlayingShiftedAx=a;var i=H.drawOne(e,n,r);return n._shiftPusher&&Oe(n,n._fullDepth||0,o,!0),n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),i}}})))},H.drawOne=function(e,t,r){var n,i,l,f=(r=r||{}).axShifts||{},h=r.overlayingShiftedAx||[];t.setScale();var d=e._fullLayout,p=t._id,y=p.charAt(0),m=H.counterLetter(p),I=d._plots[t._mainSubplot];if(I){if(t._shiftPusher=t.autoshift||-1!==h.indexOf(t._id)||-1!==h.indexOf(t.overlaying),t._shiftPusher&"free"===t.anchor){var v=t.linewidth/2||0;"inside"===t.ticks&&(v+=t.ticklen),Oe(t,v,f,!0),Oe(t,t.shift||0,f,!1)}!0===r.skipTitle&&void 0!==t._shift||(t._shift=function(e,t){return e.autoshift?t[e.overlaying][e.side]:e.shift||0}(t,f));var E=I[y+"axislayer"],C=t._mainLinePosition,B=C+=t._shift,b=t._mainMirrorPosition,x=t._vals=H.calcTicks(t),w=[t.mirror,B,b].join("_");for(n=0;n0?r.bottom-c:0,u))));var g=0,f=0;if(t._shiftPusher&&(g=Math.max(u,r.height>0?"l"===l?c-r.left:r.right-c:0),t.title.text!==d._dfltTitle[y]&&(f=(t._titleStandoff||0)+(t._titleScoot||0),"l"===l&&(f+=xe(t))),t._fullDepth=Math.max(g,f)),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var h=[0,1],p="number"===typeof t._shift?t._shift:0;if("x"===y){if("b"===l?n[l]=t._depth:(n[l]=t._depth=Math.max(r.width>0?c-r.top:0,u),h.reverse()),r.width>0){var I=r.right-(t._offset+t._length);I>0&&(n.xr=1,n.r=I);var v=t._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===l?(t._depth=Math.max(r.height>0?c-r.left:0,u),n[l]=t._depth-p):(t._depth=Math.max(r.height>0?r.right-c:0,u),n[l]=t._depth+p,h.reverse()),r.height>0){var E=r.bottom-(t._offset+t._length);E>0&&(n.yb=0,n.b=E);var C=t._offset-r.top;C>0&&(n.yt=1,n.t=C)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[h[0]],t.title.text!==d._dfltTitle[y]&&(n[l]+=xe(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[A]=t.linewidth,t.mirror&&!0!==t.mirror&&(i[A]+=u),!0===t.mirror||"ticks"===t.mirror?i[m]=t._anchorAxis.domain[h[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(i[m]=[t._counterDomainMin,t._counterDomainMax][h[1]]))}ue&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"===typeof t.automargin&&(Ee(n,t.automargin),Ee(i,t.automargin)),a.autoMargin(e,_e(t),n),a.autoMargin(e,Se(t),i),a.autoMargin(e,ke(t),s)})),s.syncOrAsync(Ae)}}function ge(e){var r=p+(e||"tick");return Q[r]||(Q[r]=function(e,t,r){var n,i,a,o;if(e._selections[t].size())n=1/0,i=-1/0,a=1/0,o=-1/0,e._selections[t].each((function(){var e=Qe(this),t=g.bBox(e.node().parentNode);n=Math.min(n,t.top),i=Math.max(i,t.bottom),a=Math.min(a,t.left),o=Math.max(o,t.right)}));else{var s=H.makeLabelFns(e,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(t,r,B)),Q[r]}},H.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],i=e.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)===("x"===r)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},H.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return l(e._offset+e.l2p(t.x),0)}:function(t){return l(0,e._offset+e.l2p(t.x))}},H.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var A=e.side,c=l?(e.tickwidth||0)/2:0,u=3,g=e.tickfont?e.tickfont.size:12;return(o||n)&&(c+=g*U,u+=(e.linewidth||0)/2),(i||a)&&(c+=(e.linewidth||0)/2,u+=3),s&&"top"===A&&(u-=g*(1-U)),(i||n)&&(c=-c),"bottom"!==A&&"right"!==A||(u=-u),[l?c:0,s?u:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return l(r+e._offset+e.l2p(Be(t)),n)}:function(t){return l(n,r+e._offset+e.l2p(Be(t)))}},H.makeTickPath=function(e,t,r,n){n||(n={});var i=n.minor;if(i&&!e.minor)return"";var a=void 0!==n.len?n.len:i?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),s=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+s*r)+"v"+a*r:"M"+(t+s*r)+",0h"+a*r},H.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",a=function(e){return-1!==n.indexOf(e)},o=a("top"),l=a("left"),A=a("right"),c=a("bottom")||l||o||A,u=a("inside"),g="inside"===n&&"inside"===e.ticks||!u&&"outside"===e.ticks&&"boundaries"!==e.tickson,f=0,h=0,d=g?e.ticklen:0;if(u?d*=-1:c&&(d=0),g&&(f+=d,r)){var p=s.deg2rad(r);f=d*Math.cos(p)+1,h=d*Math.sin(p)}e.showticklabels&&(g||e.showline)&&(f+=.2*e.tickfont.size);var y,m,I,v,E,C={labelStandoff:f+=(e.linewidth||1)/2*(u?-1:1),labelShift:h},B=0,b=e.side,x=e._id.charAt(0),w=e.tickangle;if("x"===x)v=(E=!u&&"bottom"===b||u&&"top"===b)?1:-1,u&&(v*=-1),y=h*v,m=t+f*v,I=E?1:-.2,90===Math.abs(w)&&(u?I+=G:I=-90===w&&"bottom"===b?U:90===w&&"top"===b?G:.5,B=G/2*(w/90)),C.xFn=function(e){return e.dx+y+B*e.fontSize},C.yFn=function(e){return e.dy+m+e.fontSize*I},C.anchorFn=function(e,t){if(c){if(l)return"end";if(A)return"start"}return i(t)&&0!==t&&180!==t?t*v<0!==u?"end":"start":"middle"},C.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==u?-n:0};else if("y"===x){if(v=(E=!u&&"left"===b||u&&"right"===b)?1:-1,u&&(v*=-1),y=f,m=h*v,I=0,u||90!==Math.abs(w)||(I=-90===w&&"left"===b||90===w&&"right"===b?U:.5),u){var Q=i(w)?+w:0;if(0!==Q){var _=s.deg2rad(Q);B=Math.abs(Math.sin(_))*U*v,I=0}}C.xFn=function(e){return e.dx+t-(y+e.fontSize*I)*v+B*e.fontSize},C.yFn=function(e){return e.dy+m+e.fontSize*G},C.anchorFn=function(e,t){return i(t)&&90===Math.abs(t)?"middle":E?"end":"start"},C.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return C},H.drawTicks=function(e,t,r){r=r||{};var i=t._id+"tick",a=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,be);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return u.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return g.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Fe(t,[N]),o.attr("transform",r.transFn)},H.drawGrid=function(e,t,r){if(r=r||{},"sync"!==t.tickmode){var i=t._id+"grid",a=t.minor&&t.minor.showgrid,o=a?r.vals.filter((function(e){return e.minor})):[],s=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],l=r.counterAxis;if(l&&H.shouldShowZeroLine(e,t,l))for(var A="array"===t.tickmode,c=0;c=0;y--){var m=y?d:p;if(m){var I=m.selectAll("path."+i).data(y?s:o,be);I.exit().remove(),I.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),I.attr("transform",r.transFn).attr("d",r.path).each((function(e){return u.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return g.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"===typeof r.path&&I.attr("d",r.path)}}Fe(t,[R,L])}},H.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",i=H.shouldShowZeroLine(e,t,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:t._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return K(e.id,t.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,t.zerolinecolor||u.defaultLine).style("stroke-width",g.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Fe(t,[M])},H.drawLabels=function(e,t,r){r=r||{};var a=e._fullLayout,o=t._id,c=r.cls||o+"tick",u=r.vals.filter((function(e){return e.text})),f=r.labelFns,h=r.secondary?0:t.tickangle,d=(t._prevTickAngles||{})[c],p=r.layer.selectAll("g."+c).data(t.showticklabels?u:[],be),y=[];function m(e,a){e.each((function(e){var o=n.select(this),s=o.select(".text-math-group"),c=f.anchorFn(e,a),u=r.transFn.call(o.node(),e)+(i(a)&&0!==+a?" rotate("+a+","+f.xFn(e)+","+(f.yFn(e)-e.fontSize/2)+")":""),h=A.lineCount(o),d=z*e.fontSize,p=f.heightFn(e,i(a)?+a:0,(h-1)*d);if(p&&(u+=l(0,p)),s.empty()){var y=o.select("text");y.attr({transform:u,"text-anchor":c}),y.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var m=g.bBox(s.node()).width*{end:-.5,start:.5}[c];s.attr("transform",u+l(m,0))}}))}p.enter().append("g").classed(c,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),i=e._promises.length;r.call(A.positionText,f.xFn(t),f.yFn(t)).call(g.font,{family:t.font,size:t.fontSize,color:t.fontColor,weight:t.fontWeight,style:t.fontStyle,variant:t.fontVariant}).text(t.text).call(A.convertToTspans,e),e._promises[i]?y.push(e._promises.pop().then((function(){m(r,h)}))):m(r,h)})),Fe(t,[F]),p.exit().remove(),r.repositionOnUpdate&&p.each((function(e){n.select(this).select("text").call(A.positionText,f.xFn(e),f.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),l=0,A=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var c=s.simpleMap(t.range,t.r2l);l=t.l2p(c[0])+t._offset,A=t.l2p(c[1])+t._offset}var u=Math.min(l,A),f=Math.max(l,A),h=t.side,d=1/0,y=-1/0;for(var m in p.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=g.bBox(r.node()),s=0;o?(a.right>f||a.leftf||a.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==e.K||i||l.style("display",null)}))}))}))}))},m(p,d+1?d:h);var I=null;t._selections&&(t._selections[c]=p);var v=[function(){return y.length&&Promise.all(y)}];t.automargin&&a._redrawFromAutoMarginCount&&90===d?(I=d,v.push((function(){m(p,d)}))):v.push((function(){if(m(p,h),u.length&&t.autotickangles&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){I=t.autotickangles[0];var e,n=0,i=[],a=1;p.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),o=Qe(this),s=g.bBox(o.node());a=Math.max(a,A.lineCount(o)),i.push({top:0,bottom:10,height:10,left:r-s.width/2,right:r+s.width/2+2,width:s.width+2})}));var o=("boundaries"===t.tickson||t.showdividers)&&!r.secondary,l=u.length,c=Math.abs((u[l-1].x-u[0].x)*t._m)/(l-1),f=o?c/2:c,d=o?t.ticklen:1.25*n*a,y=f/Math.sqrt(Math.pow(f,2)+Math.pow(d,2)),v=t.autotickangles.map((function(e){return e*Math.PI/180})),E=v.find((function(e){return Math.abs(Math.cos(e))<=y}));void 0===E&&(E=v.reduce((function(e,t){return Math.abs(Math.cos(e))G*P&&(D=P,_[Q]=S[Q]=T[Q])}var U=Math.abs(D-k);U-b>0?b*=1+b/(U-=b):b=0,"y"!==t._id.charAt(0)&&(b=-b),_[w]=C.p2r(C.r2p(S[w])+x*b),"min"===C.autorange||"max reversed"===C.autorange?(_[0]=null,C._rangeInitial0=void 0,C._rangeInitial1=void 0):"max"!==C.autorange&&"min reversed"!==C.autorange||(_[1]=null,C._rangeInitial0=void 0,C._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[C._name+".range"]=_}var q=s.syncOrAsync(v);return q&&q.then&&e._promises.push(q),q},H.getPxPosition=function(e,t){var r,n=e._fullLayout._size,i=t._id.charAt(0),a=t.side;return"free"!==t.anchor?r=t._anchorAxis:"x"===i?r={_offset:n.t+(1-(t.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(t.position||0)*n.w+t._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},H.shouldShowZeroLine=function(e,t,r){var n=s.simpleMap(t.range,t.r2l);return n[0]*n[1]<=0&&t.zeroline&&("linear"===t.type||"-"===t.type)&&!(t.rangebreaks&&t.maskBreaks(0)===T)&&(we(t,0)||!function(e,t,r,n){var i=r._mainAxis;if(i){var a=e._fullLayout,o=t._id.charAt(0),s=H.counterLetter(t._id),l=t._offset+(Math.abs(n[0])1)for(n=1;n2*o}(i,t))return"date";var p="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=u(r),i=0,o=0,s={},c=0;c2*i}(i,p)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,A,c="";if(2===o.length)for(s=0;s<2;s++)if(A=E(o[s])){c=y;break}var u=i("pattern",c);if(u===y)for(s=0;s<2;s++)(A=E(o[s]))&&(t.bounds[s]=o[s]=A-1);if(u)for(s=0;s<2;s++)switch(A=o[s],u){case y:if(!n(A))return void(t.enabled=!1);if((A=+A)!==Math.floor(A)||A<0||A>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=A;break;case m:if(!n(A))return void(t.enabled=!1);if((A=+A)<0||A>24)return void(t.enabled=!1);t.bounds[s]=o[s]=A}if(!1===r.autorange){var g=r.range;if(g[0]g[1])return void(t.enabled=!1)}else if(o[0]>g[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},t.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},t.isLinked=function(e,t){return a(t,e._axisMatchGroups)||a(t,e._axisConstraintGroups)}},22416:function(e,t,r){"use strict";var n=r(38116).isTypedArraySpec;e.exports=function(e,t,r,i){if("category"===t.type){var a,o=e.categoryarray,s=Array.isArray(o)&&o.length>0||n(o);s&&(a="array");var l,A=r("categoryorder",a);"array"===A&&(l=r("categoryarray")),s||"array"!==A||(A=t.categoryorder="trace"),"trace"===A?t._initialCategories=[]:"array"===A?t._initialCategories=l.slice():(l=function(e,t){var r,n,i,a=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+e*t:o}function p(e,t){for(var r=t._size,n=r.h/r.w,i={},a=Object.keys(e),o=0;oA*I)||B)for(r=0;rM&&FD&&(D=F);g/=(D-k)/(2*T),k=l.l2r(k),D=l.l2r(D),l.range=l._input.range=Q<_?[k,D]:[D,k]}y(l,g)}}},t.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function P(e,t,r,n,i){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",A(r,n)).attr("d",i+"Z")}function G(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",A(t,r)).attr("d","M0,0Z")}function U(e,t,r,n,i,a){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),z(e,t,i,a)}function z(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function q(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(e){T&&e.data&&e._context.showTips&&(i.notifier(i._(e,"Double-click to zoom back out"),"long"),T=!1)}function Y(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,D)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function J(e,t,r,n,a){for(var o,s,l,A,c=!1,u={},g={},f=(a||{}).xaHash,h=(a||{}).yaHash,d=0;d=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(q(i),2!==e||ye||He(),pe)o.indexOf("select")>-1&&Q(r,i,W,Z,t.id,De),o.indexOf("event")>-1&&f.click(i,r,t.id);else if(1===e&&ye){var s=d?M:T,A="s"===d||"w"===y?0:1,u=s._name+".range["+A+"]",g=function(e,t){var r,n=e.range[t],i=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,A),h="left",p="middle";if(s.fixedrange)return;d?(p="n"===d?"top":"bottom","right"===s.side&&(h="right")):"e"===y&&(h="right"),i._context.showAxisRangeEntryBoxes&&n.select(ve).call(c.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(g),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:h,verticalAlign:p}).on("edit",(function(e){var t=s.d2r(e);void 0!==t&&l.call("_guiRelayout",i,u,t)}))}}}function Re(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,fe*t+Ee)),i=Math.max(0,Math.min(te,he*r+Ce)),a=Math.abs(n-Ee),o=Math.abs(i-Ce);function s(){Qe="",Be.r=Be.l,Be.t=Be.b,Se.attr("d","M0,0Z")}if(Be.l=Math.min(Ee,n),Be.r=Math.max(Ee,n),Be.t=Math.min(Ce,i),Be.b=Math.max(Ce,i),re.isSubplotConstrained)a>D||o>D?(Qe="xy",a/ee>o/te?(o=a*te/ee,Ce>i?Be.t=Ce-o:Be.b=Ce+o):(a=o*ee/te,Ee>n?Be.l=Ee-a:Be.r=Ee+a),Se.attr("d",Y(Be))):s();else if(ne.isSubplotConstrained)if(a>D||o>D){Qe="xy";var l=Math.min(Be.l/ee,(te-Be.b)/te),A=Math.max(Be.r/ee,(te-Be.t)/te);Be.l=l*ee,Be.r=A*ee,Be.b=(1-l)*te,Be.t=(1-A)*te,Se.attr("d",Y(Be))}else s();else!ae||o0){var c;if(ne.isSubplotConstrained||!ie&&1===ae.length){for(c=0;c1&&(void 0!==a.maxallowed&&se===(a.range[0]1&&(void 0!==o.maxallowed&&le===(o.range[0]v[1]-1/4096&&(t.domain=s),i.noneOrAll(e.domain,t.domain,s),"sync"===t.tickmode&&(t.tickmode="auto")}return r("layer"),t}},42568:function(e,t,r){"use strict";var n=r(85024);e.exports=function(e,t,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(e);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},96312:function(e,t,r){"use strict";var n=r(76808);e.exports=function(e,t,r,i){var a=t._template||{},o=t.type||a.type||"-";r("minallowed"),r("maxallowed");var s,l=r("range");l||i.noInsiderange||"log"===o||(!(s=r("insiderange"))||null!==s[0]&&null!==s[1]||(t.insiderange=!1,s=void 0),s&&(l=r("range",s)));var A,c=t.getAutorangeDflt(l,i),u=r("autorange",c);!l||(null!==l[0]||null!==l[1])&&(null!==l[0]&&null!==l[1]||"reversed"!==u&&!0!==u)&&(null===l[0]||"min"!==u&&"max reversed"!==u)&&(null===l[1]||"max"!==u&&"min reversed"!==u)||(l=void 0,delete t.range,t.autorange=!0,A=!0),A||(u=r("autorange",c=t.getAutorangeDflt(l,i))),u&&(n(r,u,l),"linear"!==o&&"-"!==o||r("rangemode")),t.cleanRange()}},21160:function(e,t,r){"use strict";var n=r(84284).FROM_BL;e.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var i=[e.r2l(e.range[0]),e.r2l(e.range[1])],a=i[0]+(i[1]-i[0])*r;e.range=e._input.range=[e.l2r(a+(i[0]-a)*t),e.l2r(a+(i[1]-a)*t)],e.setScale()}},78344:function(e,t,r){"use strict";var n=r(33428),i=r(94336).E9,a=r(3400),o=a.numberFormat,s=r(38248),l=a.cleanNumber,A=a.ms2DateTime,c=a.dateTime2ms,u=a.ensureNumber,g=a.isArrayOrTypedArray,f=r(39032),h=f.FP_SAFE,d=f.BADNUM,p=f.LOG_CLIP,y=f.ONEWEEK,m=f.ONEDAY,I=f.ONEHOUR,v=f.ONEMIN,E=f.ONESEC,C=r(79811),B=r(33816),b=B.HOUR_PATTERN,x=B.WEEKDAY_PATTERN;function w(e){return Math.pow(10,e)}function Q(e){return null!==e&&void 0!==e}e.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function _(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],i=e.range[1];return.5*(n+i-2*p*Math.abs(n-i))}return d}function S(t,r,n,i){if((i||{}).msUTC&&s(t))return+t;var o=c(t,n||e.calendar);if(o===d){if(!s(t))return d;t=+t;var l=Math.floor(10*a.mod(t+.05,1)),A=Math.round(t-l/10);o=c(new Date(A))+l/10}return o}function k(t,r,n){return A(t,r,n||e.calendar)}function D(t){return e._categories[Math.round(t)]}function T(t){if(Q(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"===typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return d}function M(t){if(e._categoriesMap)return e._categoriesMap[t]}function R(e){var t=M(e);return void 0!==t?t:s(e)?+e:void 0}function L(e){return s(e)?+e:M(e)}function N(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var O=function(t){return s(t)?N(t,e._m,e._b):d},P=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var G="y"===f;O=function(t){if(!s(t))return d;var r=e._rangebreaks.length;if(!r)return N(t,e._m,e._b);var n=G;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,a=i*t,o=0,l=0;lc)){o=a<(A+c)/2?l:l+1;break}o=l+1}var u=e._B[o]||0;return isFinite(u)?N(t,e._m2,u):0},P=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,i=0;ie._rangebreaks[i].pmax&&(n=i+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?_:u,e.l2c="log"===e.type?w:u,e.l2p=O,e.p2l=P,e.c2p="log"===e.type?function(e,t){return O(_(e,t))}:O,e.p2c="log"===e.type?function(e){return w(P(e))}:P,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=l,e.c2d=e.c2r=e.l2d=e.l2r=u,e.d2p=e.r2p=function(t){return e.l2p(l(t))},e.p2d=e.p2r=P,e.cleanPos=u):"log"===e.type?(e.d2r=e.d2l=function(e,t){return _(l(e),t)},e.r2d=e.r2c=function(e){return w(l(e))},e.d2c=e.r2l=l,e.c2d=e.l2r=u,e.c2r=_,e.l2d=w,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return w(P(e))},e.r2p=function(t){return e.l2p(l(t))},e.p2r=P,e.cleanPos=u):"date"===e.type?(e.d2r=e.r2d=a.identity,e.d2c=e.r2c=e.d2l=e.r2l=S,e.c2d=e.c2r=e.l2d=e.l2r=k,e.d2p=e.r2p=function(t,r,n){return e.l2p(S(t,0,n))},e.p2d=e.p2r=function(e,t,r){return k(P(e),t,r)},e.cleanPos=function(t){return a.cleanDate(t,d,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=T,e.r2d=e.c2d=e.l2d=D,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=L(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=u,e.r2l=L,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return D(P(e))},e.r2p=e.d2p,e.p2r=P,e.cleanPos=function(e){return"string"===typeof e&&""!==e?e:u(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=D,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=M,e.l2r=e.c2r=u,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return D(P(e))},e.r2p=e.d2p,e.p2r=P,e.cleanPos=function(e){return Array.isArray(e)||"string"===typeof e&&""!==e?e:u(e)},e.setupMultiCategory=function(n){var i,o,s=e._traceIndices,l=e._matchGroup;if(l&&0===e._categories.length)for(var A in l)if(A!==r){var c=t[C.id2name(A)];s=s.concat(c._traceIndices)}var u=[[0,{}],[0,{}]],h=[];for(i=0;il[1]&&(i[s?0:1]=n),i[0]===i[1]){var A=e.l2r(r),c=e.l2r(n);if(void 0!==r){var u=A+1;void 0!==n&&(u=Math.min(u,c)),i[s?1:0]=u}if(void 0!==n){var g=c+1;void 0!==r&&(g=Math.max(g,A)),i[s?0:1]=g}}}},e.cleanRange=function(t,r){e._cleanRange(t,r),e.limitRange(t)},e._cleanRange=function(t,r){r||(r={}),t||(t="range");var n,i,o=a.nestedProperty(e,t).get();if(i=(i="date"===e.type?a.dfltRange(e.calendar):"y"===f?B.DFLTRANGEY:"realaxis"===e._name?[0,1]:r.dfltRange||B.DFLTRANGEX).slice(),"tozero"!==e.rangemode&&"nonnegative"!==e.rangemode||(i[0]=0),o&&2===o.length){var l=null===o[0],A=null===o[1];for("date"!==e.type||e.autorange||(o[0]=a.cleanDate(o[0],d,e.calendar),o[1]=a.cleanDate(o[1],d,e.calendar)),n=0;n<2;n++)if("date"===e.type){if(!a.isDateTime(o[n],e.calendar)){e[t]=i;break}if(e.r2l(o[0])===e.r2l(o[1])){var c=a.constrain(e.r2l(o[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);o[0]=e.l2r(c-1e3),o[1]=e.l2r(c+1e3);break}}else{if(!s(o[n])){if(l||A||!s(o[1-n])){e[t]=i;break}o[n]=o[1-n]*(n?10:.1)}if(o[n]<-h?o[n]=-h:o[n]>h&&(o[n]=h),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}}else a.nestedProperty(e,t).set(i)},e.setScale=function(r){var n=t._size;if(e.overlaying){var i=C.getFromId({_fullLayout:t},e.overlaying);e.domain=i.domain}var a=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(a);var s,l,A=e.r2l(e[a][0],o),c=e.r2l(e[a][1],o),u="y"===f;if(u?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(A-c),e._b=-e._m*c):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(c-A),e._b=-e._m*A),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks&&(e._rangebreaks=e.locateBreaks(Math.min(A,c),Math.max(A,c)),e._rangebreaks.length)){for(s=0;sc&&(g=!g),g&&e._rangebreaks.reverse();var h=g?-1:1;for(e._m2=h*e._length/(Math.abs(c-A)-e._lBreaks),e._B.push(-e._m2*(u?c:A)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&t=s.min&&(es.max&&(s.max=n),i=!1)}i&&A.push({min:e,max:n})}};for(n=0;nr.duration?(function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function p(t,r){var n=t.plotinfo,i=n.xaxis,l=n.yaxis,A=i._length,c=l._length,u=!!t.xr1,g=!!t.yr1,f=[];if(u){var h=a.simpleMap(t.xr0,i.r2l),d=a.simpleMap(t.xr1,i.r2l),p=h[1]-h[0],y=d[1]-d[0];f[0]=(h[0]*(1-r)+r*d[0]-h[0])/(h[1]-h[0])*A,f[2]=A*(1-r+r*y/p),i.range[0]=i.l2r(h[0]*(1-r)+r*d[0]),i.range[1]=i.l2r(h[1]*(1-r)+r*d[1])}else f[0]=0,f[2]=A;if(g){var m=a.simpleMap(t.yr0,l.r2l),I=a.simpleMap(t.yr1,l.r2l),v=m[1]-m[0],E=I[1]-I[0];f[1]=(m[1]*(1-r)+r*I[1]-m[1])/(m[0]-m[1])*c,f[3]=c*(1-r+r*E/v),l.range[0]=i.l2r(m[0]*(1-r)+r*I[0]),l.range[1]=l.l2r(m[1]*(1-r)+r*I[1])}else f[1]=0,f[3]=c;s.drawOne(e,i,{skipTitle:!0}),s.drawOne(e,l,{skipTitle:!0}),s.redrawComponents(e,[i._id,l._id]);var C=u?A/f[2]:1,B=g?c/f[3]:1,b=u?f[0]:0,x=g?f[1]:0,w=u?f[0]/f[2]*A:0,Q=g?f[1]/f[3]*c:0,_=i._offset-w,S=l._offset-Q;n.clipRect.call(o.setTranslate,b,x).call(o.setScale,1/C,1/B),n.plot.call(o.setTranslate,_,S).call(o.setScale,C,B),o.setPointGroupScale(n.zoomScalePts,1/C,1/B),o.setTextPointsScale(n.zoomScaleTxt,1/C,1/B)}s.redrawComponents(e)}},14944:function(e,t,r){"use strict";var n=r(24040).traceIs,i=r(52976);function a(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=a(e),i=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return i&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}e.exports=function(e,t,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(function(e,t){if("-"===e.type){var r,s=e._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var A=function(e,t,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[t])return i;if((i[r+"axis"]||r)===t){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(t,s,l);if(A)if("histogram"!==A.type||l!=={v:"y",h:"x"}[A.orientation||"v"]){var c=l+"calendar",u=A[c],g={noMultiCategory:!n(A,"cartesian")||n(A,"noMultiCategory")};if("box"===A.type&&A._hasPreCompStats&&l==={h:"x",v:"y"}[A.orientation||"v"]&&(g.noMultiCategory=!0),g.autotypenumbers=e.autotypenumbers,o(A,l)){var f=a(A),h=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,t,s,n+1):t(s,a,o)}}))}t.manageCommandObserver=function(e,r,n,o){var s={},l=!0;r&&r._commandObserver&&(s=r._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var A=t.hasSimpleAPICommandBindings(e,n,s.lookupTable);if(r&&r._commandObserver){if(A)return s;if(r._commandObserver.remove)return r._commandObserver.remove(),r._commandObserver=null,s}if(A){a(e,A,s.cache),s.check=function(){if(l){var t=a(e,A,s.cache);return t.changed&&o&&void 0!==s.lookupTable[t.value]&&(s.disable(),Promise.resolve(o({value:t.value,type:A.type,prop:A.prop,traces:A.traces,index:s.lookupTable[t.value]})).then(s.enable,s.enable)),t.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],u=0;u0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(e){return new w(e)},Q.plot=function(e,t,r,n){var i=this;if(n)return i.update(e,t,!0);i._geoCalcData=e,i._fullLayout=t;var a=t[this.id],o=[],s=!1;for(var l in C.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var A=!1,c=0;c0&&o._module.calcGeoJSON(a,t)}if(!r){if(this.updateProjection(e,t))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(t,n),this.updateDims(t,n),this.updateFx(t,n),h.generalUpdatePerTraceModule(this.graphDiv,this,e,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},Q.updateProjection=function(e,t){var r=this.graphDiv,n=t[this.id],l=t._size,c=n.domain,u=n.projection,g=n.lonaxis,f=n.lataxis,h=g._ax,d=f._ax,y=this.projection=function(e){var t=e.projection,r=t.type,n=C.projNames[r];n="geo"+A.titleCase(n);for(var l=(i[n]||s[n])(),c=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?C.lonaxisSpan[r]/2:null,u=["center","rotate","parallels","clipExtent"],g=function(e){return e?l:[]},f=0;fc*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(e){return l.getPath().bounds(e)},l.precision(C.precision),e._isSatellite&&l.tilt(t.tilt).distance(t.distance),c&&l.clipAngle(c-C.clipPad),l}(n),m=[[l.l+l.w*c.x[0],l.t+l.h*(1-c.y[1])],[l.l+l.w*c.x[1],l.t+l.h*(1-c.y[0])]],I=n.center||{},v=u.rotation||{},E=g.range||[],B=f.range||[];if(n.fitbounds){h._length=m[1][0]-m[0][0],d._length=m[1][1]-m[0][1],h.range=p(r,h),d.range=p(r,d);var b=(h.range[0]+h.range[1])/2,x=(d.range[0]+d.range[1])/2;if(n._isScoped)I={lon:b,lat:x};else if(n._isClipped){I={lon:b,lat:x},v={lon:b,lat:x,roll:v.roll};var w=u.type,Q=C.lonaxisSpan[w]/2||180,S=C.lataxisSpan[w]/2||90;E=[b-Q,b+Q],B=[x-S,x+S]}else I={lon:b,lat:x},v={lon:b,lat:v.lat,roll:v.roll}}y.center([I.lon-v.lon,I.lat-v.lat]).rotate([-v.lon,-v.lat,v.roll]).parallels(u.parallels);var k=_(E,B);y.fitExtent(m,k);var D=this.bounds=y.getBounds(k),T=this.fitScale=y.scale(),M=y.translate();if(n.fitbounds){var R=y.getBounds(_(h.range,d.range)),L=Math.min((D[1][0]-D[0][0])/(R[1][0]-R[0][0]),(D[1][1]-D[0][1])/(R[1][1]-R[0][1]));isFinite(L)?y.scale(L*T):A.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(u.scale*T);var N=this.midPt=[(D[0][0]+D[1][0])/2,(D[0][1]+D[1][1])/2];if(y.translate([M[0]+(N[0]-M[0]),M[1]+(N[1]-M[1])]).clipExtent(D),n._isAlbersUsa){var F=y([I.lon,I.lat]),O=y.translate();y.translate([O[0]-(F[0]-O[0]),O[1]-(F[1]-O[1])])}},Q.updateBaseLayers=function(e,t){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(e){return"lonaxis"===e||"lataxis"===e}function l(e){return Boolean(C.lineLayers[e])}function A(e){return Boolean(C.fillLayers[e])}var c=(this.hasChoropleth?C.layersForChoropleth:C.layers).filter((function(e){return l(e)||A(e)?t["show"+e]:!s(e)||t[e].showgrid})),f=r.framework.selectAll(".layer").data(c,String);f.exit().each((function(e){delete a[e],delete o[e],n.select(this).remove()})),f.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=a[e]=n.select(this);"bg"===e?r.bgRect=t.append("rect").style("pointer-events","all"):s(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):l(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):A(e)&&(o[e]=t.append("path").style("stroke","none"))})),f.order(),f.each((function(r){var n=o[r],a=C.layerNameToAdjective[r];"frame"===r?n.datum(C.sphereSVG):l(r)||A(r)?n.datum(x(i,i.objects[r])):s(r)&&n.datum(function(e,t,r){var n,i,a,o=1e-6,s=2.5,l=t[e],A=C.scopeDefaults[t.scope];"lonaxis"===e?(n=A.lonaxisRange,i=A.lataxisRange,a=function(e,t){return[e,t]}):"lataxis"===e&&(n=A.lataxisRange,i=A.lonaxisRange,a=function(e,t){return[t,e]});var c={type:"linear",range:[n[0],n[1]-o],tick0:l.tick0,dtick:l.dtick};d.setConvert(c,r);var u=d.calcTicks(c);t.isScoped||"lonaxis"!==e||u.pop();for(var g=u.length,f=new Array(g),h=0;h-1&&v(n.event,i,[r.xaxis],[r.yaxis],r.id,c),s.indexOf("event")>-1&&f.click(i,n.event))}))}function u(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},Q.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,i="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",i),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(g.setClipUrl,i,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(e.mockAxis,r)},Q.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,i=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},A.extendFlat(this.viewInitial,t)},Q.render=function(e){this._hasMarkerAngles&&e?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},Q._render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?c(r[0],r[1]):null}function i(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",i).attr("transform",n)}},10816:function(e,t,r){"use strict";var n=r(84888).KY,i=r(3400).counterRegex,a=r(43520),o="geo",s=i(o),l={};l[o]={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:r(40384),supplyLayoutDefaults:r(86920),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,i=t._subplots[o],s=0;s0&&D<0&&(D+=360);var T,M,R,L=(k+D)/2;if(!f){var N=h?u.projRotate:[L,0,0];T=r("projection.rotation.lon",N[0]),r("projection.rotation.lat",N[1]),r("projection.rotation.roll",N[2]),r("showcoastlines",!h&&I)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!I&&void 0)&&r("oceancolor")}f?(M=-96.6,R=38.7):(M=h?L:T,R=(S[0]+S[1])/2),r("center.lon",M),r("center.lat",R),d&&(r("projection.tilt"),r("projection.distance")),p&&r("projection.parallels",u.projParallels||[0,60]),r("projection.scale"),r("showland",!!I&&void 0)&&r("landcolor"),r("showlakes",!!I&&void 0)&&r("lakecolor"),r("showrivers",!!I&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",h&&"usa"!==c&&I)&&(r("countrycolor"),r("countrywidth")),("usa"===c||"north america"===c&&50===A)&&(r("showsubunits",I),r("subunitcolor"),r("subunitwidth")),h||r("showframe",I)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,h?(delete t.center.lon,delete t.center.lat):y?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}e.exports=function(e,t,r){i(e,t,r,{type:"geo",attributes:s,handleDefaults:A,fullData:r,partition:"y"})}},79248:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(24040),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},A={cursor:"auto"};function c(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function u(e,t,r){var n=e.id,o=e.graphDiv,s=o.layout,l=s[n],A=o._fullLayout,c=A[n],u={},g={};function f(e,t){u[n+"."+e]=i.nestedProperty(l,e).get(),a.call("_storeDirectGUIEdit",s,A._preGUI,u);var r=i.nestedProperty(c,e);r.get()!==t&&(r.set(t),i.nestedProperty(l,e).set(t),g[n+"."+e]=t)}r(f),f("projection.scale",t.scale()/e.fitScale),f("fitbounds",!1),o.emit("plotly_relayout",g)}function g(e,t){var r=c(0,t);function i(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){t.scale(n.event.scale).translate(n.event.translate),e.render(!0);var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(A),u(e,t,i)})),r}function f(e,t){var r,i,a,o,s,g,f,h,d,p=c(0,t),y=2;function m(e){return t.invert(e)}function I(r){var n=t.rotate(),i=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return p.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),i=t.rotate(),a=t.translate(),o=i,s=m(r)})).on("zoom",(function(){if(g=n.mouse(this),function(e){var r=m(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>y||Math.abs(n[1]-e[1])>y}(r))return p.scale(t.scale()),void p.translate(t.translate());t.scale(n.event.scale),t.translate([a[0],n.event.translate[1]]),s?m(g)&&(h=m(g),f=[o[0]+(h[0]-s[0]),i[1],i[2]],t.rotate(f),o=f):s=m(r=g),d=!0,e.render(!0);var l=t.rotate(),A=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":A[0],"geo.center.lat":A[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(A),d&&u(e,t,I)})),p}function h(e,t){var r,i={r:t.rotate(),k:t.scale()},a=c(0,t),g=function(e){for(var t=0,r=arguments.length,i=[];++th?(a=(u>0?90:-90)-f,i=0):(a=Math.asin(u/h)*s-f,i=Math.sqrt(h*h-u*u));var d=180-a-2*f,y=(Math.atan2(g,c)-Math.atan2(A,i))*s,I=(Math.atan2(g,c)-Math.atan2(A,-i))*s,v=p(r[0],r[1],a,y),E=p(r[0],r[1],d,I);return v<=E?[a,y,r[2]]:[d,I,r[2]]}(l,r,u);isFinite(f[0])&&isFinite(f[1])&&isFinite(f[2])||(f=u),t.rotate(f),u=f}}else r=d(t,A=e);g.of(this,arguments)({type:"zoom"})})),e=g.of(this,arguments),f++||e({type:"zoomstart"})})).on("zoomend",(function(){var r;n.select(this).style(A),h.call(a,"zoom",null),r=g.of(this,arguments),--f||r({type:"zoomend"}),u(e,t,y)})).on("zoom.redraw",(function(){e.render(!0);var r=t.rotate();e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),n.rebind(a,g,"on")}function d(e,t){var r=e.invert(t);return r&&isFinite(r[0])&&isFinite(r[1])&&function(e){var t=e[0]*o,r=e[1]*o,n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}(r)}function p(e,t,r,n){var i=y(r-e),a=y(n-t);return Math.sqrt(i*i+a*a)}function y(e){return(e%360+540)%360-180}function m(e,t,r){var n=r*o,i=e.slice(),a=0===t?1:0,s=2===t?1:2,l=Math.cos(n),A=Math.sin(n);return i[a]=e[a]*l-e[s]*A,i[s]=e[s]*l+e[a]*A,i}function I(e,t){for(var r=0,n=0,i=e.length;nMath.abs(s)?(A.boxEnd[1]=A.boxStart[1]+Math.abs(a)*E*(s>=0?1:-1),A.boxEnd[1]l[3]&&(A.boxEnd[1]=l[3],A.boxEnd[0]=A.boxStart[0]+(l[3]-A.boxStart[1])/Math.abs(E))):(A.boxEnd[0]=A.boxStart[0]+Math.abs(s)/E*(a>=0?1:-1),A.boxEnd[0]l[2]&&(A.boxEnd[0]=l[2],A.boxEnd[1]=A.boxStart[1]+(l[2]-A.boxStart[0])*Math.abs(E)))}}else A.boxEnabled?(a=A.boxStart[0]!==A.boxEnd[0],s=A.boxStart[1]!==A.boxEnd[1],a||s?(a&&(p(0,A.boxStart[0],A.boxEnd[0]),e.xaxis.autorange=!1),s&&(p(1,A.boxStart[1],A.boxEnd[1]),e.yaxis.autorange=!1),e.relayoutCallback()):e.glplot.setDirty(),A.boxEnabled=!1,A.boxInited=!1):A.boxInited&&(A.boxInited=!1);break;case"pan":A.boxEnabled=!1,A.boxInited=!1,t?(A.panning||(A.dragStart[0]=n,A.dragStart[1]=i),Math.abs(A.dragStart[0]-n).999&&(p="turntable"):p="turntable")}else p="turntable";r("dragmode",p),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(e,t,r){var i=t._basePlotModules.length>1;o(e,t,r,{type:c,attributes:l,handleDefaults:u,fullLayout:t,font:t.font,fullData:r,getDfltFromLayout:function(t){if(!i)return n.validate(e[t],l[t])?e[t]:void 0},autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,calendar:t.calendar})}},346:function(e,t,r){"use strict";var n=r(86140),i=r(86968).u,a=r(92880).extendFlat,o=r(3400).counterRegex;function s(e,t,r){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:t,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},9020:function(e,t,r){"use strict";var n=r(43080),i=["xaxis","yaxis","zaxis"];function a(){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]}a.prototype.merge=function(e){for(var t=0;t<3;++t){var r=e[i[t]];r.visible?(this.enabled[t]=r.showspikes,this.colors[t]=n(r.spikecolor),this.drawSides[t]=r.spikesides,this.lineWidth[t]=r.spikethickness):(this.enabled[t]=!1,this.drawSides[t]=!1)}},e.exports=function(e){var t=new a;return t.merge(e),t}},87152:function(e,t,r){"use strict";e.exports=function(e){for(var t=e.axesOptions,r=e.glplot.axesPixels,s=e.fullSceneLayout,l=[[],[],[]],A=0;A<3;++A){var c=s[a[A]];if(c._length=(r[A].hi-r[A].lo)*r[A].pixelsPerDataUnit/e.dataScale[A],Math.abs(c._length)===1/0||isNaN(c._length))l[A]=[];else{c._input_range=c.range.slice(),c.range[0]=r[A].lo/e.dataScale[A],c.range[1]=r[A].hi/e.dataScale[A],c._m=1/(e.dataScale[A]*r[A].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var u=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var g=c.nticks||i.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/g)}for(var f=n.calcTicks(c,{msUTC:!0}),h=0;h/g," "));l[A]=f,c.tickmode=u}}for(t.ticks=l,A=0;A<3;++A)for(o[A]=.5*(e.glplot.bounds[0][A]+e.glplot.bounds[1][A]),h=0;h<2;++h)t.bounds[h][A]=e.glplot.bounds[h][A];e.contourLevels=function(e){for(var t=new Array(3),r=0;r<3;++r){for(var n=e[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=e.glplot.getAspectratio();e.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(e)}}),!!A&&{passive:!1}),e.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==e.fullSceneLayout.dragmode&&0!==e.camera.mouseListener.buttons){var t=n();e.graphDiv.emit("plotly_relayouting",t)}})),e.staticMode||e.glplot.canvas.addEventListener("webglcontextlost",(function(r){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:r,layer:e.id})}),!1)),e.glplot.oncontextloss=function(){e.recoverContext()},e.glplot.onrender=function(){e.render()},!0},b.render=function(){var e,t=this,r=t.graphDiv,n=t.svgContainer,i=t.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),v(t),t.glplot.axes.update(t.axesOptions);for(var A=Object.keys(t.traces),c=null,g=t.glplot.selection,d=0;d")):"isosurface"===e.type||"volume"===e.type?(b.valueLabel=f.hoverLabelText(t._mockAxis,t._mockAxis.d2l(g.traceCoordinate[3]),e.valuehoverformat),_.push("value: "+b.valueLabel),g.textLabel&&_.push(g.textLabel),I=_.join("
")):I=g.textLabel;var S={x:g.traceCoordinate[0],y:g.traceCoordinate[1],z:g.traceCoordinate[2],data:E._input,fullData:E,curveNumber:E.index,pointNumber:B};h.appendArrayPointValue(S,E,B),e._module.eventData&&(S=E._module.eventData(S,g,E,{},B));var k={points:[S]};if(t.fullSceneLayout.hovermode){var D=[];h.loneHover({trace:E,x:(.5+.5*m[0]/m[3])*s,y:(.5-.5*m[1]/m[3])*l,xLabel:b.xLabel,yLabel:b.yLabel,zLabel:b.zLabel,text:I,name:c.name,color:h.castHoverOption(E,B,"bgcolor")||c.color,borderColor:h.castHoverOption(E,B,"bordercolor"),fontFamily:h.castHoverOption(E,B,"font.family"),fontSize:h.castHoverOption(E,B,"font.size"),fontColor:h.castHoverOption(E,B,"font.color"),nameLength:h.castHoverOption(E,B,"namelength"),textAlign:h.castHoverOption(E,B,"align"),hovertemplate:u.castOption(E,B,"hovertemplate"),hovertemplateLabels:u.extendFlat({},S,b),eventData:[S]},{container:n,gd:r,inOut_bbox:D}),S.bbox=D[0]}g.distance<5&&(g.buttons||C)?r.emit("plotly_click",k):r.emit("plotly_hover",k),this.oldEventData=k}else h.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;t.drawAnnotations(t)},b.recoverContext=function(){var e=this;e.glplot.dispose();var t=function(){e.glplot.gl.isContextLost()?requestAnimationFrame(t):e.initializeGLPlot()?e.plot.apply(e,e.plotArgs):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(t)};var w=["xaxis","yaxis","zaxis"];function Q(e,t,r){for(var n=e.fullSceneLayout,i=0;i<3;i++){var a=w[i],o=a.charAt(0),s=n[a],l=t[o],A=t[o+"calendar"],c=t["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var g,f=0;f<(c||l.length);f++)if(u.isArrayOrTypedArray(l[f]))for(var h=0;hy[1][o])y[0][o]=-1,y[1][o]=1;else{var T=y[1][o]-y[0][o];y[0][o]-=T/32,y[1][o]+=T/32}if(v=[y[0][o],y[1][o]],v=E(v,l),y[0][o]=v[0],y[1][o]=v[1],l.isReversed()){var M=y[0][o];y[0][o]=y[1][o],y[1][o]=M}}else v=l.range,y[0][o]=l.r2l(v[0]),y[1][o]=l.r2l(v[1]);y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),m[o]=y[1][o]-y[0][o],l.range=[y[0][o],y[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*f[o],max:l.range[1]*f[o]})}var R=c.aspectmode;if("cube"===R)p=[1,1,1];else if("manual"===R){var L=c.aspectratio;p=[L.x,L.y,L.z]}else{if("auto"!==R&&"data"!==R)throw new Error("scene.js aspectRatio was not one of the enumerated types");var N=[1,1,1];for(o=0;o<3;++o){var F=I[A=(l=c[w[o]]).type];N[o]=Math.pow(F.acc,1/F.count)/f[o]}p="data"===R||Math.max.apply(null,N)/Math.min.apply(null,N)<=4?N:[1,1,1]}c.aspectratio.x=u.aspectratio.x=p[0],c.aspectratio.y=u.aspectratio.y=p[1],c.aspectratio.z=u.aspectratio.z=p[2],n.glplot.setAspectratio(c.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=c.aspectmode);var O=c.domain||null,P=t._size||null;if(O&&P){var G=n.container.style;G.position="absolute",G.left=P.l+O.x[0]*P.w+"px",G.top=P.t+(1-O.y[1])*P.h+"px",G.width=P.w*(O.x[1]-O.x[0])+"px",G.height=P.h*(O.y[1]-O.y[0])+"px"}n.glplot.redraw()}},b.destroy=function(){var e=this;e.glplot&&(e.camera.mouseListener.enabled=!1,e.container.removeEventListener("wheel",e.camera.wheelListener),e.camera=null,e.glplot.dispose(),e.container.parentNode.removeChild(e.container),e.glplot=null)},b.getCamera=function(){var e,t=this;return t.camera.view.recalcMatrix(t.camera.view.lastT()),{up:{x:(e=t.camera).up[0],y:e.up[1],z:e.up[2]},center:{x:e.center[0],y:e.center[1],z:e.center[2]},eye:{x:e.eye[0],y:e.eye[1],z:e.eye[2]},projection:{type:!0===e._ortho?"orthographic":"perspective"}}},b.setViewport=function(e){var t,r=this,n=e.camera;r.camera.lookAt.apply(this,[[(t=n).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]]),r.glplot.setAspectratio(e.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},b.isCameraChanged=function(e){var t=this.getCamera(),r=u.nestedProperty(e,this.id+".camera").get();function n(e,t,r,n){var i=["up","center","eye"],a=["x","y","z"];return t[i[r]]&&e[i[r]][a[n]]===t[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(t,r,a,o)){i=!0;break}(!r.projection||t.projection&&t.projection.type!==r.projection.type)&&(i=!0)}return i},b.isAspectChanged=function(e){var t=this.glplot.getAspectratio(),r=u.nestedProperty(e,this.id+".aspectratio").get();return void 0===r||r.x!==t.x||r.y!==t.y||r.z!==t.z},b.saveLayout=function(e){var t,r,n,i,a,o,s=this,l=s.fullLayout,A=s.isCameraChanged(e),g=s.isAspectChanged(e),f=A||g;if(f){var h={};A&&(t=s.getCamera(),n=(r=u.nestedProperty(e,s.id+".camera")).get(),h[s.id+".camera"]=n),g&&(i=s.glplot.getAspectratio(),o=(a=u.nestedProperty(e,s.id+".aspectratio")).get(),h[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",e,l._preGUI,h),A&&(r.set(t),u.nestedProperty(l,s.id+".camera").set(t)),g&&(a.set(i),u.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return f},b.updateFx=function(e,t){var r=this,n=r.camera;if(n)if("orbit"===e)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===e){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,A=o.up.z;if(A/Math.sqrt(s*s+l*l+A*A)<.999){var g=r.id+".camera.up",f={x:0,y:0,z:1},h={};h[g]=f;var d=i.layout;c.call("_storeDirectGUIEdit",d,a._preGUI,h),o.up=f,u.nestedProperty(d,g).set(f)}}else n.keyBindingMode=e;r.fullSceneLayout.hovermode=t},b.toImage=function(e){var t=this;e||(e="png"),t.staticMode&&t.container.appendChild(n),t.glplot.redraw();var r=t.glplot.gl,i=r.drawingBufferWidth,a=r.drawingBufferHeight;r.bindFramebuffer(r.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);r.readPixels(0,0,i,a,r.RGBA,r.UNSIGNED_BYTE,o),function(e,t,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)e[a+l]=Math.min(s*e[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,A=s.getContext("2d",{willReadFrequently:!0}),c=A.createImageData(i,a);switch(c.data.set(o),A.putImageData(c,0,0),e){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return t.staticMode&&t.container.removeChild(n),l},b.setConvert=function(){for(var e=0;e<3;e++){var t=this.fullSceneLayout[w[e]];f.setConvert(t,this.fullLayout),t.setScale=u.noop}},b.make4thDimension=function(){var e=this,t=e.graphDiv._fullLayout;e._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(e._mockAxis,t)},e.exports=B},52094:function(e){"use strict";e.exports=function(e,t,r,n){n=n||e.length;for(var i=new Array(n),a=0;aOpenStreetMap contributors',o=['\xa9 Carto',a].join(" "),s=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),l={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:s,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:s,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},A=n(l);e.exports={requiredVersion:i,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:l,styleValuesNonMapbox:A,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+i+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",A.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},89032:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t){var r=e.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(t)?n.mean(t):t,s=.5+o/100,l=1.5+o/100,A=["",""],c=[0,0];switch(i){case"top":A[0]="top",c[1]=-l;break;case"bottom":A[0]="bottom",c[1]=l}switch(a){case"left":A[1]="right",c[0]=-s;break;case"right":A[1]="left",c[0]=s}return{anchor:A[0]&&A[1]?A.join("-"):A[0]?A[0]:A[1]?A[1]:"center",offset:c}}},33688:function(e,t,r){"use strict";var n=r(3480),i=r(3400),a=i.strTranslate,o=i.strScale,s=r(84888).KY,l=r(9616),A=r(33428),c=r(43616),u=r(72736),g=r(14440),f="mapbox",h=t.constants=r(47552);function d(e){return"string"===typeof e&&(-1!==h.styleValuesMapbox.indexOf(e)||0===e.indexOf("mapbox://")||0===e.indexOf("stamen"))}t.name=f,t.attr="subplot",t.idRoot=f,t.idRegex=t.attrRegex=i.counterRegex(f),t.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},t.layoutAttributes=r(5232),t.supplyLayoutDefaults=r(5976),t.plot=function(e){var t=e._fullLayout,r=e.calcdata,a=t._subplots[f];if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var o=function(e,t){var r=e._fullLayout,n=e._context;if(""===n.mapboxAccessToken)return"";for(var a=[],o=[],s=!1,l=!1,A=0;A1&&i.warn(h.multipleTokensErrorMsg),a[0]):(o.length&&i.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(e,a);n.accessToken=o;for(var l=0;lC/2){var B=m.split("|").join("
");v.text(B).attr("data-unformatted",B).call(u.convertToTspans,e),E=c.bBox(v.node())}v.attr("transform",a(-3,8-E.height)),I.insert("rect",".static-attribution").attr({x:-E.width-6,y:-E.height-3,width:E.width+6,height:E.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;E.width+6>C&&(b=C/(E.width+6));var x=[n.l+n.w*g.x[1],n.t+n.h*(1-g.y[0])];I.attr("transform",a(x[0],x[1])+o(b))}},t.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[f],n=0;n0){for(var r=0;r0}function c(e){var t={},r={};switch(e.type){case"circle":n.extendFlat(r,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":n.extendFlat(r,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var i=e.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(t,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":e.color,"text-color":i.textfont.color,"text-opacity":e.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:r}}l.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=A(e)},l.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},l.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},l.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapboxLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},l.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,A(e)){var r=function(e){var t,r=e.sourcetype,n=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"===typeof n?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=n,e.sourceattribution&&(a.attribution=i(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&p(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&A.click(n,t.originalEvent)}}},v.updateFx=function(e){var t=this,r=t.map,n=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[A([r.xmin,r.ymin]),A([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(A)};var s=t.dragOptions;t.dragOptions=i.extendDeep(s||{},{dragmode:e.dragmode,element:t.div,gd:n,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),g(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){f(e,r,n,t.dragOptions,o)},l.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function A(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},v.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},v.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t=t.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=t._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){C.sendDataToCloud(e)}));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})}}(e,o),s.text(o.text()&&l.text()?" - ":"")}},C.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=C.graphJson(e,!1,"keepdata"),i.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var x=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function Q(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,i={};function a(e){for(var r=!0,a=0;a1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(A,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,C.linkSubplots(g,s,c,n),C.cleanPlot(g,s,c,n);var P=!(!n._has||!n._has("gl2d")),G=!(!s._has||!s._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||P,z=!(!s._has||!s._has("cartesian"))||G;U&&!z?n._bgLayer.remove():z&&!U&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&d({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var i=0;i0){var c=1-2*s;n=Math.round(c*n),i=Math.round(c*i)}}var g=C.layoutAttributes.width.min,f=C.layoutAttributes.height.min;n1,d=!t.height&&Math.abs(r.height-i)>1;(d||h)&&(h&&(r.width=n),d&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),C.sanitizeMargins(r)},C.supplyLayoutModuleDefaults=function(e,t,r,n){var i,a,o,s=l.componentsRegistry,A=t._basePlotModules,c=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(e,t);for(var g in A.length||A.push(c),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),c.finalizeSubplots(e,t)),t._subplots)t._subplots[g].sort(u.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(f){var m=(r.t+r.b)/f;m>1&&(r.t/=m,r.b/=m)}var I=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,E=void 0!==r.yt?r.yt:r.y,B=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:I,size:r.l+p},r:{val:v,size:r.r+p},b:{val:B,size:r.b+p},t:{val:E,size:r.t+p}},d[t]=1}else delete h[t],delete d[t];if(!n._replotting)return C.doAutoMargin(e)}},C.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),T(t);var i=t._size,a=t.margin,s={t:0,b:0,l:0,r:0},A=u.extendFlat({},i),c=a.l,g=a.r,f=a.t,d=a.b,p=t._pushmargin,y=t._pushmarginIds,m=t.minreducedwidth,I=t.minreducedheight;if(!1!==a.autoexpand){for(var v in p)y[v]||delete p[v];var E=e._fullLayout._reservedMargin;for(var B in E)for(var b in E[B]){var x=E[B][b];s[b]=Math.max(s[b],x)}for(var w in p.base={l:{val:0,size:c},r:{val:1,size:g},t:{val:1,size:f},b:{val:0,size:d}},s){var Q=0;for(var _ in p)"base"!==_&&o(p[_][w].size)&&(Q=p[_][w].size>Q?p[_][w].size:Q);var S=Math.max(0,a[w]-Q);s[w]=Math.max(0,s[w]-S)}for(var k in p){var D=p[k].l||{},M=p[k].b||{},R=D.val,L=D.size,N=M.val,F=M.size,O=r-s.r-s.l,P=n-s.t-s.b;for(var G in p){if(o(L)&&p[G].r){var U=p[G].r.val,z=p[G].r.size;if(U>R){var q=(L*U+(z-O)*R)/(U-R),H=(z*(1-R)+(L-O)*(1-U))/(U-R);q+H>c+g&&(c=q,g=H)}}if(o(F)&&p[G].t){var Y=p[G].t.val,J=p[G].t.size;if(Y>N){var K=(F*Y+(J-P)*N)/(Y-N),j=(J*(1-N)+(F-P)*(1-Y))/(Y-N);K+j>d+f&&(d=K,f=j)}}}}}var V=u.constrain(r-a.l-a.r,2,m),W=u.constrain(n-a.t-a.b,2,I),Z=Math.max(0,r-V),X=Math.max(0,n-W);if(Z){var $=(c+g)/Z;$>1&&(c/=$,g/=$)}if(X){var ee=(d+f)/X;ee>1&&(d/=ee,f/=ee)}if(i.l=Math.round(c)+s.l,i.r=Math.round(g)+s.r,i.t=Math.round(f)+s.t,i.b=Math.round(d)+s.b,i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!t._replotting&&(C.didMarginChange(A,i)||function(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var t=h.list(e,"",!0);for(var r in t)if(t[r].autoshift||t[r].shift)return!0;return!1}(e))){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var te=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function s(){return a++,function(){var t;o++,n||o!==a||(t=i,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)))}}r.runFn(s),setTimeout(s())}))}],a=u.syncOrAsync(i,e);return a&&a.then||(a=Promise.resolve()),a.then((function(){return e}))}C.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},C.graphJson=function(e,t,r,n,i,a){(i&&t&&!e._fullData||i&&!t&&!e._fullLayout)&&C.supplyDefaults(e);var o=i?e._fullData:e.data,l=i?e._fullLayout:e.layout,A=(e._transitionData||{})._frames;function c(e,t){if("function"===typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,i={};return Object.keys(e).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!==typeof e[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(e[a],t)}else t&&(i[a]="_function")})),i}var a=Array.isArray(e),o=u.isTypedArray(e);if((a||o)&&e.dtype&&e.shape){var l=e.bdata;return c({dtype:e.dtype,shape:e.shape,bdata:u.isArrayBuffer(l)?s.encode(l):l},t)}return a?e.map((function(e){return c(e,t)})):o?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var g={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(g.layout=c(l),i)){var f=l._size;g.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return A&&(g.frames=c(A)),a&&(g.config=c(e._context,!0)),"object"===n?g:JSON.stringify(g)},C.modifyFrames=function(e,t){var r,n,i,a=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;a--)if(l[a].enabled){r._indexToPoints=l[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,g[t]=o}}for(N(o,s,c),i=0;i1e-10?e:0}function g(e,t,r){t=t||0,r=r||0;for(var n=e.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,t.length);return[t[r],t[i]]},findIntersectionXY:A,findXYatLength:function(e,t,r,n){var i=-t*r,a=t*t+1,o=2*(t*i-r),s=i*i+r*r-e*e,l=Math.sqrt(o*o-4*a*s),A=(-o+l)/(2*a),c=(-o-l)/(2*a);return[[A,t*A+i+n],[c,t*c+i+n]]},clampTiny:u,pathPolygon:function(e,t,r,n,i,a){return"M"+g(c(e,t,r,n),i,a).join("L")},pathPolygonAnnulus:function(e,t,r,n,i,a,o){var s,l;e=90||l>90&&A>=450?1:u<=0&&f<=0?0:Math.max(u,f),t=l<=180&&A>=180||l>180&&A>=540?-1:c>=0&&g>=0?0:Math.min(c,g),r=l<=270&&A>=270||l>270&&A>=630?-1:u>=0&&f>=0?0:Math.min(u,f),n=A>=360?1:c<=0&&g<=0?0:Math.max(c,g),[t,r,n,i]}(h),E=v[2]-v[0],C=v[3]-v[1],B=f/g,b=Math.abs(C/E);B>b?(d=g,I=(f-(p=g*b))/i.h/2,y=[s[0],s[1]],m=[u[0]+I,u[1]-I]):(p=f,I=(g-(d=f/b))/i.w/2,y=[s[0]+I,s[1]-I],m=[u[0],u[1]]),r.xLength2=d,r.yLength2=p,r.xDomain2=y,r.yDomain2=m;var x,w=r.xOffset2=i.l+i.w*y[0],Q=r.yOffset2=i.t+i.h*(1-m[1]),_=r.radius=d/E,S=r.innerRadius=r.getHole(t)*_,k=r.cx=w-_*v[0],D=r.cy=Q+_*v[3],T=r.cxx=k-w,M=r.cyy=D-Q,R=a.side;"counterclockwise"===R?(x=R,R="top"):"clockwise"===R&&(x=R,R="bottom"),r.radialAxis=r.mockAxis(e,t,a,{_id:"x",side:R,_trueSide:x,domain:[S/i.w,_/i.w]}),r.angularAxis=r.mockAxis(e,t,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(e,t),r.updateAngularAxis(e,t),r.updateRadialAxis(e,t),r.updateRadialAxisTitle(e,t),r.xaxis=r.mockCartesianAxis(e,t,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(e,t,{_id:"y",domain:m});var F=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",F).attr("transform",l(T,M)),n.frontplot.attr("transform",l(w,Q)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",F).attr("transform",l(k,D)).call(A.fill,t.bgcolor)},P.mockAxis=function(e,t,r,n){var i=o.extendFlat({},r,n);return h(i,t,e),i},P.mockCartesianAxis=function(e,t,r){var n=this,i=n.isSmith,a=r._id,s=o.extendFlat({type:"linear"},r);f(s,e);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var e=n.sectorBBox,r=l[a],i=n.radialAxis._rl,o=(i[1]-i[0])/(1-n.getHole(t));s.range=[e[r[0]]*o,e[r[1]]*o]},s.isPtWithinRange="x"!==a||i?function(){return!0}:function(e){return n.isPtInside(e)},s.setRange(),s.setScale(),s},P.doAutoRange=function(e,t){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(t);d(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],void 0!==i.minallowed){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]90&&d<=270&&(p.tickangle=180);var I=m?function(e){var t=M(r,k([e.x,0]));return l(t[0]-u,t[1]-f)}:function(e){return l(p.l2p(e.x)+c,0)},v=m?function(e){return T(r,e.x,-1/0,1/0)}:function(e){return r.pathArc(p.r2p(e.x)+c)},E=G(h);if(r.radialTickLayout!==E&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=E),y){p.setScale();var C=0,B=m?(p.tickvals||[]).filter((function(e){return e>=0})).map((function(e){return g.tickText(p,e,!0,!1)})):g.calcTicks(p),b=m?B:g.clipEnds(p,B),x=g.getTickSigns(p)[2];m&&(("top"===p.ticks&&"bottom"===p.side||"bottom"===p.ticks&&"top"===p.side)&&(x=-x),"top"===p.ticks&&"top"===p.side&&(C=-p.ticklen),"bottom"===p.ticks&&"bottom"===p.side&&(C=p.ticklen)),g.drawTicks(n,p,{vals:B,layer:i["radial-axis"],path:g.makeTickPath(p,0,x),transFn:I,crisp:!1}),g.drawGrid(n,p,{vals:b,layer:i["radial-grid"],path:v,transFn:o.noop,crisp:!1}),g.drawLabels(n,p,{vals:B,layer:i["radial-axis"],transFn:I,labelFns:g.makeLabelFns(p,C)})}var w=r.radialAxisAngle=r.vangles?F(U(N(h.angle),r.vangles)):h.angle,Q=l(u,f),_=Q+s(-w);z(i["radial-axis"],y&&(h.showticklabels||h.ticks),{transform:_}),z(i["radial-grid"],y&&h.showgrid,{transform:m?"":Q}),z(i["radial-line"].select("line"),y&&h.showline,{x1:m?-a:c,y1:0,x2:a,y2:0,transform:_}).attr("stroke-width",h.linewidth).call(A.stroke,h.linecolor)},P.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(t),A=n.id+"title",u=0;if(l.title){var g=c.bBox(n.layers["radial-axis"].node()).height,f=l.title.font.size,h=l.side;u="top"===h?f:"counterclockwise"===h?-(g+.4*f):g+.8*f}var d=void 0!==r?r:n.radialAxisAngle,p=N(d),y=Math.cos(p),m=Math.sin(p),v=o+a/2*y+u*m,E=s-a/2*m+u*y;n.layers["radial-axis-title"]=I.draw(i,A,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:R(i,"Click to enter radial axis title"),attributes:{x:v,y:E,"text-anchor":"middle"},transform:{rotate:-d}})}},P.updateAngularAxis=function(e,t){var r=this,n=r.gd,i=r.layers,a=r.radius,c=r.innerRadius,u=r.cx,f=r.cy,h=r.getAngular(t),d=r.angularAxis,p=r.isSmith;p||(r.fillViewInitialKey("angularaxis.rotation",h.rotation),d.setGeometry(),d.setScale());var y=p?function(e){var t=M(r,k([0,e.x]));return Math.atan2(t[0]-u,t[1]-f)-Math.PI/2}:function(e){return d.t2g(e.x)};"linear"===d.type&&"radians"===d.thetaunit&&(d.tick0=F(d.tick0),d.dtick=F(d.dtick));var m=function(e){return l(u+a*Math.cos(e),f-a*Math.sin(e))},I=p?function(e){var t=M(r,k([0,e.x]));return l(t[0],t[1])}:function(e){return m(y(e))},v=p?function(e){var t=M(r,k([0,e.x])),n=Math.atan2(t[0]-u,t[1]-f)-Math.PI/2;return l(t[0],t[1])+s(-F(n))}:function(e){var t=y(e);return m(t)+s(-F(t))},E=p?function(e){return D(r,e.x,0,1/0)}:function(e){var t=y(e),r=Math.cos(t),n=Math.sin(t);return"M"+[u+c*r,f-c*n]+"L"+[u+a*r,f-a*n]},C=g.makeLabelFns(d,0).labelStandoff,B={xFn:function(e){var t=y(e);return Math.cos(t)*C},yFn:function(e){var t=y(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(C+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*w)},anchorFn:function(e){var t=y(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(e,t,r){var n=y(e);return-.5*(1+Math.sin(n))*r}},b=G(h);r.angularTickLayout!==b&&(i["angular-axis"].selectAll("."+d._id+"tick").remove(),r.angularTickLayout=b);var x,Q=p?[1/0].concat(d.tickvals||[]).map((function(e){return g.tickText(d,e,!0,!1)})):g.calcTicks(d);if(p&&(Q[0].text="\u221e",Q[0].fontSize*=1.75),"linear"===t.gridshape?(x=Q.map(y),o.angleDelta(x[0],x[1])<0&&(x=x.slice().reverse())):x=null,r.vangles=x,"category"===d.type&&(Q=Q.filter((function(e){return o.isAngleInsideSector(y(e),r.sectorInRad)}))),d.visible){var _="inside"===d.ticks?-1:1,S=(d.linewidth||1)/2;g.drawTicks(n,d,{vals:Q,layer:i["angular-axis"],path:"M"+_*S+",0h"+_*d.ticklen,transFn:v,crisp:!1}),g.drawGrid(n,d,{vals:Q,layer:i["angular-grid"],path:E,transFn:o.noop,crisp:!1}),g.drawLabels(n,d,{vals:Q,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:I,labelFns:B})}z(i["angular-line"].select("path"),h.showline,{d:r.pathSubplot(),transform:l(u,f)}).attr("stroke-width",h.linewidth).call(A.stroke,h.linecolor)},P.updateFx=function(e,t){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e))},P.updateHoverAndMainDrag=function(e){var t,r,s=this,A=s.isSmith,c=s.gd,u=s.layers,g=e._zoomlayer,f=Q.MINZOOM,h=Q.OFFEDGE,d=s.radius,I=s.innerRadius,B=s.cx,b=s.cy,x=s.cxx,w=s.cyy,S=s.sectorInRad,k=s.vangles,D=s.radialAxis,T=_.clampTiny,M=_.findXYatLength,R=_.findEnclosingVertexAngles,L=Q.cornerHalfWidth,N=Q.cornerLen/2,F=p.makeDragger(u,"path","maindrag",!1===e.dragmode?"none":"crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(B,b)),F.onmousemove=function(e){m.hover(c,e,s.id),c._fullLayout._lasthover=F,c._fullLayout._hoversubplot=s.id},F.onmouseout=function(e){c._dragging||y.unhover(c,e)};var O,P,G,U,z,q,H,Y,J,K={element:F,gd:c,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function j(e,t){return Math.sqrt(e*e+t*t)}function V(e,t){return j(e-x,t-w)}function W(e,t){return Math.atan2(w-t,e-x)}function Z(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function X(e,t){if(0===e)return s.pathSector(2*L);var r=N/e,n=t-r,i=t+r,a=Math.max(0,Math.min(e,d)),o=a-L,l=a+L;return"M"+Z(o,n)+"A"+[o,o]+" 0,0,0 "+Z(o,i)+"L"+Z(l,i)+"A"+[l,l]+" 0,0,1 "+Z(l,n)+"Z"}function $(e,t,r){if(0===e)return s.pathSector(2*L);var n,i,a=Z(e,t),o=Z(e,r),l=T((a[0]+o[0])/2),A=T((a[1]+o[1])/2);if(l&&A){var c=A/l,u=-1/c,g=M(L,c,l,A);n=M(N,u,g[0][0],g[0][1]),i=M(N,u,g[1][0],g[1][1])}else{var f,h;A?(f=N,h=L):(f=L,h=N),n=[[l-f,A-h],[l+f,A-h]],i=[[l-f,A+h],[l+f,A+h]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function ee(e,t){return t=Math.max(Math.min(t,d),I),ef?(e-1&&1===e&&E(t,c,[s.xaxis],[s.yaxis],s.id,K),r.indexOf("event")>-1&&m.click(c,t,s.id)}K.prepFn=function(e,n,a){var l=c._fullLayout.dragmode,u=F.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var f=c._fullLayout._invTransform;t=c._fullLayout._invScaleX,r=c._fullLayout._invScaleY;var h=o.apply3DTransform(f)(n-u.left,a-u.top);if(O=h[0],P=h[1],k){var y=_.findPolygonOffset(d,S[0],S[1],k);O+=x+y[0],P+=w+y[1]}switch(l){case"zoom":K.clickFn=se,A||(K.moveFn=k?ie:re,K.doneFn=ae,function(){G=null,U=null,z=s.pathSubplot(),q=!1;var e=c._fullLayout[s.id];H=i(e.bgcolor).getLuminance(),(Y=p.makeZoombox(g,H,B,b,z)).attr("fill-rule","evenodd"),J=p.makeCorners(g,B,b),C(c)}());break;case"select":case"lasso":v(e,n,a,K,l)}},y.init(K)},P.updateRadialDrag=function(e,t,r){var i=this,A=i.gd,c=i.layers,u=i.radius,g=i.innerRadius,f=i.cx,h=i.cy,d=i.radialAxis,m=Q.radialDragBoxSize,I=m/2;if(d.visible){var v,E,B,w=N(i.radialAxisAngle),_=d._rl,S=_[0],k=_[1],D=_[r],T=.75*(_[1]-_[0])/(1-i.getHole(t))/u;r?(v=f+(u+I)*Math.cos(w),E=h-(u+I)*Math.sin(w),B="radialdrag"):(v=f+(g-I)*Math.cos(w),E=h-(g-I)*Math.sin(w),B="radialdrag-inner");var M,R,L,O=p.makeRectDragger(c,B,"crosshair",-I,-I,m,m),P={element:O,gd:A};!1===e.dragmode&&(P.dragmode=!1),z(n.select(O),d.visible&&g0===(r?L>S:Ln?function(e){return e<=0}:function(e){return e>=0};e.c2g=function(r){var n=e.c2l(r)-t;return(s(n)?n:0)+o},e.g2c=function(r){return e.l2c(r+t-o)},e.g2p=function(e){return e*a},e.c2p=function(t){return e.g2p(e.c2g(t))}}}(e,t);break;case"angularaxis":!function(e,t){var r=e.type;if("linear"===r){var i=e.d2c,s=e.c2d;e.d2c=function(e,t){return function(e,t){return"degrees"===t?a(e):e}(i(e),t)},e.c2d=function(e,t){return s(function(e,t){return"degrees"===t?o(e):e}(e,t))}}e.makeCalcdata=function(t,r){var n,i,a=t[r],o=t._length,s=function(r){return e.d2c(r,t.thetaunit)};if(a)for(n=new Array(o),i=0;i0?1:0}function r(e){var t=e[0],r=e[1];if(!isFinite(t)||!isFinite(r))return[1,0];var n=(t+1)*(t+1)+r*r;return[(t*t+r*r-1)/n,2*r/n]}function n(e,t){var r=t[0],n=t[1];return[r*e.radius+e.cx,-n*e.radius+e.cy]}function i(e,t){return t*e.radius}e.exports={smith:r,reactanceArc:function(e,t,a,o){var s=n(e,r([a,t])),l=s[0],A=s[1],c=n(e,r([o,t])),u=c[0],g=c[1];if(0===t)return["M"+l+","+A,"L"+u+","+g].join(" ");var f=i(e,1/Math.abs(t));return["M"+l+","+A,"A"+f+","+f+" 0 0,"+(t<0?1:0)+" "+u+","+g].join(" ")},resistanceArc:function(e,a,o,s){var l=i(e,1/(a+1)),A=n(e,r([a,o])),c=A[0],u=A[1],g=n(e,r([a,s])),f=g[0],h=g[1];if(t(o)!==t(s)){var d=n(e,r([a,0]));return["M"+c+","+u,"A"+l+","+l+" 0 0,"+(00){for(var n=[],i=0;i=c&&(g.min=0,h.min=0,p.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function d(e,t,r,n){var i=g[t._name];function o(r,n){return a.coerce(e,t,i,r,n)}o("uirevision",n.uirevision),t.type="linear";var f=o("color"),h=f!==i.color.dflt?f:r.font.color,d=t._name.charAt(0).toUpperCase(),p="Component "+d,y=o("title.text",p);t._hovertitle=y===p?y:d,a.coerceFont(o,"title.font",{weight:r.font.weight,style:r.font.style,variant:r.font.variant,family:r.font.family,size:a.bigFont(r.font.size),color:h}),o("min"),c(e,t,o,"linear"),l(e,t,o,"linear"),s(e,t,o,"linear",{noAutotickangles:!0}),A(e,t,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{weight:r.font.weight,style:r.font.style,variant:r.font.variant,family:r.font.family,size:r.font.size,color:h}),o("tickangle"),o("tickformat")),u(e,t,o,{dfltColor:f,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:g,handleDefaults:h,font:t.font,paper_bgcolor:t.paper_bgcolor})}},24696:function(e,t,r){"use strict";var n=r(33428),i=r(49760),a=r(24040),o=r(3400),s=o.strTranslate,l=o._,A=r(76308),c=r(43616),u=r(78344),g=r(92880).extendFlat,f=r(7316),h=r(54460),d=r(86476),p=r(93024),y=r(72760),m=y.freeMode,I=y.rectMode,v=r(81668),E=r(22676).prepSelect,C=r(22676).selectOnClick,B=r(22676).clearOutline,b=r(22676).clearSelectionsCache,x=r(33816);function w(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=w;var Q=w.prototype;Q.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},Q.plot=function(e,t){var r=this,n=t[r.id],i=t._size;r._hasClipOnAxisFalse=!1;for(var a=0;a_*v?i=(a=v)*_:a=(i=I)/_,o=y*i/I,l=m*a/v,r=t.l+t.w*d-i/2,n=t.t+t.h*(1-p)-a/2,f.x0=r,f.y0=n,f.w=i,f.h=a,f.sum=E,f.xaxis={type:"linear",range:[C+2*b-E,E-C-2*B],domain:[d-o/2,d+o/2],_id:"x"},u(f.xaxis,f.graphDiv._fullLayout),f.xaxis.setScale(),f.xaxis.isPtWithinRange=function(e){return e.a>=f.aaxis.range[0]&&e.a<=f.aaxis.range[1]&&e.b>=f.baxis.range[1]&&e.b<=f.baxis.range[0]&&e.c>=f.caxis.range[1]&&e.c<=f.caxis.range[0]},f.yaxis={type:"linear",range:[C,E-B-b],domain:[p-l/2,p+l/2],_id:"y"},u(f.yaxis,f.graphDiv._fullLayout),f.yaxis.setScale(),f.yaxis.isPtWithinRange=function(){return!0};var x=f.yaxis.domain[0],w=f.aaxis=g({},e.aaxis,{range:[C,E-B-b],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[x,x+l*_],anchor:"free",position:0,_id:"y",_length:i});u(w,f.graphDiv._fullLayout),w.setScale();var Q=f.baxis=g({},e.baxis,{range:[E-C-b,B],side:"bottom",domain:f.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(Q,f.graphDiv._fullLayout),Q.setScale();var S=f.caxis=g({},e.caxis,{range:[E-C-B,b],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[x,x+l*_],anchor:"free",position:0,_id:"y",_length:i});u(S,f.graphDiv._fullLayout),S.setScale();var k="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";f.clipDef.select("path").attr("d",k),f.layers.plotbg.select("path").attr("d",k);var D="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";f.clipDefRelative.select("path").attr("d",D);var T=s(r,n);f.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",T),f.clipDefRelative.select("path").attr("transform",null);var M=s(r-Q._offset,n+a);f.layers.baxis.attr("transform",M),f.layers.bgrid.attr("transform",M);var R=s(r+i/2,n)+"rotate(30)"+s(0,-w._offset);f.layers.aaxis.attr("transform",R),f.layers.agrid.attr("transform",R);var L=s(r+i/2,n)+"rotate(-30)"+s(0,-S._offset);f.layers.caxis.attr("transform",L),f.layers.cgrid.attr("transform",L),f.drawAxes(!0),f.layers.aline.select("path").attr("d",w.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(A.stroke,w.linecolor||"#000").style("stroke-width",(w.linewidth||0)+"px"),f.layers.bline.select("path").attr("d",Q.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(A.stroke,Q.linecolor||"#000").style("stroke-width",(Q.linewidth||0)+"px"),f.layers.cline.select("path").attr("d",S.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(A.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),f.graphDiv._context.staticPlot||f.initInteractions(),c.setClipUrl(f.layers.frontplot,f._hasClipOnAxisFalse?null:f.clipId,f.graphDiv)},Q.drawAxes=function(e){var t=this,r=t.graphDiv,n=t.id.substr(7)+"title",i=t.layers,a=t.aaxis,o=t.baxis,s=t.caxis;if(t.drawAx(a),t.drawAx(o),t.drawAx(s),e){var A=Math.max(a.showticklabels?a.tickfont.size/2:0,(s.showticklabels?.75*s.tickfont.size:0)+("outside"===s.ticks?.87*s.ticklen:0)),c=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=v.draw(r,"a"+n,{propContainer:a,propName:t.id+".aaxis.title",placeholder:l(r,"Click to enter Component A title"),attributes:{x:t.x0+t.w/2,y:t.y0-a.title.font.size/3-A,"text-anchor":"middle"}}),i["b-title"]=v.draw(r,"b"+n,{propContainer:o,propName:t.id+".baxis.title",placeholder:l(r,"Click to enter Component B title"),attributes:{x:t.x0-c,y:t.y0+t.h+.83*o.title.font.size+c,"text-anchor":"middle"}}),i["c-title"]=v.draw(r,"c"+n,{propContainer:s,propName:t.id+".caxis.title",placeholder:l(r,"Click to enter Component C title"),attributes:{x:t.x0+t.w+c,y:t.y0+t.h+.83*s.title.font.size+c,"text-anchor":"middle"}})}},Q.drawAx=function(e){var t,r=this,n=r.graphDiv,i=e._name,a=i.charAt(0),s=e._id,l=r.layers[i],A=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);r[A]!==c&&(l.selectAll("."+s+"tick").remove(),r[A]=c),e.setScale();var u=h.calcTicks(e),g=h.clipEnds(e,u),f=h.makeTransTickFn(e),d=h.getTickSigns(e)[2],p=o.deg2rad(30),y=d*(e.linewidth||1)/2,m=d*e.ticklen,I=r.w,v=r.h,E="b"===a?"M0,"+y+"l"+Math.sin(p)*m+","+Math.cos(p)*m:"M"+y+",0l"+Math.cos(p)*m+","+-Math.sin(p)*m,C={a:"M0,0l"+v+",-"+I/2,b:"M0,0l-"+I/2+",-"+v,c:"M0,0l-"+v+","+I/2}[a];h.drawTicks(n,e,{vals:"inside"===e.ticks?g:u,layer:l,path:E,transFn:f,crisp:!1}),h.drawGrid(n,e,{vals:g,layer:r.layers[a+"grid"],path:C,transFn:f,crisp:!1}),h.drawLabels(n,e,{vals:u,layer:l,transFn:f,labelFns:h.makeLabelFns(e,0,30)})};var S=x.MINZOOM/2+.87,k="m-0.87,.5h"+S+"v3h-"+(S+5.2)+"l"+(S/2+2.6)+",-"+(.87*S+4.5)+"l2.6,1.5l-"+S/2+","+.87*S+"Z",D="m0.87,.5h-"+S+"v3h"+(S+5.2)+"l-"+(S/2+2.6)+",-"+(.87*S+4.5)+"l-2.6,1.5l"+S/2+","+.87*S+"Z",T="m0,1l"+S/2+","+.87*S+"l2.6,-1.5l-"+(S/2+2.6)+",-"+(.87*S+4.5)+"l-"+(S/2+2.6)+","+(.87*S+4.5)+"l2.6,1.5l"+S/2+",-"+.87*S+"Z",M=!0;function R(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}Q.clearOutline=function(){b(this.dragOptions),B(this.dragOptions.gd)},Q.initInteractions=function(){var e,t,r,n,u,g,f,h,y,v,B,b,w=this,Q=w.layers.plotbg.select("path").node(),S=w.graphDiv,L=S._fullLayout._zoomlayer;function N(e){var t={};return t[w.id+".aaxis.min"]=e.a,t[w.id+".baxis.min"]=e.b,t[w.id+".caxis.min"]=e.c,t}function F(e,t){var r=S._fullLayout.clickmode;R(S),2===e&&(S.emit("plotly_doubleclick",null),a.call("_guiRelayout",S,N({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&C(t,S,[w.xaxis],[w.yaxis],w.id,w.dragOptions),r.indexOf("event")>-1&&p.click(S,t,w.id)}function O(e,t){return 1-t/w.h}function P(e,t){return 1-(e+(w.h-t)/Math.sqrt(3))/w.w}function G(e,t){return(e-(w.h-t)/Math.sqrt(3))/w.w}function U(i,a){var o=r+i*e,s=n+a*t,l=Math.max(0,Math.min(1,O(0,n),O(0,s))),A=Math.max(0,Math.min(1,P(r,n),P(o,s))),c=Math.max(0,Math.min(1,G(r,n),G(o,s))),d=(l/2+c)*w.w,p=(1-l/2-A)*w.w,m=(d+p)/2,I=p-d,E=(1-l)*w.h,C=E-I/_;I.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),b.transition().style("opacity",1).duration(200),v=!0),S.emit("plotly_relayouting",N(f))}function z(){R(S),f!==u&&(a.call("_guiRelayout",S,N(f)),M&&S.data&&S._context.showTips&&(o.notifier(l(S,"Double-click to zoom back out"),"long"),M=!1))}function q(e,t){var r=e/w.xaxis._m,n=t/w.yaxis._m,i=[(f={a:u.a-n,b:u.b+(r+n)/2,c:u.c-(r-n)/2}).a,f.b,f.c].sort(o.sorterAsc),a=i.indexOf(f.a),l=i.indexOf(f.b),A=i.indexOf(f.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),f={a:i[a],b:i[l],c:i[A]},t=(u.a-f.a)*w.yaxis._m,e=(u.c-f.c-u.b+f.b)*w.xaxis._m);var g=s(w.x0+e,w.y0+t);w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",g);var h=s(-e,-t);w.clipDefRelative.select("path").attr("transform",h),w.aaxis.range=[f.a,w.sum-f.b-f.c],w.baxis.range=[w.sum-f.a-f.c,f.b],w.caxis.range=[w.sum-f.a-f.b,f.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,w),S.emit("plotly_relayouting",N(f))}function H(){a.call("_guiRelayout",S,N(f))}this.dragOptions={element:Q,gd:S,plotinfo:{id:w.id,domain:S._fullLayout[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(a,l,c){w.dragOptions.xaxes=[w.xaxis],w.dragOptions.yaxes=[w.yaxis],e=S._fullLayout._invScaleX,t=S._fullLayout._invScaleY;var d=w.dragOptions.dragmode=S._fullLayout.dragmode;m(d)?w.dragOptions.minDrag=1:w.dragOptions.minDrag=void 0,"zoom"===d?(w.dragOptions.moveFn=U,w.dragOptions.clickFn=F,w.dragOptions.doneFn=z,function(e,t,a){var l=Q.getBoundingClientRect();r=t-l.left,n=a-l.top,S._fullLayout._calcInverseTransform(S);var c=S._fullLayout._invTransform,d=o.apply3DTransform(c)(r,n);r=d[0],n=d[1],u={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},f=u,g=w.aaxis.range[1]-u.a,h=i(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),y="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",v=!1,B=L.append("path").attr("class","zoombox").attr("transform",s(w.x0,w.y0)).style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",y),b=L.append("path").attr("class","zoombox-corners").attr("transform",s(w.x0,w.y0)).style({fill:A.background,stroke:A.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),w.clearOutline(S)}(0,l,c)):"pan"===d?(w.dragOptions.moveFn=q,w.dragOptions.clickFn=F,w.dragOptions.doneFn=H,u={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},f=u,w.clearOutline(S)):(I(d)||m(d))&&E(a,l,c,w.dragOptions,d)}},Q.onmousemove=function(e){p.hover(S,e,w.id),S._fullLayout._lasthover=Q,S._fullLayout._hoversubplot=w.id},Q.onmouseout=function(e){S._dragging||d.unhover(S,e)},d.init(this.dragOptions)}},24040:function(e,t,r){"use strict";var n=r(24248),i=r(16628),a=r(52416),o=r(63620),s=r(52200).addStyleRule,l=r(92880),A=r(45464),c=r(64859),u=l.extendFlat,g=l.extendDeepAll;function f(e){var r=e.name,i=e.categories,a=e.meta;if(t.modules[r])n.log("Type "+r+" already registered");else{t.subplotsRegistry[e.basePlotModule.name]||function(e){var r=e.name;if(t.subplotsRegistry[r])n.log("Plot type "+r+" already registered.");else for(var i in y(e),t.subplotsRegistry[r]=e,t.componentsRegistry)v(i,e.name)}(e.basePlotModule);for(var o={},l=0;l-1&&(u[f[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(C)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(C=(C=(C=C.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),C}},84664:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t){for(var r=0;ru+A||!n(c))}for(var f=0;f=0)return e}else if("string"===typeof e&&"%"===(e=e.trim()).slice(-1)&&n(e.slice(0,-1))&&(e=+e.slice(0,-1))>=0)return e+"%"}function h(e,t,r,n,a,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),A=!(!1===o.moduleHasConstrain),c=!(!1===o.moduleHasCliponaxis),u=!(!1===o.moduleHasTextangle),f=!(!1===o.moduleHasInsideanchor),h=!!o.hasPathbar,d=Array.isArray(a)||"auto"===a,p=d||"inside"===a,y=d||"outside"===a;if(p||y){var m=g(n,"textfont",r.font),I=i.extendFlat({},m),v=!(e.textfont&&e.textfont.color);if(v&&delete I.color,g(n,"insidetextfont",I),h){var E=i.extendFlat({},m);v&&delete E.color,g(n,"pathbar.textfont",E)}y&&g(n,"outsidetextfont",m),s&&n("selected.textfont.color"),l&&n("unselected.textfont.color"),A&&n("constraintext"),c&&n("cliponaxis"),u&&n("textangle"),n("texttemplate")}p&&f&&n("insidetextanchor")}e.exports={supplyDefaults:function(e,t,r,n){function c(r,n){return i.coerce(e,t,u,r,n)}if(s(e,t,n,c)){l(e,t,n,c),c("xhoverformat"),c("yhoverformat"),c("zorder"),c("orientation",t.x&&!t.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var g=c("textposition");h(e,0,n,c,g,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),A(e,t,c,r,n);var f=(t.marker.line||{}).color,d=o.getComponentMethod("errorbars","supplyDefaults");d(e,t,f||a.defaultLine,{axis:"y"}),d(e,t,f||a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(t,c)}else t.visible=!1},crossTraceDefaults:function(e,t){var r,n;function a(e,t){return i.coerce(n._input,n,u,e,t)}for(var o=0;oa))return t}return void 0!==r?r:e.dflt},t.coerceColor=function(e,t,r){return i(t).isValid()?t:void 0!==r?r:e.dflt},t.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},t.getValue=function(e,t){var r;return a(e)?t0?t+=r:c<0&&(t-=r)}return t}function R(e){var t=c,r=e.b,i=M(e);return n.inbox(r-t,i-t,E+(i-t)/(i-r)-1)}var L=e[u+"a"],N=e[g+"a"];d=Math.abs(L.r2c(L.range[1])-L.r2c(L.range[0]));var F=n.getDistanceFunction(i,f,h,(function(e){return(f(e)+h(e))/2}));if(n.getClosest(p,F,e),!1!==e.index&&p[e.index].p!==A){b||(S=function(e){return Math.min(x(e),e.p-m.bargroupwidth/2)},k=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var O=p[e.index],P=y.base?O.b+O.s:O.s;e[g+"0"]=e[g+"1"]=N.c2p(O[g],!0),e[g+"LabelVal"]=P;var G=m.extents[m.extents.round(O.p)];e[u+"0"]=L.c2p(I?S(O):G[0],!0),e[u+"1"]=L.c2p(I?k(O):G[1],!0);var U=void 0!==O.orig_p;return e[u+"LabelVal"]=U?O.orig_p:O.p,e.labelLabel=l(L,e[u+"LabelVal"],y[u+"hoverformat"]),e.valueLabel=l(N,e[g+"LabelVal"],y[g+"hoverformat"]),e.baseLabel=l(N,O.b,y[g+"hoverformat"]),e.spikeDistance=(function(e){var t=c,r=e.b,i=M(e);return n.inbox(r-t,i-t,C+(i-t)/(i-r)-1)}(O)+function(e){return D(x(e),w(e),C)}(O))/2,e[u+"Spike"]=L.c2p(O.p,!0),o(O,y,e),e.hovertemplate=y.hovertemplate,e}}function u(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,i=s(e,t);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(e,t,r,n,a){var o=c(e,t,r,n,a);if(o){var s=o.cd,l=s[0].trace,A=s[o.index];return o.color=u(l,A),i.getComponentMethod("errorbars","hoverInfo")(A,l,o),[o]}},hoverOnBars:c,getTraceColor:u}},51132:function(e,t,r){"use strict";e.exports={attributes:r(20832),layoutAttributes:r(39324),supplyDefaults:r(31508).supplyDefaults,crossTraceDefaults:r(31508).crossTraceDefaults,supplyLayoutDefaults:r(37156),calc:r(71820),crossTraceCalc:r(96376).crossTraceCalc,colorbar:r(5528),arraysToCalcdata:r(84664),plot:r(98184).plot,style:r(60100).style,styleOnSelect:r(60100).styleOnSelect,hoverPoints:r(63400).hoverPoints,eventData:r(52160),selectPoints:r(45784),moduleType:"trace",name:"bar",basePlotModule:r(57952),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},39324:function(e){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}},37156:function(e,t,r){"use strict";var n=r(24040),i=r(54460),a=r(3400),o=r(39324),s=r(31508).validateCornerradius;e.exports=function(e,t,r){function l(r,n){return a.coerce(e,t,o,r,n)}for(var A=!1,c=!1,u=!1,g={},f=l("barmode"),h=0;h0)-(e<0)}function x(e,t){return e0}function _(e,t,r,n,i){return!(e<0||t<0)&&(r<=e&&n<=t||r<=t&&n<=e||(i?e>=r*(t/n):t>=n*(e/r)))}function S(e){return"auto"===e?0:e}function k(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:e.width*i+e.height*n,y:e.width*n+e.height*i}}function D(e,t,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,A=a.anchor,c="end"===A,u="start"===A,g=((a.leftToRight||0)+1)/2,f=1-g,h=a.hasB,d=a.r,p=a.overhead,y=i.width,m=i.height,I=Math.abs(t-e),v=Math.abs(n-r),C=I>2*E&&v>2*E?E:0;I-=2*C,v-=2*C;var B=S(l);"auto"!==l||y<=I&&m<=v||!(y>I||m>v)||(y>v||m>I)&&yE){var _=function(e,t,r,n,i,a,o,s,l){var A,c,u,g,f,h=Math.max(0,Math.abs(t-e)-2*E),d=Math.max(0,Math.abs(n-r)-2*E),p=a-E,y=o?p-Math.sqrt(p*p-(p-o)*(p-o)):p,m=l?2*p:s?p-o:2*y,I=l?2*p:s?2*y:p-o;return i.y/i.x>=d/(h-m)?g=d/i.y:i.y/i.x<=(d-I)/h?g=h/i.x:!l&&s?(A=i.x*i.x+i.y*i.y/4,u=(h-p)*(h-p)+(d/2-p)*(d/2-p)-p*p,g=(-(c=-2*i.x*(h-p)-i.y*(d/2-p))+Math.sqrt(c*c-4*A*u))/(2*A)):l?(A=(i.x*i.x+i.y*i.y)/4,u=(h/2-p)*(h/2-p)+(d/2-p)*(d/2-p)-p*p,g=(-(c=-i.x*(h/2-p)-i.y*(d/2-p))+Math.sqrt(c*c-4*A*u))/(2*A)):(A=i.x*i.x/4+i.y*i.y,u=(h/2-p)*(h/2-p)+(d-p)*(d-p)-p*p,g=(-(c=-i.x*(h/2-p)-2*i.y*(d-p))+Math.sqrt(c*c-4*A*u))/(2*A)),g=Math.min(1,g),f=s?Math.max(0,p-Math.sqrt(Math.max(0,p*p-(p-(d-i.y*g)/2)*(p-(d-i.y*g)/2)))-o):Math.max(0,p-Math.sqrt(Math.max(0,p*p-(p-(h-i.x*g)/2)*(p-(h-i.x*g)/2)))-o),{scale:g,pad:f}}(e,t,r,n,Q,d,p,o,h);b=_.scale,w=_.pad}else b=1,s&&(b=Math.min(1,I/Q.x,v/Q.y)),w=0;var D=i.left*f+i.right*g,T=(i.top+i.bottom)/2,M=(e+E)*f+(t-E)*g,R=(r+n)/2,L=0,N=0;if(u||c){var F=(o?Q.x:Q.y)/2;d&&(c||h)&&(C+=w);var O=o?x(e,t):x(r,n);o?u?(M=e+O*C,L=-O*F):(M=t-O*C,L=O*F):u?(R=r+O*C,N=-O*F):(R=n-O*C,N=O*F)}return{textX:D,textY:T,targetX:M,targetY:R,anchorX:L,anchorY:N,scale:b,rotate:B}}e.exports={plot:function(e,t,r,u,p,y){var C=t.xaxis,T=t.yaxis,M=e._fullLayout,R=e._context.staticPlot;p||(p={mode:M.barmode,norm:M.barmode,gap:M.bargap,groupgap:M.bargroupgap},f("bar",M));var L=a.makeTraceGroups(u,r,"trace bars").each((function(r){var A=n.select(this),u=r[0].trace,f=r[0].t,L="waterfall"===u.type,N="funnel"===u.type,F="histogram"===u.type,O="bar"===u.type,P=O||N,G=0;L&&u.connector.visible&&"between"===u.connector.mode&&(G=u.connector.line.width/2);var U="h"===u.orientation,z=Q(p),q=a.ensureSingle(A,"g","points"),H=B(u),Y=q.selectAll("g.point").data(a.identity,H);Y.enter().append("g").classed("point",!0),Y.exit().remove(),Y.each((function(A,B){var Q,L,N=n.select(this),q=function(e,t,r,n){var i=[],a=[],o=n?t:r,s=n?r:t;return i[0]=o.c2p(e.s0,!0),a[0]=s.c2p(e.p0,!0),i[1]=o.c2p(e.s1,!0),a[1]=s.c2p(e.p1,!0),n?[i,a]:[a,i]}(A,C,T,U),H=q[0][0],Y=q[0][1],J=q[1][0],K=q[1][1],j=0===(U?Y-H:K-J);if(j&&P&&d.getLineWidth(u,A)&&(j=!1),j||(j=!i(H)||!i(Y)||!i(J)||!i(K)),A.isBlank=j,j&&(U?Y=H:K=J),G&&!j&&(U?(H-=x(H,Y)*G,Y+=x(H,Y)*G):(J-=x(J,K)*G,K+=x(J,K)*G)),"waterfall"===u.type){if(!j){var V=u[A.dir].marker;Q=V.line.width,L=V.color}}else Q=d.getLineWidth(u,A),L=A.mc||u.marker.color;function W(e){var t=n.round(Q/2%1,2);return 0===p.gap&&0===p.groupgap?n.round(Math.round(e)-t,2):e}var Z=s.opacity(L)<1||Q>.01?W:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?W(e):e>t?Math.ceil(e):Math.floor(e)};e._context.staticPlot||(H=Z(H,Y,U),Y=Z(Y,H,U),J=Z(J,K,!U),K=Z(K,J,!U));var X,$=U?C.c2p:T.c2p;X=A.s0>0?A._sMax:A.s0<0?A._sMin:A.s1>0?A._sMax:A._sMin;var ee,te,re=O||F?function(e,t){if(!e)return 0;var r,n=U?Math.abs(K-J):Math.abs(Y-H),i=U?Math.abs(Y-H):Math.abs(K-J),a=Z(Math.abs($(X,!0)-$(0,!0))),o=A.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===t?n*(Math.min(50,e)/100):e,Z(Math.max(Math.min(r,o),0))}(f.cornerradiusvalue,f.cornerradiusform):0,ne="M"+H+","+J+"V"+K+"H"+Y+"V"+J+"Z",ie=0;if(re&&A.s){var ae=0===b(A.s0)||b(A.s)===b(A.s0)?A.s1:A.s0;if((ie=Z(A.hasB?0:Math.abs($(X,!0)-$(ae,!0))))0?Math.sqrt(ie*(2*re-ie)):0,ue=oe>0?Math.max:Math.min;ee="M"+H+","+J+"V"+(K-Ae*se)+"H"+ue(Y-(re-ie)*oe,H)+"A "+re+","+re+" 0 0 "+le+" "+Y+","+(K-re*se-ce)+"V"+(J+re*se+ce)+"A "+re+","+re+" 0 0 "+le+" "+ue(Y-(re-ie)*oe,H)+","+(J+Ae*se)+"Z"}else if(A.hasB)ee="M"+(H+re*oe)+","+J+"A "+re+","+re+" 0 0 "+le+" "+H+","+(J+re*se)+"V"+(K-re*se)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe)+","+K+"H"+(Y-re*oe)+"A "+re+","+re+" 0 0 "+le+" "+Y+","+(K-re*se)+"V"+(J+re*se)+"A "+re+","+re+" 0 0 "+le+" "+(Y-re*oe)+","+J+"Z";else{var ge=(te=Math.abs(K-J)+ie)0?Math.sqrt(ie*(2*re-ie)):0,he=se>0?Math.max:Math.min;ee="M"+(H+ge*oe)+","+J+"V"+he(K-(re-ie)*se,J)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe-fe)+","+K+"H"+(Y-re*oe+fe)+"A "+re+","+re+" 0 0 "+le+" "+(Y-ge*oe)+","+he(K-(re-ie)*se,J)+"V"+J+"Z"}}else ee=ne}else ee=ne;var de=w(a.ensureSingle(N,"path"),M,p,y);if(de.style("vector-effect",R?"none":"non-scaling-stroke").attr("d",isNaN((Y-H)*(K-J))||j&&e._context.staticPlot?"M0,0Z":ee).call(l.setClipUrl,t.layerClipId,e),!M.uniformtext.mode&&z){var pe=l.makePointStyleFns(u);l.singlePointStyle(A,de,u,pe,e)}!function(e,t,r,n,i,s,A,u,f,p,y,C,B){var b,Q=t.xaxis,T=t.yaxis,M=e._fullLayout;function R(t,r,n){return a.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+b,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,e)}var L=n[0].trace,N="h"===L.orientation,F=function(e,t,r,n,i){var o,s=t[0].trace,l=s.texttemplate;return o=l?function(e,t,r,n,i){var o=t[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,A,u,g,f="histogram"===o.type,h="waterfall"===o.type,d="funnel"===o.type,p="h"===o.orientation;function y(e){return c(A,A.c2l(e),!0).text}function m(e){return c(g,g.c2l(e),!0).text}p?(l="y",A=i,u="x",g=n):(l="x",A=n,u="y",g=i);var I=t[r],E={};E.label=I.p,E.labelLabel=E[l+"Label"]=y(I.p);var C=a.castOption(o,I.i,"text");(0===C||C)&&(E.text=C),E.value=I.s,E.valueLabel=E[u+"Label"]=m(I.s);var B={};v(B,o,I.i),(f||void 0===B.x)&&(B.x=p?E.value:E.label),(f||void 0===B.y)&&(B.y=p?E.label:E.value),(f||void 0===B.xLabel)&&(B.xLabel=p?E.valueLabel:E.labelLabel),(f||void 0===B.yLabel)&&(B.yLabel=p?E.labelLabel:E.valueLabel),h&&(E.delta=+I.rawS||I.s,E.deltaLabel=m(E.delta),E.final=I.v,E.finalLabel=m(E.final),E.initial=E.final-E.delta,E.initialLabel=m(E.initial)),d&&(E.value=I.s,E.valueLabel=m(E.value),E.percentInitial=I.begR,E.percentInitialLabel=a.formatPercent(I.begR),E.percentPrevious=I.difR,E.percentPreviousLabel=a.formatPercent(I.difR),E.percentTotal=I.sumR,E.percenTotalLabel=a.formatPercent(I.sumR));var b=a.castOption(o,I.i,"customdata");return b&&(E.customdata=b),a.texttemplateString(s,E,e._d3locale,B,E,o._meta||{})}(e,t,r,n,i):s.textinfo?function(e,t,r,n){var i=e[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function A(e){return c(o?n:r,e,!0).text}function u(e){return c(o?r:n,+e,!0).text}var g,f=i.textinfo,h=e[t],d=f.split("+"),p=[],y=function(e){return-1!==d.indexOf(e)};if(y("label")&&p.push(A(e[t].p)),y("text")&&(0===(g=a.castOption(i,h.i,"text"))||g)&&p.push(g),s){var m=+h.rawS||h.s,I=h.v,v=I-m;y("initial")&&p.push(u(v)),y("delta")&&p.push(u(m)),y("final")&&p.push(u(I))}if(l){y("value")&&p.push(u(h.s));var E=0;y("percent initial")&&E++,y("percent previous")&&E++,y("percent total")&&E++;var C=E>1;y("percent initial")&&(g=a.formatPercent(h.begR),C&&(g+=" of initial"),p.push(g)),y("percent previous")&&(g=a.formatPercent(h.difR),C&&(g+=" of previous"),p.push(g)),y("percent total")&&(g=a.formatPercent(h.sumR),C&&(g+=" of total"),p.push(g))}return p.join("
")}(t,r,n,i):d.getValue(s.text,r),d.coerceString(m,o)}(M,n,i,Q,T);b=function(e,t){var r=d.getValue(e.textposition,t);return d.coerceEnumerated(I,r)}(L,i);var O="stack"===C.mode||"relative"===C.mode,P=n[i],G=!O||P._outmost,U=P.hasB,z=p&&p-y>E;if(F&&"none"!==b&&(!P.isBlank&&s!==A&&u!==f||"auto"!==b&&"inside"!==b)){var q=M.font,H=h.getBarColor(n[i],L),Y=h.getInsideTextFont(L,i,q,H),J=h.getOutsideTextFont(L,i,q),K=L.insidetextanchor||"end",j=r.datum();N?"log"===Q.type&&j.s0<=0&&(s=Q.range[0]0&&X>0;ie=z?U?_(re-2*p,ne,Z,X,N)||_(re,ne-2*p,Z,X,N):N?_(re-(p-y),ne,Z,X,N)||_(re,ne-2*(p-y),Z,X,N):_(re,ne-(p-y),Z,X,N)||_(re-2*(p-y),ne,Z,X,N):_(re,ne,Z,X,N),ae&&ie?b="inside":(b="outside",V.remove(),V=null)}else b="inside";if(!V){var oe=(V=R(r,F,$=a.ensureUniformFontSize(e,"outside"===b?J:Y))).attr("transform");if(V.attr("transform",""),Z=(W=l.bBox(V.node())).width,X=W.height,V.attr("transform",oe),Z<=0||X<=0)return void V.remove()}var se,le=L.textangle;se="outside"===b?function(e,t,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,A=a.angle||0,c=i.width,u=i.height,g=Math.abs(t-e),f=Math.abs(n-r);o=s?f>2*E?E:0:g>2*E?E:0;var h=1;l&&(h=s?Math.min(1,f/u):Math.min(1,g/c));var d=S(A),p=k(i,d),y=(s?p.x:p.y)/2,m=(i.left+i.right)/2,I=(i.top+i.bottom)/2,v=(e+t)/2,C=(r+n)/2,B=0,b=0,w=s?x(t,e):x(r,n);return s?(v=t-w*o,B=w*y):(C=n+w*o,b=-w*y),{textX:m,textY:I,targetX:v,targetY:C,anchorX:B,anchorY:b,scale:h,rotate:d}}(s,A,u,f,W,{isHorizontal:N,constrained:"both"===L.constraintext||"outside"===L.constraintext,angle:le}):D(s,A,u,f,W,{isHorizontal:N,constrained:"both"===L.constraintext||"inside"===L.constraintext,angle:le,anchor:K,hasB:U,r:p,overhead:y}),se.fontSize=$.size,g("histogram"===L.type?"bar":L.type,se,M),P.transform=se;var Ae=w(V,M,C,B);a.setTransormAndDisplay(Ae,se)}else r.select("text").remove()}(e,t,N,r,B,H,Y,J,K,re,ie,p,y),t.layerClipId&&l.hideOutsideRangePoint(A,N.select("text"),C,T,u.xcalendar,u.ycalendar)}));var J=!1===u.cliponaxis;l.setClipUrl(A,J?null:t.layerClipId,e)}));A.getComponentMethod("errorbars","plot")(e,L,t,p)},toMoveInsideBar:D}},45784:function(e){"use strict";function t(e,t,r,n,i){var a=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),s=r.c2p(n?e.p0:e.s0,!0),l=r.c2p(n?e.p1:e.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(e,r){var n,i=e.cd,a=e.xaxis,o=e.yaxis,s=i[0].trace,l="funnel"===s.type,A="h"===s.orientation,c=[];if(!1===r)for(n=0;n1||0===i.bargap&&0===i.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),s.getComponentMethod("errorbars","style")(t)},styleTextPoints:d,styleOnSelect:function(e,t,r){var i=t[0].trace;i.selectedpoints?function(e,t,r){a.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var i,s=n.select(this);if(e.selected){i=o.ensureUniformFontSize(r,p(s,e,t,r));var l=t.selected.textfont&&t.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,t)}))}(e.selectAll("text"),t,r)}(r,i,e):(h(r,i,e),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:m,getOutsideTextFont:I,getBarColor:E,resizeText:l}},55592:function(e,t,r){"use strict";var n=r(76308),i=r(94288).hasColorscale,a=r(27260),o=r(3400).coercePattern;e.exports=function(e,t,r,s,l){var A=r("marker.color",s),c=i(e,"marker");c&&a(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(e,"marker.line")&&a(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",A,c),r("selected.marker.color"),r("unselected.marker.color")}},82744:function(e,t,r){"use strict";var n=r(33428),i=r(3400);function a(e){return"_"+e+"Text_minsize"}e.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=a(e),i=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=og.range[1]&&(I+=Math.PI),n.getClosest(A,(function(e){return d(m,I,[e.rp0,e.rp1],[e.thetag0,e.thetag1],h)?p+Math.min(1,Math.abs(e.thetag1-e.thetag0)/y)-1+(e.rp1-m)/(e.rp1-e.rp0)-1:1/0}),e),!1!==e.index){var v=A[e.index];e.x0=e.x1=v.ct[0],e.y0=e.y1=v.ct[1];var E=i.extendFlat({},v,{r:v.s,theta:v.p});return o(v,c,e),s(E,c,u,e),e.hovertemplate=c.hovertemplate,e.color=a(c,v),e.xLabelVal=e.yLabelVal=void 0,v.s<0&&(e.idealAlign="left"),[e]}}},94456:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:r(40872),categories:["polar","bar","showLegend"],attributes:r(78100),layoutAttributes:r(9320),supplyDefaults:r(70384),supplyLayoutDefaults:r(89580),calc:r(47056).calc,crossTraceCalc:r(47056).crossTraceCalc,plot:r(42040),colorbar:r(5528),formatLabels:r(22852),style:r(60100).style,styleOnSelect:r(60100).styleOnSelect,hoverPoints:r(68896),selectPoints:r(45784),meta:{}}},9320:function(e){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},89580:function(e,t,r){"use strict";var n=r(3400),i=r(9320);e.exports=function(e,t,r){var a,o={};function s(r,o){return n.coerce(e[a]||{},t[a],i,r,o)}for(var l=0;l0?(A=o,c=l):(A=l,c=o);var u=[s.findEnclosingVertexAngles(A,e.vangles)[0],(A+c)/2,s.findEnclosingVertexAngles(c,e.vangles)[1]];return s.pathPolygonAnnulus(n,i,A,c,u,t,r)}:function(e,n,i,o){return a.pathAnnulus(e,n,i,o,t,r)}}(t),h=t.layers.frontplot.select("g.barlayer");a.makeTraceGroups(h,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(e){var t,r=n.select(this),o=e.rp0=u.c2p(e.s0),s=e.rp1=u.c2p(e.s1),l=e.thetag0=g.c2g(e.p0),h=e.thetag1=g.c2g(e.p1);if(i(o)&&i(s)&&i(l)&&i(h)&&o!==s&&l!==h){var d=u.c2g(e.s1),p=(l+h)/2;e.ct=[A.c2p(d*Math.cos(p)),c.c2p(d*Math.sin(p))],t=f(o,s,l,h)}else t="M0,0Z";a.ensureSingle(r,"path").attr("d",t)})),o.setClipUrl(r,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)}))}},63188:function(e,t,r){"use strict";var n=r(98304),i=r(52904),a=r(20832),o=r(22548),s=r(29736).axisHoverFormat,l=r(21776).Ks,A=r(92880).extendFlat,c=i.marker,u=c.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:i.xperiod,yperiod:i.yperiod,xperiod0:i.xperiod0,yperiod0:i.yperiod0,xperiodalignment:i.xperiodalignment,yperiodalignment:i.yperiodalignment,xhoverformat:s("x"),yhoverformat:s("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:A({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:A({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:A({},c.angle,{arrayOk:!1,editType:"calc"}),size:A({},c.size,{arrayOk:!1,editType:"calc"}),color:A({},c.color,{arrayOk:!1,editType:"style"}),line:{color:A({},u.color,{arrayOk:!1,dflt:o.defaultLine,editType:"style"}),width:A({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:i.selected.marker,editType:"style"},unselected:{marker:i.unselected.marker,editType:"style"},text:A({},i.text,{}),hovertext:A({},i.hovertext,{}),hovertemplate:l({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:i.zorder}},62555:function(e,t,r){"use strict";var n=r(38248),i=r(54460),a=r(1220),o=r(3400),s=r(39032).BADNUM,l=o._;e.exports=function(e,t){var r,A,m,I,v,E,C,B=e._fullLayout,b=i.getFromId(e,t.xaxis||"x"),x=i.getFromId(e,t.yaxis||"y"),w=[],Q="violin"===t.type?"_numViolins":"_numBoxes";"h"===t.orientation?(m=b,I="x",v=x,E="y",C=!!t.yperiodalignment):(m=x,I="y",v=b,E="x",C=!!t.xperiodalignment);var _,S,k,D,T,M,R=function(e,t,r,i){var s,l=t in e,A=t+"0"in e,c="d"+t in e;if(l||A&&c){var u=r.makeCalcdata(e,t);return[a(e,r,t,u).vals,u]}s=A?e[t+"0"]:"name"in e&&("category"===r.type||n(e.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(e.name)&&"date"===r.type)?e.name:i;for(var g="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,e[t+"calendar"]),f=e._length,h=new Array(f),d=0;d_.uf};if(t._hasPreCompStats){var U=t[I],z=function(e){return m.d2c((t[e]||[])[r])},q=1/0,H=-1/0;for(r=0;r=_.q1&&_.q3>=_.med){var J=z("lowerfence");_.lf=J!==s&&J<=_.q1?J:f(_,k,D);var K=z("upperfence");_.uf=K!==s&&K>=_.q3?K:h(_,k,D);var j=z("mean");_.mean=j!==s?j:D?o.mean(k,D):(_.q1+_.q3)/2;var V=z("sd");_.sd=j!==s&&V>=0?V:D?o.stdev(k,D,_.mean):_.q3-_.q1,_.lo=d(_),_.uo=p(_);var W=z("notchspan");W=W!==s&&W>0?W:y(_,D),_.ln=_.med-W,_.un=_.med+W;var Z=_.lf,X=_.uf;t.boxpoints&&k.length&&(Z=Math.min(Z,k[0]),X=Math.max(X,k[D-1])),t.notched&&(Z=Math.min(Z,_.ln),X=Math.max(X,_.un)),_.min=Z,_.max=X}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+_.q1,"median = "+_.med,"q3 = "+_.q3].join("\n")),$=_.med!==s?_.med:_.q1!==s?_.q3!==s?(_.q1+_.q3)/2:_.q1:_.q3!==s?_.q3:0,_.med=$,_.q1=_.q3=$,_.lf=_.uf=$,_.mean=_.sd=$,_.ln=_.un=$,_.min=_.max=$}q=Math.min(q,_.min),H=Math.max(H,_.max),_.pts2=S.filter(G),w.push(_)}}t._extremes[m._id]=i.findExtremes(m,[q,H],{padded:!0})}else{var ee=m.makeCalcdata(t,I),te=function(e,t){for(var r=e.length,n=new Array(r+1),i=0;i=0&&ie0){var ce,ue;(_={}).pos=_[E]=O[r],S=_.pts=ne[r].sort(u),D=(k=_[I]=S.map(g)).length,_.min=k[0],_.max=k[D-1],_.mean=o.mean(k,D),_.sd=o.stdev(k,D,_.mean)*t.sdmultiple,_.med=o.interp(k,.5),D%2&&(le||Ae)?(le?(ce=k.slice(0,D/2),ue=k.slice(D/2+1)):Ae&&(ce=k.slice(0,D/2+1),ue=k.slice(D/2)),_.q1=o.interp(ce,.5),_.q3=o.interp(ue,.5)):(_.q1=o.interp(k,.25),_.q3=o.interp(k,.75)),_.lf=f(_,k,D),_.uf=h(_,k,D),_.lo=d(_),_.uo=p(_);var ge=y(_,D);_.ln=_.med-ge,_.un=_.med+ge,ae=Math.min(ae,_.ln),oe=Math.max(oe,_.un),_.pts2=S.filter(G),w.push(_)}t.notched&&o.isTypedArray(ee)&&(ee=Array.from(ee)),t._extremes[m._id]=i.findExtremes(m,t.notched?ee.concat([ae,oe]):ee,{padded:!0})}return function(e,t){if(o.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(w[0].t={num:B[Q],dPos:P,posLetter:E,valLetter:I,labels:{med:l(e,"median:"),min:l(e,"min:"),q1:l(e,"q1:"),q3:l(e,"q3:"),max:l(e,"max:"),mean:"sd"===t.boxmean||"sd"===t.sizemode?l(e,"mean \xb1 \u03c3:").replace("\u03c3",1===t.sdmultiple?"\u03c3":t.sdmultiple+"\u03c3"):l(e,"mean:"),lf:l(e,"lower fence:"),uf:l(e,"upper fence:")}},B[Q]++,w):[{t:{empty:!0}}]};var A={text:"tx",hovertext:"htx"};function c(e,t,r){for(var n in A)o.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(t[n][r[0]])&&(e[A[n]]=t[n][r[0]][r[1]]):e[A[n]]=t[n][r])}function u(e,t){return e.v-t.v}function g(e){return e.v}function f(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(o.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function h(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(o.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function d(e){return 4*e.q1-3*e.q3}function p(e){return 4*e.q3-3*e.q1}function y(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},96404:function(e,t,r){"use strict";var n=r(54460),i=r(3400),a=r(71888).getAxisGroup,o=["v","h"];function s(e,t,r,o){var s,l,A,c=t.calcdata,u=t._fullLayout,g=o._id,f=g.charAt(0),h=[],d=0;for(s=0;s1,v=1-u[e+"gap"],E=1-u[e+"groupgap"];for(s=0;s0){var H=_.pointpos,Y=_.jitter,J=_.marker.size/2,K=0;H+Y>=0&&((K=z*(H+Y))>w?(q=!0,G=J,O=K):K>N&&(G=J,O=w)),K<=w&&(O=w);var j=0;H-Y<=0&&((j=-z*(H-Y))>Q?(q=!0,U=J,P=j):j>F&&(U=J,P=Q)),j<=Q&&(P=Q)}else O=w,P=Q;var V=new Array(A.length);for(l=0;l0?(p="v",y=I>0?Math.min(E,v):Math.min(v)):I>0?(p="h",y=Math.min(E)):y=0;if(y){t._length=y;var Q=r("orientation",p);t._hasPreCompStats?"v"===Q&&0===I?(r("x0",0),r("dx",1)):"h"===Q&&0===m&&(r("y0",0),r("dy",1)):"v"===Q&&0===I?r("x0"):"h"===Q&&0===m&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a)}else t.visible=!1}function u(e,t,r,i){var a=i.prefix,o=n.coerce2(e,t,A,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";t._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var c=r(a+"points",l);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.angle"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",t.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete t.marker;var u=r("hoveron");"all"!==u&&-1===u.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}e.exports={supplyDefaults:function(e,t,r,i){function s(r,i){return n.coerce(e,t,A,r,i)}if(c(e,t,s,i),!1!==t.visible){o(e,t,i,s),s("xhoverformat"),s("yhoverformat");var l=t._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(e.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(t.line.color,.5));var g=!1;if(l){var f=s("mean"),h=s("sd");f&&f.length&&(g=!0,h&&h.length&&(g="sd"))}s("whiskerwidth");var d,p=s("sizemode");"quartiles"===p&&(d=s("boxmean",g)),s("showwhiskers","quartiles"===p),"sd"!==p&&"sd"!==d||s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(l){var m=s("notchspan");m&&m.length&&(y=!0)}else n.validate(e.notchwidth,A.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),u(e,t,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(e,t){var r,i;function a(e){return n.coerce(i._input,i,A,e)}for(var o=0;oe.lo&&(E.so=!0)}return a}));h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(a.translatePoints,l,A)}function c(e,t,r,a){var o,s,l=t.val,A=t.pos,c=!!A.rangebreaks,u=a.bPos,g=a.bPosPxOffset||0,f=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var h=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(e){var t=A.c2l(e.pos+u,!0),i=A.l2p(t-o)+g,a=A.l2p(t+s)+g,h=c?(i+a)/2:A.l2p(t)+g,d=l.c2p(e.mean,!0),p=l.c2p(e.mean-e.sd,!0),y=l.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+d+","+i+"V"+a+("sd"===f?"m0,0L"+p+","+h+"L"+d+","+i+"L"+y+","+h+"Z":"")):n.select(this).attr("d","M"+i+","+d+"H"+a+("sd"===f?"m0,0L"+h+","+p+"L"+i+","+d+"L"+h+","+y+"Z":""))}))}e.exports={plot:function(e,t,r,a){var o=e._context.staticPlot,s=t.xaxis,u=t.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(e){var t,r,i=n.select(this),a=e[0],g=a.t,f=a.trace;g.wdPos=g.bdPos*f.whiskerwidth,!0!==f.visible||g.empty?i.remove():("h"===f.orientation?(t=u,r=s):(t=s,r=u),l(i,{pos:t,val:r},f,g,o),A(i,{x:s,y:u},f,g),c(i,{pos:t,val:r},f,g))}))},plotBoxAndWhiskers:l,plotPoints:A,plotBoxMean:c}},8264:function(e){"use strict";e.exports=function(e,t){var r,n,i=e.cd,a=e.xaxis,o=e.yaxis,s=[];if(!1===t)for(r=0;r=10)return null;for(var r=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,T=S>0?Math.ceil:Math.floor,M=S>0?Math.min:Math.max,R=S>0?Math.max:Math.min,L=D(Q+k),N=T(_-k),F=[[u=w(Q)]];for(a=L;a*S=0;i--)a[c-i]=e[u][i],o[c-i]=t[u][i];for(s.push({x:a,y:o,bicubic:l}),i=u,a=[],o=[];i>=0;i--)a[u-i]=e[i][0],o[u-i]=t[i][0];return s.push({x:a,y:o,bicubic:A}),s}},19216:function(e,t,r){"use strict";var n=r(54460),i=r(92880).extendFlat;e.exports=function(e,t,r){var a,o,s,l,A,c,u,g,f,h,d,p,y,m,I=e["_"+t],v=e[t+"axis"],E=v._gridlines=[],C=v._minorgridlines=[],B=v._boundarylines=[],b=e["_"+r],x=e[r+"axis"];"array"===v.tickmode&&(v.tickvals=I.slice());var w=e._xctrl,Q=e._yctrl,_=w[0].length,S=w.length,k=e._a.length,D=e._b.length;n.prepTicks(v),"array"===v.tickmode&&delete v.tickvals;var T=v.smoothing?3:1;function M(n){var i,a,o,s,l,A,c,u,f,h,d,p,y=[],m=[],I={};if("b"===t)for(a=e.b2j(n),o=Math.floor(Math.max(0,Math.min(D-2,a))),s=a-o,I.length=D,I.crossLength=k,I.xy=function(t){return e.evalxy([],t,a)},I.dxy=function(t,r){return e.dxydi([],t,o,r,s)},i=0;i0&&(f=e.dxydi([],i-1,o,0,s),y.push(l[0]+f[0]/3),m.push(l[1]+f[1]/3),h=e.dxydi([],i-1,o,1,s),y.push(u[0]-h[0]/3),m.push(u[1]-h[1]/3)),y.push(u[0]),m.push(u[1]),l=u;else for(i=e.a2i(n),A=Math.floor(Math.max(0,Math.min(k-2,i))),c=i-A,I.length=k,I.crossLength=D,I.xy=function(t){return e.evalxy([],i,t)},I.dxy=function(t,r){return e.dxydj([],A,t,c,r)},a=0;a0&&(d=e.dxydj([],A,a-1,c,0),y.push(l[0]+d[0]/3),m.push(l[1]+d[1]/3),p=e.dxydj([],A,a-1,c,1),y.push(u[0]-p[0]/3),m.push(u[1]-p[1]/3)),y.push(u[0]),m.push(u[1]),l=u;return I.axisLetter=t,I.axis=v,I.crossAxis=x,I.value=n,I.constvar=r,I.index=g,I.x=y,I.y=m,I.smoothing=x.smoothing,I}function R(n){var i,a,o,s,l,A=[],c=[],u={};if(u.length=I.length,u.crossLength=b.length,"b"===t)for(o=Math.max(0,Math.min(D-2,n)),l=Math.min(1,Math.max(0,n-o)),u.xy=function(t){return e.evalxy([],t,n)},u.dxy=function(t,r){return e.dxydi([],t,o,r,l)},i=0;i<_;i++)A[i]=w[n*T][i],c[i]=Q[n*T][i];else for(a=Math.max(0,Math.min(k-2,n)),s=Math.min(1,Math.max(0,n-a)),u.xy=function(t){return e.evalxy([],n,t)},u.dxy=function(t,r){return e.dxydj([],a,t,s,r)},i=0;iI.length-1||E.push(i(R(o),{color:v.gridcolor,width:v.gridwidth,dash:v.griddash}));for(g=c;gI.length-1)&&!(d<0||d>I.length-1))for(p=I[s],y=I[d],a=0;aI[I.length-1]||C.push(i(M(h),{color:v.minorgridcolor,width:v.minorgridwidth,dash:v.minorgriddash}));v.startline&&B.push(i(R(0),{color:v.startlinecolor,width:v.startlinewidth})),v.endline&&B.push(i(R(I.length-1),{color:v.endlinecolor,width:v.endlinewidth}))}else{for(l=5e-15,c=(A=[Math.floor((I[I.length-1]-v.tick0)/v.dtick*(1+l)),Math.ceil((I[0]-v.tick0)/v.dtick/(1+l))].sort((function(e,t){return e-t})))[0],u=A[1],g=c;g<=u;g++)f=v.tick0+v.dtick*g,E.push(i(M(f),{color:v.gridcolor,width:v.gridwidth,dash:v.griddash}));for(g=c-1;gI[I.length-1]||C.push(i(M(h),{color:v.minorgridcolor,width:v.minorgridwidth,dash:v.minorgriddash}));v.startline&&B.push(i(M(I[0]),{color:v.startlinecolor,width:v.startlinewidth})),v.endline&&B.push(i(M(I[I.length-1]),{color:v.endlinecolor,width:v.endlinewidth}))}}},14724:function(e,t,r){"use strict";var n=r(54460),i=r(92880).extendFlat;e.exports=function(e,t){var r,a,o,s=t._labels=[],l=t._gridlines;for(r=0;rt.length&&(e=e.slice(0,t.length)):e=[],i=0;i90&&(f-=180,l=-l),{angle:f,flip:l,p:e.c2p(n,t,r),offsetMultplier:A}}},164:function(e,t,r){"use strict";var n=r(33428),i=r(43616),a=r(87072),o=r(53416),s=r(15584),l=r(72736),A=r(3400),c=A.strRotate,u=A.strTranslate,g=r(84284);function f(e,t,r,s,l,A,c){var u="const-"+l+"-lines",g=r.selectAll("."+u).data(A);g.enter().append("path").classed(u,!0).style("vector-effect",c?"none":"non-scaling-stroke"),g.each((function(r){var s=r,l=s.x,A=s.y,c=a([],l,e.c2p),u=a([],A,t.c2p),g="M"+o(c,u,s.smoothing);n.select(this).attr("d",g).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",i.dashStyle(s.dash,s.width)).style("fill","none")})),g.exit().remove()}function h(e,t,r,a,o,A,g,f){var h=A.selectAll("text."+f).data(g);h.enter().append("text").classed(f,!0);var d=0,p={};return h.each((function(o,A){var g;if("auto"===o.axis.tickangle)g=s(a,t,r,o.xy,o.dxy);else{var f=(o.axis.tickangle+180)*Math.PI/180;g=s(a,t,r,o.xy,[Math.cos(f),Math.sin(f)])}A||(p={angle:g.angle,flip:g.flip});var h=(o.endAnchor?-1:1)*g.flip,y=n.select(this).attr({"text-anchor":h>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,e),m=i.bBox(this);y.attr("transform",u(g.p[0],g.p[1])+c(g.angle)+u(o.axis.labelpadding*h,.3*m.height)),d=Math.max(d,m.width+o.axis.labelpadding)})),h.exit().remove(),p.maxExtent=d,p}e.exports=function(e,t,r,i){var l=e._context.staticPlot,c=t.xaxis,u=t.yaxis,g=e._fullLayout._clips;A.makeTraceGroups(i,r,"trace").each((function(t){var r=n.select(this),i=t[0],d=i.trace,p=d.aaxis,m=d.baxis,I=A.ensureSingle(r,"g","minorlayer"),v=A.ensureSingle(r,"g","majorlayer"),E=A.ensureSingle(r,"g","boundarylayer"),C=A.ensureSingle(r,"g","labellayer");r.style("opacity",d.opacity),f(c,u,v,0,"a",p._gridlines,!0),f(c,u,v,0,"b",m._gridlines,!0),f(c,u,I,0,"a",p._minorgridlines,!0),f(c,u,I,0,"b",m._minorgridlines,!0),f(c,u,E,0,"a-boundary",p._boundarylines,l),f(c,u,E,0,"b-boundary",m._boundarylines,l);var B=h(e,c,u,d,0,C,p._labels,"a-label"),b=h(e,c,u,d,0,C,m._labels,"b-label");!function(e,t,r,n,i,a,o,l){var c,u,g,f,h=A.aggNums(Math.min,null,r.a),d=A.aggNums(Math.max,null,r.a),p=A.aggNums(Math.min,null,r.b),m=A.aggNums(Math.max,null,r.b);c=.5*(h+d),u=p,g=r.ab2xy(c,u,!0),f=r.dxyda_rough(c,u),void 0===o.angle&&A.extendFlat(o,s(r,i,a,g,r.dxydb_rough(c,u))),y(e,t,r,0,g,f,r.aaxis,i,a,o,"a-title"),c=h,u=.5*(p+m),g=r.ab2xy(c,u,!0),f=r.dxydb_rough(c,u),void 0===l.angle&&A.extendFlat(l,s(r,i,a,g,r.dxyda_rough(c,u))),y(e,t,r,0,g,f,r.baxis,i,a,l,"b-title")}(e,C,d,0,c,u,B,b),function(e,t,r,n,i){var s,l,c,u,g=r.select("#"+e._clipPathId);g.size()||(g=r.append("clipPath").classed("carpetclip",!0));var f=A.ensureSingle(g,"path","carpetboundary"),h=t.clipsegments,d=[];for(u=0;u90&&m<270,v=n.select(this);v.text(g.title.text).call(l.convertToTspans,e),I&&(E=(-l.lineCount(v)+p)*d*a-E),v.attr("transform",u(t.p[0],t.p[1])+c(t.angle)+u(0,E)).attr("text-anchor","middle").call(i.font,g.title.font)})),v.exit().remove()}},81e3:function(e,t,r){"use strict";var n=r(24588),i=r(14952).findBin,a=r(30180),o=r(29056),s=r(26435),l=r(24464);e.exports=function(e){var t=e._a,r=e._b,A=t.length,c=r.length,u=e.aaxis,g=e.baxis,f=t[0],h=t[A-1],d=r[0],p=r[c-1],y=t[t.length-1]-t[0],m=r[r.length-1]-r[0],I=y*n.RELATIVE_CULL_TOLERANCE,v=m*n.RELATIVE_CULL_TOLERANCE;f-=I,h+=I,d-=v,p+=v,e.isVisible=function(e,t){return e>f&&ed&&th||tp},e.setScale=function(){var t=e._x,r=e._y,n=a(e._xctrl,e._yctrl,t,r,u.smoothing,g.smoothing);e._xctrl=n[0],e._yctrl=n[1],e.evalxy=o([e._xctrl,e._yctrl],A,c,u.smoothing,g.smoothing),e.dxydi=s([e._xctrl,e._yctrl],u.smoothing,g.smoothing),e.dxydj=l([e._xctrl,e._yctrl],u.smoothing,g.smoothing)},e.i2a=function(e){var r=Math.max(0,Math.floor(e[0]),A-2),n=e[0]-r;return(1-n)*t[r]+n*t[r+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),A-2),n=e[1]-t;return(1-n)*r[t]+n*r[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var r=Math.max(0,Math.min(i(e,t),A-2)),n=t[r],a=t[r+1];return Math.max(0,Math.min(A-1,r+(e-n)/(a-n)))},e.b2j=function(e){var t=Math.max(0,Math.min(i(e,r),c-2)),n=r[t],a=r[t+1];return Math.max(0,Math.min(c-1,t+(e-n)/(a-n)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,r){return e.evalxy([],t,r)},e.ab2xy=function(n,i,a){if(!a&&(nt[A-1]|ir[c-1]))return[!1,!1];var o=e.a2i(n),s=e.b2j(i),l=e.evalxy([],o,s);if(a){var u,g,f,h,d=0,p=0,y=[];nt[A-1]?(u=A-2,g=1,d=(n-t[A-1])/(t[A-1]-t[A-2])):g=o-(u=Math.max(0,Math.min(A-2,Math.floor(o)))),ir[c-1]?(f=c-2,h=1,p=(i-r[c-1])/(r[c-1]-r[c-2])):h=s-(f=Math.max(0,Math.min(c-2,Math.floor(s)))),d&&(e.dxydi(y,u,f,g,h),l[0]+=y[0]*d,l[1]+=y[1]*d),p&&(e.dxydj(y,u,f,g,h),l[0]+=y[0]*p,l[1]+=y[1]*p)}return l},e.c2p=function(e,t,r){return[t.c2p(e[0]),r.c2p(e[1])]},e.p2x=function(e,t,r){return[t.p2c(e[0]),r.p2c(e[1])]},e.dadi=function(e){var r=Math.max(0,Math.min(t.length-2,e));return t[r+1]-t[r]},e.dbdj=function(e){var t=Math.max(0,Math.min(r.length-2,e));return r[t+1]-r[t]},e.dxyda=function(t,r,n,i){var a=e.dxydi(null,t,r,n,i),o=e.dadi(t,n);return[a[0]/o,a[1]/o]},e.dxydb=function(t,r,n,i){var a=e.dxydj(null,t,r,n,i),o=e.dbdj(r,i);return[a[0]/o,a[1]/o]},e.dxyda_rough=function(t,r,n){var i=y*(n||.1),a=e.ab2xy(t+i,r,!0),o=e.ab2xy(t-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dxydb_rough=function(t,r,n){var i=m*(n||.1),a=e.ab2xy(t,r+i,!0),o=e.ab2xy(t,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}},51512:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t,r){var i,a,o,s=[],l=[],A=e[0].length,c=e.length;function u(t,r){var n,i=0,a=0;return t>0&&void 0!==(n=e[r][t-1])&&(a++,i+=n),t0&&void 0!==(n=e[r-1][t])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",b,"after",x,"iterations"),e}},86411:function(e,t,r){"use strict";var n=r(3400).isArray1D;e.exports=function(e,t,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(t._cheater=!i,a&&!n(i)||s&&!n(o))t._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),t.a&&t.a.length&&(l=Math.min(l,t.a.length)),t.b&&t.b.length&&(l=Math.min(l,t.b.length)),t._length=l}return!0}},83372:function(e,t,r){"use strict";var n=r(21776).Ks,i=r(6096),a=r(49084),o=r(45464),s=r(22548).defaultLine,l=r(92880).extendFlat,A=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},A.color,{dflt:s}),width:l({},A.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},7924:function(e,t,r){"use strict";var n=r(38248),i=r(39032).BADNUM,a=r(47128),o=r(20148),s=r(4500);function l(e){return e&&"string"===typeof e}e.exports=function(e,t){var r,A=t._length,c=new Array(A);r=t.geojson?function(e){return l(e)||n(e)}:l;for(var u=0;u")}}(e,u,o),[e]}},54272:function(e,t,r){"use strict";e.exports={attributes:r(83372),supplyDefaults:r(30972),colorbar:r(96288),calc:r(7924),calcGeoJSON:r(88364).calcGeoJSON,plot:r(88364).plot,style:r(7947).style,styleOnSelect:r(7947).styleOnSelect,hoverPoints:r(69224),eventData:r(52428),selectPoints:r(17328),moduleType:"trace",name:"choropleth",basePlotModule:r(10816),categories:["geo","noOpacity","showLegend"],meta:{}}},88364:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(27144),o=r(59972).getTopojsonFeatures,s=r(19280).findExtremes,l=r(7947).style;e.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],i=n._subplot,l=r.locationmode,A=r._length,c="geojson-id"===l?a.extractTraceFeature(e):o(r,i.topojson),u=[],g=[],f=0;f=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)e.removeLayer(t[r][1])},s.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},e.exports=function(e,t){var r=t[0].trace,i=new o(e,r.uid),a=i.sourceId,s=n(t),l=i.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}},86040:function(e,t,r){"use strict";var n=r(49084),i=r(29736).axisHoverFormat,a=r(21776).Ks,o=r(52948),s=r(45464),l=r(92880).extendFlat,A={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(A,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){A[e]=o[e]})),A.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),A.transforms=void 0,e.exports=A},83344:function(e,t,r){"use strict";var n=r(47128);e.exports=function(e,t){for(var r=t.u,i=t.v,a=t.w,o=Math.min(t.x.length,t.y.length,t.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,A=0;Ao.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,A=-1/0,c=1/0;for(r=0;r":f>A&&(n.prefixBoundary=!0);break;case"<":(fA||n.starts.length&&g===c)&&(n.prefixBoundary=!0);break;case"][":u=Math.min(f[0],f[1]),g=Math.max(f[0],f[1]),uA&&(n.prefixBoundary=!0)}}}},55296:function(e,t,r){"use strict";var n=r(8932),i=r(41076),a=r(46960);e.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,s=t.line,l=o.size||1,A=o.coloring,c=i(t,{isColorbar:!0});if("heatmap"===A){var u=n.extractOpts(t);r._fillgradient=u.reversescale?n.flipScale(u.colorscale):u.colorscale,r._zrange=[u.min,u.max]}else"fill"===A&&(r._fillcolor=c);r._line={color:"lines"===A?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},93252:function(e){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},95536:function(e,t,r){"use strict";var n=r(38248),i=r(17428),a=r(76308),o=a.addOpacity,s=a.opacity,l=r(69104),A=r(3400).isArrayOrTypedArray,c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(e,t,r,a,l,g){var f,h,d,p=t.contours,y=r("contours.operation");p._operation=c[y],function(e,t){var r;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),A(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(A(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,p),"="===y?f=p.showlines=!0:(f=r("contours.showlines"),d=r("fillcolor",o((e.line||{}).color||l,.5))),f&&(h=r("line.color",d&&s(d)?o(t.fillcolor,1):l),r("line.width",2),r("line.dash")),r("line.smoothing"),i(r,a,h,g)}},3212:function(e,t,r){"use strict";var n=r(69104),i=r(38248);function a(e,t){var r,a=Array.isArray(t);function o(e){return i(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(a?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=a?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=a?t.map(o):[o(t)]),r}function o(e){return function(t){t=a(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function s(e){return function(t){return{start:t=a(e,t),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},84952:function(e){"use strict";e.exports=function(e,t,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},82172:function(e,t,r){"use strict";var n=r(3400);function i(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}e.exports=function(e,t){var r,a,o,s=function(e){return e.reverse()},l=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),a=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return l}},46960:function(e){"use strict";e.exports=function(e){return e.end+e.size/1e6}},88748:function(e,t,r){"use strict";var n=r(3400),i=r(93252);function a(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(e)?a=1:-1!==i.LEFTSTART.indexOf(e)?n=1:-1!==i.TOPSTART.indexOf(e)?a=-1:n=-1,[n,a]}(g,r,t),h=[l(e,t,[-f[0],-f[1]])],d=e.z.length,p=e.z[0].length,y=t.slice(),m=f.slice();for(c=0;c<1e4;c++){if(g>20?(g=i.CHOOSESADDLE[g][(f[0]||f[1])<0?0:1],e.crossings[u]=i.SADDLEREMAINDER[g]):delete e.crossings[u],!(f=i.NEWDELTA[g])){n.log("Found bad marching index:",g,t,e.level);break}h.push(l(e,t,f)),t[0]+=f[0],t[1]+=f[1],u=t.join(","),a(h[h.length-1],h[h.length-2],s,A)&&h.pop();var I=f[0]&&(t[0]<0||t[0]>p-2)||f[1]&&(t[1]<0||t[1]>d-2);if(t[0]===y[0]&&t[1]===y[1]&&f[0]===m[0]&&f[1]===m[1]||r&&I)break;g=e.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var v,E,C,B,b,x,w,Q,_,S,k,D=a(h[0],h[h.length-1],s,A),T=0,M=.2*e.smoothing,R=[],L=0;for(c=1;c=L;c--)if((v=R[c])=L&&v+R[E]Q&&_--,e.edgepaths[_]=k.concat(h,S));break}P||(e.edgepaths[Q]=h.concat(S))}for(Q=0;Q=m)&&(r<=y&&(r=y),o>=m&&(o=m),l=Math.floor((o-r)/s)+1,A=0),g=0;gy&&(d.unshift(y),p.unshift(p[0])),d[d.length-1]e?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(e){var t,r,a,o,s,l,A,c,u,g=e[0].z,f=g.length,h=g[0].length,d=2===f||2===h;for(r=0;r=0&&(n=m,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-m[1])<.01&&(m[0]-r[0])*(n[0]-m[0])>=0&&(n=m,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,m)}if(r=n,s>=0)break;u+="L"+n}if(s===e.edgepaths.length){i.log("unclosed perimeter path");break}g=s,(h=-1===f.indexOf(g))&&(g=f[0],u+="Z")}for(g=0;gn.center?n.right-s:s-n.left)/(c+Math.abs(Math.sin(A)*o)),f=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(u)+Math.cos(A)*o);if(g<1||f<1)return 1/0;var h=y.EDGECOST*(1/(g-1)+1/(f-1));h+=y.ANGLECOST*A*A;for(var d=s-c,p=l-u,m=s+c,I=l+u,v=0;v2*y.MAXCOST)break;f&&(s/=2),l=(o=A-s/2)+1.5*s}if(g<=y.MAXCOST)return c},t.addLabelData=function(e,t,r,n){var i=t.fontSize,a=t.width+i/3,o=Math.max(0,t.height-i/3),s=e.x,l=e.y,A=e.theta,c=Math.sin(A),u=Math.cos(A),g=function(e,t){return[s+e*u-t*c,l+e*c+t*u]},f=[g(-a/2,-o/2),g(-a/2,o/2),g(a/2,o/2),g(a/2,-o/2)];r.push({text:t.text,x:s,y:l,dy:t.dy,theta:A,level:t.level,width:a,height:o}),n.push(f)},t.drawLabels=function(e,t,r,a,o){var l=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,i=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:i,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var A="",c=0;cr.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),i.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var A,c=r.start,u=r.end,g=e._input.contours;c>u&&(r.start=g.start=u,u=r.end=g.end=c,c=r.start),r.size>0||(A=c===u?1:a(c,u,e.ncontours).dtick,g.size=r.size=A)}}},52440:function(e,t,r){"use strict";var n=r(33428),i=r(43616),a=r(41648),o=r(41076);e.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[0].trace,a=r.contours,s=r.line,l=a.size||1,A=a.start,c="constraint"===a.type,u=!c&&"lines"===a.coloring,g=!c&&"fill"===a.coloring,f=u||g?o(r):null;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,u?f(e.level):s.color,s.dash)}));var h=a.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){i.font(n.select(this),{weight:h.weight,style:h.style,variant:h.variant,family:h.family,size:h.size,color:h.color||(u?f(e.level):s.color)})})),c)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(g){var d;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===d&&(d=e.level),f(e.level+.5*l)})),void 0===d&&(d=A),t.selectAll("g.contourbg path").style("fill",f(d-.5*l))}})),a(e)}},97680:function(e,t,r){"use strict";var n=r(27260),i=r(17428);e.exports=function(e,t,r,a,o){var s,l=r("contours.coloring"),A="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(A=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,A,o)}},37960:function(e,t,r){"use strict";var n=r(83328),i=r(67104),a=r(49084),o=r(92880).extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},zorder:i.zorder,transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},30572:function(e,t,r){"use strict";var n=r(47128),i=r(3400),a=r(2872),o=r(26136),s=r(70448),l=r(11240),A=r(35744),c=r(3252),u=r(50948),g=r(54444);e.exports=function(e,t){var r=t._carpetTrace=u(e,t);if(r&&r.visible&&"legendonly"!==r.visible){if(!t.a||!t.b){var f=e.data[r.index],h=e.data[t.index];h.a||(h.a=f.a),h.b||(h.b=f.b),c(h,t,t._defaultColor,e._fullLayout)}var d=function(e,t){var r,c,u,g,f,h,d,p=t._carpetTrace,y=p.aaxis,m=p.baxis;y._minDtick=0,m._minDtick=0,i.isArray1D(t.z)&&a(t,y,m,"a","b",["z"]),r=t._a=t._a||t.a,g=t._b=t._b||t.b,r=r?y.makeCalcdata(t,"_a"):[],g=g?m.makeCalcdata(t,"_b"):[],c=t.a0||0,u=t.da||1,f=t.b0||0,h=t.db||1,d=t._z=o(t._z||t.z,t.transpose),t._emptypoints=l(d),s(d,t._emptypoints);var I=i.maxRowLength(d),v="scaled"===t.xtype?"":r,E=A(t,v,c,u,I,y),C="scaled"===t.ytype?"":g,B=A(t,C,f,h,d.length,m),b={a:E,b:B,z:d};return"levels"===t.contours.type&&"none"!==t.contours.coloring&&n(e,t,{vals:d,containerStr:"",cLetter:"z"}),[b]}(e,t);return g(t,t._z),d}}},3252:function(e,t,r){"use strict";var n=r(3400),i=r(51264),a=r(37960),o=r(95536),s=r(84952),l=r(97680);e.exports=function(e,t,r,A){function c(r,i){return n.coerce(e,t,a,r,i)}if(c("carpet"),e.a&&e.b){if(!i(e,t,c,A,"a","b"))return void(t.visible=!1);c("text"),"constraint"===c("contours.type")?o(e,t,c,A,r,{hasHover:!1}):(s(e,t,c,(function(r){return n.coerce2(e,t,a,r)})),l(e,t,c,A,{hasHover:!1}))}else t._defaultColor=r,t._length=null;c("zorder")}},40448:function(e,t,r){"use strict";e.exports={attributes:r(37960),supplyDefaults:r(3252),colorbar:r(55296),calc:r(30572),plot:r(94440),style:r(52440),moduleType:"trace",name:"contourcarpet",basePlotModule:r(57952),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},94440:function(e,t,r){"use strict";var n=r(33428),i=r(87072),a=r(53416),o=r(43616),s=r(3400),l=r(72424),A=r(88748),c=r(23676),u=r(93252),g=r(82172),f=r(61512),h=r(56008),d=r(50948),p=r(77712);function y(e,t,r){var n=e.getPointAtLength(t),i=e.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function m(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}function I(e,t){var r=Math.abs(e[0]*t[0]+e[1]*t[1]);return Math.sqrt(1-r*r)/r}e.exports=function(e,t,r,v){var E=t.xaxis,C=t.yaxis;s.makeTraceGroups(v,r,"contour").each((function(r){var v=n.select(this),B=r[0],b=B.trace,x=b._carpetTrace=d(e,b),w=e.calcdata[x.index][0];if(x.visible&&"legendonly"!==x.visible){var Q=B.a,_=B.b,S=b.contours,k=f(S,t,B),D="constraint"===S.type,T=S._operation,M=D?"="===T?"lines":"fill":S.coloring,R=[[Q[0],_[_.length-1]],[Q[Q.length-1],_[_.length-1]],[Q[Q.length-1],_[0]],[Q[0],_[0]]];l(k);var L=1e-8*(Q[Q.length-1]-Q[0]),N=1e-8*(_[_.length-1]-_[0]);A(k,L,N);var F,O,P,G,U=k;"constraint"===S.type&&(U=g(k,T)),function(e,t){var r,n,i,a,o,s,l,A,c;for(r=0;r=0;G--)F=w.clipsegments[G],O=i([],F.x,E.c2p),P=i([],F.y,C.c2p),O.reverse(),P.reverse(),z.push(a(O,P,F.bicubic));var q="M"+z.join("L")+"Z";!function(e,t,r,n,o,l){var A,c,u,g,f=s.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);f.enter().append("path"),f.exit().remove();var h=[];for(g=0;g=0&&(g=S,h=d):Math.abs(u[1]-g[1])=0&&(g=S,h=d):s.log("endpt to newendpt is not vert. or horz.",u,g,S)}if(h>=0)break;m+=Q(u,g),u=g}if(h===t.edgepaths.length){s.log("unclosed perimeter path");break}c=h,(v=-1===I.indexOf(c))&&(c=I[0],m+=Q(u,g)+"Z",u=null)}for(c=0;cd&&(n.max=d),n.len=n.max-n.min}function p(e,t){var r,n=0,o=.1;return(Math.abs(e[0]-l)0?+f[c]:0),u.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:m})}}var v=o.extractOpts(t),E=v.reversescale?o.flipScale(v.colorscale):v.colorscale,C=E[0][1],B=["interpolate",["linear"],["heatmap-density"],0,a.opacity(C)<1?C:a.addOpacity(C,0)];for(c=1;c=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},e.exports=function(e,t){var r=t[0].trace,i=new a(e,r.uid),o=i.sourceId,s=n(t),l=i.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},74248:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t){for(var r=0;r"),l.color=function(e,t){var r=e.marker,i=t.mc||r.color,a=t.mlc||r.line.color,o=t.mlw||r.line.width;return n(i)?i:n(a)&&o?a:void 0}(c,g),[l]}}},94704:function(e,t,r){"use strict";e.exports={attributes:r(20088),layoutAttributes:r(7076),supplyDefaults:r(45432).supplyDefaults,crossTraceDefaults:r(45432).crossTraceDefaults,supplyLayoutDefaults:r(11631),calc:r(23096),crossTraceCalc:r(4804),plot:r(42200),style:r(44544).style,hoverPoints:r(31488),eventData:r(34580),selectPoints:r(45784),moduleType:"trace",name:"funnel",basePlotModule:r(57952),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},7076:function(e){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},11631:function(e,t,r){"use strict";var n=r(3400),i=r(7076);e.exports=function(e,t,r){var a=!1;function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=0;s path").each((function(e){if(!e.isBlank){var t=s.marker;n.select(this).call(a.fill,e.mc||t.color).call(a.stroke,e.mlc||t.line.color).call(i.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),A(r,s,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},22332:function(e,t,r){"use strict";var n=r(74996),i=r(45464),a=r(86968).u,o=r(21776).Ks,s=r(21776).Gw,l=r(92880).extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},pattern:n.marker.pattern,editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},91248:function(e,t,r){"use strict";var n=r(7316);t.name="funnelarea",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},54e3:function(e,t,r){"use strict";var n=r(45768);e.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},92688:function(e,t,r){"use strict";var n=r(3400),i=r(22332),a=r(86968).Q,o=r(31508).handleText,s=r(74174).handleLabelsAndValues,l=r(74174).handleMarkerDefaults;e.exports=function(e,t,r,A){function c(r,a){return n.coerce(e,t,i,r,a)}var u=c("labels"),g=c("values"),f=s(u,g),h=f.len;if(t._hasLabels=f.hasLabels,t._hasValues=f.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),h){t._length=h,l(e,t,A,c),c("scalegroup");var d,p=c("text"),y=c("texttemplate");if(y||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),y||d&&"none"!==d){var m=c("textposition");o(e,t,A,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===d&&c("textposition","none");a(t,A,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",A.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},62396:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:r(91248),categories:["pie-like","funnelarea","showLegend"],attributes:r(22332),layoutAttributes:r(61280),supplyDefaults:r(92688),supplyLayoutDefaults:r(35384),calc:r(54e3).calc,crossTraceCalc:r(54e3).crossTraceCalc,plot:r(39472),style:r(62096),styleOne:r(10528),meta:{}}},61280:function(e,t,r){"use strict";var n=r(85204).hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},35384:function(e,t,r){"use strict";var n=r(3400),i=r(61280);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},39472:function(e,t,r){"use strict";var n=r(33428),i=r(43616),a=r(3400),o=a.strScale,s=a.strTranslate,l=r(72736),A=r(98184).toMoveInsideBar,c=r(82744),u=c.recordMinTextSize,g=c.clearMinTextSize,f=r(69656),h=r(37820),d=h.attachFxHandlers,p=h.determineInsideTextFont,y=h.layoutAreas,m=h.prerenderTitles,I=h.positionTitleOutside,v=h.formatSliceLabel;function E(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}function C(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}e.exports=function(e,t){var r=e._context.staticPlot,c=e._fullLayout;g("funnelarea",c),m(t,e),y(t,c._size),a.makeTraceGroups(c._funnelarealayer,t,"trace").each((function(t){var g=n.select(this),h=t[0],y=h.trace;!function(e){if(e.length){var t=e[0],r=t.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),A=t.vTotal,c=A,u=A*l/(1-l)/A,g=[];for(g.push(_()),o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var f=s.v/c;u+=f,g.push(_())}var h=1/0,d=-1/0;for(o=0;o-1;o--)if(!(s=e[o]).hidden){var x=g[b+=1][0],w=g[b][1];s.TL=[-x,w],s.TR=[x,w],s.BL=E,s.BR=B,s.pxmid=C(s.TR,s.BR),E=s.TL,B=s.TR}}function Q(){var e=Math.sqrt(u);return{x:e,y:-e}}function _(){var e=Q();return[e.x,e.y]}}(t),g.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove(),g.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=y.index;var g=h.cx,m=h.cy,I=n.select(this),C=I.selectAll("path.surface").data([o]);C.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),I.call(d,e,t);var B="M"+(g+o.TR[0])+","+(m+o.TR[1])+E(o.TR,o.BR)+E(o.BR,o.BL)+E(o.BL,o.TL)+"Z";C.attr("d",B),v(e,o,h);var b=f.castOption(y.textposition,o.pts),x=I.selectAll("g.slicetext").data(o.text&&"none"!==b?[0]:[]);x.enter().append("g").classed("slicetext",!0),x.exit().remove(),x.each((function(){var r=a.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=a.ensureUniformFontSize(e,p(y,o,c.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,f).call(l.convertToTspans,e);var h,d,I,v=i.bBox(r.node()),E=Math.min(o.BL[1],o.BR[1])+m,C=Math.max(o.TL[1],o.TR[1])+m;d=Math.max(o.TL[0],o.BL[0])+g,I=Math.min(o.TR[0],o.BR[0])+g,(h=A(d,I,E,C,v,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=f.size,u(y.type,h,c),t[s].transform=h,a.setTransormAndDisplay(r,h)}))}}));var m=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);m.enter().append("g").classed("titletext",!0),m.exit().remove(),m.each((function(){var t=a.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),r=y.title.text;y._meta&&(r=a.templateString(r,y._meta)),t.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,y.title.font).call(l.convertToTspans,e);var A=I(h,c._size);t.attr("transform",s(A.x,A.y)+o(Math.min(1,A.scale))+s(A.tx,A.ty))}))}))}))}},62096:function(e,t,r){"use strict";var n=r(33428),i=r(10528),a=r(82744).resizeText;e.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");a(e,t,"funnelarea"),t.each((function(t){var r=t[0].trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each((function(t){n.select(this).call(i,t,r,e)}))}))}},83328:function(e,t,r){"use strict";var n=r(52904),i=r(45464),a=r(25376),o=r(29736).axisHoverFormat,s=r(21776).Ks,l=r(21776).Gw,A=r(49084),c=r(92880).extendFlat;e.exports=c({z:{valType:"data_array",editType:"calc"},x:c({},n.x,{impliedEdits:{xtype:"array"}}),x0:c({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:c({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:c({},n.y,{impliedEdits:{ytype:"array"}}),y0:c({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:c({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:c({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:c({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:c({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:c({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:c({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:c({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:a({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:c({},i.showlegend,{dflt:!1}),zorder:n.zorder},{transforms:void 0},A("",{cLetter:"z",autoColorDflt:!1}))},19512:function(e,t,r){"use strict";var n=r(24040),i=r(3400),a=r(54460),o=r(1220),s=r(55480),l=r(47128),A=r(2872),c=r(26136),u=r(70448),g=r(11240),f=r(35744),h=r(39032).BADNUM;function d(e){for(var t=[],r=e.length,n=0;n1){var t=(e[e.length-1]-e[0])/(e.length-1),r=Math.abs(t/100);for(b=0;br)return!1}return!0}(w.rangebreaks||Q.rangebreaks)&&(B=function(e,t,r){for(var n=[],i=-1,a=0;a=0;o--)(s=((u[[(r=(a=g[o])[0])-1,i=a[1]]]||d)[2]+(u[[r+1,i]]||d)[2]+(u[[r,i-1]]||d)[2]+(u[[r,i+1]]||d)[2])/20)&&(l[a]=[r,i,s],g.splice(o,1),A=!0);if(!A)throw"findEmpties iterated with no new neighbors";for(a in l)u[a]=l[a],c.push(l[a])}return c.sort((function(e,t){return t[2]-e[2]}))}},55512:function(e,t,r){"use strict";var n=r(93024),i=r(3400),a=i.isArrayOrTypedArray,o=r(54460),s=r(8932).extractOpts;e.exports=function(e,t,r,l,A){A||(A={});var c,u,g,f,h=A.isContour,d=e.cd[0],p=d.trace,y=e.xa,m=e.ya,I=d.x,v=d.y,E=d.z,C=d.xCenter,B=d.yCenter,b=d.zmask,x=p.zhoverformat,w=I,Q=v;if(!1!==e.index){try{g=Math.round(e.index[1]),f=Math.round(e.index[0])}catch(G){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(g<0||g>=E[0].length||f<0||f>E.length)return}else{if(n.inbox(t-I[0],t-I[I.length-1],0)>0||n.inbox(r-v[0],r-v[v.length-1],0)>0)return;if(h){var _;for(w=[2*I[0]-I[1]],_=1;_d&&(y=Math.max(y,Math.abs(e[a][o]-h)/(p-d))))}return y}e.exports=function(e,t){var r,i=1;for(o(e,t),r=0;r.01;r++)i=o(e,t,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),e}},39096:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t){e("texttemplate");var r=n.extendFlat({},t.font,{color:"auto",size:"auto"});n.coerceFont(e,"textfont",r)}},35744:function(e,t,r){"use strict";var n=r(24040),i=r(3400).isArrayOrTypedArray;e.exports=function(e,t,r,a,o,s){var l,A,c,u=[],g=n.traceIs(e,"contour"),f=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(i(t)&&t.length>1&&!f&&"category"!==s.type){var d=t.length;if(!(d<=o))return g?t.slice(0,o):t.slice(0,o+1);if(g||h)u=Array.from(t).slice(0,o);else if(1===o)u="log"===s.type?[.5*t[0],2*t[0]]:[t[0]-.5,t[0]+.5];else if("log"===s.type){for(u=[Math.pow(t[0],1.5)/Math.pow(t[1],.5)],c=1;c0;)b=x.c2p(P[k]),k--;for(b0;)S=w.c2p(G[k]),k--;S<_&&(Q=_,_=S,S=Q,j=!0),q&&(U=P,z=G,P=R.xfill,G=R.yfill);var V="default";if(H?V="best"===H?"smooth":"fast":L._islinear&&0===N&&0===F&&p()&&(V="fast"),"fast"!==V){var W="best"===H?0:.5;r=Math.max(-W*x._length,r),b=Math.min((1+W)*x._length,b),_=Math.max(-W*w._length,_),S=Math.min((1+W)*w._length,S)}var Z,X,$=Math.round(b-r),ee=Math.round(S-_);if(r>=x._length||b<=0||_>=w._length||S<=0)return M.selectAll("image").data([]).exit().remove(),void v(M);"fast"===V?(Z=J,X=Y):(Z=$,X=ee);var te=document.createElement("canvas");te.width=Z,te.height=X;var re,ne,ie=te.getContext("2d",{willReadFrequently:!0}),ae=f(L,{noNumericCheck:!0,returnArray:!0});"fast"===V?(re=K?function(e){return J-1-e}:l.identity,ne=j?function(e){return Y-1-e}:l.identity):(re=function(e){return l.constrain(Math.round(x.c2p(P[e])-r),0,$)},ne=function(e){return l.constrain(Math.round(w.c2p(G[e])-_),0,ee)});var oe,se,le,Ae,ce=ne(0),ue=[ce,ce],ge=K?0:1,fe=j?0:1,he=0,de=0,pe=0,ye=0;function me(e,t){if(void 0!==e){var r=ae(e);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),he+=t,de+=r[0]*t,pe+=r[1]*t,ye+=r[2]*t,r}return[0,0,0,0]}function Ie(e,t,r,n){var i=e[r.bin0];if(void 0===i)return me(void 0,1);var a,o=e[r.bin1],s=t[r.bin0],l=t[r.bin1],A=o-i||0,c=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,me(i+r.frac*A+n.frac*(c+r.frac*a))}if("default"!==V){var ve,Ee=0;try{ve=new Uint8Array(Z*X*4)}catch(pt){ve=new Array(Z*X*4)}if("smooth"===V){var Ce,Be,be,xe=U||P,we=z||G,Qe=new Array(xe.length),_e=new Array(we.length),Se=new Array($),ke=U?C:E,De=z?C:E;for(k=0;kVe||Ve>w._length))for(D=Ye;DZe||Ze>x._length)){var Xe=c({x:We,y:je},L,e._fullLayout);Xe.x=We,Xe.y=je;var $e=R.z[k][D];void 0===$e?(Xe.z="",Xe.zLabel=""):(Xe.z=$e,Xe.zLabel=s.tickText(Ue,$e,"hover").text);var et=R.text&&R.text[k]&&R.text[k][D];void 0!==et&&!1!==et||(et=""),Xe.text=et;var tt=l.texttemplateString(Pe,Xe,e._fullLayout._d3locale,Xe,L._meta||{});if(tt){var rt=tt.split("
"),nt=rt.length,it=0;for(T=0;T0&&(a=!0);for(var l=0;la){var o=a-r[e];return r[e]=a,o}}return 0},max:function(e,t,r,i){var a=i[t];if(n(a)){if(a=Number(a),!n(r[e]))return r[e]=a,a;if(r[e]A?e>o?e>1.1*i?i:e>1.1*a?a:o:e>s?s:e>l?l:A:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function f(e,t,r,n,a,s){if(n&&e>o){var l=h(t,a,s),A=h(r,a,s),c=e===i?0:1;return l[c]!==A[c]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(e,t,r,n,a){var s,l,A=-1.1*t,g=-.1*t,f=e-g,h=r[0],d=r[1],p=Math.min(u(h+g,h+f,n,a),u(d+g,d+f,n,a)),y=Math.min(u(h+A,h+g,n,a),u(d+A,d+g,n,a));if(p>y&&yo){var m=s===i?1:6,I=s===i?"M12":"M1";return function(t,r){var o=n.c2d(t,i,a),s=o.indexOf("-",m);s>0&&(o=o.substr(0,s));var A=n.d2c(o,0,a);if(Ar.r2l(O)&&(G=o.tickIncrement(G,v.size,!0,f)),R.start=r.l2r(G),F||i.nestedProperty(t,y+".start").set(R.start)}var U=v.end,z=r.r2l(M.end),q=void 0!==z;if((v.endFound||q)&&z!==r.r2l(U)){var H=q?z:i.aggNums(Math.max,null,h);R.end=r.l2r(H),q||i.nestedProperty(t,y+".start").set(R.end)}var Y="autobin"+s;return!1===t._input[Y]&&(t._input[y]=i.extendFlat({},t[y]||{}),delete t._input[Y],delete t[Y]),[R,h]}e.exports={calc:function(e,t){var r,a,f,h,d=[],p=[],y="h"===t.orientation,m=o.getFromId(e,y?t.yaxis:t.xaxis),I=y?"y":"x",v={x:"y",y:"x"}[I],E=t[I+"calendar"],C=t.cumulative,B=g(e,t,m,I),b=B[0],x=B[1],w="string"===typeof b.size,Q=[],_=w?Q:b,S=[],k=[],D=[],T=0,M=t.histnorm,R=t.histfunc,L=-1!==M.indexOf("density");C.enabled&&L&&(M=M.replace(/ ?density$/,""),L=!1);var N,F="max"===R||"min"===R?null:0,O=l.count,P=A[M],G=!1,U=function(e){return m.r2c(e,0,E)};for(i.isArrayOrTypedArray(t[v])&&"count"!==R&&(N=t[v],G="avg"===R,O=l[R]),r=U(b.start),f=U(b.end)+(r-o.tickIncrement(r,b.size,!1,E))/1e6;r=0&&h=0;n--)s(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(p,C.direction,C.currentbin);var Z=Math.min(d.length,p.length),X=[],$=0,ee=Z-1;for(r=0;r=$;r--)if(p[r]){ee=r;break}for(r=$;r<=ee;r++)if(n(d[r])&&n(p[r])){var te={p:d[r],s:p[r],b:0};C.enabled||(te.pts=D[r],J?te.ph0=te.ph1=D[r].length?x[D[r][0]]:d[r]:(t._computePh=!0,te.ph0=H(Q[r]),te.ph1=H(Q[r+1],!0))),X.push(te)}return 1===X.length&&(X[0].width1=o.tickIncrement(X[0].p,b.size,!1,E)-X[0].p),s(X,t),i.isArrayOrTypedArray(t.selectedpoints)&&i.tagSelected(X,t,V),X},calcAllAutoBins:g}},73316:function(e){"use strict";e.exports={eventDataKeys:["binNumber"]}},80536:function(e,t,r){"use strict";var n=r(3400),i=r(79811),a=r(24040).traceIs,o=r(20011),s=r(31508).validateCornerradius,l=n.nestedProperty,A=r(71888).getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(e,t){var r,g,f,h,d,p,y,m=t._histogramBinOpts={},I=[],v={},E=[];function C(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function B(e){return"v"===e.orientation?"x":"y"}function b(e,r,a){var o=e.uid+"__"+a;r||(r=o);var s=function(e,r){return i.getFromTrace({_fullLayout:t},e,r).type}(e,a),l=e[a+"calendar"]||"",A=m[r],c=!0;A&&(s===A.axType&&l===A.calendar?(c=!1,A.traces.push(e),A.dirs.push(a)):(r=o,s!==A.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+s,"axis","with bins on","type:"+A.axType,"axis."].join(" ")),l!==A.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",l,"calendar","with bins",A.calendar?"on a "+A.calendar+" calendar":"w/o a set calendar"].join(" ")))),c&&(m[r]={traces:[e],dirs:[a],axType:s,calendar:e[a+"calendar"]||""}),e["_"+a+"bingroup"]=r}for(d=0;dQ&&B.splice(Q,B.length-Q),w.length>Q&&w.splice(Q,w.length-Q);var _=[],S=[],k=[],D="string"===typeof C.size,T="string"===typeof x.size,M=[],R=[],L=D?M:C,N=T?R:x,F=0,O=[],P=[],G=t.histnorm,U=t.histfunc,z=-1!==G.indexOf("density"),q="max"===U||"min"===U?null:0,H=a.count,Y=o[G],J=!1,K=[],j=[],V="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";V&&"count"!==U&&(J="avg"===U,H=a[U]);var W=C.size,Z=I(C.start),X=I(C.end)+(Z-i.tickIncrement(Z,W,!1,y))/1e6;for(r=Z;r=0&&f=0&&h-1,flipY:k.tiling.flip.indexOf("y")>-1,orientation:k.tiling.orientation,pad:{inner:k.tiling.pad},maxDepth:k._maxDepth}).descendants(),L=1/0,N=-1/0;R.forEach((function(e){var t=e.depth;t>=k._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(L=Math.min(L,t),N=Math.max(N,t))})),h=h.data(R,c.getPtId),k._maxVisibleLayers=isFinite(N)?N-L+1:0,h.enter().append("g").classed("slice",!0),b(h,f,{},[p,y],v),h.order();var F=null;if(B&&Q){var O=c.getPtId(Q);h.each((function(e){null===F&&c.getPtId(e)===O&&(F={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var P=function(){return F||{x0:0,x1:p,y0:0,y1:y}},G=h;return B&&(G=G.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),G.each((function(s){s._x0=m(s.x0),s._x1=m(s.x1),s._y0=I(s.y0),s._y1=I(s.y1),s._hoverX=m(s.x1-k.tiling.pad),s._hoverY=I(M?s.y1-k.tiling.pad/2:s.y0+k.tiling.pad/2);var h=n.select(this),d=i.ensureSingle(h,"path","surface",(function(e){e.style("pointer-events",_?"none":"all")}));B?d.transition().attrTween("d",(function(e){var t=x(e,f,P(),[p,y],{orientation:k.tiling.orientation,flipX:k.tiling.flip.indexOf("x")>-1,flipY:k.tiling.flip.indexOf("y")>-1});return function(e){return v(t(e))}})):d.attr("d",v),h.call(u,r,e,t,{styleOne:l,eventDataKeys:A.eventDataKeys,transitionTime:A.CLICK_TRANSITION_TIME,transitionEasing:A.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),d.call(l,s,k,e,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=g(s,r,k,t,S)||"";var b=i.ensureSingle(h,"g","slicetext"),Q=i.ensureSingle(b,"text","",(function(e){e.attr("data-notex",1)})),R=i.ensureUniformFontSize(e,c.determineTextFont(k,s,S.font));Q.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",T?"end":D?"start":"middle").call(a.font,R).call(o.convertToTspans,e),s.textBB=a.bBox(Q.node()),s.transform=E(s,{fontSize:R.size}),s.transform.fontSize=R.size,B?Q.transition().attrTween("transform",(function(e){var t=w(e,f,P(),[p,y]);return function(e){return C(t(e))}})):Q.attr("transform",C(s))})),F}},29044:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:r(59564),categories:[],animatable:!0,attributes:r(97376),layoutAttributes:r(90676),supplyDefaults:r(7045),supplyLayoutDefaults:r(4304),calc:r(73876).r,crossTraceCalc:r(73876).q,plot:r(38364),style:r(47192).style,colorbar:r(5528),meta:{}}},90676:function(e){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},4304:function(e,t,r){"use strict";var n=r(3400),i=r(90676);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("iciclecolorway",t.colorway),r("extendiciclecolors")}},25132:function(e,t,r){"use strict";var n=r(74148),i=r(83024);e.exports=function(e,t,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,A=t[0],c=t[1];l&&(A=(e.height+1)*t[0]/Math.min(e.height+1,l),c=(e.height+1)*t[1]/Math.min(e.height+1,l));var u=n.partition().padding(r.pad.inner).size(s?[t[1],A]:[t[0],c])(e);return(s||a||o)&&i(u,t,{swapXY:s,flipX:a,flipY:o}),u}},38364:function(e,t,r){"use strict";var n=r(95808),i=r(67880);e.exports=function(e,t,r,a){return n(e,t,r,a,{type:"icicle",drawDescendants:i})}},47192:function(e,t,r){"use strict";var n=r(33428),i=r(76308),a=r(3400),o=r(82744).resizeText,s=r(60404);function l(e,t,r,n){var o=t.data.data,l=!t.children,A=o.i,c=a.castOption(r,A,"marker.line.color")||i.defaultLine,u=a.castOption(r,A,"marker.line.width")||0;e.call(s,t,r,n).style("stroke-width",u).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");o(e,t,"icicle"),t.each((function(t){var r=n.select(this),i=t[0].trace;r.style("opacity",i.opacity),r.selectAll("path.surface").each((function(t){n.select(this).call(l,t,i,e)}))}))},styleOne:l}},95188:function(e,t,r){"use strict";for(var n=r(45464),i=r(52904).zorder,a=r(21776).Ks,o=r(92880).extendFlat,s=r(47797).colormodel,l=["rgb","rgba","rgba256","hsl","hsla"],A=[],c=[],u=0;u0||n.inbox(r-s.y0,r-(s.y0+s.h*l.dy),0)>0)){var u,g=Math.floor((t-s.x0)/l.dx),f=Math.floor(Math.abs(r-s.y0)/l.dy);if(l._hasZ?u=s.z[f][g]:l._hasSource&&(u=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(g,f,1,1).data),u){var h,d=s.hi||l.hoverinfo;if(d){var p=d.split("+");-1!==p.indexOf("all")&&(p=["color"]),-1!==p.indexOf("color")&&(h=!0)}var y,m=o.colormodel[l.colormodel],I=m.colormodel||l.colormodel,v=I.length,E=l._scaler(u),C=m.suffix,B=[];(l.hovertemplate||h)&&(B.push("["+[E[0]+C[0],E[1]+C[1],E[2]+C[2]].join(", ")),4===v&&B.push(", "+E[3]+C[3]),B.push("]"),B=B.join(""),e.extraText=I.toUpperCase()+": "+B),a(l.hovertext)&&a(l.hovertext[f])?y=l.hovertext[f][g]:a(l.text)&&a(l.text[f])&&(y=l.text[f][g]);var b=c.c2p(s.y0+(f+.5)*l.dy),x=s.x0+(g+.5)*l.dx,w=s.y0+(f+.5)*l.dy,Q="["+u.slice(0,l.colormodel.length).join(", ")+"]";return[i.extendFlat(e,{index:[f,g],x0:A.c2p(s.x0+g*l.dx),x1:A.c2p(s.x0+(g+1)*l.dx),y0:b,y1:b,color:E,xVal:x,xLabelVal:x,yVal:w,yLabelVal:w,zLabelVal:Q,text:y,hovertemplateLabels:{zLabel:Q,colorLabel:B,"color[0]Label":E[0]+C[0],"color[1]Label":E[1]+C[1],"color[2]Label":E[2]+C[2],"color[3]Label":E[3]+C[3]}})]}}}},48928:function(e,t,r){"use strict";e.exports={attributes:r(95188),supplyDefaults:r(13188),calc:r(93336),plot:r(63715),style:r(28576),hoverPoints:r(24892),eventData:r(79972),moduleType:"trace",name:"image",basePlotModule:r(57952),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},63715:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=i.strTranslate,o=r(9616),s=r(47797),l=r(9188),A=r(2264).STYLE;e.exports=function(e,t,r,c){var u=t.xaxis,g=t.yaxis,f=!e._context._exportedPlot&&l();i.makeTraceGroups(c,r,"im").each((function(t){var r=n.select(this),l=t[0],c=l.trace,h=("fast"===c.zsmooth||!1===c.zsmooth&&f)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===g.type;c._realImage=h;var d,p,y,m,I,v,E=l.z,C=l.x0,B=l.y0,b=l.w,x=l.h,w=c.dx,Q=c.dy;for(v=0;void 0===d&&v0;)p=u.c2p(C+v*w),v--;for(v=0;void 0===m&&v0;)I=g.c2p(B+v*Q),v--;pM[0];if(R||L){var N=d+_/2,F=m+S/2;D+="transform:"+a(N+"px",F+"px")+"scale("+(R?-1:1)+","+(L?-1:1)+")"+a(-N+"px",-F+"px")+";"}}k.attr("style",D);var O=new Promise((function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===b&&c._canvas.el.height===x&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=b,t.height=x;var r=t.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:t,source:c.source},e()},n.setAttribute("src",c.source)}})).then((function(){var e,t;if(c._hasZ)t=P((function(e,t){var r=E[t][e];return i.isTypedArray(r)&&(r=Array.from(r)),r})),e=t.toDataURL("image/png");else if(c._hasSource)if(h)e=c.source;else{var r=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,b,x).data;t=P((function(e,t){var n=4*(t*b+e);return[r[n],r[n+1],r[n+2],r[n+3]]})),e=t.toDataURL("image/png")}k.attr({"xlink:href":e,height:S,width:_,x:d,y:m})}));e._promises.push(O)}function P(e){var t=document.createElement("canvas");t.width=_,t.height=S;var r,n=t.getContext("2d",{willReadFrequently:!0}),a=function(e){return i.constrain(Math.round(u.c2p(C+e*w)-d),0,_)},o=function(e){return i.constrain(Math.round(g.c2p(B+e*Q)-m),0,S)},A=s.colormodel[c.colormodel],f=A.colormodel||c.colormodel,h=A.fmt;for(v=0;v0}function B(e){e.each((function(e){m.stroke(n.select(this),e.line.color)})).each((function(e){m.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function b(e,t,r){var n=e._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),a={type:"linear",_id:"x"+t._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(e,t){return o.coerce(i,a,y,e,t)}return d(i,a,l,s,n),p(i,a,l,s),a}function x(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function w(e,t,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(f.convertToTspans,i).call(u.font,t),u.bBox(o.node())}function Q(e,t,r,n,i,a){var s="_cache"+t;e[s]&&e[s].key===i||(e[s]={key:i,value:r});var l=o.aggNums(a,null,[e[s].value,n],2);return e[s].value=l,l}e.exports=function(e,t,r,d){var p,y=e._fullLayout;C(r)&&d&&(p=d()),o.makeTraceGroups(y._indicatorlayer,t,"trace").each((function(t){var d,_,S,k,D,T=t[0].trace,M=n.select(this),R=T._hasGauge,L=T._isAngular,N=T._isBullet,F=T.domain,O={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},P=O.l+O.w/2,G=O.t+O.h/2,U=Math.min(O.w/2,O.h),z=g.innerRadius*U,q=T.align||"center";if(_=G,R){if(L&&(d=P,_=G+U/2,S=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),n=t/r;return[n,e,t]}(e,.9*z)}),N){var H=g.bulletPadding,Y=1-g.bulletNumberDomainSize+H;d=O.l+(Y+(1-Y)*v[q])*O.w,S=function(e){return x(e,(g.bulletNumberDomainSize-H)*O.w,O.h)}}}else d=O.l+v[q]*O.w,S=function(e){return x(e,O.w,O.h)};!function(e,t,r,i){var A,c,g,d=r[0].trace,p=i.numbersX,y=i.numbersY,B=d.align||"center",x=I[B],_=i.transitionOpts,S=i.onComplete,k=o.ensureSingle(t,"g","numbers"),D=[];d._hasNumber&&D.push("number"),d._hasDelta&&(D.push("delta"),"left"===d.delta.position&&D.reverse());var T=k.selectAll("text").data(D);function M(t,r,n,i){if(!t.match("s")||n>=0===i>=0||r(n).slice(-1).match(E)||r(i).slice(-1).match(E))return r;var a=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=b(e,{tickformat:a});return function(e){return Math.abs(e)<1?h.tickText(o,e).text:r(e)}}function R(){var t=b(e,{tickformat:d.number.valueformat},d._range);t.setScale(),h.prepTicks(t);var i=function(e){return h.tickText(t,e).text},o=d.number.suffix,s=d.number.prefix,l=k.select("text.number");function c(){var t="number"===typeof r[0].y?s+i(r[0].y)+o:"-";l.text(t).call(u.font,d.number.font).call(f.convertToTspans,e)}return C(_)?l.transition().duration(_.duration).ease(_.easing).each("end",(function(){c(),S&&S()})).each("interrupt",(function(){c(),S&&S()})).attrTween("text",(function(){var e=n.select(this),t=a(r[0].lastY,r[0].y);d._lastValue=r[0].y;var l=M(d.number.valueformat,i,r[0].lastY,r[0].y);return function(r){e.text(s+l(t(r))+o)}})):c(),A=w(s+i(r[0].y)+o,d.number.font,x,e),l}function L(){var t=b(e,{tickformat:d.delta.valueformat},d._range);t.setScale(),h.prepTicks(t);var i=function(e){return h.tickText(t,e).text},o=d.delta.suffix,s=d.delta.prefix,l=function(e){return d.delta.relative?e.relativeDelta:e.delta},A=function(e,t){return 0===e||"number"!==typeof e||isNaN(e)?"-":(e>0?d.delta.increasing.symbol:d.delta.decreasing.symbol)+s+t(e)+o},g=function(e){return e.delta>=0?d.delta.increasing.color:d.delta.decreasing.color};void 0===d._deltaLastValue&&(d._deltaLastValue=l(r[0]));var p=k.select("text.delta");function y(){p.text(A(l(r[0]),i)).call(m.fill,g(r[0])).call(f.convertToTspans,e)}return p.call(u.font,d.delta.font).call(m.fill,g({delta:d._deltaLastValue})),C(_)?p.transition().duration(_.duration).ease(_.easing).tween("text",(function(){var e=n.select(this),t=l(r[0]),o=d._deltaLastValue,s=M(d.delta.valueformat,i,o,t),c=a(o,t);return d._deltaLastValue=t,function(t){e.text(A(c(t),s)),e.call(m.fill,g({delta:c(t)}))}})).each("end",(function(){y(),S&&S()})).each("interrupt",(function(){y(),S&&S()})):y(),c=w(A(l(r[0]),i),d.delta.font,x,e),p}T.enter().append("text"),T.attr("text-anchor",(function(){return x})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),T.exit().remove();var N,F=d.mode+d.align;if(d._hasDelta&&(N=L(),F+=d.delta.position+d.delta.font.size+d.delta.font.family+d.delta.valueformat,F+=d.delta.increasing.symbol+d.delta.decreasing.symbol,g=c),d._hasNumber&&(R(),F+=d.number.font.size+d.number.font.family+d.number.valueformat+d.number.suffix+d.number.prefix,g=A),d._hasDelta&&d._hasNumber){var O,P,G=[(A.left+A.right)/2,(A.top+A.bottom)/2],U=[(c.left+c.right)/2,(c.top+c.bottom)/2],z=.75*d.delta.font.size;"left"===d.delta.position&&(O=Q(d,"deltaPos",0,-1*(A.width*v[d.align]+c.width*(1-v[d.align])+z),F,Math.min),P=G[1]-U[1],g={width:A.width+c.width+z,height:Math.max(A.height,c.height),left:c.left+O,right:A.right,top:Math.min(A.top,c.top+P),bottom:Math.max(A.bottom,c.bottom+P)}),"right"===d.delta.position&&(O=Q(d,"deltaPos",0,A.width*(1-v[d.align])+c.width*v[d.align]+z,F,Math.max),P=G[1]-U[1],g={width:A.width+c.width+z,height:Math.max(A.height,c.height),left:A.left,right:c.right+O,top:Math.min(A.top,c.top+P),bottom:Math.max(A.bottom,c.bottom+P)}),"bottom"===d.delta.position&&(O=null,P=c.height,g={width:Math.max(A.width,c.width),height:A.height+c.height,left:Math.min(A.left,c.left),right:Math.max(A.right,c.right),top:A.bottom-A.height,bottom:A.bottom+c.height}),"top"===d.delta.position&&(O=null,P=A.top,g={width:Math.max(A.width,c.width),height:A.height+c.height,left:Math.min(A.left,c.left),right:Math.max(A.right,c.right),top:A.bottom-A.height-c.height,bottom:A.bottom}),N.attr({dx:O,dy:P})}(d._hasNumber||d._hasDelta)&&k.attr("transform",(function(){var e=i.numbersScaler(g);F+=e[2];var t,r=Q(d,"numbersScale",1,e[0],F,Math.min);d._scaleNumbers||(r=1),t=d._isAngular?y-r*g.bottom:y-r*(g.top+g.bottom)/2,d._numbersTop=r*g.top+t;var n=g[B];"center"===B&&(n=(g.left+g.right)/2);var a=p-r*n;return a=Q(d,"numbersTranslate",0,a,F,Math.max),l(a,t)+s(r)}))}(e,M,t,{numbersX:d,numbersY:_,numbersScaler:S,transitionOpts:r,onComplete:p}),R&&(k={range:T.gauge.axis.range,color:T.gauge.bgcolor,line:{color:T.gauge.bordercolor,width:0},thickness:1},D={range:T.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:T.gauge.bordercolor,width:T.gauge.borderwidth},thickness:1});var J=M.selectAll("g.angular").data(L?t:[]);J.exit().remove();var K=M.selectAll("g.angularaxis").data(L?t:[]);K.exit().remove(),L&&function(e,t,r,a){var o,s,u,g,f=r[0].trace,d=a.size,p=a.radius,y=a.innerRadius,m=a.gaugeBg,I=a.gaugeOutline,v=[d.l+d.w/2,d.t+d.h/2+p/2],E=a.gauge,x=a.layer,w=a.transitionOpts,Q=a.onComplete,_=Math.PI/2;function S(e){var t=f.gauge.axis.range[0],r=(e-t)/(f.gauge.axis.range[1]-t)*Math.PI-_;return r<-_?-_:r>_?_:r}function k(e){return n.svg.arc().innerRadius((y+p)/2-e/2*(p-y)).outerRadius((y+p)/2+e/2*(p-y)).startAngle(-_)}function D(e){e.attr("d",(function(e){return k(e.thickness).startAngle(S(e.range[0])).endAngle(S(e.range[1]))()}))}E.enter().append("g").classed("angular",!0),E.attr("transform",l(v[0],v[1])),x.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),x.selectAll("g.xangularaxistick,path,text").remove(),(o=b(e,f.gauge.axis)).type="linear",o.range=f.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var T=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},M={},R=h.makeLabelFns(o,0).labelStandoff;M.xFn=function(e){var t=T(e);return Math.cos(t)*R},M.yFn=function(e){var t=T(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(R+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*c)},M.anchorFn=function(e){var t=T(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},M.heightFn=function(e,t,r){var n=T(e);return-.5*(1+Math.sin(n))*r};var L=function(e){return l(v[0]+p*Math.cos(e),v[1]-p*Math.sin(e))};u=function(e){return L(T(e))};var N=function(e){var t=T(e);return L(t)+"rotate("+-A(t)+")"};if(s=h.calcTicks(o),g=h.getTickSigns(o)[2],o.visible){g="inside"===o.ticks?-1:1;var F=(o.linewidth||1)/2;h.drawTicks(e,o,{vals:s,layer:x,path:"M"+g*F+",0h"+g*o.ticklen,transFn:N}),h.drawLabels(e,o,{vals:s,layer:x,transFn:u,labelFns:M})}var O=[m].concat(f.gauge.steps),P=E.selectAll("g.bg-arc").data(O);P.enter().append("g").classed("bg-arc",!0).append("path"),P.select("path").call(D).call(B),P.exit().remove();var G=k(f.gauge.bar.thickness),U=E.selectAll("g.value-arc").data([f.gauge.bar]);U.enter().append("g").classed("value-arc",!0).append("path");var z,q,H,Y=U.select("path");C(w)?(Y.transition().duration(w.duration).ease(w.easing).each("end",(function(){Q&&Q()})).each("interrupt",(function(){Q&&Q()})).attrTween("d",(z=G,q=S(r[0].lastY),H=S(r[0].y),function(){var e=i(q,H);return function(t){return z.endAngle(e(t))()}})),f._lastValue=r[0].y):Y.attr("d","number"===typeof r[0].y?G.endAngle(S(r[0].y)):"M0,0Z"),Y.call(B),U.exit().remove(),O=[];var J=f.gauge.threshold.value;(J||0===J)&&O.push({range:[J,J],color:f.gauge.threshold.color,line:{color:f.gauge.threshold.line.color,width:f.gauge.threshold.line.width},thickness:f.gauge.threshold.thickness});var K=E.selectAll("g.threshold-arc").data(O);K.enter().append("g").classed("threshold-arc",!0).append("path"),K.select("path").call(D).call(B),K.exit().remove();var j=E.selectAll("g.gauge-outline").data([I]);j.enter().append("g").classed("gauge-outline",!0).append("path"),j.select("path").call(D).call(B),j.exit().remove()}(e,0,t,{radius:U,innerRadius:z,gauge:J,layer:K,size:O,gaugeBg:k,gaugeOutline:D,transitionOpts:r,onComplete:p});var j=M.selectAll("g.bullet").data(N?t:[]);j.exit().remove();var V=M.selectAll("g.bulletaxis").data(N?t:[]);V.exit().remove(),N&&function(e,t,r,n){var i,a,o,s,A,c=r[0].trace,u=n.gauge,f=n.layer,d=n.gaugeBg,p=n.gaugeOutline,y=n.size,I=c.domain,v=n.transitionOpts,E=n.onComplete;u.enter().append("g").classed("bullet",!0),u.attr("transform",l(y.l,y.t)),f.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),f.selectAll("g.xbulletaxistick,path,text").remove();var x=y.h,w=c.gauge.bar.thickness*x,Q=I.x[0],_=I.x[0]+(I.x[1]-I.x[0])*(c._hasNumber||c._hasDelta?1-g.bulletNumberDomainSize:1);function S(e){e.attr("width",(function(e){return Math.max(0,i.c2p(e.range[1])-i.c2p(e.range[0]))})).attr("x",(function(e){return i.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*x})).attr("height",(function(e){return e.thickness*x}))}(i=b(e,c.gauge.axis))._id="xbulletaxis",i.domain=[Q,_],i.setScale(),a=h.calcTicks(i),o=h.makeTransTickFn(i),s=h.getTickSigns(i)[2],A=y.t+y.h,i.visible&&(h.drawTicks(e,i,{vals:"inside"===i.ticks?h.clipEnds(i,a):a,layer:f,path:h.makeTickPath(i,A,s),transFn:o}),h.drawLabels(e,i,{vals:a,layer:f,transFn:o,labelFns:h.makeLabelFns(i,A)}));var k=[d].concat(c.gauge.steps),D=u.selectAll("g.bg-bullet").data(k);D.enter().append("g").classed("bg-bullet",!0).append("rect"),D.select("rect").call(S).call(B),D.exit().remove();var T=u.selectAll("g.value-bullet").data([c.gauge.bar]);T.enter().append("g").classed("value-bullet",!0).append("rect"),T.select("rect").attr("height",w).attr("y",(x-w)/2).call(B),C(v)?T.select("rect").transition().duration(v.duration).ease(v.easing).each("end",(function(){E&&E()})).each("interrupt",(function(){E&&E()})).attr("width",Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y)))):T.select("rect").attr("width","number"===typeof r[0].y?Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y))):0),T.exit().remove();var M=r.filter((function(){return c.gauge.threshold.value||0===c.gauge.threshold.value})),R=u.selectAll("g.threshold-bullet").data(M);R.enter().append("g").classed("threshold-bullet",!0).append("line"),R.select("line").attr("x1",i.c2p(c.gauge.threshold.value)).attr("x2",i.c2p(c.gauge.threshold.value)).attr("y1",(1-c.gauge.threshold.thickness)/2*x).attr("y2",(1-(1-c.gauge.threshold.thickness)/2)*x).call(m.stroke,c.gauge.threshold.line.color).style("stroke-width",c.gauge.threshold.line.width),R.exit().remove();var L=u.selectAll("g.gauge-outline").data([p]);L.enter().append("g").classed("gauge-outline",!0).append("rect"),L.select("rect").call(S).call(B),L.exit().remove()}(e,0,t,{gauge:j,layer:V,size:O,gaugeBg:k,gaugeOutline:D,transitionOpts:r,onComplete:p});var W=M.selectAll("text.title").data(t);W.exit().remove(),W.enter().append("text").classed("title",!0),W.attr("text-anchor",(function(){return N?I.right:I[T.title.align]})).text(T.title.text).call(u.font,T.title.font).call(f.convertToTspans,e),W.attr("transform",(function(){var e,t=O.l+O.w*v[T.title.align],r=g.titlePadding,n=u.bBox(W.node());return R?(L&&(e=T.gauge.axis.visible?u.bBox(K.node()).top-r-n.bottom:O.t+O.h/2-U/2-n.bottom-r),N&&(e=_-(n.top+n.bottom)/2,t=O.l-g.bulletPadding*O.w)):e=T._numbersTop-r-n.bottom,l(t,e)}))}))}},50048:function(e,t,r){"use strict";var n=r(49084),i=r(29736).axisHoverFormat,a=r(21776).Ks,o=r(52948),s=r(45464),l=r(92880).extendFlat,A=r(67824).overrideAll,c=e.exports=A(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},62624:function(e,t,r){"use strict";var n=r(47128),i=r(3832).processGrid,a=r(3832).filter;e.exports=function(e,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=a(t.x,t._len),t._y=a(t.y,t._len),t._z=a(t.z,t._len),t._value=a(t.value,t._len);var r=i(t);t._gridFill=r.fill,t._Xs=r.Xs,t._Ys=r.Ys,t._Zs=r.Zs,t._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(t[r],t[r-1]),i=Math.max(t[r],t[r-1]);if(i>n&&n-1}function N(e,t){return null===e?t:e}function F(t,r,n){k();var i,a,o,l=[r],A=[n];if(s>=1)l=[r],A=[n];else if(s>0){var c=function(e,t){var r=e[0],n=e[1],i=e[2],a=function(e,t,r){for(var n=[],i=0;i-1?n[f]:S(h,d,y);g[f]=I>-1?I:T(h,d,y,N(t,m))}i=g[0],a=g[1],o=g[2],e._meshI.push(i),e._meshJ.push(a),e._meshK.push(o),++p}}function O(e,t,r,n){var i=e[3];in&&(i=n);for(var a=(e[3]-i)/(e[3]-t[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*e[s]+a*t[s];return o}function P(e,t,r){return e>=t&&e<=r}function G(e){var t=.001*(_-Q);return e>=Q-t&&e<=_+t}function U(t){for(var r=[],n=0;n<4;n++){var i=t[n];r.push([e._x[i],e._y[i],e._z[i],e._value[i]])}return r}var z=3;function q(e,t,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[P(t[0][3],n,i),P(t[1][3],n,i),P(t[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(e,t,r){return G(t[0][3])&&G(t[1][3])&&G(t[2][3])?(F(e,t,r),!0):aMath.abs(B-w)?[x,B]:[B,w];ee(r,S[0],S[1])}}var k=[[Math.min(Q,w),Math.max(Q,w)],[Math.min(x,_),Math.max(x,_)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i0&&(u.push(h.id),"x"===r?g.push([h.distRatio,0,0]):"y"===r?g.push([0,h.distRatio,0]):g.push([0,0,h.distRatio]))}else c=ie(1,"x"===r?v-1:"y"===r?E-1:C-1);u.length>0&&(n[a]="x"===r?te(t,u,o,s,g,n[a]):"y"===r?re(t,u,o,s,g,n[a]):ne(t,u,o,s,g,n[a]),a++),c.length>0&&(n[a]="x"===r?W(t,c,o,s,n[a]):"y"===r?Z(t,c,o,s,n[a]):X(t,c,o,s,n[a]),a++)}var d=e.caps[r];d.show&&d.fill&&(R(d.fill),n[a]="x"===r?W(t,[0,v-1],o,s,n[a]):"y"===r?Z(t,[0,E-1],o,s,n[a]):X(t,[0,C-1],o,s,n[a]),a++)}})),0===p&&D(),e._meshX=n,e._meshY=i,e._meshZ=a,e._meshIntensity=o,e._Xs=y,e._Ys=m,e._Zs=I}(),e}e.exports={findNearestOnAxis:A,generateIsoMeshes:f,createIsosurfaceTrace:function(e,t){var r=e.glplot.gl,i=n({gl:r}),a=new c(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}},70548:function(e,t,r){"use strict";var n=r(3400),i=r(24040),a=r(50048),o=r(27260);function s(e,t,r,n,a){var s=a("isomin"),l=a("isomax");void 0!==l&&null!==l&&void 0!==s&&null!==s&&s>l&&(t.isomin=null,t.isomax=null);var A=a("x"),c=a("y"),u=a("z"),g=a("value");A&&A.length&&c&&c.length&&u&&u.length&&g&&g.length?(i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(e){a(e+"hoverformat");var t="caps."+e;a(t+".show")&&a(t+".fill");var r="slices."+e;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(e){a(e)})),o(e,t,n,a,{prefix:"",cLetter:"c"}),t._length=null):t.visible=!1}e.exports={supplyDefaults:function(e,t,r,i){s(e,t,0,i,(function(r,i){return n.coerce(e,t,a,r,i)}))},supplyIsoDefaults:s}},6296:function(e,t,r){"use strict";e.exports={attributes:r(50048),supplyDefaults:r(70548).supplyDefaults,calc:r(62624),colorbar:{min:"cmin",max:"cmax"},plot:r(31460).createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:r(12536),categories:["gl3d","showLegend"],meta:{}}},52948:function(e,t,r){"use strict";var n=r(49084),i=r(29736).axisHoverFormat,a=r(21776).Ks,o=r(16716),s=r(45464),l=r(92880).extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},1876:function(e,t,r){"use strict";var n=r(47128);e.exports=function(e,t){t.intensity&&n(e,t,{vals:t.intensity,containerStr:"",cLetter:"c"})}},576:function(e,t,r){"use strict";var n=r(67792).gl_mesh3d,i=r(67792).delaunay_triangulate,a=r(67792).alpha_shape,o=r(67792).convex_hull,s=r(33040).parseColorScale,l=r(3400).isArrayOrTypedArray,A=r(43080),c=r(8932).extractOpts,u=r(52094);function g(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=g.prototype;function h(e){for(var t=[],r=e.length,n=0;n=t-.5)return!1;return!0}f.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index;e.data._cellCenter?e.traceCoordinate=e.data.dataCoordinate:e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]];var r=this.data.hovertext||this.data.text;return l(r)&&void 0!==r[t]?e.textLabel=r[t]:r&&(e.textLabel=r),!0}},f.update=function(e){var t=this.scene,r=t.fullSceneLayout;this.data=e;var n,l=e.x.length,g=u(d(r.xaxis,e.x,t.dataScale[0],e.xcalendar),d(r.yaxis,e.y,t.dataScale[1],e.ycalendar),d(r.zaxis,e.z,t.dataScale[2],e.zcalendar));if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!y(e.i,l)||!y(e.j,l)||!y(e.k,l))return;n=u(p(e.i),p(e.j),p(e.k))}else n=0===e.alphahull?o(g):e.alphahull>0?a(e.alphahull,g):function(e,t){for(var r=["x","y","z"].indexOf(e),n=[],a=t.length,o=0;oy):p=x>C,y=x;var w=A(C,B,b,x);w.pos=E,w.yc=(C+x)/2,w.i=v,w.dir=p?"increasing":"decreasing",w.x=w.pos,w.y=[b,B],m&&(w.orig_p=r[v]),h&&(w.tx=t.text[v]),d&&(w.htx=t.hovertext[v]),I.push(w)}else I.push({pos:E,empty:!0})}return t._extremes[l._id]=a.findExtremes(l,n.concat(g,u),{padded:!0}),I.length&&(I[0].t={labels:{open:i(e,"open:")+" ",high:i(e,"high:")+" ",low:i(e,"low:")+" ",close:i(e,"close:")+" "}}),I}e.exports={calc:function(e,t){var r=a.getFromId(e,t.xaxis),i=a.getFromId(e,t.yaxis),s=function(e,t,r){var i=r._minDiff;if(!i){var a,s=e._fullData,l=[];for(i=1/0,a=0;a"+A.labels[I]+n.hoverLabelText(s,v,l.yhoverformat):((m=i.extendFlat({},g)).y0=m.y1=E,m.yLabelVal=v,m.yLabel=A.labels[I]+n.hoverLabelText(s,v,l.yhoverformat),m.name="",u.push(m),p[v]=m)}return u}function g(e,t,r,i){var a=e.cd,o=e.ya,l=a[0].trace,u=a[0].t,g=c(e,t,r,i);if(!g)return[];var f=a[g.index],h=g.index=f.i,d=f.dir;function p(e){return u.labels[e]+n.hoverLabelText(o,l[e][h],l.yhoverformat)}var y=f.hi||l.hoverinfo,m=y.split("+"),I="all"===y,v=I||-1!==m.indexOf("y"),E=I||-1!==m.indexOf("text"),C=v?[p("open"),p("high"),p("low"),p("close")+" "+A[d]]:[];return E&&s(f,l,C),g.extraText=C.join("
"),g.y0=g.y1=o.c2p(f.yc,!0),[g]}e.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?u(e,t,r,n):g(e,t,r,n)},hoverSplit:u,hoverOnPoints:g}},65456:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:r(57952),categories:["cartesian","svg","showLegend"],meta:{},attributes:r(20279),supplyDefaults:r(23860),calc:r(42812).calc,plot:r(36664),style:r(14008),hoverPoints:r(18720).hoverPoints,selectPoints:r(97384)}},52744:function(e,t,r){"use strict";var n=r(24040),i=r(3400);e.exports=function(e,t,r,a){var o=r("x"),s=r("open"),l=r("high"),A=r("low"),c=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],a),s&&l&&A&&c){var u=Math.min(s.length,l.length,A.length,c.length);return o&&(u=Math.min(u,i.minRowLength(o))),t._length=u,u}}},36664:function(e,t,r){"use strict";var n=r(33428),i=r(3400);e.exports=function(e,t,r,a){var o=t.yaxis,s=t.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],a=r.t;if(!0!==r.trace.visible||a.empty)t.remove();else{var A=a.tickLen,c=t.selectAll("path").data(i.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=s.c2p(e.pos-A,!0),r=s.c2p(e.pos+A,!0),n=l?(t+r)/2:s.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},97384:function(e){"use strict";e.exports=function(e,t){var r,n=e.cd,i=e.xaxis,a=e.yaxis,o=[],s=n[0].t.bPos||0;if(!1===t)for(r=0;r=e.length)return!1;if(void 0!==t[e[r]])return!1;t[e[r]]=!0}return!0}(r))for(t=0;t0||c(s);A&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete e.categoryarray,delete e.ticktext),A||"array"!==u||(t.categoryorder="trace")}}e.exports=function(e,t,r,c){function g(r,i){return n.coerce(e,t,l,r,i)}var f=s(e,t,{name:"dimensions",handleItemDefaults:u}),h=function(e,t,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,c,g);o(t,c,g),Array.isArray(f)&&f.length||(t.visible=!1),A(t,f,"values",h),g("hoveron"),g("hovertemplate"),g("arrangement"),g("bundlecolors"),g("sortpaths"),g("counts");var d={weight:c.font.weight,style:c.font.style,variant:c.font.variant,family:c.font.family,size:Math.round(c.font.size),color:c.font.color};n.coerceFont(g,"labelfont",d);var p={weight:c.font.weight,style:c.font.style,variant:c.font.variant,family:c.font.family,size:Math.round(c.font.size/1.2),color:c.font.color};n.coerceFont(g,"tickfont",p)}},22020:function(e,t,r){"use strict";e.exports={attributes:r(72140),supplyDefaults:r(76671),calc:r(69136),plot:r(60268),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:r(91800),categories:["noOpacity"],meta:{}}},51036:function(e,t,r){"use strict";var n=r(33428),i=r(67756).Gz,a=r(36424),o=r(93024),s=r(3400),l=s.strTranslate,A=r(43616),c=r(49760),u=r(72736);function g(e,t,r,i){var a=t._context.staticPlot,o=e.map(F.bind(0,t,r)),c=i.selectAll("g.parcatslayer").data([null]);c.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var g=c.selectAll("g.trace.parcats").data(o,f),m=g.enter().append("g").attr("class","trace parcats");g.attr("transform",(function(e){return l(e.x,e.y)})),m.append("g").attr("class","paths");var I=g.select("g.paths").selectAll("path.path").data((function(e){return e.paths}),f);I.attr("fill",(function(e){return e.model.color}));var C=I.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(e){return e.model.color})).attr("fill-opacity",0);E(C),I.attr("d",(function(e){return e.svgD})),C.empty()||I.sort(d),I.exit().remove(),I.on("mouseover",p).on("mouseout",y).on("click",v),m.append("g").attr("class","dimensions");var x=g.select("g.dimensions").selectAll("g.dimension").data((function(e){return e.dimensions}),f);x.enter().append("g").attr("class","dimension"),x.attr("transform",(function(e){return l(e.x,0)})),x.exit().remove();var w=x.selectAll("g.category").data((function(e){return e.categories}),f),Q=w.enter().append("g").attr("class","category");w.attr("transform",(function(e){return l(0,e.y)})),Q.append("rect").attr("class","catrect").attr("pointer-events","none"),w.select("rect.catrect").attr("fill","none").attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),B(Q);var _=w.selectAll("rect.bandrect").data((function(e){return e.bands}),f);_.each((function(){s.raiseToTop(this)})),_.attr("fill",(function(e){return e.color}));var R=_.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(e){return e.color})).attr("fill-opacity",0);_.attr("fill",(function(e){return e.color})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("y",(function(e){return e.y})).attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"perpendicular"===e.parcatsViewModel.arrangement?"ns-resize":"move"})),b(R),_.exit().remove(),Q.append("text").attr("class","catlabel").attr("pointer-events","none");var L=t._fullLayout.paper_bgcolor;w.select("text.catlabel").attr("text-anchor",(function(e){return h(e)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",u.makeTextShadow(L)).style("fill","rgb(0, 0, 0)").attr("x",(function(e){return h(e)?e.width+5:-5})).attr("y",(function(e){return e.height/2})).text((function(e){return e.model.categoryLabel})).each((function(e){A.font(n.select(this),e.parcatsViewModel.categorylabelfont),u.convertToTspans(n.select(this),t)})),Q.append("text").attr("class","dimlabel"),w.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(e){return e.width/2})).attr("y",-5).text((function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null})).each((function(e){A.font(n.select(this),e.parcatsViewModel.labelfont)})),w.selectAll("rect.bandrect").on("mouseover",S).on("mouseout",k),w.exit().remove(),x.call(n.behavior.drag().origin((function(e){return{x:e.x,y:0}})).on("dragstart",D).on("drag",T).on("dragend",M)),g.each((function(e){e.traceSelection=n.select(this),e.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),e.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),g.exit().remove()}function f(e){return e.key}function h(e){var t=e.parcatsViewModel.dimensions.length,r=e.parcatsViewModel.dimensions[t-1].model.dimensionInd;return e.model.dimensionInd===r}function d(e,t){return e.model.rawColor>t.model.rawColor?1:e.model.rawColor"),S=n.mouse(u)[0];o.loneHover({trace:g,x:v-h.left+d.left,y:E-h.top+d.top,text:_,color:e.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:B,idealAlign:S1&&g.displayInd===u.dimensions.length-1?(i=A.left,a="left"):(i=A.left+A.width,a="right");var d=c.model.count,p=c.model.categoryLabel,y=d/c.parcatsViewModel.model.count,m={countLabel:d,categoryLabel:p,probabilityLabel:y.toFixed(3)},I=[];-1!==c.parcatsViewModel.hoverinfoItems.indexOf("count")&&I.push(["Count:",m.countLabel].join(" ")),-1!==c.parcatsViewModel.hoverinfoItems.indexOf("probability")&&I.push(["P("+m.categoryLabel+"):",m.probabilityLabel].join(" "));var v=I.join("
");return{trace:f,x:o*(i-t.left),y:s*(h-t.top),text:v,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:f.hovertemplate,hovertemplateLabels:m,eventData:[{data:f._input,fullData:f,count:d,category:p,probability:y}]}}function S(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var t,r=e.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=e.parcatsViewModel.hoveron,A=this;"color"===l?(function(e){var t=n.select(e).datum(),r=x(t);C(r),r.each((function(){s.raiseToTop(this)})),n.select(e.parentNode).selectAll("rect.bandrect").filter((function(e){return e.color===t.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(A),Q(A,"plotly_hover",n.event)):(function(e){n.select(e.parentNode).selectAll("rect.bandrect").each((function(e){var t=x(e);C(t),t.each((function(){s.raiseToTop(this)}))})),n.select(e.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(A),w(A,"plotly_hover",n.event)),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?t=_(r,a,A):"color"===l?t=function(e,t,r){e._fullLayout._calcInverseTransform(e);var i,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=r.getBoundingClientRect(),A=n.select(r).datum(),u=A.categoryViewModel,g=u.parcatsViewModel,f=g.model.dimensions[u.model.dimensionInd],h=g.trace,d=l.y+l.height/2;g.dimensions.length>1&&f.displayInd===g.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var p=u.model.categoryLabel,y=A.parcatsViewModel.model.count,m=0;A.categoryViewModel.bands.forEach((function(e){e.color===A.color&&(m+=e.count)}));var I=u.model.count,v=0;g.pathSelection.each((function(e){e.model.color===A.color&&(v+=e.model.count)}));var E=m/y,C=m/v,B=m/I,b={countLabel:m,categoryLabel:p,probabilityLabel:E.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",b.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(x.push("P(color \u2229 "+p+"): "+b.probabilityLabel),x.push("P("+p+" | color): "+C.toFixed(3)),x.push("P(color | "+p+"): "+B.toFixed(3)));var w=x.join("
"),Q=c.mostReadable(A.color,["black","white"]);return{trace:h,x:o*(i-t.left),y:s*(d-t.top),text:w,color:A.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Q,fontSize:10,idealAlign:a,hovertemplate:h.hovertemplate,hovertemplateLabels:b,eventData:[{data:h._input,fullData:h,category:p,count:y,probability:E,categorycount:I,colorcount:v,bandcolorcount:m}]}}(r,a,A):"dimension"===l&&(t=function(e,t,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(_(e,t,this))})),i}(r,a,A)),t&&o.loneHover(t,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r}))}}function k(e){var t=e.parcatsViewModel;t.dragDimension||(E(t.pathSelection),B(t.dimensionSelection.selectAll("g.category")),b(t.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(d),-1!==t.hoverinfoItems.indexOf("skip"))||("color"===e.parcatsViewModel.hoveron?Q(this,"plotly_unhover",n.event):w(this,"plotly_unhover",n.event))}function D(e){"fixed"!==e.parcatsViewModel.arrangement&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(t){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=t.width+2&&-2<=i&&i<=t.height+2&&(e.dragCategoryDisplayInd=t.model.displayInd,e.initialDragCategoryDisplayInds=e.model.categories.map((function(e){return e.displayInd})),t.model.dragY=t.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(t){t.yu.y+u.height/2&&(o.model.displayInd=u.model.displayInd,u.model.displayInd=l),e.dragCategoryDisplayInd=o.model.displayInd}if(null===e.dragCategoryDisplayInd||"freeform"===e.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var g=e.parcatsViewModel.dimensions[r],f=e.parcatsViewModel.dimensions[i];void 0!==g&&a.model.dragXf.x&&(a.model.displayInd=f.model.displayInd,f.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=a.model.displayInd}G(e.parcatsViewModel),P(e.parcatsViewModel),N(e.parcatsViewModel),L(e.parcatsViewModel)}}function M(e){if("fixed"!==e.parcatsViewModel.arrangement&&null!==e.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var t={},r=R(e.parcatsViewModel),i=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),o=e.initialDragDimensionDisplayInds.some((function(e,t){return e!==i[t]}));o&&i.forEach((function(r,n){var i=e.parcatsViewModel.model.dimensions[n].containerInd;t["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==e.dragCategoryDisplayInd){var l=e.model.categories.map((function(e){return e.displayInd}));if(s=e.initialDragCategoryDisplayInds.some((function(e,t){return e!==l[t]}))){var A=e.model.categories.slice().sort((function(e,t){return e.displayInd-t.displayInd})),c=A.map((function(e){return e.categoryValue})),u=A.map((function(e){return e.categoryLabel}));t["dimensions["+e.model.containerInd+"].categoryarray"]=[c],t["dimensions["+e.model.containerInd+"].ticktext"]=[u],t["dimensions["+e.model.containerInd+"].categoryorder"]="array"}}-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!e.dragHasMoved&&e.potentialClickBand&&("color"===e.parcatsViewModel.hoveron?Q(e.potentialClickBand,"plotly_click",n.event.sourceEvent):w(e.potentialClickBand,"plotly_click",n.event.sourceEvent)),e.model.dragX=null,null!==e.dragCategoryDisplayInd&&(e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd].model.dragY=null,e.dragCategoryDisplayInd=null),e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,G(e.parcatsViewModel),P(e.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){N(e.parcatsViewModel,!0),L(e.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(e.parcatsViewModel.graphDiv,t,[r])}))}}function R(e){for(var t,r=e.graphDiv._fullData,n=0;n=0;s--)c+="C"+A[s]+","+(t[s+1]+n)+" "+l[s]+","+(t[s]+n)+" "+(e[s]+r[s])+","+(t[s]+n),c+="l-"+r[s]+",0 ";return c+="Z"}function P(e){var t=e.dimensions,r=e.model,n=t.map((function(e){return e.categories.map((function(e){return e.y}))})),i=e.model.dimensions.map((function(e){return e.categories.map((function(e){return e.displayInd}))})),a=e.model.dimensions.map((function(e){return e.displayInd})),o=e.dimensions.map((function(e){return e.model.dimensionInd})),s=t.map((function(e){return e.x})),l=t.map((function(e){return e.width})),A=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&A.push(r.paths[c]);function u(e){var t=e.categoryInds.map((function(e,t){return i[t][e]}));return o.map((function(e){return t[e]}))}A.sort((function(t,r){var n=u(t),i=u(r);return"backward"===e.sortpaths&&(n.reverse(),i.reverse()),n.push(t.valueInds[0]),i.push(r.valueInds[0]),e.bundlecolors&&(n.unshift(t.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var g=new Array(A.length),f=t[0].model.count,h=t[0].categories.map((function(e){return e.height})).reduce((function(e,t){return e+t})),d=0;d0?h*(y.count/f):0;for(var m,I=new Array(n.length),v=0;v1?(e.width-80-16)/(n-1):0)*i;var a,o,s,l,A,c=[],u=e.model.maxCats,g=t.categories.length,f=t.count,h=e.height-8*(u-1),d=8*(u-g)/2,p=t.categories.map((function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}}));for(p.sort((function(e,t){return e.displayInd-t.displayInd})),A=0;A0?o.count/f*h:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:d,bands:[],parcatsViewModel:e},d=d+a+8,c.push(s);return{key:t.dimensionInd,x:null!==t.dragX?t.dragX:r,y:0,width:16,model:t,categories:c,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(e,t,r,n){g(r,e,n,t)}},60268:function(e,t,r){"use strict";var n=r(51036);e.exports=function(e,t,r,i){var a=e._fullLayout,o=a._paper,s=a._size;n(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},82296:function(e,t,r){"use strict";var n=r(49084),i=r(94724),a=r(25376),o=r(86968).u,s=r(92880).extendFlat,l=r(31780).templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},71864:function(e,t,r){"use strict";var n=r(30140),i=r(33428),a=r(71688).keyFun,o=r(71688).repeat,s=r(3400).sorterAsc,l=r(3400).strTranslate,A=n.bar.snapRatio;function c(e,t){return e*(1-A)+t*A}var u=n.bar.snapClose;function g(e,t){return e*(1-u)+t*u}function f(e,t,r,n){if(function(e,t){for(var r=0;r=t[r][0]&&e<=t[r][1])return!0;return!1}(r,n))return r;var i=e?-1:1,a=0,o=t.length-1;if(i<0){var s=a;a=o,o=s}for(var l=t[a],A=l,u=a;i*ut){g=r;break}}if(a=c,isNaN(a)&&(a=isNaN(u)||isNaN(g)?isNaN(u)?g:u:t-A[u][1]e[1]+r||t=.9*e[1]+.1*e[0]?"n":t<=.9*e[0]+.1*e[1]?"s":"ns"}(h,t);d&&(o.interval=l[a],o.intervalPix=h,o.region=d)}}if(e.ordinal&&!o.region){var p=e.unitTickvals,m=e.unitToPaddedPx.invert(t);for(r=0;r=I[0]&&m<=I[1]){o.clickableOrdinalRange=I;break}}}return o}function C(e,t){i.event.sourceEvent.stopPropagation();var r=t.height-i.mouse(e)[1]-2*n.verticalPadding,a=t.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(t.unitToPaddedPx.invert):a.newExtent=[a.startExtent,t.unitToPaddedPx.invert(r)].sort(s),t.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(t),v(e.parentNode)}function B(e,t){var r=E(t,t.height-i.mouse(e)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function b(e){e.on("mousemove",(function(e){i.event.preventDefault(),e.parent.inBrushDrag||B(this,e)})).on("mouseleave",(function(e){e.parent.inBrushDrag||m()})).call(i.behavior.drag().on("dragstart",(function(e){!function(e,t){i.event.sourceEvent.stopPropagation();var r=t.height-i.mouse(e)[1]-2*n.verticalPadding,a=t.unitToPaddedPx.invert(r),o=t.brush,s=E(t,r),l=s.interval,A=o.svgBrush;if(A.wasDragged=!1,A.grabbingBar="ns"===s.region,A.grabbingBar){var c=l.map(t.unitToPaddedPx);A.grabPoint=r-c[0]-n.verticalPadding,A.barLength=c[1]-c[0]}A.clickableOrdinalRange=s.clickableOrdinalRange,A.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(A.stayingIntervals=A.stayingIntervals.filter((function(e){return e[0]!==l[0]&&e[1]!==l[1]}))),A.startExtent=s.region?l["s"===s.region?1:0]:a,t.parent.inBrushDrag=!0,A.brushStartCallback()}(this,e)})).on("drag",(function(e){C(this,e)})).on("dragend",(function(e){!function(e,t){var r=t.brush,n=r.filter,a=r.svgBrush;a._dragging||(B(e,t),C(e,t),t.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,m(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&w(r)):w(r),a.brushCallback(t),v(e.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(A?[a.newExtent]:[]),a.extent.length||w(r),a.brushCallback(t),A?v(e.parentNode,s):(s(),v(e.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,e)})))}function x(e,t){return e[0]-t[0]}function w(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function Q(e){for(var t,r=e.slice(),n=[],i=r.shift();i;){for(t=i.slice();(i=r.shift())&&i[0]<=t[1];)t[1]=Math.max(t[1],i[1]);n.push(t)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(e,t,r,n,i,a){var o,l=function(){var e,t,r=[];return{set:function(n){1===(r=n.map((function(e){return e.slice().sort(s)})).sort(x)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),e=Q(r),t=r.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return e},getBounds:function(){return t}}}();return l.set(r),{filter:l,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(e){var t=e.brush,r=function(e){return e.svgBrush.extent.map((function(e){return e.slice()}))}(t),n=r.slice();t.filter.set(n),o()}),brushEndCallback:a}}},ensureAxisBrush:function(e,t,r){var i=e.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(e,t,r){var i=r._context.staticPlot,a=e.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(h).call(d).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(b).attr("height",(function(e){return e.height-n.verticalPadding}));var s=e.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",t).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(e){return e.height})).call(I);var A=e.selectAll(".highlight").data(o);A.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),A.attr("y1",(function(e){return e.height})).call(I)}(i,t,r)},cleanRanges:function(e,t){if(Array.isArray(e[0])?(e=e.map((function(e){return e.sort(s)})),e=t.multiselect?Q(e.sort(x)):[e[0]]):e=[e.sort(s)],t.tickvals){var r=t.tickvals.slice().sort(s);if(!(e=e.map((function(e){var t=[f(0,r,e[0],[]),f(1,r,e[1],[])];if(t[1]>t[0])return t})).filter((function(e){return e}))).length)return}return e.length>1?e:e[0]}}},61664:function(e,t,r){"use strict";e.exports={attributes:r(82296),supplyDefaults:r(60664),calc:r(95044),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:r(19976),categories:["gl","regl","noOpacity","noHover"],meta:{}}},19976:function(e,t,r){"use strict";var n=r(33428),i=r(84888)._M,a=r(24196),o=r(9616);t.name="parcoords",t.plot=function(e){var t=i(e.calcdata,"parcoords")[0];t.length&&a(e,t)},t.clean=function(e,t,r,n){var i=n._has&&n._has("parcoords"),a=t._has&&t._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(e){var t=e._fullLayout._glimages,r=n.select(e).selectAll(".svg-container");r.filter((function(e,t){return t===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this,r=e.toDataURL("image/png");t.append("svg:image").attr({xmlns:o.svg,"xlink:href":r,preserveAspectRatio:"none",x:0,y:0,width:e.style.width,height:e.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},95044:function(e,t,r){"use strict";var n=r(3400).isArrayOrTypedArray,i=r(8932),a=r(71688).wrap;e.exports=function(e,t){var r,o;return i.hasColorscale(t,"line")&&n(t.line.color)?(r=t.line.color,o=i.extractOpts(t.line).colorscale,i.calc(e,t,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(e){for(var t=new Array(e),r=0;ru&&(n.log("parcoords traces support up to "+u+" dimensions at the moment"),h.splice(u));var d=s(e,t,{name:"dimensions",layout:l,handleItemDefaults:f}),p=function(e,t,r,o,s){var l=s("line.color",r);if(i(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,l,c);o(t,l,c),Array.isArray(d)&&d.length||(t.visible=!1),g(t,d,"values",p);var y={weight:l.font.weight,style:l.font.style,variant:l.font.variant,family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",y),n.coerceFont(c,"tickfont",y),n.coerceFont(c,"rangefont",y),c("labelangle"),c("labelside"),c("unselected.line.color"),c("unselected.line.opacity")}},95724:function(e,t,r){"use strict";var n=r(3400).isTypedArray;t.convertTypedArray=function(e){return n(e)?Array.prototype.slice.call(e):e},t.isOrdinal=function(e){return!!e.tickvals},t.isVisible=function(e){return e.visible||!("visible"in e)}},29928:function(e,t,r){"use strict";var n=r(61664);n.plot=r(24196),e.exports=n},51352:function(e,t,r){"use strict";var n=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join("\n"),i=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),a=r(30140).maxDimensionCount,o=r(3400),s=1e-6,l=2048,A=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function g(e,t,r,n,i){var a=e._gl;a.enable(a.SCISSOR_TEST),a.scissor(t,r,n,i),e.clear({color:[0,0,0,0],depth:1})}function f(e,t,r,n,i,a){var o=a.key;r.drawCompleted||(function(e){e.read({x:0,y:0,width:1,height:1,data:A})}(e),r.drawCompleted=!0),function s(l){var A=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],g(e,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*A,a.offset=2*l*n,t(a),l*n+A>>8*t)%256/255}function p(e,t,r){for(var n=new Array(8*t),i=0,a=0;ac&&(c=e[i].dim1.canvasX,o=i);0===s&&g(x,0,0,r.canvasWidth,r.canvasHeight);var u=function(e){var t,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!e&&ns._length&&(_=_.slice(0,s._length));var k,D=s.tickvals;function T(e,t){return{val:e,text:k[t]}}function M(e,t){return e.val-t.val}if(a(D)&&D.length){i.isTypedArray(D)&&(D=Array.from(D)),k=s.ticktext,a(k)&&k.length?k.length>D.length?k=k.slice(0,D.length):D.length>k.length&&(D=D.slice(0,k.length)):k=D.map(o(s.tickformat));for(var R=1;R=r||l>=i)return;var A=e.lineLayer.readPixel(s,i-1-l),c=0!==A[3],u=c?A[2]+256*(A[1]+256*A[0]):null,g={x:s,y:l,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:u};u!==F&&(c?a.hover(g):a.unhover&&a.unhover(g),F=u)}})),_.style("opacity",(function(e){return e.pick?0:1})),f.style("background","rgba(255, 255, 255, 0)");var O=f.selectAll("."+I.cn.parcoords).data(Q,d);O.exit().remove(),O.enter().append("g").classed(I.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),O.attr("transform",(function(e){return c(e.model.translateX,e.model.translateY)}));var P=O.selectAll("."+I.cn.parcoordsControlView).data(p,d);P.enter().append("g").classed(I.cn.parcoordsControlView,!0),P.attr("transform",(function(e){return c(e.model.pad.l,e.model.pad.t)}));var G=P.selectAll("."+I.cn.yAxis).data((function(e){return e.dimensions}),d);G.enter().append("g").classed(I.cn.yAxis,!0),P.each((function(e){R(G,e,C)})),_.each((function(e){if(e.viewModel){!e.lineLayer||a?e.lineLayer=E(this,e):e.lineLayer.update(e),(e.key||0===e.key)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||a;e.lineLayer.render(e.viewModel.panels,t)}})),G.attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),G.call(n.behavior.drag().origin((function(e){return e})).on("drag",(function(e){var t=e.parent;w.linePickActive(!1),e.x=Math.max(-I.overdrag,Math.min(e.model.width+I.overdrag,n.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,G.sort((function(e,t){return e.x-t.x})).each((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio})),R(G,t,C),G.filter((function(t){return 0!==Math.abs(e.xIndex-t.xIndex)})).attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),n.select(this).attr("transform",c(e.x,0)),G.each((function(r,n,i){i===e.parent.key&&(t.dimensions[n]=r)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!S(t)),t.focusLayer.render&&t.focusLayer.render(t.panels)})).on("dragend",(function(e){var t=e.parent;e.x=e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio,R(G,t,C),n.select(this).attr("transform",(function(e){return c(e.x,0)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!S(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),w.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(t.key,t.dimensions.map((function(e){return e.crossfilterDimensionIndex})))}))),G.exit().remove();var U=G.selectAll("."+I.cn.axisOverlays).data(p,d);U.enter().append("g").classed(I.cn.axisOverlays,!0),U.selectAll("."+I.cn.axis).remove();var z=U.selectAll("."+I.cn.axis).data(p,d);z.enter().append("g").classed(I.cn.axis,!0),z.each((function(e){var t=e.model.height/e.model.tickDistance,r=e.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?i:null).tickFormat((function(t){return m.isOrdinal(e)?t:L(e.model.dimensions[e.visibleIndex],t)})).scale(r)),g.font(z.selectAll("text"),e.model.tickFont)})),z.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),z.selectAll("text").style("text-shadow",u.makeTextShadow(b)).style("cursor","default");var q=U.selectAll("."+I.cn.axisHeading).data(p,d);q.enter().append("g").classed(I.cn.axisHeading,!0);var H=q.selectAll("."+I.cn.axisTitle).data(p,d);H.enter().append("text").classed(I.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),H.text((function(e){return e.label})).each((function(t){var r=n.select(this);g.font(r,t.model.labelFont),u.convertToTspans(r,e)})).attr("transform",(function(e){var t=M(e.model.labelAngle,e.model.labelSide),r=I.axisTitleOffset;return(t.dir>0?"":c(0,2*r+e.model.height))+A(t.degrees)+c(-r*t.dx,-r*t.dy)})).attr("text-anchor",(function(e){var t=M(e.model.labelAngle,e.model.labelSide);return 2*Math.abs(t.dx)>Math.abs(t.dy)?t.dir*t.dx<0?"start":"end":"middle"}));var Y=U.selectAll("."+I.cn.axisExtent).data(p,d);Y.enter().append("g").classed(I.cn.axisExtent,!0);var J=Y.selectAll("."+I.cn.axisExtentTop).data(p,d);J.enter().append("g").classed(I.cn.axisExtentTop,!0),J.attr("transform",c(0,-I.axisExtentOffset));var K=J.selectAll("."+I.cn.axisExtentTopText).data(p,d);K.enter().append("text").classed(I.cn.axisExtentTopText,!0).call(T),K.text((function(e){return N(e,!0)})).each((function(e){g.font(n.select(this),e.model.rangeFont)}));var j=Y.selectAll("."+I.cn.axisExtentBottom).data(p,d);j.enter().append("g").classed(I.cn.axisExtentBottom,!0),j.attr("transform",(function(e){return c(0,e.model.height+I.axisExtentOffset)}));var V=j.selectAll("."+I.cn.axisExtentBottomText).data(p,d);V.enter().append("text").classed(I.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(T),V.text((function(e){return N(e,!1)})).each((function(e){g.font(n.select(this),e.model.rangeFont)})),v.ensureAxisBrush(U,b,e)}},24196:function(e,t,r){"use strict";var n=r(36336),i=r(5048),a=r(95724).isVisible,o={};function s(e,t,r){var n=t.indexOf(r),i=e.indexOf(n);return-1===i&&(i+=t.length),i}(e.exports=function(e,t){var r=e._fullLayout;if(i(e,[],o)){var l={},A={},c={},u={},g=r._size;t.forEach((function(t,r){var n=t[0].trace;c[r]=n.index;var i=u[r]=n._fullInput.index;l[r]=e.data[i].dimensions,A[r]=e.data[i].dimensions.slice()})),n(e,t,{width:g.w,height:g.h,margin:{t:g.t,r:g.r,b:g.b,l:g.l}},{filterChanged:function(t,n,i){var a=A[t][n],o=i.map((function(e){return e.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[e._fullData[c[t]]._fullInput.uid];if(void 0===l[s]){var g=a.constraintrange;l[s]=g||null}var f=e._fullData[c[t]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,f.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete f.constraintrange,o=null);var h={};h[s]=o,e.emit("plotly_restyle",[h,[u[t]]])},hover:function(t){e.emit("plotly_hover",t)},unhover:function(t){e.emit("plotly_unhover",t)},axesMoved:function(t,r){var n=function(e,t){return function(r,n){return s(e,t,r)-s(e,t,n)}}(r,A[t].filter(a));l[t].sort(n),A[t].filter((function(e){return!a(e)})).sort((function(e){return A[t].indexOf(e)})).forEach((function(e){l[t].splice(l[t].indexOf(e),1),l[t].splice(A[t].indexOf(e),0,e)})),e.emit("plotly_restyle",[{dimensions:[l[t]]},[u[t]]])}})}}).reglPrecompiled=o},74996:function(e,t,r){"use strict";var n=r(45464),i=r(86968).u,a=r(25376),o=r(22548),s=r(21776).Ks,l=r(21776).Gw,A=r(92880).extendFlat,c=r(98192).c,u=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:A({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:A({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:A({},u,{}),outsidetextfont:A({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:A({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:A({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},80036:function(e,t,r){"use strict";var n=r(7316);t.name="pie",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},45768:function(e,t,r){"use strict";var n=r(38248),i=r(49760),a=r(76308),o={};function s(e){return function(t,r){return!!t&&!!(t=i(t)).isValid()&&(t=a.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t)}}function l(e,t){var r,n=JSON.stringify(e),a=t[n];if(!a){for(a=e.slice(),r=0;r=0})),("funnelarea"===t.type?y:t.sort)&&a.sort((function(e,t){return t.v-e.v})),a[0]&&(a[0].vTotal=p),a},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,i=e.calcdata,a=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=l(a,o));for(var A=0,c=0;c0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}function c(e,t,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");l(n,"marker.pattern",a),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=r.paper_bgcolor)}e.exports={handleLabelsAndValues:A,handleMarkerDefaults:c,supplyDefaults:function(e,t,r,n){function l(r,n){return i.coerce(e,t,a,r,n)}var u=A(l("labels"),l("values")),g=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(l("label0"),l("dlabel")),g){t._length=g,c(e,t,n,l,!0),l("scalegroup");var f,h=l("text"),d=l("texttemplate");if(d||(f=l("textinfo",i.isArrayOrTypedArray(h)?"text+percent":"percent")),l("hovertext"),l("hovertemplate"),d||f&&"none"!==f){var p=l("textposition");s(e,t,n,l,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(p)||"auto"===p||"outside"===p)&&l("automargin"),("inside"===p||"auto"===p||Array.isArray(p))&&l("insidetextorientation")}else"none"===f&&l("textposition","none");o(t,n,l);var y=l("hole");if(l("title.text")){var m=l("title.position",y?"middle center":"top center");y||"middle center"!==m||(t.title.position="top center"),i.coerceFont(l,"title.font",n.font)}l("sort"),l("direction"),l("rotation"),l("pull")}else t.visible=!1}}},53644:function(e,t,r){"use strict";var n=r(10624).appendArrayMultiPointValues;e.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},21552:function(e,t,r){"use strict";var n=r(43616),i=r(76308);e.exports=function(e,t,r,a){var o=r.marker.pattern;o&&o.shape?n.pointStyle(e,r,a,t):i.fill(e,t.color)}},69656:function(e,t,r){"use strict";var n=r(3400);function i(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}t.formatPiePercent=function(e,t){var r=i((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},t.formatPieValue=function(e,t){var r=i(e.toPrecision(10));return n.numSeparate(r,t)},t.getFirstFilled=function(e,t){if(n.isArrayOrTypedArray(e))for(var r=0;r"),name:u.hovertemplate||-1!==g.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:p.castOption(E.bgcolor,e.pts)||e.color,borderColor:p.castOption(E.bordercolor,e.pts),fontFamily:p.castOption(C.family,e.pts),fontSize:p.castOption(C.size,e.pts),fontColor:p.castOption(C.color,e.pts),nameLength:p.castOption(E.namelength,e.pts),textAlign:p.castOption(E.align,e.pts),hovertemplate:p.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[y(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:B}),e.bbox=B[0],A._hasHoverLabel=!0}A._hasHoverEvent=!0,t.emit("plotly_hover",{points:[y(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,i=t._fullData[A.index],o=n.select(this).datum();A._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[y(o,i)],event:n.event}),A._hasHoverEvent=!1),A._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),A._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,i=t._fullData[A.index];t._dragging||!1===r.hovermode||(t._hoverdata=[y(e,i)],a.click(t,n.event))}))}function v(e,t,r){var n=p.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=p.castOption(e._input.textfont.color,t.pts));var i=p.castOption(e.insidetextfont.family,t.pts)||p.castOption(e.textfont.family,t.pts)||r.family,a=p.castOption(e.insidetextfont.size,t.pts)||p.castOption(e.textfont.size,t.pts)||r.size,s=p.castOption(e.insidetextfont.weight,t.pts)||p.castOption(e.textfont.weight,t.pts)||r.weight,l=p.castOption(e.insidetextfont.style,t.pts)||p.castOption(e.textfont.style,t.pts)||r.style,A=p.castOption(e.insidetextfont.variant,t.pts)||p.castOption(e.textfont.variant,t.pts)||r.variant;return{color:n||o.contrast(t.color),family:i,size:a,weight:s,style:l,variant:A}}function E(e,t){for(var r,n,i=0;it&&t>n||r=-4;p-=2)y(Math.PI*p,"tan");for(p=4;p>=-4;p-=2)y(Math.PI*(p+1),"tan")}if(u||f){for(p=4;p>=-4;p-=2)y(Math.PI*(p+1.5),"rad");for(p=4;p>=-4;p-=2)y(Math.PI*(p+.5),"rad")}}if(s||h||u){var m=Math.sqrt(e.width*e.width+e.height*e.height);if((a={scale:i*n*2/m,rCenter:1-i,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,a.scale>=1)return a;d.push(a)}(h||f)&&((a=B(e,n,o,l,A)).textPosAngle=(t.startangle+t.stopangle)/2,d.push(a)),(h||g)&&((a=b(e,n,o,l,A)).textPosAngle=(t.startangle+t.stopangle)/2,d.push(a));for(var I=0,v=0,E=0;E=1)break}return d[I]}function B(e,t,r,n,i){t=Math.max(0,t-2*d);var a=e.width/e.height,o=Q(a,n,t,r);return{scale:2*o/e.height,rCenter:x(a,o/t),rotate:w(i)}}function b(e,t,r,n,i){t=Math.max(0,t-2*d);var a=e.height/e.width,o=Q(a,n,t,r);return{scale:2*o/e.width,rCenter:x(a,o/t),rotate:w(i+Math.PI/2)}}function x(e,t){return Math.cos(t)-e*t}function w(e){return(180/Math.PI*e+720)%180-90}function Q(e,t,r,n){var i=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(e*e+n/2)+e))}function _(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function S(e,t){var r=t.pxmid[0],n=t.pxmid[1],i=e.width/2,a=e.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function k(e,t){var r,n,i,a=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=T(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*e.r,s.ty-=e.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*e.r);var l,A,c=(l=e.r,A=e.trace.aspectratio,l/(void 0===A?1:A)),u=t.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(u+=c,o.x-=(1+i)*c,s.tx+=e.titleBox.width/2):-1!==a.title.position.indexOf("center")?u*=2:-1!==a.title.position.indexOf("right")&&(u+=c,o.x+=(1+i)*c,s.tx-=e.titleBox.width/2),r=u/e.titleBox.width,n=D(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function D(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function T(e){var t,r=e.pull;if(!r)return 0;if(l.isArrayOrTypedArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function M(e,t){for(var r=[],n=0;n1?c=(A=r.r)/i.aspectratio:A=(c=r.r)*i.aspectratio,l=(A*=(1+i.baseratio)/2)*c}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var I=l.castOption(i,t.i,"texttemplate");if(I){var v=function(e){return{label:e.label,value:e.v,valueLabel:p.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:p.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:l.castOption(i,e.i,"customdata")}}(t),E=p.getFirstFilled(i.text,t.pts);(m(E)||""===E)&&(v.text=E),t.text=l.texttemplateString(I,v,e._fullLayout._d3locale,v,i._meta||{})}else t.text=""}}function N(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*n-o*i,e.textY=a*i+o*n,e.noCenter=!0}e.exports={plot:function(e,t){var r=e._context.staticPlot,a=e._fullLayout,g=a._size;h("pie",a),E(t,e),M(t,g);var d=l.makeTraceGroups(a._pielayer,t,"trace").each((function(t){var h=n.select(this),d=t[0],y=d.trace;!function(e){var t,r,n,i=e[0],a=i.r,o=i.trace,s=p.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,A="px0",c="px1";if("counterclockwise"===o.direction){for(t=0;ti.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=_(r,i))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var m=n.select(this).selectAll("g.slice").data(t);m.enter().append("g").classed("slice",!0),m.exit().remove();var E=[[[],[]],[[],[]]],B=!1;m.each((function(i,o){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=y.index,E[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var A=d.cx,c=d.cy,g=n.select(this),h=g.selectAll("path.surface").data([i]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),g.call(I,e,t),y.pull){var m=+p.castOption(y.pull,i.pts)||0;m>0&&(A+=m*i.pxmid[0],c+=m*i.pxmid[1])}i.cxFinal=A,i.cyFinal=c;var b=y.hole;if(i.v===d.vTotal){var x="M"+(A+i.px0[0])+","+(c+i.px0[1])+D(i.px0,i.pxmid,!0,1)+D(i.pxmid,i.px0,!0,1)+"Z";b?h.attr("d","M"+(A+b*i.px0[0])+","+(c+b*i.px0[1])+D(i.px0,i.pxmid,!1,b)+D(i.pxmid,i.px0,!1,b)+"Z"+x):h.attr("d",x)}else{var w=D(i.px0,i.px1,!0,1);if(b){var Q=1-b;h.attr("d","M"+(A+b*i.px1[0])+","+(c+b*i.px1[1])+D(i.px1,i.px0,!1,b)+"l"+Q*i.px0[0]+","+Q*i.px0[1]+w+"Z")}else h.attr("d","M"+A+","+c+"l"+i.px0[0]+","+i.px0[1]+w+"Z")}L(e,i,d);var _=p.castOption(y.textposition,i.pts),k=g.selectAll("g.slicetext").data(i.text&&"none"!==_?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var r=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),g=l.ensureUniformFontSize(e,"outside"===_?function(e,t,r){var n=p.castOption(e.outsidetextfont.color,t.pts)||p.castOption(e.textfont.color,t.pts)||r.color,i=p.castOption(e.outsidetextfont.family,t.pts)||p.castOption(e.textfont.family,t.pts)||r.family,a=p.castOption(e.outsidetextfont.size,t.pts)||p.castOption(e.textfont.size,t.pts)||r.size,o=p.castOption(e.outsidetextfont.weight,t.pts)||p.castOption(e.textfont.weight,t.pts)||r.weight,s=p.castOption(e.outsidetextfont.style,t.pts)||p.castOption(e.textfont.style,t.pts)||r.style,l=p.castOption(e.outsidetextfont.variant,t.pts)||p.castOption(e.textfont.variant,t.pts)||r.variant;return{color:n,family:i,size:a,weight:o,style:s,variant:l}}(y,i,a.font):v(y,i,a.font));r.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,g).call(u.convertToTspans,e);var h,m=s.bBox(r.node());if("outside"===_)h=S(m,i);else if(h=C(m,i,d),"auto"===_&&h.scale<1){var I=l.ensureUniformFontSize(e,y.outsidetextfont);r.call(s.font,I),h=S(m=s.bBox(r.node()),i)}var E=h.textPosAngle,b=void 0===E?i.pxmid:R(d.r,E);if(h.targetX=A+b[0]*h.rCenter+(h.x||0),h.targetY=c+b[1]*h.rCenter+(h.y||0),N(h,m),h.outside){var x=h.targetY;i.yLabelMin=x-m.height/2,i.yLabelMid=x,i.yLabelMax=x+m.height/2,i.labelExtraX=0,i.labelExtraY=0,B=!0}h.fontSize=g.size,f(y.type,h,a),t[o].transform=h,l.setTransormAndDisplay(r,h)}))}function D(e,t,r,n){var a=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*d.r+","+n*d.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var b=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(b.enter().append("g").classed("titletext",!0),b.exit().remove(),b.each((function(){var t,r=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=l.templateString(i,y._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,y.title.font).call(u.convertToTspans,e),t="middle center"===y.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):k(d,g),r.attr("transform",c(t.x,t.y)+A(Math.min(1,t.scale))+c(t.tx,t.ty))})),B&&function(e,t){var r,n,i,a,o,s,A,c,u,g,f,h,d;function y(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function I(e,r){r||(r={});var i,c,u,f,h=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?e.yLabelMin:e.yLabelMax,y=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),I=h-d;if(I*A>0&&(e.labelExtraY=I),l.isArrayOrTypedArray(t.pull))for(c=0;c=(p.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*A>0?(I=u.cyFinal+o(u.px0[1],u.px1[1])-d-e.labelExtraY)*A>0&&(e.labelExtraY+=I):(y+e.labelExtraY-m)*A>0&&(i=3*s*Math.abs(c-g.indexOf(e)),(f=u.cxFinal+a(u.px0[0],u.px1[0])+i-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*s>0&&(e.labelExtraX+=f)))}for(n=0;n<2;n++)for(i=n?y:m,o=n?Math.max:Math.min,A=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=e[n][r]).sort(i),u=e[1-n][r],g=u.concat(c),h=[],f=0;fMath.abs(u)?s+="l"+u*e.pxmid[0]/e.pxmid[1]+","+u+"H"+(a+e.labelExtraX+A):s+="l"+e.labelExtraX+","+c+"v"+(u-c)+"h"+A}else s+="V"+(e.yLabelMid+e.labelExtraY)+"h"+A;l.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(m,y),B&&y.automargin){var x=s.bBox(h.node()),w=y.domain,Q=g.w*(w.x[1]-w.x[0]),_=g.h*(w.y[1]-w.y[0]),D=(.5*Q-d.r)/g.w,T=(.5*_-d.r)/g.h;i.autoMargin(e,"pie."+y.uid+".automargin",{xl:w.x[0]-D,xr:w.x[1]+D,yb:w.y[0]-T,yt:w.y[1]+T,l:Math.max(d.cx-d.r-x.left,0),r:Math.max(x.right-(d.cx+d.r),0),b:Math.max(x.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-x.top,0),pad:5})}}))}));setTimeout((function(){d.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:L,transformInsideText:C,determineInsideTextFont:v,positionTitleOutside:k,prerenderTitles:E,layoutAreas:M,attachFxHandlers:I,computeTransform:N}},22152:function(e,t,r){"use strict";var n=r(33428),i=r(10528),a=r(82744).resizeText;e.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");a(e,t,"pie"),t.each((function(t){var r=t[0].trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each((function(t){n.select(this).call(i,t,r,e)}))}))}},10528:function(e,t,r){"use strict";var n=r(76308),i=r(69656).castOption,a=r(21552);e.exports=function(e,t,r,o){var s=r.marker.line,l=i(s.color,t.pts)||n.defaultLine,A=i(s.width,t.pts)||0;e.call(a,t,r,o).style("stroke-width",A).call(n.stroke,l)}},35484:function(e,t,r){"use strict";var n=r(52904);e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},11072:function(e,t,r){"use strict";var n=r(67792).gl_pointcloud2d,i=r(3400).isArrayOrTypedArray,a=r(43080),o=r(19280).findExtremes,s=r(44928);function l(e,t){this.scene=e,this.uid=t,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(e.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var A=l.prototype;A.handlePick=function(e){var t=this.idToIndex[e.pointId];return{trace:this,dataCoord:e.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*t],this.pickXYData[2*t+1]]:[this.pickXData[t],this.pickYData[t]],textLabel:i(this.textLabels)?this.textLabels[t]:this.textLabels,color:this.color,name:this.name,pointIndex:t,hoverinfo:this.hoverinfo}},A.update=function(e){this.index=e.index,this.textLabels=e.text,this.name=e.name,this.hoverinfo=e.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(e),this.color=s(e,{})},A.updateFast=function(e){var t,r,n,i,s,l,A=this.xData=this.pickXData=e.x,c=this.yData=this.pickYData=e.y,u=this.pickXYData=e.xy,g=e.xbounds&&e.ybounds,f=e.indices,h=this.bounds;if(u){if(n=u,t=u.length>>>1,g)h[0]=e.xbounds[0],h[2]=e.xbounds[1],h[1]=e.ybounds[0],h[3]=e.ybounds[1];else for(l=0;lh[2]&&(h[2]=i),sh[3]&&(h[3]=s);if(f)r=f;else for(r=new Int32Array(t),l=0;lh[2]&&(h[2]=i),sh[3]&&(h[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var d=a(e.marker.color),p=a(e.marker.border.color),y=e.opacity*e.marker.opacity;d[3]*=y,this.pointcloudOptions.color=d;var m=e.marker.blend;null===m&&(m=A.length<100||c.length<100),this.pointcloudOptions.blend=m,p[3]*=y,this.pointcloudOptions.borderColor=p;var I=e.marker.sizemin,v=Math.max(e.marker.sizemax,e.marker.sizemin);this.pointcloudOptions.sizeMin=I,this.pointcloudOptions.sizeMax=v,this.pointcloudOptions.areaRatio=e.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var E=this.scene.xaxis,C=this.scene.yaxis,B=v/2||.5;e._extremes[E._id]=o(E,[h[0],h[2]],{ppad:B}),e._extremes[C._id]=o(C,[h[1],h[3]],{ppad:B})},A.dispose=function(){this.pointcloud.dispose()},e.exports=function(e,t){var r=new l(e,t.uid);return r.update(t),r}},41904:function(e,t,r){"use strict";var n=r(3400),i=r(35484);e.exports=function(e,t,r){function a(r,a){return n.coerce(e,t,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),e.xy&&e.xy instanceof Float32Array&&(t.xy=e.xy),e.indices&&e.indices instanceof Int32Array&&(t.indices=e.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),t._length=null}},156:function(e,t,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" "),e.exports={attributes:r(35484),supplyDefaults:r(41904),calc:r(41484),plot:r(11072),moduleType:"trace",name:"pointcloud",basePlotModule:r(39952),categories:["gl","gl2d","showLegend"],meta:{}}},41440:function(e,t,r){"use strict";var n=r(25376),i=r(45464),a=r(22548),o=r(55756),s=r(86968).u,l=r(21776).Ks,A=r(49084),c=r(31780).templatedArray,u=r(29736).descriptionOnlyNumbers,g=r(92880).extendFlat,f=r(67824).overrideAll;(e.exports=f({hoverinfo:g({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:u("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:c("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:g(A().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},10760:function(e,t,r){"use strict";var n=r(67824).overrideAll,i=r(84888)._M,a=r(59596),o=r(65460),s=r(93972),l=r(86476),A=r(22676).prepSelect,c=r(3400),u=r(24040),g="sankey";function f(e,t){var r=e._fullData[t],n=e._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if(o&&"pan"!==i&&"zoom"!==i){s(o,a);var g={_id:"x",c2p:c.identity,_offset:r._sankey.translateX,_length:r._sankey.width},f={_id:"y",c2p:c.identity,_offset:r._sankey.translateY,_length:r._sankey.height},h={gd:e,element:o.node(),plotinfo:{id:t,xaxis:g,yaxis:f,fillRangeItems:c.noop},subplot:t,xaxes:[g],yaxes:[f],doneFnCompleted:function(r){var n,i=e._fullData[t],a=i.node.groups.slice(),o=[];function s(e){for(var t=i._sankey.graph.nodes,r=0;rI&&(I=a.source[t]),a.target[t]>I&&(I=a.target[t]);var v,E=I+1;e.node._count=E;var C=e.node.groups,B={};for(t=0;t0&&s(S,E)&&s(k,E)&&(!B.hasOwnProperty(S)||!B.hasOwnProperty(k)||B[S]!==B[k])){B.hasOwnProperty(k)&&(k=B[k]),B.hasOwnProperty(S)&&(S=B[S]),k=+k,f[S=+S]=f[k]=!0;var D="";a.label&&a.label[t]&&(D=a.label[t]);var T=null;D&&h.hasOwnProperty(D)&&(T=h[D]),A.push({pointNumber:t,label:D,color:c?a.color[t]:a.color,hovercolor:u?a.hovercolor[t]:a.hovercolor,customdata:g?a.customdata[t]:a.customdata,concentrationscale:T,source:S,target:k,value:+_}),Q.source.push(S),Q.target.push(k)}}var M=E+C.length,R=o(r.color),L=o(r.customdata),N=[];for(t=0;tE-1,childrenNodes:[],pointNumber:t,label:F,color:R?r.color[t]:r.color,customdata:L?r.customdata[t]:r.customdata})}var O=!1;return function(e,t,r){for(var a=i.init2dArray(e,0),o=0;o1}))}(M,Q.source,Q.target)&&(O=!0),{circular:O,links:A,nodes:N,groups:C,groupLookup:B}}e.exports=function(e,t){var r=A(t);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},11820:function(e){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},47140:function(e,t,r){"use strict";var n=r(3400),i=r(41440),a=r(76308),o=r(49760),s=r(86968).Q,l=r(16132),A=r(31780),c=r(51272);function u(e,t){function r(r,a){return n.coerce(e,t,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(e,t,r,g){function f(r,a){return n.coerce(e,t,i,r,a)}var h=n.extendDeep(g.hoverlabel,e.hoverlabel),d=e.node,p=A.newContainer(t,"node");function y(e,t){return n.coerce(d,p,i.node,e,t)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",e.hoverinfo),l(d,p,y,h),y("hovertemplate"),y("align");var m=g.colorway;y("color",p.label.map((function(e,t){return a.addOpacity(function(e){return m[e%m.length]}(t),.8)}))),y("customdata");var I=e.link||{},v=A.newContainer(t,"link");function E(e,t){return n.coerce(I,v,i.link,e,t)}E("label"),E("arrowlen"),E("source"),E("target"),E("value"),E("line.color"),E("line.width"),E("hoverinfo",e.hoverinfo),l(I,v,E,h),E("hovertemplate");var C,B=o(g.paper_bgcolor).getLuminance()<.333,b=E("color",B?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function x(e){var t=o(e);if(!t.isValid())return e;var r=t.getAlpha();return r<=.8?t.setAlpha(r+.2):t=B?t.brighten():t.darken(),t.toRgbString()}E("hovercolor",Array.isArray(b)?b.map(x):x(b)),E("customdata"),c(I,v,{name:"colorscales",handleItemDefaults:u}),s(t,g,f),f("orientation"),f("valueformat"),f("valuesuffix"),p.x.length&&p.y.length&&(C="freeform"),f("arrangement",C),n.coerceFont(f,"textfont",n.extendFlat({},g.font)),t._length=null}},45499:function(e,t,r){"use strict";e.exports={attributes:r(41440),supplyDefaults:r(47140),calc:r(48068),plot:r(59596),moduleType:"trace",name:"sankey",basePlotModule:r(10760),selectPoints:r(81128),categories:["noOpacity"],meta:{}}},59596:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=i.numberFormat,o=r(83248),s=r(93024),l=r(76308),A=r(11820).cn,c=i._;function u(e){return""!==e}function g(e,t){return e.filter((function(e){return e.key===t.traceId}))}function f(e,t){n.select(e).select("path").style("fill-opacity",t),n.select(e).select("rect").style("fill-opacity",t)}function h(e){n.select(e).select("text.name").style("fill","black")}function d(e){return function(t){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function p(e){return function(t){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function y(e,t,r){t&&r&&g(r,t).selectAll("."+A.sankeyLink).filter(d(t)).call(I.bind(0,t,r,!1))}function m(e,t,r){t&&r&&g(r,t).selectAll("."+A.sankeyLink).filter(d(t)).call(v.bind(0,t,r,!1))}function I(e,t,r,n){n.style("fill",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha})),n.each((function(r){var n=r.link.label;""!==n&&g(t,e).selectAll("."+A.sankeyLink).filter((function(e){return e.link.label===n})).style("fill",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha}))})),r&&g(t,e).selectAll("."+A.sankeyNode).filter(p(e)).call(y)}function v(e,t,r,n){n.style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),n.each((function(r){var n=r.link.label;""!==n&&g(t,e).selectAll("."+A.sankeyLink).filter((function(e){return e.link.label===n})).style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha}))})),r&&g(t,e).selectAll(A.sankeyNode).filter(p(e)).call(m)}function E(e,t){var r=e.hoverlabel||{},n=i.nestedProperty(r,t).get();return!Array.isArray(n)&&n}e.exports=function(e,t){for(var r=e._fullLayout,i=r._paper,g=r._size,d=0;d"),color:E(o,"bgcolor")||l.addOpacity(d.color,1),borderColor:E(o,"bordercolor"),fontFamily:E(o,"font.family"),fontSize:E(o,"font.size"),fontColor:E(o,"font.color"),fontWeight:E(o,"font.weight"),fontStyle:E(o,"font.style"),fontVariant:E(o,"font.variant"),nameLength:E(o,"namelength"),textAlign:E(o,"align"),idealAlign:n.event.x"),color:E(o,"bgcolor")||i.tinyColorHue,borderColor:E(o,"bordercolor"),fontFamily:E(o,"font.family"),fontSize:E(o,"font.size"),fontColor:E(o,"font.color"),fontWeight:E(o,"font.weight"),fontStyle:E(o,"font.style"),fontVariant:E(o,"font.variant"),nameLength:E(o,"namelength"),textAlign:E(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:m,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e});f(C,.85),h(C)}}},unhover:function(t,i,a){!1!==e._fullLayout.hovermode&&(n.select(t).call(m,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,e.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(t,r,i){var a=r.node;a.originalEvent=n.event,e._hoverdata=[a],n.select(t).call(m,r,i),s.click(e,{target:!0})}}})}},83248:function(e,t,r){"use strict";var n=r(49812),i=r(67756).Gz,a=r(33428),o=r(26800),s=r(48932),l=r(11820),A=r(49760),c=r(76308),u=r(43616),g=r(3400),f=g.strTranslate,h=g.strRotate,d=r(71688),p=d.keyFun,y=d.repeat,m=d.unwrap,I=r(72736),v=r(24040),E=r(84284),C=E.CAP_SHIFT,B=E.LINE_SPACING;function b(e,t,r){var n,i=m(t),a=i.trace,c=a.domain,u="h"===a.orientation,f=a.node.pad,h=a.node.thickness,d={justify:o.sankeyJustify,left:o.sankeyLeft,right:o.sankeyRight,center:o.sankeyCenter}[a.node.align],p=e.width*(c.x[1]-c.x[0]),y=e.height*(c.y[1]-c.y[0]),I=i._nodes,v=i._links,E=i.circular;(n=E?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(u?[p,y]:[y,p]).nodeWidth(h).nodePadding(f).nodeId((function(e){return e.pointNumber})).nodeAlign(d).nodes(I).links(v);var C,B,b,x=n();for(var w in n.nodePadding()=i||(r=i-t.y0)>1e-6&&(t.y0+=r,t.y1+=r),i=t.y1+f}))}(function(e){var t,r,n=e.map((function(e,t){return{x0:e.x0,index:t}})).sort((function(e,t){return e.x0-t.x0})),i=[],a=-1,o=-1/0;for(C=0;Co+h&&(a+=1,t=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=t-s.x0,s.x0+=r,s.x1+=r}return i}(I=x.nodes)),n.update(x)}return{circular:E,key:r,trace:a,guid:g.randstr(),horizontal:u,width:p,height:y,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,linkArrowLength:a.link.arrowlen,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:c.x[0]*e.width+e.margin.l,translateY:e.height-c.y[1]*e.height+e.margin.t,dragParallel:u?y:p,dragPerpendicular:u?p:y,arrangement:a.arrangement,sankey:n,graph:x,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function x(e,t,r){var n=A(t.color),i=A(t.hovercolor),a=t.source.label+"|"+t.target.label+"__"+r;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:a,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:w,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,linkArrowLength:e.linkArrowLength,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function w(){return function(e){var t=e.linkArrowLength;if(e.link.circular)return function(e,t){var r=e.width/2,n=e.circularPathData;return"top"===e.circularLinkType?"M "+(n.targetX-t)+" "+(n.targetY+r)+" L"+(n.rightInnerExtent-t)+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r-t)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-t)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r-t)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-t)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+(n.rightInnerExtent-t)+" "+(n.targetY-r)+"L"+(n.targetX-t)+" "+(n.targetY-r)+(t>0?"L"+n.targetX+" "+n.targetY:"")+"Z":"M "+(n.targetX-t)+" "+(n.targetY-r)+" L"+(n.rightInnerExtent-t)+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r-t)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-t)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r-t)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-t)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+(n.rightInnerExtent-t)+" "+(n.targetY+r)+"L"+(n.targetX-t)+" "+(n.targetY+r)+(t>0?"L"+n.targetX+" "+n.targetY:"")+"Z"}(e.link,t);var r=Math.abs((e.link.target.x0-e.link.source.x1)/2);t>r&&(t=r);var n=e.link.source.x1,a=e.link.target.x0-t,o=i(n,a),s=o(.5),l=o(.5),A=e.link.y0-e.link.width/2,c=e.link.y0+e.link.width/2,u=e.link.y1-e.link.width/2,g=e.link.y1+e.link.width/2,f="M"+n+","+A,h="C"+s+","+A+" "+l+","+u+" "+a+","+u,d="C"+l+","+g+" "+s+","+c+" "+n+","+c,p=t>0?"L"+(a+t)+","+(u+e.link.width/2):"";return f+h+(p+="L"+a+","+g)+d+"Z"}}function Q(e,t){var r=A(t.color),n=l.nodePadAcross,i=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var a=t.dx,o=Math.max(.5,t.dy),s="node_"+t.pointNumber;return t.group&&(s=g.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:s,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:1===t.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,s].join("_"),interactionState:e.interactionState,figure:e}}function _(e){e.attr("transform",(function(e){return f(e.node.x0.toFixed(3),e.node.y0.toFixed(3))}))}function S(e){e.call(_)}function k(e,t){e.call(S),t.attr("d",w())}function D(e){e.attr("width",(function(e){return e.node.x1-e.node.x0})).attr("height",(function(e){return e.visibleHeight}))}function T(e){return e.link.width>1||e.linkLineWidth>0}function M(e){return f(e.translateX,e.translateY)+(e.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function R(e,t,r){e.on(".basic",null).on("mouseover.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.hover(this,e,t),e.interactionState.hovered=[this,e])})).on("mousemove.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.follow(this,e),e.interactionState.hovered=[this,e])})).on("mouseout.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.unhover(this,e,t),e.interactionState.hovered=!1)})).on("click.basic",(function(e){e.interactionState.hovered&&(r.unhover(this,e,t),e.interactionState.hovered=!1),e.interactionState.dragInProgress||e.partOfGroup||r.select(this,e,t)}))}function L(e,t,r,i){var o=a.behavior.drag().origin((function(e){return{x:e.node.x0+e.visibleWidth/2,y:e.node.y0+e.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(g.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(e){i._fullLayout._dragCover=e})),g.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(e,t,r,i){!function(e){for(var t=0;t0&&n.forceLayouts[t].alpha(0)}}(0,t,a,r)).stop()}(0,o,a),function(e,t,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,N(r,i)}}))}(e,t,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),k(e.filter(O(r)),t))}})).on("dragend",(function(e){if("fixed"!==e.arrangement){e.interactionState.dragInProgress=!1;for(var t=0;tl&&k[y].gap;)y--;for(I=k[y].s,d=k.length-1;d>y;d--)k[d].s=I;for(;lQ[u]&&u=0;u--){var g=e[u];if("scatter"===g.type&&g.xaxis===A.xaxis&&g.yaxis===A.yaxis){g.opacity=void 0;break}}}}}},18800:function(e,t,r){"use strict";var n=r(3400),i=r(24040),a=r(52904),o=r(88200),s=r(43028),l=r(43980),A=r(31147),c=r(43912),u=r(74428),g=r(66828),f=r(11731),h=r(124),d=r(70840),p=r(3400).coercePattern;e.exports=function(e,t,r,y){function m(r,i){return n.coerce(e,t,a,r,i)}var I=l(e,t,y,m);if(I||(t.visible=!1),t.visible){A(e,t,y,m),m("xhoverformat"),m("yhoverformat"),m("zorder");var v=c(e,t,y,m);"group"===y.scattermode&&void 0===t.orientation&&m("orientation","v");var E=!v&&I=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(g.c2p(e.x)-h);return a=Math.min(t,r)&&d<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(f.c2p(e.y)-d);return ar!==(A=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],A-l&&(a=o+(s-o)*(r-l)/(A-l),u=Math.min(u,a),h=Math.max(h,a)));return{x0:u=Math.max(u,0),x1:h=Math.min(h,g._length),y0:r,y1:r}}(u._polygons);null===T&&(T={x0:p[0],x1:p[0],y0:p[1],y1:p[1]});var M=s.defaultLine;return s.opacity(u.fillcolor)?M=u.fillcolor:s.opacity((u.line||{}).color)&&(M=u.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:T.x0,x1:T.x1,y0:T.y0,y1:T.y1,color:M,hovertemplate:!1}),delete e.index,u.text&&!n.isArrayOrTypedArray(u.text)?e.text=String(u.text):e.text=u.name,[e]}}},65875:function(e,t,r){"use strict";var n=r(43028);e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:r(52904),layoutAttributes:r(55308),supplyDefaults:r(18800),crossTraceDefaults:r(35036),supplyLayoutDefaults:r(59748),calc:r(16356).calc,crossTraceCalc:r(96664),arraysToCalcdata:r(20148),plot:r(96504),colorbar:r(5528),formatLabels:r(76688),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(98723),selectPoints:r(91560),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:r(57952),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},55308:function(e){"use strict";e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}},59748:function(e,t,r){"use strict";var n=r(3400),i=r(55308);e.exports=function(e,t){var r,a,o="group"===t.barmode;"group"===t.scattermode&&(r="scattergap",a=o?t.bargap:.2,n.coerce(e,t,i,r,a))}},66828:function(e,t,r){"use strict";var n=r(3400).isArrayOrTypedArray,i=r(94288).hasColorscale,a=r(27260);e.exports=function(e,t,r,o,s,l){l||(l={});var A=(e.marker||{}).color;A&&A._inputArray&&(A=A._inputArray),s("line.color",r),i(e,"line")?a(e,t,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(A)&&A||r),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},52340:function(e,t,r){"use strict";var n=r(43616),i=r(39032),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,A=r(3400),c=A.segmentsIntersect,u=A.constrain,g=r(88200);e.exports=function(e,t){var r,i,o,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q,_=t.trace||{},S=t.xaxis,k=t.yaxis,D="log"===S.type,T="log"===k.type,M=S._length,R=k._length,L=t.backoff,N=_.marker,F=t.connectGaps,O=t.baseTolerance,P=t.shape,G="linear"===P,U=_.fill&&"none"!==_.fill,z=[],q=g.minTolerance,H=e.length,Y=new Array(H),J=0;function K(r){var n=e[r];if(!n)return!1;var i=t.linearized?S.l2p(n.x):S.c2p(n.x),o=t.linearized?k.l2p(n.y):k.c2p(n.y);if(i===a){if(D&&(i=S.c2p(n.x,!0)),i===a)return!1;T&&o===a&&(i*=Math.abs(S._m*R*(S._m>0?s:l)/(k._m*M*(k._m>0?s:l)))),i*=1e3}if(o===a){if(T&&(o=k.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function j(e,t,r,n){var i=r-e,a=n-t,o=.5-e,s=.5-t,l=i*i+a*a,A=i*o+a*s;if(A>0&&Aoe||e[1]le)return[u(e[0],ae,oe),u(e[1],se,le)]}function ue(e,t){return e[0]===t[0]&&(e[0]===ae||e[0]===oe)||e[1]===t[1]&&(e[1]===se||e[1]===le)||void 0}function ge(e,t,r){return function(n,i){var a=ce(n),o=ce(i),s=[];if(a&&o&&ue(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*A.constrain((n[e]+i[e])/2,t,r)-((a||n)[e]+(o||i)[e]);return l&&((a&&o?l>0===a[e]>o[e]?a:o:a||o)[e]+=l),s}}function fe(e){var t=e[0],r=e[1],n=t===Y[J-1][0],i=r===Y[J-1][1];if(!n||!i)if(J>1){var a=t===Y[J-2][0],o=r===Y[J-2][1];n&&(t===ae||t===oe)&&a?o?J--:Y[J-1]=e:i&&(r===se||r===le)&&o?a?J--:Y[J-1]=e:Y[J++]=e}else Y[J++]=e}function he(e){Y[J-1][0]!==e[0]&&Y[J-1][1]!==e[1]&&fe([$,ee]),fe(e),te=null,$=ee=0}"linear"===P||"spline"===P?ne=function(e,t){for(var r=[],n=0,i=0;i<4;i++){var a=Ae[i],o=c(e[0],e[1],t[0],t[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&W(o,e)oe?oe:0,X=t[1]le?le:0,Z||X){if(J)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),Y[J++]=n[1])}else re=ne(Y[J-1],t)[0],Y[J++]=re;else Y[J++]=[Z||t[0],X||t[1]];var i=Y[J-1];Z&&X&&(i[0]!==Z||i[1]!==X)?(te&&($!==Z&&ee!==X?fe($&&ee?function(e,t){var r=t[0]-e[0],n=(t[1]-e[1])/r;return(e[1]*t[0]-t[1]*e[0])/r>0?[n>0?ae:oe,le]:[n>0?oe:ae,se]}(te,t):[$||Z,ee||X]):$&&ee&&fe([$,ee])),fe([Z,X])):$-Z&&ee-X&&fe([Z||$,X||ee]),te=t,$=Z,ee=X}else te&&he(ne(te,t)[0]),Y[J++]=t}for(r=0;rV(d,ye))break;o=d,(C=m[0]*y[0]+m[1]*y[1])>v?(v=C,f=d,p=!1):C=e.length||!d)break;pe(d),i=d}}else pe(f)}te&&fe([$||te[0],ee||te[1]]),z.push(Y.slice(0,J))}var me=P.slice(P.length-1);if(L&&"h"!==me&&"v"!==me){for(var Ie=!1,ve=-1,Ee=[],Ce=0;Ce=0?l=f:(l=f=g,g++),l0?Math.max(r,a):0}}},5528:function(e){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},74428:function(e,t,r){"use strict";var n=r(76308),i=r(94288).hasColorscale,a=r(27260),o=r(43028);e.exports=function(e,t,r,s,l,A){var c=o.isBubble(e),u=(e.line||{}).color;A=A||{},u&&(r=u),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),A.noAngle||(l("marker.angle"),A.noAngleRef||l("marker.angleref"),A.noStandOff||l("marker.standoff")),l("marker.color",r),i(e,"marker")&&a(e,t,s,l,{prefix:"marker.",cLetter:"c"}),A.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),A.noLine||(l("marker.line.color",u&&!Array.isArray(u)&&t.marker.color!==u?u:c?n.background:n.defaultLine),i(e,"marker.line")&&a(e,t,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),A.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}},31147:function(e,t,r){"use strict";var n=r(3400).dateTick0,i=r(39032).ONEWEEK;function a(e,t){return n(t,e%i===0?1:0)}e.exports=function(e,t,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,t.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,t.ycalendar)),n("yperiodalignment"))}}},96504:function(e,t,r){"use strict";var n=r(33428),i=r(24040),a=r(3400),o=a.ensureSingle,s=a.identity,l=r(43616),A=r(43028),c=r(52340),u=r(14328),g=r(92065).tester;function f(e,t,r,u,f,h,d){var p,y=e._context.staticPlot;!function(e,t,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),u=n.extent(a.simpleMap(l.range,l.r2c)),g=i[0].trace;if(A.hasMarkers(g)){var f=g.marker.maxdisplayed;if(0!==f){var h=i.filter((function(e){return e.x>=c[0]&&e.x<=c[1]&&e.y>=u[0]&&e.y<=u[1]})),d=Math.ceil(h.length/f),p=0;o.forEach((function(e,r){var n=e[0].trace;A.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function I(e){return m?e.transition():e}var v=r.xaxis,E=r.yaxis,C=u[0].trace,B=C.line,b=n.select(h),x=o(b,"g","errorbars"),w=o(b,"g","lines"),Q=o(b,"g","points"),_=o(b,"g","text");if(i.getComponentMethod("errorbars","plot")(e,x,r,d),!0===C.visible){var S,k;I(b).style("opacity",C.opacity);var D,T,M=C.fill.charAt(C.fill.length-1);"x"!==M&&"y"!==M&&(M=""),"y"===M?(D=1,T=E.c2p(0,!0)):"x"===M&&(D=0,T=v.c2p(0,!0)),u[0][r.isRangePlot?"nodeRangePlot3":"node3"]=b;var R,L,N="",F=[],O=C._prevtrace,P=null,G=null;O&&(N=O._prevRevpath||"",k=O._nextFill,F=O._ownPolygons,P=O._fillsegments,G=O._fillElement);var U,z,q,H,Y,J,K="",j="",V=[];C._polygons=[];var W=[],Z=[],X=a.noop;if(S=C._ownFill,A.hasLines(C)||"none"!==C.fill){k&&k.datum(u),-1!==["hv","vh","hvh","vhv"].indexOf(B.shape)?(U=l.steps(B.shape),z=l.steps(B.shape.split("").reverse().join(""))):U=z="spline"===B.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?l.smoothclosed(e.slice(1),B.smoothing):l.smoothopen(e,B.smoothing)}:function(e){return"M"+e.join("L")},q=function(e){return z(e.reverse())},Z=c(u,{xaxis:v,yaxis:E,trace:C,connectGaps:C.connectgaps,baseTolerance:Math.max(B.width||1,3)/4,shape:B.shape,backoff:B.backoff,simplify:B.simplify,fill:C.fill}),W=new Array(Z.length);var $=0;for(p=0;p0,p=u(e,t,r);(c=i.selectAll("g.trace").data(p,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(e,t,r){t.each((function(t){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,e);var a=t[0].trace,A=[];a._ownfill&&A.push("_ownFill"),a._nexttrace&&A.push("_nextFill");var c=i.selectAll("g").data(A,s);c.enter().append("g"),c.exit().each((function(e){a[e]=null})).remove(),c.order().each((function(e){a[e]=o(n.select(this),"path","js-fill")}))}))}(e,c,t),d?(A&&(g=A()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){g&&g()})).each("interrupt",(function(){g&&g()})).each((function(){i.selectAll("g.trace").each((function(r,n){f(e,n,t,r,p,this,a)}))}))):c.each((function(r,n){f(e,n,t,r,p,this,a)})),h&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},91560:function(e,t,r){"use strict";var n=r(43028);e.exports=function(e,t){var r,i,a,o,s=e.cd,l=e.xaxis,A=e.yaxis,c=[],u=s[0].trace;if(!n.hasMarkers(u)&&!n.hasText(u))return[];if(!1===t)for(r=0;r0){var g=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=g),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,g)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(e,t,r){var n=[i(e.x,e.error_x,t[0],r.xaxis),i(e.y,e.error_y,t[1],r.yaxis),i(e.z,e.error_z,t[2],r.zaxis)],a=function(e){for(var t=0;t-1?-1:e.indexOf("right")>-1?1:0}function v(e){return null===e||void 0===e?0:e.indexOf("top")>-1?-1:e.indexOf("bottom")>-1?1:0}function E(e,t){return t(4*e)}function C(e){return f[e]}function B(e,t,r,n,i){var a=null;if(l.isArrayOrTypedArray(e)){a=[];for(var o=0;o=0){var d=function(e,t,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&u("surfacecolor",f||h);for(var d=["x","y","z"],p=0;p<3;++p){var y="projection."+d[p];u(y+".show")&&(u(y+".opacity"),u(y+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(e,t,f||h||r,{axis:"z"}),m(e,t,f||h||r,{axis:"y",inherit:"z"}),m(e,t,f||h||r,{axis:"x",inherit:"z"})}else t.visible=!1}},3296:function(e,t,r){"use strict";e.exports={plot:r(41064),attributes:r(91592),markerSymbols:r(87792),supplyDefaults:r(83484),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:r(41484),moduleType:"trace",name:"scatter3d",basePlotModule:r(12536),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},90372:function(e,t,r){"use strict";var n=r(98304),i=r(52904),a=r(45464),o=r(21776).Ks,s=r(21776).Gw,l=r(49084),A=r(92880).extendFlat,c=i.marker,u=i.line,g=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:A({},i.mode,{dflt:"markers"}),text:A({},i.text,{}),texttemplate:s({editType:"plot"},{keys:["a","b","text"]}),hovertext:A({},i.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:A({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:i.connectgaps,fill:A({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n(),marker:A({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:A({width:g.width,editType:"calc"},l("marker.line")),gradient:c.gradient,editType:"calc"},l("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:A({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:i.hoveron,hovertemplate:o(),zorder:i.zorder}},48228:function(e,t,r){"use strict";var n=r(38248),i=r(90136),a=r(20148),o=r(4500),s=r(16356).calcMarkerSize,l=r(50948);e.exports=function(e,t){var r=t._carpetTrace=l(e,t);if(r&&r.visible&&"legendonly"!==r.visible){var A;t.xaxis=r.xaxis,t.yaxis=r.yaxis;var c,u,g=t._length,f=new Array(g),h=!1;for(A=0;A")}return o}function m(e,t){var r;r=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,""):e._hovertitle,p.push(r+": "+t.toFixed(3)+e.labelsuffix)}}},4184:function(e,t,r){"use strict";e.exports={attributes:r(90372),supplyDefaults:r(6176),colorbar:r(5528),formatLabels:r(52364),calc:r(48228),plot:r(20036),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(58960),selectPoints:r(91560),eventData:r(89307),moduleType:"trace",name:"scattercarpet",basePlotModule:r(57952),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},20036:function(e,t,r){"use strict";var n=r(96504),i=r(54460),a=r(43616);e.exports=function(e,t,r,o){var s,l,A,c=r[0][0].carpet,u=i.getFromId(e,c.xaxis||"x"),g=i.getFromId(e,c.yaxis||"y"),f={xaxis:u,yaxis:g,plot:t.plot};for(s=0;s")}function f(e){return e+"\xb0"}}(A,d,e,l[0].t.labels),e.hovertemplate=A.hovertemplate,[e]}}},36952:function(e,t,r){"use strict";e.exports={attributes:r(6096),supplyDefaults:r(86188),colorbar:r(5528),formatLabels:r(56696),calc:r(25212),calcGeoJSON:r(48691).calcGeoJSON,plot:r(48691).plot,style:r(25064),styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(64292),eventData:r(58544),selectPoints:r(8796),moduleType:"trace",name:"scattergeo",basePlotModule:r(10816),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},48691:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(59972).getTopojsonFeatures,o=r(44808),s=r(27144),l=r(19280).findExtremes,A=r(39032).BADNUM,c=r(16356).calcMarkerSize,u=r(43028),g=r(25064);e.exports={calcGeoJSON:function(e,t){var r,n,o=e[0].trace,u=t[o.geo],g=u._subplot,f=o._length;if(i.isArrayOrTypedArray(o.locations)){var h=o.locationmode,d="geojson-id"===h?s.extractTraceFeature(e):a(o,g.topojson);for(r=0;r=p,C=2*v,B={},b=l.makeCalcdata(t,"x"),x=m.makeCalcdata(t,"y"),w=s(t,l,"x",b),Q=s(t,m,"y",x),_=w.vals,S=Q.vals;t._x=_,t._y=S,t.xperiodalignment&&(t._origX=b,t._xStarts=w.starts,t._xEnds=w.ends),t.yperiodalignment&&(t._origY=x,t._yStarts=Q.starts,t._yEnds=Q.ends);var k=new Array(C),D=new Array(v);for(r=0;r1&&i.extendFlat(s.line,f.linePositions(e,r,n)),s.errorX||s.errorY){var l=f.errorBarPositions(e,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}return s.text&&(i.extendFlat(s.text,{positions:n},f.textPosition(e,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},f.textPosition(e,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},f.textPosition(e,r,s.text,s.markerUnsel))),s}(e,0,t,k,_,S),R=h(e,I);return u(o,t),E?M.marker&&(T=M.marker.sizeAvg||Math.max(M.marker.size,3)):T=A(t,v),c(e,t,l,m,_,S,T),M.errorX&&y(t,l,M.errorX),M.errorY&&y(t,m,M.errorY),M.fill&&!R.fill2d&&(R.fill2d=!0),M.marker&&!R.scatter2d&&(R.scatter2d=!0),M.line&&!R.line2d&&(R.line2d=!0),!M.errorX&&!M.errorY||R.error2d||(R.error2d=!0),M.text&&!R.glText&&(R.glText=!0),M.marker&&(M.marker.snap=v),R.lineOptions.push(M.line),R.errorXOptions.push(M.errorX),R.errorYOptions.push(M.errorY),R.fillOptions.push(M.fill),R.markerOptions.push(M.marker),R.markerSelectedOptions.push(M.markerSel),R.markerUnselectedOptions.push(M.markerUnsel),R.textOptions.push(M.text),R.textSelectedOptions.push(M.textSel),R.textUnselectedOptions.push(M.textUnsel),R.selectBatch.push([]),R.unselectBatch.push([]),B._scene=R,B.index=R.count,B.x=_,B.y=S,B.positions=k,R.count++,[{x:!1,y:!1,t:B,trace:t}]}},67072:function(e){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},84236:function(e,t,r){"use strict";var n=r(38248),i=r(20472),a=r(72160),o=r(24040),s=r(3400),l=s.isArrayOrTypedArray,A=r(43616),c=r(79811),u=r(33040).formatColor,g=r(43028),f=r(7152),h=r(80088),d=r(67072),p=r(13448).DESELECTDIM,y={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=r(10624).appendArrayPointValue;function I(e,t){var r,i=e._fullLayout,a=t._length,o=t.textfont,A=t.textposition,c=l(A)?A:[A],u=o.color,g=o.size,f=o.family,h=o.weight,d=o.style,p=o.variant,y={},I=e._context.plotGlPixelRatio,v=t.texttemplate;if(v){y.text=[];var E=i._d3locale,C=Array.isArray(v),B=C?Math.min(v.length,a):a,b=C?function(e){return v[e]}:function(){return v};for(r=0;rd.TOO_MANY_POINTS||g.hasMarkers(t)?"rect":"round";if(A&&t.connectgaps){var u=n[0],f=n[1];for(i=0;i1?A[i]:A[0]:A,d=l(c)?c.length>1?c[i]:c[0]:c,p=y[h],m=y[d],I=u?u/.8+1:0,v=-m*I-.5*m;o.offset[i]=[p*I/f,v/f]}}return o}}},80220:function(e,t,r){"use strict";var n=r(3400),i=r(24040),a=r(80088),o=r(2876),s=r(88200),l=r(43028),A=r(43980),c=r(31147),u=r(74428),g=r(66828),f=r(70840),h=r(124);e.exports=function(e,t,r,d){function p(r,i){return n.coerce(e,t,o,r,i)}var y=!!e.marker&&a.isOpenSymbol(e.marker.symbol),m=l.isBubble(e),I=A(e,t,d,p);if(I){c(e,t,d,p),p("xhoverformat"),p("yhoverformat");var v=I100},t.isDotSymbol=function(e){return"string"===typeof e?n.DOT_RE.test(e):e>200}},41272:function(e,t,r){"use strict";var n=r(24040),i=r(3400),a=r(44928);function o(e,t,r,o){var s=e.xa,l=e.ya,A=e.distance,c=e.dxy,u=e.index,g={pointNumber:u,x:t[u],y:r[u]};g.tx=i.isArrayOrTypedArray(o.text)?o.text[u]:o.text,g.htx=Array.isArray(o.hovertext)?o.hovertext[u]:o.hovertext,g.data=Array.isArray(o.customdata)?o.customdata[u]:o.customdata,g.tp=Array.isArray(o.textposition)?o.textposition[u]:o.textposition;var f=o.textfont;f&&(g.ts=i.isArrayOrTypedArray(f.size)?f.size[u]:f.size,g.tc=i.isArrayOrTypedArray(f.color)?f.color[u]:f.color,g.tf=Array.isArray(f.family)?f.family[u]:f.family,g.tw=Array.isArray(f.weight)?f.weight[u]:f.weight,g.ty=Array.isArray(f.style)?f.style[u]:f.style,g.tv=Array.isArray(f.variant)?f.variant[u]:f.variant);var h=o.marker;h&&(g.ms=i.isArrayOrTypedArray(h.size)?h.size[u]:h.size,g.mo=i.isArrayOrTypedArray(h.opacity)?h.opacity[u]:h.opacity,g.mx=i.isArrayOrTypedArray(h.symbol)?h.symbol[u]:h.symbol,g.ma=i.isArrayOrTypedArray(h.angle)?h.angle[u]:h.angle,g.mc=i.isArrayOrTypedArray(h.color)?h.color[u]:h.color);var d=h&&h.line;d&&(g.mlc=Array.isArray(d.color)?d.color[u]:d.color,g.mlw=i.isArrayOrTypedArray(d.width)?d.width[u]:d.width);var p=h&&h.gradient;p&&"none"!==p.type&&(g.mgt=Array.isArray(p.type)?p.type[u]:p.type,g.mgc=Array.isArray(p.color)?p.color[u]:p.color);var y=s.c2p(g.x,!0),m=l.c2p(g.y,!0),I=g.mrc||1,v=o.hoverlabel;v&&(g.hbg=Array.isArray(v.bgcolor)?v.bgcolor[u]:v.bgcolor,g.hbc=Array.isArray(v.bordercolor)?v.bordercolor[u]:v.bordercolor,g.hts=i.isArrayOrTypedArray(v.font.size)?v.font.size[u]:v.font.size,g.htc=Array.isArray(v.font.color)?v.font.color[u]:v.font.color,g.htf=Array.isArray(v.font.family)?v.font.family[u]:v.font.family,g.hnl=i.isArrayOrTypedArray(v.namelength)?v.namelength[u]:v.namelength);var E=o.hoverinfo;E&&(g.hi=Array.isArray(E)?E[u]:E);var C=o.hovertemplate;C&&(g.ht=Array.isArray(C)?C[u]:C);var B={};B[e.index]=g;var b=o._origX,x=o._origY,w=i.extendFlat({},e,{color:a(o,g),x0:y-I,x1:y+I,xLabelVal:b?b[u]:g.x,y0:m-I,y1:m+I,yLabelVal:x?x[u]:g.y,cd:B,distance:A,spikeDistance:c,hovertemplate:g.ht});return g.htx?w.text=g.htx:g.tx?w.text=g.tx:o.text&&(w.text=o.text),i.fillText(g,o,w),n.getComponentMethod("errorbars","hoverInfo")(g,o,w),w}e.exports={hoverPoints:function(e,t,r,n){var i,a,s,l,A,c,u,g,f,h,d=e.cd,p=d[0].t,y=d[0].trace,m=e.xa,I=e.ya,v=p.x,E=p.y,C=m.c2p(t),B=I.c2p(r),b=e.distance;if(p.tree){var x=m.p2c(C-b),w=m.p2c(C+b),Q=I.p2c(B-b),_=I.p2c(B+b);i="x"===n?p.tree.range(Math.min(x,w),Math.min(I._rl[0],I._rl[1]),Math.max(x,w),Math.max(I._rl[0],I._rl[1])):p.tree.range(Math.min(x,w),Math.min(Q,_),Math.max(x,w),Math.max(Q,_))}else i=p.ids;var S=b;if("x"===n){var k=!!y.xperiodalignment,D=!!y.yperiodalignment;for(c=0;c=Math.min(T,M)&&C<=Math.max(T,M)?0:1/0}if(u=Math.min(R,L)&&B<=Math.max(R,L)?0:1/0}h=Math.sqrt(u*u+g*g),s=i[c]}}}else for(c=i.length-1;c>-1;c--)l=v[a=i[c]],A=E[a],u=m.c2p(l)-C,g=I.c2p(A)-B,(f=Math.sqrt(u*u+g*g))m.glText.length){var B=E-m.glText.length;for(d=0;dr&&(isNaN(t[n])||isNaN(t[n+1]));)n-=2;e.positions=t.slice(r,n+2)}return e})),m.line2d.update(m.lineOptions)),m.error2d){var x=(m.errorXOptions||[]).concat(m.errorYOptions||[]);m.error2d.update(x)}m.scatter2d&&m.scatter2d.update(m.markerOptions),m.fillOrder=s.repeat(null,E),m.fill2d&&(m.fillOptions=m.fillOptions.map((function(e,t){var n=r[t];if(e&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,A=m.lineOptions[t],c=[];s._ownfill&&c.push(t),s._nexttrace&&c.push(t+1),c.length&&(m.fillOrder[t]=c);var u,g,f=[],h=A&&A.positions||l.positions;if("tozeroy"===s.fill){for(u=0;uu&&isNaN(h[g+1]);)g-=2;0!==h[u+1]&&(f=[h[u],0]),f=f.concat(h.slice(u,g+2)),0!==h[g+1]&&(f=f.concat([h[g],0]))}else if("tozerox"===s.fill){for(u=0;uu&&isNaN(h[g]);)g-=2;0!==h[u]&&(f=[0,h[u+1]]),f=f.concat(h.slice(u,g+2)),0!==h[g]&&(f=f.concat([0,h[g+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(f=[],i=0,e.splitNull=!0,a=0;a-1;for(d=0;d")}function c(e){return e+"\xb0"}}e.exports={hoverPoints:function(e,t,r){var o=e.cd,c=o[0].trace,u=e.xa,g=e.ya,f=e.subplot,h=[],d=l+c.uid+"-circle",p=c.cluster&&c.cluster.enabled;if(p){var y=f.map.queryRenderedFeatures(null,{layers:[d]});h=y.map((function(e){return e.id}))}var m=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),I=t-m;if(n.getClosest(o,(function(e){var t=e.lonlat;if(t[0]===s)return 1/0;if(p&&-1===h.indexOf(e.i+1))return 1/0;var n=i.modHalf(t[0],360),a=t[1],o=f.project([n,a]),l=o.x-u.c2p([I,a]),A=o.y-g.c2p([n,r]),c=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+A*A)-c,1-3/c)}),e),!1!==e.index){var v=o[e.index],E=v.lonlat,C=[i.modHalf(E[0],360)+m,E[1]],B=u.c2p(C),b=g.c2p(C),x=v.mrc||1;e.x0=B-x,e.x1=B+x,e.y0=b-x,e.y1=b+x;var w={};w[c.subplot]={_subplot:f};var Q=c._module.formatLabels(v,c,w);return e.lonLabel=Q.lonLabel,e.latLabel=Q.latLabel,e.color=a(c,v),e.extraText=A(c,v,o[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}},getExtraText:A}},11572:function(e,t,r){"use strict";e.exports={attributes:r(31512),supplyDefaults:r(15752),colorbar:r(5528),formatLabels:r(11960),calc:r(25212),plot:r(9660),hoverPoints:r(63312).hoverPoints,eventData:r(37920),selectPoints:r(404),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:"trace",name:"scattermapbox",basePlotModule:r(33688),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},9660:function(e,t,r){"use strict";var n=r(3400),i=r(59392),a=r(47552).traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(e,t,r,n){this.type="scattermapbox",this.subplot=e,this.uid=t,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+t+"-fill",line:"source-"+t+"-line",circle:"source-"+t+"-circle",symbol:"source-"+t+"-symbol",cluster:"source-"+t+"-circle",clusterCount:"source-"+t+"-circle"},this.layerIds={fill:a+t+"-fill",line:a+t+"-line",circle:a+t+"-circle",symbol:a+t+"-symbol",cluster:a+t+"-cluster",clusterCount:a+t+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(e,t,r){var i={type:"geojson",data:t.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[e]);a?a.setData(t.geojson):this.subplot.map.addSource(this.sourceIds[e],i)},l.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)},l.addLayer=function(e,t,r){var n={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(n.filter=t.filter);for(var i,a=this.layerIds[e],o=this.subplot.getMapLayers(),s=0;s=0;r--){var i=t[r];n.removeLayer(c.layerIds[i])}e||n.removeSource(c.sourceIds.circle)}(e):function(e){for(var t=o.nonCluster,r=t.length-1;r>=0;r--){var i=t[r];n.removeLayer(c.layerIds[i]),e||n.removeSource(c.sourceIds[i])}}(e)}function g(e){l?function(e){e||c.addSource("circle",a.circle,t.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},e.exports=function(e,t){var r,n,a,l=t[0].trace,A=l.cluster&&l.cluster.enabled,c=!0!==l.visible,u=new s(e,l.uid,A,c),g=i(e.gd,t),f=u.below=e.belowLookup["trace-"+l.uid];if(A)for(u.addSource("circle",g.circle,l.cluster),r=0;r")}}e.exports={hoverPoints:function(e,t,r,a){var o=n(e,t,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,A=s.cd[s.index],c=s.trace;if(l.isPtInside(A))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(A,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},76924:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:r(40872),categories:["polar","symbols","showLegend","scatter-like"],attributes:r(8319),supplyDefaults:r(85968).supplyDefaults,colorbar:r(5528),formatLabels:r(22852),calc:r(58320),plot:r(43456),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(8504).hoverPoints,selectPoints:r(91560),meta:{}}},43456:function(e,t,r){"use strict";var n=r(96504),i=r(39032).BADNUM;e.exports=function(e,t,r){for(var a=t.layers.frontplot.select("g.scatterlayer"),o=t.xaxis,s=t.yaxis,l={xaxis:o,yaxis:s,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},A=t.radialAxis,c=t.angularAxis,u=0;u=A&&(m.marker.cluster=h.tree),m.marker&&(m.markerSel.positions=m.markerUnsel.positions=m.marker.positions=E),m.line&&E.length>1&&l.extendFlat(m.line,s.linePositions(e,f,E)),m.text&&(l.extendFlat(m.text,{positions:E},s.textPosition(e,f,m.text,m.marker)),l.extendFlat(m.textSel,{positions:E},s.textPosition(e,f,m.text,m.markerSel)),l.extendFlat(m.textUnsel,{positions:E},s.textPosition(e,f,m.text,m.markerUnsel))),m.fill&&!g.fill2d&&(g.fill2d=!0),m.marker&&!g.scatter2d&&(g.scatter2d=!0),m.line&&!g.line2d&&(g.line2d=!0),m.text&&!g.glText&&(g.glText=!0),g.lineOptions.push(m.line),g.fillOptions.push(m.fill),g.markerOptions.push(m.marker),g.markerSelectedOptions.push(m.markerSel),g.markerUnselectedOptions.push(m.markerUnsel),g.textOptions.push(m.text),g.textSelectedOptions.push(m.textSel),g.textUnselectedOptions.push(m.textUnsel),g.selectBatch.push([]),g.unselectBatch.push([]),h.x=C,h.y=B,h.rawx=C,h.rawy=B,h.r=p,h.theta=y,h.positions=E,h._scene=g,h.index=g.count,g.count++}})),a(e,t,r)}},e.exports.reglPrecompiled={}},69496:function(e,t,r){"use strict";var n=r(21776).Ks,i=r(21776).Gw,a=r(92880).extendFlat,o=r(98304),s=r(52904),l=r(45464),A=s.line;e.exports={mode:s.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:s.text,texttemplate:i({editType:"plot"},{keys:["real","imag","text"]}),hovertext:s.hovertext,line:{color:A.color,width:A.width,dash:A.dash,backoff:A.backoff,shape:a({},A.shape,{values:["linear","spline"]}),smoothing:A.smoothing,editType:"calc"},connectgaps:s.connectgaps,marker:s.marker,cliponaxis:a({},s.cliponaxis,{dflt:!1}),textposition:s.textposition,textfont:s.textfont,fill:a({},s.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o(),hoverinfo:a({},l.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:s.hoveron,hovertemplate:n(),selected:s.selected,unselected:s.unselected}},47507:function(e,t,r){"use strict";var n=r(38248),i=r(39032).BADNUM,a=r(90136),o=r(20148),s=r(4500),l=r(16356).calcMarkerSize;e.exports=function(e,t){for(var r=e._fullLayout,A=t.subplot,c=r[A].realaxis,u=r[A].imaginaryaxis,g=c.makeCalcdata(t,"real"),f=u.makeCalcdata(t,"imag"),h=t._length,d=new Array(h),p=0;p")}}e.exports={hoverPoints:function(e,t,r,a){var o=n(e,t,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,A=s.cd[s.index],c=s.trace;if(l.isPtInside(A))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(A,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},95443:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:r(47788),categories:["smith","symbols","showLegend","scatter-like"],attributes:r(69496),supplyDefaults:r(76716),colorbar:r(5528),formatLabels:r(49504),calc:r(47507),plot:r(34927),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(25292).hoverPoints,selectPoints:r(91560),meta:{}}},34927:function(e,t,r){"use strict";var n=r(96504),i=r(39032).BADNUM,a=r(36416).smith;e.exports=function(e,t,r){for(var o=t.layers.frontplot.select("g.scatterlayer"),s=t.xaxis,l=t.yaxis,A={xaxis:s,yaxis:l,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},c=0;c"),o.hovertemplate=g.hovertemplate,a}function I(e,t){y.push(e._hovertitle+": "+t)}}},34864:function(e,t,r){"use strict";e.exports={attributes:r(5896),supplyDefaults:r(84256),colorbar:r(5528),formatLabels:r(90404),calc:r(34335),plot:r(88776),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(26596),selectPoints:r(91560),eventData:r(97476),moduleType:"trace",name:"scatterternary",basePlotModule:r(19352),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},88776:function(e,t,r){"use strict";var n=r(96504);e.exports=function(e,t,r){var i=t.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=t.xaxis,o=t.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},l=t.layers.frontplot.select("g.scatterlayer"),A=0;Ag?v.sizeAvg||Math.max(v.size,3):a(t,I),f=0;fa&&l||i-1,D=!0;if(o(I)||f.selectedpoints||k){var T=f._length;if(f.selectedpoints){d.selectBatch=f.selectedpoints;var M=f.selectedpoints,R={};for(l=0;l1&&(c=d[m-1],g=p[m-1],h=y[m-1]),t=0;tc?"-":"+")+"x")).replace("y",(u>g?"-":"+")+"y")).replace("z",(f>h?"-":"+")+"z");var S=function(){m=0,w=[],Q=[],_=[]};(!m||m2?e.slice(1,t-1):2===t?[(e[0]+e[1])/2]:e}function f(e){var t=e.length;return 1===t?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function h(e,t){var r=e.fullSceneLayout,i=e.dataScale,c=t._len,u={};function h(e,t){var n=r[t],o=i[A[t]];return a.simpleMap(e,(function(e){return n.d2l(e)*o}))}if(u.vectors=l(h(t._u,"xaxis"),h(t._v,"yaxis"),h(t._w,"zaxis"),c),!c)return{positions:[],cells:[]};var d=h(t._Xs,"xaxis"),p=h(t._Ys,"yaxis"),y=h(t._Zs,"zaxis");if(u.meshgrid=[d,p,y],u.gridFill=t._gridFill,t._slen)u.startingPositions=l(h(t._startsX,"xaxis"),h(t._startsY,"yaxis"),h(t._startsZ,"zaxis"));else{for(var m=p[0],I=g(d),v=g(y),E=new Array(I.length*v.length),C=0,B=0;B=0};m?(r=Math.min(y.length,v.length),l=function(e){return w(y[e])&&Q(e)},u=function(e){return String(y[e])}):(r=Math.min(I.length,v.length),l=function(e){return w(I[e])&&Q(e)},u=function(e){return String(I[e])}),C&&(r=Math.min(r,E.length));for(var _=0;_1){for(var T=a.randstr(),M=0;M=0){t.i=s.i;var c=r.marker;c.pattern&&c.colors&&c.pattern.shape||(c.color=A,t.color=A),n.pointStyle(e,r,a,t)}else i.fill(e,A)}},45716:function(e,t,r){"use strict";var n=r(33428),i=r(24040),a=r(10624).appendArrayPointValue,o=r(93024),s=r(3400),l=r(95924),A=r(78176),c=r(69656).formatPieValue;function u(e,t,r){for(var n=e.data.data,i={curveNumber:t.index,pointNumber:n.i,data:t._input,fullData:t},o=0;o"),name:x||R("name")?m.name:void 0,color:b("hoverlabel.bgcolor")||I.color,borderColor:b("hoverlabel.bordercolor"),fontFamily:b("hoverlabel.font.family"),fontSize:b("hoverlabel.font.size"),fontColor:b("hoverlabel.font.color"),fontWeight:b("hoverlabel.font.weight"),fontStyle:b("hoverlabel.font.style"),fontVariant:b("hoverlabel.font.variant"),nameLength:b("hoverlabel.namelength"),textAlign:b("hoverlabel.align"),hovertemplate:x,hovertemplateLabels:D,eventData:l};p&&(F.x0=_-i.rInscribed*i.rpx1,F.x1=_+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),y&&(F.x=_,F.idealAlign=_<0?"left":"right");var O=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:O}),l[0].bbox=O[0],h._hasHoverLabel=!0}if(y){var P=e.select("path.surface");g.styleOne(P,i,m,r,{hovered:!0})}h._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[u(i,m,g.eventDataKeys)],event:n.event})}})),e.on("mouseout",(function(t){var i=r._fullLayout,a=r._fullData[h.index],s=n.select(this).datum();if(h._hasHoverEvent&&(t.originalEvent=n.event,r.emit("plotly_unhover",{points:[u(s,a,g.eventDataKeys)],event:n.event}),h._hasHoverEvent=!1),h._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),h._hasHoverLabel=!1),y){var l=e.select("path.surface");g.styleOne(l,s,a,r,{hovered:!1})}})),e.on("click",(function(e){var t=r._fullLayout,a=r._fullData[h.index],s=p&&(A.isHierarchyRoot(e)||A.isLeaf(e)),c=A.getPtId(e),f=A.isEntry(e)?A.findEntryWithChild(d,c):A.findEntryWithLevel(d,c),y=A.getPtId(f),m={points:[u(e,a,g.eventDataKeys)],event:n.event};s||(m.nextLevel=y);var I=l.triggerHandler(r,"plotly_"+h.type+"click",m);if(!1!==I&&t.hovermode&&(r._hoverdata=[u(e,a,g.eventDataKeys)],o.click(r,n.event)),!s&&!1!==I&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,t._tracePreGUI[a.uid],{level:a.level});var v={data:[{level:y}],traces:[h.index]},E={frame:{redraw:!1,duration:g.transitionTime},transition:{duration:g.transitionTime,easing:g.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(t._hoverlayer.node()),i.call("animate",r,v,E)}}))}},78176:function(e,t,r){"use strict";var n=r(3400),i=r(76308),a=r(93972),o=r(69656);function s(e){return e.data.data.pid}t.findEntryWithLevel=function(e,r){var n;return r&&e.eachAfter((function(e){if(t.getPtId(e)===r)return n=e.copy()})),n||e},t.findEntryWithChild=function(e,r){var n;return e.eachAfter((function(e){for(var i=e.children||[],a=0;a0)},t.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0},t.isHeader=function(e,r){return!(t.isLeaf(e)||e.depth===r._maxDepth-1)},t.getParent=function(e,r){return t.findEntryWithLevel(e,s(r))},t.listPath=function(e,r){var n=e.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return t.listPath(n,r).concat(i)},t.getPath=function(e){return t.listPath(e,"label").join("/")+"/"},t.formatValue=o.formatPieValue,t.formatPercent=function(e,t){var r=n.formatPercent(e,0);return"0%"===r&&(r=o.formatPiePercent(e,t)),r}},5621:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:r(54904),categories:[],animatable:!0,attributes:r(424),layoutAttributes:r(84920),supplyDefaults:r(25244),supplyLayoutDefaults:r(28732),calc:r(3776).calc,crossTraceCalc:r(3776).crossTraceCalc,plot:r(96488).plot,style:r(85676).style,colorbar:r(5528),meta:{}}},84920:function(e){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},28732:function(e,t,r){"use strict";var n=r(3400),i=r(84920);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("sunburstcolorway",t.colorway),r("extendsunburstcolors")}},96488:function(e,t,r){"use strict";var n=r(33428),i=r(74148),a=r(67756).qy,o=r(43616),s=r(3400),l=r(72736),A=r(82744),c=A.recordMinTextSize,u=A.clearMinTextSize,g=r(37820),f=r(69656).getRotationAngle,h=g.computeTransform,d=g.transformInsideText,p=r(85676).styleOne,y=r(60100).resizeText,m=r(45716),I=r(27328),v=r(78176);function E(e,r,A,u){var g=e._context.staticPlot,y=e._fullLayout,E=!y.uniformtext.mode&&v.hasTransition(u),B=n.select(A).selectAll("g.slice"),b=r[0],x=b.trace,w=b.hierarchy,Q=v.findEntryWithLevel(w,x.level),_=v.getMaxDepth(x),S=y._size,k=x.domain,D=S.w*(k.x[1]-k.x[0]),T=S.h*(k.y[1]-k.y[0]),M=.5*Math.min(D,T),R=b.cx=S.l+S.w*(k.x[1]+k.x[0])/2,L=b.cy=S.t+S.h*(1-k.y[0])-T/2;if(!Q)return B.remove();var N=null,F={};E&&B.each((function(e){F[v.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!N&&v.isEntry(e)&&(N=e)}));var O=function(e){return i.partition().size([2*Math.PI,e.height+1])(e)}(Q).descendants(),P=Q.height+1,G=0,U=_;b.hasMultipleRoots&&v.isHierarchyRoot(Q)&&(O=O.slice(1),P-=1,G=1,U+=1),O=O.filter((function(e){return e.y1<=U}));var z=f(x.rotation);z&&O.forEach((function(e){e.x0+=z,e.x1+=z}));var q=Math.min(P,_),H=function(e){return(e-G)/q*M},Y=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},J=function(e){return s.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,R,L)},K=function(e){return R+C(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},j=function(e){return L+C(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};(B=B.data(O,v.getPtId)).enter().append("g").classed("slice",!0),E?B.exit().transition().each((function(){var e=n.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var t=function(e){var t,r=v.getPtId(e),n=F[r],i=F[v.getPtId(Q)];if(i){var o=(e.x1>i.x1?2*Math.PI:0)+z;t=e.rpx1V?2*Math.PI:0)+z;t={x0:i,x1:i}}else t={rpx0:M,rpx1:M},s.extendFlat(t,X(e));else t={rpx0:0,rpx1:0};else t={x0:z,x1:z};return a(t,n)}(e);return function(e){return J(t(e))}})):u.attr("d",J),A.call(m,Q,e,r,{eventDataKeys:I.eventDataKeys,transitionTime:I.CLICK_TRANSITION_TIME,transitionEasing:I.CLICK_TRANSITION_EASING}).call(v.setSliceCursor,e,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:e._transitioning}),u.call(p,i,x,e);var f=s.ensureSingle(A,"g","slicetext"),C=s.ensureSingle(f,"text","",(function(e){e.attr("data-notex",1)})),B=s.ensureUniformFontSize(e,v.determineTextFont(x,i,y.font));C.text(t.formatSliceLabel(i,Q,x,r,y)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,B).call(l.convertToTspans,e);var w=o.bBox(C.node());i.transform=d(w,i,b),i.transform.targetX=K(i),i.transform.targetY=j(i);var _=function(e,t){var r=e.transform;return h(r,t),r.fontSize=B.size,c(x.type,r,y),s.getTextTransform(r)};E?C.transition().attrTween("transform",(function(e){var t=function(e){var t,r=F[v.getPtId(e)],n=e.transform;if(r)t=r;else if(t={rpx1:e.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},N)if(e.parent)if(V){var i=e.x1>V?2*Math.PI:0;t.x0=t.x1=i}else s.extendFlat(t,X(e));else t.x0=t.x1=z;else t.x0=t.x1=z;var o=a(t.transform.textPosAngle,e.transform.textPosAngle),l=a(t.rpx1,e.rpx1),A=a(t.x0,e.x0),u=a(t.x1,e.x1),g=a(t.transform.scale,n.scale),f=a(t.transform.rotate,n.rotate),h=0===n.rCenter?3:0===t.transform.rCenter?1/3:1,d=a(t.transform.rCenter,n.rCenter),p=function(e){return d(Math.pow(e,h))};return function(e){var t=l(e),r=A(e),i=u(e),a=p(e),s={pxmid:Y(t,(r+i)/2),rpx1:t,transform:{textPosAngle:o(e),rCenter:a,x:n.x,y:n.y}};return c(x.type,n,y),{transform:{targetX:K(s),targetY:j(s),scale:g(e),rotate:f(e),rCenter:a}}}}(e);return function(e){return _(t(e),w)}})):C.attr("transform",_(i,w))}))}function C(e){return t=e.rpx1,r=e.transform.textPosAngle,[t*Math.sin(r),-t*Math.cos(r)];var t,r}t.plot=function(e,t,r,i){var a,o,s=e._fullLayout,l=s._sunburstlayer,A=!r,c=!s.uniformtext.mode&&v.hasTransition(r);u("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),c?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(t){E(e,t,this,r)}))}))):(a.each((function(t){E(e,t,this,r)})),s.uniformtext.mode&&y(e,s._sunburstlayer.selectAll(".trace"),"sunburst")),A&&a.exit().remove()},t.formatSliceLabel=function(e,t,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!a&&(!o||"none"===o))return"";var l=i.separators,A=n[0],c=e.data.data,u=A.hierarchy,g=v.isHierarchyRoot(e),f=v.getParent(u,e),h=v.getValue(e);if(!a){var d,p=o.split("+"),y=function(e){return-1!==p.indexOf(e)},m=[];if(y("label")&&c.label&&m.push(c.label),c.hasOwnProperty("v")&&y("value")&&m.push(v.formatValue(c.v,l)),!g){y("current path")&&m.push(v.getPath(e.data));var I=0;y("percent parent")&&I++,y("percent entry")&&I++,y("percent root")&&I++;var E=I>1;if(I){var C,B=function(e){d=v.formatPercent(C,l),E&&(d+=" of "+e),m.push(d)};y("percent parent")&&!g&&(C=h/v.getValue(f),B("parent")),y("percent entry")&&(C=h/v.getValue(t),B("entry")),y("percent root")&&(C=h/v.getValue(u),B("root"))}}return y("text")&&(d=s.castOption(r,c.i,"text"),s.isValidTextValue(d)&&m.push(d)),m.join("
")}var b=s.castOption(r,c.i,"texttemplate");if(!b)return"";var x={};c.label&&(x.label=c.label),c.hasOwnProperty("v")&&(x.value=c.v,x.valueLabel=v.formatValue(c.v,l)),x.currentPath=v.getPath(e.data),g||(x.percentParent=h/v.getValue(f),x.percentParentLabel=v.formatPercent(x.percentParent,l),x.parent=v.getPtLabel(f)),x.percentEntry=h/v.getValue(t),x.percentEntryLabel=v.formatPercent(x.percentEntry,l),x.entry=v.getPtLabel(t),x.percentRoot=h/v.getValue(u),x.percentRootLabel=v.formatPercent(x.percentRoot,l),x.root=v.getPtLabel(u),c.hasOwnProperty("color")&&(x.color=c.color);var w=s.castOption(r,c.i,"text");return(s.isValidTextValue(w)||""===w)&&(x.text=w),x.customdata=s.castOption(r,c.i,"customdata"),s.texttemplateString(b,x,i._d3locale,x,r._meta||{})}},85676:function(e,t,r){"use strict";var n=r(33428),i=r(76308),a=r(3400),o=r(82744).resizeText,s=r(60404);function l(e,t,r,n){var o=t.data.data,l=!t.children,A=o.i,c=a.castOption(r,A,"marker.line.color")||i.defaultLine,u=a.castOption(r,A,"marker.line.width")||0;e.call(s,t,r,n).style("stroke-width",u).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");o(e,t,"sunburst"),t.each((function(t){var r=n.select(this),i=t[0].trace;r.style("opacity",i.opacity),r.selectAll("path.surface").each((function(t){n.select(this).call(l,t,i,e)}))}))},styleOne:l}},16716:function(e,t,r){"use strict";var n=r(76308),i=r(49084),a=r(29736).axisHoverFormat,o=r(21776).Ks,s=r(45464),l=r(92880).extendFlat,A=r(67824).overrideAll;function c(e){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var u=e.exports=A(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},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},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");u.x.editType=u.y.editType=u.z.editType="calc+clearAxisTypes",u.transforms=void 0},56576:function(e,t,r){"use strict";var n=r(47128);e.exports=function(e,t){t.surfacecolor?n(e,t,{vals:t.surfacecolor,containerStr:"",cLetter:"c"}):n(e,t,{vals:t.z,containerStr:"",cLetter:"c"})}},79164:function(e,t,r){"use strict";var n=r(67792).gl_surface3d,i=r(67792).ndarray,a=r(67792).ndarray_linear_interpolate.d2,o=r(70448),s=r(11240),l=r(3400).isArrayOrTypedArray,A=r(33040).parseColorScale,c=r(43080),u=r(8932).extractOpts;function g(e,t,r){this.scene=e,this.uid=r,this.surface=t,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var f=g.prototype;f.getXat=function(e,t,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[t][e]:this.data.x[e]:e;return void 0===r?i:n.d2l(i,0,r)},f.getYat=function(e,t,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[t][e]:this.data.y[t]:t;return void 0===r?i:n.d2l(i,0,r)},f.getZat=function(e,t,r,n){var i=this.data.z[t][e];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[t][e]),void 0===r?i:n.d2l(i,0,r)},f.handlePick=function(e){if(e.object===this.surface){var t=(e.data.index[0]-1)/this.dataScaleX-1,r=(e.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(t),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);e.index=[n,i],e.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],e.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=e.dataCoordinate[a];null!==o&&void 0!==o&&(e.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return l(s)&&s[i]&&void 0!==s[i][n]?e.textLabel=s[i][n]:e.textLabel=s||"",e.data.dataCoordinate=e.dataCoordinate.slice(),this.surface.highlight(e.data),this.scene.glplot.spikes.position=e.dataCoordinate,!0}};var h=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function d(e,t){if(e0){r=h[n];break}return r}function m(e,t){if(!(e<1||t<1)){for(var r=p(e),n=p(t),i=1,a=0;aE;)r--,r/=y(r),++r1?n:1},f.refineCoords=function(e){for(var t=this.dataScaleX,r=this.dataScaleY,n=e[0].shape[0],a=e[0].shape[1],o=0|Math.floor(e[0].shape[0]*t+1),s=0|Math.floor(e[0].shape[1]*r+1),l=1+n+1,A=1+a+1,c=i(new Float32Array(l*A),[l,A]),u=[1/t,0,0,0,1/r,0,0,0,1],g=0;g0&&null!==this.contourStart[e]&&null!==this.contourEnd[e]&&this.contourEnd[e]>this.contourStart[e]))for(i[e]=!0,t=this.contourStart[e];ta&&(this.minValues[t]=a),this.maxValues[t]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},55992:function(e,t,r){"use strict";var n=r(23536),i=r(92880).extendFlat,a=r(38248),o=r(38116).isTypedArray,s=r(38116).isArrayOrTypedArray;function l(e){if(s(e)){for(var t=0,r=0;r=t||A===e.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=A,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=A+1,a=0);return n}e.exports=function(e,t){var r=c(t.cells.values),o=function(e){return e.slice(t.header.values.length,e.length)},d=c(t.header.values);d.length&&!d[0].length&&(d[0]=[""],d=c(d));var p=d.concat(o(r).map((function(){return u((d[0]||[""]).length)}))),y=t.domain,m=Math.floor(e._fullLayout._size.w*(y.x[1]-y.x[0])),I=Math.floor(e._fullLayout._size.h*(y.y[1]-y.y[0])),v=t.header.values.length?p[0].map((function(){return t.header.height})):[n.emptyHeaderHeight],E=r.length?r[0].map((function(){return t.cells.height})):[],C=v.reduce(A,0),B=h(E,I-C+n.uplift),b=f(h(v,C),[]),x=f(B,b),w={},Q=t._fullInput.columnorder;s(Q)&&(Q=Array.from(Q)),Q=Q.concat(o(r.map((function(e,t){return t}))));var _=p.map((function(e,r){var n=s(t.columnwidth)?t.columnwidth[Math.min(r,t.columnwidth.length-1)]:t.columnwidth;return a(n)?Number(n):1})),S=_.reduce(A,0);_=_.map((function(e){return e/S*m}));var k=Math.max(l(t.header.line.width),l(t.cells.line.width)),D={key:t.uid+e._context.staticPlot,translateX:y.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-y.y[1]),size:e._fullLayout._size,width:m,maxLineWidth:k,height:I,columnOrder:Q,groupHeight:I,rowBlocks:x,headerRowBlocks:b,scrollY:0,cells:i({},t.cells,{values:r}),headerCells:i({},t.header,{values:p}),gdColumns:p.map((function(e){return e[0]})),gdColumnsOriginalOrder:p.map((function(e){return e[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:p.map((function(e,t){var r=w[e];return w[e]=(r||0)+1,{key:e+"__"+w[e],label:e,specIndex:t,xIndex:Q[t],xScale:g,x:void 0,calcdata:void 0,columnWidth:_[t]}}))};return D.columns.forEach((function(e){e.calcdata=D,e.x=g(e)})),D}},53056:function(e,t,r){"use strict";var n=r(92880).extendFlat;t.splitToPanels=function(e){var t=[0,0],r=n({},e,{key:"header",type:"header",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:n({},e.calcdata,{cells:e.calcdata.headerCells})});return[n({},e,{key:"cells1",type:"cells",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),n({},e,{key:"cells2",type:"cells",page:1,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),r]},t.splitToCells=function(e){var t=function(e){var t=e.rowBlocks[e.page],r=t?t.rows[0].rowIndex:0,n=t?r+t.rows.length:0;return[r,n]}(e);return(e.values||[]).slice(t[0],t[1]).map((function(r,n){return{keyWithinBlock:n+("string"===typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:t[0]+n,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:r}}))}},53212:function(e,t,r){"use strict";var n=r(3400),i=r(60520),a=r(86968).Q;e.exports=function(e,t,r,o){function s(r,a){return n.coerce(e,t,i,r,a)}a(t,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(e,t){for(var r=e.columnorder||[],n=e.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(e,t){return e-t})),o=i.map((function(e){return a.indexOf(e)})),s=o.length;s/i),l=!a||s;e.mayHaveMarkup=a&&i.match(/[<&>]/);var A,c="string"===typeof(A=i)&&A.match(n.latexCheck);e.latex=c;var u,g,f=c?"":b(e.calcdata.cells.prefix,t,r)||"",h=c?"":b(e.calcdata.cells.suffix,t,r)||"",d=c?null:b(e.calcdata.cells.format,t,r)||null,p=f+(d?o(d)(e.value):e.value)+h;if(e.wrappingNeeded=!e.wrapped&&!l&&!c&&(u=B(p)),e.cellHeightMayIncrease=s||c||e.mayHaveMarkup||(void 0===u?B(p):u),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex,e.wrappingNeeded){var y=(" "===n.wrapSplitCharacter?p.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===A.length&&(A[0]===i.length-1?A.unshift(A[0]-1):A.push(A[0]+1)),A[0]%2&&A.reverse(),t.each((function(e,t){e.page=A[t],e.scrollY=l})),t.attr("transform",(function(e){var t=N(e.rowBlocks,e.page)-e.scrollY;return u(0,t)})),e&&(D(e,r,t,A,n.prevPages,n,0),D(e,r,t,A,n.prevPages,n,1),v(r,e))}}function k(e,t,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=t.filter((function(e){return s.key===e.key})),A=r||s.scrollbarState.dragMultiplier,c=s.scrollY;s.scrollY=void 0===a?s.scrollY+A*i.event.dy:a;var u=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(w);return S(e,u,l),s.scrollY===c}}function D(e,t,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(e,t){return t===o&&n[t]!==i[t]}));E(e,t,a,r),i[o]=n[o]})))}function T(e,t,r,a){return function(){var o=i.select(t.parentNode);o.each((function(e){var t=e.fragments;o.selectAll("tspan.line").each((function(e,r){t[r].width=this.getComputedTextLength()}));var r,i,a=t[t.length-1].width,s=t.slice(0,-1),l=[],A=0,c=e.column.columnWidth-2*n.cellPad;for(e.value="";s.length;)A+(i=(r=s.shift()).width+a)>c&&(e.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],A=0),l.push(r.text),A+=i;A&&(e.value+=l.join(n.wrapSpacer)),e.wrapped=!0})),o.selectAll("tspan.line").remove(),C(o.select("."+n.cn.cellText),r,e,a),i.select(t.parentNode.parentNode).call(L)}}function M(e,t,r,a,o){return function(){if(!o.settledY){var s=i.select(t.parentNode),l=P(o),A=o.key-l.firstRowIndex,c=l.rows[A].rowHeight,g=o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*n.cellPad:c,f=Math.max(g,c);f-l.rows[A].rowHeight&&(l.rows[A].rowHeight=f,e.selectAll("."+n.cn.columnCell).call(L),S(null,e.filter(w),0),v(r,a,!0)),s.attr("transform",(function(){var e=this,t=e.parentNode.getBoundingClientRect(),r=i.select(e.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),a=e.transform.baseVal.consolidate(),s=r.top-t.top+(a?a.matrix.f:n.cellPad);return u(R(o,i.select(e.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function R(e,t){switch(e.align){case"left":default:return n.cellPad;case"right":return e.column.columnWidth-(t||0)-n.cellPad;case"center":return(e.column.columnWidth-(t||0))/2}}function L(e){e.attr("transform",(function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce((function(e,t){return e+F(t,1/0)}),0),r=F(P(e),e.key);return u(0,r+t)})).selectAll("."+n.cn.cellRect).attr("height",(function(e){return(t=P(e),r=e.key,t.rows[r-t.firstRowIndex]).rowHeight;var t,r}))}function N(e,t){for(var r=0,n=t-1;n>=0;n--)r+=O(e[n]);return r}function F(e,t){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:A.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:A.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},79516:function(e,t,r){"use strict";var n=r(7316);t.name="treemap",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},97840:function(e,t,r){"use strict";var n=r(3776);t.r=function(e,t){return n.calc(e,t)},t.q=function(e){return n._runCrossTraceCalc("treemap",e)}},32984:function(e){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},34092:function(e,t,r){"use strict";var n=r(3400),i=r(40516),a=r(76308),o=r(86968).Q,s=r(31508).handleText,l=r(78048).TEXTPAD,A=r(74174).handleMarkerDefaults,c=r(8932),u=c.hasColorscale,g=c.handleDefaults;e.exports=function(e,t,r,c){function f(r,a){return n.coerce(e,t,i,r,a)}var h=f("labels"),d=f("parents");if(h&&h.length&&d&&d.length){var p=f("values");p&&p.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),"squarify"===f("tiling.packing")&&f("tiling.squarifyratio"),f("tiling.flip"),f("tiling.pad");var y=f("text");f("texttemplate"),t.texttemplate||f("textinfo",n.isArrayOrTypedArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate");var m=f("pathbar.visible");s(e,t,c,f,"auto",{hasPathbar:m,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition");var I=-1!==t.textposition.indexOf("bottom");A(e,t,c,f),(t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis)?g(e,t,c,f,{prefix:"marker.",cLetter:"c"}):f("marker.depthfade",!(t.marker.colors||[]).length);var v=2*t.textfont.size;f("marker.pad.t",I?v/4:v),f("marker.pad.l",v/4),f("marker.pad.r",v/4),f("marker.pad.b",I?v:v/4),f("marker.cornerradius"),t._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},m&&(f("pathbar.thickness",t.pathbar.textfont.size+2*l),f("pathbar.side"),f("pathbar.edgeshape")),f("sort"),f("root.color"),o(t,c,f),t._length=null}else t.visible=!1}},95808:function(e,t,r){"use strict";var n=r(33428),i=r(78176),a=r(82744).clearMinTextSize,o=r(60100).resizeText,s=r(52960);e.exports=function(e,t,r,l,A){var c,u,g=A.type,f=A.drawDescendants,h=e._fullLayout,d=h["_"+g+"layer"],p=!r;a(g,h),(c=d.selectAll("g.trace."+g).data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(g,!0),c.order(),!h.uniformtext.mode&&i.hasTransition(r)?(l&&(u=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){u&&u()})).each("interrupt",(function(){u&&u()})).each((function(){d.selectAll("g.trace").each((function(t){s(e,t,this,r,f)}))}))):(c.each((function(t){s(e,t,this,r,f)})),h.uniformtext.mode&&o(e,d.selectAll(".trace"),g)),p&&c.exit().remove()}},27336:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(43616),o=r(72736),s=r(13832),l=r(66192).styleOne,A=r(32984),c=r(78176),u=r(45716),g=!0;e.exports=function(e,t,r,f,h){var d=h.barDifY,p=h.width,y=h.height,m=h.viewX,I=h.viewY,v=h.pathSlice,E=h.toMoveInsideSlice,C=h.strTransform,B=h.hasTransition,b=h.handleSlicesExit,x=h.makeUpdateSliceInterpolator,w=h.makeUpdateTextInterpolator,Q={},_=e._context.staticPlot,S=e._fullLayout,k=t[0],D=k.trace,T=k.hierarchy,M=p/D._entryDepth,R=c.listPath(r.data,"id"),L=s(T.copy(),[p,y],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(L=L.filter((function(e){var t=R.indexOf(e.data.id);return-1!==t&&(e.x0=M*t,e.x1=M*(t+1),e.y0=d,e.y1=d+y,e.onPathbar=!0,!0)}))).reverse(),(f=f.data(L,c.getPtId)).enter().append("g").classed("pathbar",!0),b(f,g,Q,[p,y],v),f.order();var N=f;B&&(N=N.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){s._x0=m(s.x0),s._x1=m(s.x1),s._y0=I(s.y0),s._y1=I(s.y1),s._hoverX=m(s.x1-Math.min(p,y)/2),s._hoverY=I(s.y1-y/2);var f=n.select(this),h=i.ensureSingle(f,"path","surface",(function(e){e.style("pointer-events",_?"none":"all")}));B?h.transition().attrTween("d",(function(e){var t=x(e,g,Q,[p,y]);return function(e){return v(t(e))}})):h.attr("d",v),f.call(u,r,e,t,{styleOne:l,eventDataKeys:A.eventDataKeys,transitionTime:A.CLICK_TRANSITION_TIME,transitionEasing:A.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),h.call(l,s,D,e,{hovered:!1}),s._text=(c.getPtLabel(s)||"").split("
").join(" ")||"";var d=i.ensureSingle(f,"g","slicetext"),b=i.ensureSingle(d,"text","",(function(e){e.attr("data-notex",1)})),k=i.ensureUniformFontSize(e,c.determineTextFont(D,s,S.font,{onPathbar:!0}));b.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,k).call(o.convertToTspans,e),s.textBB=a.bBox(b.node()),s.transform=E(s,{fontSize:k.size,onPathbar:!0}),s.transform.fontSize=k.size,B?b.transition().attrTween("transform",(function(e){var t=w(e,g,Q,[p,y]);return function(e){return C(t(e))}})):b.attr("transform",C(s))}))}},76477:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(43616),o=r(72736),s=r(13832),l=r(66192).styleOne,A=r(32984),c=r(78176),u=r(45716),g=r(96488).formatSliceLabel,f=!1;e.exports=function(e,t,r,h,d){var p=d.width,y=d.height,m=d.viewX,I=d.viewY,v=d.pathSlice,E=d.toMoveInsideSlice,C=d.strTransform,B=d.hasTransition,b=d.handleSlicesExit,x=d.makeUpdateSliceInterpolator,w=d.makeUpdateTextInterpolator,Q=d.prevEntry,_=e._context.staticPlot,S=e._fullLayout,k=t[0].trace,D=-1!==k.textposition.indexOf("left"),T=-1!==k.textposition.indexOf("right"),M=-1!==k.textposition.indexOf("bottom"),R=!M&&!k.marker.pad.t||M&&!k.marker.pad.b,L=s(r,[p,y],{packing:k.tiling.packing,squarifyratio:k.tiling.squarifyratio,flipX:k.tiling.flip.indexOf("x")>-1,flipY:k.tiling.flip.indexOf("y")>-1,pad:{inner:k.tiling.pad,top:k.marker.pad.t,left:k.marker.pad.l,right:k.marker.pad.r,bottom:k.marker.pad.b}}).descendants(),N=1/0,F=-1/0;L.forEach((function(e){var t=e.depth;t>=k._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(N=Math.min(N,t),F=Math.max(F,t))})),h=h.data(L,c.getPtId),k._maxVisibleLayers=isFinite(F)?F-N+1:0,h.enter().append("g").classed("slice",!0),b(h,f,{},[p,y],v),h.order();var O=null;if(B&&Q){var P=c.getPtId(Q);h.each((function(e){null===O&&c.getPtId(e)===P&&(O={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var G=function(){return O||{x0:0,x1:p,y0:0,y1:y}},U=h;return B&&(U=U.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(s){var h=c.isHeader(s,k);s._x0=m(s.x0),s._x1=m(s.x1),s._y0=I(s.y0),s._y1=I(s.y1),s._hoverX=m(s.x1-k.marker.pad.r),s._hoverY=I(M?s.y1-k.marker.pad.b/2:s.y0+k.marker.pad.t/2);var d=n.select(this),b=i.ensureSingle(d,"path","surface",(function(e){e.style("pointer-events",_?"none":"all")}));B?b.transition().attrTween("d",(function(e){var t=x(e,f,G(),[p,y]);return function(e){return v(t(e))}})):b.attr("d",v),d.call(u,r,e,t,{styleOne:l,eventDataKeys:A.eventDataKeys,transitionTime:A.CLICK_TRANSITION_TIME,transitionEasing:A.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),b.call(l,s,k,e,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h?R?"":c.getPtLabel(s)||"":g(s,r,k,t,S)||"";var Q=i.ensureSingle(d,"g","slicetext"),L=i.ensureSingle(Q,"text","",(function(e){e.attr("data-notex",1)})),N=i.ensureUniformFontSize(e,c.determineTextFont(k,s,S.font)),F=s._text||" ",O=h&&-1===F.indexOf("
");L.text(F).classed("slicetext",!0).attr("text-anchor",T?"end":D||O?"start":"middle").call(a.font,N).call(o.convertToTspans,e),s.textBB=a.bBox(L.node()),s.transform=E(s,{fontSize:N.size,isHeader:h}),s.transform.fontSize=N.size,B?L.transition().attrTween("transform",(function(e){var t=w(e,f,G(),[p,y]);return function(e){return C(t(e))}})):L.attr("transform",C(s))})),O}},83024:function(e){"use strict";e.exports=function e(t,r,n){var i;n.swapXY&&(i=t.x0,t.x0=t.y0,t.y0=i,i=t.x1,t.x1=t.y1,t.y1=i),n.flipX&&(i=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-i),n.flipY&&(i=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-i);var a=t.children;if(a)for(var o=0;o-1?k+M:-(T+M):0,L={x0:D,x1:D,y0:R,y1:R+T},N=function(e,t,r){var n=y.tiling.pad,i=function(e){return e-n<=t.x0},a=function(e){return e+n>=t.x1},o=function(e){return e-n<=t.y0},s=function(e){return e+n>=t.y1};return e.x0===t.x0&&e.x1===t.x1&&e.y0===t.y0&&e.y1===t.y1?{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1}:{x0:i(e.x0-n)?0:a(e.x0-n)?r[0]:e.x0,x1:i(e.x1+n)?0:a(e.x1+n)?r[0]:e.x1,y0:o(e.y0-n)?0:s(e.y0-n)?r[1]:e.y0,y1:o(e.y1+n)?0:s(e.y1+n)?r[1]:e.y1}},F=null,O={},P={},G=null,U=function(e,t){return t?O[g(e)]:P[g(e)]},z=function(e,t,r,n){if(t)return O[g(I)]||L;var i=P[y.level]||r;return function(e){return e.data.depth-v.data.depth=(n-=(m?te:te.r)-s)){var f=(r+n)/2;r=f,n=f}var h;oe?i<(h=a-(m?te:te.b))&&h"===ee?(l.x-=a,A.x-=a,c.x-=a,u.x-=a):"/"===ee?(c.x-=a,u.x-=a,o.x-=a/2,s.x-=a/2):"\\"===ee?(l.x-=a,A.x-=a,o.x-=a/2,s.x-=a/2):"<"===ee&&(o.x-=a,s.x-=a),$(l),$(u),$(o),$(A),$(c),$(s),"M"+Z(l.x,l.y)+"L"+Z(A.x,A.y)+"L"+Z(s.x,s.y)+"L"+Z(c.x,c.y)+"L"+Z(u.x,u.y)+"L"+Z(o.x,o.y)+"Z"},toMoveInsideSlice:se,makeUpdateSliceInterpolator:Ae,makeUpdateTextInterpolator:ce,handleSlicesExit:ue,hasTransition:x,strTransform:ge}):C.remove()}},66192:function(e,t,r){"use strict";var n=r(33428),i=r(76308),a=r(3400),o=r(78176),s=r(82744).resizeText,l=r(60404);function A(e,t,r,n,s){var A,c,u=(s||{}).hovered,g=t.data.data,f=g.i,h=g.color,d=o.isHierarchyRoot(t),p=1;if(u)A=r._hovered.marker.line.color,c=r._hovered.marker.line.width;else if(d&&h===r.root.color)p=100,A="rgba(0,0,0,0)",c=0;else if(A=a.castOption(r,f,"marker.line.color")||i.defaultLine,c=a.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!t.onPathbar){var y=r.marker.depthfade;if(y){var m,I=i.combine(i.addOpacity(r._backgroundColor,.75),h);if(!0===y){var v=o.getMaxDepth(r);m=isFinite(v)?o.isLeaf(t)?0:r._maxVisibleLayers-(t.data.depth-r._entryDepth):t.data.height+1}else m=t.data.depth-r._entryDepth,r._atRootLevel||m++;if(m>0)for(var E=0;E0){var v,E,C,B,b,x=e.xa,w=e.ya;"h"===h.orientation?(b=t,v="y",C=w,E="x",B=x):(b=r,v="x",C=x,E="y",B=w);var Q=f[e.index];if(b>=Q.span[0]&&b<=Q.span[1]){var _=i.extendFlat({},e),S=B.c2p(b,!0),k=s.getKdeValue(Q,h,b),D=s.getPositionOnKdePath(Q,h,S),T=C._offset,M=C._length;_[v+"0"]=D[0],_[v+"1"]=D[1],_[E+"0"]=_[E+"1"]=S,_[E+"Label"]=E+": "+a.hoverLabelText(B,b,h[E+"hoverformat"])+", "+f[0].t.labels.kde+" "+k.toFixed(3);for(var R=0,L=0;L")),c.color=function(e,t){var r=e[t.dir].marker,n=r.color,a=r.line.color,o=r.line.width;return i(n)?n:i(a)&&o?a:void 0}(g,p),[c]}function b(e){return n(d,e,g[h+"hoverformat"])}}},95952:function(e,t,r){"use strict";e.exports={attributes:r(65776),layoutAttributes:r(91352),supplyDefaults:r(24224).supplyDefaults,crossTraceDefaults:r(24224).crossTraceDefaults,supplyLayoutDefaults:r(59464),calc:r(73540),crossTraceCalc:r(50152),plot:r(64488),style:r(12252).style,hoverPoints:r(94196),eventData:r(53256),selectPoints:r(45784),moduleType:"trace",name:"waterfall",basePlotModule:r(57952),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},91352:function(e){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},59464:function(e,t,r){"use strict";var n=r(3400),i=r(91352);e.exports=function(e,t,r){var a=!1;function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=0;s0&&(p+=g?"M"+u[0]+","+h[1]+"V"+h[0]:"M"+u[1]+","+h[0]+"H"+u[0]),"between"!==f&&(r.isSum||s path").each((function(e){if(!e.isBlank){var t=s[e.dir].marker;n.select(this).call(a.fill,t.color).call(a.stroke,t.line.color).call(i.dashLine,t.line.dash,t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),A(r,s,e),r.selectAll(".lines").each((function(){var e=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},84224:function(e,t,r){"use strict";var n=r(54460),i=r(3400),a=r(73060),o=r(60468).W,s=r(39032).BADNUM;t.moduleType="transform",t.name="aggregate";var l=t.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},A=l.aggregations;function c(e,t,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(t,o),A=l.get(),c=function(e,t){var r=e.func,n=t.d2c,a=t.c2d;switch(r){case"count":return u;case"first":return g;case"last":return f;case"sum":return function(e,t){for(var r=0,i=0;ii&&(i=c,o=A)}}return i?a(o):s};case"rms":return function(e,t){for(var r=0,i=0,o=0;o":return function(e){return f(e)>u};case">=":return function(e){return f(e)>=u};case"[]":return function(e){var t=f(e);return t>=u[0]&&t<=u[1]};case"()":return function(e){var t=f(e);return t>u[0]&&t=u[0]&&tu[0]&&t<=u[1]};case"][":return function(e){var t=f(e);return t<=u[0]||t>=u[1]};case")(":return function(e){var t=f(e);return tu[1]};case"](":return function(e){var t=f(e);return t<=u[0]||t>u[1]};case")[":return function(e){var t=f(e);return t=u[1]};case"{}":return function(e){return-1!==u.indexOf(f(e))};case"}{":return function(e){return-1===u.indexOf(f(e))}}}(r,a.getDataToCoordFunc(e,t,s,i),g),I={},v={},E=0;h?(p=function(e){I[e.astr]=n.extendDeep([],e.get()),e.set(new Array(u))},y=function(e,t){var r=I[e.astr][t];e.get()[t]=r}):(p=function(e){I[e.astr]=n.extendDeep([],e.get()),e.set([])},y=function(e,t){var r=I[e.astr][t];e.get().push(r)}),b(p);for(var C=o(t.transforms,r),B=0;B1?"%{group} (%{trace})":"%{group}");var l=e.styles,A=o.styles=[];if(l)for(a=0;af)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,d.prototype),t}function d(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return m(e)}return p(e,t,r)}function p(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!d.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|C(e,t),n=h(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(re(e,Uint8Array)){var t=new Uint8Array(e);return v(t.buffer,t.byteOffset,t.byteLength)}return I(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(e));if(re(e,ArrayBuffer)||e&&re(e.buffer,ArrayBuffer))return v(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(re(e,SharedArrayBuffer)||e&&re(e.buffer,SharedArrayBuffer)))return v(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return d.from(n,t,r);var i=function(e){if(d.isBuffer(e)){var t=0|E(e.length),r=h(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||ne(e.length)?h(0):I(e):"Buffer"===e.type&&Array.isArray(e.data)?I(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return d.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(e))}function y(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function m(e){return y(e),h(e<0?0:0|E(e))}function I(e){for(var t=e.length<0?0:0|E(e.length),r=h(t),n=0;n=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|e}function C(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||re(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+A(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function B(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function x(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ne(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=d.from(t,n)),d.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function A(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var u=!0,g=0;gi&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,A=void 0,c=void 0,u=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(u=(31&a)<<6|63&l)>127&&(o=u);break;case 3:l=e[i+1],A=e[i+2],128===(192&l)&&128===(192&A)&&(u=(15&a)<<12|(63&l)<<6|63&A)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:l=e[i+1],A=e[i+2],c=e[i+3],128===(192&l)&&128===(192&A)&&128===(192&c)&&(u=(15&a)<<18|(63&l)<<12|(63&A)<<6|63&c)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?(d.isBuffer(a)||(a=d.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!d.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},d.byteLength=C,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},g&&(d.prototype[g]=d.prototype.inspect),d.prototype.compare=function(e,t,r,n,i){if(re(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+A(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(n,i),c=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return Q(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function L(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function G(e,t,r,n,i,a){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function U(e,t,r,n,i){V(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function z(e,t,r,n,i){V(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function q(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,4),u.write(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,8),u.write(e,t,r,n,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},d.prototype.readUint8=d.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readBigUInt64LE=ae((function(e){W(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},d.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readBigInt64LE=ae((function(e){W(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||P(e,4,this.length),u.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),u.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),u.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),u.read(this,e,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigUInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=ae((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>>=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=ae((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,n){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function V(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new J.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||Z(t,e.length-(r+1))}(n,i,a)}function W(e,t){if("number"!==typeof e)throw new J.ERR_INVALID_ARG_TYPE(t,"number",e)}function Z(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new J.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new J.ERR_BUFFER_OUT_OF_BOUNDS;throw new J.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}K("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),K("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(A(t))}),TypeError),K("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=j(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=j(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var X=/[^+/0-9A-Za-z-_]/g;function $(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function ee(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function te(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!==e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ae(e){return"undefined"===typeof BigInt?oe:e}function oe(){throw new Error("BigInt not supported")}},9216:function(e){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(e,t,r){"use strict";e.exports=function(e){var t=(e=e||{}).eye||[0,0,1],r=e.center||[0,0,0],s=e.up||[0,1,0],l=e.distanceLimits||[0,1/0],A=e.mode||"turntable",c=n(),u=i(),g=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,t,r,s),u.setDistanceLimits(l[0],l[1]),u.lookAt(0,t,r,s),g.setDistanceLimits(l[0],l[1]),g.lookAt(0,t,r,s),new o({turntable:c,orbit:u,matrix:g},A)};var n=r(7261),i=r(9977),a=r(4192);function o(e,t){this._controllerNames=Object.keys(e),this._controllerList=this._controllerNames.map((function(t){return e[t]})),this._mode=t,this._active=e[t],this._active||(this._mode="turntable",this._active=e.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}var s=o.prototype;s.flush=function(e){for(var t=this._controllerList,r=0;r0?o-4:o;for(r=0;r>16&255,A[c++]=t>>8&255,A[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,A[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,A[c++]=t>>8&255,A[c++]=255&t),A},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,A=n-i;sA?A:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3865:function(e,t,r){"use strict";var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).add(t[0].mul(e[1])),e[1].mul(t[1]))}},1318:function(e){"use strict";e.exports=function(e,t){return e[0].mul(t[1]).cmp(t[0].mul(e[1]))}},8697:function(e,t,r){"use strict";var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]),e[1].mul(t[0]))}},7842:function(e,t,r){"use strict";var n=r(6330),i=r(1533),a=r(2651),o=r(4387),s=r(869),l=r(8697);e.exports=function e(t,r){if(n(t))return r?l(t,e(r)):[t[0].clone(),t[1].clone()];var A,c,u=0;if(i(t))A=t.clone();else if("string"===typeof t)A=o(t);else{if(0===t)return[a(0),a(1)];if(t===Math.floor(t))A=a(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),u-=256;A=a(t)}}if(n(r))A.mul(r[1]),c=r[0].clone();else if(i(r))c=r.clone();else if("string"===typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),u+=256;c=a(r)}else c=a(1);return u>0?A=A.ushln(u):u<0&&(c=c.ushln(-u)),s(A,c)}},6330:function(e,t,r){"use strict";var n=r(1533);e.exports=function(e){return Array.isArray(e)&&2===e.length&&n(e[0])&&n(e[1])}},5716:function(e,t,r){"use strict";var n=r(6859);e.exports=function(e){return e.cmp(new n(0))}},1369:function(e,t,r){"use strict";var n=r(5716);e.exports=function(e){var t=e.length,r=e.words,i=0;if(1===t)i=r[0];else if(2===t)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},1533:function(e,t,r){"use strict";r(6859),e.exports=function(e){return e&&"object"===typeof e&&Boolean(e.words)}},2651:function(e,t,r){"use strict";var n=r(6859),i=r(2361);e.exports=function(e){var t=i.exponent(e);return t<52?new n(e):new n(e*Math.pow(2,52-t)).ushln(t-52)}},869:function(e,t,r){"use strict";var n=r(2651),i=r(5716);e.exports=function(e,t){var r=i(e),a=i(t);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(e=e.neg(),t=t.neg());var o=e.gcd(t);return o.cmpn(1)?[e.div(o),t.div(o)]:[e,t]}},4387:function(e,t,r){"use strict";var n=r(6859);e.exports=function(e){return new n(e)}},6504:function(e,t,r){"use strict";var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[0]),e[1].mul(t[1]))}},7721:function(e,t,r){"use strict";var n=r(5716);e.exports=function(e){return n(e[0])*n(e[1])}},5572:function(e,t,r){"use strict";var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},946:function(e,t,r){"use strict";var n=r(1369),i=r(4025);e.exports=function(e){var t=e[0],r=e[1];if(0===t.cmpn(0))return 0;var a=t.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,A=t.negative!==r.negative?-1:1;if(0===l.cmpn(0))return A*s;if(s){var c=i(s)+4;return A*(s+(g=n(l.ushln(c).divRound(r)))*Math.pow(2,-c))}var u=r.bitLength()-l.bitLength()+53,g=n(l.ushln(u).divRound(r));return u<1023?A*g*Math.pow(2,-u):A*(g*=Math.pow(2,-1023))*Math.pow(2,1023-u)}},2478:function(e){"use strict";function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},8828:function(e,t){"use strict";function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},6859:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(7790).Buffer}catch(x){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function A(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=l(e,t,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var A=1;A>>26,u=67108863&l,g=Math.min(A,t.length-1),f=Math.max(0,A-e.length+1);f<=g;f++){var h=A-f|0;c+=(o=(i=0|e.words[h])*(a=0|t.words[f])+u)/67108864|0,u=67108863&o}r.words[A]=0|u,l=0|c}return 0!==l?r.words[A]=0|l:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var A=u[e],f=g[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var d=h.modn(f).toString(e);r=(h=h.idivn(f)).isZero()?d+r:c[A-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n("undefined"!==typeof o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===t,A=new e(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),A[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,f=0|o[1],h=8191&f,d=f>>>13,p=0|o[2],y=8191&p,m=p>>>13,I=0|o[3],v=8191&I,E=I>>>13,C=0|o[4],B=8191&C,b=C>>>13,x=0|o[5],w=8191&x,Q=x>>>13,_=0|o[6],S=8191&_,k=_>>>13,D=0|o[7],T=8191&D,M=D>>>13,R=0|o[8],L=8191&R,N=R>>>13,F=0|o[9],O=8191&F,P=F>>>13,G=0|s[0],U=8191&G,z=G>>>13,q=0|s[1],H=8191&q,Y=q>>>13,J=0|s[2],K=8191&J,j=J>>>13,V=0|s[3],W=8191&V,Z=V>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],le=8191&se,Ae=se>>>13,ce=0|s[8],ue=8191&ce,ge=ce>>>13,fe=0|s[9],he=8191&fe,de=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var pe=(A+(n=Math.imul(u,U))|0)+((8191&(i=(i=Math.imul(u,z))+Math.imul(g,U)|0))<<13)|0;A=((a=Math.imul(g,z))+(i>>>13)|0)+(pe>>>26)|0,pe&=67108863,n=Math.imul(h,U),i=(i=Math.imul(h,z))+Math.imul(d,U)|0,a=Math.imul(d,z);var ye=(A+(n=n+Math.imul(u,H)|0)|0)+((8191&(i=(i=i+Math.imul(u,Y)|0)+Math.imul(g,H)|0))<<13)|0;A=((a=a+Math.imul(g,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(m,U)|0,a=Math.imul(m,z),n=n+Math.imul(h,H)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,H)|0,a=a+Math.imul(d,Y)|0;var me=(A+(n=n+Math.imul(u,K)|0)|0)+((8191&(i=(i=i+Math.imul(u,j)|0)+Math.imul(g,K)|0))<<13)|0;A=((a=a+Math.imul(g,j)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,z))+Math.imul(E,U)|0,a=Math.imul(E,z),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,Y)|0,n=n+Math.imul(h,K)|0,i=(i=i+Math.imul(h,j)|0)+Math.imul(d,K)|0,a=a+Math.imul(d,j)|0;var Ie=(A+(n=n+Math.imul(u,W)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(g,W)|0))<<13)|0;A=((a=a+Math.imul(g,Z)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,z))+Math.imul(b,U)|0,a=Math.imul(b,z),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,j)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,j)|0,n=n+Math.imul(h,W)|0,i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,W)|0,a=a+Math.imul(d,Z)|0;var ve=(A+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(g,$)|0))<<13)|0;A=((a=a+Math.imul(g,ee)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,z))+Math.imul(Q,U)|0,a=Math.imul(Q,z),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,j)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,j)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,Z)|0,n=n+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,$)|0,a=a+Math.imul(d,ee)|0;var Ee=(A+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(g,re)|0))<<13)|0;A=((a=a+Math.imul(g,ne)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,z))+Math.imul(k,U)|0,a=Math.imul(k,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(Q,H)|0,a=a+Math.imul(Q,Y)|0,n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,j)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,j)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(E,W)|0,a=a+Math.imul(E,Z)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0,n=n+Math.imul(h,re)|0,i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0,a=a+Math.imul(d,ne)|0;var Ce=(A+(n=n+Math.imul(u,ae)|0)|0)+((8191&(i=(i=i+Math.imul(u,oe)|0)+Math.imul(g,ae)|0))<<13)|0;A=((a=a+Math.imul(g,oe)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(M,U)|0,a=Math.imul(M,z),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,j)|0)+Math.imul(Q,K)|0,a=a+Math.imul(Q,j)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,Z)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ne)|0,n=n+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(d,ae)|0,a=a+Math.imul(d,oe)|0;var Be=(A+(n=n+Math.imul(u,le)|0)|0)+((8191&(i=(i=i+Math.imul(u,Ae)|0)+Math.imul(g,le)|0))<<13)|0;A=((a=a+Math.imul(g,Ae)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,z))+Math.imul(N,U)|0,a=Math.imul(N,z),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,Y)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,j)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,j)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(Q,W)|0,a=a+Math.imul(Q,Z)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0,n=n+Math.imul(h,le)|0,i=(i=i+Math.imul(h,Ae)|0)+Math.imul(d,le)|0,a=a+Math.imul(d,Ae)|0;var be=(A+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,ge)|0)+Math.imul(g,ue)|0))<<13)|0;A=((a=a+Math.imul(g,ge)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(P,U)|0,a=Math.imul(P,z),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(N,H)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,j)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,j)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,Z)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(Q,$)|0,a=a+Math.imul(Q,ee)|0,n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(v,ae)|0,i=(i=i+Math.imul(v,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(y,le)|0,i=(i=i+Math.imul(y,Ae)|0)+Math.imul(m,le)|0,a=a+Math.imul(m,Ae)|0,n=n+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ge)|0)+Math.imul(d,ue)|0,a=a+Math.imul(d,ge)|0;var xe=(A+(n=n+Math.imul(u,he)|0)|0)+((8191&(i=(i=i+Math.imul(u,de)|0)+Math.imul(g,he)|0))<<13)|0;A=((a=a+Math.imul(g,de)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(O,H),i=(i=Math.imul(O,Y))+Math.imul(P,H)|0,a=Math.imul(P,Y),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,j)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,j)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(M,W)|0,a=a+Math.imul(M,Z)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(Q,re)|0,a=a+Math.imul(Q,ne)|0,n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(v,le)|0,i=(i=i+Math.imul(v,Ae)|0)+Math.imul(E,le)|0,a=a+Math.imul(E,Ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ge)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,ge)|0;var we=(A+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;A=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,K),i=(i=Math.imul(O,j))+Math.imul(P,K)|0,a=Math.imul(P,j),n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,Z)|0)+Math.imul(N,W)|0,a=a+Math.imul(N,Z)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(Q,ae)|0,a=a+Math.imul(Q,oe)|0,n=n+Math.imul(B,le)|0,i=(i=i+Math.imul(B,Ae)|0)+Math.imul(b,le)|0,a=a+Math.imul(b,Ae)|0,n=n+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,ge)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,ge)|0;var Qe=(A+(n=n+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,de)|0)+Math.imul(m,he)|0))<<13)|0;A=((a=a+Math.imul(m,de)|0)+(i>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,n=Math.imul(O,W),i=(i=Math.imul(O,Z))+Math.imul(P,W)|0,a=Math.imul(P,Z),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(N,$)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ne)|0,n=n+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,Ae)|0)+Math.imul(Q,le)|0,a=a+Math.imul(Q,Ae)|0,n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,ge)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ge)|0;var _e=(A+(n=n+Math.imul(v,he)|0)|0)+((8191&(i=(i=i+Math.imul(v,de)|0)+Math.imul(E,he)|0))<<13)|0;A=((a=a+Math.imul(E,de)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(O,$),i=(i=Math.imul(O,ee))+Math.imul(P,$)|0,a=Math.imul(P,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,Ae)|0)+Math.imul(k,le)|0,a=a+Math.imul(k,Ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ge)|0)+Math.imul(Q,ue)|0,a=a+Math.imul(Q,ge)|0;var Se=(A+(n=n+Math.imul(B,he)|0)|0)+((8191&(i=(i=i+Math.imul(B,de)|0)+Math.imul(b,he)|0))<<13)|0;A=((a=a+Math.imul(b,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(O,re),i=(i=Math.imul(O,ne))+Math.imul(P,re)|0,a=Math.imul(P,ne),n=n+Math.imul(L,ae)|0,i=(i=i+Math.imul(L,oe)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,oe)|0,n=n+Math.imul(T,le)|0,i=(i=i+Math.imul(T,Ae)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,Ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ge)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,ge)|0;var ke=(A+(n=n+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,de)|0)+Math.imul(Q,he)|0))<<13)|0;A=((a=a+Math.imul(Q,de)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,ae),i=(i=Math.imul(O,oe))+Math.imul(P,ae)|0,a=Math.imul(P,oe),n=n+Math.imul(L,le)|0,i=(i=i+Math.imul(L,Ae)|0)+Math.imul(N,le)|0,a=a+Math.imul(N,Ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ge)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,ge)|0;var De=(A+(n=n+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,de)|0)+Math.imul(k,he)|0))<<13)|0;A=((a=a+Math.imul(k,de)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(O,le),i=(i=Math.imul(O,Ae))+Math.imul(P,le)|0,a=Math.imul(P,Ae),n=n+Math.imul(L,ue)|0,i=(i=i+Math.imul(L,ge)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,ge)|0;var Te=(A+(n=n+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,de)|0)+Math.imul(M,he)|0))<<13)|0;A=((a=a+Math.imul(M,de)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(O,ue),i=(i=Math.imul(O,ge))+Math.imul(P,ue)|0,a=Math.imul(P,ge);var Me=(A+(n=n+Math.imul(L,he)|0)|0)+((8191&(i=(i=i+Math.imul(L,de)|0)+Math.imul(N,he)|0))<<13)|0;A=((a=a+Math.imul(N,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Re=(A+(n=Math.imul(O,he))|0)+((8191&(i=(i=Math.imul(O,de))+Math.imul(P,he)|0))<<13)|0;return A=((a=Math.imul(P,de))+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,l[0]=pe,l[1]=ye,l[2]=me,l[3]=Ie,l[4]=ve,l[5]=Ee,l[6]=Ce,l[7]=Be,l[8]=be,l[9]=xe,l[10]=we,l[11]=Qe,l[12]=_e,l[13]=Se,l[14]=ke,l[15]=De,l[16]=Te,l[17]=Me,l[18]=Re,0!==A&&(l[19]=A,r.length++),r};function d(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(h=f),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):d(this,e,t),r},p.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},p.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,A=0;A=0&&(0!==c||A>=i);A--){var u=0|this.words[A];this.words[A]=c<<26-a|u>>>a,c=u&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==t){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var A=0;A=0;u--){var g=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(g=Math.min(g/o|0,67108863),n._ishlnsubmul(i,g,u);0!==n.negative;)g--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);s&&(s.words[u]=g)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),A=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++A;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var g=0,f=1;0===(t.words[0]&f)&&g<26;++g,f<<=1);if(g>0)for(t.iushrn(g);g-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(u)),i.iushrn(1),o.iushrn(1);for(var h=0,d=1;0===(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(u)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(l)):(r.isub(t),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(A)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var A=0,c=1;0===(t.words[0]&c)&&A<26;++A,c<<=1);if(A>0)for(t.iushrn(A);A-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var u=0,g=1;0===(r.words[0]&g)&&u<26;++u,g<<=1);if(u>0)for(r.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new B(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function I(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function C(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function b(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},i(I,m),I.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},I.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new I;else if("p224"===e)t=new v;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new C}return y[e]=t,t},B.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},B.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),A=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,A).cmp(l);)c.redIAdd(l);for(var u=this.pow(c,i),g=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),h=o;0!==f.cmp(s);){for(var d=f,p=0;0!==d.cmp(s);p++)d=d.redSqr();n(p=0;n--){for(var A=t.words[n],c=l-1;c>=0;c--){var u=A>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==o?(o<<=1,o|=u,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new b(e)},i(b,B),b.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},b.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},b.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},b.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},b.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6204:function(e){"use strict";e.exports=function(e){var t,r,n,i=e.length,a=0;for(t=0;t>>1;if(!(c<=0)){var u,g=i.mallocDouble(2*c*s),f=i.mallocInt32(s);if((s=l(e,c,g,f))>0){if(1===c&&n)a.init(s),u=a.sweepComplete(c,r,0,s,g,f,0,s,g,f);else{var h=i.mallocDouble(2*c*A),d=i.mallocInt32(A);(A=l(t,c,h,d))>0&&(a.init(s+A),u=1===c?a.sweepBipartite(c,r,0,s,g,f,0,A,h,d):o(c,r,n,s,g,f,A,h,d),i.free(h),i.free(d))}i.free(g),i.free(f)}return u}}}function c(e,t){n.push([e,t])}},2455:function(e,t){"use strict";function r(e){return e?function(e,t,r,n,i,a,o,s,l,A,c){return i-n>l-s?function(e,t,r,n,i,a,o,s,l,A,c){for(var u=2*e,g=n,f=u*n;gA-l?n?function(e,t,r,n,i,a,o,s,l,A,c){for(var u=2*e,g=n,f=u*n;g0;){var R=(T-=1)*v,L=C[R],N=C[R+1],F=C[R+2],O=C[R+3],P=C[R+4],G=C[R+5],U=T*E,z=B[U],q=B[U+1],H=1&G,Y=!!(16&G),J=c,K=Q,j=S,V=k;if(H&&(J=S,K=k,j=c,V=Q),!(2&G&&N>=(F=p(e,L,N,F,J,K,q)))&&!(4&G&&(N=y(e,L,N,F,J,K,z))>=F)){var W=F-N,Z=P-O;if(Y){if(e*W*(W+Z)=p0)&&!(p1>=hi)"),d=c("lo===p0"),p=c("lo>>1,g=2*e,f=u,h=s[g*u+t];A=I?(f=m,h=I):y>=E?(f=p,h=y):(f=v,h=E):I>=E?(f=m,h=I):E>=y?(f=p,h=y):(f=v,h=E);for(var C=g*(c-1),B=g*f,b=0;br&&i[u+t]>A;--c,u-=o){for(var g=u,f=u+o,h=0;hg;++g,l+=s)if(i[l+u]===o)if(c===g)c+=1,A+=s;else{for(var f=0;s>f;++f){var h=i[l+f];i[l+f]=i[A],i[A++]=h}var d=a[g];a[g]=a[c],a[c++]=d}return c},"log;++g,l+=s)if(i[l+u]f;++f){var h=i[l+f];i[l+f]=i[A],i[A++]=h}var d=a[g];a[g]=a[c],a[c++]=d}return c},"lo<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,A=l,c=r,u=e+t,g=r;n>g;++g,l+=s)if(i[l+u]<=o)if(c===g)c+=1,A+=s;else{for(var f=0;s>f;++f){var h=i[l+f];i[l+f]=i[A],i[A++]=h}var d=a[g];a[g]=a[c],a[c++]=d}return c},"hi<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,A=l,c=r,u=e+t,g=r;n>g;++g,l+=s)if(i[l+u]<=o)if(c===g)c+=1,A+=s;else{for(var f=0;s>f;++f){var h=i[l+f];i[l+f]=i[A],i[A++]=h}var d=a[g];a[g]=a[c],a[c++]=d}return c},"lof;++f,l+=s){var h=i[l+u],d=i[l+g];if(hp;++p){var y=i[l+p];i[l+p]=i[A],i[A++]=y}var m=a[f];a[f]=a[c],a[c++]=m}}return c},"lo<=p0&&p0<=hi":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,A=l,c=r,u=t,g=e+t,f=r;n>f;++f,l+=s){var h=i[l+u],d=i[l+g];if(h<=o&&o<=d)if(c===f)c+=1,A+=s;else{for(var p=0;s>p;++p){var y=i[l+p];i[l+p]=i[A],i[A++]=y}var m=a[f];a[f]=a[c],a[c++]=m}}return c},"!(lo>=p0)&&!(p1>=hi)":function(e,t,r,n,i,a,o,s){for(var l=2*e,A=l*r,c=A,u=r,g=t,f=e+t,h=r;n>h;++h,A+=l){var d=i[A+g],p=i[A+f];if(!(d>=o)&&!(s>=p))if(u===h)u+=1,c+=l;else{for(var y=0;l>y;++y){var m=i[A+y];i[A+y]=i[c],i[c++]=m}var I=a[h];a[h]=a[u],a[u++]=I}}return u}}},1811:function(e){"use strict";e.exports=function(e,n){n<=4*t?r(0,n-1,e):A(0,n-1,e)};var t=32;function r(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >e;){var A=r[l-2],c=r[l-1];if(Ar[t+1])}function l(e,t,r,n){var i=n[e*=2];return i>1,p=d-g,y=d+g,m=f,I=p,v=d,E=y,C=h,B=e+1,b=c-1,x=0;s(m,I,u)&&(x=m,m=I,I=x),s(E,C,u)&&(x=E,E=C,C=x),s(m,v,u)&&(x=m,m=v,v=x),s(I,v,u)&&(x=I,I=v,v=x),s(m,E,u)&&(x=m,m=E,E=x),s(v,E,u)&&(x=v,v=E,E=x),s(I,C,u)&&(x=I,I=C,C=x),s(I,v,u)&&(x=I,I=v,v=x),s(E,C,u)&&(x=E,E=C,C=x);for(var w=u[2*I],Q=u[2*I+1],_=u[2*E],S=u[2*E+1],k=2*m,D=2*v,T=2*C,M=2*f,R=2*d,L=2*h,N=0;N<2;++N){var F=u[k+N],O=u[D+N],P=u[T+N];u[M+N]=F,u[R+N]=O,u[L+N]=P}i(p,e,u),i(y,c,u);for(var G=B;G<=b;++G)if(l(G,w,Q,u))G!==B&&n(G,B,u),++B;else if(!l(G,_,S,u))for(;;){if(l(b,_,S,u)){l(b,w,Q,u)?(a(G,B,b,u),++B,--b):(n(G,b,u),--b);break}if(--b>>1;a(h,Q);var _=0,S=0;for(B=0;B=o)d(c,u,S--,k=k-o|0);else if(k>=0)d(l,A,_--,k);else if(k<=-o){k=-k-o|0;for(var D=0;D<_;++D)if(void 0!==(T=t(l[D],k)))return T;p(c,u,S++,k)}else{for(k=-k-1|0,D=0;D>>1;a(h,_);var S=0,k=0,D=0;for(b=0;b<_;++b){var T=0|h[2*b+1],M=1&T;if(b<_-1&&T>>1===h[2*b+3]>>1&&(M=2,b+=1),T<0){for(var R=-(T>>1)-1,L=0;L>1)-1,0===M?d(l,A,S--,R):1===M?d(c,u,k--,R):2===M&&d(g,f,D--,R)}},scanBipartite:function(e,t,r,n,i,s,c,u,g,f,y,m){var I=0,v=2*e,E=t,C=t+e,B=1,b=1;n?b=o:B=o;for(var x=i;x>>1;a(h,S);var k=0;for(x=0;x=o?(T=!n,w-=o):(T=!!n,w-=1),T)p(l,A,k++,w);else{var M=m[w],R=v*w,L=y[R+t+1],N=y[R+t+1+e];e:for(var F=0;F>>1;a(h,B);var b=0;for(I=0;I=o)l[b++]=v-o;else{var w=f[v-=1],Q=p*v,_=g[Q+t+1],S=g[Q+t+1+e];e:for(var k=0;k=0;--k)if(l[k]===v){for(R=k+1;R0;){for(var f=r.pop(),h=(c=-1,u=-1,l=o[s=r.pop()],1);h=0||(t.flip(s,f),i(e,t,r,c,s,u),i(e,t,r,s,u,c),i(e,t,r,u,f,c),i(e,t,r,f,c,u))}}},5023:function(e,t,r){"use strict";var n=r(2478);function i(e,t,r,n,i,a,o){this.cells=e,this.neighbor=t,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function a(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}e.exports=function(e,t,r){var n=function(e,t){for(var r=e.cells(),n=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var f=s.pop();if(A[f]!==-o){A[f]=o,c[f];for(var h=0;h<3;++h){var d=g[3*f+h];d>=0&&0===A[d]&&(u[3*f+h]?l.push(d):(s.push(d),A[d]=o))}}}var p=l;l=s,s=p,l.length=0,o=-o}var y=function(e,t,r){for(var n=0,i=0;i1&&i(r[g[f-2]],r[g[f-1]],a)>0;)e.push([g[f-1],g[f-2],o]),f-=1;g.length=f,g.push(o);var h=u.upperIds;for(f=h.length;f>1&&i(r[h[f-2]],r[h[f-1]],a)<0;)e.push([h[f-2],h[f-1],o]),f-=1;h.length=f,h.push(o)}}function u(e,t){var r;return(r=e.a[0]d[0]&&i.push(new s(d,h,2,A),new s(h,d,1,A))}i.sort(l);for(var p=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),y=[new o([p,1],[p,0],-1,[],[],[],[])],m=[],I=(A=0,i.length);A=0}}(),a.removeTriangle=function(e,t,r){var n=this.stars;o(n[e],t,r),o(n[t],r,e),o(n[r],e,t)},a.addTriangle=function(e,t,r){var n=this.stars;n[e].push(t,r),n[t].push(r,e),n[r].push(e,t)},a.opposite=function(e,t){for(var r=this.stars[t],n=1,i=r.length;nt[2]?1:0)}function y(e,t,r){if(0!==e.length){if(t)for(var n=0;n=0;--a){var I=t[c=(Q=n[a])[0]],v=I[0],E=I[1],C=e[v],B=e[E];if((C[0]-B[0]||C[1]-B[1])<0){var b=v;v=E,E=b}I[0]=v;var x,w=I[1]=Q[1];for(i&&(x=I[2]);a>0&&n[a-1][0]===c;){var Q,_=(Q=n[--a])[1];i?t.push([w,_,x]):t.push([w,_]),w=_}i?t.push([w,E,x]):t.push([w,E])}return g}(e,t,g,p,r),I=h(e,m);return y(t,I,r),!!I||g.length>0||p.length>0}},3637:function(e,t,r){"use strict";e.exports=function(e,t,r,n){var a=s(t,e),u=s(n,r),g=c(a,u);if(0===o(g))return null;var f=s(e,r),h=c(u,f),d=i(h,g),p=A(a,d);return l(e,p)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),A=r(8987);function c(e,t){return a(n(e[0],t[1]),n(e[1],t[0]))}},3642:function(e){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]}],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:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(e,t,r){"use strict";var n=r(3642),i=r(395);function a(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function o(e){for(var t,r="#",n=0;n<3;++n)r+=("00"+(t=(t=e[n]).toString(16))).substr(t.length);return r}function s(e){return"rgba("+e.join(",")+")"}e.exports=function(e){var t,r,l,A,c,u,g,f,h,d;if(e||(e={}),f=(e.nshades||72)-1,g=e.format||"hex",(u=e.colormap)||(u="jet"),"string"===typeof u){if(u=u.toLowerCase(),!n[u])throw Error(u+" not a supported colorscale");c=n[u]}else{if(!Array.isArray(u))throw Error("unsupported colormap option",u);c=u.slice()}if(c.length>f+1)throw new Error(u+" map requires nshades to be at least size "+c.length);h=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"===typeof e.alpha?[e.alpha,e.alpha]:[1,1],t=c.map((function(e){return Math.round(e.index*f)})),h[0]=Math.min(Math.max(h[0],0),1),h[1]=Math.min(Math.max(h[1],0),1);var p=c.map((function(e,t){var r=c[t].index,n=c[t].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=h[0]+(h[1]-h[0])*r),n})),y=[];for(d=0;d0||l(e,t,a)?-1:1:0===s?A>0||l(e,t,r)?1:-1:i(A-s)}var u=n(e,t,r);return u>0?o>0&&n(e,t,a)>0?1:-1:u<0?o>0||n(e,t,a)>0?1:-1:n(e,t,a)>0||l(e,t,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(e,t,r){var n=a(e[0],-t[0]),i=a(e[1],-t[1]),l=a(r[0],-t[0]),A=a(r[1],-t[1]),c=s(o(n,l),o(i,A));return c[c.length-1]>=0}},8572:function(e){"use strict";e.exports=function(e){return e<0?-1:e>0?1:0}},8507:function(e){e.exports=function(e,n){var i=e.length,a=e.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return e[0]-n[0];case 2:return e[0]+e[1]-n[0]-n[1]||t(e[0],e[1])-t(n[0],n[1]);case 3:var o=e[0]+e[1],s=n[0]+n[1];if(a=o+e[2]-(s+n[2]))return a;var l=t(e[0],e[1]),A=t(n[0],n[1]);return t(l,e[2])-t(A,n[2])||t(l+e[2],o)-t(A+n[2],s);case 4:var c=e[0],u=e[1],g=e[2],f=e[3],h=n[0],d=n[1],p=n[2],y=n[3];return c+u+g+f-(h+d+p+y)||t(c,u,g,f)-t(h,d,p,y,h)||t(c+u,c+g,c+f,u+g,u+f,g+f)-t(h+d,h+p,h+y,d+p,d+y,p+y)||t(c+u+g,c+u+f,c+g+f,u+g+f)-t(h+d+p,h+d+y,h+p+y,d+p+y);default:for(var m=e.slice().sort(r),I=n.slice().sort(r),v=0;ve[r][0]&&(r=n);return tr?[[r],[t]]:[[t]]}},4750:function(e,t,r){"use strict";e.exports=function(e){var t=n(e),r=t.length;if(r<=2)return[];for(var i=new Array(r),a=t[r-1],o=0;o=t[l]&&(s+=1);a[o]=s}}return e}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(e){"use strict";e.exports=function(e,t,r,n,i,a){var o=i-1,s=i*i,l=o*o,A=(1+2*i)*l,c=i*l,u=s*(3-2*i),g=s*o;if(e.length){a||(a=new Array(e.length));for(var f=e.length-1;f>=0;--f)a[f]=A*e[f]+c*t[f]+u*r[f]+g*n[f];return a}return A*e+c*t+u*r+g*n},e.exports.derivative=function(e,t,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,A=3*i*i-2*i;if(e.length){a||(a=new Array(e.length));for(var c=e.length-1;c>=0;--c)a[c]=o*e[c]+s*t[c]+l*r[c]+A*n[c];return a}return o*e+s*t+l*r[c]+A*n}},7642:function(e,t,r){"use strict";var n=r(8954),i=r(1682);function a(e,t){this.point=e,this.index=t}function o(e,t){for(var r=e.point,n=t.point,i=r.length,a=0;a=2)return!1;e[r]=n}return!0})):E.filter((function(e){for(var t=0;t<=s;++t){var r=y[e[t]];if(r<0)return!1;e[t]=r}return!0})),1&s)for(c=0;c>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<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){return!(2146435072&e.exports.hi(t))}},1338:function(e){"use strict";function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a0)return function(e,t){var r,n;for(r=new Array(e),n=0;n=r-1){g=l.length-1;var h=e-t[r-1];for(f=0;f=r-1)for(var c=s.length-1,u=(t[r-1],0);u=0;--r)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),r=this.dimension;if(!(e0;--u)n.push(a(l[u-1],A[u-1],arguments[u])),i.push(0)}},s.push=function(e){var t=this.lastT(),r=this.dimension;if(!(e1e-6?1/s:0;this._time.push(e);for(var g=r;g>0;--g){var f=a(A[g-1],c[g-1],arguments[g]);n.push(f),i.push((f-n[o++])*u)}}},s.set=function(e){var t=this.dimension;if(!(e0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(e){var t=this.lastT(),r=this.dimension;if(!(e<=t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],A=s[1],c=e-t,u=c>1e-6?1/c:0;this._time.push(e);for(var g=r;g>0;--g){var f=arguments[g];n.push(a(l[g-1],A[g-1],n[o++]+f)),i.push(f*u)}}},s.idle=function(e){var t=this.lastT();if(!(e=0;--u)n.push(a(l[u],A[u],n[o]+c*i[o])),i.push(0),o+=1}}},3840:function(e){"use strict";function t(e,t,r,n,i,a){this._color=e,this.key=t,this.value=r,this.left=n,this.right=i,this._count=a}function r(e){return new t(e._color,e.key,e.value,e.left,e.right,e._count)}function n(e,r){return new t(e,r.key,r.value,r.left,r.right,r._count)}function i(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function a(e,t){this._compare=e,this.root=t}e.exports=function(e){return new a(e||f,null)};var o=a.prototype;function s(e,t){var r;return t.left&&(r=s(e,t.left))?r:(r=e(t.key,t.value))||(t.right?s(e,t.right):void 0)}function l(e,t,r,n){if(t(e,n.key)<=0){var i;if(n.left&&(i=l(e,t,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(e,t,r,n.right)}function A(e,t,r,n,i){var a,o=r(e,i.key),s=r(t,i.key);if(o<=0){if(i.left&&(a=A(e,t,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return A(e,t,r,n,i.right)}function c(e,t){this.tree=e,this._stack=t}Object.defineProperty(o,"keys",{get:function(){var e=[];return this.forEach((function(t,r){e.push(t)})),e}}),Object.defineProperty(o,"values",{get:function(){var e=[];return this.forEach((function(t,r){e.push(r)})),e}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(e,r){for(var o=this._compare,s=this.root,l=[],A=[];s;){var c=o(e,s.key);l.push(s),A.push(c),s=c<=0?s.left:s.right}l.push(new t(0,e,r,null,null,1));for(var u=l.length-2;u>=0;--u)s=l[u],A[u]<=0?l[u]=new t(s._color,s.key,s.value,l[u+1],s.right,s._count+1):l[u]=new t(s._color,s.key,s.value,s.left,l[u+1],s._count+1);for(u=l.length-1;u>1;--u){var g=l[u-1];if(s=l[u],1===g._color||1===s._color)break;var f=l[u-2];if(f.left===g)if(g.left===s){if(!(h=f.right)||0!==h._color){f._color=0,f.left=g.right,g._color=1,g.right=f,l[u-2]=g,l[u-1]=s,i(f),i(g),u>=3&&((d=l[u-3]).left===f?d.left=g:d.right=g);break}g._color=1,f.right=n(1,h),f._color=0,u-=1}else{if(!(h=f.right)||0!==h._color){g.right=s.left,f._color=0,f.left=s.right,s._color=1,s.left=g,s.right=f,l[u-2]=s,l[u-1]=g,i(f),i(g),i(s),u>=3&&((d=l[u-3]).left===f?d.left=s:d.right=s);break}g._color=1,f.right=n(1,h),f._color=0,u-=1}else if(g.right===s){if(!(h=f.left)||0!==h._color){f._color=0,f.right=g.left,g._color=1,g.left=f,l[u-2]=g,l[u-1]=s,i(f),i(g),u>=3&&((d=l[u-3]).right===f?d.right=g:d.left=g);break}g._color=1,f.left=n(1,h),f._color=0,u-=1}else{var h;if(!(h=f.left)||0!==h._color){var d;g.left=s.right,f._color=0,f.right=s.left,s._color=1,s.right=g,s.left=f,l[u-2]=s,l[u-1]=g,i(f),i(g),i(s),u>=3&&((d=l[u-3]).right===f?d.right=s:d.left=s);break}g._color=1,f.left=n(1,h),f._color=0,u-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(e,t,r){if(this.root)switch(arguments.length){case 1:return s(e,this.root);case 2:return l(t,this._compare,e,this.root);case 3:if(this._compare(t,r)>=0)return;return A(t,r,this._compare,e,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new c(this,e)}}),Object.defineProperty(o,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new c(this,e)}}),o.at=function(e){if(e<0)return new c(this,[]);for(var t=this.root,r=[];;){if(r.push(t),t.left){if(e=t.right._count)break;t=t.right}return new c(this,[])},o.ge=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.gt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.lt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.le=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.find=function(e){for(var t=this._compare,r=this.root,n=[];r;){var i=t(e,r.key);if(n.push(r),0===i)return new c(this,n);r=i<=0?r.left:r.right}return new c(this,[])},o.remove=function(e){var t=this.find(e);return t?t.remove():this},o.get=function(e){for(var t=this._compare,r=this.root;r;){var n=t(e,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var u=c.prototype;function g(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function f(e,t){return et?1:0}Object.defineProperty(u,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(u,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),u.clone=function(){return new c(this.tree,this._stack.slice())},u.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var o=new Array(e.length),s=e[e.length-1];o[o.length-1]=new t(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=e.length-2;l>=0;--l)(s=e[l]).left===e[l+1]?o[l]=new t(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var A=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var c=o[A-1];for(o.push(new t(s._color,c.key,c.value,s.left,s.right,s._count)),o[A-1].key=s.key,o[A-1].value=s.value,l=o.length-2;l>=A;--l)s=o[l],o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);o[A-1].left=o[A]}if(0===(s=o[o.length-1])._color){var u=o[o.length-2];for(u.left===s?u.left=null:u.right===s&&(u.right=null),o.pop(),l=0;l=0;--l){if(t=e[l],0===l)return void(t._color=1);if((a=e[l-1]).left===t){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,t._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((A=e[l-2]).left===a?A.left=o:A.right=o),void(e[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((A=e[l-2]).left===a?A.left=s:A.right=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((A=e[l-2]).left===a?A.left=o:A.right=o),e[l-1]=o,e[l]=a,l+11&&((A=e[l-2]).right===a?A.right=o:A.left=o),void(e[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((A=e[l-2]).right===a?A.right=s:A.left=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var A;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((A=e[l-2]).right===a?A.right=o:A.left=o),e[l-1]=o,e[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(u,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(u,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var r=this.tree.root;return r?r._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var n=t.length-2;n>=0;--n)t[n+1]===t[n].right&&(++e,t[n].left&&(e+=t[n].left._count));return e},enumerable:!0}),u.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(u,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),u.update=function(e){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new t(i._color,i.key,e,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new t(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new t(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},u.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(u,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},3837:function(e,t,r){"use strict";e.exports=function(e,t){var r=new c(e);return r.update(t),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function A(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function c(e){this.gl=e,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.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],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","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],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=a(e)}var u=c.prototype;function g(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}u.update=function(e){function t(t,r,n){if(n in e){var i,a=e[n],o=this[n];(t?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}e=e||{};var r,a=t.bind(this,!1,Number),o=t.bind(this,!1,Boolean),l=t.bind(this,!1,String),A=t.bind(this,!0,(function(e){if(Array.isArray(e)){if(3===e.length)return[+e[0],+e[1],+e[2],1];if(4===e.length)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]})),c=!1,u=!1;if("bounds"in e)for(var g=e.bounds,f=0;f<2;++f)for(var h=0;h<3;++h)g[f][h]!==this.bounds[f][h]&&(u=!0),this.bounds[f][h]=g[f][h];if("ticks"in e)for(r=e.ticks,c=!0,this.autoTicks=!1,f=0;f<3;++f)this.tickSpacing[f]=0;else a("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in e||"tickSpacing"in e||(this.autoTicks=!0),u=!0,c=!0,this._firstInit=!1),u&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),c=!0),c){for(f=0;f<3;++f)r[f].sort((function(e,t){return e.x-t.x}));s.equal(r,this.ticks)?c=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(c=!0),l("tickFontStyle")&&(c=!0),l("tickFontWeight")&&(c=!0),l("tickFontVariant")&&(c=!0),a("tickSize"),a("tickAngle"),a("tickPad"),A("tickColor");var d=l("labels");l("labelFont")&&(d=!0),l("labelFontStyle")&&(d=!0),l("labelFontWeight")&&(d=!0),l("labelFontVariant")&&(d=!0),o("labelEnable"),a("labelSize"),a("labelPad"),A("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),A("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),A("lineTickColor"),o("gridEnable"),a("gridWidth"),A("gridColor"),o("zeroEnable"),A("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),A("backgroundColor");var p=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],y=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(d||c)&&this._text.update(this.bounds,this.labels,p,this.ticks,y):this._text=n(this.gl,this.bounds,this.labels,p,this.ticks,y),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var f=[new g,new g,new g];function h(e,t,r,n,i){for(var a=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,l=e.mirrorMinor,A=n[t],c=0;c<3;++c)if(t!==c){var u=a,g=s,f=o,h=l;A&1<0?(f[c]=-1,h[c]=0):(f[c]=0,h[c]=1)}}var d=[0,0,0],p={model:l,view:l,projection:l,_ortho:!1};u.isOpaque=function(){return!0},u.isTransparent=function(){return!1},u.drawTransparent=function(e){};var y=[0,0,0],m=[0,0,0],I=[0,0,0];u.draw=function(e){e=e||p;for(var t=this.gl,r=e.model||l,n=e.view||l,i=e.projection||l,a=this.bounds,s=e._ortho||!1,c=o(r,n,i,a,s),u=c.cubeEdges,g=c.axis,v=n[12],E=n[13],C=n[14],B=n[15],b=(s?2:1)*this.pixelRatio*(i[3]*v+i[7]*E+i[11]*C+i[15]*B)/t.drawingBufferHeight,x=0;x<3;++x)this.lastCubeProps.cubeEdges[x]=u[x],this.lastCubeProps.axis[x]=g[x];var w=f;for(x=0;x<3;++x)h(f[x],x,this.bounds,u,g);t=this.gl;var Q,_,S,k=d;for(x=0;x<3;++x)this.backgroundEnable[x]?k[x]=g[x]:k[x]=0;for(this._background.draw(r,n,i,a,k,this.backgroundColor),this._lines.bind(r,n,i,this),x=0;x<3;++x){var D=[0,0,0];g[x]>0?D[x]=a[1][x]:D[x]=a[0][x];for(var T=0;T<2;++T){var M=(x+1+T)%3,R=(x+1+(1^T))%3;this.gridEnable[M]&&this._lines.drawGrid(M,R,this.bounds,D,this.gridColor[M],this.gridWidth[M]*this.pixelRatio)}for(T=0;T<2;++T)M=(x+1+T)%3,R=(x+1+(1^T))%3,this.zeroEnable[R]&&Math.min(a[0][R],a[1][R])<=0&&Math.max(a[0][R],a[1][R])>=0&&this._lines.drawZero(M,R,this.bounds,D,this.zeroLineColor[R],this.zeroLineWidth[R]*this.pixelRatio)}for(x=0;x<3;++x){this.lineEnable[x]&&this._lines.drawAxisLine(x,this.bounds,w[x].primalOffset,this.lineColor[x],this.lineWidth[x]*this.pixelRatio),this.lineMirror[x]&&this._lines.drawAxisLine(x,this.bounds,w[x].mirrorOffset,this.lineColor[x],this.lineWidth[x]*this.pixelRatio);var L=A(y,w[x].primalMinor),N=A(m,w[x].mirrorMinor),F=this.lineTickLength;for(T=0;T<3;++T){var O=b/r[5*T];L[T]*=F[T]*O,N[T]*=F[T]*O}this.lineTickEnable[x]&&this._lines.drawAxisTicks(x,w[x].primalOffset,L,this.lineTickColor[x],this.lineTickWidth[x]*this.pixelRatio),this.lineTickMirror[x]&&this._lines.drawAxisTicks(x,w[x].mirrorOffset,N,this.lineTickColor[x],this.lineTickWidth[x]*this.pixelRatio)}function P(e){(S=[0,0,0])[e]=1}function G(e,t,r){var n=(e+1)%3,i=(e+2)%3,a=t[n],o=t[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?P(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&P(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),x=0;x<3;++x){var U=w[x].primalMinor,z=w[x].mirrorMinor,q=A(I,w[x].primalOffset);for(T=0;T<3;++T)this.lineTickEnable[x]&&(q[T]+=b*U[T]*Math.max(this.lineTickLength[T],0)/r[5*T]);var H=[0,0,0];if(H[x]=1,this.tickEnable[x]){for(-3600===this.tickAngle[x]?(this.tickAngle[x]=0,this.tickAlign[x]="auto"):this.tickAlign[x]=-1,_=1,"auto"===(Q=[this.tickAlign[x],.5,_])[0]?Q[0]=0:Q[0]=parseInt(""+Q[0]),S=[0,0,0],G(x,U,z),T=0;T<3;++T)q[T]+=b*U[T]*this.tickPad[T]/r[5*T];this._text.drawTicks(x,this.tickSize[x],this.tickAngle[x],q,this.tickColor[x],H,S,Q)}if(this.labelEnable[x]){for(_=0,S=[0,0,0],this.labels[x].length>4&&(P(x),_=1),"auto"===(Q=[this.labelAlign[x],.5,_])[0]?Q[0]=0:Q[0]=parseInt(""+Q[0]),T=0;T<3;++T)q[T]+=b*U[T]*this.labelPad[T]/r[5*T];q[x]+=.5*(a[0][x]+a[1][x]),this._text.drawLabel(x,this.labelSize[x],this.labelAngle[x],q,this.labelColor[x],[0,0,0],S,Q)}}this._text.unbind()},u.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(e,t,r){"use strict";e.exports=function(e){for(var t=[],r=[],s=0,l=0;l<3;++l)for(var A=(l+1)%3,c=(l+2)%3,u=[0,0,0],g=[0,0,0],f=-1;f<=1;f+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),u[l]=f,g[l]=f;for(var h=-1;h<=1;h+=2){u[A]=h;for(var d=-1;d<=1;d+=2)u[c]=d,t.push(u[0],u[1],u[2],g[0],g[1],g[2]),s+=1}var p=A;A=c,c=p}var y=n(e,new Float32Array(t)),m=n(e,new Uint16Array(r),e.ELEMENT_ARRAY_BUFFER),I=i(e,[{buffer:y,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:e.FLOAT,size:3,offset:12,stride:24}],m),v=a(e);return v.attributes.position.location=0,v.attributes.normal.location=1,new o(e,y,I,v)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(e,t,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(e,t,r){"use strict";e.exports=function(e,t,r,a,f){i(s,t,e),i(s,r,s);for(var m=0,I=0;I<2;++I){c[2]=a[I][2];for(var v=0;v<2;++v){c[1]=a[v][1];for(var E=0;E<2;++E)c[0]=a[E][0],g(l[m],c,s),m+=1}}var C=-1;for(I=0;I<8;++I){for(var B=l[I][3],b=0;b<3;++b)A[I][b]=l[I][b]/B;f&&(A[I][2]*=-1),B<0&&(C<0||A[I][2]_&&(C|=1<_&&(C|=1<A[I][1])&&(N=I);var F=-1;for(I=0;I<3;++I)(P=N^1<A[O][0]&&(O=P))}var G=d;G[0]=G[1]=G[2]=0,G[n.log2(F^N)]=N&F,G[n.log2(N^O)]=N&O;var U=7^O;U===C||U===L?(U=7^F,G[n.log2(O^U)]=U&O):G[n.log2(F^U)]=U&F;var z=p,q=C;for(x=0;x<3;++x)z[x]=q&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);t.Q=function(e){return i(e,s,l,null,[{name:"position",type:"vec3"}])};var A=n(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp 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}"]);t.bg=function(e){return i(e,A,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){"use strict";e.exports=function(e,t,r,n,o,l){var A=i(e),u=a(e,[{buffer:A,size:3}]),g=s(e);g.attributes.position.location=0;var f=new c(e,g,A,u);return f.update(t,r,n,o,l),f};var i=r(2762),a=r(8116),o=r(4359),s=r(1879).Q,l=window||n.global||{},A=l.__TEXT_CACHE||{};function c(e,t,r,n){this.gl=e,this.shader=t,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}l.__TEXT_CACHE={};var u=c.prototype,g=[0,0];u.bind=function(e,t,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=e,i.view=t,i.projection=r,i.pixelScale=n,g[0]=this.gl.drawingBufferWidth,g[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=g},u.unbind=function(){this.vao.unbind()},u.update=function(e,t,r,n,i){var a=[];function s(e,t,r,n,i,s){var l=[r.style,r.weight,r.variant,r.family].join("_"),c=A[l];c||(c=A[l]={});var u=c[t];u||(u=c[t]=function(e,t){try{return o(e,t)}catch(r){return console.warn('error vectorizing text:"'+e+'" error:',r),{cells:[],positions:[]}}}(t,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var g=(n||12)/12,f=u.positions,h=u.cells,d=0,p=h.length;d=0;--m){var I=f[y[m]];a.push(g*I[0],-g*I[1],e)}}for(var l=[0,0,0],c=[0,0,0],u=[0,0,0],g=[0,0,0],f={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},h=0;h<3;++h){u[h]=a.length/3|0,s(.5*(e[0][h]+e[1][h]),t[h],r[h],12,1.25,f),g[h]=(a.length/3|0)-u[h],l[h]=a.length/3|0;for(var d=0;d=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(e*t*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,A=o%a;o<0?(l=0|-Math.ceil(l),A=0|-A):(l=0|Math.floor(l),A|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var u=""+A;u.length=e[0][i];--o)a.push({x:o*t[i],text:r(t[i],o)});n.push(a)}return n},t.equal=function(e,t){for(var r=0;r<3;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return e.bufferSubData(t,a,i),r}function c(e,t){for(var r=n.malloc(e.length,t),i=e.length,a=0;a=0;--n){if(t[n]!==r)return!1;r*=e[n]}return!0}(e.shape,e.stride))0===e.offset&&e.data.length===e.shape[0]?this.length=A(this.gl,this.type,this.length,this.usage,e.data,t):this.length=A(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var s=n.malloc(e.size,r),l=a(s,e.shape);i.assign(l,e),this.length=A(this.gl,this.type,this.length,this.usage,t<0?s:s.subarray(0,e.size),t),n.free(s)}}else if(Array.isArray(e)){var u;u=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(e,"uint16"):c(e,"float32"),this.length=A(this.gl,this.type,this.length,this.usage,t<0?u:u.subarray(0,e.length),t),n.free(u)}else if("object"===typeof e&&"number"===typeof e.length)this.length=A(this.gl,this.type,this.length,this.usage,e,t);else{if("number"!==typeof e&&void 0!==e)throw new Error("gl-buffer: Invalid data type");if(t>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(e|=0)<=0&&(e=1),this.gl.bufferData(this.type,0|e,this.usage),this.length=e}},e.exports=function(e,t,r,n){if(r=r||e.ARRAY_BUFFER,n=n||e.DYNAMIC_DRAW,r!==e.ARRAY_BUFFER&&r!==e.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(n!==e.DYNAMIC_DRAW&&n!==e.STATIC_DRAW&&n!==e.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 i=e.createBuffer(),a=new s(e,r,i,0,n);return a.update(t),a}},6405:function(e,t,r){"use strict";var n=r(2931);e.exports=function(e,t){var r=e.positions,i=e.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(0===e.positions.length)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,A=1/0,c=-1/0,u=1/0,g=-1/0,f=null,h=null,d=[],p=1/0,y=!1,m="raw"===e.coneSizemode,I=0;Io&&(o=n.length(E)),I&&!m){var C=2*n.distance(f,v)/(n.length(h)+n.length(E));C?(p=Math.min(p,C),y=!1):y=!0}y||(f=v,h=E),d.push(E)}var B=[s,A,u],b=[l,c,g];t&&(t[0]=B,t[1]=b),0===o&&(o=1);var x=1/o;isFinite(p)||(p=1),a.vectorScale=p;var w=e.coneSize||(m?1:.5);e.absoluteConeSize&&(w=e.absoluteConeSize*x),a.coneScale=w,I=0;for(var Q=0;I=1},f.isTransparent=function(){return this.opacity<1},f.pickSlots=1,f.setPickBase=function(e){this.pickId=e},f.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"lightPosition"in e&&(this.lightPosition=e.lightPosition),"opacity"in e&&(this.opacity=e.opacity),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),void 0!==e.tubeScale&&(this.tubeScale=e.tubeScale),void 0!==e.vectorScale&&(this.vectorScale=e.vectorScale),void 0!==e.coneScale&&(this.coneScale=e.coneScale),void 0!==e.coneOffset&&(this.coneOffset=e.coneOffset),e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e){for(var t=c({colormap:e,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=t[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return A(r,[256,256,4],[4,0,1])}(e.colormap)),this.texture.generateMipmap());var r=e.cells,n=e.positions,i=e.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],u=[];this.cells=r,this.positions=n,this.vectors=i;var g=e.meshColor||[1,1,1,1],f=e.vertexIntensity,h=1/0,d=-1/0;if(f)if(e.vertexIntensityBounds)h=+e.vertexIntensityBounds[0],d=+e.vertexIntensityBounds[1];else for(var p=0;p0){var d=this.triShader;d.bind(),d.uniforms=A,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},f.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||u,n=e.view||u,i=e.projection||u,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},f.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=t),i},f.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(e,t,r){var s=r.shaders;1===arguments.length&&(e=(t=e).gl);var l=function(e,t){var r=n(e,t.meshShader.vertex,t.meshShader.fragment,null,t.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(e,s),c=function(e,t){var r=n(e,t.pickShader.vertex,t.pickShader.fragment,null,t.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(e,s),u=o(e,A(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=e.LINEAR_MIPMAP_LINEAR,u.magFilter=e.LINEAR;var f=i(e),h=i(e),d=i(e),p=i(e),y=i(e),m=new g(e,u,l,c,f,h,y,d,p,a(e,[{buffer:f,type:e.FLOAT,size:4},{buffer:y,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:d,type:e.FLOAT,size:4},{buffer:p,type:e.FLOAT,size:2},{buffer:h,type:e.FLOAT,size:4}]),r.traceType||"cone");return m.update(t),m}},614:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(e){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"}},5171:function(e,t,r){var n=r(737);e.exports=function(e){return n[e]}},9165:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl,r=n(t),o=i(t,[{buffer:r,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:t.FLOAT,size:3,offset:28,stride:40}]),l=a(t);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var A=new s(t,r,o,l);return A.update(e),A};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.shader=n,this.buffer=t,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,this.hasAlpha=!1}var l=s.prototype;function A(e,t){for(var r=0;r<3;++r)e[0][r]=Math.min(e[0][r],t[r]),e[1][r]=Math.max(e[1][r],t[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(e){var t=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=e.view||o,i=r.projection=e.projection||o;r.model=e.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],A=n[15],c=(e._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*A)/t.drawingBufferHeight;this.vao.bind();for(var u=0;u<3;++u)t.lineWidth(this.lineWidth[u]*this.pixelRatio),r.capSize=this.capSize[u]*c,this.lineCount[u]&&t.drawArrays(t.LINES,this.lineOffset[u],this.lineCount[u]);this.vao.unbind()};var c=function(){for(var e=new Array(3),t=0;t<3;++t){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+t)%3]=i,r.push(a)}e[t]=r}return e}();function u(e,t,r,n){for(var i=c[n],a=0;a0&&((f=c.slice())[s]+=h[1][s],i.push(c[0],c[1],c[2],d[0],d[1],d[2],d[3],0,0,0,f[0],f[1],f[2],d[0],d[1],d[2],d[3],0,0,0),A(this.bounds,f),o+=2+u(i,f,d,s))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(e,t,r){"use strict";var n=r(3236),i=r(9405),a=n(["precision highp 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=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){"use strict";var n=r(7766);e.exports=function(e,t,r,n){i||(i=e.FRAMEBUFFER_UNSUPPORTED,a=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var A=e.getExtension("WEBGL_draw_buffers");if(!l&&A&&function(e,t){var r=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;ac||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var u=1;if("color"in(n=n||{})){if((u=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(u>1){if(!A)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(u>e.getParameter(A.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+u+" draw buffers")}}var g=e.UNSIGNED_BYTE,f=e.getExtension("OES_texture_float");if(n.float&&u>0){if(!f)throw new Error("gl-fbo: Context does not support floating point textures");g=e.FLOAT}else n.preferFloat&&u>0&&f&&(g=e.FLOAT);var d=!0;"depth"in n&&(d=!!n.depth);var p=!1;return"stencil"in n&&(p=!!n.stencil),new h(e,t,r,g,u,d,p,A)};var i,a,o,s,l=null;function A(e){return[e.getParameter(e.FRAMEBUFFER_BINDING),e.getParameter(e.RENDERBUFFER_BINDING),e.getParameter(e.TEXTURE_BINDING_2D)]}function c(e,t){e.bindFramebuffer(e.FRAMEBUFFER,t[0]),e.bindRenderbuffer(e.RENDERBUFFER,t[1]),e.bindTexture(e.TEXTURE_2D,t[2])}function u(e){switch(e){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function g(e,t,r,i,a,o){if(!i)return null;var s=n(e,t,r,a,i);return s.magFilter=e.NEAREST,s.minFilter=e.NEAREST,s.mipSamples=1,s.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,o,e.TEXTURE_2D,s.handle,0),s}function f(e,t,r,n,i){var a=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,a),e.renderbufferStorage(e.RENDERBUFFER,n,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,a),a}function h(e,t,r,n,i,a,o,s){this.gl=e,this._shape=[0|t,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var h=0;h1&&s.drawBuffersWEBGL(l[o]);var m=r.getExtension("WEBGL_depth_texture");m?h?e.depth=g(r,i,a,m.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):d&&(e.depth=g(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):d&&h?e._depth_rb=f(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):d?e._depth_rb=f(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):h&&(e._depth_rb=f(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var I=r.checkFramebufferStatus(r.FRAMEBUFFER);if(I!==r.FRAMEBUFFER_COMPLETE){for(e._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(e.handle),e.handle=null,e.depth&&(e.depth.dispose(),e.depth=null),e._depth_rb&&(r.deleteRenderbuffer(e._depth_rb),e._depth_rb=null),y=0;yi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");e._shape[0]=t,e._shape[1]=r;for(var a=A(n),o=0;o>8*f&255;this.pickOffset=r,i.bind();var h=i.uniforms;h.viewTransform=e,h.pickOffset=t,h.shape=this.shape;var d=i.attributes;return this.positionBuffer.bind(),d.position.pointer(),this.weightBuffer.bind(),d.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),d.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),c.pick=function(e,t,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},c.update=function(e){var t=(e=e||{}).shape||[0,0],r=e.x||i(t[0]),o=e.y||i(t[1]),s=e.z||new Float32Array(t[0]*t[1]),l=!1!==e.zsmooth;this.xData=r,this.yData=o;var A,c,g,f,h=e.colorLevels||[0],d=e.colorValues||[0,0,0,1],p=h.length,y=this.bounds;l?(A=y[0]=r[0],c=y[1]=o[0],g=y[2]=r[r.length-1],f=y[3]=o[o.length-1]):(A=y[0]=r[0]+(r[1]-r[0])/2,c=y[1]=o[0]+(o[1]-o[0])/2,g=y[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,f=y[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var m=1/(g-A),I=1/(f-c),v=t[0],E=t[1];this.shape=[v,E];var C=(l?(v-1)*(E-1):v*E)*(u.length>>>1);this.numVertices=C;for(var B=a.mallocUint8(4*C),b=a.mallocFloat32(2*C),x=a.mallocUint8(2*C),w=a.mallocUint32(C),Q=0,_=l?v-1:v,S=l?E-1:E,k=0;k max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\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"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n 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 vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n 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 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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(e){return i(e,a,o,null,l)},t.createPickShader=function(e){return i(e,a,s,null,l)}},5714:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl||e.scene&&e.scene.gl,r=u(t);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 o=g(t);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(t),l=i(t,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=A(new Array(1024),[256,1,4]),f=0;f<1024;++f)c.data[f]=255;var h=a(t,c);h.wrap=t.REPEAT;var d=new y(t,r,o,s,l,h);return d.update(e),d};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),A=r(9618),c=r(7319),u=c.createShader,g=c.createPickShader,f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(e,t){for(var r=0,n=0;n<3;++n){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)}function d(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)t[0][r]=Math.max(e[0][r],t[0][r]),t[1][r]=Math.min(e[1][r],t[1][r]);return t}function p(e,t,r,n){this.arcLength=e,this.position=t,this.index=r,this.dataCoordinate=n}function y(e,t,r,n,i,a){this.gl=e,this.shader=t,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var m=y.prototype;m.isTransparent=function(){return this.hasAlpha},m.isOpaque=function(){return!this.hasAlpha},m.pickSlots=1,m.setPickBase=function(e){this.pickId=e},m.drawTransparent=m.draw=function(e){if(this.vertexCount){var t=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:e.model||f,view:e.view||f,projection:e.projection||f,clipBounds:d(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.drawPick=function(e){if(this.vertexCount){var t=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:e.model||f,view:e.view||f,projection:e.projection||f,pickId:this.pickId,clipBounds:d(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.update=function(e){var t,r;this.dirty=!0;var n=!!e.connectGaps;"dashScale"in e&&(this.dashScale=e.dashScale),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,c=0,u=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=e.position||e.positions;if(g){var f=e.color||e.colors||[0,0,0,1],d=e.lineWidth||1,p=!1;e:for(t=1;t0){for(var C=0;C<24;++C)i.push(i[i.length-12]);c+=2,p=!0}continue e}u[0][r]=Math.min(u[0][r],v[r],E[r]),u[1][r]=Math.max(u[1][r],v[r],E[r])}Array.isArray(f[0])?(y=f.length>t-1?f[t-1]:f.length>0?f[f.length-1]:[0,0,0,1],m=f.length>t?f[t]:f.length>0?f[f.length-1]:[0,0,0,1]):y=m=f,3===y.length&&(y=[y[0],y[1],y[2],1]),3===m.length&&(m=[m[0],m[1],m[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),I=Array.isArray(d)?d.length>t-1?d[t-1]:d.length>0?d[d.length-1]:[0,0,0,1]:d;var B=s;if(s+=h(v,E),p){for(r=0;r<2;++r)i.push(v[0],v[1],v[2],E[0],E[1],E[2],B,I,y[0],y[1],y[2],y[3]);c+=2,p=!1}i.push(v[0],v[1],v[2],E[0],E[1],E[2],B,I,y[0],y[1],y[2],y[3],v[0],v[1],v[2],E[0],E[1],E[2],B,-I,y[0],y[1],y[2],y[3],E[0],E[1],E[2],v[0],v[1],v[2],s,-I,m[0],m[1],m[2],m[3],E[0],E[1],E[2],v[0],v[1],v[2],s,I,m[0],m[1],m[2],m[3]),c+=4}}if(this.buffer.update(i),a.push(s),o.push(g[g.length-1].slice()),this.bounds=u,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in e){var b=e.dashes.slice();for(b.unshift(0),t=1;t1.0001)return null;y+=p[u]}return Math.abs(y-1)>.001?null:[g,s(e,p),p]}},840:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]),o=n(["precision highp 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}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,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}"]),A=n(["precision highp 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}"]),c=n(["precision highp 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}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),g=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]),f=n(["precision highp 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}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:l,fragment:A,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:c,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:g,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:f,fragment:h,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){"use strict";var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),A=r(7608),c=r(9618),u=r(6729),g=r(7765),f=r(1888),h=r(840),d=r(7626),p=h.meshShader,y=h.wireShader,m=h.pointShader,I=h.pickShader,v=h.pointPickShader,E=h.contourShader,C=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function B(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,B,b,x,w,Q){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=g,this.triangleUVs=u,this.triangleIds=A,this.triangleVAO=f,this.triangleCount=0,this.lineWidth=1,this.edgePositions=h,this.edgeColors=p,this.edgeUVs=y,this.edgeIds=d,this.edgeVAO=m,this.edgeCount=0,this.pointPositions=I,this.pointColors=E,this.pointUVs=B,this.pointSizes=b,this.pointIds=v,this.pointVAO=x,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=w,this.contourVAO=Q,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!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.hasAlpha=!1,this.opacityscale=!1,this._model=C,this._view=C,this._projection=C,this._resolution=[1,1]}var b=B.prototype;function x(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}function w(e){var t=n(e,m.vertex,m.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.pointSize.location=4,t}function Q(e){var t=n(e,I.vertex,I.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t}function _(e){var t=n(e,v.vertex,v.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t.attributes.pointSize.location=4,t}function S(e){var t=n(e,E.vertex,E.fragment);return t.attributes.position.location=0,t}b.isOpaque=function(){return!this.hasAlpha},b.isTransparent=function(){return this.hasAlpha},b.pickSlots=1,b.setPickBase=function(e){this.pickId=e},b.highlight=function(e){if(e&&this.contourEnable){for(var t=g(this.cells,this.intensity,e.intensity),r=t.cells,n=t.vertexIds,i=t.vertexWeights,a=r.length,o=f.mallocFloat32(6*a),s=0,l=0;l0&&((u=this.triShader).bind(),u.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((u=this.lineShader).bind(),u.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((u=this.pointShader).bind(),u.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((u=this.contourShader).bind(),u.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind())},b.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||C,n=e.view||C,i=e.projection||C,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind())},b.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;for(var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions,i=new Array(r.length),a=0;al[b]&&(a.uniforms.dataAxis=e,a.uniforms.screenOffset=t,a.uniforms.color=p[n],a.uniforms.angle=y[n],A.drawArrays(A.TRIANGLES,l[b],l[x]-l[b]))),m[n]&&B&&(t[1^n]-=w*f*I[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=t,a.uniforms.color=v[n],a.uniforms.angle=E[n],A.drawArrays(A.TRIANGLES,C,B)),t[1^n]=w*c[2+(1^n)]-1,h[n+2]&&(t[1^n]+=w*f*d[n+2],bl[b]&&(a.uniforms.dataAxis=e,a.uniforms.screenOffset=t,a.uniforms.color=p[n+2],a.uniforms.angle=y[n+2],A.drawArrays(A.TRIANGLES,l[b],l[x]-l[b]))),m[n+2]&&B&&(t[1^n]+=w*f*I[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=t,a.uniforms.color=v[n+2],a.uniforms.angle=E[n+2],A.drawArrays(A.TRIANGLES,C,B))}}(),A.drawTitle=function(){var e=[0,0],t=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,A=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)t[c]=2*(o[c]*A-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=e,n.uniforms.screenOffset=t,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),A.bind=function(){var e=[0,0],t=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var A=0;A<2;++A){var c=a[A],u=a[A+2]-c,g=.5*(o[A+2]+o[A]),f=o[A+2]-o[A],h=l[A],d=l[A+2]-h,p=s[A],y=s[A+2]-p;t[A]=2*u/f*d/y,e[A]=2*(c-g)/f*d/y}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=t,i.uniforms.dataShift=e,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),A.update=function(e){var t,r,n,i,o,s=[],l=e.ticks,A=e.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],u=[-1/0],g=l[o];for(t=0;t=0){var d=t[h]-n[h]*(t[h+2]-t[h])/(n[h+2]-n[h]);0===h?o.drawLine(d,t[1],d,t[3],f[h],g[h]):o.drawLine(t[0],d,t[2],d,f[h],g[h])}}for(h=0;h=0;--e)this.objects[e].dispose();for(this.objects.length=0,e=this.overlays.length-1;e>=0;--e)this.overlays[e].dispose();this.overlays.length=0,this.gl=null},A.addObject=function(e){this.objects.indexOf(e)<0&&(this.objects.push(e),this.setDirty())},A.removeObject=function(e){for(var t=this.objects,r=0;rMath.abs(t))A.rotate(a,0,0,-e*r*Math.PI*h.rotateSpeed/window.innerWidth);else if(!h._ortho){var o=-h.zoomSpeed*i*t/window.innerHeight*(a-A.lastT())/20;A.pan(a,0,0,u*(Math.exp(o)-1))}}}),!0)},h.enableMouseListeners(),h};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(e,t,r){var n=r(3236),i=r(9405),a=n(["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=n(["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(e){return i(e,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){"use strict";var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),A=r(7169),c=r(351),u=r(4772),g=r(4040),f=r(799),h=r(9216)({tablet:!0,featureDetect:!0});function d(){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 p(e){var t=Math.round(Math.log(Math.abs(e))/Math.log(10));if(t<0){var r=Math.round(Math.pow(10,-t));return Math.ceil(e*r)/r}return t>0?(r=Math.round(Math.pow(10,t)),Math.ceil(e/r)*r):Math.ceil(e)}function y(e){return"boolean"!==typeof e||e}e.exports={createScene:function(e){(e=e||{}).camera=e.camera||{};var t=e.canvas;t||(t=document.createElement("canvas"),e.container?e.container.appendChild(t):document.body.appendChild(t));var r=e.gl;if(r||(e.glOptions&&(h=!!e.glOptions.preserveDrawingBuffer),r=function(e,t){var r=null;try{(r=e.getContext("webgl",t))||(r=e.getContext("experimental-webgl",t))}catch(n){return null}return r}(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:h})),!r)throw new Error("webgl not supported");var m=e.bounds||[[-10,-10,-10],[10,10,10]],I=new d,v=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!h}),E=f(r),C=e.cameraObject&&!0===e.cameraObject._ortho||e.camera.projection&&"orthographic"===e.camera.projection.type||!1,B={eye:e.camera.eye||[2,0,0],center:e.camera.center||[0,0,0],up:e.camera.up||[0,1,0],zoomMin:e.camera.zoomMax||.1,zoomMax:e.camera.zoomMin||100,mode:e.camera.mode||"turntable",_ortho:C},b=e.axes||{},x=i(r,b);x.enable=!b.disable;var w=e.spikes||{},Q=o(r,w),_=[],S=[],k=[],D=[],T=!0,M=!0,R=new Array(16),L=new Array(16),N={view:null,projection:R,model:L,_ortho:!1},F=(M=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),O=e.cameraObject||n(t,B),P={gl:r,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:I,camera:O,axes:x,axesPixels:null,spikes:Q,bounds:m,objects:_,shape:F,aspect:e.aspectRatio||[1,1,1],pickRadius:e.pickRadius||10,zNear:e.zNear||.01,zFar:e.zFar||1e3,fovy:e.fovy||Math.PI/4,clearColor:e.clearColor||[0,0,0,0],autoResize:y(e.autoResize),autoBounds:y(e.autoBounds),autoScale:!!e.autoScale,autoCenter:y(e.autoCenter),clipToBounds:y(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:N,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(e){this.aspect[0]=e.x,this.aspect[1]=e.y,this.aspect[2]=e.z,M=!0},setBounds:function(e,t){this.bounds[0][e]=t.min,this.bounds[1][e]=t.max},setClearColor:function(e){this.clearColor=e},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},G=[r.drawingBufferWidth/P.pixelRatio|0,r.drawingBufferHeight/P.pixelRatio|0];function U(){if(!P._stopped&&P.autoResize){var e=t.parentNode,r=1,n=1;e&&e!==document.body?(r=e.clientWidth,n=e.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*P.pixelRatio),a=0|Math.ceil(n*P.pixelRatio);if(i!==t.width||a!==t.height){t.width=i,t.height=a;var o=t.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",T=!0}}}function z(){for(var e=_.length,t=D.length,n=0;n0&&0===k[t-1];)k.pop(),D.pop().dispose()}function q(){if(P.contextLost)return!0;r.isContextLost()&&(P.contextLost=!0,P.mouseListener.enabled=!1,P.selection.object=null,P.oncontextloss&&P.oncontextloss())}P.autoResize&&U(),window.addEventListener("resize",U),P.update=function(e){P._stopped||(e=e||{},T=!0,M=!0)},P.add=function(e){P._stopped||(e.axes=x,_.push(e),S.push(-1),T=!0,M=!0,z())},P.remove=function(e){if(!P._stopped){var t=_.indexOf(e);t<0||(_.splice(t,1),S.pop(),T=!0,M=!0,z())}},P.dispose=function(){if(!P._stopped&&(P._stopped=!0,window.removeEventListener("resize",U),t.removeEventListener("webglcontextlost",q),P.mouseListener.enabled=!1,!P.contextLost)){x.dispose(),Q.dispose();for(var e=0;e<_.length;++e)_[e].dispose();for(v.dispose(),e=0;eI.distance)continue;for(var A=0;A 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),t.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),t.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},4696:function(e,t,r){"use strict";var n=r(9405),i=r(2762),a=r(1888),o=r(6640);function s(e,t,r,n,i){this.plot=e,this.offsetBuffer=t,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(e,t){var r=e.gl,a=i(r),l=i(r),A=n(r,o.pointVertex,o.pointFragment),c=n(r,o.pickVertex,o.pickFragment),u=new s(e,a,l,A,c);return u.update(t),e.addObject(u),u};var l=s.prototype;l.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},l.update=function(e){var t;function r(t,r){return t in e?e[t]:r}e=e||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=e.positions.length>>>1,i=e.positions instanceof Float32Array,o=e.idToIndex instanceof Int32Array&&e.idToIndex.length>=n,s=e.positions,l=i?s:a.mallocFloat32(s.length),A=o?e.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),t=0;t>>1;for(r=0;r=t[0]&&a<=t[2]&&o>=t[1]&&o<=t[3]&&n++}return n}(this.points,o),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(A,.33333)));e[0]=2/s,e[4]=2/l,e[6]=-2*o[0]/s-1,e[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=e,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=c<5,i.uniforms.pointSize=c,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(t[0]=255&r,t[1]=r>>8&255,t[2]=r>>16&255,t[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=t,this.pickOffset=r);var u=a.getParameter(a.BLEND),g=a.getParameter(a.DITHER);return u&&!this.blend&&a.disable(a.BLEND),g&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),u&&!this.blend&&a.enable(a.BLEND),g&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.pick=function(e,t,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},783:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,A=t[0],c=t[1],u=t[2],g=t[3],f=r[0],h=r[1],d=r[2],p=r[3];return(a=A*f+c*h+u*d+g*p)<0&&(a=-a,f=-f,h=-h,d=-d,p=-p),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),e[0]=s*A+l*f,e[1]=s*c+l*h,e[2]=s*u+l*d,e[3]=s*g+l*p,e}},5964:function(e){"use strict";e.exports=function(e){return e||0===e?e.toString():""}},9366:function(e,t,r){"use strict";var n=r(4359);e.exports=function(e,t,r){var a=[t.style,t.weight,t.variant,t.family].join("_"),o=i[a];if(o||(o=i[a]={}),e in o)return o[e];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:t.family,fontStyle:t.style,fontWeight:t.weight,fontVariant:t.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(e,s);s.triangles=!1;var A,c,u=n(e,s);if(r&&1!==r){for(A=0;A max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),A=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],u={vertex:a,fragment:l,attributes:c},g={vertex:o,fragment:l,attributes:c},f={vertex:s,fragment:l,attributes:c},h={vertex:a,fragment:A,attributes:c},d={vertex:o,fragment:A,attributes:c},p={vertex:s,fragment:A,attributes:c};function y(e,t){var r=n(e,t),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}t.createPerspective=function(e){return y(e,u)},t.createOrtho=function(e){return y(e,g)},t.createProject=function(e){return y(e,f)},t.createPickPerspective=function(e){return y(e,h)},t.createPickOrtho=function(e){return y(e,d)},t.createPickProject=function(e){return y(e,p)}},8418:function(e,t,r){"use strict";var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),A=r(9366),c=r(5964),u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function g(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];return e[0]=t[0]*r+t[4]*n+t[8]*i+t[12]*a,e[1]=t[1]*r+t[5]*n+t[9]*i+t[13]*a,e[2]=t[2]*r+t[6]*n+t[10]*i+t[14]*a,e[3]=t[3]*r+t[7]*n+t[11]*i+t[15]*a,e}function f(e,t,r,n){return g(n,n),g(n,n),g(n,n)}function h(e,t){this.index=e,this.dataCoordinate=this.position=t}function d(e){return!0===e||e>1?1:e}function p(e,t,r,n,i,a,o,s,l,A,c,u){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=A,this.pickOrthoShader=c,this.pickProjectShader=u,this.points=[],this._selectResult=new h(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}e.exports=function(e){var t=e.gl,r=l.createPerspective(t),n=l.createOrtho(t),o=l.createProject(t),s=l.createPickPerspective(t),A=l.createPickOrtho(t),c=l.createPickProject(t),u=i(t),g=i(t),f=i(t),h=i(t),d=a(t,[{buffer:u,size:3,type:t.FLOAT},{buffer:g,size:4,type:t.FLOAT},{buffer:f,size:2,type:t.FLOAT},{buffer:h,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),y=new p(t,r,n,o,u,g,f,h,d,s,A,c);return y.update(e),y};var y=p.prototype;y.pickSlots=1,y.setPickBase=function(e){this.pickId=e},y.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},y.isOpaque=function(){if(!this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&!this.projectHasAlpha)return!0;return!1};var m=[0,0],I=[0,0,0],v=[0,0,0],E=[0,0,0,1],C=[0,0,0,1],B=u.slice(),b=[0,0,0],x=[[0,0,0],[0,0,0]];function w(e){return e[0]=e[1]=e[2]=0,e}function Q(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function _(e,t,r,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[r]=n,e}function S(e,t,r,n){var i,a=t.axesProject,o=t.gl,l=e.uniforms,A=r.model||u,c=r.view||u,g=r.projection||u,h=t.axesBounds,d=function(e){for(var t=x,r=0;r<2;++r)for(var n=0;n<3;++n)t[r][n]=Math.max(Math.min(e[r][n],1e8),-1e8);return t}(t.clipBounds);i=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1],m[0]=2/o.drawingBufferWidth,m[1]=2/o.drawingBufferHeight,e.bind(),l.view=c,l.projection=g,l.screenSize=m,l.highlightId=t.highlightId,l.highlightScale=t.highlightScale,l.clipBounds=d,l.pickGroup=t.pickId/255,l.pixelRatio=n;for(var p=0;p<3;++p)if(a[p]){l.scale=t.projectScale[p],l.opacity=t.projectOpacity[p];for(var y=B,S=0;S<16;++S)y[S]=0;for(S=0;S<4;++S)y[5*S]=1;y[5*p]=0,i[p]<0?y[12+p]=h[0][p]:y[12+p]=h[1][p],s(y,A,y),l.model=y;var k=(p+1)%3,D=(p+2)%3,T=w(I),M=w(v);T[k]=1,M[D]=1;var R=f(0,0,0,Q(E,T)),L=f(0,0,0,Q(C,M));if(Math.abs(R[1])>Math.abs(L[1])){var N=R;R=L,L=N,N=T,T=M,M=N;var F=k;k=D,D=F}R[0]<0&&(T[k]=-1),L[1]>0&&(M[D]=-1);var O=0,P=0;for(S=0;S<4;++S)O+=Math.pow(A[4*k+S],2),P+=Math.pow(A[4*D+S],2);T[k]/=Math.sqrt(O),M[D]/=Math.sqrt(P),l.axes[0]=T,l.axes[1]=M,l.fragClipBounds[0]=_(b,d[0],p,-1e8),l.fragClipBounds[1]=_(b,d[1],p,1e8),t.vao.bind(),t.vao.draw(o.TRIANGLES,t.vertexCount),t.lineWidth>0&&(o.lineWidth(t.lineWidth*n),t.vao.draw(o.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}var k=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function D(e,t,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&S(t,r,n,i),a===r.hasAlpha||o){e.bind();var l=e.uniforms;l.model=n.model||u,l.view=n.view||u,l.projection=n.projection||u,m[0]=2/s.drawingBufferWidth,m[1]=2/s.drawingBufferHeight,l.screenSize=m,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=k,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function T(e,t,r,i){var a;a=Array.isArray(e)?t=this.pointCount||t<0)return null;var r=this.points[t],n=this._selectResult;n.index=t;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},y.highlight=function(e){if(e){var t=e.index,r=255&t,n=t>>8&255,i=t>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},y.update=function(e){if("perspective"in(e=e||{})&&(this.useOrtho=!e.perspective),"orthographic"in e&&(this.useOrtho=!!e.orthographic),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"project"in e)if(Array.isArray(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if("projectScale"in e)if(Array.isArray(e.projectScale))this.projectScale=e.projectScale.slice();else{var r=+e.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in e){Array.isArray(e.projectOpacity)?this.projectOpacity=e.projectOpacity.slice():(r=+e.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=d(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in e&&(this.opacity=d(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=e.position,l={family:e.font||"normal",style:e.fontStyle||"normal",weight:e.fontWeight||"normal",variant:e.fontVariant||"normal"},A=e.alignment||[0,0];if(2===A.length)i=A[0],a=A[1];else for(i=[],a=[],n=0;n0){var M=0,R=I,L=[0,0,0,1],N=[0,0,0,1],F=Array.isArray(f)&&Array.isArray(f[0]),O=Array.isArray(y)&&Array.isArray(y[0]);e:for(n=0;n0?1-w[0][0]:J<0?1+w[1][0]:1,K*=K>0?1-w[0][1]:K<0?1+w[1][1]:1],V=b.cells||[],W=b.positions||[];for(B=0;B0){var y=r*c;o.drawBox(u-y,g-y,f+y,g+y,a),o.drawBox(u-y,h-y,f+y,h+y,a),o.drawBox(u-y,g-y,u+y,h+y,a),o.drawBox(f-y,g-y,f+y,h+y,a)}}}},s.update=function(e){e=e||{},this.innerFill=!!e.innerFill,this.outerFill=!!e.outerFill,this.innerColor=(e.innerColor||[0,0,0,.5]).slice(),this.outerColor=(e.outerColor||[0,0,0,.5]).slice(),this.borderColor=(e.borderColor||[0,0,0,1]).slice(),this.borderWidth=e.borderWidth||0,this.selectBox=(e.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},3589:function(e,t,r){"use strict";e.exports=function(e,t){var r=t[0],a=t[1],o=n(e,r,a,{}),s=i.mallocUint8(r*a*4);return new l(e,o,s)};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(e,t,r,n,i){this.coord=[e,t],this.id=r,this.value=n,this.distance=i}function l(e,t,r){this.gl=e,this.fbo=t,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(t.bind(),e.readPixels(0,0,t.shape[0],t.shape[1],e.RGBA,e.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var A=l.prototype;Object.defineProperty(A,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(e){if(this.gl){this.fbo.shape=e;var t=this.fbo.shape[0],r=this.fbo.shape[1];if(r*t*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*t*4)),a=0;ar)for(e=r;et)for(e=t;e=0){for(var B=0|C.type.charAt(C.type.length-1),b=new Array(B),x=0;x=0;)w+=1;E[m]=w}var Q=new Array(r.length);function _(){g.program=o.program(f,g._vref,g._fref,v,E);for(var e=0;e=0){if((h=g.charCodeAt(g.length-1)-48)<2||h>4)throw new n("","Invalid data type for attribute "+u+": "+g);s(e,t,f[0],i,h,a,u)}else{if(!(g.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+u+": "+g);var h;if((h=g.charCodeAt(g.length-1)-48)<2||h>4)throw new n("","Invalid data type for attribute "+u+": "+g);l(e,t,f,i,h,a,u)}}}return a};var n=r(8866);function i(e,t,r,n,i,a){this._gl=e,this._wrapper=t,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(e,t,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,e||a.FLOAT,!!t,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(e,t,r,n){return this._constFunc(this._locations[this._index],e,t,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=0|e,this._wrapper.program=null),0|e}});var o=[function(e,t,r){return void 0===r.length?e.vertexAttrib1f(t,r):e.vertexAttrib1fv(t,r)},function(e,t,r,n){return void 0===r.length?e.vertexAttrib2f(t,r,n):e.vertexAttrib2fv(t,r)},function(e,t,r,n,i){return void 0===r.length?e.vertexAttrib3f(t,r,n,i):e.vertexAttrib3fv(t,r)},function(e,t,r,n,i,a){return void 0===r.length?e.vertexAttrib4f(t,r,n,i,a):e.vertexAttrib4fv(t,r)}];function s(e,t,r,n,a,s,l){var A=o[a],c=new i(e,t,r,n,a,A);Object.defineProperty(s,l,{set:function(t){return e.disableVertexAttribArray(n[r]),A(e,n[r],t),t},get:function(){return c},enumerable:!0})}function l(e,t,r,n,i,a,o){for(var l=new Array(i),A=new Array(i),c=0;c4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+m);e["uniformMatrix"+y+"fv"](s[u],!1,g);break}throw new i("","Unknown uniform data type for "+name+": "+m)}if((y=m.charCodeAt(m.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(m.charAt(0)){case"b":case"i":e["uniform"+y+"iv"](s[u],g);break;case"v":e["uniform"+y+"fv"](s[u],g);break;default:throw new i("","Unrecognized data type for vector "+name+": "+m)}}}}}}function A(e,t){if("object"!==typeof t)return[[e,t]];var r=[];for(var n in t){var i=t[n],a=e;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"===typeof i?r.push.apply(r,A(a,i)):r.push([a,i])}return r}function c(e,t,n){if("object"===typeof n){var A=u(n);Object.defineProperty(e,t,{get:a(A),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(e,t,{get:(c=n,function(e,t,r){return e.getUniform(t.program,r[c])}),set:l(n),enumerable:!0,configurable:!1}):e[t]=function(e){switch(e){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var t=e.indexOf("vec");if(0<=t&&t<=1&&e.length===4+t){if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===e.charAt(0)?o(r,!1):o(r,0)}if(0===e.indexOf("mat")&&4===e.length){var r;if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+e);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+e)}}(r[n].type);var c}function u(e){var t;if(Array.isArray(e)){t=new Array(e.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){"use strict";var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(e,t,r,a){for(var o=0,s=0;s0)for(B=0;B<8;B++){var b=(B+1)%8;A.push(g[B],f[B],f[b],f[b],g[b],g[B]),u.push(m,y,y,y,m,m),h.push(d,p,p,p,d,d);var x=A.length;c.push([x-6,x-5,x-4],[x-3,x-2,x-1])}var w=g;g=f,f=w;var Q=m;m=y,y=Q;var _=d;d=p,p=_}return{positions:A,cells:c,vectors:u,vertexIntensity:h}}(e,r,a,o)})),u=[],g=[],f=[],h=[];for(s=0;st)return r-1}return r},l=function(e,t,r){return er?r:e},A=function(e){var t=1/0;e.sort((function(e,t){return e-t}));for(var r=e.length,n=1;nu-1||m>g-1||I>f-1)return n.create();var v,E,C,B,b,x,w=a[0][h],Q=a[0][y],_=a[1][d],S=a[1][m],k=a[2][p],D=(o-w)/(Q-w),T=(A-_)/(S-_),M=(c-k)/(a[2][I]-k);switch(isFinite(D)||(D=.5),isFinite(T)||(T=.5),isFinite(M)||(M=.5),r.reversedX&&(h=u-1-h,y=u-1-y),r.reversedY&&(d=g-1-d,m=g-1-m),r.reversedZ&&(p=f-1-p,I=f-1-I),r.filled){case 5:b=p,x=I,C=d*f,B=m*f,v=h*f*g,E=y*f*g;break;case 4:b=p,x=I,v=h*f,E=y*f,C=d*f*u,B=m*f*u;break;case 3:C=d,B=m,b=p*g,x=I*g,v=h*g*f,E=y*g*f;break;case 2:C=d,B=m,v=h*g,E=y*g,b=p*g*u,x=I*g*u;break;case 1:v=h,E=y,b=p*u,x=I*u,C=d*u*f,B=m*u*f;break;default:v=h,E=y,C=d*u,B=m*u,b=p*u*g,x=I*u*g}var R=i[v+C+b],L=i[v+C+x],N=i[v+B+b],F=i[v+B+x],O=i[E+C+b],P=i[E+C+x],G=i[E+B+b],U=i[E+B+x],z=n.create(),q=n.create(),H=n.create(),Y=n.create();n.lerp(z,R,O,D),n.lerp(q,L,P,D),n.lerp(H,N,G,D),n.lerp(Y,F,U,D);var J=n.create(),K=n.create();n.lerp(J,z,H,T),n.lerp(K,q,Y,T);var j=n.create();return n.lerp(j,J,K,M),j}(t,e,f)},d=e.getDivergence||function(e,t){var r=n.create(),i=1e-4;n.add(r,e,[i,0,0]);var a=h(r);n.subtract(a,a,t),n.scale(a,a,1/i),n.add(r,e,[0,i,0]);var o=h(r);n.subtract(o,o,t),n.scale(o,o,1/i),n.add(r,e,[0,0,i]);var s=h(r);return n.subtract(s,s,t),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},p=[],y=t[0][0],m=t[0][1],I=t[0][2],v=t[1][0],E=t[1][1],C=t[1][2],B=function(e){var t=e[0],r=e[1],n=e[2];return!(tv||rE||nC)},b=10*n.distance(t[0],t[1])/i,x=b*b,w=1,Q=0,_=r.length;_>1&&(w=function(e){for(var t=[],r=[],n=[],i={},a={},o={},s=e.length,l=0;lQ&&(Q=F),L.push(F),p.push({points:D,velocities:T,divergences:L});for(var O=0;O<100*i&&D.lengthx&&n.scale(P,P,b/Math.sqrt(G)),n.add(P,P,k),M=h(P),n.squaredDistance(R,P)-x>-1e-4*x&&(D.push(P),R=P,T.push(M),N=d(P,M),F=n.length(N),isFinite(F)&&F>Q&&(Q=F),L.push(F)),k=P}}var U=o(p,e.colormap,Q,w);return u?U.tubeScale=u:(0===Q&&(Q=1),U.tubeScale=.5*c*w/Q),U};var c=r(6740),u=r(6405).createMesh;e.exports.createTubeMesh=function(e,t){return u(e,t,{shaders:c,traceType:"streamtube"})}},990:function(e,t,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\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 vColor = texture2D(colormap, vec2(value, value));\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=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\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 = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\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"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\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"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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"]);t.createShader=function(e){var t=n(e,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createPickShader=function(e){var t=n(e,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createContourShader=function(e){var t=n(e,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t},t.createPickContourShader=function(e){var t=n(e,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t}},9499:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl,r=m(t),n=v(t),s=I(t),l=E(t),A=i(t),c=a(t,[{buffer:A,size:4,stride:C,offset:0},{buffer:A,size:3,stride:C,offset:16},{buffer:A,size:3,stride:C,offset:28}]),u=i(t),g=a(t,[{buffer:u,size:4,stride:20,offset:0},{buffer:u,size:1,stride:20,offset:16}]),f=i(t),h=a(t,[{buffer:f,size:2,type:t.FLOAT}]),d=o(t,1,Q,t.RGBA,t.UNSIGNED_BYTE);d.minFilter=t.LINEAR,d.magFilter=t.LINEAR;var p=new _(t,[0,0],[[0,0,0],[0,0,0]],r,n,A,c,d,s,l,u,g,f,h,[0,0,0]),y={levels:[[],[],[]]};for(var B in e)y[B]=e[B];return y.colormap=y.colormap||"jet",p.update(y),p};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),A=r(5298),c=r(9994),u=r(9618),g=r(3711),f=r(6760),h=r(7608),d=r(2478),p=r(6199),y=r(990),m=y.createShader,I=y.createContourShader,v=y.createPickShader,E=y.createPickContourShader,C=40,B=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],b=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],x=[[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 w(e,t,r,n,i){this.position=e,this.index=t,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var e=0;e<3;++e){var t=x[e],r=(e+2)%3;t[(e+1)%3+0]=1,t[r+3]=1,t[e+6]=1}}();var Q=256;function _(e,t,r,n,i,a,o,l,A,c,g,f,h,d,p){this.gl=e,this.shape=t,this.bounds=r,this.objectOffset=p,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=A,this._contourPickShader=c,this._contourBuffer=g,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new w([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=h,this._dynamicVAO=d,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=[u(s.mallocFloat(1024),[0,0]),u(s.mallocFloat(1024),[0,0]),u(s.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.pixelRatio=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.vertexColor=0,this.dirty=!0}var S=_.prototype;S.genColormap=function(e,t){var r=!1,n=c([l({colormap:e,nshades:Q,format:"rgba"}).map((function(e,n){var i=t?function(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}(n/255,t):e[3];return i<1&&(r=!0),[e[0],e[1],e[2],255*i]}))]);return A.divseq(n,255),this.hasAlphaScale=r,n},S.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},S.isOpaque=function(){return!this.isTransparent()},S.pickSlots=1,S.setPickBase=function(e){this.pickId=e};var k=[0,0,0],D={showSurface:!1,showContour:!1,projections:[B.slice(),B.slice(),B.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function T(e,t){var r,n,i,a=t.axes&&t.axes.lastCubeProps.axis||k,o=t.showSurface,s=t.showContour;for(r=0;r<3;++r)for(o=o||t.surfaceProject[r],n=0;n<3;++n)s=s||t.contourProject[r][n];for(r=0;r<3;++r){var l=D.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=t.axesBounds[+(a[r]>0)][r],f(l,e.model,l);var A=D.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)A[i][n]=e.clipBounds[i][n];A[0][r]=-1e8,A[1][r]=1e8}return D.showSurface=o,D.showContour=s,D}var M={model:B,view:B,projection:B,inverseModel:B.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},R=B.slice(),L=[1,0,0,0,1,0,0,0,1];function N(e,t){e=e||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=M;n.model=e.model||B,n.view=e.view||B,n.projection=e.projection||B,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.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=h(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-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=L,n.vertexColor=this.vertexColor;var s=R;for(f(s,n.view,n.model),f(s,n.projection,s),h(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var A=s[12+i];for(o=0;o<3;++o)A+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=A/l}var c=T(n,this);if(c.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour){var u=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,u.bind(),u.uniforms=n;var g=this._contourVAO;for(g.bind(),i=0;i<3;++i)for(u.uniforms.permutation=x[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=t[1]*(e.value[1]+(15&e.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var A=r.position;A[0]=A[1]=A[2]=0;for(var c=0;c<2;++c)for(var u=c?a:1-a,g=0;g<2;++g)for(var f=i+c,h=s+g,p=u*(g?l:1-l),y=0;y<3;++y)A[y]+=this._field[y].get(f,h)*p;for(var m=this._pickResult.level,I=0;I<3;++I)if(m[I]=d.le(this.contourLevels[I],A[I]),m[I]<0)this.contourLevels[I].length>0&&(m[I]=0);else if(m[I]Math.abs(E-A[I])&&(m[I]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/t[0],r.uv[1]=o/t[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},S.padField=function(e,t){var r=t.shape.slice(),n=e.shape.slice();A.assign(e.lo(1,1).hi(r[0],r[1]),t),A.assign(e.lo(1).hi(r[0],1),t.hi(r[0],1)),A.assign(e.lo(1,n[1]-1).hi(r[0],1),t.lo(0,r[1]-1).hi(r[0],1)),A.assign(e.lo(0,1).hi(1,r[1]),t.hi(1)),A.assign(e.lo(n[0]-1,1).hi(1,r[1]),t.lo(r[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,n[1]-1,t.get(0,r[1]-1)),e.set(n[0]-1,0,t.get(r[0]-1,0)),e.set(n[0]-1,n[1]-1,t.get(r[0]-1,r[1]-1))},S.update=function(e){e=e||{},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in e&&(this.contourWidth=O(e.contourWidth,Number)),"showContour"in e&&(this.showContour=O(e.showContour,Boolean)),"showSurface"in e&&(this.showSurface=!!e.showSurface),"contourTint"in e&&(this.contourTint=O(e.contourTint,Boolean)),"contourColor"in e&&(this.contourColor=G(e.contourColor)),"contourProject"in e&&(this.contourProject=O(e.contourProject,(function(e){return O(e,Boolean)}))),"surfaceProject"in e&&(this.surfaceProject=e.surfaceProject),"dynamicColor"in e&&(this.dynamicColor=G(e.dynamicColor)),"dynamicTint"in e&&(this.dynamicTint=O(e.dynamicTint,Number)),"dynamicWidth"in e&&(this.dynamicWidth=O(e.dynamicWidth,Number)),"opacity"in e&&(this.opacity=e.opacity),"opacityscale"in e&&(this.opacityscale=e.opacityscale),"colorBounds"in e&&(this.colorBounds=e.colorBounds),"vertexColor"in e&&(this.vertexColor=e.vertexColor?1:0),"colormap"in e&&this._colorMap.setPixels(this.genColormap(e.colormap,this.opacityscale));var t=e.field||e.coords&&e.coords[2]||null,r=!1;if(t||(t=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 e||"coords"in e){var i=(t.shape[0]+2)*(t.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=u(this._field[2].data,[t.shape[0]+2,t.shape[1]+2]),this.padField(this._field[2],t),this.shape=t.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=u(this._field[o].data,[a[0]+2,a[1]+2]);if(e.coords){var l=e.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var A=l[o];for(y=0;y<2;++y)if(A.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],A)}}else if(e.ticks){var c=e.ticks;if(!Array.isArray(c)||2!==c.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var f=c[o];if((Array.isArray(f)||f.length)&&(f=u(f)),f.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var h=u(f.data,a);h.stride[o]=f.stride[0],h.stride[1^o]=0,this.padField(this._field[o],h)}}else{for(o=0;o<2;++o){var d=[0,0];d[o]=1,this._field[o]=u(this._field[o].data,[a[0]+2,a[1]+2],d,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var Ie=0;Ie<5;++Ie)X.pop();U-=1}continue e}X.push(ne[0],ne[1],oe[0],oe[1],ne[2]),U+=1}}re.push(U)}this._contourOffsets[$]=te,this._contourCounts[$]=re}var ve=s.mallocFloat(X.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=h(o,t.stride.slice()),A=0;"float32"===r?A=e.FLOAT:"float64"===r?(A=e.FLOAT,l=!1,r="float32"):"uint8"===r?A=e.UNSIGNED_BYTE:(A=e.UNSIGNED_BYTE,l=!1,r="uint8");var u,f,p=0;if(2===o.length)p=e.LUMINANCE,o=[o[0],o[1],1],t=n(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])p=e.ALPHA;else if(2===o[2])p=e.LUMINANCE_ALPHA;else if(3===o[2])p=e.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");p=e.RGBA}}A!==e.FLOAT||e.getExtension("OES_texture_float")||(A=e.UNSIGNED_BYTE,l=!1);var y=t.size;if(l)u=0===t.offset&&t.data.length===y?t.data:t.data.subarray(t.offset,t.offset+y);else{var m=[o[2],o[2]*o[0],1];f=a.malloc(y,r);var I=n(f,o,m,0);"float32"!==r&&"float64"!==r||A!==e.UNSIGNED_BYTE?i.assign(I,t):c(I,t),u=f.subarray(0,y)}var v=d(e);return e.texImage2D(e.TEXTURE_2D,0,p,o[0],o[1],0,p,A,u),l||a.free(f),new g(e,v,o[0],o[1],p,A)}(e,t)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function A(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&e instanceof ImageData}var c=function(e,t){i.muls(e,t,255)};function u(e,t,r){var n=e.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),n.texImage2D(n.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function g(e,t,r,n,i,a){this.gl=e,this.handle=t,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(e){return o.wrapS=e}},{get:function(){return o._wrapT},set:function(e){return o.wrapT=e}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(e){return o.width=e}},{get:function(){return o._shape[1]},set:function(e){return o.height=e}}]),this._shapeVector=l}var f=g.prototype;function h(e,t){return 3===e.length?1===t[2]&&t[1]===e[0]*e[2]&&t[0]===e[2]:1===t[0]&&t[1]===e[0]}function d(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function p(e,t,r,n,i){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===e.FLOAT&&!e.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=d(e);return e.texImage2D(e.TEXTURE_2D,0,n,t,r,0,n,i,null),new g(e,o,t,r,n,i)}Object.defineProperties(f,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=0|Math.max(e,1),t!==this._anisoSamples){var r=this.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(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),2!==e.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(l.indexOf(e[t])<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[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),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(Array.isArray(e)){if(2!==e.length)throw new Error("gl-texture2d: Invalid texture shape")}else e=[0|e,0|e];return u(this,0|e[0],0|e[1]),[0|e[0],0|e[1]]}},width:{get:function(){return this._shape[0]},set:function(e){return u(this,e|=0,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,u(this,this._shape[0],e),e}}}),f.bind=function(e){var t=this.gl;return void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(t.TEXTURE_2D,this.handle),void 0!==e?0|e:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0},f.dispose=function(){this.gl.deleteTexture(this.handle)},f.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)this._mipLevels.indexOf(t)<0&&this._mipLevels.push(t)},f.setPixels=function(e,t,r,o){var s=this.gl;this.bind(),Array.isArray(t)?(o=r,r=0|t[1],t=0|t[0]):(t=t||0,r=r||0),o=o||0;var l=A(e)?e:e.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,t,r,this.format,this.type,l);else{if(!(e.shape&&e.stride&&e.data))throw new Error("gl-texture2d: Unsupported data type");if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>o||r+e.shape[0]>this._shape[0]>>>o||t<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(e,t,r,o,s,l,A,u){var g=u.dtype,f=u.shape.slice();if(f.length<2||f.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var d=0,p=0,y=h(f,u.stride.slice());if("float32"===g?d=e.FLOAT:"float64"===g?(d=e.FLOAT,y=!1,g="float32"):"uint8"===g?d=e.UNSIGNED_BYTE:(d=e.UNSIGNED_BYTE,y=!1,g="uint8"),2===f.length)p=e.LUMINANCE,f=[f[0],f[1],1],u=n(u.data,f,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==f.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===f[2])p=e.ALPHA;else if(2===f[2])p=e.LUMINANCE_ALPHA;else if(3===f[2])p=e.RGB;else{if(4!==f[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");p=e.RGBA}f[2]}if(p!==e.LUMINANCE&&p!==e.ALPHA||s!==e.LUMINANCE&&s!==e.ALPHA||(p=s),p!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var m=u.size,I=A.indexOf(o)<0;if(I&&A.push(o),d===l&&y)0===u.offset&&u.data.length===m?I?e.texImage2D(e.TEXTURE_2D,o,s,f[0],f[1],0,s,l,u.data):e.texSubImage2D(e.TEXTURE_2D,o,t,r,f[0],f[1],s,l,u.data):I?e.texImage2D(e.TEXTURE_2D,o,s,f[0],f[1],0,s,l,u.data.subarray(u.offset,u.offset+m)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,f[0],f[1],s,l,u.data.subarray(u.offset,u.offset+m));else{var v;v=l===e.FLOAT?a.mallocFloat32(m):a.mallocUint8(m);var E=n(v,f,[f[2],f[2]*f[0],1]);d===e.FLOAT&&l===e.UNSIGNED_BYTE?c(E,u):i.assign(E,u),I?e.texImage2D(e.TEXTURE_2D,o,s,f[0],f[1],0,s,l,v.subarray(0,m)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,f[0],f[1],s,l,v.subarray(0,m)),l===e.FLOAT?a.freeFloat32(v):a.freeUint8(v)}}(s,t,r,o,this.format,this.type,this._mipLevels,e)}}},1433:function(e){"use strict";e.exports=function(e,t,r){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var n=0|e.getParameter(e.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(e){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},3126:function(e){e.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},3990:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},1091:function(e){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},5911:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}},244:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,r){e.exports=function(e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(e){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},2681:function(e){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},5137:function(e,t,r){e.exports=function(e,t,r,i,a,o){var s,l;for(t||(t=3),r||(r=0),l=i?Math.min(i*t+r,e.length):e.length,s=r;s0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e}},7636:function(e){e.exports=function(e,t){t=t||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}},6894:function(e){e.exports=function(e,t,r,n){var i=r[1],a=r[2],o=t[1]-i,s=t[2]-a,l=Math.sin(n),A=Math.cos(n);return e[0]=t[0],e[1]=i+o*A-s*l,e[2]=a+o*l+s*A,e}},109:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[2],o=t[0]-i,s=t[2]-a,l=Math.sin(n),A=Math.cos(n);return e[0]=i+s*l+o*A,e[1]=t[1],e[2]=a+s*A-o*l,e}},8692:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[1],o=t[0]-i,s=t[1]-a,l=Math.sin(n),A=Math.cos(n);return e[0]=i+o*A-s*l,e[1]=a+o*l+s*A,e[2]=t[2],e}},2447:function(e){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},6621:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}},8489:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}},1463:function(e){e.exports=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}},6141:function(e,t,r){e.exports=r(2953)},5486:function(e,t,r){e.exports=r(3066)},2953:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}},3066:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}},492:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}},5673:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}},264:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],A=r[3],c=A*n+s*a-l*i,u=A*i+l*n-o*a,g=A*a+o*i-s*n,f=-o*n-s*i-l*a;return e[0]=c*A+f*-o+u*-l-g*-s,e[1]=u*A+f*-s+g*-o-c*-l,e[2]=g*A+f*-l+c*-s-u*-o,e}},4361:function(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}},2335:function(e){e.exports=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},2933:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},7536:function(e){e.exports=function(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},4691:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}},3750:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},3390:function(e){e.exports=function(e,t,r,n){var i=new Float32Array(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}},9970:function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(e){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}},6808:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}},2573:function(e){e.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}},160:function(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}},2334:function(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}},3576:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}},1498:function(e){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}},5177:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o),e}},9131:function(e,t,r){var n=r(5177),i=r(9288);e.exports=function(e,t){return t=t||1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),n(e,e),i(e,e,t),e}},9288:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}},4844:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}},4578:function(e){e.exports=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}},7960:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a}},483:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}},6860:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}},5352:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}},4041:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],A=r[3],c=A*n+s*a-l*i,u=A*i+l*n-o*a,g=A*a+o*i-s*n,f=-o*n-s*i-l*a;return e[0]=c*A+f*-o+u*-l-g*-s,e[1]=u*A+f*-s+g*-o-c*-l,e[2]=g*A+f*-l+c*-s-u*-o,e[3]=t[3],e}},1848:function(e,t,r){var n=r(4905),i=r(6468);e.exports=function(e){for(var t=Array.isArray(e)?e:n(e),r=0;r0)continue;r=e.slice(0,1).join("")}return P(r),D+=r.length,(Q=Q.slice(r.length)).length}}function K(){return/[^a-fA-F0-9]/.test(t)?(P(Q.join("")),w=l,b):(Q.push(t),r=t,b+1)}function j(){return"."===t||/[eE]/.test(t)?(Q.push(t),w=d,r=t,b+1):"x"===t&&1===Q.length&&"0"===Q[0]?(w=E,Q.push(t),r=t,b+1):/[^\d]/.test(t)?(P(Q.join("")),w=l,b):(Q.push(t),r=t,b+1)}function V(){return"f"===t&&(Q.push(t),r=t,b+=1),/[eE]/.test(t)?(Q.push(t),r=t,b+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(P(Q.join("")),w=l,b):(Q.push(t),r=t,b+1)}function W(){if(/[^\d\w_]/.test(t)){var e=Q.join("");return w=O[e]?m:F[e]?y:p,P(Q.join("")),w=l,b}return Q.push(t),r=t,b+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,A=9999,c=0,u=1,g=2,f=3,h=4,d=5,p=6,y=7,m=8,I=9,v=10,E=11,C=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(e,t,r){var n=r(6852);n=n.slice().filter((function(e){return!/^(gl\_|texture)/.test(e)})),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"])},6852:function(e){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"]},7932:function(e,t,r){var n=r(620);e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","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"])},620:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","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"]},7827:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(e,t,r){var n=r(5874);e.exports=function(e,t){var r=n(t),i=[];return i=(i=i.concat(r(e))).concat(r(null))}},3236:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,u=r?i-1:0,g=r?-1:1,f=e[t+u];for(u+=g,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=g,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+u],u+=g,c-=8);if(0===a)a=1-A;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=A}return(f?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,A=8*a-i-1,c=(1<>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,h=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?g/l:g*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,i),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&s,f+=h,s/=256,i-=8);for(o=o<0;e[r+f]=255&o,f+=h,o/=256,A-=8);e[r+f-h]|=128*d}},8954:function(e,t,r){"use strict";e.exports=function(e,t){var r=e.length;if(0===r)throw new Error("Must have at least d+1 points");var i=e[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=e.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);var u=new a(l,new Array(i+1),!1),g=u.adjacent,f=new Array(i+2);for(c=0;c<=i;++c){for(var h=l.slice(),d=0;d<=i;++d)d===c&&(h[d]=-1);var p=h[0];h[0]=h[1],h[1]=p;var y=new a(h,new Array(i+1),!0);g[c]=y,f[c]=y}for(f[i+1]=u,c=0;c<=i;++c){h=g[c].vertices;var m=g[c].adjacent;for(d=0;d<=i;++d){var I=h[d];if(I<0)m[d]=u;else for(var v=0;v<=i;++v)g[v].vertices.indexOf(I)<0&&(m[d]=g[v])}}var E=new A(i,o,f),C=!!t;for(c=i+1;c0;)for(var s=(e=o.pop()).adjacent,l=0;l<=r;++l){var A=s[l];if(A.boundary&&!(A.lastVisited<=-n)){for(var c=A.vertices,u=0;u<=r;++u){var g=c[u];i[u]=g<0?t:a[g]}var f=this.orient();if(f>0)return A;A.lastVisited=-n,0===f&&o.push(A)}}return null},c.walk=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];e:for(;!s.boundary;){for(var l=s.vertices,A=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];for(s.lastVisited=r,c=0;c<=n;++c){var u=A[c];if(!(u.lastVisited>=r)){var g=a[c];a[c]=e;var f=this.orient();if(a[c]=g,f<0){s=u;continue e}u.boundary?u.lastVisited=-r:u.lastVisited=r}}return}return s},c.addPeaks=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,A=this.interior,c=this.simplices,u=[t];t.lastVisited=r,t.vertices[t.vertices.indexOf(-1)]=r,t.boundary=!1,A.push(t);for(var g=[];u.length>0;){var f=(t=u.pop()).vertices,h=t.adjacent,d=f.indexOf(r);if(!(d<0))for(var p=0;p<=n;++p)if(p!==d){var y=h[p];if(y.boundary&&!(y.lastVisited>=r)){var m=y.vertices;if(y.lastVisited!==-r){for(var I=0,v=0;v<=n;++v)m[v]<0?(I=v,l[v]=e):l[v]=i[m[v]];if(this.orient()>0){m[I]=r,y.boundary=!1,A.push(y),u.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var E=y.adjacent,C=f.slice(),B=h.slice(),b=new a(C,B,!0);c.push(b);var x=E.indexOf(t);if(!(x<0))for(E[x]=b,B[d]=y,C[p]=-1,B[p]=t,h[p]=b,b.flip(),v=0;v<=n;++v){var w=C[v];if(!(w<0||w===r)){for(var Q=new Array(n-1),_=0,S=0;S<=n;++S){var k=C[S];k<0||S===v||(Q[_++]=k)}g.push(new o(Q,b,v))}}}}}for(g.sort(s),p=0;p+1=0?o[l++]=s[c]:A=1&c;if(A===(1&e)){var u=o[0];o[0]=o[1],o[1]=u}t.push(o)}}return t}},3352:function(e,t,r){"use strict";var n=r(2478);function i(e,t,r,n,i){this.mid=e,this.left=t,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(t?t.count:0)+(r?r.count:0)+n.length}e.exports=function(e){return e&&0!==e.length?new y(p(e)):new y(null)};var a=i.prototype;function o(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function s(e,t){var r=p(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function l(e,t){var r=e.intervals([]);r.push(t),s(e,r)}function A(e,t){var r=e.intervals([]),n=r.indexOf(t);return n<0?0:(r.splice(n,1),s(e,r),1)}function c(e,t,r){for(var n=0;n=0&&e[n][1]>=t;--n){var i=r(e[n]);if(i)return i}}function g(e,t){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(t+1)?l(this,e):this.left.insert(e):this.left=p([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=p([e]);else{var r=n.ge(this.leftPoints,e,h),i=n.ge(this.rightPoints,e,d);this.leftPoints.splice(r,0,e),this.rightPoints.splice(i,0,e)}},a.remove=function(e){var t=this.count-this.leftPoints;if(e[1]3*(t-1)?A(this,e):2===(s=this.left.remove(e))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(e[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(t-1)?A(this,e):2===(s=this.right.remove(e))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===e?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,e,h);athis.mid?this.right&&(r=this.right.queryPoint(e,t))?r:u(this.rightPoints,e,t):g(this.leftPoints,t);var r},a.queryInterval=function(e,t,r){var n;return ethis.mid&&this.right&&(n=this.right.queryInterval(e,t,r))?n:tthis.mid?u(this.rightPoints,e,r):g(this.leftPoints,r)};var m=y.prototype;m.insert=function(e){this.root?this.root.insert(e):this.root=new i(e[0],null,null,[e],[e])},m.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},m.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},m.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)},Object.defineProperty(m,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(m,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},7762:function(e){"use strict";e.exports=function(e){for(var t=new Array(e),r=0;r13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},395:function(e){e.exports=function(e,t,r){return e*(1-r)+t*r}},2652:function(e,t,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),A={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},c=i(),u=i(),g=[0,0,0,0],f=[[0,0,0],[0,0,0],[0,0,0]],h=[0,0,0];function d(e,t,r,n,i){e[0]=t[0]*n+r[0]*i,e[1]=t[1]*n+r[1]*i,e[2]=t[2]*n+r[2]*i}e.exports=function(e,t,r,i,p,y){if(t||(t=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),p||(p=[0,0,0,1]),y||(y=[0,0,0,1]),!n(c,e))return!1;if(a(u,c),u[3]=0,u[7]=0,u[11]=0,u[15]=1,Math.abs(o(u)<1e-8))return!1;var m,I,v=c[3],E=c[7],C=c[11],B=c[12],b=c[13],x=c[14],w=c[15];if(0!==v||0!==E||0!==C){if(g[0]=v,g[1]=E,g[2]=C,g[3]=w,!s(u,u))return!1;l(u,u),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(p,g,u)}else p[0]=p[1]=p[2]=0,p[3]=1;if(t[0]=B,t[1]=b,t[2]=x,I=c,(m=f)[0][0]=I[0],m[0][1]=I[1],m[0][2]=I[2],m[1][0]=I[4],m[1][1]=I[5],m[1][2]=I[6],m[2][0]=I[8],m[2][1]=I[9],m[2][2]=I[10],r[0]=A.length(f[0]),A.normalize(f[0],f[0]),i[0]=A.dot(f[0],f[1]),d(f[1],f[1],f[0],1,-i[0]),r[1]=A.length(f[1]),A.normalize(f[1],f[1]),i[0]/=r[1],i[1]=A.dot(f[0],f[2]),d(f[2],f[2],f[0],1,-i[1]),i[2]=A.dot(f[1],f[2]),d(f[2],f[2],f[1],1,-i[2]),r[2]=A.length(f[2]),A.normalize(f[2],f[2]),i[1]/=r[2],i[2]/=r[2],A.cross(h,f[1],f[2]),A.dot(f[0],h)<0)for(var Q=0;Q<3;Q++)r[Q]*=-1,f[Q][0]*=-1,f[Q][1]*=-1,f[Q][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+f[0][0]-f[1][1]-f[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-f[0][0]+f[1][1]-f[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-f[0][0]-f[1][1]+f[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+f[0][0]+f[1][1]+f[2][2],0)),f[2][1]>f[1][2]&&(y[0]=-y[0]),f[0][2]>f[2][0]&&(y[1]=-y[1]),f[1][0]>f[0][1]&&(y[2]=-y[2]),!0}},4335:function(e){e.exports=function(e,t){var r=t[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)e[i]=t[i]*n;return!0}},7442:function(e,t,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=u(),A=u(),c=u();function u(){return{translate:g(),scale:g(1),skew:g(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function g(e){return[e||0,e||0,e||0]}e.exports=function(e,t,r,u){if(0===o(t)||0===o(r))return!1;var g=a(t,l.translate,l.scale,l.skew,l.perspective,l.quaternion),f=a(r,A.translate,A.scale,A.skew,A.perspective,A.quaternion);return!(!g||!f)&&(n(c.translate,l.translate,A.translate,u),n(c.skew,l.skew,A.skew,u),n(c.scale,l.scale,A.scale,u),n(c.perspective,l.perspective,A.perspective,u),s(c.quaternion,l.quaternion,A.quaternion,u),i(e,c.translate,c.scale,c.skew,c.perspective,c.quaternion),!0)}},7182:function(e,t,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());e.exports=function(e,t,r,a,o,s){return n.identity(e),n.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(e,e,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(e,e,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(e,e,i)),n.scale(e,e,r),e}},4192:function(e,t,r){"use strict";var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),A=r(6582),c=r(7656),u=(r(2504),r(3536)),g=[0,0,0];function f(e){this._components=e.slice(),this._time=[0],this.prevMatrix=e.slice(),this.nextMatrix=e.slice(),this.computedMatrix=e.slice(),this.computedInverse=e.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]}e.exports=function(e){return new f((e=e||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var h=f.prototype;h.recalcMatrix=function(e){var t=this._time,r=n.le(t,e),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===t.length-1)for(var l=16*r,A=0;A<16;++A)o[A]=s[l++];else{var c=t[r+1]-t[r],g=(l=16*r,this.prevMatrix),f=!0;for(A=0;A<16;++A)g[A]=s[l++];var h=this.nextMatrix;for(A=0;A<16;++A)h[A]=s[l++],f=f&&g[A]===h[A];if(c<1e-6||f)for(A=0;A<16;++A)o[A]=g[A];else i(o,g,h,(e-t[r])/c)}var d=this.computedUp;d[0]=o[1],d[1]=o[5],d[2]=o[9],u(d,d);var p=this.computedInverse;a(p,o);var y=this.computedEye,m=p[15];y[0]=p[12]/m,y[1]=p[13]/m,y[2]=p[14]/m;var I=this.computedCenter,v=Math.exp(this.computedRadius[0]);for(A=0;A<3;++A)I[A]=y[A]-o[2+4*A]*v}},h.idle=function(e){if(!(e1&&n(e[o[c-2]],e[o[c-1]],A)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(e[s[c-2]],e[s[c-1]],A)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var u=0,g=(i=0,o.length);i0;--f)r[u++]=s[f];return r};var n=r(3250)[3]},351:function(e,t,r){"use strict";e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function A(e,s){var A=n.x(s),c=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||A!==i||c!==a||l(s))&&(r=0|e,i=A||0,a=c||0,t&&t(r,i,a,o))}function c(e){A(0,e)}function u(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function g(e){l(e)&&t&&t(r,i,a,o)}function f(e){0===n.buttons(e)?A(0,e):A(r,e)}function h(e){A(r|n.buttons(e),e)}function d(e){A(r&~n.buttons(e),e)}function p(){s||(s=!0,e.addEventListener("mousemove",f),e.addEventListener("mousedown",h),e.addEventListener("mouseup",d),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",u),e.addEventListener("keyup",g),e.addEventListener("keydown",g),e.addEventListener("keypress",g),e!==window&&(window.addEventListener("blur",u),window.addEventListener("keyup",g),window.addEventListener("keydown",g),window.addEventListener("keypress",g)))}p();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?p():s&&(s=!1,e.removeEventListener("mousemove",f),e.removeEventListener("mousedown",h),e.removeEventListener("mouseup",d),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",u),e.removeEventListener("keyup",g),e.removeEventListener("keydown",g),e.removeEventListener("keypress",g),e!==window&&(window.removeEventListener("blur",u),window.removeEventListener("keyup",g),window.removeEventListener("keydown",g),window.removeEventListener("keypress",g)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4687:function(e,t){"use strict";function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1< 0"),"function"!==typeof e.vertex&&t("Must specify vertex creation function"),"function"!==typeof e.cell&&t("Must specify cell creation function"),"function"!==typeof e.phase&&t("Must specify phase function");for(var s=e.getters||[],l=new Array(a),A=0;A=0?l[A]=!0:l[A]=!1;return function(e,t,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(e,t,r,n.mallocUint32,n.freeUint32)}(e.vertex,e.cell,e.phase,0,r,l)};var i={"false,0,1":function(e,t,r,n,i){return function(a,o,s,l){var A,c=0|a.shape[0],u=0|a.shape[1],g=a.data,f=0|a.offset,h=0|a.stride[0],d=0|a.stride[1],p=f,y=0|-h,m=0,I=0|-d,v=0,E=-h-d|0,C=0,B=0|h,b=d-h*c|0,x=0,w=0,Q=0,_=2*c|0,S=n(_),k=n(_),D=0,T=0,M=-1,R=-1,L=0,N=0|-c,F=0|c,O=0,P=-c-1|0,G=c-1|0,U=0,z=0,q=0;for(x=0;x0){if(w=1,S[D++]=r(g[p],o,s,l),p+=B,c>0)for(x=1,A=g[p],T=S[D]=r(A,o,s,l),L=S[D+M],O=S[D+N],U=S[D+P],T===L&&T===O&&T===U||(m=g[p+y],v=g[p+I],C=g[p+E],e(x,w,A,m,v,C,T,L,O,U,o,s,l),z=k[D]=Q++),D+=1,p+=B,x=2;x0)for(x=1,A=g[p],T=S[D]=r(A,o,s,l),L=S[D+M],O=S[D+N],U=S[D+P],T===L&&T===O&&T===U||(m=g[p+y],v=g[p+I],C=g[p+E],e(x,w,A,m,v,C,T,L,O,U,o,s,l),z=k[D]=Q++,U!==O&&t(k[D+N],z,v,C,O,U,o,s,l)),D+=1,p+=B,x=2;x0){if(x=1,S[D++]=r(g[p],o,s,l),p+=B,u>0)for(w=1,A=g[p],T=S[D]=r(A,o,s,l),O=S[D+N],L=S[D+M],U=S[D+P],T===O&&T===L&&T===U||(m=g[p+y],v=g[p+I],C=g[p+E],e(x,w,A,m,v,C,T,O,L,U,o,s,l),z=k[D]=Q++),D+=1,p+=B,w=2;w0)for(w=1,A=g[p],T=S[D]=r(A,o,s,l),O=S[D+N],L=S[D+M],U=S[D+P],T===O&&T===L&&T===U||(m=g[p+y],v=g[p+I],C=g[p+E],e(x,w,A,m,v,C,T,O,L,U,o,s,l),z=k[D]=Q++,U!==O&&t(k[D+N],z,C,m,U,O,o,s,l)),D+=1,p+=B,w=2;w2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),e.pick(0,-1,1).lo(1).hi(a[1]-2)),t(e.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),e.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),t(e.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),e.pick(-1,0,0).lo(1).hi(a[0]-2)),t(e.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),e.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),t(e.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),e.set(0,0,0,0),e.set(0,0,1,0),e.set(a[0]-1,0,0,0),e.set(a[0]-1,0,1,0),e.set(0,a[1]-1,0,0),e.set(0,a[1]-1,1,0),e.set(a[0]-1,a[1]-1,0,0),e.set(a[0]-1,a[1]-1,1,0),e}}e.exports=function(e,t,r){return Array.isArray(r)||(r=n(t.dimension,"string"===typeof r?r:"clamp")),0===t.size?e:0===t.dimension?(e.set(0),e):function(e){var t=e.join();if(a=c[t])return a;for(var r=e.length,n=[u,g],i=1;i<=r;++i)n.push(f(i));var a=h.apply(void 0,n);return c[t]=a,a}(r)(e,t)}},4317:function(e){"use strict";function t(e,t){var r=Math.floor(t),n=t-r,i=0<=r&&r0;){I<64?(l=I,I=0):(l=64,I-=64);for(var v=0|e[1];v>0;){v<64?(A=v,v=0):(A=64,v-=64),n=y+I*u+v*g,o=m+I*h+v*d;var E=0,C=0,B=0,b=f,x=u-c*f,w=g-l*u,Q=p,_=h-c*p,S=d-l*h;for(B=0;B0;){d<64?(l=d,d=0):(l=64,d-=64);for(var p=0|e[0];p>0;){p<64?(s=p,p=0):(s=64,p-=64),n=f+d*c+p*A,o=h+d*g+p*u;var y=0,m=0,I=c,v=A-l*c,E=g,C=u-l*g;for(m=0;m0;){m<64?(A=m,m=0):(A=64,m-=64);for(var I=0|e[0];I>0;){I<64?(s=I,I=0):(s=64,I-=64);for(var v=0|e[1];v>0;){v<64?(l=v,v=0):(l=64,v-=64),n=p+m*g+I*c+v*u,o=y+m*d+I*f+v*h;var E=0,C=0,B=0,b=g,x=c-A*g,w=u-s*c,Q=d,_=f-A*d,S=h-s*f;for(B=0;Br;){y=0,m=d-o;t:for(p=0;pv)break t;m+=u,y+=g}for(y=d,m=d-o,p=0;p>1,H=q-G,Y=q+G,J=U,K=H,j=q,V=Y,W=z,Z=i+1,X=a-1,$=!0,ee=0,te=0,re=0,ne=u,ie=t(ne),ae=t(ne);x=l*J,w=l*K,P=s;e:for(b=0;b0){p=J,J=K,K=p;break e}if(re<0)break e;P+=f}x=l*V,w=l*W,P=s;e:for(b=0;b0){p=V,V=W,W=p;break e}if(re<0)break e;P+=f}x=l*J,w=l*j,P=s;e:for(b=0;b0){p=J,J=j,j=p;break e}if(re<0)break e;P+=f}x=l*K,w=l*j,P=s;e:for(b=0;b0){p=K,K=j,j=p;break e}if(re<0)break e;P+=f}x=l*J,w=l*V,P=s;e:for(b=0;b0){p=J,J=V,V=p;break e}if(re<0)break e;P+=f}x=l*j,w=l*V,P=s;e:for(b=0;b0){p=j,j=V,V=p;break e}if(re<0)break e;P+=f}x=l*K,w=l*W,P=s;e:for(b=0;b0){p=K,K=W,W=p;break e}if(re<0)break e;P+=f}x=l*K,w=l*j,P=s;e:for(b=0;b0){p=K,K=j,j=p;break e}if(re<0)break e;P+=f}x=l*V,w=l*W,P=s;e:for(b=0;b0){p=V,V=W,W=p;break e}if(re<0)break e;P+=f}for(x=l*J,w=l*K,Q=l*j,_=l*V,S=l*W,k=l*U,D=l*q,T=l*z,O=0,P=s,b=0;b0)){if(re<0){for(x=l*v,w=l*Z,Q=l*X,P=s,b=0;b0)for(;;){for(E=s+X*l,O=0,b=0;b0)){for(E=s+X*l,O=0,b=0;bz){e:for(;;){for(E=s+Z*l,O=0,P=s,b=0;b1&&n?s(r,n[0],n[1]):s(r)}(e,t,l);return n(l,A)}},446:function(e,t,r){"use strict";var n=r(7640),i={};e.exports=function(e){var t=e.order,r=e.dtype,a=[t,r].join(":"),o=i[a];return o||(i[a]=o=n(t,r)),o(e),e}},9618:function(e,t,r){var n=r(7163),i="undefined"!==typeof Float64Array;function a(e,t){return e[0]-t[0]}function o(){var e,t=this.stride,r=new Array(t.length);for(e=0;e=0&&(t+=a*(r=0|e),i-=r),new n(this.data,i,a,t)},i.step=function(e){var t=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"===typeof e&&((a=0|e)<0?(i+=r*(t-1),t=o(-t/a)):t=o(t/a),r*=a),new n(this.data,t,r,i)},i.transpose=function(e){e=void 0===e?0:0|e;var t=this.shape,r=this.stride;return new n(this.data,t[e],r[e],this.offset)},i.pick=function(e){var r=[],n=[],i=this.offset;return"number"===typeof e&&e>=0?i=i+this.stride[0]*e|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,t[r.length+1])(this.data,r,n,i)},function(e,t,r,i){return new n(e,t[0],r[0],i)}},2:function(e,t,r){function n(e,t,r,n,i,a){this.data=e,this.shape=[t,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=e,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(t,r,n){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]=n},i.get=function(t,r){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]},i.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},i.hi=function(e,t){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,this.stride[0],this.stride[1],this.offset)},i.lo=function(e,t){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"===typeof e&&e>=0&&(r+=s*(i=0|e),a-=i),"number"===typeof t&&t>=0&&(r+=l*(i=0|t),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(e,t){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,A=Math.ceil;return"number"===typeof e&&((l=0|e)<0?(s+=a*(r-1),r=A(-r/l)):r=A(r/l),a*=l),"number"===typeof t&&((l=0|t)<0?(s+=o*(i-1),i=A(-i/l)):i=A(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(e,t){e=void 0===e?0:0|e,t=void 0===t?1:0|t;var r=this.shape,i=this.stride;return new n(this.data,r[e],r[t],i[e],i[t],this.offset)},i.pick=function(e,r){var n=[],i=[],a=this.offset;return"number"===typeof e&&e>=0?a=a+this.stride[0]*e|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"===typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,t[n.length+1])(this.data,n,i,a)},function(e,t,r,i){return new n(e,t[0],t[1],r[0],r[1],i)}},3:function(e,t,r){function n(e,t,r,n,i,a,o,s){this.data=e,this.shape=[t,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=e,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var e=Math.abs(this.stride[0]),t=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return e>t?t>r?[2,1,0]:e>r?[1,2,0]:[1,0,2]:e>r?[2,0,1]:r>t?[0,1,2]:[0,2,1]}}),i.set=function(t,r,n,i){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(t,r,n){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]},i.index=function(e,t,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r},i.hi=function(e,t,r){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(e,t,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],A=this.stride[0],c=this.stride[1],u=this.stride[2];return"number"===typeof e&&e>=0&&(i+=A*(a=0|e),o-=a),"number"===typeof t&&t>=0&&(i+=c*(a=0|t),s-=a),"number"===typeof r&&r>=0&&(i+=u*(a=0|r),l-=a),new n(this.data,o,s,l,A,c,u,i)},i.step=function(e,t,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],A=this.stride[2],c=this.offset,u=0,g=Math.ceil;return"number"===typeof e&&((u=0|e)<0?(c+=s*(i-1),i=g(-i/u)):i=g(i/u),s*=u),"number"===typeof t&&((u=0|t)<0?(c+=l*(a-1),a=g(-a/u)):a=g(a/u),l*=u),"number"===typeof r&&((u=0|r)<0?(c+=A*(o-1),o=g(-o/u)):o=g(o/u),A*=u),new n(this.data,i,a,o,s,l,A,c)},i.transpose=function(e,t,r){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[e],i[t],i[r],a[e],a[t],a[r],this.offset)},i.pick=function(e,r,n){var i=[],a=[],o=this.offset;return"number"===typeof e&&e>=0?o=o+this.stride[0]*e|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"===typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"===typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,t[i.length+1])(this.data,i,a,o)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],r[0],r[1],r[2],i)}},4:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,A){this.data=e,this.shape=[t,r,n,i],this.stride=[a,o,s,l],this.offset=0|A}var i=n.prototype;return i.dtype=e,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(t,r,n,i){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(e,t,r,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n},i.hi=function(e,t,r,i){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(e,t,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],A=this.shape[2],c=this.shape[3],u=this.stride[0],g=this.stride[1],f=this.stride[2],h=this.stride[3];return"number"===typeof e&&e>=0&&(a+=u*(o=0|e),s-=o),"number"===typeof t&&t>=0&&(a+=g*(o=0|t),l-=o),"number"===typeof r&&r>=0&&(a+=f*(o=0|r),A-=o),"number"===typeof i&&i>=0&&(a+=h*(o=0|i),c-=o),new n(this.data,s,l,A,c,u,g,f,h,a)},i.step=function(e,t,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],A=this.stride[0],c=this.stride[1],u=this.stride[2],g=this.stride[3],f=this.offset,h=0,d=Math.ceil;return"number"===typeof e&&((h=0|e)<0?(f+=A*(a-1),a=d(-a/h)):a=d(a/h),A*=h),"number"===typeof t&&((h=0|t)<0?(f+=c*(o-1),o=d(-o/h)):o=d(o/h),c*=h),"number"===typeof r&&((h=0|r)<0?(f+=u*(s-1),s=d(-s/h)):s=d(s/h),u*=h),"number"===typeof i&&((h=0|i)<0?(f+=g*(l-1),l=d(-l/h)):l=d(l/h),g*=h),new n(this.data,a,o,s,l,A,c,u,g,f)},i.transpose=function(e,t,r,i){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[e],a[t],a[r],a[i],o[e],o[t],o[r],o[i],this.offset)},i.pick=function(e,r,n,i){var a=[],o=[],s=this.offset;return"number"===typeof e&&e>=0?s=s+this.stride[0]*e|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"===typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"===typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"===typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,t[a.length+1])(this.data,a,o,s)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],r[0],r[1],r[2],r[3],i)}},5:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,A,c,u){this.data=e,this.shape=[t,r,n,i,a],this.stride=[o,s,l,A,c],this.offset=0|u}var i=n.prototype;return i.dtype=e,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a,o){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(t,r,n,i,a){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(e,t,r,n,i){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(e,t,r,i,a){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,"number"!==typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(e,t,r,i,a){var o=this.offset,s=0,l=this.shape[0],A=this.shape[1],c=this.shape[2],u=this.shape[3],g=this.shape[4],f=this.stride[0],h=this.stride[1],d=this.stride[2],p=this.stride[3],y=this.stride[4];return"number"===typeof e&&e>=0&&(o+=f*(s=0|e),l-=s),"number"===typeof t&&t>=0&&(o+=h*(s=0|t),A-=s),"number"===typeof r&&r>=0&&(o+=d*(s=0|r),c-=s),"number"===typeof i&&i>=0&&(o+=p*(s=0|i),u-=s),"number"===typeof a&&a>=0&&(o+=y*(s=0|a),g-=s),new n(this.data,l,A,c,u,g,f,h,d,p,y,o)},i.step=function(e,t,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],A=this.shape[3],c=this.shape[4],u=this.stride[0],g=this.stride[1],f=this.stride[2],h=this.stride[3],d=this.stride[4],p=this.offset,y=0,m=Math.ceil;return"number"===typeof e&&((y=0|e)<0?(p+=u*(o-1),o=m(-o/y)):o=m(o/y),u*=y),"number"===typeof t&&((y=0|t)<0?(p+=g*(s-1),s=m(-s/y)):s=m(s/y),g*=y),"number"===typeof r&&((y=0|r)<0?(p+=f*(l-1),l=m(-l/y)):l=m(l/y),f*=y),"number"===typeof i&&((y=0|i)<0?(p+=h*(A-1),A=m(-A/y)):A=m(A/y),h*=y),"number"===typeof a&&((y=0|a)<0?(p+=d*(c-1),c=m(-c/y)):c=m(c/y),d*=y),new n(this.data,o,s,l,A,c,u,g,f,h,d,p)},i.transpose=function(e,t,r,i,a){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[e],o[t],o[r],o[i],o[a],s[e],s[t],s[r],s[i],s[a],this.offset)},i.pick=function(e,r,n,i,a){var o=[],s=[],l=this.offset;return"number"===typeof e&&e>=0?l=l+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"===typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"===typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"===typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"===typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,t[o.length+1])(this.data,o,s,l)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],t[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(e,t){var r=-1===t?"T":String(t),n=s[r];return-1===t?n(e):0===t?n(e,A[e][0]):n(e,A[e],o)}var A={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(e,t,r,a){if(void 0===e)return(0,A.array[0])([]);"number"===typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=t[s]}if(void 0===a)for(a=0,s=0;s>>0;e.exports=function(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(0===e)return t<0?-i:i;var r=n.hi(e),o=n.lo(e);return t>e===e>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(e,t){t.vertexNormals=function(e,t,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var v=i[A],E=1/Math.sqrt(p*m);for(I=0;I<3;++I){var C=(I+1)%3,B=(I+2)%3;v[I]+=E*(y[C]*d[B]-y[B]*d[C])}}}for(o=0;oa)for(E=1/Math.sqrt(b),I=0;I<3;++I)v[I]*=E;else for(I=0;I<3;++I)v[I]=0}return i},t.faceNormals=function(e,t,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(f):0,A=0;A<3;++A)g[A]*=f;i[o]=g}return i}},4081:function(e){"use strict";e.exports=function(e,t,r,n,i,a,o,s,l,A){var c=t+a+A;if(u>0){var u=Math.sqrt(c+1);e[0]=.5*(o-l)/u,e[1]=.5*(s-n)/u,e[2]=.5*(r-a)/u,e[3]=.5*u}else{var g=Math.max(t,a,A);u=Math.sqrt(2*g-c+1),t>=g?(e[0]=.5*u,e[1]=.5*(i+r)/u,e[2]=.5*(s+n)/u,e[3]=.5*(o-l)/u):a>=g?(e[0]=.5*(r+i)/u,e[1]=.5*u,e[2]=.5*(l+o)/u,e[3]=.5*(s-n)/u):(e[0]=.5*(n+s)/u,e[1]=.5*(o+l)/u,e[2]=.5*u,e[3]=.5*(r-i)/u)}return e}},9977:function(e,t,r){"use strict";e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.rotation||[0,0,0,1],n=e.radius||1;t=[].slice.call(t,0,3),c(r=[].slice.call(r,0,4),r);var i=new u(r,t,Math.log(n));return i.setDistanceLimits(e.zoomMin,e.zoomMax),("eye"in e||"up"in e)&&i.lookAt(0,e.eye,e.center,e.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function A(e,t,r,n){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2)+Math.pow(n,2))}function c(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=A(r,n,i,a);o>1e-6?(e[0]=r/o,e[1]=n/o,e[2]=i/o,e[3]=a/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function u(e,t,r){this.radius=n([r]),this.center=n(t),this.rotation=n(e),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)}var g=u.prototype;g.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},g.recalcMatrix=function(e){this.radius.curve(e),this.center.curve(e),this.rotation.curve(e);var t=this.computedRotation;c(t,t);var r=this.computedMatrix;a(r,t);var n=this.computedCenter,i=this.computedEye,o=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],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var A=0,u=0;u<3;++u)A+=r[l+4*u]*i[u];r[12+l]=-A}},g.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r},g.idle=function(e){this.center.idle(e),this.radius.idle(e),this.rotation.idle(e)},g.flush=function(e){this.center.flush(e),this.radius.flush(e),this.rotation.flush(e)},g.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],A=l(a,o,s);a/=A,o/=A,s/=A;var c=i[0],u=i[4],g=i[8],f=c*a+u*o+g*s,h=l(c-=a*f,u-=o*f,g-=s*f);c/=h,u/=h,g/=h;var d=i[2],p=i[6],y=i[10],m=d*a+p*o+y*s,I=d*c+p*u+y*g,v=l(d-=m*a+I*c,p-=m*o+I*u,y-=m*s+I*g);d/=v,p/=v,y/=v;var E=c*t+a*r,C=u*t+o*r,B=g*t+s*r;this.center.move(e,E,C,B);var b=Math.exp(this.computedRadius[0]);b=Math.max(1e-4,b+n),this.radius.set(e,Math.log(b))},g.rotate=function(e,t,r,n){this.recalcMatrix(e),t=t||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],u=i[5],g=i[9],f=i[2],h=i[6],d=i[10],p=t*a+r*c,y=t*o+r*u,m=t*s+r*g,I=-(h*m-d*y),v=-(d*p-f*m),E=-(f*y-h*p),C=Math.sqrt(Math.max(0,1-Math.pow(I,2)-Math.pow(v,2)-Math.pow(E,2))),B=A(I,v,E,C);B>1e-6?(I/=B,v/=B,E/=B,C/=B):(I=v=E=0,C=1);var b=this.computedRotation,x=b[0],w=b[1],Q=b[2],_=b[3],S=x*C+_*I+w*E-Q*v,k=w*C+_*v+Q*I-x*E,D=Q*C+_*E+x*v-w*I,T=_*C-x*I-w*v-Q*E;if(n){I=f,v=h,E=d;var M=Math.sin(n)/l(I,v,E);I*=M,v*=M,E*=M,T=T*(C=Math.cos(t))-(S=S*C+T*I+k*E-D*v)*I-(k=k*C+T*v+D*I-S*E)*v-(D=D*C+T*E+S*v-k*I)*E}var R=A(S,k,D,T);R>1e-6?(S/=R,k/=R,D/=R,T/=R):(S=k=D=0,T=1),this.rotation.set(e,S,k,D,T)},g.lookAt=function(e,t,r,n){this.recalcMatrix(e),r=r||this.computedCenter,t=t||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,t,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(e,o[0],o[1],o[2],o[3]);for(var l=0,A=0;A<3;++A)l+=Math.pow(r[A]-t[A],2);this.radius.set(e,.5*Math.log(Math.max(l,1e-6))),this.center.set(e,r[0],r[1],r[2])},g.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},g.setMatrix=function(e,t){var r=this.computedRotation;s(r,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),c(r,r),this.rotation.set(e,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,t);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,A=n[14]/i;this.recalcMatrix(e);var u=Math.exp(this.computedRadius[0]);this.center.set(e,a-n[2]*u,l-n[6]*u,A-n[10]*u),this.radius.idle(e)}else this.center.idle(e),this.radius.idle(e)},g.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},g.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},g.getDistanceLimits=function(e){var t=this.radius.bounds;return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},g.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]}},g.fromJSON=function(e){var t=this.lastT(),r=e.center;r&&this.center.set(t,r[0],r[1],r[2]);var n=e.rotation;n&&this.rotation.set(t,n[0],n[1],n[2],n[3]);var i=e.distance;i&&i>0&&this.radius.set(t,Math.log(i)),this.setDistanceLimits(e.zoomMin,e.zoomMax)}},1371:function(e,t,r){"use strict";var n=r(3233);e.exports=function(e,t,r){return n(r="undefined"!==typeof r?r+"":" ",t)+e}},3202:function(e){e.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},3088:function(e,t,r){"use strict";e.exports=function(e,t){for(var r=0|t.length,i=e.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var u=0;u<2;++u)for(var g=a[u][r],f=0;f0&&(o=h,s=d,l=u)}return i||o&&A(o,l),s}function u(e,r){var i=a[r][e][0],o=[e];A(i,r);for(var s=i[1^r];;){for(;s!==e;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][e].length+a[1][e].length===0)break;var l=o[o.length-1],u=e,g=o[1],f=c(l,u,!0);if(n(t[l],t[u],t[g],t[f])<0)break;o.push(e),s=c(l,u)}return o}function g(e,t){return t[1]===t[t.length-1]}for(o=0;o0;){a[0][o].length;var d=u(o,f);g(0,d)?h.push.apply(h,d):(h.length>0&&l.push(h),h=d)}h.length>0&&l.push(h)}return l};var n=r(3140)},5609:function(e,t,r){"use strict";e.exports=function(e,t){for(var r=n(e,t.length),i=new Array(t.length),a=new Array(t.length),o=[],s=0;s0;){i[f=o.pop()]=!1;var A=r[f];for(s=0;s0}))).length,p=new Array(d),y=new Array(d);for(f=0;f0;){var O=N.pop(),P=_[O];l(P,(function(e,t){return e-t}));var G,U=P.length,z=F[O];for(0===z&&(G=[q=h[O]]),f=0;f=0||(F[H]=1^z,N.push(H),0===z&&(L(q=h[H])||(q.reverse(),G.push(q))))}0===z&&r.push(G)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),A=r(5609);function c(e,t){for(var r=new Array(e),n=0;n0&&t[i]===r[0]))return 1;a=e[i-1]}for(var s=1;a;){var l=a.key,A=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(A>0)a=a.left;else{if(!(A<0))return 0;s=1,a=a.right}}return s}}(y.slabs,y.coordinates);return 0===a.length?m:function(e,t){return function(r){return e(r[0],r[1])?0:t(r)}}(l(a),m)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(e){for(var t={},r=0;r=A?(b=1,m=A+2*g+h):m=g*(b=-g/A)+h):(b=0,f>=0?(x=0,m=h):-f>=u?(x=1,m=u+2*f+h):m=f*(x=-f/u)+h);else if(x<0)x=0,g>=0?(b=0,m=h):-g>=A?(b=1,m=A+2*g+h):m=g*(b=-g/A)+h;else{var w=1/B;m=(b*=w)*(A*b+c*(x*=w)+2*g)+x*(c*b+u*x+2*f)+h}else b<0?(v=u+f)>(I=c+g)?(E=v-I)>=(C=A-2*c+u)?(b=1,x=0,m=A+2*g+h):m=(b=E/C)*(A*b+c*(x=1-b)+2*g)+x*(c*b+u*x+2*f)+h:(b=0,v<=0?(x=1,m=u+2*f+h):f>=0?(x=0,m=h):m=f*(x=-f/u)+h):x<0?(v=A+g)>(I=c+f)?(E=v-I)>=(C=A-2*c+u)?(x=1,b=0,m=u+2*f+h):m=(b=1-(x=E/C))*(A*b+c*x+2*g)+x*(c*b+u*x+2*f)+h:(x=0,v<=0?(b=1,m=A+2*g+h):g>=0?(b=0,m=h):m=g*(b=-g/A)+h):(E=u+f-c-g)<=0?(b=0,x=1,m=u+2*f+h):E>=(C=A-2*c+u)?(b=1,x=0,m=A+2*g+h):m=(b=E/C)*(A*b+c*(x=1-b)+2*g)+x*(c*b+u*x+2*f)+h;var Q=1-b-x;for(l=0;l0){var A=e[r-1];if(0===n(s,A)&&a(A)!==l){r-=1;continue}}e[r++]=s}}return e.length=r,e}},3233:function(e){"use strict";var t,r="";e.exports=function(e,n){if("string"!==typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var i=e.length*n;if(t!==e||"undefined"===typeof t)t=e,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,i)}},3025:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){"use strict";e.exports=function(e){for(var t=e.length,r=e[e.length-1],n=t,i=t-2;i>=0;--i){var a=r;(l=(s=e[i])-((r=a+s)-a))&&(e[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:u(e,t,r)},function(e,t,r,n){var i=e[0]-n[0],a=t[0]-n[0],o=r[0]-n[0],s=e[1]-n[1],l=t[1]-n[1],A=r[1]-n[1],c=e[2]-n[2],u=t[2]-n[2],f=r[2]-n[2],h=a*A,d=o*l,p=o*s,y=i*A,m=i*l,I=a*s,v=c*(h-d)+u*(p-y)+f*(m-I),E=7771561172376103e-31*((Math.abs(h)+Math.abs(d))*Math.abs(c)+(Math.abs(p)+Math.abs(y))*Math.abs(u)+(Math.abs(m)+Math.abs(I))*Math.abs(f));return v>E||-v>E?v:g(e,t,r,n)}];function h(e){var t=f[e.length];return t||(t=f[e.length]=c(e.length)),t.apply(void 0,e)}function d(e,t,r,n,i,a,o){return function(t,r,s,l,A){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return i(t,r,s);case 4:return a(t,r,s,l);case 5:return o(t,r,s,l,A)}for(var c=new Array(arguments.length),u=0;u0&&o>0||a<0&&o<0)return!1;var s=n(r,e,t),l=n(i,e,t);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(e,t,r,n){for(var i=0;i<2;++i){var a=e[i],o=t[i],s=Math.min(a,o),l=Math.max(a,o),A=r[i],c=n[i],u=Math.min(A,c);if(Math.max(A,c)=n?(i=u,(l+=1)=n?(i=u,(l+=1)>1,A=t[2*l+1];if(A===a)return l;a>1,A=t[2*l+1];if(A===a)return l;a>1,A=t[2*l+1];if(A===a)return l;a0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},2014:function(e,t,r){"use strict";var n=r(3105),i=r(4623);function a(e,t){var r=e.length,n=e.length-t.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||i(e[0],e[1])-i(t[0],t[1]);case 3:var a=e[0]+e[1],o=t[0]+t[1];if(s=a+e[2]-(o+t[2]))return s;var s,l=i(e[0],e[1]),A=i(t[0],t[1]);return(s=i(l,e[2])-i(A,t[2]))||i(l+e[2],a)-i(A+t[2],o);default:var c=e.slice(0);c.sort();var u=t.slice(0);u.sort();for(var g=0;g>1,s=a(e[o],t);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(e,t){for(var r=new Array(e.length),i=0,o=r.length;i=e.length||0!==a(e[p],s)););}return r}function u(e,t){if(t<0)return[];for(var r=[],i=(1<>>c&1&&A.push(i[c]);t.push(A)}return s(t)},t.skeleton=u,t.boundary=function(e){for(var t=[],r=0,n=e.length;r>1:(e>>1)-1}function I(e){for(var t=y(e);;){var r=t,n=2*e+1,i=2*(e+1),a=e;if(n0;){var r=m(e);if(!(r>=0&&t0){var e=b[0];return p(0,w-1),w-=1,I(0),e}return-1}function C(e,t){var r=b[e];return A[r]===t?e:(A[r]=-1/0,v(e),E(),A[r]=t,v((w+=1)-1))}function B(e){if(!c[e]){c[e]=!0;var t=s[e],r=l[e];s[r]>=0&&(s[r]=t),l[t]>=0&&(l[t]=r),x[t]>=0&&C(x[t],d(t)),x[r]>=0&&C(x[r],d(r))}}var b=[],x=new Array(a);for(u=0;u>1;u>=0;--u)I(u);for(;;){var Q=E();if(Q<0||A[Q]>r)break;B(Q)}var _=[];for(u=0;u=0&&r>=0&&t!==r){var n=x[t],i=x[r];n!==i&&k.push([n,i])}})),i.unique(i.normalize(k)),{positions:_,edges:k}};var n=r(3250),i=r(2014)},1303:function(e,t,r){"use strict";e.exports=function(e,t){var r,a,o,s;if(t[0][0]t[1][0]))return i(t,e);r=t[1],a=t[0]}if(e[0][0]e[1][0]))return-i(e,t);o=e[1],s=e[0]}var l=n(r,a,s),A=n(r,a,o);if(l<0){if(A<=0)return l}else if(l>0){if(A>=0)return l}else if(A)return A;if(l=n(s,o,a),A=n(s,o,r),l<0){if(A<=0)return l}else if(l>0){if(A>=0)return l}else if(A)return A;return a[0]-s[0]};var n=r(3250);function i(e,t){var r,i,a,o;if(t[0][0]t[1][0])){var s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]),A=Math.min(t[0][1],t[1][1]),c=Math.max(t[0][1],t[1][1]);return lc?s-c:l-c}r=t[1],i=t[0]}e[0][1]0)if(t[0]!==o[1][0])r=e,e=e.right;else{if(l=A(e.right,t))return l;e=e.left}else{if(t[0]!==o[1][0])return e;var l;if(l=A(e.right,t))return l;e=e.left}}return r}function c(e,t,r,n){this.y=e,this.index=t,this.start=r,this.closed=n}function u(e,t,r,n){this.x=e,this.segment=t,this.create=r,this.index=n}s.prototype.castUp=function(e){var t=n.le(this.coordinates,e[0]);if(t<0)return-1;this.slabs[t];var r=A(this.slabs[t],e),i=-1;if(r&&(i=r.value),this.coordinates[t]===e[0]){var s=null;if(r&&(s=r.key),t>0){var c=A(this.slabs[t-1],e);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var u=this.horizontal[t];if(u.length>0){var g=n.ge(u,e[1],l);if(g=u.length)return i;f=u[g]}}if(f.start)if(s){var h=a(s[0],s[1],[e[0],f.y]);s[0][0]>s[1][0]&&(h=-h),h>0&&(i=f.index)}else i=f.index;else f.y!==e[1]&&(i=f.index)}}}return i}},5202:function(e,t,r){"use strict";var n=r(1944),i=r(8210);function a(e,t){var r=i(n(e,t),[t[t.length-1]]);return r[r.length-1]}function o(e,t,r,n){var i=-t/(n-t);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=e.length,s=new Array(o),l=0;l0||i>0&&c<0){var u=o(s,c,l,i);r.push(u),n.push(u.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},e.exports.positive=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&A<0)&&r.push(o(i,A,s,n)),A>=0&&r.push(s.slice()),n=A}return r},e.exports.negative=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&A<0)&&r.push(o(i,A,s,n)),A<=0&&r.push(s.slice()),n=A}return r}},3387:function(e,t,r){var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(e){return function(e,t){var r,n,o,s,l,A,c,u,g,f=1,h=e.length,d="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?d+=r:(!i.number.test(s.type)||u&&!s.sign?g="":(g=u?"+":"-",r=r.toString().replace(i.sign,"")),A=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(g+r).length,l=s.width&&c>0?A.repeat(c):"",d+=s.align?g+r+l:"0"===A?g+l+r:l+g+r)}return d}(function(e){if(s[e])return s[e];for(var t,r=e,n=[],a=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var o=[],l=t[2],A=[];if(null===(A=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(A[1]);""!==(l=l.substring(A[0].length));)if(null!==(A=i.key_access.exec(l)))o.push(A[1]);else{if(null===(A=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(A[1])}t[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return s[e]=n}(e),arguments)}function o(e,t){return a.apply(null,[e].concat(t||[]))}var s=Object.create(null);t.sprintf=a,t.vsprintf=o,"undefined"!==typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(t,r,t,e))||(e.exports=n))}()},3711:function(e,t,r){"use strict";e.exports=function(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(1===e.dimension)return function(e,t){for(var r=i(e,t),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(e,t,r,n,i,a,o,s,l,A,c,u,g){var f=(0|o)+(s<<1)+(l<<2)+(A<<3)|0;if(0!==f&&15!==f)switch(f){case 0:case 15:c.push([e-.5,t-.5]);break;case 1:c.push([e-.25-.25*(n+r-2*g)/(r-n),t-.25-.25*(i+r-2*g)/(r-i)]);break;case 2:c.push([e-.75-.25*(-n-r+2*g)/(n-r),t-.25-.25*(a+n-2*g)/(n-a)]);break;case 3:c.push([e-.5,t-.5-.5*(i+r+a+n-4*g)/(r-i+n-a)]);break;case 4:c.push([e-.25-.25*(a+i-2*g)/(i-a),t-.75-.25*(-i-r+2*g)/(i-r)]);break;case 5:c.push([e-.5-.5*(n+r+a+i-4*g)/(r-n+i-a),t-.5]);break;case 6:c.push([e-.5-.25*(-n-r+a+i)/(n-r+i-a),t-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:c.push([e-.75-.25*(a+i-2*g)/(i-a),t-.75-.25*(a+n-2*g)/(n-a)]);break;case 8:c.push([e-.75-.25*(-a-i+2*g)/(a-i),t-.75-.25*(-a-n+2*g)/(a-n)]);break;case 9:c.push([e-.5-.25*(n+r+-a-i)/(r-n+a-i),t-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:c.push([e-.5-.5*(-n-r-a-i+4*g)/(n-r+a-i),t-.5]);break;case 11:c.push([e-.25-.25*(-a-i+2*g)/(a-i),t-.75-.25*(i+r-2*g)/(r-i)]);break;case 12:c.push([e-.5,t-.5-.5*(-i-r-a-n+4*g)/(i-r+a-n)]);break;case 13:c.push([e-.75-.25*(n+r-2*g)/(r-n),t-.25-.25*(-a-n+2*g)/(a-n)]);break;case 14:c.push([e-.25-.25*(-n-r+2*g)/(n-r),t-.25-.25*(-i-r+2*g)/(i-r)])}},cell:function(e,t,r,n,i,a,o,s,l){i?s.push([e,t]):s.push([t,e])}});return function(e,t){var r=[],i=[];return n(e,r,i,t),{positions:r,cells:i}}}},o={}},529:function(e,t,r){"use strict";e.exports=function e(t,r,n){var a=(n=n||{}).fontStyle||"normal",s=n.fontWeight||"normal",l=n.fontVariant||"normal",A=[a,s,l,t].join("_"),c=o[A];c||(c=o[A]={" ":{data:new Float32Array(0),shape:.2}});var u=c[r];if(!u)if(r.length<=1||!/\d/.test(r))u=c[r]=function(e){for(var t=e.cells,r=e.positions,n=new Float32Array(6*t.length),i=0,a=0,o=0;o0&&(d+=.02);var y=new Float32Array(h),m=0,I=-.5*d;for(p=0;pMath.max(r,n)?i[2]=1:r>Math.max(t,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=e[l]*e[l],o+=i[l]*e[l];for(l=0;l<3;++l)i[l]-=o/a*e[l];return s(i,i),i}function g(e,t,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(e,t),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 A=0;A<16;++A)this.computedMatrix[A]=.5;this.recalcMatrix(0)}var f=g.prototype;f.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},f.getDistanceLimits=function(e){var t=this.radius.bounds[0];return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},f.recalcMatrix=function(e){this.center.curve(e),this.up.curve(e),this.right.curve(e),this.radius.curve(e),this.angle.curve(e);for(var t=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=t[a]*r[a],n+=t[a]*t[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=t[a]*i/n,c+=r[a]*r[a],t[a]/=l;var u=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=u;var g=this.computedToward;o(g,t,r),s(g,g);var f=Math.exp(this.computedRadius[0]),h=this.computedAngle[0],d=this.computedAngle[1],p=Math.cos(h),y=Math.sin(h),m=Math.cos(d),I=Math.sin(d),v=this.computedCenter,E=p*m,C=y*m,B=I,b=-p*I,x=-y*I,w=m,Q=this.computedEye,_=this.computedMatrix;for(a=0;a<3;++a){var S=E*r[a]+C*g[a]+B*t[a];_[4*a+1]=b*r[a]+x*g[a]+w*t[a],_[4*a+2]=S,_[4*a+3]=0}var k=_[1],D=_[5],T=_[9],M=_[2],R=_[6],L=_[10],N=D*L-T*R,F=T*M-k*L,O=k*R-D*M,P=A(N,F,O);for(N/=P,F/=P,O/=P,_[0]=N,_[4]=F,_[8]=O,a=0;a<3;++a)Q[a]=v[a]+_[2+4*a]*f;for(a=0;a<3;++a){c=0;for(var G=0;G<3;++G)c+=_[a+4*G]*Q[G];_[12+a]=-c}_[15]=1},f.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r};var h=[0,0,0];f.rotate=function(e,t,r,n){if(this.angle.move(e,t,r),n){this.recalcMatrix(e);var i=this.computedMatrix;h[0]=i[2],h[1]=i[6],h[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,A=0;A<3;++A)i[4*A]=o[A],i[4*A+1]=s[A],i[4*A+2]=l[A];for(a(i,i,n,h),A=0;A<3;++A)o[A]=i[4*A],s[A]=i[4*A+1];this.up.set(e,o[0],o[1],o[2]),this.right.set(e,s[0],s[1],s[2])}},f.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=A(a,o,s);a/=l,o/=l,s/=l;var c=i[0],u=i[4],g=i[8],f=c*a+u*o+g*s,h=A(c-=a*f,u-=o*f,g-=s*f),d=(c/=h)*t+a*r,p=(u/=h)*t+o*r,y=(g/=h)*t+s*r;this.center.move(e,d,p,y);var m=Math.exp(this.computedRadius[0]);m=Math.max(1e-4,m+n),this.radius.set(e,Math.log(m))},f.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},f.setMatrix=function(e,t,r,n){var a=1;"number"===typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;t||(this.recalcMatrix(e),t=this.computedMatrix);var s=t[a],l=t[a+4],u=t[a+8];if(n){var g=Math.abs(s),f=Math.abs(l),h=Math.abs(u),d=Math.max(g,f,h);g===d?(s=s<0?-1:1,l=u=0):h===d?(u=u<0?-1:1,s=l=0):(l=l<0?-1:1,s=u=0)}else{var p=A(s,l,u);s/=p,l/=p,u/=p}var y,m,I=t[o],v=t[o+4],E=t[o+8],C=I*s+v*l+E*u,B=A(I-=s*C,v-=l*C,E-=u*C),b=l*(E/=B)-u*(v/=B),x=u*(I/=B)-s*E,w=s*v-l*I,Q=A(b,x,w);if(b/=Q,x/=Q,w/=Q,this.center.jump(e,H,Y,J),this.radius.idle(e),this.up.jump(e,s,l,u),this.right.jump(e,I,v,E),2===a){var _=t[1],S=t[5],k=t[9],D=_*I+S*v+k*E,T=_*b+S*x+k*w;y=N<0?-Math.PI/2:Math.PI/2,m=Math.atan2(T,D)}else{var M=t[2],R=t[6],L=t[10],N=M*s+R*l+L*u,F=M*I+R*v+L*E,O=M*b+R*x+L*w;y=Math.asin(c(N)),m=Math.atan2(O,F)}this.angle.jump(e,m,y),this.recalcMatrix(e);var P=t[2],G=t[6],U=t[10],z=this.computedMatrix;i(z,t);var q=z[15],H=z[12]/q,Y=z[13]/q,J=z[14]/q,K=Math.exp(this.computedRadius[0]);this.center.jump(e,H-P*K,Y-G*K,J-U*K)},f.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},f.idle=function(e){this.center.idle(e),this.up.idle(e),this.right.idle(e),this.radius.idle(e),this.angle.idle(e)},f.flush=function(e){this.center.flush(e),this.up.flush(e),this.right.flush(e),this.radius.flush(e),this.angle.flush(e)},f.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},f.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=A(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=t[0]-r[0],u=t[1]-r[1],g=t[2]-r[2],f=A(l,u,g);if(!(f<1e-6)){l/=f,u/=f,g/=f;var h=this.computedRight,d=h[0],p=h[1],y=h[2],m=i*d+a*p+o*y,I=A(d-=m*i,p-=m*a,y-=m*o);if(!(I<.01&&(I=A(d=a*g-o*u,p=o*l-i*g,y=i*u-a*l))<1e-6)){d/=I,p/=I,y/=I,this.up.set(e,i,a,o),this.right.set(e,d,p,y),this.center.set(e,r[0],r[1],r[2]),this.radius.set(e,Math.log(f));var v=a*y-o*p,E=o*d-i*y,C=i*p-a*d,B=A(v,E,C),b=i*l+a*u+o*g,x=d*l+p*u+y*g,w=(v/=B)*l+(E/=B)*u+(C/=B)*g,Q=Math.asin(c(b)),_=Math.atan2(w,x),S=this.angle._state,k=S[S.length-1],D=S[S.length-2];k%=2*Math.PI;var T=Math.abs(k+2*Math.PI-_),M=Math.abs(k-_),R=Math.abs(k-2*Math.PI-_);T0?r.pop():new ArrayBuffer(e)}function h(e){return new Uint8Array(f(e),0,e)}function d(e){return new Uint16Array(f(2*e),0,e)}function p(e){return new Uint32Array(f(4*e),0,e)}function y(e){return new Int8Array(f(e),0,e)}function m(e){return new Int16Array(f(2*e),0,e)}function I(e){return new Int32Array(f(4*e),0,e)}function v(e){return new Float32Array(f(4*e),0,e)}function E(e){return new Float64Array(f(8*e),0,e)}function C(e){return o?new Uint8ClampedArray(f(e),0,e):h(e)}function B(e){return s?new BigUint64Array(f(8*e),0,e):null}function b(e){return l?new BigInt64Array(f(8*e),0,e):null}function x(e){return new DataView(f(e),0,e)}function w(e){e=n.nextPow2(e);var t=n.log2(e),r=u[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))u[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);c[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){g(e.buffer)},t.freeArrayBuffer=g,t.freeBuffer=function(e){u[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return f(e);switch(t){case"uint8":return h(e);case"uint16":return d(e);case"uint32":return p(e);case"int8":return y(e);case"int16":return m(e);case"int32":return I(e);case"float":case"float32":return v(e);case"double":case"float64":return E(e);case"uint8_clamped":return C(e);case"bigint64":return b(e);case"biguint64":return B(e);case"buffer":return w(e);case"data":case"dataview":return x(e);default:return null}return null},t.mallocArrayBuffer=f,t.mallocUint8=h,t.mallocUint16=d,t.mallocUint32=p,t.mallocInt8=y,t.mallocInt16=m,t.mallocInt32=I,t.mallocFloat32=t.mallocFloat=v,t.mallocFloat64=t.mallocDouble=E,t.mallocUint8Clamped=C,t.mallocBigUint64=B,t.mallocBigInt64=b,t.mallocDataView=x,t.mallocBuffer=w,t.clearCache=function(){for(var e=0;e<32;++e)A.UINT8[e].length=0,A.UINT16[e].length=0,A.UINT32[e].length=0,A.INT8[e].length=0,A.INT16[e].length=0,A.INT32[e].length=0,A.FLOAT[e].length=0,A.DOUBLE[e].length=0,A.BIGUINT64[e].length=0,A.BIGINT64[e].length=0,A.UINT8C[e].length=0,c[e].length=0,u[e].length=0}},1755:function(e){"use strict";function t(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(e){return e})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",C(function(e,t,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(B=0;B-1?parseInt(e[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),w*=Math.pow(.75,l-s),n=n.replace("?px ",F())),x+=.25*S*(l-s)}if(!0===o.superscripts){var A=e.indexOf(h),u=r.indexOf(h),f=A>-1?parseInt(e[1+A]):0,d=u>-1?parseInt(r[1+u]):0;f!==d&&(n=n.replace(F(),"?px "),w*=Math.pow(.75,d-f),n=n.replace("?px ",F())),x-=.25*S*(d-f)}if(!0===o.bolds){var p=e.indexOf(c)>-1,m=r.indexOf(c)>-1;!p&&m&&(n=I?n.replace("italic ","italic bold "):"bold "+n),p&&!m&&(n=n.replace("bold ",""))}if(!0===o.italics){var I=e.indexOf(g)>-1,v=r.indexOf(g)>-1;!I&&v&&(n="italic "+n),I&&!v&&(n=n.replace("italic ",""))}t.font=n}for(C=0;C<_;++C){var P=Q[C]+"\n";for(b=0,x=C*S,w=n,L="",B=0;B",a="",o=i.length,s=a.length,l=t[0]===h||t[0]===y,A=0,c=-s;A>-1&&-1!==(A=r.indexOf(i,A))&&-1!==(c=r.indexOf(a,A+o))&&!(c<=A);){for(var u=A;u=c)n[u]=null,r=r.substr(0,u)+" "+r.substr(u+1);else if(null!==n[u]){var g=n[u].indexOf(t[0]);-1===g?n[u]+=t:l&&(n[u]=n[u].substr(0,g+1)+(1+parseInt(n[u][g+1]))+n[u].substr(g+2))}var f=A+o,d=r.substr(f,c-f).indexOf(i);A=-1!==d?d:c+s}return n}function v(e,t){var r=n(e,128);return t?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function E(e,t,r,n){var i=v(e,n),a=function(e,t,r){for(var n=t.textAlign||"start",i=t.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=e.length,l=0;l=0?t[a]:i}))},has___:{value:I((function(t){var n=m(t);return n?r in n:e.indexOf(t)>=0}))},set___:{value:I((function(n,i){var a,o=m(n);return o?o[r]=i:(a=e.indexOf(n))>=0?t[a]=i:(a=e.length,t[a]=i,e[a]=n),this}))},delete___:{value:I((function(n){var i,a,o=m(n);return o?r in o&&delete o[r]:!((i=e.indexOf(n))<0)&&(a=e.length-1,e[i]=void 0,t[i]=t[a],e[i]=e[a],e.length=a,t.length=a,!0)}))}})};d.prototype=Object.create(Object.prototype,{get:{value:function(e,t){return this.get___(e,t)},writable:!0,configurable:!0},has:{value:function(e){return this.has___(e)},writable:!0,configurable:!0},set:{value:function(e,t){return this.set___(e,t)},writable:!0,configurable:!0},delete:{value:function(e){return this.delete___(e)},writable:!0,configurable:!0}}),"function"===typeof r?function(){function n(){this instanceof d||v();var e,n=new r,i=void 0,a=!1;return e=t?function(e,t){return n.set(e,t),n.has(e)||(i||(i=new d),i.set(e,t)),this}:function(e,t){if(a)try{n.set(e,t)}catch(r){i||(i=new d),i.set___(e,t)}else n.set(e,t);return this},Object.create(d.prototype,{get___:{value:I((function(e,t){return i?n.has(e)?n.get(e):i.get___(e,t):n.get(e,t)}))},has___:{value:I((function(e){return n.has(e)||!!i&&i.has___(e)}))},set___:{value:I(e)},delete___:{value:I((function(e){var t=!!n.delete(e);return i&&i.delete___(e)||t}))},permitHostObjects___:{value:I((function(e){if(e!==p)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!==typeof Proxy&&(Proxy=void 0),n.prototype=d.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!==typeof Proxy&&(Proxy=void 0),e.exports=d)}function p(e){e.permitHostObjects___&&e.permitHostObjects___(p)}function y(e){return!(e.substr(0,8)==l&&"___"===e.substr(e.length-3))}function m(e){if(e!==Object(e))throw new TypeError("Not an object: "+e);var t=e[A];if(t&&t.key===e)return t;if(s(e)){t={key:e};try{return o(e,A,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch(r){return}}}function I(e){return e.prototype=null,Object.freeze(e)}function v(){f||"undefined"===typeof console||(f=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(e,t,r){var n=r(8284);e.exports=function(){var e={};return function(t){if(("object"!==typeof t||null===t)&&"function"!==typeof t)throw new Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:n(t,e)}}},8284:function(e){e.exports=function(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(e){return e!==t?n.apply(this,arguments):r},writable:!0}),r}},606:function(e,t,r){var n=r(236);e.exports=function(){var e=n();return{get:function(t,r){var n=e(t);return n.hasOwnProperty("value")?n.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}},3349:function(e){"use strict";var t=function(){return function(e,t,r,n,i,a){var o=e[0],s=r[0],l=[0],A=s;n|=0;var c=0,u=s;for(c=0;c=0!==f>=0&&i.push(l[0]+.5+.5*(g+f)/(g-f)),n+=u,++l[0]}}};e.exports=function(e){return r={funcName:e.funcName},function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=t[s];return l||(t[s]=l=e([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(t.bind(void 0,r));var r}({funcName:"zeroCrossings"})},781:function(e,t,r){"use strict";e.exports=function(e,t){var r=[];return t=+t||0,n(e.hi(e.shape[0]-1),r,t),r};var n=r(3349)},7790:function(){}},r={};function i(e){var n=r[e];if(void 0!==n)return n.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}i.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),i.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var a=i(1964);e.exports=a}()},33576:function(e,t,r){"use strict";function n(e,t){for(var r=0;rf)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,d.prototype),t}function d(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return m(e)}return p(e,t,r)}function p(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!d.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|C(e,t),n=h(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(re(e,Uint8Array)){var t=new Uint8Array(e);return v(t.buffer,t.byteOffset,t.byteLength)}return I(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(e));if(re(e,ArrayBuffer)||e&&re(e.buffer,ArrayBuffer))return v(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(re(e,SharedArrayBuffer)||e&&re(e.buffer,SharedArrayBuffer)))return v(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return d.from(n,t,r);var i=function(e){if(d.isBuffer(e)){var t=0|E(e.length),r=h(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||ne(e.length)?h(0):I(e):"Buffer"===e.type&&Array.isArray(e.data)?I(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return d.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(e))}function y(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function m(e){return y(e),h(e<0?0:0|E(e))}function I(e){for(var t=e.length<0?0:0|E(e.length),r=h(t),n=0;n=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|e}function C(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||re(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+A(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function B(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function x(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ne(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=d.from(t,n)),d.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function A(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var u=!0,g=0;gi&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,A=void 0,c=void 0,u=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(u=(31&a)<<6|63&l)>127&&(o=u);break;case 3:l=e[i+1],A=e[i+2],128===(192&l)&&128===(192&A)&&(u=(15&a)<<12|(63&l)<<6|63&A)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:l=e[i+1],A=e[i+2],c=e[i+3],128===(192&l)&&128===(192&A)&&128===(192&c)&&(u=(15&a)<<18|(63&l)<<12|(63&A)<<6|63&c)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?(d.isBuffer(a)||(a=d.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!d.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},d.byteLength=C,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},g&&(d.prototype[g]=d.prototype.inspect),d.prototype.compare=function(e,t,r,n,i){if(re(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+A(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(n,i),c=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return Q(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function L(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function G(e,t,r,n,i,a){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function U(e,t,r,n,i){V(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function z(e,t,r,n,i){V(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function q(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,4),u.write(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,8),u.write(e,t,r,n,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},d.prototype.readUint8=d.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readBigUInt64LE=ae((function(e){W(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},d.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readBigInt64LE=ae((function(e){W(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||P(e,4,this.length),u.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),u.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),u.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),u.read(this,e,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigUInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=ae((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>>=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=ae((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,n){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function V(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new J.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||Z(t,e.length-(r+1))}(n,i,a)}function W(e,t){if("number"!==typeof e)throw new J.ERR_INVALID_ARG_TYPE(t,"number",e)}function Z(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new J.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new J.ERR_BUFFER_OUT_OF_BOUNDS;throw new J.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}K("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),K("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(A(t))}),TypeError),K("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=j(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=j(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var X=/[^+/0-9A-Za-z-_]/g;function $(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function ee(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function te(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!==e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ae(e){return"undefined"===typeof BigInt?oe:e}function oe(){throw new Error("BigInt not supported")}},25928:function(e){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},48932:function(e,t,r){"use strict";r.r(t),r.d(t,{sankeyCenter:function(){return g},sankeyCircular:function(){return k},sankeyJustify:function(){return u},sankeyLeft:function(){return A},sankeyRight:function(){return c}});var n=r(84706),i=r(34712),a=r(10132),o=r(6688),s=r.n(o);function l(e){return e.target.depth}function A(e){return e.depth}function c(e,t){return t-1-e.height}function u(e,t){return e.sourceLinks.length?e.depth:t-1}function g(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?(0,n.SY)(e.sourceLinks,l)-1:0}function f(e){return function(){return e}}var h="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function d(e,t){return y(e.source,t.source)||e.index-t.index}function p(e,t){return y(e.target,t.target)||e.index-t.index}function y(e,t){return e.partOfCycle===t.partOfCycle?e.y0-t.y0:"top"===e.circularLinkType||"bottom"===t.circularLinkType?-1:1}function m(e){return e.value}function I(e){return(e.y0+e.y1)/2}function v(e){return I(e.source)}function E(e){return I(e.target)}function C(e){return e.index}function B(e){return e.nodes}function b(e){return e.links}function x(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function w(e,t){return t(e)}var Q=25,_=10,S=.3;function k(){var e,t,r=0,a=0,o=1,l=1,A=24,c=C,g=u,w=B,k=b,T=32,R=2,L=null;function F(){var u={nodes:w.apply(null,arguments),links:k.apply(null,arguments)};!function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=(0,i.kH)(e.nodes,c);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==("undefined"===typeof n?"undefined":h(n))&&(n=e.source=x(t,n)),"object"!==("undefined"===typeof i?"undefined":h(i))&&(i=e.target=x(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(u),function(e,t,r){var n=0;if(null===r){for(var i=[],a=0;a0;--h)p(f*=.99,u),C();function d(i){if(t){var c=1/0;g.forEach((function(e){var r=l*t/(e.length+1);c=r0?t+Q+_:t,bottom:r=r>0?r+Q+_:r,left:a=a>0?a+Q+_:a,right:i=i>0?i+Q+_:i}}(s),h=function(e,t){var i=(0,n.kv)(e.nodes,(function(e){return e.column})),s=o-r,c=l-a,u=s+t.right+t.left,g=c+t.top+t.bottom,f=s/u,h=c/g;return r=r*f+t.left,o=0==t.right?o:o*f,a=a*h+t.top,l*=h,e.nodes.forEach((function(e){e.x0=r+e.column*((o-r-A)/i),e.x1=e.x0+A})),h}(s,f);u*=h,s.links.forEach((function(e){e.width=e.value*u})),g.forEach((function(e){var t=e.length;e.forEach((function(e,r){e.depth==g.length-1&&1==t||0==e.depth&&1==t?(e.y0=l/2-e.value*u,e.y1=e.y0+e.value*u):e.partOfCycle?0==M(e,i)?(e.y0=l/2+r,e.y1=e.y0+e.value*u):"top"==e.circularLinkType?(e.y0=a+r,e.y1=e.y0+e.value*u):(e.y0=l-e.value*u-r,e.y1=e.y0+e.value*u):0==f.top||0==f.bottom?(e.y0=(l-a)/t*r,e.y1=e.y0+e.value*u):(e.y0=(l-a)/2-t/2+r,e.y1=e.y0+e.value*u)}))}))}function p(e,t){var r=g.length;g.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&M(i,t)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else if(o==r-1&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else{var A=(0,n.mo)(i.sourceLinks,E),c=(0,n.mo)(i.targetLinks,v),u=((A&&c?(A+c)/2:A||c)-I(i))*e;i.y0+=u,i.y1+=u}}))}))}function C(){g.forEach((function(t){var r,n,i,o=a,s=t.length;for(t.sort(y),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+e;if((n=o-e-l)>0)for(o=r.y0-=n,r.y1-=n,i=s-2;i>=0;--i)(n=(r=t[i]).y1+e-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}(u,T,c),O(u);for(var f=0;f<4;f++)j(u,l,c),V(u,0,c),J(u,a,l,c),j(u,l,c),V(u,0,c);return function(e,t,r){var i=e.nodes,a=e.links,o=!1,s=!1;if(a.forEach((function(e){"top"==e.circularLinkType?o=!0:"bottom"==e.circularLinkType&&(s=!0)})),0==o||0==s){var l=(0,n.SY)(i,(function(e){return e.y0})),A=(r-t)/((0,n.kv)(i,(function(e){return e.y1}))-l);i.forEach((function(e){var t=(e.y1-e.y0)*A;e.y0=(e.y0-l)*A,e.y1=e.y0+t})),a.forEach((function(e){e.y0=(e.y0-l)*A,e.y1=(e.y1-l)*A,e.width=e.width*A}))}}(u,a,l),N(u,R,l,c),u}function O(e){e.nodes.forEach((function(e){e.sourceLinks.sort(p),e.targetLinks.sort(d)})),e.nodes.forEach((function(e){var t=e.y0,r=t,n=e.y1,i=n;e.sourceLinks.forEach((function(e){e.circular?(e.y0=n-e.width/2,n-=e.width):(e.y0=t+e.width/2,t+=e.width)})),e.targetLinks.forEach((function(e){e.circular?(e.y1=i-e.width/2,i-=e.width):(e.y1=r+e.width/2,r+=e.width)}))}))}return F.nodeId=function(e){return arguments.length?(c="function"===typeof e?e:f(e),F):c},F.nodeAlign=function(e){return arguments.length?(g="function"===typeof e?e:f(e),F):g},F.nodeWidth=function(e){return arguments.length?(A=+e,F):A},F.nodePadding=function(t){return arguments.length?(e=+t,F):e},F.nodes=function(e){return arguments.length?(w="function"===typeof e?e:f(e),F):w},F.links=function(e){return arguments.length?(k="function"===typeof e?e:f(e),F):k},F.size=function(e){return arguments.length?(r=a=0,o=+e[0],l=+e[1],F):[o-r,l-a]},F.extent=function(e){return arguments.length?(r=+e[0][0],o=+e[1][0],a=+e[0][1],l=+e[1][1],F):[[r,a],[o,l]]},F.iterations=function(e){return arguments.length?(T=+e,F):T},F.circularLinkGap=function(e){return arguments.length?(R=+e,F):R},F.nodePaddingRatio=function(e){return arguments.length?(t=+e,F):t},F.sortNodes=function(e){return arguments.length?(L=e,F):L},F.update=function(e){return D(e,c),O(e),e.links.forEach((function(e){e.circular&&(e.circularLinkType=e.y0+e.y11||i>1)}function L(e,t,r){return e.sort(F),e.forEach((function(n,i){var a,o,s=0;if(X(n,r)&&R(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var A=e[l].circularPathData.verticalBuffer+e[l].width/2+t;s=A>s?A:s}n.circularPathData.verticalBuffer=s+n.width/2}})),e}function N(e,t,r,i){var o=(0,n.SY)(e.links,(function(e){return e.source.y0}));e.links.forEach((function(e){e.circular&&(e.circularPathData={})})),L(e.links.filter((function(e){return"top"==e.circularLinkType})),t,i),L(e.links.filter((function(e){return"bottom"==e.circularLinkType})),t,i),e.links.forEach((function(n){if(n.circular){if(n.circularPathData.arcRadius=n.width+_,n.circularPathData.leftNodeBuffer=5,n.circularPathData.rightNodeBuffer=5,n.circularPathData.sourceWidth=n.source.x1-n.source.x0,n.circularPathData.sourceX=n.source.x0+n.circularPathData.sourceWidth,n.circularPathData.targetX=n.target.x0,n.circularPathData.sourceY=n.y0,n.circularPathData.targetY=n.y1,X(n,i)&&R(n))n.circularPathData.leftSmallArcRadius=_+n.width/2,n.circularPathData.leftLargeArcRadius=_+n.width/2,n.circularPathData.rightSmallArcRadius=_+n.width/2,n.circularPathData.rightLargeArcRadius=_+n.width/2,"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=n.source.y1+Q+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=n.source.y0-Q-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius);else{var s=n.source.column,l=n.circularLinkType,A=e.links.filter((function(e){return e.source.column==s&&e.circularLinkType==l}));"bottom"==n.circularLinkType?A.sort(P):A.sort(O);var c=0;A.forEach((function(e,r){e.circularLinkID==n.circularLinkID&&(n.circularPathData.leftSmallArcRadius=_+n.width/2+c,n.circularPathData.leftLargeArcRadius=_+n.width/2+r*t+c),c+=e.width})),s=n.target.column,A=e.links.filter((function(e){return e.target.column==s&&e.circularLinkType==l})),"bottom"==n.circularLinkType?A.sort(U):A.sort(G),c=0,A.forEach((function(e,r){e.circularLinkID==n.circularLinkID&&(n.circularPathData.rightSmallArcRadius=_+n.width/2+c,n.circularPathData.rightLargeArcRadius=_+n.width/2+r*t+c),c+=e.width})),"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=Math.max(r,n.source.y1,n.target.y1)+Q+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=o-Q-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius)}n.circularPathData.leftInnerExtent=n.circularPathData.sourceX+n.circularPathData.leftNodeBuffer,n.circularPathData.rightInnerExtent=n.circularPathData.targetX-n.circularPathData.rightNodeBuffer,n.circularPathData.leftFullExtent=n.circularPathData.sourceX+n.circularPathData.leftLargeArcRadius+n.circularPathData.leftNodeBuffer,n.circularPathData.rightFullExtent=n.circularPathData.targetX-n.circularPathData.rightLargeArcRadius-n.circularPathData.rightNodeBuffer}if(n.circular)n.path=function(e){return"top"==e.circularLinkType?"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 0 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY-e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 0 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 0 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY-e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 0 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY:"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 1 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY+e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 1 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 1 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY+e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 1 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY}(n);else{var u=(0,a.ak)().source((function(e){return[e.source.x0+(e.source.x1-e.source.x0),e.y0]})).target((function(e){return[e.target.x0,e.y1]}));n.path=u(n)}}))}function F(e,t){return z(e)==z(t)?"bottom"==e.circularLinkType?P(e,t):O(e,t):z(t)-z(e)}function O(e,t){return e.y0-t.y0}function P(e,t){return t.y0-e.y0}function G(e,t){return e.y1-t.y1}function U(e,t){return t.y1-e.y1}function z(e){return e.target.column-e.source.column}function q(e){return e.target.x0-e.source.x1}function H(e,t){var r=T(e),n=q(t)/Math.tan(r);return"up"==Z(e)?e.y1+n:e.y1-n}function Y(e,t){var r=T(e),n=q(t)/Math.tan(r);return"up"==Z(e)?e.y1-n:e.y1+n}function J(e,t,r,n){e.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)e.nodes.forEach((function(o){if(o.column==a){var A,c=s/(l+1),u=Math.pow(1-c,3),g=3*c*Math.pow(1-c,2),f=3*Math.pow(c,2)*(1-c),h=Math.pow(c,3),d=u*i.y0+g*i.y0+f*i.y1+h*i.y1,p=d-i.width/2,y=d+i.width/2;p>o.y0&&pa.y0&&i.y0a.y0&&i.y1a.y1)&&K(e,A,t,r)}))):(y>o.y0&&yo.y1)&&(A=y-o.y0+10,o=K(o,A,t,r),e.nodes.forEach((function(e){w(e,n)!=w(o,n)&&e.column==o.column&&e.y0o.y1&&K(e,A,t,r)})))}}))}}))}function K(e,t,r,n){return e.y0+t>=r&&e.y1+t<=n&&(e.y0=e.y0+t,e.y1=e.y1+t,e.targetLinks.forEach((function(e){e.y1=e.y1+t})),e.sourceLinks.forEach((function(e){e.y0=e.y0+t}))),e}function j(e,t,r,n){e.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>t&&(i.y=i.y-(i.y+(i.y1-i.y0)-t));var a=e.links.filter((function(e){return w(e.source,r)==w(i,r)})),o=a.length;o>1&&a.sort((function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(!W(e,t))return e.y1-t.y1;if(e.target.column>t.target.column){var r=Y(t,e);return e.y1-r}if(t.target.column>e.target.column)return Y(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(e){e.y0=s+e.width/2,s+=e.width})),a.forEach((function(e,t){if("bottom"==e.circularLinkType){for(var r=t+1,n=0;r1&&n.sort((function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(!W(e,t))return e.y0-t.y0;if(t.source.column0?"up":"down"}function X(e,t){return w(e.source,t)==w(e.target,t)}},26800:function(e,t,r){"use strict";r.r(t),r.d(t,{sankey:function(){return C},sankeyCenter:function(){return A},sankeyJustify:function(){return l},sankeyLeft:function(){return o},sankeyLinkHorizontal:function(){return w},sankeyRight:function(){return s}});var n=r(84706),i=r(34712);function a(e){return e.target.depth}function o(e){return e.depth}function s(e,t){return t-1-e.height}function l(e,t){return e.sourceLinks.length?e.depth:t-1}function A(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?(0,n.SY)(e.sourceLinks,a)-1:0}function c(e){return function(){return e}}function u(e,t){return f(e.source,t.source)||e.index-t.index}function g(e,t){return f(e.target,t.target)||e.index-t.index}function f(e,t){return e.y0-t.y0}function h(e){return e.value}function d(e){return(e.y0+e.y1)/2}function p(e){return d(e.source)*e.value}function y(e){return d(e.target)*e.value}function m(e){return e.index}function I(e){return e.nodes}function v(e){return e.links}function E(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function C(){var e=0,t=0,r=1,a=1,o=24,s=8,A=m,C=l,B=I,b=v,x=32,w=2/3;function Q(){var l={nodes:B.apply(null,arguments),links:b.apply(null,arguments)};return function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=(0,i.kH)(e.nodes,A);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==typeof n&&(n=e.source=E(t,n)),"object"!==typeof i&&(i=e.target=E(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(l),function(e){e.nodes.forEach((function(e){e.value=Math.max((0,n.oh)(e.sourceLinks,h),(0,n.oh)(e.targetLinks,h))}))}(l),function(t){var n,i,a;for(n=t.nodes,i=[],a=0;n.length;++a,n=i,i=[])n.forEach((function(e){e.depth=a,e.sourceLinks.forEach((function(e){i.indexOf(e.target)<0&&i.push(e.target)}))}));for(n=t.nodes,i=[],a=0;n.length;++a,n=i,i=[])n.forEach((function(e){e.height=a,e.targetLinks.forEach((function(e){i.indexOf(e.source)<0&&i.push(e.source)}))}));var s=(r-e-o)/(a-1);t.nodes.forEach((function(t){t.x1=(t.x0=e+Math.max(0,Math.min(a-1,Math.floor(C.call(null,t,a))))*s)+o}))}(l),function(e){var r=(0,i.UJ)().key((function(e){return e.x0})).sortKeys(n.XE).entries(e.nodes).map((function(e){return e.values}));A(),g();for(var o=1,l=x;l>0;--l)u(o*=.99),g(),c(o),g();function A(){var i=(0,n.kv)(r,(function(e){return e.length})),o=w*(a-t)/(i-1);s>o&&(s=o);var l=(0,n.SY)(r,(function(e){return(a-t-(e.length-1)*s)/(0,n.oh)(e,h)}));r.forEach((function(e){e.forEach((function(e,t){e.y1=(e.y0=t)+e.value*l}))})),e.links.forEach((function(e){e.width=e.value*l}))}function c(e){r.forEach((function(t){t.forEach((function(t){if(t.targetLinks.length){var r=((0,n.oh)(t.targetLinks,p)/(0,n.oh)(t.targetLinks,h)-d(t))*e;t.y0+=r,t.y1+=r}}))}))}function u(e){r.slice().reverse().forEach((function(t){t.forEach((function(t){if(t.sourceLinks.length){var r=((0,n.oh)(t.sourceLinks,y)/(0,n.oh)(t.sourceLinks,h)-d(t))*e;t.y0+=r,t.y1+=r}}))}))}function g(){r.forEach((function(e){var r,n,i,o=t,l=e.length;for(e.sort(f),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+s;if((n=o-s-a)>0)for(o=r.y0-=n,r.y1-=n,i=l-2;i>=0;--i)(n=(r=e[i]).y1+s-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}(l),_(l),l}function _(e){e.nodes.forEach((function(e){e.sourceLinks.sort(g),e.targetLinks.sort(u)})),e.nodes.forEach((function(e){var t=e.y0,r=t;e.sourceLinks.forEach((function(e){e.y0=t+e.width/2,t+=e.width})),e.targetLinks.forEach((function(e){e.y1=r+e.width/2,r+=e.width}))}))}return Q.update=function(e){return _(e),e},Q.nodeId=function(e){return arguments.length?(A="function"===typeof e?e:c(e),Q):A},Q.nodeAlign=function(e){return arguments.length?(C="function"===typeof e?e:c(e),Q):C},Q.nodeWidth=function(e){return arguments.length?(o=+e,Q):o},Q.nodePadding=function(e){return arguments.length?(s=+e,Q):s},Q.nodes=function(e){return arguments.length?(B="function"===typeof e?e:c(e),Q):B},Q.links=function(e){return arguments.length?(b="function"===typeof e?e:c(e),Q):b},Q.size=function(n){return arguments.length?(e=t=0,r=+n[0],a=+n[1],Q):[r-e,a-t]},Q.extent=function(n){return arguments.length?(e=+n[0][0],r=+n[1][0],t=+n[0][1],a=+n[1][1],Q):[[e,t],[r,a]]},Q.iterations=function(e){return arguments.length?(x=+e,Q):x},Q}var B=r(10132);function b(e){return[e.source.x1,e.y0]}function x(e){return[e.target.x0,e.y1]}function w(){return(0,B.ak)().source(b).target(x)}},33428:function(e,t,r){var n,i;(function(){var a={version:"3.8.0"},o=[].slice,s=function(e){return o.call(e)},l=self.document;function A(e){return e&&(e.ownerDocument||e.document||e).documentElement}function c(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(l)try{s(l.documentElement.childNodes)[0].nodeType}catch(ya){s=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(ma){var u=this.Element.prototype,g=u.setAttribute,f=u.setAttributeNS,h=this.CSSStyleDeclaration.prototype,d=h.setProperty;u.setAttribute=function(e,t){g.call(this,e,t+"")},u.setAttributeNS=function(e,t,r){f.call(this,e,t,r+"")},h.setProperty=function(e,t,r){d.call(this,e,t+"",r)}}function p(e,t){return et?1:e>=t?0:NaN}function y(e){return null===e?NaN:+e}function m(e){return!isNaN(e)}function I(e){return{left:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}a.ascending=p,a.descending=function(e,t){return te?1:t>=e?0:NaN},a.min=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},a.max=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},a.extent=function(e,t){var r,n,i,a=-1,o=e.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},a.deviation=function(){var e=a.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=I(p);function E(e){return e.length}a.bisectLeft=v.left,a.bisect=a.bisectRight=v.right,a.bisector=function(e){return I(1===e.length?function(t,r){return p(e(t),r)}:e)},a.shuffle=function(e,t,r){(a=arguments.length)<3&&(r=e.length,a<2&&(t=0));for(var n,i,a=r-t;a;)i=Math.random()*a--|0,n=e[a+t],e[a+t]=e[i+t],e[i+t]=n;return e},a.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},a.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],i=new Array(r<0?0:r);t=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r};var C=Math.abs;function B(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function b(){this._=Object.create(null)}a.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r===1/0)throw new Error("infinite range");var n,i=[],a=function(e){for(var t=1;e*t%1;)t*=10;return t}(C(r)),o=-1;if(e*=a,t*=a,(r*=a)<0)for(;(n=e+r*++o)>t;)i.push(n/a);else for(;(n=e+r*++o)=n.length)return t?t.call(r,a):e?a.sort(e):a;for(var l,A,c,u,g=-1,f=a.length,h=n[s++],d=new b;++g=n.length)return e;var r=[],a=i[t++];return e.forEach((function(e,n){r.push({key:e,values:s(n,t)})})),a?r.sort((function(e,t){return a(e.key,t.key)})):r}return r.map=function(e,t){return o(t,e,0)},r.entries=function(e){return s(o(a.map,e,0),0)},r.key=function(e){return n.push(e),r},r.sortKeys=function(e){return i[n.length-1]=e,r},r.sortValues=function(t){return e=t,r},r.rollup=function(e){return t=e,r},r},a.set=function(e){var t=new R;if(e)for(var r=0,n=e.length;r=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},a.event=null,a.requote=function(e){return e.replace(Y,"\\$&")};var Y=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,J={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function K(e){return J(e,Z),e}var j=function(e,t){return t.querySelector(e)},V=function(e,t){return t.querySelectorAll(e)},W=function(e,t){var r=e.matches||e[F(e,"matchesSelector")];return W=function(e,t){return r.call(e,t)},W(e,t)};"function"===typeof Sizzle&&(j=function(e,t){return Sizzle(e,t)[0]||null},V=Sizzle,W=Sizzle.matchesSelector),a.selection=function(){return a.select(l.documentElement)};var Z=a.selection.prototype=[];function X(e){return"function"===typeof e?e:function(){return j(e,this)}}function $(e){return"function"===typeof e?e:function(){return V(e,this)}}Z.select=function(e){var t,r,n,i,a=[];e=X(e);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),te.hasOwnProperty(r)?{space:te[r],local:e}:e}},Z.attr=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node();return(e=a.ns.qualify(e)).local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}for(t in e)this.each(re(t,e[t]));return this}return this.each(re(e,t))},Z.classed=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node(),n=(e=ae(e)).length,i=-1;if(t=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Z.sort=function(e){e=he.apply(this,arguments);for(var t=-1,r=this.length;++t0&&(e=e.slice(0,i));var l=Ie.get(e);function A(){var t=this[n];t&&(this.removeEventListener(e,t,t.$),delete this[n])}return l&&(e=l,o=Ee),i?t?function(){var i=o(t,s(arguments));A.call(this),this.addEventListener(e,this[n]=i,i.$=r),i._=t}:A:t?P:function(){var t,r=new RegExp("^__on([^.]+)"+a.requote(e)+"$");for(var n in this)if(t=n.match(r)){var i=this[n];this.removeEventListener(t[1],i,i.$),delete this[n]}}}a.selection.enter=pe,a.selection.enter.prototype=ye,ye.append=Z.append,ye.empty=Z.empty,ye.node=Z.node,ye.call=Z.call,ye.size=Z.size,ye.select=function(e){for(var t,r,n,i,a,o=[],s=-1,l=this.length;++s=t&&(t=i+1);!(o=s[t])&&++t1?Me:e<-1?-Me:Math.asin(e)}function Fe(e){return((e=Math.exp(e))+1/e)/2}var Oe=Math.SQRT2;a.interpolateZoom=function(e,t){var r,n,i=e[0],a=e[1],o=e[2],s=t[0],l=t[1],A=t[2],c=s-i,u=l-a,g=c*c+u*u;if(g0&&(e=e.transition().duration(d)),e.call(C.event)}function Q(){s&&s.domain(o.range().map((function(e){return(e-g.x)/g.k})).map(o.invert)),u&&u.domain(A.range().map((function(e){return(e-g.y)/g.k})).map(A.invert))}function _(e){p++||e({type:"zoomstart"})}function S(e){Q(),e({type:"zoom",scale:g.k,translate:[g.x,g.y]})}function k(e){--p||(e({type:"zoomend"}),t=null)}function D(){var e=this,t=E.of(e,arguments),r=0,n=a.select(c(e)).on(m,(function(){r=1,x(a.mouse(e),i),S(t)})).on(I,(function(){n.on(m,null).on(I,null),o(r),k(t)})),i=B(a.mouse(e)),o=be(e);Xi.call(e),_(t)}function T(){var e,t=this,r=E.of(t,arguments),n={},o=0,s=".zoom-"+a.event.changedTouches[0].identifier,l="touchmove"+s,A="touchend"+s,c=[],u=a.select(t),f=be(t);function h(){var r=a.touches(t);return e=g.k,r.forEach((function(e){e.identifier in n&&(n[e.identifier]=B(e))})),r}function d(){var e=a.event.target;a.select(e).on(l,p).on(A,m),c.push(e);for(var r=a.event.changedTouches,s=0,u=r.length;s1){y=f[0];var I=f[1],v=y[0]-I[0],E=y[1]-I[1];o=v*v+E*E}}function p(){var s,l,A,c,u=a.touches(t);Xi.call(t);for(var g=0,f=u.length;g360?e-=360:e<0&&(e+=360),e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+t):r+t-r*t),new ot(a(e+120),a(e),a(e-120))}function Je(e,t,r){return this instanceof Je?(this.h=+e,this.c=+t,void(this.l=+r)):arguments.length<2?e instanceof Je?new Je(e.h,e.c,e.l):rt(e instanceof Ve?e.l:(e=ft((e=a.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Je(e,t,r)}He.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new qe(this.h,this.s,this.l/e)},He.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new qe(this.h,this.s,e*this.l)},He.rgb=function(){return Ye(this.h,this.s,this.l)},a.hcl=Je;var Ke=Je.prototype=new ze;function je(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Ve(r,Math.cos(e*=Re)*t,Math.sin(e)*t)}function Ve(e,t,r){return this instanceof Ve?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Ve?new Ve(e.l,e.a,e.b):e instanceof Je?je(e.h,e.c,e.l):ft((e=ot(e)).r,e.g,e.b):new Ve(e,t,r)}Ke.brighter=function(e){return new Je(this.h,this.c,Math.min(100,this.l+We*(arguments.length?e:1)))},Ke.darker=function(e){return new Je(this.h,this.c,Math.max(0,this.l-We*(arguments.length?e:1)))},Ke.rgb=function(){return je(this.h,this.c,this.l).rgb()},a.lab=Ve;var We=18,Ze=.95047,Xe=1,$e=1.08883,et=Ve.prototype=new ze;function tt(e,t,r){var n=(e+16)/116,i=n+t/500,a=n-r/200;return new ot(at(3.2404542*(i=nt(i)*Ze)-1.5371385*(n=nt(n)*Xe)-.4985314*(a=nt(a)*$e)),at(-.969266*i+1.8760108*n+.041556*a),at(.0556434*i-.2040259*n+1.0572252*a))}function rt(e,t,r){return e>0?new Je(Math.atan2(r,t)*Le,Math.sqrt(t*t+r*r),e):new Je(NaN,NaN,e)}function nt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function it(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function at(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function ot(e,t,r){return this instanceof ot?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof ot?new ot(e.r,e.g,e.b):ut(""+e,ot,Ye):new ot(e,t,r)}function st(e){return new ot(e>>16,e>>8&255,255&e)}function lt(e){return st(e)+""}et.brighter=function(e){return new Ve(Math.min(100,this.l+We*(arguments.length?e:1)),this.a,this.b)},et.darker=function(e){return new Ve(Math.max(0,this.l-We*(arguments.length?e:1)),this.a,this.b)},et.rgb=function(){return tt(this.l,this.a,this.b)},a.rgb=ot;var At=ot.prototype=new ze;function ct(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function ut(e,t,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.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 t(dt(i[0]),dt(i[1]),dt(i[2]))}return(a=pt.get(e))?t(a.r,a.g,a.b):(null==e||"#"!==e.charAt(0)||isNaN(a=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===e.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),t(o,s,l))}function gt(e,t,r){var n,i,a=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=e==o?(t-r)/s+(t0&&l<1?0:n),new qe(n,i,l)}function ft(e,t,r){var n=it((.4124564*(e=ht(e))+.3575761*(t=ht(t))+.1804375*(r=ht(r)))/Ze),i=it((.2126729*e+.7151522*t+.072175*r)/Xe);return Ve(116*i-16,500*(n-i),200*(i-it((.0193339*e+.119192*t+.9503041*r)/$e)))}function ht(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function dt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}At.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,i=30;return t||r||n?(t&&t=200&&t<300||304===t){try{e=r.call(i,A)}catch(ya){return void o.error.call(i,ya)}o.load.call(i,e)}else o.error.call(i,A)}return self.XDomainRequest&&!("withCredentials"in A)&&/^(http(s)?:)?\/\//.test(e)&&(A=new XDomainRequest),"onload"in A?A.onload=A.onerror=u:A.onreadystatechange=function(){A.readyState>3&&u()},A.onprogress=function(e){var t=a.event;a.event=e;try{o.progress.call(i,A)}finally{a.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(c=e,i):c},i.response=function(e){return r=e,i},["get","post"].forEach((function(e){i[e]=function(){return i.send.apply(i,[e].concat(s(arguments)))}})),i.send=function(r,n,a){if(2===arguments.length&&"function"===typeof n&&(a=n,n=null),A.open(r,e,!0),null==t||"accept"in l||(l.accept=t+",*/*"),A.setRequestHeader)for(var s in l)A.setRequestHeader(s,l[s]);return null!=t&&A.overrideMimeType&&A.overrideMimeType(t),null!=c&&(A.responseType=c),null!=a&&i.on("error",a).on("load",(function(e){a(null,e)})),o.beforesend.call(i,A),A.send(null==n?null:n),i},i.abort=function(){return A.abort(),i},a.rebind(i,o,"on"),null==n?i:i.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(n))}pt.forEach((function(e,t){pt.set(e,st(t))})),a.functor=yt,a.xhr=mt(L),a.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function i(e,r,n){arguments.length<3&&(n=r,r=null);var i=It(e,t,null==r?a:o(r),n);return i.row=function(e){return arguments.length?i.response(null==(r=e)?a:o(e)):r},i}function a(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var r;return i.parseRows(e,(function(e,n){if(r)return r(e,n-1);var i=function(t){for(var r={},n=e.length,i=0;i=l)return o;if(i)return i=!1,a;var t=A;if(34===e.charCodeAt(t)){for(var r=t;r++24?(isFinite(t)&&(clearTimeout(Bt),Bt=setTimeout(wt,t)),Ct=0):(Ct=1,bt(wt))}function Qt(){for(var e=Date.now(),t=vt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function _t(){for(var e,t=vt,r=1/0;t;)t.c?(t.t1&&(t=e[a[o-2]],r=e[a[o-1]],n=e[s],(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function Tt(e,t){return e[0]-t[0]||e[1]-t[1]}a.timer=function(){xt.apply(this,arguments)},a.timer.flush=function(){Qt(),_t()},a.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},a.geom={},a.geom.hull=function(e){var t=St,r=kt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,i=yt(t),a=yt(r),o=e.length,s=[],l=[];for(n=0;n=0;--n)f.push(e[s[A[n]][2]]);for(n=+u;n_e)s=s.L;else{if(!((i=a-Wt(s,o))>_e)){n>-_e?(t=s.P,r=s):i>-_e?(t=s,r=s.N):t=r=s;break}if(!s.R){t=s;break}s=s.R}var l=Yt(e);if(Pt.insert(t,l),t||r){if(t===r)return tr(t),r=Yt(t.site),Pt.insert(l,r),l.edge=r.edge=ir(t.site,l.site),er(t),void er(r);if(r){tr(t),tr(r);var A=t.site,c=A.x,u=A.y,g=e.x-c,f=e.y-u,h=r.site,d=h.x-c,p=h.y-u,y=2*(g*p-f*d),m=g*g+f*f,I=d*d+p*p,v={x:(p*m-f*I)/y+c,y:(g*I-d*m)/y+u};or(r.edge,A,h,v),l.edge=ir(A,e,null,v),r.edge=ir(e,h,null,v),er(t),er(r)}else l.edge=ir(t.site,l.site)}}function Vt(e,t){var r=e.site,n=r.x,i=r.y,a=i-t;if(!a)return n;var o=e.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,A=l-t;if(!A)return s;var c=s-n,u=1/a-1/A,g=c/A;return u?(-g+Math.sqrt(g*g-2*u*(c*c/(-2*A)-l+A/2+i-a/2)))/u+n:(n+s)/2}function Wt(e,t){var r=e.N;if(r)return Vt(r,t);var n=e.site;return n.y===t?n.x:1/0}function Zt(e){this.site=e,this.edges=[]}function Xt(e,t){return t.angle-e.angle}function $t(){Ar(this),this.x=this.y=this.arc=this.site=this.cy=null}function er(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,i=e.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,A=n.y-s,c=a.x-o,u=2*(l*(p=a.y-s)-A*c);if(!(u>=-Se)){var g=l*l+A*A,f=c*c+p*p,h=(p*g-A*f)/u,d=(l*f-c*g)/u,p=d+s,y=qt.pop()||new $t;y.arc=e,y.site=i,y.x=h+o,y.y=p+Math.sqrt(h*h+d*d),y.cy=p,e.circle=y;for(var m=null,I=Ut._;I;)if(y.y=s)return;if(g>h){if(a){if(a.y>=A)return}else a={x:p,y:l};r={x:p,y:A}}else{if(a){if(a.y1)if(g>h){if(a){if(a.y>=A)return}else a={x:(l-i)/n,y:l};r={x:(A-i)/n,y:A}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(t/=g,g<0){if(t0){if(t>u)return;t>c&&(c=t)}if(t=i-l,g||!(t<0)){if(t/=g,g<0){if(t>u)return;t>c&&(c=t)}else if(g>0){if(t0)){if(t/=f,f<0){if(t0){if(t>u)return;t>c&&(c=t)}if(t=a-A,f||!(t<0)){if(t/=f,f<0){if(t>u)return;t>c&&(c=t)}else if(f>0){if(t0&&(e.a={x:l+c*g,y:A+c*f}),u<1&&(e.b={x:l+u*g,y:A+u*f}),e}}}}}),l=o.length;l--;)(!rr(t=o[l],e)||!s(t)||C(t.a.x-t.b.x)<_e&&C(t.a.y-t.b.y)<_e)&&(t.a=t.b=null,o.splice(l,1))}(t),function(e){for(var t,r,n,i,a,o,s,l,A,c,u=e[0][0],g=e[1][0],f=e[0][1],h=e[1][1],d=Ot,p=d.length;p--;)if((a=d[p])&&a.prepare())for(l=(s=a.edges).length,o=0;o_e||C(i-r)>_e)&&(s.splice(o,0,new sr(ar(a.site,c,C(n-u)<_e&&h-i>_e?{x:u,y:C(t-u)<_e?r:h}:C(i-h)<_e&&g-n>_e?{x:C(r-h)<_e?t:g,y:h}:C(n-g)<_e&&i-f>_e?{x:g,y:C(t-g)<_e?r:f}:C(i-f)<_e&&n-u>_e?{x:C(r-f)<_e?t:u,y:f}:null),a.site,null)),++l)}(t));var o={cells:Ot,edges:Ft};return Pt=Ut=Ft=Ot=null,o}function hr(e,t){return t.y-e.y||t.x-e.x}Zt.prototype.prepare=function(){for(var e,t=this.edges,r=t.length;r--;)(e=t[r].edge).b&&e.a||t.splice(r,1);return t.sort(Xt),t.length},sr.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}},lr.prototype={insert:function(e,t){var r,n,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=gr(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.R&&(cr(this,r),r=(e=r).U),r.C=!1,n.C=!0,ur(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.L&&(ur(this,r),r=(e=r).U),r.C=!1,n.C=!0,cr(this,n)),r=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,r,n,i=e.U,a=e.L,o=e.R;if(r=a?o?gr(o):a:o,i?i.L===e?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=e.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=e.U,e=r.R,i.L=e,r.R=o,o.U=r):(r.U=i,i=r,e=r.R)):(n=e.C,e=r),e&&(e.U=i),!n)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,cr(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ur(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,cr(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,ur(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,cr(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,ur(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}},a.geom.voronoi=function(e){var t=St,r=kt,n=t,i=r,a=dr;if(e)return o(e);function o(e){var t=new Array(e.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return fr(s(e),a).cells.forEach((function(a,s){var l=a.edges,A=a.site;(t[s]=l.length?l.map((function(e){var t=e.start();return[t.x,t.y]})):A.x>=r&&A.x<=i&&A.y>=n&&A.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=e[s]})),t}function s(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/_e)*_e,y:Math.round(i(e,t)/_e)*_e,i:t}}))}return o.links=function(e){return fr(s(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return fr(s(e)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,A=r.edges.sort(Xt),c=-1,u=A.length,g=A[u-1].edge,f=g.l===l?g.r:g.l;++ca&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Er(r,n)})),a=br.lastIndex;return ad&&(d=l.x),l.y>p&&(p=l.y),A.push(l.x),c.push(l.y);else for(u=0;ud&&(d=I),v>p&&(p=v),A.push(I),c.push(v)}var E=d-f,B=p-h;function b(e,t,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var l=e.x,A=e.y;if(null!=l)if(C(l-r)+C(A-n)<.01)x(e,t,r,n,i,a,o,s);else{var c=e.point;e.x=e.y=e.point=null,x(e,c,l,A,i,a,o,s),x(e,t,r,n,i,a,o,s)}else e.x=r,e.y=n,e.point=t}else x(e,t,r,n,i,a,o,s)}function x(e,t,r,n,i,a,o,s){var l=.5*(i+o),A=.5*(a+s),c=r>=l,u=n>=A,g=u<<1|c;e.leaf=!1,c?i=l:o=l,u?a=A:s=A,b(e=e.nodes[g]||(e.nodes[g]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,i,a,o,s)}E>B?p=h+E:d=f+B;var w={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){b(w,e,+y(e,++u),+m(e,u),f,h,d,p)},visit:function(e){mr(e,w,f,h,d,p)},find:function(e){return function(e,t,r,n,i,a,o){var s,l=1/0;return function e(A,c,u,g,f){if(!(c>a||u>o||g=E)<<1|t>=v,B=C+4;C=0&&!(r=a.interpolators[n](e,t)););return r}function wr(e,t){var r,n=[],i=[],a=e.length,o=t.length,s=Math.min(e.length,t.length);for(r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Lr(e){return 1-Math.cos(e*Me)}function Nr(e){return Math.pow(2,10*(e-1))}function Fr(e){return 1-Math.sqrt(1-e*e)}function Or(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Pr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Gr(e){var t,r,n,i=[e.a,e.b],a=[e.c,e.d],o=zr(i),s=Ur(i,a),l=zr(((t=a)[0]+=(n=-s)*(r=i)[0],t[1]+=n*r[1],t))||0;i[0]*a[1]=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):"in";return n=_r.get(n)||Qr,i=Sr.get(i)||L,t=i(n.apply(null,o.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},a.interpolateHcl=function(e,t){e=a.hcl(e),t=a.hcl(t);var r=e.h,n=e.c,i=e.l,o=t.h-r,s=t.c-n,l=t.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?t.c:n),isNaN(o)?(o=0,r=isNaN(r)?t.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return je(r+o*e,n+s*e,i+l*e)+""}},a.interpolateHsl=function(e,t){e=a.hsl(e),t=a.hsl(t);var r=e.h,n=e.s,i=e.l,o=t.h-r,s=t.s-n,l=t.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?t.s:n),isNaN(o)?(o=0,r=isNaN(r)?t.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return Ye(r+o*e,n+s*e,i+l*e)+""}},a.interpolateLab=function(e,t){e=a.lab(e),t=a.lab(t);var r=e.l,n=e.a,i=e.b,o=t.l-r,s=t.a-n,l=t.b-i;return function(e){return tt(r+o*e,n+s*e,i+l*e)+""}},a.interpolateRound=Pr,a.transform=function(e){var t=l.createElementNS(a.ns.prefix.svg,"g");return(a.transform=function(e){if(null!=e){t.setAttribute("transform",e);var r=t.transform.baseVal.consolidate()}return new Gr(r?r.matrix:qr)})(e)},Gr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var qr={a:1,b:0,c:0,d:1,e:0,f:0};function Hr(e){return e.length?e.pop()+",":""}function Yr(e,t){var r=[],n=[];return e=a.transform(e),t=a.transform(t),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:Er(e[0],t[0])},{i:i-2,x:Er(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(e.translate,t.translate,r,n),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Hr(r)+"rotate(",null,")")-2,x:Er(e,t)})):t&&r.push(Hr(r)+"rotate("+t+")")}(e.rotate,t.rotate,r,n),function(e,t,r,n){e!==t?n.push({i:r.push(Hr(r)+"skewX(",null,")")-2,x:Er(e,t)}):t&&r.push(Hr(r)+"skewX("+t+")")}(e.skew,t.skew,r,n),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push(Hr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Er(e[0],t[0])},{i:i-2,x:Er(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(Hr(r)+"scale("+t+")")}(e.scale,t.scale,r,n),e=t=null,function(e){for(var t,i=-1,a=n.length;++i0?r=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:r=0})):t>0&&(l.start({type:"start",alpha:r=t}),e=xt(s.tick)),s):r},s.start=function(){var e,t,r,a=y.length,l=m.length,c=A[0],h=A[1];for(e=0;e=0;)r.push(i[n])}function sn(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(a=e.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(c=A[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=A}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return sn(i,(function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)})),s}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(on(e,(function(e){e.children&&(e.value=0)})),sn(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},a.layout.partition=function(){var e=a.layout.hierarchy(),t=[1,1];function r(e,t,n,i){var a=e.children;if(e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,A=-1;for(n=e.value?n/e.value:0;++As&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=t);return n}function En(e){return e.reduce(Cn,0)}function Cn(e,t){return e+t[1]}function Bn(e,t){return bn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function bn(e,t){for(var r=-1,n=+e[0],i=(e[1]-n)/t,a=[];++r<=t;)a[r]=i*r+n;return a}function xn(e){return[a.min(e),a.max(e)]}function wn(e,t){return e.value-t.value}function Qn(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function _n(e,t){e._pack_next=t,t._pack_prev=e}function Sn(e,t){var r=t.x-e.x,n=t.y-e.y,i=e.r+t.r;return.999*i*i>r*r+n*n}function kn(e){if((t=e.children)&&(l=t.length)){var t,r,n,i,a,o,s,l,A=1/0,c=-1/0,u=1/0,g=-1/0;if(t.forEach(Dn),(r=t[0]).x=-r.r,r.y=0,I(r),l>1&&((n=t[1]).x=n.r,n.y=0,I(n),l>2))for(Rn(r,n,i=t[2]),I(i),Qn(r,i),r._pack_prev=i,Qn(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=u[0]&&l<=u[1]&&((s=A[a.bisect(g,l,1,h)-1]).y+=d,s.push(i[o]));return A}return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(r=yt(e),i):r},i.bins=function(e){return arguments.length?(n="number"===typeof e?function(t){return bn(t,e)}:yt(e),i):n},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},a.layout.pack=function(){var e,t=a.layout.hierarchy().sort(wn),r=0,n=[1,1];function i(i,a){var o=t.call(this,i,a),s=o[0],l=n[0],A=n[1],c=null==e?Math.sqrt:"function"===typeof e?e:function(){return e};if(s.x=s.y=0,sn(s,(function(e){e.r=+c(e.value)})),sn(s,kn),r){var u=r*(e?1:Math.max(2*s.r/l,2*s.r/A))/2;sn(s,(function(e){e.r+=u})),sn(s,kn),sn(s,(function(e){e.r-=u}))}return Mn(s,l/2,A/2,e?1:1/Math.max(2*s.r/l,2*s.r/A)),o}return i.size=function(e){return arguments.length?(n=e,i):n},i.radius=function(t){return arguments.length?(e=null==t||"function"===typeof t?t:+t,i):e},i.padding=function(e){return arguments.length?(r=+e,i):r},an(i,t)},a.layout.tree=function(){var e=a.layout.hierarchy().sort(null).value(null),t=Ln,r=[1,1],n=null;function i(i,a){var A=e.call(this,i,a),c=A[0],u=function(e){for(var t,r={A:null,children:[e]},n=[r];null!=(t=n.pop());)for(var i,a=t.children,o=0,s=a.length;of.x&&(f=e),e.depth>h.depth&&(h=e)}));var d=t(g,f)/2-g.x,p=r[0]/(f.x+t(f,g)/2+d),y=r[1]/(h.depth||1);on(c,(function(e){e.x=(e.x+d)*p,e.y=e.depth*y}))}return A}function o(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r.length){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],A=a.m,c=o.m,u=s.m,g=l.m;s=Fn(s),a=Nn(a),s&&a;)l=Nn(l),(o=Fn(o)).a=e,(i=s.z+u-a.z-A+t(s._,a._))>0&&(On(Pn(s,e,n),e,i),A+=i,c+=i),u+=s.m,A+=a.m,g+=l.m,c+=o.m;s&&!Fn(o)&&(o.t=s,o.m+=u-c),a&&!Nn(l)&&(l.t=a,l.m+=A-g,n=e)}return n}(e,i,e.parent.A||n[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=r[0],e.y=e.depth*r[1]}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e)?l:null,i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null==(r=e)?null:l,i):n?r:null},an(i,e)},a.layout.cluster=function(){var e=a.layout.hierarchy().sort(null).value(null),t=Ln,r=[1,1],n=!1;function i(i,o){var s,l=e.call(this,i,o),A=l[0],c=0;sn(A,(function(e){var r=e.children;r&&r.length?(e.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(r),e.y=function(e){return 1+a.max(e,(function(e){return e.y}))}(r)):(e.x=s?c+=t(e,s):0,e.y=0,s=e)}));var u=Gn(A),g=Un(A),f=u.x-t(u,g)/2,h=g.x+t(g,u)/2;return sn(A,n?function(e){e.x=(e.x-A.x)*r[0],e.y=(A.y-e.y)*r[1]}:function(e){e.x=(e.x-f)/(h-f)*r[0],e.y=(1-(A.y?e.y/A.y:1))*r[1]}),l}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e),i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null!=(r=e),i):n?r:null},an(i,e)},a.layout.treemap=function(){var e,t=a.layout.hierarchy(),r=Math.round,n=[1,1],i=null,o=zn,s=!1,l="squarify",A=.5*(1+Math.sqrt(5));function c(e,t){for(var r,n,i=-1,a=e.length;++i0;)s.push(r=A[i-1]),s.area+=r.area,"squarify"!==l||(n=f(s,d))<=g?(A.pop(),g=n):(s.area-=s.pop().area,h(s,d,a,!1),d=Math.min(a.dx,a.dy),s.length=s.area=0,g=1/0);s.length&&(h(s,d,a,!0),s.length=s.area=0),t.forEach(u)}}function g(e){var t=e.children;if(t&&t.length){var r,n=o(e),i=t.slice(),a=[];for(c(i,n.dx*n.dy/e.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(h(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);t.forEach(g)}}function f(e,t){for(var r,n=e.area,i=0,a=1/0,o=-1,s=e.length;++oi&&(i=r));return t*=t,(n*=n)?Math.max(t*i*A/n,n/(t*a*A)):1/0}function h(e,t,n,i){var a,o=-1,s=e.length,l=n.x,A=n.y,c=t?r(e.area/t):0;if(t==n.dx){for((i||c>n.dy)&&(c=n.dy);++on.dx)&&(c=n.dx);++o1);return e+t*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=a.random.normal.apply(a,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=a.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?Wn:Jn,l=n?Kr:Jr;return i=o(e,t,l,r),a=o(t,e,l,xr),s}function s(e){return i(e)}return s.invert=function(e){return a(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},s.range=function(e){return arguments.length?(t=e,o()):t},s.rangeRound=function(e){return s.range(e).interpolate(Pr)},s.clamp=function(e){return arguments.length?(n=e,o()):n},s.interpolate=function(e){return arguments.length?(r=e,o()):r},s.ticks=function(t){return ti(e,t)},s.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},s.nice=function(t){return $n(e,t),o()},s.copy=function(){return Zn(e,t,r,n)},o()}function Xn(e,t){return a.rebind(e,t,"range","rangeRound","interpolate","clamp")}function $n(e,t){return Kn(e,jn(ei(e,t)[2])),Kn(e,jn(ei(e,t)[2])),e}function ei(e,t){null==t&&(t=10);var r=Hn(e),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),a=t/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(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 ti(e,t){return a.range.apply(a,ei(e,t))}function ri(e,t,r,n){function i(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return r?Math.pow(t,e):-Math.pow(t,-e)}function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(r=t[0]>=0,e.domain((n=t.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(t=+r,e.domain(n.map(i)),o):t},o.nice=function(){var t=Kn(n.map(i),r?Math:ni);return e.domain(t),n=t.map(a),o},o.ticks=function(){var e=Hn(n),o=[],s=e[0],l=e[1],A=Math.floor(i(s)),c=Math.ceil(i(l)),u=t%1?2:t;if(isFinite(c-A)){if(r){for(;A0;g--)o.push(a(A)*g);for(A=0;o[A]l;c--);o=o.slice(A,c)}return o},o.copy=function(){return ri(e.copy(),t,r,n)},Xn(o,e)}a.scale.linear=function(){return Zn([0,1],[0,1],xr,!1)},a.scale.log=function(){return ri(a.scale.linear().domain([0,1]),10,!0,[1,10])};var ni={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function ii(e,t,r){var n=ai(t),i=ai(1/t);function a(t){return e(n(t))}return a.invert=function(t){return i(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain((r=t.map(Number)).map(n)),a):r},a.ticks=function(e){return ti(r,e)},a.tickFormat=function(e,t){return d3_scale_linearTickFormat(r,e,t)},a.nice=function(e){return a.domain($n(r,e))},a.exponent=function(o){return arguments.length?(n=ai(t=o),i=ai(1/t),e.domain(r.map(n)),a):t},a.copy=function(){return ii(e.copy(),t,r)},Xn(a,e)}function ai(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oi(e,t){var r,n,i;function o(i){return n[((r.get(i)||("range"===t.t?r.set(i,e.push(i)):NaN))-1)%n.length]}function s(t,r){return a.range(e.length).map((function(e){return t+r*e}))}return o.domain=function(n){if(!arguments.length)return e;e=[],r=new b;for(var i,a=-1,s=n.length;++a0?r[n-1]:e[0],nu?0:1;if(A=Te)return l(A,f)+(s?l(s,1-f):"")+"Z";var h,d,p,y,m,I,v,E,C,B,b,x,w=0,Q=0,_=[];if((y=(+o.apply(this,arguments)||0)/2)&&(p=n===pi?Math.sqrt(s*s+A*A):+n.apply(this,arguments),f||(Q*=-1),A&&(Q=Ne(p/A*Math.sin(y))),s&&(w=Ne(p/s*Math.sin(y)))),A){m=A*Math.cos(c+Q),I=A*Math.sin(c+Q),v=A*Math.cos(u-Q),E=A*Math.sin(u-Q);var S=Math.abs(u-c-2*Q)<=ke?0:1;if(Q&&Ci(m,I,v,E)===f^S){var k=(c+u)/2;m=A*Math.cos(k),I=A*Math.sin(k),v=E=null}}else m=I=0;if(s){C=s*Math.cos(u-w),B=s*Math.sin(u-w),b=s*Math.cos(c+w),x=s*Math.sin(c+w);var D=Math.abs(c-u+2*w)<=ke?0:1;if(w&&Ci(C,B,b,x)===1-f^D){var T=(c+u)/2;C=s*Math.cos(T),B=s*Math.sin(T),b=x=null}}else C=B=0;if(g>_e&&(h=Math.min(Math.abs(A-s)/2,+r.apply(this,arguments)))>.001){d=s0?0:1}function Bi(e,t,r,n,i){var a=e[0]-t[0],o=e[1]-t[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,A=-s*a,c=e[0]+l,u=e[1]+A,g=t[0]+l,f=t[1]+A,h=(c+g)/2,d=(u+f)/2,p=g-c,y=f-u,m=p*p+y*y,I=r-n,v=c*f-g*u,E=(y<0?-1:1)*Math.sqrt(Math.max(0,I*I*m-v*v)),C=(v*y-p*E)/m,B=(-v*p-y*E)/m,b=(v*y+p*E)/m,x=(-v*p+y*E)/m,w=C-h,Q=B-d,_=b-h,S=x-d;return w*w+Q*Q>_*_+S*S&&(C=b,B=x),[[C-l,B-A],[C*r/I,B*r/I]]}function bi(){return!0}function xi(e){var t=St,r=kt,n=bi,i=Qi,a=i.key,o=.7;function s(a){var s,l=[],A=[],c=-1,u=a.length,g=yt(t),f=yt(r);function h(){l.push("M",i(e(A),o))}for(;++c1&&i.push("H",n[0]),i.join("")},"step-before":Si,"step-after":ki,basis:Mi,"basis-open":function(e){if(e.length<4)return Qi(e);for(var t,r=[],n=-1,i=e.length,a=[0],o=[0];++n<3;)t=e[n],a.push(t[0]),o.push(t[1]);for(r.push(Ri(Fi,a)+","+Ri(Fi,o)),--n;++n9&&(i=3*t/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(e))}});function Qi(e){return e.length>1?e.join("L"):e+"Z"}function _i(e){return e.join("L")+"Z"}function Si(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t1){s=t[1],a=e[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var A=2;Ake)+",1 "+t}function l(e,t,r,n){return"Q 0,0 "+n}return a.radius=function(e){return arguments.length?(r=yt(e),a):r},a.source=function(t){return arguments.length?(e=yt(t),a):e},a.target=function(e){return arguments.length?(t=yt(e),a):t},a.startAngle=function(e){return arguments.length?(n=yt(e),a):n},a.endAngle=function(e){return arguments.length?(i=yt(e),a):i},a},a.svg.diagonal=function(){var e=zi,t=qi,r=Yi;function n(n,i){var a=e.call(this,n,i),o=t.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(t){return arguments.length?(e=yt(t),n):e},n.target=function(e){return arguments.length?(t=yt(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},a.svg.diagonal.radial=function(){var e=a.svg.diagonal(),t=Yi,r=e.projection;return e.projection=function(e){return arguments.length?r(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Me;return[r*Math.cos(n),r*Math.sin(n)]}}(t=e)):t},e},a.svg.symbol=function(){var e=Ki,t=Ji;function r(r,n){return(Vi.get(e.call(this,r,n))||ji)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=yt(t),r):e},r.size=function(e){return arguments.length?(t=yt(e),r):t},r};var Vi=a.map({circle:ji,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Zi)),r=t*Zi;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Wi),r=t*Wi/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Wi),r=t*Wi/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});a.svg.symbolTypes=Vi.keys();var Wi=Math.sqrt(3),Zi=Math.tan(30*Re);Z.transition=function(e){for(var t,r,n=ta||++ia,i=sa(e),a=[],o=ra||{time:Date.now(),ease:Rr,delay:0,duration:250},s=-1,l=this.length;++s0;)A[--g].call(e,o);if(a>=1)return u.event&&u.event.end.call(e,e.__data__,t),--c.count?delete c[n]:delete e[r],1}u||(a=i.time,o=xt((function(e){var t=u.delay;if(o.t=t+a,t<=e)return g(e-t);o.c=g}),0,a),u=c[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++c.count)}na.call=Z.call,na.empty=Z.empty,na.node=Z.node,na.size=Z.size,a.transition=function(e,t){return e&&e.transition?ta?e.transition(t):e:a.selection().transition(e)},a.transition.prototype=na,na.select=function(e){var t,r,n,i=this.id,a=this.namespace,o=[];e=X(e);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",o[1]-o[0])}function d(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function p(){var u,p,y=this,m=a.select(a.event.target),I=r.of(y,arguments),v=a.select(y),E=m.datum(),C=!/^(n|s)$/.test(E)&&n,B=!/^(e|w)$/.test(E)&&i,b=m.classed("extent"),x=be(y),w=a.mouse(y),Q=a.select(c(y)).on("keydown.brush",(function(){32==a.event.keyCode&&(b||(u=null,w[0]-=o[1],w[1]-=s[1],b=2),z())})).on("keyup.brush",(function(){32==a.event.keyCode&&2==b&&(w[0]+=o[1],w[1]+=s[1],b=0,z())}));if(a.event.changedTouches?Q.on("touchmove.brush",k).on("touchend.brush",T):Q.on("mousemove.brush",k).on("mouseup.brush",T),v.interrupt().selectAll("*").interrupt(),b)w[0]=o[0]-w[0],w[1]=s[0]-w[1];else if(E){var _=+/w$/.test(E),S=+/^n/.test(E);p=[o[1-_]-w[0],s[1-S]-w[1]],w[0]=o[_],w[1]=s[S]}else a.event.altKey&&(u=w.slice());function k(){var e=a.mouse(y),t=!1;p&&(e[0]+=p[0],e[1]+=p[1]),b||(a.event.altKey?(u||(u=[(o[0]+o[1])/2,(s[0]+s[1])/2]),w[0]=o[+(e[0](n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var a=o;function o(e,t){this.x=e,this.y=t}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),a=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(e){return e instanceof o?e:Array.isArray(e)?new o(e[0],e[1]):e};var s="undefined"!==typeof self?self:{};function l(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function u(e,t,r,i){var a=new n(e,t,r,i);return function(e){return a.solve(e)}}var g=u(.25,.1,.25,1);function f(e,t,r){return Math.min(r,Math.max(t,e))}function h(e,t,r){var n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function d(e,t,r){if(!e.length)return r(null,[]);var n=e.length,i=new Array(e.length),a=null;e.forEach((function(e,o){t(e,(function(e,t){e&&(a=e),i[o]=t,0===--n&&r(a,i)}))}))}function p(e){var t=[];for(var r in e)t.push(e[r]);return t}function y(e,t){var r=[];for(var n in e)n in t||r.push(n);return r}function m(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}return e()}function B(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function b(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function x(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function w(e,t){return-1!==e.indexOf(t,e.length-t.length)}function Q(e,t,r){var n={};for(var i in e)n[i]=t.call(r||this,e[i],i,e);return n}function _(e,t,r){var n={};for(var i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function S(e){return Array.isArray(e)?e.map(S):"object"===typeof e&&e?Q(e,S):e}function k(e,t){for(var r=0;r=0)return!0;return!1}var D={};function T(e){D[e]||("undefined"!==typeof console&&console.warn(e),D[e]=!0)}function M(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function R(e){for(var t=0,r=0,n=e.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(e.replace(t,(function(e,t,n,i){var a=n||i;return r[t]=!a||a.toLowerCase(),""})),r["max-age"]){var n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}var O=null;function P(e){if(null==O){var t=e.navigator?e.navigator.userAgent:null;O=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return O}function G(e){try{var t=s[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(r){return!1}}function U(e){return s.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(Number("0x"+t))})))}function z(e){return decodeURIComponent(s.atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}var q,H,Y,J,K=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),j=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,V=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,W={now:K,frame:function(e){var t=j(e);return{cancel:function(){return V(t)}}},getImageData:function(e,t){void 0===t&&(t=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return q||(q=s.document.createElement("a")),q.href=e,q.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==H&&(H=s.matchMedia("(prefers-reduced-motion: reduce)")),H.matches)}},Z={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},X={supported:!1,testSupport:te},$=!1,ee=!1;function te(e){!$&&J&&(ee?re(e):Y=e)}function re(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,J),e.isContextLost())return;X.supported=!0}catch(r){}e.deleteTexture(t),$=!0}s.document&&((J=s.document.createElement("img")).onload=function(){Y&&re(Y),Y=null,ee=!0},J.onerror=function(){$=!0,Y=null},J.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var ne="01";function ie(){for(var e="1",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=0;n<10;n++)r+=t[Math.floor(62*Math.random())];var i=432e5;return{token:[e,ne,r].join(""),tokenExpiresAt:Date.now()+i}}var ae=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function oe(e){return 0===e.indexOf("mapbox:")}ae.prototype._createSkuToken=function(){var e=ie();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},ae.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ae.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},ae.prototype.normalizeStyleURL=function(e,t){if(!oe(e))return e;var r=ge(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},ae.prototype.normalizeGlyphsURL=function(e,t){if(!oe(e))return e;var r=ge(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},ae.prototype.normalizeSourceURL=function(e,t){if(!oe(e))return e;var r=ge(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},ae.prototype.normalizeSpriteURL=function(e,t,r,n){var i=ge(e);return oe(e)?(i.path="/styles/v1"+i.path+"/sprite"+t+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+t+r,fe(i))},ae.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!oe(e))return e;var r=ge(e),n=/(\.(png|jpg)\d*)(?=$)/,i=/^.+\/v4\//,a=W.devicePixelRatio>=2||512===t?"@2x":"",o=X.supported?".webp":"$1";r.path=r.path.replace(n,""+a+o),r.path=r.path.replace(i,"/"),r.path="/v4"+r.path;var s=this._customAccessToken||ce(r.params)||Z.ACCESS_TOKEN;return Z.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,s)},ae.prototype.canonicalizeTileURL=function(e,t){var r="/v4/",n=/\.[\w]+$/,i=ge(e);if(!i.path.match(/(^\/v4\/)/)||!i.path.match(n))return e;var a="mapbox://tiles/";a+=i.path.replace(r,"");var o=i.params;return t&&(o=o.filter((function(e){return!e.match(/^access_token=/)}))),o.length&&(a+="?"+o.join("&")),a},ae.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&oe(t),n=[],i=0,a=e.tiles||[];i=0&&e.params.splice(i,1)}if("/"!==n.path&&(e.path=""+n.path+e.path),!Z.REQUIRE_ACCESS_TOKEN)return fe(e);if(!(t=t||Z.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(e){return-1===e.indexOf("access_token")})),e.params.push("access_token="+t),fe(e)};var se=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function le(e){return se.test(e)}function Ae(e){return e.indexOf("sku=")>0&&le(e)}function ce(e){for(var t=0,r=e;t=1&&s.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(n){T("Unable to write to LocalStorage")}},pe.prototype.processRequests=function(e){},pe.prototype.postEvent=function(e,t,n,i){var a=this;if(Z.EVENTS_URL){var o=ge(Z.EVENTS_URL);o.params.push("access_token="+(i||Z.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:ne,userId:this.anonId},l=t?m(s,t):s,A={url:fe(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=Ze(A,(function(e){a.pendingRequest=null,n(e),a.saveEventData(),a.processRequests(i)}))}},pe.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var ye,me,Ie=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postMapLoadEvent=function(e,t,r,n){this.skuToken=r,(Z.EVENTS_URL&&n||Z.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return oe(e)||le(e)})))&&this.queueRequest({id:t,timestamp:Date.now()},n)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),b(this.anonId)||(this.anonId=C()),this.postEvent(i,{skuToken:this.skuToken},(function(e){e||n&&(t.success[n]=!0)}),e))}},t}(pe),ve=function(e){function t(t){e.call(this,"appUserTurnstile"),this._customAccessToken=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postTurnstileEvent=function(e,t){Z.EVENTS_URL&&Z.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return oe(e)||le(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=de(Z.ACCESS_TOKEN),n=r?r.u:Z.ACCESS_TOKEN,i=n!==this.eventData.tokenU;b(this.anonId)||(this.anonId=C(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=n)}),e)}},t}(pe),Ee=new ve,Ce=Ee.postTurnstileEvent.bind(Ee),Be=new Ie,be=Be.postMapLoadEvent.bind(Be),xe="mapbox-tiles",we=500,Qe=50,_e=42e4;function Se(){s.caches&&!ye&&(ye=s.caches.open(xe))}function ke(e,t){if(void 0===me)try{new Response(new ReadableStream),me=!0}catch(r){me=!1}me?t(e.body):e.blob().then(t)}function De(e,t,r){if(Se(),ye){var n={status:t.status,statusText:t.statusText,headers:new s.Headers};t.headers.forEach((function(e,t){return n.headers.set(t,e)}));var i=F(t.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<_e||ke(t,(function(t){var r=new s.Response(t,n);Se(),ye&&ye.then((function(t){return t.put(Te(e.url),r)})).catch((function(e){return T(e.message)}))})))}}function Te(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Me(e,t){if(Se(),!ye)return t(null);var r=Te(e.url);ye.then((function(e){e.match(r).then((function(n){var i=Re(n);e.delete(r),i&&e.put(r,n.clone()),t(null,n,i)})).catch(t)})).catch(t)}function Re(e){if(!e)return!1;var t=new Date(e.headers.get("Expires")||0),r=F(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}var Le,Ne=1/0;function Fe(e){++Ne>Qe&&(e.getActor().send("enforceCacheSizeLimit",we),Ne=0)}function Oe(e){Se(),ye&&ye.then((function(t){t.keys().then((function(r){for(var n=0;n=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(i){return t(i)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new qe(r.statusText,r.status,e.url))},r.send(e.body),{cancel:function(){return r.abort()}}}var je=function(e,t){if(!Ye(e.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Je(e,t);if(N()&&self.worker&&self.worker.actor){var r=!0;return self.worker.actor.send("getResource",e,t,void 0,r)}}return Ke(e,t)},Ve=function(e,t){return je(m(e,{type:"json"}),t)},We=function(e,t){return je(m(e,{type:"arrayBuffer"}),t)},Ze=function(e,t){return je(m(e,{method:"POST"}),t)};function Xe(e){var t=s.document.createElement("a");return t.href=e,t.protocol===s.document.location.protocol&&t.host===s.document.location.host}var $e,et,tt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function rt(e,t,r,n){var i=new s.Image,a=s.URL;i.onload=function(){t(null,i),a.revokeObjectURL(i.src),i.onload=null,s.requestAnimationFrame((function(){i.src=tt}))},i.onerror=function(){return t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new s.Blob([new Uint8Array(e)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=e.byteLength?a.createObjectURL(o):tt}function nt(e,t){var r=new s.Blob([new Uint8Array(e)],{type:"image/png"});s.createImageBitmap(r).then((function(e){t(null,e)})).catch((function(e){t(new Error("Could not load image because of "+e.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}$e=[],et=0;var it=function(e,t){if(X.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),et>=Z.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return $e.push(r),r}et++;var n=!1,i=function(){if(!n)for(n=!0,et--;$e.length&&et0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ct.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var ut={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},gt=function(e,t,r,n){this.message=(e?e+": ":"")+r,n&&(this.identifier=n),null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)};function ft(e){var t=e.key,r=e.value;return r?[new gt(t,r,"constants have been deprecated as of v8")]:[]}function ht(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var Tt=[It,vt,Et,Ct,Bt,_t,bt,kt(xt),St];function Mt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Mt(e.itemType,t.itemType))&&("number"!==typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,n=Tt;r255?255:e}function i(e){return e<0?0:e>1?1:e}function a(e){return"%"===e[e.length-1]?n(parseFloat(e)/100*255):n(parseInt(e))}function o(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function l(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=i.indexOf("("),A=i.indexOf(")");if(-1!==l&&A+1===i.length){var c=i.substr(0,l),u=i.substr(l+1,A-(l+1)).split(","),g=1;switch(c){case"rgba":if(4!==u.length)return null;g=o(u.pop());case"rgb":return 3!==u.length?null:[a(u[0]),a(u[1]),a(u[2]),g];case"hsla":if(4!==u.length)return null;g=o(u.pop());case"hsl":if(3!==u.length)return null;var f=(parseFloat(u[0])%360+360)%360/360,h=o(u[1]),d=o(u[2]),p=d<=.5?d*(h+1):d+h-d*h,y=2*d-p;return[n(255*s(y,p,f+1/3)),n(255*s(y,p,f)),n(255*s(y,p,f-1/3)),g];default:return null}}return null}try{t.parseCSSColor=l}catch(A){}})),Ft=Nt.parseCSSColor,Ot=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};Ot.parse=function(e){if(e){if(e instanceof Ot)return e;if("string"===typeof e){var t=Ft(e);if(t)return new Ot(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Ot.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],i=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+i+")"},Ot.prototype.toArray=function(){var e=this,t=e.r,r=e.g,n=e.b,i=e.a;return 0===i?[0,0,0,0]:[255*t/i,255*r/i,255*n/i,i]},Ot.black=new Ot(0,0,0,1),Ot.white=new Ot(1,1,1,1),Ot.transparent=new Ot(0,0,0,0),Ot.red=new Ot(1,0,0,1);var Pt=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Pt.prototype.compare=function(e,t){return this.collator.compare(e,t)},Pt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Gt=function(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i},Ut=function(e){this.sections=e};Ut.fromString=function(e){return new Ut([new Gt(e,null,null,null,null)])},Ut.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},Ut.factory=function(e){return e instanceof Ut?e:Ut.fromString(e)},Ut.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},Ut.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t=0&&e<=255&&"number"===typeof t&&t>=0&&t<=255&&"number"===typeof r&&r>=0&&r<=255?"undefined"===typeof n||"number"===typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"===typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Ht(e){if(null===e)return!0;if("string"===typeof e)return!0;if("boolean"===typeof e)return!0;if("number"===typeof e)return!0;if(e instanceof Ot)return!0;if(e instanceof Pt)return!0;if(e instanceof Ut)return!0;if(e instanceof zt)return!0;if(Array.isArray(e)){for(var t=0,r=e;t2){var s=e[1];if("string"!==typeof s||!(s in Vt)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Vt[s],n++}else a=xt;if(e.length>3){if(null!==e[2]&&("number"!==typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=kt(a,o)}else r=Vt[i];for(var l=[];n1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var Zt=function(e){this.type=_t,this.sections=e};Zt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"===typeof r)return t.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=e.length-1;++a){var o=e[a];if(i&&"object"===typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,vt)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,kt(Et))))return null;var A=null;if(o["text-color"]&&!(A=t.parse(o["text-color"],1,Bt)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=A}else{var u=t.parse(e[a],1,xt);if(!u)return null;var g=u.type.kind;if("string"!==g&&"value"!==g&&"null"!==g&&"resolvedImage"!==g)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:u,scale:null,font:null,textColor:null})}}return new Zt(n)},Zt.prototype.evaluate=function(e){var t=function(t){var r=t.content.evaluate(e);return Yt(r)===St?new Gt("",r,null,null,null):new Gt(Jt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)};return new Ut(this.sections.map(t))},Zt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t-1),r},Xt.prototype.eachChild=function(e){e(this.input)},Xt.prototype.outputDefined=function(){return!1},Xt.prototype.serialize=function(){return["image",this.input.serialize()]};var $t={"to-boolean":Ct,"to-color":Bt,"to-number":vt,"to-string":Et},er=function(e,t){this.type=e,this.args=t};er.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=$t[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":qt(t[0],t[1],t[2],t[3])))return new Ot(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new jt(r||"Could not parse color from value '"+("string"===typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=t[2])&&!(e[1]<=t[1])&&!(e[3]>=t[3])}function ur(e,t){var r=lr(e[0]),n=Ar(e[1]),i=Math.pow(2,t.z);return[Math.round(r*i*or),Math.round(n*i*or)]}function gr(e,t,r){var n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function fr(e,t,r){return t[1]>e[1]!==r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function hr(e,t){for(var r=!1,n=0,i=t.length;n0&&u<0||c<0&&u>0}function mr(e,t,r,n){var i=[t[0]-e[0],t[1]-e[1]];return 0!==pr([n[0]-r[0],n[1]-r[1]],i)&&!(!yr(e,t,r,n)||!yr(r,n,e,t))}function Ir(e,t,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=e[0]-r[0]>i?-n:r[0]-e[0]>i?n:0;0===a&&(a=e[0]-r[2]>i?-n:r[2]-e[0]>i?n:0),e[0]+=a}sr(t,e)}function xr(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function wr(e,t,r,n){for(var i=Math.pow(2,n.z)*or,a=[n.x*or,n.y*or],o=[],s=0,l=e;s=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Mr(e,t)&&(r=!1)})),r}kr.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(Ht(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;nt))throw new jt("Input is not a number.");o=s-1}return 0}Lr.prototype.parse=function(e,t,r,n,i){return void 0===i&&(i={}),t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)},Lr.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new Wt(t,[e]):"coerce"===r?new er(t,[e]):e}if(null!==e&&"string"!==typeof e&&"boolean"!==typeof e&&"number"!==typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=e[0];if("string"!==typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,t.typeAnnotation||"coerce");else a=r(a,o,t.typeAnnotation||"assert")}if(!(a instanceof Kt)&&"resolvedImage"!==a.type.kind&&Nr(a)){var l=new rr;try{a=new Kt(a.type,a.evaluate(l))}catch(A){return this.error(A.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return"undefined"===typeof e?this.error("'undefined' value invalid. Use null instead."):"object"===typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Lr.prototype.concat=function(e,t,r){var n="number"===typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Lr(this.registry,n,t||null,i,this.errors)},Lr.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new yt(n,e))},Lr.prototype.checkSubtype=function(e,t){var r=Mt(e,t);return r&&this.error(r),r};var Or=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=t.parse(s,A,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new Or(i,r,n)},Or.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Fr(t,n)].evaluate(e)},Or.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var zr=Object.freeze({__proto__:null,number:Pr,color:Gr,array:Ur}),qr=.95047,Hr=1,Yr=1.08883,Jr=4/29,Kr=6/29,jr=3*Kr*Kr,Vr=Kr*Kr*Kr,Wr=Math.PI/180,Zr=180/Math.PI;function Xr(e){return e>Vr?Math.pow(e,1/3):e/jr+Jr}function $r(e){return e>Kr?e*e*e:jr*(e-Jr)}function en(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function tn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function rn(e){var t=tn(e.r),r=tn(e.g),n=tn(e.b),i=Xr((.4124564*t+.3575761*r+.1804375*n)/qr),a=Xr((.2126729*t+.7151522*r+.072175*n)/Hr);return{l:116*a-16,a:500*(i-a),b:200*(a-Xr((.0193339*t+.119192*r+.9503041*n)/Yr)),alpha:e.a}}function nn(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=Hr*$r(t),r=qr*$r(r),n=Yr*$r(n),new Ot(en(3.2404542*r-1.5371385*t-.4985314*n),en(-.969266*r+1.8760108*t+.041556*n),en(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function an(e,t,r){return{l:Pr(e.l,t.l,r),a:Pr(e.a,t.a,r),b:Pr(e.b,t.b,r),alpha:Pr(e.alpha,t.alpha,r)}}function on(e){var t=rn(e),r=t.l,n=t.a,i=t.b,a=Math.atan2(i,n)*Zr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:e.a}}function sn(e){var t=e.h*Wr,r=e.c;return nn({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})}function ln(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}function An(e,t,r){return{h:ln(e.h,t.h,r),c:Pr(e.c,t.c,r),l:Pr(e.l,t.l,r),alpha:Pr(e.alpha,t.alpha,r)}}var cn={forward:rn,reverse:nn,interpolate:an},un={forward:on,reverse:sn,interpolate:An},gn=Object.freeze({__proto__:null,lab:cn,hcl:un}),fn=function(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(!(i=t.parse(i,2,vt)))return null;var l=[],A=null;"interpolate-hcl"===r||"interpolate-lab"===r?A=Bt:t.expectedType&&"value"!==t.expectedType.kind&&(A=t.expectedType);for(var c=0;c=u)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=t.parse(g,h,A);if(!d)return null;A=A||d.type,l.push([u,d])}return"number"===A.kind||"color"===A.kind||"array"===A.kind&&"number"===A.itemType.kind&&"number"===typeof A.N?new fn(A,r,n,i,l):t.error("Type "+Dt(A)+" is not interpolatable.")},fn.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);var a=Fr(t,n),o=t[a],s=t[a+1],l=fn.interpolationFactor(this.interpolation,n,o,s),A=r[a].evaluate(e),c=r[a+1].evaluate(e);return"interpolate"===this.operator?zr[this.type.kind.toLowerCase()](A,c,l):"interpolate-hcl"===this.operator?un.reverse(un.interpolate(un.forward(A),un.forward(c),l)):cn.reverse(cn.interpolate(cn.forward(A),cn.forward(c),l))},fn.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t=r.length)throw new jt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new jt("Array index must be an integer, but found "+t+" instead.");return r[t]},yn.prototype.eachChild=function(e){e(this.index),e(this.input)},yn.prototype.outputDefined=function(){return!1},yn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var mn=function(e,t){this.type=Ct,this.needle=e,this.haystack=t};mn.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,xt),n=t.parse(e[2],2,xt);return r&&n?Rt(r.type,[Ct,Et,vt,It,xt])?new mn(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead"):null},mn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Lt(t,["boolean","string","number","null"]))throw new jt("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Yt(t))+" instead.");if(!Lt(r,["string","array"]))throw new jt("Expected second argument to be of type array or string, but found "+Dt(Yt(r))+" instead.");return r.indexOf(t)>=0},mn.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},mn.prototype.outputDefined=function(){return!0},mn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var In=function(e,t,r){this.type=vt,this.needle=e,this.haystack=t,this.fromIndex=r};In.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,xt),n=t.parse(e[2],2,xt);if(!r||!n)return null;if(!Rt(r.type,[Ct,Et,vt,It,xt]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,vt);return i?new In(r,n,i):null}return new In(r,n)},In.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Lt(t,["boolean","string","number","null"]))throw new jt("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Yt(t))+" instead.");if(!Lt(r,["string","array"]))throw new jt("Expected second argument to be of type array or string, but found "+Dt(Yt(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},In.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var vn=function(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};vn.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!==1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return A.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"===typeof g&&Math.floor(g)!==g)return A.error("Numeric branch labels must be integer values.");if(r){if(A.checkSubtype(r,Yt(g)))return null}else r=Yt(g);if("undefined"!==typeof i[String(g)])return A.error("Branch labels must be unique.");i[String(g)]=a.length}var f=t.parse(l,o,n);if(!f)return null;n=n||f.type,a.push(f)}var h=t.parse(e[1],1,xt);if(!h)return null;var d=t.parse(e[e.length-1],e.length-1,n);return d?"value"!==h.type.kind&&t.concat(1).checkSubtype(r,h.type)?null:new vn(r,n,h,i,a,d):null},vn.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Yt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},vn.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},vn.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},vn.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();ir}function _n(e,t,r){return t<=r}function Sn(e,t,r){return t>=r}function kn(e,t,r,n){return 0===n.compare(t,r)}function Dn(e,t,r,n){return!kn(e,t,r,n)}function Tn(e,t,r,n){return n.compare(t,r)<0}function Mn(e,t,r,n){return n.compare(t,r)>0}function Rn(e,t,r,n){return n.compare(t,r)<=0}function Ln(e,t,r,n){return n.compare(t,r)>=0}function Nn(e,t,r){var n="=="!==e&&"!="!==e;return function(){function i(e,t,r){this.type=Ct,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return i.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],a=t.parse(e[1],1,xt);if(!a)return null;if(!Bn(r,a.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Dt(a.type)+"'.");var o=t.parse(e[2],2,xt);if(!o)return null;if(!Bn(r,o.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Dt(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+Dt(a.type)+"' and '"+Dt(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new Wt(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new Wt(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Qt)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=Yt(a),l=Yt(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new jt('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var A=Yt(a),c=Yt(o);if("string"!==A.kind||"string"!==c.kind)return t(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):t(i,a,o)},i.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},i}()}Cn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,xt),n=t.parse(e[2],2,vt);if(!r||!n)return null;if(!Rt(r.type,[kt(xt),Et,xt]))return t.error("Expected first argument to be of type array or string, but found "+Dt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,vt);return i?new Cn(r.type,r,n,i):null}return new Cn(r.type,r,n)},Cn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Lt(t,["string","array"]))throw new jt("Expected first argument to be of type array or string, but found "+Dt(Yt(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},Cn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Cn.prototype.outputDefined=function(){return!1},Cn.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Fn=Nn("==",bn,kn),On=Nn("!=",xn,Dn),Pn=Nn("<",wn,Tn),Gn=Nn(">",Qn,Mn),Un=Nn("<=",_n,Rn),zn=Nn(">=",Sn,Ln),qn=function(e,t,r,n,i){this.type=Et,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};qn.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,vt);if(!r)return null;var n=e[2];if("object"!==typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=t.parse(n.locale,1,Et)))return null;var a=null;if(n.currency&&!(a=t.parse(n.currency,1,Et)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=t.parse(n["min-fraction-digits"],1,vt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,vt))?null:new qn(r,i,a,o,s)},qn.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},qn.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},qn.prototype.outputDefined=function(){return!1},qn.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Hn=function(e){this.type=vt,this.input=e};Hn.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+Dt(r.type)+" instead."):new Hn(r):null},Hn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"===typeof t)return t.length;if(Array.isArray(t))return t.length;throw new jt("Expected value to be of type string or array, but found "+Dt(Yt(t))+" instead.")},Hn.prototype.eachChild=function(e){e(this.input)},Hn.prototype.outputDefined=function(){return!1},Hn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Yn={"==":Fn,"!=":On,">":Gn,"<":Pn,">=":zn,"<=":Un,array:Wt,at:yn,boolean:Wt,case:En,coalesce:dn,collator:ar,format:Zt,image:Xt,in:mn,"index-of":In,interpolate:fn,"interpolate-hcl":fn,"interpolate-lab":fn,length:Hn,let:pn,literal:Kt,match:vn,number:Wt,"number-format":qn,object:Wt,slice:Cn,step:Or,string:Wt,"to-boolean":er,"to-color":er,"to-number":er,"to-string":er,var:Rr,within:kr};function Jn(e,t){var r=t[0],n=t[1],i=t[2],a=t[3];r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);var o=a?a.evaluate(e):1,s=qt(r,n,i,o);if(s)throw new jt(s);return new Ot(r/255*o,n/255*o,i/255*o,o)}function Kn(e,t){return e in t}function jn(e,t){var r=t[e];return"undefined"===typeof r?null:r}function Vn(e,t,r,n){for(;r<=n;){var i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}function Wn(e){return{type:e}}function Zn(e){return{result:"success",value:e}}function Xn(e){return{result:"error",value:e}}function $n(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function ei(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ti(e){return!!e.expression&&e.expression.interpolated}function ri(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ni(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)}function ii(e){return e}function ai(e,t){var r,n,i,a="color"===t.type,o=e.stops&&"object"===typeof e.stops[0][0],s=o||void 0!==e.property,l=o||!s,A=e.type||(ti(t)?"exponential":"interval");if(a&&((e=ht({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],Ot.parse(e[1])]}))),e.default?e.default=Ot.parse(e.default):e.default=Ot.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!gn[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===A)r=Ai;else if("interval"===A)r=li;else if("categorical"===A){r=si,n=Object.create(null);for(var c=0,u=e.stops;c=e.stops[n-1][0])return e.stops[n-1][1];var i=Fr(e.stops.map((function(e){return e[0]})),r);return e.stops[i][1]}function Ai(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==ri(r))return oi(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];var a=Fr(e.stops.map((function(e){return e[0]})),r),o=ui(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],A=zr[t.type]||ii;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=gn[e.colorSpace];A=function(e,t){return c.reverse(c.interpolate(c.forward(e),c.forward(t),o))}}return"function"===typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return A(r,n,o)}}:A(s,l,o)}function ci(e,t,r){return"color"===t.type?r=Ot.parse(r):"formatted"===t.type?r=Ut.fromString(r.toString()):"resolvedImage"===t.type?r=zt.fromString(r.toString()):ri(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),oi(r,e.default,t.default)}function ui(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}nr.register(Yn,{error:[wt,[Et],function(e,t){var r=t[0];throw new jt(r.evaluate(e))}],typeof:[Et,[xt],function(e,t){return Dt(Yt(t[0].evaluate(e)))}],"to-rgba":[kt(vt,4),[Bt],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Bt,[vt,vt,vt],Jn],rgba:[Bt,[vt,vt,vt,vt],Jn],has:{type:Ct,overloads:[[[Et],function(e,t){return Kn(t[0].evaluate(e),e.properties())}],[[Et,bt],function(e,t){var r=t[0],n=t[1];return Kn(r.evaluate(e),n.evaluate(e))}]]},get:{type:xt,overloads:[[[Et],function(e,t){return jn(t[0].evaluate(e),e.properties())}],[[Et,bt],function(e,t){var r=t[0],n=t[1];return jn(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[xt,[Et],function(e,t){return jn(t[0].evaluate(e),e.featureState||{})}],properties:[bt,[],function(e){return e.properties()}],"geometry-type":[Et,[],function(e){return e.geometryType()}],id:[xt,[],function(e){return e.id()}],zoom:[vt,[],function(e){return e.globals.zoom}],"heatmap-density":[vt,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[vt,[],function(e){return e.globals.lineProgress||0}],accumulated:[xt,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[vt,Wn(vt),function(e,t){for(var r=0,n=0,i=t;n":[Ct,[Et,xt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>a}],"filter-id->":[Ct,[xt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>i}],"filter-<=":[Ct,[Et,xt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i<=a}],"filter-id-<=":[Ct,[xt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n<=i}],"filter->=":[Ct,[Et,xt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>=a}],"filter-id->=":[Ct,[xt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>=i}],"filter-has":[Ct,[xt],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Ct,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[Ct,[kt(Et)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Ct,[kt(xt)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Ct,[Et,kt(xt)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Ct,[Et,kt(xt)],function(e,t){var r=t[0],n=t[1];return Vn(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Ct,overloads:[[[Ct,Ct],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[Wn(Ct),function(e,t){for(var r=0,n=t;r0&&"string"===typeof e[0]&&e[0]in Yn}function hi(e,t){var r=new Lr(Yn,[],t?Ei(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Zn(new gi(n,t)):Xn(r.errors)}gi.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},gi.prototype.evaluate=function(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null===o||void 0===o||"number"===typeof o&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new jt("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!==typeof console&&console.warn(s.message)),this._defaultValue}};var di=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Tr(t.expression)};di.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},di.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)};var pi=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Tr(t.expression),this.interpolationType=n};function yi(e,t){if("error"===(e=hi(e,t)).result)return e;var r=e.value.expression,n=Dr(r);if(!n&&!$n(t))return Xn([new yt("","data expressions not supported")]);var i=Mr(r,["zoom"]);if(!i&&!ei(t))return Xn([new yt("","zoom expressions not supported")]);var a=vi(r);if(!a&&!i)return Xn([new yt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof yt)return Xn([a]);if(a instanceof fn&&!ti(t))return Xn([new yt("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Zn(new di(n?"constant":"source",e.value));var o=a instanceof fn?a.interpolation:void 0;return Zn(new pi(n?"camera":"composite",e.value,a.labels,o))}pi.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},pi.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)},pi.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?fn.interpolationFactor(this.interpolationType,e,t,r):0};var mi=function(e,t){this._parameters=e,this._specification=t,ht(this,ai(this._parameters,this._specification))};function Ii(e,t){if(ni(e))return new mi(e,t);if(fi(e)){var r=yi(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"===typeof e&&"color"===t.type&&(n=Ot.parse(e)),{kind:"constant",evaluate:function(){return n}}}function vi(e){var t=null;if(e instanceof pn)t=vi(e.result);else if(e instanceof dn)for(var r=0,n=e.args;rn.maximum?[new gt(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function wi(e){var t,r,n,i=e.valueSpec,a=dt(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,A="array"===ri(e.value.stops)&&"array"===ri(e.value.stops[0])&&"object"===ri(e.value.stops[0][0]),c=Bi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:u,default:h}});return"identity"===a&&s&&c.push(new gt(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||c.push(new gt(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!ti(e.valueSpec)&&c.push(new gt(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!$n(e.valueSpec)?c.push(new gt(e.key,e.value,"property functions not supported")):s&&!ei(e.valueSpec)&&c.push(new gt(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!A||void 0!==e.value.property||c.push(new gt(e.key,e.value,'"property" property is required')),c;function u(e){if("identity"===a)return[new gt(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(bi({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:g})),"array"===ri(r)&&0===r.length&&t.push(new gt(e.key,r,"array must have at least one stop")),t}function g(e){var t=[],a=e.value,s=e.key;if("array"!==ri(a))return[new gt(s,a,"array expected, "+ri(a)+" found")];if(2!==a.length)return[new gt(s,a,"array length 2 expected, length "+a.length+" found")];if(A){if("object"!==ri(a[0]))return[new gt(s,a,"object expected, "+ri(a[0])+" found")];if(void 0===a[0].zoom)return[new gt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new gt(s,a,"object stop key must have value")];if(n&&n>dt(a[0].zoom))return[new gt(s,a[0].zoom,"stop zoom values must appear in ascending order")];dt(a[0].zoom)!==n&&(n=dt(a[0].zoom),r=void 0,o={}),t=t.concat(Bi({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:xi,value:f}}))}else t=t.concat(f({key:s+"[0]",value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return fi(pt(a[1]))?t.concat([new gt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):t.concat(ra({key:s+"[1]",value:a[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function f(e,n){var s=ri(e.value),l=dt(e.value),A=null!==e.value?e.value:n;if(t){if(s!==t)return[new gt(e.key,A,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new gt(e.key,A,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return $n(i)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new gt(e.key,A,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!==typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);tt?1:0}function Li(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t"===t||"<="===t||">="===t?Fi(e[1],e[2],t):"any"===t?Oi(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(Ni)):"none"===t?["all"].concat(e.slice(1).map(Ni).map(Ui)):"in"===t?Pi(e[1],e.slice(2)):"!in"===t?Ui(Pi(e[1],e.slice(2))):"has"===t?Gi(e[1]):"!has"===t?Ui(Gi(e[1])):"within"!==t||e}function Fi(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Oi(e){return["any"].concat(e.map(Ni))}function Pi(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!==typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Ri)]]:["filter-in-small",e,["literal",t]]}}function Gi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Ui(e){return["!",e]}function zi(e){return Di(pt(e.value))?Qi(ht({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):qi(e)}function qi(e){var t=e.value,r=e.key;if("array"!==ri(t))return[new gt(r,t,"array expected, "+ri(t)+" found")];var n,i=e.styleSpec,a=[];if(t.length<1)return[new gt(r,t,"filter array must have at least 1 element")];switch(a=a.concat(ki({key:r+"[0]",value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),dt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===dt(t[1])&&a.push(new gt(r,t,'"$type" cannot be use with operator "'+t[0]+'"'));case"==":case"!=":3!==t.length&&a.push(new gt(r,t,'filter array for operator "'+t[0]+'" must have 3 elements'));case"in":case"!in":t.length>=2&&"string"!==(n=ri(t[1]))&&a.push(new gt(r+"[1]",t[1],"string expected, "+n+" found"));for(var o=2;o=c[f+0]&&n>=c[f+1])?(o[g]=!0,a.push(A[g])):o[g]=!1}}},ha.prototype._forEachCell=function(e,t,r,n,i,a,o,s){for(var l=this._convertToCellCoord(e),A=this._convertToCellCoord(t),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),g=l;g<=c;g++)for(var f=A;f<=u;f++){var h=this.d*f+g;if((!s||s(this._convertFromCellCoord(g),this._convertFromCellCoord(f),this._convertFromCellCoord(g+1),this._convertFromCellCoord(f+1)))&&i.call(this,e,t,r,n,h,a,o,s))return}},ha.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ha.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ha.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=fa+this.cells.length+1+1,r=0,n=0;n=0)){var u=e[c];A[c]=ya[l].shallow.indexOf(c)>=0?u:Ca(u,t)}e instanceof Error&&(A.message=e.message)}if(A.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(A.$name=l),A}throw new Error("can't serialize object of type "+typeof e)}function Ba(e){if(null===e||void 0===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||va(e)||Ea(e)||ArrayBuffer.isView(e)||e instanceof da)return e;if(Array.isArray(e))return e.map(Ba);if("object"===typeof e){var t=e.$name||"Object",r=ya[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var n=Object.create(r.prototype),i=0,a=Object.keys(e);i=0?s:Ba(s)}}return n}throw new Error("can't deserialize object of type "+typeof e)}var ba=function(){this.first=!0};ba.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function wa(e){for(var t=0,r=e;t=65097&&e<=65103)||!!xa["CJK Compatibility Ideographs"](e)||!!xa["CJK Compatibility"](e)||!!xa["CJK Radicals Supplement"](e)||!!xa["CJK Strokes"](e)||!(!xa["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||!!xa["CJK Unified Ideographs Extension A"](e)||!!xa["CJK Unified Ideographs"](e)||!!xa["Enclosed CJK Letters and Months"](e)||!!xa["Hangul Compatibility Jamo"](e)||!!xa["Hangul Jamo Extended-A"](e)||!!xa["Hangul Jamo Extended-B"](e)||!!xa["Hangul Jamo"](e)||!!xa["Hangul Syllables"](e)||!!xa.Hiragana(e)||!!xa["Ideographic Description Characters"](e)||!!xa.Kanbun(e)||!!xa["Kangxi Radicals"](e)||!!xa["Katakana Phonetic Extensions"](e)||!(!xa.Katakana(e)||12540===e)||!(!xa["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!xa["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||!!xa["Unified Canadian Aboriginal Syllabics"](e)||!!xa["Unified Canadian Aboriginal Syllabics Extended"](e)||!!xa["Vertical Forms"](e)||!!xa["Yijing Hexagram Symbols"](e)||!!xa["Yi Syllables"](e)||!!xa["Yi Radicals"](e))}function Da(e){return!(!xa["Latin-1 Supplement"](e)||167!==e&&169!==e&&174!==e&&177!==e&&188!==e&&189!==e&&190!==e&&215!==e&&247!==e)||!(!xa["General Punctuation"](e)||8214!==e&&8224!==e&&8225!==e&&8240!==e&&8241!==e&&8251!==e&&8252!==e&&8258!==e&&8263!==e&&8264!==e&&8265!==e&&8273!==e)||!!xa["Letterlike Symbols"](e)||!!xa["Number Forms"](e)||!(!xa["Miscellaneous Technical"](e)||!(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215))||!(!xa["Control Pictures"](e)||9251===e)||!!xa["Optical Character Recognition"](e)||!!xa["Enclosed Alphanumerics"](e)||!!xa["Geometric Shapes"](e)||!(!xa["Miscellaneous Symbols"](e)||e>=9754&&e<=9759)||!(!xa["Miscellaneous Symbols and Arrows"](e)||!(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243))||!!xa["CJK Symbols and Punctuation"](e)||!!xa.Katakana(e)||!!xa["Private Use Area"](e)||!!xa["CJK Compatibility Forms"](e)||!!xa["Small Form Variants"](e)||!!xa["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e}function Ta(e){return!(ka(e)||Da(e))}function Ma(e){return xa.Arabic(e)||xa["Arabic Supplement"](e)||xa["Arabic Extended-A"](e)||xa["Arabic Presentation Forms-A"](e)||xa["Arabic Presentation Forms-B"](e)}function Ra(e){return e>=1424&&e<=2303||xa["Arabic Presentation Forms-A"](e)||xa["Arabic Presentation Forms-B"](e)}function La(e,t){return!(!t&&Ra(e))&&!(e>=2304&&e<=3583||e>=3840&&e<=4255||xa.Khmer(e))}function Na(e){for(var t=0,r=e;t-1&&(Ga=Oa.error),Pa&&Pa(e)};function qa(){Ha.fire(new lt("pluginStateChange",{pluginStatus:Ga,pluginURL:Ua}))}var Ha=new ct,Ya=function(){return Ga},Ja=function(e){return e({pluginStatus:Ga,pluginURL:Ua}),Ha.on("pluginStateChange",e),e},Ka=function(e,t,r){if(void 0===r&&(r=!1),Ga===Oa.deferred||Ga===Oa.loading||Ga===Oa.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ua=W.resolveURL(e),Ga=Oa.deferred,Pa=t,qa(),r||ja()},ja=function(){if(Ga!==Oa.deferred||!Ua)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ga=Oa.loading,qa(),Ua&&We({url:Ua},(function(e){e?za(e):(Ga=Oa.loaded,qa())}))},Va={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ga===Oa.loaded||null!=Va.applyArabicShaping},isLoading:function(){return Ga===Oa.loading},setState:function(e){Ga=e.pluginStatus,Ua=e.pluginURL},isParsed:function(){return null!=Va.applyArabicShaping&&null!=Va.processBidirectionalText&&null!=Va.processStyledBidirectionalText},getPluginURL:function(){return Ua}},Wa=function(){Va.isLoading()||Va.isLoaded()||"deferred"!==Ya()||ja()},Za=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ba,this.transition={})};Za.prototype.isSupportedScript=function(e){return Fa(e,Va.isLoaded())},Za.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Za.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Xa=function(e,t){this.property=e,this.value=t,this.expression=Ii(void 0===t?e.specification.default:t,e.specification)};Xa.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Xa.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var $a=function(e){this.property=e,this.value=new Xa(e,void 0)};$a.prototype.transitioned=function(e,t){return new to(this.property,this.value,t,m({},e.transition,this.transition),e.now)},$a.prototype.untransitioned=function(){return new to(this.property,this.value,null,{},0)};var eo=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};eo.prototype.getValue=function(e){return S(this._values[e].value.value)},eo.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new $a(this._values[e].property)),this._values[e].value=new Xa(this._values[e].property,null===t?void 0:S(t))},eo.prototype.getTransition=function(e){return S(this._values[e].transition)},eo.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new $a(this._values[e].property)),this._values[e].transition=S(t)||void 0},eo.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);tthis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(nn.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},t.prototype.interpolate=function(e){return e},t}(so),Ao=function(e){this.specification=e};Ao.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new Za(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Za(Math.floor(t.zoom),t)),e.expression.evaluate(new Za(Math.floor(t.zoom+1),t)),t)}},Ao.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Ao.prototype.interpolate=function(e){return e};var co=function(e){this.specification=e};co.prototype.possiblyEvaluate=function(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)},co.prototype.interpolate=function(){return!1};var uo=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var n=this.defaultPropertyValues[t]=new Xa(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new $a(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}};ma("DataDrivenProperty",so),ma("DataConstantProperty",oo),ma("CrossFadedDataDrivenProperty",lo),ma("CrossFadedProperty",Ao),ma("ColorRampProperty",co);var go="-transition",fo=function(e){function t(t,r){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new no(r.layout)),r.paint)){for(var n in this._transitionablePaint=new eo(r.paint),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ao(r.paint)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".layout."+e;if(this._validate(ca,n,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t},t.prototype.getPaintProperty=function(e){return w(e,go)?this._transitionablePaint.getTransition(e.slice(0,-go.length)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".paint."+e;if(this._validate(Aa,n,e,t,r))return!1}if(w(e,go))return this._transitionablePaint.setTransition(e.slice(0,-go.length),t||void 0),!1;var i=this._transitionablePaint._values[e],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var l=this._transitionablePaint._values[e].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(e,s,l)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,r){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)},t.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),_(e,(function(e,t){return void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&ua(this,e.call(sa,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:ut,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof io&&$n(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(ct),ho={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},po=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},yo=128,mo=5,Io=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function vo(e,t){void 0===t&&(t=1);var r=0,n=0;return{members:e.map((function(e){var i=Eo(e.type),a=r=Co(r,Math.max(t,i)),o=e.components||1;return n=Math.max(n,i),r+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:Co(r,Math.max(n,t)),alignment:t}}function Eo(e){return ho[e].BYTES_PER_ELEMENT}function Co(e,t){return Math.ceil(e/t)*t}Io.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Io.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Io.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Io.prototype.clear=function(){this.length=0},Io.prototype.resize=function(e){this.reserve(e),this.length=e},Io.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*mo),yo),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Io.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Bo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e},t}(Io);Bo.prototype.bytesPerElement=4,ma("StructArrayLayout2i4",Bo);var bo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e},t}(Io);bo.prototype.bytesPerElement=8,ma("StructArrayLayout4i8",bo);var xo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Io);xo.prototype.bytesPerElement=12,ma("StructArrayLayout2i4i12",xo);var wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e},t}(Io);wo.prototype.bytesPerElement=8,ma("StructArrayLayout2i4ub8",wo);var Qo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e},t}(Io);Qo.prototype.bytesPerElement=8,ma("StructArrayLayout2f8",Qo);var _o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,A){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l,A)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A,c){var u=10*e;return this.uint16[u+0]=t,this.uint16[u+1]=r,this.uint16[u+2]=n,this.uint16[u+3]=i,this.uint16[u+4]=a,this.uint16[u+5]=o,this.uint16[u+6]=s,this.uint16[u+7]=l,this.uint16[u+8]=A,this.uint16[u+9]=c,e},t}(Io);_o.prototype.bytesPerElement=20,ma("StructArrayLayout10ui20",_o);var So=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,A,c,u){var g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,n,i,a,o,s,l,A,c,u)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A,c,u,g){var f=12*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=A,this.int16[f+9]=c,this.int16[f+10]=u,this.int16[f+11]=g,e},t}(Io);So.prototype.bytesPerElement=24,ma("StructArrayLayout4i4ui4i24",So);var ko=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e},t}(Io);ko.prototype.bytesPerElement=12,ma("StructArrayLayout3f12",ko);var Do=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint32[r+0]=t,e},t}(Io);Do.prototype.bytesPerElement=4,ma("StructArrayLayout1ul4",Do);var To=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l){var A=this.length;return this.resize(A+1),this.emplace(A,e,t,r,n,i,a,o,s,l)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A){var c=10*e,u=5*e;return this.int16[c+0]=t,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[u+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=A,e},t}(Io);To.prototype.bytesPerElement=20,ma("StructArrayLayout6i1ul2ui20",To);var Mo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Io);Mo.prototype.bytesPerElement=12,ma("StructArrayLayout2i2i2i12",Mo);var Ro=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)},t.prototype.emplace=function(e,t,r,n,i,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e},t}(Io);Ro.prototype.bytesPerElement=16,ma("StructArrayLayout2f1f2i16",Ro);var Lo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,e},t}(Io);Lo.prototype.bytesPerElement=12,ma("StructArrayLayout2ub2f12",Lo);var No=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e},t}(Io);No.prototype.bytesPerElement=6,ma("StructArrayLayout3ui6",No);var Fo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p){var y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y){var m=24*e,I=12*e,v=48*e;return this.int16[m+0]=t,this.int16[m+1]=r,this.uint16[m+2]=n,this.uint16[m+3]=i,this.uint32[I+2]=a,this.uint32[I+3]=o,this.uint32[I+4]=s,this.uint16[m+10]=l,this.uint16[m+11]=A,this.uint16[m+12]=c,this.float32[I+7]=u,this.float32[I+8]=g,this.uint8[v+36]=f,this.uint8[v+37]=h,this.uint8[v+38]=d,this.uint32[I+10]=p,this.int16[m+22]=y,e},t}(Io);Fo.prototype.bytesPerElement=48,ma("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Fo);var Oo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q){var _=this.length;return this.resize(_+1),this.emplace(_,e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q,_){var S=34*e,k=17*e;return this.int16[S+0]=t,this.int16[S+1]=r,this.int16[S+2]=n,this.int16[S+3]=i,this.int16[S+4]=a,this.int16[S+5]=o,this.int16[S+6]=s,this.int16[S+7]=l,this.uint16[S+8]=A,this.uint16[S+9]=c,this.uint16[S+10]=u,this.uint16[S+11]=g,this.uint16[S+12]=f,this.uint16[S+13]=h,this.uint16[S+14]=d,this.uint16[S+15]=p,this.uint16[S+16]=y,this.uint16[S+17]=m,this.uint16[S+18]=I,this.uint16[S+19]=v,this.uint16[S+20]=E,this.uint16[S+21]=C,this.uint16[S+22]=B,this.uint32[k+12]=b,this.float32[k+13]=x,this.float32[k+14]=w,this.float32[k+15]=Q,this.float32[k+16]=_,e},t}(Io);Oo.prototype.bytesPerElement=68,ma("StructArrayLayout8i15ui1ul4f68",Oo);var Po=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.float32[r+0]=t,e},t}(Io);Po.prototype.bytesPerElement=4,ma("StructArrayLayout1f4",Po);var Go=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e},t}(Io);Go.prototype.bytesPerElement=6,ma("StructArrayLayout3i6",Go);var Uo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=2*e,a=4*e;return this.uint32[i+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=n,e},t}(Io);Uo.prototype.bytesPerElement=8,ma("StructArrayLayout1ul2ui8",Uo);var zo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e},t}(Io);zo.prototype.bytesPerElement=4,ma("StructArrayLayout2ui4",zo);var qo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint16[r+0]=t,e},t}(Io);qo.prototype.bytesPerElement=2,ma("StructArrayLayout1ui2",qo);var Ho=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e},t}(Io);Ho.prototype.bytesPerElement=16,ma("StructArrayLayout4f16",Ho);var Yo=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(po);Yo.prototype.size=20;var Jo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Yo(this,e)},t}(To);ma("CollisionBoxArray",Jo);var Ko=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(po);Ko.prototype.size=48;var jo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ko(this,e)},t}(Fo);ma("PlacedSymbolArray",jo);var Vo=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(po);Vo.prototype.size=68;var Wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Vo(this,e)},t}(Oo);ma("SymbolInstanceArray",Wo);var Zo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t}(Po);ma("GlyphOffsetArray",Zo);var Xo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(Go);ma("SymbolLineVertexArray",Xo);var $o=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(po);$o.prototype.size=8;var es=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new $o(this,e)},t}(Uo);ma("FeatureIndexArray",es);var ts=vo([{name:"a_pos",components:2,type:"Int16"}],4).members,rs=function(e){void 0===e&&(e=[]),this.segments=e};function ns(e,t){return 256*(e=f(Math.floor(e),0,255))+(t=f(Math.floor(t),0,255))}rs.prototype.prepareSegment=function(e,t,r,n){var i=this.segments[this.segments.length-1];return e>rs.MAX_VERTEX_ARRAY_LENGTH&&T("Max vertices per segment is "+rs.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!i||i.vertexLength+e>rs.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},rs.prototype.get=function(){return this.segments},rs.prototype.destroy=function(){for(var e=0,t=this.segments;e>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(A+2))<<16;case 2:l^=(255&e.charCodeAt(A+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(A)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}e.exports=t})),os=t((function(e){function t(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}e.exports=t})),ss=as,ls=as,As=os;ss.murmur3=ls,ss.murmur2=As;var cs=function(){this.ids=[],this.positions=[],this.indexed=!1};cs.prototype.add=function(e,t,r,n){this.ids.push(gs(e)),this.positions.push(t,r,n)},cs.prototype.getPositions=function(e){for(var t=gs(e),r=0,n=this.ids.length-1;r>1;this.ids[i]>=t?n=i:r=i+1}for(var a=[];this.ids[r]===t;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},cs.serialize=function(e,t){var r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return fs(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}},cs.deserialize=function(e){var t=new cs;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var us=Math.pow(2,53)-1;function gs(e){var t=+e;return!isNaN(t)&&t<=us?t:ss(String(e))}function fs(e,t,r,n){for(;r>1],a=r-1,o=n+1;;){do{a++}while(e[a]i);if(a>=o)break;hs(e,a,o),hs(t,3*a,3*o),hs(t,3*a+1,3*o+1),hs(t,3*a+2,3*o+2)}o-ro.x+1||lo.y+1)&&T("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Gs(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Ps(e):[]}}function Us(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}var zs=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Bo,this.indexArray=new No,this.segments=new rs,this.programConfigurations=new Ds(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function qs(e,t){for(var r=0;r=3)for(var a=0;a1){if(js(e,t))return!0;for(var n=0;n1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function Xs(e,t){for(var r,n,i,a=!1,o=0;ot.y!==i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function $s(e,t){for(var r=!1,n=0,i=e.length-1;nt.y!==o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function el(e,t,r,n,i){for(var o=0,s=e;o=l.x&&i>=l.y)return!0}var A=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(var c=0,u=A;ci.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;var a=M(e,t,r[0]);return a!==M(e,t,r[1])||a!==M(e,t,r[2])||a!==M(e,t,r[3])}function rl(e,t,r){var n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function nl(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function il(e,t,r,n,i){if(!t[0]&&!t[1])return e;var o=a.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=Ls||c<0||c>=Ls)){var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),g=u.vertexLength;Us(this.layoutVertexArray,A,c,-1,-1),Us(this.layoutVertexArray,A,c,1,-1),Us(this.layoutVertexArray,A,c,1,1),Us(this.layoutVertexArray,A,c,-1,1),this.indexArray.emplaceBack(g,g+1,g+2),this.indexArray.emplaceBack(g,g+3,g+2),u.vertexLength+=4,u.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)},ma("CircleBucket",zs,{omit:["layers"]});var al=new uo({"circle-sort-key":new so(ut.layout_circle["circle-sort-key"])}),ol={paint:new uo({"circle-radius":new so(ut.paint_circle["circle-radius"]),"circle-color":new so(ut.paint_circle["circle-color"]),"circle-blur":new so(ut.paint_circle["circle-blur"]),"circle-opacity":new so(ut.paint_circle["circle-opacity"]),"circle-translate":new oo(ut.paint_circle["circle-translate"]),"circle-translate-anchor":new oo(ut.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new oo(ut.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new oo(ut.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new so(ut.paint_circle["circle-stroke-width"]),"circle-stroke-color":new so(ut.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new so(ut.paint_circle["circle-stroke-opacity"])}),layout:al},sl="undefined"!==typeof Float32Array?Float32Array:Array;function ll(){var e=new sl(4);return sl!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function Al(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=n*-s+a*l,e[3]=i*-s+o*l,e}function cl(){var e=new sl(9);return sl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ul(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function gl(){var e=new sl(16);return sl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function fl(e){var t=new sl(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function hl(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dl(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],A=t[7],c=t[8],u=t[9],g=t[10],f=t[11],h=t[12],d=t[13],p=t[14],y=t[15],m=r*s-n*o,I=r*l-i*o,v=r*A-a*o,E=n*l-i*s,C=n*A-a*s,B=i*A-a*l,b=c*d-u*h,x=c*p-g*h,w=c*y-f*h,Q=u*p-g*d,_=u*y-f*d,S=g*y-f*p,k=m*S-I*_+v*Q+E*w-C*x+B*b;return k?(k=1/k,e[0]=(s*S-l*_+A*Q)*k,e[1]=(i*_-n*S-a*Q)*k,e[2]=(d*B-p*C+y*E)*k,e[3]=(g*C-u*B-f*E)*k,e[4]=(l*w-o*S-A*x)*k,e[5]=(r*S-i*w+a*x)*k,e[6]=(p*v-h*B-y*I)*k,e[7]=(c*B-g*v+f*I)*k,e[8]=(o*_-s*w+A*b)*k,e[9]=(n*w-r*_-a*b)*k,e[10]=(h*C-d*v+y*m)*k,e[11]=(u*v-c*C-f*m)*k,e[12]=(s*x-o*Q-l*b)*k,e[13]=(r*Q-n*x+i*b)*k,e[14]=(d*I-h*E-p*m)*k,e[15]=(c*E-u*I+g*m)*k,e):null}function pl(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],A=t[6],c=t[7],u=t[8],g=t[9],f=t[10],h=t[11],d=t[12],p=t[13],y=t[14],m=t[15],I=r[0],v=r[1],E=r[2],C=r[3];return e[0]=I*n+v*s+E*u+C*d,e[1]=I*i+v*l+E*g+C*p,e[2]=I*a+v*A+E*f+C*y,e[3]=I*o+v*c+E*h+C*m,I=r[4],v=r[5],E=r[6],C=r[7],e[4]=I*n+v*s+E*u+C*d,e[5]=I*i+v*l+E*g+C*p,e[6]=I*a+v*A+E*f+C*y,e[7]=I*o+v*c+E*h+C*m,I=r[8],v=r[9],E=r[10],C=r[11],e[8]=I*n+v*s+E*u+C*d,e[9]=I*i+v*l+E*g+C*p,e[10]=I*a+v*A+E*f+C*y,e[11]=I*o+v*c+E*h+C*m,I=r[12],v=r[13],E=r[14],C=r[15],e[12]=I*n+v*s+E*u+C*d,e[13]=I*i+v*l+E*g+C*p,e[14]=I*a+v*A+E*f+C*y,e[15]=I*o+v*c+E*h+C*m,e}function yl(e,t,r){var n,i,a,o,s,l,A,c,u,g,f,h,d=r[0],p=r[1],y=r[2];return t===e?(e[12]=t[0]*d+t[4]*p+t[8]*y+t[12],e[13]=t[1]*d+t[5]*p+t[9]*y+t[13],e[14]=t[2]*d+t[6]*p+t[10]*y+t[14],e[15]=t[3]*d+t[7]*p+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],A=t[6],c=t[7],u=t[8],g=t[9],f=t[10],h=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=A,e[7]=c,e[8]=u,e[9]=g,e[10]=f,e[11]=h,e[12]=n*d+s*p+u*y+t[12],e[13]=i*d+l*p+g*y+t[13],e[14]=a*d+A*p+f*y+t[14],e[15]=o*d+c*p+h*y+t[15]),e}function ml(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Il(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],A=t[8],c=t[9],u=t[10],g=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+A*n,e[5]=o*i+c*n,e[6]=s*i+u*n,e[7]=l*i+g*n,e[8]=A*i-a*n,e[9]=c*i-o*n,e[10]=u*i-s*n,e[11]=g*i-l*n,e}function vl(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],A=t[4],c=t[5],u=t[6],g=t[7];return t!==e&&(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[0]=a*i+A*n,e[1]=o*i+c*n,e[2]=s*i+u*n,e[3]=l*i+g*n,e[4]=A*i-a*n,e[5]=c*i-o*n,e[6]=u*i-s*n,e[7]=g*i-l*n,e}function El(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e}function Cl(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),A=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*A,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*A,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Bl=pl;function bl(){var e=new sl(3);return sl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function xl(e){var t=new sl(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function wl(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Ql(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function _l(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function Sl(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function kl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Dl(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}function Tl(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}var Ml=Ql;function Rl(){var e=new sl(4);return sl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Ll(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Nl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Fl(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function Ol(){var e=new sl(2);return sl!=Float32Array&&(e[0]=0,e[1]=0),e}function Pl(e){var t=e[0],r=e[1];return t*t+r*r}bl(),Rl();var Gl=Pl,Ul=(Ol(),function(e){function t(t){e.call(this,t,ol)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new zs(e)},t.prototype.queryRadius=function(e){var t=e;return rl("circle-radius",this,t)+rl("circle-stroke-width",this,t)+nl(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o,s){for(var l=il(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),A=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),c="map"===this.paint.get("circle-pitch-alignment"),u=c?l:ql(l,s),g=c?A*o:A,f=0,h=n;fe.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=e.data,s=t.data,l=0;l80*r){n=a=e[0],i=o=e[1];for(var h=r;ha&&(a=s),l>o&&(o=l);A=0!==(A=Math.max(a-n,o-i))?1/A:0}return sA(g,f,r,n,i,A),f}function aA(e,t,r,n,i){var a,o;if(i===LA(e,t,r,n)>0)for(a=t;a=t;a-=n)o=TA(a,e[a],e[a+1],o);return o&&bA(o,o.next)&&(MA(o),o=o.next),o}function oA(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!bA(n,n.next)&&0!==BA(n.prev,n,n.next))n=n.next;else{if(MA(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function sA(e,t,r,n,i,a,o){if(e){!o&&a&&yA(e,n,i,a);for(var s,l,A=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?AA(e,n,i,a):lA(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),MA(e),e=l.next,A=l.next;else if((e=l)===A){o?1===o?sA(e=cA(oA(e),t,r),t,r,n,i,a,2):2===o&&uA(e,t,r,n,i,a):sA(oA(e),t,r,n,i,a,1);break}}}function lA(e){var t=e.prev,r=e,n=e.next;if(BA(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(EA(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&BA(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function AA(e,t,r,n){var i=e.prev,a=e,o=e.next;if(BA(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,u=IA(s,l,t,r,n),g=IA(A,c,t,r,n),f=e.prevZ,h=e.nextZ;f&&f.z>=u&&h&&h.z<=g;){if(f!==e.prev&&f!==e.next&&EA(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&BA(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,h!==e.prev&&h!==e.next&&EA(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&BA(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;f&&f.z>=u;){if(f!==e.prev&&f!==e.next&&EA(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&BA(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;h&&h.z<=g;){if(h!==e.prev&&h!==e.next&&EA(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&BA(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function cA(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!bA(i,a)&&xA(i,n,n.next,a)&&SA(i,a)&&SA(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),MA(n),MA(n.next),n=e=a),n=n.next}while(n!==e);return oA(n)}function uA(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&CA(o,s)){var l=DA(o,s);return o=oA(o,o.next),l=oA(l,l.next),sA(o,t,r,n,i,a),void sA(l,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function gA(e,t,r,n){var i,a,o,s=[];for(i=0,a=t.length;i=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&EA(ar.x||n.x===r.x&&pA(r,n)))&&(r=n,g=l)),n=n.next}while(n!==A);return r}function pA(e,t){return BA(e.prev,e,t.prev)<0&&BA(t.next,e,e.next)<0}function yA(e,t,r,n){var i=e;do{null===i.z&&(i.z=IA(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,mA(i)}function mA(e){var t,r,n,i,a,o,s,l,A=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,A*=2}while(o>1);return e}function IA(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vA(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function CA(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!_A(e,t)&&(SA(e,t)&&SA(t,e)&&kA(e,t)&&(BA(e.prev,e,t.prev)||BA(e,t.prev,t))||bA(e,t)&&BA(e.prev,e,e.next)>0&&BA(t.prev,t,t.next)>0)}function BA(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function bA(e,t){return e.x===t.x&&e.y===t.y}function xA(e,t,r,n){var i=QA(BA(e,t,r)),a=QA(BA(e,t,n)),o=QA(BA(r,n,e)),s=QA(BA(r,n,t));return i!==a&&o!==s||!(0!==i||!wA(e,r,t))||!(0!==a||!wA(e,n,t))||!(0!==o||!wA(r,e,n))||!(0!==s||!wA(r,t,n))}function wA(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function QA(e){return e>0?1:e<0?-1:0}function _A(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&xA(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function SA(e,t){return BA(e.prev,e,e.next)<0?BA(e,t,e.next)>=0&&BA(e,e.prev,t)>=0:BA(e,t,e.prev)<0||BA(e,e.next,t)<0}function kA(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}function DA(e,t){var r=new RA(e.i,e.x,e.y),n=new RA(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function TA(e,t,r,n){var i=new RA(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function MA(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function RA(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function LA(e,t,r,n){for(var i=0,a=t,o=r-n;ar;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),A=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);FA(e,t,Math.max(r,Math.floor(t-o*l/a+A)),Math.min(n,Math.floor(t+(a-o)*l/a+A)),i)}var c=e[t],u=r,g=n;for(OA(e,r,t),i(e[n],c)>0&&OA(e,r,n);u0;)g--}0===i(e[r],c)?OA(e,r,g):OA(e,++g,n),g<=t&&(r=g+1),t<=g&&(n=g-1)}}function OA(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function PA(e,t){return et?1:0}function GA(e,t){var r=e.length;if(r<=1)return[e];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=e[i-1].length,r.holes.push(n))}return r},rA.default=nA;var HA=500,YA=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Bo,this.indexArray=new No,this.indexArray2=new zo,this.programConfigurations=new Ds(e.layers,e.zoom),this.segments=new rs,this.segments2=new rs,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};YA.prototype.populate=function(e,t,r){this.hasPattern=zA("fill",this.layers,t);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=e;a>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},ZA.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,A=-1/0;e.pos>3}if(n--,1===r||2===r)(i+=e.readSVarint())s&&(s=i),(a+=e.readSVarint())A&&(A=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,A]},ZA.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),A=ZA.types[this.type];function c(e){for(var t=0;t>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}function oc(e,t){this.layers=e.readFields(sc,{},t)}function sc(e,t,r){if(3===e){var n=new rc(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}nc.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new WA(this._pbf,t,this.extent,this._keys,this._values)};var lc={VectorTile:oc,VectorTileFeature:WA,VectorTileLayer:rc},Ac=lc.VectorTileFeature.types,cc=500,uc=Math.pow(2,13);function gc(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*uc)+o,i*uc*2,a*uc*2,Math.round(s))}var fc=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new xo,this.indexArray=new No,this.programConfigurations=new Ds(e.layers,e.zoom),this.segments=new rs,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function hc(e,t){return e.x===t.x&&(e.x<0||e.x>Ls)||e.y===t.y&&(e.y<0||e.y>Ls)}function dc(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>Ls}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>Ls}))}fc.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=zA("fill-extrusion",this.layers,t);for(var n=0,i=e;n=1){var m=h[p-1];if(!hc(y,m)){u.vertexLength+4>rs.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var I=y.sub(m)._perp()._unit(),v=m.dist(y);d+v>32768&&(d=0),gc(this.layoutVertexArray,y.x,y.y,I.x,I.y,0,0,d),gc(this.layoutVertexArray,y.x,y.y,I.x,I.y,0,1,d),d+=v,gc(this.layoutVertexArray,m.x,m.y,I.x,I.y,0,0,d),gc(this.layoutVertexArray,m.x,m.y,I.x,I.y,0,1,d);var E=u.vertexLength;this.indexArray.emplaceBack(E,E+2,E+1),this.indexArray.emplaceBack(E+1,E+2,E+3),u.vertexLength+=4,u.primitiveLength+=2}}}}if(u.vertexLength+l>rs.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Ac[e.type]){for(var C=[],B=[],b=u.vertexLength,x=0,w=s;x=2&&e[l-1].equals(e[l-2]);)l--;for(var A=0;A0;if(B&&y>A){var x=c.dist(f);if(x>2*u){var w=c.sub(c.sub(f)._mult(u/x)._round());this.updateDistance(f,w),this.addCurrentVertex(w,d,0,0,g),f=w}}var Q=f&&h,_=Q?r:s?"butt":n;if(Q&&"round"===_&&(Ei&&(_="bevel"),"bevel"===_&&(E>2&&(_="flipbevel"),E100)m=p.mult(-1);else{var S=E*d.add(p).mag()/d.sub(p).mag();m._perp()._mult(S*(b?-1:1))}this.addCurrentVertex(c,m,0,0,g),this.addCurrentVertex(c,m.mult(-1),0,0,g)}else if("bevel"===_||"fakeround"===_){var k=-Math.sqrt(E*E-1),D=b?k:0,T=b?0:k;if(f&&this.addCurrentVertex(c,d,D,T,g),"fakeround"===_)for(var M=Math.round(180*C/Math.PI/Sc),R=1;R2*u){var G=c.add(h.sub(c)._mult(u/P)._round());this.updateDistance(c,G),this.addCurrentVertex(G,p,0,0,g),c=G}}}}},Mc.prototype.addCurrentVertex=function(e,t,r,n,i,a){void 0===a&&(a=!1);var o=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*n,A=-t.y-t.x*n;this.addHalfVertex(e,o,s,a,!1,r,i),this.addHalfVertex(e,l,A,a,!0,-n,i),this.distance>Tc/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,n,i,a))},Mc.prototype.addHalfVertex=function(e,t,r,n,i,a,o){var s=e.x,l=e.y,A=(this.lineClips?this.scaledDistance*(Tc-1):this.scaledDistance)*Dc;if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(wc*t)+128,Math.round(wc*r)+128,1+(0===a?0:a<0?-1:1)|(63&A)<<2,A>>6),this.lineClips){var c=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(c,this.lineClipsArray.length)}var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u},Mc.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Mc.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},ma("LineBucket",Mc,{omit:["layers","patternFeatures"]});var Rc=new uo({"line-cap":new oo(ut.layout_line["line-cap"]),"line-join":new so(ut.layout_line["line-join"]),"line-miter-limit":new oo(ut.layout_line["line-miter-limit"]),"line-round-limit":new oo(ut.layout_line["line-round-limit"]),"line-sort-key":new so(ut.layout_line["line-sort-key"])}),Lc={paint:new uo({"line-opacity":new so(ut.paint_line["line-opacity"]),"line-color":new so(ut.paint_line["line-color"]),"line-translate":new oo(ut.paint_line["line-translate"]),"line-translate-anchor":new oo(ut.paint_line["line-translate-anchor"]),"line-width":new so(ut.paint_line["line-width"]),"line-gap-width":new so(ut.paint_line["line-gap-width"]),"line-offset":new so(ut.paint_line["line-offset"]),"line-blur":new so(ut.paint_line["line-blur"]),"line-dasharray":new Ao(ut.paint_line["line-dasharray"]),"line-pattern":new lo(ut.paint_line["line-pattern"]),"line-gradient":new co(ut.paint_line["line-gradient"])}),layout:Rc},Nc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,r){return r=new Za(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),e.prototype.possiblyEvaluate.call(this,t,r)},t.prototype.evaluate=function(t,r,n,i){return r=m({},r,{zoom:Math.floor(r.zoom)}),e.prototype.evaluate.call(this,t,r,n,i)},t}(so),Fc=new Nc(Lc.paint.properties["line-width"].specification);Fc.useIntegerZoom=!0;var Oc=function(e){function t(t){e.call(this,t,Lc),this.gradientVersion=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){if("line-gradient"===e){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression.expression instanceof Or,this.gradientVersion=(this.gradientVersion+1)%A}},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=Fc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new Mc(e)},t.prototype.queryRadius=function(e){var t=e,r=Pc(rl("line-width",this,t),rl("line-gap-width",this,t)),n=rl("line-offset",this,t);return r/2+Math.abs(n)+nl(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o){var s=il(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*Pc(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),A=this.paint.get("line-offset").evaluate(t,r);return A&&(n=Gc(n,A*o)),Js(s,n,l)},t.prototype.isTileClipped=function(){return!0},t}(fo);function Pc(e,t){return t>0?t+2*e:e}function Gc(e,t){for(var r=[],n=new a(0,0),i=0;i":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};function Wc(e){for(var t="",r=0;r>1,c=-7,u=r?i-1:0,g=r?-1:1,f=e[t+u];for(u+=g,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=g,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+u],u+=g,c-=8);if(0===a)a=1-A;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=A}return(f?-1:1)*o*Math.pow(2,a-n)},write:function(e,t,r,n,i,a){var o,s,l,A=8*a-i-1,c=(1<>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,h=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?g/l:g*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,i),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&s,f+=h,s/=256,i-=8);for(o=o<0;e[r+f]=255&o,f+=h,o/=256,A-=8);e[r+f-h]|=128*d}},$c=eu;function eu(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}eu.Varint=0,eu.Fixed64=1,eu.Bytes=2,eu.Fixed32=5;var tu=4294967296,ru=1/tu,nu=12,iu="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function au(e,t,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return su(e,n,t);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return su(e,n,t);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return su(e,n,t);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return su(e,n,t);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return su(e,n,t);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return su(e,n,t);throw new Error("Expected varint not more than 10 bytes")}function ou(e){return e.type===eu.Bytes?e.readVarint()+e.pos:e.pos+1}function su(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function lu(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),Au(r,n,t),cu(n,t)}function Au(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}function cu(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}function uu(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function gu(e,t){for(var r=0;r>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Bu(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function bu(e,t,r){for(var n="",i=t;i239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(A=l):2===c?128===(192&(a=e[i+1]))&&(A=(31&l)<<6|63&a)<=127&&(A=null):3===c?(a=e[i+1],o=e[i+2],128===(192&a)&&128===(192&o)&&((A=(15&l)<<12|(63&a)<<6|63&o)<=2047||A>=55296&&A<=57343)&&(A=null)):4===c&&(a=e[i+1],o=e[i+2],s=e[i+3],128===(192&a)&&128===(192&o)&&128===(192&s)&&((A=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||A>=1114112)&&(A=null)),null===A?(A=65533,c=1):A>65535&&(A-=65536,n+=String.fromCharCode(A>>>10&1023|55296),A=56320|1023&A),n+=String.fromCharCode(A),i+=c}return n}function xu(e,t,r){return iu.decode(e.subarray(t,r))}function wu(e,t,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}eu.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Eu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Bu(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Eu(this.buf,this.pos)+Eu(this.buf,this.pos+4)*tu;return this.pos+=8,e},readSFixed64:function(){var e=Eu(this.buf,this.pos)+Bu(this.buf,this.pos+4)*tu;return this.pos+=8,e},readFloat:function(){var e=Xc.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Xc.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:au(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=nu&&iu?xu(this.buf,t,e):bu(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==eu.Bytes)return e.push(this.readVarint(t));var r=ou(this);for(e=e||[];this.pos127;);else if(t===eu.Bytes)this.pos=this.readVarint()+this.pos;else if(t===eu.Fixed32)this.pos+=4;else{if(t!==eu.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?lu(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=wu(this.buf,e,this.pos);var r=this.pos-t;r>=128&&uu(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Xc.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Xc.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&uu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,eu.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,gu,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,fu,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,pu,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,hu,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,du,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,yu,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,mu,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Iu,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,vu,t)},writeBytesField:function(e,t){this.writeTag(e,eu.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,eu.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,eu.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,eu.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,eu.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,eu.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,eu.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,eu.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,eu.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,eu.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var Qu=3;function _u(e,t,r){1===e&&r.readMessage(Su,t)}function Su(e,t,r){if(3===e){var n=r.readMessage(ku,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,A=n.top,c=n.advance;t.push({id:i,bitmap:new jl({width:o+2*Qu,height:s+2*Qu},a),metrics:{width:o,height:s,left:l,top:A,advance:c}})}}function ku(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function Du(e){return new $c(e).readFields(_u,[])}var Tu=Qu;function Mu(e){for(var t=0,r=0,n=0,i=e;n=0;g--){var f=o[g];if(!(u.w>f.w||u.h>f.h)){if(u.x=f.x,u.y=f.y,l=Math.max(l,u.y+u.h),s=Math.max(s,u.x+u.w),u.w===f.w&&u.h===f.h){var h=o.pop();g=0&&n>=e&&Ku[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Hu.prototype.substring=function(e,t){var r=new Hu;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Hu.prototype.toString=function(){return this.text},Hu.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Hu.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(qu.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,n=0;n=zu?null:++this.imageSectionID:(this.imageSectionID=Uu,this.imageSectionID)};var Ku={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ju={};function Vu(e,t,r,n,i,a){if(t.imageName){var o=n[t.imageName];return o?o.displaySize[0]*t.scale*Zc/a+i:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+i:0}function Wu(e,t,r,n,i,a){for(var o=0,s=0;s=0,c=0,u=0;u0&&O>x&&(x=O)}else{var P=r[Q.fontStack],G=P&&P[S];if(G&&G.rect)T=G.rect,D=G.metrics;else{var U=t[Q.fontStack],z=U&&U[S];if(!z)continue;D=z.metrics}k=(E-Q.scale)*Zc}L?(e.verticalizable=!0,b.push({glyph:S,imageName:M,x:g,y:f+k,vertical:L,scale:Q.scale,fontStack:Q.fontStack,sectionIndex:_,metrics:D,rect:T}),g+=R*Q.scale+A):(b.push({glyph:S,imageName:M,x:g,y:f+k,vertical:L,scale:Q.scale,fontStack:Q.fontStack,sectionIndex:_,metrics:D,rect:T}),g+=D.advance*Q.scale+A)}if(0!==b.length){var q=g-A;h=Math.max(q,h),ig(b,0,b.length-1,p,x)}g=0;var H=a*E+x;B.lineOffset=Math.max(x,C),f+=H,d=Math.max(H,d),++y}else f+=a,++y}var Y=f-Pu,J=rg(o),K=J.horizontalAlign,j=J.verticalAlign;ag(e.positionedLines,p,K,j,h,d,a,Y,i.length),e.top+=-j*Y,e.bottom=e.top+Y,e.left+=-K*h,e.right=e.left+h}function ig(e,t,r,n,i){if(n||i)for(var a=e[r],o=a.metrics.advance*a.scale,s=(e[r].x+o)*n,l=t;l<=r;l++)e[l].x-=s,e[l].y+=i}function ag(e,t,r,n,i,a,o,s,l){var A=(t-r)*i,c=0;c=a!==o?-s*n-Pu:(-n*l+.5)*o;for(var u=0,g=e;u-r/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],A=0;sn;)A-=l.shift().angleDelta;if(A>i)return!1;o++,s+=u.dist(g)}return!0}function dg(e){for(var t=0,r=0;rA){var h=(A-l)/f,d=Pr(u.x,g.x,h),p=Pr(u.y,g.y,h),y=new lg(d,p,g.angleTo(u),c);return y._round(),!o||hg(e,y,s,o,t)?y:void 0}l+=f}}function Ig(e,t,r,n,i,a,o,s,l){var A=pg(n,a,o),c=yg(n,i),u=c*o,g=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-u=0&&v=0&&E=0&&g+A<=c){var C=new lg(v,E,m,h);C._round(),n&&!hg(e,C,a,n,i)||f.push(C)}}u+=y}return s||f.length||o||(f=vg(e,u/2,r,n,i,a,o,!0,l)),f}function Eg(e,t,r,n,i){for(var o=[],s=0;s=n&&g.x>=n||(u.x>=n?u=new a(n,u.y+(g.y-u.y)*((n-u.x)/(g.x-u.x)))._round():g.x>=n&&(g=new a(n,u.y+(g.y-u.y)*((n-u.x)/(g.x-u.x)))._round()),u.y>=i&&g.y>=i||(u.y>=i?u=new a(u.x+(g.x-u.x)*((i-u.y)/(g.y-u.y)),i)._round():g.y>=i&&(g=new a(u.x+(g.x-u.x)*((i-u.y)/(g.y-u.y)),i)._round()),A&&u.equals(A[A.length-1])||(A=[u],o.push(A)),A.push(g)))))}return o}var Cg=Ru;function Bg(e,t,r,n){var i=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2*Cg,A=o.paddedRect.h-2*Cg,c=e.right-e.left,u=e.bottom-e.top,g=o.stretchX||[[0,l]],f=o.stretchY||[[0,A]],h=function(e,t){return e+t[1]-t[0]},d=g.reduce(h,0),p=f.reduce(h,0),y=l-d,m=A-p,I=0,v=d,E=0,C=p,B=0,b=y,x=0,w=m;if(o.content&&n){var Q=o.content;I=bg(g,0,Q[0]),E=bg(f,0,Q[1]),v=bg(g,Q[0],Q[2]),C=bg(f,Q[1],Q[3]),B=Q[0]-I,x=Q[1]-E,b=Q[2]-Q[0]-v,w=Q[3]-Q[1]-C}var _=function(n,i,l,A){var g=wg(n.stretch-I,v,c,e.left),f=Qg(n.fixed-B,b,n.stretch,d),h=wg(i.stretch-E,C,u,e.top),y=Qg(i.fixed-x,w,i.stretch,p),m=wg(l.stretch-I,v,c,e.left),Q=Qg(l.fixed-B,b,l.stretch,d),_=wg(A.stretch-E,C,u,e.top),S=Qg(A.fixed-x,w,A.stretch,p),k=new a(g,h),D=new a(m,h),T=new a(m,_),M=new a(g,_),R=new a(f/s,y/s),L=new a(Q/s,S/s),N=t*Math.PI/180;if(N){var F=Math.sin(N),O=Math.cos(N),P=[O,-F,F,O];k._matMult(P),D._matMult(P),M._matMult(P),T._matMult(P)}var G=n.stretch+n.fixed,U=l.stretch+l.fixed,z=i.stretch+i.fixed,q=A.stretch+A.fixed;return{tl:k,tr:D,bl:M,br:T,tex:{x:o.paddedRect.x+Cg+G,y:o.paddedRect.y+Cg+z,w:U-G,h:q-z},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:L,minFontScaleX:b/s/c,minFontScaleY:w/s/u,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var S=xg(g,y,d),k=xg(f,m,p),D=0;D0&&(h=Math.max(10,h),this.circleDiameter=h)}else{var d=o.top*s-l,p=o.bottom*s+l,y=o.left*s-l,m=o.right*s+l,I=o.collisionPadding;if(I&&(y-=I[0]*s,d-=I[1]*s,m+=I[2]*s,p+=I[3]*s),c){var v=new a(y,d),E=new a(m,d),C=new a(y,p),B=new a(m,p),b=c*Math.PI/180;v._rotate(b),E._rotate(b),C._rotate(b),B._rotate(b),y=Math.min(v.x,E.x,C.x,B.x),m=Math.max(v.x,E.x,C.x,B.x),d=Math.min(v.y,E.y,C.y,B.y),p=Math.max(v.y,E.y,C.y,B.y)}e.emplaceBack(t.x,t.y,y,d,m,p,r,n,i)}this.boxEndIndex=e.length},kg=function(e,t){if(void 0===e&&(e=[]),void 0===t&&(t=Dg),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Dg(e,t){return et?1:0}function Tg(e,t,r){void 0===t&&(t=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=e[0],A=0;Ao)&&(o=c.x),(!A||c.y>s)&&(s=c.y)}var u=o-n,g=s-i,f=Math.min(u,g),h=f/2,d=new kg([],Mg);if(0===f)return new a(n,i);for(var p=n;pm.d||!m.d)&&(m=v,r&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,I)),v.max-m.d<=t||(h=v.h/2,d.push(new Rg(v.p.x-h,v.p.y-h,h,e)),d.push(new Rg(v.p.x+h,v.p.y-h,h,e)),d.push(new Rg(v.p.x-h,v.p.y+h,h,e)),d.push(new Rg(v.p.x+h,v.p.y+h,h,e)),I+=4)}return r&&(console.log("num probes: "+I),console.log("best distance: "+m.d)),m.p}function Mg(e,t){return t.max-e.max}function Rg(e,t,r,n){this.p=new a(e,t),this.h=r,this.d=Lg(this.p,n),this.max=this.d+this.h*Math.SQRT2}function Lg(e,t){for(var r=!1,n=1/0,i=0;ie.y!==c.y>e.y&&e.x<(c.x-A.x)*(e.y-A.y)/(c.y-A.y)+A.x&&(r=!r),n=Math.min(n,Zs(e,A,c))}return(r?1:-1)*Math.sqrt(n)}function Ng(e){for(var t=0,r=0,n=0,i=e[0],a=0,o=i.length,s=o-1;a0&&(this.data[0]=t,this._down(0)),e}},kg.prototype.peek=function(){return this.data[0]},kg.prototype._up=function(e){for(var t=this,r=t.data,n=t.compare,i=r[e];e>0;){var a=e-1>>1,o=r[a];if(n(i,o)>=0)break;r[e]=o,e=a}r[e]=i},kg.prototype._down=function(e){for(var t=this,r=t.data,n=t.compare,i=this.length>>1,a=r[e];e=0)break;r[e]=s,e=o}r[e]=a};var Fg=7,Og=Number.POSITIVE_INFINITY;function Pg(e,t){function r(e,t){var r=0,n=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":n=i-Fg;break;case"bottom-right":case"bottom-left":n=-i+Fg;break;case"bottom":n=-t+Fg;break;case"top":n=t-Fg}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}function n(e,t,r){var n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-Fg;break;case"bottom-right":case"bottom-left":case"bottom":i=-r+Fg}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}return t[1]!==Og?n(e,t[0],t[1]):r(e,t[0])}function Gg(e,t,r,n,i,a,o){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=Ls/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,A=e.layers[0]._unevaluatedLayout._values,c={};if("composite"===e.textSizeData.kind){var u=e.textSizeData,g=u.minZoom,f=u.maxZoom;c.compositeTextSizes=[A["text-size"].possiblyEvaluate(new Za(g),o),A["text-size"].possiblyEvaluate(new Za(f),o)]}if("composite"===e.iconSizeData.kind){var h=e.iconSizeData,d=h.minZoom,p=h.maxZoom;c.compositeIconSizes=[A["icon-size"].possiblyEvaluate(new Za(d),o),A["icon-size"].possiblyEvaluate(new Za(p),o)]}c.layoutTextSize=A["text-size"].possiblyEvaluate(new Za(e.zoom+1),o),c.layoutIconSize=A["icon-size"].possiblyEvaluate(new Za(e.zoom+1),o),c.textMaxSize=A["text-size"].possiblyEvaluate(new Za(18));for(var y=l.get("text-line-height")*Zc,m="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),I=l.get("text-keep-upright"),v=l.get("text-size"),E=function(){var a=B[C],s=l.get("text-font").evaluate(a,{},o).join(","),A=v.evaluate(a,{},o),u=c.layoutTextSize.evaluate(a,{},o),g=c.layoutIconSize.evaluate(a,{},o),f={horizontal:{},vertical:void 0},h=a.text,d=[0,0];if(h){var p=h.toString(),E=l.get("text-letter-spacing").evaluate(a,{},o)*Zc,b=Qa(p)?E:0,x=l.get("text-anchor").evaluate(a,{},o),w=l.get("text-variable-anchor");if(!w){var Q=l.get("text-radial-offset").evaluate(a,{},o);d=Q?Pg(x,[Q*Zc,Og]):l.get("text-offset").evaluate(a,{},o).map((function(e){return e*Zc}))}var _=m?"center":l.get("text-justify").evaluate(a,{},o),S=l.get("symbol-placement"),k="point"===S?l.get("text-max-width").evaluate(a,{},o)*Zc:0,D=function(){e.allowVerticalPlacement&&wa(p)&&(f.vertical=Ju(h,t,r,i,s,k,y,x,"left",b,d,Ou.vertical,!0,S,u,A))};if(!m&&w){for(var M="auto"===_?w.map((function(e){return Ug(e)})):[_],R=!1,L=0;L=Ls||u.y<0||u.y>=Ls||Kg(e,u,s,r,n,i,g,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,m,C,x,l,v,B,w,h,t,a,A,c,o)};if("line"===Q)for(var D=0,T=Eg(t.geometry,0,0,Ls,Ls);D1){var G=mg(P,b,r.vertical||d,n,p,I);G&&k(P,G)}}else if("Polygon"===t.type)for(var U=0,z=GA(t.geometry,0);UHg&&T(e.layerIds[0]+': Value for "text-size" is >= '+qg+'. Reduce your "text-size".'):"composite"===p.kind&&((y=[Ag*f.compositeTextSizes[0].evaluate(o,{},h),Ag*f.compositeTextSizes[1].evaluate(o,{},h)])[0]>Hg||y[1]>Hg)&&T(e.layerIds[0]+': Value for "text-size" is >= '+qg+'. Reduce your "text-size".'),e.addSymbols(e.text,d,y,s,a,o,A,t,l.lineStartIndex,l.lineLength,g,h);for(var m=0,I=c;mHg&&T(e.layerIds[0]+': Value for "icon-size" is >= '+qg+'. Reduce your "icon-size".'):"composite"===j.kind&&((V=[Ag*E.compositeIconSizes[0].evaluate(v,{},B),Ag*E.compositeIconSizes[1].evaluate(v,{},B)])[0]>Hg||V[1]>Hg)&&T(e.layerIds[0]+': Value for "icon-size" is >= '+qg+'. Reduce your "icon-size".'),e.addSymbols(e.icon,J,V,I,m,v,!1,t,k.lineStartIndex,k.lineLength,-1,B),N=e.icon.placedSymbolArray.length-1,K&&(M=4*K.length,e.addSymbols(e.icon,K,V,I,m,v,Ou.vertical,t,k.lineStartIndex,k.lineLength,-1,B),F=e.icon.placedSymbolArray.length-1)}for(var W in n.horizontal){var Z=n.horizontal[W];if(!w){P=ss(Z.text);var X=s.layout.get("text-rotate").evaluate(v,{},B);w=new Sg(l,t,A,c,u,Z,g,f,h,X)}var $=1===Z.positionedLines.length;if(R+=Yg(e,t,Z,a,s,h,v,d,k,n.vertical?Ou.horizontal:Ou.horizontalOnly,$?Object.keys(n.horizontal):[W],O,N,E,B),$)break}n.vertical&&(L+=Yg(e,t,n.vertical,a,s,h,v,d,k,Ou.vertical,["vertical"],O,F,E,B));var ee=w?w.boxStartIndex:e.collisionBoxArray.length,te=w?w.boxEndIndex:e.collisionBoxArray.length,re=_?_.boxStartIndex:e.collisionBoxArray.length,ne=_?_.boxEndIndex:e.collisionBoxArray.length,ie=Q?Q.boxStartIndex:e.collisionBoxArray.length,ae=Q?Q.boxEndIndex:e.collisionBoxArray.length,oe=S?S.boxStartIndex:e.collisionBoxArray.length,se=S?S.boxEndIndex:e.collisionBoxArray.length,le=-1,Ae=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};le=Ae(w,le),le=Ae(_,le),le=Ae(Q,le);var ce=(le=Ae(S,le))>-1?1:0;ce&&(le*=b/Zc),e.glyphOffsetArray.length>=rf.MAX_GLYPHS&&T("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==v.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,v.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,O.right>=0?O.right:-1,O.center>=0?O.center:-1,O.left>=0?O.left:-1,O.vertical||-1,N,F,P,ee,te,re,ne,ie,ae,oe,se,A,R,L,D,M,ce,0,g,G,U,le)}function jg(e,t,r,n){var i=e.compareText;if(t in i){for(var a=i[t],o=a.length-1;o>=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),A="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],l||A){for(var u=t.iconDependencies,g=t.glyphDependencies,f=t.availableImages,h=new Za(this.zoom),d=0,p=e;d=0;for(var M=0,R=b.sections;M=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var l=0;l0},rf.prototype.hasIconData=function(){return this.icon.segments.get().length>0},rf.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},rf.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},rf.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},rf.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(e)===r&&t.addIndicesForPlacedSymbol(t.text,e)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},ma("SymbolBucket",rf,{omit:["layers","collisionBoxArray","features","compareText"]}),rf.MAX_GLYPHS=65535,rf.addDynamicAttributes=Xg;var af=new uo({"symbol-placement":new oo(ut.layout_symbol["symbol-placement"]),"symbol-spacing":new oo(ut.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new oo(ut.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new so(ut.layout_symbol["symbol-sort-key"]),"symbol-z-order":new oo(ut.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new oo(ut.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new oo(ut.layout_symbol["icon-ignore-placement"]),"icon-optional":new oo(ut.layout_symbol["icon-optional"]),"icon-rotation-alignment":new oo(ut.layout_symbol["icon-rotation-alignment"]),"icon-size":new so(ut.layout_symbol["icon-size"]),"icon-text-fit":new oo(ut.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new oo(ut.layout_symbol["icon-text-fit-padding"]),"icon-image":new so(ut.layout_symbol["icon-image"]),"icon-rotate":new so(ut.layout_symbol["icon-rotate"]),"icon-padding":new oo(ut.layout_symbol["icon-padding"]),"icon-keep-upright":new oo(ut.layout_symbol["icon-keep-upright"]),"icon-offset":new so(ut.layout_symbol["icon-offset"]),"icon-anchor":new so(ut.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new oo(ut.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new oo(ut.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new oo(ut.layout_symbol["text-rotation-alignment"]),"text-field":new so(ut.layout_symbol["text-field"]),"text-font":new so(ut.layout_symbol["text-font"]),"text-size":new so(ut.layout_symbol["text-size"]),"text-max-width":new so(ut.layout_symbol["text-max-width"]),"text-line-height":new oo(ut.layout_symbol["text-line-height"]),"text-letter-spacing":new so(ut.layout_symbol["text-letter-spacing"]),"text-justify":new so(ut.layout_symbol["text-justify"]),"text-radial-offset":new so(ut.layout_symbol["text-radial-offset"]),"text-variable-anchor":new oo(ut.layout_symbol["text-variable-anchor"]),"text-anchor":new so(ut.layout_symbol["text-anchor"]),"text-max-angle":new oo(ut.layout_symbol["text-max-angle"]),"text-writing-mode":new oo(ut.layout_symbol["text-writing-mode"]),"text-rotate":new so(ut.layout_symbol["text-rotate"]),"text-padding":new oo(ut.layout_symbol["text-padding"]),"text-keep-upright":new oo(ut.layout_symbol["text-keep-upright"]),"text-transform":new so(ut.layout_symbol["text-transform"]),"text-offset":new so(ut.layout_symbol["text-offset"]),"text-allow-overlap":new oo(ut.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new oo(ut.layout_symbol["text-ignore-placement"]),"text-optional":new oo(ut.layout_symbol["text-optional"])}),of={paint:new uo({"icon-opacity":new so(ut.paint_symbol["icon-opacity"]),"icon-color":new so(ut.paint_symbol["icon-color"]),"icon-halo-color":new so(ut.paint_symbol["icon-halo-color"]),"icon-halo-width":new so(ut.paint_symbol["icon-halo-width"]),"icon-halo-blur":new so(ut.paint_symbol["icon-halo-blur"]),"icon-translate":new oo(ut.paint_symbol["icon-translate"]),"icon-translate-anchor":new oo(ut.paint_symbol["icon-translate-anchor"]),"text-opacity":new so(ut.paint_symbol["text-opacity"]),"text-color":new so(ut.paint_symbol["text-color"],{runtimeType:Bt,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new so(ut.paint_symbol["text-halo-color"]),"text-halo-width":new so(ut.paint_symbol["text-halo-width"]),"text-halo-blur":new so(ut.paint_symbol["text-halo-blur"]),"text-translate":new oo(ut.paint_symbol["text-translate"]),"text-translate-anchor":new oo(ut.paint_symbol["text-translate-anchor"])}),layout:af},sf=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:It,this.defaultValue=e};sf.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},sf.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},sf.prototype.outputDefined=function(){return!1},sf.prototype.serialize=function(){return null},ma("FormatSectionOverride",sf,{omit:["defaultValue"]});var lf=function(e){function t(t){e.call(this,t,of)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){if(e.prototype.recalculate.call(this,t,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},bf.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(""===t.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else N()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},bf.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},bf.prototype.processTask=function(e,t){var r=this;if(""===t.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(Ba(t.error)):n(null,Ba(t.data)))}else{var i=!1,a=P(this.globalScope)?void 0:[],o=t.hasCallback?function(t,n){i=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"",sourceMapId:r.mapId,error:t?Ca(t):null,data:Ca(n,a)},a)}:function(e){i=!0},s=null,l=Ba(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,l,o);else if(this.parent.getWorkerSource){var A=t.type.split(".");s=this.parent.getWorkerSource(t.sourceMapId,A[0],l.source)[A[1]](l,o)}else o(new Error("Could not find function "+t.type));!i&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},bf.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Qf=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};Qf.prototype.setNorthEast=function(e){return this._ne=e instanceof Sf?new Sf(e.lng,e.lat):Sf.convert(e),this},Qf.prototype.setSouthWest=function(e){return this._sw=e instanceof Sf?new Sf(e.lng,e.lat):Sf.convert(e),this},Qf.prototype.extend=function(e){var t,r,n=this._sw,i=this._ne;if(e instanceof Sf)t=e,r=e;else{if(!(e instanceof Qf)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){var a=e;return this.extend(Qf.convert(a))}var o=e;return this.extend(Sf.convert(o))}return this}if(t=e._sw,r=e._ne,!t||!r)return this}return n||i?(n.lng=Math.min(t.lng,n.lng),n.lat=Math.min(t.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Sf(t.lng,t.lat),this._ne=new Sf(r.lng,r.lat)),this},Qf.prototype.getCenter=function(){return new Sf((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Qf.prototype.getSouthWest=function(){return this._sw},Qf.prototype.getNorthEast=function(){return this._ne},Qf.prototype.getNorthWest=function(){return new Sf(this.getWest(),this.getNorth())},Qf.prototype.getSouthEast=function(){return new Sf(this.getEast(),this.getSouth())},Qf.prototype.getWest=function(){return this._sw.lng},Qf.prototype.getSouth=function(){return this._sw.lat},Qf.prototype.getEast=function(){return this._ne.lng},Qf.prototype.getNorth=function(){return this._ne.lat},Qf.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Qf.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Qf.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Qf.prototype.contains=function(e){var t=Sf.convert(e),r=t.lng,n=t.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Qf.convert=function(e){return!e||e instanceof Qf?e:new Qf(e)};var _f=6371008.8,Sf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Sf.prototype.wrap=function(){return new Sf(h(this.lng,-180,180),this.lat)},Sf.prototype.toArray=function(){return[this.lng,this.lat]},Sf.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Sf.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return _f*Math.acos(Math.min(i,1))},Sf.prototype.toBounds=function(e){void 0===e&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new Qf(new Sf(this.lng-r,this.lat-t),new Sf(this.lng+r,this.lat+t))},Sf.convert=function(e){if(e instanceof Sf)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Sf(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"===typeof e&&null!==e)return new Sf(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var kf=2*Math.PI*_f;function Df(e){return kf*Math.cos(e*Math.PI/180)}function Tf(e){return(180+e)/360}function Mf(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Rf(e,t){return e/Df(t)}function Lf(e){return 360*e-180}function Nf(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function Ff(e,t){return e*Df(Nf(t))}function Of(e){return 1/Math.cos(e*Math.PI/180)}var Pf=function(e,t,r){void 0===r&&(r=0),this.x=+e,this.y=+t,this.z=+r};Pf.fromLngLat=function(e,t){void 0===t&&(t=0);var r=Sf.convert(e);return new Pf(Tf(r.lng),Mf(r.lat),Rf(t,r.lat))},Pf.prototype.toLngLat=function(){return new Sf(Lf(this.x),Nf(this.y))},Pf.prototype.toAltitude=function(){return Ff(this.z,this.y)},Pf.prototype.meterInMercatorCoordinateUnits=function(){return 1/kf*Of(Nf(this.y))};var Gf=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=qf(0,e,e,t,r)};Gf.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Gf.prototype.url=function(e,t){var r=xf(this.x,this.y,this.z),n=Hf(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)},Gf.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new a((e.x*t-this.x)*Ls,(e.y*t-this.y)*Ls)},Gf.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Uf=function(e,t){this.wrap=e,this.canonical=t,this.key=qf(e,t.z,t.z,t.x,t.y)},zf=function(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new Gf(r,+n,+i),this.key=qf(t,e,r,n,i)};function qf(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);var a=1<0;a--)i+=(t&(n=1<this.canonical.z?new zf(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new zf(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},zf.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?qf(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):qf(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},zf.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t},zf.prototype.children=function(e){if(this.overscaledZ>=e)return[new zf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new zf(t,this.wrap,t,r,n),new zf(t,this.wrap,t,r+1,n),new zf(t,this.wrap,t,r,n+1),new zf(t,this.wrap,t,r+1,n+1)]},zf.prototype.isLessThan=function(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Yf.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Yf.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Yf.prototype.getPixels=function(){return new Vl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Yf.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,l=-r*this.dim,A=a;A=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},Zf.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new lc.VectorTile(new $c(this.rawTileData)).layers,this.sourceLayerCoder=new Kf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Zf.prototype.query=function(e,t,r,n){var i=this;this.loadVTLayers();for(var a=e.params||{},o=Ls/e.tileSize/e.scale,s=Mi(a.filter),l=e.queryGeometry,A=e.queryPadding*o,c=$f(l),u=this.grid.query(c.minX-A,c.minY-A,c.maxX+A,c.maxY+A),g=$f(e.cameraQueryGeometry),f=0,h=this.grid3D.query(g.minX-A,g.minY-A,g.maxX+A,g.maxY+A,(function(t,r,n,i){return el(e.cameraQueryGeometry,t-A,r-A,n+A,i+A)}));fn)i=!1;else if(t)if(this.expirationTime=_.maxzoom||"none"!==_.visibility&&(l(Q,this.zoom,n),(d[_.id]=_.createBucket({index:c.bucketLayerIDs.length,layers:Q,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:v,sourceID:this.source})).populate(E,p,this.tileID.canonical),c.bucketLayerIDs.push(Q.map((function(e){return e.id}))))}}}var S=e.mapObject(p.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(S).length?i.send("getGlyphs",{uid:this.uid,stacks:S},(function(e,t){u||(u=e,g=t,T.call(s))})):g={};var k=Object.keys(p.iconDependencies);k.length?i.send("getImages",{icons:k,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){u||(u=e,f=t,T.call(s))})):f={};var D=Object.keys(p.patternDependencies);function T(){if(u)return a(u);if(g&&f&&h){var t=new o(g),r=new e.ImageAtlas(f,h);for(var i in d){var s=d[i];s instanceof e.SymbolBucket?(l(s.layers,this.zoom,n),e.performSymbolLayout(s,g,t.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):s.hasPattern&&(s instanceof e.LineBucket||s instanceof e.FillBucket||s instanceof e.FillExtrusionBucket)&&(l(s.layers,this.zoom,n),s.addFeatures(p,this.tileID.canonical,r.patternPositions))}this.status="done",a(null,{buckets:e.values(d).filter((function(e){return!e.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?g:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?t.positions:null})}}D.length?i.send("getImages",{icons:D,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){u||(u=e,h=t,T.call(s))})):h={},T.call(this)};var c=function(e,t,r,n){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=n||A,this.loading={},this.loaded={}};c.prototype.loadTile=function(t,r){var n=this,i=t.uid;this.loading||(this.loading={});var a=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),o=this.loading[i]=new s(t);o.abort=this.loadVectorData(t,(function(t,s){if(delete n.loading[i],t||!s)return o.status="done",n.loaded[i]=o,r(t);var l=s.rawData,A={};s.expires&&(A.expires=s.expires),s.cacheControl&&(A.cacheControl=s.cacheControl);var c={};if(a){var u=a.finish();u&&(c.resourceTiming=JSON.parse(JSON.stringify(u)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(t,n){if(t||!n)return r(t);r(null,e.extend({rawTileData:l.slice(0)},n,A,c))})),n.loaded=n.loaded||{},n.loaded[i]=o}))},c.prototype.reloadTile=function(e,t){var r=this,n=this.loaded,i=e.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),t(e,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},c.prototype.abortTile=function(e,t){var r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),t()},c.prototype.removeTile=function(e,t){var r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()};var u=e.window.ImageBitmap,g=function(){this.loaded={}};g.prototype.loadTile=function(t,r){var n=t.uid,i=t.encoding,a=t.rawImageData,o=u&&a instanceof u?this.getImageData(a):a,s=new e.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},g.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},g.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]};var f=h;function h(e,t){var r,n=e&&e.type;if("FeatureCollection"===n)for(r=0;r=0!==!!t&&e.reverse()}var y=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,n=this._feature.geometry;r>31}function N(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;s>1;P(e,t,o,n,i,a%2),O(e,t,r,n,o-1,a+1),O(e,t,r,o+1,i,a+1)}}function P(e,t,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),A=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*A*(o-A)/o)*(s-o/2<0?-1:1);P(e,t,r,Math.max(n,Math.floor(r-s*A/o+c)),Math.min(i,Math.floor(r+(o-s)*A/o+c)),a)}var u=t[2*r+a],g=n,f=i;for(G(e,t,n,r),t[2*i+a]>u&&G(e,t,n,i);gu;)f--}t[2*n+a]===u?G(e,t,n,f):G(e,t,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}function G(e,t,r,n){U(e,r,n),U(t,2*r,2*n),U(t,2*r+1,2*n+1)}function U(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function z(e,t,r,n,i,a,o){for(var s,l,A=[0,e.length-1,0],c=[];A.length;){var u=A.pop(),g=A.pop(),f=A.pop();if(g-f<=o)for(var h=f;h<=g;h++)s=t[2*h],l=t[2*h+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(e[h]);else{var d=Math.floor((f+g)/2);s=t[2*d],l=t[2*d+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(e[d]);var p=(u+1)%2;(0===u?r<=s:n<=l)&&(A.push(f),A.push(d-1),A.push(p)),(0===u?i>=s:a>=l)&&(A.push(d+1),A.push(g),A.push(p))}}return c}function q(e,t,r,n,i,a){for(var o=[0,e.length-1,0],s=[],l=i*i;o.length;){var A=o.pop(),c=o.pop(),u=o.pop();if(c-u<=a)for(var g=u;g<=c;g++)H(t[2*g],t[2*g+1],r,n)<=l&&s.push(e[g]);else{var f=Math.floor((u+c)/2),h=t[2*f],d=t[2*f+1];H(h,d,r,n)<=l&&s.push(e[f]);var p=(A+1)%2;(0===A?r-i<=h:n-i<=d)&&(o.push(u),o.push(f-1),o.push(p)),(0===A?r+i>=h:n+i>=d)&&(o.push(f+1),o.push(c),o.push(p))}}return s}function H(e,t,r,n){var i=e-r,a=t-n;return i*i+a*a}b.fromVectorTileJs=x,b.fromGeojsonVt=w,b.GeoJSONWrapper=Q;var Y=function(e){return e[0]},J=function(e){return e[1]},K=function(e,t,r,n,i){void 0===t&&(t=Y),void 0===r&&(r=J),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=e;for(var a=e.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(e.length),s=this.coords=new i(2*e.length),l=0;l=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return ie(ie({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function ee(e){return e/360+.5}function te(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function re(e){return 360*(e-.5)}function ne(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function ie(e,t){for(var r in t)e[r]=t[r];return e}function ae(e){return e.x}function oe(e){return e.y}function se(e,t,r,n){for(var i,a=n,o=r-t>>1,s=r-t,l=e[t],A=e[t+1],c=e[r],u=e[r+1],g=t+3;ga)i=g,a=f;else if(f===a){var h=Math.abs(g-o);hn&&(i-t>3&&se(e,t,i,n),e[i+2]=a,r-i>3&&se(e,i,r,n))}function le(e,t,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=e-r)*o+(s=t-n)*s}function Ae(e,t,r,n){var i={id:"undefined"===typeof e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return ce(i),i}function ce(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)ue(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*A-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(A-a,2))),i=l,a=A}var c=t.length-3;t[2]=1,se(t,0,c,r),t[c+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function pe(e,t,r,n){for(var i=0;i1?1:r}function Ie(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o=n)return null;for(var l=[],A=0;A=r&&h=n)){var d=[];if("Point"===g||"MultiPoint"===g)ve(u,d,r,n,i);else if("LineString"===g)Ee(u,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===g)Be(u,d,r,n,i,!1);else if("Polygon"===g)Be(u,d,r,n,i,!0);else if("MultiPolygon"===g)for(var p=0;p=r&&o<=n&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function Ee(e,t,r,n,i,a,o){for(var s,l,A=Ce(e),c=0===i?xe:we,u=e.start,g=0;gr&&(l=c(A,f,h,p,y,r),o&&(A.start=u+s*l)):m>n?I=r&&(l=c(A,f,h,p,y,r),v=!0),I>n&&m<=n&&(l=c(A,f,h,p,y,n),v=!0),!a&&v&&(o&&(A.end=u+s*l),t.push(A),A=Ce(e)),o&&(u+=s)}var E=e.length-3;f=e[E],h=e[E+1],d=e[E+2],(m=0===i?f:h)>=r&&m<=n&&be(A,f,h,d),E=A.length-3,a&&E>=3&&(A[E]!==A[0]||A[E+1]!==A[1])&&be(A,A[0],A[1],A[2]),A.length&&t.push(A)}function Ce(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function Be(e,t,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=c),u>o.maxY&&(o.maxY=u)}return o}function Me(e,t,r,n){var i=t.geometry,a=t.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&t.size<(i?o:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;i&&Le(s,a),e.push(s)}}function Le(e,t){for(var r=0,n=0,i=e.length,a=i-2;n0===t)for(n=0,i=e.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=ge(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=Qe(n,t)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Oe(e,t,r){return 32*((1<=n;A--){var c=+Date.now();s=this._cluster(s,A),this.trees[A]=new K(s,ae,oe,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",A,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},V.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],t),s=this.getClusters([-180,n,i,a],t);return o.concat(s)}for(var l=this.trees[this._limitZoom(t)],A=[],c=0,u=l.range(ee(r),te(a),ee(i),te(n));ct&&(h+=m.numPoints||1)}if(h>=s){for(var I=c.x*f,v=c.y*f,E=o&&f>1?this._map(c,!0):null,C=(A<<5)+(t+1)+this.points.length,B=0,b=g;B1)for(var _=0,S=g;_>5},V.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},V.prototype._map=function(e,t){if(e.numPoints)return t?ie({},e.properties):e.properties;var r=this.points[e.index].properties,n=this.options.map(r);return t&&n===r?ie({},n):n},Fe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Fe.prototype.splitTile=function(e,t,r,n,i,a,o){for(var s=[e,t,r,n],l=this.options,A=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var c=1<1&&console.time("creation"),g=this.tiles[u]=Te(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),A)){A>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,g.numFeatures,g.numPoints,g.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(g.source=e,i){if(t===l.maxZoom||t===i)continue;var h=1<1&&console.time("clipping");var d,p,y,m,I,v,E=.5*l.buffer/l.extent,C=.5-E,B=.5+E,b=1+E;d=p=y=m=null,I=Ie(e,c,r-E,r+B,0,g.minX,g.maxX,l),v=Ie(e,c,r+C,r+b,0,g.minX,g.maxX,l),e=null,I&&(d=Ie(I,c,n-E,n+B,1,g.minY,g.maxY,l),p=Ie(I,c,n+C,n+b,1,g.minY,g.maxY,l),I=null),v&&(y=Ie(v,c,n-E,n+B,1,g.minY,g.maxY,l),m=Ie(v,c,n+C,n+b,1,g.minY,g.maxY,l),v=null),A>1&&console.timeEnd("clipping"),s.push(d||[],t+1,2*r,2*n),s.push(p||[],t+1,2*r,2*n+1),s.push(y||[],t+1,2*r+1,2*n),s.push(m||[],t+1,2*r+1,2*n+1)}}},Fe.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent,a=n.debug;if(e<0||e>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,A=e,c=t,u=r;!l&&A>0;)A--,c=Math.floor(c/2),u=Math.floor(u/2),l=this.tiles[Oe(A,c,u)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",A,c,u),a>1&&console.time("drilling down"),this.splitTile(l.source,A,c,u,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?ke(this.tiles[s],i):null):null};var Ue=function(t){function r(e,r,n,i){t.call(this,e,r,n,Ge),i&&(this.loadGeoJSON=i)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new e.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!==typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));f(o,!0);try{if(n.filter){var s=e.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(e){return e.key+": "+e.message})).join(", "));var l=o.features.filter((function(e){return s.value.evaluate({zoom:0},e)}));o={type:"FeatureCollection",features:l}}t._geoJSONIndex=n.cluster?new V(ze(n)).load(o.features):Ne(o,n.geojsonVtOptions)}catch(a){return r(a)}t.loaded={};var A={};if(i){var c=i.finish();c&&(A.resourceTiming={},A.resourceTiming[n.source]=JSON.parse(JSON.stringify(c)))}r(null,A)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(e,r){var n=this.loaded,i=e.uid;return n&&n[i]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else{if("string"!==typeof t.data)return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch(n){return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()},r.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(r){t(r)}},r}(c);function ze(t){var r=t.superclusterOptions,n=t.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),A=0,c=l;A1?"@2x":"",l=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),(function(e,t){l=null,o||(o=e,i=t,c())})),A=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),(function(e,t){A=null,o||(o=e,a=t,c())}));function c(){if(o)n(o);else if(i&&a){var t=e.browser.getImageData(a),r={};for(var s in i){var l=i[s],A=l.width,c=l.height,u=l.x,g=l.y,f=l.sdf,h=l.pixelRatio,d=l.stretchX,p=l.stretchY,y=l.content,m=new e.RGBAImage({width:A,height:c});e.RGBAImage.copy(t,m,{x:u,y:g},{x:0,y:0},{width:A,height:c}),r[s]={data:m,pixelRatio:h,sdf:f,stretchX:d,stretchY:p,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),A&&(A.cancel(),A=null)}}}function g(e){var t=e.userImage;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}r.suppressClick=function(){e.window.addEventListener("click",c,!0),e.window.setTimeout((function(){e.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(t,r){var n=t.getBoundingClientRect();return new e.Point(r.clientX-n.left-t.clientLeft,r.clientY-n.top-t.clientTop)},r.touchPos=function(t,r){for(var n=t.getBoundingClientRect(),i=[],a=0;a=0?0:t.button},r.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var f=1,h=function(t){function r(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,r=this.requestors;t=0?1.2:1))}function v(e,t,r,n,i,a,o){for(var s=0;s65535)t(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])t(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],C.loadGlyphRange(r,s,n.url,n.requestManager,(function(e,t){if(t){for(var r in t)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=t[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=e[++s]);var c=Math.abs(A-l.left),u=Math.abs(A-l.right),g=Math.min(c,u),f=void 0,h=i/r*(n+1);if(l.isDash){var d=n-Math.abs(h);f=Math.sqrt(g*g+d*d)}else f=n-Math.sqrt(g*g+h*h);this.data[o+A]=Math.max(0,Math.min(255,f+128))}},Q.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}var i=e[0],a=e[e.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=e[s],A=0;A1&&(l=e[++s]);var c=Math.abs(A-l.left),u=Math.abs(A-l.right),g=Math.min(c,u),f=l.isDash?g:-g;this.data[o+A]=Math.max(0,Math.min(255,f+128))}},Q.prototype.addDash=function(t,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n.minX&&t.x=n.minY&&t.y0&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event("data",n))}}))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setData=function(t){var r=this;return this._data=t,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)r.fire(new e.ErrorEvent(t));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new e.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this},r.prototype.getClusterChildren=function(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this},r.prototype.getClusterLeaves=function(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},n),this},r.prototype._updateWorkerData=function(t){var r=this;this._loaded=!1;var n=e.extend({},this.workerOptions),i=this._data;"string"===typeof i?(n.request=this.map._requestManager.transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(e,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),t(e))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(t,r){var n=this,i=t.actor?"reloadTile":"loadTile";t.actor=this.actor;var a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(i,a,(function(e,a){return delete t.request,t.unloadVectorData(),t.aborted?r(null):e?r(e):(t.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},r.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(e.Evented),L=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),N=function(t){function r(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(t,r){var n=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new e.ErrorEvent(i)):a&&(n.image=a,t&&(n.coordinates=t),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setCoordinates=function(t){var r=this;this.coordinates=t;var n=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=F(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(e){return r.tileID.getTilePoint(e)._round()}));return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(e.Evented);function F(t){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=t;or.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=t}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(N),P=function(t){function r(r,n,i,a){t.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!==typeof e}))}))||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!==typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"===typeof n.canvas||n.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];ethis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Z.prototype.has=function(e){return e.wrapped().key in this.data},Z.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},Z.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},Z.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},Z.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},Z.prototype.remove=function(e,t){if(!this.has(e))return this;var r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},Z.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this},Z.prototype.filter=function(e){var t=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(e){return this.getTileByID(e.key)},r.prototype.getTileByID=function(e){return this._tiles[e]},r.prototype._retainLoadedChildren=function(e,t,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(var n=e.overscaledZ-1;n>=t;n--){var i=e.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},r.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),r=5,n=Math.floor(t*r),i="number"===typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(e){var t=(e-(void 0===this._prevLng?e:this._prevLng))/360,r=Math.round(t);if(this._prevLng=e,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(t){var n=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(e){return n._source.hasTile(e)})))):i=[];var a=t.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Xe(this._source.type)){for(var A={},c={},u=0,g=Object.keys(l);uthis._source.maxzoom){var p=h.children(this._source.maxzoom)[0],y=this.getTile(p);if(y&&y.hasData()){n[p.key]=p;continue}}else{var m=h.children(this._source.maxzoom);if(n[m[0].key]&&n[m[1].key]&&n[m[2].key]&&n[m[3].key])continue}for(var I=d.wasRequested(),v=h.overscaledZ-1;v>=a;--v){var E=h.scaledTo(v);if(i[E.key])break;if(i[E.key]=!0,!(d=this.getTile(E))&&I&&(d=this._addTile(E)),d&&(n[E.key]=E,I=d.wasRequested(),d.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],r=void 0,n=this._tiles[e].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=t;a0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},r.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},r.prototype.tilesIn=function(t,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(t):t,l=t.map((function(e){return o.pointCoordinate(e)})),A=s.map((function(e){return o.pointCoordinate(e)})),c=this.getIds(),u=1/0,g=1/0,f=-1/0,h=-1/0,d=0,p=A;d=0&&y[1].y+p>=0){var m=l.map((function(e){return s.getTilePoint(e)})),I=A.map((function(e){return s.getTilePoint(e)}));a.push({tile:n,tileID:s,queryGeometry:m,cameraQueryGeometry:I,scale:d})}}},I=0;I=e.browser.now())return!0}return!1},r.prototype.setFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.updateState(e,t,r)},r.prototype.removeFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,t,r)},r.prototype.getFeatureState=function(e,t){return e=e||"_geojsonTileLayer",this._state.getState(e,t)},r.prototype.setDependencies=function(e,t,r){var n=this._tiles[e];n&&n.setDependencies(t,r)},r.prototype.reloadTilesForDependencies=function(e,t){for(var r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(e,t)}))},r}(e.Evented);function Ze(e,t){var r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Xe(e){return"raster"===e||"image"===e||"video"===e}function $e(){return new e.window.Worker(hs.workerUrl)}We.maxOverzooming=10,We.maxUnderzooming=3;var et="mapboxgl_preloaded_worker_pool",tt=function(){this.active={}};tt.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Ct=function(e,t,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(var a=0;a=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function _t(t,r,n,i,a,o,s,l){var A=i?t.textSizeData:t.iconSizeData,c=e.evaluateSizeForZoom(A,n.transform.zoom),u=[256/n.width*2+1,256/n.height*2+1],g=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();for(var f=t.lineVertexArray,h=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,d=n.transform.width/n.transform.height,p=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function Dt(t,r,n,i,a,o,s,l,A,c,u,g,f,h){var d,p=r/24,y=t.lineOffsetX*p,m=t.lineOffsetY*p;if(t.numGlyphs>1){var I=t.glyphStartIndex+t.numGlyphs,v=t.lineStartIndex,E=t.lineStartIndex+t.lineLength,C=St(p,l,y,m,n,u,g,t,A,o,f);if(!C)return{notEnoughRoom:!0};var B=xt(C.first.point,s).point,b=xt(C.last.point,s).point;if(i&&!n){var x=kt(t.writingMode,B,b,h);if(x)return x}d=[C.first];for(var w=t.glyphStartIndex+1;w0?k.point:Tt(g,S,Q,1,a),T=kt(t.writingMode,Q,D,h);if(T)return T}var M=Mt(p*l.getoffsetX(t.glyphStartIndex),y,m,n,u,g,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,A,o,f);if(!M)return{notEnoughRoom:!0};d=[M]}for(var R=0,L=d;R0?1:-1,d=0;i&&(h*=-1,d=Math.PI),h<0&&(d+=Math.PI);for(var p=h>0?l+s:l+s+1,y=a,m=a,I=0,v=0,E=Math.abs(f),C=[];I+v<=E;){if((p+=h)=A)return null;if(m=y,C.push(y),void 0===(y=g[p])){var B=new e.Point(c.getx(p),c.gety(p)),b=xt(B,u);if(b.signedDistanceFromCamera>0)y=g[p]=b.point;else{var x=p-h;y=Tt(0===I?o:new e.Point(c.getx(x),c.gety(x)),B,m,E-I+1,u)}}I+=v,v=m.dist(y)}var w=(E-I)/v,Q=y.sub(m),_=Q.mult(w)._add(m);_._add(Q._unit()._perp()._mult(n*h));var S=d+Math.atan2(y.y-m.y,y.x-m.x);return C.push(_),{point:_,angle:S,path:C}}Ct.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ct.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Ct.prototype.insertCircle=function(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)},Ct.prototype._insertBoxCell=function(e,t,r,n,i,a){this.boxCells[i].push(a)},Ct.prototype._insertCircleCell=function(e,t,r,n,i,a){this.circleCells[i].push(a)},Ct.prototype._query=function(e,t,r,n,i,a){if(r<0||e>this.width||n<0||t>this.height)return!i&&[];var o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Ct.prototype._queryCircle=function(e,t,r,n,i){var a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var A=[],c={hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,A,c,i),n?A.length>0:A},Ct.prototype.query=function(e,t,r,n,i){return this._query(e,t,r,n,!1,i)},Ct.prototype.hitTest=function(e,t,r,n,i){return this._query(e,t,r,n,!0,i)},Ct.prototype.hitTestCircle=function(e,t,r,n){return this._queryCircle(e,t,r,!0,n)},Ct.prototype._queryCell=function(e,t,r,n,i,a,o,s){var l=o.seenUids,A=this.boxCells[i];if(null!==A)for(var c=this.bboxes,u=0,g=A;u=c[h+0]&&n>=c[h+1]&&(!s||s(this.boxKeys[f]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[f],x1:c[h],y1:c[h+1],x2:c[h+2],y2:c[h+3]})}}}var d=this.circleCells[i];if(null!==d)for(var p=this.circles,y=0,m=d;yo*o+s*s},Ct.prototype._circleAndRectCollide=function(e,t,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;var A=(o-i)/2,c=Math.abs(t-(i+A));if(c>A+r)return!1;if(l<=s||c<=A)return!0;var u=l-s,g=c-A;return u*u+g*g<=r*r};var Rt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Lt(e,t){for(var r=0;r=1;T--)D.push(S.path[T]);for(var M=1;M0){for(var F=D[0].clone(),O=D[0].clone(),P=1;P=w.x&&O.x<=Q.x&&F.y>=w.y&&O.y<=Q.y?[D]:O.xQ.x||O.yQ.y?[]:e.clipLine([D],w.x,w.y,Q.x,Q.y)}for(var G=0,U=N;G=this.screenRightBoundary||nthis.screenBottomBoundary},Ot.prototype.isInsideGrid=function(e,t,r,n){return r>=0&&e=0&&t0?(this.prevPlacement&&this.prevPlacement.variableOffsets[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID].text&&(d=this.prevPlacement.variableOffsets[u.crossTileID].anchor),this.variableOffsets[u.crossTileID]={textOffset:p,width:r,height:n,anchor:e,textBoxScale:i,prevAnchor:d},this.markUsedJustification(g,e,u,f),g.allowVerticalPlacement&&(this.markUsedOrientation(g,f,u),this.placedOrientations[u.crossTileID]=f),{shift:y,placedGlyphBoxes:m}):void 0},jt.prototype.placeLayerBucketPart=function(t,r,n){var i=this,a=t.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,A=a.textLabelPlaneMatrix,c=a.labelToScreenMatrix,u=a.textPixelRatio,g=a.holdingForFade,f=a.collisionBoxArray,h=a.partiallyEvaluatedTextSize,d=a.collisionGroup,p=s.get("text-optional"),y=s.get("icon-optional"),m=s.get("text-allow-overlap"),I=s.get("icon-allow-overlap"),v="map"===s.get("text-rotation-alignment"),E="map"===s.get("text-pitch-alignment"),C="none"!==s.get("icon-text-fit"),B="viewport-y"===s.get("symbol-z-order"),b=m&&(I||!o.hasIconData()||y),x=I&&(m||!o.hasTextData()||p);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f);var w=function(t,a){if(!r[t.crossTileID])if(g)i.placements[t.crossTileID]=new zt(!1,!1,!1);else{var f=!1,B=!1,w=!0,Q=null,_={box:null,offscreen:null},S={box:null,offscreen:null},k=null,D=null,T=null,M=0,R=0,L=0;a.textFeatureIndex?M=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(M=t.featureIndex),a.verticalTextFeatureIndex&&(R=a.verticalTextFeatureIndex);var N=a.textBox;if(N){var F=function(r){var n=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[t.crossTileID];a&&(i.placedOrientations[t.crossTileID]=a,n=a,i.markUsedOrientation(o,n,t))}return n},O=function(r,n){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(P=P.filter((function(e){return e!==G.anchor}))).unshift(G.anchor)}var U=function(e,r,n){for(var a=e.x2-e.x1,s=e.y2-e.y1,A=t.textBoxScale,c=C&&!I?r:null,g={box:[],offscreen:!1},h=m?2*P.length:P.length,p=0;p=P.length,b=i.attemptAnchorPlacement(y,e,a,s,A,v,E,u,l,d,B,t,o,n,c);if(b&&(g=b.placedGlyphBoxes)&&g.box&&g.box.length){f=!0,Q=b.shift;break}}return g};O((function(){return U(N,a.iconBox,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=_&&_.box&&_.box.length;return o.allowVerticalPlacement&&!n&&t.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),_&&(f=_.box,w=_.offscreen);var z=F(_&&_.box);if(!f&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[t.crossTileID];q&&(i.variableOffsets[t.crossTileID]=q,i.markUsedJustification(o,q.anchor,t,z))}}else{var H=function(e,r){var n=i.collisionIndex.placeCollisionBox(e,m,u,l,d.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,t),i.placedOrientations[t.crossTileID]=r),n};O((function(){return H(N,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?H(r,e.WritingMode.vertical):{box:null,offscreen:null}})),F(_&&_.box&&_.box.length)}}if(f=(k=_)&&k.box&&k.box.length>0,w=k&&k.offscreen,t.useRuntimeCollisionCircles){var Y=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),J=e.evaluateSizeForFeature(o.textSizeData,h,Y),K=s.get("text-padding"),j=t.collisionCircleDiameter;D=i.collisionIndex.placeCollisionCircles(m,Y,o.lineVertexArray,o.glyphOffsetArray,J,l,A,c,n,E,d.predicate,j,K),f=m||D.circles.length>0&&!D.collisionDetected,w=w&&D.offscreen}if(a.iconFeatureIndex&&(L=a.iconFeatureIndex),a.iconBox){var V=function(e){var t=C&&Q?Kt(e,Q.x,Q.y,v,E,i.transform.angle):e;return i.collisionIndex.placeCollisionBox(t,I,u,l,d.predicate)};B=S&&S.box&&S.box.length&&a.verticalIconBox?(T=V(a.verticalIconBox)).box.length>0:(T=V(a.iconBox)).box.length>0,w=w&&T.offscreen}var W=p||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,Z=y||0===t.numIconVertices;if(W||Z?Z?W||(B=B&&f):f=B&&f:B=f=B&&f,f&&k&&k.box&&(S&&S.box&&R?i.collisionIndex.insertCollisionBox(k.box,s.get("text-ignore-placement"),o.bucketInstanceId,R,d.ID):i.collisionIndex.insertCollisionBox(k.box,s.get("text-ignore-placement"),o.bucketInstanceId,M,d.ID)),B&&T&&i.collisionIndex.insertCollisionBox(T.box,s.get("icon-ignore-placement"),o.bucketInstanceId,L,d.ID),D&&(f&&i.collisionIndex.insertCollisionCircles(D.circles,s.get("text-ignore-placement"),o.bucketInstanceId,M,d.ID),n)){var X=o.bucketInstanceId,$=i.collisionCircleArrays[X];void 0===$&&($=i.collisionCircleArrays[X]=new qt);for(var ee=0;ee=0;--_){var S=Q[_];w(o.symbolInstances.get(S),o.collisionArrays[S])}else for(var k=t.symbolInstanceStart;k=0&&(t.text.placedSymbolArray.get(A).crossTileID=a>=0&&A!==a?0:n.crossTileID)}},jt.prototype.markUsedOrientation=function(t,r,n){for(var i=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,a=r===e.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,I=a.numIconVertices>0,v=i.placedOrientations[a.crossTileID],E=v===e.WritingMode.vertical,C=v===e.WritingMode.horizontal||v===e.WritingMode.horizontalOnly;if(m){var B=nr(y.text),b=E?ir:B;h(t.text,s,b);var x=C?ir:B;h(t.text,l,x);var w=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=w||E?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=w||C?1:0);var Q=i.variableOffsets[a.crossTileID];Q&&i.markUsedJustification(t,Q.anchor,a,v);var _=i.placedOrientations[a.crossTileID];_&&(i.markUsedJustification(t,"left",a,_),i.markUsedOrientation(t,_,a))}if(I){var S=nr(y.icon),k=!(g&&a.verticalPlacedIconSymbolIndex&&E);if(a.placedIconSymbolIndex>=0){var D=k?S:ir;h(t.icon,a.numIconVertices,D),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var T=k?ir:S;h(t.icon,a.numVerticalIconVertices,T),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var M=t.collisionArrays[n];if(M){var R=new e.Point(0,0);if(M.textBox||M.verticalTextBox){var L=!0;if(A){var N=i.variableOffsets[d];N?(R=Jt(N.anchor,N.width,N.height,N.textOffset,N.textBoxScale),c&&R._rotate(u?i.transform.angle:-i.transform.angle)):L=!1}M.textBox&&Vt(t.textCollisionBox.collisionVertexArray,y.text.placed,!L||E,R.x,R.y),M.verticalTextBox&&Vt(t.textCollisionBox.collisionVertexArray,y.text.placed,!L||C,R.x,R.y)}var F=Boolean(!C&&M.verticalIconBox);M.iconBox&&Vt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,F,g?R.x:0,g?R.y:0),M.verticalIconBox&&Vt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,g?R.x:0,g?R.y:0)}}},p=0;pe},jt.prototype.setStale=function(){this.stale=!0};var Wt=Math.pow(2,25),Zt=Math.pow(2,24),Xt=Math.pow(2,17),$t=Math.pow(2,16),er=Math.pow(2,9),tr=Math.pow(2,8),rr=Math.pow(2,1);function nr(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*Wt+t*Zt+r*Xt+t*$t+r*er+t*tr+r*rr+t}var ir=0,ar=function(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ar.prototype.continuePlacement=function(e,t,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new ar(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},or.prototype.commit=function(e){return this.placement.commit(e),this.placement};var sr=512/e.EXTENT/2,lr=function(e,t,r){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;ne.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,i)}else{var A=o[e.scaledTo(Number(a)).key];A&&A.findMatches(t.symbolInstances,e,i)}}for(var c=0;c0)throw new Error("Unimplemented: "+i.map((function(e){return e.command})).join(", ")+".");return n.forEach((function(e){"setTransition"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=t,!0},r.prototype.addImage=function(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,r),this._afterImageUpdated(t)},r.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},r.prototype.getImage=function(e){return this.imageManager.getImage(e)},r.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._afterImageUpdated(t)},r.prototype._afterImageUpdated=function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(t,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(e.validateStyle.source,"sources."+t,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[t]=new We(t,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:t}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},r.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},r.prototype.addLayer=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===t.type){if(gr(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if("object"===typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,"layers."+i,t,{arrayIndex:-1},n))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(t,r){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==r){var n=this._order.indexOf(t);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(t){this._checkLoaded();var r=this._layers[t];if(r){r.setEventedParent(null);var n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(e){return this._layers[e]},r.prototype.hasLayer=function(e){return e in this._layers},r.prototype.setLayerZoomRange=function(t,r,n){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!e.deepEqual(i.filter,r))return null===r||void 0===r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=e.clone$1(r),this._updateLayer(i)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},r.prototype.setLayoutProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,r){var n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},r.prototype.setFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!==typeof t.id&&"number"!==typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(t){this._checkLoaded();var r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))},r.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,r=function(e){return"fill-extrusion"===t._layers[e].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=e;s=0;h--){var d=this._order[h];if(r(d))for(var p=i.length-1;p>=0;p--){var y=i[p].feature;if(n[y.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}",Dr="attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}",Tr="varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}",Mr="attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}",Rr="uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}",Lr="attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}",Nr="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Fr="attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}",Or="varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Pr="attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}",Gr="uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Ur="uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}",zr="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",qr="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}",Hr="varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Yr="uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}",Jr="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Kr="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}",jr="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Vr="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",Wr="uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Zr="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Xr="uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",$r="\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}",en="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",tn="\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}",rn="uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",nn="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}",an="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",on="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}",sn="uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",ln="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",An="uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",cn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}",un="#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",gn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}",fn="#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",hn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}",dn=Un("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),pn=Un(mr,Ir),yn=Un(vr,Er),mn=Un(Cr,Br),In=Un(br,xr),vn=Un(wr,Qr),En=Un(_r,Sr),Cn=Un(kr,Dr),Bn=Un(Tr,Mr),bn=Un(Rr,Lr),xn=Un(Nr,Fr),wn=Un(Or,Pr),Qn=Un(Gr,Ur),_n=Un(zr,qr),Sn=Un(Hr,Yr),kn=Un(Jr,Kr),Dn=Un(jr,Vr),Tn=Un(Wr,Zr),Mn=Un(Xr,$r),Rn=Un(en,tn),Ln=Un(rn,nn),Nn=Un(an,on),Fn=Un(sn,ln),On=Un(An,cn),Pn=Un(un,gn),Gn=Un(fn,hn);function Un(e,t){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:e=e.replace(r,(function(e,t,r,n,i){return s[i]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:t=t.replace(r,(function(e,t,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:o}}var zn=Object.freeze({__proto__:null,prelude:dn,background:pn,backgroundPattern:yn,circle:mn,clippingMask:In,heatmap:vn,heatmapTexture:En,collisionBox:Cn,collisionCircle:Bn,debug:bn,fill:xn,fillOutline:wn,fillOutlinePattern:Qn,fillPattern:_n,fillExtrusion:Sn,fillExtrusionPattern:kn,hillshadePrepare:Dn,hillshade:Tn,line:Mn,lineGradient:Rn,linePattern:Ln,lineSDF:Nn,raster:Fn,symbolIcon:On,symbolSDF:Pn,symbolTextAndIcon:Gn}),qn=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Hn(e){for(var t=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}function Kn(e,t,r,n){var i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,A=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/A,u=c*(n.tileID.canonical.x+n.tileID.wrap*A),g=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/Pt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,g>>16],u_pixel_coord_lower:[65535&u,65535&g]}}Yn.prototype.draw=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d){var p,y=e.gl;if(!this.failedToCreate){for(var m in e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(a),this.fixedUniforms)this.fixedUniforms[m].set(o[m]);f&&f.setUniforms(e,this.binderUniforms,u,{zoom:g});for(var I=(p={},p[y.LINES]=2,p[y.TRIANGLES]=3,p[y.LINE_STRIP]=1,p)[t],v=0,E=c.get();v0?1/(1-e):1+e}function Ii(e){return e>0?1-1/(1.001-e):-e}var vi,Ei=function(e,t,r,n,i,a,o,s,l,A){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:A,u_texture:0}},Ci=function(t,r,n,i,a,o,s,l,A,c,u){var g=a.transform;return e.extend(Ei(t,r,n,i,a,o,s,l,A,c),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+u})},Bi=function(t,r,n,i,a,o,s,l,A,c){return e.extend(Ci(t,r,n,i,a,o,s,l,!0,A,!0),{u_texsize_icon:c,u_texture_icon:1})},bi=function(e,t,r){return{u_matrix:e,u_opacity:t,u_color:r}},xi=function(t,r,n,i,a,o){return e.extend(Kn(i,o,n,a),{u_matrix:t,u_opacity:r})},wi={fillExtrusion:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fillExtrusionPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fill:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},fillPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},fillOutline:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}},fillOutlinePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},circle:function(t,r){return{u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},collisionBox:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}},collisionCircle:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}},debug:function(t,r){return{u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}},clippingMask:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmap:function(t,r){return{u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmapTexture:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}},hillshade:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}},hillshadePrepare:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}},line:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}},lineGradient:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image),u_image_height:new e.Uniform1f(t,r.u_image_height)}},linePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},lineSDF:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}},raster:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}},symbolIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}},symbolSDF:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},symbolTextAndIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},background:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}},backgroundPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}}};function Qi(t,r,n,i,a,o,s){for(var l=t.context,A=l.gl,c=t.useProgram("collisionBox"),u=[],g=0,f=0,h=0;h0){var E=e.create(),C=m;e.mul(E,y.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(E,E,y.placementViewportMatrix),u.push({circleArray:v,circleOffset:f,transform:C,invTransform:E}),f=g+=v.length/4}I&&c.draw(l,A.LINES,Oe.disabled,Ue.disabled,t.colorModeForRenderPass(),je.disabled,ti(m,t.transform,p),n.id,I.layoutVertexBuffer,I.indexBuffer,I.segments,null,t.transform.zoom,null,null,I.collisionVertexBuffer)}}if(s&&u.length){var B=t.useProgram("collisionCircle"),b=new e.StructArrayLayout2f1f2i16;b.resize(4*g),b._trim();for(var x=0,w=0,Q=u;w=0&&(d[y.associatedIconIndex]={shiftedAnchor:Q,angle:_})}else Lt(y.numGlyphs,f)}if(u){h.clear();for(var k=t.icon.placedSymbolArray,D=0;D0){var s=e.browser.now(),l=(s-t.timeAdded)/o,A=r?(s-r.timeAdded)/o:-1,c=n.getSource(),u=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),g=!r||Math.abs(r.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),f=g&&t.refreshedUponExpiration?1:e.clamp(g?l:1-A,0,1);return t.refreshedUponExpiration&&l>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}function Xi(e,t,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=e.context,o=a.gl,s=e.transform,l=s.tileSize,A=r.paint.get("background-pattern");if(!e.isPatternMissing(A)){var c=!A&&1===n.a&&1===i&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===c){var u=Ue.disabled,g=e.depthModeForSublayer(0,"opaque"===c?Oe.ReadWrite:Oe.ReadOnly),f=e.colorModeForRenderPass(),h=e.useProgram(A?"backgroundPattern":"background"),d=s.coveringTiles({tileSize:l});A&&(a.activeTexture.set(o.TEXTURE0),e.imageManager.bind(e.context));for(var p=r.getCrossfadeParameters(),y=0,m=d;y "+n.overscaledZ),ua(t,y+" "+h+"kb"),s.draw(i,a.TRIANGLES,l,A,Ye.alphaBlended,je.disabled,ni(o,e.Color.transparent,p),u,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}function ua(e,t){e.initDebugOverlayCanvas();var r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}function ga(e,t,r){var n=e.context,i=r.implementation;if("offscreen"===e.renderPass){var a=i.prerender;a&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),a.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Ue.disabled);var o="3d"===i.renderingMode?new Oe(e.context.gl.LEQUAL,Oe.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Oe.ReadOnly);n.setDepthMode(o),i.render(n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}var fa={symbol:ki,circle:Fi,heatmap:Oi,line:zi,fill:qi,"fill-extrusion":Yi,hillshade:Ki,raster:Wi,background:Xi,debug:Aa,custom:ga},ha=function(e,t){this.context=new Ve(e),this.transform=t,this._tileTextures={},this.setup(),this.numSublayers=We.maxUnderzooming+We.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ur,this.gpuTimers={}};ha.prototype.resize=function(t,r){if(this.width=t*e.browser.devicePixelRatio,this.height=r*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n256&&this.clearStencil(),r.setColorMode(Ye.disabled),r.setDepthMode(Oe.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=t;a256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Ue({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},ha.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new Ue({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},ha.prototype.stencilConfigForOverlap=function(e){var t,r=this.context.gl,n=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var C=this.style._layers[i[this.currentLayer]],B=a[C.source],b=c[C.source];this._renderTileClippingMasks(C,b),this.renderLayer(this,B,C,b)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?t.pop():null},ha.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r},ha.prototype.useProgram=function(e,t){this.cache=this.cache||{};var r=""+e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Yn(this.context,e,zn[e],t,wi[e],this._showOverdrawInspector)),this.cache[r]},ha.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},ha.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)},ha.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var t=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,t.RGBA)}},ha.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var da=function(e,t){this.points=e,this.planes=t};da.fromInvProjectionMatrix=function(t,r,n){var i=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],a=Math.pow(2,n),o=i.map((function(r){return e.transformMat4([],r,t)})).map((function(t){return e.scale$1([],t,1/t[3]/r*a)})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var r=e.sub([],o[t[0]],o[t[1]]),n=e.sub([],o[t[2]],o[t[1]]),i=e.normalize([],e.cross([],r,n)),a=-e.dot(i,o[t[1]]);return i.concat(a)}));return new da(o,s)};var pa=function(t,r){this.min=t,this.max=r,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};pa.prototype.quadrant=function(t){for(var r=[t%2===0,t<2],n=e.clone$2(this.min),i=e.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var A=Number.MAX_VALUE,c=-Number.MAX_VALUE,u=0;uthis.max[l]-this.min[l])return 0}return 1};var ya=function(e,t,r,n){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n};ya.prototype.interpolate=function(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,n)),this},ya.prototype.getCenter=function(t,r){var n=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.Point(n,i)},ya.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},ya.prototype.clone=function(){return new ya(this.top,this.bottom,this.left,this.right)},ya.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var ma=function(t,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=void 0===n||null===n?0:n,this._maxPitch=void 0===i||null===i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ya,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ia={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};function va(e,t){var r=!1,n=null,i=function(){n=null,r&&(e(),n=setTimeout(i,t),r=!1)};return function(){return r=!0,n||i(),n}}ma.prototype.clone=function(){var e=new ma(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e},Ia.minZoom.get=function(){return this._minZoom},Ia.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},Ia.maxZoom.get=function(){return this._maxZoom},Ia.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},Ia.minPitch.get=function(){return this._minPitch},Ia.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},Ia.maxPitch.get=function(){return this._maxPitch},Ia.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},Ia.renderWorldCopies.get=function(){return this._renderWorldCopies},Ia.renderWorldCopies.set=function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e},Ia.worldSize.get=function(){return this.tileSize*this.scale},Ia.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ia.size.get=function(){return new e.Point(this.width,this.height)},Ia.bearing.get=function(){return-this.angle/Math.PI*180},Ia.bearing.set=function(t){var r=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ia.pitch.get=function(){return this._pitch/Math.PI*180},Ia.pitch.set=function(t){var r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Ia.fov.get=function(){return this._fov/Math.PI*180},Ia.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},Ia.zoom.get=function(){return this._zoom},Ia.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},Ia.center.get=function(){return this._center},Ia.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},Ia.padding.get=function(){return this._edgeInsets.toJSON()},Ia.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},Ia.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},ma.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},ma.prototype.interpolatePadding=function(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()},ma.prototype.coveringZoomLevel=function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)},ma.prototype.getVisibleUnwrappedCoordinates=function(t){var r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),a=this.pointCoordinate(new e.Point(this.width,this.height)),o=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),A=1,c=s-A;c<=l+A;c++)0!==c&&r.push(new e.UnwrappedTileID(c,t));return r},ma.prototype.coveringTiles=function(t){var r=this.coveringZoomLevel(t),n=r;if(void 0!==t.minzoom&&rt.maxzoom&&(r=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=da.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var A=3,c=function(e){return{aabb:new pa([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},u=[],g=[],f=r,h=t.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var p=u.pop(),y=p.x,m=p.y,I=p.fullyVisible;if(!I){var v=p.aabb.intersects(s);if(0===v)continue;I=2===v}var E=p.aabb.distanceX(o),C=p.aabb.distanceY(o),B=Math.max(Math.abs(E),Math.abs(C)),b=A+(1<b&&p.zoom>=l)g.push({tileID:new e.OverscaledTileID(p.zoom===f?h:p.zoom,p.wrap,p.zoom,y,m),distanceSq:e.sqrLen([o[0]-.5-y,o[1]-.5-m])});else for(var x=0;x<4;x++){var w=(y<<1)+x%2,Q=(m<<1)+(x>>1);u.push({aabb:p.aabb.quadrant(x),zoom:p.zoom+1,x:w,y:Q,wrap:p.wrap,fullyVisible:I})}}return g.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))},ma.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},Ia.unmodified.get=function(){return this._unmodified},ma.prototype.zoomScale=function(e){return Math.pow(2,e)},ma.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},ma.prototype.project=function(t){var r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)},ma.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},Ia.point.get=function(){return this.project(this.center)},ma.prototype.setLocationAtPoint=function(t,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},ma.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},ma.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},ma.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},ma.prototype.coordinateLocation=function(e){return e.toLngLat()},ma.prototype.pointCoordinate=function(t){var r=0,n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.transformMat4(n,n,this.pixelMatrixInverse),e.transformMat4(i,i,this.pixelMatrixInverse);var a=n[3],o=i[3],s=n[0]/a,l=i[0]/o,A=n[1]/a,c=i[1]/o,u=n[2]/a,g=i[2]/o,f=u===g?0:(r-u)/(g-u);return new e.MercatorCoordinate(e.number(s,l,f)/this.worldSize,e.number(A,c,f)/this.worldSize)},ma.prototype.coordinatePoint=function(t){var r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix),new e.Point(r[0]/r[3],r[1]/r[3])},ma.prototype.getBounds=function(){return(new e.LngLatBounds).extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},ma.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},ma.prototype.setMaxBounds=function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},ma.prototype.calculatePosMatrix=function(t,r){void 0===r&&(r=!1);var n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*o,a.y*o,0]),e.scale(l,l,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},ma.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},ma.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,r,n,i,a=-90,o=90,s=-180,l=180,A=this.size,c=this._unmodified;if(this.latRange){var u=this.latRange;a=e.mercatorYfromLat(u[1])*this.worldSize,t=(o=e.mercatorYfromLat(u[0])*this.worldSize)-ao&&(i=o-p)}if(this.lngRange){var y=f.x,m=A.x/2;y-ml&&(n=l-m)}void 0===n&&void 0===i||(this.center=this.unproject(new e.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},ma.prototype._calcMatrices=function(){if(this.height){var t=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,A=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),c=this.height/50,u=new Float64Array(16);e.perspective(u,this._fov,this.width/this.height,c,A),u[8]=2*-r.x/this.width,u[9]=2*r.y/this.height,e.scale(u,u,[1,-1,1]),e.translate(u,u,[0,0,-this.cameraToCenterDistance]),e.rotateX(u,u,this._pitch),e.rotateZ(u,u,this.angle),e.translate(u,u,[-s,-l,0]),this.mercatorMatrix=e.scale([],u,[this.worldSize,this.worldSize,this.worldSize]),e.scale(u,u,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=u,this.invProjMatrix=e.invert([],this.projMatrix);var g=this.width%2/2,f=this.height%2/2,h=Math.cos(this.angle),d=Math.sin(this.angle),p=s-Math.round(s)+h*g+d*f,y=l-Math.round(l)+h*f+d*g,m=new Float64Array(u);if(e.translate(m,m,[p>.5?p-1:p,y>.5?y-1:y,0]),this.alignedProjMatrix=m,u=e.create(),e.scale(u,u,[this.width/2,-this.height/2,1]),e.translate(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=e.create(),e.scale(u,u,[1,-1,1]),e.translate(u,u,[-1,-1,0]),e.scale(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(u=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=u,this._posMatrixCache={},this._alignedPosMatrixCache={}}},ma.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},ma.prototype.getCameraPoint=function(){var t=this._pitch,r=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,r))},ma.prototype.getCameraQueryGeometry=function(t){var r=this.getCameraPoint();if(1===t.length)return[t[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=t;s=3&&!e.some((function(e){return isNaN(e)}))){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},Ea.prototype._updateHashUnthrottled=function(){var t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,t)}catch(r){}};var Ca={linearity:.3,easing:e.bezier(0,0,.3,1)},Ba=e.extend({deceleration:2500,maxSpeed:1400},Ca),ba=e.extend({deceleration:20,maxSpeed:1400},Ca),xa=e.extend({deceleration:1e3,maxSpeed:360},Ca),wa=e.extend({deceleration:1e3,maxSpeed:90},Ca),Qa=function(e){this._map=e,this.clear()};function _a(e,t){(!e.duration||e.duration0&&r-t[0].time>n;)t.shift()},Qa.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new ka(e.type,this._map,e))},Ma.prototype.dblclick=function(e){return this._firePreventable(new ka(e.type,this._map,e))},Ma.prototype.mouseover=function(e){this._map.fire(new ka(e.type,this._map,e))},Ma.prototype.mouseout=function(e){this._map.fire(new ka(e.type,this._map,e))},Ma.prototype.touchstart=function(e){return this._firePreventable(new Da(e.type,this._map,e))},Ma.prototype.touchmove=function(e){this._map.fire(new Da(e.type,this._map,e))},Ma.prototype.touchend=function(e){this._map.fire(new Da(e.type,this._map,e))},Ma.prototype.touchcancel=function(e){this._map.fire(new Da(e.type,this._map,e))},Ma.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},Ma.prototype.isEnabled=function(){return!0},Ma.prototype.isActive=function(){return!1},Ma.prototype.enable=function(){},Ma.prototype.disable=function(){};var Ra=function(e){this._map=e};Ra.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ra.prototype.mousemove=function(e){this._map.fire(new ka(e.type,this._map,e))},Ra.prototype.mousedown=function(){this._delayContextMenu=!0},Ra.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ka("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ra.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new ka(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()},Ra.prototype.isEnabled=function(){return!0},Ra.prototype.isActive=function(){return!1},Ra.prototype.enable=function(){},Ra.prototype.disable=function(){};var La=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};function Na(e,t){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=Fa(t),this.touches=Na(r,t)))},Ua.prototype.touchmove=function(e,t,r){if(!this.aborted&&this.centroid){var n=Na(r,t);for(var i in this.touches){var a=this.touches[i],o=n[i];(!o||o.dist(a)>Ga)&&(this.aborted=!0)}}},Ua.prototype.touchend=function(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>Pa)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var za=function(e){this.singleTap=new Ua(e),this.numTaps=e.numTaps,this.reset()};za.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},za.prototype.touchstart=function(e,t,r){this.singleTap.touchstart(e,t,r)},za.prototype.touchmove=function(e,t,r){this.singleTap.touchmove(e,t,r)},za.prototype.touchend=function(e,t,r){var n=this.singleTap.touchend(e,t,r);if(n){var i=e.timeStamp-this.lastTime0&&(this._active=!0);var i=Na(n,r),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var l in i){var A=i[l],c=this._touches[l];c&&(a._add(A),o._add(A.sub(c)),s++,i[l]=A)}if(this._touches=i,!(sMath.abs(e.x)}var lo=100,Ao=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},t.prototype._start=function(e){this._lastPoints=e,so(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,r){var n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,r){if(void 0!==this._valid)return this._valid;var n=2,i=e.mag()>=n,a=t.mag()>=n;if(i||a){if(!i||!a)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove0===t.y>0;return so(e)&&so(t)&&o}},t}($a),co={panStep:100,bearingStep:15,pitchStep:10},uo=function(){var e=co;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1};function go(e){return e*(2-e)}uo.prototype.reset=function(){this._active=!1},uo.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:go,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+n*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},uo.prototype.enable=function(){this._enabled=!0},uo.prototype.disable=function(){this._enabled=!1,this.reset()},uo.prototype.isEnabled=function(){return this._enabled},uo.prototype.isActive=function(){return this._active},uo.prototype.disableRotation=function(){this._rotationDisabled=!0},uo.prototype.enableRotation=function(){this._rotationDisabled=!1};var fo=4.000244140625,ho=.01,po=1/450,yo=2,mo=function(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=ho,this._wheelZoomRate=po,e.bindAll(["_onTimeout"],this)};mo.prototype.setZoomRate=function(e){this._defaultZoomRate=e},mo.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},mo.prototype.isEnabled=function(){return!!this._enabled},mo.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},mo.prototype.isZooming=function(){return!!this._zooming},mo.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},mo.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},mo.prototype.wheel=function(t){if(this.isEnabled()){var r=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,n=e.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%fo===0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}},mo.prototype._onTimeout=function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},mo.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},mo.prototype.renderFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>fo?this._wheelZoomRate:this._defaultZoomRate,i=yo/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"===typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"===typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,A=this._easing,c=!1;if("wheel"===this._type&&l&&A){var u=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),g=A(u);o=e.number(l,s,g),u<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},mo.prototype._smoothOutEasing=function(t){var r=e.ease;if(this._prevEase){var n=this._prevEase,i=(e.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:r},r},mo.prototype.reset=function(){this._active=!1};var Io=function(e,t){this._clickZoom=e,this._tapZoom=t};Io.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Io.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Io.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Io.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var vo=function(){this.reset()};vo.prototype.reset=function(){this._active=!1},vo.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}},vo.prototype.enable=function(){this._enabled=!0},vo.prototype.disable=function(){this._enabled=!1,this.reset()},vo.prototype.isEnabled=function(){return this._enabled},vo.prototype.isActive=function(){return this._active};var Eo=function(){this._tap=new za({numTouches:1,numTaps:1}),this.reset()};Eo.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Eo.prototype.touchstart=function(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>Oa&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))},Eo.prototype.touchmove=function(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)},Eo.prototype.touchend=function(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)},Eo.prototype.touchcancel=function(){this.reset()},Eo.prototype.enable=function(){this._enabled=!0},Eo.prototype.disable=function(){this._enabled=!1,this.reset()},Eo.prototype.isEnabled=function(){return this._enabled},Eo.prototype.isActive=function(){return this._active};var Co=function(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r};Co.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Co.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Co.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Co.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Bo=function(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r};Bo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Bo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Bo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Bo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var bo=function(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};bo.prototype.enable=function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},bo.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},bo.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},bo.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},bo.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},bo.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var xo=function(e){return e.zoom||e.drag||e.pitch||e.rotate},wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(e.Event);function Qo(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var _o=function(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Qa(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),e.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[e.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,E):Math.max(.5,E),C=Math.pow(p,1-t),B=i.unproject(I.add(v.mult(t*C)).mult(d));i.setLocationAtPoint(i.renderWorldCopies?B.wrap():B,h)}n._fireMoveEvents(r)}),(function(e){n._afterEase(r,e)}),t),this},r.prototype._prepareEase=function(t,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.Event("pitchstart",t))},r.prototype._fireMoveEvents=function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))},r.prototype._afterEase=function(t,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.Event("zoomend",t)),i&&this.fire(new e.Event("rotateend",t)),a&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}},r.prototype.flyTo=function(t,r){var n=this;if(!t.essential&&e.browser.prefersReducedMotion){var i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),A=this.getPadding(),c="zoom"in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,u="bearing"in t?this._normalizeBearing(t.bearing,s):s,g="pitch"in t?+t.pitch:l,f="padding"in t?t.padding:a.padding,h=a.zoomScale(c-o),d=e.Point.convert(t.offset),p=a.centerPoint.add(d),y=a.pointLocation(p),m=e.LngLat.convert(t.center||y);this._normalizeCenter(m);var I=a.project(y),v=a.project(m).sub(I),E=t.curve,C=Math.max(a.width,a.height),B=C/h,b=v.mag();if("minZoom"in t){var x=e.clamp(Math.min(t.minZoom,o,c),a.minZoom,a.maxZoom),w=C/a.zoomScale(x-o);E=Math.sqrt(w/b*2)}var Q=E*E;function _(e){var t=(B*B-C*C+(e?-1:1)*Q*Q*b*b)/(2*(e?B:C)*Q*b);return Math.log(Math.sqrt(t*t+1)-t)}function S(e){return(Math.exp(e)-Math.exp(-e))/2}function k(e){return(Math.exp(e)+Math.exp(-e))/2}function D(e){return S(e)/k(e)}var T=_(0),M=function(e){return k(T)/k(T+E*e)},R=function(e){return C*((k(T)*D(T+E*e)-S(T))/Q)/b},L=(_(1)-T)/E;if(Math.abs(b)<1e-6||!isFinite(L)){if(Math.abs(C-B)<1e-6)return this.easeTo(t,r);var N=Bt.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=g!==l,this._padding=!a.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(t){var i=t*L,h=1/M(i);a.zoom=1===t?c:o+a.scaleZoom(h),n._rotating&&(a.bearing=e.number(s,u,t)),n._pitching&&(a.pitch=e.number(l,g,t)),n._padding&&(a.interpolatePadding(A,f,t),p=a.centerPoint.add(d));var y=1===t?m:a.unproject(I.add(v.mult(R(i))).mult(h));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,p),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),t),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}if(!e){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.browser.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(t,r){t=e.wrap(t,-180,180);var n=Math.abs(t-r);return Math.abs(t-360-r)180?-360:r<-180?360:0}},r}(e.Evented),ko=function(t){void 0===t&&(t={}),this.options=t,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ko.prototype.getDefaultPosition=function(){return"bottom-right"},ko.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ko.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},ko.prototype._setElementTitle=function(e,t){var r=this._map._getUIString("AttributionControl."+t);e.title=r,e.setAttribute("aria-label",r)},ko.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},ko.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var n=r.reduce((function(e,t,n){return t.value&&(e+=t.key+"="+t.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},ko.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Do=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Do.prototype.onAdd=function(e){this._map=e,this._container=r.create("div","mapboxgl-ctrl");var t=r.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Do.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Do.prototype.getDefaultPosition=function(){return"bottom-left"},Do.prototype._updateLogo=function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Do.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},Do.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}};var To=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};To.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},To.prototype.remove=function(e){for(var t=this._currentlyRunning,r=0,n=t?this._queue.concat(t):this._queue;rt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitchGo)throw new Error("maxPitch must be less than or equal to "+Go);var i=new ma(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(n.call(this,i,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new To,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Mo,t.locale),this._clickTolerance=t.clickTolerance,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),"string"===typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof Lo))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),"undefined"!==typeof e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new _o(this,t);var a="string"===typeof t.hash&&t.hash||void 0;this._hash=t.hash&&new Ea(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new ko({customAttribution:t.customAttribution})),this.addControl(new Do,t.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new e.Event(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new e.Event(t.dataType+"dataloading",t))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this},i.prototype.hasControl=function(e){return this._controls.indexOf(e)>-1},i.prototype.resize=function(t){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t))),this.fire(new e.Event("resize",t)),a&&this.fire(new e.Event("moveend",t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},i.prototype.setMinZoom=function(e){if((e=null===e||void 0===e?Fo:e)>=Fo&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(e){if((e=null===e||void 0===e?Po:e)=Po&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()Go)throw new Error("maxPitch must be less than or equal to "+Go);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(e,t,r){var n,i=this;if("mouseenter"===e||"mouseover"===e){var a=!1,o=function(n){var o=i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[];o.length?a||(a=!0,r.call(i,new ka(e,i,n.originalEvent,{features:o}))):a=!1};return{layer:t,listener:r,delegates:{mousemove:o,mouseout:function(){a=!1}}}}if("mouseleave"===e||"mouseout"===e){var s=!1,l=function(n){(i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?s=!0:s&&(s=!1,r.call(i,new ka(e,i,n.originalEvent)))},A=function(t){s&&(s=!1,r.call(i,new ka(e,i,t.originalEvent)))};return{layer:t,listener:r,delegates:{mousemove:l,mouseout:A}}}var c=function(e){var n=i.getLayer(t)?i.queryRenderedFeatures(e.point,{layers:[t]}):[];n.length&&(e.features=n,r.call(i,e),delete e.features)};return{layer:t,listener:r,delegates:(n={},n[e]=c,n)}},i.prototype.on=function(e,t,r){if(void 0===r)return n.prototype.on.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(e,t,r){if(void 0===r)return n.prototype.once.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(e,t,r){var i=this;if(void 0===r)return n.prototype.off.call(this,e,t);var a=function(n){for(var a=n[e],o=0;o180;){var s=n.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}Jo.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),r.disableDrag()},Jo.prototype.move=function(e,t){var r=this.map,n=this.mouseRotate.mousemoveWindow(e,t);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Jo.prototype.off=function(){var e=this.element;r.removeEventListener(e,"mousedown",this.mousedown),r.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(e,"touchmove",this.touchmove),r.removeEventListener(e,"touchend",this.touchend),r.removeEventListener(e,"touchcancel",this.reset),this.offTemp()},Jo.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},Jo.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),r.mousePos(this.element,t)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},Jo.prototype.mousemove=function(e){this.move(e,r.mousePos(this.element,e))},Jo.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},Jo.prototype.touchstart=function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))},Jo.prototype.touchmove=function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))},Jo.prototype.touchend=function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(e){this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(e){return this._rotation=e||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(e){return this._rotationAlignment=e||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(e.Evented),Xo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};function $o(t){void 0!==Wo?t(Wo):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((function(e){Wo="denied"!==e.state,t(Wo)})):(Wo=!!e.window.navigator.geolocation,t(Wo))}var es=0,ts=!1,rs=function(t){function n(r){t.call(this),this.options=e.extend({},Xo,r),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),$o(this._setupUI),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,es=0,ts=!1},n.prototype._isOutOfMapMaxBounds=function(e){var t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitudet.getEast()||r.latitudet.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}},n.prototype._updateCamera=function(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(t){if(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),n=t.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&ts)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(t){var n=this;if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Zo(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){var r=t.originalEvent&&"resize"===t.originalEvent.type;t.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new e.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":es--,ts=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++es>1?(t={maximumAge:6e5,timeout:0},ts=!0):(t=this.options.positionOptions,ts=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(e.Evented),ns={maxWidth:100,unit:"metric"},is=function(t){this.options=e.extend({},ns,t),e.bindAll(["_onMove","setUnit"],this)};function as(e,t,r){var n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?os(t,n,l/5280,e._getUIString("ScaleControl.Miles")):os(t,n,l,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?os(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?os(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):os(t,n,s,e._getUIString("ScaleControl.Meters"))}function os(e,t,r,n){var i=ls(r),a=i/r;e.style.width=t*a+"px",e.innerHTML=i+" "+n}function ss(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}function ls(e){var t=Math.pow(10,(""+Math.floor(e)).length-1),r=e/t;return t*(r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:ss(r))}is.prototype.getDefaultPosition=function(){return"bottom-left"},is.prototype._onMove=function(){as(this._map,this._container,this.options)},is.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},is.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},is.prototype.setUnit=function(e){this.options.unit=e,as(this._map,this._container,this.options)};var As=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};As.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},As.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},As.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},As.prototype._setupUI=function(){var t=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},As.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e},As.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},As.prototype._isFullscreen=function(){return this._fullscreen},As.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},As.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var cs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},us=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),gs=function(t){function n(r){t.call(this),this.options=e.extend(Object.create(cs),r),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},n.prototype.setHTML=function(t){var r,n=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");for(i.innerHTML=t;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},n.prototype.setDOMContent=function(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},n.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},n.prototype.setOffset=function(e){return this.options.offset=e,this._update(),this},n.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(e){this._update(e.point)},n.prototype._onMouseMove=function(e){this._update(e.point)},n.prototype._onDrag=function(e){this._update(e.point)},n.prototype._update=function(e){var t=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(e){return t._container.classList.add(e)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ko(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,o=fs(this.options.offset);if(!a){var s,l=this._container.offsetWidth,A=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-A?["bottom"]:[],i.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var c=i.add(o[a]).round();r.setTransform(this._container,jo[a]+" translate("+c.x+"px,"+c.y+"px)"),Vo(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var e=this._container.querySelector(us);e&&e.focus()}},n.prototype._onClose=function(){this.remove()},n}(e.Evented);function fs(t){if(t){if("number"===typeof t){var r=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{center:new e.Point(0,0),top:new e.Point(0,t),"top-left":new e.Point(r,r),"top-right":new e.Point(-r,r),bottom:new e.Point(0,-t),"bottom-left":new e.Point(r,-r),"bottom-right":new e.Point(-r,-r),left:new e.Point(t,0),right:new e.Point(-t,0)}}if(t instanceof e.Point||Array.isArray(t)){var n=e.Point.convert(t);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:e.Point.convert(t.center||[0,0]),top:e.Point.convert(t.top||[0,0]),"top-left":e.Point.convert(t["top-left"]||[0,0]),"top-right":e.Point.convert(t["top-right"]||[0,0]),bottom:e.Point.convert(t.bottom||[0,0]),"bottom-left":e.Point.convert(t["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(t["bottom-right"]||[0,0]),left:e.Point.convert(t.left||[0,0]),right:e.Point.convert(t.right||[0,0])}}return fs(new e.Point(0,0))}var hs={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:zo,NavigationControl:Yo,GeolocateControl:rs,AttributionControl:ko,ScaleControl:is,FullscreenControl:As,Popup:gs,Marker:Zo,Style:pr,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:at,clearPrewarmedResources:ot,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return tt.workerCount},set workerCount(e){tt.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:""};return hs})),r}()},3108:function(e,t,r){"use strict";e.exports=r(26099)},26099:function(e,t,r){"use strict";var n=r(64928),i=r(32420),a=r(51160),o=r(76752),s=r(55616),l=r(31264),A=r(47520),c=r(18400),u=r(72512),g=r(76244);function f(e,t){for(var r=t[0],n=t[1],a=1/(t[2]-r),o=1/(t[3]-n),s=new Array(e.length),l=0,A=e.length/2;l>>1;t.dtype||(t.dtype="array"),"string"===typeof t.dtype?h=new(u(t.dtype))(p):t.dtype&&(h=t.dtype,Array.isArray(h)&&(h.length=p));for(var y=0;yr||s>1073741824){for(var g=0;gr+i||w>n+i||Q=k)&&o!==s){var l=m[a];void 0===s&&(s=l.length);for(var A=o;A=p&&u<=C&&g>=y&&g<=B&&D.push(c)}var f=I[a],h=f[4*o+0],d=f[4*o+1],v=f[4*o+2],E=f[4*o+3],b=function(e,t){for(var r=null,n=0;null===r;)if(r=e[4*t+n],++n>e.length)return null;return r}(f,o+1),_=.5*i,T=a+1;t(r,n,_,T,h,d||v||E||b),t(r,n+_,_,T,d,v||E||b),t(r+_,n,_,T,v,E||b),t(r+_,n+_,_,T,E,b)}}(0,0,1,0,0,1),D},h;function _(e,t,r){for(var n=1,i=.5,a=.5,o=.5,s=0;s0){t+=Math.abs(o(e[0]));for(var r=1;r2){for(l=0;l=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=u,t.lengthToDegrees=function(e,t){return g(u(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=g,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(u(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=f,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!f(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},3256:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(46284);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,A,c,u,g=0,f=0,h=e.type,d="FeatureCollection"===h,p="Feature"===h,y=d?e.features.length:1,m=0;mA||f>c||h>u)return l=i,A=r,c=f,u=h,void(o=0);var d=n.lineString([l,i],e.properties);if(!1===t(d,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;se[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=u,t.lengthToDegrees=function(e,t){return g(u(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=g,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(u(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=f,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!f(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},84880:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(76796);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,A,c,u,g=0,f=0,h=e.type,d="FeatureCollection"===h,p="Feature"===h,y=d?e.features.length:1,m=0;mA||f>c||h>u)return l=i,A=r,c=f,u=h,void(o=0);var d=n.lineString([l,i],e.properties);if(!1===t(d,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=u,t.lengthToDegrees=function(e,t){return g(u(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=g,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(u(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=f,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!f(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")},t.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},t.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},t.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},t.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},t.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},t.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},t.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},43752:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(49840);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,A,c,u,g=0,f=0,h=e.type,d="FeatureCollection"===h,p="Feature"===h,y=d?e.features.length:1,m=0;mA||f>c||h>u)return l=i,A=r,c=f,u=h,void(o=0);var d=n.lineString([l,i],e.properties);if(!1===t(d,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;si&&(i=e[o]),e[o]1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;ie.length)&&(r=e.length),e.substring(r-t.length,r)===t}var p="",y="",m="",I="",v={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function E(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function C(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function B(e,t,r){var i="",a="",o=0,s="",l=!1,A=C(e),c=A.split("\n"),u=C(t).split("\n"),f=0,h="";if("strictEqual"===r&&"object"===g(e)&&"object"===g(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===u.length&&c[0]!==u[0]){var E=c[0].length+u[0].length;if(E<=10){if(("object"!==g(e)||null===e)&&("object"!==g(t)||null===t)&&(0!==e||0!==t))return"".concat(v[r],"\n\n")+"".concat(c[0]," !== ").concat(u[0],"\n")}else if("strictEqualObject"!==r&&E<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][f]===u[0][f];)f++;f>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}for(var B=c[c.length-1],b=u[u.length-1];B===b&&(f++<2?s="\n ".concat(B).concat(s):i=B,c.pop(),u.pop(),0!==c.length&&0!==u.length);)B=c[c.length-1],b=u[u.length-1];var x=Math.max(c.length,u.length);if(0===x){var w=A.split("\n");if(w.length>30)for(w[26]="".concat(p,"...").concat(I);w.length>27;)w.pop();return"".concat(v.notIdentical,"\n\n").concat(w.join("\n"),"\n")}f>3&&(s="\n".concat(p,"...").concat(I).concat(s),l=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var Q=0,_=v[r]+"\n".concat(y,"+ actual").concat(I," ").concat(m,"- expected").concat(I),S=" ".concat(p,"...").concat(I," Lines skipped");for(f=0;f1&&f>2&&(k>4?(a+="\n".concat(p,"...").concat(I),l=!0):k>3&&(a+="\n ".concat(u[f-2]),Q++),a+="\n ".concat(u[f-1]),Q++),o=f,i+="\n".concat(m,"-").concat(I," ").concat(u[f]),Q++;else if(u.length1&&f>2&&(k>4?(a+="\n".concat(p,"...").concat(I),l=!0):k>3&&(a+="\n ".concat(c[f-2]),Q++),a+="\n ".concat(c[f-1]),Q++),o=f,a+="\n".concat(y,"+").concat(I," ").concat(c[f]),Q++;else{var D=u[f],T=c[f],M=T!==D&&(!d(T,",")||T.slice(0,-1)!==D);M&&d(D,",")&&D.slice(0,-1)===T&&(M=!1,T+=","),M?(k>1&&f>2&&(k>4?(a+="\n".concat(p,"...").concat(I),l=!0):k>3&&(a+="\n ".concat(c[f-2]),Q++),a+="\n ".concat(c[f-1]),Q++),o=f,a+="\n".concat(y,"+").concat(I," ").concat(T),i+="\n".concat(m,"-").concat(I," ").concat(D),Q+=2):(a+=i,i="",1!==k&&0!==f||(a+="\n ".concat(T),Q++))}if(Q>20&&f30)for(b[26]="".concat(p,"...").concat(I);b.length>27;)b.pop();r=1===b.length?o(this,u(t).call(this,"".concat(d," ").concat(b[0]))):o(this,u(t).call(this,"".concat(d,"\n\n").concat(b.join("\n"),"\n")))}else{var x=C(A),w="",Q=v[a];"notDeepEqual"===a||"notEqual"===a?(x="".concat(v[a],"\n\n").concat(x)).length>1024&&(x="".concat(x.slice(0,1021),"...")):(w="".concat(C(c)),x.length>512&&(x="".concat(x.slice(0,509),"...")),w.length>512&&(w="".concat(w.slice(0,509),"...")),"deepEqual"===a||"equal"===a?x="".concat(Q,"\n\n").concat(x,"\n\nshould equal\n\n"):w=" ".concat(a," ").concat(w)),r=o(this,u(t).call(this,"".concat(x).concat(w)))}return Error.stackTraceLimit=f,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=A,r.expected=c,r.operator=a,Error.captureStackTrace&&Error.captureStackTrace(s(r),l),r.stack,r.name="AssertionError",o(r)}var r,l,A;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(e,t){return f(this,function(e){for(var t=1;t2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var a,o,l,A;if(void 0===s&&(s=r(45408)),s("string"===typeof e,"'name' must be a string"),"string"===typeof t&&(o="not ",t.substr(!l||l<0?0:+l,o.length)===o)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))A="The ".concat(e," ").concat(a," ").concat(u(t,"type"));else{var c=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";A='The "'.concat(e,'" ').concat(c," ").concat(a," ").concat(u(t,"type"))}return A+=". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===l&&(l=r(35840));var i=l.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",a=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),a){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,a-1).join(", "),i+=", and ".concat(t[a-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=A},25116:function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(l){i=!0,a=l}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=void 0!==/a/g.flags,o=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(39896),A=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:r(1560);function u(e){return e.call.bind(e)}var g=u(Object.prototype.hasOwnProperty),f=u(Object.prototype.propertyIsEnumerable),h=u(Object.prototype.toString),d=r(35840).types,p=d.isAnyArrayBuffer,y=d.isArrayBufferView,m=d.isDate,I=d.isMap,v=d.isRegExp,E=d.isSet,C=d.isNativeError,B=d.isBoxedPrimitive,b=d.isNumberObject,x=d.isStringObject,w=d.isBooleanObject,Q=d.isBigIntObject,_=d.isSymbolObject,S=d.isFloat32Array,k=d.isFloat64Array;function D(e){if(0===e.length||e.length>10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function T(e){return Object.keys(e).filter(D).concat(A(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function M(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i>2],a+=n[(3&r[t])<<4|r[t+1]>>4],a+=n[(15&r[t+1])<<2|r[t+2]>>6],a+=n[63&r[t+2]];return i%3===2?a=a.substring(0,a.length-1)+"=":i%3===1&&(a=a.substring(0,a.length-2)+"=="),a},s=function(e){var t,r,n,a,o,s=.75*e.length,l=e.length,A=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var c=new ArrayBuffer(s),u=new Uint8Array(c);for(t=0;t>4,u[A++]=(15&n)<<4|a>>2,u[A++]=(3&a)<<6|63&o;return c}},59968:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],l=a[1],A=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,l)),c=0,u=l>0?o-4:o;for(r=0;r>16&255,A[c++]=t>>8&255,A[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,A[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,A[c++]=t>>8&255,A[c++]=255&t),A},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,A=n-i;sA?A:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},64928:function(e){"use strict";function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},308:function(e,t){"use strict";function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},29620:function(e,t,r){"use strict";var n=r(32420);e.exports=function(e,t){t||(t={});var r,o,s,l,A,c,u,g,f,h,d,p=null==t.cutoff?.25:t.cutoff,y=null==t.radius?8:t.radius,m=t.channel||0;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,o=t.height,l=e,c=t.stride?t.stride:Math.floor(e.length/r/o)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(u=(g=e).getContext("2d"),r=g.width,o=g.height,l=(f=u.getImageData(0,0,r,o)).data,c=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(u=e,r=(g=e.canvas).width,o=g.height,l=(f=u.getImageData(0,0,r,o)).data,c=4):window.ImageData&&e instanceof window.ImageData&&(f=e,r=e.width,o=e.height,l=f.data,c=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(A=l,l=Array(r*o),h=0,d=A.length;h-1?i(r):r}},57916:function(e,t,r){"use strict";var n=r(8844),i=r(53664),a=r(14500),o=i("%TypeError%"),s=i("%Function.prototype.apply%"),l=i("%Function.prototype.call%"),A=i("%Reflect.apply%",!0)||n.call(l,s),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(f){c=null}e.exports=function(e){if("function"!==typeof e)throw new o("a function is required");var t=A(n,l,arguments);return a(t,1+u(0,e.length-(arguments.length-1)),!0)};var g=function(){return A(n,s,arguments)};c?c(e.exports,"apply",{value:g}):e.exports.apply=g},32420:function(e){e.exports=function(e,t,r){return tr?r:e:et?t:e}},3808:function(e,t,r){"use strict";var n=r(32420);function i(e,t){null==t&&(t=!0);var r=e[0],i=e[1],a=e[2],o=e[3];return null==o&&(o=t?1:255),t&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(e,t){var r=(e=+e)>>>24,n=(16711680&e)>>>16,i=(65280&e)>>>8,a=255&e;return!1===t?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},17592:function(e){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},72160:function(e,t,r){"use strict";var n=r(96824),i=r(32420),a=r(72512);e.exports=function(e,t){"float"!==t&&t||(t="array"),"uint"===t&&(t="uint8"),"uint_clamped"===t&&(t="uint8_clamped");var r=new(a(t))(4),o="uint8"!==t&&"uint8_clamped"!==t;return e.length&&"string"!==typeof e||((e=n(e))[0]/=255,e[1]/=255,e[2]/=255),function(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||!!(Array.isArray(e)&&(e[0]>1||0===e[0])&&(e[1]>1||0===e[1])&&(e[2]>1||0===e[2])&&(!e[3]||e[3]>1))}(e)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:1):(r[0]=i(Math.floor(255*e[0]),0,255),r[1]=i(Math.floor(255*e[1]),0,255),r[2]=i(Math.floor(255*e[2]),0,255),r[3]=null==e[3]?255:i(Math.floor(255*e[3]),0,255)),r)}},96824:function(e,t,r){"use strict";var n=r(95532),i=r(53576),a=r(32420);e.exports=function(e){var t,r=n(e);return r.space?((t=Array(3))[0]=a(r.values[0],0,255),t[1]=a(r.values[1],0,255),t[2]=a(r.values[2],0,255),"h"===r.space[0]&&(t=i.rgb(t)),t.push(a(r.alpha,0,1)),t):[]}},95532:function(e,t,r){"use strict";var n=r(17592);e.exports=function(e){var t,r,a=[],o=1;if("string"===typeof e)if(e=e.toLowerCase(),n[e])a=n[e].slice(),r="rgb";else if("transparent"===e)o=0,r="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var s=e.slice(1);o=1,(c=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===c&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===c&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),r="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var l=t[1],A="rgb"===l;r=s=l.replace(/a$/,"");var c="cmyk"===s?4:"gray"===s?1:3;a=t[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(e,t){if(/%$/.test(e))return t===c?parseFloat(e)/100:"rgb"===s?255*parseFloat(e)/100:parseFloat(e);if("h"===s[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==i[e])return i[e]}return parseFloat(e)})),l===s&&a.push(1),o=A||void 0===a[c]?1:a[c],a=a.slice(0,c)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(a=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),r=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(a=[e[0],e[1],e[2]],r="rgb",o=4===e.length?e[3]:1):e instanceof Object&&(null!=e.r||null!=e.red||null!=e.R?(r="rgb",a=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(r="hsl",a=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),o=e.a||e.alpha||e.opacity||1,null!=e.opacity&&(o/=100)):(r="rgb",a=[e>>>16,(65280&e)>>>8,255&e]);return{space:r,values:a,alpha:o}};var i={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},53576:function(e,t,r){"use strict";var n=r(19336);e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[a=255*l,a,a];t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var A=0;A<3;A++)(n=o+1/3*-(A-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[A]=255*a;return i}},n.hsl=function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?t=0:n===s?t=(i-a)/l:i===s?t=2+(a-n)/l:a===s&&(t=4+(n-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},19336:function(e){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},36116:function(e){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},42771:function(e,t,r){"use strict";e.exports={parse:r(46416),stringify:r(49395)}},8744:function(e,t,r){"use strict";var n=r(30584);e.exports={isSize:function(e){return/^[\d\.]/.test(e)||-1!==e.indexOf("/")||-1!==n.indexOf(e)}}},46416:function(e,t,r){"use strict";var n=r(92384),i=r(68194),a=r(3748),o=r(2904),s=r(47916),l=r(7294),A=r(39956),c=r(8744).isSize;e.exports=g;var u=g.cache={};function g(e){if("string"!==typeof e)throw new Error("Font argument must be a string.");if(u[e])return u[e];if(""===e)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(e))return u[e]={system:e};for(var t,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},g=A(e,/\s+/);t=g.shift();){if(-1!==i.indexOf(t))return["style","variant","weight","stretch"].forEach((function(e){r[e]=t})),u[e]=r;if(-1===s.indexOf(t))if("normal"!==t&&"small-caps"!==t)if(-1===l.indexOf(t)){if(-1===o.indexOf(t)){if(c(t)){var h=A(t,"/");if(r.size=h[0],null!=h[1]?r.lineHeight=f(h[1]):"/"===g[0]&&(g.shift(),r.lineHeight=f(g.shift())),!g.length)throw new Error("Missing required font-family.");return r.family=A(g.join(" "),/\s*,\s*/).map(n),u[e]=r}throw new Error("Unknown or unsupported font token: "+t)}r.weight=t}else r.stretch=t;else r.variant=t;else r.style=t}throw new Error("Missing required font-size.")}function f(e){var t=parseFloat(e);return t.toString()===e?t:e}},49395:function(e,t,r){"use strict";var n=r(55616),i=r(8744).isSize,a=d(r(68194)),o=d(r(3748)),s=d(r(2904)),l=d(r(47916)),A=d(r(7294)),c={normal:1,"small-caps":1},u={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},g="1rem",f="serif";function h(e,t){if(e&&!t[e]&&!a[e])throw Error("Unknown keyword `"+e+"`");return e}function d(e){for(var t={},r=0;rt?1:e>=t?0:NaN}r.d(t,{XE:function(){return n},kv:function(){return o},mo:function(){return l},Uf:function(){return A},SY:function(){return c},ik:function(){return u},oh:function(){return g}});var i=function(e){var t;return 1===e.length&&(t=e,e=function(e,r){return n(t(e),r)}),{left:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}(n),a=(i.right,i.left,Array.prototype);function o(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n}function s(e){return null===e?NaN:+e}function l(e,t){var r,n=e.length,i=n,a=-1,o=0;if(null==t)for(;++a=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r}function c(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function u(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=new Array(i);++n=n.length)return null!=e&&r.sort(e),null!=t?t(r):r;for(var A,c,u,g=-1,f=r.length,h=n[i++],d=o(),p=s();++gn.length)return e;var a,o=i[r-1];return null!=t&&r>=n.length?a=e.entries():(a=[],e.each((function(e,t){a.push({key:t,values:s(e,r)})}))),null!=o?a.sort((function(e,t){return o(e.key,t.key)})):a}return r={object:function(e){return a(e,0,l,A)},map:function(e){return a(e,0,c,u)},entries:function(e){return s(a(e,0,c,u),0)},key:function(e){return n.push(e),r},sortKeys:function(e){return i[n.length-1]=e,r},sortValues:function(t){return e=t,r},rollup:function(e){return t=e,r}}}function l(){return{}}function A(e,t,r){e[t]=r}function c(){return o()}function u(e,t,r){e.set(t,r)}function g(){}var f=o.prototype;g.prototype=function(e,t){var r=new g;if(e instanceof g)e.each((function(e){r.add(e)}));else if(e){var n=-1,i=e.length;if(null==t)for(;++n=(a=(d+y)/2))?d=a:y=a,(c=r>=(o=(p+m)/2))?p=o:m=o,i=f,!(f=f[u=c<<1|A]))return i[u]=h,e;if(s=+e._x.call(null,f.data),l=+e._y.call(null,f.data),t===s&&r===l)return h.next=f,i?i[u]=h:e._root=h,e;do{i=i?i[u]=new Array(4):e._root=new Array(4),(A=t>=(a=(d+y)/2))?d=a:y=a,(c=r>=(o=(p+m)/2))?p=o:m=o}while((u=c<<1|A)===(g=(l>=o)<<1|s>=a));return i[g]=f,i[u]=h,e}function s(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function l(e){return e[0]}function A(e){return e[1]}function c(e,t,r){var n=new u(null==t?l:t,null==r?A:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function u(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function g(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}r.r(t),r.d(t,{forceCenter:function(){return n},forceCollide:function(){return p},forceLink:function(){return v},forceManyBody:function(){return W},forceRadial:function(){return Z},forceSimulation:function(){return V},forceX:function(){return X},forceY:function(){return $}});var f=c.prototype=u.prototype;function h(e){return e.x+e.vx}function d(e){return e.y+e.vy}function p(e){var t,r,n=1,o=1;function s(){for(var e,i,s,A,u,g,f,p=t.length,y=0;yA+h||iu+h||os.index){var d=A-l.x-l.vx,p=u-l.y-l.vy,y=d*d+p*p;ye.r&&(e.r=e[t].r)}function A(){if(t){var n,i,a=t.length;for(r=new Array(a),n=0;nu&&(u=n),ig&&(g=i));if(A>u||c>g)return this;for(this.cover(A,c).cover(u,g),r=0;re||e>=i||n>t||t>=a;)switch(s=(tf||(a=A.y0)>h||(o=A.x1)=m)<<1|e>=y)&&(A=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=A)}else{var I=e-+this._x.call(null,p.data),v=t-+this._y.call(null,p.data),E=I*I+v*v;if(E=(s=(h+p)/2))?h=s:p=s,(c=o>=(l=(d+y)/2))?d=l:y=l,t=f,!(f=f[u=c<<1|A]))return this;if(!f.length)break;(t[u+1&3]||t[u+2&3]||t[u+3&3])&&(r=t,g=u)}for(;f.data!==e;)if(n=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,n?(i?n.next=i:delete n.next,this):t?(i?t[u]=i:delete t[u],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(r?r[g]=f:this._root=f),this):(this._root=i,this)},f.removeAll=function(e){for(var t=0,r=e.length;t=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++o0)for(var r,n,i=new Array(r),a=0;a=0&&t._call.call(null,e),t=t._next;--S}()}finally{S=0,function(){for(var e,t,r=w,n=1/0;r;)r._call?(n>r._time&&(n=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:w=t);Q=e,H(n)}(),R=0}}function q(){var e=N.now(),t=e-M;t>T&&(L-=t,M=e)}function H(e){S||(k&&(k=clearTimeout(k)),e-R>24?(e<1/0&&(k=setTimeout(z,e-N.now()-L)),D&&(D=clearInterval(D))):(D||(M=N.now(),D=setInterval(q,T)),S=1,F(z)))}function Y(e){return e.x}function J(e){return e.y}G.prototype=U.prototype={constructor:G,restart:function(e,t,r){if("function"!==typeof e)throw new TypeError("callback is not a function");r=(null==r?O():+r)+(null==t?0:+t),this._next||Q===this||(Q?Q._next=this:w=this,Q=this),this._call=e,this._time=r,H()},stop:function(){this._call&&(this._call=null,this._time=1/0,H())}};var K=10,j=Math.PI*(3-Math.sqrt(5));function V(e){var t,r=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=(0,y.kH)(),l=U(c),A=_("tick","end");function c(){u(),A.call("tick",t),r1?(null==r?s.remove(e):s.set(e,f(r)),t):s.get(e)},find:function(t,r,n){var i,a,o,s,l,A=0,c=e.length;for(null==n?n=1/0:n*=n,A=0;A1?(A.on(e,r),t):A.on(e)}}}function W(){var e,t,r,n,o=i(-30),s=1,l=1/0,A=.81;function u(n){var i,a=e.length,o=c(e,Y,J).visitAfter(f);for(r=n,i=0;i=l)){(e.data!==t||e.next)&&(0===u&&(h+=(u=a())*u),0===g&&(h+=(g=a())*g),h1?n[0]+n.slice(2):n,+e.slice(r+1)]}r.d(t,{E9:function(){return g},SO:function(){return d}});var i,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(e){if(!(t=a.exec(e)))throw new Error("invalid format: "+e);var t;return new s({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function s(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function l(e,t){var r=n(e,t);if(!r)return e+"";var i=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}o.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var A={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return l(100*e,t)},r:l,s:function(e,t){var r=n(e,t);if(!r)return e+"";var a=r[0],o=r[1],s=o-(i=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+n(e,Math.max(0,t+s-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var u,g,f=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function d(e){var t,r,a=void 0===e.grouping||void 0===e.thousands?c:(t=f.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var i=e.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(e.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(r)}),s=void 0===e.currency?"":e.currency[0]+"",l=void 0===e.currency?"":e.currency[1]+"",u=void 0===e.decimal?".":e.decimal+"",g=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(f.call(e.numerals,String)),d=void 0===e.percent?"%":e.percent+"",p=void 0===e.minus?"-":e.minus+"",y=void 0===e.nan?"NaN":e.nan+"";function m(e){var t=(e=o(e)).fill,r=e.align,n=e.sign,c=e.symbol,f=e.zero,m=e.width,I=e.comma,v=e.precision,E=e.trim,C=e.type;"n"===C?(I=!0,C="g"):A[C]||(void 0===v&&(v=12),E=!0,C="g"),(f||"0"===t&&"="===r)&&(f=!0,t="0",r="=");var B="$"===c?s:"#"===c&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",b="$"===c?l:/[%p]/.test(C)?d:"",x=A[C],w=/[defgprs%]/.test(C);function Q(e){var o,s,l,A=B,c=b;if("c"===C)c=x(e)+c,e="";else{var d=(e=+e)<0||1/e<0;if(e=isNaN(e)?y:x(Math.abs(e),v),E&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),d&&0===+e&&"+"!==n&&(d=!1),A=(d?"("===n?n:p:"-"===n||"("===n?"":n)+A,c=("s"===C?h[8+i/3]:"")+c+(d&&"("===n?")":""),w)for(o=-1,s=e.length;++o(l=e.charCodeAt(o))||l>57){c=(46===l?u+e.slice(o+1):e.slice(o))+c,e=e.slice(0,o);break}}I&&!f&&(e=a(e,1/0));var Q=A.length+e.length+c.length,_=Q>1)+A+e+c+_.slice(Q);break;default:e=_+A+e+c}return g(e)}return v=void 0===v?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),Q.toString=function(){return e+""},Q}return{format:m,formatPrefix:function(e,t){var r,i=m(((e=o(e)).type="f",e)),a=3*Math.max(-8,Math.min(8,Math.floor((r=t,((r=n(Math.abs(r)))?r[1]:NaN)/3)))),s=Math.pow(10,-a),l=h[8+a/3];return function(e){return i(s*e)+l}}}}u=d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),g=u.format,u.formatPrefix},87108:function(e,t,r){"use strict";r.r(t),r.d(t,{geoAiry:function(){return L},geoAiryRaw:function(){return R},geoAitoff:function(){return F},geoAitoffRaw:function(){return N},geoArmadillo:function(){return P},geoArmadilloRaw:function(){return O},geoAugust:function(){return U},geoAugustRaw:function(){return G},geoBaker:function(){return Y},geoBakerRaw:function(){return H},geoBerghaus:function(){return j},geoBerghausRaw:function(){return K},geoBertin1953:function(){return re},geoBertin1953Raw:function(){return te},geoBoggs:function(){return ce},geoBoggsRaw:function(){return Ae},geoBonne:function(){return de},geoBonneRaw:function(){return he},geoBottomley:function(){return ye},geoBottomleyRaw:function(){return pe},geoBromley:function(){return Ie},geoBromleyRaw:function(){return me},geoChamberlin:function(){return _e},geoChamberlinAfrica:function(){return Qe},geoChamberlinRaw:function(){return xe},geoCollignon:function(){return ke},geoCollignonRaw:function(){return Se},geoCraig:function(){return Te},geoCraigRaw:function(){return De},geoCraster:function(){return Le},geoCrasterRaw:function(){return Re},geoCylindricalEqualArea:function(){return Fe},geoCylindricalEqualAreaRaw:function(){return Ne},geoCylindricalStereographic:function(){return Pe},geoCylindricalStereographicRaw:function(){return Oe},geoEckert1:function(){return Ue},geoEckert1Raw:function(){return Ge},geoEckert2:function(){return qe},geoEckert2Raw:function(){return ze},geoEckert3:function(){return Ye},geoEckert3Raw:function(){return He},geoEckert4:function(){return Ke},geoEckert4Raw:function(){return Je},geoEckert5:function(){return Ve},geoEckert5Raw:function(){return je},geoEckert6:function(){return Ze},geoEckert6Raw:function(){return We},geoEisenlohr:function(){return et},geoEisenlohrRaw:function(){return $e},geoFahey:function(){return nt},geoFaheyRaw:function(){return rt},geoFoucaut:function(){return at},geoFoucautRaw:function(){return it},geoFoucautSinusoidal:function(){return st},geoFoucautSinusoidalRaw:function(){return ot},geoGilbert:function(){return gt},geoGingery:function(){return pt},geoGingeryRaw:function(){return ft},geoGinzburg4:function(){return It},geoGinzburg4Raw:function(){return mt},geoGinzburg5:function(){return Et},geoGinzburg5Raw:function(){return vt},geoGinzburg6:function(){return Bt},geoGinzburg6Raw:function(){return Ct},geoGinzburg8:function(){return xt},geoGinzburg8Raw:function(){return bt},geoGinzburg9:function(){return Qt},geoGinzburg9Raw:function(){return wt},geoGringorten:function(){return kt},geoGringortenQuincuncial:function(){return ai},geoGringortenRaw:function(){return St},geoGuyou:function(){return Rt},geoGuyouRaw:function(){return Mt},geoHammer:function(){return X},geoHammerRaw:function(){return W},geoHammerRetroazimuthal:function(){return Ot},geoHammerRetroazimuthalRaw:function(){return Nt},geoHealpix:function(){return Kt},geoHealpixRaw:function(){return qt},geoHill:function(){return Vt},geoHillRaw:function(){return jt},geoHomolosine:function(){return tr},geoHomolosineRaw:function(){return er},geoHufnagel:function(){return nr},geoHufnagelRaw:function(){return rr},geoHyperelliptical:function(){return sr},geoHyperellipticalRaw:function(){return or},geoInterrupt:function(){return cr},geoInterruptedBoggs:function(){return gr},geoInterruptedHomolosine:function(){return hr},geoInterruptedMollweide:function(){return pr},geoInterruptedMollweideHemispheres:function(){return mr},geoInterruptedQuarticAuthalic:function(){return un},geoInterruptedSinuMollweide:function(){return vr},geoInterruptedSinusoidal:function(){return Cr},geoKavrayskiy7:function(){return br},geoKavrayskiy7Raw:function(){return Br},geoLagrange:function(){return wr},geoLagrangeRaw:function(){return xr},geoLarrivee:function(){return Sr},geoLarriveeRaw:function(){return _r},geoLaskowski:function(){return Dr},geoLaskowskiRaw:function(){return kr},geoLittrow:function(){return Mr},geoLittrowRaw:function(){return Tr},geoLoximuthal:function(){return Lr},geoLoximuthalRaw:function(){return Rr},geoMiller:function(){return Fr},geoMillerRaw:function(){return Nr},geoModifiedStereographic:function(){return Vr},geoModifiedStereographicAlaska:function(){return Hr},geoModifiedStereographicGs48:function(){return Yr},geoModifiedStereographicGs50:function(){return Jr},geoModifiedStereographicLee:function(){return jr},geoModifiedStereographicMiller:function(){return Kr},geoModifiedStereographicRaw:function(){return Or},geoMollweide:function(){return oe},geoMollweideRaw:function(){return ae},geoMtFlatPolarParabolic:function(){return $r},geoMtFlatPolarParabolicRaw:function(){return Xr},geoMtFlatPolarQuartic:function(){return tn},geoMtFlatPolarQuarticRaw:function(){return en},geoMtFlatPolarSinusoidal:function(){return nn},geoMtFlatPolarSinusoidalRaw:function(){return rn},geoNaturalEarth:function(){return an.c},geoNaturalEarth2:function(){return sn},geoNaturalEarth2Raw:function(){return on},geoNaturalEarthRaw:function(){return an.g},geoNellHammer:function(){return An},geoNellHammerRaw:function(){return ln},geoNicolosi:function(){return fn},geoNicolosiRaw:function(){return gn},geoPatterson:function(){return bn},geoPattersonRaw:function(){return Bn},geoPeirceQuincuncial:function(){return oi},geoPierceQuincuncial:function(){return oi},geoPolyconic:function(){return wn},geoPolyconicRaw:function(){return xn},geoPolyhedral:function(){return Mn},geoPolyhedralButterfly:function(){return Gn},geoPolyhedralCollignon:function(){return qn},geoPolyhedralWaterman:function(){return Hn},geoProject:function(){return Vn},geoQuantize:function(){return si},geoQuincuncial:function(){return ii},geoRectangularPolyconic:function(){return Ai},geoRectangularPolyconicRaw:function(){return li},geoRobinson:function(){return gi},geoRobinsonRaw:function(){return ui},geoSatellite:function(){return hi},geoSatelliteRaw:function(){return fi},geoSinuMollweide:function(){return $t},geoSinuMollweideRaw:function(){return Xt},geoSinusoidal:function(){return fe},geoSinusoidalRaw:function(){return ge},geoStitch:function(){return Mi},geoTimes:function(){return Li},geoTimesRaw:function(){return Ri},geoTwoPointAzimuthal:function(){return Pi},geoTwoPointAzimuthalRaw:function(){return Fi},geoTwoPointAzimuthalUsa:function(){return Oi},geoTwoPointEquidistant:function(){return zi},geoTwoPointEquidistantRaw:function(){return Gi},geoTwoPointEquidistantUsa:function(){return Ui},geoVanDerGrinten:function(){return Hi},geoVanDerGrinten2:function(){return Ji},geoVanDerGrinten2Raw:function(){return Yi},geoVanDerGrinten3:function(){return ji},geoVanDerGrinten3Raw:function(){return Ki},geoVanDerGrinten4:function(){return Wi},geoVanDerGrinten4Raw:function(){return Vi},geoVanDerGrintenRaw:function(){return qi},geoWagner:function(){return Xi},geoWagner4:function(){return na},geoWagner4Raw:function(){return ra},geoWagner6:function(){return aa},geoWagner6Raw:function(){return ia},geoWagner7:function(){return $i},geoWagnerRaw:function(){return Zi},geoWiechel:function(){return sa},geoWiechelRaw:function(){return oa},geoWinkel3:function(){return Aa},geoWinkel3Raw:function(){return la}});var n=r(87952),i=Math.abs,a=Math.atan,o=Math.atan2,s=(Math.ceil,Math.cos),l=Math.exp,A=Math.floor,c=Math.log,u=Math.max,g=Math.min,f=Math.pow,h=Math.round,d=Math.sign||function(e){return e>0?1:e<0?-1:0},p=Math.sin,y=Math.tan,m=1e-6,I=1e-12,v=Math.PI,E=v/2,C=v/4,B=Math.SQRT1_2,b=D(2),x=D(v),w=2*v,Q=180/v,_=v/180;function S(e){return e>1?E:e<-1?-E:Math.asin(e)}function k(e){return e>1?0:e<-1?v:Math.acos(e)}function D(e){return e>0?Math.sqrt(e):0}function T(e){return(l(e)-l(-e))/2}function M(e){return(l(e)+l(-e))/2}function R(e){var t=y(e/2),r=2*c(s(e/2))/(t*t);function n(e,t){var n=s(e),i=s(t),a=p(t),o=i*n,l=-((1-o?c((1+o)/2)/(1-o):-.5)+r/(1+o));return[l*i*p(e),l*a]}return n.invert=function(t,n){var a,l=D(t*t+n*n),A=-e/2,u=50;if(!l)return[0,0];do{var g=A/2,f=s(g),h=p(g),d=h/f,y=-c(i(f));A-=a=(2/d*y-r*d-l)/(-y/(h*h)+1-r/(2*f*f))*(f<0?.7:1)}while(i(a)>m&&--u>0);var I=p(A);return[o(t*I,l*s(A)),S(n*I/l)]},n}function L(){var e=E,t=(0,n.U)(R),r=t(e);return r.radius=function(r){return arguments.length?t(e=r*_):e*Q},r.scale(179.976).clipAngle(147)}function N(e,t){var r=s(t),n=function(e){return e?e/Math.sin(e):1}(k(r*s(e/=2)));return[2*r*p(e)*n,p(t)*n]}function F(){return(0,n.c)(N).scale(152.63)}function O(e){var t=p(e),r=s(e),n=e>=0?1:-1,a=y(n*e),l=(1+t-r)/2;function A(e,i){var A=s(i),c=s(e/=2);return[(1+A)*p(e),(n*i>-o(c,a)-.001?0:10*-n)+l+p(i)*r-(1+A)*t*c]}return A.invert=function(e,A){var c=0,u=0,g=50;do{var f=s(c),h=p(c),d=s(u),y=p(u),I=1+d,v=I*h-e,E=l+y*r-I*t*f-A,C=I*f/2,B=-h*y,b=t*I*h/2,x=r*d+t*f*y,w=B*b-x*C,Q=(E*B-v*x)/w/2,_=(v*b-E*C)/w;i(_)>2&&(_/=2),c-=Q,u-=_}while((i(Q)>m||i(_)>m)&&--g>0);return n*u>-o(s(c),a)-.001?[2*c,u]:null},A}function P(){var e=20*_,t=e>=0?1:-1,r=y(t*e),i=(0,n.U)(O),a=i(e),l=a.stream;return a.parallel=function(n){return arguments.length?(r=y((t=(e=n*_)>=0?1:-1)*e),i(e)):e*Q},a.stream=function(n){var i=a.rotate(),A=l(n),c=(a.rotate([0,0]),l(n)),u=a.precision();return a.rotate(i),A.sphere=function(){c.polygonStart(),c.lineStart();for(var n=-180*t;t*n<180;n+=90*t)c.point(n,90*t);if(e)for(;t*(n-=3*t*u)>=-180;)c.point(n,t*-o(s(n*_/2),r)*Q);c.lineEnd(),c.polygonEnd()},A},a.scale(218.695).center([0,28.0974])}function G(e,t){var r=y(t/2),n=D(1-r*r),i=1+n*s(e/=2),a=p(e)*n/i,o=r/i,l=a*a,A=o*o;return[4/3*a*(3+l-3*A),4/3*o*(3+3*l-A)]}function U(){return(0,n.c)(G).scale(66.1603)}N.invert=function(e,t){if(!(e*e+4*t*t>v*v+m)){var r=e,n=t,a=25;do{var o,l=p(r),A=p(r/2),c=s(r/2),u=p(n),g=s(n),f=p(2*n),h=u*u,d=g*g,y=A*A,I=1-d*c*c,E=I?k(g*c)*D(o=1/I):o=0,C=2*E*g*A-e,B=E*u-t,b=o*(d*y+E*g*c*h),x=o*(.5*l*f-2*E*u*A),w=.25*o*(f*A-E*u*d*l),Q=o*(h*c+E*y*g),_=x*w-Q*b;if(!_)break;var S=(B*x-C*Q)/_,T=(C*w-B*b)/_;r-=S,n-=T}while((i(S)>m||i(T)>m)&&--a>0);return[r,n]}},G.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&i(t)>1)return null;var r=1+e*e+t*t,n=D((r-D(r*r-4*t*t))/2),a=S(n)/3,l=n?function(e){return c(e+D(e*e-1))}(i(t/n))/3:function(e){return c(e+D(e*e+1))}(i(e))/3,A=s(a),u=M(l),g=u*u-A*A;return[2*d(e)*o(T(l)*A,.25-g),2*d(t)*o(u*p(a),.25+g)]};var z=D(8),q=c(1+b);function H(e,t){var r=i(t);return rI&&--A>0);return[e/(s(o)*(z-1/p(o))),d(t)*o]};var J=r(69020);function K(e){var t=2*v/e;function r(e,r){var n=(0,J.O)(e,r);if(i(e)>E){var a=o(n[1],n[0]),l=D(n[0]*n[0]+n[1]*n[1]),A=t*h((a-E)/t)+E,c=o(p(a-=A),2-s(a));a=A+S(v/l*p(c))-c,n[0]=l*s(a),n[1]=l*p(a)}return n}return r.invert=function(e,r){var n=D(e*e+r*r);if(n>E){var i=o(r,e),l=t*h((i-E)/t)+E,A=i>l?-1:1,c=n*s(l-i),u=1/y(A*k((c-v)/D(v*(v-2*c)+n*n)));i=l+2*a((u+A*D(u*u-3))/3),e=n*s(i),r=n*p(i)}return J.O.invert(e,r)},r}function j(){var e=5,t=(0,n.U)(K),r=t(e),i=r.stream,a=.01,l=-s(a*_),A=p(a*_);return r.lobes=function(r){return arguments.length?t(e=+r):e},r.stream=function(t){var n=r.rotate(),c=i(t),u=(r.rotate([0,0]),i(t));return r.rotate(n),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=0,r=360/e,n=2*v/e,i=90-180/e,c=E;t0&&i(n)>m);return s<0?NaN:r}function ee(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=I),function(n,a,o,s){var l,A,c;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var u=0;ul)o-=A/=2,s-=c/=2;else{l=d;var p=(o>0?-1:1)*r,y=(s>0?-1:1)*r,m=e(o+p,s),I=e(o,s+y),v=(m[0]-g[0])/p,E=(m[1]-g[1])/p,C=(I[0]-g[0])/y,B=(I[1]-g[1])/y,b=B*v-E*C,x=(i(b)<.5?.5:1)/b;if(o+=A=(h*C-f*B)*x,s+=c=(f*E-h*v)*x,i(A)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return t.invert=ee(t),t}function re(){return(0,n.c)(te()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ne(e,t){var r,n=e*p(t),a=30;do{t-=r=(t+p(t)-n)/(1+s(t))}while(i(r)>m&&--a>0);return t/2}function ie(e,t,r){function n(n,i){return[e*n*s(i=ne(r,i)),t*p(i)]}return n.invert=function(n,i){return i=S(i/t),[n/(e*s(i)),S((2*i+p(2*i))/r)]},n}Z.invert=function(e,t){var r=2*S(t/2);return[e*s(r/2)/s(r),r]};var ae=ie(b/E,b,v);function oe(){return(0,n.c)(ae).scale(169.529)}var se=2.00276,le=1.11072;function Ae(e,t){var r=ne(v,t);return[se*e/(1/s(t)+le/s(r)),(t+b*p(r))/se]}function ce(){return(0,n.c)(Ae).scale(160.857)}function ue(e){var t=0,r=(0,n.U)(e),i=r(t);return i.parallel=function(e){return arguments.length?r(t=e*_):t*Q},i}function ge(e,t){return[e*s(t),t]}function fe(){return(0,n.c)(ge).scale(152.63)}function he(e){if(!e)return ge;var t=1/y(e);function r(r,n){var i=t+e-n,a=i?r*s(n)/i:i;return[i*p(a),t-i*s(a)]}return r.invert=function(r,n){var i=D(r*r+(n=t-n)*n),a=t+e-i;return[i/s(a)*o(r,n),a]},r}function de(){return ue(he).scale(123.082).center([0,26.1441]).parallel(45)}function pe(e){function t(t,r){var n=E-r,i=n?t*e*p(n)/n:n;return[n*p(i)/e,E-n*s(i)]}return t.invert=function(t,r){var n=t*e,i=E-r,a=D(n*n+i*i),s=o(n,i);return[(a?a/p(a):1)*s/e,E-a]},t}function ye(){var e=.5,t=(0,n.U)(pe),r=t(e);return r.fraction=function(r){return arguments.length?t(e=+r):e},r.scale(158.837)}Ae.invert=function(e,t){var r,n,a=se*t,o=t<0?-C:C,l=25;do{n=a-b*p(o),o-=r=(p(2*o)+2*o-v*p(n))/(2*s(2*o)+2+v*s(n)*b*s(o))}while(i(r)>m&&--l>0);return n=a-b*p(o),[e*(1/s(n)+le/s(o))/se,n]},ge.invert=function(e,t){return[e/s(t),t]};var me=ie(1,4/v,v);function Ie(){return(0,n.c)(me).scale(152.63)}var ve=r(24052),Ee=r(92992);function Ce(e,t,r,n,a,l){var A,c=s(l);if(i(e)>1||i(l)>1)A=k(r*a+t*n*c);else{var u=p(e/2),g=p(l/2);A=2*S(D(u*u+t*n*g*g))}return i(A)>m?[A,o(n*p(l),t*a-r*n*c)]:[0,0]}function Be(e,t,r){return k((e*e+t*t-r*r)/(2*e*t))}function be(e){return e-2*v*A((e+v)/(2*v))}function xe(e,t,r){for(var n,i=[[e[0],e[1],p(e[1]),s(e[1])],[t[0],t[1],p(t[1]),s(t[1])],[r[0],r[1],p(r[1]),s(r[1])]],a=i[2],o=0;o<3;++o,a=n)n=i[o],a.v=Ce(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=Be(i[0].v[0],i[2].v[0],i[1].v[0]),A=Be(i[0].v[0],i[1].v[0],i[2].v[0]),c=v-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var u=[i[2].point[0]=i[0].point[0]+i[2].v[0]*s(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*p(l))];return function(e,t){var r,n=p(t),a=s(t),o=new Array(3);for(r=0;r<3;++r){var l=i[r];if(o[r]=Ce(t-l[1],l[3],l[2],a,n,e-l[0]),!o[r][0])return l.point;o[r][1]=be(o[r][1]-l.v[1])}var g=u.slice();for(r=0;r<3;++r){var f=2==r?0:r+1,h=Be(i[r].v[0],o[r][0],o[f][0]);o[r][1]<0&&(h=-h),r?1==r?(h=A-h,g[0]-=o[r][0]*s(h),g[1]-=o[r][0]*p(h)):(h=c-h,g[0]+=o[r][0]*s(h),g[1]+=o[r][0]*p(h)):(g[0]+=o[r][0]*s(h),g[1]-=o[r][0]*p(h))}return g[0]/=3,g[1]/=3,g}}function we(e){return e[0]*=_,e[1]*=_,e}function Qe(){return _e([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function _e(e,t,r){var i=(0,ve.c)({type:"MultiPoint",coordinates:[e,t,r]}),a=[-i[0],-i[1]],o=(0,Ee.c)(a),s=xe(we(o(e)),we(o(t)),we(o(r)));s.invert=ee(s);var l=(0,n.c)(s).rotate(a),A=l.center;return delete l.rotate,l.center=function(e){return arguments.length?A(o(e)):o.invert(A())},l.clipAngle(90)}function Se(e,t){var r=D(1-p(t));return[2/x*e*r,x*(1-r)]}function ke(){return(0,n.c)(Se).scale(95.6464).center([0,30])}function De(e){var t=y(e);function r(e,r){return[e,(e?e/p(e):1)*(p(r)*s(e)-t*s(r))]}return r.invert=t?function(e,r){e&&(r*=p(e)/e);var n=s(e);return[e,2*o(D(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,S(e?t*y(e)/e:t)]},r}function Te(){return ue(De).scale(249.828).clipAngle(90)}Se.invert=function(e,t){var r=(r=t/x-1)*r;return[r>0?e*D(v/r)/2:0,S(1-r)]};var Me=D(3);function Re(e,t){return[Me*e*(2*s(2*t/3)-1)/x,Me*x*p(t/3)]}function Le(){return(0,n.c)(Re).scale(156.19)}function Ne(e){var t=s(e);function r(e,r){return[e*t,p(r)/t]}return r.invert=function(e,r){return[e/t,S(r*t)]},r}function Fe(){return ue(Ne).parallel(38.58).scale(195.044)}function Oe(e){var t=s(e);function r(e,r){return[e*t,(1+t)*y(r/2)]}return r.invert=function(e,r){return[e/t,2*a(r/(1+t))]},r}function Pe(){return ue(Oe).scale(124.75)}function Ge(e,t){var r=D(8/(3*v));return[r*e*(1-i(t)/v),r*t]}function Ue(){return(0,n.c)(Ge).scale(165.664)}function ze(e,t){var r=D(4-3*p(i(t)));return[2/D(6*v)*e*r,d(t)*D(2*v/3)*(2-r)]}function qe(){return(0,n.c)(ze).scale(165.664)}function He(e,t){var r=D(v*(4+v));return[2/r*e*(1+D(1-4*t*t/(v*v))),4/r*t]}function Ye(){return(0,n.c)(He).scale(180.739)}function Je(e,t){var r=(2+E)*p(t);t/=2;for(var n=0,a=1/0;n<10&&i(a)>m;n++){var o=s(t);t-=a=(t+p(t)*(o+2)-r)/(2*o*(1+o))}return[2/D(v*(4+v))*e*(1+s(t)),2*D(v/(4+v))*p(t)]}function Ke(){return(0,n.c)(Je).scale(180.739)}function je(e,t){return[e*(1+s(t))/D(2+v),2*t/D(2+v)]}function Ve(){return(0,n.c)(je).scale(173.044)}function We(e,t){for(var r=(1+E)*p(t),n=0,a=1/0;n<10&&i(a)>m;n++)t-=a=(t+p(t)-r)/(1+s(t));return r=D(2+v),[e*(1+s(t))/r,2*t/r]}function Ze(){return(0,n.c)(We).scale(173.044)}Re.invert=function(e,t){var r=3*S(t/(Me*x));return[x*e/(Me*(2*s(2*r/3)-1)),r]},Ge.invert=function(e,t){var r=D(8/(3*v)),n=t/r;return[e/(r*(1-i(n)/v)),n]},ze.invert=function(e,t){var r=2-i(t)/D(2*v/3);return[e*D(6*v)/(2*r),d(t)*S((4-r*r)/3)]},He.invert=function(e,t){var r=D(v*(4+v))/2;return[e*r/(1+D(1-t*t*(4+v)/(4*v))),t*r/2]},Je.invert=function(e,t){var r=t*D((4+v)/v)/2,n=S(r),i=s(n);return[e/(2/D(v*(4+v))*(1+i)),S((n+r*(i+2))/(2+E))]},je.invert=function(e,t){var r=D(2+v),n=t*r/2;return[r*e/(1+s(n)),n]},We.invert=function(e,t){var r=1+E,n=D(r/2);return[2*e*n/(1+s(t*=n)),S((t+p(t))/r)]};var Xe=3+2*b;function $e(e,t){var r=p(e/=2),n=s(e),i=D(s(t)),o=s(t/=2),l=p(t)/(o+b*n*i),A=D(2/(1+l*l)),u=D((b*o+(n+r)*i)/(b*o+(n-r)*i));return[Xe*(A*(u-1/u)-2*c(u)),Xe*(A*l*(u+1/u)-2*a(l))]}function et(){return(0,n.c)($e).scale(62.5271)}$e.invert=function(e,t){if(!(r=G.invert(e/1.2,1.065*t)))return null;var r,n=r[0],o=r[1],l=20;e/=Xe,t/=Xe;do{var A=n/2,f=o/2,h=p(A),d=s(A),y=p(f),I=s(f),v=s(o),C=D(v),x=y/(I+b*d*C),w=x*x,Q=D(2/(1+w)),_=(b*I+(d+h)*C)/(b*I+(d-h)*C),S=D(_),k=S-1/S,T=S+1/S,M=Q*k-2*c(S)-e,R=Q*x*T-2*a(x)-t,L=y&&B*C*h*w/y,N=(b*d*I+C)/(2*(I+b*d*C)*(I+b*d*C)*C),F=-.5*x*Q*Q*Q,O=F*L,P=F*N,U=(U=2*I+b*C*(d-h))*U*S,z=(b*d*I*C+v)/U,q=-b*h*y/(C*U),H=k*O-2*z/S+Q*(z+z/_),Y=k*P-2*q/S+Q*(q+q/_),J=x*T*O-2*L/(1+w)+Q*T*L+Q*x*(z-z/_),K=x*T*P-2*N/(1+w)+Q*T*N+Q*x*(q-q/_),j=Y*J-K*H;if(!j)break;var V=(R*Y-M*K)/j,W=(M*J-R*H)/j;n-=V,o=u(-E,g(E,o-W))}while((i(V)>m||i(W)>m)&&--l>0);return i(i(o)-E)n){var g=D(u),f=o(c,A),d=r*h(f/r),y=f-d,I=e*s(y),C=(e*p(y)-y*p(I))/(E-I),B=ht(y,C),b=(v-e)/dt(B,I,v);A=g;var x,w=50;do{A-=x=(e+dt(B,I,A)*b-g)/(B(A)*b)}while(i(x)>m&&--w>0);c=y*p(A),An){var A=D(l),c=o(a,t),u=r*h(c/r),g=c-u;t=A*s(g),a=A*p(g);for(var f=t-E,d=p(t),y=a/d,m=tm||i(f)>m)&&--y>0);return[h,d]},c}var mt=yt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function It(){return(0,n.c)(mt).scale(149.995)}var vt=yt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Et(){return(0,n.c)(vt).scale(153.93)}var Ct=yt(5/6*v,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Bt(){return(0,n.c)(Ct).scale(130.945)}function bt(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}function xt(){return(0,n.c)(bt).scale(131.747)}bt.invert=function(e,t){var r,n=e,a=t,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-t)/(1+s/4)}while(i(r)>m&&--o>0);o=50,e/=1-.162388*s;do{var l=(l=n*n)*l;n-=r=(n*(.87-952426e-9*l)-e)/(.87-.00476213*l)}while(i(r)>m&&--o>0);return[n,a]};var wt=yt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Qt(){return(0,n.c)(wt).scale(131.087)}function _t(e){var t=e(E,0)[0]-e(-E,0)[0];function r(r,n){var i=r>0?-.5:.5,a=e(r+i*v,n);return a[0]-=i*t,a}return e.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=e.invert(r+i*t,n),o=a[0]-i*v;return o<-v?o+=2*v:o>v&&(o-=2*v),a[0]=o,a}),r}function St(e,t){var r=d(e),n=d(t),a=s(t),l=s(e)*a,A=p(e)*a,c=p(n*t);e=i(o(A,c)),t=S(l),i(e-E)>m&&(e%=E);var u=function(e,t){if(t===E)return[0,0];var r,n,a=p(t),o=a*a,l=o*o,A=1+l,c=1+3*l,u=1-l,g=S(1/D(A)),f=u+o*A*g,h=(1-a)/f,d=D(h),y=h*A,I=D(y),C=d*u;if(0===e)return[0,-(C+o*I)];var B,b=s(t),x=1/b,w=2*a*b,Q=(-3*o+g*c)*w,_=(-f*b-(1-a)*Q)/(f*f),k=o*A*_+h*c*w,T=-x*w,M=-x*k,R=-2*x*(u*(.5*_/d)-2*o*d*w),L=4*e/v;if(e>.222*v||t.175*v){if(r=(C+o*D(y*(1+l)-C*C))/(1+l),e>v/4)return[r,r];var N=r,F=.5*r;r=.5*(F+N),n=50;do{var O=r*(R+T*D(y-r*r))+M*S(r/I)-L;if(!O)break;O<0?F=r:N=r,r=.5*(F+N)}while(i(N-F)>m&&--n>0)}else{r=m,n=25;do{var P=r*r,G=D(y-P),U=R+T*G,z=r*U+M*S(r/I)-L;r-=B=G?z/(U+(M-T*P)/G):0}while(i(B)>m&&--n>0)}return[r,-C-o*D(y-r*r)]}(e>v/4?E-e:e,t);return e>v/4&&(c=u[0],u[0]=-u[1],u[1]=-c),u[0]*=r,u[1]*=-n,u}function kt(){return(0,n.c)(_t(St)).scale(239.75)}function Dt(e,t){var r,n,o,A,c,u;if(t=1-m)return r=(1-t)/4,o=1/(n=M(e)),[(A=((u=l(2*(u=e)))-1)/(u+1))+r*((c=n*T(e))-e)/(n*n),o-r*A*o*(c-e),o+r*A*o*(c+e),2*a(l(e))-E+r*(c-e)/n];var g=[1,0,0,0,0,0,0,0,0],f=[D(t),0,0,0,0,0,0,0,0],h=0;for(n=D(1-t),c=1;i(f[h]/g[h])>m&&h<8;)r=g[h++],f[h]=(r-n)/2,g[h]=(r+n)/2,n=D(r*n),c*=2;o=c*g[h]*e;do{o=(S(A=f[h]*p(n=o)/g[h])+o)/2}while(--h);return[p(o),A=s(o),A/s(o-n),o]}function Tt(e,t){if(!t)return e;if(1===t)return c(y(e/2+C));for(var r=1,n=D(1-t),o=D(t),s=0;i(o)>m;s++){if(e%v){var l=a(n*y(e)/r);l<0&&(l+=v),e+=l+~~(e/v)*v}else e+=e;o=(r+n)/2,n=D(r*n),o=((r=o)-n)/2}return e/(f(2,s)*r)}function Mt(e,t){var r=(b-1)/(b+1),n=D(1-r*r),A=Tt(E,n*n),u=c(y(v/4+i(t)/2)),g=l(-1*u)/D(r),f=function(e,t){var r=e*e,n=t+1,i=1-r-t*t;return[.5*((e>=0?E:-E)-o(i,2*e)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(g*s(-1*e),g*p(-1*e)),h=function(e,t,r){var n=i(e),o=T(i(t));if(n){var s=1/p(n),l=1/(y(n)*y(n)),A=-(l+r*(o*o*s*s)-1+r),c=(-A+D(A*A-(r-1)*l*4))/2;return[Tt(a(1/D(c)),r)*d(e),Tt(a(D((c/l-1)/r)),1-r)*d(t)]}return[0,Tt(a(o),1-r)*d(t)]}(f[0],f[1],n*n);return[-h[1],(t>=0?1:-1)*(.5*A-h[0])]}function Rt(){return(0,n.c)(_t(Mt)).scale(151.496)}St.invert=function(e,t){i(e)>1&&(e=2*d(e)-e),i(t)>1&&(t=2*d(t)-t);var r=d(e),n=d(t),a=-r*e,l=-n*t,A=l/a<1,c=function(e,t){for(var r=0,n=1,a=.5,o=50;;){var l=a*a,A=D(a),c=S(1/D(1+l)),u=1-l+a*(1+l)*c,g=(1-A)/u,f=D(g),h=g*(1+l),d=f*(1-l),p=D(h-e*e),y=t+d+a*p;if(i(n-r)0?r=a:n=a,a=.5*(r+n)}if(!o)return null;var m=S(A),E=s(m),C=1/E,B=2*A*E,b=(-u*E-(-3*a+c*(1+3*l))*B*(1-A))/(u*u),x=.5*b/f,w=(1-l)*x-2*a*f*B;return[v/4*(e*(-2*C*w+-C*B*p)+-C*(a*(1+l)*b+g*(1+3*l)*B)*S(e/D(h))),m]}(A?l:a,A?a:l),u=c[0],g=c[1],f=s(g);return A&&(u=-E-u),[r*(o(p(u)*f,-p(g))+v),n*S(s(u)*f)]},Mt.invert=function(e,t){var r=(b-1)/(b+1),n=D(1-r*r),i=function(e,t,r){var n,i,a;return e?(n=Dt(e,r),t?(a=(i=Dt(t,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=Dt(t,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*Tt(E,n*n)-t,-e,n*n),s=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(i[0],i[1]);return[o(s[1],s[0])/-1,2*a(l(-.5*c(r*s[0]*s[0]+r*s[1]*s[1])))-E]};var Lt=r(61780);function Nt(e){var t=p(e),r=s(e),n=Ft(e);function a(e,a){var o=n(e,a);e=o[0],a=o[1];var l=p(a),A=s(a),c=s(e),u=k(t*l+r*A*c),g=p(u),f=i(g)>m?u/g:1;return[f*r*p(e),(i(e)>E?f:-f)*(t*A-r*l*c)]}return n.invert=Ft(-e),a.invert=function(e,r){var i=D(e*e+r*r),a=-p(i),l=s(i),A=i*l,c=-r*a,u=i*t,g=D(A*A+c*c-u*u),f=o(A*u+c*g,c*u-A*g),h=(i>E?-1:1)*o(e*a,i*s(f)*l+r*p(f)*a);return n.invert(h,f)},a}function Ft(e){var t=p(e),r=s(e);return function(e,n){var i=s(n),a=s(e)*i,l=p(e)*i,A=p(n);return[o(l,a*r-A*t),S(A*r+a*t)]}}function Ot(){var e=0,t=(0,n.U)(Nt),r=t(e),i=r.rotate,a=r.stream,o=(0,Lt.c)();return r.parallel=function(n){if(!arguments.length)return e*Q;var i=r.rotate();return t(e=n*_).rotate(i)},r.rotate=function(t){return arguments.length?(i.call(r,[t[0],t[1]-e*Q]),o.center([-t[0],-t[1]]),r):((t=i.call(r))[1]+=e*Q,t)},r.stream=function(e){return(e=a(e)).sphere=function(){e.polygonStart();var t,r=o.radius(89.99)().coordinates[0],n=r.length-1,i=-1;for(e.lineStart();++i=0;)e.point((t=r[i])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},r.scale(79.4187).parallel(45).clipAngle(179.999)}var Pt=r(84706),Gt=r(16016),Ut=S(1-1/3)*Q,zt=Ne(0);function qt(e){var t=Ut*_,r=Se(v,t)[0]-Se(-v,t)[0],n=zt(0,t)[1],a=Se(0,t)[1],o=x-a,s=w/e,l=4/w,c=n+o*o*4/w;function f(f,h){var d,p=i(h);if(p>t){var y=g(e-1,u(0,A((f+v)/s)));(d=Se(f+=v*(e-1)/e-y*s,p))[0]=d[0]*w/r-w*(e-1)/(2*e)+y*w/e,d[1]=n+4*(d[1]-a)*o/w,h<0&&(d[1]=-d[1])}else d=zt(f,h);return d[0]*=l,d[1]/=c,d}return f.invert=function(t,f){t/=l;var h=i(f*=c);if(h>n){var d=g(e-1,u(0,A((t+v)/s)));t=(t+v*(e-1)/e-d*s)*r/w;var p=Se.invert(t,.25*(h-n)*w/o+a);return p[0]-=v*(e-1)/e-d*s,f<0&&(p[1]=-p[1]),p}return zt.invert(t,f)},f}function Ht(e,t){return[e,1&t?90-m:Ut]}function Yt(e,t){return[e,1&t?-90+m:-Ut]}function Jt(e){return[e[0]*(1-m),e[1]]}function Kt(){var e=4,t=(0,n.U)(qt),r=t(e),i=r.stream;return r.lobes=function(r){return arguments.length?t(e=+r):e},r.stream=function(t){var n=r.rotate(),a=i(t),o=(r.rotate([0,0]),i(t));return r.rotate(n),a.sphere=function(){(0,Gt.c)(function(e){var t=[].concat((0,Pt.ik)(-180,180+e/2,e).map(Ht),(0,Pt.ik)(180,-180-e/2,-e).map(Yt));return{type:"Polygon",coordinates:[180===e?t.map(Jt):t]}}(180/e),o)},a},r.scale(239.75)}function jt(e){var t,r=1+e,n=S(p(1/r)),a=2*D(v/(t=v+4*n*r)),l=.5*a*(r+D(e*(2+e))),A=e*e,c=r*r;function u(u,g){var f,h,d=1-p(g);if(d&&d<2){var y,m=E-g,C=25;do{var B=p(m),b=s(m),x=n+o(B,r-b),w=1+c-2*r*b;m-=y=(m-A*n-r*B+w*x-.5*d*t)/(2*r*B*x)}while(i(y)>I&&--C>0);f=a*D(w),h=u*x/v}else f=a*(e+d),h=u*n/v;return[f*p(h),l-f*s(h)]}return u.invert=function(e,i){var s=e*e+(i-=l)*i,u=(1+c-s/(a*a))/(2*r),g=k(u),f=p(g),h=n+o(f,r-u);return[S(e/D(s))*v/h,S(1-2*(g-A*n-r*f+(1+c-2*r*u)*h)/t)]},u}function Vt(){var e=1,t=(0,n.U)(jt),r=t(e);return r.ratio=function(r){return arguments.length?t(e=+r):e},r.scale(167.774).center([0,18.67])}var Wt=.7109889596207567,Zt=.0528035274542;function Xt(e,t){return t>-Wt?((e=ae(e,t))[1]+=Zt,e):ge(e,t)}function $t(){return(0,n.c)(Xt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function er(e,t){return i(t)>Wt?((e=ae(e,t))[1]-=t>0?Zt:-Zt,e):ge(e,t)}function tr(){return(0,n.c)(er).scale(152.63)}function rr(e,t,r,n){var i=D(4*v/(2*r+(1+e-t/2)*p(2*r)+(e+t)/2*p(4*r)+t/2*p(6*r))),a=D(n*p(r)*D((1+e*s(2*r)+t*s(4*r))/(1+e+t))),o=r*A(1);function l(r){return D(1+e*s(2*r)+t*s(4*r))}function A(n){var i=n*r;return(2*i+(1+e-t/2)*p(2*i)+(e+t)/2*p(4*i)+t/2*p(6*i))/r}function c(e){return l(e)*p(e)}var u=function(e,t){var n=r*$(A,o*p(t)/r,t/v);isNaN(n)&&(n=r*d(t));var c=i*l(n);return[c*a*e/v*s(n),c/a*p(n)]};return u.invert=function(e,t){var n=$(c,t*a/i);return[e*v/(s(n)*i*a*l(n)),S(r*A(n/r)/o)]},0===r&&(i=D(n/v),(u=function(e,t){return[e*i,p(t)/i]}).invert=function(e,t){return[e/i,S(t*i)]}),u}function nr(){var e=1,t=0,r=45*_,i=2,a=(0,n.U)(rr),o=a(e,t,r,i);return o.a=function(n){return arguments.length?a(e=+n,t,r,i):e},o.b=function(n){return arguments.length?a(e,t=+n,r,i):t},o.psiMax=function(n){return arguments.length?a(e,t,r=+n*_,i):r*Q},o.ratio=function(n){return arguments.length?a(e,t,r,i=+n):i},o.scale(180.739)}function ir(e,t,r,n,i,a,o,s,l,A,c){if(c.nanEncountered)return NaN;var u,g,f,h,d,p,y,m,I,v;if(g=e(t+.25*(u=r-t)),f=e(r-.25*u),isNaN(g))c.nanEncountered=!0;else{if(!isNaN(f))return v=((p=(h=u*(n+4*g+i)/12)+(d=u*(i+4*f+a)/12))-o)/15,A>l?(c.maxDepthCount++,p+v):Math.abs(v)e?r=n:t=n,n=t+r>>1}while(n>t);var i=A[n+1]-A[n];return i&&(i=(e-A[n+1])/i),(n+1+i)/s}var g=2*u(1)/v*o/r,h=function(e,t){var r=u(i(p(t))),a=n(r)*e;return r/=g,[a,t>=0?r:-r]};return h.invert=function(e,t){var r;return i(t*=g)<1&&(r=d(t)*S(a(i(t))*o)),[e/n(i(t)),r]},h}function sr(){var e=0,t=2.5,r=1.183136,i=(0,n.U)(or),a=i(e,t,r);return a.alpha=function(n){return arguments.length?i(e=+n,t,r):e},a.k=function(n){return arguments.length?i(e,t=+n,r):t},a.gamma=function(n){return arguments.length?i(e,t,r=+n):r},a.scale(152.63)}function lr(e,t){return i(e[0]-t[0])a[o][2][0];++o);var l=e(r-a[o][1][0],n);return l[0]+=e(a[o][1][0],i*n>i*a[o][0][1]?a[o][0][1]:n)[0],l}r?o.invert=r(o):e.invert&&(o.invert=function(r,n){for(var i=a[+(n<0)],s=t[+(n<0)],l=0,A=i.length;l=0;--s)r=(t=e[1][s])[0][0],n=t[0][1],i=t[1][1],a=t[2][0],o=t[2][1],l.push(Ar([[a-m,o-m],[a-m,i+m],[r+m,i+m],[r+m,n-m]],30));return{type:"Polygon",coordinates:[(0,Pt.Uf)(l)]}}(r),t=r.map((function(e){return e.map((function(e){return[[e[0][0]*_,e[0][1]*_],[e[1][0]*_,e[1][1]*_],[e[2][0]*_,e[2][1]*_]]}))})),a=t.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),s):t.map((function(e){return e.map((function(e){return[[e[0][0]*Q,e[0][1]*Q],[e[1][0]*Q,e[1][1]*Q],[e[2][0]*Q,e[2][1]*Q]]}))}))},null!=t&&s.lobes(t),s}Xt.invert=function(e,t){return t>-Wt?ae.invert(e,t-Zt):ge.invert(e,t)},er.invert=function(e,t){return i(t)>Wt?ae.invert(e,t+(t>0?Zt:-Zt)):ge.invert(e,t)};var ur=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function gr(){return cr(Ae,ur).scale(160.857)}var fr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function hr(){return cr(er,fr).scale(152.63)}var dr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function pr(){return cr(ae,dr).scale(169.529)}var yr=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function mr(){return cr(ae,yr).scale(169.529).rotate([20,0])}var Ir=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function vr(){return cr(Xt,Ir,ee).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Er=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function Cr(){return cr(ge,Er).scale(152.63).rotate([-20,0])}function Br(e,t){return[3/w*e*D(v*v/3-t*t),t]}function br(){return(0,n.c)(Br).scale(158.837)}function xr(e){function t(t,r){if(i(i(r)-E)2)return null;var a=(t/=2)*t,s=(r/=2)*r,l=2*r/(1+a+s);return l=f((1+l)/(1-l),1/e),[o(2*t,1-a-s)/e,S((l-1)/(l+1))]},t}function wr(){var e=.5,t=(0,n.U)(xr),r=t(e);return r.spacing=function(r){return arguments.length?t(e=+r):e},r.scale(124.75)}Br.invert=function(e,t){return[w/3*e/D(v*v/3-t*t),t]};var Qr=v/b;function _r(e,t){return[e*(1+D(s(t)))/2,t/(s(t/2)*s(e/6))]}function Sr(){return(0,n.c)(_r).scale(97.2672)}function kr(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function Dr(){return(0,n.c)(kr).scale(139.98)}function Tr(e,t){return[p(e)/s(t),y(t)*s(e)]}function Mr(){return(0,n.c)(Tr).scale(144.049).clipAngle(89.999)}function Rr(e){var t=s(e),r=y(C+e/2);function n(n,a){var o=a-e,s=i(o)=0;)g=(u=e[c])[0]+l*(i=g)-A*f,f=u[1]+l*f+A*i;return[g=l*(i=g)-A*f,f=l*f+A*i]}return r.invert=function(r,n){var l=20,A=r,c=n;do{for(var u,g=t,f=e[g],h=f[0],d=f[1],y=0,I=0;--g>=0;)y=h+A*(u=y)-c*I,I=d+A*I+c*u,h=(f=e[g])[0]+A*(u=h)-c*d,d=f[1]+A*d+c*u;var v,E,C=(y=h+A*(u=y)-c*I)*y+(I=d+A*I+c*u)*I;A-=v=((h=A*(u=h)-c*d-r)*y+(d=A*d+c*u-n)*I)/C,c-=E=(d*y-h*I)/C}while(i(v)+i(E)>m*m&&--l>0);if(l){var B=D(A*A+c*c),b=2*a(.5*B),x=p(b);return[o(A*x,B*s(b)),B?S(c*x/B):0]}},r}_r.invert=function(e,t){var r=i(e),n=i(t),a=m,o=E;nm||i(I)>m)&&--a>0);return a&&[r,n]},Tr.invert=function(e,t){var r=e*e,n=t*t+1,i=r+n,a=e?B*D((i-D(i*i-4*r))/r):1/D(n);return[S(e*a),d(t)*k(a)]},Nr.invert=function(e,t){return[e,2.5*a(l(.8*t))-.625*v]};var Pr=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Gr=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ur=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],zr=[[.9245,0],[0,0],[.01943,0]],qr=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Hr(){return Vr(Pr,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Yr(){return Vr(Gr,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Jr(){return Vr(Ur,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Kr(){return Vr(zr,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function jr(){return Vr(qr,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Vr(e,t){var r=(0,n.c)(Or(e)).rotate(t).clipAngle(90),i=(0,Ee.c)(t),a=r.center;return delete r.rotate,r.center=function(e){return arguments.length?a(i(e)):i.invert(a())},r}var Wr=D(6),Zr=D(7);function Xr(e,t){var r=S(7*p(t)/(3*Wr));return[Wr*e*(2*s(2*r/3)-1)/Zr,9*p(r/3)/Zr]}function $r(){return(0,n.c)(Xr).scale(164.859)}function en(e,t){for(var r,n=(1+B)*p(t),a=t,o=0;o<25&&(a-=r=(p(a/2)+p(a)-n)/(.5*s(a/2)+s(a)),!(i(r)I&&--l>0);return[e/(.84719-.13063*(n=s*s)+(o=n*(a=n*n))*o*(.05494*n-.04515-.02326*a+.00331*o)),s]},ln.invert=function(e,t){for(var r=t/2,n=0,a=1/0;n<10&&i(a)>m;++n){var o=s(t/2);t-=a=(t-y(t/2)-r)/(1-.5/(o*o))}return[2*e/(1+s(t)),t]};var cn=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function un(){return cr(W(1/0),cn).rotate([20,0]).scale(152.63)}function gn(e,t){var r=p(t),n=s(t),a=d(e);if(0===e||i(t)===E)return[0,t];if(0===t)return[e,0];if(i(e)===E)return[e*n,E*r];var o=v/(2*e)-2*e/v,l=2*t/v,A=(1-l*l)/(r-l),c=o*o,u=A*A,g=1+c/u,f=1+u/c,h=(o*r/A-o/2)/g,y=(u*r/c+A/2)/f,m=y*y-(u*r*r/c+A*r-1)/f;return[E*(h+D(h*h+n*n/g)*a),E*(y+D(m<0?0:m)*d(-t*o)*a)]}function fn(){return(0,n.c)(gn).scale(127.267)}gn.invert=function(e,t){var r=(e/=E)*e,n=r+(t/=E)*t,i=v*v;return[e?(n-1+D((1-n)*(1-n)+4*r))/(2*e)*E:0,$((function(e){return n*(v*p(e)-2*e)*v+4*e*e*(t-p(e))+2*v*e-i*t}),0)]};var hn=1.0148,dn=.23185,pn=-.14499,yn=.02406,mn=hn,In=5*dn,vn=7*pn,En=9*yn,Cn=1.790857183;function Bn(e,t){var r=t*t;return[e,t*(hn+r*r*(dn+r*(pn+yn*r)))]}function bn(){return(0,n.c)(Bn).scale(139.319)}function xn(e,t){if(i(t)Cn?t=Cn:t<-1.790857183&&(t=-1.790857183);var r,n=t;do{var a=n*n;n-=r=(n*(hn+a*a*(dn+a*(pn+yn*a)))-t)/(mn+a*a*(In+a*(vn+En*a)))}while(i(r)>m);return[e,n]},xn.invert=function(e,t){if(i(t)m&&--o>0);return l=y(a),[(i(t)=0;)if(n=t[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(t.face,r.face),i=Sn(n.map(r.project),n.map(t.project));t.transform=r.transform?kn(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o0?[-t[0],0]:[180-t[0],180])};var t=Pn.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,r){var n=t[e];n&&(n.children||(n.children=[])).push(t[r])})),Mn(t[0],(function(e,r){return t[e<-v/2?r<0?6:4:e<0?r<0?2:0:en^f>n&&r<(g-A)*(n-c)/(f-c)+A&&(i=!i)}return i}(e[0],r))return e.push(t),!0}))||e.push([t])})),ei=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function ii(e){var t=e(E,0)[0]-e(-E,0)[0];function r(r,n){var a=i(r)0?r-v:r+v,n),s=(o[0]-o[1])*B,l=(o[0]+o[1])*B;if(a)return[s,l];var A=t*B,c=s>0^l>0?-1:1;return[c*s-d(l)*A,c*l-d(s)*A]}return e.invert&&(r.invert=function(r,n){var a=(r+n)*B,o=(n-r)*B,s=i(a)<.5*t&&i(o)<.5*t;if(!s){var l=t*B,A=a>0^o>0?-1:1,c=-A*r+(o>0?1:-1)*l,u=-A*n+(a>0?1:-1)*l;a=(-c-u)*B,o=(c-u)*B}var g=e.invert(a,o);return s||(g[0]+=a>0?v:-v),g}),(0,n.c)(r).rotate([-90,-90,45]).clipAngle(179.999)}function ai(){return ii(St).scale(176.423)}function oi(){return ii(Mt).scale(111.48)}function si(e,t){if(!(0<=(t=+t)&&t<=20))throw new Error("invalid digits");function r(e){var r=e.length,n=2,i=new Array(r);for(i[0]=+e[0].toFixed(t),i[1]=+e[1].toFixed(t);n2||a[0]!=t[0]||a[1]!=t[1])&&(n.push(a),t=a)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function a(e){return e.map(i)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(e.coordinates)};break;case"LineString":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:a(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(a)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function s(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return s(e);case"FeatureCollection":var l={type:"FeatureCollection",features:e.features.map(s)};return null!=e.bbox&&(l.bbox=e.bbox),l;default:return o(e)}return e}function li(e){var t=p(e);function r(r,n){var i=t?y(r*t/2)/t:r/2;if(!n)return[2*i,-e];var o=2*a(i*p(n)),l=1/y(n);return[p(o)*l,n+(1-s(o))*l-e]}return r.invert=function(r,n){if(i(n+=e)m&&--c>0);var h=r*(u=y(A)),d=y(i(n)0?E:-E)*(u+o*(h-l)/2+o*o*(h-2*u+l)/2)]}function gi(){return(0,n.c)(ui).scale(152.63)}function fi(e,t){var r=function(e){function t(t,r){var n=s(r),i=(e-1)/(e-n*s(t));return[i*n*p(t),i*p(r)]}return t.invert=function(t,r){var n=t*t+r*r,i=D(n),a=(e-D(1-n*(e+1)/(e-1)))/((e-1)/i+i/(e-1));return[o(t*a,i*D(1-a*a)),i?S(r*a/i):0]},t}(e);if(!t)return r;var n=s(t),i=p(t);function a(t,a){var o=r(t,a),s=o[1],l=s*i/(e-1)+n;return[o[0]*n/l,s/l]}return a.invert=function(t,a){var o=(e-1)/(e-1-a*i);return r.invert(o*t,o*a*n)},a}function hi(){var e=2,t=0,r=(0,n.U)(fi),i=r(e,t);return i.distance=function(n){return arguments.length?r(e=+n,t):e},i.tilt=function(n){return arguments.length?r(e,t=n*_):t*Q},i.scale(432.147).clipAngle(k(1/e)*Q-1e-6)}ci.forEach((function(e){e[1]*=1.0144})),ui.invert=function(e,t){var r=t/E,n=90*r,a=g(18,i(n/5)),o=u(0,A(a));do{var s=ci[o][1],l=ci[o+1][1],c=ci[g(19,o+2)][1],f=c-s,h=c-2*l+s,d=2*(i(r)-l)/f,p=h/f,y=d*(1-p*d*(1-2*p*d));if(y>=0||1===o){n=(t>=0?5:-5)*(y+a);var m,v=50;do{y=(a=g(18,i(n)/5))-(o=A(a)),s=ci[o][1],l=ci[o+1][1],c=ci[g(19,o+2)][1],n-=(m=(t>=0?E:-E)*(l+y*(c-s)/2+y*y*(c-2*l+s)/2)-t)*Q}while(i(m)>I&&--v>0);break}}while(--o>=0);var C=ci[o][0],B=ci[o+1][0],b=ci[g(19,o+2)][0];return[e/(B+y*(b-C)/2+y*y*(b-2*B+C)/2),n*_]};var di=1e-4,pi=1e4,yi=-180,mi=yi+di,Ii=180,vi=Ii-di,Ei=-90,Ci=Ei+di,Bi=90,bi=Bi-di;function xi(e){return e.length>0}function wi(e){return e===Ei||e===Bi?[0,e]:[yi,(t=e,Math.floor(t*pi)/pi)];var t}function Qi(e){var t=e[0],r=e[1],n=!1;return t<=mi?(t=yi,n=!0):t>=vi&&(t=Ii,n=!0),r<=Ci?(r=Ei,n=!0):r>=bi&&(r=Bi,n=!0),n?[t,r]:e}function _i(e){return e.map(Qi)}function Si(e,t,r){for(var n=0,i=e.length;n=vi||c<=Ci||c>=bi){a[o]=Qi(l);for(var u=o+1;umi&&fCi&&h=s)break;r.push({index:-1,polygon:t,ring:a=a.slice(u-1)}),a[0]=wi(a[0][1]),o=-1,s=a.length}}}}function ki(e){var t,r,n,i,a,o,s=e.length,l={},A={};for(t=0;t0?v-l:l)*Q],c=(0,n.c)(e(s)).rotate(A),u=(0,Ee.c)(A),g=c.center;return delete c.rotate,c.center=function(e){return arguments.length?g(u(e)):u.invert(g())},c.clipAngle(90)}function Fi(e){var t=s(e);function r(e,r){var n=(0,Fn.Y)(e,r);return n[0]*=t,n}return r.invert=function(e,r){return Fn.Y.invert(e/t,r)},r}function Oi(){return Pi([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Pi(e,t){return Ni(Fi,e,t)}function Gi(e){if(!(e*=2))return J.O;var t=-e/2,r=-t,n=e*e,i=y(r),a=.5/p(r);function l(i,a){var o=k(s(a)*s(i-t)),l=k(s(a)*s(i-r));return[((o*=o)-(l*=l))/(2*e),(a<0?-1:1)*D(4*n*l-(n-o+l)*(n-o+l))/(2*e)]}return l.invert=function(e,n){var l,A,c=n*n,u=s(D(c+(l=e+t)*l)),g=s(D(c+(l=e+r)*l));return[o(A=u-g,l=(u+g)*i),(n<0?-1:1)*k(D(l*l+A*A)*a)]},l}function Ui(){return zi([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function zi(e,t){return Ni(Gi,e,t)}function qi(e,t){if(i(t)m&&--l>0);return[d(e)*(D(a*a+4)+a)*v/4,E*s]};var ea=4*v+3*D(3),ta=2*D(2*v*D(3)/ea),ra=ie(ta*D(3)/v,ta,ea/6);function na(){return(0,n.c)(ra).scale(176.84)}function ia(e,t){return[e*D(1-3*t*t/(v*v)),t]}function aa(){return(0,n.c)(ia).scale(152.63)}function oa(e,t){var r=s(t),n=s(e)*r,i=1-n,a=s(e=o(p(e)*r,-p(t))),l=p(e);return[l*(r=D(1-n*n))-a*i,-a*r-l*i]}function sa(){return(0,n.c)(oa).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)}function la(e,t){var r=N(e,t);return[(r[0]+e/E)/2,(r[1]+t)/2]}function Aa(){return(0,n.c)(la).scale(158.837)}ia.invert=function(e,t){return[e/D(1-3*t*t/(v*v)),t]},oa.invert=function(e,t){var r=(e*e+t*t)/-2,n=D(-r*(2+r)),i=t*r+e*n,a=e*r-t*n,s=D(a*a+i*i);return[o(n*i,s*(1+r)),s?-S(n*a/s):0]},la.invert=function(e,t){var r=e,n=t,a=25;do{var o,l=s(n),A=p(n),c=p(2*n),u=A*A,g=l*l,f=p(r),h=s(r/2),d=p(r/2),y=d*d,I=1-g*h*h,v=I?k(l*h)*D(o=1/I):o=0,C=.5*(2*v*l*d+r/E)-e,B=.5*(v*A+n)-t,b=.5*o*(g*y+v*l*h*u)+.5/E,x=o*(f*c/4-v*A*d),w=.125*o*(c*d-v*A*g*f),Q=.5*o*(u*h+v*y*l)+.5,_=x*w-Q*b,S=(B*x-C*Q)/_,T=(C*w-B*b)/_;r-=S,n-=T}while((i(S)>m||i(T)>m)&&--a>0);return[r,n]}},88728:function(e,t,r){"use strict";function n(){return new i}function i(){this.reset()}r.d(t,{c:function(){return n}}),i.prototype={constructor:i,reset:function(){this.s=this.t=0},add:function(e){o(a,e,this.t),o(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new i;function o(e,t,r){var n=e.s=t+r,i=n-t,a=n-i;e.t=t-a+(r-i)}},95384:function(e,t,r){"use strict";r.d(t,{cp:function(){return I},mQ:function(){return g},oB:function(){return h}});var n,i,a,o,s,l=r(88728),A=r(64528),c=r(70932),u=r(16016),g=(0,l.c)(),f=(0,l.c)(),h={point:c.c,lineStart:c.c,lineEnd:c.c,polygonStart:function(){g.reset(),h.lineStart=d,h.lineEnd=p},polygonEnd:function(){var e=+g;f.add(e<0?A.kD+e:e),this.lineStart=this.lineEnd=this.point=c.c},sphere:function(){f.add(A.kD)}};function d(){h.point=y}function p(){m(n,i)}function y(e,t){h.point=m,n=e,i=t,e*=A.qw,t*=A.qw,a=e,o=(0,A.W8)(t=t/2+A.wL),s=(0,A.g$)(t)}function m(e,t){e*=A.qw,t=(t*=A.qw)/2+A.wL;var r=e-a,n=r>=0?1:-1,i=n*r,l=(0,A.W8)(t),c=(0,A.g$)(t),u=s*c,f=o*l+u*(0,A.W8)(i),h=u*n*(0,A.g$)(i);g.add((0,A.WE)(h,f)),a=e,o=l,s=c}function I(e){return f.reset(),(0,u.c)(e,h),2*f}},13696:function(e,t,r){"use strict";r.d(t,{c:function(){return k}});var n,i,a,o,s,l,A,c,u,g,f=r(88728),h=r(95384),d=r(84220),p=r(64528),y=r(16016),m=(0,f.c)(),I={point:v,lineStart:C,lineEnd:B,polygonStart:function(){I.point=b,I.lineStart=x,I.lineEnd=w,m.reset(),h.oB.polygonStart()},polygonEnd:function(){h.oB.polygonEnd(),I.point=v,I.lineStart=C,I.lineEnd=B,h.mQ<0?(n=-(a=180),i=-(o=90)):m>p.Gg?o=90:m<-p.Gg&&(i=-90),g[0]=n,g[1]=a},sphere:function(){n=-(a=180),i=-(o=90)}};function v(e,t){u.push(g=[n=e,a=e]),to&&(o=t)}function E(e,t){var r=(0,d.ux)([e*p.qw,t*p.qw]);if(c){var l=(0,d.CW)(c,r),A=[l[1],-l[0],0],f=(0,d.CW)(A,l);(0,d.cJ)(f),f=(0,d.G)(f);var h,y=e-s,m=y>0?1:-1,I=f[0]*p.oh*m,v=(0,p.a2)(y)>180;v^(m*so&&(o=h):v^(m*s<(I=(I+360)%360-180)&&Io&&(o=t)),v?eQ(n,a)&&(a=e):Q(e,a)>Q(n,a)&&(n=e):a>=n?(ea&&(a=e)):e>s?Q(n,e)>Q(n,a)&&(a=e):Q(e,a)>Q(n,a)&&(n=e)}else u.push(g=[n=e,a=e]);to&&(o=t),c=r,s=e}function C(){I.point=E}function B(){g[0]=n,g[1]=a,I.point=v,c=null}function b(e,t){if(c){var r=e-s;m.add((0,p.a2)(r)>180?r+(r>0?360:-360):r)}else l=e,A=t;h.oB.point(e,t),E(e,t)}function x(){h.oB.lineStart()}function w(){b(l,A),h.oB.lineEnd(),(0,p.a2)(m)>p.Gg&&(n=-(a=180)),g[0]=n,g[1]=a,c=null}function Q(e,t){return(t-=e)<0?t+360:t}function _(e,t){return e[0]-t[0]}function S(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tQ(s[0],s[1])&&(s[1]=l[1]),Q(l[0],s[1])>Q(s[0],s[1])&&(s[0]=l[0])):A.push(s=l);for(c=-1/0,t=0,s=A[r=A.length-1];t<=r;s=l,++t)l=A[t],(f=Q(s[1],l[0]))>c&&(c=f,n=l[0],a=s[1])}return u=g=null,n===1/0||i===1/0?[[NaN,NaN],[NaN,NaN]]:[[n,i],[a,o]]}},84220:function(e,t,r){"use strict";r.d(t,{CW:function(){return s},Ez:function(){return o},G:function(){return i},cJ:function(){return c},mg:function(){return l},ux:function(){return a},wx:function(){return A}});var n=r(64528);function i(e){return[(0,n.WE)(e[1],e[0]),(0,n.qR)(e[2])]}function a(e){var t=e[0],r=e[1],i=(0,n.W8)(r);return[i*(0,n.W8)(t),i*(0,n.g$)(t),(0,n.g$)(r)]}function o(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function s(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function l(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function A(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function c(e){var t=(0,n._I)(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}},24052:function(e,t,r){"use strict";r.d(t,{c:function(){return M}});var n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I=r(64528),v=r(70932),E=r(16016),C={sphere:v.c,point:B,lineStart:x,lineEnd:_,polygonStart:function(){C.lineStart=S,C.lineEnd=k},polygonEnd:function(){C.lineStart=x,C.lineEnd=_}};function B(e,t){e*=I.qw,t*=I.qw;var r=(0,I.W8)(t);b(r*(0,I.W8)(e),r*(0,I.g$)(e),(0,I.g$)(t))}function b(e,t,r){++n,a+=(e-a)/n,o+=(t-o)/n,s+=(r-s)/n}function x(){C.point=w}function w(e,t){e*=I.qw,t*=I.qw;var r=(0,I.W8)(t);p=r*(0,I.W8)(e),y=r*(0,I.g$)(e),m=(0,I.g$)(t),C.point=Q,b(p,y,m)}function Q(e,t){e*=I.qw,t*=I.qw;var r=(0,I.W8)(t),n=r*(0,I.W8)(e),a=r*(0,I.g$)(e),o=(0,I.g$)(t),s=(0,I.WE)((0,I._I)((s=y*o-m*a)*s+(s=m*n-p*o)*s+(s=p*a-y*n)*s),p*n+y*a+m*o);i+=s,l+=s*(p+(p=n)),A+=s*(y+(y=a)),c+=s*(m+(m=o)),b(p,y,m)}function _(){C.point=B}function S(){C.point=D}function k(){T(h,d),C.point=B}function D(e,t){h=e,d=t,e*=I.qw,t*=I.qw,C.point=T;var r=(0,I.W8)(t);p=r*(0,I.W8)(e),y=r*(0,I.g$)(e),m=(0,I.g$)(t),b(p,y,m)}function T(e,t){e*=I.qw,t*=I.qw;var r=(0,I.W8)(t),n=r*(0,I.W8)(e),a=r*(0,I.g$)(e),o=(0,I.g$)(t),s=y*o-m*a,h=m*n-p*o,d=p*a-y*n,v=(0,I._I)(s*s+h*h+d*d),E=(0,I.qR)(v),C=v&&-E/v;u+=C*s,g+=C*h,f+=C*d,i+=E,l+=E*(p+(p=n)),A+=E*(y+(y=a)),c+=E*(m+(m=o)),b(p,y,m)}function M(e){n=i=a=o=s=l=A=c=u=g=f=0,(0,E.c)(e,C);var t=u,r=g,h=f,d=t*t+r*r+h*h;return d0?os)&&(o+=i*a.kD));for(var g,f=o;i>0?f>s:f0?i.pi:-i.pi,A=(0,i.a2)(o-r);(0,i.a2)(A-i.pi)0?i.or:-i.or),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),e.point(o,n),t=0):a!==l&&A>=i.pi&&((0,i.a2)(r-a)i.Gg?(0,i.MQ)(((0,i.g$)(t)*(o=(0,i.W8)(n))*(0,i.g$)(r)-(0,i.g$)(n)*(a=(0,i.W8)(t))*(0,i.g$)(e))/(a*o*s)):(t+n)/2}(r,n,o,s),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),t=0),e.point(r=o,n=s),a=l},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var a;if(null==e)a=r*i.or,n.point(-i.pi,a),n.point(0,a),n.point(i.pi,a),n.point(i.pi,0),n.point(i.pi,-a),n.point(0,-a),n.point(-i.pi,-a),n.point(-i.pi,0),n.point(-i.pi,a);else if((0,i.a2)(e[0]-t[0])>i.Gg){var o=e[0]1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}},2728:function(e,t,r){"use strict";r.d(t,{c:function(){return l}});var n=r(84220),i=r(61780),a=r(64528),o=r(41860),s=r(14229);function l(e){var t=(0,a.W8)(e),r=6*a.qw,l=t>0,A=(0,a.a2)(t)>a.Gg;function c(e,r){return(0,a.W8)(e)*(0,a.W8)(r)>t}function u(e,r,i){var o=(0,n.ux)(e),s=(0,n.ux)(r),l=[1,0,0],A=(0,n.CW)(o,s),c=(0,n.Ez)(A,A),u=A[0],g=c-u*u;if(!g)return!i&&e;var f=t*c/g,h=-t*u/g,d=(0,n.CW)(l,A),p=(0,n.wx)(l,f),y=(0,n.wx)(A,h);(0,n.mg)(p,y);var m=d,I=(0,n.Ez)(p,m),v=(0,n.Ez)(m,m),E=I*I-v*((0,n.Ez)(p,p)-1);if(!(E<0)){var C=(0,a._I)(E),B=(0,n.wx)(m,(-I-C)/v);if((0,n.mg)(B,p),B=(0,n.G)(B),!i)return B;var b,x=e[0],w=r[0],Q=e[1],_=r[1];w0^B[1]<((0,a.a2)(B[0]-x)a.pi^(x<=B[0]&&B[0]<=w)){var D=(0,n.wx)(m,(-I+C)/v);return(0,n.mg)(D,p),[B,(0,n.G)(D)]}}}function g(t,r){var n=l?e:a.pi-e,i=0;return t<-n?i|=1:t>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}return(0,s.c)(c,(function(e){var t,r,n,i,s;return{lineStart:function(){i=n=!1,s=1},point:function(f,h){var d,p=[f,h],y=c(f,h),m=l?y?0:g(f,h):y?g(f+(f<0?a.pi:-a.pi),h):0;if(!t&&(i=n=y)&&e.lineStart(),y!==n&&(!(d=u(t,p))||(0,o.c)(t,d)||(0,o.c)(p,d))&&(p[2]=1),y!==n)s=0,y?(e.lineStart(),d=u(p,t),e.point(d[0],d[1])):(d=u(t,p),e.point(d[0],d[1],2),e.lineEnd()),t=d;else if(A&&t&&l^y){var I;m&r||!(I=u(p,t,!0))||(s=0,l?(e.lineStart(),e.point(I[0][0],I[0][1]),e.point(I[1][0],I[1][1]),e.lineEnd()):(e.point(I[1][0],I[1][1]),e.lineEnd(),e.lineStart(),e.point(I[0][0],I[0][1],3)))}!y||t&&(0,o.c)(t,p)||e.point(p[0],p[1]),t=p,n=y,r=m},lineEnd:function(){n&&e.lineEnd(),t=null},clean:function(){return s|(i&&n)<<1}}}),(function(t,n,a,o){(0,i.Q)(o,e,r,a,t,n)}),l?[0,-e]:[-a.pi,e-a.pi])}},14229:function(e,t,r){"use strict";r.d(t,{c:function(){return l}});var n=r(97208),i=r(32232),a=r(64528),o=r(58196),s=r(84706);function l(e,t,r,a){return function(l){var u,g,f,h=t(l),d=(0,n.c)(),p=t(d),y=!1,m={point:I,lineStart:E,lineEnd:C,polygonStart:function(){m.point=B,m.lineStart=b,m.lineEnd=x,g=[],u=[]},polygonEnd:function(){m.point=I,m.lineStart=E,m.lineEnd=C,g=(0,s.Uf)(g);var e=(0,o.c)(u,a);g.length?(y||(l.polygonStart(),y=!0),(0,i.c)(g,c,e,r,l)):e&&(y||(l.polygonStart(),y=!0),l.lineStart(),r(null,null,1,l),l.lineEnd()),y&&(l.polygonEnd(),y=!1),g=u=null},sphere:function(){l.polygonStart(),l.lineStart(),r(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function I(t,r){e(t,r)&&l.point(t,r)}function v(e,t){h.point(e,t)}function E(){m.point=v,h.lineStart()}function C(){m.point=I,h.lineEnd()}function B(e,t){f.push([e,t]),p.point(e,t)}function b(){p.lineStart(),f=[]}function x(){B(f[0][0],f[0][1]),p.lineEnd();var e,t,r,n,i=p.clean(),a=d.result(),o=a.length;if(f.pop(),u.push(f),f=null,o)if(1&i){if((t=(r=a[0]).length-1)>0){for(y||(l.polygonStart(),y=!0),l.lineStart(),e=0;e1&&2&i&&a.push(a.pop().concat(a.shift())),g.push(a.filter(A))}return m}}function A(e){return e.length>1}function c(e,t){return((e=e.x)[0]<0?e[1]-a.or-a.Gg:a.or-e[1])-((t=t.x)[0]<0?t[1]-a.or-a.Gg:a.or-t[1])}},21676:function(e,t,r){"use strict";r.d(t,{c:function(){return A}});var n=r(64528),i=r(97208),a=r(32232),o=r(84706),s=1e9,l=-s;function A(e,t,r,A){function c(n,i){return e<=n&&n<=r&&t<=i&&i<=A}function u(n,i,a,o){var s=0,l=0;if(null==n||(s=g(n,a))!==(l=g(i,a))||h(n,i)<0^a>0)do{o.point(0===s||3===s?e:r,s>1?A:t)}while((s=(s+a+4)%4)!==l);else o.point(i[0],i[1])}function g(i,a){return(0,n.a2)(i[0]-e)0?0:3:(0,n.a2)(i[0]-r)0?2:1:(0,n.a2)(i[1]-t)0?1:0:a>0?3:2}function f(e,t){return h(e.x,t.x)}function h(e,t){var r=g(e,1),n=g(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(n){var g,h,d,p,y,m,I,v,E,C,B,b=n,x=(0,i.c)(),w={point:Q,lineStart:function(){w.point=_,h&&h.push(d=[]),C=!0,E=!1,I=v=NaN},lineEnd:function(){g&&(_(p,y),m&&E&&x.rejoin(),g.push(x.result())),w.point=Q,E&&b.lineEnd()},polygonStart:function(){b=x,g=[],h=[],B=!0},polygonEnd:function(){var t=function(){for(var t=0,r=0,n=h.length;rA&&(u-i)*(A-a)>(g-a)*(e-i)&&++t:g<=A&&(u-i)*(A-a)<(g-a)*(e-i)&&--t;return t}(),r=B&&t,i=(g=(0,o.Uf)(g)).length;(r||i)&&(n.polygonStart(),r&&(n.lineStart(),u(null,null,1,n),n.lineEnd()),i&&(0,a.c)(g,f,t,u,n),n.polygonEnd()),b=n,g=h=d=null}};function Q(e,t){c(e,t)&&b.point(e,t)}function _(n,i){var a=c(n,i);if(h&&d.push([n,i]),C)p=n,y=i,m=a,C=!1,a&&(b.lineStart(),b.point(n,i));else if(a&&E)b.point(n,i);else{var o=[I=Math.max(l,Math.min(s,I)),v=Math.max(l,Math.min(s,v))],u=[n=Math.max(l,Math.min(s,n)),i=Math.max(l,Math.min(s,i))];!function(e,t,r,n,i,a){var o,s=e[0],l=e[1],A=0,c=1,u=t[0]-s,g=t[1]-l;if(o=r-s,u||!(o>0)){if(o/=u,u<0){if(o0){if(o>c)return;o>A&&(A=o)}if(o=i-s,u||!(o<0)){if(o/=u,u<0){if(o>c)return;o>A&&(A=o)}else if(u>0){if(o0)){if(o/=g,g<0){if(o0){if(o>c)return;o>A&&(A=o)}if(o=a-l,g||!(o<0)){if(o/=g,g<0){if(o>c)return;o>A&&(A=o)}else if(g>0){if(o0&&(e[0]=s+A*u,e[1]=l+A*g),c<1&&(t[0]=s+c*u,t[1]=l+c*g),!0}}}}}(o,u,e,t,r,A)?a&&(b.lineStart(),b.point(n,i),B=!1):(E||(b.lineStart(),b.point(o[0],o[1])),b.point(u[0],u[1]),a||b.lineEnd(),B=!1)}I=n,v=i,E=a}return w}}},32232:function(e,t,r){"use strict";r.d(t,{c:function(){return o}});var n=r(41860),i=r(64528);function a(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function o(e,t,r,o,l){var A,c,u=[],g=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,r,o=e[0],s=e[t];if((0,n.c)(o,s)){if(!o[2]&&!s[2]){for(l.lineStart(),A=0;A=0;--A)l.point((h=f[A])[0],h[1]);else o(p.x,p.p.x,-1,l);p=p.p}f=(p=p.o).z,y=!y}while(!p.v);l.lineEnd()}}}function s(e){if(t=e.length){for(var t,r,n=0,i=e[0];++n0&&(i=Q(e[a],e[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))p.Gg})).map(l)).concat((0,F.ik)((0,p.Km)(a/f)*f,i,f).filter((function(e){return(0,p.a2)(e%d)>p.Gg})).map(A))}return m.lines=function(){return I().map((function(e){return{type:"LineString",coordinates:e}}))},m.outline=function(){return{type:"Polygon",coordinates:[c(n).concat(u(o).slice(1),c(r).reverse().slice(1),u(s).reverse().slice(1))]}},m.extent=function(e){return arguments.length?m.extentMajor(e).extentMinor(e):m.extentMinor()},m.extentMajor=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),m.precision(y)):[[n,s],[r,o]]},m.extentMinor=function(r){return arguments.length?(t=+r[0][0],e=+r[1][0],a=+r[0][1],i=+r[1][1],t>e&&(r=t,t=e,e=r),a>i&&(r=a,a=i,i=r),m.precision(y)):[[t,a],[e,i]]},m.step=function(e){return arguments.length?m.stepMajor(e).stepMinor(e):m.stepMinor()},m.stepMajor=function(e){return arguments.length?(h=+e[0],d=+e[1],m):[h,d]},m.stepMinor=function(e){return arguments.length?(g=+e[0],f=+e[1],m):[g,f]},m.precision=function(g){return arguments.length?(y=+g,l=O(a,i,90),A=P(t,e,y),c=O(s,o,90),u=P(n,r,y),m):y},m.extentMajor([[-180,-90+p.Gg],[180,90-p.Gg]]).extentMinor([[-180,-80-p.Gg],[180,80+p.Gg]])}function U(){return G()()}var z,q,H,Y,J=r(27284),K=r(7376),j=(0,d.c)(),V=(0,d.c)(),W={point:y.c,lineStart:y.c,lineEnd:y.c,polygonStart:function(){W.lineStart=Z,W.lineEnd=ee},polygonEnd:function(){W.lineStart=W.lineEnd=W.point=y.c,j.add((0,p.a2)(V)),V.reset()},result:function(){var e=j/2;return j.reset(),e}};function Z(){W.point=X}function X(e,t){W.point=$,z=H=e,q=Y=t}function $(e,t){V.add(Y*e-H*t),H=e,Y=t}function ee(){$(z,q)}var te,re,ne,ie,ae=W,oe=r(73784),se=0,le=0,Ae=0,ce=0,ue=0,ge=0,fe=0,he=0,de=0,pe={point:ye,lineStart:me,lineEnd:Ee,polygonStart:function(){pe.lineStart=Ce,pe.lineEnd=Be},polygonEnd:function(){pe.point=ye,pe.lineStart=me,pe.lineEnd=Ee},result:function(){var e=de?[fe/de,he/de]:ge?[ce/ge,ue/ge]:Ae?[se/Ae,le/Ae]:[NaN,NaN];return se=le=Ae=ce=ue=ge=fe=he=de=0,e}};function ye(e,t){se+=e,le+=t,++Ae}function me(){pe.point=Ie}function Ie(e,t){pe.point=ve,ye(ne=e,ie=t)}function ve(e,t){var r=e-ne,n=t-ie,i=(0,p._I)(r*r+n*n);ce+=i*(ne+e)/2,ue+=i*(ie+t)/2,ge+=i,ye(ne=e,ie=t)}function Ee(){pe.point=ye}function Ce(){pe.point=be}function Be(){xe(te,re)}function be(e,t){pe.point=xe,ye(te=ne=e,re=ie=t)}function xe(e,t){var r=e-ne,n=t-ie,i=(0,p._I)(r*r+n*n);ce+=i*(ne+e)/2,ue+=i*(ie+t)/2,ge+=i,fe+=(i=ie*e-ne*t)*(ne+e),he+=i*(ie+t),de+=3*i,ye(ne=e,ie=t)}var we=pe;function Qe(e){this._context=e}Qe.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,p.kD)}},result:y.c};var _e,Se,ke,De,Te,Me=(0,d.c)(),Re={point:y.c,lineStart:function(){Re.point=Le},lineEnd:function(){_e&&Ne(Se,ke),Re.point=y.c},polygonStart:function(){_e=!0},polygonEnd:function(){_e=null},result:function(){var e=+Me;return Me.reset(),e}};function Le(e,t){Re.point=Ne,Se=De=e,ke=Te=t}function Ne(e,t){De-=e,Te-=t,Me.add((0,p._I)(De*De+Te*Te)),De=e,Te=t}var Fe=Re;function Oe(){this._string=[]}function Pe(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Ge(e,t){var r,n,i=4.5;function a(e){return e&&("function"===typeof i&&n.pointRadius(+i.apply(this,arguments)),(0,m.c)(e,r(n))),n.result()}return a.area=function(e){return(0,m.c)(e,r(ae)),ae.result()},a.measure=function(e){return(0,m.c)(e,r(Fe)),Fe.result()},a.bounds=function(e){return(0,m.c)(e,r(oe.c)),oe.c.result()},a.centroid=function(e){return(0,m.c)(e,r(we)),we.result()},a.projection=function(t){return arguments.length?(r=null==t?(e=null,K.c):(e=t).stream,a):e},a.context=function(e){return arguments.length?(n=null==e?(t=null,new Oe):new Qe(t=e),"function"!==typeof i&&n.pointRadius(i),a):t},a.pointRadius=function(e){return arguments.length?(i="function"===typeof e?e:(n.pointRadius(+e),+e),a):i},a.projection(e).context(t)}Oe.prototype={_radius:4.5,_circle:Pe(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=Pe(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}};var Ue=r(87952);function ze(e){var t=0,r=p.pi/3,n=(0,Ue.U)(e),i=n(t,r);return i.parallels=function(e){return arguments.length?n(t=e[0]*p.qw,r=e[1]*p.qw):[t*p.oh,r*p.oh]},i}function qe(e,t){var r=(0,p.g$)(e),n=(r+(0,p.g$)(t))/2;if((0,p.a2)(n)=.12&&i<.234&&n>=-.425&&n<-.214?s:i>=.166&&i<.234&&n>=-.214&&n<-.115?l:o).invert(e)},c.stream=function(r){return e&&t===r?e:e=function(e){var t=e.length;return{point:function(r,n){for(var i=-1;++i0?t<-p.or+p.Gg&&(t=-p.or+p.Gg):t>p.or-p.Gg&&(t=p.or-p.Gg);var r=i/(0,p.g3)(et(t),n);return[r*(0,p.g$)(n*e),i-r*(0,p.W8)(n*e)]}return a.invert=function(e,t){var r=i-t,a=(0,p.kq)(n)*(0,p._I)(e*e+r*r),o=(0,p.WE)(e,(0,p.a2)(r))*(0,p.kq)(r);return r*n<0&&(o-=p.pi*(0,p.kq)(e)*(0,p.kq)(r)),[o/n,2*(0,p.MQ)((0,p.g3)(i/a,1/n))-p.or]},a}function rt(){return ze(tt).scale(109.5).parallels([30,30])}Ze.invert=function(e,t){return[e,2*(0,p.MQ)((0,p.oN)(t))-p.or]};var nt=r(69604);function it(e,t){var r=(0,p.W8)(e),n=e===t?(0,p.g$)(e):(r-(0,p.W8)(t))/(t-e),i=r/n+e;if((0,p.a2)(n)2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)}It.invert=(0,mt.g)((function(e){return 2*(0,p.MQ)(e)})),Et.invert=function(e,t){return[-t,2*(0,p.MQ)((0,p.oN)(e))-p.or]}},27284:function(e,t,r){"use strict";r.d(t,{c:function(){return i}});var n=r(64528);function i(e,t){var r=e[0]*n.qw,i=e[1]*n.qw,a=t[0]*n.qw,o=t[1]*n.qw,s=(0,n.W8)(i),l=(0,n.g$)(i),A=(0,n.W8)(o),c=(0,n.g$)(o),u=s*(0,n.W8)(r),g=s*(0,n.g$)(r),f=A*(0,n.W8)(a),h=A*(0,n.g$)(a),d=2*(0,n.qR)((0,n._I)((0,n.SD)(o-i)+s*A*(0,n.SD)(a-r))),p=(0,n.g$)(d),y=d?function(e){var t=(0,n.g$)(e*=d)/p,r=(0,n.g$)(d-e)/p,i=r*u+t*f,a=r*g+t*h,o=r*l+t*c;return[(0,n.WE)(a,i)*n.oh,(0,n.WE)(o,(0,n._I)(i*i+a*a))*n.oh]}:function(){return[r*n.oh,i*n.oh]};return y.distance=d,y}},64528:function(e,t,r){"use strict";r.d(t,{Gg:function(){return n},Km:function(){return d},MQ:function(){return g},SD:function(){return x},W8:function(){return h},WE:function(){return f},Yz:function(){return y},_I:function(){return E},a2:function(){return u},a6:function(){return C},a8:function(){return i},g$:function(){return I},g3:function(){return m},kD:function(){return l},kq:function(){return v},mE:function(){return B},oN:function(){return p},oh:function(){return A},or:function(){return o},pi:function(){return a},qR:function(){return b},qw:function(){return c},wL:function(){return s}});var n=1e-6,i=1e-12,a=Math.PI,o=a/2,s=a/4,l=2*a,A=180/a,c=a/180,u=Math.abs,g=Math.atan,f=Math.atan2,h=Math.cos,d=Math.ceil,p=Math.exp,y=(Math.floor,Math.log),m=Math.pow,I=Math.sin,v=Math.sign||function(e){return e>0?1:e<0?-1:0},E=Math.sqrt,C=Math.tan;function B(e){return e>1?0:e<-1?a:Math.acos(e)}function b(e){return e>1?o:e<-1?-o:Math.asin(e)}function x(e){return(e=I(e/2))*e}},70932:function(e,t,r){"use strict";function n(){}r.d(t,{c:function(){return n}})},73784:function(e,t,r){"use strict";var n=r(70932),i=1/0,a=i,o=-i,s=o,l={point:function(e,t){eo&&(o=e),ts&&(s=t)},lineStart:n.c,lineEnd:n.c,polygonStart:n.c,polygonEnd:n.c,result:function(){var e=[[i,a],[o,s]];return o=s=-(a=i=1/0),e}};t.c=l},41860:function(e,t,r){"use strict";r.d(t,{c:function(){return i}});var n=r(64528);function i(e,t){return(0,n.a2)(e[0]-t[0])=0?1:-1,S=_*Q,k=S>a.pi,D=I*x;if(o.add((0,a.WE)(D*_*(0,a.g$)(S),v*w+D*(0,a.W8)(S))),c+=k?Q+_*a.kD:Q,k^y>=r^B>=r){var T=(0,i.CW)((0,i.ux)(p),(0,i.ux)(C));(0,i.cJ)(T);var M=(0,i.CW)(A,T);(0,i.cJ)(M);var R=(k^Q>=0?-1:1)*(0,a.qR)(M[2]);(n>R||n===R&&(T[0]||T[1]))&&(u+=k^Q>=0?1:-1)}}return(c<-a.Gg||c4*t&&y--){var C=o+f,B=s+d,b=A+p,x=(0,l._I)(C*C+B*B+b*b),w=(0,l.qR)(b/=x),Q=(0,l.a2)((0,l.a2)(b)-1)t||(0,l.a2)((I*D+v*T)/E-.5)>.3||o*f+s*d+A*p2?e[2]%360*l.qw:0,z()):[S*l.oh,k*l.oh,D*l.oh]},G.angle=function(e){return arguments.length?(T=e%360*l.qw,z()):T*l.oh},G.reflectX=function(e){return arguments.length?(M=e?-1:1,z()):M<0},G.reflectY=function(e){return arguments.length?(R=e?-1:1,z()):R<0},G.precision=function(e){return arguments.length?(I=d(v,P=e*e),q()):(0,l._I)(P)},G.fitExtent=function(e,t){return(0,u.QX)(G,e,t)},G.fitSize=function(e,t){return(0,u.UV)(G,e,t)},G.fitWidth=function(e,t){return(0,u.Qx)(G,e,t)},G.fitHeight=function(e,t){return(0,u.OW)(G,e,t)},function(){return t=e.apply(this,arguments),G.invert=t.invert&&U,z()}}},47984:function(e,t,r){"use strict";r.d(t,{c:function(){return o},g:function(){return a}});var n=r(87952),i=r(64528);function a(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function o(){return(0,n.c)(a).scale(175.295)}a.invert=function(e,t){var r,n=t,a=25;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-t)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while((0,i.a2)(r)>i.Gg&&--a>0);return[e/(.8707+(o=n*n)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),n]}},4888:function(e,t,r){"use strict";r.d(t,{c:function(){return s},t:function(){return o}});var n=r(64528),i=r(62280),a=r(87952);function o(e,t){return[(0,n.W8)(t)*(0,n.g$)(e),(0,n.g$)(t)]}function s(){return(0,a.c)(o).scale(249.5).clipAngle(90+n.Gg)}o.invert=(0,i.g)(n.qR)},92992:function(e,t,r){"use strict";r.d(t,{O:function(){return o},c:function(){return c}});var n=r(68120),i=r(64528);function a(e,t){return[(0,i.a2)(e)>i.pi?e+Math.round(-e/i.kD)*i.kD:e,t]}function o(e,t,r){return(e%=i.kD)?t||r?(0,n.c)(l(e),A(t,r)):l(e):t||r?A(t,r):a}function s(e){return function(t,r){return[(t+=e)>i.pi?t-i.kD:t<-i.pi?t+i.kD:t,r]}}function l(e){var t=s(e);return t.invert=s(-e),t}function A(e,t){var r=(0,i.W8)(e),n=(0,i.g$)(e),a=(0,i.W8)(t),o=(0,i.g$)(t);function s(e,t){var s=(0,i.W8)(t),l=(0,i.W8)(e)*s,A=(0,i.g$)(e)*s,c=(0,i.g$)(t),u=c*r+l*n;return[(0,i.WE)(A*a-u*o,l*r-c*n),(0,i.qR)(u*a+A*o)]}return s.invert=function(e,t){var s=(0,i.W8)(t),l=(0,i.W8)(e)*s,A=(0,i.g$)(e)*s,c=(0,i.g$)(t),u=c*a-A*o;return[(0,i.WE)(A*a+c*o,l*r+u*n),(0,i.qR)(u*r-l*n)]},s}function c(e){function t(t){return(t=e(t[0]*i.qw,t[1]*i.qw))[0]*=i.oh,t[1]*=i.oh,t}return e=o(e[0]*i.qw,e[1]*i.qw,e.length>2?e[2]*i.qw:0),t.invert=function(t){return(t=e.invert(t[0]*i.qw,t[1]*i.qw))[0]*=i.oh,t[1]*=i.oh,t},t}a.invert=a},16016:function(e,t,r){"use strict";function n(e,t){e&&a.hasOwnProperty(e.type)&&a[e.type](e,t)}r.d(t,{c:function(){return l}});var i={Feature:function(e,t){n(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,i=-1,a=r.length;++i=0;)t+=r[n].value;else t=1;e.value=t}function l(e,t){var r,n,i,a,o,s=new g(e),l=+e.value&&(s.value=e.value),c=[s];for(null==t&&(t=A);r=c.pop();)if(l&&(r.value=+r.data.value),(i=t(r.data))&&(o=i.length))for(r.children=new Array(o),a=o-1;a>=0;--a)c.push(n=r.children[a]=new g(i[a])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(u)}function A(e){return e.children}function c(e){e.data=e.data.data}function u(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function g(e){this.data=e,this.depth=this.height=0,this.parent=null}r.r(t),r.d(t,{cluster:function(){return o},hierarchy:function(){return l},pack:function(){return T},packEnclose:function(){return h},packSiblings:function(){return Q},partition:function(){return O},stratify:function(){return H},tree:function(){return Z},treemap:function(){return re},treemapBinary:function(){return ne},treemapDice:function(){return F},treemapResquarify:function(){return ae},treemapSlice:function(){return X},treemapSliceDice:function(){return ie},treemapSquarify:function(){return te}}),g.prototype=l.prototype={constructor:g,count:function(){return this.eachAfter(s)},each:function(e){var t,r,n,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return l(this).eachBefore(c)}};var f=Array.prototype.slice;function h(e){for(var t,r,n=0,i=(e=function(e){for(var t,r,n=e.length;n;)r=Math.random()*n--|0,t=e[n],e[n]=e[r],e[r]=t;return e}(f.call(e))).length,a=[];n0&&r*r>n*n+i*i}function m(e,t){for(var r=0;r(o*=o)?(n=(A+o-i)/(2*A),a=Math.sqrt(Math.max(0,o/A-n*n)),r.x=e.x-n*s-a*l,r.y=e.y-n*l+a*s):(n=(A+i-o)/(2*A),a=Math.sqrt(Math.max(0,i/A-n*n)),r.x=t.x+n*s-a*l,r.y=t.y+n*l+a*s)):(r.x=t.x+r.r,r.y=t.y)}function B(e,t){var r=e.r+t.r-1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function b(e){var t=e._,r=e.next._,n=t.r+r.r,i=(t.x*r.r+r.x*t.r)/n,a=(t.y*r.r+r.y*t.r)/n;return i*i+a*a}function x(e){this._=e,this.next=null,this.previous=null}function w(e){if(!(i=e.length))return 0;var t,r,n,i,a,o,s,l,A,c,u;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(i>2))return t.r+r.r;C(r,t,n=e[2]),t=new x(t),r=new x(r),n=new x(n),t.next=n.previous=r,r.next=t.previous=n,n.next=r.previous=t;e:for(s=3;s0)throw new Error("cycle");return a}return r.id=function(t){return arguments.length?(e=_(t),r):e},r.parentId=function(e){return arguments.length?(t=_(e),r):t},r}function Y(e,t){return e.parent===t.parent?1:2}function J(e){var t=e.children;return t?t[0]:e.t}function K(e){var t=e.children;return t?t[t.length-1]:e.t}function j(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function V(e,t,r){return e.a.parent===t.parent?e.a:r}function W(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function Z(){var e=Y,t=1,r=1,n=null;function i(i){var l=function(e){for(var t,r,n,i,a,o=new W(e,0),s=[o];t=s.pop();)if(n=t._.children)for(t.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=t.children[i]=new W(n[i],i)),r.parent=t;return(o.parent=new W(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var A=i,c=i,u=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>u.depth&&(u=e)}));var g=A===c?1:e(A,c)/2,f=g-A.x,h=t/(c.x+g+f),d=r/(u.depth||1);i.eachBefore((function(e){e.x=(e.x+f)*h,e.y=e.depth*d}))}return i}function a(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],A=a.m,c=o.m,u=s.m,g=l.m;s=K(s),a=J(a),s&&a;)l=J(l),(o=K(o)).a=t,(i=s.z+u-a.z-A+e(s._,a._))>0&&(j(V(s,t,n),t,i),A+=i,c+=i),u+=s.m,A+=a.m,g+=l.m,c+=o.m;s&&!K(o)&&(o.t=s,o.m+=u-c),a&&!J(l)&&(l.t=a,l.m+=A-g,n=t)}return n}(t,i,t.parent.A||n[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],i):n?null:[t,r]},i.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],i):n?[t,r]:null},i}function X(e,t,r,n,i){for(var a,o=e.children,s=-1,l=o.length,A=e.value&&(i-r)/e.value;++sg&&(g=s),p=c*c*d,(f=Math.max(g/p,p/u))>h){c-=s;break}h=f}y.push(o={value:c,dice:l1?t:1)},r}($);function re(){var e=te,t=!1,r=1,n=1,i=[0],a=S,o=S,s=S,l=S,A=S;function c(e){return e.x0=e.y0=0,e.x1=r,e.y1=n,e.eachBefore(u),i=[0],t&&e.eachBefore(N),e}function u(t){var r=i[t.depth],n=t.x0+r,c=t.y0+r,u=t.x1-r,g=t.y1-r;u=r-1){var c=s[t];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=l)}for(var u=A[t],g=n/2+u,f=t+1,h=r-1;f>>1;A[d]l-a){var m=(i*y+o*p)/n;e(t,f,p,i,a,m,l),e(f,r,y,m,a,o,l)}else{var I=(a*y+l*p)/n;e(t,f,p,i,a,o,I),e(f,r,y,i,I,o,l)}}(0,l,e.value,t,r,n,i)}function ie(e,t,r,n,i){(1&e.depth?X:F)(e,t,r,n,i)}var ae=function e(t){function r(e,r,n,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,l,A,c,u=-1,g=o.length,f=e.value;++u1?t:1)},r}($)},10132:function(e,t,r){"use strict";r.d(t,{ak:function(){return m}});var n=Math.PI,i=2*n,a=1e-6,o=i-a;function s(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function l(){return new s}s.prototype=l.prototype={constructor:s,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,i,a){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,r,i,o){e=+e,t=+t,r=+r,i=+i,o=+o;var s=this._x1,l=this._y1,A=r-e,c=i-t,u=s-e,g=l-t,f=u*u+g*g;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(f>a)if(Math.abs(g*A-c*u)>a&&o){var h=r-s,d=i-l,p=A*A+c*c,y=h*h+d*d,m=Math.sqrt(p),I=Math.sqrt(f),v=o*Math.tan((n-Math.acos((p+f-y)/(2*m*I)))/2),E=v/I,C=v/m;Math.abs(E-1)>a&&(this._+="L"+(e+E*u)+","+(t+E*g)),this._+="A"+o+","+o+",0,0,"+ +(g*h>u*d)+","+(this._x1=e+C*A)+","+(this._y1=t+C*c)}else this._+="L"+(this._x1=e)+","+(this._y1=t)},arc:function(e,t,r,s,l,A){e=+e,t=+t,A=!!A;var c=(r=+r)*Math.cos(s),u=r*Math.sin(s),g=e+c,f=t+u,h=1^A,d=A?s-l:l-s;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+g+","+f:(Math.abs(this._x1-g)>a||Math.abs(this._y1-f)>a)&&(this._+="L"+g+","+f),r&&(d<0&&(d=d%i+i),d>o?this._+="A"+r+","+r+",0,1,"+h+","+(e-c)+","+(t-u)+"A"+r+","+r+",0,1,"+h+","+(this._x1=g)+","+(this._y1=f):d>a&&(this._+="A"+r+","+r+",0,"+ +(d>=n)+","+h+","+(this._x1=e+r*Math.cos(l))+","+(this._y1=t+r*Math.sin(l))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};var A=l,c=Array.prototype.slice;function u(e){return function(){return e}}function g(e){return e[0]}function f(e){return e[1]}function h(e){return e.source}function d(e){return e.target}function p(e){var t=h,r=d,n=g,i=f,a=null;function o(){var o,s=c.call(arguments),l=t.apply(this,s),u=r.apply(this,s);if(a||(a=o=A()),e(a,+n.apply(this,(s[0]=l,s)),+i.apply(this,s),+n.apply(this,(s[0]=u,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(r=e,o):r},o.x=function(e){return arguments.length?(n="function"===typeof e?e:u(+e),o):n},o.y=function(e){return arguments.length?(i="function"===typeof e?e:u(+e),o):i},o.context=function(e){return arguments.length?(a=null==e?null:e,o):a},o}function y(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function m(){return p(y)}},94336:function(e,t,r){"use strict";r.d(t,{Yn:function(){return h},m_:function(){return g},E9:function(){return d}});var n=r(8208),i=r(58931),a=r(46192),o=r(68936),s=r(32171),l=r(53528);function A(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function c(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function u(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function g(e){var t=e.dateTime,r=e.date,s=e.time,l=e.periods,g=e.days,f=e.shortDays,h=e.months,d=e.shortMonths,y=C(l),m=B(l),I=C(g),v=B(g),E=C(f),Qe=B(f),_e=C(h),Se=B(h),ke=C(d),De=B(d),Te={a:function(e){return f[e.getDay()]},A:function(e){return g[e.getDay()]},b:function(e){return d[e.getMonth()]},B:function(e){return h[e.getMonth()]},c:null,d:H,e:H,f:V,H:Y,I:J,j:K,L:j,m:W,M:Z,p:function(e){return l[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:xe,s:we,S:X,u:$,U:ee,V:te,w:re,W:ne,x:null,X:null,y:ie,Y:ae,Z:oe,"%":be},Me={a:function(e){return f[e.getUTCDay()]},A:function(e){return g[e.getUTCDay()]},b:function(e){return d[e.getUTCMonth()]},B:function(e){return h[e.getUTCMonth()]},c:null,d:se,e:se,f:ge,H:le,I:Ae,j:ce,L:ue,m:fe,M:he,p:function(e){return l[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:xe,s:we,S:de,u:pe,U:ye,V:me,w:Ie,W:ve,x:null,X:null,y:Ee,Y:Ce,Z:Be,"%":be},Re={a:function(e,t,r){var n=E.exec(t.slice(r));return n?(e.w=Qe[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=I.exec(t.slice(r));return n?(e.w=v[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=ke.exec(t.slice(r));return n?(e.m=De[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=_e.exec(t.slice(r));return n?(e.m=Se[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,r,n){return Fe(e,t,r,n)},d:R,e:R,f:G,H:N,I:N,j:L,L:P,m:M,M:F,p:function(e,t,r){var n=y.exec(t.slice(r));return n?(e.p=m[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:q,S:O,u:x,U:w,V:Q,w:b,W:_,x:function(e,t,n){return Fe(e,r,t,n)},X:function(e,t,r){return Fe(e,s,t,r)},y:k,Y:S,Z:D,"%":U};function Le(e,t){return function(r){var n,i,a,o=[],s=-1,l=0,A=e.length;for(r instanceof Date||(r=new Date(+r));++s53)return null;"w"in g||(g.w=1),"Z"in g?(l=(s=c(u(g.y,0,1))).getUTCDay(),s=l>4||0===l?n.ot.ceil(s):(0,n.ot)(s),s=i.c.offset(s,7*(g.V-1)),g.y=s.getUTCFullYear(),g.m=s.getUTCMonth(),g.d=s.getUTCDate()+(g.w+6)%7):(l=(s=A(u(g.y,0,1))).getDay(),s=l>4||0===l?a.qT.ceil(s):(0,a.qT)(s),s=o.c.offset(s,7*(g.V-1)),g.y=s.getFullYear(),g.m=s.getMonth(),g.d=s.getDate()+(g.w+6)%7)}else("W"in g||"U"in g)&&("w"in g||(g.w="u"in g?g.u%7:"W"in g?1:0),l="Z"in g?c(u(g.y,0,1)).getUTCDay():A(u(g.y,0,1)).getDay(),g.m=0,g.d="W"in g?(g.w+6)%7+7*g.W-(l+5)%7:g.w+7*g.U-(l+6)%7);return"Z"in g?(g.H+=g.Z/100|0,g.M+=g.Z%100,c(g)):A(g)}}function Fe(e,t,r,n){for(var i,a,o=0,s=t.length,l=r.length;o=l)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=Re[i in p?t.charAt(o++):i])||(n=a(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Te.x=Le(r,Te),Te.X=Le(s,Te),Te.c=Le(t,Te),Me.x=Le(r,Me),Me.X=Le(s,Me),Me.c=Le(t,Me),{format:function(e){var t=Le(e+="",Te);return t.toString=function(){return e},t},parse:function(e){var t=Ne(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Le(e+="",Me);return t.toString=function(){return e},t},utcParse:function(e){var t=Ne(e+="",!0);return t.toString=function(){return e},t}}}var f,h,d,p={"-":"",_:" ",0:"0"},y=/^\s*\d+/,m=/^%/,I=/[\\^$*+?|[\]().{}]/g;function v(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function D(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(e,t,r){var n=y.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function M(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function R(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function L(e,t,r){var n=y.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function N(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function F(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function O(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function P(e,t,r){var n=y.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function G(e,t,r){var n=y.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function U(e,t,r){var n=m.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function z(e,t,r){var n=y.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function q(e,t,r){var n=y.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function H(e,t){return v(e.getDate(),t,2)}function Y(e,t){return v(e.getHours(),t,2)}function J(e,t){return v(e.getHours()%12||12,t,2)}function K(e,t){return v(1+o.c.count((0,s.c)(e),e),t,3)}function j(e,t){return v(e.getMilliseconds(),t,3)}function V(e,t){return j(e,t)+"000"}function W(e,t){return v(e.getMonth()+1,t,2)}function Z(e,t){return v(e.getMinutes(),t,2)}function X(e,t){return v(e.getSeconds(),t,2)}function $(e){var t=e.getDay();return 0===t?7:t}function ee(e,t){return v(a.uU.count((0,s.c)(e)-1,e),t,2)}function te(e,t){var r=e.getDay();return e=r>=4||0===r?(0,a.kD)(e):a.kD.ceil(e),v(a.kD.count((0,s.c)(e),e)+(4===(0,s.c)(e).getDay()),t,2)}function re(e){return e.getDay()}function ne(e,t){return v(a.qT.count((0,s.c)(e)-1,e),t,2)}function ie(e,t){return v(e.getFullYear()%100,t,2)}function ae(e,t){return v(e.getFullYear()%1e4,t,4)}function oe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+v(t/60|0,"0",2)+v(t%60,"0",2)}function se(e,t){return v(e.getUTCDate(),t,2)}function le(e,t){return v(e.getUTCHours(),t,2)}function Ae(e,t){return v(e.getUTCHours()%12||12,t,2)}function ce(e,t){return v(1+i.c.count((0,l.c)(e),e),t,3)}function ue(e,t){return v(e.getUTCMilliseconds(),t,3)}function ge(e,t){return ue(e,t)+"000"}function fe(e,t){return v(e.getUTCMonth()+1,t,2)}function he(e,t){return v(e.getUTCMinutes(),t,2)}function de(e,t){return v(e.getUTCSeconds(),t,2)}function pe(e){var t=e.getUTCDay();return 0===t?7:t}function ye(e,t){return v(n.EV.count((0,l.c)(e)-1,e),t,2)}function me(e,t){var r=e.getUTCDay();return e=r>=4||0===r?(0,n.yA)(e):n.yA.ceil(e),v(n.yA.count((0,l.c)(e),e)+(4===(0,l.c)(e).getUTCDay()),t,2)}function Ie(e){return e.getUTCDay()}function ve(e,t){return v(n.ot.count((0,l.c)(e)-1,e),t,2)}function Ee(e,t){return v(e.getUTCFullYear()%100,t,2)}function Ce(e,t){return v(e.getUTCFullYear()%1e4,t,4)}function Be(){return"+0000"}function be(){return"%"}function xe(e){return+e}function we(e){return Math.floor(+e/1e3)}f=g({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]}),h=f.format,f.parse,d=f.utcFormat,f.utcParse},68936:function(e,t,r){"use strict";r.d(t,{m:function(){return o}});var n=r(81628),i=r(69792),a=(0,n.c)((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.iy)/i.SK}),(function(e){return e.getDate()-1}));t.c=a;var o=a.range},69792:function(e,t,r){"use strict";r.d(t,{KK:function(){return s},SK:function(){return o},cg:function(){return a},iy:function(){return i},yc:function(){return n}});var n=1e3,i=6e4,a=36e5,o=864e5,s=6048e5},73220:function(e,t,r){"use strict";r.r(t),r.d(t,{timeDay:function(){return y.c},timeDays:function(){return y.m},timeFriday:function(){return m.iB},timeFridays:function(){return m.sJ},timeHour:function(){return d},timeHours:function(){return p},timeInterval:function(){return n.c},timeMillisecond:function(){return a},timeMilliseconds:function(){return o},timeMinute:function(){return g},timeMinutes:function(){return f},timeMonday:function(){return m.qT},timeMondays:function(){return m.QP},timeMonth:function(){return v},timeMonths:function(){return E},timeSaturday:function(){return m.Wc},timeSaturdays:function(){return m.aI},timeSecond:function(){return A},timeSeconds:function(){return c},timeSunday:function(){return m.uU},timeSundays:function(){return m.Ab},timeThursday:function(){return m.kD},timeThursdays:function(){return m.eC},timeTuesday:function(){return m.Mf},timeTuesdays:function(){return m.Oc},timeWednesday:function(){return m.eg},timeWednesdays:function(){return m.sn},timeWeek:function(){return m.uU},timeWeeks:function(){return m.Ab},timeYear:function(){return C.c},timeYears:function(){return C.Q},utcDay:function(){return S.c},utcDays:function(){return S.o},utcFriday:function(){return k.od},utcFridays:function(){return k.iG},utcHour:function(){return Q},utcHours:function(){return _},utcMillisecond:function(){return a},utcMilliseconds:function(){return o},utcMinute:function(){return b},utcMinutes:function(){return x},utcMonday:function(){return k.ot},utcMondays:function(){return k.iO},utcMonth:function(){return T},utcMonths:function(){return M},utcSaturday:function(){return k.Ad},utcSaturdays:function(){return k.K8},utcSecond:function(){return A},utcSeconds:function(){return c},utcSunday:function(){return k.EV},utcSundays:function(){return k.Wq},utcThursday:function(){return k.yA},utcThursdays:function(){return k.ob},utcTuesday:function(){return k.sG},utcTuesdays:function(){return k.kl},utcWednesday:function(){return k._6},utcWednesdays:function(){return k.W_},utcWeek:function(){return k.EV},utcWeeks:function(){return k.Wq},utcYear:function(){return R.c},utcYears:function(){return R.i}});var n=r(81628),i=(0,n.c)((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?(0,n.c)((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):i:null};var a=i,o=i.range,s=r(69792),l=(0,n.c)((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*s.yc)}),(function(e,t){return(t-e)/s.yc}),(function(e){return e.getUTCSeconds()})),A=l,c=l.range,u=(0,n.c)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*s.yc)}),(function(e,t){e.setTime(+e+t*s.iy)}),(function(e,t){return(t-e)/s.iy}),(function(e){return e.getMinutes()})),g=u,f=u.range,h=(0,n.c)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*s.yc-e.getMinutes()*s.iy)}),(function(e,t){e.setTime(+e+t*s.cg)}),(function(e,t){return(t-e)/s.cg}),(function(e){return e.getHours()})),d=h,p=h.range,y=r(68936),m=r(46192),I=(0,n.c)((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),v=I,E=I.range,C=r(32171),B=(0,n.c)((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*s.iy)}),(function(e,t){return(t-e)/s.iy}),(function(e){return e.getUTCMinutes()})),b=B,x=B.range,w=(0,n.c)((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*s.cg)}),(function(e,t){return(t-e)/s.cg}),(function(e){return e.getUTCHours()})),Q=w,_=w.range,S=r(58931),k=r(8208),D=(0,n.c)((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),T=D,M=D.range,R=r(53528)},81628:function(e,t,r){"use strict";r.d(t,{c:function(){return a}});var n=new Date,i=new Date;function a(e,t,r,o){function s(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return s.floor=function(t){return e(t=new Date(+t)),t},s.ceil=function(r){return e(r=new Date(r-1)),t(r,1),e(r),r},s.round=function(e){var t=s(e),r=s.ceil(e);return e-t0))return o;do{o.push(a=new Date(+r)),t(r,i),e(r)}while(a=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}))},r&&(s.count=function(t,a){return n.setTime(+t),i.setTime(+a),e(n),e(i),Math.floor(r(n,i))},s.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?s.filter(o?function(t){return o(t)%e===0}:function(t){return s.count(0,t)%e===0}):s:null}),s}},58931:function(e,t,r){"use strict";r.d(t,{o:function(){return o}});var n=r(81628),i=r(69792),a=(0,n.c)((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/i.SK}),(function(e){return e.getUTCDate()-1}));t.c=a;var o=a.range},8208:function(e,t,r){"use strict";r.d(t,{Ad:function(){return g},EV:function(){return o},K8:function(){return I},W_:function(){return p},Wq:function(){return f},_6:function(){return A},iG:function(){return m},iO:function(){return h},kl:function(){return d},ob:function(){return y},od:function(){return u},ot:function(){return s},sG:function(){return l},yA:function(){return c}});var n=r(81628),i=r(69792);function a(e){return(0,n.c)((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/i.KK}))}var o=a(0),s=a(1),l=a(2),A=a(3),c=a(4),u=a(5),g=a(6),f=o.range,h=s.range,d=l.range,p=A.range,y=c.range,m=u.range,I=g.range},53528:function(e,t,r){"use strict";r.d(t,{i:function(){return a}});var n=r(81628),i=(0,n.c)((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?(0,n.c)((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null},t.c=i;var a=i.range},46192:function(e,t,r){"use strict";r.d(t,{Ab:function(){return f},Mf:function(){return l},Oc:function(){return d},QP:function(){return h},Wc:function(){return g},aI:function(){return I},eC:function(){return y},eg:function(){return A},iB:function(){return u},kD:function(){return c},qT:function(){return s},sJ:function(){return m},sn:function(){return p},uU:function(){return o}});var n=r(81628),i=r(69792);function a(e){return(0,n.c)((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.iy)/i.KK}))}var o=a(0),s=a(1),l=a(2),A=a(3),c=a(4),u=a(5),g=a(6),f=o.range,h=s.range,d=l.range,p=A.range,y=c.range,m=u.range,I=g.range},32171:function(e,t,r){"use strict";r.d(t,{Q:function(){return a}});var n=r(81628),i=(0,n.c)((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?(0,n.c)((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null},t.c=i;var a=i.range},64348:function(e,t,r){"use strict";var n=r(39640)(),i=r(53664),a=n&&i("%Object.defineProperty%",!0);if(a)try{a({},"a",{value:1})}catch(A){a=!1}var o=i("%SyntaxError%"),s=i("%TypeError%"),l=r(2304);e.exports=function(e,t,r){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new s("`obj` must be an object or a function`");if("string"!==typeof t&&"symbol"!==typeof t)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,A=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],u=!!l&&l(e,t);if(a)a(e,t,{configurable:null===A&&u?u.configurable:!A,enumerable:null===n&&u?u.enumerable:!n,value:r,writable:null===i&&u?u.writable:!i});else{if(!c&&(n||i||A))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},81288:function(e,t,r){"use strict";var n=r(41820),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),a=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,l=r(39640)(),A=s&&l,c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!==typeof(i=n)||"[object Function]"!==a.call(i)||!n())return;var i;A?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r},u=function(e,t){var r=arguments.length>2?arguments[2]:{},a=n(t);i&&(a=o.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;ss*l){var f=(g-u)/s;o[c]=1e3*f}}return o}function i(e){for(var t=[],r=e[0];r<=e[1];r++)for(var n=String.fromCharCode(r),i=e[0];i0)return function(e,t){var r,n;for(r=new Array(e),n=0;n80*a){o=l=e[0],s=u=e[1];for(var v=a;vl&&(l=g),h>u&&(u=h);d=0!==(d=Math.max(l-o,u-s))?1/d:0}return i(m,I,a,o,s,d),I}function r(e,t,r,n,i){var a,o;if(i===w(e,t,r,n)>0)for(a=t;a=t;a-=n)o=B(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(b(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!y(n,n.next)&&0!==p(n.prev,n,n.next))n=n.next;else{if(b(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function i(e,t,r,A,c,u,f){if(e){!f&&u&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=g(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,A=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,A*=2}while(o>1)}(i)}(e,A,c,u);for(var h,d,p=e;e.prev!==e.next;)if(h=e.prev,d=e.next,u?o(e,A,c,u):a(e))t.push(h.i/r),t.push(e.i/r),t.push(d.i/r),b(e),e=d.next,p=d.next;else if((e=d)===p){f?1===f?i(e=s(n(e),t,r),t,r,A,c,u,2):2===f&&l(e,t,r,A,c,u):i(n(e),t,r,A,c,u,1);break}}}function a(e){var t=e.prev,r=e,n=e.next;if(p(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(h(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&p(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function o(e,t,r,n){var i=e.prev,a=e,o=e.next;if(p(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,u=g(s,l,t,r,n),f=g(A,c,t,r,n),d=e.prevZ,y=e.nextZ;d&&d.z>=u&&y&&y.z<=f;){if(d!==e.prev&&d!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&p(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,y!==e.prev&&y!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&p(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;d&&d.z>=u;){if(d!==e.prev&&d!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&p(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;y&&y.z<=f;){if(y!==e.prev&&y!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&p(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function s(e,t,r){var i=e;do{var a=i.prev,o=i.next.next;!y(a,o)&&m(a,i,i.next,o)&&E(a,o)&&E(o,a)&&(t.push(a.i/r),t.push(i.i/r),t.push(o.i/r),b(i),b(i.next),i=e=o),i=i.next}while(i!==e);return n(i)}function l(e,t,r,a,o,s){var l=e;do{for(var A=l.next.next;A!==l.prev;){if(l.i!==A.i&&d(l,A)){var c=C(l,A);return l=n(l,l.next),c=n(c,c.next),i(l,t,r,a,o,s),void i(c,t,r,a,o,s)}A=A.next}l=l.next}while(l!==e)}function A(e,t){return e.x-t.x}function c(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&h(ar.x||n.x===r.x&&u(r,n)))&&(r=n,f=l)),n=n.next}while(n!==A);return r}(e,t),t){var r=C(t,e);n(t,t.next),n(r,r.next)}}function u(e,t){return p(e.prev,e,t.prev)<0&&p(t.next,e,e.next)<0}function g(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function f(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function d(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&m(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(E(e,t)&&E(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(p(e.prev,e,t.prev)||p(e,t.prev,t))||y(e,t)&&p(e.prev,e,e.next)>0&&p(t.prev,t,t.next)>0)}function p(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function m(e,t,r,n){var i=v(p(e,t,r)),a=v(p(e,t,n)),o=v(p(r,n,e)),s=v(p(r,n,t));return i!==a&&o!==s||!(0!==i||!I(e,r,t))||!(0!==a||!I(e,n,t))||!(0!==o||!I(r,e,n))||!(0!==s||!I(r,t,n))}function I(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function v(e){return e>0?1:e<0?-1:0}function E(e,t){return p(e.prev,e,e.next)<0?p(e,t,e.next)>=0&&p(e,e.prev,t)>=0:p(e,t,e.prev)<0||p(e,e.next,t)<0}function C(e,t){var r=new x(e.i,e.x,e.y),n=new x(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function B(e,t,r,n){var i=new x(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function b(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function x(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function w(e,t,r,n){for(var i=0,a=t,o=r-n;a0&&(n+=e[i-1].length,r.holes.push(n))}return r}},6688:function(e,t,r){var n=r(78484);e.exports=function(e,t){var r,i=[],a=[],o=[],s={},l=[];function A(e){o[e]=!1,s.hasOwnProperty(e)&&Object.keys(s[e]).forEach((function(t){delete s[e][t],o[t]&&A(t)}))}function c(e){var t,n,i=!1;for(a.push(e),o[e]=!0,t=0;t=t}))}(t);for(var r,i=n(e).components.filter((function(e){return e.length>1})),a=1/0,o=0;o=55296&&m<=56319&&(C+=e[++r]),C=B?g.call(B,b,C,d):C,t?(f.value=C,h(p,d,f)):p[d]=C,++d;y=d}if(void 0===y)for(y=o(e.length),t&&(p=new t(y)),r=0;r0?1:-1}},96936:function(e,t,r){"use strict";var n=r(85608),i=Math.abs,a=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?n(e)*a(i(e)):e}},81304:function(e,t,r){"use strict";var n=r(96936),i=Math.max;e.exports=function(e){return i(0,n(e))}},14428:function(e,t,r){"use strict";var n=r(34044),i=r(9252),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(r,A){var c,u=arguments[2],g=arguments[3];return r=Object(i(r)),n(A),c=s(r),g&&c.sort("function"===typeof g?a.call(g,r):void 0),"function"!==typeof e&&(e=c[e]),o.call(e,c,(function(e,n){return l.call(r,e)?o.call(A,u,r[e],e,r,n):t}))}}},38452:function(e,t,r){"use strict";e.exports=r(96276)()?Object.assign:r(81892)},96276:function(e){"use strict";e.exports=function(){var e,t=Object.assign;return"function"===typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},81892:function(e,t,r){"use strict";var n=r(54768),i=r(9252),a=Math.max;e.exports=function(e,t){var r,o,s,l=a(arguments.length,2);for(e=Object(i(e)),s=function(n){try{e[n]=t[n]}catch(i){r||(r=i)}},o=1;o-1}},29768:function(e){"use strict";var t=Object.prototype.toString,r=t.call("");e.exports=function(e){return"string"===typeof e||e&&"object"===typeof e&&(e instanceof String||t.call(e)===r)||!1}},82252:function(e){"use strict";var t=Object.create(null),r=Math.random;e.exports=function(){var e;do{e=r().toString(36).slice(2)}while(t[e]);return e}},52104:function(e,t,r){"use strict";var n,i=r(69932),a=r(71056),o=r(21092),s=r(92664),l=r(85512),A=Object.defineProperty;n=e.exports=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,e),t=t?a.call(t,"key+value")?"key+value":a.call(t,"key")?"key":"value":"value",A(this,"__kind__",o("",t))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),A(n.prototype,s.toStringTag,o("c","Array Iterator"))},76024:function(e,t,r){"use strict";var n=r(60948),i=r(34044),a=r(29768),o=r(76252),s=Array.isArray,l=Function.prototype.call,A=Array.prototype.some;e.exports=function(e,t){var r,c,u,g,f,h,d,p,y=arguments[2];if(s(e)||n(e)?r="array":a(e)?r="string":e=o(e),i(t),u=function(){g=!0},"array"!==r)if("string"!==r)for(c=e.next();!c.done;){if(l.call(t,y,c.value,u),g)return;c=e.next()}else for(h=e.length,f=0;f=55296&&p<=56319&&(d+=e[++f]),l.call(t,y,d,u),!g);++f);else A.call(e,(function(e){return l.call(t,y,e,u),g}))}},76252:function(e,t,r){"use strict";var n=r(60948),i=r(29768),a=r(52104),o=r(80940),s=r(52891),l=r(92664).iterator;e.exports=function(e){return"function"===typeof s(e)[l]?e[l]():n(e)?new a(e):i(e)?new o(e):new a(e)}},85512:function(e,t,r){"use strict";var n,i=r(41476),a=r(38452),o=r(34044),s=r(9252),l=r(21092),A=r(27940),c=r(92664),u=Object.defineProperty,g=Object.defineProperties;e.exports=n=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");g(this,{__list__:l("w",s(e)),__context__:l("w",t),__nextIndex__:l("w",0)}),t&&(o(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete n.prototype.constructor,g(n.prototype,a({_next:l((function(){var e;if(this.__list__)return this.__redo__&&void 0!==(e=this.__redo__.shift())?e:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,r){t>=e&&(this.__redo__[r]=++t)}),this),this.__redo__.push(e)):u(this,"__redo__",l("c",[e])))})),_onDelete:l((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,r){t>e&&(this.__redo__[r]=--t)}),this)))})),_onClear:l((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),u(n.prototype,c.iterator,l((function(){return this})))},76368:function(e,t,r){"use strict";var n=r(60948),i=r(42584),a=r(29768),o=r(92664).iterator,s=Array.isArray;e.exports=function(e){return!!i(e)&&(!!s(e)||!!a(e)||!!n(e)||"function"===typeof e[o])}},80940:function(e,t,r){"use strict";var n,i=r(69932),a=r(21092),o=r(92664),s=r(85512),l=Object.defineProperty;n=e.exports=function(e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");e=String(e),s.call(this,e),l(this,"__length__",a("",e.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:a((function(){if(this.__list__)return this.__nextIndex__=55296&&t<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,a("c","String Iterator"))},52891:function(e,t,r){"use strict";var n=r(76368);e.exports=function(e){if(!n(e))throw new TypeError(e+" is not iterable");return e}},60964:function(e){"use strict";function t(e,t){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,A=c,console&&console.warn&&console.warn(A)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function g(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"===typeof l)n(l,this,t);else{var A=l.length,c=h(l,A);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return g(this,e,!0)},a.prototype.rawListeners=function(e){return g(this,e,!1)},a.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},39072:function(e){var t=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},12296:function(e,t,r){"use strict";e.exports=r(45072)()?globalThis:r(39072)},45072:function(e){"use strict";e.exports=function(){return"object"===typeof globalThis&&!!globalThis&&globalThis.Array===Array}},38248:function(e,t,r){"use strict";var n=r(94576);e.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0===(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},47520:function(e,t,r){var n=r(72512);e.exports=function(e,t,r){if(!e)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(e)&&e[0]&&"number"===typeof e[0][0]){var i,a,o,s,l=e[0].length,A=e.length*l;t&&"string"!==typeof t||(t=new(n(t||"float32"))(A+r));var c=t.length-r;if(A!==c)throw new Error("source length "+A+" ("+l+"x"+e.length+") does not match destination length "+c);for(i=0,o=r;it[0]-o[0]/2&&(g=o[0]/2,f+=o[1]);return r}},71920:function(e){"use strict";function t(e,a){a||(a={}),("string"===typeof e||Array.isArray(e))&&(a.family=e);var o=Array.isArray(a.family)?a.family.join(", "):a.family;if(!o)throw Error("`family` must be defined");var s=a.size||a.fontSize||a.em||48,l=a.weight||a.fontWeight||"",A=(e=[a.style||a.fontStyle||"",l,s].join(" ")+"px "+o,a.origin||"top");if(t.cache[o]&&s<=t.cache[o].em)return r(t.cache[o],A);var c=a.canvas||t.canvas,u=c.getContext("2d"),g={upper:void 0!==a.upper?a.upper:"H",lower:void 0!==a.lower?a.lower:"x",descent:void 0!==a.descent?a.descent:"p",ascent:void 0!==a.ascent?a.ascent:"h",tittle:void 0!==a.tittle?a.tittle:"i",overshoot:void 0!==a.overshoot?a.overshoot:"O"},f=Math.ceil(1.5*s);c.height=f,c.width=.5*f,u.font=e;var h="H",d={top:0};u.clearRect(0,0,f,f),u.textBaseline="top",u.fillStyle="black",u.fillText(h,0,0);var p=n(u.getImageData(0,0,f,f));u.clearRect(0,0,f,f),u.textBaseline="bottom",u.fillText(h,0,f);var y=n(u.getImageData(0,0,f,f));d.lineHeight=d.bottom=f-y+p,u.clearRect(0,0,f,f),u.textBaseline="alphabetic",u.fillText(h,0,f);var m=f-n(u.getImageData(0,0,f,f))-1+p;d.baseline=d.alphabetic=m,u.clearRect(0,0,f,f),u.textBaseline="middle",u.fillText(h,0,.5*f);var I=n(u.getImageData(0,0,f,f));d.median=d.middle=f-I-1+p-.5*f,u.clearRect(0,0,f,f),u.textBaseline="hanging",u.fillText(h,0,.5*f);var v=n(u.getImageData(0,0,f,f));d.hanging=f-v-1+p-.5*f,u.clearRect(0,0,f,f),u.textBaseline="ideographic",u.fillText(h,0,f);var E=n(u.getImageData(0,0,f,f));if(d.ideographic=f-E-1+p,g.upper&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.upper,0,0),d.upper=n(u.getImageData(0,0,f,f)),d.capHeight=d.baseline-d.upper),g.lower&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.lower,0,0),d.lower=n(u.getImageData(0,0,f,f)),d.xHeight=d.baseline-d.lower),g.tittle&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.tittle,0,0),d.tittle=n(u.getImageData(0,0,f,f))),g.ascent&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.ascent,0,0),d.ascent=n(u.getImageData(0,0,f,f))),g.descent&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.descent,0,0),d.descent=i(u.getImageData(0,0,f,f))),g.overshoot){u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.overshoot,0,0);var C=i(u.getImageData(0,0,f,f));d.overshoot=C-m}for(var B in d)d[B]/=s;return d.em=s,t.cache[o]=d,r(d,A)}function r(e,t){var r={};for(var n in"string"===typeof t&&(t=e[t]),e)"em"!==n&&(r[n]=e[n]-t);return r}function n(e){for(var t=e.height,r=e.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}e.exports=t,t.canvas=document.createElement("canvas"),t.cache={}},46492:function(e,t,r){"use strict";var n=r(90720),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n1&&"boolean"!==typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===w(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=x(e,0,1),r=x(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return b(e,Q,(function(e,t,r,i){n[n.length]=r?b(i,_,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",a=S("%"+n+"%",t),s=a.name,A=a.value,c=!1,u=a.alias;u&&(n=u[0],B(r,C([0,1],u)));for(var g=1,f=!0;g=r.length){var m=l(A,h);A=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:A[h]}else f=E(A,h),A=A[h];f&&!c&&(p[s]=A)}}return A}},12408:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],A=t[7],c=t[8],u=t[9],g=t[10],f=t[11],h=t[12],d=t[13],p=t[14],y=t[15];return e[0]=s*(g*y-f*p)-u*(l*y-A*p)+d*(l*f-A*g),e[1]=-(n*(g*y-f*p)-u*(i*y-a*p)+d*(i*f-a*g)),e[2]=n*(l*y-A*p)-s*(i*y-a*p)+d*(i*A-a*l),e[3]=-(n*(l*f-A*g)-s*(i*f-a*g)+u*(i*A-a*l)),e[4]=-(o*(g*y-f*p)-c*(l*y-A*p)+h*(l*f-A*g)),e[5]=r*(g*y-f*p)-c*(i*y-a*p)+h*(i*f-a*g),e[6]=-(r*(l*y-A*p)-o*(i*y-a*p)+h*(i*A-a*l)),e[7]=r*(l*f-A*g)-o*(i*f-a*g)+c*(i*A-a*l),e[8]=o*(u*y-f*d)-c*(s*y-A*d)+h*(s*f-A*u),e[9]=-(r*(u*y-f*d)-c*(n*y-a*d)+h*(n*f-a*u)),e[10]=r*(s*y-A*d)-o*(n*y-a*d)+h*(n*A-a*s),e[11]=-(r*(s*f-A*u)-o*(n*f-a*u)+c*(n*A-a*s)),e[12]=-(o*(u*p-g*d)-c*(s*p-l*d)+h*(s*g-l*u)),e[13]=r*(u*p-g*d)-c*(n*p-i*d)+h*(n*g-i*u),e[14]=-(r*(s*p-l*d)-o*(n*p-i*d)+h*(n*l-i*s)),e[15]=r*(s*g-l*u)-o*(n*g-i*u)+c*(n*l-i*s),e}},76860:function(e){e.exports=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},64492:function(e){e.exports=function(e,t){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}},54212:function(e){e.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},70800:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],A=e[8],c=e[9],u=e[10],g=e[11],f=e[12],h=e[13],d=e[14],p=e[15];return(t*o-r*a)*(u*p-g*d)-(t*s-n*a)*(c*p-g*h)+(t*l-i*a)*(c*d-u*h)+(r*s-n*o)*(A*p-g*f)-(r*l-i*o)*(A*d-u*f)+(n*l-i*s)*(A*h-c*f)}},61784:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,l=i+i,A=r*o,c=n*o,u=n*s,g=i*o,f=i*s,h=i*l,d=a*o,p=a*s,y=a*l;return e[0]=1-u-h,e[1]=c+y,e[2]=g-p,e[3]=0,e[4]=c-y,e[5]=1-A-h,e[6]=f+d,e[7]=0,e[8]=g+p,e[9]=f-d,e[10]=1-A-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},91616:function(e){e.exports=function(e,t,r){var n,i,a,o=r[0],s=r[1],l=r[2],A=Math.sqrt(o*o+s*s+l*l);return Math.abs(A)<1e-6?null:(o*=A=1/A,s*=A,l*=A,n=Math.sin(t),i=Math.cos(t),a=1-i,e[0]=o*o*a+i,e[1]=s*o*a+l*n,e[2]=l*o*a-s*n,e[3]=0,e[4]=o*s*a-l*n,e[5]=s*s*a+i,e[6]=l*s*a+o*n,e[7]=0,e[8]=o*l*a+s*n,e[9]=s*l*a-o*n,e[10]=l*l*a+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}},51944:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,l=i+i,A=a+a,c=n*s,u=n*l,g=n*A,f=i*l,h=i*A,d=a*A,p=o*s,y=o*l,m=o*A;return e[0]=1-(f+d),e[1]=u+m,e[2]=g-y,e[3]=0,e[4]=u-m,e[5]=1-(c+d),e[6]=h+p,e[7]=0,e[8]=g+y,e[9]=h-p,e[10]=1-(c+f),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},69444:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},48268:function(e){e.exports=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}},21856:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},79216:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},57736:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},38848:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(r-t),l=1/(i-n),A=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*l,e[10]=(o+a)*A,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*A,e[15]=0,e}},36635:function(e){e.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},36524:function(e,t,r){e.exports={create:r(54212),clone:r(76860),copy:r(64492),identity:r(36635),transpose:r(86520),invert:r(4308),adjoint:r(12408),determinant:r(70800),multiply:r(80944),translate:r(35176),scale:r(68152),rotate:r(30016),rotateX:r(15456),rotateY:r(64840),rotateZ:r(4192),fromRotation:r(91616),fromRotationTranslation:r(51944),fromScaling:r(69444),fromTranslation:r(48268),fromXRotation:r(21856),fromYRotation:r(79216),fromZRotation:r(57736),fromQuat:r(61784),frustum:r(38848),perspective:r(51296),perspectiveFromFieldOfView:r(63688),ortho:r(97688),lookAt:r(56508),str:r(89412)}},4308:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],A=t[7],c=t[8],u=t[9],g=t[10],f=t[11],h=t[12],d=t[13],p=t[14],y=t[15],m=r*s-n*o,I=r*l-i*o,v=r*A-a*o,E=n*l-i*s,C=n*A-a*s,B=i*A-a*l,b=c*d-u*h,x=c*p-g*h,w=c*y-f*h,Q=u*p-g*d,_=u*y-f*d,S=g*y-f*p,k=m*S-I*_+v*Q+E*w-C*x+B*b;return k?(k=1/k,e[0]=(s*S-l*_+A*Q)*k,e[1]=(i*_-n*S-a*Q)*k,e[2]=(d*B-p*C+y*E)*k,e[3]=(g*C-u*B-f*E)*k,e[4]=(l*w-o*S-A*x)*k,e[5]=(r*S-i*w+a*x)*k,e[6]=(p*v-h*B-y*I)*k,e[7]=(c*B-g*v+f*I)*k,e[8]=(o*_-s*w+A*b)*k,e[9]=(n*w-r*_-a*b)*k,e[10]=(h*C-d*v+y*m)*k,e[11]=(u*v-c*C-f*m)*k,e[12]=(s*x-o*Q-l*b)*k,e[13]=(r*Q-n*x+i*b)*k,e[14]=(d*I-h*E-p*m)*k,e[15]=(c*E-u*I+g*m)*k,e):null}},56508:function(e,t,r){var n=r(36635);e.exports=function(e,t,r,i){var a,o,s,l,A,c,u,g,f,h,d=t[0],p=t[1],y=t[2],m=i[0],I=i[1],v=i[2],E=r[0],C=r[1],B=r[2];return Math.abs(d-E)<1e-6&&Math.abs(p-C)<1e-6&&Math.abs(y-B)<1e-6?n(e):(u=d-E,g=p-C,f=y-B,h=1/Math.sqrt(u*u+g*g+f*f),a=I*(f*=h)-v*(g*=h),o=v*(u*=h)-m*f,s=m*g-I*u,(h=Math.sqrt(a*a+o*o+s*s))?(a*=h=1/h,o*=h,s*=h):(a=0,o=0,s=0),l=g*s-f*o,A=f*a-u*s,c=u*o-g*a,(h=Math.sqrt(l*l+A*A+c*c))?(l*=h=1/h,A*=h,c*=h):(l=0,A=0,c=0),e[0]=a,e[1]=l,e[2]=u,e[3]=0,e[4]=o,e[5]=A,e[6]=g,e[7]=0,e[8]=s,e[9]=c,e[10]=f,e[11]=0,e[12]=-(a*d+o*p+s*y),e[13]=-(l*d+A*p+c*y),e[14]=-(u*d+g*p+f*y),e[15]=1,e)}},80944:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],A=t[6],c=t[7],u=t[8],g=t[9],f=t[10],h=t[11],d=t[12],p=t[13],y=t[14],m=t[15],I=r[0],v=r[1],E=r[2],C=r[3];return e[0]=I*n+v*s+E*u+C*d,e[1]=I*i+v*l+E*g+C*p,e[2]=I*a+v*A+E*f+C*y,e[3]=I*o+v*c+E*h+C*m,I=r[4],v=r[5],E=r[6],C=r[7],e[4]=I*n+v*s+E*u+C*d,e[5]=I*i+v*l+E*g+C*p,e[6]=I*a+v*A+E*f+C*y,e[7]=I*o+v*c+E*h+C*m,I=r[8],v=r[9],E=r[10],C=r[11],e[8]=I*n+v*s+E*u+C*d,e[9]=I*i+v*l+E*g+C*p,e[10]=I*a+v*A+E*f+C*y,e[11]=I*o+v*c+E*h+C*m,I=r[12],v=r[13],E=r[14],C=r[15],e[12]=I*n+v*s+E*u+C*d,e[13]=I*i+v*l+E*g+C*p,e[14]=I*a+v*A+E*f+C*y,e[15]=I*o+v*c+E*h+C*m,e}},97688:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),A=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*A,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*A,e[15]=1,e}},51296:function(e){e.exports=function(e,t,r,n,i){var a=1/Math.tan(t/2),o=1/(n-i);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*o,e[15]=0,e}},63688:function(e){e.exports=function(e,t,r,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+s),A=2/(i+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=A,e[6]=0,e[7]=0,e[8]=-(o-s)*l*.5,e[9]=(i-a)*A*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}},30016:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q,_=n[0],S=n[1],k=n[2],D=Math.sqrt(_*_+S*S+k*k);return Math.abs(D)<1e-6?null:(_*=D=1/D,S*=D,k*=D,i=Math.sin(r),a=Math.cos(r),o=1-a,s=t[0],l=t[1],A=t[2],c=t[3],u=t[4],g=t[5],f=t[6],h=t[7],d=t[8],p=t[9],y=t[10],m=t[11],I=_*_*o+a,v=S*_*o+k*i,E=k*_*o-S*i,C=_*S*o-k*i,B=S*S*o+a,b=k*S*o+_*i,x=_*k*o+S*i,w=S*k*o-_*i,Q=k*k*o+a,e[0]=s*I+u*v+d*E,e[1]=l*I+g*v+p*E,e[2]=A*I+f*v+y*E,e[3]=c*I+h*v+m*E,e[4]=s*C+u*B+d*b,e[5]=l*C+g*B+p*b,e[6]=A*C+f*B+y*b,e[7]=c*C+h*B+m*b,e[8]=s*x+u*w+d*Q,e[9]=l*x+g*w+p*Q,e[10]=A*x+f*w+y*Q,e[11]=c*x+h*w+m*Q,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},15456:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],A=t[8],c=t[9],u=t[10],g=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+A*n,e[5]=o*i+c*n,e[6]=s*i+u*n,e[7]=l*i+g*n,e[8]=A*i-a*n,e[9]=c*i-o*n,e[10]=u*i-s*n,e[11]=g*i-l*n,e}},64840:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],A=t[8],c=t[9],u=t[10],g=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-A*n,e[1]=o*i-c*n,e[2]=s*i-u*n,e[3]=l*i-g*n,e[8]=a*n+A*i,e[9]=o*n+c*i,e[10]=s*n+u*i,e[11]=l*n+g*i,e}},4192:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],A=t[4],c=t[5],u=t[6],g=t[7];return t!==e&&(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[0]=a*i+A*n,e[1]=o*i+c*n,e[2]=s*i+u*n,e[3]=l*i+g*n,e[4]=A*i-a*n,e[5]=c*i-o*n,e[6]=u*i-s*n,e[7]=g*i-l*n,e}},68152:function(e){e.exports=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},89412:function(e){e.exports=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}},35176:function(e){e.exports=function(e,t,r){var n,i,a,o,s,l,A,c,u,g,f,h,d=r[0],p=r[1],y=r[2];return t===e?(e[12]=t[0]*d+t[4]*p+t[8]*y+t[12],e[13]=t[1]*d+t[5]*p+t[9]*y+t[13],e[14]=t[2]*d+t[6]*p+t[10]*y+t[14],e[15]=t[3]*d+t[7]*p+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],A=t[6],c=t[7],u=t[8],g=t[9],f=t[10],h=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=A,e[7]=c,e[8]=u,e[9]=g,e[10]=f,e[11]=h,e[12]=n*d+s*p+u*y+t[12],e[13]=i*d+l*p+g*y+t[13],e[14]=a*d+A*p+f*y+t[14],e[15]=o*d+c*p+h*y+t[15]),e}},86520:function(e){e.exports=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},23352:function(e,t,r){"use strict";var n=r(42771),i=r(55616),a=r(28624),o=r(55212),s=r(60463),l=r(72160),A=r(33888),c=r(14144),u=r(51160),g=r(58908),f=r(65819),h=r(23464),d=r(63768),p=r(50896),y=r(71920),m=r(47520),I=r(308).nextPow2,v=new s,E=!1;if(document.body){var C=document.body.appendChild(document.createElement("div"));C.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(C).fontStretch&&(E=!0),document.body.removeChild(C)}var B=function(e){!function(e){return"function"===typeof e&&e._gl&&e.prop&&e.texture&&e.buffer}(e)?this.gl=o(e):(e={regl:e},this.gl=e.regl._gl),this.shader=v.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=e.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),v.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(g(e)?e:{})};B.prototype.createShader=function(){var e=this.regl,t=e({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:e.prop("count"),offset:e.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:e.this("sizeBuffer")},width:{offset:0,stride:8,buffer:e.this("sizeBuffer")},char:e.this("charBuffer"),position:e.this("position")},uniforms:{atlasSize:function(e,t){return[t.atlas.width,t.atlas.height]},atlasDim:function(e,t){return[t.atlas.cols,t.atlas.rows]},atlas:function(e,t){return t.atlas.texture},charStep:function(e,t){return t.atlas.step},em:function(e,t){return t.atlas.em},color:e.prop("color"),opacity:e.prop("opacity"),viewport:e.this("viewportArray"),scale:e.this("scale"),align:e.prop("align"),baseline:e.prop("baseline"),translate:e.this("translate"),positionOffset:e.prop("positionOffset")},primitive:"points",viewport:e.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:e,draw:t,atlas:{}}},B.prototype.update=function(e){var t=this;if("string"===typeof e)e={text:e};else if(!e)return;null!=(e=i(e,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map((function(e){return parseFloat(e)})):this.opacity=parseFloat(e.opacity)),null!=e.viewport&&(this.viewport=u(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=e.kerning&&(this.kerning=e.kerning),null!=e.offset&&("number"===typeof e.offset&&(e.offset=[e.offset,0]),this.positionOffset=m(e.offset)),e.direction&&(this.direction=e.direction),e.range&&(this.range=e.range,this.scale=[1/(e.range[2]-e.range[0]),1/(e.range[3]-e.range[1])],this.translate=[-e.range[0],-e.range[1]]),e.scale&&(this.scale=e.scale),e.translate&&(this.translate=e.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||e.font||(e.font=B.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach((function(e,r){if("string"===typeof e)try{e=n.parse(e)}catch(m){e=n.parse(B.baseFontSize+"px "+e)}else{var i=e.style,s=e.weight,l=e.stretch,A=e.variant;e=n.parse(n.stringify(e)),i&&(e.style=i),s&&(e.weight=s),l&&(e.stretch=l),A&&(e.variant=A)}var c=n.stringify({size:B.baseFontSize,family:e.family,stretch:E?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),u=f(e.size),g=Math.round(u[0]*h(u[1]));if(g!==t.fontSize[r]&&(o=!0,t.fontSize[r]=g),(!t.font[r]||c!=t.font[r].baseString)&&(a=!0,t.font[r]=B.fonts[c],!t.font[r])){var d=e.family.join(", "),p=[e.style];e.style!=e.variant&&p.push(e.variant),e.variant!=e.weight&&p.push(e.weight),E&&e.weight!=e.stretch&&p.push(e.stretch),t.font[r]={baseString:c,family:d,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:y(d,{origin:"top",fontSize:B.baseFontSize,fontStyle:p.join(" ")})},B.fonts[c]=t.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:t.fontSize[i],family:r.family,stretch:E?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(t.fontAtlas[i]=t.shader.atlas[a],!t.fontAtlas[i]){var o=r.metrics;t.shader.atlas[a]=t.fontAtlas[i]={fontString:a,step:2*Math.ceil(t.fontSize[i]*o.bottom*.5),em:t.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:t.regl.texture()}}null==e.text&&(e.text=t.text)})),"string"===typeof e.text&&e.position&&e.position.length>2){for(var s=Array(.5*e.position.length),g=0;g2){for(var C=!e.position[0].length,b=c.mallocFloat(2*this.count),x=0,w=0;x1?t.align[r]:t.align[0]:t.align;if("number"===typeof n)return n;switch(n){case"right":case"end":return-e;case"center":case"centre":case"middle":return.5*-e}return 0}))),null==this.baseline&&null==e.baseline&&(e.baseline=0),null!=e.baseline&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(e,r){var n=(t.font[r]||t.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"===typeof e?e-n.baseline:-n[e],i*=-1}))),null!=e.color)if(e.color||(e.color="transparent"),"string"!==typeof e.color&&isNaN(e.color)){var H;if("number"===typeof e.color[0]&&e.color.length>this.counts.length){var Y=e.color.length;H=c.mallocUint8(Y);for(var J=(e.color.subarray||e.color.slice).bind(e.color),K=0;K4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var W=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(W);for(var Z=0;Z1?this.counts[Z]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Z]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*Z,4*Z+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Z]:this.opacity,baseline:null!=this.baselineOffset[Z]?this.baselineOffset[Z]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[Z]?this.alignOffset[Z]:this.alignOffset[0]:0,atlas:this.fontAtlas[Z]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*Z,2*Z+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},B.prototype.destroy=function(){},B.prototype.kerning=!0,B.prototype.position={constant:new Float32Array(2)},B.prototype.translate=null,B.prototype.scale=null,B.prototype.font=null,B.prototype.text="",B.prototype.positionOffset=[0,0],B.prototype.opacity=1,B.prototype.color=new Uint8Array([0,0,0,255]),B.prototype.alignOffset=[0,0],B.maxAtlasSize=1024,B.atlasCanvas=document.createElement("canvas"),B.atlasContext=B.atlasCanvas.getContext("2d",{alpha:!1}),B.baseFontSize=64,B.fonts={},e.exports=B},55212:function(e,t,r){"use strict";var n=r(55616);function i(e){if(e.container)if(e.container==document.body)document.body.style.width||(e.canvas.width=e.width||e.pixelRatio*r.g.innerWidth),document.body.style.height||(e.canvas.height=e.height||e.pixelRatio*r.g.innerHeight);else{var t=e.container.getBoundingClientRect();e.canvas.width=e.width||t.right-t.left,e.canvas.height=e.height||t.bottom-t.top}}function a(e){return"function"===typeof e.getContext&&"width"in e&&"height"in e}function o(){var e=document.createElement("canvas");return e.style.position="absolute",e.style.top=0,e.style.left=0,e}e.exports=function(e){var t;if(e?"string"===typeof e&&(e={container:e}):e={},(e=a(e)||"string"===typeof(t=e).nodeName&&"function"===typeof t.appendChild&&"function"===typeof t.getBoundingClientRect?{container:e}:function(e){return"function"===typeof e.drawArrays||"function"===typeof e.drawElements}(e)?{gl:e}:n(e,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(e.pixelRatio=r.g.pixelRatio||1),e.gl)return e.gl;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if("string"===typeof e.container){var s=document.querySelector(e.container);if(!s)throw Error("Element "+e.container+" is not found");e.container=s}a(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=o(),e.container.appendChild(e.canvas),i(e))}else if(!e.canvas){if("undefined"===typeof document)throw Error("Not DOM environment. Use headless-gl.");e.container=document.body||document.documentElement,e.canvas=o(),e.container.appendChild(e.canvas),i(e)}return e.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(r){try{e.gl=e.canvas.getContext(r,e.attrs)}catch(t){}return e.gl})),e.gl}},26444:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,u=r?i-1:0,g=r?-1:1,f=e[t+u];for(u+=g,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=g,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+u],u+=g,c-=8);if(0===a)a=1-A;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=A}return(f?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,A=8*a-i-1,c=(1<>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,h=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?g/l:g*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,i),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&s,f+=h,s/=256,i-=8);for(o=o<0;e[r+f]=255&o,f+=h,o/=256,A-=8);e[r+f-h]|=128*d}},6768:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},91148:function(e,t,r){"use strict";var n=r(46672)(),i=r(99676)("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},24200:function(e){e.exports=!0},90720:function(e){"use strict";var t,r,n=Function.prototype.toString,i="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof i&&"function"===typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(f){f!==r&&(i=null)}else i=null;var a=/^\s*class\b/,o=function(e){try{var t=n.call(e);return a.test(t)}catch(r){return!1}},s=function(e){try{return!o(e)&&(n.call(e),!0)}catch(t){return!1}},l=Object.prototype.toString,A="function"===typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),u=function(){return!1};if("object"===typeof document){var g=document.all;l.call(g)===l.call(document.all)&&(u=function(e){if((c||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(r){}return!1})}e.exports=i?function(e){if(u(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{i(e,null,t)}catch(n){if(n!==r)return!1}return!o(e)&&s(e)}:function(e){if(u(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(A)return s(e);if(o(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},84420:function(e,t,r){"use strict";var n,i=Object.prototype.toString,a=Function.prototype.toString,o=/^\s*(?:function)?\*/,s=r(46672)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!==typeof e)return!1;if(o.test(a.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if("undefined"===typeof n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},96604:function(e){"use strict";e.exports="undefined"!==typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},85992:function(e){"use strict";e.exports=function(e){return e!==e}},1560:function(e,t,r){"use strict";var n=r(57916),i=r(81288),a=r(85992),o=r(57740),s=r(59736),l=n(o(),Number);i(l,{getPolyfill:o,implementation:a,shim:s}),e.exports=l},57740:function(e,t,r){"use strict";var n=r(85992);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},59736:function(e,t,r){"use strict";var n=r(81288),i=r(57740);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},18400:function(e){"use strict";e.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},58908:function(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r;return"[object Object]"===t.call(e)&&(null===(r=Object.getPrototypeOf(e))||r===Object.getPrototypeOf({}))}},94576:function(e){"use strict";e.exports=function(e){for(var t,r=e.length,n=0;n13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},53520:function(e){"use strict";e.exports=function(e){return"string"===typeof e&&(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4))}},7728:function(e,t,r){"use strict";var n=r(46492),i=r(63436),a=r(99676),o=a("Object.prototype.toString"),s=r(46672)(),l=r(2304),A="undefined"===typeof globalThis?r.g:globalThis,c=i(),u=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!l&&function(e){var t=!1;return n(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch(i){}})),t}(e)}},76244:function(e){"use strict";e.exports=Math.log2||function(e){return Math.log(e)*Math.LOG2E}},62644:function(e,t,r){"use strict";e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function A(e,s){var A=n.x(s),c=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||A!==i||c!==a||l(s))&&(r=0|e,i=A||0,a=c||0,t&&t(r,i,a,o))}function c(e){A(0,e)}function u(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function g(e){l(e)&&t&&t(r,i,a,o)}function f(e){0===n.buttons(e)?A(0,e):A(r,e)}function h(e){A(r|n.buttons(e),e)}function d(e){A(r&~n.buttons(e),e)}function p(){s||(s=!0,e.addEventListener("mousemove",f),e.addEventListener("mousedown",h),e.addEventListener("mouseup",d),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",u),e.addEventListener("keyup",g),e.addEventListener("keydown",g),e.addEventListener("keypress",g),e!==window&&(window.addEventListener("blur",u),window.addEventListener("keyup",g),window.addEventListener("keydown",g),window.addEventListener("keypress",g)))}p();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?p():s&&(s=!1,e.removeEventListener("mousemove",f),e.removeEventListener("mousedown",h),e.removeEventListener("mouseup",d),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",u),e.removeEventListener("keyup",g),e.removeEventListener("keydown",g),e.removeEventListener("keypress",g),e!==window&&(window.removeEventListener("blur",u),window.removeEventListener("keyup",g),window.removeEventListener("keydown",g),window.removeEventListener("keypress",g)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(93784)},29128:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},93784:function(e,t){"use strict";function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1<0&&a(s,r))}catch(p){c.call(new g(r),p)}}}function c(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function u(e,t,r,n){for(var i=0;i1&&(i*=y=Math.sqrt(y),s*=y);var m=i*i,I=s*s,v=(A==c?-1:1)*Math.sqrt(Math.abs((m*I-m*p*p-I*d*d)/(m*p*p+I*d*d)));v==1/0&&(v=1);var E=v*i*p/s+(e+u)/2,C=v*-s*d/i+(n+g)/2,B=Math.asin(((n-C)/s).toFixed(9)),b=Math.asin(((g-C)/s).toFixed(9));(B=eb&&(B-=2*t),!c&&b>B&&(b-=2*t)}if(Math.abs(b-B)>r){var x=b,w=u,Q=g;b=B+r*(c&&b>B?1:-1);var _=a(u=E+i*Math.cos(b),g=C+s*Math.sin(b),i,s,l,0,c,w,Q,[b,x,E,C])}var S=Math.tan((b-B)/4),k=4/3*i*S,D=4/3*s*S,T=[2*e-(e+k*Math.sin(B)),2*n-(n-D*Math.cos(B)),u+k*Math.sin(b),g-D*Math.cos(b),u,g];if(f)return T;_&&(T=T.concat(_));for(var M=0;M7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var I=f,v=h;"C"!=t&&"S"!=t||(I+=I-o,v+=v-l),y=["C",I,v,y[1],y[2],y[3],y[4]];break;case"T":"Q"==t||"T"==t?(u=2*f-u,g=2*h-g):(u=f,g=h),y=i(f,h,u,g,y[1],y[2]);break;case"Q":u=y[1],g=y[2],y=i(f,h,y[1],y[2],y[3],y[4]);break;case"L":y=n(f,h,y[1],y[2]);break;case"H":y=n(f,h,y[1],h);break;case"V":y=n(f,h,f,y[1]);break;case"Z":y=n(f,h,A,c)}t=m,f=y[y.length-2],h=y[y.length-1],y.length>4?(o=y[y.length-4],l=y[y.length-3]):(o=f,l=h),r.push(y)}return r}},50896:function(e){"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,i){for(var a,o,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l0&&!i.call(e,0))for(var d=0;d0)for(var p=0;p=0&&"[object Function]"===t.call(e.callee)),n}},32868:function(e){"use strict";function t(e,t){if("string"!==typeof e)return[e];var r=[e];"string"===typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",a=!!t.flat;n.forEach((function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function a(t,a,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(s),i+s+i}r.forEach((function(e,n){for(var i,o=0;e!=i;)if(i=e,e=e.replace(t,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=e})),n=n.reverse(),r=r.map((function(t){return n.forEach((function(r){t=t.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),e[0]+"$1"+e[1])})),t}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function e(t,r,n){for(var i,a=[],s=0;i=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(t.slice(0,i.index)),a.push(e(r[i[1]],r)),t=t.slice(i.index+i[0].length)}return a.push(t),a}(r[0],r)}function r(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",i=e[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=i,i=i.replace(a,s)}return i}return e.reduce((function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r}),"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function n(e,n){return Array.isArray(e)?r(e,n):t(e,n)}n.parse=t,n.stringify=r,e.exports=n},51160:function(e,t,r){"use strict";var n=r(55616);e.exports=function(e){var t;return arguments.length>1&&(e=arguments),"string"===typeof e?e=e.split(/\s/).map(parseFloat):"number"===typeof e&&(e=[e]),e.length&&"number"===typeof e[0]?t=1===e.length?{width:e[0],height:e[0],x:0,y:0}:2===e.length?{width:e[0],height:e[1],x:0,y:0}:{x:e[0],y:e[1],width:e[2]-e[0]||0,height:e[3]-e[1]||0}:e&&(t={x:(e=n(e,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:e.top||0},null==e.width?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,null==e.height?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}},21984:function(e){e.exports=function(e){var i=[];return e.replace(r,(function(e,r,a){var o=r.toLowerCase();for(a=function(e){var t=e.match(n);return t?t.map(Number):[]}(a),"m"==o&&a.length>2&&(i.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==t[o])return a.unshift(r),i.push(a);if(a.lengtha!==f>a&&i<(g-c)*(a-u)/(f-u)+c&&(o=!o)}return o}},14756:function(e,t,r){var n,i=r(7688),a=r(28648),o=r(72200),s=r(11403),l=r(82368),A=r(17792),c=!1,u=a();function g(e,t,r){var i=n.segments(e),a=n.segments(t),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(e){return!0===e?c=i():!1===e&&(c=!1),!1!==c&&c.list},epsilon:function(e){return u.epsilon(e)},segments:function(e){var t=o(!0,u,c);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,u,c).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:l.union(e.combined,c),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:l.intersect(e.combined,c),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:l.difference(e.combined,c),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:l.differenceRev(e.combined,c),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:l.xor(e.combined,c),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:s(e.segments,u,c),inverted:e.inverted}},polygonFromGeoJSON:function(e){return A.toPolygon(n,e)},polygonToGeoJSON:function(e){return A.fromPolygon(n,u,e)},union:function(e,t){return g(e,t,n.selectUnion)},intersect:function(e,t){return g(e,t,n.selectIntersect)},difference:function(e,t){return g(e,t,n.selectDifference)},differenceRev:function(e,t){return g(e,t,n.selectDifferenceRev)},xor:function(e,t){return g(e,t,n.selectXor)}},"object"===typeof window&&(window.PolyBool=n),e.exports=n},7688:function(e){e.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!==typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},28648:function(e){e.exports=function(e){"number"!==typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"===typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=t[0];return(o-i)*(t[1]-a)-(s-a)*(l-i)>=-e},pointBetween:function(t,r,n){var i=t[1]-r[1],a=n[0]-r[0],o=t[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-i>e&&(a-A)*(i-c)/(o-c)+A-n>e&&(s=!s),a=A,o=c}return s}};return t}},17792:function(e){var t={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),i=1;i0}))}function c(e,n){var i=e.seg,a=n.seg,o=i.start,s=i.end,A=a.start,c=a.end;r&&r.checkIntersection(i,a);var u=t.linesIntersect(o,s,A,c);if(!1===u){if(!t.pointsCollinear(o,s,A))return!1;if(t.pointsSame(o,c)||t.pointsSame(s,A))return!1;var g=t.pointsSame(o,A),f=t.pointsSame(s,c);if(g&&f)return n;var h=!g&&t.pointBetween(o,A,c),d=!f&&t.pointBetween(s,A,c);if(g)return d?l(n,s):l(e,c),n;h&&(f||(d?l(n,s):l(e,c)),l(n,o))}else 0===u.alongA&&(-1===u.alongB?l(e,A):0===u.alongB?l(e,u.pt):1===u.alongB&&l(e,c)),0===u.alongB&&(-1===u.alongA?l(n,o):0===u.alongA?l(n,u.pt):1===u.alongA&&l(n,s));return!1}for(var u=[];!a.isEmpty();){var g=a.getHead();if(r&&r.vert(g.pt[0]),g.isStart){r&&r.segmentNew(g.seg,g.primary);var f=A(g),h=f.before?f.before.ev:null,d=f.after?f.after.ev:null;function p(){if(h){var e=c(g,h);if(e)return e}return!!d&&c(g,d)}r&&r.tempStatus(g.seg,!!h&&h.seg,!!d&&d.seg);var y,m,I=p();if(I)e?(m=null===g.seg.myFill.below||g.seg.myFill.above!==g.seg.myFill.below)&&(I.seg.myFill.above=!I.seg.myFill.above):I.seg.otherFill=g.seg.myFill,r&&r.segmentUpdate(I.seg),g.other.remove(),g.remove();if(a.getHead()!==g){r&&r.rewind(g.seg);continue}e?(m=null===g.seg.myFill.below||g.seg.myFill.above!==g.seg.myFill.below,g.seg.myFill.below=d?d.seg.myFill.above:i,g.seg.myFill.above=m?!g.seg.myFill.below:g.seg.myFill.below):null===g.seg.otherFill&&(y=d?g.primary===d.primary?d.seg.otherFill.above:d.seg.myFill.above:g.primary?o:i,g.seg.otherFill={above:y,below:y}),r&&r.status(g.seg,!!h&&h.seg,!!d&&d.seg),g.other.status=f.insert(n.node({ev:g}))}else{var v=g.status;if(null===v)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(v.prev)&&s.exists(v.next)&&c(v.prev.ev,v.next.ev),r&&r.statusRemove(v.ev.seg),v.remove(),!g.primary){var E=g.seg.myFill;g.seg.myFill=g.seg.otherFill,g.seg.otherFill=E}u.push(g.seg)}a.getHead().remove()}return r&&r.done(),u}return e?{addRegion:function(e){for(var n,i,a,o=e[e.length-1],l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},n.prototype.read_uint16=function(e){var r=this.input;if(e+2>r.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?256*r[e]+r[e+1]:r[e]+256*r[e+1]},n.prototype.read_uint32=function(e){var r=this.input;if(e+4>r.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?16777216*r[e]+65536*r[e+1]+256*r[e+2]+r[e+3]:r[e]+256*r[e+1]+65536*r[e+2]+16777216*r[e+3]},n.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},n.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},n.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));default:return null}},n.prototype.scan_ifd=function(e,n,i){var a=this.read_uint16(n);n+=2;for(var o=0;othis.input.length)throw t("unexpected EOF","EBADDATA");for(var h=[],d=g,p=0;p0&&(this.ifds_to_read.push({id:s,offset:h[0]}),f=!0),!1===i({is_big_endian:this.big_endian,ifd:e,tag:s,format:l,count:A,entry_offset:n+this.start,data_length:u,data_offset:g+this.start,value:h,is_subifd_link:f}))return void(this.aborted=!0);n+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(n)})},e.exports.ExifParser=n,e.exports.get_orientation=function(e){var t=0;try{return new n(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(r){return-1}}},44600:function(e,t,r){"use strict";var n=r(9696).eW,i=r(9696).eI;function a(e,t){if(e.length<4+t)return null;var r=i(e,t);return e.length>4&15,i=15&e[4],a=e[5]>>4&15,o=n(e,6),l=8,A=0;At.width||e.width===t.width&&e.height>t.height?e:t})),r=e.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t}));return t.width>r.height||t.width===r.height&&t.height>r.width?t:r}(t.sizes),n=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(n=0===e.value?r[n]:t[n=t[n=r[n]]]),"irot"===e.type)for(var i=0;i1&&(g.variants=u.variants),u.orientation&&(g.orientation=u.orientation),u.exif_location&&u.exif_location.offset+u.exif_location.length<=e.length){var f=a(e,u.exif_location.offset),h=e.slice(u.exif_location.offset+f+4,u.exif_location.offset+u.exif_location.length),d=s.get_orientation(h);d>0&&(g.orientation=d)}return g}}}}}}},38728:function(e,t,r){"use strict";var n=r(9696).wR,i=r(9696).gS,a=r(9696).Bz,o=n("BM");e.exports=function(e){if(!(e.length<26)&&i(e,0,o))return{width:a(e,18),height:a(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},5588:function(e,t,r){"use strict";var n=r(9696).wR,i=r(9696).gS,a=r(9696).Bz,o=n("GIF87a"),s=n("GIF89a");e.exports=function(e){if(!(e.length<10)&&(i(e,0,o)||i(e,0,s)))return{width:a(e,6),height:a(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},41924:function(e,t,r){"use strict";var n=r(9696).Bz;e.exports=function(e){var t=n(e,0),r=n(e,2),i=n(e,4);if(0===t&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||A>o.height)&&(o=c)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},87968:function(e,t,r){"use strict";var n=r(9696).eW,i=r(9696).wR,a=r(9696).gS,o=r(11688),s=i("Exif\0\0");e.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var r,i,l=e[t++];255===l;)l=e[t++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(e.length-t<2)return;r=n(e,t)-2,t+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(e,t,s)&&(i=o.get_orientation(e.slice(t+6,t+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(e.length-t0&&(A.orientation=i),A}t+=r}}},37276:function(e,t,r){"use strict";var n=r(9696).wR,i=r(9696).gS,a=r(9696).eI,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(e){if(!(e.length<24)&&i(e,0,o)&&i(e,12,s))return{width:a(e,16),height:a(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},90328:function(e,t,r){"use strict";var n=r(9696).wR,i=r(9696).gS,a=r(9696).eI,o=n("8BPS\0\x01");e.exports=function(e){if(!(e.length<22)&&i(e,0,o))return{width:a(e,18),height:a(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},16024:function(e){"use strict";function t(e){return"number"===typeof e&&isFinite(e)&&e>0}var r=/<[-_.:a-zA-Z0-9][^>]*>/,n=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,i=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,a=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,s=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function l(e){return s.test(e)?e.match(s)[0]:"px"}e.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function g(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<e.length)){for(;t+8=10?r=r||c(e,t+8):"VP8L"===f&&h>=9?r=r||u(e,t+8):"VP8X"===f&&h>=10?r=r||g(e,t+8):"EXIF"===f&&(n=s.get_orientation(e.slice(t+8,t+8+h)),t=1/0),t+=8+h}else t++;if(r)return n>0&&(r.orientation=n),r}}}},87480:function(e,t,r){"use strict";e.exports={avif:r(40528),bmp:r(38728),gif:r(5588),ico:r(41924),jpeg:r(87968),png:r(37276),psd:r(90328),svg:r(16024),tiff:r(98792),webp:r(20704)}},19480:function(e,t,r){"use strict";var n=r(87480);e.exports=function(e){return function(e){for(var t=Object.keys(n),r=0;r1)for(var r=1;r1&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],r(e),e.after&&e.after(e))}function B(e){if(e){null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var t=0,r=0;if(v.groups=I=e.map((function(e,A){var c=I[A];return e?("function"===typeof e?e={after:e}:"number"===typeof e[0]&&(e={positions:e}),e=o(e,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(I[A]=c={id:A,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=s({},m,e)),a(c,e,[{lineWidth:function(e){return.5*+e},capSize:function(e){return.5*+e},opacity:parseFloat,errors:function(e){return e=l(e),r+=e.length,e},positions:function(e,r){return e=l(e,"float64"),r.count=Math.floor(e.length/2),r.bounds=n(e,2),r.offset=t,t+=r.count,e}},{color:function(e,t){var r=t.count;if(e||(e="transparent"),!Array.isArray(e)||"number"===typeof e[0]){var n=e;e=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:e.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(o){t=i}return{fill:e({primitive:"triangle",elements:function(e,t){return t.triangles},offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:e.prop("scale"),color:e.prop("fill"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),viewport:function(e,t){return[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]}},attributes:{position:{buffer:e.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:t}},p.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},p.prototype.render=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];t.length&&(e=this).update.apply(e,t),this.draw()},p.prototype.draw=function(){for(var e=this,t=[],r=arguments.length;r--;)t[r]=arguments[r];return(t.length?t:this.passes).forEach((function(t,r){var n;if(t&&Array.isArray(t))return(n=e).draw.apply(n,t);"number"===typeof t&&(t=e.passes[t]),t&&t.count>1&&t.opacity&&(e.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&e.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>p.precisionThreshold||t.scale[1]*t.viewport.height>p.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=p.maxPoints)?e.shaders.rect(t):e.shaders.miter(t)))})),this},p.prototype.update=function(e){var t=this;if(e){null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=this.regl,c=this.gl;if(e.forEach((function(e,f){var y=t.passes[f];if(void 0!==e)if(null!==e){if("number"===typeof e[0]&&(e={positions:e}),e=o(e,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),y||(t.passes[f]=y={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},e=a({},p.defaults,e)),null!=e.thickness&&(y.thickness=parseFloat(e.thickness)),null!=e.opacity&&(y.opacity=parseFloat(e.opacity)),null!=e.miterLimit&&(y.miterLimit=parseFloat(e.miterLimit)),null!=e.overlay&&(y.overlay=!!e.overlay,f=L}));(T=T.slice(0,N)).push(L)}for(var F=function(e){var t=b.slice(2*R,2*T[e]).concat(L?b.slice(2*L):[]),r=(y.hole||[]).map((function(t){return t-L+(T[e]-R)})),n=l(t,r);n=n.map((function(t){return t+R+(t+Re.length)&&(t=e.length);for(var r=0,n=new Array(t);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),A.vert=g(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),p&&(A.frag=A.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=e(A)}v.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},v.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},v.prototype.draw=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;nn)?t.tree=c(e,{bounds:u}):n&&n.length&&(t.tree=n),t.tree){var g={primitive:"points",usage:"static",data:t.tree,type:"uint32"};t.elements?t.elements(g):t.elements=o.elements(g)}var f=y.float32(e);return i({data:f,usage:"dynamic"}),a({data:y.fract32(e,f),usage:"dynamic"}),s({data:new Uint8Array(A),type:"uint8",usage:"stream"}),e}},{marker:function(t,r,n){var i=r.activation;if(i.forEach((function(e){return e&&e.destroy&&e.destroy()})),i.length=0,t&&"number"!==typeof t[0]){for(var a=[],s=0,l=Math.min(t.length,r.count);s=0)return a;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)t=e;else{t=new Uint8Array(e.length);for(var o=0,s=e.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},v.prototype.updatePalette=function(e){if(!this.tooManyColors){var t=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*e.length/t);if(n>1)for(var i=.25*(e=e.slice()).length%t;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x,s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y,l.height),[a,n,o,i]}function f(e){if("number"===typeof e)return[e,e,e,e];if(2===e.length)return[e[0],e[1],e[0],e[1]];var t=l(e);return[t.x,t.y,t.x+t.width,t.y+t.height]}e.exports=c,c.prototype.render=function(){for(var e,t=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(e=this).update.apply(e,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){t.draw(),t.dirty=!0,t.planned=null}))):(this.draw(),this.dirty=!0,o((function(){t.dirty=!1}))),this)},c.prototype.update=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t.length){for(var n=0;nb))&&(s.lower||!(B>>=t))<<3,(t|=r=(15<(e>>>=r))<<2)|(r=(3<(e>>>=r))<<1)|e>>>r>>1}function f(){function e(e){e:{for(var t=16;268435456>=t;t*=16)if(e<=t){e=t;break e}e=0}return 0<(t=r[g(e)>>2]).length?t.pop():new ArrayBuffer(e)}function t(e){r[g(e.byteLength)>>2].push(e)}var r=u(8,(function(){return[]}));return{alloc:e,free:t,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){t(e.buffer)}}}function h(e){return!!e&&"object"===typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"===typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||oe(e.data))}function d(e,t,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===c?i>>=1:5125===c&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(e){n.elementsCount--,delete s[e.id],e.buffer.destroy(),e.buffer=null}var s={},l=0,A={uint8:5121,uint16:5123};t.oes_element_index_uint&&(A.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var c=[];return{create:function(e,t){function s(e){if(e)if("number"===typeof e)l(e),c.primType=4,c.vertCount=0|e,c.type=5121;else{var t=null,r=35044,n=-1,i=-1,o=0,u=0;Array.isArray(e)||oe(e)||h(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=ue[e.usage]),"primitive"in e&&(n=de[e.primitive]),"count"in e&&(i=0|e.count),"type"in e&&(u=A[e.type]),"length"in e?o=0|e.length:(o=i,5123===u||5122===u?o*=2:5125!==u&&5124!==u||(o*=4))),a(c,t,r,n,i,o,u)}else l(),c.primType=4,c.vertCount=0,c.type=5121;return s}var l=r.create(null,34963,!0),c=new i(l._buffer);return n.elementsCount++,s(e),s._reglType="elements",s._elements=c,s.subdata=function(e,t){return l.subdata(e,t),s},s.destroy=function(){o(c)},s},createStream:function(e){var t=c.pop();return t||(t=new i(r.create(null,34963,!0,!1)._buffer)),a(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){c.push(e)},getElements:function(e){return"function"===typeof e&&e._elements instanceof i?e._elements:null},clear:function(){se(s).forEach(o)}}}function C(e){for(var t=ie.allocType(5123,e.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;t[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,g(r,n[i]),e.mipmask|=1<t;++t)e.images[t]=null;return e}function b(e){for(var t=e.images,r=0;rt){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var e=0;return Object.keys(ae).forEach((function(t){e+=ae[t].stats.size})),e}),{create2D:function(t,r){function n(e,t){var r=i.texInfo;D.call(r);var a=E();return"number"===typeof e?m(a,0|e,"number"===typeof t?0|t:0|e):e?(T(r,e),I(a,e)):m(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,l(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,L(i),v(a,3553),M(r,3553),N(),b(a),o.profile&&(i.stats.size=k(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=j[i.internalformat],n.type=V[i.type],n.mag=W[r.magFilter],n.min=Z[r.minFilter],n.wrapS=X[r.wrapS],n.wrapT=X[r.wrapT],n}var i=new R(3553);return ae[i.id]=i,a.textureCount++,n(t,r),n.subimage=function(e,t,r,a){t|=0,r|=0,a|=0;var o=d();return l(o,i),o.width=0,o.height=0,g(o,e),o.width=o.width||(i.width>>a)-t,o.height=o.height||(i.height>>a)-r,L(i),f(o,3553,t,r,a),N(),p(o),n},n.resize=function(t,r){var a=0|t,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,L(i);for(var l=0;i.mipmask>>l;++l){var A=a>>l,c=s>>l;if(!A||!c)break;e.texImage2D(3553,l,i.format,A,c,0,i.format,i.type,null)}return N(),o.profile&&(i.stats.size=k(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(t,r,n,i,s,c){function u(e,t,r,n,i,a){var s,c=h.texInfo;for(D.call(c),s=0;6>s;++s)y[s]=E();if("number"!==typeof e&&e){if("object"===typeof e)if(t)I(y[0],e),I(y[1],t),I(y[2],r),I(y[3],n),I(y[4],i),I(y[5],a);else if(T(c,e),A(h,e),"faces"in e)for(e=e.faces,s=0;6>s;++s)l(y[s],h),I(y[s],e[s]);else for(s=0;6>s;++s)I(y[s],e)}else for(e=0|e||1,s=0;6>s;++s)m(y[s],e,e);for(l(h,y[0]),h.mipmask=c.genMipmaps?(y[0].width<<1)-1:y[0].mipmask,h.internalformat=y[0].internalformat,u.width=y[0].width,u.height=y[0].height,L(h),s=0;6>s;++s)v(y[s],34069+s);for(M(c,34067),N(),o.profile&&(h.stats.size=k(h.internalformat,h.type,u.width,u.height,c.genMipmaps,!0)),u.format=j[h.internalformat],u.type=V[h.type],u.mag=W[c.magFilter],u.min=Z[c.minFilter],u.wrapS=X[c.wrapS],u.wrapT=X[c.wrapT],s=0;6>s;++s)b(y[s]);return u}var h=new R(34067);ae[h.id]=h,a.cubeCount++;var y=Array(6);return u(t,r,n,i,s,c),u.subimage=function(e,t,r,n,i){r|=0,n|=0,i|=0;var a=d();return l(a,h),a.width=0,a.height=0,g(a,t),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,L(h),f(a,34069+e,r,n,i),N(),p(a),u},u.resize=function(t){if((t|=0)!==h.width){u.width=h.width=t,u.height=h.height=t,L(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)e.texImage2D(34069+r,n,h.format,t>>n,t>>n,0,h.format,h.type,null);return N(),o.profile&&(h.stats.size=k(h.internalformat,h.type,u.width,u.height,!1,!0)),u}},u._reglType="textureCube",u._texture=h,o.profile&&(u.stats=h.stats),u.destroy=function(){h.decRef()},u},clear:function(){for(var t=0;tr;++r)if(0!==(t.mipmask&1<>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;6>n;++n)e.texImage2D(34069+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);M(t.texInfo,t.target)}))},refresh:function(){for(var t=0;ti;++i){for(A=0;Ae;++e)r[e].resize(n);return t.width=t.height=n,t},_reglType:"framebufferCube",destroy:function(){r.forEach((function(e){e.destroy()}))}})},clear:function(){se(b).forEach(p)},restore:function(){I.cur=null,I.next=null,I.dirty=!0,se(b).forEach((function(t){t.framebuffer=e.createFramebuffer(),y(t)}))}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function R(e,t,r,n,i,a,o){function s(e){if(e!==y.currentVAO){var r=t.oes_vertex_array_object;e?r.bindVertexArrayOES(e.vao):r.bindVertexArrayOES(null),y.currentVAO=e}}function l(r){if(r!==y.currentVAO){if(r)r.bindAttrs();else{for(var n=t.angle_instanced_arrays,i=0;i=u.byteLength?l.subdata(u):(l.destroy(),r.buffers[s]=null)),r.buffers[s]||(l=r.buffers[s]=i.create(A,34962,!1,!0)),c.buffer=i.getBuffer(l),c.size=0|c.buffer.dimension,c.normalized=!1,c.type=c.buffer.dtype,c.offset=0,c.stride=0,c.divisor=0,c.state=1,e[s]=1):i.getBuffer(A)?(c.buffer=i.getBuffer(A),c.size=0|c.buffer.dimension,c.normalized=!1,c.type=c.buffer.dtype,c.offset=0,c.stride=0,c.divisor=0,c.state=1):i.getBuffer(A.buffer)?(c.buffer=i.getBuffer(A.buffer),c.size=0|(+A.size||c.buffer.dimension),c.normalized=!!A.normalized||!1,c.type="type"in A?ce[A.type]:c.buffer.dtype,c.offset=0|(A.offset||0),c.stride=0|(A.stride||0),c.divisor=0|(A.divisor||0),c.state=1):"x"in A&&(c.x=+A.x||0,c.y=+A.y||0,c.z=+A.z||0,c.w=+A.w||0,c.state=2)}for(l=0;le&&(e=t.stats.uniformsCount)})),e},r.getMaxAttributesCount=function(){var e=0;return g.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);se(A).forEach(t),A={},se(c).forEach(t),c={},g.forEach((function(t){e.deleteProgram(t.program)})),g.length=0,u={},r.shaderCount=0},program:function(t,n,i,a){var o=u[n];o||(o=u[n]={});var f=o[t];if(f&&(f.refCount++,!a))return f;var h=new s(n,t);return r.shaderCount++,l(h,i,a),f||(o[t]=h),g.push(h),$(h,{destroy:function(){if(h.refCount--,0>=h.refCount){e.deleteProgram(h.program);var t=g.indexOf(h);g.splice(t,1),r.shaderCount--}0>=o[h.vertId].refCount&&(e.deleteShader(c[h.vertId]),delete c[h.vertId],delete u[h.fragId][h.vertId]),Object.keys(u[h.fragId]).length||(e.deleteShader(A[h.fragId]),delete A[h.fragId],delete u[h.fragId])}})},restore:function(){A={},c={};for(var e=0;e>2),r=0;r>5]|=(255&e.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,A,c,u,g,f,h=8*e.length;for(e=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),t[h>>5]|=128<<24-h%32,t[15+(h+64>>9<<4)]=h,c=0;cu;u++){var d;16>u?r[u]=t[u+c]:(g=u,f=U(f=G(f=r[u-2],17)^G(f,19)^f>>>10,r[u-7]),d=G(d=r[u-15],7)^G(d,18)^d>>>3,r[g]=U(U(f,d),r[u-16])),g=U(U(U(U(A,g=G(g=o,6)^G(g,11)^G(g,25)),o&s^~o&l),Re[u]),r[u]),f=U(A=G(A=h,2)^G(A,13)^G(A,22),h&n^h&i^n&i),A=l,l=s,s=o,o=U(a,g),a=i,i=n,n=h,h=U(g,f)}e[0]=U(h,e[0]),e[1]=U(n,e[1]),e[2]=U(i,e[2]),e[3]=U(a,e[3]),e[4]=U(o,e[4]),e[5]=U(s,e[5]),e[6]=U(l,e[6]),e[7]=U(A,e[7])}for(t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}function O(e){for(var t,r="",n=0;n>>4&15)+"0123456789abcdef".charAt(15&t);return r}function P(e){for(var t,r,n="",i=-1;++i=t&&56320<=r&&57343>=r&&(t=65536+((1023&t)<<10)+(1023&r),i++),127>=t?n+=String.fromCharCode(t):2047>=t?n+=String.fromCharCode(192|t>>>6&31,128|63&t):65535>=t?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):2097151>=t&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return n}function G(e,t){return e>>>t|e<<32-t}function U(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function z(e){return Array.prototype.slice.call(e)}function q(e){return z(e).join("")}function H(e){function t(){var e=[],t=[];return $((function(){e.push.apply(e,z(arguments))}),{def:function(){var r="v"+i++;return t.push(r),0"+t+"?"+i+".constant["+t+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",c,"=",a,".createStream(",34962,",",i,".buffer);","}else{",c,"=",a,".getBuffer(",i,".buffer);","}",u,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",c,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",c,");","}"),l}))})),o}function D(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=V((function(e,t){return"number"===typeof r||"boolean"===typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=W(t,(function(e,r){return e.invoke(r,t)}))})),n}function T(e,t,n,i,a){function o(e){var t=l[e];t&&(u[e]=t)}var s=x(e,t),l=b(e,f=C(e,a),a),c=Q(e,a),u=_(e,a),g=w(e,a,s);o("viewport"),o(y("scissor.box"));var f,h=0>1)",s],");")}function t(){r(l,".drawArraysInstancedANGLE(",[h,d,p,s],");")}f&&"null"!==f?m?e():(r("if(",f,"){"),e(),r("}else{"),t(),r("}")):t()}function o(){function e(){r(c+".drawElements("+[h,p,y,d+"<<(("+y+"-5121)>>1)"]+");")}function t(){r(c+".drawArrays("+[h,d,p]+");")}f&&"null"!==f?m?e():(r("if(",f,"){"),e(),r("}else{"),t(),r("}")):t()}var s,l,A=e.shared,c=A.gl,u=A.draw,g=n.draw,f=function(){var i=g.elements,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a),g.elementsActive&&a("if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",u,".","elements",";","if(",i,"){",c,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",A.vao,".currentVAO){",i,"=",e.shared.elements+".getElements("+A.vao,".currentVAO.elements);",ue?"":"if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),h=i("primitive"),d=i("offset"),p=function(){var i=g.count,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a)):i=a.def(u,".","count"),i}();if("number"===typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");le&&(s=i("instances"),l=e.instancing);var y=f+".type",m=g.elements&&j(g.elements)&&!g.vaoActive;le&&("number"!==typeof s||0<=s)?"string"===typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function z(e,t,r,n,i){return i=(t=v()).proc("body",i),le&&(t.instancing=i.def(t.shared.extensions,".angle_instanced_arrays")),e(t,i,r,n),t.compile().body}function q(e,t,r,n){F(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),P(e,t,r,n.attributes,(function(){return!0}))),G(e,t,r,n.uniforms,(function(){return!0}),!1),U(e,t,t,r)}function Z(e,t){var r=e.proc("draw",1);F(e,r),M(e,r,t.context),R(e,r,t.framebuffer),L(e,r,t),N(e,r,t.state),O(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)q(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link((function(r){return z(q,e,t,r,1)})),"(",n,");",o,".call(this,a0);"))}0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(c).forEach((function(t){e+=c[t].stats.size})),e}),{create:function(t,r){function o(t,r){var n=0,a=0,c=32854;if("object"===typeof t&&t?("shape"in t?(n=0|(a=t.shape)[0],a=0|a[1]):("radius"in t&&(n=a=0|t.radius),"width"in t&&(n=0|t.width),"height"in t&&(a=0|t.height)),"format"in t&&(c=s[t.format])):"number"===typeof t?(n=0|t,a="number"===typeof r?0|r:n):t||(n=a=1),n!==A.width||a!==A.height||c!==A.format)return o.width=A.width=n,o.height=A.height=a,A.format=c,e.bindRenderbuffer(36161,A.renderbuffer),e.renderbufferStorage(36161,c,n,a),i.profile&&(A.stats.size=ke[A.format]*A.width*A.height),o.format=l[A.format],o}var A=new a(e.createRenderbuffer());return c[A.id]=A,n.renderbufferCount++,o(t,r),o.resize=function(t,r){var n=0|t,a=0|r||n;return n===A.width&&a===A.height||(o.width=A.width=n,o.height=A.height=a,e.bindRenderbuffer(36161,A.renderbuffer),e.renderbufferStorage(36161,A.format,n,a),i.profile&&(A.stats.size=ke[A.format]*A.width*A.height)),o},o._reglType="renderbuffer",o._renderbuffer=A,i.profile&&(o.stats=A.stats),o.destroy=function(){A.decRef()},o},clear:function(){se(c).forEach(o)},restore:function(){se(c).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)})),e.bindRenderbuffer(36161,null)}}},Te=[];Te[6408]=4,Te[6407]=3;var Me=[];Me[5121]=1,Me[5126]=4,Me[36193]=2;var Re=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Le=["x","y","z","w"],Ne="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Fe={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Oe={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Pe={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ge={cw:2304,ccw:2305},Ue=new K(!1,!1,!1,(function(){})),ze=function(e,t){function r(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null}function n(e,t,n){var i=o.pop()||new r;i.startQueryIndex=e,i.endQueryIndex=t,i.sum=0,i.stats=n,s.push(i)}if(!t.ext_disjoint_timer_query)return null;var i=[],a=[],o=[],s=[],l=[],A=[];return{beginQuery:function(e){var r=i.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,r),a.push(r),n(a.length-1,a.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:n,update:function(){var e,r;if(0!==(e=a.length)){A.length=Math.max(A.length,e+1),l.length=Math.max(l.length,e+1),l[0]=0;var n=A[0]=0;for(r=e=0;r=J.length&&n()}var r=X(J,e);J[r]=t}}}function g(){var e=H.viewport,t=H.scissor_box;e[0]=e[1]=t[0]=t[1]=0,S.viewportWidth=S.framebufferWidth=S.drawingBufferWidth=e[2]=t[2]=p.drawingBufferWidth,S.viewportHeight=S.framebufferHeight=S.drawingBufferHeight=e[3]=t[3]=p.drawingBufferHeight}function f(){S.tick+=1,S.time=d(),g(),q.procs.poll()}function h(){G.refresh(),g(),q.procs.refresh(),x&&x.update()}function d(){return(ne()-w)/1e3}if(!(e=A(e)))return null;var p=e.gl,y=p.getContextAttributes();p.isContextLost();var m=c(p,e);if(!m)return null;var I=i(),C={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},B=e.cachedCode||{},b=m.extensions,x=ze(p,b),w=ne(),Q=p.drawingBufferWidth,_=p.drawingBufferHeight,S={tick:0,time:0,viewportWidth:Q,viewportHeight:_,framebufferWidth:Q,framebufferHeight:_,drawingBufferWidth:Q,drawingBufferHeight:_,pixelRatio:e.pixelRatio},k=(Q={elements:null,primitive:4,count:-1,offset:0,instances:-1},ae(p,b)),M=v(p,C,e,(function(e){return O.destroyBuffer(e)})),F=E(p,b,M,C),O=R(p,b,k,C,M,F,Q),P=L(p,I,C,e),G=D(p,b,k,(function(){q.procs.poll()}),S,C,e),U=De(p,b,k,C,e),z=T(p,b,k,G,U,C),q=Z(p,I,b,k,M,F,G,z,{},O,P,Q,S,x,B,e),H=(I=N(p,z,q.procs.poll,S,y,b,k),q.next),Y=p.canvas,J=[],K=[],j=[],V=[e.onDestroy],W=null;Y&&(Y.addEventListener("webglcontextlost",a,!1),Y.addEventListener("webglcontextrestored",o,!1));var ee=z.setFBO=s({framebuffer:te.define.call(null,1,"framebuffer")});return h(),y=$(s,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var t=0;6>t;++t)ee($({framebuffer:e.framebuffer.faces[t]},e),l);else ee(e,l);else l(null,e)},prop:te.define.bind(null,1),context:te.define.bind(null,2),this:te.define.bind(null,3),draw:s({}),buffer:function(e){return M.create(e,34962,!1,!1)},elements:function(e){return F.create(e,!1)},texture:G.create2D,cube:G.createCube,renderbuffer:U.create,framebuffer:z.create,framebufferCube:z.createCube,vao:O.createVAO,attributes:y,frame:u,on:function(e,t){var r;switch(e){case"frame":return u(t);case"lost":r=K;break;case"restore":r=j;break;case"destroy":r=V}return r.push(t),{cancel:function(){for(var e=0;e4294967295||l(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,A=!0;if("length"in e&&o){var c=o(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(A=!1)}return(n||A||!r)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},29936:function(e,t,r){e.exports=i;var n=r(61252).EventEmitter;function i(){n.call(this)}r(6768)(i,n),i.Readable=r(12348),i.Writable=r(11288),i.Duplex=r(15316),i.Transform=r(22477),i.PassThrough=r(27136),i.finished=r(15932),i.pipeline=r(38180),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"===typeof e.destroy&&e.destroy())}function A(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",A),e.removeListener("error",A),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",A),e.on("error",A),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},92784:function(e){"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"===typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,a,o,s;if("string"===typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.i=t},15316:function(e,t,r){"use strict";var n=r(4168),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var a=r(12348),o=r(11288);r(6768)(c,a);for(var s=i(o.prototype),l=0;l0)if("string"===typeof t||s.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)s.endEmitted?C(e,new E):Q(e,s,t,!0);else if(s.ended)C(e,new I);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?Q(e,s,t,!1):T(e,s)):Q(e,s,t,!1)}else n||(s.reading=!1,T(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(D,e))}function D(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,F(e)}function T(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(M,e,t))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){a("readable nexttick read 0"),e.read(0)}function N(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),F(e),t.flowing&&!t.reading&&e.read(0)}function F(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function P(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(G,t,e))}function G(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?O(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(e){C(this,new v("_read()"))},x.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===i.stdout||e===i.stderr?p:A;function l(t,i){a("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,a("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",l),r.removeListener("end",A),r.removeListener("end",p),r.removeListener("data",g),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function A(){a("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",l);var c=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,F(e))}}(r);e.on("drain",c);var u=!1;function g(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==U(n.pipes,e))&&!u&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){a("onerror",t),p(),e.removeListener("error",f),0===o(e,"error")&&C(e,t)}function h(){e.removeListener("finish",d),p()}function d(){a("onfinish"),e.removeListener("close",h),p()}function p(){a("unpipe"),r.unpipe(e)}return r.on("data",g),function(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",h),e.once("finish",d),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?k(this):n.reading||i.nextTick(L,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(R,this),r},x.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(R,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(N,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,r){r(new d("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,r){var n=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,D(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=u.destroy,x.prototype._undestroy=u.undestroy,x.prototype._destroy=function(e,t){t(e)}},60328:function(e,t,r){"use strict";var n,i=r(4168);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(15932),s=Symbol("lastResolve"),l=Symbol("lastReject"),A=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),g=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function d(e){var t=e[s];if(null!==t){var r=e[f].read();null!==r&&(e[u]=null,e[s]=null,e[l]=null,t(h(r,!1)))}}function p(e){i.nextTick(d,e)}var y=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((a(n={get stream(){return this[f]},next:function(){var e=this,t=this[A];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[A]?r(e[A]):t(h(void 0,!0))}))}));var r,n=this[u];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[g](r,n)}),n)}}(n,this));else{var a=this[f].read();if(null!==a)return Promise.resolve(h(a,!1));r=new Promise(this[g])}return this[u]=r,r}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[f].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),y);e.exports=function(e){var t,r=Object.create(m,(a(t={},f,{value:e,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,A,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,g,{value:function(e,t){var n=r[f].read();n?(r[u]=null,r[s]=null,r[l]=null,e(h(n,!1))):(r[s]=e,r[l]=t)},writable:!0}),t));return r[u]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[u]=null,r[s]=null,r[l]=null,t(e)),void(r[A]=e)}var n=r[s];null!==n&&(r[u]=null,r[s]=null,r[l]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",p.bind(null,r)),r}},47264:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,i=o.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=i,n=s,o.prototype.copy.call(t,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0===(e-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&g.forEach(l),a||(g.forEach(l),u(c))}))}));return t.reduce(A)}},24888:function(e,t,r){"use strict";var n=r(92784).i.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},4776:function(e,t,r){e.exports=r(61252).EventEmitter},86032:function(e,t,r){"use strict";var n=r(30456).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!==typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=A,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=u,t=3;break;default:return this.write=g,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function A(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.o=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},55619:function(e,t,r){var n=r(45408),i=r(86844)("stream-parser");e.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),e._bytes=c,e._skipBytes=u,t&&(e._passthrough=g),t?e._transform=h:e._write=f};var a=-1,o=0,s=1,l=2;function A(e){i("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=a,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function c(e,t){n(!this._parserCallback,'there is already a "callback" set!'),n(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||A(this),i("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=o}function u(e,t){n(!this._parserCallback,'there is already a "callback" set!'),n(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||A(this),i("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=s}function g(e,t){n(!this._parserCallback,'There is already a "callback" set!'),n(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||A(this),i("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=l}function f(e,t,r){this._parserInit||A(this),i("write(%o bytes)",e.length),"function"==typeof t&&(r=t),p(this,e,null,r)}function h(e,t,r){this._parserInit||A(this),i("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),p(this,e,t,r)}function d(e,t,r,n){if(e._parserBytesLeft-=t.length,i("%o bytes left for stream piece",e._parserBytesLeft),e._parserState===o?(e._parserBuffers.push(t),e._parserBuffered+=t.length):e._parserState===l&&r(t),0!==e._parserBytesLeft)return n;var s=e._parserCallback;if(s&&e._parserState===o&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),e._parserState!==o&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=a,e._parserBuffers.splice(0),s){var A=[];t&&A.push(t),r&&A.push(r);var c=s.length>A.length;c&&A.push(y(n));var u=s.apply(e,A);if(!c||n===u)return n}}var p=y((function e(t,r,n,i){return t._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return d(t,r,n,i)}:function(){var a=r.slice(0,t._parserBytesLeft);return d(t,a,n,(function(o){return o?i(o):r.length>a.length?function(){return e(t,r.slice(a.length),n,i)}:void 0}))}}));function y(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}},86844:function(e,t,r){var n=r(4168);function i(){var e;try{e=t.storage.debug}catch(r){}return!e&&"undefined"!==typeof n&&"env"in n&&(e=n.env.DEBUG),e}(t=e.exports=r(89416)).log=function(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))})),e.splice(a,0,n)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(r){}},t.load=i,t.useColors=function(){return!("undefined"===typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(i())},89416:function(e,t,r){var n;function i(e){function r(){if(r.enabled){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(e){if(!((e=String(e)).length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*a;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===A&&!1===isNaN(e))return s.long?o(l=e,i,"day")||o(l,n,"hour")||o(l,r,"minute")||o(l,t,"second")||l+" ms":function(e){return e>=i?Math.round(e/i)+"d":e>=n?Math.round(e/n)+"h":e>=r?Math.round(e/r)+"m":e>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},39956:function(e,t,r){"use strict";var n=r(32868);e.exports=function(e,t,r){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");r?("string"===typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"===typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(e){return 1===e.length&&(e+=e),e})));var i=n.parse(e,{flat:!0,brackets:r.ignore}),a=i[0].split(t);if(r.escape){for(var o=[],s=0;s0;){t=A[A.length-1];var f=e[t];if(a[t]=0&&s[t].push(o[d])}a[t]=h}else{if(n[t]===r[t]){var p=[],y=[],m=0;for(h=l.length-1;h>=0;--h){var I=l[h];if(i[I]=!1,p.push(I),y.push(s[I]),m+=s[I].length,o[I]=u.length,I===t){l.length=h;break}}u.push(p);var v=new Array(m);for(h=0;h1&&(i=1),i<-1&&(i=-1),(e*n-t*r<0?-1:1)*Math.acos(i)};t.default=function(e){var t=e.px,r=e.py,l=e.cx,A=e.cy,c=e.rx,u=e.ry,g=e.xAxisRotation,f=void 0===g?0:g,h=e.largeArcFlag,d=void 0===h?0:h,p=e.sweepFlag,y=void 0===p?0:p,m=[];if(0===c||0===u)return[];var I=Math.sin(f*i/360),v=Math.cos(f*i/360),E=v*(t-l)/2+I*(r-A)/2,C=-I*(t-l)/2+v*(r-A)/2;if(0===E&&0===C)return[];c=Math.abs(c),u=Math.abs(u);var B=Math.pow(E,2)/Math.pow(c,2)+Math.pow(C,2)/Math.pow(u,2);B>1&&(c*=Math.sqrt(B),u*=Math.sqrt(B));var b=function(e,t,r,n,a,o,l,A,c,u,g,f){var h=Math.pow(a,2),d=Math.pow(o,2),p=Math.pow(g,2),y=Math.pow(f,2),m=h*d-h*y-d*p;m<0&&(m=0),m/=h*y+d*p;var I=(m=Math.sqrt(m)*(l===A?-1:1))*a/o*f,v=m*-o/a*g,E=u*I-c*v+(e+r)/2,C=c*I+u*v+(t+n)/2,B=(g-I)/a,b=(f-v)/o,x=(-g-I)/a,w=(-f-v)/o,Q=s(1,0,B,b),_=s(B,b,x,w);return 0===A&&_>0&&(_-=i),1===A&&_<0&&(_+=i),[E,C,Q,_]}(t,r,l,A,c,u,d,y,I,v,E,C),x=n(b,4),w=x[0],Q=x[1],_=x[2],S=x[3],k=Math.abs(S)/(i/4);Math.abs(1-k)<1e-7&&(k=1);var D=Math.max(Math.ceil(k),1);S/=D;for(var T=0;Tt[2]&&(t[2]=A[c+0]),A[c+1]>t[3]&&(t[3]=A[c+1]);return t}},41976:function(e,t,r){"use strict";e.exports=function(e){for(var t,r=[],o=0,s=0,l=0,A=0,c=null,u=null,g=0,f=0,h=0,d=e.length;h4?(o=p[p.length-4],s=p[p.length-3]):(o=g,s=f),r.push(p)}return r};var n=r(92848);function i(e,t,r,n){return["C",e,t,r,n,r,n]}function a(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},20472:function(e,t,r){"use strict";var n,i=r(74840),a=r(21984),o=r(22235),s=r(53520),l=r(29620),A=document.createElement("canvas"),c=A.getContext("2d");e.exports=function(e,t){if(!s(e))throw Error("Argument should be valid svg path string");var r,u;t||(t={}),t.shape?(r=t.shape[0],u=t.shape[1]):(r=A.width=t.w||t.width||200,u=A.height=t.h||t.height||200);var g=Math.min(r,u),f=t.stroke||0,h=t.viewbox||t.viewBox||i(e),d=[r/(h[2]-h[0]),u/(h[3]-h[1])],p=Math.min(d[0]||0,d[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,r,u),c.fillStyle="white",f&&("number"!=typeof f&&(f=1),c.strokeStyle=f>0?"white":"black",c.lineWidth=Math.abs(f)),c.translate(.5*r,.5*u),c.scale(p,p),function(){if(null!=n)return n;var e=document.createElement("canvas").getContext("2d");if(e.canvas.width=e.canvas.height=1,!window.Path2D)return n=!1;var t=new Path2D("M0,0h1v1h-1v-1Z");e.fillStyle="black",e.fill(t);var r=e.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var y=new Path2D(e);c.fill(y),f&&c.stroke(y)}else{var m=a(e);o(c,m),c.fill(),f&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=t.cutoff?t.cutoff:.5,radius:null!=t.radius?t.radius:.5*g})}},49760:function(e,t,r){var n;!function(i){var a=/^\s+/,o=/\s+$/,s=0,l=i.round,A=i.min,c=i.max,u=i.random;function g(e,t){if(t=t||{},(e=e||"")instanceof g)return e;if(!(this instanceof g))return new g(e,t);var r=function(e){var t,r,n,s={r:0,g:0,b:0},l=1,u=null,g=null,f=null,h=!1,d=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(o,"").toLowerCase();var t,r=!1;if(k[e])e=k[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=G.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=G.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=G.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=G.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=G.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=G.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=G.hex8.exec(e))?{r:L(t[1]),g:L(t[2]),b:L(t[3]),a:P(t[4]),format:r?"name":"hex8"}:(t=G.hex6.exec(e))?{r:L(t[1]),g:L(t[2]),b:L(t[3]),format:r?"name":"hex"}:(t=G.hex4.exec(e))?{r:L(t[1]+""+t[1]),g:L(t[2]+""+t[2]),b:L(t[3]+""+t[3]),a:P(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=G.hex3.exec(e))&&{r:L(t[1]+""+t[1]),g:L(t[2]+""+t[2]),b:L(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(t=e.r,r=e.g,n=e.b,s={r:255*M(t,255),g:255*M(r,255),b:255*M(n,255)},h=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(u=F(e.s),g=F(e.v),s=function(e,t,r){e=6*M(e,360),t=M(t,100),r=M(r,100);var n=i.floor(e),a=e-n,o=r*(1-t),s=r*(1-a*t),l=r*(1-(1-a)*t),A=n%6,c=[r,s,o,o,l,r][A],u=[l,r,r,s,o,o][A],g=[o,o,l,r,r,s][A];return{r:255*c,g:255*u,b:255*g}}(e.h,u,g),h=!0,d="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(u=F(e.s),f=F(e.l),s=function(e,t,r){var n,i,a;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=M(e,360),t=M(t,100),r=M(r,100),0===t)n=i=a=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,u,f),h=!0,d="hsl"),e.hasOwnProperty("a")&&(l=e.a)),l=T(l),{ok:h,format:e.format||d,r:A(255,c(s.r,0)),g:A(255,c(s.g,0)),b:A(255,c(s.b,0)),a:l}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=l(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=r.ok,this._tc_id=s++}function f(e,t,r){e=M(e,255),t=M(t,255),r=M(r,255);var n,i,a=c(e,t,r),o=A(e,t,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case e:n=(t-r)/l+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(g(n));return a}function S(e,t){t=t||6;for(var r=g(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(g({h:n,s:i,v:a})),a=(a+s)%1;return o}g.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:i.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=T(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=f(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,i){var a=[N(l(e).toString(16)),N(l(t).toString(16)),N(l(r).toString(16)),N(O(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*M(this._r,255))+"%",g:l(100*M(this._g,255))+"%",b:l(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*M(this._r,255))+"%, "+l(100*M(this._g,255))+"%, "+l(100*M(this._b,255))+"%)":"rgba("+l(100*M(this._r,255))+"%, "+l(100*M(this._g,255))+"%, "+l(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(D[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=g(e);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return g(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(E,arguments)},darken:function(){return this._applyModification(C,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(I,arguments)},spin:function(){return this._applyModification(B,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(_,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(Q,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},g.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:F(e[n]));e=r}return g(e,t)},g.equals=function(e,t){return!(!e||!t)&&g(e).toRgbString()==g(t).toRgbString()},g.random=function(){return g.fromRatio({r:u(),g:u(),b:u()})},g.mix=function(e,t,r){r=0===r?0:r||50;var n=g(e).toRgb(),i=g(t).toRgb(),a=r/100;return g({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},g.readability=function(e,t){var r=g(e),n=g(t);return(i.max(r.getLuminance(),n.getLuminance())+.05)/(i.min(r.getLuminance(),n.getLuminance())+.05)},g.isReadable=function(e,t,r){var n,i,a=g.readability(e,t);switch(i=!1,(n=function(e){var t,r;return t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},g.mostReadable=function(e,t,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var A=0;Al&&(l=n,s=g(t[A]));return g.isReadable(e,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,g.mostReadable(e,["#fff","#000"],r))};var k=g.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"},D=g.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(k);function T(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function M(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(e);return e=A(t,c(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),i.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function R(e){return A(1,c(0,e))}function L(e){return parseInt(e,16)}function N(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function O(e){return i.round(255*parseFloat(e)).toString(16)}function P(e){return L(e)/255}var G=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",r="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+r),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})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function U(e){return!!G.CSS_UNIT.exec(e)}e.exports?e.exports=g:void 0===(n=function(){return g}.call(t,r,t,e))||(e.exports=n)}(Math)},37816:function(e){"use strict";e.exports=r,e.exports.float32=e.exports.float=r,e.exports.fract32=e.exports.fract=function(e,t){if(e.length){if(e instanceof Float32Array)return new Float32Array(e.length);t instanceof Float32Array||(t=r(e));for(var n=0,i=t.length;n":(t.length>100&&(t=t.slice(0,99)+"\u2026"),t=t.replace(i,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},7328:function(e,t,r){"use strict";var n=r(81680),i={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!n(e)&&hasOwnProperty.call(i,typeof e)}},87396:function(e,t,r){"use strict";var n=r(57980),i=r(85488);e.exports=function(e){return i(e)?e:n(e,"%v is not a plain function",arguments[1])}},85488:function(e,t,r){"use strict";var n=r(73384),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(e){return!!n(e)&&!i.test(a.call(e))}},54612:function(e,t,r){"use strict";var n=r(7328);e.exports=function(e){if(!n(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}}},33940:function(e,t,r){"use strict";var n=r(81680),i=r(7328),a=Object.prototype.toString;e.exports=function(e){if(!n(e))return null;if(i(e)){var t=e.toString;if("function"!==typeof t)return null;if(t===a)return null}try{return""+e}catch(r){return null}}},18496:function(e,t,r){"use strict";var n=r(57980),i=r(81680);e.exports=function(e){return i(e)?e:n(e,"Cannot use %v",arguments[1])}},81680:function(e){"use strict";e.exports=function(e){return void 0!==e&&null!==e}},14144:function(e,t,r){"use strict";var n=r(308),i=r(10352),a=r(33576).Buffer;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!==typeof Uint8ClampedArray,s="undefined"!==typeof BigUint64Array,l="undefined"!==typeof BigInt64Array,A=r.g.__TYPEDARRAY_POOL;A.UINT8C||(A.UINT8C=i([32,0])),A.BIGUINT64||(A.BIGUINT64=i([32,0])),A.BIGINT64||(A.BIGINT64=i([32,0])),A.BUFFER||(A.BUFFER=i([32,0]));var c=A.DATA,u=A.BUFFER;function g(e){if(e){var t=e.length||e.byteLength,r=n.log2(t);c[r].push(e)}}function f(e){e=n.nextPow2(e);var t=n.log2(e),r=c[t];return r.length>0?r.pop():new ArrayBuffer(e)}function h(e){return new Uint8Array(f(e),0,e)}function d(e){return new Uint16Array(f(2*e),0,e)}function p(e){return new Uint32Array(f(4*e),0,e)}function y(e){return new Int8Array(f(e),0,e)}function m(e){return new Int16Array(f(2*e),0,e)}function I(e){return new Int32Array(f(4*e),0,e)}function v(e){return new Float32Array(f(4*e),0,e)}function E(e){return new Float64Array(f(8*e),0,e)}function C(e){return o?new Uint8ClampedArray(f(e),0,e):h(e)}function B(e){return s?new BigUint64Array(f(8*e),0,e):null}function b(e){return l?new BigInt64Array(f(8*e),0,e):null}function x(e){return new DataView(f(e),0,e)}function w(e){e=n.nextPow2(e);var t=n.log2(e),r=u[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))u[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);c[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){g(e.buffer)},t.freeArrayBuffer=g,t.freeBuffer=function(e){u[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return f(e);switch(t){case"uint8":return h(e);case"uint16":return d(e);case"uint32":return p(e);case"int8":return y(e);case"int16":return m(e);case"int32":return I(e);case"float":case"float32":return v(e);case"double":case"float64":return E(e);case"uint8_clamped":return C(e);case"bigint64":return b(e);case"biguint64":return B(e);case"buffer":return w(e);case"data":case"dataview":return x(e);default:return null}return null},t.mallocArrayBuffer=f,t.mallocUint8=h,t.mallocUint16=d,t.mallocUint32=p,t.mallocInt8=y,t.mallocInt16=m,t.mallocInt32=I,t.mallocFloat32=t.mallocFloat=v,t.mallocFloat64=t.mallocDouble=E,t.mallocUint8Clamped=C,t.mallocBigUint64=B,t.mallocBigInt64=b,t.mallocDataView=x,t.mallocBuffer=w,t.clearCache=function(){for(var e=0;e<32;++e)A.UINT8[e].length=0,A.UINT16[e].length=0,A.UINT32[e].length=0,A.INT8[e].length=0,A.INT16[e].length=0,A.INT32[e].length=0,A.FLOAT[e].length=0,A.DOUBLE[e].length=0,A.BIGUINT64[e].length=0,A.BIGINT64[e].length=0,A.UINT8C[e].length=0,c[e].length=0,u[e].length=0}},92384:function(e){var t=/[\'\"]/;e.exports=function(e){return e?(t.test(e.charAt(0))&&(e=e.substr(1)),t.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}},45223:function(e){"use strict";e.exports=function(e,t,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),g(n,e,n.depth)}function c(e,t){var r=A.styles[t];return r?"\x1b["+A.colors[r][0]+"m"+e+"\x1b["+A.colors[r][1]+"m":e}function u(e,t){return e}function g(e,r,n){if(e.customInspect&&r&&x(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return I(i)||(i=g(e,i,n)),i}var a=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(I(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),b(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(x(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(B(r))return e.stylize(Date.prototype.toString.call(r),"date");if(b(r))return f(r)}var A,c="",u=!1,C=["{","}"];return d(r)&&(u=!0,C=["[","]"]),x(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(c=" "+RegExp.prototype.toString.call(r)),B(r)&&(c=" "+Date.prototype.toUTCString.call(r)),b(r)&&(c=" "+f(r)),0!==o.length||u&&0!=r.length?n<0?E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),A=u?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(A,c,C)):C[0]+c+C[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),S(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=y(r)?g(e,l.value,null):g(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),v(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"===typeof e}function y(e){return null===e}function m(e){return"number"===typeof e}function I(e){return"string"===typeof e}function v(e){return void 0===e}function E(e){return C(e)&&"[object RegExp]"===w(e)}function C(e){return"object"===typeof e&&null!==e}function B(e){return C(e)&&"[object Date]"===w(e)}function b(e){return C(e)&&("[object Error]"===w(e)||e instanceof Error)}function x(e){return"function"===typeof e}function w(e){return Object.prototype.toString.call(e)}function Q(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(s.test(e)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=A,A.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},A.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(41088),t.isArray=d,t.isBoolean=p,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=I,t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=v,t.isRegExp=E,t.types.isRegExp=E,t.isObject=C,t.isDate=B,t.types.isDate=B,t.isError=b,t.types.isNativeError=b,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=r(75272);var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",function(){var e=new Date,t=[Q(e.getHours()),Q(e.getMinutes()),Q(e.getSeconds())].join(":");return[e.getDate(),_[e.getMonth()],t].join(" ")}(),t.format.apply(t,arguments))},t.inherits=r(6768),t._extend=function(e,t){if(!t||!C(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var k="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function D(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var t;if("function"!==typeof(t=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a-1?t:"Object"===t&&function(e){var t=!1;return n(d,(function(r,n){if(!t)try{r(e),t=g(n,1)}catch(i){}})),t}(e)}return s?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{"$"+r(e)===n&&(t=g(n,1))}catch(i){}})),t}(e):null}},67020:function(e,t,r){var n=r(38700),i=r(50896),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"===typeof e){var r=e.match(l);return r?r[0]:""}var n=this._validateYear(e),i=e.month(),a=""+this.toChineseMonth(n,i);return t&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(e){if("string"===typeof e){var t=e.match(A);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(e){if("string"===typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var i=t[t.length-1];r="i"===i||"I"===i}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!==typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var i=this.intercalaryMonth(e);if(r&&t!==i||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&t<=i?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var i,o=this._validateYear(e,n.local.invalidyear),s=g[o-g[0]],l=s>>9&4095,A=s>>5&15,c=31&s;(i=a.newDate(l,A,c)).add(4-(i.dayOfWeek()||7),"d");var u=this.toJD(e,t,r)-i.toJD();return 1+Math.floor(u/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=u[e-u[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,s,r,n.local.invalidDate);e=this._validateYear(i.year()),t=i.month(),r=i.day();var o=this.isIntercalaryMonth(e,t),s=this.toChineseMonth(e,t),l=function(e,t,r,n,i){var a,o,s;if("object"===typeof e)o=e,a=t||{};else{var l;if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"===typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:e,month:t,day:r,isIntercalary:l}}s=o.day-1;var A,c=u[o.year-u[0]],f=c>>13;A=f&&(o.month>f||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(d>>5&15)-1,(31&d)+s);return a.year=p.getFullYear(),a.month=1+p.getMonth(),a.day=p.getDate(),a}(e,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(e){var t=a.fromJD(e),r=function(e,t,r,n){var i,a;if("object"===typeof e)i=e,a=t||{};else{if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:e,month:t,day:r},a=n||{}}var o=g[i.year-g[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=g[a.year-g[0]];var l,A=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(i.year,i.month-1,i.day);l=Math.round((c-A)/864e5);var f,h=u[a.year-u[0]];for(f=0;f<13;f++){var d=h&1<<12-f?30:29;if(l>13;return!p||f=2&&n<=6},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year()+(i.year()<0?1:0),t=i.month(),(r=i.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},65168:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4===3||e%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},2084:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=e<=0?e+1:e,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(t<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=a},26368:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year(),t=i.month(),e=e<=0?e+1:e,(r=i.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=a},24747:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4===0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year(),t=i.month(),r=i.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((t-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=t-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},65616:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function s(e,t){return o(e-1,t)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o(8+(e-=this.jdEpoch)+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[s(20+(e-=this.jdEpoch),20),s(e+4,13)]},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=a},30632:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidMonth);(e=i.year())<0&&e++;for(var a=i.day(),s=1;s=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=a},73040:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=n.instance(),o=0,s=t,l=e;this._createMissingCalendarData(e);var A=e-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==t&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(A)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(A,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),i=t.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var A=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,A)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=e-(e>=0?474:473),s=474+o(a,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var A=e-this.toJD(l,1,1)+1,c=A<=186?Math.ceil(A/31):Math.ceil((A-6)/30),u=e-this.toJD(l,c,1)+1;return this.newDate(l,c,u)}}),n.calendars.persian=a,n.calendars.jalali=a},51456:function(e,t,r){var n=r(38700),i=r(50896),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),a.leapYear(e)},weekOfYear:function(e,t,r){var i=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(i.year()),a.weekOfYear(e,i.month(),i.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(i.year()),a.toJD(e,i.month(),i.day())},fromJD:function(e){var t=a.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},4592:function(e,t,r){var n=r(38700),i=r(50896),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),a.leapYear(e)},weekOfYear:function(e,t,r){var i=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(i.year()),a.weekOfYear(e,i.month(),i.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(i.year()),a.toJD(e,i.month(),i.day())},fromJD:function(e){var t=a.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},45348:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,A=t-o[r-1]+1;return this.newDate(s,l,A)},isValid:function(e,t,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(e=null!=e.year?e.year:e)>=1276&&e<=1500),i},_validate:function(e,t,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},38700:function(e,t,r){var n=r(50896);function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(A.local.invalidDate||A.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function s(){this.shortYearCutoff="+10"}function l(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(i.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,i){return(n=(null!=e&&e.year?e.calendar():"string"===typeof n?this.instance(n,i):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":e[a]+t[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(a.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(A.local.invalidDate||A.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(A.local.differentCalendars||A.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new a(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,A.local.invalidYear||A.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,A.local.invalidYear||A.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,A.local.invalidYear||A.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,A.local.invalidMonth||A.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,A.local.invalidMonth||A.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,A.local.invalidYear||A.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,A.local.invalidDate||A.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),i=e.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);i=e.day(),"y"===r?(e.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(e){for(;ot-1+e.minMonth;)a++,o-=t,t=e.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(l){throw this._validateLevel--,l}},_correctAdd:function(e,t,r,n){if(!this.hasYearZero&&("y"===n||"m"===n)&&(0===t[0]||e.year()>0!==t[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;t=this._add(e,r*i[0]+a*i[1],i[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,A.local.invalidDate||A.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),i="m"===r?t:e.month(),a="d"===r?t:e.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),e.date(n,i,a)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var i=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),A=i-(l>2.5?4716:4715);return A<=0&&A--,this.newDate(A,l,s)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var A=e.exports=new i;A.cdate=a,A.baseCalendar=s,A.calendars.gregorian=l},15168:function(e,t,r){var n=r(50896),i=r(38700);n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(e,t){return"string"!==typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!==typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,A=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,u=r.monthNamesShort||this.local.monthNamesShort,g=r.monthNames||this.local.monthNames,f=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;C+n1}),h=function(e,t,r,n){var i=""+t;if(f(e,n))for(;i.length1},I=function(e,r){var n=m(e,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=t.substring(x).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,x);return x+=s[0].length,parseInt(s[0],10)},v=this,E=function(){if("function"===typeof l){m("m");var e=l.call(v,t.substring(x));return x+=e.length,e}return I("m")},C=function(e,r,n,a){for(var o=m(e,a)?n:r,s=0;s-1){f=1,h=d;for(var _=this.daysInMonth(g,f);h>_;_=this.daysInMonth(g,f))f++,h-=_}return u>-1?this.fromJD(u):this.newDate(g,f,h)},determineDate:function(e,t,r,n,i){r&&"object"!==typeof r&&(i=n,n=r,r=null),"string"!==typeof n&&(i=n,n="");var a=this;return t=t?t.newDate():null,e=null==e?t:"string"===typeof e?function(e){try{return a.parseDate(n,e,i)}catch(l){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(e);s;)t.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(e);return t}(e):"number"===typeof e?isNaN(e)||e===1/0||e===-1/0?t:a.today().add(e,"d"):a.newDate(e)}})},21576:function(){},19768:function(){},63436:function(e,t,r){"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"===typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?B(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?B(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=g.exec(e))?new x(t[1],t[2],t[3],1):(t=f.exec(e))?new x(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=h.exec(e))?B(t[1],t[2],t[3],t[4]):(t=d.exec(e))?B(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=p.exec(e))?D(t[1],t[2]/100,t[3]/100,1):(t=y.exec(e))?D(t[1],t[2]/100,t[3]/100,t[4]):m.hasOwnProperty(e)?C(m[e]):"transparent"===e?new x(NaN,NaN,NaN,0):null}function C(e){return new x(e>>16&255,e>>8&255,255&e,1)}function B(e,t,r,n){return n<=0&&(e=t=r=NaN),new x(e,t,r,n)}function b(e,t,r,n){return 1===arguments.length?((i=e)instanceof a||(i=E(i)),i?new x((i=i.rgb()).r,i.g,i.b,i.opacity):new x):new x(e,t,r,null==n?1:n);var i}function x(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function w(){return"#".concat(k(this.r)).concat(k(this.g)).concat(k(this.b))}function Q(){var e=_(this.opacity);return"".concat(1===e?"rgb(":"rgba(").concat(S(this.r),", ").concat(S(this.g),", ").concat(S(this.b)).concat(1===e?")":", ".concat(e,")"))}function _(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function S(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function k(e){return((e=S(e))<16?"0":"")+e.toString(16)}function D(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new M(e,t,r,n)}function T(e){if(e instanceof M)return new M(e.h,e.s,e.l,e.opacity);if(e instanceof a||(e=E(e)),!e)return new M;if(e instanceof M)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=NaN,l=o-i,A=(o+i)/2;return l?(s=t===o?(r-n)/l+6*(r0&&A<1?0:s,new M(s,l,A,e.opacity)}function M(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function R(e){return(e=(e||0)%360)<0?e+360:e}function L(e){return Math.max(0,Math.min(1,e||0))}function N(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function F(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}n(a,E,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:I,formatHex:I,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return T(this).formatHsl()},formatRgb:v,toString:v}),n(x,b,i(a,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new x(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?o:Math.pow(o,e),new x(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},clamp:function(){return new x(S(this.r),S(this.g),S(this.b),_(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:w,formatHex:w,formatHex8:function(){return"#".concat(k(this.r)).concat(k(this.g)).concat(k(this.b)).concat(k(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:Q,toString:Q})),n(M,(function(e,t,r,n){return 1===arguments.length?T(e):new M(e,t,r,null==n?1:n)}),i(a,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new M(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?o:Math.pow(o,e),new M(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new x(N(e>=240?e-240:e+120,i,n),N(e,i,n),N(e<120?e+240:e-120,i,n),this.opacity)},clamp:function(){return new M(R(this.h),L(this.s),L(this.l),_(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=_(this.opacity);return"".concat(1===e?"hsl(":"hsla(").concat(R(this.h),", ").concat(100*L(this.s),"%, ").concat(100*L(this.l),"%").concat(1===e?")":", ".concat(e,")"))}}));var O=function(e){return function(){return e}};function P(e,t){return function(r){return e+r*t}}function G(e){return 1===(e=+e)?U:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):O(isNaN(t)?r:t)}}function U(e,t){var r=t-e;return r?P(e,r):O(isNaN(e)?t:e)}var z=function e(t){var r=G(t);function n(e,t){var n=r((e=b(e)).r,(t=b(t)).r),i=r(e.g,t.g),a=r(e.b,t.b),o=U(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1);function q(e){return function(t){var r,n,i=t.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=na&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:J(r,n)})),a=W.lastIndex;return a{"use strict";var n=r(4141),i=r(3275),a=r(2803),o="data";e.exports=function(e,t){var r=n(t),g=t,f=a;if(r in e.normal)return e.property[e.normal[r]];r.length>4&&r.slice(0,4)===o&&s.test(t)&&("-"===t.charAt(4)?g=function(e){var t=e.slice(5).replace(l,u);return o+t.charAt(0).toUpperCase()+t.slice(1)}(t):t=function(e){var t=e.slice(4);if(l.test(t))return e;t=t.replace(A,c),"-"!==t.charAt(0)&&(t="-"+t);return o+t}(t),f=i);return new f(g,t)};var s=/^data[-\w.:]+$/i,l=/-[a-z]/g,A=/[A-Z]/g;function c(e){return"-"+e.toLowerCase()}function u(e){return e.charAt(1).toUpperCase()}},4509:(e,t,r)=>{"use strict";var n=r(2723),i=r(9366),a=r(8599),o=r(9696),s=r(5349),l=r(7321);e.exports=n([a,i,o,s,l])},5349:(e,t,r)=>{"use strict";var n=r(3498),i=r(6155),a=n.booleanish,o=n.number,s=n.spaceSeparated;e.exports=i({transform:function(e,t){return"role"===t?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:a,ariaAutoComplete:null,ariaBusy:a,ariaChecked:a,ariaColCount:o,ariaColIndex:o,ariaColSpan:o,ariaControls:s,ariaCurrent:null,ariaDescribedBy:s,ariaDetails:null,ariaDisabled:a,ariaDropEffect:s,ariaErrorMessage:null,ariaExpanded:a,ariaFlowTo:s,ariaGrabbed:a,ariaHasPopup:null,ariaHidden:a,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:s,ariaLevel:o,ariaLive:null,ariaModal:a,ariaMultiLine:a,ariaMultiSelectable:a,ariaOrientation:null,ariaOwns:s,ariaPlaceholder:null,ariaPosInSet:o,ariaPressed:a,ariaReadOnly:a,ariaRelevant:null,ariaRequired:a,ariaRoleDescription:s,ariaRowCount:o,ariaRowIndex:o,ariaRowSpan:o,ariaSelected:a,ariaSetSize:o,ariaSort:null,ariaValueMax:o,ariaValueMin:o,ariaValueNow:o,ariaValueText:null,role:null}})},7321:(e,t,r)=>{"use strict";var n=r(3498),i=r(6155),a=r(9010),o=n.boolean,s=n.overloadedBoolean,l=n.booleanish,A=n.number,c=n.spaceSeparated,u=n.commaSeparated;e.exports=i({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:a,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:u,acceptCharset:c,accessKey:c,action:null,allow:null,allowFullScreen:o,allowPaymentRequest:o,allowUserMedia:o,alt:null,as:null,async:o,autoCapitalize:null,autoComplete:c,autoFocus:o,autoPlay:o,capture:o,charSet:null,checked:o,cite:null,className:c,cols:A,colSpan:null,content:null,contentEditable:l,controls:o,controlsList:c,coords:A|u,crossOrigin:null,data:null,dateTime:null,decoding:null,default:o,defer:o,dir:null,dirName:null,disabled:o,download:s,draggable:l,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:o,formTarget:null,headers:c,height:A,hidden:o,high:A,href:null,hrefLang:null,htmlFor:c,httpEquiv:c,id:null,imageSizes:null,imageSrcSet:u,inputMode:null,integrity:null,is:null,isMap:o,itemId:null,itemProp:c,itemRef:c,itemScope:o,itemType:c,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:o,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:o,muted:o,name:null,nonce:null,noModule:o,noValidate:o,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:o,optimum:A,pattern:null,ping:c,placeholder:null,playsInline:o,poster:null,preload:null,readOnly:o,referrerPolicy:null,rel:c,required:o,reversed:o,rows:A,rowSpan:A,sandbox:c,scope:null,scoped:o,seamless:o,selected:o,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:l,src:null,srcDoc:null,srcLang:null,srcSet:u,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:o,useMap:null,value:l,width:A,wrap:null,align:null,aLink:null,archive:c,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:o,declare:o,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:o,noHref:o,noShade:o,noWrap:o,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:l,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:o,disableRemotePlayback:o,prefix:null,property:null,results:A,security:null,unselectable:null}})},9010:(e,t,r)=>{"use strict";var n=r(2367);e.exports=function(e,t){return n(e,t.toLowerCase())}},2367:e=>{"use strict";e.exports=function(e,t){return t in e?e[t]:t}},6155:(e,t,r)=>{"use strict";var n=r(4141),i=r(5224),a=r(3275);e.exports=function(e){var t,r,o=e.space,s=e.mustUseProperty||[],l=e.attributes||{},A=e.properties,c=e.transform,u={},g={};for(t in A)r=new a(t,c(l,t),A[t],o),-1!==s.indexOf(t)&&(r.mustUseProperty=!0),u[t]=r,g[n(t)]=t,g[n(r.attribute)]=t;return new i(u,g,o)}},3275:(e,t,r)=>{"use strict";var n=r(2803),i=r(3498);e.exports=s,s.prototype=new n,s.prototype.defined=!0;var a=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],o=a.length;function s(e,t,r,s){var A,c=-1;for(l(this,"space",s),n.call(this,e,t);++c{"use strict";e.exports=r;var t=r.prototype;function r(e,t){this.property=e,this.attribute=t}t.space=null,t.attribute=null,t.property=null,t.boolean=!1,t.booleanish=!1,t.overloadedBoolean=!1,t.number=!1,t.commaSeparated=!1,t.spaceSeparated=!1,t.commaOrSpaceSeparated=!1,t.mustUseProperty=!1,t.defined=!1},2723:(e,t,r)=>{"use strict";var n=r(49),i=r(5224);e.exports=function(e){var t,r,a=e.length,o=[],s=[],l=-1;for(;++l{"use strict";e.exports=r;var t=r.prototype;function r(e,t,r){this.property=e,this.normal=t,r&&(this.space=r)}t.space=null,t.normal={},t.property={}},3498:(e,t)=>{"use strict";var r=0;function n(){return Math.pow(2,++r)}t.boolean=n(),t.booleanish=n(),t.overloadedBoolean=n(),t.number=n(),t.spaceSeparated=n(),t.commaSeparated=n(),t.commaOrSpaceSeparated=n()},9366:(e,t,r)=>{"use strict";var n=r(6155);e.exports=n({space:"xlink",transform:function(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}})},8599:(e,t,r)=>{"use strict";var n=r(6155);e.exports=n({space:"xml",transform:function(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}})},9696:(e,t,r)=>{"use strict";var n=r(6155),i=r(9010);e.exports=n({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:i,properties:{xmlns:null,xmlnsXLink:null}})},4141:e=>{"use strict";e.exports=function(e){return e.toLowerCase()}},2730:(e,t,r)=>{"use strict";var n=r(5043),i=r(8853);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r
contributors',o=['\xa9 Carto',a].join(" "),s=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),l={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:s,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:s,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},A=n(l);e.exports={requiredVersion:i,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:l,styleValuesNonMapbox:A,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+i+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",A.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},89032:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t){var r=e.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(t)?n.mean(t):t,s=.5+o/100,l=1.5+o/100,A=["",""],c=[0,0];switch(i){case"top":A[0]="top",c[1]=-l;break;case"bottom":A[0]="bottom",c[1]=l}switch(a){case"left":A[1]="right",c[0]=-s;break;case"right":A[1]="left",c[0]=s}return{anchor:A[0]&&A[1]?A.join("-"):A[0]?A[0]:A[1]?A[1]:"center",offset:c}}},33688:function(e,t,r){"use strict";var n=r(3480),i=r(3400),a=i.strTranslate,o=i.strScale,s=r(84888).KY,l=r(9616),A=r(33428),c=r(43616),u=r(72736),g=r(14440),f="mapbox",h=t.constants=r(47552);function d(e){return"string"===typeof e&&(-1!==h.styleValuesMapbox.indexOf(e)||0===e.indexOf("mapbox://")||0===e.indexOf("stamen"))}t.name=f,t.attr="subplot",t.idRoot=f,t.idRegex=t.attrRegex=i.counterRegex(f),t.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},t.layoutAttributes=r(5232),t.supplyLayoutDefaults=r(5976),t.plot=function(e){var t=e._fullLayout,r=e.calcdata,a=t._subplots[f];if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var o=function(e,t){var r=e._fullLayout,n=e._context;if(""===n.mapboxAccessToken)return"";for(var a=[],o=[],s=!1,l=!1,A=0;A1&&i.warn(h.multipleTokensErrorMsg),a[0]):(o.length&&i.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(e,a);n.accessToken=o;for(var l=0;lC/2){var B=m.split("|").join("
");v.text(B).attr("data-unformatted",B).call(u.convertToTspans,e),E=c.bBox(v.node())}v.attr("transform",a(-3,8-E.height)),I.insert("rect",".static-attribution").attr({x:-E.width-6,y:-E.height-3,width:E.width+6,height:E.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;E.width+6>C&&(b=C/(E.width+6));var x=[n.l+n.w*g.x[1],n.t+n.h*(1-g.y[0])];I.attr("transform",a(x[0],x[1])+o(b))}},t.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[f],n=0;n0){for(var r=0;r0}function c(e){var t={},r={};switch(e.type){case"circle":n.extendFlat(r,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":n.extendFlat(r,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var i=e.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(t,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":e.color,"text-color":i.textfont.color,"text-opacity":e.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:r}}l.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=A(e)},l.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},l.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},l.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapboxLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},l.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,A(e)){var r=function(e){var t,r=e.sourcetype,n=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"===typeof n?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=n,e.sourceattribution&&(a.attribution=i(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&p(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&A.click(n,t.originalEvent)}}},v.updateFx=function(e){var t=this,r=t.map,n=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[A([r.xmin,r.ymin]),A([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(A)};var s=t.dragOptions;t.dragOptions=i.extendDeep(s||{},{dragmode:e.dragmode,element:t.div,gd:n,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),g(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){f(e,r,n,t.dragOptions,o)},l.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function A(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},v.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},v.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t=t.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=t._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){C.sendDataToCloud(e)}));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})}}(e,o),s.text(o.text()&&l.text()?" - ":"")}},C.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=C.graphJson(e,!1,"keepdata"),i.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var x=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function Q(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,i={};function a(e){for(var r=!0,a=0;a1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(A,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,C.linkSubplots(g,s,c,n),C.cleanPlot(g,s,c,n);var P=!(!n._has||!n._has("gl2d")),G=!(!s._has||!s._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||P,z=!(!s._has||!s._has("cartesian"))||G;U&&!z?n._bgLayer.remove():z&&!U&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&d({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var i=0;i0){var c=1-2*s;n=Math.round(c*n),i=Math.round(c*i)}}var g=C.layoutAttributes.width.min,f=C.layoutAttributes.height.min;n1,d=!t.height&&Math.abs(r.height-i)>1;(d||h)&&(h&&(r.width=n),d&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),C.sanitizeMargins(r)},C.supplyLayoutModuleDefaults=function(e,t,r,n){var i,a,o,s=l.componentsRegistry,A=t._basePlotModules,c=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(e,t);for(var g in A.length||A.push(c),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),c.finalizeSubplots(e,t)),t._subplots)t._subplots[g].sort(u.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(f){var m=(r.t+r.b)/f;m>1&&(r.t/=m,r.b/=m)}var I=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,E=void 0!==r.yt?r.yt:r.y,B=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:I,size:r.l+p},r:{val:v,size:r.r+p},b:{val:B,size:r.b+p},t:{val:E,size:r.t+p}},d[t]=1}else delete h[t],delete d[t];if(!n._replotting)return C.doAutoMargin(e)}},C.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),T(t);var i=t._size,a=t.margin,s={t:0,b:0,l:0,r:0},A=u.extendFlat({},i),c=a.l,g=a.r,f=a.t,d=a.b,p=t._pushmargin,y=t._pushmarginIds,m=t.minreducedwidth,I=t.minreducedheight;if(!1!==a.autoexpand){for(var v in p)y[v]||delete p[v];var E=e._fullLayout._reservedMargin;for(var B in E)for(var b in E[B]){var x=E[B][b];s[b]=Math.max(s[b],x)}for(var w in p.base={l:{val:0,size:c},r:{val:1,size:g},t:{val:1,size:f},b:{val:0,size:d}},s){var Q=0;for(var _ in p)"base"!==_&&o(p[_][w].size)&&(Q=p[_][w].size>Q?p[_][w].size:Q);var S=Math.max(0,a[w]-Q);s[w]=Math.max(0,s[w]-S)}for(var k in p){var D=p[k].l||{},M=p[k].b||{},R=D.val,L=D.size,N=M.val,F=M.size,O=r-s.r-s.l,P=n-s.t-s.b;for(var G in p){if(o(L)&&p[G].r){var U=p[G].r.val,z=p[G].r.size;if(U>R){var q=(L*U+(z-O)*R)/(U-R),H=(z*(1-R)+(L-O)*(1-U))/(U-R);q+H>c+g&&(c=q,g=H)}}if(o(F)&&p[G].t){var Y=p[G].t.val,J=p[G].t.size;if(Y>N){var K=(F*Y+(J-P)*N)/(Y-N),j=(J*(1-N)+(F-P)*(1-Y))/(Y-N);K+j>d+f&&(d=K,f=j)}}}}}var V=u.constrain(r-a.l-a.r,2,m),W=u.constrain(n-a.t-a.b,2,I),Z=Math.max(0,r-V),X=Math.max(0,n-W);if(Z){var $=(c+g)/Z;$>1&&(c/=$,g/=$)}if(X){var ee=(d+f)/X;ee>1&&(d/=ee,f/=ee)}if(i.l=Math.round(c)+s.l,i.r=Math.round(g)+s.r,i.t=Math.round(f)+s.t,i.b=Math.round(d)+s.b,i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!t._replotting&&(C.didMarginChange(A,i)||function(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var t=h.list(e,"",!0);for(var r in t)if(t[r].autoshift||t[r].shift)return!0;return!1}(e))){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var te=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function s(){return a++,function(){var t;o++,n||o!==a||(t=i,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)))}}r.runFn(s),setTimeout(s())}))}],a=u.syncOrAsync(i,e);return a&&a.then||(a=Promise.resolve()),a.then((function(){return e}))}C.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},C.graphJson=function(e,t,r,n,i,a){(i&&t&&!e._fullData||i&&!t&&!e._fullLayout)&&C.supplyDefaults(e);var o=i?e._fullData:e.data,l=i?e._fullLayout:e.layout,A=(e._transitionData||{})._frames;function c(e,t){if("function"===typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,i={};return Object.keys(e).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!==typeof e[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(e[a],t)}else t&&(i[a]="_function")})),i}var a=Array.isArray(e),o=u.isTypedArray(e);if((a||o)&&e.dtype&&e.shape){var l=e.bdata;return c({dtype:e.dtype,shape:e.shape,bdata:u.isArrayBuffer(l)?s.encode(l):l},t)}return a?e.map((function(e){return c(e,t)})):o?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var g={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(g.layout=c(l),i)){var f=l._size;g.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return A&&(g.frames=c(A)),a&&(g.config=c(e._context,!0)),"object"===n?g:JSON.stringify(g)},C.modifyFrames=function(e,t){var r,n,i,a=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;a--)if(l[a].enabled){r._indexToPoints=l[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,g[t]=o}}for(N(o,s,c),i=0;i1e-10?e:0}function g(e,t,r){t=t||0,r=r||0;for(var n=e.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,t.length);return[t[r],t[i]]},findIntersectionXY:A,findXYatLength:function(e,t,r,n){var i=-t*r,a=t*t+1,o=2*(t*i-r),s=i*i+r*r-e*e,l=Math.sqrt(o*o-4*a*s),A=(-o+l)/(2*a),c=(-o-l)/(2*a);return[[A,t*A+i+n],[c,t*c+i+n]]},clampTiny:u,pathPolygon:function(e,t,r,n,i,a){return"M"+g(c(e,t,r,n),i,a).join("L")},pathPolygonAnnulus:function(e,t,r,n,i,a,o){var s,l;e=90||l>90&&A>=450?1:u<=0&&f<=0?0:Math.max(u,f),t=l<=180&&A>=180||l>180&&A>=540?-1:c>=0&&g>=0?0:Math.min(c,g),r=l<=270&&A>=270||l>270&&A>=630?-1:u>=0&&f>=0?0:Math.min(u,f),n=A>=360?1:c<=0&&g<=0?0:Math.max(c,g),[t,r,n,i]}(h),E=v[2]-v[0],C=v[3]-v[1],B=f/g,b=Math.abs(C/E);B>b?(d=g,I=(f-(p=g*b))/i.h/2,y=[s[0],s[1]],m=[u[0]+I,u[1]-I]):(p=f,I=(g-(d=f/b))/i.w/2,y=[s[0]+I,s[1]-I],m=[u[0],u[1]]),r.xLength2=d,r.yLength2=p,r.xDomain2=y,r.yDomain2=m;var x,w=r.xOffset2=i.l+i.w*y[0],Q=r.yOffset2=i.t+i.h*(1-m[1]),_=r.radius=d/E,S=r.innerRadius=r.getHole(t)*_,k=r.cx=w-_*v[0],D=r.cy=Q+_*v[3],T=r.cxx=k-w,M=r.cyy=D-Q,R=a.side;"counterclockwise"===R?(x=R,R="top"):"clockwise"===R&&(x=R,R="bottom"),r.radialAxis=r.mockAxis(e,t,a,{_id:"x",side:R,_trueSide:x,domain:[S/i.w,_/i.w]}),r.angularAxis=r.mockAxis(e,t,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(e,t),r.updateAngularAxis(e,t),r.updateRadialAxis(e,t),r.updateRadialAxisTitle(e,t),r.xaxis=r.mockCartesianAxis(e,t,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(e,t,{_id:"y",domain:m});var F=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",F).attr("transform",l(T,M)),n.frontplot.attr("transform",l(w,Q)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",F).attr("transform",l(k,D)).call(A.fill,t.bgcolor)},P.mockAxis=function(e,t,r,n){var i=o.extendFlat({},r,n);return h(i,t,e),i},P.mockCartesianAxis=function(e,t,r){var n=this,i=n.isSmith,a=r._id,s=o.extendFlat({type:"linear"},r);f(s,e);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var e=n.sectorBBox,r=l[a],i=n.radialAxis._rl,o=(i[1]-i[0])/(1-n.getHole(t));s.range=[e[r[0]]*o,e[r[1]]*o]},s.isPtWithinRange="x"!==a||i?function(){return!0}:function(e){return n.isPtInside(e)},s.setRange(),s.setScale(),s},P.doAutoRange=function(e,t){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(t);d(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],void 0!==i.minallowed){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]90&&d<=270&&(p.tickangle=180);var I=m?function(e){var t=M(r,k([e.x,0]));return l(t[0]-u,t[1]-f)}:function(e){return l(p.l2p(e.x)+c,0)},v=m?function(e){return T(r,e.x,-1/0,1/0)}:function(e){return r.pathArc(p.r2p(e.x)+c)},E=G(h);if(r.radialTickLayout!==E&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=E),y){p.setScale();var C=0,B=m?(p.tickvals||[]).filter((function(e){return e>=0})).map((function(e){return g.tickText(p,e,!0,!1)})):g.calcTicks(p),b=m?B:g.clipEnds(p,B),x=g.getTickSigns(p)[2];m&&(("top"===p.ticks&&"bottom"===p.side||"bottom"===p.ticks&&"top"===p.side)&&(x=-x),"top"===p.ticks&&"top"===p.side&&(C=-p.ticklen),"bottom"===p.ticks&&"bottom"===p.side&&(C=p.ticklen)),g.drawTicks(n,p,{vals:B,layer:i["radial-axis"],path:g.makeTickPath(p,0,x),transFn:I,crisp:!1}),g.drawGrid(n,p,{vals:b,layer:i["radial-grid"],path:v,transFn:o.noop,crisp:!1}),g.drawLabels(n,p,{vals:B,layer:i["radial-axis"],transFn:I,labelFns:g.makeLabelFns(p,C)})}var w=r.radialAxisAngle=r.vangles?F(U(N(h.angle),r.vangles)):h.angle,Q=l(u,f),_=Q+s(-w);z(i["radial-axis"],y&&(h.showticklabels||h.ticks),{transform:_}),z(i["radial-grid"],y&&h.showgrid,{transform:m?"":Q}),z(i["radial-line"].select("line"),y&&h.showline,{x1:m?-a:c,y1:0,x2:a,y2:0,transform:_}).attr("stroke-width",h.linewidth).call(A.stroke,h.linecolor)},P.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(t),A=n.id+"title",u=0;if(l.title){var g=c.bBox(n.layers["radial-axis"].node()).height,f=l.title.font.size,h=l.side;u="top"===h?f:"counterclockwise"===h?-(g+.4*f):g+.8*f}var d=void 0!==r?r:n.radialAxisAngle,p=N(d),y=Math.cos(p),m=Math.sin(p),v=o+a/2*y+u*m,E=s-a/2*m+u*y;n.layers["radial-axis-title"]=I.draw(i,A,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:R(i,"Click to enter radial axis title"),attributes:{x:v,y:E,"text-anchor":"middle"},transform:{rotate:-d}})}},P.updateAngularAxis=function(e,t){var r=this,n=r.gd,i=r.layers,a=r.radius,c=r.innerRadius,u=r.cx,f=r.cy,h=r.getAngular(t),d=r.angularAxis,p=r.isSmith;p||(r.fillViewInitialKey("angularaxis.rotation",h.rotation),d.setGeometry(),d.setScale());var y=p?function(e){var t=M(r,k([0,e.x]));return Math.atan2(t[0]-u,t[1]-f)-Math.PI/2}:function(e){return d.t2g(e.x)};"linear"===d.type&&"radians"===d.thetaunit&&(d.tick0=F(d.tick0),d.dtick=F(d.dtick));var m=function(e){return l(u+a*Math.cos(e),f-a*Math.sin(e))},I=p?function(e){var t=M(r,k([0,e.x]));return l(t[0],t[1])}:function(e){return m(y(e))},v=p?function(e){var t=M(r,k([0,e.x])),n=Math.atan2(t[0]-u,t[1]-f)-Math.PI/2;return l(t[0],t[1])+s(-F(n))}:function(e){var t=y(e);return m(t)+s(-F(t))},E=p?function(e){return D(r,e.x,0,1/0)}:function(e){var t=y(e),r=Math.cos(t),n=Math.sin(t);return"M"+[u+c*r,f-c*n]+"L"+[u+a*r,f-a*n]},C=g.makeLabelFns(d,0).labelStandoff,B={xFn:function(e){var t=y(e);return Math.cos(t)*C},yFn:function(e){var t=y(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(C+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*w)},anchorFn:function(e){var t=y(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(e,t,r){var n=y(e);return-.5*(1+Math.sin(n))*r}},b=G(h);r.angularTickLayout!==b&&(i["angular-axis"].selectAll("."+d._id+"tick").remove(),r.angularTickLayout=b);var x,Q=p?[1/0].concat(d.tickvals||[]).map((function(e){return g.tickText(d,e,!0,!1)})):g.calcTicks(d);if(p&&(Q[0].text="\u221e",Q[0].fontSize*=1.75),"linear"===t.gridshape?(x=Q.map(y),o.angleDelta(x[0],x[1])<0&&(x=x.slice().reverse())):x=null,r.vangles=x,"category"===d.type&&(Q=Q.filter((function(e){return o.isAngleInsideSector(y(e),r.sectorInRad)}))),d.visible){var _="inside"===d.ticks?-1:1,S=(d.linewidth||1)/2;g.drawTicks(n,d,{vals:Q,layer:i["angular-axis"],path:"M"+_*S+",0h"+_*d.ticklen,transFn:v,crisp:!1}),g.drawGrid(n,d,{vals:Q,layer:i["angular-grid"],path:E,transFn:o.noop,crisp:!1}),g.drawLabels(n,d,{vals:Q,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:I,labelFns:B})}z(i["angular-line"].select("path"),h.showline,{d:r.pathSubplot(),transform:l(u,f)}).attr("stroke-width",h.linewidth).call(A.stroke,h.linecolor)},P.updateFx=function(e,t){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e))},P.updateHoverAndMainDrag=function(e){var t,r,s=this,A=s.isSmith,c=s.gd,u=s.layers,g=e._zoomlayer,f=Q.MINZOOM,h=Q.OFFEDGE,d=s.radius,I=s.innerRadius,B=s.cx,b=s.cy,x=s.cxx,w=s.cyy,S=s.sectorInRad,k=s.vangles,D=s.radialAxis,T=_.clampTiny,M=_.findXYatLength,R=_.findEnclosingVertexAngles,L=Q.cornerHalfWidth,N=Q.cornerLen/2,F=p.makeDragger(u,"path","maindrag",!1===e.dragmode?"none":"crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(B,b)),F.onmousemove=function(e){m.hover(c,e,s.id),c._fullLayout._lasthover=F,c._fullLayout._hoversubplot=s.id},F.onmouseout=function(e){c._dragging||y.unhover(c,e)};var O,P,G,U,z,q,H,Y,J,K={element:F,gd:c,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function j(e,t){return Math.sqrt(e*e+t*t)}function V(e,t){return j(e-x,t-w)}function W(e,t){return Math.atan2(w-t,e-x)}function Z(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function X(e,t){if(0===e)return s.pathSector(2*L);var r=N/e,n=t-r,i=t+r,a=Math.max(0,Math.min(e,d)),o=a-L,l=a+L;return"M"+Z(o,n)+"A"+[o,o]+" 0,0,0 "+Z(o,i)+"L"+Z(l,i)+"A"+[l,l]+" 0,0,1 "+Z(l,n)+"Z"}function $(e,t,r){if(0===e)return s.pathSector(2*L);var n,i,a=Z(e,t),o=Z(e,r),l=T((a[0]+o[0])/2),A=T((a[1]+o[1])/2);if(l&&A){var c=A/l,u=-1/c,g=M(L,c,l,A);n=M(N,u,g[0][0],g[0][1]),i=M(N,u,g[1][0],g[1][1])}else{var f,h;A?(f=N,h=L):(f=L,h=N),n=[[l-f,A-h],[l+f,A-h]],i=[[l-f,A+h],[l+f,A+h]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function ee(e,t){return t=Math.max(Math.min(t,d),I),ef?(e-1&&1===e&&E(t,c,[s.xaxis],[s.yaxis],s.id,K),r.indexOf("event")>-1&&m.click(c,t,s.id)}K.prepFn=function(e,n,a){var l=c._fullLayout.dragmode,u=F.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var f=c._fullLayout._invTransform;t=c._fullLayout._invScaleX,r=c._fullLayout._invScaleY;var h=o.apply3DTransform(f)(n-u.left,a-u.top);if(O=h[0],P=h[1],k){var y=_.findPolygonOffset(d,S[0],S[1],k);O+=x+y[0],P+=w+y[1]}switch(l){case"zoom":K.clickFn=se,A||(K.moveFn=k?ie:re,K.doneFn=ae,function(){G=null,U=null,z=s.pathSubplot(),q=!1;var e=c._fullLayout[s.id];H=i(e.bgcolor).getLuminance(),(Y=p.makeZoombox(g,H,B,b,z)).attr("fill-rule","evenodd"),J=p.makeCorners(g,B,b),C(c)}());break;case"select":case"lasso":v(e,n,a,K,l)}},y.init(K)},P.updateRadialDrag=function(e,t,r){var i=this,A=i.gd,c=i.layers,u=i.radius,g=i.innerRadius,f=i.cx,h=i.cy,d=i.radialAxis,m=Q.radialDragBoxSize,I=m/2;if(d.visible){var v,E,B,w=N(i.radialAxisAngle),_=d._rl,S=_[0],k=_[1],D=_[r],T=.75*(_[1]-_[0])/(1-i.getHole(t))/u;r?(v=f+(u+I)*Math.cos(w),E=h-(u+I)*Math.sin(w),B="radialdrag"):(v=f+(g-I)*Math.cos(w),E=h-(g-I)*Math.sin(w),B="radialdrag-inner");var M,R,L,O=p.makeRectDragger(c,B,"crosshair",-I,-I,m,m),P={element:O,gd:A};!1===e.dragmode&&(P.dragmode=!1),z(n.select(O),d.visible&&g0===(r?L>S:Ln?function(e){return e<=0}:function(e){return e>=0};e.c2g=function(r){var n=e.c2l(r)-t;return(s(n)?n:0)+o},e.g2c=function(r){return e.l2c(r+t-o)},e.g2p=function(e){return e*a},e.c2p=function(t){return e.g2p(e.c2g(t))}}}(e,t);break;case"angularaxis":!function(e,t){var r=e.type;if("linear"===r){var i=e.d2c,s=e.c2d;e.d2c=function(e,t){return function(e,t){return"degrees"===t?a(e):e}(i(e),t)},e.c2d=function(e,t){return s(function(e,t){return"degrees"===t?o(e):e}(e,t))}}e.makeCalcdata=function(t,r){var n,i,a=t[r],o=t._length,s=function(r){return e.d2c(r,t.thetaunit)};if(a)for(n=new Array(o),i=0;i0?1:0}function r(e){var t=e[0],r=e[1];if(!isFinite(t)||!isFinite(r))return[1,0];var n=(t+1)*(t+1)+r*r;return[(t*t+r*r-1)/n,2*r/n]}function n(e,t){var r=t[0],n=t[1];return[r*e.radius+e.cx,-n*e.radius+e.cy]}function i(e,t){return t*e.radius}e.exports={smith:r,reactanceArc:function(e,t,a,o){var s=n(e,r([a,t])),l=s[0],A=s[1],c=n(e,r([o,t])),u=c[0],g=c[1];if(0===t)return["M"+l+","+A,"L"+u+","+g].join(" ");var f=i(e,1/Math.abs(t));return["M"+l+","+A,"A"+f+","+f+" 0 0,"+(t<0?1:0)+" "+u+","+g].join(" ")},resistanceArc:function(e,a,o,s){var l=i(e,1/(a+1)),A=n(e,r([a,o])),c=A[0],u=A[1],g=n(e,r([a,s])),f=g[0],h=g[1];if(t(o)!==t(s)){var d=n(e,r([a,0]));return["M"+c+","+u,"A"+l+","+l+" 0 0,"+(00){for(var n=[],i=0;i=c&&(g.min=0,h.min=0,p.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function d(e,t,r,n){var i=g[t._name];function o(r,n){return a.coerce(e,t,i,r,n)}o("uirevision",n.uirevision),t.type="linear";var f=o("color"),h=f!==i.color.dflt?f:r.font.color,d=t._name.charAt(0).toUpperCase(),p="Component "+d,y=o("title.text",p);t._hovertitle=y===p?y:d,a.coerceFont(o,"title.font",{weight:r.font.weight,style:r.font.style,variant:r.font.variant,family:r.font.family,size:a.bigFont(r.font.size),color:h}),o("min"),c(e,t,o,"linear"),l(e,t,o,"linear"),s(e,t,o,"linear",{noAutotickangles:!0}),A(e,t,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{weight:r.font.weight,style:r.font.style,variant:r.font.variant,family:r.font.family,size:r.font.size,color:h}),o("tickangle"),o("tickformat")),u(e,t,o,{dfltColor:f,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:g,handleDefaults:h,font:t.font,paper_bgcolor:t.paper_bgcolor})}},24696:function(e,t,r){"use strict";var n=r(33428),i=r(49760),a=r(24040),o=r(3400),s=o.strTranslate,l=o._,A=r(76308),c=r(43616),u=r(78344),g=r(92880).extendFlat,f=r(7316),h=r(54460),d=r(86476),p=r(93024),y=r(72760),m=y.freeMode,I=y.rectMode,v=r(81668),E=r(22676).prepSelect,C=r(22676).selectOnClick,B=r(22676).clearOutline,b=r(22676).clearSelectionsCache,x=r(33816);function w(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=w;var Q=w.prototype;Q.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},Q.plot=function(e,t){var r=this,n=t[r.id],i=t._size;r._hasClipOnAxisFalse=!1;for(var a=0;a_*v?i=(a=v)*_:a=(i=I)/_,o=y*i/I,l=m*a/v,r=t.l+t.w*d-i/2,n=t.t+t.h*(1-p)-a/2,f.x0=r,f.y0=n,f.w=i,f.h=a,f.sum=E,f.xaxis={type:"linear",range:[C+2*b-E,E-C-2*B],domain:[d-o/2,d+o/2],_id:"x"},u(f.xaxis,f.graphDiv._fullLayout),f.xaxis.setScale(),f.xaxis.isPtWithinRange=function(e){return e.a>=f.aaxis.range[0]&&e.a<=f.aaxis.range[1]&&e.b>=f.baxis.range[1]&&e.b<=f.baxis.range[0]&&e.c>=f.caxis.range[1]&&e.c<=f.caxis.range[0]},f.yaxis={type:"linear",range:[C,E-B-b],domain:[p-l/2,p+l/2],_id:"y"},u(f.yaxis,f.graphDiv._fullLayout),f.yaxis.setScale(),f.yaxis.isPtWithinRange=function(){return!0};var x=f.yaxis.domain[0],w=f.aaxis=g({},e.aaxis,{range:[C,E-B-b],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[x,x+l*_],anchor:"free",position:0,_id:"y",_length:i});u(w,f.graphDiv._fullLayout),w.setScale();var Q=f.baxis=g({},e.baxis,{range:[E-C-b,B],side:"bottom",domain:f.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(Q,f.graphDiv._fullLayout),Q.setScale();var S=f.caxis=g({},e.caxis,{range:[E-C-B,b],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[x,x+l*_],anchor:"free",position:0,_id:"y",_length:i});u(S,f.graphDiv._fullLayout),S.setScale();var k="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";f.clipDef.select("path").attr("d",k),f.layers.plotbg.select("path").attr("d",k);var D="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";f.clipDefRelative.select("path").attr("d",D);var T=s(r,n);f.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",T),f.clipDefRelative.select("path").attr("transform",null);var M=s(r-Q._offset,n+a);f.layers.baxis.attr("transform",M),f.layers.bgrid.attr("transform",M);var R=s(r+i/2,n)+"rotate(30)"+s(0,-w._offset);f.layers.aaxis.attr("transform",R),f.layers.agrid.attr("transform",R);var L=s(r+i/2,n)+"rotate(-30)"+s(0,-S._offset);f.layers.caxis.attr("transform",L),f.layers.cgrid.attr("transform",L),f.drawAxes(!0),f.layers.aline.select("path").attr("d",w.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(A.stroke,w.linecolor||"#000").style("stroke-width",(w.linewidth||0)+"px"),f.layers.bline.select("path").attr("d",Q.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(A.stroke,Q.linecolor||"#000").style("stroke-width",(Q.linewidth||0)+"px"),f.layers.cline.select("path").attr("d",S.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(A.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),f.graphDiv._context.staticPlot||f.initInteractions(),c.setClipUrl(f.layers.frontplot,f._hasClipOnAxisFalse?null:f.clipId,f.graphDiv)},Q.drawAxes=function(e){var t=this,r=t.graphDiv,n=t.id.substr(7)+"title",i=t.layers,a=t.aaxis,o=t.baxis,s=t.caxis;if(t.drawAx(a),t.drawAx(o),t.drawAx(s),e){var A=Math.max(a.showticklabels?a.tickfont.size/2:0,(s.showticklabels?.75*s.tickfont.size:0)+("outside"===s.ticks?.87*s.ticklen:0)),c=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=v.draw(r,"a"+n,{propContainer:a,propName:t.id+".aaxis.title",placeholder:l(r,"Click to enter Component A title"),attributes:{x:t.x0+t.w/2,y:t.y0-a.title.font.size/3-A,"text-anchor":"middle"}}),i["b-title"]=v.draw(r,"b"+n,{propContainer:o,propName:t.id+".baxis.title",placeholder:l(r,"Click to enter Component B title"),attributes:{x:t.x0-c,y:t.y0+t.h+.83*o.title.font.size+c,"text-anchor":"middle"}}),i["c-title"]=v.draw(r,"c"+n,{propContainer:s,propName:t.id+".caxis.title",placeholder:l(r,"Click to enter Component C title"),attributes:{x:t.x0+t.w+c,y:t.y0+t.h+.83*s.title.font.size+c,"text-anchor":"middle"}})}},Q.drawAx=function(e){var t,r=this,n=r.graphDiv,i=e._name,a=i.charAt(0),s=e._id,l=r.layers[i],A=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);r[A]!==c&&(l.selectAll("."+s+"tick").remove(),r[A]=c),e.setScale();var u=h.calcTicks(e),g=h.clipEnds(e,u),f=h.makeTransTickFn(e),d=h.getTickSigns(e)[2],p=o.deg2rad(30),y=d*(e.linewidth||1)/2,m=d*e.ticklen,I=r.w,v=r.h,E="b"===a?"M0,"+y+"l"+Math.sin(p)*m+","+Math.cos(p)*m:"M"+y+",0l"+Math.cos(p)*m+","+-Math.sin(p)*m,C={a:"M0,0l"+v+",-"+I/2,b:"M0,0l-"+I/2+",-"+v,c:"M0,0l-"+v+","+I/2}[a];h.drawTicks(n,e,{vals:"inside"===e.ticks?g:u,layer:l,path:E,transFn:f,crisp:!1}),h.drawGrid(n,e,{vals:g,layer:r.layers[a+"grid"],path:C,transFn:f,crisp:!1}),h.drawLabels(n,e,{vals:u,layer:l,transFn:f,labelFns:h.makeLabelFns(e,0,30)})};var S=x.MINZOOM/2+.87,k="m-0.87,.5h"+S+"v3h-"+(S+5.2)+"l"+(S/2+2.6)+",-"+(.87*S+4.5)+"l2.6,1.5l-"+S/2+","+.87*S+"Z",D="m0.87,.5h-"+S+"v3h"+(S+5.2)+"l-"+(S/2+2.6)+",-"+(.87*S+4.5)+"l-2.6,1.5l"+S/2+","+.87*S+"Z",T="m0,1l"+S/2+","+.87*S+"l2.6,-1.5l-"+(S/2+2.6)+",-"+(.87*S+4.5)+"l-"+(S/2+2.6)+","+(.87*S+4.5)+"l2.6,1.5l"+S/2+",-"+.87*S+"Z",M=!0;function R(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}Q.clearOutline=function(){b(this.dragOptions),B(this.dragOptions.gd)},Q.initInteractions=function(){var e,t,r,n,u,g,f,h,y,v,B,b,w=this,Q=w.layers.plotbg.select("path").node(),S=w.graphDiv,L=S._fullLayout._zoomlayer;function N(e){var t={};return t[w.id+".aaxis.min"]=e.a,t[w.id+".baxis.min"]=e.b,t[w.id+".caxis.min"]=e.c,t}function F(e,t){var r=S._fullLayout.clickmode;R(S),2===e&&(S.emit("plotly_doubleclick",null),a.call("_guiRelayout",S,N({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&C(t,S,[w.xaxis],[w.yaxis],w.id,w.dragOptions),r.indexOf("event")>-1&&p.click(S,t,w.id)}function O(e,t){return 1-t/w.h}function P(e,t){return 1-(e+(w.h-t)/Math.sqrt(3))/w.w}function G(e,t){return(e-(w.h-t)/Math.sqrt(3))/w.w}function U(i,a){var o=r+i*e,s=n+a*t,l=Math.max(0,Math.min(1,O(0,n),O(0,s))),A=Math.max(0,Math.min(1,P(r,n),P(o,s))),c=Math.max(0,Math.min(1,G(r,n),G(o,s))),d=(l/2+c)*w.w,p=(1-l/2-A)*w.w,m=(d+p)/2,I=p-d,E=(1-l)*w.h,C=E-I/_;I.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),b.transition().style("opacity",1).duration(200),v=!0),S.emit("plotly_relayouting",N(f))}function z(){R(S),f!==u&&(a.call("_guiRelayout",S,N(f)),M&&S.data&&S._context.showTips&&(o.notifier(l(S,"Double-click to zoom back out"),"long"),M=!1))}function q(e,t){var r=e/w.xaxis._m,n=t/w.yaxis._m,i=[(f={a:u.a-n,b:u.b+(r+n)/2,c:u.c-(r-n)/2}).a,f.b,f.c].sort(o.sorterAsc),a=i.indexOf(f.a),l=i.indexOf(f.b),A=i.indexOf(f.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),f={a:i[a],b:i[l],c:i[A]},t=(u.a-f.a)*w.yaxis._m,e=(u.c-f.c-u.b+f.b)*w.xaxis._m);var g=s(w.x0+e,w.y0+t);w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",g);var h=s(-e,-t);w.clipDefRelative.select("path").attr("transform",h),w.aaxis.range=[f.a,w.sum-f.b-f.c],w.baxis.range=[w.sum-f.a-f.c,f.b],w.caxis.range=[w.sum-f.a-f.b,f.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,w),S.emit("plotly_relayouting",N(f))}function H(){a.call("_guiRelayout",S,N(f))}this.dragOptions={element:Q,gd:S,plotinfo:{id:w.id,domain:S._fullLayout[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(a,l,c){w.dragOptions.xaxes=[w.xaxis],w.dragOptions.yaxes=[w.yaxis],e=S._fullLayout._invScaleX,t=S._fullLayout._invScaleY;var d=w.dragOptions.dragmode=S._fullLayout.dragmode;m(d)?w.dragOptions.minDrag=1:w.dragOptions.minDrag=void 0,"zoom"===d?(w.dragOptions.moveFn=U,w.dragOptions.clickFn=F,w.dragOptions.doneFn=z,function(e,t,a){var l=Q.getBoundingClientRect();r=t-l.left,n=a-l.top,S._fullLayout._calcInverseTransform(S);var c=S._fullLayout._invTransform,d=o.apply3DTransform(c)(r,n);r=d[0],n=d[1],u={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},f=u,g=w.aaxis.range[1]-u.a,h=i(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),y="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",v=!1,B=L.append("path").attr("class","zoombox").attr("transform",s(w.x0,w.y0)).style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",y),b=L.append("path").attr("class","zoombox-corners").attr("transform",s(w.x0,w.y0)).style({fill:A.background,stroke:A.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),w.clearOutline(S)}(0,l,c)):"pan"===d?(w.dragOptions.moveFn=q,w.dragOptions.clickFn=F,w.dragOptions.doneFn=H,u={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},f=u,w.clearOutline(S)):(I(d)||m(d))&&E(a,l,c,w.dragOptions,d)}},Q.onmousemove=function(e){p.hover(S,e,w.id),S._fullLayout._lasthover=Q,S._fullLayout._hoversubplot=w.id},Q.onmouseout=function(e){S._dragging||d.unhover(S,e)},d.init(this.dragOptions)}},24040:function(e,t,r){"use strict";var n=r(24248),i=r(16628),a=r(52416),o=r(63620),s=r(52200).addStyleRule,l=r(92880),A=r(45464),c=r(64859),u=l.extendFlat,g=l.extendDeepAll;function f(e){var r=e.name,i=e.categories,a=e.meta;if(t.modules[r])n.log("Type "+r+" already registered");else{t.subplotsRegistry[e.basePlotModule.name]||function(e){var r=e.name;if(t.subplotsRegistry[r])n.log("Plot type "+r+" already registered.");else for(var i in y(e),t.subplotsRegistry[r]=e,t.componentsRegistry)v(i,e.name)}(e.basePlotModule);for(var o={},l=0;l-1&&(u[f[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(C)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(C=(C=(C=C.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),C}},84664:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t){for(var r=0;ru+A||!n(c))}for(var f=0;f=0)return e}else if("string"===typeof e&&"%"===(e=e.trim()).slice(-1)&&n(e.slice(0,-1))&&(e=+e.slice(0,-1))>=0)return e+"%"}function h(e,t,r,n,a,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),A=!(!1===o.moduleHasConstrain),c=!(!1===o.moduleHasCliponaxis),u=!(!1===o.moduleHasTextangle),f=!(!1===o.moduleHasInsideanchor),h=!!o.hasPathbar,d=Array.isArray(a)||"auto"===a,p=d||"inside"===a,y=d||"outside"===a;if(p||y){var m=g(n,"textfont",r.font),I=i.extendFlat({},m),v=!(e.textfont&&e.textfont.color);if(v&&delete I.color,g(n,"insidetextfont",I),h){var E=i.extendFlat({},m);v&&delete E.color,g(n,"pathbar.textfont",E)}y&&g(n,"outsidetextfont",m),s&&n("selected.textfont.color"),l&&n("unselected.textfont.color"),A&&n("constraintext"),c&&n("cliponaxis"),u&&n("textangle"),n("texttemplate")}p&&f&&n("insidetextanchor")}e.exports={supplyDefaults:function(e,t,r,n){function c(r,n){return i.coerce(e,t,u,r,n)}if(s(e,t,n,c)){l(e,t,n,c),c("xhoverformat"),c("yhoverformat"),c("zorder"),c("orientation",t.x&&!t.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var g=c("textposition");h(e,0,n,c,g,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),A(e,t,c,r,n);var f=(t.marker.line||{}).color,d=o.getComponentMethod("errorbars","supplyDefaults");d(e,t,f||a.defaultLine,{axis:"y"}),d(e,t,f||a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(t,c)}else t.visible=!1},crossTraceDefaults:function(e,t){var r,n;function a(e,t){return i.coerce(n._input,n,u,e,t)}for(var o=0;oa))return t}return void 0!==r?r:e.dflt},t.coerceColor=function(e,t,r){return i(t).isValid()?t:void 0!==r?r:e.dflt},t.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},t.getValue=function(e,t){var r;return a(e)?t0?t+=r:c<0&&(t-=r)}return t}function R(e){var t=c,r=e.b,i=M(e);return n.inbox(r-t,i-t,E+(i-t)/(i-r)-1)}var L=e[u+"a"],N=e[g+"a"];d=Math.abs(L.r2c(L.range[1])-L.r2c(L.range[0]));var F=n.getDistanceFunction(i,f,h,(function(e){return(f(e)+h(e))/2}));if(n.getClosest(p,F,e),!1!==e.index&&p[e.index].p!==A){b||(S=function(e){return Math.min(x(e),e.p-m.bargroupwidth/2)},k=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var O=p[e.index],P=y.base?O.b+O.s:O.s;e[g+"0"]=e[g+"1"]=N.c2p(O[g],!0),e[g+"LabelVal"]=P;var G=m.extents[m.extents.round(O.p)];e[u+"0"]=L.c2p(I?S(O):G[0],!0),e[u+"1"]=L.c2p(I?k(O):G[1],!0);var U=void 0!==O.orig_p;return e[u+"LabelVal"]=U?O.orig_p:O.p,e.labelLabel=l(L,e[u+"LabelVal"],y[u+"hoverformat"]),e.valueLabel=l(N,e[g+"LabelVal"],y[g+"hoverformat"]),e.baseLabel=l(N,O.b,y[g+"hoverformat"]),e.spikeDistance=(function(e){var t=c,r=e.b,i=M(e);return n.inbox(r-t,i-t,C+(i-t)/(i-r)-1)}(O)+function(e){return D(x(e),w(e),C)}(O))/2,e[u+"Spike"]=L.c2p(O.p,!0),o(O,y,e),e.hovertemplate=y.hovertemplate,e}}function u(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,i=s(e,t);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(e,t,r,n,a){var o=c(e,t,r,n,a);if(o){var s=o.cd,l=s[0].trace,A=s[o.index];return o.color=u(l,A),i.getComponentMethod("errorbars","hoverInfo")(A,l,o),[o]}},hoverOnBars:c,getTraceColor:u}},51132:function(e,t,r){"use strict";e.exports={attributes:r(20832),layoutAttributes:r(39324),supplyDefaults:r(31508).supplyDefaults,crossTraceDefaults:r(31508).crossTraceDefaults,supplyLayoutDefaults:r(37156),calc:r(71820),crossTraceCalc:r(96376).crossTraceCalc,colorbar:r(5528),arraysToCalcdata:r(84664),plot:r(98184).plot,style:r(60100).style,styleOnSelect:r(60100).styleOnSelect,hoverPoints:r(63400).hoverPoints,eventData:r(52160),selectPoints:r(45784),moduleType:"trace",name:"bar",basePlotModule:r(57952),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},39324:function(e){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}},37156:function(e,t,r){"use strict";var n=r(24040),i=r(54460),a=r(3400),o=r(39324),s=r(31508).validateCornerradius;e.exports=function(e,t,r){function l(r,n){return a.coerce(e,t,o,r,n)}for(var A=!1,c=!1,u=!1,g={},f=l("barmode"),h=0;h0)-(e<0)}function x(e,t){return e0}function _(e,t,r,n,i){return!(e<0||t<0)&&(r<=e&&n<=t||r<=t&&n<=e||(i?e>=r*(t/n):t>=n*(e/r)))}function S(e){return"auto"===e?0:e}function k(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:e.width*i+e.height*n,y:e.width*n+e.height*i}}function D(e,t,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,A=a.anchor,c="end"===A,u="start"===A,g=((a.leftToRight||0)+1)/2,f=1-g,h=a.hasB,d=a.r,p=a.overhead,y=i.width,m=i.height,I=Math.abs(t-e),v=Math.abs(n-r),C=I>2*E&&v>2*E?E:0;I-=2*C,v-=2*C;var B=S(l);"auto"!==l||y<=I&&m<=v||!(y>I||m>v)||(y>v||m>I)&&yE){var _=function(e,t,r,n,i,a,o,s,l){var A,c,u,g,f,h=Math.max(0,Math.abs(t-e)-2*E),d=Math.max(0,Math.abs(n-r)-2*E),p=a-E,y=o?p-Math.sqrt(p*p-(p-o)*(p-o)):p,m=l?2*p:s?p-o:2*y,I=l?2*p:s?2*y:p-o;return i.y/i.x>=d/(h-m)?g=d/i.y:i.y/i.x<=(d-I)/h?g=h/i.x:!l&&s?(A=i.x*i.x+i.y*i.y/4,u=(h-p)*(h-p)+(d/2-p)*(d/2-p)-p*p,g=(-(c=-2*i.x*(h-p)-i.y*(d/2-p))+Math.sqrt(c*c-4*A*u))/(2*A)):l?(A=(i.x*i.x+i.y*i.y)/4,u=(h/2-p)*(h/2-p)+(d/2-p)*(d/2-p)-p*p,g=(-(c=-i.x*(h/2-p)-i.y*(d/2-p))+Math.sqrt(c*c-4*A*u))/(2*A)):(A=i.x*i.x/4+i.y*i.y,u=(h/2-p)*(h/2-p)+(d-p)*(d-p)-p*p,g=(-(c=-i.x*(h/2-p)-2*i.y*(d-p))+Math.sqrt(c*c-4*A*u))/(2*A)),g=Math.min(1,g),f=s?Math.max(0,p-Math.sqrt(Math.max(0,p*p-(p-(d-i.y*g)/2)*(p-(d-i.y*g)/2)))-o):Math.max(0,p-Math.sqrt(Math.max(0,p*p-(p-(h-i.x*g)/2)*(p-(h-i.x*g)/2)))-o),{scale:g,pad:f}}(e,t,r,n,Q,d,p,o,h);b=_.scale,w=_.pad}else b=1,s&&(b=Math.min(1,I/Q.x,v/Q.y)),w=0;var D=i.left*f+i.right*g,T=(i.top+i.bottom)/2,M=(e+E)*f+(t-E)*g,R=(r+n)/2,L=0,N=0;if(u||c){var F=(o?Q.x:Q.y)/2;d&&(c||h)&&(C+=w);var O=o?x(e,t):x(r,n);o?u?(M=e+O*C,L=-O*F):(M=t-O*C,L=O*F):u?(R=r+O*C,N=-O*F):(R=n-O*C,N=O*F)}return{textX:D,textY:T,targetX:M,targetY:R,anchorX:L,anchorY:N,scale:b,rotate:B}}e.exports={plot:function(e,t,r,u,p,y){var C=t.xaxis,T=t.yaxis,M=e._fullLayout,R=e._context.staticPlot;p||(p={mode:M.barmode,norm:M.barmode,gap:M.bargap,groupgap:M.bargroupgap},f("bar",M));var L=a.makeTraceGroups(u,r,"trace bars").each((function(r){var A=n.select(this),u=r[0].trace,f=r[0].t,L="waterfall"===u.type,N="funnel"===u.type,F="histogram"===u.type,O="bar"===u.type,P=O||N,G=0;L&&u.connector.visible&&"between"===u.connector.mode&&(G=u.connector.line.width/2);var U="h"===u.orientation,z=Q(p),q=a.ensureSingle(A,"g","points"),H=B(u),Y=q.selectAll("g.point").data(a.identity,H);Y.enter().append("g").classed("point",!0),Y.exit().remove(),Y.each((function(A,B){var Q,L,N=n.select(this),q=function(e,t,r,n){var i=[],a=[],o=n?t:r,s=n?r:t;return i[0]=o.c2p(e.s0,!0),a[0]=s.c2p(e.p0,!0),i[1]=o.c2p(e.s1,!0),a[1]=s.c2p(e.p1,!0),n?[i,a]:[a,i]}(A,C,T,U),H=q[0][0],Y=q[0][1],J=q[1][0],K=q[1][1],j=0===(U?Y-H:K-J);if(j&&P&&d.getLineWidth(u,A)&&(j=!1),j||(j=!i(H)||!i(Y)||!i(J)||!i(K)),A.isBlank=j,j&&(U?Y=H:K=J),G&&!j&&(U?(H-=x(H,Y)*G,Y+=x(H,Y)*G):(J-=x(J,K)*G,K+=x(J,K)*G)),"waterfall"===u.type){if(!j){var V=u[A.dir].marker;Q=V.line.width,L=V.color}}else Q=d.getLineWidth(u,A),L=A.mc||u.marker.color;function W(e){var t=n.round(Q/2%1,2);return 0===p.gap&&0===p.groupgap?n.round(Math.round(e)-t,2):e}var Z=s.opacity(L)<1||Q>.01?W:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?W(e):e>t?Math.ceil(e):Math.floor(e)};e._context.staticPlot||(H=Z(H,Y,U),Y=Z(Y,H,U),J=Z(J,K,!U),K=Z(K,J,!U));var X,$=U?C.c2p:T.c2p;X=A.s0>0?A._sMax:A.s0<0?A._sMin:A.s1>0?A._sMax:A._sMin;var ee,te,re=O||F?function(e,t){if(!e)return 0;var r,n=U?Math.abs(K-J):Math.abs(Y-H),i=U?Math.abs(Y-H):Math.abs(K-J),a=Z(Math.abs($(X,!0)-$(0,!0))),o=A.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===t?n*(Math.min(50,e)/100):e,Z(Math.max(Math.min(r,o),0))}(f.cornerradiusvalue,f.cornerradiusform):0,ne="M"+H+","+J+"V"+K+"H"+Y+"V"+J+"Z",ie=0;if(re&&A.s){var ae=0===b(A.s0)||b(A.s)===b(A.s0)?A.s1:A.s0;if((ie=Z(A.hasB?0:Math.abs($(X,!0)-$(ae,!0))))0?Math.sqrt(ie*(2*re-ie)):0,ue=oe>0?Math.max:Math.min;ee="M"+H+","+J+"V"+(K-Ae*se)+"H"+ue(Y-(re-ie)*oe,H)+"A "+re+","+re+" 0 0 "+le+" "+Y+","+(K-re*se-ce)+"V"+(J+re*se+ce)+"A "+re+","+re+" 0 0 "+le+" "+ue(Y-(re-ie)*oe,H)+","+(J+Ae*se)+"Z"}else if(A.hasB)ee="M"+(H+re*oe)+","+J+"A "+re+","+re+" 0 0 "+le+" "+H+","+(J+re*se)+"V"+(K-re*se)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe)+","+K+"H"+(Y-re*oe)+"A "+re+","+re+" 0 0 "+le+" "+Y+","+(K-re*se)+"V"+(J+re*se)+"A "+re+","+re+" 0 0 "+le+" "+(Y-re*oe)+","+J+"Z";else{var ge=(te=Math.abs(K-J)+ie)0?Math.sqrt(ie*(2*re-ie)):0,he=se>0?Math.max:Math.min;ee="M"+(H+ge*oe)+","+J+"V"+he(K-(re-ie)*se,J)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe-fe)+","+K+"H"+(Y-re*oe+fe)+"A "+re+","+re+" 0 0 "+le+" "+(Y-ge*oe)+","+he(K-(re-ie)*se,J)+"V"+J+"Z"}}else ee=ne}else ee=ne;var de=w(a.ensureSingle(N,"path"),M,p,y);if(de.style("vector-effect",R?"none":"non-scaling-stroke").attr("d",isNaN((Y-H)*(K-J))||j&&e._context.staticPlot?"M0,0Z":ee).call(l.setClipUrl,t.layerClipId,e),!M.uniformtext.mode&&z){var pe=l.makePointStyleFns(u);l.singlePointStyle(A,de,u,pe,e)}!function(e,t,r,n,i,s,A,u,f,p,y,C,B){var b,Q=t.xaxis,T=t.yaxis,M=e._fullLayout;function R(t,r,n){return a.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+b,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,e)}var L=n[0].trace,N="h"===L.orientation,F=function(e,t,r,n,i){var o,s=t[0].trace,l=s.texttemplate;return o=l?function(e,t,r,n,i){var o=t[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,A,u,g,f="histogram"===o.type,h="waterfall"===o.type,d="funnel"===o.type,p="h"===o.orientation;function y(e){return c(A,A.c2l(e),!0).text}function m(e){return c(g,g.c2l(e),!0).text}p?(l="y",A=i,u="x",g=n):(l="x",A=n,u="y",g=i);var I=t[r],E={};E.label=I.p,E.labelLabel=E[l+"Label"]=y(I.p);var C=a.castOption(o,I.i,"text");(0===C||C)&&(E.text=C),E.value=I.s,E.valueLabel=E[u+"Label"]=m(I.s);var B={};v(B,o,I.i),(f||void 0===B.x)&&(B.x=p?E.value:E.label),(f||void 0===B.y)&&(B.y=p?E.label:E.value),(f||void 0===B.xLabel)&&(B.xLabel=p?E.valueLabel:E.labelLabel),(f||void 0===B.yLabel)&&(B.yLabel=p?E.labelLabel:E.valueLabel),h&&(E.delta=+I.rawS||I.s,E.deltaLabel=m(E.delta),E.final=I.v,E.finalLabel=m(E.final),E.initial=E.final-E.delta,E.initialLabel=m(E.initial)),d&&(E.value=I.s,E.valueLabel=m(E.value),E.percentInitial=I.begR,E.percentInitialLabel=a.formatPercent(I.begR),E.percentPrevious=I.difR,E.percentPreviousLabel=a.formatPercent(I.difR),E.percentTotal=I.sumR,E.percenTotalLabel=a.formatPercent(I.sumR));var b=a.castOption(o,I.i,"customdata");return b&&(E.customdata=b),a.texttemplateString(s,E,e._d3locale,B,E,o._meta||{})}(e,t,r,n,i):s.textinfo?function(e,t,r,n){var i=e[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function A(e){return c(o?n:r,e,!0).text}function u(e){return c(o?r:n,+e,!0).text}var g,f=i.textinfo,h=e[t],d=f.split("+"),p=[],y=function(e){return-1!==d.indexOf(e)};if(y("label")&&p.push(A(e[t].p)),y("text")&&(0===(g=a.castOption(i,h.i,"text"))||g)&&p.push(g),s){var m=+h.rawS||h.s,I=h.v,v=I-m;y("initial")&&p.push(u(v)),y("delta")&&p.push(u(m)),y("final")&&p.push(u(I))}if(l){y("value")&&p.push(u(h.s));var E=0;y("percent initial")&&E++,y("percent previous")&&E++,y("percent total")&&E++;var C=E>1;y("percent initial")&&(g=a.formatPercent(h.begR),C&&(g+=" of initial"),p.push(g)),y("percent previous")&&(g=a.formatPercent(h.difR),C&&(g+=" of previous"),p.push(g)),y("percent total")&&(g=a.formatPercent(h.sumR),C&&(g+=" of total"),p.push(g))}return p.join("
")}(t,r,n,i):d.getValue(s.text,r),d.coerceString(m,o)}(M,n,i,Q,T);b=function(e,t){var r=d.getValue(e.textposition,t);return d.coerceEnumerated(I,r)}(L,i);var O="stack"===C.mode||"relative"===C.mode,P=n[i],G=!O||P._outmost,U=P.hasB,z=p&&p-y>E;if(F&&"none"!==b&&(!P.isBlank&&s!==A&&u!==f||"auto"!==b&&"inside"!==b)){var q=M.font,H=h.getBarColor(n[i],L),Y=h.getInsideTextFont(L,i,q,H),J=h.getOutsideTextFont(L,i,q),K=L.insidetextanchor||"end",j=r.datum();N?"log"===Q.type&&j.s0<=0&&(s=Q.range[0]0&&X>0;ie=z?U?_(re-2*p,ne,Z,X,N)||_(re,ne-2*p,Z,X,N):N?_(re-(p-y),ne,Z,X,N)||_(re,ne-2*(p-y),Z,X,N):_(re,ne-(p-y),Z,X,N)||_(re-2*(p-y),ne,Z,X,N):_(re,ne,Z,X,N),ae&&ie?b="inside":(b="outside",V.remove(),V=null)}else b="inside";if(!V){var oe=(V=R(r,F,$=a.ensureUniformFontSize(e,"outside"===b?J:Y))).attr("transform");if(V.attr("transform",""),Z=(W=l.bBox(V.node())).width,X=W.height,V.attr("transform",oe),Z<=0||X<=0)return void V.remove()}var se,le=L.textangle;se="outside"===b?function(e,t,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,A=a.angle||0,c=i.width,u=i.height,g=Math.abs(t-e),f=Math.abs(n-r);o=s?f>2*E?E:0:g>2*E?E:0;var h=1;l&&(h=s?Math.min(1,f/u):Math.min(1,g/c));var d=S(A),p=k(i,d),y=(s?p.x:p.y)/2,m=(i.left+i.right)/2,I=(i.top+i.bottom)/2,v=(e+t)/2,C=(r+n)/2,B=0,b=0,w=s?x(t,e):x(r,n);return s?(v=t-w*o,B=w*y):(C=n+w*o,b=-w*y),{textX:m,textY:I,targetX:v,targetY:C,anchorX:B,anchorY:b,scale:h,rotate:d}}(s,A,u,f,W,{isHorizontal:N,constrained:"both"===L.constraintext||"outside"===L.constraintext,angle:le}):D(s,A,u,f,W,{isHorizontal:N,constrained:"both"===L.constraintext||"inside"===L.constraintext,angle:le,anchor:K,hasB:U,r:p,overhead:y}),se.fontSize=$.size,g("histogram"===L.type?"bar":L.type,se,M),P.transform=se;var Ae=w(V,M,C,B);a.setTransormAndDisplay(Ae,se)}else r.select("text").remove()}(e,t,N,r,B,H,Y,J,K,re,ie,p,y),t.layerClipId&&l.hideOutsideRangePoint(A,N.select("text"),C,T,u.xcalendar,u.ycalendar)}));var J=!1===u.cliponaxis;l.setClipUrl(A,J?null:t.layerClipId,e)}));A.getComponentMethod("errorbars","plot")(e,L,t,p)},toMoveInsideBar:D}},45784:function(e){"use strict";function t(e,t,r,n,i){var a=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),s=r.c2p(n?e.p0:e.s0,!0),l=r.c2p(n?e.p1:e.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(e,r){var n,i=e.cd,a=e.xaxis,o=e.yaxis,s=i[0].trace,l="funnel"===s.type,A="h"===s.orientation,c=[];if(!1===r)for(n=0;n1||0===i.bargap&&0===i.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),s.getComponentMethod("errorbars","style")(t)},styleTextPoints:d,styleOnSelect:function(e,t,r){var i=t[0].trace;i.selectedpoints?function(e,t,r){a.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var i,s=n.select(this);if(e.selected){i=o.ensureUniformFontSize(r,p(s,e,t,r));var l=t.selected.textfont&&t.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,t)}))}(e.selectAll("text"),t,r)}(r,i,e):(h(r,i,e),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:m,getOutsideTextFont:I,getBarColor:E,resizeText:l}},55592:function(e,t,r){"use strict";var n=r(76308),i=r(94288).hasColorscale,a=r(27260),o=r(3400).coercePattern;e.exports=function(e,t,r,s,l){var A=r("marker.color",s),c=i(e,"marker");c&&a(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(e,"marker.line")&&a(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",A,c),r("selected.marker.color"),r("unselected.marker.color")}},82744:function(e,t,r){"use strict";var n=r(33428),i=r(3400);function a(e){return"_"+e+"Text_minsize"}e.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=a(e),i=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=og.range[1]&&(I+=Math.PI),n.getClosest(A,(function(e){return d(m,I,[e.rp0,e.rp1],[e.thetag0,e.thetag1],h)?p+Math.min(1,Math.abs(e.thetag1-e.thetag0)/y)-1+(e.rp1-m)/(e.rp1-e.rp0)-1:1/0}),e),!1!==e.index){var v=A[e.index];e.x0=e.x1=v.ct[0],e.y0=e.y1=v.ct[1];var E=i.extendFlat({},v,{r:v.s,theta:v.p});return o(v,c,e),s(E,c,u,e),e.hovertemplate=c.hovertemplate,e.color=a(c,v),e.xLabelVal=e.yLabelVal=void 0,v.s<0&&(e.idealAlign="left"),[e]}}},94456:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:r(40872),categories:["polar","bar","showLegend"],attributes:r(78100),layoutAttributes:r(9320),supplyDefaults:r(70384),supplyLayoutDefaults:r(89580),calc:r(47056).calc,crossTraceCalc:r(47056).crossTraceCalc,plot:r(42040),colorbar:r(5528),formatLabels:r(22852),style:r(60100).style,styleOnSelect:r(60100).styleOnSelect,hoverPoints:r(68896),selectPoints:r(45784),meta:{}}},9320:function(e){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},89580:function(e,t,r){"use strict";var n=r(3400),i=r(9320);e.exports=function(e,t,r){var a,o={};function s(r,o){return n.coerce(e[a]||{},t[a],i,r,o)}for(var l=0;l0?(A=o,c=l):(A=l,c=o);var u=[s.findEnclosingVertexAngles(A,e.vangles)[0],(A+c)/2,s.findEnclosingVertexAngles(c,e.vangles)[1]];return s.pathPolygonAnnulus(n,i,A,c,u,t,r)}:function(e,n,i,o){return a.pathAnnulus(e,n,i,o,t,r)}}(t),h=t.layers.frontplot.select("g.barlayer");a.makeTraceGroups(h,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(e){var t,r=n.select(this),o=e.rp0=u.c2p(e.s0),s=e.rp1=u.c2p(e.s1),l=e.thetag0=g.c2g(e.p0),h=e.thetag1=g.c2g(e.p1);if(i(o)&&i(s)&&i(l)&&i(h)&&o!==s&&l!==h){var d=u.c2g(e.s1),p=(l+h)/2;e.ct=[A.c2p(d*Math.cos(p)),c.c2p(d*Math.sin(p))],t=f(o,s,l,h)}else t="M0,0Z";a.ensureSingle(r,"path").attr("d",t)})),o.setClipUrl(r,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)}))}},63188:function(e,t,r){"use strict";var n=r(98304),i=r(52904),a=r(20832),o=r(22548),s=r(29736).axisHoverFormat,l=r(21776).Ks,A=r(92880).extendFlat,c=i.marker,u=c.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:i.xperiod,yperiod:i.yperiod,xperiod0:i.xperiod0,yperiod0:i.yperiod0,xperiodalignment:i.xperiodalignment,yperiodalignment:i.yperiodalignment,xhoverformat:s("x"),yhoverformat:s("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:A({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:A({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:A({},c.angle,{arrayOk:!1,editType:"calc"}),size:A({},c.size,{arrayOk:!1,editType:"calc"}),color:A({},c.color,{arrayOk:!1,editType:"style"}),line:{color:A({},u.color,{arrayOk:!1,dflt:o.defaultLine,editType:"style"}),width:A({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:i.selected.marker,editType:"style"},unselected:{marker:i.unselected.marker,editType:"style"},text:A({},i.text,{}),hovertext:A({},i.hovertext,{}),hovertemplate:l({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:i.zorder}},62555:function(e,t,r){"use strict";var n=r(38248),i=r(54460),a=r(1220),o=r(3400),s=r(39032).BADNUM,l=o._;e.exports=function(e,t){var r,A,m,I,v,E,C,B=e._fullLayout,b=i.getFromId(e,t.xaxis||"x"),x=i.getFromId(e,t.yaxis||"y"),w=[],Q="violin"===t.type?"_numViolins":"_numBoxes";"h"===t.orientation?(m=b,I="x",v=x,E="y",C=!!t.yperiodalignment):(m=x,I="y",v=b,E="x",C=!!t.xperiodalignment);var _,S,k,D,T,M,R=function(e,t,r,i){var s,l=t in e,A=t+"0"in e,c="d"+t in e;if(l||A&&c){var u=r.makeCalcdata(e,t);return[a(e,r,t,u).vals,u]}s=A?e[t+"0"]:"name"in e&&("category"===r.type||n(e.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(e.name)&&"date"===r.type)?e.name:i;for(var g="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,e[t+"calendar"]),f=e._length,h=new Array(f),d=0;d_.uf};if(t._hasPreCompStats){var U=t[I],z=function(e){return m.d2c((t[e]||[])[r])},q=1/0,H=-1/0;for(r=0;r=_.q1&&_.q3>=_.med){var J=z("lowerfence");_.lf=J!==s&&J<=_.q1?J:f(_,k,D);var K=z("upperfence");_.uf=K!==s&&K>=_.q3?K:h(_,k,D);var j=z("mean");_.mean=j!==s?j:D?o.mean(k,D):(_.q1+_.q3)/2;var V=z("sd");_.sd=j!==s&&V>=0?V:D?o.stdev(k,D,_.mean):_.q3-_.q1,_.lo=d(_),_.uo=p(_);var W=z("notchspan");W=W!==s&&W>0?W:y(_,D),_.ln=_.med-W,_.un=_.med+W;var Z=_.lf,X=_.uf;t.boxpoints&&k.length&&(Z=Math.min(Z,k[0]),X=Math.max(X,k[D-1])),t.notched&&(Z=Math.min(Z,_.ln),X=Math.max(X,_.un)),_.min=Z,_.max=X}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+_.q1,"median = "+_.med,"q3 = "+_.q3].join("\n")),$=_.med!==s?_.med:_.q1!==s?_.q3!==s?(_.q1+_.q3)/2:_.q1:_.q3!==s?_.q3:0,_.med=$,_.q1=_.q3=$,_.lf=_.uf=$,_.mean=_.sd=$,_.ln=_.un=$,_.min=_.max=$}q=Math.min(q,_.min),H=Math.max(H,_.max),_.pts2=S.filter(G),w.push(_)}}t._extremes[m._id]=i.findExtremes(m,[q,H],{padded:!0})}else{var ee=m.makeCalcdata(t,I),te=function(e,t){for(var r=e.length,n=new Array(r+1),i=0;i=0&&ie0){var ce,ue;(_={}).pos=_[E]=O[r],S=_.pts=ne[r].sort(u),D=(k=_[I]=S.map(g)).length,_.min=k[0],_.max=k[D-1],_.mean=o.mean(k,D),_.sd=o.stdev(k,D,_.mean)*t.sdmultiple,_.med=o.interp(k,.5),D%2&&(le||Ae)?(le?(ce=k.slice(0,D/2),ue=k.slice(D/2+1)):Ae&&(ce=k.slice(0,D/2+1),ue=k.slice(D/2)),_.q1=o.interp(ce,.5),_.q3=o.interp(ue,.5)):(_.q1=o.interp(k,.25),_.q3=o.interp(k,.75)),_.lf=f(_,k,D),_.uf=h(_,k,D),_.lo=d(_),_.uo=p(_);var ge=y(_,D);_.ln=_.med-ge,_.un=_.med+ge,ae=Math.min(ae,_.ln),oe=Math.max(oe,_.un),_.pts2=S.filter(G),w.push(_)}t.notched&&o.isTypedArray(ee)&&(ee=Array.from(ee)),t._extremes[m._id]=i.findExtremes(m,t.notched?ee.concat([ae,oe]):ee,{padded:!0})}return function(e,t){if(o.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(w[0].t={num:B[Q],dPos:P,posLetter:E,valLetter:I,labels:{med:l(e,"median:"),min:l(e,"min:"),q1:l(e,"q1:"),q3:l(e,"q3:"),max:l(e,"max:"),mean:"sd"===t.boxmean||"sd"===t.sizemode?l(e,"mean \xb1 \u03c3:").replace("\u03c3",1===t.sdmultiple?"\u03c3":t.sdmultiple+"\u03c3"):l(e,"mean:"),lf:l(e,"lower fence:"),uf:l(e,"upper fence:")}},B[Q]++,w):[{t:{empty:!0}}]};var A={text:"tx",hovertext:"htx"};function c(e,t,r){for(var n in A)o.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(t[n][r[0]])&&(e[A[n]]=t[n][r[0]][r[1]]):e[A[n]]=t[n][r])}function u(e,t){return e.v-t.v}function g(e){return e.v}function f(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(o.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function h(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(o.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function d(e){return 4*e.q1-3*e.q3}function p(e){return 4*e.q3-3*e.q1}function y(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},96404:function(e,t,r){"use strict";var n=r(54460),i=r(3400),a=r(71888).getAxisGroup,o=["v","h"];function s(e,t,r,o){var s,l,A,c=t.calcdata,u=t._fullLayout,g=o._id,f=g.charAt(0),h=[],d=0;for(s=0;s1,v=1-u[e+"gap"],E=1-u[e+"groupgap"];for(s=0;s0){var H=_.pointpos,Y=_.jitter,J=_.marker.size/2,K=0;H+Y>=0&&((K=z*(H+Y))>w?(q=!0,G=J,O=K):K>N&&(G=J,O=w)),K<=w&&(O=w);var j=0;H-Y<=0&&((j=-z*(H-Y))>Q?(q=!0,U=J,P=j):j>F&&(U=J,P=Q)),j<=Q&&(P=Q)}else O=w,P=Q;var V=new Array(A.length);for(l=0;l0?(p="v",y=I>0?Math.min(E,v):Math.min(v)):I>0?(p="h",y=Math.min(E)):y=0;if(y){t._length=y;var Q=r("orientation",p);t._hasPreCompStats?"v"===Q&&0===I?(r("x0",0),r("dx",1)):"h"===Q&&0===m&&(r("y0",0),r("dy",1)):"v"===Q&&0===I?r("x0"):"h"===Q&&0===m&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a)}else t.visible=!1}function u(e,t,r,i){var a=i.prefix,o=n.coerce2(e,t,A,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";t._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var c=r(a+"points",l);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.angle"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",t.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete t.marker;var u=r("hoveron");"all"!==u&&-1===u.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}e.exports={supplyDefaults:function(e,t,r,i){function s(r,i){return n.coerce(e,t,A,r,i)}if(c(e,t,s,i),!1!==t.visible){o(e,t,i,s),s("xhoverformat"),s("yhoverformat");var l=t._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(e.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(t.line.color,.5));var g=!1;if(l){var f=s("mean"),h=s("sd");f&&f.length&&(g=!0,h&&h.length&&(g="sd"))}s("whiskerwidth");var d,p=s("sizemode");"quartiles"===p&&(d=s("boxmean",g)),s("showwhiskers","quartiles"===p),"sd"!==p&&"sd"!==d||s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(l){var m=s("notchspan");m&&m.length&&(y=!0)}else n.validate(e.notchwidth,A.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),u(e,t,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(e,t){var r,i;function a(e){return n.coerce(i._input,i,A,e)}for(var o=0;oe.lo&&(E.so=!0)}return a}));h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(a.translatePoints,l,A)}function c(e,t,r,a){var o,s,l=t.val,A=t.pos,c=!!A.rangebreaks,u=a.bPos,g=a.bPosPxOffset||0,f=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var h=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(e){var t=A.c2l(e.pos+u,!0),i=A.l2p(t-o)+g,a=A.l2p(t+s)+g,h=c?(i+a)/2:A.l2p(t)+g,d=l.c2p(e.mean,!0),p=l.c2p(e.mean-e.sd,!0),y=l.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+d+","+i+"V"+a+("sd"===f?"m0,0L"+p+","+h+"L"+d+","+i+"L"+y+","+h+"Z":"")):n.select(this).attr("d","M"+i+","+d+"H"+a+("sd"===f?"m0,0L"+h+","+p+"L"+i+","+d+"L"+h+","+y+"Z":""))}))}e.exports={plot:function(e,t,r,a){var o=e._context.staticPlot,s=t.xaxis,u=t.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(e){var t,r,i=n.select(this),a=e[0],g=a.t,f=a.trace;g.wdPos=g.bdPos*f.whiskerwidth,!0!==f.visible||g.empty?i.remove():("h"===f.orientation?(t=u,r=s):(t=s,r=u),l(i,{pos:t,val:r},f,g,o),A(i,{x:s,y:u},f,g),c(i,{pos:t,val:r},f,g))}))},plotBoxAndWhiskers:l,plotPoints:A,plotBoxMean:c}},8264:function(e){"use strict";e.exports=function(e,t){var r,n,i=e.cd,a=e.xaxis,o=e.yaxis,s=[];if(!1===t)for(r=0;r=10)return null;for(var r=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,T=S>0?Math.ceil:Math.floor,M=S>0?Math.min:Math.max,R=S>0?Math.max:Math.min,L=D(Q+k),N=T(_-k),F=[[u=w(Q)]];for(a=L;a*S=0;i--)a[c-i]=e[u][i],o[c-i]=t[u][i];for(s.push({x:a,y:o,bicubic:l}),i=u,a=[],o=[];i>=0;i--)a[u-i]=e[i][0],o[u-i]=t[i][0];return s.push({x:a,y:o,bicubic:A}),s}},19216:function(e,t,r){"use strict";var n=r(54460),i=r(92880).extendFlat;e.exports=function(e,t,r){var a,o,s,l,A,c,u,g,f,h,d,p,y,m,I=e["_"+t],v=e[t+"axis"],E=v._gridlines=[],C=v._minorgridlines=[],B=v._boundarylines=[],b=e["_"+r],x=e[r+"axis"];"array"===v.tickmode&&(v.tickvals=I.slice());var w=e._xctrl,Q=e._yctrl,_=w[0].length,S=w.length,k=e._a.length,D=e._b.length;n.prepTicks(v),"array"===v.tickmode&&delete v.tickvals;var T=v.smoothing?3:1;function M(n){var i,a,o,s,l,A,c,u,f,h,d,p,y=[],m=[],I={};if("b"===t)for(a=e.b2j(n),o=Math.floor(Math.max(0,Math.min(D-2,a))),s=a-o,I.length=D,I.crossLength=k,I.xy=function(t){return e.evalxy([],t,a)},I.dxy=function(t,r){return e.dxydi([],t,o,r,s)},i=0;i0&&(f=e.dxydi([],i-1,o,0,s),y.push(l[0]+f[0]/3),m.push(l[1]+f[1]/3),h=e.dxydi([],i-1,o,1,s),y.push(u[0]-h[0]/3),m.push(u[1]-h[1]/3)),y.push(u[0]),m.push(u[1]),l=u;else for(i=e.a2i(n),A=Math.floor(Math.max(0,Math.min(k-2,i))),c=i-A,I.length=k,I.crossLength=D,I.xy=function(t){return e.evalxy([],i,t)},I.dxy=function(t,r){return e.dxydj([],A,t,c,r)},a=0;a0&&(d=e.dxydj([],A,a-1,c,0),y.push(l[0]+d[0]/3),m.push(l[1]+d[1]/3),p=e.dxydj([],A,a-1,c,1),y.push(u[0]-p[0]/3),m.push(u[1]-p[1]/3)),y.push(u[0]),m.push(u[1]),l=u;return I.axisLetter=t,I.axis=v,I.crossAxis=x,I.value=n,I.constvar=r,I.index=g,I.x=y,I.y=m,I.smoothing=x.smoothing,I}function R(n){var i,a,o,s,l,A=[],c=[],u={};if(u.length=I.length,u.crossLength=b.length,"b"===t)for(o=Math.max(0,Math.min(D-2,n)),l=Math.min(1,Math.max(0,n-o)),u.xy=function(t){return e.evalxy([],t,n)},u.dxy=function(t,r){return e.dxydi([],t,o,r,l)},i=0;i<_;i++)A[i]=w[n*T][i],c[i]=Q[n*T][i];else for(a=Math.max(0,Math.min(k-2,n)),s=Math.min(1,Math.max(0,n-a)),u.xy=function(t){return e.evalxy([],n,t)},u.dxy=function(t,r){return e.dxydj([],a,t,s,r)},i=0;iI.length-1||E.push(i(R(o),{color:v.gridcolor,width:v.gridwidth,dash:v.griddash}));for(g=c;gI.length-1)&&!(d<0||d>I.length-1))for(p=I[s],y=I[d],a=0;aI[I.length-1]||C.push(i(M(h),{color:v.minorgridcolor,width:v.minorgridwidth,dash:v.minorgriddash}));v.startline&&B.push(i(R(0),{color:v.startlinecolor,width:v.startlinewidth})),v.endline&&B.push(i(R(I.length-1),{color:v.endlinecolor,width:v.endlinewidth}))}else{for(l=5e-15,c=(A=[Math.floor((I[I.length-1]-v.tick0)/v.dtick*(1+l)),Math.ceil((I[0]-v.tick0)/v.dtick/(1+l))].sort((function(e,t){return e-t})))[0],u=A[1],g=c;g<=u;g++)f=v.tick0+v.dtick*g,E.push(i(M(f),{color:v.gridcolor,width:v.gridwidth,dash:v.griddash}));for(g=c-1;gI[I.length-1]||C.push(i(M(h),{color:v.minorgridcolor,width:v.minorgridwidth,dash:v.minorgriddash}));v.startline&&B.push(i(M(I[0]),{color:v.startlinecolor,width:v.startlinewidth})),v.endline&&B.push(i(M(I[I.length-1]),{color:v.endlinecolor,width:v.endlinewidth}))}}},14724:function(e,t,r){"use strict";var n=r(54460),i=r(92880).extendFlat;e.exports=function(e,t){var r,a,o,s=t._labels=[],l=t._gridlines;for(r=0;rt.length&&(e=e.slice(0,t.length)):e=[],i=0;i90&&(f-=180,l=-l),{angle:f,flip:l,p:e.c2p(n,t,r),offsetMultplier:A}}},164:function(e,t,r){"use strict";var n=r(33428),i=r(43616),a=r(87072),o=r(53416),s=r(15584),l=r(72736),A=r(3400),c=A.strRotate,u=A.strTranslate,g=r(84284);function f(e,t,r,s,l,A,c){var u="const-"+l+"-lines",g=r.selectAll("."+u).data(A);g.enter().append("path").classed(u,!0).style("vector-effect",c?"none":"non-scaling-stroke"),g.each((function(r){var s=r,l=s.x,A=s.y,c=a([],l,e.c2p),u=a([],A,t.c2p),g="M"+o(c,u,s.smoothing);n.select(this).attr("d",g).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",i.dashStyle(s.dash,s.width)).style("fill","none")})),g.exit().remove()}function h(e,t,r,a,o,A,g,f){var h=A.selectAll("text."+f).data(g);h.enter().append("text").classed(f,!0);var d=0,p={};return h.each((function(o,A){var g;if("auto"===o.axis.tickangle)g=s(a,t,r,o.xy,o.dxy);else{var f=(o.axis.tickangle+180)*Math.PI/180;g=s(a,t,r,o.xy,[Math.cos(f),Math.sin(f)])}A||(p={angle:g.angle,flip:g.flip});var h=(o.endAnchor?-1:1)*g.flip,y=n.select(this).attr({"text-anchor":h>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,e),m=i.bBox(this);y.attr("transform",u(g.p[0],g.p[1])+c(g.angle)+u(o.axis.labelpadding*h,.3*m.height)),d=Math.max(d,m.width+o.axis.labelpadding)})),h.exit().remove(),p.maxExtent=d,p}e.exports=function(e,t,r,i){var l=e._context.staticPlot,c=t.xaxis,u=t.yaxis,g=e._fullLayout._clips;A.makeTraceGroups(i,r,"trace").each((function(t){var r=n.select(this),i=t[0],d=i.trace,p=d.aaxis,m=d.baxis,I=A.ensureSingle(r,"g","minorlayer"),v=A.ensureSingle(r,"g","majorlayer"),E=A.ensureSingle(r,"g","boundarylayer"),C=A.ensureSingle(r,"g","labellayer");r.style("opacity",d.opacity),f(c,u,v,0,"a",p._gridlines,!0),f(c,u,v,0,"b",m._gridlines,!0),f(c,u,I,0,"a",p._minorgridlines,!0),f(c,u,I,0,"b",m._minorgridlines,!0),f(c,u,E,0,"a-boundary",p._boundarylines,l),f(c,u,E,0,"b-boundary",m._boundarylines,l);var B=h(e,c,u,d,0,C,p._labels,"a-label"),b=h(e,c,u,d,0,C,m._labels,"b-label");!function(e,t,r,n,i,a,o,l){var c,u,g,f,h=A.aggNums(Math.min,null,r.a),d=A.aggNums(Math.max,null,r.a),p=A.aggNums(Math.min,null,r.b),m=A.aggNums(Math.max,null,r.b);c=.5*(h+d),u=p,g=r.ab2xy(c,u,!0),f=r.dxyda_rough(c,u),void 0===o.angle&&A.extendFlat(o,s(r,i,a,g,r.dxydb_rough(c,u))),y(e,t,r,0,g,f,r.aaxis,i,a,o,"a-title"),c=h,u=.5*(p+m),g=r.ab2xy(c,u,!0),f=r.dxydb_rough(c,u),void 0===l.angle&&A.extendFlat(l,s(r,i,a,g,r.dxyda_rough(c,u))),y(e,t,r,0,g,f,r.baxis,i,a,l,"b-title")}(e,C,d,0,c,u,B,b),function(e,t,r,n,i){var s,l,c,u,g=r.select("#"+e._clipPathId);g.size()||(g=r.append("clipPath").classed("carpetclip",!0));var f=A.ensureSingle(g,"path","carpetboundary"),h=t.clipsegments,d=[];for(u=0;u90&&m<270,v=n.select(this);v.text(g.title.text).call(l.convertToTspans,e),I&&(E=(-l.lineCount(v)+p)*d*a-E),v.attr("transform",u(t.p[0],t.p[1])+c(t.angle)+u(0,E)).attr("text-anchor","middle").call(i.font,g.title.font)})),v.exit().remove()}},81e3:function(e,t,r){"use strict";var n=r(24588),i=r(14952).findBin,a=r(30180),o=r(29056),s=r(26435),l=r(24464);e.exports=function(e){var t=e._a,r=e._b,A=t.length,c=r.length,u=e.aaxis,g=e.baxis,f=t[0],h=t[A-1],d=r[0],p=r[c-1],y=t[t.length-1]-t[0],m=r[r.length-1]-r[0],I=y*n.RELATIVE_CULL_TOLERANCE,v=m*n.RELATIVE_CULL_TOLERANCE;f-=I,h+=I,d-=v,p+=v,e.isVisible=function(e,t){return e>f&&ed&&th||tp},e.setScale=function(){var t=e._x,r=e._y,n=a(e._xctrl,e._yctrl,t,r,u.smoothing,g.smoothing);e._xctrl=n[0],e._yctrl=n[1],e.evalxy=o([e._xctrl,e._yctrl],A,c,u.smoothing,g.smoothing),e.dxydi=s([e._xctrl,e._yctrl],u.smoothing,g.smoothing),e.dxydj=l([e._xctrl,e._yctrl],u.smoothing,g.smoothing)},e.i2a=function(e){var r=Math.max(0,Math.floor(e[0]),A-2),n=e[0]-r;return(1-n)*t[r]+n*t[r+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),A-2),n=e[1]-t;return(1-n)*r[t]+n*r[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var r=Math.max(0,Math.min(i(e,t),A-2)),n=t[r],a=t[r+1];return Math.max(0,Math.min(A-1,r+(e-n)/(a-n)))},e.b2j=function(e){var t=Math.max(0,Math.min(i(e,r),c-2)),n=r[t],a=r[t+1];return Math.max(0,Math.min(c-1,t+(e-n)/(a-n)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,r){return e.evalxy([],t,r)},e.ab2xy=function(n,i,a){if(!a&&(nt[A-1]|ir[c-1]))return[!1,!1];var o=e.a2i(n),s=e.b2j(i),l=e.evalxy([],o,s);if(a){var u,g,f,h,d=0,p=0,y=[];nt[A-1]?(u=A-2,g=1,d=(n-t[A-1])/(t[A-1]-t[A-2])):g=o-(u=Math.max(0,Math.min(A-2,Math.floor(o)))),ir[c-1]?(f=c-2,h=1,p=(i-r[c-1])/(r[c-1]-r[c-2])):h=s-(f=Math.max(0,Math.min(c-2,Math.floor(s)))),d&&(e.dxydi(y,u,f,g,h),l[0]+=y[0]*d,l[1]+=y[1]*d),p&&(e.dxydj(y,u,f,g,h),l[0]+=y[0]*p,l[1]+=y[1]*p)}return l},e.c2p=function(e,t,r){return[t.c2p(e[0]),r.c2p(e[1])]},e.p2x=function(e,t,r){return[t.p2c(e[0]),r.p2c(e[1])]},e.dadi=function(e){var r=Math.max(0,Math.min(t.length-2,e));return t[r+1]-t[r]},e.dbdj=function(e){var t=Math.max(0,Math.min(r.length-2,e));return r[t+1]-r[t]},e.dxyda=function(t,r,n,i){var a=e.dxydi(null,t,r,n,i),o=e.dadi(t,n);return[a[0]/o,a[1]/o]},e.dxydb=function(t,r,n,i){var a=e.dxydj(null,t,r,n,i),o=e.dbdj(r,i);return[a[0]/o,a[1]/o]},e.dxyda_rough=function(t,r,n){var i=y*(n||.1),a=e.ab2xy(t+i,r,!0),o=e.ab2xy(t-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dxydb_rough=function(t,r,n){var i=m*(n||.1),a=e.ab2xy(t,r+i,!0),o=e.ab2xy(t,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}},51512:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t,r){var i,a,o,s=[],l=[],A=e[0].length,c=e.length;function u(t,r){var n,i=0,a=0;return t>0&&void 0!==(n=e[r][t-1])&&(a++,i+=n),t0&&void 0!==(n=e[r-1][t])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",b,"after",x,"iterations"),e}},86411:function(e,t,r){"use strict";var n=r(3400).isArray1D;e.exports=function(e,t,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(t._cheater=!i,a&&!n(i)||s&&!n(o))t._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),t.a&&t.a.length&&(l=Math.min(l,t.a.length)),t.b&&t.b.length&&(l=Math.min(l,t.b.length)),t._length=l}return!0}},83372:function(e,t,r){"use strict";var n=r(21776).Ks,i=r(6096),a=r(49084),o=r(45464),s=r(22548).defaultLine,l=r(92880).extendFlat,A=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},A.color,{dflt:s}),width:l({},A.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},7924:function(e,t,r){"use strict";var n=r(38248),i=r(39032).BADNUM,a=r(47128),o=r(20148),s=r(4500);function l(e){return e&&"string"===typeof e}e.exports=function(e,t){var r,A=t._length,c=new Array(A);r=t.geojson?function(e){return l(e)||n(e)}:l;for(var u=0;u")}}(e,u,o),[e]}},54272:function(e,t,r){"use strict";e.exports={attributes:r(83372),supplyDefaults:r(30972),colorbar:r(96288),calc:r(7924),calcGeoJSON:r(88364).calcGeoJSON,plot:r(88364).plot,style:r(7947).style,styleOnSelect:r(7947).styleOnSelect,hoverPoints:r(69224),eventData:r(52428),selectPoints:r(17328),moduleType:"trace",name:"choropleth",basePlotModule:r(10816),categories:["geo","noOpacity","showLegend"],meta:{}}},88364:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(27144),o=r(59972).getTopojsonFeatures,s=r(19280).findExtremes,l=r(7947).style;e.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],i=n._subplot,l=r.locationmode,A=r._length,c="geojson-id"===l?a.extractTraceFeature(e):o(r,i.topojson),u=[],g=[],f=0;f=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)e.removeLayer(t[r][1])},s.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},e.exports=function(e,t){var r=t[0].trace,i=new o(e,r.uid),a=i.sourceId,s=n(t),l=i.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}},86040:function(e,t,r){"use strict";var n=r(49084),i=r(29736).axisHoverFormat,a=r(21776).Ks,o=r(52948),s=r(45464),l=r(92880).extendFlat,A={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(A,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){A[e]=o[e]})),A.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),A.transforms=void 0,e.exports=A},83344:function(e,t,r){"use strict";var n=r(47128);e.exports=function(e,t){for(var r=t.u,i=t.v,a=t.w,o=Math.min(t.x.length,t.y.length,t.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,A=0;Ao.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,A=-1/0,c=1/0;for(r=0;r":f>A&&(n.prefixBoundary=!0);break;case"<":(fA||n.starts.length&&g===c)&&(n.prefixBoundary=!0);break;case"][":u=Math.min(f[0],f[1]),g=Math.max(f[0],f[1]),uA&&(n.prefixBoundary=!0)}}}},55296:function(e,t,r){"use strict";var n=r(8932),i=r(41076),a=r(46960);e.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,s=t.line,l=o.size||1,A=o.coloring,c=i(t,{isColorbar:!0});if("heatmap"===A){var u=n.extractOpts(t);r._fillgradient=u.reversescale?n.flipScale(u.colorscale):u.colorscale,r._zrange=[u.min,u.max]}else"fill"===A&&(r._fillcolor=c);r._line={color:"lines"===A?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},93252:function(e){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},95536:function(e,t,r){"use strict";var n=r(38248),i=r(17428),a=r(76308),o=a.addOpacity,s=a.opacity,l=r(69104),A=r(3400).isArrayOrTypedArray,c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(e,t,r,a,l,g){var f,h,d,p=t.contours,y=r("contours.operation");p._operation=c[y],function(e,t){var r;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),A(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(A(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,p),"="===y?f=p.showlines=!0:(f=r("contours.showlines"),d=r("fillcolor",o((e.line||{}).color||l,.5))),f&&(h=r("line.color",d&&s(d)?o(t.fillcolor,1):l),r("line.width",2),r("line.dash")),r("line.smoothing"),i(r,a,h,g)}},3212:function(e,t,r){"use strict";var n=r(69104),i=r(38248);function a(e,t){var r,a=Array.isArray(t);function o(e){return i(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(a?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=a?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=a?t.map(o):[o(t)]),r}function o(e){return function(t){t=a(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function s(e){return function(t){return{start:t=a(e,t),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},84952:function(e){"use strict";e.exports=function(e,t,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},82172:function(e,t,r){"use strict";var n=r(3400);function i(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}e.exports=function(e,t){var r,a,o,s=function(e){return e.reverse()},l=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),a=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return l}},46960:function(e){"use strict";e.exports=function(e){return e.end+e.size/1e6}},88748:function(e,t,r){"use strict";var n=r(3400),i=r(93252);function a(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(e)?a=1:-1!==i.LEFTSTART.indexOf(e)?n=1:-1!==i.TOPSTART.indexOf(e)?a=-1:n=-1,[n,a]}(g,r,t),h=[l(e,t,[-f[0],-f[1]])],d=e.z.length,p=e.z[0].length,y=t.slice(),m=f.slice();for(c=0;c<1e4;c++){if(g>20?(g=i.CHOOSESADDLE[g][(f[0]||f[1])<0?0:1],e.crossings[u]=i.SADDLEREMAINDER[g]):delete e.crossings[u],!(f=i.NEWDELTA[g])){n.log("Found bad marching index:",g,t,e.level);break}h.push(l(e,t,f)),t[0]+=f[0],t[1]+=f[1],u=t.join(","),a(h[h.length-1],h[h.length-2],s,A)&&h.pop();var I=f[0]&&(t[0]<0||t[0]>p-2)||f[1]&&(t[1]<0||t[1]>d-2);if(t[0]===y[0]&&t[1]===y[1]&&f[0]===m[0]&&f[1]===m[1]||r&&I)break;g=e.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var v,E,C,B,b,x,w,Q,_,S,k,D=a(h[0],h[h.length-1],s,A),T=0,M=.2*e.smoothing,R=[],L=0;for(c=1;c=L;c--)if((v=R[c])=L&&v+R[E]Q&&_--,e.edgepaths[_]=k.concat(h,S));break}P||(e.edgepaths[Q]=h.concat(S))}for(Q=0;Q=m)&&(r<=y&&(r=y),o>=m&&(o=m),l=Math.floor((o-r)/s)+1,A=0),g=0;gy&&(d.unshift(y),p.unshift(p[0])),d[d.length-1]e?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(e){var t,r,a,o,s,l,A,c,u,g=e[0].z,f=g.length,h=g[0].length,d=2===f||2===h;for(r=0;r=0&&(n=m,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-m[1])<.01&&(m[0]-r[0])*(n[0]-m[0])>=0&&(n=m,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,m)}if(r=n,s>=0)break;u+="L"+n}if(s===e.edgepaths.length){i.log("unclosed perimeter path");break}g=s,(h=-1===f.indexOf(g))&&(g=f[0],u+="Z")}for(g=0;gn.center?n.right-s:s-n.left)/(c+Math.abs(Math.sin(A)*o)),f=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(u)+Math.cos(A)*o);if(g<1||f<1)return 1/0;var h=y.EDGECOST*(1/(g-1)+1/(f-1));h+=y.ANGLECOST*A*A;for(var d=s-c,p=l-u,m=s+c,I=l+u,v=0;v2*y.MAXCOST)break;f&&(s/=2),l=(o=A-s/2)+1.5*s}if(g<=y.MAXCOST)return c},t.addLabelData=function(e,t,r,n){var i=t.fontSize,a=t.width+i/3,o=Math.max(0,t.height-i/3),s=e.x,l=e.y,A=e.theta,c=Math.sin(A),u=Math.cos(A),g=function(e,t){return[s+e*u-t*c,l+e*c+t*u]},f=[g(-a/2,-o/2),g(-a/2,o/2),g(a/2,o/2),g(a/2,-o/2)];r.push({text:t.text,x:s,y:l,dy:t.dy,theta:A,level:t.level,width:a,height:o}),n.push(f)},t.drawLabels=function(e,t,r,a,o){var l=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,i=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:i,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var A="",c=0;cr.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),i.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var A,c=r.start,u=r.end,g=e._input.contours;c>u&&(r.start=g.start=u,u=r.end=g.end=c,c=r.start),r.size>0||(A=c===u?1:a(c,u,e.ncontours).dtick,g.size=r.size=A)}}},52440:function(e,t,r){"use strict";var n=r(33428),i=r(43616),a=r(41648),o=r(41076);e.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[0].trace,a=r.contours,s=r.line,l=a.size||1,A=a.start,c="constraint"===a.type,u=!c&&"lines"===a.coloring,g=!c&&"fill"===a.coloring,f=u||g?o(r):null;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,u?f(e.level):s.color,s.dash)}));var h=a.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){i.font(n.select(this),{weight:h.weight,style:h.style,variant:h.variant,family:h.family,size:h.size,color:h.color||(u?f(e.level):s.color)})})),c)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(g){var d;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===d&&(d=e.level),f(e.level+.5*l)})),void 0===d&&(d=A),t.selectAll("g.contourbg path").style("fill",f(d-.5*l))}})),a(e)}},97680:function(e,t,r){"use strict";var n=r(27260),i=r(17428);e.exports=function(e,t,r,a,o){var s,l=r("contours.coloring"),A="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(A=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,A,o)}},37960:function(e,t,r){"use strict";var n=r(83328),i=r(67104),a=r(49084),o=r(92880).extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},zorder:i.zorder,transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},30572:function(e,t,r){"use strict";var n=r(47128),i=r(3400),a=r(2872),o=r(26136),s=r(70448),l=r(11240),A=r(35744),c=r(3252),u=r(50948),g=r(54444);e.exports=function(e,t){var r=t._carpetTrace=u(e,t);if(r&&r.visible&&"legendonly"!==r.visible){if(!t.a||!t.b){var f=e.data[r.index],h=e.data[t.index];h.a||(h.a=f.a),h.b||(h.b=f.b),c(h,t,t._defaultColor,e._fullLayout)}var d=function(e,t){var r,c,u,g,f,h,d,p=t._carpetTrace,y=p.aaxis,m=p.baxis;y._minDtick=0,m._minDtick=0,i.isArray1D(t.z)&&a(t,y,m,"a","b",["z"]),r=t._a=t._a||t.a,g=t._b=t._b||t.b,r=r?y.makeCalcdata(t,"_a"):[],g=g?m.makeCalcdata(t,"_b"):[],c=t.a0||0,u=t.da||1,f=t.b0||0,h=t.db||1,d=t._z=o(t._z||t.z,t.transpose),t._emptypoints=l(d),s(d,t._emptypoints);var I=i.maxRowLength(d),v="scaled"===t.xtype?"":r,E=A(t,v,c,u,I,y),C="scaled"===t.ytype?"":g,B=A(t,C,f,h,d.length,m),b={a:E,b:B,z:d};return"levels"===t.contours.type&&"none"!==t.contours.coloring&&n(e,t,{vals:d,containerStr:"",cLetter:"z"}),[b]}(e,t);return g(t,t._z),d}}},3252:function(e,t,r){"use strict";var n=r(3400),i=r(51264),a=r(37960),o=r(95536),s=r(84952),l=r(97680);e.exports=function(e,t,r,A){function c(r,i){return n.coerce(e,t,a,r,i)}if(c("carpet"),e.a&&e.b){if(!i(e,t,c,A,"a","b"))return void(t.visible=!1);c("text"),"constraint"===c("contours.type")?o(e,t,c,A,r,{hasHover:!1}):(s(e,t,c,(function(r){return n.coerce2(e,t,a,r)})),l(e,t,c,A,{hasHover:!1}))}else t._defaultColor=r,t._length=null;c("zorder")}},40448:function(e,t,r){"use strict";e.exports={attributes:r(37960),supplyDefaults:r(3252),colorbar:r(55296),calc:r(30572),plot:r(94440),style:r(52440),moduleType:"trace",name:"contourcarpet",basePlotModule:r(57952),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},94440:function(e,t,r){"use strict";var n=r(33428),i=r(87072),a=r(53416),o=r(43616),s=r(3400),l=r(72424),A=r(88748),c=r(23676),u=r(93252),g=r(82172),f=r(61512),h=r(56008),d=r(50948),p=r(77712);function y(e,t,r){var n=e.getPointAtLength(t),i=e.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function m(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}function I(e,t){var r=Math.abs(e[0]*t[0]+e[1]*t[1]);return Math.sqrt(1-r*r)/r}e.exports=function(e,t,r,v){var E=t.xaxis,C=t.yaxis;s.makeTraceGroups(v,r,"contour").each((function(r){var v=n.select(this),B=r[0],b=B.trace,x=b._carpetTrace=d(e,b),w=e.calcdata[x.index][0];if(x.visible&&"legendonly"!==x.visible){var Q=B.a,_=B.b,S=b.contours,k=f(S,t,B),D="constraint"===S.type,T=S._operation,M=D?"="===T?"lines":"fill":S.coloring,R=[[Q[0],_[_.length-1]],[Q[Q.length-1],_[_.length-1]],[Q[Q.length-1],_[0]],[Q[0],_[0]]];l(k);var L=1e-8*(Q[Q.length-1]-Q[0]),N=1e-8*(_[_.length-1]-_[0]);A(k,L,N);var F,O,P,G,U=k;"constraint"===S.type&&(U=g(k,T)),function(e,t){var r,n,i,a,o,s,l,A,c;for(r=0;r=0;G--)F=w.clipsegments[G],O=i([],F.x,E.c2p),P=i([],F.y,C.c2p),O.reverse(),P.reverse(),z.push(a(O,P,F.bicubic));var q="M"+z.join("L")+"Z";!function(e,t,r,n,o,l){var A,c,u,g,f=s.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);f.enter().append("path"),f.exit().remove();var h=[];for(g=0;g=0&&(g=S,h=d):Math.abs(u[1]-g[1])=0&&(g=S,h=d):s.log("endpt to newendpt is not vert. or horz.",u,g,S)}if(h>=0)break;m+=Q(u,g),u=g}if(h===t.edgepaths.length){s.log("unclosed perimeter path");break}c=h,(v=-1===I.indexOf(c))&&(c=I[0],m+=Q(u,g)+"Z",u=null)}for(c=0;cd&&(n.max=d),n.len=n.max-n.min}function p(e,t){var r,n=0,o=.1;return(Math.abs(e[0]-l)0?+f[c]:0),u.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:m})}}var v=o.extractOpts(t),E=v.reversescale?o.flipScale(v.colorscale):v.colorscale,C=E[0][1],B=["interpolate",["linear"],["heatmap-density"],0,a.opacity(C)<1?C:a.addOpacity(C,0)];for(c=1;c=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},e.exports=function(e,t){var r=t[0].trace,i=new a(e,r.uid),o=i.sourceId,s=n(t),l=i.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},74248:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t){for(var r=0;r"),l.color=function(e,t){var r=e.marker,i=t.mc||r.color,a=t.mlc||r.line.color,o=t.mlw||r.line.width;return n(i)?i:n(a)&&o?a:void 0}(c,g),[l]}}},94704:function(e,t,r){"use strict";e.exports={attributes:r(20088),layoutAttributes:r(7076),supplyDefaults:r(45432).supplyDefaults,crossTraceDefaults:r(45432).crossTraceDefaults,supplyLayoutDefaults:r(11631),calc:r(23096),crossTraceCalc:r(4804),plot:r(42200),style:r(44544).style,hoverPoints:r(31488),eventData:r(34580),selectPoints:r(45784),moduleType:"trace",name:"funnel",basePlotModule:r(57952),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},7076:function(e){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},11631:function(e,t,r){"use strict";var n=r(3400),i=r(7076);e.exports=function(e,t,r){var a=!1;function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=0;s path").each((function(e){if(!e.isBlank){var t=s.marker;n.select(this).call(a.fill,e.mc||t.color).call(a.stroke,e.mlc||t.line.color).call(i.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),A(r,s,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},22332:function(e,t,r){"use strict";var n=r(74996),i=r(45464),a=r(86968).u,o=r(21776).Ks,s=r(21776).Gw,l=r(92880).extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},pattern:n.marker.pattern,editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},91248:function(e,t,r){"use strict";var n=r(7316);t.name="funnelarea",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},54e3:function(e,t,r){"use strict";var n=r(45768);e.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},92688:function(e,t,r){"use strict";var n=r(3400),i=r(22332),a=r(86968).Q,o=r(31508).handleText,s=r(74174).handleLabelsAndValues,l=r(74174).handleMarkerDefaults;e.exports=function(e,t,r,A){function c(r,a){return n.coerce(e,t,i,r,a)}var u=c("labels"),g=c("values"),f=s(u,g),h=f.len;if(t._hasLabels=f.hasLabels,t._hasValues=f.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),h){t._length=h,l(e,t,A,c),c("scalegroup");var d,p=c("text"),y=c("texttemplate");if(y||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),y||d&&"none"!==d){var m=c("textposition");o(e,t,A,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===d&&c("textposition","none");a(t,A,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",A.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},62396:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:r(91248),categories:["pie-like","funnelarea","showLegend"],attributes:r(22332),layoutAttributes:r(61280),supplyDefaults:r(92688),supplyLayoutDefaults:r(35384),calc:r(54e3).calc,crossTraceCalc:r(54e3).crossTraceCalc,plot:r(39472),style:r(62096),styleOne:r(10528),meta:{}}},61280:function(e,t,r){"use strict";var n=r(85204).hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},35384:function(e,t,r){"use strict";var n=r(3400),i=r(61280);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},39472:function(e,t,r){"use strict";var n=r(33428),i=r(43616),a=r(3400),o=a.strScale,s=a.strTranslate,l=r(72736),A=r(98184).toMoveInsideBar,c=r(82744),u=c.recordMinTextSize,g=c.clearMinTextSize,f=r(69656),h=r(37820),d=h.attachFxHandlers,p=h.determineInsideTextFont,y=h.layoutAreas,m=h.prerenderTitles,I=h.positionTitleOutside,v=h.formatSliceLabel;function E(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}function C(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}e.exports=function(e,t){var r=e._context.staticPlot,c=e._fullLayout;g("funnelarea",c),m(t,e),y(t,c._size),a.makeTraceGroups(c._funnelarealayer,t,"trace").each((function(t){var g=n.select(this),h=t[0],y=h.trace;!function(e){if(e.length){var t=e[0],r=t.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),A=t.vTotal,c=A,u=A*l/(1-l)/A,g=[];for(g.push(_()),o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var f=s.v/c;u+=f,g.push(_())}var h=1/0,d=-1/0;for(o=0;o-1;o--)if(!(s=e[o]).hidden){var x=g[b+=1][0],w=g[b][1];s.TL=[-x,w],s.TR=[x,w],s.BL=E,s.BR=B,s.pxmid=C(s.TR,s.BR),E=s.TL,B=s.TR}}function Q(){var e=Math.sqrt(u);return{x:e,y:-e}}function _(){var e=Q();return[e.x,e.y]}}(t),g.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove(),g.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=y.index;var g=h.cx,m=h.cy,I=n.select(this),C=I.selectAll("path.surface").data([o]);C.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),I.call(d,e,t);var B="M"+(g+o.TR[0])+","+(m+o.TR[1])+E(o.TR,o.BR)+E(o.BR,o.BL)+E(o.BL,o.TL)+"Z";C.attr("d",B),v(e,o,h);var b=f.castOption(y.textposition,o.pts),x=I.selectAll("g.slicetext").data(o.text&&"none"!==b?[0]:[]);x.enter().append("g").classed("slicetext",!0),x.exit().remove(),x.each((function(){var r=a.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=a.ensureUniformFontSize(e,p(y,o,c.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,f).call(l.convertToTspans,e);var h,d,I,v=i.bBox(r.node()),E=Math.min(o.BL[1],o.BR[1])+m,C=Math.max(o.TL[1],o.TR[1])+m;d=Math.max(o.TL[0],o.BL[0])+g,I=Math.min(o.TR[0],o.BR[0])+g,(h=A(d,I,E,C,v,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=f.size,u(y.type,h,c),t[s].transform=h,a.setTransormAndDisplay(r,h)}))}}));var m=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);m.enter().append("g").classed("titletext",!0),m.exit().remove(),m.each((function(){var t=a.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),r=y.title.text;y._meta&&(r=a.templateString(r,y._meta)),t.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,y.title.font).call(l.convertToTspans,e);var A=I(h,c._size);t.attr("transform",s(A.x,A.y)+o(Math.min(1,A.scale))+s(A.tx,A.ty))}))}))}))}},62096:function(e,t,r){"use strict";var n=r(33428),i=r(10528),a=r(82744).resizeText;e.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");a(e,t,"funnelarea"),t.each((function(t){var r=t[0].trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each((function(t){n.select(this).call(i,t,r,e)}))}))}},83328:function(e,t,r){"use strict";var n=r(52904),i=r(45464),a=r(25376),o=r(29736).axisHoverFormat,s=r(21776).Ks,l=r(21776).Gw,A=r(49084),c=r(92880).extendFlat;e.exports=c({z:{valType:"data_array",editType:"calc"},x:c({},n.x,{impliedEdits:{xtype:"array"}}),x0:c({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:c({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:c({},n.y,{impliedEdits:{ytype:"array"}}),y0:c({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:c({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:c({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:c({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:c({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:c({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:c({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:c({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:a({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:c({},i.showlegend,{dflt:!1}),zorder:n.zorder},{transforms:void 0},A("",{cLetter:"z",autoColorDflt:!1}))},19512:function(e,t,r){"use strict";var n=r(24040),i=r(3400),a=r(54460),o=r(1220),s=r(55480),l=r(47128),A=r(2872),c=r(26136),u=r(70448),g=r(11240),f=r(35744),h=r(39032).BADNUM;function d(e){for(var t=[],r=e.length,n=0;n1){var t=(e[e.length-1]-e[0])/(e.length-1),r=Math.abs(t/100);for(b=0;br)return!1}return!0}(w.rangebreaks||Q.rangebreaks)&&(B=function(e,t,r){for(var n=[],i=-1,a=0;a=0;o--)(s=((u[[(r=(a=g[o])[0])-1,i=a[1]]]||d)[2]+(u[[r+1,i]]||d)[2]+(u[[r,i-1]]||d)[2]+(u[[r,i+1]]||d)[2])/20)&&(l[a]=[r,i,s],g.splice(o,1),A=!0);if(!A)throw"findEmpties iterated with no new neighbors";for(a in l)u[a]=l[a],c.push(l[a])}return c.sort((function(e,t){return t[2]-e[2]}))}},55512:function(e,t,r){"use strict";var n=r(93024),i=r(3400),a=i.isArrayOrTypedArray,o=r(54460),s=r(8932).extractOpts;e.exports=function(e,t,r,l,A){A||(A={});var c,u,g,f,h=A.isContour,d=e.cd[0],p=d.trace,y=e.xa,m=e.ya,I=d.x,v=d.y,E=d.z,C=d.xCenter,B=d.yCenter,b=d.zmask,x=p.zhoverformat,w=I,Q=v;if(!1!==e.index){try{g=Math.round(e.index[1]),f=Math.round(e.index[0])}catch(G){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(g<0||g>=E[0].length||f<0||f>E.length)return}else{if(n.inbox(t-I[0],t-I[I.length-1],0)>0||n.inbox(r-v[0],r-v[v.length-1],0)>0)return;if(h){var _;for(w=[2*I[0]-I[1]],_=1;_d&&(y=Math.max(y,Math.abs(e[a][o]-h)/(p-d))))}return y}e.exports=function(e,t){var r,i=1;for(o(e,t),r=0;r.01;r++)i=o(e,t,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),e}},39096:function(e,t,r){"use strict";var n=r(3400);e.exports=function(e,t){e("texttemplate");var r=n.extendFlat({},t.font,{color:"auto",size:"auto"});n.coerceFont(e,"textfont",r)}},35744:function(e,t,r){"use strict";var n=r(24040),i=r(3400).isArrayOrTypedArray;e.exports=function(e,t,r,a,o,s){var l,A,c,u=[],g=n.traceIs(e,"contour"),f=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(i(t)&&t.length>1&&!f&&"category"!==s.type){var d=t.length;if(!(d<=o))return g?t.slice(0,o):t.slice(0,o+1);if(g||h)u=Array.from(t).slice(0,o);else if(1===o)u="log"===s.type?[.5*t[0],2*t[0]]:[t[0]-.5,t[0]+.5];else if("log"===s.type){for(u=[Math.pow(t[0],1.5)/Math.pow(t[1],.5)],c=1;c0;)b=x.c2p(P[k]),k--;for(b0;)S=w.c2p(G[k]),k--;S<_&&(Q=_,_=S,S=Q,j=!0),q&&(U=P,z=G,P=R.xfill,G=R.yfill);var V="default";if(H?V="best"===H?"smooth":"fast":L._islinear&&0===N&&0===F&&p()&&(V="fast"),"fast"!==V){var W="best"===H?0:.5;r=Math.max(-W*x._length,r),b=Math.min((1+W)*x._length,b),_=Math.max(-W*w._length,_),S=Math.min((1+W)*w._length,S)}var Z,X,$=Math.round(b-r),ee=Math.round(S-_);if(r>=x._length||b<=0||_>=w._length||S<=0)return M.selectAll("image").data([]).exit().remove(),void v(M);"fast"===V?(Z=J,X=Y):(Z=$,X=ee);var te=document.createElement("canvas");te.width=Z,te.height=X;var re,ne,ie=te.getContext("2d",{willReadFrequently:!0}),ae=f(L,{noNumericCheck:!0,returnArray:!0});"fast"===V?(re=K?function(e){return J-1-e}:l.identity,ne=j?function(e){return Y-1-e}:l.identity):(re=function(e){return l.constrain(Math.round(x.c2p(P[e])-r),0,$)},ne=function(e){return l.constrain(Math.round(w.c2p(G[e])-_),0,ee)});var oe,se,le,Ae,ce=ne(0),ue=[ce,ce],ge=K?0:1,fe=j?0:1,he=0,de=0,pe=0,ye=0;function me(e,t){if(void 0!==e){var r=ae(e);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),he+=t,de+=r[0]*t,pe+=r[1]*t,ye+=r[2]*t,r}return[0,0,0,0]}function Ie(e,t,r,n){var i=e[r.bin0];if(void 0===i)return me(void 0,1);var a,o=e[r.bin1],s=t[r.bin0],l=t[r.bin1],A=o-i||0,c=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,me(i+r.frac*A+n.frac*(c+r.frac*a))}if("default"!==V){var ve,Ee=0;try{ve=new Uint8Array(Z*X*4)}catch(pt){ve=new Array(Z*X*4)}if("smooth"===V){var Ce,Be,be,xe=U||P,we=z||G,Qe=new Array(xe.length),_e=new Array(we.length),Se=new Array($),ke=U?C:E,De=z?C:E;for(k=0;kVe||Ve>w._length))for(D=Ye;DZe||Ze>x._length)){var Xe=c({x:We,y:je},L,e._fullLayout);Xe.x=We,Xe.y=je;var $e=R.z[k][D];void 0===$e?(Xe.z="",Xe.zLabel=""):(Xe.z=$e,Xe.zLabel=s.tickText(Ue,$e,"hover").text);var et=R.text&&R.text[k]&&R.text[k][D];void 0!==et&&!1!==et||(et=""),Xe.text=et;var tt=l.texttemplateString(Pe,Xe,e._fullLayout._d3locale,Xe,L._meta||{});if(tt){var rt=tt.split("
"),nt=rt.length,it=0;for(T=0;T0&&(a=!0);for(var l=0;la){var o=a-r[e];return r[e]=a,o}}return 0},max:function(e,t,r,i){var a=i[t];if(n(a)){if(a=Number(a),!n(r[e]))return r[e]=a,a;if(r[e]A?e>o?e>1.1*i?i:e>1.1*a?a:o:e>s?s:e>l?l:A:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function f(e,t,r,n,a,s){if(n&&e>o){var l=h(t,a,s),A=h(r,a,s),c=e===i?0:1;return l[c]!==A[c]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(e,t,r,n,a){var s,l,A=-1.1*t,g=-.1*t,f=e-g,h=r[0],d=r[1],p=Math.min(u(h+g,h+f,n,a),u(d+g,d+f,n,a)),y=Math.min(u(h+A,h+g,n,a),u(d+A,d+g,n,a));if(p>y&&yo){var m=s===i?1:6,I=s===i?"M12":"M1";return function(t,r){var o=n.c2d(t,i,a),s=o.indexOf("-",m);s>0&&(o=o.substr(0,s));var A=n.d2c(o,0,a);if(Ar.r2l(O)&&(G=o.tickIncrement(G,v.size,!0,f)),R.start=r.l2r(G),F||i.nestedProperty(t,y+".start").set(R.start)}var U=v.end,z=r.r2l(M.end),q=void 0!==z;if((v.endFound||q)&&z!==r.r2l(U)){var H=q?z:i.aggNums(Math.max,null,h);R.end=r.l2r(H),q||i.nestedProperty(t,y+".start").set(R.end)}var Y="autobin"+s;return!1===t._input[Y]&&(t._input[y]=i.extendFlat({},t[y]||{}),delete t._input[Y],delete t[Y]),[R,h]}e.exports={calc:function(e,t){var r,a,f,h,d=[],p=[],y="h"===t.orientation,m=o.getFromId(e,y?t.yaxis:t.xaxis),I=y?"y":"x",v={x:"y",y:"x"}[I],E=t[I+"calendar"],C=t.cumulative,B=g(e,t,m,I),b=B[0],x=B[1],w="string"===typeof b.size,Q=[],_=w?Q:b,S=[],k=[],D=[],T=0,M=t.histnorm,R=t.histfunc,L=-1!==M.indexOf("density");C.enabled&&L&&(M=M.replace(/ ?density$/,""),L=!1);var N,F="max"===R||"min"===R?null:0,O=l.count,P=A[M],G=!1,U=function(e){return m.r2c(e,0,E)};for(i.isArrayOrTypedArray(t[v])&&"count"!==R&&(N=t[v],G="avg"===R,O=l[R]),r=U(b.start),f=U(b.end)+(r-o.tickIncrement(r,b.size,!1,E))/1e6;r=0&&h=0;n--)s(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(p,C.direction,C.currentbin);var Z=Math.min(d.length,p.length),X=[],$=0,ee=Z-1;for(r=0;r=$;r--)if(p[r]){ee=r;break}for(r=$;r<=ee;r++)if(n(d[r])&&n(p[r])){var te={p:d[r],s:p[r],b:0};C.enabled||(te.pts=D[r],J?te.ph0=te.ph1=D[r].length?x[D[r][0]]:d[r]:(t._computePh=!0,te.ph0=H(Q[r]),te.ph1=H(Q[r+1],!0))),X.push(te)}return 1===X.length&&(X[0].width1=o.tickIncrement(X[0].p,b.size,!1,E)-X[0].p),s(X,t),i.isArrayOrTypedArray(t.selectedpoints)&&i.tagSelected(X,t,V),X},calcAllAutoBins:g}},73316:function(e){"use strict";e.exports={eventDataKeys:["binNumber"]}},80536:function(e,t,r){"use strict";var n=r(3400),i=r(79811),a=r(24040).traceIs,o=r(20011),s=r(31508).validateCornerradius,l=n.nestedProperty,A=r(71888).getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(e,t){var r,g,f,h,d,p,y,m=t._histogramBinOpts={},I=[],v={},E=[];function C(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function B(e){return"v"===e.orientation?"x":"y"}function b(e,r,a){var o=e.uid+"__"+a;r||(r=o);var s=function(e,r){return i.getFromTrace({_fullLayout:t},e,r).type}(e,a),l=e[a+"calendar"]||"",A=m[r],c=!0;A&&(s===A.axType&&l===A.calendar?(c=!1,A.traces.push(e),A.dirs.push(a)):(r=o,s!==A.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+s,"axis","with bins on","type:"+A.axType,"axis."].join(" ")),l!==A.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",l,"calendar","with bins",A.calendar?"on a "+A.calendar+" calendar":"w/o a set calendar"].join(" ")))),c&&(m[r]={traces:[e],dirs:[a],axType:s,calendar:e[a+"calendar"]||""}),e["_"+a+"bingroup"]=r}for(d=0;dQ&&B.splice(Q,B.length-Q),w.length>Q&&w.splice(Q,w.length-Q);var _=[],S=[],k=[],D="string"===typeof C.size,T="string"===typeof x.size,M=[],R=[],L=D?M:C,N=T?R:x,F=0,O=[],P=[],G=t.histnorm,U=t.histfunc,z=-1!==G.indexOf("density"),q="max"===U||"min"===U?null:0,H=a.count,Y=o[G],J=!1,K=[],j=[],V="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";V&&"count"!==U&&(J="avg"===U,H=a[U]);var W=C.size,Z=I(C.start),X=I(C.end)+(Z-i.tickIncrement(Z,W,!1,y))/1e6;for(r=Z;r=0&&f=0&&h-1,flipY:k.tiling.flip.indexOf("y")>-1,orientation:k.tiling.orientation,pad:{inner:k.tiling.pad},maxDepth:k._maxDepth}).descendants(),L=1/0,N=-1/0;R.forEach((function(e){var t=e.depth;t>=k._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(L=Math.min(L,t),N=Math.max(N,t))})),h=h.data(R,c.getPtId),k._maxVisibleLayers=isFinite(N)?N-L+1:0,h.enter().append("g").classed("slice",!0),b(h,f,{},[p,y],v),h.order();var F=null;if(B&&Q){var O=c.getPtId(Q);h.each((function(e){null===F&&c.getPtId(e)===O&&(F={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var P=function(){return F||{x0:0,x1:p,y0:0,y1:y}},G=h;return B&&(G=G.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),G.each((function(s){s._x0=m(s.x0),s._x1=m(s.x1),s._y0=I(s.y0),s._y1=I(s.y1),s._hoverX=m(s.x1-k.tiling.pad),s._hoverY=I(M?s.y1-k.tiling.pad/2:s.y0+k.tiling.pad/2);var h=n.select(this),d=i.ensureSingle(h,"path","surface",(function(e){e.style("pointer-events",_?"none":"all")}));B?d.transition().attrTween("d",(function(e){var t=x(e,f,P(),[p,y],{orientation:k.tiling.orientation,flipX:k.tiling.flip.indexOf("x")>-1,flipY:k.tiling.flip.indexOf("y")>-1});return function(e){return v(t(e))}})):d.attr("d",v),h.call(u,r,e,t,{styleOne:l,eventDataKeys:A.eventDataKeys,transitionTime:A.CLICK_TRANSITION_TIME,transitionEasing:A.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),d.call(l,s,k,e,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=g(s,r,k,t,S)||"";var b=i.ensureSingle(h,"g","slicetext"),Q=i.ensureSingle(b,"text","",(function(e){e.attr("data-notex",1)})),R=i.ensureUniformFontSize(e,c.determineTextFont(k,s,S.font));Q.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",T?"end":D?"start":"middle").call(a.font,R).call(o.convertToTspans,e),s.textBB=a.bBox(Q.node()),s.transform=E(s,{fontSize:R.size}),s.transform.fontSize=R.size,B?Q.transition().attrTween("transform",(function(e){var t=w(e,f,P(),[p,y]);return function(e){return C(t(e))}})):Q.attr("transform",C(s))})),F}},29044:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:r(59564),categories:[],animatable:!0,attributes:r(97376),layoutAttributes:r(90676),supplyDefaults:r(7045),supplyLayoutDefaults:r(4304),calc:r(73876).r,crossTraceCalc:r(73876).q,plot:r(38364),style:r(47192).style,colorbar:r(5528),meta:{}}},90676:function(e){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},4304:function(e,t,r){"use strict";var n=r(3400),i=r(90676);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("iciclecolorway",t.colorway),r("extendiciclecolors")}},25132:function(e,t,r){"use strict";var n=r(74148),i=r(83024);e.exports=function(e,t,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,A=t[0],c=t[1];l&&(A=(e.height+1)*t[0]/Math.min(e.height+1,l),c=(e.height+1)*t[1]/Math.min(e.height+1,l));var u=n.partition().padding(r.pad.inner).size(s?[t[1],A]:[t[0],c])(e);return(s||a||o)&&i(u,t,{swapXY:s,flipX:a,flipY:o}),u}},38364:function(e,t,r){"use strict";var n=r(95808),i=r(67880);e.exports=function(e,t,r,a){return n(e,t,r,a,{type:"icicle",drawDescendants:i})}},47192:function(e,t,r){"use strict";var n=r(33428),i=r(76308),a=r(3400),o=r(82744).resizeText,s=r(60404);function l(e,t,r,n){var o=t.data.data,l=!t.children,A=o.i,c=a.castOption(r,A,"marker.line.color")||i.defaultLine,u=a.castOption(r,A,"marker.line.width")||0;e.call(s,t,r,n).style("stroke-width",u).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");o(e,t,"icicle"),t.each((function(t){var r=n.select(this),i=t[0].trace;r.style("opacity",i.opacity),r.selectAll("path.surface").each((function(t){n.select(this).call(l,t,i,e)}))}))},styleOne:l}},95188:function(e,t,r){"use strict";for(var n=r(45464),i=r(52904).zorder,a=r(21776).Ks,o=r(92880).extendFlat,s=r(47797).colormodel,l=["rgb","rgba","rgba256","hsl","hsla"],A=[],c=[],u=0;u0||n.inbox(r-s.y0,r-(s.y0+s.h*l.dy),0)>0)){var u,g=Math.floor((t-s.x0)/l.dx),f=Math.floor(Math.abs(r-s.y0)/l.dy);if(l._hasZ?u=s.z[f][g]:l._hasSource&&(u=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(g,f,1,1).data),u){var h,d=s.hi||l.hoverinfo;if(d){var p=d.split("+");-1!==p.indexOf("all")&&(p=["color"]),-1!==p.indexOf("color")&&(h=!0)}var y,m=o.colormodel[l.colormodel],I=m.colormodel||l.colormodel,v=I.length,E=l._scaler(u),C=m.suffix,B=[];(l.hovertemplate||h)&&(B.push("["+[E[0]+C[0],E[1]+C[1],E[2]+C[2]].join(", ")),4===v&&B.push(", "+E[3]+C[3]),B.push("]"),B=B.join(""),e.extraText=I.toUpperCase()+": "+B),a(l.hovertext)&&a(l.hovertext[f])?y=l.hovertext[f][g]:a(l.text)&&a(l.text[f])&&(y=l.text[f][g]);var b=c.c2p(s.y0+(f+.5)*l.dy),x=s.x0+(g+.5)*l.dx,w=s.y0+(f+.5)*l.dy,Q="["+u.slice(0,l.colormodel.length).join(", ")+"]";return[i.extendFlat(e,{index:[f,g],x0:A.c2p(s.x0+g*l.dx),x1:A.c2p(s.x0+(g+1)*l.dx),y0:b,y1:b,color:E,xVal:x,xLabelVal:x,yVal:w,yLabelVal:w,zLabelVal:Q,text:y,hovertemplateLabels:{zLabel:Q,colorLabel:B,"color[0]Label":E[0]+C[0],"color[1]Label":E[1]+C[1],"color[2]Label":E[2]+C[2],"color[3]Label":E[3]+C[3]}})]}}}},48928:function(e,t,r){"use strict";e.exports={attributes:r(95188),supplyDefaults:r(13188),calc:r(93336),plot:r(63715),style:r(28576),hoverPoints:r(24892),eventData:r(79972),moduleType:"trace",name:"image",basePlotModule:r(57952),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},63715:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=i.strTranslate,o=r(9616),s=r(47797),l=r(9188),A=r(2264).STYLE;e.exports=function(e,t,r,c){var u=t.xaxis,g=t.yaxis,f=!e._context._exportedPlot&&l();i.makeTraceGroups(c,r,"im").each((function(t){var r=n.select(this),l=t[0],c=l.trace,h=("fast"===c.zsmooth||!1===c.zsmooth&&f)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===g.type;c._realImage=h;var d,p,y,m,I,v,E=l.z,C=l.x0,B=l.y0,b=l.w,x=l.h,w=c.dx,Q=c.dy;for(v=0;void 0===d&&v0;)p=u.c2p(C+v*w),v--;for(v=0;void 0===m&&v0;)I=g.c2p(B+v*Q),v--;pM[0];if(R||L){var N=d+_/2,F=m+S/2;D+="transform:"+a(N+"px",F+"px")+"scale("+(R?-1:1)+","+(L?-1:1)+")"+a(-N+"px",-F+"px")+";"}}k.attr("style",D);var O=new Promise((function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===b&&c._canvas.el.height===x&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=b,t.height=x;var r=t.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:t,source:c.source},e()},n.setAttribute("src",c.source)}})).then((function(){var e,t;if(c._hasZ)t=P((function(e,t){var r=E[t][e];return i.isTypedArray(r)&&(r=Array.from(r)),r})),e=t.toDataURL("image/png");else if(c._hasSource)if(h)e=c.source;else{var r=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,b,x).data;t=P((function(e,t){var n=4*(t*b+e);return[r[n],r[n+1],r[n+2],r[n+3]]})),e=t.toDataURL("image/png")}k.attr({"xlink:href":e,height:S,width:_,x:d,y:m})}));e._promises.push(O)}function P(e){var t=document.createElement("canvas");t.width=_,t.height=S;var r,n=t.getContext("2d",{willReadFrequently:!0}),a=function(e){return i.constrain(Math.round(u.c2p(C+e*w)-d),0,_)},o=function(e){return i.constrain(Math.round(g.c2p(B+e*Q)-m),0,S)},A=s.colormodel[c.colormodel],f=A.colormodel||c.colormodel,h=A.fmt;for(v=0;v0}function B(e){e.each((function(e){m.stroke(n.select(this),e.line.color)})).each((function(e){m.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function b(e,t,r){var n=e._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),a={type:"linear",_id:"x"+t._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(e,t){return o.coerce(i,a,y,e,t)}return d(i,a,l,s,n),p(i,a,l,s),a}function x(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function w(e,t,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(f.convertToTspans,i).call(u.font,t),u.bBox(o.node())}function Q(e,t,r,n,i,a){var s="_cache"+t;e[s]&&e[s].key===i||(e[s]={key:i,value:r});var l=o.aggNums(a,null,[e[s].value,n],2);return e[s].value=l,l}e.exports=function(e,t,r,d){var p,y=e._fullLayout;C(r)&&d&&(p=d()),o.makeTraceGroups(y._indicatorlayer,t,"trace").each((function(t){var d,_,S,k,D,T=t[0].trace,M=n.select(this),R=T._hasGauge,L=T._isAngular,N=T._isBullet,F=T.domain,O={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},P=O.l+O.w/2,G=O.t+O.h/2,U=Math.min(O.w/2,O.h),z=g.innerRadius*U,q=T.align||"center";if(_=G,R){if(L&&(d=P,_=G+U/2,S=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),n=t/r;return[n,e,t]}(e,.9*z)}),N){var H=g.bulletPadding,Y=1-g.bulletNumberDomainSize+H;d=O.l+(Y+(1-Y)*v[q])*O.w,S=function(e){return x(e,(g.bulletNumberDomainSize-H)*O.w,O.h)}}}else d=O.l+v[q]*O.w,S=function(e){return x(e,O.w,O.h)};!function(e,t,r,i){var A,c,g,d=r[0].trace,p=i.numbersX,y=i.numbersY,B=d.align||"center",x=I[B],_=i.transitionOpts,S=i.onComplete,k=o.ensureSingle(t,"g","numbers"),D=[];d._hasNumber&&D.push("number"),d._hasDelta&&(D.push("delta"),"left"===d.delta.position&&D.reverse());var T=k.selectAll("text").data(D);function M(t,r,n,i){if(!t.match("s")||n>=0===i>=0||r(n).slice(-1).match(E)||r(i).slice(-1).match(E))return r;var a=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=b(e,{tickformat:a});return function(e){return Math.abs(e)<1?h.tickText(o,e).text:r(e)}}function R(){var t=b(e,{tickformat:d.number.valueformat},d._range);t.setScale(),h.prepTicks(t);var i=function(e){return h.tickText(t,e).text},o=d.number.suffix,s=d.number.prefix,l=k.select("text.number");function c(){var t="number"===typeof r[0].y?s+i(r[0].y)+o:"-";l.text(t).call(u.font,d.number.font).call(f.convertToTspans,e)}return C(_)?l.transition().duration(_.duration).ease(_.easing).each("end",(function(){c(),S&&S()})).each("interrupt",(function(){c(),S&&S()})).attrTween("text",(function(){var e=n.select(this),t=a(r[0].lastY,r[0].y);d._lastValue=r[0].y;var l=M(d.number.valueformat,i,r[0].lastY,r[0].y);return function(r){e.text(s+l(t(r))+o)}})):c(),A=w(s+i(r[0].y)+o,d.number.font,x,e),l}function L(){var t=b(e,{tickformat:d.delta.valueformat},d._range);t.setScale(),h.prepTicks(t);var i=function(e){return h.tickText(t,e).text},o=d.delta.suffix,s=d.delta.prefix,l=function(e){return d.delta.relative?e.relativeDelta:e.delta},A=function(e,t){return 0===e||"number"!==typeof e||isNaN(e)?"-":(e>0?d.delta.increasing.symbol:d.delta.decreasing.symbol)+s+t(e)+o},g=function(e){return e.delta>=0?d.delta.increasing.color:d.delta.decreasing.color};void 0===d._deltaLastValue&&(d._deltaLastValue=l(r[0]));var p=k.select("text.delta");function y(){p.text(A(l(r[0]),i)).call(m.fill,g(r[0])).call(f.convertToTspans,e)}return p.call(u.font,d.delta.font).call(m.fill,g({delta:d._deltaLastValue})),C(_)?p.transition().duration(_.duration).ease(_.easing).tween("text",(function(){var e=n.select(this),t=l(r[0]),o=d._deltaLastValue,s=M(d.delta.valueformat,i,o,t),c=a(o,t);return d._deltaLastValue=t,function(t){e.text(A(c(t),s)),e.call(m.fill,g({delta:c(t)}))}})).each("end",(function(){y(),S&&S()})).each("interrupt",(function(){y(),S&&S()})):y(),c=w(A(l(r[0]),i),d.delta.font,x,e),p}T.enter().append("text"),T.attr("text-anchor",(function(){return x})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),T.exit().remove();var N,F=d.mode+d.align;if(d._hasDelta&&(N=L(),F+=d.delta.position+d.delta.font.size+d.delta.font.family+d.delta.valueformat,F+=d.delta.increasing.symbol+d.delta.decreasing.symbol,g=c),d._hasNumber&&(R(),F+=d.number.font.size+d.number.font.family+d.number.valueformat+d.number.suffix+d.number.prefix,g=A),d._hasDelta&&d._hasNumber){var O,P,G=[(A.left+A.right)/2,(A.top+A.bottom)/2],U=[(c.left+c.right)/2,(c.top+c.bottom)/2],z=.75*d.delta.font.size;"left"===d.delta.position&&(O=Q(d,"deltaPos",0,-1*(A.width*v[d.align]+c.width*(1-v[d.align])+z),F,Math.min),P=G[1]-U[1],g={width:A.width+c.width+z,height:Math.max(A.height,c.height),left:c.left+O,right:A.right,top:Math.min(A.top,c.top+P),bottom:Math.max(A.bottom,c.bottom+P)}),"right"===d.delta.position&&(O=Q(d,"deltaPos",0,A.width*(1-v[d.align])+c.width*v[d.align]+z,F,Math.max),P=G[1]-U[1],g={width:A.width+c.width+z,height:Math.max(A.height,c.height),left:A.left,right:c.right+O,top:Math.min(A.top,c.top+P),bottom:Math.max(A.bottom,c.bottom+P)}),"bottom"===d.delta.position&&(O=null,P=c.height,g={width:Math.max(A.width,c.width),height:A.height+c.height,left:Math.min(A.left,c.left),right:Math.max(A.right,c.right),top:A.bottom-A.height,bottom:A.bottom+c.height}),"top"===d.delta.position&&(O=null,P=A.top,g={width:Math.max(A.width,c.width),height:A.height+c.height,left:Math.min(A.left,c.left),right:Math.max(A.right,c.right),top:A.bottom-A.height-c.height,bottom:A.bottom}),N.attr({dx:O,dy:P})}(d._hasNumber||d._hasDelta)&&k.attr("transform",(function(){var e=i.numbersScaler(g);F+=e[2];var t,r=Q(d,"numbersScale",1,e[0],F,Math.min);d._scaleNumbers||(r=1),t=d._isAngular?y-r*g.bottom:y-r*(g.top+g.bottom)/2,d._numbersTop=r*g.top+t;var n=g[B];"center"===B&&(n=(g.left+g.right)/2);var a=p-r*n;return a=Q(d,"numbersTranslate",0,a,F,Math.max),l(a,t)+s(r)}))}(e,M,t,{numbersX:d,numbersY:_,numbersScaler:S,transitionOpts:r,onComplete:p}),R&&(k={range:T.gauge.axis.range,color:T.gauge.bgcolor,line:{color:T.gauge.bordercolor,width:0},thickness:1},D={range:T.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:T.gauge.bordercolor,width:T.gauge.borderwidth},thickness:1});var J=M.selectAll("g.angular").data(L?t:[]);J.exit().remove();var K=M.selectAll("g.angularaxis").data(L?t:[]);K.exit().remove(),L&&function(e,t,r,a){var o,s,u,g,f=r[0].trace,d=a.size,p=a.radius,y=a.innerRadius,m=a.gaugeBg,I=a.gaugeOutline,v=[d.l+d.w/2,d.t+d.h/2+p/2],E=a.gauge,x=a.layer,w=a.transitionOpts,Q=a.onComplete,_=Math.PI/2;function S(e){var t=f.gauge.axis.range[0],r=(e-t)/(f.gauge.axis.range[1]-t)*Math.PI-_;return r<-_?-_:r>_?_:r}function k(e){return n.svg.arc().innerRadius((y+p)/2-e/2*(p-y)).outerRadius((y+p)/2+e/2*(p-y)).startAngle(-_)}function D(e){e.attr("d",(function(e){return k(e.thickness).startAngle(S(e.range[0])).endAngle(S(e.range[1]))()}))}E.enter().append("g").classed("angular",!0),E.attr("transform",l(v[0],v[1])),x.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),x.selectAll("g.xangularaxistick,path,text").remove(),(o=b(e,f.gauge.axis)).type="linear",o.range=f.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var T=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},M={},R=h.makeLabelFns(o,0).labelStandoff;M.xFn=function(e){var t=T(e);return Math.cos(t)*R},M.yFn=function(e){var t=T(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(R+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*c)},M.anchorFn=function(e){var t=T(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},M.heightFn=function(e,t,r){var n=T(e);return-.5*(1+Math.sin(n))*r};var L=function(e){return l(v[0]+p*Math.cos(e),v[1]-p*Math.sin(e))};u=function(e){return L(T(e))};var N=function(e){var t=T(e);return L(t)+"rotate("+-A(t)+")"};if(s=h.calcTicks(o),g=h.getTickSigns(o)[2],o.visible){g="inside"===o.ticks?-1:1;var F=(o.linewidth||1)/2;h.drawTicks(e,o,{vals:s,layer:x,path:"M"+g*F+",0h"+g*o.ticklen,transFn:N}),h.drawLabels(e,o,{vals:s,layer:x,transFn:u,labelFns:M})}var O=[m].concat(f.gauge.steps),P=E.selectAll("g.bg-arc").data(O);P.enter().append("g").classed("bg-arc",!0).append("path"),P.select("path").call(D).call(B),P.exit().remove();var G=k(f.gauge.bar.thickness),U=E.selectAll("g.value-arc").data([f.gauge.bar]);U.enter().append("g").classed("value-arc",!0).append("path");var z,q,H,Y=U.select("path");C(w)?(Y.transition().duration(w.duration).ease(w.easing).each("end",(function(){Q&&Q()})).each("interrupt",(function(){Q&&Q()})).attrTween("d",(z=G,q=S(r[0].lastY),H=S(r[0].y),function(){var e=i(q,H);return function(t){return z.endAngle(e(t))()}})),f._lastValue=r[0].y):Y.attr("d","number"===typeof r[0].y?G.endAngle(S(r[0].y)):"M0,0Z"),Y.call(B),U.exit().remove(),O=[];var J=f.gauge.threshold.value;(J||0===J)&&O.push({range:[J,J],color:f.gauge.threshold.color,line:{color:f.gauge.threshold.line.color,width:f.gauge.threshold.line.width},thickness:f.gauge.threshold.thickness});var K=E.selectAll("g.threshold-arc").data(O);K.enter().append("g").classed("threshold-arc",!0).append("path"),K.select("path").call(D).call(B),K.exit().remove();var j=E.selectAll("g.gauge-outline").data([I]);j.enter().append("g").classed("gauge-outline",!0).append("path"),j.select("path").call(D).call(B),j.exit().remove()}(e,0,t,{radius:U,innerRadius:z,gauge:J,layer:K,size:O,gaugeBg:k,gaugeOutline:D,transitionOpts:r,onComplete:p});var j=M.selectAll("g.bullet").data(N?t:[]);j.exit().remove();var V=M.selectAll("g.bulletaxis").data(N?t:[]);V.exit().remove(),N&&function(e,t,r,n){var i,a,o,s,A,c=r[0].trace,u=n.gauge,f=n.layer,d=n.gaugeBg,p=n.gaugeOutline,y=n.size,I=c.domain,v=n.transitionOpts,E=n.onComplete;u.enter().append("g").classed("bullet",!0),u.attr("transform",l(y.l,y.t)),f.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),f.selectAll("g.xbulletaxistick,path,text").remove();var x=y.h,w=c.gauge.bar.thickness*x,Q=I.x[0],_=I.x[0]+(I.x[1]-I.x[0])*(c._hasNumber||c._hasDelta?1-g.bulletNumberDomainSize:1);function S(e){e.attr("width",(function(e){return Math.max(0,i.c2p(e.range[1])-i.c2p(e.range[0]))})).attr("x",(function(e){return i.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*x})).attr("height",(function(e){return e.thickness*x}))}(i=b(e,c.gauge.axis))._id="xbulletaxis",i.domain=[Q,_],i.setScale(),a=h.calcTicks(i),o=h.makeTransTickFn(i),s=h.getTickSigns(i)[2],A=y.t+y.h,i.visible&&(h.drawTicks(e,i,{vals:"inside"===i.ticks?h.clipEnds(i,a):a,layer:f,path:h.makeTickPath(i,A,s),transFn:o}),h.drawLabels(e,i,{vals:a,layer:f,transFn:o,labelFns:h.makeLabelFns(i,A)}));var k=[d].concat(c.gauge.steps),D=u.selectAll("g.bg-bullet").data(k);D.enter().append("g").classed("bg-bullet",!0).append("rect"),D.select("rect").call(S).call(B),D.exit().remove();var T=u.selectAll("g.value-bullet").data([c.gauge.bar]);T.enter().append("g").classed("value-bullet",!0).append("rect"),T.select("rect").attr("height",w).attr("y",(x-w)/2).call(B),C(v)?T.select("rect").transition().duration(v.duration).ease(v.easing).each("end",(function(){E&&E()})).each("interrupt",(function(){E&&E()})).attr("width",Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y)))):T.select("rect").attr("width","number"===typeof r[0].y?Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y))):0),T.exit().remove();var M=r.filter((function(){return c.gauge.threshold.value||0===c.gauge.threshold.value})),R=u.selectAll("g.threshold-bullet").data(M);R.enter().append("g").classed("threshold-bullet",!0).append("line"),R.select("line").attr("x1",i.c2p(c.gauge.threshold.value)).attr("x2",i.c2p(c.gauge.threshold.value)).attr("y1",(1-c.gauge.threshold.thickness)/2*x).attr("y2",(1-(1-c.gauge.threshold.thickness)/2)*x).call(m.stroke,c.gauge.threshold.line.color).style("stroke-width",c.gauge.threshold.line.width),R.exit().remove();var L=u.selectAll("g.gauge-outline").data([p]);L.enter().append("g").classed("gauge-outline",!0).append("rect"),L.select("rect").call(S).call(B),L.exit().remove()}(e,0,t,{gauge:j,layer:V,size:O,gaugeBg:k,gaugeOutline:D,transitionOpts:r,onComplete:p});var W=M.selectAll("text.title").data(t);W.exit().remove(),W.enter().append("text").classed("title",!0),W.attr("text-anchor",(function(){return N?I.right:I[T.title.align]})).text(T.title.text).call(u.font,T.title.font).call(f.convertToTspans,e),W.attr("transform",(function(){var e,t=O.l+O.w*v[T.title.align],r=g.titlePadding,n=u.bBox(W.node());return R?(L&&(e=T.gauge.axis.visible?u.bBox(K.node()).top-r-n.bottom:O.t+O.h/2-U/2-n.bottom-r),N&&(e=_-(n.top+n.bottom)/2,t=O.l-g.bulletPadding*O.w)):e=T._numbersTop-r-n.bottom,l(t,e)}))}))}},50048:function(e,t,r){"use strict";var n=r(49084),i=r(29736).axisHoverFormat,a=r(21776).Ks,o=r(52948),s=r(45464),l=r(92880).extendFlat,A=r(67824).overrideAll,c=e.exports=A(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},62624:function(e,t,r){"use strict";var n=r(47128),i=r(3832).processGrid,a=r(3832).filter;e.exports=function(e,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=a(t.x,t._len),t._y=a(t.y,t._len),t._z=a(t.z,t._len),t._value=a(t.value,t._len);var r=i(t);t._gridFill=r.fill,t._Xs=r.Xs,t._Ys=r.Ys,t._Zs=r.Zs,t._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(t[r],t[r-1]),i=Math.max(t[r],t[r-1]);if(i>n&&n-1}function N(e,t){return null===e?t:e}function F(t,r,n){k();var i,a,o,l=[r],A=[n];if(s>=1)l=[r],A=[n];else if(s>0){var c=function(e,t){var r=e[0],n=e[1],i=e[2],a=function(e,t,r){for(var n=[],i=0;i-1?n[f]:S(h,d,y);g[f]=I>-1?I:T(h,d,y,N(t,m))}i=g[0],a=g[1],o=g[2],e._meshI.push(i),e._meshJ.push(a),e._meshK.push(o),++p}}function O(e,t,r,n){var i=e[3];in&&(i=n);for(var a=(e[3]-i)/(e[3]-t[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*e[s]+a*t[s];return o}function P(e,t,r){return e>=t&&e<=r}function G(e){var t=.001*(_-Q);return e>=Q-t&&e<=_+t}function U(t){for(var r=[],n=0;n<4;n++){var i=t[n];r.push([e._x[i],e._y[i],e._z[i],e._value[i]])}return r}var z=3;function q(e,t,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[P(t[0][3],n,i),P(t[1][3],n,i),P(t[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(e,t,r){return G(t[0][3])&&G(t[1][3])&&G(t[2][3])?(F(e,t,r),!0):aMath.abs(B-w)?[x,B]:[B,w];ee(r,S[0],S[1])}}var k=[[Math.min(Q,w),Math.max(Q,w)],[Math.min(x,_),Math.max(x,_)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i0&&(u.push(h.id),"x"===r?g.push([h.distRatio,0,0]):"y"===r?g.push([0,h.distRatio,0]):g.push([0,0,h.distRatio]))}else c=ie(1,"x"===r?v-1:"y"===r?E-1:C-1);u.length>0&&(n[a]="x"===r?te(t,u,o,s,g,n[a]):"y"===r?re(t,u,o,s,g,n[a]):ne(t,u,o,s,g,n[a]),a++),c.length>0&&(n[a]="x"===r?W(t,c,o,s,n[a]):"y"===r?Z(t,c,o,s,n[a]):X(t,c,o,s,n[a]),a++)}var d=e.caps[r];d.show&&d.fill&&(R(d.fill),n[a]="x"===r?W(t,[0,v-1],o,s,n[a]):"y"===r?Z(t,[0,E-1],o,s,n[a]):X(t,[0,C-1],o,s,n[a]),a++)}})),0===p&&D(),e._meshX=n,e._meshY=i,e._meshZ=a,e._meshIntensity=o,e._Xs=y,e._Ys=m,e._Zs=I}(),e}e.exports={findNearestOnAxis:A,generateIsoMeshes:f,createIsosurfaceTrace:function(e,t){var r=e.glplot.gl,i=n({gl:r}),a=new c(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}},70548:function(e,t,r){"use strict";var n=r(3400),i=r(24040),a=r(50048),o=r(27260);function s(e,t,r,n,a){var s=a("isomin"),l=a("isomax");void 0!==l&&null!==l&&void 0!==s&&null!==s&&s>l&&(t.isomin=null,t.isomax=null);var A=a("x"),c=a("y"),u=a("z"),g=a("value");A&&A.length&&c&&c.length&&u&&u.length&&g&&g.length?(i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(e){a(e+"hoverformat");var t="caps."+e;a(t+".show")&&a(t+".fill");var r="slices."+e;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(e){a(e)})),o(e,t,n,a,{prefix:"",cLetter:"c"}),t._length=null):t.visible=!1}e.exports={supplyDefaults:function(e,t,r,i){s(e,t,0,i,(function(r,i){return n.coerce(e,t,a,r,i)}))},supplyIsoDefaults:s}},6296:function(e,t,r){"use strict";e.exports={attributes:r(50048),supplyDefaults:r(70548).supplyDefaults,calc:r(62624),colorbar:{min:"cmin",max:"cmax"},plot:r(31460).createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:r(12536),categories:["gl3d","showLegend"],meta:{}}},52948:function(e,t,r){"use strict";var n=r(49084),i=r(29736).axisHoverFormat,a=r(21776).Ks,o=r(16716),s=r(45464),l=r(92880).extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},1876:function(e,t,r){"use strict";var n=r(47128);e.exports=function(e,t){t.intensity&&n(e,t,{vals:t.intensity,containerStr:"",cLetter:"c"})}},576:function(e,t,r){"use strict";var n=r(67792).gl_mesh3d,i=r(67792).delaunay_triangulate,a=r(67792).alpha_shape,o=r(67792).convex_hull,s=r(33040).parseColorScale,l=r(3400).isArrayOrTypedArray,A=r(43080),c=r(8932).extractOpts,u=r(52094);function g(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=g.prototype;function h(e){for(var t=[],r=e.length,n=0;n=t-.5)return!1;return!0}f.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index;e.data._cellCenter?e.traceCoordinate=e.data.dataCoordinate:e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]];var r=this.data.hovertext||this.data.text;return l(r)&&void 0!==r[t]?e.textLabel=r[t]:r&&(e.textLabel=r),!0}},f.update=function(e){var t=this.scene,r=t.fullSceneLayout;this.data=e;var n,l=e.x.length,g=u(d(r.xaxis,e.x,t.dataScale[0],e.xcalendar),d(r.yaxis,e.y,t.dataScale[1],e.ycalendar),d(r.zaxis,e.z,t.dataScale[2],e.zcalendar));if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!y(e.i,l)||!y(e.j,l)||!y(e.k,l))return;n=u(p(e.i),p(e.j),p(e.k))}else n=0===e.alphahull?o(g):e.alphahull>0?a(e.alphahull,g):function(e,t){for(var r=["x","y","z"].indexOf(e),n=[],a=t.length,o=0;oy):p=x>C,y=x;var w=A(C,B,b,x);w.pos=E,w.yc=(C+x)/2,w.i=v,w.dir=p?"increasing":"decreasing",w.x=w.pos,w.y=[b,B],m&&(w.orig_p=r[v]),h&&(w.tx=t.text[v]),d&&(w.htx=t.hovertext[v]),I.push(w)}else I.push({pos:E,empty:!0})}return t._extremes[l._id]=a.findExtremes(l,n.concat(g,u),{padded:!0}),I.length&&(I[0].t={labels:{open:i(e,"open:")+" ",high:i(e,"high:")+" ",low:i(e,"low:")+" ",close:i(e,"close:")+" "}}),I}e.exports={calc:function(e,t){var r=a.getFromId(e,t.xaxis),i=a.getFromId(e,t.yaxis),s=function(e,t,r){var i=r._minDiff;if(!i){var a,s=e._fullData,l=[];for(i=1/0,a=0;a"+A.labels[I]+n.hoverLabelText(s,v,l.yhoverformat):((m=i.extendFlat({},g)).y0=m.y1=E,m.yLabelVal=v,m.yLabel=A.labels[I]+n.hoverLabelText(s,v,l.yhoverformat),m.name="",u.push(m),p[v]=m)}return u}function g(e,t,r,i){var a=e.cd,o=e.ya,l=a[0].trace,u=a[0].t,g=c(e,t,r,i);if(!g)return[];var f=a[g.index],h=g.index=f.i,d=f.dir;function p(e){return u.labels[e]+n.hoverLabelText(o,l[e][h],l.yhoverformat)}var y=f.hi||l.hoverinfo,m=y.split("+"),I="all"===y,v=I||-1!==m.indexOf("y"),E=I||-1!==m.indexOf("text"),C=v?[p("open"),p("high"),p("low"),p("close")+" "+A[d]]:[];return E&&s(f,l,C),g.extraText=C.join("
"),g.y0=g.y1=o.c2p(f.yc,!0),[g]}e.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?u(e,t,r,n):g(e,t,r,n)},hoverSplit:u,hoverOnPoints:g}},65456:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:r(57952),categories:["cartesian","svg","showLegend"],meta:{},attributes:r(20279),supplyDefaults:r(23860),calc:r(42812).calc,plot:r(36664),style:r(14008),hoverPoints:r(18720).hoverPoints,selectPoints:r(97384)}},52744:function(e,t,r){"use strict";var n=r(24040),i=r(3400);e.exports=function(e,t,r,a){var o=r("x"),s=r("open"),l=r("high"),A=r("low"),c=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],a),s&&l&&A&&c){var u=Math.min(s.length,l.length,A.length,c.length);return o&&(u=Math.min(u,i.minRowLength(o))),t._length=u,u}}},36664:function(e,t,r){"use strict";var n=r(33428),i=r(3400);e.exports=function(e,t,r,a){var o=t.yaxis,s=t.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],a=r.t;if(!0!==r.trace.visible||a.empty)t.remove();else{var A=a.tickLen,c=t.selectAll("path").data(i.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=s.c2p(e.pos-A,!0),r=s.c2p(e.pos+A,!0),n=l?(t+r)/2:s.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},97384:function(e){"use strict";e.exports=function(e,t){var r,n=e.cd,i=e.xaxis,a=e.yaxis,o=[],s=n[0].t.bPos||0;if(!1===t)for(r=0;r=e.length)return!1;if(void 0!==t[e[r]])return!1;t[e[r]]=!0}return!0}(r))for(t=0;t0||c(s);A&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete e.categoryarray,delete e.ticktext),A||"array"!==u||(t.categoryorder="trace")}}e.exports=function(e,t,r,c){function g(r,i){return n.coerce(e,t,l,r,i)}var f=s(e,t,{name:"dimensions",handleItemDefaults:u}),h=function(e,t,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,c,g);o(t,c,g),Array.isArray(f)&&f.length||(t.visible=!1),A(t,f,"values",h),g("hoveron"),g("hovertemplate"),g("arrangement"),g("bundlecolors"),g("sortpaths"),g("counts");var d={weight:c.font.weight,style:c.font.style,variant:c.font.variant,family:c.font.family,size:Math.round(c.font.size),color:c.font.color};n.coerceFont(g,"labelfont",d);var p={weight:c.font.weight,style:c.font.style,variant:c.font.variant,family:c.font.family,size:Math.round(c.font.size/1.2),color:c.font.color};n.coerceFont(g,"tickfont",p)}},22020:function(e,t,r){"use strict";e.exports={attributes:r(72140),supplyDefaults:r(76671),calc:r(69136),plot:r(60268),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:r(91800),categories:["noOpacity"],meta:{}}},51036:function(e,t,r){"use strict";var n=r(33428),i=r(67756).Gz,a=r(36424),o=r(93024),s=r(3400),l=s.strTranslate,A=r(43616),c=r(49760),u=r(72736);function g(e,t,r,i){var a=t._context.staticPlot,o=e.map(F.bind(0,t,r)),c=i.selectAll("g.parcatslayer").data([null]);c.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var g=c.selectAll("g.trace.parcats").data(o,f),m=g.enter().append("g").attr("class","trace parcats");g.attr("transform",(function(e){return l(e.x,e.y)})),m.append("g").attr("class","paths");var I=g.select("g.paths").selectAll("path.path").data((function(e){return e.paths}),f);I.attr("fill",(function(e){return e.model.color}));var C=I.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(e){return e.model.color})).attr("fill-opacity",0);E(C),I.attr("d",(function(e){return e.svgD})),C.empty()||I.sort(d),I.exit().remove(),I.on("mouseover",p).on("mouseout",y).on("click",v),m.append("g").attr("class","dimensions");var x=g.select("g.dimensions").selectAll("g.dimension").data((function(e){return e.dimensions}),f);x.enter().append("g").attr("class","dimension"),x.attr("transform",(function(e){return l(e.x,0)})),x.exit().remove();var w=x.selectAll("g.category").data((function(e){return e.categories}),f),Q=w.enter().append("g").attr("class","category");w.attr("transform",(function(e){return l(0,e.y)})),Q.append("rect").attr("class","catrect").attr("pointer-events","none"),w.select("rect.catrect").attr("fill","none").attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),B(Q);var _=w.selectAll("rect.bandrect").data((function(e){return e.bands}),f);_.each((function(){s.raiseToTop(this)})),_.attr("fill",(function(e){return e.color}));var R=_.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(e){return e.color})).attr("fill-opacity",0);_.attr("fill",(function(e){return e.color})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("y",(function(e){return e.y})).attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"perpendicular"===e.parcatsViewModel.arrangement?"ns-resize":"move"})),b(R),_.exit().remove(),Q.append("text").attr("class","catlabel").attr("pointer-events","none");var L=t._fullLayout.paper_bgcolor;w.select("text.catlabel").attr("text-anchor",(function(e){return h(e)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",u.makeTextShadow(L)).style("fill","rgb(0, 0, 0)").attr("x",(function(e){return h(e)?e.width+5:-5})).attr("y",(function(e){return e.height/2})).text((function(e){return e.model.categoryLabel})).each((function(e){A.font(n.select(this),e.parcatsViewModel.categorylabelfont),u.convertToTspans(n.select(this),t)})),Q.append("text").attr("class","dimlabel"),w.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(e){return e.width/2})).attr("y",-5).text((function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null})).each((function(e){A.font(n.select(this),e.parcatsViewModel.labelfont)})),w.selectAll("rect.bandrect").on("mouseover",S).on("mouseout",k),w.exit().remove(),x.call(n.behavior.drag().origin((function(e){return{x:e.x,y:0}})).on("dragstart",D).on("drag",T).on("dragend",M)),g.each((function(e){e.traceSelection=n.select(this),e.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),e.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),g.exit().remove()}function f(e){return e.key}function h(e){var t=e.parcatsViewModel.dimensions.length,r=e.parcatsViewModel.dimensions[t-1].model.dimensionInd;return e.model.dimensionInd===r}function d(e,t){return e.model.rawColor>t.model.rawColor?1:e.model.rawColor"),S=n.mouse(u)[0];o.loneHover({trace:g,x:v-h.left+d.left,y:E-h.top+d.top,text:_,color:e.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:B,idealAlign:S1&&g.displayInd===u.dimensions.length-1?(i=A.left,a="left"):(i=A.left+A.width,a="right");var d=c.model.count,p=c.model.categoryLabel,y=d/c.parcatsViewModel.model.count,m={countLabel:d,categoryLabel:p,probabilityLabel:y.toFixed(3)},I=[];-1!==c.parcatsViewModel.hoverinfoItems.indexOf("count")&&I.push(["Count:",m.countLabel].join(" ")),-1!==c.parcatsViewModel.hoverinfoItems.indexOf("probability")&&I.push(["P("+m.categoryLabel+"):",m.probabilityLabel].join(" "));var v=I.join("
");return{trace:f,x:o*(i-t.left),y:s*(h-t.top),text:v,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:f.hovertemplate,hovertemplateLabels:m,eventData:[{data:f._input,fullData:f,count:d,category:p,probability:y}]}}function S(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var t,r=e.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=e.parcatsViewModel.hoveron,A=this;"color"===l?(function(e){var t=n.select(e).datum(),r=x(t);C(r),r.each((function(){s.raiseToTop(this)})),n.select(e.parentNode).selectAll("rect.bandrect").filter((function(e){return e.color===t.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(A),Q(A,"plotly_hover",n.event)):(function(e){n.select(e.parentNode).selectAll("rect.bandrect").each((function(e){var t=x(e);C(t),t.each((function(){s.raiseToTop(this)}))})),n.select(e.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(A),w(A,"plotly_hover",n.event)),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?t=_(r,a,A):"color"===l?t=function(e,t,r){e._fullLayout._calcInverseTransform(e);var i,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=r.getBoundingClientRect(),A=n.select(r).datum(),u=A.categoryViewModel,g=u.parcatsViewModel,f=g.model.dimensions[u.model.dimensionInd],h=g.trace,d=l.y+l.height/2;g.dimensions.length>1&&f.displayInd===g.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var p=u.model.categoryLabel,y=A.parcatsViewModel.model.count,m=0;A.categoryViewModel.bands.forEach((function(e){e.color===A.color&&(m+=e.count)}));var I=u.model.count,v=0;g.pathSelection.each((function(e){e.model.color===A.color&&(v+=e.model.count)}));var E=m/y,C=m/v,B=m/I,b={countLabel:m,categoryLabel:p,probabilityLabel:E.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",b.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(x.push("P(color \u2229 "+p+"): "+b.probabilityLabel),x.push("P("+p+" | color): "+C.toFixed(3)),x.push("P(color | "+p+"): "+B.toFixed(3)));var w=x.join("
"),Q=c.mostReadable(A.color,["black","white"]);return{trace:h,x:o*(i-t.left),y:s*(d-t.top),text:w,color:A.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Q,fontSize:10,idealAlign:a,hovertemplate:h.hovertemplate,hovertemplateLabels:b,eventData:[{data:h._input,fullData:h,category:p,count:y,probability:E,categorycount:I,colorcount:v,bandcolorcount:m}]}}(r,a,A):"dimension"===l&&(t=function(e,t,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(_(e,t,this))})),i}(r,a,A)),t&&o.loneHover(t,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r}))}}function k(e){var t=e.parcatsViewModel;t.dragDimension||(E(t.pathSelection),B(t.dimensionSelection.selectAll("g.category")),b(t.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(d),-1!==t.hoverinfoItems.indexOf("skip"))||("color"===e.parcatsViewModel.hoveron?Q(this,"plotly_unhover",n.event):w(this,"plotly_unhover",n.event))}function D(e){"fixed"!==e.parcatsViewModel.arrangement&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(t){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=t.width+2&&-2<=i&&i<=t.height+2&&(e.dragCategoryDisplayInd=t.model.displayInd,e.initialDragCategoryDisplayInds=e.model.categories.map((function(e){return e.displayInd})),t.model.dragY=t.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(t){t.yu.y+u.height/2&&(o.model.displayInd=u.model.displayInd,u.model.displayInd=l),e.dragCategoryDisplayInd=o.model.displayInd}if(null===e.dragCategoryDisplayInd||"freeform"===e.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var g=e.parcatsViewModel.dimensions[r],f=e.parcatsViewModel.dimensions[i];void 0!==g&&a.model.dragXf.x&&(a.model.displayInd=f.model.displayInd,f.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=a.model.displayInd}G(e.parcatsViewModel),P(e.parcatsViewModel),N(e.parcatsViewModel),L(e.parcatsViewModel)}}function M(e){if("fixed"!==e.parcatsViewModel.arrangement&&null!==e.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var t={},r=R(e.parcatsViewModel),i=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),o=e.initialDragDimensionDisplayInds.some((function(e,t){return e!==i[t]}));o&&i.forEach((function(r,n){var i=e.parcatsViewModel.model.dimensions[n].containerInd;t["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==e.dragCategoryDisplayInd){var l=e.model.categories.map((function(e){return e.displayInd}));if(s=e.initialDragCategoryDisplayInds.some((function(e,t){return e!==l[t]}))){var A=e.model.categories.slice().sort((function(e,t){return e.displayInd-t.displayInd})),c=A.map((function(e){return e.categoryValue})),u=A.map((function(e){return e.categoryLabel}));t["dimensions["+e.model.containerInd+"].categoryarray"]=[c],t["dimensions["+e.model.containerInd+"].ticktext"]=[u],t["dimensions["+e.model.containerInd+"].categoryorder"]="array"}}-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!e.dragHasMoved&&e.potentialClickBand&&("color"===e.parcatsViewModel.hoveron?Q(e.potentialClickBand,"plotly_click",n.event.sourceEvent):w(e.potentialClickBand,"plotly_click",n.event.sourceEvent)),e.model.dragX=null,null!==e.dragCategoryDisplayInd&&(e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd].model.dragY=null,e.dragCategoryDisplayInd=null),e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,G(e.parcatsViewModel),P(e.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){N(e.parcatsViewModel,!0),L(e.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(e.parcatsViewModel.graphDiv,t,[r])}))}}function R(e){for(var t,r=e.graphDiv._fullData,n=0;n=0;s--)c+="C"+A[s]+","+(t[s+1]+n)+" "+l[s]+","+(t[s]+n)+" "+(e[s]+r[s])+","+(t[s]+n),c+="l-"+r[s]+",0 ";return c+="Z"}function P(e){var t=e.dimensions,r=e.model,n=t.map((function(e){return e.categories.map((function(e){return e.y}))})),i=e.model.dimensions.map((function(e){return e.categories.map((function(e){return e.displayInd}))})),a=e.model.dimensions.map((function(e){return e.displayInd})),o=e.dimensions.map((function(e){return e.model.dimensionInd})),s=t.map((function(e){return e.x})),l=t.map((function(e){return e.width})),A=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&A.push(r.paths[c]);function u(e){var t=e.categoryInds.map((function(e,t){return i[t][e]}));return o.map((function(e){return t[e]}))}A.sort((function(t,r){var n=u(t),i=u(r);return"backward"===e.sortpaths&&(n.reverse(),i.reverse()),n.push(t.valueInds[0]),i.push(r.valueInds[0]),e.bundlecolors&&(n.unshift(t.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var g=new Array(A.length),f=t[0].model.count,h=t[0].categories.map((function(e){return e.height})).reduce((function(e,t){return e+t})),d=0;d0?h*(y.count/f):0;for(var m,I=new Array(n.length),v=0;v1?(e.width-80-16)/(n-1):0)*i;var a,o,s,l,A,c=[],u=e.model.maxCats,g=t.categories.length,f=t.count,h=e.height-8*(u-1),d=8*(u-g)/2,p=t.categories.map((function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}}));for(p.sort((function(e,t){return e.displayInd-t.displayInd})),A=0;A0?o.count/f*h:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:d,bands:[],parcatsViewModel:e},d=d+a+8,c.push(s);return{key:t.dimensionInd,x:null!==t.dragX?t.dragX:r,y:0,width:16,model:t,categories:c,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(e,t,r,n){g(r,e,n,t)}},60268:function(e,t,r){"use strict";var n=r(51036);e.exports=function(e,t,r,i){var a=e._fullLayout,o=a._paper,s=a._size;n(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},82296:function(e,t,r){"use strict";var n=r(49084),i=r(94724),a=r(25376),o=r(86968).u,s=r(92880).extendFlat,l=r(31780).templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},71864:function(e,t,r){"use strict";var n=r(30140),i=r(33428),a=r(71688).keyFun,o=r(71688).repeat,s=r(3400).sorterAsc,l=r(3400).strTranslate,A=n.bar.snapRatio;function c(e,t){return e*(1-A)+t*A}var u=n.bar.snapClose;function g(e,t){return e*(1-u)+t*u}function f(e,t,r,n){if(function(e,t){for(var r=0;r=t[r][0]&&e<=t[r][1])return!0;return!1}(r,n))return r;var i=e?-1:1,a=0,o=t.length-1;if(i<0){var s=a;a=o,o=s}for(var l=t[a],A=l,u=a;i*ut){g=r;break}}if(a=c,isNaN(a)&&(a=isNaN(u)||isNaN(g)?isNaN(u)?g:u:t-A[u][1]e[1]+r||t=.9*e[1]+.1*e[0]?"n":t<=.9*e[0]+.1*e[1]?"s":"ns"}(h,t);d&&(o.interval=l[a],o.intervalPix=h,o.region=d)}}if(e.ordinal&&!o.region){var p=e.unitTickvals,m=e.unitToPaddedPx.invert(t);for(r=0;r=I[0]&&m<=I[1]){o.clickableOrdinalRange=I;break}}}return o}function C(e,t){i.event.sourceEvent.stopPropagation();var r=t.height-i.mouse(e)[1]-2*n.verticalPadding,a=t.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(t.unitToPaddedPx.invert):a.newExtent=[a.startExtent,t.unitToPaddedPx.invert(r)].sort(s),t.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(t),v(e.parentNode)}function B(e,t){var r=E(t,t.height-i.mouse(e)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function b(e){e.on("mousemove",(function(e){i.event.preventDefault(),e.parent.inBrushDrag||B(this,e)})).on("mouseleave",(function(e){e.parent.inBrushDrag||m()})).call(i.behavior.drag().on("dragstart",(function(e){!function(e,t){i.event.sourceEvent.stopPropagation();var r=t.height-i.mouse(e)[1]-2*n.verticalPadding,a=t.unitToPaddedPx.invert(r),o=t.brush,s=E(t,r),l=s.interval,A=o.svgBrush;if(A.wasDragged=!1,A.grabbingBar="ns"===s.region,A.grabbingBar){var c=l.map(t.unitToPaddedPx);A.grabPoint=r-c[0]-n.verticalPadding,A.barLength=c[1]-c[0]}A.clickableOrdinalRange=s.clickableOrdinalRange,A.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(A.stayingIntervals=A.stayingIntervals.filter((function(e){return e[0]!==l[0]&&e[1]!==l[1]}))),A.startExtent=s.region?l["s"===s.region?1:0]:a,t.parent.inBrushDrag=!0,A.brushStartCallback()}(this,e)})).on("drag",(function(e){C(this,e)})).on("dragend",(function(e){!function(e,t){var r=t.brush,n=r.filter,a=r.svgBrush;a._dragging||(B(e,t),C(e,t),t.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,m(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&w(r)):w(r),a.brushCallback(t),v(e.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(A?[a.newExtent]:[]),a.extent.length||w(r),a.brushCallback(t),A?v(e.parentNode,s):(s(),v(e.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,e)})))}function x(e,t){return e[0]-t[0]}function w(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function Q(e){for(var t,r=e.slice(),n=[],i=r.shift();i;){for(t=i.slice();(i=r.shift())&&i[0]<=t[1];)t[1]=Math.max(t[1],i[1]);n.push(t)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(e,t,r,n,i,a){var o,l=function(){var e,t,r=[];return{set:function(n){1===(r=n.map((function(e){return e.slice().sort(s)})).sort(x)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),e=Q(r),t=r.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return e},getBounds:function(){return t}}}();return l.set(r),{filter:l,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(e){var t=e.brush,r=function(e){return e.svgBrush.extent.map((function(e){return e.slice()}))}(t),n=r.slice();t.filter.set(n),o()}),brushEndCallback:a}}},ensureAxisBrush:function(e,t,r){var i=e.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(e,t,r){var i=r._context.staticPlot,a=e.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(h).call(d).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(b).attr("height",(function(e){return e.height-n.verticalPadding}));var s=e.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",t).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(e){return e.height})).call(I);var A=e.selectAll(".highlight").data(o);A.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),A.attr("y1",(function(e){return e.height})).call(I)}(i,t,r)},cleanRanges:function(e,t){if(Array.isArray(e[0])?(e=e.map((function(e){return e.sort(s)})),e=t.multiselect?Q(e.sort(x)):[e[0]]):e=[e.sort(s)],t.tickvals){var r=t.tickvals.slice().sort(s);if(!(e=e.map((function(e){var t=[f(0,r,e[0],[]),f(1,r,e[1],[])];if(t[1]>t[0])return t})).filter((function(e){return e}))).length)return}return e.length>1?e:e[0]}}},61664:function(e,t,r){"use strict";e.exports={attributes:r(82296),supplyDefaults:r(60664),calc:r(95044),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:r(19976),categories:["gl","regl","noOpacity","noHover"],meta:{}}},19976:function(e,t,r){"use strict";var n=r(33428),i=r(84888)._M,a=r(24196),o=r(9616);t.name="parcoords",t.plot=function(e){var t=i(e.calcdata,"parcoords")[0];t.length&&a(e,t)},t.clean=function(e,t,r,n){var i=n._has&&n._has("parcoords"),a=t._has&&t._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(e){var t=e._fullLayout._glimages,r=n.select(e).selectAll(".svg-container");r.filter((function(e,t){return t===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this,r=e.toDataURL("image/png");t.append("svg:image").attr({xmlns:o.svg,"xlink:href":r,preserveAspectRatio:"none",x:0,y:0,width:e.style.width,height:e.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},95044:function(e,t,r){"use strict";var n=r(3400).isArrayOrTypedArray,i=r(8932),a=r(71688).wrap;e.exports=function(e,t){var r,o;return i.hasColorscale(t,"line")&&n(t.line.color)?(r=t.line.color,o=i.extractOpts(t.line).colorscale,i.calc(e,t,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(e){for(var t=new Array(e),r=0;ru&&(n.log("parcoords traces support up to "+u+" dimensions at the moment"),h.splice(u));var d=s(e,t,{name:"dimensions",layout:l,handleItemDefaults:f}),p=function(e,t,r,o,s){var l=s("line.color",r);if(i(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,l,c);o(t,l,c),Array.isArray(d)&&d.length||(t.visible=!1),g(t,d,"values",p);var y={weight:l.font.weight,style:l.font.style,variant:l.font.variant,family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",y),n.coerceFont(c,"tickfont",y),n.coerceFont(c,"rangefont",y),c("labelangle"),c("labelside"),c("unselected.line.color"),c("unselected.line.opacity")}},95724:function(e,t,r){"use strict";var n=r(3400).isTypedArray;t.convertTypedArray=function(e){return n(e)?Array.prototype.slice.call(e):e},t.isOrdinal=function(e){return!!e.tickvals},t.isVisible=function(e){return e.visible||!("visible"in e)}},29928:function(e,t,r){"use strict";var n=r(61664);n.plot=r(24196),e.exports=n},51352:function(e,t,r){"use strict";var n=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join("\n"),i=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),a=r(30140).maxDimensionCount,o=r(3400),s=1e-6,l=2048,A=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function g(e,t,r,n,i){var a=e._gl;a.enable(a.SCISSOR_TEST),a.scissor(t,r,n,i),e.clear({color:[0,0,0,0],depth:1})}function f(e,t,r,n,i,a){var o=a.key;r.drawCompleted||(function(e){e.read({x:0,y:0,width:1,height:1,data:A})}(e),r.drawCompleted=!0),function s(l){var A=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],g(e,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*A,a.offset=2*l*n,t(a),l*n+A>>8*t)%256/255}function p(e,t,r){for(var n=new Array(8*t),i=0,a=0;ac&&(c=e[i].dim1.canvasX,o=i);0===s&&g(x,0,0,r.canvasWidth,r.canvasHeight);var u=function(e){var t,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!e&&ns._length&&(_=_.slice(0,s._length));var k,D=s.tickvals;function T(e,t){return{val:e,text:k[t]}}function M(e,t){return e.val-t.val}if(a(D)&&D.length){i.isTypedArray(D)&&(D=Array.from(D)),k=s.ticktext,a(k)&&k.length?k.length>D.length?k=k.slice(0,D.length):D.length>k.length&&(D=D.slice(0,k.length)):k=D.map(o(s.tickformat));for(var R=1;R=r||l>=i)return;var A=e.lineLayer.readPixel(s,i-1-l),c=0!==A[3],u=c?A[2]+256*(A[1]+256*A[0]):null,g={x:s,y:l,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:u};u!==F&&(c?a.hover(g):a.unhover&&a.unhover(g),F=u)}})),_.style("opacity",(function(e){return e.pick?0:1})),f.style("background","rgba(255, 255, 255, 0)");var O=f.selectAll("."+I.cn.parcoords).data(Q,d);O.exit().remove(),O.enter().append("g").classed(I.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),O.attr("transform",(function(e){return c(e.model.translateX,e.model.translateY)}));var P=O.selectAll("."+I.cn.parcoordsControlView).data(p,d);P.enter().append("g").classed(I.cn.parcoordsControlView,!0),P.attr("transform",(function(e){return c(e.model.pad.l,e.model.pad.t)}));var G=P.selectAll("."+I.cn.yAxis).data((function(e){return e.dimensions}),d);G.enter().append("g").classed(I.cn.yAxis,!0),P.each((function(e){R(G,e,C)})),_.each((function(e){if(e.viewModel){!e.lineLayer||a?e.lineLayer=E(this,e):e.lineLayer.update(e),(e.key||0===e.key)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||a;e.lineLayer.render(e.viewModel.panels,t)}})),G.attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),G.call(n.behavior.drag().origin((function(e){return e})).on("drag",(function(e){var t=e.parent;w.linePickActive(!1),e.x=Math.max(-I.overdrag,Math.min(e.model.width+I.overdrag,n.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,G.sort((function(e,t){return e.x-t.x})).each((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio})),R(G,t,C),G.filter((function(t){return 0!==Math.abs(e.xIndex-t.xIndex)})).attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),n.select(this).attr("transform",c(e.x,0)),G.each((function(r,n,i){i===e.parent.key&&(t.dimensions[n]=r)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!S(t)),t.focusLayer.render&&t.focusLayer.render(t.panels)})).on("dragend",(function(e){var t=e.parent;e.x=e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio,R(G,t,C),n.select(this).attr("transform",(function(e){return c(e.x,0)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!S(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),w.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(t.key,t.dimensions.map((function(e){return e.crossfilterDimensionIndex})))}))),G.exit().remove();var U=G.selectAll("."+I.cn.axisOverlays).data(p,d);U.enter().append("g").classed(I.cn.axisOverlays,!0),U.selectAll("."+I.cn.axis).remove();var z=U.selectAll("."+I.cn.axis).data(p,d);z.enter().append("g").classed(I.cn.axis,!0),z.each((function(e){var t=e.model.height/e.model.tickDistance,r=e.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?i:null).tickFormat((function(t){return m.isOrdinal(e)?t:L(e.model.dimensions[e.visibleIndex],t)})).scale(r)),g.font(z.selectAll("text"),e.model.tickFont)})),z.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),z.selectAll("text").style("text-shadow",u.makeTextShadow(b)).style("cursor","default");var q=U.selectAll("."+I.cn.axisHeading).data(p,d);q.enter().append("g").classed(I.cn.axisHeading,!0);var H=q.selectAll("."+I.cn.axisTitle).data(p,d);H.enter().append("text").classed(I.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),H.text((function(e){return e.label})).each((function(t){var r=n.select(this);g.font(r,t.model.labelFont),u.convertToTspans(r,e)})).attr("transform",(function(e){var t=M(e.model.labelAngle,e.model.labelSide),r=I.axisTitleOffset;return(t.dir>0?"":c(0,2*r+e.model.height))+A(t.degrees)+c(-r*t.dx,-r*t.dy)})).attr("text-anchor",(function(e){var t=M(e.model.labelAngle,e.model.labelSide);return 2*Math.abs(t.dx)>Math.abs(t.dy)?t.dir*t.dx<0?"start":"end":"middle"}));var Y=U.selectAll("."+I.cn.axisExtent).data(p,d);Y.enter().append("g").classed(I.cn.axisExtent,!0);var J=Y.selectAll("."+I.cn.axisExtentTop).data(p,d);J.enter().append("g").classed(I.cn.axisExtentTop,!0),J.attr("transform",c(0,-I.axisExtentOffset));var K=J.selectAll("."+I.cn.axisExtentTopText).data(p,d);K.enter().append("text").classed(I.cn.axisExtentTopText,!0).call(T),K.text((function(e){return N(e,!0)})).each((function(e){g.font(n.select(this),e.model.rangeFont)}));var j=Y.selectAll("."+I.cn.axisExtentBottom).data(p,d);j.enter().append("g").classed(I.cn.axisExtentBottom,!0),j.attr("transform",(function(e){return c(0,e.model.height+I.axisExtentOffset)}));var V=j.selectAll("."+I.cn.axisExtentBottomText).data(p,d);V.enter().append("text").classed(I.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(T),V.text((function(e){return N(e,!1)})).each((function(e){g.font(n.select(this),e.model.rangeFont)})),v.ensureAxisBrush(U,b,e)}},24196:function(e,t,r){"use strict";var n=r(36336),i=r(5048),a=r(95724).isVisible,o={};function s(e,t,r){var n=t.indexOf(r),i=e.indexOf(n);return-1===i&&(i+=t.length),i}(e.exports=function(e,t){var r=e._fullLayout;if(i(e,[],o)){var l={},A={},c={},u={},g=r._size;t.forEach((function(t,r){var n=t[0].trace;c[r]=n.index;var i=u[r]=n._fullInput.index;l[r]=e.data[i].dimensions,A[r]=e.data[i].dimensions.slice()})),n(e,t,{width:g.w,height:g.h,margin:{t:g.t,r:g.r,b:g.b,l:g.l}},{filterChanged:function(t,n,i){var a=A[t][n],o=i.map((function(e){return e.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[e._fullData[c[t]]._fullInput.uid];if(void 0===l[s]){var g=a.constraintrange;l[s]=g||null}var f=e._fullData[c[t]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,f.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete f.constraintrange,o=null);var h={};h[s]=o,e.emit("plotly_restyle",[h,[u[t]]])},hover:function(t){e.emit("plotly_hover",t)},unhover:function(t){e.emit("plotly_unhover",t)},axesMoved:function(t,r){var n=function(e,t){return function(r,n){return s(e,t,r)-s(e,t,n)}}(r,A[t].filter(a));l[t].sort(n),A[t].filter((function(e){return!a(e)})).sort((function(e){return A[t].indexOf(e)})).forEach((function(e){l[t].splice(l[t].indexOf(e),1),l[t].splice(A[t].indexOf(e),0,e)})),e.emit("plotly_restyle",[{dimensions:[l[t]]},[u[t]]])}})}}).reglPrecompiled=o},74996:function(e,t,r){"use strict";var n=r(45464),i=r(86968).u,a=r(25376),o=r(22548),s=r(21776).Ks,l=r(21776).Gw,A=r(92880).extendFlat,c=r(98192).c,u=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:A({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:A({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:A({},u,{}),outsidetextfont:A({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:A({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:A({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},80036:function(e,t,r){"use strict";var n=r(7316);t.name="pie",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},45768:function(e,t,r){"use strict";var n=r(38248),i=r(49760),a=r(76308),o={};function s(e){return function(t,r){return!!t&&!!(t=i(t)).isValid()&&(t=a.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t)}}function l(e,t){var r,n=JSON.stringify(e),a=t[n];if(!a){for(a=e.slice(),r=0;r=0})),("funnelarea"===t.type?y:t.sort)&&a.sort((function(e,t){return t.v-e.v})),a[0]&&(a[0].vTotal=p),a},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,i=e.calcdata,a=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=l(a,o));for(var A=0,c=0;c0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}function c(e,t,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");l(n,"marker.pattern",a),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=r.paper_bgcolor)}e.exports={handleLabelsAndValues:A,handleMarkerDefaults:c,supplyDefaults:function(e,t,r,n){function l(r,n){return i.coerce(e,t,a,r,n)}var u=A(l("labels"),l("values")),g=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(l("label0"),l("dlabel")),g){t._length=g,c(e,t,n,l,!0),l("scalegroup");var f,h=l("text"),d=l("texttemplate");if(d||(f=l("textinfo",i.isArrayOrTypedArray(h)?"text+percent":"percent")),l("hovertext"),l("hovertemplate"),d||f&&"none"!==f){var p=l("textposition");s(e,t,n,l,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(p)||"auto"===p||"outside"===p)&&l("automargin"),("inside"===p||"auto"===p||Array.isArray(p))&&l("insidetextorientation")}else"none"===f&&l("textposition","none");o(t,n,l);var y=l("hole");if(l("title.text")){var m=l("title.position",y?"middle center":"top center");y||"middle center"!==m||(t.title.position="top center"),i.coerceFont(l,"title.font",n.font)}l("sort"),l("direction"),l("rotation"),l("pull")}else t.visible=!1}}},53644:function(e,t,r){"use strict";var n=r(10624).appendArrayMultiPointValues;e.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},21552:function(e,t,r){"use strict";var n=r(43616),i=r(76308);e.exports=function(e,t,r,a){var o=r.marker.pattern;o&&o.shape?n.pointStyle(e,r,a,t):i.fill(e,t.color)}},69656:function(e,t,r){"use strict";var n=r(3400);function i(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}t.formatPiePercent=function(e,t){var r=i((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},t.formatPieValue=function(e,t){var r=i(e.toPrecision(10));return n.numSeparate(r,t)},t.getFirstFilled=function(e,t){if(n.isArrayOrTypedArray(e))for(var r=0;r"),name:u.hovertemplate||-1!==g.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:p.castOption(E.bgcolor,e.pts)||e.color,borderColor:p.castOption(E.bordercolor,e.pts),fontFamily:p.castOption(C.family,e.pts),fontSize:p.castOption(C.size,e.pts),fontColor:p.castOption(C.color,e.pts),nameLength:p.castOption(E.namelength,e.pts),textAlign:p.castOption(E.align,e.pts),hovertemplate:p.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[y(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:B}),e.bbox=B[0],A._hasHoverLabel=!0}A._hasHoverEvent=!0,t.emit("plotly_hover",{points:[y(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,i=t._fullData[A.index],o=n.select(this).datum();A._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[y(o,i)],event:n.event}),A._hasHoverEvent=!1),A._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),A._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,i=t._fullData[A.index];t._dragging||!1===r.hovermode||(t._hoverdata=[y(e,i)],a.click(t,n.event))}))}function v(e,t,r){var n=p.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=p.castOption(e._input.textfont.color,t.pts));var i=p.castOption(e.insidetextfont.family,t.pts)||p.castOption(e.textfont.family,t.pts)||r.family,a=p.castOption(e.insidetextfont.size,t.pts)||p.castOption(e.textfont.size,t.pts)||r.size,s=p.castOption(e.insidetextfont.weight,t.pts)||p.castOption(e.textfont.weight,t.pts)||r.weight,l=p.castOption(e.insidetextfont.style,t.pts)||p.castOption(e.textfont.style,t.pts)||r.style,A=p.castOption(e.insidetextfont.variant,t.pts)||p.castOption(e.textfont.variant,t.pts)||r.variant;return{color:n||o.contrast(t.color),family:i,size:a,weight:s,style:l,variant:A}}function E(e,t){for(var r,n,i=0;it&&t>n||r=-4;p-=2)y(Math.PI*p,"tan");for(p=4;p>=-4;p-=2)y(Math.PI*(p+1),"tan")}if(u||f){for(p=4;p>=-4;p-=2)y(Math.PI*(p+1.5),"rad");for(p=4;p>=-4;p-=2)y(Math.PI*(p+.5),"rad")}}if(s||h||u){var m=Math.sqrt(e.width*e.width+e.height*e.height);if((a={scale:i*n*2/m,rCenter:1-i,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,a.scale>=1)return a;d.push(a)}(h||f)&&((a=B(e,n,o,l,A)).textPosAngle=(t.startangle+t.stopangle)/2,d.push(a)),(h||g)&&((a=b(e,n,o,l,A)).textPosAngle=(t.startangle+t.stopangle)/2,d.push(a));for(var I=0,v=0,E=0;E=1)break}return d[I]}function B(e,t,r,n,i){t=Math.max(0,t-2*d);var a=e.width/e.height,o=Q(a,n,t,r);return{scale:2*o/e.height,rCenter:x(a,o/t),rotate:w(i)}}function b(e,t,r,n,i){t=Math.max(0,t-2*d);var a=e.height/e.width,o=Q(a,n,t,r);return{scale:2*o/e.width,rCenter:x(a,o/t),rotate:w(i+Math.PI/2)}}function x(e,t){return Math.cos(t)-e*t}function w(e){return(180/Math.PI*e+720)%180-90}function Q(e,t,r,n){var i=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(e*e+n/2)+e))}function _(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function S(e,t){var r=t.pxmid[0],n=t.pxmid[1],i=e.width/2,a=e.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function k(e,t){var r,n,i,a=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=T(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*e.r,s.ty-=e.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*e.r);var l,A,c=(l=e.r,A=e.trace.aspectratio,l/(void 0===A?1:A)),u=t.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(u+=c,o.x-=(1+i)*c,s.tx+=e.titleBox.width/2):-1!==a.title.position.indexOf("center")?u*=2:-1!==a.title.position.indexOf("right")&&(u+=c,o.x+=(1+i)*c,s.tx-=e.titleBox.width/2),r=u/e.titleBox.width,n=D(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function D(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function T(e){var t,r=e.pull;if(!r)return 0;if(l.isArrayOrTypedArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function M(e,t){for(var r=[],n=0;n1?c=(A=r.r)/i.aspectratio:A=(c=r.r)*i.aspectratio,l=(A*=(1+i.baseratio)/2)*c}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var I=l.castOption(i,t.i,"texttemplate");if(I){var v=function(e){return{label:e.label,value:e.v,valueLabel:p.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:p.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:l.castOption(i,e.i,"customdata")}}(t),E=p.getFirstFilled(i.text,t.pts);(m(E)||""===E)&&(v.text=E),t.text=l.texttemplateString(I,v,e._fullLayout._d3locale,v,i._meta||{})}else t.text=""}}function N(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*n-o*i,e.textY=a*i+o*n,e.noCenter=!0}e.exports={plot:function(e,t){var r=e._context.staticPlot,a=e._fullLayout,g=a._size;h("pie",a),E(t,e),M(t,g);var d=l.makeTraceGroups(a._pielayer,t,"trace").each((function(t){var h=n.select(this),d=t[0],y=d.trace;!function(e){var t,r,n,i=e[0],a=i.r,o=i.trace,s=p.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,A="px0",c="px1";if("counterclockwise"===o.direction){for(t=0;ti.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=_(r,i))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var m=n.select(this).selectAll("g.slice").data(t);m.enter().append("g").classed("slice",!0),m.exit().remove();var E=[[[],[]],[[],[]]],B=!1;m.each((function(i,o){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=y.index,E[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var A=d.cx,c=d.cy,g=n.select(this),h=g.selectAll("path.surface").data([i]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),g.call(I,e,t),y.pull){var m=+p.castOption(y.pull,i.pts)||0;m>0&&(A+=m*i.pxmid[0],c+=m*i.pxmid[1])}i.cxFinal=A,i.cyFinal=c;var b=y.hole;if(i.v===d.vTotal){var x="M"+(A+i.px0[0])+","+(c+i.px0[1])+D(i.px0,i.pxmid,!0,1)+D(i.pxmid,i.px0,!0,1)+"Z";b?h.attr("d","M"+(A+b*i.px0[0])+","+(c+b*i.px0[1])+D(i.px0,i.pxmid,!1,b)+D(i.pxmid,i.px0,!1,b)+"Z"+x):h.attr("d",x)}else{var w=D(i.px0,i.px1,!0,1);if(b){var Q=1-b;h.attr("d","M"+(A+b*i.px1[0])+","+(c+b*i.px1[1])+D(i.px1,i.px0,!1,b)+"l"+Q*i.px0[0]+","+Q*i.px0[1]+w+"Z")}else h.attr("d","M"+A+","+c+"l"+i.px0[0]+","+i.px0[1]+w+"Z")}L(e,i,d);var _=p.castOption(y.textposition,i.pts),k=g.selectAll("g.slicetext").data(i.text&&"none"!==_?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var r=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),g=l.ensureUniformFontSize(e,"outside"===_?function(e,t,r){var n=p.castOption(e.outsidetextfont.color,t.pts)||p.castOption(e.textfont.color,t.pts)||r.color,i=p.castOption(e.outsidetextfont.family,t.pts)||p.castOption(e.textfont.family,t.pts)||r.family,a=p.castOption(e.outsidetextfont.size,t.pts)||p.castOption(e.textfont.size,t.pts)||r.size,o=p.castOption(e.outsidetextfont.weight,t.pts)||p.castOption(e.textfont.weight,t.pts)||r.weight,s=p.castOption(e.outsidetextfont.style,t.pts)||p.castOption(e.textfont.style,t.pts)||r.style,l=p.castOption(e.outsidetextfont.variant,t.pts)||p.castOption(e.textfont.variant,t.pts)||r.variant;return{color:n,family:i,size:a,weight:o,style:s,variant:l}}(y,i,a.font):v(y,i,a.font));r.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,g).call(u.convertToTspans,e);var h,m=s.bBox(r.node());if("outside"===_)h=S(m,i);else if(h=C(m,i,d),"auto"===_&&h.scale<1){var I=l.ensureUniformFontSize(e,y.outsidetextfont);r.call(s.font,I),h=S(m=s.bBox(r.node()),i)}var E=h.textPosAngle,b=void 0===E?i.pxmid:R(d.r,E);if(h.targetX=A+b[0]*h.rCenter+(h.x||0),h.targetY=c+b[1]*h.rCenter+(h.y||0),N(h,m),h.outside){var x=h.targetY;i.yLabelMin=x-m.height/2,i.yLabelMid=x,i.yLabelMax=x+m.height/2,i.labelExtraX=0,i.labelExtraY=0,B=!0}h.fontSize=g.size,f(y.type,h,a),t[o].transform=h,l.setTransormAndDisplay(r,h)}))}function D(e,t,r,n){var a=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*d.r+","+n*d.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var b=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(b.enter().append("g").classed("titletext",!0),b.exit().remove(),b.each((function(){var t,r=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=l.templateString(i,y._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,y.title.font).call(u.convertToTspans,e),t="middle center"===y.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):k(d,g),r.attr("transform",c(t.x,t.y)+A(Math.min(1,t.scale))+c(t.tx,t.ty))})),B&&function(e,t){var r,n,i,a,o,s,A,c,u,g,f,h,d;function y(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function I(e,r){r||(r={});var i,c,u,f,h=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?e.yLabelMin:e.yLabelMax,y=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),I=h-d;if(I*A>0&&(e.labelExtraY=I),l.isArrayOrTypedArray(t.pull))for(c=0;c=(p.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*A>0?(I=u.cyFinal+o(u.px0[1],u.px1[1])-d-e.labelExtraY)*A>0&&(e.labelExtraY+=I):(y+e.labelExtraY-m)*A>0&&(i=3*s*Math.abs(c-g.indexOf(e)),(f=u.cxFinal+a(u.px0[0],u.px1[0])+i-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*s>0&&(e.labelExtraX+=f)))}for(n=0;n<2;n++)for(i=n?y:m,o=n?Math.max:Math.min,A=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=e[n][r]).sort(i),u=e[1-n][r],g=u.concat(c),h=[],f=0;fMath.abs(u)?s+="l"+u*e.pxmid[0]/e.pxmid[1]+","+u+"H"+(a+e.labelExtraX+A):s+="l"+e.labelExtraX+","+c+"v"+(u-c)+"h"+A}else s+="V"+(e.yLabelMid+e.labelExtraY)+"h"+A;l.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(m,y),B&&y.automargin){var x=s.bBox(h.node()),w=y.domain,Q=g.w*(w.x[1]-w.x[0]),_=g.h*(w.y[1]-w.y[0]),D=(.5*Q-d.r)/g.w,T=(.5*_-d.r)/g.h;i.autoMargin(e,"pie."+y.uid+".automargin",{xl:w.x[0]-D,xr:w.x[1]+D,yb:w.y[0]-T,yt:w.y[1]+T,l:Math.max(d.cx-d.r-x.left,0),r:Math.max(x.right-(d.cx+d.r),0),b:Math.max(x.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-x.top,0),pad:5})}}))}));setTimeout((function(){d.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:L,transformInsideText:C,determineInsideTextFont:v,positionTitleOutside:k,prerenderTitles:E,layoutAreas:M,attachFxHandlers:I,computeTransform:N}},22152:function(e,t,r){"use strict";var n=r(33428),i=r(10528),a=r(82744).resizeText;e.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");a(e,t,"pie"),t.each((function(t){var r=t[0].trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each((function(t){n.select(this).call(i,t,r,e)}))}))}},10528:function(e,t,r){"use strict";var n=r(76308),i=r(69656).castOption,a=r(21552);e.exports=function(e,t,r,o){var s=r.marker.line,l=i(s.color,t.pts)||n.defaultLine,A=i(s.width,t.pts)||0;e.call(a,t,r,o).style("stroke-width",A).call(n.stroke,l)}},35484:function(e,t,r){"use strict";var n=r(52904);e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},11072:function(e,t,r){"use strict";var n=r(67792).gl_pointcloud2d,i=r(3400).isArrayOrTypedArray,a=r(43080),o=r(19280).findExtremes,s=r(44928);function l(e,t){this.scene=e,this.uid=t,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(e.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var A=l.prototype;A.handlePick=function(e){var t=this.idToIndex[e.pointId];return{trace:this,dataCoord:e.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*t],this.pickXYData[2*t+1]]:[this.pickXData[t],this.pickYData[t]],textLabel:i(this.textLabels)?this.textLabels[t]:this.textLabels,color:this.color,name:this.name,pointIndex:t,hoverinfo:this.hoverinfo}},A.update=function(e){this.index=e.index,this.textLabels=e.text,this.name=e.name,this.hoverinfo=e.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(e),this.color=s(e,{})},A.updateFast=function(e){var t,r,n,i,s,l,A=this.xData=this.pickXData=e.x,c=this.yData=this.pickYData=e.y,u=this.pickXYData=e.xy,g=e.xbounds&&e.ybounds,f=e.indices,h=this.bounds;if(u){if(n=u,t=u.length>>>1,g)h[0]=e.xbounds[0],h[2]=e.xbounds[1],h[1]=e.ybounds[0],h[3]=e.ybounds[1];else for(l=0;lh[2]&&(h[2]=i),sh[3]&&(h[3]=s);if(f)r=f;else for(r=new Int32Array(t),l=0;lh[2]&&(h[2]=i),sh[3]&&(h[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var d=a(e.marker.color),p=a(e.marker.border.color),y=e.opacity*e.marker.opacity;d[3]*=y,this.pointcloudOptions.color=d;var m=e.marker.blend;null===m&&(m=A.length<100||c.length<100),this.pointcloudOptions.blend=m,p[3]*=y,this.pointcloudOptions.borderColor=p;var I=e.marker.sizemin,v=Math.max(e.marker.sizemax,e.marker.sizemin);this.pointcloudOptions.sizeMin=I,this.pointcloudOptions.sizeMax=v,this.pointcloudOptions.areaRatio=e.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var E=this.scene.xaxis,C=this.scene.yaxis,B=v/2||.5;e._extremes[E._id]=o(E,[h[0],h[2]],{ppad:B}),e._extremes[C._id]=o(C,[h[1],h[3]],{ppad:B})},A.dispose=function(){this.pointcloud.dispose()},e.exports=function(e,t){var r=new l(e,t.uid);return r.update(t),r}},41904:function(e,t,r){"use strict";var n=r(3400),i=r(35484);e.exports=function(e,t,r){function a(r,a){return n.coerce(e,t,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),e.xy&&e.xy instanceof Float32Array&&(t.xy=e.xy),e.indices&&e.indices instanceof Int32Array&&(t.indices=e.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),t._length=null}},156:function(e,t,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" "),e.exports={attributes:r(35484),supplyDefaults:r(41904),calc:r(41484),plot:r(11072),moduleType:"trace",name:"pointcloud",basePlotModule:r(39952),categories:["gl","gl2d","showLegend"],meta:{}}},41440:function(e,t,r){"use strict";var n=r(25376),i=r(45464),a=r(22548),o=r(55756),s=r(86968).u,l=r(21776).Ks,A=r(49084),c=r(31780).templatedArray,u=r(29736).descriptionOnlyNumbers,g=r(92880).extendFlat,f=r(67824).overrideAll;(e.exports=f({hoverinfo:g({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:u("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:c("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:g(A().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},10760:function(e,t,r){"use strict";var n=r(67824).overrideAll,i=r(84888)._M,a=r(59596),o=r(65460),s=r(93972),l=r(86476),A=r(22676).prepSelect,c=r(3400),u=r(24040),g="sankey";function f(e,t){var r=e._fullData[t],n=e._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if(o&&"pan"!==i&&"zoom"!==i){s(o,a);var g={_id:"x",c2p:c.identity,_offset:r._sankey.translateX,_length:r._sankey.width},f={_id:"y",c2p:c.identity,_offset:r._sankey.translateY,_length:r._sankey.height},h={gd:e,element:o.node(),plotinfo:{id:t,xaxis:g,yaxis:f,fillRangeItems:c.noop},subplot:t,xaxes:[g],yaxes:[f],doneFnCompleted:function(r){var n,i=e._fullData[t],a=i.node.groups.slice(),o=[];function s(e){for(var t=i._sankey.graph.nodes,r=0;rI&&(I=a.source[t]),a.target[t]>I&&(I=a.target[t]);var v,E=I+1;e.node._count=E;var C=e.node.groups,B={};for(t=0;t0&&s(S,E)&&s(k,E)&&(!B.hasOwnProperty(S)||!B.hasOwnProperty(k)||B[S]!==B[k])){B.hasOwnProperty(k)&&(k=B[k]),B.hasOwnProperty(S)&&(S=B[S]),k=+k,f[S=+S]=f[k]=!0;var D="";a.label&&a.label[t]&&(D=a.label[t]);var T=null;D&&h.hasOwnProperty(D)&&(T=h[D]),A.push({pointNumber:t,label:D,color:c?a.color[t]:a.color,hovercolor:u?a.hovercolor[t]:a.hovercolor,customdata:g?a.customdata[t]:a.customdata,concentrationscale:T,source:S,target:k,value:+_}),Q.source.push(S),Q.target.push(k)}}var M=E+C.length,R=o(r.color),L=o(r.customdata),N=[];for(t=0;tE-1,childrenNodes:[],pointNumber:t,label:F,color:R?r.color[t]:r.color,customdata:L?r.customdata[t]:r.customdata})}var O=!1;return function(e,t,r){for(var a=i.init2dArray(e,0),o=0;o1}))}(M,Q.source,Q.target)&&(O=!0),{circular:O,links:A,nodes:N,groups:C,groupLookup:B}}e.exports=function(e,t){var r=A(t);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},11820:function(e){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},47140:function(e,t,r){"use strict";var n=r(3400),i=r(41440),a=r(76308),o=r(49760),s=r(86968).Q,l=r(16132),A=r(31780),c=r(51272);function u(e,t){function r(r,a){return n.coerce(e,t,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(e,t,r,g){function f(r,a){return n.coerce(e,t,i,r,a)}var h=n.extendDeep(g.hoverlabel,e.hoverlabel),d=e.node,p=A.newContainer(t,"node");function y(e,t){return n.coerce(d,p,i.node,e,t)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",e.hoverinfo),l(d,p,y,h),y("hovertemplate"),y("align");var m=g.colorway;y("color",p.label.map((function(e,t){return a.addOpacity(function(e){return m[e%m.length]}(t),.8)}))),y("customdata");var I=e.link||{},v=A.newContainer(t,"link");function E(e,t){return n.coerce(I,v,i.link,e,t)}E("label"),E("arrowlen"),E("source"),E("target"),E("value"),E("line.color"),E("line.width"),E("hoverinfo",e.hoverinfo),l(I,v,E,h),E("hovertemplate");var C,B=o(g.paper_bgcolor).getLuminance()<.333,b=E("color",B?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function x(e){var t=o(e);if(!t.isValid())return e;var r=t.getAlpha();return r<=.8?t.setAlpha(r+.2):t=B?t.brighten():t.darken(),t.toRgbString()}E("hovercolor",Array.isArray(b)?b.map(x):x(b)),E("customdata"),c(I,v,{name:"colorscales",handleItemDefaults:u}),s(t,g,f),f("orientation"),f("valueformat"),f("valuesuffix"),p.x.length&&p.y.length&&(C="freeform"),f("arrangement",C),n.coerceFont(f,"textfont",n.extendFlat({},g.font)),t._length=null}},45499:function(e,t,r){"use strict";e.exports={attributes:r(41440),supplyDefaults:r(47140),calc:r(48068),plot:r(59596),moduleType:"trace",name:"sankey",basePlotModule:r(10760),selectPoints:r(81128),categories:["noOpacity"],meta:{}}},59596:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=i.numberFormat,o=r(83248),s=r(93024),l=r(76308),A=r(11820).cn,c=i._;function u(e){return""!==e}function g(e,t){return e.filter((function(e){return e.key===t.traceId}))}function f(e,t){n.select(e).select("path").style("fill-opacity",t),n.select(e).select("rect").style("fill-opacity",t)}function h(e){n.select(e).select("text.name").style("fill","black")}function d(e){return function(t){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function p(e){return function(t){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function y(e,t,r){t&&r&&g(r,t).selectAll("."+A.sankeyLink).filter(d(t)).call(I.bind(0,t,r,!1))}function m(e,t,r){t&&r&&g(r,t).selectAll("."+A.sankeyLink).filter(d(t)).call(v.bind(0,t,r,!1))}function I(e,t,r,n){n.style("fill",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha})),n.each((function(r){var n=r.link.label;""!==n&&g(t,e).selectAll("."+A.sankeyLink).filter((function(e){return e.link.label===n})).style("fill",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha}))})),r&&g(t,e).selectAll("."+A.sankeyNode).filter(p(e)).call(y)}function v(e,t,r,n){n.style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),n.each((function(r){var n=r.link.label;""!==n&&g(t,e).selectAll("."+A.sankeyLink).filter((function(e){return e.link.label===n})).style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha}))})),r&&g(t,e).selectAll(A.sankeyNode).filter(p(e)).call(m)}function E(e,t){var r=e.hoverlabel||{},n=i.nestedProperty(r,t).get();return!Array.isArray(n)&&n}e.exports=function(e,t){for(var r=e._fullLayout,i=r._paper,g=r._size,d=0;d"),color:E(o,"bgcolor")||l.addOpacity(d.color,1),borderColor:E(o,"bordercolor"),fontFamily:E(o,"font.family"),fontSize:E(o,"font.size"),fontColor:E(o,"font.color"),fontWeight:E(o,"font.weight"),fontStyle:E(o,"font.style"),fontVariant:E(o,"font.variant"),nameLength:E(o,"namelength"),textAlign:E(o,"align"),idealAlign:n.event.x"),color:E(o,"bgcolor")||i.tinyColorHue,borderColor:E(o,"bordercolor"),fontFamily:E(o,"font.family"),fontSize:E(o,"font.size"),fontColor:E(o,"font.color"),fontWeight:E(o,"font.weight"),fontStyle:E(o,"font.style"),fontVariant:E(o,"font.variant"),nameLength:E(o,"namelength"),textAlign:E(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:m,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e});f(C,.85),h(C)}}},unhover:function(t,i,a){!1!==e._fullLayout.hovermode&&(n.select(t).call(m,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,e.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(t,r,i){var a=r.node;a.originalEvent=n.event,e._hoverdata=[a],n.select(t).call(m,r,i),s.click(e,{target:!0})}}})}},83248:function(e,t,r){"use strict";var n=r(49812),i=r(67756).Gz,a=r(33428),o=r(26800),s=r(48932),l=r(11820),A=r(49760),c=r(76308),u=r(43616),g=r(3400),f=g.strTranslate,h=g.strRotate,d=r(71688),p=d.keyFun,y=d.repeat,m=d.unwrap,I=r(72736),v=r(24040),E=r(84284),C=E.CAP_SHIFT,B=E.LINE_SPACING;function b(e,t,r){var n,i=m(t),a=i.trace,c=a.domain,u="h"===a.orientation,f=a.node.pad,h=a.node.thickness,d={justify:o.sankeyJustify,left:o.sankeyLeft,right:o.sankeyRight,center:o.sankeyCenter}[a.node.align],p=e.width*(c.x[1]-c.x[0]),y=e.height*(c.y[1]-c.y[0]),I=i._nodes,v=i._links,E=i.circular;(n=E?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(u?[p,y]:[y,p]).nodeWidth(h).nodePadding(f).nodeId((function(e){return e.pointNumber})).nodeAlign(d).nodes(I).links(v);var C,B,b,x=n();for(var w in n.nodePadding()=i||(r=i-t.y0)>1e-6&&(t.y0+=r,t.y1+=r),i=t.y1+f}))}(function(e){var t,r,n=e.map((function(e,t){return{x0:e.x0,index:t}})).sort((function(e,t){return e.x0-t.x0})),i=[],a=-1,o=-1/0;for(C=0;Co+h&&(a+=1,t=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=t-s.x0,s.x0+=r,s.x1+=r}return i}(I=x.nodes)),n.update(x)}return{circular:E,key:r,trace:a,guid:g.randstr(),horizontal:u,width:p,height:y,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,linkArrowLength:a.link.arrowlen,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:c.x[0]*e.width+e.margin.l,translateY:e.height-c.y[1]*e.height+e.margin.t,dragParallel:u?y:p,dragPerpendicular:u?p:y,arrangement:a.arrangement,sankey:n,graph:x,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function x(e,t,r){var n=A(t.color),i=A(t.hovercolor),a=t.source.label+"|"+t.target.label+"__"+r;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:a,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:w,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,linkArrowLength:e.linkArrowLength,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function w(){return function(e){var t=e.linkArrowLength;if(e.link.circular)return function(e,t){var r=e.width/2,n=e.circularPathData;return"top"===e.circularLinkType?"M "+(n.targetX-t)+" "+(n.targetY+r)+" L"+(n.rightInnerExtent-t)+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r-t)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-t)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r-t)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-t)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+(n.rightInnerExtent-t)+" "+(n.targetY-r)+"L"+(n.targetX-t)+" "+(n.targetY-r)+(t>0?"L"+n.targetX+" "+n.targetY:"")+"Z":"M "+(n.targetX-t)+" "+(n.targetY-r)+" L"+(n.rightInnerExtent-t)+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r-t)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-t)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r-t)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-t)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+(n.rightInnerExtent-t)+" "+(n.targetY+r)+"L"+(n.targetX-t)+" "+(n.targetY+r)+(t>0?"L"+n.targetX+" "+n.targetY:"")+"Z"}(e.link,t);var r=Math.abs((e.link.target.x0-e.link.source.x1)/2);t>r&&(t=r);var n=e.link.source.x1,a=e.link.target.x0-t,o=i(n,a),s=o(.5),l=o(.5),A=e.link.y0-e.link.width/2,c=e.link.y0+e.link.width/2,u=e.link.y1-e.link.width/2,g=e.link.y1+e.link.width/2,f="M"+n+","+A,h="C"+s+","+A+" "+l+","+u+" "+a+","+u,d="C"+l+","+g+" "+s+","+c+" "+n+","+c,p=t>0?"L"+(a+t)+","+(u+e.link.width/2):"";return f+h+(p+="L"+a+","+g)+d+"Z"}}function Q(e,t){var r=A(t.color),n=l.nodePadAcross,i=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var a=t.dx,o=Math.max(.5,t.dy),s="node_"+t.pointNumber;return t.group&&(s=g.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:s,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:1===t.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,s].join("_"),interactionState:e.interactionState,figure:e}}function _(e){e.attr("transform",(function(e){return f(e.node.x0.toFixed(3),e.node.y0.toFixed(3))}))}function S(e){e.call(_)}function k(e,t){e.call(S),t.attr("d",w())}function D(e){e.attr("width",(function(e){return e.node.x1-e.node.x0})).attr("height",(function(e){return e.visibleHeight}))}function T(e){return e.link.width>1||e.linkLineWidth>0}function M(e){return f(e.translateX,e.translateY)+(e.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function R(e,t,r){e.on(".basic",null).on("mouseover.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.hover(this,e,t),e.interactionState.hovered=[this,e])})).on("mousemove.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.follow(this,e),e.interactionState.hovered=[this,e])})).on("mouseout.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.unhover(this,e,t),e.interactionState.hovered=!1)})).on("click.basic",(function(e){e.interactionState.hovered&&(r.unhover(this,e,t),e.interactionState.hovered=!1),e.interactionState.dragInProgress||e.partOfGroup||r.select(this,e,t)}))}function L(e,t,r,i){var o=a.behavior.drag().origin((function(e){return{x:e.node.x0+e.visibleWidth/2,y:e.node.y0+e.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(g.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(e){i._fullLayout._dragCover=e})),g.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(e,t,r,i){!function(e){for(var t=0;t0&&n.forceLayouts[t].alpha(0)}}(0,t,a,r)).stop()}(0,o,a),function(e,t,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,N(r,i)}}))}(e,t,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),k(e.filter(O(r)),t))}})).on("dragend",(function(e){if("fixed"!==e.arrangement){e.interactionState.dragInProgress=!1;for(var t=0;tl&&k[y].gap;)y--;for(I=k[y].s,d=k.length-1;d>y;d--)k[d].s=I;for(;lQ[u]&&u=0;u--){var g=e[u];if("scatter"===g.type&&g.xaxis===A.xaxis&&g.yaxis===A.yaxis){g.opacity=void 0;break}}}}}},18800:function(e,t,r){"use strict";var n=r(3400),i=r(24040),a=r(52904),o=r(88200),s=r(43028),l=r(43980),A=r(31147),c=r(43912),u=r(74428),g=r(66828),f=r(11731),h=r(124),d=r(70840),p=r(3400).coercePattern;e.exports=function(e,t,r,y){function m(r,i){return n.coerce(e,t,a,r,i)}var I=l(e,t,y,m);if(I||(t.visible=!1),t.visible){A(e,t,y,m),m("xhoverformat"),m("yhoverformat"),m("zorder");var v=c(e,t,y,m);"group"===y.scattermode&&void 0===t.orientation&&m("orientation","v");var E=!v&&I=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(g.c2p(e.x)-h);return a=Math.min(t,r)&&d<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(f.c2p(e.y)-d);return ar!==(A=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],A-l&&(a=o+(s-o)*(r-l)/(A-l),u=Math.min(u,a),h=Math.max(h,a)));return{x0:u=Math.max(u,0),x1:h=Math.min(h,g._length),y0:r,y1:r}}(u._polygons);null===T&&(T={x0:p[0],x1:p[0],y0:p[1],y1:p[1]});var M=s.defaultLine;return s.opacity(u.fillcolor)?M=u.fillcolor:s.opacity((u.line||{}).color)&&(M=u.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:T.x0,x1:T.x1,y0:T.y0,y1:T.y1,color:M,hovertemplate:!1}),delete e.index,u.text&&!n.isArrayOrTypedArray(u.text)?e.text=String(u.text):e.text=u.name,[e]}}},65875:function(e,t,r){"use strict";var n=r(43028);e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:r(52904),layoutAttributes:r(55308),supplyDefaults:r(18800),crossTraceDefaults:r(35036),supplyLayoutDefaults:r(59748),calc:r(16356).calc,crossTraceCalc:r(96664),arraysToCalcdata:r(20148),plot:r(96504),colorbar:r(5528),formatLabels:r(76688),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(98723),selectPoints:r(91560),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:r(57952),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},55308:function(e){"use strict";e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}},59748:function(e,t,r){"use strict";var n=r(3400),i=r(55308);e.exports=function(e,t){var r,a,o="group"===t.barmode;"group"===t.scattermode&&(r="scattergap",a=o?t.bargap:.2,n.coerce(e,t,i,r,a))}},66828:function(e,t,r){"use strict";var n=r(3400).isArrayOrTypedArray,i=r(94288).hasColorscale,a=r(27260);e.exports=function(e,t,r,o,s,l){l||(l={});var A=(e.marker||{}).color;A&&A._inputArray&&(A=A._inputArray),s("line.color",r),i(e,"line")?a(e,t,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(A)&&A||r),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},52340:function(e,t,r){"use strict";var n=r(43616),i=r(39032),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,A=r(3400),c=A.segmentsIntersect,u=A.constrain,g=r(88200);e.exports=function(e,t){var r,i,o,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q,_=t.trace||{},S=t.xaxis,k=t.yaxis,D="log"===S.type,T="log"===k.type,M=S._length,R=k._length,L=t.backoff,N=_.marker,F=t.connectGaps,O=t.baseTolerance,P=t.shape,G="linear"===P,U=_.fill&&"none"!==_.fill,z=[],q=g.minTolerance,H=e.length,Y=new Array(H),J=0;function K(r){var n=e[r];if(!n)return!1;var i=t.linearized?S.l2p(n.x):S.c2p(n.x),o=t.linearized?k.l2p(n.y):k.c2p(n.y);if(i===a){if(D&&(i=S.c2p(n.x,!0)),i===a)return!1;T&&o===a&&(i*=Math.abs(S._m*R*(S._m>0?s:l)/(k._m*M*(k._m>0?s:l)))),i*=1e3}if(o===a){if(T&&(o=k.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function j(e,t,r,n){var i=r-e,a=n-t,o=.5-e,s=.5-t,l=i*i+a*a,A=i*o+a*s;if(A>0&&Aoe||e[1]le)return[u(e[0],ae,oe),u(e[1],se,le)]}function ue(e,t){return e[0]===t[0]&&(e[0]===ae||e[0]===oe)||e[1]===t[1]&&(e[1]===se||e[1]===le)||void 0}function ge(e,t,r){return function(n,i){var a=ce(n),o=ce(i),s=[];if(a&&o&&ue(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*A.constrain((n[e]+i[e])/2,t,r)-((a||n)[e]+(o||i)[e]);return l&&((a&&o?l>0===a[e]>o[e]?a:o:a||o)[e]+=l),s}}function fe(e){var t=e[0],r=e[1],n=t===Y[J-1][0],i=r===Y[J-1][1];if(!n||!i)if(J>1){var a=t===Y[J-2][0],o=r===Y[J-2][1];n&&(t===ae||t===oe)&&a?o?J--:Y[J-1]=e:i&&(r===se||r===le)&&o?a?J--:Y[J-1]=e:Y[J++]=e}else Y[J++]=e}function he(e){Y[J-1][0]!==e[0]&&Y[J-1][1]!==e[1]&&fe([$,ee]),fe(e),te=null,$=ee=0}"linear"===P||"spline"===P?ne=function(e,t){for(var r=[],n=0,i=0;i<4;i++){var a=Ae[i],o=c(e[0],e[1],t[0],t[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&W(o,e)oe?oe:0,X=t[1]le?le:0,Z||X){if(J)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),Y[J++]=n[1])}else re=ne(Y[J-1],t)[0],Y[J++]=re;else Y[J++]=[Z||t[0],X||t[1]];var i=Y[J-1];Z&&X&&(i[0]!==Z||i[1]!==X)?(te&&($!==Z&&ee!==X?fe($&&ee?function(e,t){var r=t[0]-e[0],n=(t[1]-e[1])/r;return(e[1]*t[0]-t[1]*e[0])/r>0?[n>0?ae:oe,le]:[n>0?oe:ae,se]}(te,t):[$||Z,ee||X]):$&&ee&&fe([$,ee])),fe([Z,X])):$-Z&&ee-X&&fe([Z||$,X||ee]),te=t,$=Z,ee=X}else te&&he(ne(te,t)[0]),Y[J++]=t}for(r=0;rV(d,ye))break;o=d,(C=m[0]*y[0]+m[1]*y[1])>v?(v=C,f=d,p=!1):C=e.length||!d)break;pe(d),i=d}}else pe(f)}te&&fe([$||te[0],ee||te[1]]),z.push(Y.slice(0,J))}var me=P.slice(P.length-1);if(L&&"h"!==me&&"v"!==me){for(var Ie=!1,ve=-1,Ee=[],Ce=0;Ce=0?l=f:(l=f=g,g++),l0?Math.max(r,a):0}}},5528:function(e){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},74428:function(e,t,r){"use strict";var n=r(76308),i=r(94288).hasColorscale,a=r(27260),o=r(43028);e.exports=function(e,t,r,s,l,A){var c=o.isBubble(e),u=(e.line||{}).color;A=A||{},u&&(r=u),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),A.noAngle||(l("marker.angle"),A.noAngleRef||l("marker.angleref"),A.noStandOff||l("marker.standoff")),l("marker.color",r),i(e,"marker")&&a(e,t,s,l,{prefix:"marker.",cLetter:"c"}),A.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),A.noLine||(l("marker.line.color",u&&!Array.isArray(u)&&t.marker.color!==u?u:c?n.background:n.defaultLine),i(e,"marker.line")&&a(e,t,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),A.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}},31147:function(e,t,r){"use strict";var n=r(3400).dateTick0,i=r(39032).ONEWEEK;function a(e,t){return n(t,e%i===0?1:0)}e.exports=function(e,t,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,t.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,t.ycalendar)),n("yperiodalignment"))}}},96504:function(e,t,r){"use strict";var n=r(33428),i=r(24040),a=r(3400),o=a.ensureSingle,s=a.identity,l=r(43616),A=r(43028),c=r(52340),u=r(14328),g=r(92065).tester;function f(e,t,r,u,f,h,d){var p,y=e._context.staticPlot;!function(e,t,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),u=n.extent(a.simpleMap(l.range,l.r2c)),g=i[0].trace;if(A.hasMarkers(g)){var f=g.marker.maxdisplayed;if(0!==f){var h=i.filter((function(e){return e.x>=c[0]&&e.x<=c[1]&&e.y>=u[0]&&e.y<=u[1]})),d=Math.ceil(h.length/f),p=0;o.forEach((function(e,r){var n=e[0].trace;A.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function I(e){return m?e.transition():e}var v=r.xaxis,E=r.yaxis,C=u[0].trace,B=C.line,b=n.select(h),x=o(b,"g","errorbars"),w=o(b,"g","lines"),Q=o(b,"g","points"),_=o(b,"g","text");if(i.getComponentMethod("errorbars","plot")(e,x,r,d),!0===C.visible){var S,k;I(b).style("opacity",C.opacity);var D,T,M=C.fill.charAt(C.fill.length-1);"x"!==M&&"y"!==M&&(M=""),"y"===M?(D=1,T=E.c2p(0,!0)):"x"===M&&(D=0,T=v.c2p(0,!0)),u[0][r.isRangePlot?"nodeRangePlot3":"node3"]=b;var R,L,N="",F=[],O=C._prevtrace,P=null,G=null;O&&(N=O._prevRevpath||"",k=O._nextFill,F=O._ownPolygons,P=O._fillsegments,G=O._fillElement);var U,z,q,H,Y,J,K="",j="",V=[];C._polygons=[];var W=[],Z=[],X=a.noop;if(S=C._ownFill,A.hasLines(C)||"none"!==C.fill){k&&k.datum(u),-1!==["hv","vh","hvh","vhv"].indexOf(B.shape)?(U=l.steps(B.shape),z=l.steps(B.shape.split("").reverse().join(""))):U=z="spline"===B.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?l.smoothclosed(e.slice(1),B.smoothing):l.smoothopen(e,B.smoothing)}:function(e){return"M"+e.join("L")},q=function(e){return z(e.reverse())},Z=c(u,{xaxis:v,yaxis:E,trace:C,connectGaps:C.connectgaps,baseTolerance:Math.max(B.width||1,3)/4,shape:B.shape,backoff:B.backoff,simplify:B.simplify,fill:C.fill}),W=new Array(Z.length);var $=0;for(p=0;p0,p=u(e,t,r);(c=i.selectAll("g.trace").data(p,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(e,t,r){t.each((function(t){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,e);var a=t[0].trace,A=[];a._ownfill&&A.push("_ownFill"),a._nexttrace&&A.push("_nextFill");var c=i.selectAll("g").data(A,s);c.enter().append("g"),c.exit().each((function(e){a[e]=null})).remove(),c.order().each((function(e){a[e]=o(n.select(this),"path","js-fill")}))}))}(e,c,t),d?(A&&(g=A()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){g&&g()})).each("interrupt",(function(){g&&g()})).each((function(){i.selectAll("g.trace").each((function(r,n){f(e,n,t,r,p,this,a)}))}))):c.each((function(r,n){f(e,n,t,r,p,this,a)})),h&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},91560:function(e,t,r){"use strict";var n=r(43028);e.exports=function(e,t){var r,i,a,o,s=e.cd,l=e.xaxis,A=e.yaxis,c=[],u=s[0].trace;if(!n.hasMarkers(u)&&!n.hasText(u))return[];if(!1===t)for(r=0;r0){var g=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=g),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,g)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(e,t,r){var n=[i(e.x,e.error_x,t[0],r.xaxis),i(e.y,e.error_y,t[1],r.yaxis),i(e.z,e.error_z,t[2],r.zaxis)],a=function(e){for(var t=0;t-1?-1:e.indexOf("right")>-1?1:0}function v(e){return null===e||void 0===e?0:e.indexOf("top")>-1?-1:e.indexOf("bottom")>-1?1:0}function E(e,t){return t(4*e)}function C(e){return f[e]}function B(e,t,r,n,i){var a=null;if(l.isArrayOrTypedArray(e)){a=[];for(var o=0;o=0){var d=function(e,t,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&u("surfacecolor",f||h);for(var d=["x","y","z"],p=0;p<3;++p){var y="projection."+d[p];u(y+".show")&&(u(y+".opacity"),u(y+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(e,t,f||h||r,{axis:"z"}),m(e,t,f||h||r,{axis:"y",inherit:"z"}),m(e,t,f||h||r,{axis:"x",inherit:"z"})}else t.visible=!1}},3296:function(e,t,r){"use strict";e.exports={plot:r(41064),attributes:r(91592),markerSymbols:r(87792),supplyDefaults:r(83484),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:r(41484),moduleType:"trace",name:"scatter3d",basePlotModule:r(12536),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},90372:function(e,t,r){"use strict";var n=r(98304),i=r(52904),a=r(45464),o=r(21776).Ks,s=r(21776).Gw,l=r(49084),A=r(92880).extendFlat,c=i.marker,u=i.line,g=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:A({},i.mode,{dflt:"markers"}),text:A({},i.text,{}),texttemplate:s({editType:"plot"},{keys:["a","b","text"]}),hovertext:A({},i.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:A({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:i.connectgaps,fill:A({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n(),marker:A({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:A({width:g.width,editType:"calc"},l("marker.line")),gradient:c.gradient,editType:"calc"},l("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:A({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:i.hoveron,hovertemplate:o(),zorder:i.zorder}},48228:function(e,t,r){"use strict";var n=r(38248),i=r(90136),a=r(20148),o=r(4500),s=r(16356).calcMarkerSize,l=r(50948);e.exports=function(e,t){var r=t._carpetTrace=l(e,t);if(r&&r.visible&&"legendonly"!==r.visible){var A;t.xaxis=r.xaxis,t.yaxis=r.yaxis;var c,u,g=t._length,f=new Array(g),h=!1;for(A=0;A")}return o}function m(e,t){var r;r=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,""):e._hovertitle,p.push(r+": "+t.toFixed(3)+e.labelsuffix)}}},4184:function(e,t,r){"use strict";e.exports={attributes:r(90372),supplyDefaults:r(6176),colorbar:r(5528),formatLabels:r(52364),calc:r(48228),plot:r(20036),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(58960),selectPoints:r(91560),eventData:r(89307),moduleType:"trace",name:"scattercarpet",basePlotModule:r(57952),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},20036:function(e,t,r){"use strict";var n=r(96504),i=r(54460),a=r(43616);e.exports=function(e,t,r,o){var s,l,A,c=r[0][0].carpet,u=i.getFromId(e,c.xaxis||"x"),g=i.getFromId(e,c.yaxis||"y"),f={xaxis:u,yaxis:g,plot:t.plot};for(s=0;s")}function f(e){return e+"\xb0"}}(A,d,e,l[0].t.labels),e.hovertemplate=A.hovertemplate,[e]}}},36952:function(e,t,r){"use strict";e.exports={attributes:r(6096),supplyDefaults:r(86188),colorbar:r(5528),formatLabels:r(56696),calc:r(25212),calcGeoJSON:r(48691).calcGeoJSON,plot:r(48691).plot,style:r(25064),styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(64292),eventData:r(58544),selectPoints:r(8796),moduleType:"trace",name:"scattergeo",basePlotModule:r(10816),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},48691:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(59972).getTopojsonFeatures,o=r(44808),s=r(27144),l=r(19280).findExtremes,A=r(39032).BADNUM,c=r(16356).calcMarkerSize,u=r(43028),g=r(25064);e.exports={calcGeoJSON:function(e,t){var r,n,o=e[0].trace,u=t[o.geo],g=u._subplot,f=o._length;if(i.isArrayOrTypedArray(o.locations)){var h=o.locationmode,d="geojson-id"===h?s.extractTraceFeature(e):a(o,g.topojson);for(r=0;r=p,C=2*v,B={},b=l.makeCalcdata(t,"x"),x=m.makeCalcdata(t,"y"),w=s(t,l,"x",b),Q=s(t,m,"y",x),_=w.vals,S=Q.vals;t._x=_,t._y=S,t.xperiodalignment&&(t._origX=b,t._xStarts=w.starts,t._xEnds=w.ends),t.yperiodalignment&&(t._origY=x,t._yStarts=Q.starts,t._yEnds=Q.ends);var k=new Array(C),D=new Array(v);for(r=0;r1&&i.extendFlat(s.line,f.linePositions(e,r,n)),s.errorX||s.errorY){var l=f.errorBarPositions(e,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}return s.text&&(i.extendFlat(s.text,{positions:n},f.textPosition(e,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},f.textPosition(e,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},f.textPosition(e,r,s.text,s.markerUnsel))),s}(e,0,t,k,_,S),R=h(e,I);return u(o,t),E?M.marker&&(T=M.marker.sizeAvg||Math.max(M.marker.size,3)):T=A(t,v),c(e,t,l,m,_,S,T),M.errorX&&y(t,l,M.errorX),M.errorY&&y(t,m,M.errorY),M.fill&&!R.fill2d&&(R.fill2d=!0),M.marker&&!R.scatter2d&&(R.scatter2d=!0),M.line&&!R.line2d&&(R.line2d=!0),!M.errorX&&!M.errorY||R.error2d||(R.error2d=!0),M.text&&!R.glText&&(R.glText=!0),M.marker&&(M.marker.snap=v),R.lineOptions.push(M.line),R.errorXOptions.push(M.errorX),R.errorYOptions.push(M.errorY),R.fillOptions.push(M.fill),R.markerOptions.push(M.marker),R.markerSelectedOptions.push(M.markerSel),R.markerUnselectedOptions.push(M.markerUnsel),R.textOptions.push(M.text),R.textSelectedOptions.push(M.textSel),R.textUnselectedOptions.push(M.textUnsel),R.selectBatch.push([]),R.unselectBatch.push([]),B._scene=R,B.index=R.count,B.x=_,B.y=S,B.positions=k,R.count++,[{x:!1,y:!1,t:B,trace:t}]}},67072:function(e){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},84236:function(e,t,r){"use strict";var n=r(38248),i=r(20472),a=r(72160),o=r(24040),s=r(3400),l=s.isArrayOrTypedArray,A=r(43616),c=r(79811),u=r(33040).formatColor,g=r(43028),f=r(7152),h=r(80088),d=r(67072),p=r(13448).DESELECTDIM,y={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=r(10624).appendArrayPointValue;function I(e,t){var r,i=e._fullLayout,a=t._length,o=t.textfont,A=t.textposition,c=l(A)?A:[A],u=o.color,g=o.size,f=o.family,h=o.weight,d=o.style,p=o.variant,y={},I=e._context.plotGlPixelRatio,v=t.texttemplate;if(v){y.text=[];var E=i._d3locale,C=Array.isArray(v),B=C?Math.min(v.length,a):a,b=C?function(e){return v[e]}:function(){return v};for(r=0;rd.TOO_MANY_POINTS||g.hasMarkers(t)?"rect":"round";if(A&&t.connectgaps){var u=n[0],f=n[1];for(i=0;i1?A[i]:A[0]:A,d=l(c)?c.length>1?c[i]:c[0]:c,p=y[h],m=y[d],I=u?u/.8+1:0,v=-m*I-.5*m;o.offset[i]=[p*I/f,v/f]}}return o}}},80220:function(e,t,r){"use strict";var n=r(3400),i=r(24040),a=r(80088),o=r(2876),s=r(88200),l=r(43028),A=r(43980),c=r(31147),u=r(74428),g=r(66828),f=r(70840),h=r(124);e.exports=function(e,t,r,d){function p(r,i){return n.coerce(e,t,o,r,i)}var y=!!e.marker&&a.isOpenSymbol(e.marker.symbol),m=l.isBubble(e),I=A(e,t,d,p);if(I){c(e,t,d,p),p("xhoverformat"),p("yhoverformat");var v=I100},t.isDotSymbol=function(e){return"string"===typeof e?n.DOT_RE.test(e):e>200}},41272:function(e,t,r){"use strict";var n=r(24040),i=r(3400),a=r(44928);function o(e,t,r,o){var s=e.xa,l=e.ya,A=e.distance,c=e.dxy,u=e.index,g={pointNumber:u,x:t[u],y:r[u]};g.tx=i.isArrayOrTypedArray(o.text)?o.text[u]:o.text,g.htx=Array.isArray(o.hovertext)?o.hovertext[u]:o.hovertext,g.data=Array.isArray(o.customdata)?o.customdata[u]:o.customdata,g.tp=Array.isArray(o.textposition)?o.textposition[u]:o.textposition;var f=o.textfont;f&&(g.ts=i.isArrayOrTypedArray(f.size)?f.size[u]:f.size,g.tc=i.isArrayOrTypedArray(f.color)?f.color[u]:f.color,g.tf=Array.isArray(f.family)?f.family[u]:f.family,g.tw=Array.isArray(f.weight)?f.weight[u]:f.weight,g.ty=Array.isArray(f.style)?f.style[u]:f.style,g.tv=Array.isArray(f.variant)?f.variant[u]:f.variant);var h=o.marker;h&&(g.ms=i.isArrayOrTypedArray(h.size)?h.size[u]:h.size,g.mo=i.isArrayOrTypedArray(h.opacity)?h.opacity[u]:h.opacity,g.mx=i.isArrayOrTypedArray(h.symbol)?h.symbol[u]:h.symbol,g.ma=i.isArrayOrTypedArray(h.angle)?h.angle[u]:h.angle,g.mc=i.isArrayOrTypedArray(h.color)?h.color[u]:h.color);var d=h&&h.line;d&&(g.mlc=Array.isArray(d.color)?d.color[u]:d.color,g.mlw=i.isArrayOrTypedArray(d.width)?d.width[u]:d.width);var p=h&&h.gradient;p&&"none"!==p.type&&(g.mgt=Array.isArray(p.type)?p.type[u]:p.type,g.mgc=Array.isArray(p.color)?p.color[u]:p.color);var y=s.c2p(g.x,!0),m=l.c2p(g.y,!0),I=g.mrc||1,v=o.hoverlabel;v&&(g.hbg=Array.isArray(v.bgcolor)?v.bgcolor[u]:v.bgcolor,g.hbc=Array.isArray(v.bordercolor)?v.bordercolor[u]:v.bordercolor,g.hts=i.isArrayOrTypedArray(v.font.size)?v.font.size[u]:v.font.size,g.htc=Array.isArray(v.font.color)?v.font.color[u]:v.font.color,g.htf=Array.isArray(v.font.family)?v.font.family[u]:v.font.family,g.hnl=i.isArrayOrTypedArray(v.namelength)?v.namelength[u]:v.namelength);var E=o.hoverinfo;E&&(g.hi=Array.isArray(E)?E[u]:E);var C=o.hovertemplate;C&&(g.ht=Array.isArray(C)?C[u]:C);var B={};B[e.index]=g;var b=o._origX,x=o._origY,w=i.extendFlat({},e,{color:a(o,g),x0:y-I,x1:y+I,xLabelVal:b?b[u]:g.x,y0:m-I,y1:m+I,yLabelVal:x?x[u]:g.y,cd:B,distance:A,spikeDistance:c,hovertemplate:g.ht});return g.htx?w.text=g.htx:g.tx?w.text=g.tx:o.text&&(w.text=o.text),i.fillText(g,o,w),n.getComponentMethod("errorbars","hoverInfo")(g,o,w),w}e.exports={hoverPoints:function(e,t,r,n){var i,a,s,l,A,c,u,g,f,h,d=e.cd,p=d[0].t,y=d[0].trace,m=e.xa,I=e.ya,v=p.x,E=p.y,C=m.c2p(t),B=I.c2p(r),b=e.distance;if(p.tree){var x=m.p2c(C-b),w=m.p2c(C+b),Q=I.p2c(B-b),_=I.p2c(B+b);i="x"===n?p.tree.range(Math.min(x,w),Math.min(I._rl[0],I._rl[1]),Math.max(x,w),Math.max(I._rl[0],I._rl[1])):p.tree.range(Math.min(x,w),Math.min(Q,_),Math.max(x,w),Math.max(Q,_))}else i=p.ids;var S=b;if("x"===n){var k=!!y.xperiodalignment,D=!!y.yperiodalignment;for(c=0;c=Math.min(T,M)&&C<=Math.max(T,M)?0:1/0}if(u=Math.min(R,L)&&B<=Math.max(R,L)?0:1/0}h=Math.sqrt(u*u+g*g),s=i[c]}}}else for(c=i.length-1;c>-1;c--)l=v[a=i[c]],A=E[a],u=m.c2p(l)-C,g=I.c2p(A)-B,(f=Math.sqrt(u*u+g*g))m.glText.length){var B=E-m.glText.length;for(d=0;dr&&(isNaN(t[n])||isNaN(t[n+1]));)n-=2;e.positions=t.slice(r,n+2)}return e})),m.line2d.update(m.lineOptions)),m.error2d){var x=(m.errorXOptions||[]).concat(m.errorYOptions||[]);m.error2d.update(x)}m.scatter2d&&m.scatter2d.update(m.markerOptions),m.fillOrder=s.repeat(null,E),m.fill2d&&(m.fillOptions=m.fillOptions.map((function(e,t){var n=r[t];if(e&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,A=m.lineOptions[t],c=[];s._ownfill&&c.push(t),s._nexttrace&&c.push(t+1),c.length&&(m.fillOrder[t]=c);var u,g,f=[],h=A&&A.positions||l.positions;if("tozeroy"===s.fill){for(u=0;uu&&isNaN(h[g+1]);)g-=2;0!==h[u+1]&&(f=[h[u],0]),f=f.concat(h.slice(u,g+2)),0!==h[g+1]&&(f=f.concat([h[g],0]))}else if("tozerox"===s.fill){for(u=0;uu&&isNaN(h[g]);)g-=2;0!==h[u]&&(f=[0,h[u+1]]),f=f.concat(h.slice(u,g+2)),0!==h[g]&&(f=f.concat([0,h[g+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(f=[],i=0,e.splitNull=!0,a=0;a-1;for(d=0;d")}function c(e){return e+"\xb0"}}e.exports={hoverPoints:function(e,t,r){var o=e.cd,c=o[0].trace,u=e.xa,g=e.ya,f=e.subplot,h=[],d=l+c.uid+"-circle",p=c.cluster&&c.cluster.enabled;if(p){var y=f.map.queryRenderedFeatures(null,{layers:[d]});h=y.map((function(e){return e.id}))}var m=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),I=t-m;if(n.getClosest(o,(function(e){var t=e.lonlat;if(t[0]===s)return 1/0;if(p&&-1===h.indexOf(e.i+1))return 1/0;var n=i.modHalf(t[0],360),a=t[1],o=f.project([n,a]),l=o.x-u.c2p([I,a]),A=o.y-g.c2p([n,r]),c=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+A*A)-c,1-3/c)}),e),!1!==e.index){var v=o[e.index],E=v.lonlat,C=[i.modHalf(E[0],360)+m,E[1]],B=u.c2p(C),b=g.c2p(C),x=v.mrc||1;e.x0=B-x,e.x1=B+x,e.y0=b-x,e.y1=b+x;var w={};w[c.subplot]={_subplot:f};var Q=c._module.formatLabels(v,c,w);return e.lonLabel=Q.lonLabel,e.latLabel=Q.latLabel,e.color=a(c,v),e.extraText=A(c,v,o[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}},getExtraText:A}},11572:function(e,t,r){"use strict";e.exports={attributes:r(31512),supplyDefaults:r(15752),colorbar:r(5528),formatLabels:r(11960),calc:r(25212),plot:r(9660),hoverPoints:r(63312).hoverPoints,eventData:r(37920),selectPoints:r(404),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:"trace",name:"scattermapbox",basePlotModule:r(33688),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},9660:function(e,t,r){"use strict";var n=r(3400),i=r(59392),a=r(47552).traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(e,t,r,n){this.type="scattermapbox",this.subplot=e,this.uid=t,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+t+"-fill",line:"source-"+t+"-line",circle:"source-"+t+"-circle",symbol:"source-"+t+"-symbol",cluster:"source-"+t+"-circle",clusterCount:"source-"+t+"-circle"},this.layerIds={fill:a+t+"-fill",line:a+t+"-line",circle:a+t+"-circle",symbol:a+t+"-symbol",cluster:a+t+"-cluster",clusterCount:a+t+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(e,t,r){var i={type:"geojson",data:t.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[e]);a?a.setData(t.geojson):this.subplot.map.addSource(this.sourceIds[e],i)},l.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)},l.addLayer=function(e,t,r){var n={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(n.filter=t.filter);for(var i,a=this.layerIds[e],o=this.subplot.getMapLayers(),s=0;s=0;r--){var i=t[r];n.removeLayer(c.layerIds[i])}e||n.removeSource(c.sourceIds.circle)}(e):function(e){for(var t=o.nonCluster,r=t.length-1;r>=0;r--){var i=t[r];n.removeLayer(c.layerIds[i]),e||n.removeSource(c.sourceIds[i])}}(e)}function g(e){l?function(e){e||c.addSource("circle",a.circle,t.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},e.exports=function(e,t){var r,n,a,l=t[0].trace,A=l.cluster&&l.cluster.enabled,c=!0!==l.visible,u=new s(e,l.uid,A,c),g=i(e.gd,t),f=u.below=e.belowLookup["trace-"+l.uid];if(A)for(u.addSource("circle",g.circle,l.cluster),r=0;r")}}e.exports={hoverPoints:function(e,t,r,a){var o=n(e,t,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,A=s.cd[s.index],c=s.trace;if(l.isPtInside(A))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(A,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},76924:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:r(40872),categories:["polar","symbols","showLegend","scatter-like"],attributes:r(8319),supplyDefaults:r(85968).supplyDefaults,colorbar:r(5528),formatLabels:r(22852),calc:r(58320),plot:r(43456),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(8504).hoverPoints,selectPoints:r(91560),meta:{}}},43456:function(e,t,r){"use strict";var n=r(96504),i=r(39032).BADNUM;e.exports=function(e,t,r){for(var a=t.layers.frontplot.select("g.scatterlayer"),o=t.xaxis,s=t.yaxis,l={xaxis:o,yaxis:s,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},A=t.radialAxis,c=t.angularAxis,u=0;u=A&&(m.marker.cluster=h.tree),m.marker&&(m.markerSel.positions=m.markerUnsel.positions=m.marker.positions=E),m.line&&E.length>1&&l.extendFlat(m.line,s.linePositions(e,f,E)),m.text&&(l.extendFlat(m.text,{positions:E},s.textPosition(e,f,m.text,m.marker)),l.extendFlat(m.textSel,{positions:E},s.textPosition(e,f,m.text,m.markerSel)),l.extendFlat(m.textUnsel,{positions:E},s.textPosition(e,f,m.text,m.markerUnsel))),m.fill&&!g.fill2d&&(g.fill2d=!0),m.marker&&!g.scatter2d&&(g.scatter2d=!0),m.line&&!g.line2d&&(g.line2d=!0),m.text&&!g.glText&&(g.glText=!0),g.lineOptions.push(m.line),g.fillOptions.push(m.fill),g.markerOptions.push(m.marker),g.markerSelectedOptions.push(m.markerSel),g.markerUnselectedOptions.push(m.markerUnsel),g.textOptions.push(m.text),g.textSelectedOptions.push(m.textSel),g.textUnselectedOptions.push(m.textUnsel),g.selectBatch.push([]),g.unselectBatch.push([]),h.x=C,h.y=B,h.rawx=C,h.rawy=B,h.r=p,h.theta=y,h.positions=E,h._scene=g,h.index=g.count,g.count++}})),a(e,t,r)}},e.exports.reglPrecompiled={}},69496:function(e,t,r){"use strict";var n=r(21776).Ks,i=r(21776).Gw,a=r(92880).extendFlat,o=r(98304),s=r(52904),l=r(45464),A=s.line;e.exports={mode:s.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:s.text,texttemplate:i({editType:"plot"},{keys:["real","imag","text"]}),hovertext:s.hovertext,line:{color:A.color,width:A.width,dash:A.dash,backoff:A.backoff,shape:a({},A.shape,{values:["linear","spline"]}),smoothing:A.smoothing,editType:"calc"},connectgaps:s.connectgaps,marker:s.marker,cliponaxis:a({},s.cliponaxis,{dflt:!1}),textposition:s.textposition,textfont:s.textfont,fill:a({},s.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o(),hoverinfo:a({},l.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:s.hoveron,hovertemplate:n(),selected:s.selected,unselected:s.unselected}},47507:function(e,t,r){"use strict";var n=r(38248),i=r(39032).BADNUM,a=r(90136),o=r(20148),s=r(4500),l=r(16356).calcMarkerSize;e.exports=function(e,t){for(var r=e._fullLayout,A=t.subplot,c=r[A].realaxis,u=r[A].imaginaryaxis,g=c.makeCalcdata(t,"real"),f=u.makeCalcdata(t,"imag"),h=t._length,d=new Array(h),p=0;p")}}e.exports={hoverPoints:function(e,t,r,a){var o=n(e,t,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,A=s.cd[s.index],c=s.trace;if(l.isPtInside(A))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(A,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},95443:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:r(47788),categories:["smith","symbols","showLegend","scatter-like"],attributes:r(69496),supplyDefaults:r(76716),colorbar:r(5528),formatLabels:r(49504),calc:r(47507),plot:r(34927),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(25292).hoverPoints,selectPoints:r(91560),meta:{}}},34927:function(e,t,r){"use strict";var n=r(96504),i=r(39032).BADNUM,a=r(36416).smith;e.exports=function(e,t,r){for(var o=t.layers.frontplot.select("g.scatterlayer"),s=t.xaxis,l=t.yaxis,A={xaxis:s,yaxis:l,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},c=0;c"),o.hovertemplate=g.hovertemplate,a}function I(e,t){y.push(e._hovertitle+": "+t)}}},34864:function(e,t,r){"use strict";e.exports={attributes:r(5896),supplyDefaults:r(84256),colorbar:r(5528),formatLabels:r(90404),calc:r(34335),plot:r(88776),style:r(49224).style,styleOnSelect:r(49224).styleOnSelect,hoverPoints:r(26596),selectPoints:r(91560),eventData:r(97476),moduleType:"trace",name:"scatterternary",basePlotModule:r(19352),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},88776:function(e,t,r){"use strict";var n=r(96504);e.exports=function(e,t,r){var i=t.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=t.xaxis,o=t.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},l=t.layers.frontplot.select("g.scatterlayer"),A=0;Ag?v.sizeAvg||Math.max(v.size,3):a(t,I),f=0;fa&&l||i-1,D=!0;if(o(I)||f.selectedpoints||k){var T=f._length;if(f.selectedpoints){d.selectBatch=f.selectedpoints;var M=f.selectedpoints,R={};for(l=0;l1&&(c=d[m-1],g=p[m-1],h=y[m-1]),t=0;tc?"-":"+")+"x")).replace("y",(u>g?"-":"+")+"y")).replace("z",(f>h?"-":"+")+"z");var S=function(){m=0,w=[],Q=[],_=[]};(!m||m2?e.slice(1,t-1):2===t?[(e[0]+e[1])/2]:e}function f(e){var t=e.length;return 1===t?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function h(e,t){var r=e.fullSceneLayout,i=e.dataScale,c=t._len,u={};function h(e,t){var n=r[t],o=i[A[t]];return a.simpleMap(e,(function(e){return n.d2l(e)*o}))}if(u.vectors=l(h(t._u,"xaxis"),h(t._v,"yaxis"),h(t._w,"zaxis"),c),!c)return{positions:[],cells:[]};var d=h(t._Xs,"xaxis"),p=h(t._Ys,"yaxis"),y=h(t._Zs,"zaxis");if(u.meshgrid=[d,p,y],u.gridFill=t._gridFill,t._slen)u.startingPositions=l(h(t._startsX,"xaxis"),h(t._startsY,"yaxis"),h(t._startsZ,"zaxis"));else{for(var m=p[0],I=g(d),v=g(y),E=new Array(I.length*v.length),C=0,B=0;B=0};m?(r=Math.min(y.length,v.length),l=function(e){return w(y[e])&&Q(e)},u=function(e){return String(y[e])}):(r=Math.min(I.length,v.length),l=function(e){return w(I[e])&&Q(e)},u=function(e){return String(I[e])}),C&&(r=Math.min(r,E.length));for(var _=0;_1){for(var T=a.randstr(),M=0;M=0){t.i=s.i;var c=r.marker;c.pattern&&c.colors&&c.pattern.shape||(c.color=A,t.color=A),n.pointStyle(e,r,a,t)}else i.fill(e,A)}},45716:function(e,t,r){"use strict";var n=r(33428),i=r(24040),a=r(10624).appendArrayPointValue,o=r(93024),s=r(3400),l=r(95924),A=r(78176),c=r(69656).formatPieValue;function u(e,t,r){for(var n=e.data.data,i={curveNumber:t.index,pointNumber:n.i,data:t._input,fullData:t},o=0;o"),name:x||R("name")?m.name:void 0,color:b("hoverlabel.bgcolor")||I.color,borderColor:b("hoverlabel.bordercolor"),fontFamily:b("hoverlabel.font.family"),fontSize:b("hoverlabel.font.size"),fontColor:b("hoverlabel.font.color"),fontWeight:b("hoverlabel.font.weight"),fontStyle:b("hoverlabel.font.style"),fontVariant:b("hoverlabel.font.variant"),nameLength:b("hoverlabel.namelength"),textAlign:b("hoverlabel.align"),hovertemplate:x,hovertemplateLabels:D,eventData:l};p&&(F.x0=_-i.rInscribed*i.rpx1,F.x1=_+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),y&&(F.x=_,F.idealAlign=_<0?"left":"right");var O=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:O}),l[0].bbox=O[0],h._hasHoverLabel=!0}if(y){var P=e.select("path.surface");g.styleOne(P,i,m,r,{hovered:!0})}h._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[u(i,m,g.eventDataKeys)],event:n.event})}})),e.on("mouseout",(function(t){var i=r._fullLayout,a=r._fullData[h.index],s=n.select(this).datum();if(h._hasHoverEvent&&(t.originalEvent=n.event,r.emit("plotly_unhover",{points:[u(s,a,g.eventDataKeys)],event:n.event}),h._hasHoverEvent=!1),h._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),h._hasHoverLabel=!1),y){var l=e.select("path.surface");g.styleOne(l,s,a,r,{hovered:!1})}})),e.on("click",(function(e){var t=r._fullLayout,a=r._fullData[h.index],s=p&&(A.isHierarchyRoot(e)||A.isLeaf(e)),c=A.getPtId(e),f=A.isEntry(e)?A.findEntryWithChild(d,c):A.findEntryWithLevel(d,c),y=A.getPtId(f),m={points:[u(e,a,g.eventDataKeys)],event:n.event};s||(m.nextLevel=y);var I=l.triggerHandler(r,"plotly_"+h.type+"click",m);if(!1!==I&&t.hovermode&&(r._hoverdata=[u(e,a,g.eventDataKeys)],o.click(r,n.event)),!s&&!1!==I&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,t._tracePreGUI[a.uid],{level:a.level});var v={data:[{level:y}],traces:[h.index]},E={frame:{redraw:!1,duration:g.transitionTime},transition:{duration:g.transitionTime,easing:g.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(t._hoverlayer.node()),i.call("animate",r,v,E)}}))}},78176:function(e,t,r){"use strict";var n=r(3400),i=r(76308),a=r(93972),o=r(69656);function s(e){return e.data.data.pid}t.findEntryWithLevel=function(e,r){var n;return r&&e.eachAfter((function(e){if(t.getPtId(e)===r)return n=e.copy()})),n||e},t.findEntryWithChild=function(e,r){var n;return e.eachAfter((function(e){for(var i=e.children||[],a=0;a0)},t.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0},t.isHeader=function(e,r){return!(t.isLeaf(e)||e.depth===r._maxDepth-1)},t.getParent=function(e,r){return t.findEntryWithLevel(e,s(r))},t.listPath=function(e,r){var n=e.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return t.listPath(n,r).concat(i)},t.getPath=function(e){return t.listPath(e,"label").join("/")+"/"},t.formatValue=o.formatPieValue,t.formatPercent=function(e,t){var r=n.formatPercent(e,0);return"0%"===r&&(r=o.formatPiePercent(e,t)),r}},5621:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:r(54904),categories:[],animatable:!0,attributes:r(424),layoutAttributes:r(84920),supplyDefaults:r(25244),supplyLayoutDefaults:r(28732),calc:r(3776).calc,crossTraceCalc:r(3776).crossTraceCalc,plot:r(96488).plot,style:r(85676).style,colorbar:r(5528),meta:{}}},84920:function(e){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},28732:function(e,t,r){"use strict";var n=r(3400),i=r(84920);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("sunburstcolorway",t.colorway),r("extendsunburstcolors")}},96488:function(e,t,r){"use strict";var n=r(33428),i=r(74148),a=r(67756).qy,o=r(43616),s=r(3400),l=r(72736),A=r(82744),c=A.recordMinTextSize,u=A.clearMinTextSize,g=r(37820),f=r(69656).getRotationAngle,h=g.computeTransform,d=g.transformInsideText,p=r(85676).styleOne,y=r(60100).resizeText,m=r(45716),I=r(27328),v=r(78176);function E(e,r,A,u){var g=e._context.staticPlot,y=e._fullLayout,E=!y.uniformtext.mode&&v.hasTransition(u),B=n.select(A).selectAll("g.slice"),b=r[0],x=b.trace,w=b.hierarchy,Q=v.findEntryWithLevel(w,x.level),_=v.getMaxDepth(x),S=y._size,k=x.domain,D=S.w*(k.x[1]-k.x[0]),T=S.h*(k.y[1]-k.y[0]),M=.5*Math.min(D,T),R=b.cx=S.l+S.w*(k.x[1]+k.x[0])/2,L=b.cy=S.t+S.h*(1-k.y[0])-T/2;if(!Q)return B.remove();var N=null,F={};E&&B.each((function(e){F[v.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!N&&v.isEntry(e)&&(N=e)}));var O=function(e){return i.partition().size([2*Math.PI,e.height+1])(e)}(Q).descendants(),P=Q.height+1,G=0,U=_;b.hasMultipleRoots&&v.isHierarchyRoot(Q)&&(O=O.slice(1),P-=1,G=1,U+=1),O=O.filter((function(e){return e.y1<=U}));var z=f(x.rotation);z&&O.forEach((function(e){e.x0+=z,e.x1+=z}));var q=Math.min(P,_),H=function(e){return(e-G)/q*M},Y=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},J=function(e){return s.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,R,L)},K=function(e){return R+C(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},j=function(e){return L+C(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};(B=B.data(O,v.getPtId)).enter().append("g").classed("slice",!0),E?B.exit().transition().each((function(){var e=n.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var t=function(e){var t,r=v.getPtId(e),n=F[r],i=F[v.getPtId(Q)];if(i){var o=(e.x1>i.x1?2*Math.PI:0)+z;t=e.rpx1V?2*Math.PI:0)+z;t={x0:i,x1:i}}else t={rpx0:M,rpx1:M},s.extendFlat(t,X(e));else t={rpx0:0,rpx1:0};else t={x0:z,x1:z};return a(t,n)}(e);return function(e){return J(t(e))}})):u.attr("d",J),A.call(m,Q,e,r,{eventDataKeys:I.eventDataKeys,transitionTime:I.CLICK_TRANSITION_TIME,transitionEasing:I.CLICK_TRANSITION_EASING}).call(v.setSliceCursor,e,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:e._transitioning}),u.call(p,i,x,e);var f=s.ensureSingle(A,"g","slicetext"),C=s.ensureSingle(f,"text","",(function(e){e.attr("data-notex",1)})),B=s.ensureUniformFontSize(e,v.determineTextFont(x,i,y.font));C.text(t.formatSliceLabel(i,Q,x,r,y)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,B).call(l.convertToTspans,e);var w=o.bBox(C.node());i.transform=d(w,i,b),i.transform.targetX=K(i),i.transform.targetY=j(i);var _=function(e,t){var r=e.transform;return h(r,t),r.fontSize=B.size,c(x.type,r,y),s.getTextTransform(r)};E?C.transition().attrTween("transform",(function(e){var t=function(e){var t,r=F[v.getPtId(e)],n=e.transform;if(r)t=r;else if(t={rpx1:e.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},N)if(e.parent)if(V){var i=e.x1>V?2*Math.PI:0;t.x0=t.x1=i}else s.extendFlat(t,X(e));else t.x0=t.x1=z;else t.x0=t.x1=z;var o=a(t.transform.textPosAngle,e.transform.textPosAngle),l=a(t.rpx1,e.rpx1),A=a(t.x0,e.x0),u=a(t.x1,e.x1),g=a(t.transform.scale,n.scale),f=a(t.transform.rotate,n.rotate),h=0===n.rCenter?3:0===t.transform.rCenter?1/3:1,d=a(t.transform.rCenter,n.rCenter),p=function(e){return d(Math.pow(e,h))};return function(e){var t=l(e),r=A(e),i=u(e),a=p(e),s={pxmid:Y(t,(r+i)/2),rpx1:t,transform:{textPosAngle:o(e),rCenter:a,x:n.x,y:n.y}};return c(x.type,n,y),{transform:{targetX:K(s),targetY:j(s),scale:g(e),rotate:f(e),rCenter:a}}}}(e);return function(e){return _(t(e),w)}})):C.attr("transform",_(i,w))}))}function C(e){return t=e.rpx1,r=e.transform.textPosAngle,[t*Math.sin(r),-t*Math.cos(r)];var t,r}t.plot=function(e,t,r,i){var a,o,s=e._fullLayout,l=s._sunburstlayer,A=!r,c=!s.uniformtext.mode&&v.hasTransition(r);u("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),c?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(t){E(e,t,this,r)}))}))):(a.each((function(t){E(e,t,this,r)})),s.uniformtext.mode&&y(e,s._sunburstlayer.selectAll(".trace"),"sunburst")),A&&a.exit().remove()},t.formatSliceLabel=function(e,t,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!a&&(!o||"none"===o))return"";var l=i.separators,A=n[0],c=e.data.data,u=A.hierarchy,g=v.isHierarchyRoot(e),f=v.getParent(u,e),h=v.getValue(e);if(!a){var d,p=o.split("+"),y=function(e){return-1!==p.indexOf(e)},m=[];if(y("label")&&c.label&&m.push(c.label),c.hasOwnProperty("v")&&y("value")&&m.push(v.formatValue(c.v,l)),!g){y("current path")&&m.push(v.getPath(e.data));var I=0;y("percent parent")&&I++,y("percent entry")&&I++,y("percent root")&&I++;var E=I>1;if(I){var C,B=function(e){d=v.formatPercent(C,l),E&&(d+=" of "+e),m.push(d)};y("percent parent")&&!g&&(C=h/v.getValue(f),B("parent")),y("percent entry")&&(C=h/v.getValue(t),B("entry")),y("percent root")&&(C=h/v.getValue(u),B("root"))}}return y("text")&&(d=s.castOption(r,c.i,"text"),s.isValidTextValue(d)&&m.push(d)),m.join("
")}var b=s.castOption(r,c.i,"texttemplate");if(!b)return"";var x={};c.label&&(x.label=c.label),c.hasOwnProperty("v")&&(x.value=c.v,x.valueLabel=v.formatValue(c.v,l)),x.currentPath=v.getPath(e.data),g||(x.percentParent=h/v.getValue(f),x.percentParentLabel=v.formatPercent(x.percentParent,l),x.parent=v.getPtLabel(f)),x.percentEntry=h/v.getValue(t),x.percentEntryLabel=v.formatPercent(x.percentEntry,l),x.entry=v.getPtLabel(t),x.percentRoot=h/v.getValue(u),x.percentRootLabel=v.formatPercent(x.percentRoot,l),x.root=v.getPtLabel(u),c.hasOwnProperty("color")&&(x.color=c.color);var w=s.castOption(r,c.i,"text");return(s.isValidTextValue(w)||""===w)&&(x.text=w),x.customdata=s.castOption(r,c.i,"customdata"),s.texttemplateString(b,x,i._d3locale,x,r._meta||{})}},85676:function(e,t,r){"use strict";var n=r(33428),i=r(76308),a=r(3400),o=r(82744).resizeText,s=r(60404);function l(e,t,r,n){var o=t.data.data,l=!t.children,A=o.i,c=a.castOption(r,A,"marker.line.color")||i.defaultLine,u=a.castOption(r,A,"marker.line.width")||0;e.call(s,t,r,n).style("stroke-width",u).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");o(e,t,"sunburst"),t.each((function(t){var r=n.select(this),i=t[0].trace;r.style("opacity",i.opacity),r.selectAll("path.surface").each((function(t){n.select(this).call(l,t,i,e)}))}))},styleOne:l}},16716:function(e,t,r){"use strict";var n=r(76308),i=r(49084),a=r(29736).axisHoverFormat,o=r(21776).Ks,s=r(45464),l=r(92880).extendFlat,A=r(67824).overrideAll;function c(e){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var u=e.exports=A(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},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},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");u.x.editType=u.y.editType=u.z.editType="calc+clearAxisTypes",u.transforms=void 0},56576:function(e,t,r){"use strict";var n=r(47128);e.exports=function(e,t){t.surfacecolor?n(e,t,{vals:t.surfacecolor,containerStr:"",cLetter:"c"}):n(e,t,{vals:t.z,containerStr:"",cLetter:"c"})}},79164:function(e,t,r){"use strict";var n=r(67792).gl_surface3d,i=r(67792).ndarray,a=r(67792).ndarray_linear_interpolate.d2,o=r(70448),s=r(11240),l=r(3400).isArrayOrTypedArray,A=r(33040).parseColorScale,c=r(43080),u=r(8932).extractOpts;function g(e,t,r){this.scene=e,this.uid=r,this.surface=t,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var f=g.prototype;f.getXat=function(e,t,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[t][e]:this.data.x[e]:e;return void 0===r?i:n.d2l(i,0,r)},f.getYat=function(e,t,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[t][e]:this.data.y[t]:t;return void 0===r?i:n.d2l(i,0,r)},f.getZat=function(e,t,r,n){var i=this.data.z[t][e];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[t][e]),void 0===r?i:n.d2l(i,0,r)},f.handlePick=function(e){if(e.object===this.surface){var t=(e.data.index[0]-1)/this.dataScaleX-1,r=(e.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(t),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);e.index=[n,i],e.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],e.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=e.dataCoordinate[a];null!==o&&void 0!==o&&(e.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return l(s)&&s[i]&&void 0!==s[i][n]?e.textLabel=s[i][n]:e.textLabel=s||"",e.data.dataCoordinate=e.dataCoordinate.slice(),this.surface.highlight(e.data),this.scene.glplot.spikes.position=e.dataCoordinate,!0}};var h=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function d(e,t){if(e0){r=h[n];break}return r}function m(e,t){if(!(e<1||t<1)){for(var r=p(e),n=p(t),i=1,a=0;aE;)r--,r/=y(r),++r1?n:1},f.refineCoords=function(e){for(var t=this.dataScaleX,r=this.dataScaleY,n=e[0].shape[0],a=e[0].shape[1],o=0|Math.floor(e[0].shape[0]*t+1),s=0|Math.floor(e[0].shape[1]*r+1),l=1+n+1,A=1+a+1,c=i(new Float32Array(l*A),[l,A]),u=[1/t,0,0,0,1/r,0,0,0,1],g=0;g0&&null!==this.contourStart[e]&&null!==this.contourEnd[e]&&this.contourEnd[e]>this.contourStart[e]))for(i[e]=!0,t=this.contourStart[e];ta&&(this.minValues[t]=a),this.maxValues[t]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},55992:function(e,t,r){"use strict";var n=r(23536),i=r(92880).extendFlat,a=r(38248),o=r(38116).isTypedArray,s=r(38116).isArrayOrTypedArray;function l(e){if(s(e)){for(var t=0,r=0;r=t||A===e.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=A,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=A+1,a=0);return n}e.exports=function(e,t){var r=c(t.cells.values),o=function(e){return e.slice(t.header.values.length,e.length)},d=c(t.header.values);d.length&&!d[0].length&&(d[0]=[""],d=c(d));var p=d.concat(o(r).map((function(){return u((d[0]||[""]).length)}))),y=t.domain,m=Math.floor(e._fullLayout._size.w*(y.x[1]-y.x[0])),I=Math.floor(e._fullLayout._size.h*(y.y[1]-y.y[0])),v=t.header.values.length?p[0].map((function(){return t.header.height})):[n.emptyHeaderHeight],E=r.length?r[0].map((function(){return t.cells.height})):[],C=v.reduce(A,0),B=h(E,I-C+n.uplift),b=f(h(v,C),[]),x=f(B,b),w={},Q=t._fullInput.columnorder;s(Q)&&(Q=Array.from(Q)),Q=Q.concat(o(r.map((function(e,t){return t}))));var _=p.map((function(e,r){var n=s(t.columnwidth)?t.columnwidth[Math.min(r,t.columnwidth.length-1)]:t.columnwidth;return a(n)?Number(n):1})),S=_.reduce(A,0);_=_.map((function(e){return e/S*m}));var k=Math.max(l(t.header.line.width),l(t.cells.line.width)),D={key:t.uid+e._context.staticPlot,translateX:y.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-y.y[1]),size:e._fullLayout._size,width:m,maxLineWidth:k,height:I,columnOrder:Q,groupHeight:I,rowBlocks:x,headerRowBlocks:b,scrollY:0,cells:i({},t.cells,{values:r}),headerCells:i({},t.header,{values:p}),gdColumns:p.map((function(e){return e[0]})),gdColumnsOriginalOrder:p.map((function(e){return e[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:p.map((function(e,t){var r=w[e];return w[e]=(r||0)+1,{key:e+"__"+w[e],label:e,specIndex:t,xIndex:Q[t],xScale:g,x:void 0,calcdata:void 0,columnWidth:_[t]}}))};return D.columns.forEach((function(e){e.calcdata=D,e.x=g(e)})),D}},53056:function(e,t,r){"use strict";var n=r(92880).extendFlat;t.splitToPanels=function(e){var t=[0,0],r=n({},e,{key:"header",type:"header",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:n({},e.calcdata,{cells:e.calcdata.headerCells})});return[n({},e,{key:"cells1",type:"cells",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),n({},e,{key:"cells2",type:"cells",page:1,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),r]},t.splitToCells=function(e){var t=function(e){var t=e.rowBlocks[e.page],r=t?t.rows[0].rowIndex:0,n=t?r+t.rows.length:0;return[r,n]}(e);return(e.values||[]).slice(t[0],t[1]).map((function(r,n){return{keyWithinBlock:n+("string"===typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:t[0]+n,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:r}}))}},53212:function(e,t,r){"use strict";var n=r(3400),i=r(60520),a=r(86968).Q;e.exports=function(e,t,r,o){function s(r,a){return n.coerce(e,t,i,r,a)}a(t,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(e,t){for(var r=e.columnorder||[],n=e.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(e,t){return e-t})),o=i.map((function(e){return a.indexOf(e)})),s=o.length;s/i),l=!a||s;e.mayHaveMarkup=a&&i.match(/[<&>]/);var A,c="string"===typeof(A=i)&&A.match(n.latexCheck);e.latex=c;var u,g,f=c?"":b(e.calcdata.cells.prefix,t,r)||"",h=c?"":b(e.calcdata.cells.suffix,t,r)||"",d=c?null:b(e.calcdata.cells.format,t,r)||null,p=f+(d?o(d)(e.value):e.value)+h;if(e.wrappingNeeded=!e.wrapped&&!l&&!c&&(u=B(p)),e.cellHeightMayIncrease=s||c||e.mayHaveMarkup||(void 0===u?B(p):u),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex,e.wrappingNeeded){var y=(" "===n.wrapSplitCharacter?p.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===A.length&&(A[0]===i.length-1?A.unshift(A[0]-1):A.push(A[0]+1)),A[0]%2&&A.reverse(),t.each((function(e,t){e.page=A[t],e.scrollY=l})),t.attr("transform",(function(e){var t=N(e.rowBlocks,e.page)-e.scrollY;return u(0,t)})),e&&(D(e,r,t,A,n.prevPages,n,0),D(e,r,t,A,n.prevPages,n,1),v(r,e))}}function k(e,t,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=t.filter((function(e){return s.key===e.key})),A=r||s.scrollbarState.dragMultiplier,c=s.scrollY;s.scrollY=void 0===a?s.scrollY+A*i.event.dy:a;var u=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(w);return S(e,u,l),s.scrollY===c}}function D(e,t,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(e,t){return t===o&&n[t]!==i[t]}));E(e,t,a,r),i[o]=n[o]})))}function T(e,t,r,a){return function(){var o=i.select(t.parentNode);o.each((function(e){var t=e.fragments;o.selectAll("tspan.line").each((function(e,r){t[r].width=this.getComputedTextLength()}));var r,i,a=t[t.length-1].width,s=t.slice(0,-1),l=[],A=0,c=e.column.columnWidth-2*n.cellPad;for(e.value="";s.length;)A+(i=(r=s.shift()).width+a)>c&&(e.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],A=0),l.push(r.text),A+=i;A&&(e.value+=l.join(n.wrapSpacer)),e.wrapped=!0})),o.selectAll("tspan.line").remove(),C(o.select("."+n.cn.cellText),r,e,a),i.select(t.parentNode.parentNode).call(L)}}function M(e,t,r,a,o){return function(){if(!o.settledY){var s=i.select(t.parentNode),l=P(o),A=o.key-l.firstRowIndex,c=l.rows[A].rowHeight,g=o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*n.cellPad:c,f=Math.max(g,c);f-l.rows[A].rowHeight&&(l.rows[A].rowHeight=f,e.selectAll("."+n.cn.columnCell).call(L),S(null,e.filter(w),0),v(r,a,!0)),s.attr("transform",(function(){var e=this,t=e.parentNode.getBoundingClientRect(),r=i.select(e.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),a=e.transform.baseVal.consolidate(),s=r.top-t.top+(a?a.matrix.f:n.cellPad);return u(R(o,i.select(e.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function R(e,t){switch(e.align){case"left":default:return n.cellPad;case"right":return e.column.columnWidth-(t||0)-n.cellPad;case"center":return(e.column.columnWidth-(t||0))/2}}function L(e){e.attr("transform",(function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce((function(e,t){return e+F(t,1/0)}),0),r=F(P(e),e.key);return u(0,r+t)})).selectAll("."+n.cn.cellRect).attr("height",(function(e){return(t=P(e),r=e.key,t.rows[r-t.firstRowIndex]).rowHeight;var t,r}))}function N(e,t){for(var r=0,n=t-1;n>=0;n--)r+=O(e[n]);return r}function F(e,t){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:A.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:A.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},79516:function(e,t,r){"use strict";var n=r(7316);t.name="treemap",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},97840:function(e,t,r){"use strict";var n=r(3776);t.r=function(e,t){return n.calc(e,t)},t.q=function(e){return n._runCrossTraceCalc("treemap",e)}},32984:function(e){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},34092:function(e,t,r){"use strict";var n=r(3400),i=r(40516),a=r(76308),o=r(86968).Q,s=r(31508).handleText,l=r(78048).TEXTPAD,A=r(74174).handleMarkerDefaults,c=r(8932),u=c.hasColorscale,g=c.handleDefaults;e.exports=function(e,t,r,c){function f(r,a){return n.coerce(e,t,i,r,a)}var h=f("labels"),d=f("parents");if(h&&h.length&&d&&d.length){var p=f("values");p&&p.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),"squarify"===f("tiling.packing")&&f("tiling.squarifyratio"),f("tiling.flip"),f("tiling.pad");var y=f("text");f("texttemplate"),t.texttemplate||f("textinfo",n.isArrayOrTypedArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate");var m=f("pathbar.visible");s(e,t,c,f,"auto",{hasPathbar:m,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition");var I=-1!==t.textposition.indexOf("bottom");A(e,t,c,f),(t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis)?g(e,t,c,f,{prefix:"marker.",cLetter:"c"}):f("marker.depthfade",!(t.marker.colors||[]).length);var v=2*t.textfont.size;f("marker.pad.t",I?v/4:v),f("marker.pad.l",v/4),f("marker.pad.r",v/4),f("marker.pad.b",I?v:v/4),f("marker.cornerradius"),t._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},m&&(f("pathbar.thickness",t.pathbar.textfont.size+2*l),f("pathbar.side"),f("pathbar.edgeshape")),f("sort"),f("root.color"),o(t,c,f),t._length=null}else t.visible=!1}},95808:function(e,t,r){"use strict";var n=r(33428),i=r(78176),a=r(82744).clearMinTextSize,o=r(60100).resizeText,s=r(52960);e.exports=function(e,t,r,l,A){var c,u,g=A.type,f=A.drawDescendants,h=e._fullLayout,d=h["_"+g+"layer"],p=!r;a(g,h),(c=d.selectAll("g.trace."+g).data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(g,!0),c.order(),!h.uniformtext.mode&&i.hasTransition(r)?(l&&(u=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){u&&u()})).each("interrupt",(function(){u&&u()})).each((function(){d.selectAll("g.trace").each((function(t){s(e,t,this,r,f)}))}))):(c.each((function(t){s(e,t,this,r,f)})),h.uniformtext.mode&&o(e,d.selectAll(".trace"),g)),p&&c.exit().remove()}},27336:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(43616),o=r(72736),s=r(13832),l=r(66192).styleOne,A=r(32984),c=r(78176),u=r(45716),g=!0;e.exports=function(e,t,r,f,h){var d=h.barDifY,p=h.width,y=h.height,m=h.viewX,I=h.viewY,v=h.pathSlice,E=h.toMoveInsideSlice,C=h.strTransform,B=h.hasTransition,b=h.handleSlicesExit,x=h.makeUpdateSliceInterpolator,w=h.makeUpdateTextInterpolator,Q={},_=e._context.staticPlot,S=e._fullLayout,k=t[0],D=k.trace,T=k.hierarchy,M=p/D._entryDepth,R=c.listPath(r.data,"id"),L=s(T.copy(),[p,y],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(L=L.filter((function(e){var t=R.indexOf(e.data.id);return-1!==t&&(e.x0=M*t,e.x1=M*(t+1),e.y0=d,e.y1=d+y,e.onPathbar=!0,!0)}))).reverse(),(f=f.data(L,c.getPtId)).enter().append("g").classed("pathbar",!0),b(f,g,Q,[p,y],v),f.order();var N=f;B&&(N=N.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){s._x0=m(s.x0),s._x1=m(s.x1),s._y0=I(s.y0),s._y1=I(s.y1),s._hoverX=m(s.x1-Math.min(p,y)/2),s._hoverY=I(s.y1-y/2);var f=n.select(this),h=i.ensureSingle(f,"path","surface",(function(e){e.style("pointer-events",_?"none":"all")}));B?h.transition().attrTween("d",(function(e){var t=x(e,g,Q,[p,y]);return function(e){return v(t(e))}})):h.attr("d",v),f.call(u,r,e,t,{styleOne:l,eventDataKeys:A.eventDataKeys,transitionTime:A.CLICK_TRANSITION_TIME,transitionEasing:A.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),h.call(l,s,D,e,{hovered:!1}),s._text=(c.getPtLabel(s)||"").split("
").join(" ")||"";var d=i.ensureSingle(f,"g","slicetext"),b=i.ensureSingle(d,"text","",(function(e){e.attr("data-notex",1)})),k=i.ensureUniformFontSize(e,c.determineTextFont(D,s,S.font,{onPathbar:!0}));b.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,k).call(o.convertToTspans,e),s.textBB=a.bBox(b.node()),s.transform=E(s,{fontSize:k.size,onPathbar:!0}),s.transform.fontSize=k.size,B?b.transition().attrTween("transform",(function(e){var t=w(e,g,Q,[p,y]);return function(e){return C(t(e))}})):b.attr("transform",C(s))}))}},76477:function(e,t,r){"use strict";var n=r(33428),i=r(3400),a=r(43616),o=r(72736),s=r(13832),l=r(66192).styleOne,A=r(32984),c=r(78176),u=r(45716),g=r(96488).formatSliceLabel,f=!1;e.exports=function(e,t,r,h,d){var p=d.width,y=d.height,m=d.viewX,I=d.viewY,v=d.pathSlice,E=d.toMoveInsideSlice,C=d.strTransform,B=d.hasTransition,b=d.handleSlicesExit,x=d.makeUpdateSliceInterpolator,w=d.makeUpdateTextInterpolator,Q=d.prevEntry,_=e._context.staticPlot,S=e._fullLayout,k=t[0].trace,D=-1!==k.textposition.indexOf("left"),T=-1!==k.textposition.indexOf("right"),M=-1!==k.textposition.indexOf("bottom"),R=!M&&!k.marker.pad.t||M&&!k.marker.pad.b,L=s(r,[p,y],{packing:k.tiling.packing,squarifyratio:k.tiling.squarifyratio,flipX:k.tiling.flip.indexOf("x")>-1,flipY:k.tiling.flip.indexOf("y")>-1,pad:{inner:k.tiling.pad,top:k.marker.pad.t,left:k.marker.pad.l,right:k.marker.pad.r,bottom:k.marker.pad.b}}).descendants(),N=1/0,F=-1/0;L.forEach((function(e){var t=e.depth;t>=k._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(N=Math.min(N,t),F=Math.max(F,t))})),h=h.data(L,c.getPtId),k._maxVisibleLayers=isFinite(F)?F-N+1:0,h.enter().append("g").classed("slice",!0),b(h,f,{},[p,y],v),h.order();var O=null;if(B&&Q){var P=c.getPtId(Q);h.each((function(e){null===O&&c.getPtId(e)===P&&(O={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var G=function(){return O||{x0:0,x1:p,y0:0,y1:y}},U=h;return B&&(U=U.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(s){var h=c.isHeader(s,k);s._x0=m(s.x0),s._x1=m(s.x1),s._y0=I(s.y0),s._y1=I(s.y1),s._hoverX=m(s.x1-k.marker.pad.r),s._hoverY=I(M?s.y1-k.marker.pad.b/2:s.y0+k.marker.pad.t/2);var d=n.select(this),b=i.ensureSingle(d,"path","surface",(function(e){e.style("pointer-events",_?"none":"all")}));B?b.transition().attrTween("d",(function(e){var t=x(e,f,G(),[p,y]);return function(e){return v(t(e))}})):b.attr("d",v),d.call(u,r,e,t,{styleOne:l,eventDataKeys:A.eventDataKeys,transitionTime:A.CLICK_TRANSITION_TIME,transitionEasing:A.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),b.call(l,s,k,e,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h?R?"":c.getPtLabel(s)||"":g(s,r,k,t,S)||"";var Q=i.ensureSingle(d,"g","slicetext"),L=i.ensureSingle(Q,"text","",(function(e){e.attr("data-notex",1)})),N=i.ensureUniformFontSize(e,c.determineTextFont(k,s,S.font)),F=s._text||" ",O=h&&-1===F.indexOf("
");L.text(F).classed("slicetext",!0).attr("text-anchor",T?"end":D||O?"start":"middle").call(a.font,N).call(o.convertToTspans,e),s.textBB=a.bBox(L.node()),s.transform=E(s,{fontSize:N.size,isHeader:h}),s.transform.fontSize=N.size,B?L.transition().attrTween("transform",(function(e){var t=w(e,f,G(),[p,y]);return function(e){return C(t(e))}})):L.attr("transform",C(s))})),O}},83024:function(e){"use strict";e.exports=function e(t,r,n){var i;n.swapXY&&(i=t.x0,t.x0=t.y0,t.y0=i,i=t.x1,t.x1=t.y1,t.y1=i),n.flipX&&(i=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-i),n.flipY&&(i=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-i);var a=t.children;if(a)for(var o=0;o-1?k+M:-(T+M):0,L={x0:D,x1:D,y0:R,y1:R+T},N=function(e,t,r){var n=y.tiling.pad,i=function(e){return e-n<=t.x0},a=function(e){return e+n>=t.x1},o=function(e){return e-n<=t.y0},s=function(e){return e+n>=t.y1};return e.x0===t.x0&&e.x1===t.x1&&e.y0===t.y0&&e.y1===t.y1?{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1}:{x0:i(e.x0-n)?0:a(e.x0-n)?r[0]:e.x0,x1:i(e.x1+n)?0:a(e.x1+n)?r[0]:e.x1,y0:o(e.y0-n)?0:s(e.y0-n)?r[1]:e.y0,y1:o(e.y1+n)?0:s(e.y1+n)?r[1]:e.y1}},F=null,O={},P={},G=null,U=function(e,t){return t?O[g(e)]:P[g(e)]},z=function(e,t,r,n){if(t)return O[g(I)]||L;var i=P[y.level]||r;return function(e){return e.data.depth-v.data.depth=(n-=(m?te:te.r)-s)){var f=(r+n)/2;r=f,n=f}var h;oe?i<(h=a-(m?te:te.b))&&h"===ee?(l.x-=a,A.x-=a,c.x-=a,u.x-=a):"/"===ee?(c.x-=a,u.x-=a,o.x-=a/2,s.x-=a/2):"\\"===ee?(l.x-=a,A.x-=a,o.x-=a/2,s.x-=a/2):"<"===ee&&(o.x-=a,s.x-=a),$(l),$(u),$(o),$(A),$(c),$(s),"M"+Z(l.x,l.y)+"L"+Z(A.x,A.y)+"L"+Z(s.x,s.y)+"L"+Z(c.x,c.y)+"L"+Z(u.x,u.y)+"L"+Z(o.x,o.y)+"Z"},toMoveInsideSlice:se,makeUpdateSliceInterpolator:Ae,makeUpdateTextInterpolator:ce,handleSlicesExit:ue,hasTransition:x,strTransform:ge}):C.remove()}},66192:function(e,t,r){"use strict";var n=r(33428),i=r(76308),a=r(3400),o=r(78176),s=r(82744).resizeText,l=r(60404);function A(e,t,r,n,s){var A,c,u=(s||{}).hovered,g=t.data.data,f=g.i,h=g.color,d=o.isHierarchyRoot(t),p=1;if(u)A=r._hovered.marker.line.color,c=r._hovered.marker.line.width;else if(d&&h===r.root.color)p=100,A="rgba(0,0,0,0)",c=0;else if(A=a.castOption(r,f,"marker.line.color")||i.defaultLine,c=a.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!t.onPathbar){var y=r.marker.depthfade;if(y){var m,I=i.combine(i.addOpacity(r._backgroundColor,.75),h);if(!0===y){var v=o.getMaxDepth(r);m=isFinite(v)?o.isLeaf(t)?0:r._maxVisibleLayers-(t.data.depth-r._entryDepth):t.data.height+1}else m=t.data.depth-r._entryDepth,r._atRootLevel||m++;if(m>0)for(var E=0;E0){var v,E,C,B,b,x=e.xa,w=e.ya;"h"===h.orientation?(b=t,v="y",C=w,E="x",B=x):(b=r,v="x",C=x,E="y",B=w);var Q=f[e.index];if(b>=Q.span[0]&&b<=Q.span[1]){var _=i.extendFlat({},e),S=B.c2p(b,!0),k=s.getKdeValue(Q,h,b),D=s.getPositionOnKdePath(Q,h,S),T=C._offset,M=C._length;_[v+"0"]=D[0],_[v+"1"]=D[1],_[E+"0"]=_[E+"1"]=S,_[E+"Label"]=E+": "+a.hoverLabelText(B,b,h[E+"hoverformat"])+", "+f[0].t.labels.kde+" "+k.toFixed(3);for(var R=0,L=0;L")),c.color=function(e,t){var r=e[t.dir].marker,n=r.color,a=r.line.color,o=r.line.width;return i(n)?n:i(a)&&o?a:void 0}(g,p),[c]}function b(e){return n(d,e,g[h+"hoverformat"])}}},95952:function(e,t,r){"use strict";e.exports={attributes:r(65776),layoutAttributes:r(91352),supplyDefaults:r(24224).supplyDefaults,crossTraceDefaults:r(24224).crossTraceDefaults,supplyLayoutDefaults:r(59464),calc:r(73540),crossTraceCalc:r(50152),plot:r(64488),style:r(12252).style,hoverPoints:r(94196),eventData:r(53256),selectPoints:r(45784),moduleType:"trace",name:"waterfall",basePlotModule:r(57952),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},91352:function(e){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},59464:function(e,t,r){"use strict";var n=r(3400),i=r(91352);e.exports=function(e,t,r){var a=!1;function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=0;s0&&(p+=g?"M"+u[0]+","+h[1]+"V"+h[0]:"M"+u[1]+","+h[0]+"H"+u[0]),"between"!==f&&(r.isSum||s path").each((function(e){if(!e.isBlank){var t=s[e.dir].marker;n.select(this).call(a.fill,t.color).call(a.stroke,t.line.color).call(i.dashLine,t.line.dash,t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),A(r,s,e),r.selectAll(".lines").each((function(){var e=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},84224:function(e,t,r){"use strict";var n=r(54460),i=r(3400),a=r(73060),o=r(60468).W,s=r(39032).BADNUM;t.moduleType="transform",t.name="aggregate";var l=t.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},A=l.aggregations;function c(e,t,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(t,o),A=l.get(),c=function(e,t){var r=e.func,n=t.d2c,a=t.c2d;switch(r){case"count":return u;case"first":return g;case"last":return f;case"sum":return function(e,t){for(var r=0,i=0;ii&&(i=c,o=A)}}return i?a(o):s};case"rms":return function(e,t){for(var r=0,i=0,o=0;o":return function(e){return f(e)>u};case">=":return function(e){return f(e)>=u};case"[]":return function(e){var t=f(e);return t>=u[0]&&t<=u[1]};case"()":return function(e){var t=f(e);return t>u[0]&&t=u[0]&&tu[0]&&t<=u[1]};case"][":return function(e){var t=f(e);return t<=u[0]||t>=u[1]};case")(":return function(e){var t=f(e);return tu[1]};case"](":return function(e){var t=f(e);return t<=u[0]||t>u[1]};case")[":return function(e){var t=f(e);return t=u[1]};case"{}":return function(e){return-1!==u.indexOf(f(e))};case"}{":return function(e){return-1===u.indexOf(f(e))}}}(r,a.getDataToCoordFunc(e,t,s,i),g),I={},v={},E=0;h?(p=function(e){I[e.astr]=n.extendDeep([],e.get()),e.set(new Array(u))},y=function(e,t){var r=I[e.astr][t];e.get()[t]=r}):(p=function(e){I[e.astr]=n.extendDeep([],e.get()),e.set([])},y=function(e,t){var r=I[e.astr][t];e.get().push(r)}),b(p);for(var C=o(t.transforms,r),B=0;B1?"%{group} (%{trace})":"%{group}");var l=e.styles,A=o.styles=[];if(l)for(a=0;af)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,d.prototype),t}function d(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return m(e)}return p(e,t,r)}function p(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!d.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|C(e,t),n=h(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(re(e,Uint8Array)){var t=new Uint8Array(e);return v(t.buffer,t.byteOffset,t.byteLength)}return I(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(e));if(re(e,ArrayBuffer)||e&&re(e.buffer,ArrayBuffer))return v(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(re(e,SharedArrayBuffer)||e&&re(e.buffer,SharedArrayBuffer)))return v(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return d.from(n,t,r);var i=function(e){if(d.isBuffer(e)){var t=0|E(e.length),r=h(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||ne(e.length)?h(0):I(e):"Buffer"===e.type&&Array.isArray(e.data)?I(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return d.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(e))}function y(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function m(e){return y(e),h(e<0?0:0|E(e))}function I(e){for(var t=e.length<0?0:0|E(e.length),r=h(t),n=0;n=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|e}function C(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||re(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+A(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function B(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function x(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ne(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=d.from(t,n)),d.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function A(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var u=!0,g=0;gi&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,A=void 0,c=void 0,u=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(u=(31&a)<<6|63&l)>127&&(o=u);break;case 3:l=e[i+1],A=e[i+2],128===(192&l)&&128===(192&A)&&(u=(15&a)<<12|(63&l)<<6|63&A)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:l=e[i+1],A=e[i+2],c=e[i+3],128===(192&l)&&128===(192&A)&&128===(192&c)&&(u=(15&a)<<18|(63&l)<<12|(63&A)<<6|63&c)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?(d.isBuffer(a)||(a=d.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!d.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},d.byteLength=C,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},g&&(d.prototype[g]=d.prototype.inspect),d.prototype.compare=function(e,t,r,n,i){if(re(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+A(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(n,i),c=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return Q(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function L(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function G(e,t,r,n,i,a){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function U(e,t,r,n,i){V(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function z(e,t,r,n,i){V(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function q(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,4),u.write(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,8),u.write(e,t,r,n,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},d.prototype.readUint8=d.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readBigUInt64LE=ae((function(e){W(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},d.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readBigInt64LE=ae((function(e){W(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||P(e,4,this.length),u.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),u.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),u.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),u.read(this,e,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigUInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=ae((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>>=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=ae((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,n){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function V(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new J.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||Z(t,e.length-(r+1))}(n,i,a)}function W(e,t){if("number"!==typeof e)throw new J.ERR_INVALID_ARG_TYPE(t,"number",e)}function Z(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new J.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new J.ERR_BUFFER_OUT_OF_BOUNDS;throw new J.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}K("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),K("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(A(t))}),TypeError),K("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=j(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=j(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var X=/[^+/0-9A-Za-z-_]/g;function $(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function ee(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function te(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!==e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ae(e){return"undefined"===typeof BigInt?oe:e}function oe(){throw new Error("BigInt not supported")}},9216:function(e){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(e,t,r){"use strict";e.exports=function(e){var t=(e=e||{}).eye||[0,0,1],r=e.center||[0,0,0],s=e.up||[0,1,0],l=e.distanceLimits||[0,1/0],A=e.mode||"turntable",c=n(),u=i(),g=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,t,r,s),u.setDistanceLimits(l[0],l[1]),u.lookAt(0,t,r,s),g.setDistanceLimits(l[0],l[1]),g.lookAt(0,t,r,s),new o({turntable:c,orbit:u,matrix:g},A)};var n=r(7261),i=r(9977),a=r(4192);function o(e,t){this._controllerNames=Object.keys(e),this._controllerList=this._controllerNames.map((function(t){return e[t]})),this._mode=t,this._active=e[t],this._active||(this._mode="turntable",this._active=e.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}var s=o.prototype;s.flush=function(e){for(var t=this._controllerList,r=0;r0?o-4:o;for(r=0;r>16&255,A[c++]=t>>8&255,A[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,A[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,A[c++]=t>>8&255,A[c++]=255&t),A},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,A=n-i;sA?A:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3865:function(e,t,r){"use strict";var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).add(t[0].mul(e[1])),e[1].mul(t[1]))}},1318:function(e){"use strict";e.exports=function(e,t){return e[0].mul(t[1]).cmp(t[0].mul(e[1]))}},8697:function(e,t,r){"use strict";var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]),e[1].mul(t[0]))}},7842:function(e,t,r){"use strict";var n=r(6330),i=r(1533),a=r(2651),o=r(4387),s=r(869),l=r(8697);e.exports=function e(t,r){if(n(t))return r?l(t,e(r)):[t[0].clone(),t[1].clone()];var A,c,u=0;if(i(t))A=t.clone();else if("string"===typeof t)A=o(t);else{if(0===t)return[a(0),a(1)];if(t===Math.floor(t))A=a(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),u-=256;A=a(t)}}if(n(r))A.mul(r[1]),c=r[0].clone();else if(i(r))c=r.clone();else if("string"===typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),u+=256;c=a(r)}else c=a(1);return u>0?A=A.ushln(u):u<0&&(c=c.ushln(-u)),s(A,c)}},6330:function(e,t,r){"use strict";var n=r(1533);e.exports=function(e){return Array.isArray(e)&&2===e.length&&n(e[0])&&n(e[1])}},5716:function(e,t,r){"use strict";var n=r(6859);e.exports=function(e){return e.cmp(new n(0))}},1369:function(e,t,r){"use strict";var n=r(5716);e.exports=function(e){var t=e.length,r=e.words,i=0;if(1===t)i=r[0];else if(2===t)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},1533:function(e,t,r){"use strict";r(6859),e.exports=function(e){return e&&"object"===typeof e&&Boolean(e.words)}},2651:function(e,t,r){"use strict";var n=r(6859),i=r(2361);e.exports=function(e){var t=i.exponent(e);return t<52?new n(e):new n(e*Math.pow(2,52-t)).ushln(t-52)}},869:function(e,t,r){"use strict";var n=r(2651),i=r(5716);e.exports=function(e,t){var r=i(e),a=i(t);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(e=e.neg(),t=t.neg());var o=e.gcd(t);return o.cmpn(1)?[e.div(o),t.div(o)]:[e,t]}},4387:function(e,t,r){"use strict";var n=r(6859);e.exports=function(e){return new n(e)}},6504:function(e,t,r){"use strict";var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[0]),e[1].mul(t[1]))}},7721:function(e,t,r){"use strict";var n=r(5716);e.exports=function(e){return n(e[0])*n(e[1])}},5572:function(e,t,r){"use strict";var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},946:function(e,t,r){"use strict";var n=r(1369),i=r(4025);e.exports=function(e){var t=e[0],r=e[1];if(0===t.cmpn(0))return 0;var a=t.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,A=t.negative!==r.negative?-1:1;if(0===l.cmpn(0))return A*s;if(s){var c=i(s)+4;return A*(s+(g=n(l.ushln(c).divRound(r)))*Math.pow(2,-c))}var u=r.bitLength()-l.bitLength()+53,g=n(l.ushln(u).divRound(r));return u<1023?A*g*Math.pow(2,-u):A*(g*=Math.pow(2,-1023))*Math.pow(2,1023-u)}},2478:function(e){"use strict";function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},8828:function(e,t){"use strict";function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},6859:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(7790).Buffer}catch(x){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function A(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=l(e,t,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var A=1;A>>26,u=67108863&l,g=Math.min(A,t.length-1),f=Math.max(0,A-e.length+1);f<=g;f++){var h=A-f|0;c+=(o=(i=0|e.words[h])*(a=0|t.words[f])+u)/67108864|0,u=67108863&o}r.words[A]=0|u,l=0|c}return 0!==l?r.words[A]=0|l:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var A=u[e],f=g[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var d=h.modn(f).toString(e);r=(h=h.idivn(f)).isZero()?d+r:c[A-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n("undefined"!==typeof o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===t,A=new e(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),A[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,f=0|o[1],h=8191&f,d=f>>>13,p=0|o[2],y=8191&p,m=p>>>13,I=0|o[3],v=8191&I,E=I>>>13,C=0|o[4],B=8191&C,b=C>>>13,x=0|o[5],w=8191&x,Q=x>>>13,_=0|o[6],S=8191&_,k=_>>>13,D=0|o[7],T=8191&D,M=D>>>13,R=0|o[8],L=8191&R,N=R>>>13,F=0|o[9],O=8191&F,P=F>>>13,G=0|s[0],U=8191&G,z=G>>>13,q=0|s[1],H=8191&q,Y=q>>>13,J=0|s[2],K=8191&J,j=J>>>13,V=0|s[3],W=8191&V,Z=V>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],le=8191&se,Ae=se>>>13,ce=0|s[8],ue=8191&ce,ge=ce>>>13,fe=0|s[9],he=8191&fe,de=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var pe=(A+(n=Math.imul(u,U))|0)+((8191&(i=(i=Math.imul(u,z))+Math.imul(g,U)|0))<<13)|0;A=((a=Math.imul(g,z))+(i>>>13)|0)+(pe>>>26)|0,pe&=67108863,n=Math.imul(h,U),i=(i=Math.imul(h,z))+Math.imul(d,U)|0,a=Math.imul(d,z);var ye=(A+(n=n+Math.imul(u,H)|0)|0)+((8191&(i=(i=i+Math.imul(u,Y)|0)+Math.imul(g,H)|0))<<13)|0;A=((a=a+Math.imul(g,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(m,U)|0,a=Math.imul(m,z),n=n+Math.imul(h,H)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,H)|0,a=a+Math.imul(d,Y)|0;var me=(A+(n=n+Math.imul(u,K)|0)|0)+((8191&(i=(i=i+Math.imul(u,j)|0)+Math.imul(g,K)|0))<<13)|0;A=((a=a+Math.imul(g,j)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,z))+Math.imul(E,U)|0,a=Math.imul(E,z),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,Y)|0,n=n+Math.imul(h,K)|0,i=(i=i+Math.imul(h,j)|0)+Math.imul(d,K)|0,a=a+Math.imul(d,j)|0;var Ie=(A+(n=n+Math.imul(u,W)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(g,W)|0))<<13)|0;A=((a=a+Math.imul(g,Z)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,z))+Math.imul(b,U)|0,a=Math.imul(b,z),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,j)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,j)|0,n=n+Math.imul(h,W)|0,i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,W)|0,a=a+Math.imul(d,Z)|0;var ve=(A+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(g,$)|0))<<13)|0;A=((a=a+Math.imul(g,ee)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,z))+Math.imul(Q,U)|0,a=Math.imul(Q,z),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,j)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,j)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,Z)|0,n=n+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,$)|0,a=a+Math.imul(d,ee)|0;var Ee=(A+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(g,re)|0))<<13)|0;A=((a=a+Math.imul(g,ne)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,z))+Math.imul(k,U)|0,a=Math.imul(k,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(Q,H)|0,a=a+Math.imul(Q,Y)|0,n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,j)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,j)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(E,W)|0,a=a+Math.imul(E,Z)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0,n=n+Math.imul(h,re)|0,i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0,a=a+Math.imul(d,ne)|0;var Ce=(A+(n=n+Math.imul(u,ae)|0)|0)+((8191&(i=(i=i+Math.imul(u,oe)|0)+Math.imul(g,ae)|0))<<13)|0;A=((a=a+Math.imul(g,oe)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(M,U)|0,a=Math.imul(M,z),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,j)|0)+Math.imul(Q,K)|0,a=a+Math.imul(Q,j)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,Z)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ne)|0,n=n+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(d,ae)|0,a=a+Math.imul(d,oe)|0;var Be=(A+(n=n+Math.imul(u,le)|0)|0)+((8191&(i=(i=i+Math.imul(u,Ae)|0)+Math.imul(g,le)|0))<<13)|0;A=((a=a+Math.imul(g,Ae)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,z))+Math.imul(N,U)|0,a=Math.imul(N,z),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,Y)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,j)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,j)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(Q,W)|0,a=a+Math.imul(Q,Z)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0,n=n+Math.imul(h,le)|0,i=(i=i+Math.imul(h,Ae)|0)+Math.imul(d,le)|0,a=a+Math.imul(d,Ae)|0;var be=(A+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,ge)|0)+Math.imul(g,ue)|0))<<13)|0;A=((a=a+Math.imul(g,ge)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(P,U)|0,a=Math.imul(P,z),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(N,H)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,j)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,j)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,Z)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(Q,$)|0,a=a+Math.imul(Q,ee)|0,n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(v,ae)|0,i=(i=i+Math.imul(v,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(y,le)|0,i=(i=i+Math.imul(y,Ae)|0)+Math.imul(m,le)|0,a=a+Math.imul(m,Ae)|0,n=n+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ge)|0)+Math.imul(d,ue)|0,a=a+Math.imul(d,ge)|0;var xe=(A+(n=n+Math.imul(u,he)|0)|0)+((8191&(i=(i=i+Math.imul(u,de)|0)+Math.imul(g,he)|0))<<13)|0;A=((a=a+Math.imul(g,de)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(O,H),i=(i=Math.imul(O,Y))+Math.imul(P,H)|0,a=Math.imul(P,Y),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,j)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,j)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(M,W)|0,a=a+Math.imul(M,Z)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(Q,re)|0,a=a+Math.imul(Q,ne)|0,n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(v,le)|0,i=(i=i+Math.imul(v,Ae)|0)+Math.imul(E,le)|0,a=a+Math.imul(E,Ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ge)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,ge)|0;var we=(A+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;A=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,K),i=(i=Math.imul(O,j))+Math.imul(P,K)|0,a=Math.imul(P,j),n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,Z)|0)+Math.imul(N,W)|0,a=a+Math.imul(N,Z)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(Q,ae)|0,a=a+Math.imul(Q,oe)|0,n=n+Math.imul(B,le)|0,i=(i=i+Math.imul(B,Ae)|0)+Math.imul(b,le)|0,a=a+Math.imul(b,Ae)|0,n=n+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,ge)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,ge)|0;var Qe=(A+(n=n+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,de)|0)+Math.imul(m,he)|0))<<13)|0;A=((a=a+Math.imul(m,de)|0)+(i>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,n=Math.imul(O,W),i=(i=Math.imul(O,Z))+Math.imul(P,W)|0,a=Math.imul(P,Z),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(N,$)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ne)|0,n=n+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,Ae)|0)+Math.imul(Q,le)|0,a=a+Math.imul(Q,Ae)|0,n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,ge)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ge)|0;var _e=(A+(n=n+Math.imul(v,he)|0)|0)+((8191&(i=(i=i+Math.imul(v,de)|0)+Math.imul(E,he)|0))<<13)|0;A=((a=a+Math.imul(E,de)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(O,$),i=(i=Math.imul(O,ee))+Math.imul(P,$)|0,a=Math.imul(P,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,Ae)|0)+Math.imul(k,le)|0,a=a+Math.imul(k,Ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ge)|0)+Math.imul(Q,ue)|0,a=a+Math.imul(Q,ge)|0;var Se=(A+(n=n+Math.imul(B,he)|0)|0)+((8191&(i=(i=i+Math.imul(B,de)|0)+Math.imul(b,he)|0))<<13)|0;A=((a=a+Math.imul(b,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(O,re),i=(i=Math.imul(O,ne))+Math.imul(P,re)|0,a=Math.imul(P,ne),n=n+Math.imul(L,ae)|0,i=(i=i+Math.imul(L,oe)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,oe)|0,n=n+Math.imul(T,le)|0,i=(i=i+Math.imul(T,Ae)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,Ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ge)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,ge)|0;var ke=(A+(n=n+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,de)|0)+Math.imul(Q,he)|0))<<13)|0;A=((a=a+Math.imul(Q,de)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,ae),i=(i=Math.imul(O,oe))+Math.imul(P,ae)|0,a=Math.imul(P,oe),n=n+Math.imul(L,le)|0,i=(i=i+Math.imul(L,Ae)|0)+Math.imul(N,le)|0,a=a+Math.imul(N,Ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ge)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,ge)|0;var De=(A+(n=n+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,de)|0)+Math.imul(k,he)|0))<<13)|0;A=((a=a+Math.imul(k,de)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(O,le),i=(i=Math.imul(O,Ae))+Math.imul(P,le)|0,a=Math.imul(P,Ae),n=n+Math.imul(L,ue)|0,i=(i=i+Math.imul(L,ge)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,ge)|0;var Te=(A+(n=n+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,de)|0)+Math.imul(M,he)|0))<<13)|0;A=((a=a+Math.imul(M,de)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(O,ue),i=(i=Math.imul(O,ge))+Math.imul(P,ue)|0,a=Math.imul(P,ge);var Me=(A+(n=n+Math.imul(L,he)|0)|0)+((8191&(i=(i=i+Math.imul(L,de)|0)+Math.imul(N,he)|0))<<13)|0;A=((a=a+Math.imul(N,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Re=(A+(n=Math.imul(O,he))|0)+((8191&(i=(i=Math.imul(O,de))+Math.imul(P,he)|0))<<13)|0;return A=((a=Math.imul(P,de))+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,l[0]=pe,l[1]=ye,l[2]=me,l[3]=Ie,l[4]=ve,l[5]=Ee,l[6]=Ce,l[7]=Be,l[8]=be,l[9]=xe,l[10]=we,l[11]=Qe,l[12]=_e,l[13]=Se,l[14]=ke,l[15]=De,l[16]=Te,l[17]=Me,l[18]=Re,0!==A&&(l[19]=A,r.length++),r};function d(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(h=f),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):d(this,e,t),r},p.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},p.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,A=0;A=0&&(0!==c||A>=i);A--){var u=0|this.words[A];this.words[A]=c<<26-a|u>>>a,c=u&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==t){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var A=0;A=0;u--){var g=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(g=Math.min(g/o|0,67108863),n._ishlnsubmul(i,g,u);0!==n.negative;)g--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);s&&(s.words[u]=g)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),A=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++A;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var g=0,f=1;0===(t.words[0]&f)&&g<26;++g,f<<=1);if(g>0)for(t.iushrn(g);g-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(u)),i.iushrn(1),o.iushrn(1);for(var h=0,d=1;0===(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(u)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(l)):(r.isub(t),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(A)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var A=0,c=1;0===(t.words[0]&c)&&A<26;++A,c<<=1);if(A>0)for(t.iushrn(A);A-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var u=0,g=1;0===(r.words[0]&g)&&u<26;++u,g<<=1);if(u>0)for(r.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new B(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function I(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function C(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function b(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},i(I,m),I.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},I.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new I;else if("p224"===e)t=new v;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new C}return y[e]=t,t},B.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},B.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),A=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,A).cmp(l);)c.redIAdd(l);for(var u=this.pow(c,i),g=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),h=o;0!==f.cmp(s);){for(var d=f,p=0;0!==d.cmp(s);p++)d=d.redSqr();n(p=0;n--){for(var A=t.words[n],c=l-1;c>=0;c--){var u=A>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==o?(o<<=1,o|=u,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new b(e)},i(b,B),b.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},b.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},b.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},b.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},b.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6204:function(e){"use strict";e.exports=function(e){var t,r,n,i=e.length,a=0;for(t=0;t>>1;if(!(c<=0)){var u,g=i.mallocDouble(2*c*s),f=i.mallocInt32(s);if((s=l(e,c,g,f))>0){if(1===c&&n)a.init(s),u=a.sweepComplete(c,r,0,s,g,f,0,s,g,f);else{var h=i.mallocDouble(2*c*A),d=i.mallocInt32(A);(A=l(t,c,h,d))>0&&(a.init(s+A),u=1===c?a.sweepBipartite(c,r,0,s,g,f,0,A,h,d):o(c,r,n,s,g,f,A,h,d),i.free(h),i.free(d))}i.free(g),i.free(f)}return u}}}function c(e,t){n.push([e,t])}},2455:function(e,t){"use strict";function r(e){return e?function(e,t,r,n,i,a,o,s,l,A,c){return i-n>l-s?function(e,t,r,n,i,a,o,s,l,A,c){for(var u=2*e,g=n,f=u*n;gA-l?n?function(e,t,r,n,i,a,o,s,l,A,c){for(var u=2*e,g=n,f=u*n;g0;){var R=(T-=1)*v,L=C[R],N=C[R+1],F=C[R+2],O=C[R+3],P=C[R+4],G=C[R+5],U=T*E,z=B[U],q=B[U+1],H=1&G,Y=!!(16&G),J=c,K=Q,j=S,V=k;if(H&&(J=S,K=k,j=c,V=Q),!(2&G&&N>=(F=p(e,L,N,F,J,K,q)))&&!(4&G&&(N=y(e,L,N,F,J,K,z))>=F)){var W=F-N,Z=P-O;if(Y){if(e*W*(W+Z)=p0)&&!(p1>=hi)"),d=c("lo===p0"),p=c("lo>>1,g=2*e,f=u,h=s[g*u+t];A=I?(f=m,h=I):y>=E?(f=p,h=y):(f=v,h=E):I>=E?(f=m,h=I):E>=y?(f=p,h=y):(f=v,h=E);for(var C=g*(c-1),B=g*f,b=0;br&&i[u+t]>A;--c,u-=o){for(var g=u,f=u+o,h=0;hg;++g,l+=s)if(i[l+u]===o)if(c===g)c+=1,A+=s;else{for(var f=0;s>f;++f){var h=i[l+f];i[l+f]=i[A],i[A++]=h}var d=a[g];a[g]=a[c],a[c++]=d}return c},"log;++g,l+=s)if(i[l+u]f;++f){var h=i[l+f];i[l+f]=i[A],i[A++]=h}var d=a[g];a[g]=a[c],a[c++]=d}return c},"lo<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,A=l,c=r,u=e+t,g=r;n>g;++g,l+=s)if(i[l+u]<=o)if(c===g)c+=1,A+=s;else{for(var f=0;s>f;++f){var h=i[l+f];i[l+f]=i[A],i[A++]=h}var d=a[g];a[g]=a[c],a[c++]=d}return c},"hi<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,A=l,c=r,u=e+t,g=r;n>g;++g,l+=s)if(i[l+u]<=o)if(c===g)c+=1,A+=s;else{for(var f=0;s>f;++f){var h=i[l+f];i[l+f]=i[A],i[A++]=h}var d=a[g];a[g]=a[c],a[c++]=d}return c},"lof;++f,l+=s){var h=i[l+u],d=i[l+g];if(hp;++p){var y=i[l+p];i[l+p]=i[A],i[A++]=y}var m=a[f];a[f]=a[c],a[c++]=m}}return c},"lo<=p0&&p0<=hi":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,A=l,c=r,u=t,g=e+t,f=r;n>f;++f,l+=s){var h=i[l+u],d=i[l+g];if(h<=o&&o<=d)if(c===f)c+=1,A+=s;else{for(var p=0;s>p;++p){var y=i[l+p];i[l+p]=i[A],i[A++]=y}var m=a[f];a[f]=a[c],a[c++]=m}}return c},"!(lo>=p0)&&!(p1>=hi)":function(e,t,r,n,i,a,o,s){for(var l=2*e,A=l*r,c=A,u=r,g=t,f=e+t,h=r;n>h;++h,A+=l){var d=i[A+g],p=i[A+f];if(!(d>=o)&&!(s>=p))if(u===h)u+=1,c+=l;else{for(var y=0;l>y;++y){var m=i[A+y];i[A+y]=i[c],i[c++]=m}var I=a[h];a[h]=a[u],a[u++]=I}}return u}}},1811:function(e){"use strict";e.exports=function(e,n){n<=4*t?r(0,n-1,e):A(0,n-1,e)};var t=32;function r(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >e;){var A=r[l-2],c=r[l-1];if(Ar[t+1])}function l(e,t,r,n){var i=n[e*=2];return i>1,p=d-g,y=d+g,m=f,I=p,v=d,E=y,C=h,B=e+1,b=c-1,x=0;s(m,I,u)&&(x=m,m=I,I=x),s(E,C,u)&&(x=E,E=C,C=x),s(m,v,u)&&(x=m,m=v,v=x),s(I,v,u)&&(x=I,I=v,v=x),s(m,E,u)&&(x=m,m=E,E=x),s(v,E,u)&&(x=v,v=E,E=x),s(I,C,u)&&(x=I,I=C,C=x),s(I,v,u)&&(x=I,I=v,v=x),s(E,C,u)&&(x=E,E=C,C=x);for(var w=u[2*I],Q=u[2*I+1],_=u[2*E],S=u[2*E+1],k=2*m,D=2*v,T=2*C,M=2*f,R=2*d,L=2*h,N=0;N<2;++N){var F=u[k+N],O=u[D+N],P=u[T+N];u[M+N]=F,u[R+N]=O,u[L+N]=P}i(p,e,u),i(y,c,u);for(var G=B;G<=b;++G)if(l(G,w,Q,u))G!==B&&n(G,B,u),++B;else if(!l(G,_,S,u))for(;;){if(l(b,_,S,u)){l(b,w,Q,u)?(a(G,B,b,u),++B,--b):(n(G,b,u),--b);break}if(--b>>1;a(h,Q);var _=0,S=0;for(B=0;B=o)d(c,u,S--,k=k-o|0);else if(k>=0)d(l,A,_--,k);else if(k<=-o){k=-k-o|0;for(var D=0;D<_;++D)if(void 0!==(T=t(l[D],k)))return T;p(c,u,S++,k)}else{for(k=-k-1|0,D=0;D>>1;a(h,_);var S=0,k=0,D=0;for(b=0;b<_;++b){var T=0|h[2*b+1],M=1&T;if(b<_-1&&T>>1===h[2*b+3]>>1&&(M=2,b+=1),T<0){for(var R=-(T>>1)-1,L=0;L>1)-1,0===M?d(l,A,S--,R):1===M?d(c,u,k--,R):2===M&&d(g,f,D--,R)}},scanBipartite:function(e,t,r,n,i,s,c,u,g,f,y,m){var I=0,v=2*e,E=t,C=t+e,B=1,b=1;n?b=o:B=o;for(var x=i;x>>1;a(h,S);var k=0;for(x=0;x=o?(T=!n,w-=o):(T=!!n,w-=1),T)p(l,A,k++,w);else{var M=m[w],R=v*w,L=y[R+t+1],N=y[R+t+1+e];e:for(var F=0;F>>1;a(h,B);var b=0;for(I=0;I=o)l[b++]=v-o;else{var w=f[v-=1],Q=p*v,_=g[Q+t+1],S=g[Q+t+1+e];e:for(var k=0;k=0;--k)if(l[k]===v){for(R=k+1;R0;){for(var f=r.pop(),h=(c=-1,u=-1,l=o[s=r.pop()],1);h=0||(t.flip(s,f),i(e,t,r,c,s,u),i(e,t,r,s,u,c),i(e,t,r,u,f,c),i(e,t,r,f,c,u))}}},5023:function(e,t,r){"use strict";var n=r(2478);function i(e,t,r,n,i,a,o){this.cells=e,this.neighbor=t,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function a(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}e.exports=function(e,t,r){var n=function(e,t){for(var r=e.cells(),n=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var f=s.pop();if(A[f]!==-o){A[f]=o,c[f];for(var h=0;h<3;++h){var d=g[3*f+h];d>=0&&0===A[d]&&(u[3*f+h]?l.push(d):(s.push(d),A[d]=o))}}}var p=l;l=s,s=p,l.length=0,o=-o}var y=function(e,t,r){for(var n=0,i=0;i1&&i(r[g[f-2]],r[g[f-1]],a)>0;)e.push([g[f-1],g[f-2],o]),f-=1;g.length=f,g.push(o);var h=u.upperIds;for(f=h.length;f>1&&i(r[h[f-2]],r[h[f-1]],a)<0;)e.push([h[f-2],h[f-1],o]),f-=1;h.length=f,h.push(o)}}function u(e,t){var r;return(r=e.a[0]d[0]&&i.push(new s(d,h,2,A),new s(h,d,1,A))}i.sort(l);for(var p=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),y=[new o([p,1],[p,0],-1,[],[],[],[])],m=[],I=(A=0,i.length);A=0}}(),a.removeTriangle=function(e,t,r){var n=this.stars;o(n[e],t,r),o(n[t],r,e),o(n[r],e,t)},a.addTriangle=function(e,t,r){var n=this.stars;n[e].push(t,r),n[t].push(r,e),n[r].push(e,t)},a.opposite=function(e,t){for(var r=this.stars[t],n=1,i=r.length;nt[2]?1:0)}function y(e,t,r){if(0!==e.length){if(t)for(var n=0;n=0;--a){var I=t[c=(Q=n[a])[0]],v=I[0],E=I[1],C=e[v],B=e[E];if((C[0]-B[0]||C[1]-B[1])<0){var b=v;v=E,E=b}I[0]=v;var x,w=I[1]=Q[1];for(i&&(x=I[2]);a>0&&n[a-1][0]===c;){var Q,_=(Q=n[--a])[1];i?t.push([w,_,x]):t.push([w,_]),w=_}i?t.push([w,E,x]):t.push([w,E])}return g}(e,t,g,p,r),I=h(e,m);return y(t,I,r),!!I||g.length>0||p.length>0}},3637:function(e,t,r){"use strict";e.exports=function(e,t,r,n){var a=s(t,e),u=s(n,r),g=c(a,u);if(0===o(g))return null;var f=s(e,r),h=c(u,f),d=i(h,g),p=A(a,d);return l(e,p)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),A=r(8987);function c(e,t){return a(n(e[0],t[1]),n(e[1],t[0]))}},3642:function(e){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]}],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:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(e,t,r){"use strict";var n=r(3642),i=r(395);function a(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function o(e){for(var t,r="#",n=0;n<3;++n)r+=("00"+(t=(t=e[n]).toString(16))).substr(t.length);return r}function s(e){return"rgba("+e.join(",")+")"}e.exports=function(e){var t,r,l,A,c,u,g,f,h,d;if(e||(e={}),f=(e.nshades||72)-1,g=e.format||"hex",(u=e.colormap)||(u="jet"),"string"===typeof u){if(u=u.toLowerCase(),!n[u])throw Error(u+" not a supported colorscale");c=n[u]}else{if(!Array.isArray(u))throw Error("unsupported colormap option",u);c=u.slice()}if(c.length>f+1)throw new Error(u+" map requires nshades to be at least size "+c.length);h=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"===typeof e.alpha?[e.alpha,e.alpha]:[1,1],t=c.map((function(e){return Math.round(e.index*f)})),h[0]=Math.min(Math.max(h[0],0),1),h[1]=Math.min(Math.max(h[1],0),1);var p=c.map((function(e,t){var r=c[t].index,n=c[t].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=h[0]+(h[1]-h[0])*r),n})),y=[];for(d=0;d0||l(e,t,a)?-1:1:0===s?A>0||l(e,t,r)?1:-1:i(A-s)}var u=n(e,t,r);return u>0?o>0&&n(e,t,a)>0?1:-1:u<0?o>0||n(e,t,a)>0?1:-1:n(e,t,a)>0||l(e,t,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(e,t,r){var n=a(e[0],-t[0]),i=a(e[1],-t[1]),l=a(r[0],-t[0]),A=a(r[1],-t[1]),c=s(o(n,l),o(i,A));return c[c.length-1]>=0}},8572:function(e){"use strict";e.exports=function(e){return e<0?-1:e>0?1:0}},8507:function(e){e.exports=function(e,n){var i=e.length,a=e.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return e[0]-n[0];case 2:return e[0]+e[1]-n[0]-n[1]||t(e[0],e[1])-t(n[0],n[1]);case 3:var o=e[0]+e[1],s=n[0]+n[1];if(a=o+e[2]-(s+n[2]))return a;var l=t(e[0],e[1]),A=t(n[0],n[1]);return t(l,e[2])-t(A,n[2])||t(l+e[2],o)-t(A+n[2],s);case 4:var c=e[0],u=e[1],g=e[2],f=e[3],h=n[0],d=n[1],p=n[2],y=n[3];return c+u+g+f-(h+d+p+y)||t(c,u,g,f)-t(h,d,p,y,h)||t(c+u,c+g,c+f,u+g,u+f,g+f)-t(h+d,h+p,h+y,d+p,d+y,p+y)||t(c+u+g,c+u+f,c+g+f,u+g+f)-t(h+d+p,h+d+y,h+p+y,d+p+y);default:for(var m=e.slice().sort(r),I=n.slice().sort(r),v=0;ve[r][0]&&(r=n);return tr?[[r],[t]]:[[t]]}},4750:function(e,t,r){"use strict";e.exports=function(e){var t=n(e),r=t.length;if(r<=2)return[];for(var i=new Array(r),a=t[r-1],o=0;o=t[l]&&(s+=1);a[o]=s}}return e}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(e){"use strict";e.exports=function(e,t,r,n,i,a){var o=i-1,s=i*i,l=o*o,A=(1+2*i)*l,c=i*l,u=s*(3-2*i),g=s*o;if(e.length){a||(a=new Array(e.length));for(var f=e.length-1;f>=0;--f)a[f]=A*e[f]+c*t[f]+u*r[f]+g*n[f];return a}return A*e+c*t+u*r+g*n},e.exports.derivative=function(e,t,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,A=3*i*i-2*i;if(e.length){a||(a=new Array(e.length));for(var c=e.length-1;c>=0;--c)a[c]=o*e[c]+s*t[c]+l*r[c]+A*n[c];return a}return o*e+s*t+l*r[c]+A*n}},7642:function(e,t,r){"use strict";var n=r(8954),i=r(1682);function a(e,t){this.point=e,this.index=t}function o(e,t){for(var r=e.point,n=t.point,i=r.length,a=0;a=2)return!1;e[r]=n}return!0})):E.filter((function(e){for(var t=0;t<=s;++t){var r=y[e[t]];if(r<0)return!1;e[t]=r}return!0})),1&s)for(c=0;c>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<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){return!(2146435072&e.exports.hi(t))}},1338:function(e){"use strict";function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a0)return function(e,t){var r,n;for(r=new Array(e),n=0;n=r-1){g=l.length-1;var h=e-t[r-1];for(f=0;f=r-1)for(var c=s.length-1,u=(t[r-1],0);u=0;--r)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),r=this.dimension;if(!(e0;--u)n.push(a(l[u-1],A[u-1],arguments[u])),i.push(0)}},s.push=function(e){var t=this.lastT(),r=this.dimension;if(!(e1e-6?1/s:0;this._time.push(e);for(var g=r;g>0;--g){var f=a(A[g-1],c[g-1],arguments[g]);n.push(f),i.push((f-n[o++])*u)}}},s.set=function(e){var t=this.dimension;if(!(e0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(e){var t=this.lastT(),r=this.dimension;if(!(e<=t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],A=s[1],c=e-t,u=c>1e-6?1/c:0;this._time.push(e);for(var g=r;g>0;--g){var f=arguments[g];n.push(a(l[g-1],A[g-1],n[o++]+f)),i.push(f*u)}}},s.idle=function(e){var t=this.lastT();if(!(e=0;--u)n.push(a(l[u],A[u],n[o]+c*i[o])),i.push(0),o+=1}}},3840:function(e){"use strict";function t(e,t,r,n,i,a){this._color=e,this.key=t,this.value=r,this.left=n,this.right=i,this._count=a}function r(e){return new t(e._color,e.key,e.value,e.left,e.right,e._count)}function n(e,r){return new t(e,r.key,r.value,r.left,r.right,r._count)}function i(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function a(e,t){this._compare=e,this.root=t}e.exports=function(e){return new a(e||f,null)};var o=a.prototype;function s(e,t){var r;return t.left&&(r=s(e,t.left))?r:(r=e(t.key,t.value))||(t.right?s(e,t.right):void 0)}function l(e,t,r,n){if(t(e,n.key)<=0){var i;if(n.left&&(i=l(e,t,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(e,t,r,n.right)}function A(e,t,r,n,i){var a,o=r(e,i.key),s=r(t,i.key);if(o<=0){if(i.left&&(a=A(e,t,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return A(e,t,r,n,i.right)}function c(e,t){this.tree=e,this._stack=t}Object.defineProperty(o,"keys",{get:function(){var e=[];return this.forEach((function(t,r){e.push(t)})),e}}),Object.defineProperty(o,"values",{get:function(){var e=[];return this.forEach((function(t,r){e.push(r)})),e}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(e,r){for(var o=this._compare,s=this.root,l=[],A=[];s;){var c=o(e,s.key);l.push(s),A.push(c),s=c<=0?s.left:s.right}l.push(new t(0,e,r,null,null,1));for(var u=l.length-2;u>=0;--u)s=l[u],A[u]<=0?l[u]=new t(s._color,s.key,s.value,l[u+1],s.right,s._count+1):l[u]=new t(s._color,s.key,s.value,s.left,l[u+1],s._count+1);for(u=l.length-1;u>1;--u){var g=l[u-1];if(s=l[u],1===g._color||1===s._color)break;var f=l[u-2];if(f.left===g)if(g.left===s){if(!(h=f.right)||0!==h._color){f._color=0,f.left=g.right,g._color=1,g.right=f,l[u-2]=g,l[u-1]=s,i(f),i(g),u>=3&&((d=l[u-3]).left===f?d.left=g:d.right=g);break}g._color=1,f.right=n(1,h),f._color=0,u-=1}else{if(!(h=f.right)||0!==h._color){g.right=s.left,f._color=0,f.left=s.right,s._color=1,s.left=g,s.right=f,l[u-2]=s,l[u-1]=g,i(f),i(g),i(s),u>=3&&((d=l[u-3]).left===f?d.left=s:d.right=s);break}g._color=1,f.right=n(1,h),f._color=0,u-=1}else if(g.right===s){if(!(h=f.left)||0!==h._color){f._color=0,f.right=g.left,g._color=1,g.left=f,l[u-2]=g,l[u-1]=s,i(f),i(g),u>=3&&((d=l[u-3]).right===f?d.right=g:d.left=g);break}g._color=1,f.left=n(1,h),f._color=0,u-=1}else{var h;if(!(h=f.left)||0!==h._color){var d;g.left=s.right,f._color=0,f.right=s.left,s._color=1,s.right=g,s.left=f,l[u-2]=s,l[u-1]=g,i(f),i(g),i(s),u>=3&&((d=l[u-3]).right===f?d.right=s:d.left=s);break}g._color=1,f.left=n(1,h),f._color=0,u-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(e,t,r){if(this.root)switch(arguments.length){case 1:return s(e,this.root);case 2:return l(t,this._compare,e,this.root);case 3:if(this._compare(t,r)>=0)return;return A(t,r,this._compare,e,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new c(this,e)}}),Object.defineProperty(o,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new c(this,e)}}),o.at=function(e){if(e<0)return new c(this,[]);for(var t=this.root,r=[];;){if(r.push(t),t.left){if(e=t.right._count)break;t=t.right}return new c(this,[])},o.ge=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.gt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.lt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.le=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.find=function(e){for(var t=this._compare,r=this.root,n=[];r;){var i=t(e,r.key);if(n.push(r),0===i)return new c(this,n);r=i<=0?r.left:r.right}return new c(this,[])},o.remove=function(e){var t=this.find(e);return t?t.remove():this},o.get=function(e){for(var t=this._compare,r=this.root;r;){var n=t(e,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var u=c.prototype;function g(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function f(e,t){return et?1:0}Object.defineProperty(u,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(u,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),u.clone=function(){return new c(this.tree,this._stack.slice())},u.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var o=new Array(e.length),s=e[e.length-1];o[o.length-1]=new t(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=e.length-2;l>=0;--l)(s=e[l]).left===e[l+1]?o[l]=new t(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var A=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var c=o[A-1];for(o.push(new t(s._color,c.key,c.value,s.left,s.right,s._count)),o[A-1].key=s.key,o[A-1].value=s.value,l=o.length-2;l>=A;--l)s=o[l],o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);o[A-1].left=o[A]}if(0===(s=o[o.length-1])._color){var u=o[o.length-2];for(u.left===s?u.left=null:u.right===s&&(u.right=null),o.pop(),l=0;l=0;--l){if(t=e[l],0===l)return void(t._color=1);if((a=e[l-1]).left===t){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,t._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((A=e[l-2]).left===a?A.left=o:A.right=o),void(e[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((A=e[l-2]).left===a?A.left=s:A.right=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((A=e[l-2]).left===a?A.left=o:A.right=o),e[l-1]=o,e[l]=a,l+11&&((A=e[l-2]).right===a?A.right=o:A.left=o),void(e[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((A=e[l-2]).right===a?A.right=s:A.left=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var A;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((A=e[l-2]).right===a?A.right=o:A.left=o),e[l-1]=o,e[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(u,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(u,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var r=this.tree.root;return r?r._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var n=t.length-2;n>=0;--n)t[n+1]===t[n].right&&(++e,t[n].left&&(e+=t[n].left._count));return e},enumerable:!0}),u.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(u,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),u.update=function(e){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new t(i._color,i.key,e,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new t(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new t(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},u.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(u,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},3837:function(e,t,r){"use strict";e.exports=function(e,t){var r=new c(e);return r.update(t),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function A(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function c(e){this.gl=e,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.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],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","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],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=a(e)}var u=c.prototype;function g(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}u.update=function(e){function t(t,r,n){if(n in e){var i,a=e[n],o=this[n];(t?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}e=e||{};var r,a=t.bind(this,!1,Number),o=t.bind(this,!1,Boolean),l=t.bind(this,!1,String),A=t.bind(this,!0,(function(e){if(Array.isArray(e)){if(3===e.length)return[+e[0],+e[1],+e[2],1];if(4===e.length)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]})),c=!1,u=!1;if("bounds"in e)for(var g=e.bounds,f=0;f<2;++f)for(var h=0;h<3;++h)g[f][h]!==this.bounds[f][h]&&(u=!0),this.bounds[f][h]=g[f][h];if("ticks"in e)for(r=e.ticks,c=!0,this.autoTicks=!1,f=0;f<3;++f)this.tickSpacing[f]=0;else a("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in e||"tickSpacing"in e||(this.autoTicks=!0),u=!0,c=!0,this._firstInit=!1),u&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),c=!0),c){for(f=0;f<3;++f)r[f].sort((function(e,t){return e.x-t.x}));s.equal(r,this.ticks)?c=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(c=!0),l("tickFontStyle")&&(c=!0),l("tickFontWeight")&&(c=!0),l("tickFontVariant")&&(c=!0),a("tickSize"),a("tickAngle"),a("tickPad"),A("tickColor");var d=l("labels");l("labelFont")&&(d=!0),l("labelFontStyle")&&(d=!0),l("labelFontWeight")&&(d=!0),l("labelFontVariant")&&(d=!0),o("labelEnable"),a("labelSize"),a("labelPad"),A("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),A("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),A("lineTickColor"),o("gridEnable"),a("gridWidth"),A("gridColor"),o("zeroEnable"),A("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),A("backgroundColor");var p=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],y=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(d||c)&&this._text.update(this.bounds,this.labels,p,this.ticks,y):this._text=n(this.gl,this.bounds,this.labels,p,this.ticks,y),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var f=[new g,new g,new g];function h(e,t,r,n,i){for(var a=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,l=e.mirrorMinor,A=n[t],c=0;c<3;++c)if(t!==c){var u=a,g=s,f=o,h=l;A&1<0?(f[c]=-1,h[c]=0):(f[c]=0,h[c]=1)}}var d=[0,0,0],p={model:l,view:l,projection:l,_ortho:!1};u.isOpaque=function(){return!0},u.isTransparent=function(){return!1},u.drawTransparent=function(e){};var y=[0,0,0],m=[0,0,0],I=[0,0,0];u.draw=function(e){e=e||p;for(var t=this.gl,r=e.model||l,n=e.view||l,i=e.projection||l,a=this.bounds,s=e._ortho||!1,c=o(r,n,i,a,s),u=c.cubeEdges,g=c.axis,v=n[12],E=n[13],C=n[14],B=n[15],b=(s?2:1)*this.pixelRatio*(i[3]*v+i[7]*E+i[11]*C+i[15]*B)/t.drawingBufferHeight,x=0;x<3;++x)this.lastCubeProps.cubeEdges[x]=u[x],this.lastCubeProps.axis[x]=g[x];var w=f;for(x=0;x<3;++x)h(f[x],x,this.bounds,u,g);t=this.gl;var Q,_,S,k=d;for(x=0;x<3;++x)this.backgroundEnable[x]?k[x]=g[x]:k[x]=0;for(this._background.draw(r,n,i,a,k,this.backgroundColor),this._lines.bind(r,n,i,this),x=0;x<3;++x){var D=[0,0,0];g[x]>0?D[x]=a[1][x]:D[x]=a[0][x];for(var T=0;T<2;++T){var M=(x+1+T)%3,R=(x+1+(1^T))%3;this.gridEnable[M]&&this._lines.drawGrid(M,R,this.bounds,D,this.gridColor[M],this.gridWidth[M]*this.pixelRatio)}for(T=0;T<2;++T)M=(x+1+T)%3,R=(x+1+(1^T))%3,this.zeroEnable[R]&&Math.min(a[0][R],a[1][R])<=0&&Math.max(a[0][R],a[1][R])>=0&&this._lines.drawZero(M,R,this.bounds,D,this.zeroLineColor[R],this.zeroLineWidth[R]*this.pixelRatio)}for(x=0;x<3;++x){this.lineEnable[x]&&this._lines.drawAxisLine(x,this.bounds,w[x].primalOffset,this.lineColor[x],this.lineWidth[x]*this.pixelRatio),this.lineMirror[x]&&this._lines.drawAxisLine(x,this.bounds,w[x].mirrorOffset,this.lineColor[x],this.lineWidth[x]*this.pixelRatio);var L=A(y,w[x].primalMinor),N=A(m,w[x].mirrorMinor),F=this.lineTickLength;for(T=0;T<3;++T){var O=b/r[5*T];L[T]*=F[T]*O,N[T]*=F[T]*O}this.lineTickEnable[x]&&this._lines.drawAxisTicks(x,w[x].primalOffset,L,this.lineTickColor[x],this.lineTickWidth[x]*this.pixelRatio),this.lineTickMirror[x]&&this._lines.drawAxisTicks(x,w[x].mirrorOffset,N,this.lineTickColor[x],this.lineTickWidth[x]*this.pixelRatio)}function P(e){(S=[0,0,0])[e]=1}function G(e,t,r){var n=(e+1)%3,i=(e+2)%3,a=t[n],o=t[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?P(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&P(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),x=0;x<3;++x){var U=w[x].primalMinor,z=w[x].mirrorMinor,q=A(I,w[x].primalOffset);for(T=0;T<3;++T)this.lineTickEnable[x]&&(q[T]+=b*U[T]*Math.max(this.lineTickLength[T],0)/r[5*T]);var H=[0,0,0];if(H[x]=1,this.tickEnable[x]){for(-3600===this.tickAngle[x]?(this.tickAngle[x]=0,this.tickAlign[x]="auto"):this.tickAlign[x]=-1,_=1,"auto"===(Q=[this.tickAlign[x],.5,_])[0]?Q[0]=0:Q[0]=parseInt(""+Q[0]),S=[0,0,0],G(x,U,z),T=0;T<3;++T)q[T]+=b*U[T]*this.tickPad[T]/r[5*T];this._text.drawTicks(x,this.tickSize[x],this.tickAngle[x],q,this.tickColor[x],H,S,Q)}if(this.labelEnable[x]){for(_=0,S=[0,0,0],this.labels[x].length>4&&(P(x),_=1),"auto"===(Q=[this.labelAlign[x],.5,_])[0]?Q[0]=0:Q[0]=parseInt(""+Q[0]),T=0;T<3;++T)q[T]+=b*U[T]*this.labelPad[T]/r[5*T];q[x]+=.5*(a[0][x]+a[1][x]),this._text.drawLabel(x,this.labelSize[x],this.labelAngle[x],q,this.labelColor[x],[0,0,0],S,Q)}}this._text.unbind()},u.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(e,t,r){"use strict";e.exports=function(e){for(var t=[],r=[],s=0,l=0;l<3;++l)for(var A=(l+1)%3,c=(l+2)%3,u=[0,0,0],g=[0,0,0],f=-1;f<=1;f+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),u[l]=f,g[l]=f;for(var h=-1;h<=1;h+=2){u[A]=h;for(var d=-1;d<=1;d+=2)u[c]=d,t.push(u[0],u[1],u[2],g[0],g[1],g[2]),s+=1}var p=A;A=c,c=p}var y=n(e,new Float32Array(t)),m=n(e,new Uint16Array(r),e.ELEMENT_ARRAY_BUFFER),I=i(e,[{buffer:y,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:e.FLOAT,size:3,offset:12,stride:24}],m),v=a(e);return v.attributes.position.location=0,v.attributes.normal.location=1,new o(e,y,I,v)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(e,t,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(e,t,r){"use strict";e.exports=function(e,t,r,a,f){i(s,t,e),i(s,r,s);for(var m=0,I=0;I<2;++I){c[2]=a[I][2];for(var v=0;v<2;++v){c[1]=a[v][1];for(var E=0;E<2;++E)c[0]=a[E][0],g(l[m],c,s),m+=1}}var C=-1;for(I=0;I<8;++I){for(var B=l[I][3],b=0;b<3;++b)A[I][b]=l[I][b]/B;f&&(A[I][2]*=-1),B<0&&(C<0||A[I][2]_&&(C|=1<_&&(C|=1<A[I][1])&&(N=I);var F=-1;for(I=0;I<3;++I)(P=N^1<A[O][0]&&(O=P))}var G=d;G[0]=G[1]=G[2]=0,G[n.log2(F^N)]=N&F,G[n.log2(N^O)]=N&O;var U=7^O;U===C||U===L?(U=7^F,G[n.log2(O^U)]=U&O):G[n.log2(F^U)]=U&F;var z=p,q=C;for(x=0;x<3;++x)z[x]=q&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);t.Q=function(e){return i(e,s,l,null,[{name:"position",type:"vec3"}])};var A=n(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp 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}"]);t.bg=function(e){return i(e,A,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){"use strict";e.exports=function(e,t,r,n,o,l){var A=i(e),u=a(e,[{buffer:A,size:3}]),g=s(e);g.attributes.position.location=0;var f=new c(e,g,A,u);return f.update(t,r,n,o,l),f};var i=r(2762),a=r(8116),o=r(4359),s=r(1879).Q,l=window||n.global||{},A=l.__TEXT_CACHE||{};function c(e,t,r,n){this.gl=e,this.shader=t,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}l.__TEXT_CACHE={};var u=c.prototype,g=[0,0];u.bind=function(e,t,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=e,i.view=t,i.projection=r,i.pixelScale=n,g[0]=this.gl.drawingBufferWidth,g[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=g},u.unbind=function(){this.vao.unbind()},u.update=function(e,t,r,n,i){var a=[];function s(e,t,r,n,i,s){var l=[r.style,r.weight,r.variant,r.family].join("_"),c=A[l];c||(c=A[l]={});var u=c[t];u||(u=c[t]=function(e,t){try{return o(e,t)}catch(r){return console.warn('error vectorizing text:"'+e+'" error:',r),{cells:[],positions:[]}}}(t,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var g=(n||12)/12,f=u.positions,h=u.cells,d=0,p=h.length;d=0;--m){var I=f[y[m]];a.push(g*I[0],-g*I[1],e)}}for(var l=[0,0,0],c=[0,0,0],u=[0,0,0],g=[0,0,0],f={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},h=0;h<3;++h){u[h]=a.length/3|0,s(.5*(e[0][h]+e[1][h]),t[h],r[h],12,1.25,f),g[h]=(a.length/3|0)-u[h],l[h]=a.length/3|0;for(var d=0;d=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(e*t*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,A=o%a;o<0?(l=0|-Math.ceil(l),A=0|-A):(l=0|Math.floor(l),A|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var u=""+A;u.length=e[0][i];--o)a.push({x:o*t[i],text:r(t[i],o)});n.push(a)}return n},t.equal=function(e,t){for(var r=0;r<3;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return e.bufferSubData(t,a,i),r}function c(e,t){for(var r=n.malloc(e.length,t),i=e.length,a=0;a=0;--n){if(t[n]!==r)return!1;r*=e[n]}return!0}(e.shape,e.stride))0===e.offset&&e.data.length===e.shape[0]?this.length=A(this.gl,this.type,this.length,this.usage,e.data,t):this.length=A(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var s=n.malloc(e.size,r),l=a(s,e.shape);i.assign(l,e),this.length=A(this.gl,this.type,this.length,this.usage,t<0?s:s.subarray(0,e.size),t),n.free(s)}}else if(Array.isArray(e)){var u;u=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(e,"uint16"):c(e,"float32"),this.length=A(this.gl,this.type,this.length,this.usage,t<0?u:u.subarray(0,e.length),t),n.free(u)}else if("object"===typeof e&&"number"===typeof e.length)this.length=A(this.gl,this.type,this.length,this.usage,e,t);else{if("number"!==typeof e&&void 0!==e)throw new Error("gl-buffer: Invalid data type");if(t>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(e|=0)<=0&&(e=1),this.gl.bufferData(this.type,0|e,this.usage),this.length=e}},e.exports=function(e,t,r,n){if(r=r||e.ARRAY_BUFFER,n=n||e.DYNAMIC_DRAW,r!==e.ARRAY_BUFFER&&r!==e.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(n!==e.DYNAMIC_DRAW&&n!==e.STATIC_DRAW&&n!==e.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 i=e.createBuffer(),a=new s(e,r,i,0,n);return a.update(t),a}},6405:function(e,t,r){"use strict";var n=r(2931);e.exports=function(e,t){var r=e.positions,i=e.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(0===e.positions.length)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,A=1/0,c=-1/0,u=1/0,g=-1/0,f=null,h=null,d=[],p=1/0,y=!1,m="raw"===e.coneSizemode,I=0;Io&&(o=n.length(E)),I&&!m){var C=2*n.distance(f,v)/(n.length(h)+n.length(E));C?(p=Math.min(p,C),y=!1):y=!0}y||(f=v,h=E),d.push(E)}var B=[s,A,u],b=[l,c,g];t&&(t[0]=B,t[1]=b),0===o&&(o=1);var x=1/o;isFinite(p)||(p=1),a.vectorScale=p;var w=e.coneSize||(m?1:.5);e.absoluteConeSize&&(w=e.absoluteConeSize*x),a.coneScale=w,I=0;for(var Q=0;I=1},f.isTransparent=function(){return this.opacity<1},f.pickSlots=1,f.setPickBase=function(e){this.pickId=e},f.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"lightPosition"in e&&(this.lightPosition=e.lightPosition),"opacity"in e&&(this.opacity=e.opacity),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),void 0!==e.tubeScale&&(this.tubeScale=e.tubeScale),void 0!==e.vectorScale&&(this.vectorScale=e.vectorScale),void 0!==e.coneScale&&(this.coneScale=e.coneScale),void 0!==e.coneOffset&&(this.coneOffset=e.coneOffset),e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e){for(var t=c({colormap:e,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=t[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return A(r,[256,256,4],[4,0,1])}(e.colormap)),this.texture.generateMipmap());var r=e.cells,n=e.positions,i=e.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],u=[];this.cells=r,this.positions=n,this.vectors=i;var g=e.meshColor||[1,1,1,1],f=e.vertexIntensity,h=1/0,d=-1/0;if(f)if(e.vertexIntensityBounds)h=+e.vertexIntensityBounds[0],d=+e.vertexIntensityBounds[1];else for(var p=0;p0){var d=this.triShader;d.bind(),d.uniforms=A,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},f.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||u,n=e.view||u,i=e.projection||u,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},f.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=t),i},f.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(e,t,r){var s=r.shaders;1===arguments.length&&(e=(t=e).gl);var l=function(e,t){var r=n(e,t.meshShader.vertex,t.meshShader.fragment,null,t.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(e,s),c=function(e,t){var r=n(e,t.pickShader.vertex,t.pickShader.fragment,null,t.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(e,s),u=o(e,A(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=e.LINEAR_MIPMAP_LINEAR,u.magFilter=e.LINEAR;var f=i(e),h=i(e),d=i(e),p=i(e),y=i(e),m=new g(e,u,l,c,f,h,y,d,p,a(e,[{buffer:f,type:e.FLOAT,size:4},{buffer:y,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:d,type:e.FLOAT,size:4},{buffer:p,type:e.FLOAT,size:2},{buffer:h,type:e.FLOAT,size:4}]),r.traceType||"cone");return m.update(t),m}},614:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(e){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"}},5171:function(e,t,r){var n=r(737);e.exports=function(e){return n[e]}},9165:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl,r=n(t),o=i(t,[{buffer:r,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:t.FLOAT,size:3,offset:28,stride:40}]),l=a(t);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var A=new s(t,r,o,l);return A.update(e),A};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.shader=n,this.buffer=t,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,this.hasAlpha=!1}var l=s.prototype;function A(e,t){for(var r=0;r<3;++r)e[0][r]=Math.min(e[0][r],t[r]),e[1][r]=Math.max(e[1][r],t[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(e){var t=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=e.view||o,i=r.projection=e.projection||o;r.model=e.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],A=n[15],c=(e._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*A)/t.drawingBufferHeight;this.vao.bind();for(var u=0;u<3;++u)t.lineWidth(this.lineWidth[u]*this.pixelRatio),r.capSize=this.capSize[u]*c,this.lineCount[u]&&t.drawArrays(t.LINES,this.lineOffset[u],this.lineCount[u]);this.vao.unbind()};var c=function(){for(var e=new Array(3),t=0;t<3;++t){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+t)%3]=i,r.push(a)}e[t]=r}return e}();function u(e,t,r,n){for(var i=c[n],a=0;a0&&((f=c.slice())[s]+=h[1][s],i.push(c[0],c[1],c[2],d[0],d[1],d[2],d[3],0,0,0,f[0],f[1],f[2],d[0],d[1],d[2],d[3],0,0,0),A(this.bounds,f),o+=2+u(i,f,d,s))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(e,t,r){"use strict";var n=r(3236),i=r(9405),a=n(["precision highp 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=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){"use strict";var n=r(7766);e.exports=function(e,t,r,n){i||(i=e.FRAMEBUFFER_UNSUPPORTED,a=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var A=e.getExtension("WEBGL_draw_buffers");if(!l&&A&&function(e,t){var r=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;ac||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var u=1;if("color"in(n=n||{})){if((u=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(u>1){if(!A)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(u>e.getParameter(A.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+u+" draw buffers")}}var g=e.UNSIGNED_BYTE,f=e.getExtension("OES_texture_float");if(n.float&&u>0){if(!f)throw new Error("gl-fbo: Context does not support floating point textures");g=e.FLOAT}else n.preferFloat&&u>0&&f&&(g=e.FLOAT);var d=!0;"depth"in n&&(d=!!n.depth);var p=!1;return"stencil"in n&&(p=!!n.stencil),new h(e,t,r,g,u,d,p,A)};var i,a,o,s,l=null;function A(e){return[e.getParameter(e.FRAMEBUFFER_BINDING),e.getParameter(e.RENDERBUFFER_BINDING),e.getParameter(e.TEXTURE_BINDING_2D)]}function c(e,t){e.bindFramebuffer(e.FRAMEBUFFER,t[0]),e.bindRenderbuffer(e.RENDERBUFFER,t[1]),e.bindTexture(e.TEXTURE_2D,t[2])}function u(e){switch(e){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function g(e,t,r,i,a,o){if(!i)return null;var s=n(e,t,r,a,i);return s.magFilter=e.NEAREST,s.minFilter=e.NEAREST,s.mipSamples=1,s.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,o,e.TEXTURE_2D,s.handle,0),s}function f(e,t,r,n,i){var a=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,a),e.renderbufferStorage(e.RENDERBUFFER,n,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,a),a}function h(e,t,r,n,i,a,o,s){this.gl=e,this._shape=[0|t,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var h=0;h1&&s.drawBuffersWEBGL(l[o]);var m=r.getExtension("WEBGL_depth_texture");m?h?e.depth=g(r,i,a,m.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):d&&(e.depth=g(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):d&&h?e._depth_rb=f(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):d?e._depth_rb=f(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):h&&(e._depth_rb=f(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var I=r.checkFramebufferStatus(r.FRAMEBUFFER);if(I!==r.FRAMEBUFFER_COMPLETE){for(e._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(e.handle),e.handle=null,e.depth&&(e.depth.dispose(),e.depth=null),e._depth_rb&&(r.deleteRenderbuffer(e._depth_rb),e._depth_rb=null),y=0;yi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");e._shape[0]=t,e._shape[1]=r;for(var a=A(n),o=0;o>8*f&255;this.pickOffset=r,i.bind();var h=i.uniforms;h.viewTransform=e,h.pickOffset=t,h.shape=this.shape;var d=i.attributes;return this.positionBuffer.bind(),d.position.pointer(),this.weightBuffer.bind(),d.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),d.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),c.pick=function(e,t,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},c.update=function(e){var t=(e=e||{}).shape||[0,0],r=e.x||i(t[0]),o=e.y||i(t[1]),s=e.z||new Float32Array(t[0]*t[1]),l=!1!==e.zsmooth;this.xData=r,this.yData=o;var A,c,g,f,h=e.colorLevels||[0],d=e.colorValues||[0,0,0,1],p=h.length,y=this.bounds;l?(A=y[0]=r[0],c=y[1]=o[0],g=y[2]=r[r.length-1],f=y[3]=o[o.length-1]):(A=y[0]=r[0]+(r[1]-r[0])/2,c=y[1]=o[0]+(o[1]-o[0])/2,g=y[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,f=y[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var m=1/(g-A),I=1/(f-c),v=t[0],E=t[1];this.shape=[v,E];var C=(l?(v-1)*(E-1):v*E)*(u.length>>>1);this.numVertices=C;for(var B=a.mallocUint8(4*C),b=a.mallocFloat32(2*C),x=a.mallocUint8(2*C),w=a.mallocUint32(C),Q=0,_=l?v-1:v,S=l?E-1:E,k=0;k max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\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"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n 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 vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n 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 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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(e){return i(e,a,o,null,l)},t.createPickShader=function(e){return i(e,a,s,null,l)}},5714:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl||e.scene&&e.scene.gl,r=u(t);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 o=g(t);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(t),l=i(t,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=A(new Array(1024),[256,1,4]),f=0;f<1024;++f)c.data[f]=255;var h=a(t,c);h.wrap=t.REPEAT;var d=new y(t,r,o,s,l,h);return d.update(e),d};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),A=r(9618),c=r(7319),u=c.createShader,g=c.createPickShader,f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(e,t){for(var r=0,n=0;n<3;++n){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)}function d(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)t[0][r]=Math.max(e[0][r],t[0][r]),t[1][r]=Math.min(e[1][r],t[1][r]);return t}function p(e,t,r,n){this.arcLength=e,this.position=t,this.index=r,this.dataCoordinate=n}function y(e,t,r,n,i,a){this.gl=e,this.shader=t,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var m=y.prototype;m.isTransparent=function(){return this.hasAlpha},m.isOpaque=function(){return!this.hasAlpha},m.pickSlots=1,m.setPickBase=function(e){this.pickId=e},m.drawTransparent=m.draw=function(e){if(this.vertexCount){var t=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:e.model||f,view:e.view||f,projection:e.projection||f,clipBounds:d(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.drawPick=function(e){if(this.vertexCount){var t=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:e.model||f,view:e.view||f,projection:e.projection||f,pickId:this.pickId,clipBounds:d(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.update=function(e){var t,r;this.dirty=!0;var n=!!e.connectGaps;"dashScale"in e&&(this.dashScale=e.dashScale),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,c=0,u=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=e.position||e.positions;if(g){var f=e.color||e.colors||[0,0,0,1],d=e.lineWidth||1,p=!1;e:for(t=1;t0){for(var C=0;C<24;++C)i.push(i[i.length-12]);c+=2,p=!0}continue e}u[0][r]=Math.min(u[0][r],v[r],E[r]),u[1][r]=Math.max(u[1][r],v[r],E[r])}Array.isArray(f[0])?(y=f.length>t-1?f[t-1]:f.length>0?f[f.length-1]:[0,0,0,1],m=f.length>t?f[t]:f.length>0?f[f.length-1]:[0,0,0,1]):y=m=f,3===y.length&&(y=[y[0],y[1],y[2],1]),3===m.length&&(m=[m[0],m[1],m[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),I=Array.isArray(d)?d.length>t-1?d[t-1]:d.length>0?d[d.length-1]:[0,0,0,1]:d;var B=s;if(s+=h(v,E),p){for(r=0;r<2;++r)i.push(v[0],v[1],v[2],E[0],E[1],E[2],B,I,y[0],y[1],y[2],y[3]);c+=2,p=!1}i.push(v[0],v[1],v[2],E[0],E[1],E[2],B,I,y[0],y[1],y[2],y[3],v[0],v[1],v[2],E[0],E[1],E[2],B,-I,y[0],y[1],y[2],y[3],E[0],E[1],E[2],v[0],v[1],v[2],s,-I,m[0],m[1],m[2],m[3],E[0],E[1],E[2],v[0],v[1],v[2],s,I,m[0],m[1],m[2],m[3]),c+=4}}if(this.buffer.update(i),a.push(s),o.push(g[g.length-1].slice()),this.bounds=u,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in e){var b=e.dashes.slice();for(b.unshift(0),t=1;t1.0001)return null;y+=p[u]}return Math.abs(y-1)>.001?null:[g,s(e,p),p]}},840:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]),o=n(["precision highp 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}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,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}"]),A=n(["precision highp 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}"]),c=n(["precision highp 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}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),g=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]),f=n(["precision highp 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}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:l,fragment:A,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:c,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:g,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:f,fragment:h,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){"use strict";var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),A=r(7608),c=r(9618),u=r(6729),g=r(7765),f=r(1888),h=r(840),d=r(7626),p=h.meshShader,y=h.wireShader,m=h.pointShader,I=h.pickShader,v=h.pointPickShader,E=h.contourShader,C=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function B(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,B,b,x,w,Q){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=g,this.triangleUVs=u,this.triangleIds=A,this.triangleVAO=f,this.triangleCount=0,this.lineWidth=1,this.edgePositions=h,this.edgeColors=p,this.edgeUVs=y,this.edgeIds=d,this.edgeVAO=m,this.edgeCount=0,this.pointPositions=I,this.pointColors=E,this.pointUVs=B,this.pointSizes=b,this.pointIds=v,this.pointVAO=x,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=w,this.contourVAO=Q,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!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.hasAlpha=!1,this.opacityscale=!1,this._model=C,this._view=C,this._projection=C,this._resolution=[1,1]}var b=B.prototype;function x(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}function w(e){var t=n(e,m.vertex,m.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.pointSize.location=4,t}function Q(e){var t=n(e,I.vertex,I.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t}function _(e){var t=n(e,v.vertex,v.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t.attributes.pointSize.location=4,t}function S(e){var t=n(e,E.vertex,E.fragment);return t.attributes.position.location=0,t}b.isOpaque=function(){return!this.hasAlpha},b.isTransparent=function(){return this.hasAlpha},b.pickSlots=1,b.setPickBase=function(e){this.pickId=e},b.highlight=function(e){if(e&&this.contourEnable){for(var t=g(this.cells,this.intensity,e.intensity),r=t.cells,n=t.vertexIds,i=t.vertexWeights,a=r.length,o=f.mallocFloat32(6*a),s=0,l=0;l0&&((u=this.triShader).bind(),u.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((u=this.lineShader).bind(),u.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((u=this.pointShader).bind(),u.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((u=this.contourShader).bind(),u.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind())},b.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||C,n=e.view||C,i=e.projection||C,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind())},b.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;for(var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions,i=new Array(r.length),a=0;al[b]&&(a.uniforms.dataAxis=e,a.uniforms.screenOffset=t,a.uniforms.color=p[n],a.uniforms.angle=y[n],A.drawArrays(A.TRIANGLES,l[b],l[x]-l[b]))),m[n]&&B&&(t[1^n]-=w*f*I[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=t,a.uniforms.color=v[n],a.uniforms.angle=E[n],A.drawArrays(A.TRIANGLES,C,B)),t[1^n]=w*c[2+(1^n)]-1,h[n+2]&&(t[1^n]+=w*f*d[n+2],bl[b]&&(a.uniforms.dataAxis=e,a.uniforms.screenOffset=t,a.uniforms.color=p[n+2],a.uniforms.angle=y[n+2],A.drawArrays(A.TRIANGLES,l[b],l[x]-l[b]))),m[n+2]&&B&&(t[1^n]+=w*f*I[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=t,a.uniforms.color=v[n+2],a.uniforms.angle=E[n+2],A.drawArrays(A.TRIANGLES,C,B))}}(),A.drawTitle=function(){var e=[0,0],t=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,A=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)t[c]=2*(o[c]*A-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=e,n.uniforms.screenOffset=t,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),A.bind=function(){var e=[0,0],t=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var A=0;A<2;++A){var c=a[A],u=a[A+2]-c,g=.5*(o[A+2]+o[A]),f=o[A+2]-o[A],h=l[A],d=l[A+2]-h,p=s[A],y=s[A+2]-p;t[A]=2*u/f*d/y,e[A]=2*(c-g)/f*d/y}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=t,i.uniforms.dataShift=e,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),A.update=function(e){var t,r,n,i,o,s=[],l=e.ticks,A=e.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],u=[-1/0],g=l[o];for(t=0;t=0){var d=t[h]-n[h]*(t[h+2]-t[h])/(n[h+2]-n[h]);0===h?o.drawLine(d,t[1],d,t[3],f[h],g[h]):o.drawLine(t[0],d,t[2],d,f[h],g[h])}}for(h=0;h=0;--e)this.objects[e].dispose();for(this.objects.length=0,e=this.overlays.length-1;e>=0;--e)this.overlays[e].dispose();this.overlays.length=0,this.gl=null},A.addObject=function(e){this.objects.indexOf(e)<0&&(this.objects.push(e),this.setDirty())},A.removeObject=function(e){for(var t=this.objects,r=0;rMath.abs(t))A.rotate(a,0,0,-e*r*Math.PI*h.rotateSpeed/window.innerWidth);else if(!h._ortho){var o=-h.zoomSpeed*i*t/window.innerHeight*(a-A.lastT())/20;A.pan(a,0,0,u*(Math.exp(o)-1))}}}),!0)},h.enableMouseListeners(),h};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(e,t,r){var n=r(3236),i=r(9405),a=n(["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=n(["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(e){return i(e,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){"use strict";var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),A=r(7169),c=r(351),u=r(4772),g=r(4040),f=r(799),h=r(9216)({tablet:!0,featureDetect:!0});function d(){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 p(e){var t=Math.round(Math.log(Math.abs(e))/Math.log(10));if(t<0){var r=Math.round(Math.pow(10,-t));return Math.ceil(e*r)/r}return t>0?(r=Math.round(Math.pow(10,t)),Math.ceil(e/r)*r):Math.ceil(e)}function y(e){return"boolean"!==typeof e||e}e.exports={createScene:function(e){(e=e||{}).camera=e.camera||{};var t=e.canvas;t||(t=document.createElement("canvas"),e.container?e.container.appendChild(t):document.body.appendChild(t));var r=e.gl;if(r||(e.glOptions&&(h=!!e.glOptions.preserveDrawingBuffer),r=function(e,t){var r=null;try{(r=e.getContext("webgl",t))||(r=e.getContext("experimental-webgl",t))}catch(n){return null}return r}(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:h})),!r)throw new Error("webgl not supported");var m=e.bounds||[[-10,-10,-10],[10,10,10]],I=new d,v=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!h}),E=f(r),C=e.cameraObject&&!0===e.cameraObject._ortho||e.camera.projection&&"orthographic"===e.camera.projection.type||!1,B={eye:e.camera.eye||[2,0,0],center:e.camera.center||[0,0,0],up:e.camera.up||[0,1,0],zoomMin:e.camera.zoomMax||.1,zoomMax:e.camera.zoomMin||100,mode:e.camera.mode||"turntable",_ortho:C},b=e.axes||{},x=i(r,b);x.enable=!b.disable;var w=e.spikes||{},Q=o(r,w),_=[],S=[],k=[],D=[],T=!0,M=!0,R=new Array(16),L=new Array(16),N={view:null,projection:R,model:L,_ortho:!1},F=(M=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),O=e.cameraObject||n(t,B),P={gl:r,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:I,camera:O,axes:x,axesPixels:null,spikes:Q,bounds:m,objects:_,shape:F,aspect:e.aspectRatio||[1,1,1],pickRadius:e.pickRadius||10,zNear:e.zNear||.01,zFar:e.zFar||1e3,fovy:e.fovy||Math.PI/4,clearColor:e.clearColor||[0,0,0,0],autoResize:y(e.autoResize),autoBounds:y(e.autoBounds),autoScale:!!e.autoScale,autoCenter:y(e.autoCenter),clipToBounds:y(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:N,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(e){this.aspect[0]=e.x,this.aspect[1]=e.y,this.aspect[2]=e.z,M=!0},setBounds:function(e,t){this.bounds[0][e]=t.min,this.bounds[1][e]=t.max},setClearColor:function(e){this.clearColor=e},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},G=[r.drawingBufferWidth/P.pixelRatio|0,r.drawingBufferHeight/P.pixelRatio|0];function U(){if(!P._stopped&&P.autoResize){var e=t.parentNode,r=1,n=1;e&&e!==document.body?(r=e.clientWidth,n=e.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*P.pixelRatio),a=0|Math.ceil(n*P.pixelRatio);if(i!==t.width||a!==t.height){t.width=i,t.height=a;var o=t.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",T=!0}}}function z(){for(var e=_.length,t=D.length,n=0;n0&&0===k[t-1];)k.pop(),D.pop().dispose()}function q(){if(P.contextLost)return!0;r.isContextLost()&&(P.contextLost=!0,P.mouseListener.enabled=!1,P.selection.object=null,P.oncontextloss&&P.oncontextloss())}P.autoResize&&U(),window.addEventListener("resize",U),P.update=function(e){P._stopped||(e=e||{},T=!0,M=!0)},P.add=function(e){P._stopped||(e.axes=x,_.push(e),S.push(-1),T=!0,M=!0,z())},P.remove=function(e){if(!P._stopped){var t=_.indexOf(e);t<0||(_.splice(t,1),S.pop(),T=!0,M=!0,z())}},P.dispose=function(){if(!P._stopped&&(P._stopped=!0,window.removeEventListener("resize",U),t.removeEventListener("webglcontextlost",q),P.mouseListener.enabled=!1,!P.contextLost)){x.dispose(),Q.dispose();for(var e=0;e<_.length;++e)_[e].dispose();for(v.dispose(),e=0;eI.distance)continue;for(var A=0;A 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),t.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),t.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},4696:function(e,t,r){"use strict";var n=r(9405),i=r(2762),a=r(1888),o=r(6640);function s(e,t,r,n,i){this.plot=e,this.offsetBuffer=t,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(e,t){var r=e.gl,a=i(r),l=i(r),A=n(r,o.pointVertex,o.pointFragment),c=n(r,o.pickVertex,o.pickFragment),u=new s(e,a,l,A,c);return u.update(t),e.addObject(u),u};var l=s.prototype;l.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},l.update=function(e){var t;function r(t,r){return t in e?e[t]:r}e=e||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=e.positions.length>>>1,i=e.positions instanceof Float32Array,o=e.idToIndex instanceof Int32Array&&e.idToIndex.length>=n,s=e.positions,l=i?s:a.mallocFloat32(s.length),A=o?e.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),t=0;t>>1;for(r=0;r=t[0]&&a<=t[2]&&o>=t[1]&&o<=t[3]&&n++}return n}(this.points,o),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(A,.33333)));e[0]=2/s,e[4]=2/l,e[6]=-2*o[0]/s-1,e[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=e,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=c<5,i.uniforms.pointSize=c,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(t[0]=255&r,t[1]=r>>8&255,t[2]=r>>16&255,t[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=t,this.pickOffset=r);var u=a.getParameter(a.BLEND),g=a.getParameter(a.DITHER);return u&&!this.blend&&a.disable(a.BLEND),g&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),u&&!this.blend&&a.enable(a.BLEND),g&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.pick=function(e,t,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},783:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,A=t[0],c=t[1],u=t[2],g=t[3],f=r[0],h=r[1],d=r[2],p=r[3];return(a=A*f+c*h+u*d+g*p)<0&&(a=-a,f=-f,h=-h,d=-d,p=-p),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),e[0]=s*A+l*f,e[1]=s*c+l*h,e[2]=s*u+l*d,e[3]=s*g+l*p,e}},5964:function(e){"use strict";e.exports=function(e){return e||0===e?e.toString():""}},9366:function(e,t,r){"use strict";var n=r(4359);e.exports=function(e,t,r){var a=[t.style,t.weight,t.variant,t.family].join("_"),o=i[a];if(o||(o=i[a]={}),e in o)return o[e];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:t.family,fontStyle:t.style,fontWeight:t.weight,fontVariant:t.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(e,s);s.triangles=!1;var A,c,u=n(e,s);if(r&&1!==r){for(A=0;A max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),A=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],u={vertex:a,fragment:l,attributes:c},g={vertex:o,fragment:l,attributes:c},f={vertex:s,fragment:l,attributes:c},h={vertex:a,fragment:A,attributes:c},d={vertex:o,fragment:A,attributes:c},p={vertex:s,fragment:A,attributes:c};function y(e,t){var r=n(e,t),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}t.createPerspective=function(e){return y(e,u)},t.createOrtho=function(e){return y(e,g)},t.createProject=function(e){return y(e,f)},t.createPickPerspective=function(e){return y(e,h)},t.createPickOrtho=function(e){return y(e,d)},t.createPickProject=function(e){return y(e,p)}},8418:function(e,t,r){"use strict";var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),A=r(9366),c=r(5964),u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function g(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];return e[0]=t[0]*r+t[4]*n+t[8]*i+t[12]*a,e[1]=t[1]*r+t[5]*n+t[9]*i+t[13]*a,e[2]=t[2]*r+t[6]*n+t[10]*i+t[14]*a,e[3]=t[3]*r+t[7]*n+t[11]*i+t[15]*a,e}function f(e,t,r,n){return g(n,n),g(n,n),g(n,n)}function h(e,t){this.index=e,this.dataCoordinate=this.position=t}function d(e){return!0===e||e>1?1:e}function p(e,t,r,n,i,a,o,s,l,A,c,u){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=A,this.pickOrthoShader=c,this.pickProjectShader=u,this.points=[],this._selectResult=new h(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}e.exports=function(e){var t=e.gl,r=l.createPerspective(t),n=l.createOrtho(t),o=l.createProject(t),s=l.createPickPerspective(t),A=l.createPickOrtho(t),c=l.createPickProject(t),u=i(t),g=i(t),f=i(t),h=i(t),d=a(t,[{buffer:u,size:3,type:t.FLOAT},{buffer:g,size:4,type:t.FLOAT},{buffer:f,size:2,type:t.FLOAT},{buffer:h,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),y=new p(t,r,n,o,u,g,f,h,d,s,A,c);return y.update(e),y};var y=p.prototype;y.pickSlots=1,y.setPickBase=function(e){this.pickId=e},y.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},y.isOpaque=function(){if(!this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&!this.projectHasAlpha)return!0;return!1};var m=[0,0],I=[0,0,0],v=[0,0,0],E=[0,0,0,1],C=[0,0,0,1],B=u.slice(),b=[0,0,0],x=[[0,0,0],[0,0,0]];function w(e){return e[0]=e[1]=e[2]=0,e}function Q(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function _(e,t,r,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[r]=n,e}function S(e,t,r,n){var i,a=t.axesProject,o=t.gl,l=e.uniforms,A=r.model||u,c=r.view||u,g=r.projection||u,h=t.axesBounds,d=function(e){for(var t=x,r=0;r<2;++r)for(var n=0;n<3;++n)t[r][n]=Math.max(Math.min(e[r][n],1e8),-1e8);return t}(t.clipBounds);i=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1],m[0]=2/o.drawingBufferWidth,m[1]=2/o.drawingBufferHeight,e.bind(),l.view=c,l.projection=g,l.screenSize=m,l.highlightId=t.highlightId,l.highlightScale=t.highlightScale,l.clipBounds=d,l.pickGroup=t.pickId/255,l.pixelRatio=n;for(var p=0;p<3;++p)if(a[p]){l.scale=t.projectScale[p],l.opacity=t.projectOpacity[p];for(var y=B,S=0;S<16;++S)y[S]=0;for(S=0;S<4;++S)y[5*S]=1;y[5*p]=0,i[p]<0?y[12+p]=h[0][p]:y[12+p]=h[1][p],s(y,A,y),l.model=y;var k=(p+1)%3,D=(p+2)%3,T=w(I),M=w(v);T[k]=1,M[D]=1;var R=f(0,0,0,Q(E,T)),L=f(0,0,0,Q(C,M));if(Math.abs(R[1])>Math.abs(L[1])){var N=R;R=L,L=N,N=T,T=M,M=N;var F=k;k=D,D=F}R[0]<0&&(T[k]=-1),L[1]>0&&(M[D]=-1);var O=0,P=0;for(S=0;S<4;++S)O+=Math.pow(A[4*k+S],2),P+=Math.pow(A[4*D+S],2);T[k]/=Math.sqrt(O),M[D]/=Math.sqrt(P),l.axes[0]=T,l.axes[1]=M,l.fragClipBounds[0]=_(b,d[0],p,-1e8),l.fragClipBounds[1]=_(b,d[1],p,1e8),t.vao.bind(),t.vao.draw(o.TRIANGLES,t.vertexCount),t.lineWidth>0&&(o.lineWidth(t.lineWidth*n),t.vao.draw(o.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}var k=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function D(e,t,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&S(t,r,n,i),a===r.hasAlpha||o){e.bind();var l=e.uniforms;l.model=n.model||u,l.view=n.view||u,l.projection=n.projection||u,m[0]=2/s.drawingBufferWidth,m[1]=2/s.drawingBufferHeight,l.screenSize=m,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=k,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function T(e,t,r,i){var a;a=Array.isArray(e)?t=this.pointCount||t<0)return null;var r=this.points[t],n=this._selectResult;n.index=t;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},y.highlight=function(e){if(e){var t=e.index,r=255&t,n=t>>8&255,i=t>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},y.update=function(e){if("perspective"in(e=e||{})&&(this.useOrtho=!e.perspective),"orthographic"in e&&(this.useOrtho=!!e.orthographic),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"project"in e)if(Array.isArray(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if("projectScale"in e)if(Array.isArray(e.projectScale))this.projectScale=e.projectScale.slice();else{var r=+e.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in e){Array.isArray(e.projectOpacity)?this.projectOpacity=e.projectOpacity.slice():(r=+e.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=d(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in e&&(this.opacity=d(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=e.position,l={family:e.font||"normal",style:e.fontStyle||"normal",weight:e.fontWeight||"normal",variant:e.fontVariant||"normal"},A=e.alignment||[0,0];if(2===A.length)i=A[0],a=A[1];else for(i=[],a=[],n=0;n0){var M=0,R=I,L=[0,0,0,1],N=[0,0,0,1],F=Array.isArray(f)&&Array.isArray(f[0]),O=Array.isArray(y)&&Array.isArray(y[0]);e:for(n=0;n0?1-w[0][0]:J<0?1+w[1][0]:1,K*=K>0?1-w[0][1]:K<0?1+w[1][1]:1],V=b.cells||[],W=b.positions||[];for(B=0;B0){var y=r*c;o.drawBox(u-y,g-y,f+y,g+y,a),o.drawBox(u-y,h-y,f+y,h+y,a),o.drawBox(u-y,g-y,u+y,h+y,a),o.drawBox(f-y,g-y,f+y,h+y,a)}}}},s.update=function(e){e=e||{},this.innerFill=!!e.innerFill,this.outerFill=!!e.outerFill,this.innerColor=(e.innerColor||[0,0,0,.5]).slice(),this.outerColor=(e.outerColor||[0,0,0,.5]).slice(),this.borderColor=(e.borderColor||[0,0,0,1]).slice(),this.borderWidth=e.borderWidth||0,this.selectBox=(e.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},3589:function(e,t,r){"use strict";e.exports=function(e,t){var r=t[0],a=t[1],o=n(e,r,a,{}),s=i.mallocUint8(r*a*4);return new l(e,o,s)};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(e,t,r,n,i){this.coord=[e,t],this.id=r,this.value=n,this.distance=i}function l(e,t,r){this.gl=e,this.fbo=t,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(t.bind(),e.readPixels(0,0,t.shape[0],t.shape[1],e.RGBA,e.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var A=l.prototype;Object.defineProperty(A,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(e){if(this.gl){this.fbo.shape=e;var t=this.fbo.shape[0],r=this.fbo.shape[1];if(r*t*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*t*4)),a=0;ar)for(e=r;et)for(e=t;e=0){for(var B=0|C.type.charAt(C.type.length-1),b=new Array(B),x=0;x=0;)w+=1;E[m]=w}var Q=new Array(r.length);function _(){g.program=o.program(f,g._vref,g._fref,v,E);for(var e=0;e=0){if((h=g.charCodeAt(g.length-1)-48)<2||h>4)throw new n("","Invalid data type for attribute "+u+": "+g);s(e,t,f[0],i,h,a,u)}else{if(!(g.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+u+": "+g);var h;if((h=g.charCodeAt(g.length-1)-48)<2||h>4)throw new n("","Invalid data type for attribute "+u+": "+g);l(e,t,f,i,h,a,u)}}}return a};var n=r(8866);function i(e,t,r,n,i,a){this._gl=e,this._wrapper=t,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(e,t,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,e||a.FLOAT,!!t,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(e,t,r,n){return this._constFunc(this._locations[this._index],e,t,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=0|e,this._wrapper.program=null),0|e}});var o=[function(e,t,r){return void 0===r.length?e.vertexAttrib1f(t,r):e.vertexAttrib1fv(t,r)},function(e,t,r,n){return void 0===r.length?e.vertexAttrib2f(t,r,n):e.vertexAttrib2fv(t,r)},function(e,t,r,n,i){return void 0===r.length?e.vertexAttrib3f(t,r,n,i):e.vertexAttrib3fv(t,r)},function(e,t,r,n,i,a){return void 0===r.length?e.vertexAttrib4f(t,r,n,i,a):e.vertexAttrib4fv(t,r)}];function s(e,t,r,n,a,s,l){var A=o[a],c=new i(e,t,r,n,a,A);Object.defineProperty(s,l,{set:function(t){return e.disableVertexAttribArray(n[r]),A(e,n[r],t),t},get:function(){return c},enumerable:!0})}function l(e,t,r,n,i,a,o){for(var l=new Array(i),A=new Array(i),c=0;c4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+m);e["uniformMatrix"+y+"fv"](s[u],!1,g);break}throw new i("","Unknown uniform data type for "+name+": "+m)}if((y=m.charCodeAt(m.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(m.charAt(0)){case"b":case"i":e["uniform"+y+"iv"](s[u],g);break;case"v":e["uniform"+y+"fv"](s[u],g);break;default:throw new i("","Unrecognized data type for vector "+name+": "+m)}}}}}}function A(e,t){if("object"!==typeof t)return[[e,t]];var r=[];for(var n in t){var i=t[n],a=e;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"===typeof i?r.push.apply(r,A(a,i)):r.push([a,i])}return r}function c(e,t,n){if("object"===typeof n){var A=u(n);Object.defineProperty(e,t,{get:a(A),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(e,t,{get:(c=n,function(e,t,r){return e.getUniform(t.program,r[c])}),set:l(n),enumerable:!0,configurable:!1}):e[t]=function(e){switch(e){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var t=e.indexOf("vec");if(0<=t&&t<=1&&e.length===4+t){if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===e.charAt(0)?o(r,!1):o(r,0)}if(0===e.indexOf("mat")&&4===e.length){var r;if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+e);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+e)}}(r[n].type);var c}function u(e){var t;if(Array.isArray(e)){t=new Array(e.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){"use strict";var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(e,t,r,a){for(var o=0,s=0;s0)for(B=0;B<8;B++){var b=(B+1)%8;A.push(g[B],f[B],f[b],f[b],g[b],g[B]),u.push(m,y,y,y,m,m),h.push(d,p,p,p,d,d);var x=A.length;c.push([x-6,x-5,x-4],[x-3,x-2,x-1])}var w=g;g=f,f=w;var Q=m;m=y,y=Q;var _=d;d=p,p=_}return{positions:A,cells:c,vectors:u,vertexIntensity:h}}(e,r,a,o)})),u=[],g=[],f=[],h=[];for(s=0;st)return r-1}return r},l=function(e,t,r){return er?r:e},A=function(e){var t=1/0;e.sort((function(e,t){return e-t}));for(var r=e.length,n=1;nu-1||m>g-1||I>f-1)return n.create();var v,E,C,B,b,x,w=a[0][h],Q=a[0][y],_=a[1][d],S=a[1][m],k=a[2][p],D=(o-w)/(Q-w),T=(A-_)/(S-_),M=(c-k)/(a[2][I]-k);switch(isFinite(D)||(D=.5),isFinite(T)||(T=.5),isFinite(M)||(M=.5),r.reversedX&&(h=u-1-h,y=u-1-y),r.reversedY&&(d=g-1-d,m=g-1-m),r.reversedZ&&(p=f-1-p,I=f-1-I),r.filled){case 5:b=p,x=I,C=d*f,B=m*f,v=h*f*g,E=y*f*g;break;case 4:b=p,x=I,v=h*f,E=y*f,C=d*f*u,B=m*f*u;break;case 3:C=d,B=m,b=p*g,x=I*g,v=h*g*f,E=y*g*f;break;case 2:C=d,B=m,v=h*g,E=y*g,b=p*g*u,x=I*g*u;break;case 1:v=h,E=y,b=p*u,x=I*u,C=d*u*f,B=m*u*f;break;default:v=h,E=y,C=d*u,B=m*u,b=p*u*g,x=I*u*g}var R=i[v+C+b],L=i[v+C+x],N=i[v+B+b],F=i[v+B+x],O=i[E+C+b],P=i[E+C+x],G=i[E+B+b],U=i[E+B+x],z=n.create(),q=n.create(),H=n.create(),Y=n.create();n.lerp(z,R,O,D),n.lerp(q,L,P,D),n.lerp(H,N,G,D),n.lerp(Y,F,U,D);var J=n.create(),K=n.create();n.lerp(J,z,H,T),n.lerp(K,q,Y,T);var j=n.create();return n.lerp(j,J,K,M),j}(t,e,f)},d=e.getDivergence||function(e,t){var r=n.create(),i=1e-4;n.add(r,e,[i,0,0]);var a=h(r);n.subtract(a,a,t),n.scale(a,a,1/i),n.add(r,e,[0,i,0]);var o=h(r);n.subtract(o,o,t),n.scale(o,o,1/i),n.add(r,e,[0,0,i]);var s=h(r);return n.subtract(s,s,t),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},p=[],y=t[0][0],m=t[0][1],I=t[0][2],v=t[1][0],E=t[1][1],C=t[1][2],B=function(e){var t=e[0],r=e[1],n=e[2];return!(tv||rE||nC)},b=10*n.distance(t[0],t[1])/i,x=b*b,w=1,Q=0,_=r.length;_>1&&(w=function(e){for(var t=[],r=[],n=[],i={},a={},o={},s=e.length,l=0;lQ&&(Q=F),L.push(F),p.push({points:D,velocities:T,divergences:L});for(var O=0;O<100*i&&D.lengthx&&n.scale(P,P,b/Math.sqrt(G)),n.add(P,P,k),M=h(P),n.squaredDistance(R,P)-x>-1e-4*x&&(D.push(P),R=P,T.push(M),N=d(P,M),F=n.length(N),isFinite(F)&&F>Q&&(Q=F),L.push(F)),k=P}}var U=o(p,e.colormap,Q,w);return u?U.tubeScale=u:(0===Q&&(Q=1),U.tubeScale=.5*c*w/Q),U};var c=r(6740),u=r(6405).createMesh;e.exports.createTubeMesh=function(e,t){return u(e,t,{shaders:c,traceType:"streamtube"})}},990:function(e,t,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\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 vColor = texture2D(colormap, vec2(value, value));\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=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\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 = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\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"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\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"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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"]);t.createShader=function(e){var t=n(e,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createPickShader=function(e){var t=n(e,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createContourShader=function(e){var t=n(e,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t},t.createPickContourShader=function(e){var t=n(e,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t}},9499:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl,r=m(t),n=v(t),s=I(t),l=E(t),A=i(t),c=a(t,[{buffer:A,size:4,stride:C,offset:0},{buffer:A,size:3,stride:C,offset:16},{buffer:A,size:3,stride:C,offset:28}]),u=i(t),g=a(t,[{buffer:u,size:4,stride:20,offset:0},{buffer:u,size:1,stride:20,offset:16}]),f=i(t),h=a(t,[{buffer:f,size:2,type:t.FLOAT}]),d=o(t,1,Q,t.RGBA,t.UNSIGNED_BYTE);d.minFilter=t.LINEAR,d.magFilter=t.LINEAR;var p=new _(t,[0,0],[[0,0,0],[0,0,0]],r,n,A,c,d,s,l,u,g,f,h,[0,0,0]),y={levels:[[],[],[]]};for(var B in e)y[B]=e[B];return y.colormap=y.colormap||"jet",p.update(y),p};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),A=r(5298),c=r(9994),u=r(9618),g=r(3711),f=r(6760),h=r(7608),d=r(2478),p=r(6199),y=r(990),m=y.createShader,I=y.createContourShader,v=y.createPickShader,E=y.createPickContourShader,C=40,B=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],b=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],x=[[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 w(e,t,r,n,i){this.position=e,this.index=t,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var e=0;e<3;++e){var t=x[e],r=(e+2)%3;t[(e+1)%3+0]=1,t[r+3]=1,t[e+6]=1}}();var Q=256;function _(e,t,r,n,i,a,o,l,A,c,g,f,h,d,p){this.gl=e,this.shape=t,this.bounds=r,this.objectOffset=p,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=A,this._contourPickShader=c,this._contourBuffer=g,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new w([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=h,this._dynamicVAO=d,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=[u(s.mallocFloat(1024),[0,0]),u(s.mallocFloat(1024),[0,0]),u(s.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.pixelRatio=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.vertexColor=0,this.dirty=!0}var S=_.prototype;S.genColormap=function(e,t){var r=!1,n=c([l({colormap:e,nshades:Q,format:"rgba"}).map((function(e,n){var i=t?function(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}(n/255,t):e[3];return i<1&&(r=!0),[e[0],e[1],e[2],255*i]}))]);return A.divseq(n,255),this.hasAlphaScale=r,n},S.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},S.isOpaque=function(){return!this.isTransparent()},S.pickSlots=1,S.setPickBase=function(e){this.pickId=e};var k=[0,0,0],D={showSurface:!1,showContour:!1,projections:[B.slice(),B.slice(),B.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function T(e,t){var r,n,i,a=t.axes&&t.axes.lastCubeProps.axis||k,o=t.showSurface,s=t.showContour;for(r=0;r<3;++r)for(o=o||t.surfaceProject[r],n=0;n<3;++n)s=s||t.contourProject[r][n];for(r=0;r<3;++r){var l=D.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=t.axesBounds[+(a[r]>0)][r],f(l,e.model,l);var A=D.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)A[i][n]=e.clipBounds[i][n];A[0][r]=-1e8,A[1][r]=1e8}return D.showSurface=o,D.showContour=s,D}var M={model:B,view:B,projection:B,inverseModel:B.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},R=B.slice(),L=[1,0,0,0,1,0,0,0,1];function N(e,t){e=e||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=M;n.model=e.model||B,n.view=e.view||B,n.projection=e.projection||B,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.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=h(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-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=L,n.vertexColor=this.vertexColor;var s=R;for(f(s,n.view,n.model),f(s,n.projection,s),h(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var A=s[12+i];for(o=0;o<3;++o)A+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=A/l}var c=T(n,this);if(c.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour){var u=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,u.bind(),u.uniforms=n;var g=this._contourVAO;for(g.bind(),i=0;i<3;++i)for(u.uniforms.permutation=x[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=t[1]*(e.value[1]+(15&e.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var A=r.position;A[0]=A[1]=A[2]=0;for(var c=0;c<2;++c)for(var u=c?a:1-a,g=0;g<2;++g)for(var f=i+c,h=s+g,p=u*(g?l:1-l),y=0;y<3;++y)A[y]+=this._field[y].get(f,h)*p;for(var m=this._pickResult.level,I=0;I<3;++I)if(m[I]=d.le(this.contourLevels[I],A[I]),m[I]<0)this.contourLevels[I].length>0&&(m[I]=0);else if(m[I]Math.abs(E-A[I])&&(m[I]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/t[0],r.uv[1]=o/t[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},S.padField=function(e,t){var r=t.shape.slice(),n=e.shape.slice();A.assign(e.lo(1,1).hi(r[0],r[1]),t),A.assign(e.lo(1).hi(r[0],1),t.hi(r[0],1)),A.assign(e.lo(1,n[1]-1).hi(r[0],1),t.lo(0,r[1]-1).hi(r[0],1)),A.assign(e.lo(0,1).hi(1,r[1]),t.hi(1)),A.assign(e.lo(n[0]-1,1).hi(1,r[1]),t.lo(r[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,n[1]-1,t.get(0,r[1]-1)),e.set(n[0]-1,0,t.get(r[0]-1,0)),e.set(n[0]-1,n[1]-1,t.get(r[0]-1,r[1]-1))},S.update=function(e){e=e||{},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in e&&(this.contourWidth=O(e.contourWidth,Number)),"showContour"in e&&(this.showContour=O(e.showContour,Boolean)),"showSurface"in e&&(this.showSurface=!!e.showSurface),"contourTint"in e&&(this.contourTint=O(e.contourTint,Boolean)),"contourColor"in e&&(this.contourColor=G(e.contourColor)),"contourProject"in e&&(this.contourProject=O(e.contourProject,(function(e){return O(e,Boolean)}))),"surfaceProject"in e&&(this.surfaceProject=e.surfaceProject),"dynamicColor"in e&&(this.dynamicColor=G(e.dynamicColor)),"dynamicTint"in e&&(this.dynamicTint=O(e.dynamicTint,Number)),"dynamicWidth"in e&&(this.dynamicWidth=O(e.dynamicWidth,Number)),"opacity"in e&&(this.opacity=e.opacity),"opacityscale"in e&&(this.opacityscale=e.opacityscale),"colorBounds"in e&&(this.colorBounds=e.colorBounds),"vertexColor"in e&&(this.vertexColor=e.vertexColor?1:0),"colormap"in e&&this._colorMap.setPixels(this.genColormap(e.colormap,this.opacityscale));var t=e.field||e.coords&&e.coords[2]||null,r=!1;if(t||(t=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 e||"coords"in e){var i=(t.shape[0]+2)*(t.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=u(this._field[2].data,[t.shape[0]+2,t.shape[1]+2]),this.padField(this._field[2],t),this.shape=t.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=u(this._field[o].data,[a[0]+2,a[1]+2]);if(e.coords){var l=e.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var A=l[o];for(y=0;y<2;++y)if(A.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],A)}}else if(e.ticks){var c=e.ticks;if(!Array.isArray(c)||2!==c.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var f=c[o];if((Array.isArray(f)||f.length)&&(f=u(f)),f.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var h=u(f.data,a);h.stride[o]=f.stride[0],h.stride[1^o]=0,this.padField(this._field[o],h)}}else{for(o=0;o<2;++o){var d=[0,0];d[o]=1,this._field[o]=u(this._field[o].data,[a[0]+2,a[1]+2],d,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var Ie=0;Ie<5;++Ie)X.pop();U-=1}continue e}X.push(ne[0],ne[1],oe[0],oe[1],ne[2]),U+=1}}re.push(U)}this._contourOffsets[$]=te,this._contourCounts[$]=re}var ve=s.mallocFloat(X.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=h(o,t.stride.slice()),A=0;"float32"===r?A=e.FLOAT:"float64"===r?(A=e.FLOAT,l=!1,r="float32"):"uint8"===r?A=e.UNSIGNED_BYTE:(A=e.UNSIGNED_BYTE,l=!1,r="uint8");var u,f,p=0;if(2===o.length)p=e.LUMINANCE,o=[o[0],o[1],1],t=n(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])p=e.ALPHA;else if(2===o[2])p=e.LUMINANCE_ALPHA;else if(3===o[2])p=e.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");p=e.RGBA}}A!==e.FLOAT||e.getExtension("OES_texture_float")||(A=e.UNSIGNED_BYTE,l=!1);var y=t.size;if(l)u=0===t.offset&&t.data.length===y?t.data:t.data.subarray(t.offset,t.offset+y);else{var m=[o[2],o[2]*o[0],1];f=a.malloc(y,r);var I=n(f,o,m,0);"float32"!==r&&"float64"!==r||A!==e.UNSIGNED_BYTE?i.assign(I,t):c(I,t),u=f.subarray(0,y)}var v=d(e);return e.texImage2D(e.TEXTURE_2D,0,p,o[0],o[1],0,p,A,u),l||a.free(f),new g(e,v,o[0],o[1],p,A)}(e,t)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function A(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&e instanceof ImageData}var c=function(e,t){i.muls(e,t,255)};function u(e,t,r){var n=e.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),n.texImage2D(n.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function g(e,t,r,n,i,a){this.gl=e,this.handle=t,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(e){return o.wrapS=e}},{get:function(){return o._wrapT},set:function(e){return o.wrapT=e}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(e){return o.width=e}},{get:function(){return o._shape[1]},set:function(e){return o.height=e}}]),this._shapeVector=l}var f=g.prototype;function h(e,t){return 3===e.length?1===t[2]&&t[1]===e[0]*e[2]&&t[0]===e[2]:1===t[0]&&t[1]===e[0]}function d(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function p(e,t,r,n,i){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===e.FLOAT&&!e.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=d(e);return e.texImage2D(e.TEXTURE_2D,0,n,t,r,0,n,i,null),new g(e,o,t,r,n,i)}Object.defineProperties(f,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=0|Math.max(e,1),t!==this._anisoSamples){var r=this.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(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),2!==e.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(l.indexOf(e[t])<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[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),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(Array.isArray(e)){if(2!==e.length)throw new Error("gl-texture2d: Invalid texture shape")}else e=[0|e,0|e];return u(this,0|e[0],0|e[1]),[0|e[0],0|e[1]]}},width:{get:function(){return this._shape[0]},set:function(e){return u(this,e|=0,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,u(this,this._shape[0],e),e}}}),f.bind=function(e){var t=this.gl;return void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(t.TEXTURE_2D,this.handle),void 0!==e?0|e:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0},f.dispose=function(){this.gl.deleteTexture(this.handle)},f.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)this._mipLevels.indexOf(t)<0&&this._mipLevels.push(t)},f.setPixels=function(e,t,r,o){var s=this.gl;this.bind(),Array.isArray(t)?(o=r,r=0|t[1],t=0|t[0]):(t=t||0,r=r||0),o=o||0;var l=A(e)?e:e.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,t,r,this.format,this.type,l);else{if(!(e.shape&&e.stride&&e.data))throw new Error("gl-texture2d: Unsupported data type");if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>o||r+e.shape[0]>this._shape[0]>>>o||t<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(e,t,r,o,s,l,A,u){var g=u.dtype,f=u.shape.slice();if(f.length<2||f.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var d=0,p=0,y=h(f,u.stride.slice());if("float32"===g?d=e.FLOAT:"float64"===g?(d=e.FLOAT,y=!1,g="float32"):"uint8"===g?d=e.UNSIGNED_BYTE:(d=e.UNSIGNED_BYTE,y=!1,g="uint8"),2===f.length)p=e.LUMINANCE,f=[f[0],f[1],1],u=n(u.data,f,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==f.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===f[2])p=e.ALPHA;else if(2===f[2])p=e.LUMINANCE_ALPHA;else if(3===f[2])p=e.RGB;else{if(4!==f[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");p=e.RGBA}f[2]}if(p!==e.LUMINANCE&&p!==e.ALPHA||s!==e.LUMINANCE&&s!==e.ALPHA||(p=s),p!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var m=u.size,I=A.indexOf(o)<0;if(I&&A.push(o),d===l&&y)0===u.offset&&u.data.length===m?I?e.texImage2D(e.TEXTURE_2D,o,s,f[0],f[1],0,s,l,u.data):e.texSubImage2D(e.TEXTURE_2D,o,t,r,f[0],f[1],s,l,u.data):I?e.texImage2D(e.TEXTURE_2D,o,s,f[0],f[1],0,s,l,u.data.subarray(u.offset,u.offset+m)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,f[0],f[1],s,l,u.data.subarray(u.offset,u.offset+m));else{var v;v=l===e.FLOAT?a.mallocFloat32(m):a.mallocUint8(m);var E=n(v,f,[f[2],f[2]*f[0],1]);d===e.FLOAT&&l===e.UNSIGNED_BYTE?c(E,u):i.assign(E,u),I?e.texImage2D(e.TEXTURE_2D,o,s,f[0],f[1],0,s,l,v.subarray(0,m)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,f[0],f[1],s,l,v.subarray(0,m)),l===e.FLOAT?a.freeFloat32(v):a.freeUint8(v)}}(s,t,r,o,this.format,this.type,this._mipLevels,e)}}},1433:function(e){"use strict";e.exports=function(e,t,r){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var n=0|e.getParameter(e.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(e){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},3126:function(e){e.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},3990:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},1091:function(e){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},5911:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}},244:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,r){e.exports=function(e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(e){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},2681:function(e){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},5137:function(e,t,r){e.exports=function(e,t,r,i,a,o){var s,l;for(t||(t=3),r||(r=0),l=i?Math.min(i*t+r,e.length):e.length,s=r;s0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e}},7636:function(e){e.exports=function(e,t){t=t||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}},6894:function(e){e.exports=function(e,t,r,n){var i=r[1],a=r[2],o=t[1]-i,s=t[2]-a,l=Math.sin(n),A=Math.cos(n);return e[0]=t[0],e[1]=i+o*A-s*l,e[2]=a+o*l+s*A,e}},109:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[2],o=t[0]-i,s=t[2]-a,l=Math.sin(n),A=Math.cos(n);return e[0]=i+s*l+o*A,e[1]=t[1],e[2]=a+s*A-o*l,e}},8692:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[1],o=t[0]-i,s=t[1]-a,l=Math.sin(n),A=Math.cos(n);return e[0]=i+o*A-s*l,e[1]=a+o*l+s*A,e[2]=t[2],e}},2447:function(e){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},6621:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}},8489:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}},1463:function(e){e.exports=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}},6141:function(e,t,r){e.exports=r(2953)},5486:function(e,t,r){e.exports=r(3066)},2953:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}},3066:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}},492:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}},5673:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}},264:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],A=r[3],c=A*n+s*a-l*i,u=A*i+l*n-o*a,g=A*a+o*i-s*n,f=-o*n-s*i-l*a;return e[0]=c*A+f*-o+u*-l-g*-s,e[1]=u*A+f*-s+g*-o-c*-l,e[2]=g*A+f*-l+c*-s-u*-o,e}},4361:function(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}},2335:function(e){e.exports=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},2933:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},7536:function(e){e.exports=function(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},4691:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}},3750:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},3390:function(e){e.exports=function(e,t,r,n){var i=new Float32Array(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}},9970:function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(e){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}},6808:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}},2573:function(e){e.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}},160:function(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}},2334:function(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}},3576:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}},1498:function(e){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}},5177:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o),e}},9131:function(e,t,r){var n=r(5177),i=r(9288);e.exports=function(e,t){return t=t||1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),n(e,e),i(e,e,t),e}},9288:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}},4844:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}},4578:function(e){e.exports=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}},7960:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a}},483:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}},6860:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}},5352:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}},4041:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],A=r[3],c=A*n+s*a-l*i,u=A*i+l*n-o*a,g=A*a+o*i-s*n,f=-o*n-s*i-l*a;return e[0]=c*A+f*-o+u*-l-g*-s,e[1]=u*A+f*-s+g*-o-c*-l,e[2]=g*A+f*-l+c*-s-u*-o,e[3]=t[3],e}},1848:function(e,t,r){var n=r(4905),i=r(6468);e.exports=function(e){for(var t=Array.isArray(e)?e:n(e),r=0;r0)continue;r=e.slice(0,1).join("")}return P(r),D+=r.length,(Q=Q.slice(r.length)).length}}function K(){return/[^a-fA-F0-9]/.test(t)?(P(Q.join("")),w=l,b):(Q.push(t),r=t,b+1)}function j(){return"."===t||/[eE]/.test(t)?(Q.push(t),w=d,r=t,b+1):"x"===t&&1===Q.length&&"0"===Q[0]?(w=E,Q.push(t),r=t,b+1):/[^\d]/.test(t)?(P(Q.join("")),w=l,b):(Q.push(t),r=t,b+1)}function V(){return"f"===t&&(Q.push(t),r=t,b+=1),/[eE]/.test(t)?(Q.push(t),r=t,b+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(P(Q.join("")),w=l,b):(Q.push(t),r=t,b+1)}function W(){if(/[^\d\w_]/.test(t)){var e=Q.join("");return w=O[e]?m:F[e]?y:p,P(Q.join("")),w=l,b}return Q.push(t),r=t,b+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,A=9999,c=0,u=1,g=2,f=3,h=4,d=5,p=6,y=7,m=8,I=9,v=10,E=11,C=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(e,t,r){var n=r(6852);n=n.slice().filter((function(e){return!/^(gl\_|texture)/.test(e)})),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"])},6852:function(e){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"]},7932:function(e,t,r){var n=r(620);e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","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"])},620:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","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"]},7827:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(e,t,r){var n=r(5874);e.exports=function(e,t){var r=n(t),i=[];return i=(i=i.concat(r(e))).concat(r(null))}},3236:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,u=r?i-1:0,g=r?-1:1,f=e[t+u];for(u+=g,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=g,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+u],u+=g,c-=8);if(0===a)a=1-A;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=A}return(f?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,A=8*a-i-1,c=(1<>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,h=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?g/l:g*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,i),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&s,f+=h,s/=256,i-=8);for(o=o<0;e[r+f]=255&o,f+=h,o/=256,A-=8);e[r+f-h]|=128*d}},8954:function(e,t,r){"use strict";e.exports=function(e,t){var r=e.length;if(0===r)throw new Error("Must have at least d+1 points");var i=e[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=e.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);var u=new a(l,new Array(i+1),!1),g=u.adjacent,f=new Array(i+2);for(c=0;c<=i;++c){for(var h=l.slice(),d=0;d<=i;++d)d===c&&(h[d]=-1);var p=h[0];h[0]=h[1],h[1]=p;var y=new a(h,new Array(i+1),!0);g[c]=y,f[c]=y}for(f[i+1]=u,c=0;c<=i;++c){h=g[c].vertices;var m=g[c].adjacent;for(d=0;d<=i;++d){var I=h[d];if(I<0)m[d]=u;else for(var v=0;v<=i;++v)g[v].vertices.indexOf(I)<0&&(m[d]=g[v])}}var E=new A(i,o,f),C=!!t;for(c=i+1;c0;)for(var s=(e=o.pop()).adjacent,l=0;l<=r;++l){var A=s[l];if(A.boundary&&!(A.lastVisited<=-n)){for(var c=A.vertices,u=0;u<=r;++u){var g=c[u];i[u]=g<0?t:a[g]}var f=this.orient();if(f>0)return A;A.lastVisited=-n,0===f&&o.push(A)}}return null},c.walk=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];e:for(;!s.boundary;){for(var l=s.vertices,A=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];for(s.lastVisited=r,c=0;c<=n;++c){var u=A[c];if(!(u.lastVisited>=r)){var g=a[c];a[c]=e;var f=this.orient();if(a[c]=g,f<0){s=u;continue e}u.boundary?u.lastVisited=-r:u.lastVisited=r}}return}return s},c.addPeaks=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,A=this.interior,c=this.simplices,u=[t];t.lastVisited=r,t.vertices[t.vertices.indexOf(-1)]=r,t.boundary=!1,A.push(t);for(var g=[];u.length>0;){var f=(t=u.pop()).vertices,h=t.adjacent,d=f.indexOf(r);if(!(d<0))for(var p=0;p<=n;++p)if(p!==d){var y=h[p];if(y.boundary&&!(y.lastVisited>=r)){var m=y.vertices;if(y.lastVisited!==-r){for(var I=0,v=0;v<=n;++v)m[v]<0?(I=v,l[v]=e):l[v]=i[m[v]];if(this.orient()>0){m[I]=r,y.boundary=!1,A.push(y),u.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var E=y.adjacent,C=f.slice(),B=h.slice(),b=new a(C,B,!0);c.push(b);var x=E.indexOf(t);if(!(x<0))for(E[x]=b,B[d]=y,C[p]=-1,B[p]=t,h[p]=b,b.flip(),v=0;v<=n;++v){var w=C[v];if(!(w<0||w===r)){for(var Q=new Array(n-1),_=0,S=0;S<=n;++S){var k=C[S];k<0||S===v||(Q[_++]=k)}g.push(new o(Q,b,v))}}}}}for(g.sort(s),p=0;p+1=0?o[l++]=s[c]:A=1&c;if(A===(1&e)){var u=o[0];o[0]=o[1],o[1]=u}t.push(o)}}return t}},3352:function(e,t,r){"use strict";var n=r(2478);function i(e,t,r,n,i){this.mid=e,this.left=t,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(t?t.count:0)+(r?r.count:0)+n.length}e.exports=function(e){return e&&0!==e.length?new y(p(e)):new y(null)};var a=i.prototype;function o(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function s(e,t){var r=p(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function l(e,t){var r=e.intervals([]);r.push(t),s(e,r)}function A(e,t){var r=e.intervals([]),n=r.indexOf(t);return n<0?0:(r.splice(n,1),s(e,r),1)}function c(e,t,r){for(var n=0;n=0&&e[n][1]>=t;--n){var i=r(e[n]);if(i)return i}}function g(e,t){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(t+1)?l(this,e):this.left.insert(e):this.left=p([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=p([e]);else{var r=n.ge(this.leftPoints,e,h),i=n.ge(this.rightPoints,e,d);this.leftPoints.splice(r,0,e),this.rightPoints.splice(i,0,e)}},a.remove=function(e){var t=this.count-this.leftPoints;if(e[1]3*(t-1)?A(this,e):2===(s=this.left.remove(e))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(e[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(t-1)?A(this,e):2===(s=this.right.remove(e))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===e?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,e,h);athis.mid?this.right&&(r=this.right.queryPoint(e,t))?r:u(this.rightPoints,e,t):g(this.leftPoints,t);var r},a.queryInterval=function(e,t,r){var n;return ethis.mid&&this.right&&(n=this.right.queryInterval(e,t,r))?n:tthis.mid?u(this.rightPoints,e,r):g(this.leftPoints,r)};var m=y.prototype;m.insert=function(e){this.root?this.root.insert(e):this.root=new i(e[0],null,null,[e],[e])},m.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},m.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},m.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)},Object.defineProperty(m,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(m,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},7762:function(e){"use strict";e.exports=function(e){for(var t=new Array(e),r=0;r13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},395:function(e){e.exports=function(e,t,r){return e*(1-r)+t*r}},2652:function(e,t,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),A={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},c=i(),u=i(),g=[0,0,0,0],f=[[0,0,0],[0,0,0],[0,0,0]],h=[0,0,0];function d(e,t,r,n,i){e[0]=t[0]*n+r[0]*i,e[1]=t[1]*n+r[1]*i,e[2]=t[2]*n+r[2]*i}e.exports=function(e,t,r,i,p,y){if(t||(t=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),p||(p=[0,0,0,1]),y||(y=[0,0,0,1]),!n(c,e))return!1;if(a(u,c),u[3]=0,u[7]=0,u[11]=0,u[15]=1,Math.abs(o(u)<1e-8))return!1;var m,I,v=c[3],E=c[7],C=c[11],B=c[12],b=c[13],x=c[14],w=c[15];if(0!==v||0!==E||0!==C){if(g[0]=v,g[1]=E,g[2]=C,g[3]=w,!s(u,u))return!1;l(u,u),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(p,g,u)}else p[0]=p[1]=p[2]=0,p[3]=1;if(t[0]=B,t[1]=b,t[2]=x,I=c,(m=f)[0][0]=I[0],m[0][1]=I[1],m[0][2]=I[2],m[1][0]=I[4],m[1][1]=I[5],m[1][2]=I[6],m[2][0]=I[8],m[2][1]=I[9],m[2][2]=I[10],r[0]=A.length(f[0]),A.normalize(f[0],f[0]),i[0]=A.dot(f[0],f[1]),d(f[1],f[1],f[0],1,-i[0]),r[1]=A.length(f[1]),A.normalize(f[1],f[1]),i[0]/=r[1],i[1]=A.dot(f[0],f[2]),d(f[2],f[2],f[0],1,-i[1]),i[2]=A.dot(f[1],f[2]),d(f[2],f[2],f[1],1,-i[2]),r[2]=A.length(f[2]),A.normalize(f[2],f[2]),i[1]/=r[2],i[2]/=r[2],A.cross(h,f[1],f[2]),A.dot(f[0],h)<0)for(var Q=0;Q<3;Q++)r[Q]*=-1,f[Q][0]*=-1,f[Q][1]*=-1,f[Q][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+f[0][0]-f[1][1]-f[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-f[0][0]+f[1][1]-f[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-f[0][0]-f[1][1]+f[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+f[0][0]+f[1][1]+f[2][2],0)),f[2][1]>f[1][2]&&(y[0]=-y[0]),f[0][2]>f[2][0]&&(y[1]=-y[1]),f[1][0]>f[0][1]&&(y[2]=-y[2]),!0}},4335:function(e){e.exports=function(e,t){var r=t[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)e[i]=t[i]*n;return!0}},7442:function(e,t,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=u(),A=u(),c=u();function u(){return{translate:g(),scale:g(1),skew:g(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function g(e){return[e||0,e||0,e||0]}e.exports=function(e,t,r,u){if(0===o(t)||0===o(r))return!1;var g=a(t,l.translate,l.scale,l.skew,l.perspective,l.quaternion),f=a(r,A.translate,A.scale,A.skew,A.perspective,A.quaternion);return!(!g||!f)&&(n(c.translate,l.translate,A.translate,u),n(c.skew,l.skew,A.skew,u),n(c.scale,l.scale,A.scale,u),n(c.perspective,l.perspective,A.perspective,u),s(c.quaternion,l.quaternion,A.quaternion,u),i(e,c.translate,c.scale,c.skew,c.perspective,c.quaternion),!0)}},7182:function(e,t,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());e.exports=function(e,t,r,a,o,s){return n.identity(e),n.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(e,e,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(e,e,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(e,e,i)),n.scale(e,e,r),e}},4192:function(e,t,r){"use strict";var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),A=r(6582),c=r(7656),u=(r(2504),r(3536)),g=[0,0,0];function f(e){this._components=e.slice(),this._time=[0],this.prevMatrix=e.slice(),this.nextMatrix=e.slice(),this.computedMatrix=e.slice(),this.computedInverse=e.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]}e.exports=function(e){return new f((e=e||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var h=f.prototype;h.recalcMatrix=function(e){var t=this._time,r=n.le(t,e),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===t.length-1)for(var l=16*r,A=0;A<16;++A)o[A]=s[l++];else{var c=t[r+1]-t[r],g=(l=16*r,this.prevMatrix),f=!0;for(A=0;A<16;++A)g[A]=s[l++];var h=this.nextMatrix;for(A=0;A<16;++A)h[A]=s[l++],f=f&&g[A]===h[A];if(c<1e-6||f)for(A=0;A<16;++A)o[A]=g[A];else i(o,g,h,(e-t[r])/c)}var d=this.computedUp;d[0]=o[1],d[1]=o[5],d[2]=o[9],u(d,d);var p=this.computedInverse;a(p,o);var y=this.computedEye,m=p[15];y[0]=p[12]/m,y[1]=p[13]/m,y[2]=p[14]/m;var I=this.computedCenter,v=Math.exp(this.computedRadius[0]);for(A=0;A<3;++A)I[A]=y[A]-o[2+4*A]*v}},h.idle=function(e){if(!(e1&&n(e[o[c-2]],e[o[c-1]],A)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(e[s[c-2]],e[s[c-1]],A)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var u=0,g=(i=0,o.length);i0;--f)r[u++]=s[f];return r};var n=r(3250)[3]},351:function(e,t,r){"use strict";e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function A(e,s){var A=n.x(s),c=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||A!==i||c!==a||l(s))&&(r=0|e,i=A||0,a=c||0,t&&t(r,i,a,o))}function c(e){A(0,e)}function u(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function g(e){l(e)&&t&&t(r,i,a,o)}function f(e){0===n.buttons(e)?A(0,e):A(r,e)}function h(e){A(r|n.buttons(e),e)}function d(e){A(r&~n.buttons(e),e)}function p(){s||(s=!0,e.addEventListener("mousemove",f),e.addEventListener("mousedown",h),e.addEventListener("mouseup",d),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",u),e.addEventListener("keyup",g),e.addEventListener("keydown",g),e.addEventListener("keypress",g),e!==window&&(window.addEventListener("blur",u),window.addEventListener("keyup",g),window.addEventListener("keydown",g),window.addEventListener("keypress",g)))}p();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?p():s&&(s=!1,e.removeEventListener("mousemove",f),e.removeEventListener("mousedown",h),e.removeEventListener("mouseup",d),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",u),e.removeEventListener("keyup",g),e.removeEventListener("keydown",g),e.removeEventListener("keypress",g),e!==window&&(window.removeEventListener("blur",u),window.removeEventListener("keyup",g),window.removeEventListener("keydown",g),window.removeEventListener("keypress",g)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4687:function(e,t){"use strict";function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1< 0"),"function"!==typeof e.vertex&&t("Must specify vertex creation function"),"function"!==typeof e.cell&&t("Must specify cell creation function"),"function"!==typeof e.phase&&t("Must specify phase function");for(var s=e.getters||[],l=new Array(a),A=0;A=0?l[A]=!0:l[A]=!1;return function(e,t,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(e,t,r,n.mallocUint32,n.freeUint32)}(e.vertex,e.cell,e.phase,0,r,l)};var i={"false,0,1":function(e,t,r,n,i){return function(a,o,s,l){var A,c=0|a.shape[0],u=0|a.shape[1],g=a.data,f=0|a.offset,h=0|a.stride[0],d=0|a.stride[1],p=f,y=0|-h,m=0,I=0|-d,v=0,E=-h-d|0,C=0,B=0|h,b=d-h*c|0,x=0,w=0,Q=0,_=2*c|0,S=n(_),k=n(_),D=0,T=0,M=-1,R=-1,L=0,N=0|-c,F=0|c,O=0,P=-c-1|0,G=c-1|0,U=0,z=0,q=0;for(x=0;x0){if(w=1,S[D++]=r(g[p],o,s,l),p+=B,c>0)for(x=1,A=g[p],T=S[D]=r(A,o,s,l),L=S[D+M],O=S[D+N],U=S[D+P],T===L&&T===O&&T===U||(m=g[p+y],v=g[p+I],C=g[p+E],e(x,w,A,m,v,C,T,L,O,U,o,s,l),z=k[D]=Q++),D+=1,p+=B,x=2;x0)for(x=1,A=g[p],T=S[D]=r(A,o,s,l),L=S[D+M],O=S[D+N],U=S[D+P],T===L&&T===O&&T===U||(m=g[p+y],v=g[p+I],C=g[p+E],e(x,w,A,m,v,C,T,L,O,U,o,s,l),z=k[D]=Q++,U!==O&&t(k[D+N],z,v,C,O,U,o,s,l)),D+=1,p+=B,x=2;x0){if(x=1,S[D++]=r(g[p],o,s,l),p+=B,u>0)for(w=1,A=g[p],T=S[D]=r(A,o,s,l),O=S[D+N],L=S[D+M],U=S[D+P],T===O&&T===L&&T===U||(m=g[p+y],v=g[p+I],C=g[p+E],e(x,w,A,m,v,C,T,O,L,U,o,s,l),z=k[D]=Q++),D+=1,p+=B,w=2;w0)for(w=1,A=g[p],T=S[D]=r(A,o,s,l),O=S[D+N],L=S[D+M],U=S[D+P],T===O&&T===L&&T===U||(m=g[p+y],v=g[p+I],C=g[p+E],e(x,w,A,m,v,C,T,O,L,U,o,s,l),z=k[D]=Q++,U!==O&&t(k[D+N],z,C,m,U,O,o,s,l)),D+=1,p+=B,w=2;w2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),e.pick(0,-1,1).lo(1).hi(a[1]-2)),t(e.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),e.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),t(e.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),e.pick(-1,0,0).lo(1).hi(a[0]-2)),t(e.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),e.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),t(e.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),e.set(0,0,0,0),e.set(0,0,1,0),e.set(a[0]-1,0,0,0),e.set(a[0]-1,0,1,0),e.set(0,a[1]-1,0,0),e.set(0,a[1]-1,1,0),e.set(a[0]-1,a[1]-1,0,0),e.set(a[0]-1,a[1]-1,1,0),e}}e.exports=function(e,t,r){return Array.isArray(r)||(r=n(t.dimension,"string"===typeof r?r:"clamp")),0===t.size?e:0===t.dimension?(e.set(0),e):function(e){var t=e.join();if(a=c[t])return a;for(var r=e.length,n=[u,g],i=1;i<=r;++i)n.push(f(i));var a=h.apply(void 0,n);return c[t]=a,a}(r)(e,t)}},4317:function(e){"use strict";function t(e,t){var r=Math.floor(t),n=t-r,i=0<=r&&r0;){I<64?(l=I,I=0):(l=64,I-=64);for(var v=0|e[1];v>0;){v<64?(A=v,v=0):(A=64,v-=64),n=y+I*u+v*g,o=m+I*h+v*d;var E=0,C=0,B=0,b=f,x=u-c*f,w=g-l*u,Q=p,_=h-c*p,S=d-l*h;for(B=0;B0;){d<64?(l=d,d=0):(l=64,d-=64);for(var p=0|e[0];p>0;){p<64?(s=p,p=0):(s=64,p-=64),n=f+d*c+p*A,o=h+d*g+p*u;var y=0,m=0,I=c,v=A-l*c,E=g,C=u-l*g;for(m=0;m0;){m<64?(A=m,m=0):(A=64,m-=64);for(var I=0|e[0];I>0;){I<64?(s=I,I=0):(s=64,I-=64);for(var v=0|e[1];v>0;){v<64?(l=v,v=0):(l=64,v-=64),n=p+m*g+I*c+v*u,o=y+m*d+I*f+v*h;var E=0,C=0,B=0,b=g,x=c-A*g,w=u-s*c,Q=d,_=f-A*d,S=h-s*f;for(B=0;Br;){y=0,m=d-o;t:for(p=0;pv)break t;m+=u,y+=g}for(y=d,m=d-o,p=0;p>1,H=q-G,Y=q+G,J=U,K=H,j=q,V=Y,W=z,Z=i+1,X=a-1,$=!0,ee=0,te=0,re=0,ne=u,ie=t(ne),ae=t(ne);x=l*J,w=l*K,P=s;e:for(b=0;b0){p=J,J=K,K=p;break e}if(re<0)break e;P+=f}x=l*V,w=l*W,P=s;e:for(b=0;b0){p=V,V=W,W=p;break e}if(re<0)break e;P+=f}x=l*J,w=l*j,P=s;e:for(b=0;b0){p=J,J=j,j=p;break e}if(re<0)break e;P+=f}x=l*K,w=l*j,P=s;e:for(b=0;b0){p=K,K=j,j=p;break e}if(re<0)break e;P+=f}x=l*J,w=l*V,P=s;e:for(b=0;b0){p=J,J=V,V=p;break e}if(re<0)break e;P+=f}x=l*j,w=l*V,P=s;e:for(b=0;b0){p=j,j=V,V=p;break e}if(re<0)break e;P+=f}x=l*K,w=l*W,P=s;e:for(b=0;b0){p=K,K=W,W=p;break e}if(re<0)break e;P+=f}x=l*K,w=l*j,P=s;e:for(b=0;b0){p=K,K=j,j=p;break e}if(re<0)break e;P+=f}x=l*V,w=l*W,P=s;e:for(b=0;b0){p=V,V=W,W=p;break e}if(re<0)break e;P+=f}for(x=l*J,w=l*K,Q=l*j,_=l*V,S=l*W,k=l*U,D=l*q,T=l*z,O=0,P=s,b=0;b0)){if(re<0){for(x=l*v,w=l*Z,Q=l*X,P=s,b=0;b0)for(;;){for(E=s+X*l,O=0,b=0;b0)){for(E=s+X*l,O=0,b=0;bz){e:for(;;){for(E=s+Z*l,O=0,P=s,b=0;b1&&n?s(r,n[0],n[1]):s(r)}(e,t,l);return n(l,A)}},446:function(e,t,r){"use strict";var n=r(7640),i={};e.exports=function(e){var t=e.order,r=e.dtype,a=[t,r].join(":"),o=i[a];return o||(i[a]=o=n(t,r)),o(e),e}},9618:function(e,t,r){var n=r(7163),i="undefined"!==typeof Float64Array;function a(e,t){return e[0]-t[0]}function o(){var e,t=this.stride,r=new Array(t.length);for(e=0;e=0&&(t+=a*(r=0|e),i-=r),new n(this.data,i,a,t)},i.step=function(e){var t=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"===typeof e&&((a=0|e)<0?(i+=r*(t-1),t=o(-t/a)):t=o(t/a),r*=a),new n(this.data,t,r,i)},i.transpose=function(e){e=void 0===e?0:0|e;var t=this.shape,r=this.stride;return new n(this.data,t[e],r[e],this.offset)},i.pick=function(e){var r=[],n=[],i=this.offset;return"number"===typeof e&&e>=0?i=i+this.stride[0]*e|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,t[r.length+1])(this.data,r,n,i)},function(e,t,r,i){return new n(e,t[0],r[0],i)}},2:function(e,t,r){function n(e,t,r,n,i,a){this.data=e,this.shape=[t,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=e,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(t,r,n){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]=n},i.get=function(t,r){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]},i.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},i.hi=function(e,t){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,this.stride[0],this.stride[1],this.offset)},i.lo=function(e,t){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"===typeof e&&e>=0&&(r+=s*(i=0|e),a-=i),"number"===typeof t&&t>=0&&(r+=l*(i=0|t),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(e,t){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,A=Math.ceil;return"number"===typeof e&&((l=0|e)<0?(s+=a*(r-1),r=A(-r/l)):r=A(r/l),a*=l),"number"===typeof t&&((l=0|t)<0?(s+=o*(i-1),i=A(-i/l)):i=A(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(e,t){e=void 0===e?0:0|e,t=void 0===t?1:0|t;var r=this.shape,i=this.stride;return new n(this.data,r[e],r[t],i[e],i[t],this.offset)},i.pick=function(e,r){var n=[],i=[],a=this.offset;return"number"===typeof e&&e>=0?a=a+this.stride[0]*e|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"===typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,t[n.length+1])(this.data,n,i,a)},function(e,t,r,i){return new n(e,t[0],t[1],r[0],r[1],i)}},3:function(e,t,r){function n(e,t,r,n,i,a,o,s){this.data=e,this.shape=[t,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=e,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var e=Math.abs(this.stride[0]),t=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return e>t?t>r?[2,1,0]:e>r?[1,2,0]:[1,0,2]:e>r?[2,0,1]:r>t?[0,1,2]:[0,2,1]}}),i.set=function(t,r,n,i){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(t,r,n){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]},i.index=function(e,t,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r},i.hi=function(e,t,r){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(e,t,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],A=this.stride[0],c=this.stride[1],u=this.stride[2];return"number"===typeof e&&e>=0&&(i+=A*(a=0|e),o-=a),"number"===typeof t&&t>=0&&(i+=c*(a=0|t),s-=a),"number"===typeof r&&r>=0&&(i+=u*(a=0|r),l-=a),new n(this.data,o,s,l,A,c,u,i)},i.step=function(e,t,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],A=this.stride[2],c=this.offset,u=0,g=Math.ceil;return"number"===typeof e&&((u=0|e)<0?(c+=s*(i-1),i=g(-i/u)):i=g(i/u),s*=u),"number"===typeof t&&((u=0|t)<0?(c+=l*(a-1),a=g(-a/u)):a=g(a/u),l*=u),"number"===typeof r&&((u=0|r)<0?(c+=A*(o-1),o=g(-o/u)):o=g(o/u),A*=u),new n(this.data,i,a,o,s,l,A,c)},i.transpose=function(e,t,r){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[e],i[t],i[r],a[e],a[t],a[r],this.offset)},i.pick=function(e,r,n){var i=[],a=[],o=this.offset;return"number"===typeof e&&e>=0?o=o+this.stride[0]*e|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"===typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"===typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,t[i.length+1])(this.data,i,a,o)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],r[0],r[1],r[2],i)}},4:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,A){this.data=e,this.shape=[t,r,n,i],this.stride=[a,o,s,l],this.offset=0|A}var i=n.prototype;return i.dtype=e,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(t,r,n,i){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(e,t,r,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n},i.hi=function(e,t,r,i){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(e,t,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],A=this.shape[2],c=this.shape[3],u=this.stride[0],g=this.stride[1],f=this.stride[2],h=this.stride[3];return"number"===typeof e&&e>=0&&(a+=u*(o=0|e),s-=o),"number"===typeof t&&t>=0&&(a+=g*(o=0|t),l-=o),"number"===typeof r&&r>=0&&(a+=f*(o=0|r),A-=o),"number"===typeof i&&i>=0&&(a+=h*(o=0|i),c-=o),new n(this.data,s,l,A,c,u,g,f,h,a)},i.step=function(e,t,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],A=this.stride[0],c=this.stride[1],u=this.stride[2],g=this.stride[3],f=this.offset,h=0,d=Math.ceil;return"number"===typeof e&&((h=0|e)<0?(f+=A*(a-1),a=d(-a/h)):a=d(a/h),A*=h),"number"===typeof t&&((h=0|t)<0?(f+=c*(o-1),o=d(-o/h)):o=d(o/h),c*=h),"number"===typeof r&&((h=0|r)<0?(f+=u*(s-1),s=d(-s/h)):s=d(s/h),u*=h),"number"===typeof i&&((h=0|i)<0?(f+=g*(l-1),l=d(-l/h)):l=d(l/h),g*=h),new n(this.data,a,o,s,l,A,c,u,g,f)},i.transpose=function(e,t,r,i){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[e],a[t],a[r],a[i],o[e],o[t],o[r],o[i],this.offset)},i.pick=function(e,r,n,i){var a=[],o=[],s=this.offset;return"number"===typeof e&&e>=0?s=s+this.stride[0]*e|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"===typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"===typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"===typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,t[a.length+1])(this.data,a,o,s)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],r[0],r[1],r[2],r[3],i)}},5:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,A,c,u){this.data=e,this.shape=[t,r,n,i,a],this.stride=[o,s,l,A,c],this.offset=0|u}var i=n.prototype;return i.dtype=e,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a,o){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(t,r,n,i,a){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(e,t,r,n,i){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(e,t,r,i,a){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,"number"!==typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(e,t,r,i,a){var o=this.offset,s=0,l=this.shape[0],A=this.shape[1],c=this.shape[2],u=this.shape[3],g=this.shape[4],f=this.stride[0],h=this.stride[1],d=this.stride[2],p=this.stride[3],y=this.stride[4];return"number"===typeof e&&e>=0&&(o+=f*(s=0|e),l-=s),"number"===typeof t&&t>=0&&(o+=h*(s=0|t),A-=s),"number"===typeof r&&r>=0&&(o+=d*(s=0|r),c-=s),"number"===typeof i&&i>=0&&(o+=p*(s=0|i),u-=s),"number"===typeof a&&a>=0&&(o+=y*(s=0|a),g-=s),new n(this.data,l,A,c,u,g,f,h,d,p,y,o)},i.step=function(e,t,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],A=this.shape[3],c=this.shape[4],u=this.stride[0],g=this.stride[1],f=this.stride[2],h=this.stride[3],d=this.stride[4],p=this.offset,y=0,m=Math.ceil;return"number"===typeof e&&((y=0|e)<0?(p+=u*(o-1),o=m(-o/y)):o=m(o/y),u*=y),"number"===typeof t&&((y=0|t)<0?(p+=g*(s-1),s=m(-s/y)):s=m(s/y),g*=y),"number"===typeof r&&((y=0|r)<0?(p+=f*(l-1),l=m(-l/y)):l=m(l/y),f*=y),"number"===typeof i&&((y=0|i)<0?(p+=h*(A-1),A=m(-A/y)):A=m(A/y),h*=y),"number"===typeof a&&((y=0|a)<0?(p+=d*(c-1),c=m(-c/y)):c=m(c/y),d*=y),new n(this.data,o,s,l,A,c,u,g,f,h,d,p)},i.transpose=function(e,t,r,i,a){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[e],o[t],o[r],o[i],o[a],s[e],s[t],s[r],s[i],s[a],this.offset)},i.pick=function(e,r,n,i,a){var o=[],s=[],l=this.offset;return"number"===typeof e&&e>=0?l=l+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"===typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"===typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"===typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"===typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,t[o.length+1])(this.data,o,s,l)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],t[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(e,t){var r=-1===t?"T":String(t),n=s[r];return-1===t?n(e):0===t?n(e,A[e][0]):n(e,A[e],o)}var A={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(e,t,r,a){if(void 0===e)return(0,A.array[0])([]);"number"===typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=t[s]}if(void 0===a)for(a=0,s=0;s>>0;e.exports=function(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(0===e)return t<0?-i:i;var r=n.hi(e),o=n.lo(e);return t>e===e>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(e,t){t.vertexNormals=function(e,t,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var v=i[A],E=1/Math.sqrt(p*m);for(I=0;I<3;++I){var C=(I+1)%3,B=(I+2)%3;v[I]+=E*(y[C]*d[B]-y[B]*d[C])}}}for(o=0;oa)for(E=1/Math.sqrt(b),I=0;I<3;++I)v[I]*=E;else for(I=0;I<3;++I)v[I]=0}return i},t.faceNormals=function(e,t,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(f):0,A=0;A<3;++A)g[A]*=f;i[o]=g}return i}},4081:function(e){"use strict";e.exports=function(e,t,r,n,i,a,o,s,l,A){var c=t+a+A;if(u>0){var u=Math.sqrt(c+1);e[0]=.5*(o-l)/u,e[1]=.5*(s-n)/u,e[2]=.5*(r-a)/u,e[3]=.5*u}else{var g=Math.max(t,a,A);u=Math.sqrt(2*g-c+1),t>=g?(e[0]=.5*u,e[1]=.5*(i+r)/u,e[2]=.5*(s+n)/u,e[3]=.5*(o-l)/u):a>=g?(e[0]=.5*(r+i)/u,e[1]=.5*u,e[2]=.5*(l+o)/u,e[3]=.5*(s-n)/u):(e[0]=.5*(n+s)/u,e[1]=.5*(o+l)/u,e[2]=.5*u,e[3]=.5*(r-i)/u)}return e}},9977:function(e,t,r){"use strict";e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.rotation||[0,0,0,1],n=e.radius||1;t=[].slice.call(t,0,3),c(r=[].slice.call(r,0,4),r);var i=new u(r,t,Math.log(n));return i.setDistanceLimits(e.zoomMin,e.zoomMax),("eye"in e||"up"in e)&&i.lookAt(0,e.eye,e.center,e.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function A(e,t,r,n){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2)+Math.pow(n,2))}function c(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=A(r,n,i,a);o>1e-6?(e[0]=r/o,e[1]=n/o,e[2]=i/o,e[3]=a/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function u(e,t,r){this.radius=n([r]),this.center=n(t),this.rotation=n(e),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)}var g=u.prototype;g.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},g.recalcMatrix=function(e){this.radius.curve(e),this.center.curve(e),this.rotation.curve(e);var t=this.computedRotation;c(t,t);var r=this.computedMatrix;a(r,t);var n=this.computedCenter,i=this.computedEye,o=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],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var A=0,u=0;u<3;++u)A+=r[l+4*u]*i[u];r[12+l]=-A}},g.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r},g.idle=function(e){this.center.idle(e),this.radius.idle(e),this.rotation.idle(e)},g.flush=function(e){this.center.flush(e),this.radius.flush(e),this.rotation.flush(e)},g.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],A=l(a,o,s);a/=A,o/=A,s/=A;var c=i[0],u=i[4],g=i[8],f=c*a+u*o+g*s,h=l(c-=a*f,u-=o*f,g-=s*f);c/=h,u/=h,g/=h;var d=i[2],p=i[6],y=i[10],m=d*a+p*o+y*s,I=d*c+p*u+y*g,v=l(d-=m*a+I*c,p-=m*o+I*u,y-=m*s+I*g);d/=v,p/=v,y/=v;var E=c*t+a*r,C=u*t+o*r,B=g*t+s*r;this.center.move(e,E,C,B);var b=Math.exp(this.computedRadius[0]);b=Math.max(1e-4,b+n),this.radius.set(e,Math.log(b))},g.rotate=function(e,t,r,n){this.recalcMatrix(e),t=t||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],u=i[5],g=i[9],f=i[2],h=i[6],d=i[10],p=t*a+r*c,y=t*o+r*u,m=t*s+r*g,I=-(h*m-d*y),v=-(d*p-f*m),E=-(f*y-h*p),C=Math.sqrt(Math.max(0,1-Math.pow(I,2)-Math.pow(v,2)-Math.pow(E,2))),B=A(I,v,E,C);B>1e-6?(I/=B,v/=B,E/=B,C/=B):(I=v=E=0,C=1);var b=this.computedRotation,x=b[0],w=b[1],Q=b[2],_=b[3],S=x*C+_*I+w*E-Q*v,k=w*C+_*v+Q*I-x*E,D=Q*C+_*E+x*v-w*I,T=_*C-x*I-w*v-Q*E;if(n){I=f,v=h,E=d;var M=Math.sin(n)/l(I,v,E);I*=M,v*=M,E*=M,T=T*(C=Math.cos(t))-(S=S*C+T*I+k*E-D*v)*I-(k=k*C+T*v+D*I-S*E)*v-(D=D*C+T*E+S*v-k*I)*E}var R=A(S,k,D,T);R>1e-6?(S/=R,k/=R,D/=R,T/=R):(S=k=D=0,T=1),this.rotation.set(e,S,k,D,T)},g.lookAt=function(e,t,r,n){this.recalcMatrix(e),r=r||this.computedCenter,t=t||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,t,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(e,o[0],o[1],o[2],o[3]);for(var l=0,A=0;A<3;++A)l+=Math.pow(r[A]-t[A],2);this.radius.set(e,.5*Math.log(Math.max(l,1e-6))),this.center.set(e,r[0],r[1],r[2])},g.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},g.setMatrix=function(e,t){var r=this.computedRotation;s(r,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),c(r,r),this.rotation.set(e,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,t);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,A=n[14]/i;this.recalcMatrix(e);var u=Math.exp(this.computedRadius[0]);this.center.set(e,a-n[2]*u,l-n[6]*u,A-n[10]*u),this.radius.idle(e)}else this.center.idle(e),this.radius.idle(e)},g.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},g.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},g.getDistanceLimits=function(e){var t=this.radius.bounds;return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},g.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]}},g.fromJSON=function(e){var t=this.lastT(),r=e.center;r&&this.center.set(t,r[0],r[1],r[2]);var n=e.rotation;n&&this.rotation.set(t,n[0],n[1],n[2],n[3]);var i=e.distance;i&&i>0&&this.radius.set(t,Math.log(i)),this.setDistanceLimits(e.zoomMin,e.zoomMax)}},1371:function(e,t,r){"use strict";var n=r(3233);e.exports=function(e,t,r){return n(r="undefined"!==typeof r?r+"":" ",t)+e}},3202:function(e){e.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},3088:function(e,t,r){"use strict";e.exports=function(e,t){for(var r=0|t.length,i=e.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var u=0;u<2;++u)for(var g=a[u][r],f=0;f0&&(o=h,s=d,l=u)}return i||o&&A(o,l),s}function u(e,r){var i=a[r][e][0],o=[e];A(i,r);for(var s=i[1^r];;){for(;s!==e;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][e].length+a[1][e].length===0)break;var l=o[o.length-1],u=e,g=o[1],f=c(l,u,!0);if(n(t[l],t[u],t[g],t[f])<0)break;o.push(e),s=c(l,u)}return o}function g(e,t){return t[1]===t[t.length-1]}for(o=0;o0;){a[0][o].length;var d=u(o,f);g(0,d)?h.push.apply(h,d):(h.length>0&&l.push(h),h=d)}h.length>0&&l.push(h)}return l};var n=r(3140)},5609:function(e,t,r){"use strict";e.exports=function(e,t){for(var r=n(e,t.length),i=new Array(t.length),a=new Array(t.length),o=[],s=0;s0;){i[f=o.pop()]=!1;var A=r[f];for(s=0;s0}))).length,p=new Array(d),y=new Array(d);for(f=0;f0;){var O=N.pop(),P=_[O];l(P,(function(e,t){return e-t}));var G,U=P.length,z=F[O];for(0===z&&(G=[q=h[O]]),f=0;f=0||(F[H]=1^z,N.push(H),0===z&&(L(q=h[H])||(q.reverse(),G.push(q))))}0===z&&r.push(G)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),A=r(5609);function c(e,t){for(var r=new Array(e),n=0;n0&&t[i]===r[0]))return 1;a=e[i-1]}for(var s=1;a;){var l=a.key,A=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(A>0)a=a.left;else{if(!(A<0))return 0;s=1,a=a.right}}return s}}(y.slabs,y.coordinates);return 0===a.length?m:function(e,t){return function(r){return e(r[0],r[1])?0:t(r)}}(l(a),m)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(e){for(var t={},r=0;r=A?(b=1,m=A+2*g+h):m=g*(b=-g/A)+h):(b=0,f>=0?(x=0,m=h):-f>=u?(x=1,m=u+2*f+h):m=f*(x=-f/u)+h);else if(x<0)x=0,g>=0?(b=0,m=h):-g>=A?(b=1,m=A+2*g+h):m=g*(b=-g/A)+h;else{var w=1/B;m=(b*=w)*(A*b+c*(x*=w)+2*g)+x*(c*b+u*x+2*f)+h}else b<0?(v=u+f)>(I=c+g)?(E=v-I)>=(C=A-2*c+u)?(b=1,x=0,m=A+2*g+h):m=(b=E/C)*(A*b+c*(x=1-b)+2*g)+x*(c*b+u*x+2*f)+h:(b=0,v<=0?(x=1,m=u+2*f+h):f>=0?(x=0,m=h):m=f*(x=-f/u)+h):x<0?(v=A+g)>(I=c+f)?(E=v-I)>=(C=A-2*c+u)?(x=1,b=0,m=u+2*f+h):m=(b=1-(x=E/C))*(A*b+c*x+2*g)+x*(c*b+u*x+2*f)+h:(x=0,v<=0?(b=1,m=A+2*g+h):g>=0?(b=0,m=h):m=g*(b=-g/A)+h):(E=u+f-c-g)<=0?(b=0,x=1,m=u+2*f+h):E>=(C=A-2*c+u)?(b=1,x=0,m=A+2*g+h):m=(b=E/C)*(A*b+c*(x=1-b)+2*g)+x*(c*b+u*x+2*f)+h;var Q=1-b-x;for(l=0;l0){var A=e[r-1];if(0===n(s,A)&&a(A)!==l){r-=1;continue}}e[r++]=s}}return e.length=r,e}},3233:function(e){"use strict";var t,r="";e.exports=function(e,n){if("string"!==typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var i=e.length*n;if(t!==e||"undefined"===typeof t)t=e,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,i)}},3025:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){"use strict";e.exports=function(e){for(var t=e.length,r=e[e.length-1],n=t,i=t-2;i>=0;--i){var a=r;(l=(s=e[i])-((r=a+s)-a))&&(e[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:u(e,t,r)},function(e,t,r,n){var i=e[0]-n[0],a=t[0]-n[0],o=r[0]-n[0],s=e[1]-n[1],l=t[1]-n[1],A=r[1]-n[1],c=e[2]-n[2],u=t[2]-n[2],f=r[2]-n[2],h=a*A,d=o*l,p=o*s,y=i*A,m=i*l,I=a*s,v=c*(h-d)+u*(p-y)+f*(m-I),E=7771561172376103e-31*((Math.abs(h)+Math.abs(d))*Math.abs(c)+(Math.abs(p)+Math.abs(y))*Math.abs(u)+(Math.abs(m)+Math.abs(I))*Math.abs(f));return v>E||-v>E?v:g(e,t,r,n)}];function h(e){var t=f[e.length];return t||(t=f[e.length]=c(e.length)),t.apply(void 0,e)}function d(e,t,r,n,i,a,o){return function(t,r,s,l,A){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return i(t,r,s);case 4:return a(t,r,s,l);case 5:return o(t,r,s,l,A)}for(var c=new Array(arguments.length),u=0;u0&&o>0||a<0&&o<0)return!1;var s=n(r,e,t),l=n(i,e,t);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(e,t,r,n){for(var i=0;i<2;++i){var a=e[i],o=t[i],s=Math.min(a,o),l=Math.max(a,o),A=r[i],c=n[i],u=Math.min(A,c);if(Math.max(A,c)=n?(i=u,(l+=1)=n?(i=u,(l+=1)>1,A=t[2*l+1];if(A===a)return l;a>1,A=t[2*l+1];if(A===a)return l;a>1,A=t[2*l+1];if(A===a)return l;a0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},2014:function(e,t,r){"use strict";var n=r(3105),i=r(4623);function a(e,t){var r=e.length,n=e.length-t.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||i(e[0],e[1])-i(t[0],t[1]);case 3:var a=e[0]+e[1],o=t[0]+t[1];if(s=a+e[2]-(o+t[2]))return s;var s,l=i(e[0],e[1]),A=i(t[0],t[1]);return(s=i(l,e[2])-i(A,t[2]))||i(l+e[2],a)-i(A+t[2],o);default:var c=e.slice(0);c.sort();var u=t.slice(0);u.sort();for(var g=0;g>1,s=a(e[o],t);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(e,t){for(var r=new Array(e.length),i=0,o=r.length;i=e.length||0!==a(e[p],s)););}return r}function u(e,t){if(t<0)return[];for(var r=[],i=(1<>>c&1&&A.push(i[c]);t.push(A)}return s(t)},t.skeleton=u,t.boundary=function(e){for(var t=[],r=0,n=e.length;r>1:(e>>1)-1}function I(e){for(var t=y(e);;){var r=t,n=2*e+1,i=2*(e+1),a=e;if(n0;){var r=m(e);if(!(r>=0&&t0){var e=b[0];return p(0,w-1),w-=1,I(0),e}return-1}function C(e,t){var r=b[e];return A[r]===t?e:(A[r]=-1/0,v(e),E(),A[r]=t,v((w+=1)-1))}function B(e){if(!c[e]){c[e]=!0;var t=s[e],r=l[e];s[r]>=0&&(s[r]=t),l[t]>=0&&(l[t]=r),x[t]>=0&&C(x[t],d(t)),x[r]>=0&&C(x[r],d(r))}}var b=[],x=new Array(a);for(u=0;u>1;u>=0;--u)I(u);for(;;){var Q=E();if(Q<0||A[Q]>r)break;B(Q)}var _=[];for(u=0;u=0&&r>=0&&t!==r){var n=x[t],i=x[r];n!==i&&k.push([n,i])}})),i.unique(i.normalize(k)),{positions:_,edges:k}};var n=r(3250),i=r(2014)},1303:function(e,t,r){"use strict";e.exports=function(e,t){var r,a,o,s;if(t[0][0]t[1][0]))return i(t,e);r=t[1],a=t[0]}if(e[0][0]e[1][0]))return-i(e,t);o=e[1],s=e[0]}var l=n(r,a,s),A=n(r,a,o);if(l<0){if(A<=0)return l}else if(l>0){if(A>=0)return l}else if(A)return A;if(l=n(s,o,a),A=n(s,o,r),l<0){if(A<=0)return l}else if(l>0){if(A>=0)return l}else if(A)return A;return a[0]-s[0]};var n=r(3250);function i(e,t){var r,i,a,o;if(t[0][0]t[1][0])){var s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]),A=Math.min(t[0][1],t[1][1]),c=Math.max(t[0][1],t[1][1]);return lc?s-c:l-c}r=t[1],i=t[0]}e[0][1]0)if(t[0]!==o[1][0])r=e,e=e.right;else{if(l=A(e.right,t))return l;e=e.left}else{if(t[0]!==o[1][0])return e;var l;if(l=A(e.right,t))return l;e=e.left}}return r}function c(e,t,r,n){this.y=e,this.index=t,this.start=r,this.closed=n}function u(e,t,r,n){this.x=e,this.segment=t,this.create=r,this.index=n}s.prototype.castUp=function(e){var t=n.le(this.coordinates,e[0]);if(t<0)return-1;this.slabs[t];var r=A(this.slabs[t],e),i=-1;if(r&&(i=r.value),this.coordinates[t]===e[0]){var s=null;if(r&&(s=r.key),t>0){var c=A(this.slabs[t-1],e);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var u=this.horizontal[t];if(u.length>0){var g=n.ge(u,e[1],l);if(g=u.length)return i;f=u[g]}}if(f.start)if(s){var h=a(s[0],s[1],[e[0],f.y]);s[0][0]>s[1][0]&&(h=-h),h>0&&(i=f.index)}else i=f.index;else f.y!==e[1]&&(i=f.index)}}}return i}},5202:function(e,t,r){"use strict";var n=r(1944),i=r(8210);function a(e,t){var r=i(n(e,t),[t[t.length-1]]);return r[r.length-1]}function o(e,t,r,n){var i=-t/(n-t);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=e.length,s=new Array(o),l=0;l0||i>0&&c<0){var u=o(s,c,l,i);r.push(u),n.push(u.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},e.exports.positive=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&A<0)&&r.push(o(i,A,s,n)),A>=0&&r.push(s.slice()),n=A}return r},e.exports.negative=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&A<0)&&r.push(o(i,A,s,n)),A<=0&&r.push(s.slice()),n=A}return r}},3387:function(e,t,r){var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(e){return function(e,t){var r,n,o,s,l,A,c,u,g,f=1,h=e.length,d="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?d+=r:(!i.number.test(s.type)||u&&!s.sign?g="":(g=u?"+":"-",r=r.toString().replace(i.sign,"")),A=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(g+r).length,l=s.width&&c>0?A.repeat(c):"",d+=s.align?g+r+l:"0"===A?g+l+r:l+g+r)}return d}(function(e){if(s[e])return s[e];for(var t,r=e,n=[],a=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var o=[],l=t[2],A=[];if(null===(A=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(A[1]);""!==(l=l.substring(A[0].length));)if(null!==(A=i.key_access.exec(l)))o.push(A[1]);else{if(null===(A=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(A[1])}t[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return s[e]=n}(e),arguments)}function o(e,t){return a.apply(null,[e].concat(t||[]))}var s=Object.create(null);t.sprintf=a,t.vsprintf=o,"undefined"!==typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(t,r,t,e))||(e.exports=n))}()},3711:function(e,t,r){"use strict";e.exports=function(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(1===e.dimension)return function(e,t){for(var r=i(e,t),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(e,t,r,n,i,a,o,s,l,A,c,u,g){var f=(0|o)+(s<<1)+(l<<2)+(A<<3)|0;if(0!==f&&15!==f)switch(f){case 0:case 15:c.push([e-.5,t-.5]);break;case 1:c.push([e-.25-.25*(n+r-2*g)/(r-n),t-.25-.25*(i+r-2*g)/(r-i)]);break;case 2:c.push([e-.75-.25*(-n-r+2*g)/(n-r),t-.25-.25*(a+n-2*g)/(n-a)]);break;case 3:c.push([e-.5,t-.5-.5*(i+r+a+n-4*g)/(r-i+n-a)]);break;case 4:c.push([e-.25-.25*(a+i-2*g)/(i-a),t-.75-.25*(-i-r+2*g)/(i-r)]);break;case 5:c.push([e-.5-.5*(n+r+a+i-4*g)/(r-n+i-a),t-.5]);break;case 6:c.push([e-.5-.25*(-n-r+a+i)/(n-r+i-a),t-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:c.push([e-.75-.25*(a+i-2*g)/(i-a),t-.75-.25*(a+n-2*g)/(n-a)]);break;case 8:c.push([e-.75-.25*(-a-i+2*g)/(a-i),t-.75-.25*(-a-n+2*g)/(a-n)]);break;case 9:c.push([e-.5-.25*(n+r+-a-i)/(r-n+a-i),t-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:c.push([e-.5-.5*(-n-r-a-i+4*g)/(n-r+a-i),t-.5]);break;case 11:c.push([e-.25-.25*(-a-i+2*g)/(a-i),t-.75-.25*(i+r-2*g)/(r-i)]);break;case 12:c.push([e-.5,t-.5-.5*(-i-r-a-n+4*g)/(i-r+a-n)]);break;case 13:c.push([e-.75-.25*(n+r-2*g)/(r-n),t-.25-.25*(-a-n+2*g)/(a-n)]);break;case 14:c.push([e-.25-.25*(-n-r+2*g)/(n-r),t-.25-.25*(-i-r+2*g)/(i-r)])}},cell:function(e,t,r,n,i,a,o,s,l){i?s.push([e,t]):s.push([t,e])}});return function(e,t){var r=[],i=[];return n(e,r,i,t),{positions:r,cells:i}}}},o={}},529:function(e,t,r){"use strict";e.exports=function e(t,r,n){var a=(n=n||{}).fontStyle||"normal",s=n.fontWeight||"normal",l=n.fontVariant||"normal",A=[a,s,l,t].join("_"),c=o[A];c||(c=o[A]={" ":{data:new Float32Array(0),shape:.2}});var u=c[r];if(!u)if(r.length<=1||!/\d/.test(r))u=c[r]=function(e){for(var t=e.cells,r=e.positions,n=new Float32Array(6*t.length),i=0,a=0,o=0;o0&&(d+=.02);var y=new Float32Array(h),m=0,I=-.5*d;for(p=0;pMath.max(r,n)?i[2]=1:r>Math.max(t,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=e[l]*e[l],o+=i[l]*e[l];for(l=0;l<3;++l)i[l]-=o/a*e[l];return s(i,i),i}function g(e,t,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(e,t),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 A=0;A<16;++A)this.computedMatrix[A]=.5;this.recalcMatrix(0)}var f=g.prototype;f.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},f.getDistanceLimits=function(e){var t=this.radius.bounds[0];return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},f.recalcMatrix=function(e){this.center.curve(e),this.up.curve(e),this.right.curve(e),this.radius.curve(e),this.angle.curve(e);for(var t=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=t[a]*r[a],n+=t[a]*t[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=t[a]*i/n,c+=r[a]*r[a],t[a]/=l;var u=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=u;var g=this.computedToward;o(g,t,r),s(g,g);var f=Math.exp(this.computedRadius[0]),h=this.computedAngle[0],d=this.computedAngle[1],p=Math.cos(h),y=Math.sin(h),m=Math.cos(d),I=Math.sin(d),v=this.computedCenter,E=p*m,C=y*m,B=I,b=-p*I,x=-y*I,w=m,Q=this.computedEye,_=this.computedMatrix;for(a=0;a<3;++a){var S=E*r[a]+C*g[a]+B*t[a];_[4*a+1]=b*r[a]+x*g[a]+w*t[a],_[4*a+2]=S,_[4*a+3]=0}var k=_[1],D=_[5],T=_[9],M=_[2],R=_[6],L=_[10],N=D*L-T*R,F=T*M-k*L,O=k*R-D*M,P=A(N,F,O);for(N/=P,F/=P,O/=P,_[0]=N,_[4]=F,_[8]=O,a=0;a<3;++a)Q[a]=v[a]+_[2+4*a]*f;for(a=0;a<3;++a){c=0;for(var G=0;G<3;++G)c+=_[a+4*G]*Q[G];_[12+a]=-c}_[15]=1},f.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r};var h=[0,0,0];f.rotate=function(e,t,r,n){if(this.angle.move(e,t,r),n){this.recalcMatrix(e);var i=this.computedMatrix;h[0]=i[2],h[1]=i[6],h[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,A=0;A<3;++A)i[4*A]=o[A],i[4*A+1]=s[A],i[4*A+2]=l[A];for(a(i,i,n,h),A=0;A<3;++A)o[A]=i[4*A],s[A]=i[4*A+1];this.up.set(e,o[0],o[1],o[2]),this.right.set(e,s[0],s[1],s[2])}},f.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=A(a,o,s);a/=l,o/=l,s/=l;var c=i[0],u=i[4],g=i[8],f=c*a+u*o+g*s,h=A(c-=a*f,u-=o*f,g-=s*f),d=(c/=h)*t+a*r,p=(u/=h)*t+o*r,y=(g/=h)*t+s*r;this.center.move(e,d,p,y);var m=Math.exp(this.computedRadius[0]);m=Math.max(1e-4,m+n),this.radius.set(e,Math.log(m))},f.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},f.setMatrix=function(e,t,r,n){var a=1;"number"===typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;t||(this.recalcMatrix(e),t=this.computedMatrix);var s=t[a],l=t[a+4],u=t[a+8];if(n){var g=Math.abs(s),f=Math.abs(l),h=Math.abs(u),d=Math.max(g,f,h);g===d?(s=s<0?-1:1,l=u=0):h===d?(u=u<0?-1:1,s=l=0):(l=l<0?-1:1,s=u=0)}else{var p=A(s,l,u);s/=p,l/=p,u/=p}var y,m,I=t[o],v=t[o+4],E=t[o+8],C=I*s+v*l+E*u,B=A(I-=s*C,v-=l*C,E-=u*C),b=l*(E/=B)-u*(v/=B),x=u*(I/=B)-s*E,w=s*v-l*I,Q=A(b,x,w);if(b/=Q,x/=Q,w/=Q,this.center.jump(e,H,Y,J),this.radius.idle(e),this.up.jump(e,s,l,u),this.right.jump(e,I,v,E),2===a){var _=t[1],S=t[5],k=t[9],D=_*I+S*v+k*E,T=_*b+S*x+k*w;y=N<0?-Math.PI/2:Math.PI/2,m=Math.atan2(T,D)}else{var M=t[2],R=t[6],L=t[10],N=M*s+R*l+L*u,F=M*I+R*v+L*E,O=M*b+R*x+L*w;y=Math.asin(c(N)),m=Math.atan2(O,F)}this.angle.jump(e,m,y),this.recalcMatrix(e);var P=t[2],G=t[6],U=t[10],z=this.computedMatrix;i(z,t);var q=z[15],H=z[12]/q,Y=z[13]/q,J=z[14]/q,K=Math.exp(this.computedRadius[0]);this.center.jump(e,H-P*K,Y-G*K,J-U*K)},f.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},f.idle=function(e){this.center.idle(e),this.up.idle(e),this.right.idle(e),this.radius.idle(e),this.angle.idle(e)},f.flush=function(e){this.center.flush(e),this.up.flush(e),this.right.flush(e),this.radius.flush(e),this.angle.flush(e)},f.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},f.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=A(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=t[0]-r[0],u=t[1]-r[1],g=t[2]-r[2],f=A(l,u,g);if(!(f<1e-6)){l/=f,u/=f,g/=f;var h=this.computedRight,d=h[0],p=h[1],y=h[2],m=i*d+a*p+o*y,I=A(d-=m*i,p-=m*a,y-=m*o);if(!(I<.01&&(I=A(d=a*g-o*u,p=o*l-i*g,y=i*u-a*l))<1e-6)){d/=I,p/=I,y/=I,this.up.set(e,i,a,o),this.right.set(e,d,p,y),this.center.set(e,r[0],r[1],r[2]),this.radius.set(e,Math.log(f));var v=a*y-o*p,E=o*d-i*y,C=i*p-a*d,B=A(v,E,C),b=i*l+a*u+o*g,x=d*l+p*u+y*g,w=(v/=B)*l+(E/=B)*u+(C/=B)*g,Q=Math.asin(c(b)),_=Math.atan2(w,x),S=this.angle._state,k=S[S.length-1],D=S[S.length-2];k%=2*Math.PI;var T=Math.abs(k+2*Math.PI-_),M=Math.abs(k-_),R=Math.abs(k-2*Math.PI-_);T0?r.pop():new ArrayBuffer(e)}function h(e){return new Uint8Array(f(e),0,e)}function d(e){return new Uint16Array(f(2*e),0,e)}function p(e){return new Uint32Array(f(4*e),0,e)}function y(e){return new Int8Array(f(e),0,e)}function m(e){return new Int16Array(f(2*e),0,e)}function I(e){return new Int32Array(f(4*e),0,e)}function v(e){return new Float32Array(f(4*e),0,e)}function E(e){return new Float64Array(f(8*e),0,e)}function C(e){return o?new Uint8ClampedArray(f(e),0,e):h(e)}function B(e){return s?new BigUint64Array(f(8*e),0,e):null}function b(e){return l?new BigInt64Array(f(8*e),0,e):null}function x(e){return new DataView(f(e),0,e)}function w(e){e=n.nextPow2(e);var t=n.log2(e),r=u[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))u[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);c[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){g(e.buffer)},t.freeArrayBuffer=g,t.freeBuffer=function(e){u[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return f(e);switch(t){case"uint8":return h(e);case"uint16":return d(e);case"uint32":return p(e);case"int8":return y(e);case"int16":return m(e);case"int32":return I(e);case"float":case"float32":return v(e);case"double":case"float64":return E(e);case"uint8_clamped":return C(e);case"bigint64":return b(e);case"biguint64":return B(e);case"buffer":return w(e);case"data":case"dataview":return x(e);default:return null}return null},t.mallocArrayBuffer=f,t.mallocUint8=h,t.mallocUint16=d,t.mallocUint32=p,t.mallocInt8=y,t.mallocInt16=m,t.mallocInt32=I,t.mallocFloat32=t.mallocFloat=v,t.mallocFloat64=t.mallocDouble=E,t.mallocUint8Clamped=C,t.mallocBigUint64=B,t.mallocBigInt64=b,t.mallocDataView=x,t.mallocBuffer=w,t.clearCache=function(){for(var e=0;e<32;++e)A.UINT8[e].length=0,A.UINT16[e].length=0,A.UINT32[e].length=0,A.INT8[e].length=0,A.INT16[e].length=0,A.INT32[e].length=0,A.FLOAT[e].length=0,A.DOUBLE[e].length=0,A.BIGUINT64[e].length=0,A.BIGINT64[e].length=0,A.UINT8C[e].length=0,c[e].length=0,u[e].length=0}},1755:function(e){"use strict";function t(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(e){return e})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",C(function(e,t,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(B=0;B-1?parseInt(e[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),w*=Math.pow(.75,l-s),n=n.replace("?px ",F())),x+=.25*S*(l-s)}if(!0===o.superscripts){var A=e.indexOf(h),u=r.indexOf(h),f=A>-1?parseInt(e[1+A]):0,d=u>-1?parseInt(r[1+u]):0;f!==d&&(n=n.replace(F(),"?px "),w*=Math.pow(.75,d-f),n=n.replace("?px ",F())),x-=.25*S*(d-f)}if(!0===o.bolds){var p=e.indexOf(c)>-1,m=r.indexOf(c)>-1;!p&&m&&(n=I?n.replace("italic ","italic bold "):"bold "+n),p&&!m&&(n=n.replace("bold ",""))}if(!0===o.italics){var I=e.indexOf(g)>-1,v=r.indexOf(g)>-1;!I&&v&&(n="italic "+n),I&&!v&&(n=n.replace("italic ",""))}t.font=n}for(C=0;C<_;++C){var P=Q[C]+"\n";for(b=0,x=C*S,w=n,L="",B=0;B",a="",o=i.length,s=a.length,l=t[0]===h||t[0]===y,A=0,c=-s;A>-1&&-1!==(A=r.indexOf(i,A))&&-1!==(c=r.indexOf(a,A+o))&&!(c<=A);){for(var u=A;u=c)n[u]=null,r=r.substr(0,u)+" "+r.substr(u+1);else if(null!==n[u]){var g=n[u].indexOf(t[0]);-1===g?n[u]+=t:l&&(n[u]=n[u].substr(0,g+1)+(1+parseInt(n[u][g+1]))+n[u].substr(g+2))}var f=A+o,d=r.substr(f,c-f).indexOf(i);A=-1!==d?d:c+s}return n}function v(e,t){var r=n(e,128);return t?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function E(e,t,r,n){var i=v(e,n),a=function(e,t,r){for(var n=t.textAlign||"start",i=t.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=e.length,l=0;l=0?t[a]:i}))},has___:{value:I((function(t){var n=m(t);return n?r in n:e.indexOf(t)>=0}))},set___:{value:I((function(n,i){var a,o=m(n);return o?o[r]=i:(a=e.indexOf(n))>=0?t[a]=i:(a=e.length,t[a]=i,e[a]=n),this}))},delete___:{value:I((function(n){var i,a,o=m(n);return o?r in o&&delete o[r]:!((i=e.indexOf(n))<0)&&(a=e.length-1,e[i]=void 0,t[i]=t[a],e[i]=e[a],e.length=a,t.length=a,!0)}))}})};d.prototype=Object.create(Object.prototype,{get:{value:function(e,t){return this.get___(e,t)},writable:!0,configurable:!0},has:{value:function(e){return this.has___(e)},writable:!0,configurable:!0},set:{value:function(e,t){return this.set___(e,t)},writable:!0,configurable:!0},delete:{value:function(e){return this.delete___(e)},writable:!0,configurable:!0}}),"function"===typeof r?function(){function n(){this instanceof d||v();var e,n=new r,i=void 0,a=!1;return e=t?function(e,t){return n.set(e,t),n.has(e)||(i||(i=new d),i.set(e,t)),this}:function(e,t){if(a)try{n.set(e,t)}catch(r){i||(i=new d),i.set___(e,t)}else n.set(e,t);return this},Object.create(d.prototype,{get___:{value:I((function(e,t){return i?n.has(e)?n.get(e):i.get___(e,t):n.get(e,t)}))},has___:{value:I((function(e){return n.has(e)||!!i&&i.has___(e)}))},set___:{value:I(e)},delete___:{value:I((function(e){var t=!!n.delete(e);return i&&i.delete___(e)||t}))},permitHostObjects___:{value:I((function(e){if(e!==p)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!==typeof Proxy&&(Proxy=void 0),n.prototype=d.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!==typeof Proxy&&(Proxy=void 0),e.exports=d)}function p(e){e.permitHostObjects___&&e.permitHostObjects___(p)}function y(e){return!(e.substr(0,8)==l&&"___"===e.substr(e.length-3))}function m(e){if(e!==Object(e))throw new TypeError("Not an object: "+e);var t=e[A];if(t&&t.key===e)return t;if(s(e)){t={key:e};try{return o(e,A,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch(r){return}}}function I(e){return e.prototype=null,Object.freeze(e)}function v(){f||"undefined"===typeof console||(f=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(e,t,r){var n=r(8284);e.exports=function(){var e={};return function(t){if(("object"!==typeof t||null===t)&&"function"!==typeof t)throw new Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:n(t,e)}}},8284:function(e){e.exports=function(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(e){return e!==t?n.apply(this,arguments):r},writable:!0}),r}},606:function(e,t,r){var n=r(236);e.exports=function(){var e=n();return{get:function(t,r){var n=e(t);return n.hasOwnProperty("value")?n.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}},3349:function(e){"use strict";var t=function(){return function(e,t,r,n,i,a){var o=e[0],s=r[0],l=[0],A=s;n|=0;var c=0,u=s;for(c=0;c=0!==f>=0&&i.push(l[0]+.5+.5*(g+f)/(g-f)),n+=u,++l[0]}}};e.exports=function(e){return r={funcName:e.funcName},function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=t[s];return l||(t[s]=l=e([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(t.bind(void 0,r));var r}({funcName:"zeroCrossings"})},781:function(e,t,r){"use strict";e.exports=function(e,t){var r=[];return t=+t||0,n(e.hi(e.shape[0]-1),r,t),r};var n=r(3349)},7790:function(){}},r={};function i(e){var n=r[e];if(void 0!==n)return n.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}i.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),i.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var a=i(1964);e.exports=a}()},33576:function(e,t,r){"use strict";function n(e,t){for(var r=0;rf)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,d.prototype),t}function d(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return m(e)}return p(e,t,r)}function p(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!d.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|C(e,t),n=h(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(re(e,Uint8Array)){var t=new Uint8Array(e);return v(t.buffer,t.byteOffset,t.byteLength)}return I(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(e));if(re(e,ArrayBuffer)||e&&re(e.buffer,ArrayBuffer))return v(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(re(e,SharedArrayBuffer)||e&&re(e.buffer,SharedArrayBuffer)))return v(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return d.from(n,t,r);var i=function(e){if(d.isBuffer(e)){var t=0|E(e.length),r=h(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||ne(e.length)?h(0):I(e):"Buffer"===e.type&&Array.isArray(e.data)?I(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return d.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(e))}function y(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function m(e){return y(e),h(e<0?0:0|E(e))}function I(e){for(var t=e.length<0?0:0|E(e.length),r=h(t),n=0;n=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|e}function C(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||re(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+A(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function B(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function x(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ne(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=d.from(t,n)),d.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function A(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var u=!0,g=0;gi&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,A=void 0,c=void 0,u=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(u=(31&a)<<6|63&l)>127&&(o=u);break;case 3:l=e[i+1],A=e[i+2],128===(192&l)&&128===(192&A)&&(u=(15&a)<<12|(63&l)<<6|63&A)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:l=e[i+1],A=e[i+2],c=e[i+3],128===(192&l)&&128===(192&A)&&128===(192&c)&&(u=(15&a)<<18|(63&l)<<12|(63&A)<<6|63&c)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?(d.isBuffer(a)||(a=d.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!d.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},d.byteLength=C,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},g&&(d.prototype[g]=d.prototype.inspect),d.prototype.compare=function(e,t,r,n,i){if(re(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+A(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(n,i),c=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return Q(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function L(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function G(e,t,r,n,i,a){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function U(e,t,r,n,i){V(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function z(e,t,r,n,i){V(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function q(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,4),u.write(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,8),u.write(e,t,r,n,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},d.prototype.readUint8=d.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readBigUInt64LE=ae((function(e){W(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},d.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readBigInt64LE=ae((function(e){W(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Z(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||P(e,4,this.length),u.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),u.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),u.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),u.read(this,e,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||G(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigUInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=ae((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>>=0,!n){var i=Math.pow(2,8*r-1);G(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=ae((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,n){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function V(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new J.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||Z(t,e.length-(r+1))}(n,i,a)}function W(e,t){if("number"!==typeof e)throw new J.ERR_INVALID_ARG_TYPE(t,"number",e)}function Z(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new J.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new J.ERR_BUFFER_OUT_OF_BOUNDS;throw new J.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}K("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),K("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(A(t))}),TypeError),K("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=j(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=j(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var X=/[^+/0-9A-Za-z-_]/g;function $(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function ee(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function te(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!==e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ae(e){return"undefined"===typeof BigInt?oe:e}function oe(){throw new Error("BigInt not supported")}},25928:function(e){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},48932:function(e,t,r){"use strict";r.r(t),r.d(t,{sankeyCenter:function(){return g},sankeyCircular:function(){return k},sankeyJustify:function(){return u},sankeyLeft:function(){return A},sankeyRight:function(){return c}});var n=r(84706),i=r(34712),a=r(10132),o=r(6688),s=r.n(o);function l(e){return e.target.depth}function A(e){return e.depth}function c(e,t){return t-1-e.height}function u(e,t){return e.sourceLinks.length?e.depth:t-1}function g(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?(0,n.SY)(e.sourceLinks,l)-1:0}function f(e){return function(){return e}}var h="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function d(e,t){return y(e.source,t.source)||e.index-t.index}function p(e,t){return y(e.target,t.target)||e.index-t.index}function y(e,t){return e.partOfCycle===t.partOfCycle?e.y0-t.y0:"top"===e.circularLinkType||"bottom"===t.circularLinkType?-1:1}function m(e){return e.value}function I(e){return(e.y0+e.y1)/2}function v(e){return I(e.source)}function E(e){return I(e.target)}function C(e){return e.index}function B(e){return e.nodes}function b(e){return e.links}function x(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function w(e,t){return t(e)}var Q=25,_=10,S=.3;function k(){var e,t,r=0,a=0,o=1,l=1,A=24,c=C,g=u,w=B,k=b,T=32,R=2,L=null;function F(){var u={nodes:w.apply(null,arguments),links:k.apply(null,arguments)};!function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=(0,i.kH)(e.nodes,c);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==("undefined"===typeof n?"undefined":h(n))&&(n=e.source=x(t,n)),"object"!==("undefined"===typeof i?"undefined":h(i))&&(i=e.target=x(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(u),function(e,t,r){var n=0;if(null===r){for(var i=[],a=0;a0;--h)p(f*=.99,u),C();function d(i){if(t){var c=1/0;g.forEach((function(e){var r=l*t/(e.length+1);c=r0?t+Q+_:t,bottom:r=r>0?r+Q+_:r,left:a=a>0?a+Q+_:a,right:i=i>0?i+Q+_:i}}(s),h=function(e,t){var i=(0,n.kv)(e.nodes,(function(e){return e.column})),s=o-r,c=l-a,u=s+t.right+t.left,g=c+t.top+t.bottom,f=s/u,h=c/g;return r=r*f+t.left,o=0==t.right?o:o*f,a=a*h+t.top,l*=h,e.nodes.forEach((function(e){e.x0=r+e.column*((o-r-A)/i),e.x1=e.x0+A})),h}(s,f);u*=h,s.links.forEach((function(e){e.width=e.value*u})),g.forEach((function(e){var t=e.length;e.forEach((function(e,r){e.depth==g.length-1&&1==t||0==e.depth&&1==t?(e.y0=l/2-e.value*u,e.y1=e.y0+e.value*u):e.partOfCycle?0==M(e,i)?(e.y0=l/2+r,e.y1=e.y0+e.value*u):"top"==e.circularLinkType?(e.y0=a+r,e.y1=e.y0+e.value*u):(e.y0=l-e.value*u-r,e.y1=e.y0+e.value*u):0==f.top||0==f.bottom?(e.y0=(l-a)/t*r,e.y1=e.y0+e.value*u):(e.y0=(l-a)/2-t/2+r,e.y1=e.y0+e.value*u)}))}))}function p(e,t){var r=g.length;g.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&M(i,t)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else if(o==r-1&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else{var A=(0,n.mo)(i.sourceLinks,E),c=(0,n.mo)(i.targetLinks,v),u=((A&&c?(A+c)/2:A||c)-I(i))*e;i.y0+=u,i.y1+=u}}))}))}function C(){g.forEach((function(t){var r,n,i,o=a,s=t.length;for(t.sort(y),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+e;if((n=o-e-l)>0)for(o=r.y0-=n,r.y1-=n,i=s-2;i>=0;--i)(n=(r=t[i]).y1+e-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}(u,T,c),O(u);for(var f=0;f<4;f++)j(u,l,c),V(u,0,c),J(u,a,l,c),j(u,l,c),V(u,0,c);return function(e,t,r){var i=e.nodes,a=e.links,o=!1,s=!1;if(a.forEach((function(e){"top"==e.circularLinkType?o=!0:"bottom"==e.circularLinkType&&(s=!0)})),0==o||0==s){var l=(0,n.SY)(i,(function(e){return e.y0})),A=(r-t)/((0,n.kv)(i,(function(e){return e.y1}))-l);i.forEach((function(e){var t=(e.y1-e.y0)*A;e.y0=(e.y0-l)*A,e.y1=e.y0+t})),a.forEach((function(e){e.y0=(e.y0-l)*A,e.y1=(e.y1-l)*A,e.width=e.width*A}))}}(u,a,l),N(u,R,l,c),u}function O(e){e.nodes.forEach((function(e){e.sourceLinks.sort(p),e.targetLinks.sort(d)})),e.nodes.forEach((function(e){var t=e.y0,r=t,n=e.y1,i=n;e.sourceLinks.forEach((function(e){e.circular?(e.y0=n-e.width/2,n-=e.width):(e.y0=t+e.width/2,t+=e.width)})),e.targetLinks.forEach((function(e){e.circular?(e.y1=i-e.width/2,i-=e.width):(e.y1=r+e.width/2,r+=e.width)}))}))}return F.nodeId=function(e){return arguments.length?(c="function"===typeof e?e:f(e),F):c},F.nodeAlign=function(e){return arguments.length?(g="function"===typeof e?e:f(e),F):g},F.nodeWidth=function(e){return arguments.length?(A=+e,F):A},F.nodePadding=function(t){return arguments.length?(e=+t,F):e},F.nodes=function(e){return arguments.length?(w="function"===typeof e?e:f(e),F):w},F.links=function(e){return arguments.length?(k="function"===typeof e?e:f(e),F):k},F.size=function(e){return arguments.length?(r=a=0,o=+e[0],l=+e[1],F):[o-r,l-a]},F.extent=function(e){return arguments.length?(r=+e[0][0],o=+e[1][0],a=+e[0][1],l=+e[1][1],F):[[r,a],[o,l]]},F.iterations=function(e){return arguments.length?(T=+e,F):T},F.circularLinkGap=function(e){return arguments.length?(R=+e,F):R},F.nodePaddingRatio=function(e){return arguments.length?(t=+e,F):t},F.sortNodes=function(e){return arguments.length?(L=e,F):L},F.update=function(e){return D(e,c),O(e),e.links.forEach((function(e){e.circular&&(e.circularLinkType=e.y0+e.y11||i>1)}function L(e,t,r){return e.sort(F),e.forEach((function(n,i){var a,o,s=0;if(X(n,r)&&R(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var A=e[l].circularPathData.verticalBuffer+e[l].width/2+t;s=A>s?A:s}n.circularPathData.verticalBuffer=s+n.width/2}})),e}function N(e,t,r,i){var o=(0,n.SY)(e.links,(function(e){return e.source.y0}));e.links.forEach((function(e){e.circular&&(e.circularPathData={})})),L(e.links.filter((function(e){return"top"==e.circularLinkType})),t,i),L(e.links.filter((function(e){return"bottom"==e.circularLinkType})),t,i),e.links.forEach((function(n){if(n.circular){if(n.circularPathData.arcRadius=n.width+_,n.circularPathData.leftNodeBuffer=5,n.circularPathData.rightNodeBuffer=5,n.circularPathData.sourceWidth=n.source.x1-n.source.x0,n.circularPathData.sourceX=n.source.x0+n.circularPathData.sourceWidth,n.circularPathData.targetX=n.target.x0,n.circularPathData.sourceY=n.y0,n.circularPathData.targetY=n.y1,X(n,i)&&R(n))n.circularPathData.leftSmallArcRadius=_+n.width/2,n.circularPathData.leftLargeArcRadius=_+n.width/2,n.circularPathData.rightSmallArcRadius=_+n.width/2,n.circularPathData.rightLargeArcRadius=_+n.width/2,"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=n.source.y1+Q+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=n.source.y0-Q-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius);else{var s=n.source.column,l=n.circularLinkType,A=e.links.filter((function(e){return e.source.column==s&&e.circularLinkType==l}));"bottom"==n.circularLinkType?A.sort(P):A.sort(O);var c=0;A.forEach((function(e,r){e.circularLinkID==n.circularLinkID&&(n.circularPathData.leftSmallArcRadius=_+n.width/2+c,n.circularPathData.leftLargeArcRadius=_+n.width/2+r*t+c),c+=e.width})),s=n.target.column,A=e.links.filter((function(e){return e.target.column==s&&e.circularLinkType==l})),"bottom"==n.circularLinkType?A.sort(U):A.sort(G),c=0,A.forEach((function(e,r){e.circularLinkID==n.circularLinkID&&(n.circularPathData.rightSmallArcRadius=_+n.width/2+c,n.circularPathData.rightLargeArcRadius=_+n.width/2+r*t+c),c+=e.width})),"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=Math.max(r,n.source.y1,n.target.y1)+Q+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=o-Q-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius)}n.circularPathData.leftInnerExtent=n.circularPathData.sourceX+n.circularPathData.leftNodeBuffer,n.circularPathData.rightInnerExtent=n.circularPathData.targetX-n.circularPathData.rightNodeBuffer,n.circularPathData.leftFullExtent=n.circularPathData.sourceX+n.circularPathData.leftLargeArcRadius+n.circularPathData.leftNodeBuffer,n.circularPathData.rightFullExtent=n.circularPathData.targetX-n.circularPathData.rightLargeArcRadius-n.circularPathData.rightNodeBuffer}if(n.circular)n.path=function(e){return"top"==e.circularLinkType?"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 0 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY-e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 0 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 0 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY-e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 0 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY:"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 1 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY+e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 1 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 1 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY+e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 1 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY}(n);else{var u=(0,a.ak)().source((function(e){return[e.source.x0+(e.source.x1-e.source.x0),e.y0]})).target((function(e){return[e.target.x0,e.y1]}));n.path=u(n)}}))}function F(e,t){return z(e)==z(t)?"bottom"==e.circularLinkType?P(e,t):O(e,t):z(t)-z(e)}function O(e,t){return e.y0-t.y0}function P(e,t){return t.y0-e.y0}function G(e,t){return e.y1-t.y1}function U(e,t){return t.y1-e.y1}function z(e){return e.target.column-e.source.column}function q(e){return e.target.x0-e.source.x1}function H(e,t){var r=T(e),n=q(t)/Math.tan(r);return"up"==Z(e)?e.y1+n:e.y1-n}function Y(e,t){var r=T(e),n=q(t)/Math.tan(r);return"up"==Z(e)?e.y1-n:e.y1+n}function J(e,t,r,n){e.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)e.nodes.forEach((function(o){if(o.column==a){var A,c=s/(l+1),u=Math.pow(1-c,3),g=3*c*Math.pow(1-c,2),f=3*Math.pow(c,2)*(1-c),h=Math.pow(c,3),d=u*i.y0+g*i.y0+f*i.y1+h*i.y1,p=d-i.width/2,y=d+i.width/2;p>o.y0&&pa.y0&&i.y0a.y0&&i.y1a.y1)&&K(e,A,t,r)}))):(y>o.y0&&yo.y1)&&(A=y-o.y0+10,o=K(o,A,t,r),e.nodes.forEach((function(e){w(e,n)!=w(o,n)&&e.column==o.column&&e.y0o.y1&&K(e,A,t,r)})))}}))}}))}function K(e,t,r,n){return e.y0+t>=r&&e.y1+t<=n&&(e.y0=e.y0+t,e.y1=e.y1+t,e.targetLinks.forEach((function(e){e.y1=e.y1+t})),e.sourceLinks.forEach((function(e){e.y0=e.y0+t}))),e}function j(e,t,r,n){e.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>t&&(i.y=i.y-(i.y+(i.y1-i.y0)-t));var a=e.links.filter((function(e){return w(e.source,r)==w(i,r)})),o=a.length;o>1&&a.sort((function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(!W(e,t))return e.y1-t.y1;if(e.target.column>t.target.column){var r=Y(t,e);return e.y1-r}if(t.target.column>e.target.column)return Y(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(e){e.y0=s+e.width/2,s+=e.width})),a.forEach((function(e,t){if("bottom"==e.circularLinkType){for(var r=t+1,n=0;r1&&n.sort((function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(!W(e,t))return e.y0-t.y0;if(t.source.column0?"up":"down"}function X(e,t){return w(e.source,t)==w(e.target,t)}},26800:function(e,t,r){"use strict";r.r(t),r.d(t,{sankey:function(){return C},sankeyCenter:function(){return A},sankeyJustify:function(){return l},sankeyLeft:function(){return o},sankeyLinkHorizontal:function(){return w},sankeyRight:function(){return s}});var n=r(84706),i=r(34712);function a(e){return e.target.depth}function o(e){return e.depth}function s(e,t){return t-1-e.height}function l(e,t){return e.sourceLinks.length?e.depth:t-1}function A(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?(0,n.SY)(e.sourceLinks,a)-1:0}function c(e){return function(){return e}}function u(e,t){return f(e.source,t.source)||e.index-t.index}function g(e,t){return f(e.target,t.target)||e.index-t.index}function f(e,t){return e.y0-t.y0}function h(e){return e.value}function d(e){return(e.y0+e.y1)/2}function p(e){return d(e.source)*e.value}function y(e){return d(e.target)*e.value}function m(e){return e.index}function I(e){return e.nodes}function v(e){return e.links}function E(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function C(){var e=0,t=0,r=1,a=1,o=24,s=8,A=m,C=l,B=I,b=v,x=32,w=2/3;function Q(){var l={nodes:B.apply(null,arguments),links:b.apply(null,arguments)};return function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=(0,i.kH)(e.nodes,A);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==typeof n&&(n=e.source=E(t,n)),"object"!==typeof i&&(i=e.target=E(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(l),function(e){e.nodes.forEach((function(e){e.value=Math.max((0,n.oh)(e.sourceLinks,h),(0,n.oh)(e.targetLinks,h))}))}(l),function(t){var n,i,a;for(n=t.nodes,i=[],a=0;n.length;++a,n=i,i=[])n.forEach((function(e){e.depth=a,e.sourceLinks.forEach((function(e){i.indexOf(e.target)<0&&i.push(e.target)}))}));for(n=t.nodes,i=[],a=0;n.length;++a,n=i,i=[])n.forEach((function(e){e.height=a,e.targetLinks.forEach((function(e){i.indexOf(e.source)<0&&i.push(e.source)}))}));var s=(r-e-o)/(a-1);t.nodes.forEach((function(t){t.x1=(t.x0=e+Math.max(0,Math.min(a-1,Math.floor(C.call(null,t,a))))*s)+o}))}(l),function(e){var r=(0,i.UJ)().key((function(e){return e.x0})).sortKeys(n.XE).entries(e.nodes).map((function(e){return e.values}));A(),g();for(var o=1,l=x;l>0;--l)u(o*=.99),g(),c(o),g();function A(){var i=(0,n.kv)(r,(function(e){return e.length})),o=w*(a-t)/(i-1);s>o&&(s=o);var l=(0,n.SY)(r,(function(e){return(a-t-(e.length-1)*s)/(0,n.oh)(e,h)}));r.forEach((function(e){e.forEach((function(e,t){e.y1=(e.y0=t)+e.value*l}))})),e.links.forEach((function(e){e.width=e.value*l}))}function c(e){r.forEach((function(t){t.forEach((function(t){if(t.targetLinks.length){var r=((0,n.oh)(t.targetLinks,p)/(0,n.oh)(t.targetLinks,h)-d(t))*e;t.y0+=r,t.y1+=r}}))}))}function u(e){r.slice().reverse().forEach((function(t){t.forEach((function(t){if(t.sourceLinks.length){var r=((0,n.oh)(t.sourceLinks,y)/(0,n.oh)(t.sourceLinks,h)-d(t))*e;t.y0+=r,t.y1+=r}}))}))}function g(){r.forEach((function(e){var r,n,i,o=t,l=e.length;for(e.sort(f),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+s;if((n=o-s-a)>0)for(o=r.y0-=n,r.y1-=n,i=l-2;i>=0;--i)(n=(r=e[i]).y1+s-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}(l),_(l),l}function _(e){e.nodes.forEach((function(e){e.sourceLinks.sort(g),e.targetLinks.sort(u)})),e.nodes.forEach((function(e){var t=e.y0,r=t;e.sourceLinks.forEach((function(e){e.y0=t+e.width/2,t+=e.width})),e.targetLinks.forEach((function(e){e.y1=r+e.width/2,r+=e.width}))}))}return Q.update=function(e){return _(e),e},Q.nodeId=function(e){return arguments.length?(A="function"===typeof e?e:c(e),Q):A},Q.nodeAlign=function(e){return arguments.length?(C="function"===typeof e?e:c(e),Q):C},Q.nodeWidth=function(e){return arguments.length?(o=+e,Q):o},Q.nodePadding=function(e){return arguments.length?(s=+e,Q):s},Q.nodes=function(e){return arguments.length?(B="function"===typeof e?e:c(e),Q):B},Q.links=function(e){return arguments.length?(b="function"===typeof e?e:c(e),Q):b},Q.size=function(n){return arguments.length?(e=t=0,r=+n[0],a=+n[1],Q):[r-e,a-t]},Q.extent=function(n){return arguments.length?(e=+n[0][0],r=+n[1][0],t=+n[0][1],a=+n[1][1],Q):[[e,t],[r,a]]},Q.iterations=function(e){return arguments.length?(x=+e,Q):x},Q}var B=r(10132);function b(e){return[e.source.x1,e.y0]}function x(e){return[e.target.x0,e.y1]}function w(){return(0,B.ak)().source(b).target(x)}},33428:function(e,t,r){var n,i;(function(){var a={version:"3.8.0"},o=[].slice,s=function(e){return o.call(e)},l=self.document;function A(e){return e&&(e.ownerDocument||e.document||e).documentElement}function c(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(l)try{s(l.documentElement.childNodes)[0].nodeType}catch(ya){s=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(ma){var u=this.Element.prototype,g=u.setAttribute,f=u.setAttributeNS,h=this.CSSStyleDeclaration.prototype,d=h.setProperty;u.setAttribute=function(e,t){g.call(this,e,t+"")},u.setAttributeNS=function(e,t,r){f.call(this,e,t,r+"")},h.setProperty=function(e,t,r){d.call(this,e,t+"",r)}}function p(e,t){return et?1:e>=t?0:NaN}function y(e){return null===e?NaN:+e}function m(e){return!isNaN(e)}function I(e){return{left:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}a.ascending=p,a.descending=function(e,t){return te?1:t>=e?0:NaN},a.min=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},a.max=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},a.extent=function(e,t){var r,n,i,a=-1,o=e.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},a.deviation=function(){var e=a.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=I(p);function E(e){return e.length}a.bisectLeft=v.left,a.bisect=a.bisectRight=v.right,a.bisector=function(e){return I(1===e.length?function(t,r){return p(e(t),r)}:e)},a.shuffle=function(e,t,r){(a=arguments.length)<3&&(r=e.length,a<2&&(t=0));for(var n,i,a=r-t;a;)i=Math.random()*a--|0,n=e[a+t],e[a+t]=e[i+t],e[i+t]=n;return e},a.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},a.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],i=new Array(r<0?0:r);t=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r};var C=Math.abs;function B(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function b(){this._=Object.create(null)}a.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r===1/0)throw new Error("infinite range");var n,i=[],a=function(e){for(var t=1;e*t%1;)t*=10;return t}(C(r)),o=-1;if(e*=a,t*=a,(r*=a)<0)for(;(n=e+r*++o)>t;)i.push(n/a);else for(;(n=e+r*++o)=n.length)return t?t.call(r,a):e?a.sort(e):a;for(var l,A,c,u,g=-1,f=a.length,h=n[s++],d=new b;++g=n.length)return e;var r=[],a=i[t++];return e.forEach((function(e,n){r.push({key:e,values:s(n,t)})})),a?r.sort((function(e,t){return a(e.key,t.key)})):r}return r.map=function(e,t){return o(t,e,0)},r.entries=function(e){return s(o(a.map,e,0),0)},r.key=function(e){return n.push(e),r},r.sortKeys=function(e){return i[n.length-1]=e,r},r.sortValues=function(t){return e=t,r},r.rollup=function(e){return t=e,r},r},a.set=function(e){var t=new R;if(e)for(var r=0,n=e.length;r=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},a.event=null,a.requote=function(e){return e.replace(Y,"\\$&")};var Y=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,J={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function K(e){return J(e,Z),e}var j=function(e,t){return t.querySelector(e)},V=function(e,t){return t.querySelectorAll(e)},W=function(e,t){var r=e.matches||e[F(e,"matchesSelector")];return W=function(e,t){return r.call(e,t)},W(e,t)};"function"===typeof Sizzle&&(j=function(e,t){return Sizzle(e,t)[0]||null},V=Sizzle,W=Sizzle.matchesSelector),a.selection=function(){return a.select(l.documentElement)};var Z=a.selection.prototype=[];function X(e){return"function"===typeof e?e:function(){return j(e,this)}}function $(e){return"function"===typeof e?e:function(){return V(e,this)}}Z.select=function(e){var t,r,n,i,a=[];e=X(e);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),te.hasOwnProperty(r)?{space:te[r],local:e}:e}},Z.attr=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node();return(e=a.ns.qualify(e)).local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}for(t in e)this.each(re(t,e[t]));return this}return this.each(re(e,t))},Z.classed=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node(),n=(e=ae(e)).length,i=-1;if(t=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Z.sort=function(e){e=he.apply(this,arguments);for(var t=-1,r=this.length;++t0&&(e=e.slice(0,i));var l=Ie.get(e);function A(){var t=this[n];t&&(this.removeEventListener(e,t,t.$),delete this[n])}return l&&(e=l,o=Ee),i?t?function(){var i=o(t,s(arguments));A.call(this),this.addEventListener(e,this[n]=i,i.$=r),i._=t}:A:t?P:function(){var t,r=new RegExp("^__on([^.]+)"+a.requote(e)+"$");for(var n in this)if(t=n.match(r)){var i=this[n];this.removeEventListener(t[1],i,i.$),delete this[n]}}}a.selection.enter=pe,a.selection.enter.prototype=ye,ye.append=Z.append,ye.empty=Z.empty,ye.node=Z.node,ye.call=Z.call,ye.size=Z.size,ye.select=function(e){for(var t,r,n,i,a,o=[],s=-1,l=this.length;++s=t&&(t=i+1);!(o=s[t])&&++t1?Me:e<-1?-Me:Math.asin(e)}function Fe(e){return((e=Math.exp(e))+1/e)/2}var Oe=Math.SQRT2;a.interpolateZoom=function(e,t){var r,n,i=e[0],a=e[1],o=e[2],s=t[0],l=t[1],A=t[2],c=s-i,u=l-a,g=c*c+u*u;if(g0&&(e=e.transition().duration(d)),e.call(C.event)}function Q(){s&&s.domain(o.range().map((function(e){return(e-g.x)/g.k})).map(o.invert)),u&&u.domain(A.range().map((function(e){return(e-g.y)/g.k})).map(A.invert))}function _(e){p++||e({type:"zoomstart"})}function S(e){Q(),e({type:"zoom",scale:g.k,translate:[g.x,g.y]})}function k(e){--p||(e({type:"zoomend"}),t=null)}function D(){var e=this,t=E.of(e,arguments),r=0,n=a.select(c(e)).on(m,(function(){r=1,x(a.mouse(e),i),S(t)})).on(I,(function(){n.on(m,null).on(I,null),o(r),k(t)})),i=B(a.mouse(e)),o=be(e);Xi.call(e),_(t)}function T(){var e,t=this,r=E.of(t,arguments),n={},o=0,s=".zoom-"+a.event.changedTouches[0].identifier,l="touchmove"+s,A="touchend"+s,c=[],u=a.select(t),f=be(t);function h(){var r=a.touches(t);return e=g.k,r.forEach((function(e){e.identifier in n&&(n[e.identifier]=B(e))})),r}function d(){var e=a.event.target;a.select(e).on(l,p).on(A,m),c.push(e);for(var r=a.event.changedTouches,s=0,u=r.length;s1){y=f[0];var I=f[1],v=y[0]-I[0],E=y[1]-I[1];o=v*v+E*E}}function p(){var s,l,A,c,u=a.touches(t);Xi.call(t);for(var g=0,f=u.length;g360?e-=360:e<0&&(e+=360),e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+t):r+t-r*t),new ot(a(e+120),a(e),a(e-120))}function Je(e,t,r){return this instanceof Je?(this.h=+e,this.c=+t,void(this.l=+r)):arguments.length<2?e instanceof Je?new Je(e.h,e.c,e.l):rt(e instanceof Ve?e.l:(e=ft((e=a.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Je(e,t,r)}He.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new qe(this.h,this.s,this.l/e)},He.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new qe(this.h,this.s,e*this.l)},He.rgb=function(){return Ye(this.h,this.s,this.l)},a.hcl=Je;var Ke=Je.prototype=new ze;function je(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Ve(r,Math.cos(e*=Re)*t,Math.sin(e)*t)}function Ve(e,t,r){return this instanceof Ve?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Ve?new Ve(e.l,e.a,e.b):e instanceof Je?je(e.h,e.c,e.l):ft((e=ot(e)).r,e.g,e.b):new Ve(e,t,r)}Ke.brighter=function(e){return new Je(this.h,this.c,Math.min(100,this.l+We*(arguments.length?e:1)))},Ke.darker=function(e){return new Je(this.h,this.c,Math.max(0,this.l-We*(arguments.length?e:1)))},Ke.rgb=function(){return je(this.h,this.c,this.l).rgb()},a.lab=Ve;var We=18,Ze=.95047,Xe=1,$e=1.08883,et=Ve.prototype=new ze;function tt(e,t,r){var n=(e+16)/116,i=n+t/500,a=n-r/200;return new ot(at(3.2404542*(i=nt(i)*Ze)-1.5371385*(n=nt(n)*Xe)-.4985314*(a=nt(a)*$e)),at(-.969266*i+1.8760108*n+.041556*a),at(.0556434*i-.2040259*n+1.0572252*a))}function rt(e,t,r){return e>0?new Je(Math.atan2(r,t)*Le,Math.sqrt(t*t+r*r),e):new Je(NaN,NaN,e)}function nt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function it(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function at(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function ot(e,t,r){return this instanceof ot?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof ot?new ot(e.r,e.g,e.b):ut(""+e,ot,Ye):new ot(e,t,r)}function st(e){return new ot(e>>16,e>>8&255,255&e)}function lt(e){return st(e)+""}et.brighter=function(e){return new Ve(Math.min(100,this.l+We*(arguments.length?e:1)),this.a,this.b)},et.darker=function(e){return new Ve(Math.max(0,this.l-We*(arguments.length?e:1)),this.a,this.b)},et.rgb=function(){return tt(this.l,this.a,this.b)},a.rgb=ot;var At=ot.prototype=new ze;function ct(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function ut(e,t,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.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 t(dt(i[0]),dt(i[1]),dt(i[2]))}return(a=pt.get(e))?t(a.r,a.g,a.b):(null==e||"#"!==e.charAt(0)||isNaN(a=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===e.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),t(o,s,l))}function gt(e,t,r){var n,i,a=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=e==o?(t-r)/s+(t0&&l<1?0:n),new qe(n,i,l)}function ft(e,t,r){var n=it((.4124564*(e=ht(e))+.3575761*(t=ht(t))+.1804375*(r=ht(r)))/Ze),i=it((.2126729*e+.7151522*t+.072175*r)/Xe);return Ve(116*i-16,500*(n-i),200*(i-it((.0193339*e+.119192*t+.9503041*r)/$e)))}function ht(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function dt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}At.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,i=30;return t||r||n?(t&&t=200&&t<300||304===t){try{e=r.call(i,A)}catch(ya){return void o.error.call(i,ya)}o.load.call(i,e)}else o.error.call(i,A)}return self.XDomainRequest&&!("withCredentials"in A)&&/^(http(s)?:)?\/\//.test(e)&&(A=new XDomainRequest),"onload"in A?A.onload=A.onerror=u:A.onreadystatechange=function(){A.readyState>3&&u()},A.onprogress=function(e){var t=a.event;a.event=e;try{o.progress.call(i,A)}finally{a.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(c=e,i):c},i.response=function(e){return r=e,i},["get","post"].forEach((function(e){i[e]=function(){return i.send.apply(i,[e].concat(s(arguments)))}})),i.send=function(r,n,a){if(2===arguments.length&&"function"===typeof n&&(a=n,n=null),A.open(r,e,!0),null==t||"accept"in l||(l.accept=t+",*/*"),A.setRequestHeader)for(var s in l)A.setRequestHeader(s,l[s]);return null!=t&&A.overrideMimeType&&A.overrideMimeType(t),null!=c&&(A.responseType=c),null!=a&&i.on("error",a).on("load",(function(e){a(null,e)})),o.beforesend.call(i,A),A.send(null==n?null:n),i},i.abort=function(){return A.abort(),i},a.rebind(i,o,"on"),null==n?i:i.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(n))}pt.forEach((function(e,t){pt.set(e,st(t))})),a.functor=yt,a.xhr=mt(L),a.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function i(e,r,n){arguments.length<3&&(n=r,r=null);var i=It(e,t,null==r?a:o(r),n);return i.row=function(e){return arguments.length?i.response(null==(r=e)?a:o(e)):r},i}function a(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var r;return i.parseRows(e,(function(e,n){if(r)return r(e,n-1);var i=function(t){for(var r={},n=e.length,i=0;i=l)return o;if(i)return i=!1,a;var t=A;if(34===e.charCodeAt(t)){for(var r=t;r++24?(isFinite(t)&&(clearTimeout(Bt),Bt=setTimeout(wt,t)),Ct=0):(Ct=1,bt(wt))}function Qt(){for(var e=Date.now(),t=vt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function _t(){for(var e,t=vt,r=1/0;t;)t.c?(t.t1&&(t=e[a[o-2]],r=e[a[o-1]],n=e[s],(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function Tt(e,t){return e[0]-t[0]||e[1]-t[1]}a.timer=function(){xt.apply(this,arguments)},a.timer.flush=function(){Qt(),_t()},a.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},a.geom={},a.geom.hull=function(e){var t=St,r=kt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,i=yt(t),a=yt(r),o=e.length,s=[],l=[];for(n=0;n=0;--n)f.push(e[s[A[n]][2]]);for(n=+u;n_e)s=s.L;else{if(!((i=a-Wt(s,o))>_e)){n>-_e?(t=s.P,r=s):i>-_e?(t=s,r=s.N):t=r=s;break}if(!s.R){t=s;break}s=s.R}var l=Yt(e);if(Pt.insert(t,l),t||r){if(t===r)return tr(t),r=Yt(t.site),Pt.insert(l,r),l.edge=r.edge=ir(t.site,l.site),er(t),void er(r);if(r){tr(t),tr(r);var A=t.site,c=A.x,u=A.y,g=e.x-c,f=e.y-u,h=r.site,d=h.x-c,p=h.y-u,y=2*(g*p-f*d),m=g*g+f*f,I=d*d+p*p,v={x:(p*m-f*I)/y+c,y:(g*I-d*m)/y+u};or(r.edge,A,h,v),l.edge=ir(A,e,null,v),r.edge=ir(e,h,null,v),er(t),er(r)}else l.edge=ir(t.site,l.site)}}function Vt(e,t){var r=e.site,n=r.x,i=r.y,a=i-t;if(!a)return n;var o=e.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,A=l-t;if(!A)return s;var c=s-n,u=1/a-1/A,g=c/A;return u?(-g+Math.sqrt(g*g-2*u*(c*c/(-2*A)-l+A/2+i-a/2)))/u+n:(n+s)/2}function Wt(e,t){var r=e.N;if(r)return Vt(r,t);var n=e.site;return n.y===t?n.x:1/0}function Zt(e){this.site=e,this.edges=[]}function Xt(e,t){return t.angle-e.angle}function $t(){Ar(this),this.x=this.y=this.arc=this.site=this.cy=null}function er(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,i=e.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,A=n.y-s,c=a.x-o,u=2*(l*(p=a.y-s)-A*c);if(!(u>=-Se)){var g=l*l+A*A,f=c*c+p*p,h=(p*g-A*f)/u,d=(l*f-c*g)/u,p=d+s,y=qt.pop()||new $t;y.arc=e,y.site=i,y.x=h+o,y.y=p+Math.sqrt(h*h+d*d),y.cy=p,e.circle=y;for(var m=null,I=Ut._;I;)if(y.y=s)return;if(g>h){if(a){if(a.y>=A)return}else a={x:p,y:l};r={x:p,y:A}}else{if(a){if(a.y1)if(g>h){if(a){if(a.y>=A)return}else a={x:(l-i)/n,y:l};r={x:(A-i)/n,y:A}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(t/=g,g<0){if(t0){if(t>u)return;t>c&&(c=t)}if(t=i-l,g||!(t<0)){if(t/=g,g<0){if(t>u)return;t>c&&(c=t)}else if(g>0){if(t0)){if(t/=f,f<0){if(t0){if(t>u)return;t>c&&(c=t)}if(t=a-A,f||!(t<0)){if(t/=f,f<0){if(t>u)return;t>c&&(c=t)}else if(f>0){if(t0&&(e.a={x:l+c*g,y:A+c*f}),u<1&&(e.b={x:l+u*g,y:A+u*f}),e}}}}}),l=o.length;l--;)(!rr(t=o[l],e)||!s(t)||C(t.a.x-t.b.x)<_e&&C(t.a.y-t.b.y)<_e)&&(t.a=t.b=null,o.splice(l,1))}(t),function(e){for(var t,r,n,i,a,o,s,l,A,c,u=e[0][0],g=e[1][0],f=e[0][1],h=e[1][1],d=Ot,p=d.length;p--;)if((a=d[p])&&a.prepare())for(l=(s=a.edges).length,o=0;o_e||C(i-r)>_e)&&(s.splice(o,0,new sr(ar(a.site,c,C(n-u)<_e&&h-i>_e?{x:u,y:C(t-u)<_e?r:h}:C(i-h)<_e&&g-n>_e?{x:C(r-h)<_e?t:g,y:h}:C(n-g)<_e&&i-f>_e?{x:g,y:C(t-g)<_e?r:f}:C(i-f)<_e&&n-u>_e?{x:C(r-f)<_e?t:u,y:f}:null),a.site,null)),++l)}(t));var o={cells:Ot,edges:Ft};return Pt=Ut=Ft=Ot=null,o}function hr(e,t){return t.y-e.y||t.x-e.x}Zt.prototype.prepare=function(){for(var e,t=this.edges,r=t.length;r--;)(e=t[r].edge).b&&e.a||t.splice(r,1);return t.sort(Xt),t.length},sr.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}},lr.prototype={insert:function(e,t){var r,n,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=gr(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.R&&(cr(this,r),r=(e=r).U),r.C=!1,n.C=!0,ur(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.L&&(ur(this,r),r=(e=r).U),r.C=!1,n.C=!0,cr(this,n)),r=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,r,n,i=e.U,a=e.L,o=e.R;if(r=a?o?gr(o):a:o,i?i.L===e?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=e.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=e.U,e=r.R,i.L=e,r.R=o,o.U=r):(r.U=i,i=r,e=r.R)):(n=e.C,e=r),e&&(e.U=i),!n)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,cr(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ur(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,cr(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,ur(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,cr(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,ur(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}},a.geom.voronoi=function(e){var t=St,r=kt,n=t,i=r,a=dr;if(e)return o(e);function o(e){var t=new Array(e.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return fr(s(e),a).cells.forEach((function(a,s){var l=a.edges,A=a.site;(t[s]=l.length?l.map((function(e){var t=e.start();return[t.x,t.y]})):A.x>=r&&A.x<=i&&A.y>=n&&A.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=e[s]})),t}function s(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/_e)*_e,y:Math.round(i(e,t)/_e)*_e,i:t}}))}return o.links=function(e){return fr(s(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return fr(s(e)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,A=r.edges.sort(Xt),c=-1,u=A.length,g=A[u-1].edge,f=g.l===l?g.r:g.l;++ca&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Er(r,n)})),a=br.lastIndex;return ad&&(d=l.x),l.y>p&&(p=l.y),A.push(l.x),c.push(l.y);else for(u=0;ud&&(d=I),v>p&&(p=v),A.push(I),c.push(v)}var E=d-f,B=p-h;function b(e,t,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var l=e.x,A=e.y;if(null!=l)if(C(l-r)+C(A-n)<.01)x(e,t,r,n,i,a,o,s);else{var c=e.point;e.x=e.y=e.point=null,x(e,c,l,A,i,a,o,s),x(e,t,r,n,i,a,o,s)}else e.x=r,e.y=n,e.point=t}else x(e,t,r,n,i,a,o,s)}function x(e,t,r,n,i,a,o,s){var l=.5*(i+o),A=.5*(a+s),c=r>=l,u=n>=A,g=u<<1|c;e.leaf=!1,c?i=l:o=l,u?a=A:s=A,b(e=e.nodes[g]||(e.nodes[g]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,i,a,o,s)}E>B?p=h+E:d=f+B;var w={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){b(w,e,+y(e,++u),+m(e,u),f,h,d,p)},visit:function(e){mr(e,w,f,h,d,p)},find:function(e){return function(e,t,r,n,i,a,o){var s,l=1/0;return function e(A,c,u,g,f){if(!(c>a||u>o||g=E)<<1|t>=v,B=C+4;C=0&&!(r=a.interpolators[n](e,t)););return r}function wr(e,t){var r,n=[],i=[],a=e.length,o=t.length,s=Math.min(e.length,t.length);for(r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Lr(e){return 1-Math.cos(e*Me)}function Nr(e){return Math.pow(2,10*(e-1))}function Fr(e){return 1-Math.sqrt(1-e*e)}function Or(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Pr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Gr(e){var t,r,n,i=[e.a,e.b],a=[e.c,e.d],o=zr(i),s=Ur(i,a),l=zr(((t=a)[0]+=(n=-s)*(r=i)[0],t[1]+=n*r[1],t))||0;i[0]*a[1]=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):"in";return n=_r.get(n)||Qr,i=Sr.get(i)||L,t=i(n.apply(null,o.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},a.interpolateHcl=function(e,t){e=a.hcl(e),t=a.hcl(t);var r=e.h,n=e.c,i=e.l,o=t.h-r,s=t.c-n,l=t.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?t.c:n),isNaN(o)?(o=0,r=isNaN(r)?t.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return je(r+o*e,n+s*e,i+l*e)+""}},a.interpolateHsl=function(e,t){e=a.hsl(e),t=a.hsl(t);var r=e.h,n=e.s,i=e.l,o=t.h-r,s=t.s-n,l=t.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?t.s:n),isNaN(o)?(o=0,r=isNaN(r)?t.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return Ye(r+o*e,n+s*e,i+l*e)+""}},a.interpolateLab=function(e,t){e=a.lab(e),t=a.lab(t);var r=e.l,n=e.a,i=e.b,o=t.l-r,s=t.a-n,l=t.b-i;return function(e){return tt(r+o*e,n+s*e,i+l*e)+""}},a.interpolateRound=Pr,a.transform=function(e){var t=l.createElementNS(a.ns.prefix.svg,"g");return(a.transform=function(e){if(null!=e){t.setAttribute("transform",e);var r=t.transform.baseVal.consolidate()}return new Gr(r?r.matrix:qr)})(e)},Gr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var qr={a:1,b:0,c:0,d:1,e:0,f:0};function Hr(e){return e.length?e.pop()+",":""}function Yr(e,t){var r=[],n=[];return e=a.transform(e),t=a.transform(t),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:Er(e[0],t[0])},{i:i-2,x:Er(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(e.translate,t.translate,r,n),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Hr(r)+"rotate(",null,")")-2,x:Er(e,t)})):t&&r.push(Hr(r)+"rotate("+t+")")}(e.rotate,t.rotate,r,n),function(e,t,r,n){e!==t?n.push({i:r.push(Hr(r)+"skewX(",null,")")-2,x:Er(e,t)}):t&&r.push(Hr(r)+"skewX("+t+")")}(e.skew,t.skew,r,n),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push(Hr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Er(e[0],t[0])},{i:i-2,x:Er(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(Hr(r)+"scale("+t+")")}(e.scale,t.scale,r,n),e=t=null,function(e){for(var t,i=-1,a=n.length;++i0?r=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:r=0})):t>0&&(l.start({type:"start",alpha:r=t}),e=xt(s.tick)),s):r},s.start=function(){var e,t,r,a=y.length,l=m.length,c=A[0],h=A[1];for(e=0;e=0;)r.push(i[n])}function sn(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(a=e.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(c=A[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=A}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return sn(i,(function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)})),s}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(on(e,(function(e){e.children&&(e.value=0)})),sn(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},a.layout.partition=function(){var e=a.layout.hierarchy(),t=[1,1];function r(e,t,n,i){var a=e.children;if(e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,A=-1;for(n=e.value?n/e.value:0;++As&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=t);return n}function En(e){return e.reduce(Cn,0)}function Cn(e,t){return e+t[1]}function Bn(e,t){return bn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function bn(e,t){for(var r=-1,n=+e[0],i=(e[1]-n)/t,a=[];++r<=t;)a[r]=i*r+n;return a}function xn(e){return[a.min(e),a.max(e)]}function wn(e,t){return e.value-t.value}function Qn(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function _n(e,t){e._pack_next=t,t._pack_prev=e}function Sn(e,t){var r=t.x-e.x,n=t.y-e.y,i=e.r+t.r;return.999*i*i>r*r+n*n}function kn(e){if((t=e.children)&&(l=t.length)){var t,r,n,i,a,o,s,l,A=1/0,c=-1/0,u=1/0,g=-1/0;if(t.forEach(Dn),(r=t[0]).x=-r.r,r.y=0,I(r),l>1&&((n=t[1]).x=n.r,n.y=0,I(n),l>2))for(Rn(r,n,i=t[2]),I(i),Qn(r,i),r._pack_prev=i,Qn(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=u[0]&&l<=u[1]&&((s=A[a.bisect(g,l,1,h)-1]).y+=d,s.push(i[o]));return A}return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(r=yt(e),i):r},i.bins=function(e){return arguments.length?(n="number"===typeof e?function(t){return bn(t,e)}:yt(e),i):n},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},a.layout.pack=function(){var e,t=a.layout.hierarchy().sort(wn),r=0,n=[1,1];function i(i,a){var o=t.call(this,i,a),s=o[0],l=n[0],A=n[1],c=null==e?Math.sqrt:"function"===typeof e?e:function(){return e};if(s.x=s.y=0,sn(s,(function(e){e.r=+c(e.value)})),sn(s,kn),r){var u=r*(e?1:Math.max(2*s.r/l,2*s.r/A))/2;sn(s,(function(e){e.r+=u})),sn(s,kn),sn(s,(function(e){e.r-=u}))}return Mn(s,l/2,A/2,e?1:1/Math.max(2*s.r/l,2*s.r/A)),o}return i.size=function(e){return arguments.length?(n=e,i):n},i.radius=function(t){return arguments.length?(e=null==t||"function"===typeof t?t:+t,i):e},i.padding=function(e){return arguments.length?(r=+e,i):r},an(i,t)},a.layout.tree=function(){var e=a.layout.hierarchy().sort(null).value(null),t=Ln,r=[1,1],n=null;function i(i,a){var A=e.call(this,i,a),c=A[0],u=function(e){for(var t,r={A:null,children:[e]},n=[r];null!=(t=n.pop());)for(var i,a=t.children,o=0,s=a.length;of.x&&(f=e),e.depth>h.depth&&(h=e)}));var d=t(g,f)/2-g.x,p=r[0]/(f.x+t(f,g)/2+d),y=r[1]/(h.depth||1);on(c,(function(e){e.x=(e.x+d)*p,e.y=e.depth*y}))}return A}function o(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r.length){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],A=a.m,c=o.m,u=s.m,g=l.m;s=Fn(s),a=Nn(a),s&&a;)l=Nn(l),(o=Fn(o)).a=e,(i=s.z+u-a.z-A+t(s._,a._))>0&&(On(Pn(s,e,n),e,i),A+=i,c+=i),u+=s.m,A+=a.m,g+=l.m,c+=o.m;s&&!Fn(o)&&(o.t=s,o.m+=u-c),a&&!Nn(l)&&(l.t=a,l.m+=A-g,n=e)}return n}(e,i,e.parent.A||n[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=r[0],e.y=e.depth*r[1]}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e)?l:null,i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null==(r=e)?null:l,i):n?r:null},an(i,e)},a.layout.cluster=function(){var e=a.layout.hierarchy().sort(null).value(null),t=Ln,r=[1,1],n=!1;function i(i,o){var s,l=e.call(this,i,o),A=l[0],c=0;sn(A,(function(e){var r=e.children;r&&r.length?(e.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(r),e.y=function(e){return 1+a.max(e,(function(e){return e.y}))}(r)):(e.x=s?c+=t(e,s):0,e.y=0,s=e)}));var u=Gn(A),g=Un(A),f=u.x-t(u,g)/2,h=g.x+t(g,u)/2;return sn(A,n?function(e){e.x=(e.x-A.x)*r[0],e.y=(A.y-e.y)*r[1]}:function(e){e.x=(e.x-f)/(h-f)*r[0],e.y=(1-(A.y?e.y/A.y:1))*r[1]}),l}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e),i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null!=(r=e),i):n?r:null},an(i,e)},a.layout.treemap=function(){var e,t=a.layout.hierarchy(),r=Math.round,n=[1,1],i=null,o=zn,s=!1,l="squarify",A=.5*(1+Math.sqrt(5));function c(e,t){for(var r,n,i=-1,a=e.length;++i0;)s.push(r=A[i-1]),s.area+=r.area,"squarify"!==l||(n=f(s,d))<=g?(A.pop(),g=n):(s.area-=s.pop().area,h(s,d,a,!1),d=Math.min(a.dx,a.dy),s.length=s.area=0,g=1/0);s.length&&(h(s,d,a,!0),s.length=s.area=0),t.forEach(u)}}function g(e){var t=e.children;if(t&&t.length){var r,n=o(e),i=t.slice(),a=[];for(c(i,n.dx*n.dy/e.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(h(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);t.forEach(g)}}function f(e,t){for(var r,n=e.area,i=0,a=1/0,o=-1,s=e.length;++oi&&(i=r));return t*=t,(n*=n)?Math.max(t*i*A/n,n/(t*a*A)):1/0}function h(e,t,n,i){var a,o=-1,s=e.length,l=n.x,A=n.y,c=t?r(e.area/t):0;if(t==n.dx){for((i||c>n.dy)&&(c=n.dy);++on.dx)&&(c=n.dx);++o1);return e+t*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=a.random.normal.apply(a,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=a.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?Wn:Jn,l=n?Kr:Jr;return i=o(e,t,l,r),a=o(t,e,l,xr),s}function s(e){return i(e)}return s.invert=function(e){return a(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},s.range=function(e){return arguments.length?(t=e,o()):t},s.rangeRound=function(e){return s.range(e).interpolate(Pr)},s.clamp=function(e){return arguments.length?(n=e,o()):n},s.interpolate=function(e){return arguments.length?(r=e,o()):r},s.ticks=function(t){return ti(e,t)},s.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},s.nice=function(t){return $n(e,t),o()},s.copy=function(){return Zn(e,t,r,n)},o()}function Xn(e,t){return a.rebind(e,t,"range","rangeRound","interpolate","clamp")}function $n(e,t){return Kn(e,jn(ei(e,t)[2])),Kn(e,jn(ei(e,t)[2])),e}function ei(e,t){null==t&&(t=10);var r=Hn(e),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),a=t/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(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 ti(e,t){return a.range.apply(a,ei(e,t))}function ri(e,t,r,n){function i(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return r?Math.pow(t,e):-Math.pow(t,-e)}function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(r=t[0]>=0,e.domain((n=t.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(t=+r,e.domain(n.map(i)),o):t},o.nice=function(){var t=Kn(n.map(i),r?Math:ni);return e.domain(t),n=t.map(a),o},o.ticks=function(){var e=Hn(n),o=[],s=e[0],l=e[1],A=Math.floor(i(s)),c=Math.ceil(i(l)),u=t%1?2:t;if(isFinite(c-A)){if(r){for(;A0;g--)o.push(a(A)*g);for(A=0;o[A]l;c--);o=o.slice(A,c)}return o},o.copy=function(){return ri(e.copy(),t,r,n)},Xn(o,e)}a.scale.linear=function(){return Zn([0,1],[0,1],xr,!1)},a.scale.log=function(){return ri(a.scale.linear().domain([0,1]),10,!0,[1,10])};var ni={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function ii(e,t,r){var n=ai(t),i=ai(1/t);function a(t){return e(n(t))}return a.invert=function(t){return i(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain((r=t.map(Number)).map(n)),a):r},a.ticks=function(e){return ti(r,e)},a.tickFormat=function(e,t){return d3_scale_linearTickFormat(r,e,t)},a.nice=function(e){return a.domain($n(r,e))},a.exponent=function(o){return arguments.length?(n=ai(t=o),i=ai(1/t),e.domain(r.map(n)),a):t},a.copy=function(){return ii(e.copy(),t,r)},Xn(a,e)}function ai(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oi(e,t){var r,n,i;function o(i){return n[((r.get(i)||("range"===t.t?r.set(i,e.push(i)):NaN))-1)%n.length]}function s(t,r){return a.range(e.length).map((function(e){return t+r*e}))}return o.domain=function(n){if(!arguments.length)return e;e=[],r=new b;for(var i,a=-1,s=n.length;++a0?r[n-1]:e[0],nu?0:1;if(A=Te)return l(A,f)+(s?l(s,1-f):"")+"Z";var h,d,p,y,m,I,v,E,C,B,b,x,w=0,Q=0,_=[];if((y=(+o.apply(this,arguments)||0)/2)&&(p=n===pi?Math.sqrt(s*s+A*A):+n.apply(this,arguments),f||(Q*=-1),A&&(Q=Ne(p/A*Math.sin(y))),s&&(w=Ne(p/s*Math.sin(y)))),A){m=A*Math.cos(c+Q),I=A*Math.sin(c+Q),v=A*Math.cos(u-Q),E=A*Math.sin(u-Q);var S=Math.abs(u-c-2*Q)<=ke?0:1;if(Q&&Ci(m,I,v,E)===f^S){var k=(c+u)/2;m=A*Math.cos(k),I=A*Math.sin(k),v=E=null}}else m=I=0;if(s){C=s*Math.cos(u-w),B=s*Math.sin(u-w),b=s*Math.cos(c+w),x=s*Math.sin(c+w);var D=Math.abs(c-u+2*w)<=ke?0:1;if(w&&Ci(C,B,b,x)===1-f^D){var T=(c+u)/2;C=s*Math.cos(T),B=s*Math.sin(T),b=x=null}}else C=B=0;if(g>_e&&(h=Math.min(Math.abs(A-s)/2,+r.apply(this,arguments)))>.001){d=s0?0:1}function Bi(e,t,r,n,i){var a=e[0]-t[0],o=e[1]-t[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,A=-s*a,c=e[0]+l,u=e[1]+A,g=t[0]+l,f=t[1]+A,h=(c+g)/2,d=(u+f)/2,p=g-c,y=f-u,m=p*p+y*y,I=r-n,v=c*f-g*u,E=(y<0?-1:1)*Math.sqrt(Math.max(0,I*I*m-v*v)),C=(v*y-p*E)/m,B=(-v*p-y*E)/m,b=(v*y+p*E)/m,x=(-v*p+y*E)/m,w=C-h,Q=B-d,_=b-h,S=x-d;return w*w+Q*Q>_*_+S*S&&(C=b,B=x),[[C-l,B-A],[C*r/I,B*r/I]]}function bi(){return!0}function xi(e){var t=St,r=kt,n=bi,i=Qi,a=i.key,o=.7;function s(a){var s,l=[],A=[],c=-1,u=a.length,g=yt(t),f=yt(r);function h(){l.push("M",i(e(A),o))}for(;++c1&&i.push("H",n[0]),i.join("")},"step-before":Si,"step-after":ki,basis:Mi,"basis-open":function(e){if(e.length<4)return Qi(e);for(var t,r=[],n=-1,i=e.length,a=[0],o=[0];++n<3;)t=e[n],a.push(t[0]),o.push(t[1]);for(r.push(Ri(Fi,a)+","+Ri(Fi,o)),--n;++n9&&(i=3*t/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(e))}});function Qi(e){return e.length>1?e.join("L"):e+"Z"}function _i(e){return e.join("L")+"Z"}function Si(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t1){s=t[1],a=e[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var A=2;Ake)+",1 "+t}function l(e,t,r,n){return"Q 0,0 "+n}return a.radius=function(e){return arguments.length?(r=yt(e),a):r},a.source=function(t){return arguments.length?(e=yt(t),a):e},a.target=function(e){return arguments.length?(t=yt(e),a):t},a.startAngle=function(e){return arguments.length?(n=yt(e),a):n},a.endAngle=function(e){return arguments.length?(i=yt(e),a):i},a},a.svg.diagonal=function(){var e=zi,t=qi,r=Yi;function n(n,i){var a=e.call(this,n,i),o=t.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(t){return arguments.length?(e=yt(t),n):e},n.target=function(e){return arguments.length?(t=yt(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},a.svg.diagonal.radial=function(){var e=a.svg.diagonal(),t=Yi,r=e.projection;return e.projection=function(e){return arguments.length?r(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Me;return[r*Math.cos(n),r*Math.sin(n)]}}(t=e)):t},e},a.svg.symbol=function(){var e=Ki,t=Ji;function r(r,n){return(Vi.get(e.call(this,r,n))||ji)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=yt(t),r):e},r.size=function(e){return arguments.length?(t=yt(e),r):t},r};var Vi=a.map({circle:ji,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Zi)),r=t*Zi;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Wi),r=t*Wi/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Wi),r=t*Wi/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});a.svg.symbolTypes=Vi.keys();var Wi=Math.sqrt(3),Zi=Math.tan(30*Re);Z.transition=function(e){for(var t,r,n=ta||++ia,i=sa(e),a=[],o=ra||{time:Date.now(),ease:Rr,delay:0,duration:250},s=-1,l=this.length;++s0;)A[--g].call(e,o);if(a>=1)return u.event&&u.event.end.call(e,e.__data__,t),--c.count?delete c[n]:delete e[r],1}u||(a=i.time,o=xt((function(e){var t=u.delay;if(o.t=t+a,t<=e)return g(e-t);o.c=g}),0,a),u=c[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++c.count)}na.call=Z.call,na.empty=Z.empty,na.node=Z.node,na.size=Z.size,a.transition=function(e,t){return e&&e.transition?ta?e.transition(t):e:a.selection().transition(e)},a.transition.prototype=na,na.select=function(e){var t,r,n,i=this.id,a=this.namespace,o=[];e=X(e);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",o[1]-o[0])}function d(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function p(){var u,p,y=this,m=a.select(a.event.target),I=r.of(y,arguments),v=a.select(y),E=m.datum(),C=!/^(n|s)$/.test(E)&&n,B=!/^(e|w)$/.test(E)&&i,b=m.classed("extent"),x=be(y),w=a.mouse(y),Q=a.select(c(y)).on("keydown.brush",(function(){32==a.event.keyCode&&(b||(u=null,w[0]-=o[1],w[1]-=s[1],b=2),z())})).on("keyup.brush",(function(){32==a.event.keyCode&&2==b&&(w[0]+=o[1],w[1]+=s[1],b=0,z())}));if(a.event.changedTouches?Q.on("touchmove.brush",k).on("touchend.brush",T):Q.on("mousemove.brush",k).on("mouseup.brush",T),v.interrupt().selectAll("*").interrupt(),b)w[0]=o[0]-w[0],w[1]=s[0]-w[1];else if(E){var _=+/w$/.test(E),S=+/^n/.test(E);p=[o[1-_]-w[0],s[1-S]-w[1]],w[0]=o[_],w[1]=s[S]}else a.event.altKey&&(u=w.slice());function k(){var e=a.mouse(y),t=!1;p&&(e[0]+=p[0],e[1]+=p[1]),b||(a.event.altKey?(u||(u=[(o[0]+o[1])/2,(s[0]+s[1])/2]),w[0]=o[+(e[0](n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var a=o;function o(e,t){this.x=e,this.y=t}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),a=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(e){return e instanceof o?e:Array.isArray(e)?new o(e[0],e[1]):e};var s="undefined"!==typeof self?self:{};function l(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function u(e,t,r,i){var a=new n(e,t,r,i);return function(e){return a.solve(e)}}var g=u(.25,.1,.25,1);function f(e,t,r){return Math.min(r,Math.max(t,e))}function h(e,t,r){var n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function d(e,t,r){if(!e.length)return r(null,[]);var n=e.length,i=new Array(e.length),a=null;e.forEach((function(e,o){t(e,(function(e,t){e&&(a=e),i[o]=t,0===--n&&r(a,i)}))}))}function p(e){var t=[];for(var r in e)t.push(e[r]);return t}function y(e,t){var r=[];for(var n in e)n in t||r.push(n);return r}function m(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}return e()}function B(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function b(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function x(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function w(e,t){return-1!==e.indexOf(t,e.length-t.length)}function Q(e,t,r){var n={};for(var i in e)n[i]=t.call(r||this,e[i],i,e);return n}function _(e,t,r){var n={};for(var i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function S(e){return Array.isArray(e)?e.map(S):"object"===typeof e&&e?Q(e,S):e}function k(e,t){for(var r=0;r=0)return!0;return!1}var D={};function T(e){D[e]||("undefined"!==typeof console&&console.warn(e),D[e]=!0)}function M(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function R(e){for(var t=0,r=0,n=e.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(e.replace(t,(function(e,t,n,i){var a=n||i;return r[t]=!a||a.toLowerCase(),""})),r["max-age"]){var n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}var O=null;function P(e){if(null==O){var t=e.navigator?e.navigator.userAgent:null;O=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return O}function G(e){try{var t=s[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(r){return!1}}function U(e){return s.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(Number("0x"+t))})))}function z(e){return decodeURIComponent(s.atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}var q,H,Y,J,K=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),j=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,V=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,W={now:K,frame:function(e){var t=j(e);return{cancel:function(){return V(t)}}},getImageData:function(e,t){void 0===t&&(t=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return q||(q=s.document.createElement("a")),q.href=e,q.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==H&&(H=s.matchMedia("(prefers-reduced-motion: reduce)")),H.matches)}},Z={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},X={supported:!1,testSupport:te},$=!1,ee=!1;function te(e){!$&&J&&(ee?re(e):Y=e)}function re(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,J),e.isContextLost())return;X.supported=!0}catch(r){}e.deleteTexture(t),$=!0}s.document&&((J=s.document.createElement("img")).onload=function(){Y&&re(Y),Y=null,ee=!0},J.onerror=function(){$=!0,Y=null},J.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var ne="01";function ie(){for(var e="1",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=0;n<10;n++)r+=t[Math.floor(62*Math.random())];var i=432e5;return{token:[e,ne,r].join(""),tokenExpiresAt:Date.now()+i}}var ae=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function oe(e){return 0===e.indexOf("mapbox:")}ae.prototype._createSkuToken=function(){var e=ie();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},ae.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ae.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},ae.prototype.normalizeStyleURL=function(e,t){if(!oe(e))return e;var r=ge(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},ae.prototype.normalizeGlyphsURL=function(e,t){if(!oe(e))return e;var r=ge(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},ae.prototype.normalizeSourceURL=function(e,t){if(!oe(e))return e;var r=ge(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},ae.prototype.normalizeSpriteURL=function(e,t,r,n){var i=ge(e);return oe(e)?(i.path="/styles/v1"+i.path+"/sprite"+t+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+t+r,fe(i))},ae.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!oe(e))return e;var r=ge(e),n=/(\.(png|jpg)\d*)(?=$)/,i=/^.+\/v4\//,a=W.devicePixelRatio>=2||512===t?"@2x":"",o=X.supported?".webp":"$1";r.path=r.path.replace(n,""+a+o),r.path=r.path.replace(i,"/"),r.path="/v4"+r.path;var s=this._customAccessToken||ce(r.params)||Z.ACCESS_TOKEN;return Z.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,s)},ae.prototype.canonicalizeTileURL=function(e,t){var r="/v4/",n=/\.[\w]+$/,i=ge(e);if(!i.path.match(/(^\/v4\/)/)||!i.path.match(n))return e;var a="mapbox://tiles/";a+=i.path.replace(r,"");var o=i.params;return t&&(o=o.filter((function(e){return!e.match(/^access_token=/)}))),o.length&&(a+="?"+o.join("&")),a},ae.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&oe(t),n=[],i=0,a=e.tiles||[];i=0&&e.params.splice(i,1)}if("/"!==n.path&&(e.path=""+n.path+e.path),!Z.REQUIRE_ACCESS_TOKEN)return fe(e);if(!(t=t||Z.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(e){return-1===e.indexOf("access_token")})),e.params.push("access_token="+t),fe(e)};var se=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function le(e){return se.test(e)}function Ae(e){return e.indexOf("sku=")>0&&le(e)}function ce(e){for(var t=0,r=e;t=1&&s.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(n){T("Unable to write to LocalStorage")}},pe.prototype.processRequests=function(e){},pe.prototype.postEvent=function(e,t,n,i){var a=this;if(Z.EVENTS_URL){var o=ge(Z.EVENTS_URL);o.params.push("access_token="+(i||Z.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:ne,userId:this.anonId},l=t?m(s,t):s,A={url:fe(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=Ze(A,(function(e){a.pendingRequest=null,n(e),a.saveEventData(),a.processRequests(i)}))}},pe.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var ye,me,Ie=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postMapLoadEvent=function(e,t,r,n){this.skuToken=r,(Z.EVENTS_URL&&n||Z.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return oe(e)||le(e)})))&&this.queueRequest({id:t,timestamp:Date.now()},n)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),b(this.anonId)||(this.anonId=C()),this.postEvent(i,{skuToken:this.skuToken},(function(e){e||n&&(t.success[n]=!0)}),e))}},t}(pe),ve=function(e){function t(t){e.call(this,"appUserTurnstile"),this._customAccessToken=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postTurnstileEvent=function(e,t){Z.EVENTS_URL&&Z.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return oe(e)||le(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=de(Z.ACCESS_TOKEN),n=r?r.u:Z.ACCESS_TOKEN,i=n!==this.eventData.tokenU;b(this.anonId)||(this.anonId=C(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=n)}),e)}},t}(pe),Ee=new ve,Ce=Ee.postTurnstileEvent.bind(Ee),Be=new Ie,be=Be.postMapLoadEvent.bind(Be),xe="mapbox-tiles",we=500,Qe=50,_e=42e4;function Se(){s.caches&&!ye&&(ye=s.caches.open(xe))}function ke(e,t){if(void 0===me)try{new Response(new ReadableStream),me=!0}catch(r){me=!1}me?t(e.body):e.blob().then(t)}function De(e,t,r){if(Se(),ye){var n={status:t.status,statusText:t.statusText,headers:new s.Headers};t.headers.forEach((function(e,t){return n.headers.set(t,e)}));var i=F(t.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<_e||ke(t,(function(t){var r=new s.Response(t,n);Se(),ye&&ye.then((function(t){return t.put(Te(e.url),r)})).catch((function(e){return T(e.message)}))})))}}function Te(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Me(e,t){if(Se(),!ye)return t(null);var r=Te(e.url);ye.then((function(e){e.match(r).then((function(n){var i=Re(n);e.delete(r),i&&e.put(r,n.clone()),t(null,n,i)})).catch(t)})).catch(t)}function Re(e){if(!e)return!1;var t=new Date(e.headers.get("Expires")||0),r=F(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}var Le,Ne=1/0;function Fe(e){++Ne>Qe&&(e.getActor().send("enforceCacheSizeLimit",we),Ne=0)}function Oe(e){Se(),ye&&ye.then((function(t){t.keys().then((function(r){for(var n=0;n=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(i){return t(i)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new qe(r.statusText,r.status,e.url))},r.send(e.body),{cancel:function(){return r.abort()}}}var je=function(e,t){if(!Ye(e.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Je(e,t);if(N()&&self.worker&&self.worker.actor){var r=!0;return self.worker.actor.send("getResource",e,t,void 0,r)}}return Ke(e,t)},Ve=function(e,t){return je(m(e,{type:"json"}),t)},We=function(e,t){return je(m(e,{type:"arrayBuffer"}),t)},Ze=function(e,t){return je(m(e,{method:"POST"}),t)};function Xe(e){var t=s.document.createElement("a");return t.href=e,t.protocol===s.document.location.protocol&&t.host===s.document.location.host}var $e,et,tt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function rt(e,t,r,n){var i=new s.Image,a=s.URL;i.onload=function(){t(null,i),a.revokeObjectURL(i.src),i.onload=null,s.requestAnimationFrame((function(){i.src=tt}))},i.onerror=function(){return t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new s.Blob([new Uint8Array(e)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=e.byteLength?a.createObjectURL(o):tt}function nt(e,t){var r=new s.Blob([new Uint8Array(e)],{type:"image/png"});s.createImageBitmap(r).then((function(e){t(null,e)})).catch((function(e){t(new Error("Could not load image because of "+e.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}$e=[],et=0;var it=function(e,t){if(X.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),et>=Z.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return $e.push(r),r}et++;var n=!1,i=function(){if(!n)for(n=!0,et--;$e.length&&et0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ct.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var ut={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},gt=function(e,t,r,n){this.message=(e?e+": ":"")+r,n&&(this.identifier=n),null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)};function ft(e){var t=e.key,r=e.value;return r?[new gt(t,r,"constants have been deprecated as of v8")]:[]}function ht(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var Tt=[It,vt,Et,Ct,Bt,_t,bt,kt(xt),St];function Mt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Mt(e.itemType,t.itemType))&&("number"!==typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,n=Tt;r255?255:e}function i(e){return e<0?0:e>1?1:e}function a(e){return"%"===e[e.length-1]?n(parseFloat(e)/100*255):n(parseInt(e))}function o(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function l(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=i.indexOf("("),A=i.indexOf(")");if(-1!==l&&A+1===i.length){var c=i.substr(0,l),u=i.substr(l+1,A-(l+1)).split(","),g=1;switch(c){case"rgba":if(4!==u.length)return null;g=o(u.pop());case"rgb":return 3!==u.length?null:[a(u[0]),a(u[1]),a(u[2]),g];case"hsla":if(4!==u.length)return null;g=o(u.pop());case"hsl":if(3!==u.length)return null;var f=(parseFloat(u[0])%360+360)%360/360,h=o(u[1]),d=o(u[2]),p=d<=.5?d*(h+1):d+h-d*h,y=2*d-p;return[n(255*s(y,p,f+1/3)),n(255*s(y,p,f)),n(255*s(y,p,f-1/3)),g];default:return null}}return null}try{t.parseCSSColor=l}catch(A){}})),Ft=Nt.parseCSSColor,Ot=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};Ot.parse=function(e){if(e){if(e instanceof Ot)return e;if("string"===typeof e){var t=Ft(e);if(t)return new Ot(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Ot.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],i=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+i+")"},Ot.prototype.toArray=function(){var e=this,t=e.r,r=e.g,n=e.b,i=e.a;return 0===i?[0,0,0,0]:[255*t/i,255*r/i,255*n/i,i]},Ot.black=new Ot(0,0,0,1),Ot.white=new Ot(1,1,1,1),Ot.transparent=new Ot(0,0,0,0),Ot.red=new Ot(1,0,0,1);var Pt=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Pt.prototype.compare=function(e,t){return this.collator.compare(e,t)},Pt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Gt=function(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i},Ut=function(e){this.sections=e};Ut.fromString=function(e){return new Ut([new Gt(e,null,null,null,null)])},Ut.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},Ut.factory=function(e){return e instanceof Ut?e:Ut.fromString(e)},Ut.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},Ut.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t=0&&e<=255&&"number"===typeof t&&t>=0&&t<=255&&"number"===typeof r&&r>=0&&r<=255?"undefined"===typeof n||"number"===typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"===typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Ht(e){if(null===e)return!0;if("string"===typeof e)return!0;if("boolean"===typeof e)return!0;if("number"===typeof e)return!0;if(e instanceof Ot)return!0;if(e instanceof Pt)return!0;if(e instanceof Ut)return!0;if(e instanceof zt)return!0;if(Array.isArray(e)){for(var t=0,r=e;t2){var s=e[1];if("string"!==typeof s||!(s in Vt)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Vt[s],n++}else a=xt;if(e.length>3){if(null!==e[2]&&("number"!==typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=kt(a,o)}else r=Vt[i];for(var l=[];n1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var Zt=function(e){this.type=_t,this.sections=e};Zt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"===typeof r)return t.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=e.length-1;++a){var o=e[a];if(i&&"object"===typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,vt)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,kt(Et))))return null;var A=null;if(o["text-color"]&&!(A=t.parse(o["text-color"],1,Bt)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=A}else{var u=t.parse(e[a],1,xt);if(!u)return null;var g=u.type.kind;if("string"!==g&&"value"!==g&&"null"!==g&&"resolvedImage"!==g)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:u,scale:null,font:null,textColor:null})}}return new Zt(n)},Zt.prototype.evaluate=function(e){var t=function(t){var r=t.content.evaluate(e);return Yt(r)===St?new Gt("",r,null,null,null):new Gt(Jt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)};return new Ut(this.sections.map(t))},Zt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t-1),r},Xt.prototype.eachChild=function(e){e(this.input)},Xt.prototype.outputDefined=function(){return!1},Xt.prototype.serialize=function(){return["image",this.input.serialize()]};var $t={"to-boolean":Ct,"to-color":Bt,"to-number":vt,"to-string":Et},er=function(e,t){this.type=e,this.args=t};er.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=$t[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":qt(t[0],t[1],t[2],t[3])))return new Ot(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new jt(r||"Could not parse color from value '"+("string"===typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=t[2])&&!(e[1]<=t[1])&&!(e[3]>=t[3])}function ur(e,t){var r=lr(e[0]),n=Ar(e[1]),i=Math.pow(2,t.z);return[Math.round(r*i*or),Math.round(n*i*or)]}function gr(e,t,r){var n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function fr(e,t,r){return t[1]>e[1]!==r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function hr(e,t){for(var r=!1,n=0,i=t.length;n0&&u<0||c<0&&u>0}function mr(e,t,r,n){var i=[t[0]-e[0],t[1]-e[1]];return 0!==pr([n[0]-r[0],n[1]-r[1]],i)&&!(!yr(e,t,r,n)||!yr(r,n,e,t))}function Ir(e,t,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=e[0]-r[0]>i?-n:r[0]-e[0]>i?n:0;0===a&&(a=e[0]-r[2]>i?-n:r[2]-e[0]>i?n:0),e[0]+=a}sr(t,e)}function xr(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function wr(e,t,r,n){for(var i=Math.pow(2,n.z)*or,a=[n.x*or,n.y*or],o=[],s=0,l=e;s=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Mr(e,t)&&(r=!1)})),r}kr.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(Ht(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;nt))throw new jt("Input is not a number.");o=s-1}return 0}Lr.prototype.parse=function(e,t,r,n,i){return void 0===i&&(i={}),t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)},Lr.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new Wt(t,[e]):"coerce"===r?new er(t,[e]):e}if(null!==e&&"string"!==typeof e&&"boolean"!==typeof e&&"number"!==typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=e[0];if("string"!==typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,t.typeAnnotation||"coerce");else a=r(a,o,t.typeAnnotation||"assert")}if(!(a instanceof Kt)&&"resolvedImage"!==a.type.kind&&Nr(a)){var l=new rr;try{a=new Kt(a.type,a.evaluate(l))}catch(A){return this.error(A.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return"undefined"===typeof e?this.error("'undefined' value invalid. Use null instead."):"object"===typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Lr.prototype.concat=function(e,t,r){var n="number"===typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Lr(this.registry,n,t||null,i,this.errors)},Lr.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new yt(n,e))},Lr.prototype.checkSubtype=function(e,t){var r=Mt(e,t);return r&&this.error(r),r};var Or=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=t.parse(s,A,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new Or(i,r,n)},Or.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Fr(t,n)].evaluate(e)},Or.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var zr=Object.freeze({__proto__:null,number:Pr,color:Gr,array:Ur}),qr=.95047,Hr=1,Yr=1.08883,Jr=4/29,Kr=6/29,jr=3*Kr*Kr,Vr=Kr*Kr*Kr,Wr=Math.PI/180,Zr=180/Math.PI;function Xr(e){return e>Vr?Math.pow(e,1/3):e/jr+Jr}function $r(e){return e>Kr?e*e*e:jr*(e-Jr)}function en(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function tn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function rn(e){var t=tn(e.r),r=tn(e.g),n=tn(e.b),i=Xr((.4124564*t+.3575761*r+.1804375*n)/qr),a=Xr((.2126729*t+.7151522*r+.072175*n)/Hr);return{l:116*a-16,a:500*(i-a),b:200*(a-Xr((.0193339*t+.119192*r+.9503041*n)/Yr)),alpha:e.a}}function nn(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=Hr*$r(t),r=qr*$r(r),n=Yr*$r(n),new Ot(en(3.2404542*r-1.5371385*t-.4985314*n),en(-.969266*r+1.8760108*t+.041556*n),en(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function an(e,t,r){return{l:Pr(e.l,t.l,r),a:Pr(e.a,t.a,r),b:Pr(e.b,t.b,r),alpha:Pr(e.alpha,t.alpha,r)}}function on(e){var t=rn(e),r=t.l,n=t.a,i=t.b,a=Math.atan2(i,n)*Zr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:e.a}}function sn(e){var t=e.h*Wr,r=e.c;return nn({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})}function ln(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}function An(e,t,r){return{h:ln(e.h,t.h,r),c:Pr(e.c,t.c,r),l:Pr(e.l,t.l,r),alpha:Pr(e.alpha,t.alpha,r)}}var cn={forward:rn,reverse:nn,interpolate:an},un={forward:on,reverse:sn,interpolate:An},gn=Object.freeze({__proto__:null,lab:cn,hcl:un}),fn=function(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(!(i=t.parse(i,2,vt)))return null;var l=[],A=null;"interpolate-hcl"===r||"interpolate-lab"===r?A=Bt:t.expectedType&&"value"!==t.expectedType.kind&&(A=t.expectedType);for(var c=0;c=u)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=t.parse(g,h,A);if(!d)return null;A=A||d.type,l.push([u,d])}return"number"===A.kind||"color"===A.kind||"array"===A.kind&&"number"===A.itemType.kind&&"number"===typeof A.N?new fn(A,r,n,i,l):t.error("Type "+Dt(A)+" is not interpolatable.")},fn.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);var a=Fr(t,n),o=t[a],s=t[a+1],l=fn.interpolationFactor(this.interpolation,n,o,s),A=r[a].evaluate(e),c=r[a+1].evaluate(e);return"interpolate"===this.operator?zr[this.type.kind.toLowerCase()](A,c,l):"interpolate-hcl"===this.operator?un.reverse(un.interpolate(un.forward(A),un.forward(c),l)):cn.reverse(cn.interpolate(cn.forward(A),cn.forward(c),l))},fn.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t=r.length)throw new jt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new jt("Array index must be an integer, but found "+t+" instead.");return r[t]},yn.prototype.eachChild=function(e){e(this.index),e(this.input)},yn.prototype.outputDefined=function(){return!1},yn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var mn=function(e,t){this.type=Ct,this.needle=e,this.haystack=t};mn.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,xt),n=t.parse(e[2],2,xt);return r&&n?Rt(r.type,[Ct,Et,vt,It,xt])?new mn(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead"):null},mn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Lt(t,["boolean","string","number","null"]))throw new jt("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Yt(t))+" instead.");if(!Lt(r,["string","array"]))throw new jt("Expected second argument to be of type array or string, but found "+Dt(Yt(r))+" instead.");return r.indexOf(t)>=0},mn.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},mn.prototype.outputDefined=function(){return!0},mn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var In=function(e,t,r){this.type=vt,this.needle=e,this.haystack=t,this.fromIndex=r};In.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,xt),n=t.parse(e[2],2,xt);if(!r||!n)return null;if(!Rt(r.type,[Ct,Et,vt,It,xt]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,vt);return i?new In(r,n,i):null}return new In(r,n)},In.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Lt(t,["boolean","string","number","null"]))throw new jt("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Yt(t))+" instead.");if(!Lt(r,["string","array"]))throw new jt("Expected second argument to be of type array or string, but found "+Dt(Yt(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},In.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var vn=function(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};vn.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!==1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return A.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"===typeof g&&Math.floor(g)!==g)return A.error("Numeric branch labels must be integer values.");if(r){if(A.checkSubtype(r,Yt(g)))return null}else r=Yt(g);if("undefined"!==typeof i[String(g)])return A.error("Branch labels must be unique.");i[String(g)]=a.length}var f=t.parse(l,o,n);if(!f)return null;n=n||f.type,a.push(f)}var h=t.parse(e[1],1,xt);if(!h)return null;var d=t.parse(e[e.length-1],e.length-1,n);return d?"value"!==h.type.kind&&t.concat(1).checkSubtype(r,h.type)?null:new vn(r,n,h,i,a,d):null},vn.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Yt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},vn.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},vn.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},vn.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();ir}function _n(e,t,r){return t<=r}function Sn(e,t,r){return t>=r}function kn(e,t,r,n){return 0===n.compare(t,r)}function Dn(e,t,r,n){return!kn(e,t,r,n)}function Tn(e,t,r,n){return n.compare(t,r)<0}function Mn(e,t,r,n){return n.compare(t,r)>0}function Rn(e,t,r,n){return n.compare(t,r)<=0}function Ln(e,t,r,n){return n.compare(t,r)>=0}function Nn(e,t,r){var n="=="!==e&&"!="!==e;return function(){function i(e,t,r){this.type=Ct,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return i.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],a=t.parse(e[1],1,xt);if(!a)return null;if(!Bn(r,a.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Dt(a.type)+"'.");var o=t.parse(e[2],2,xt);if(!o)return null;if(!Bn(r,o.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Dt(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+Dt(a.type)+"' and '"+Dt(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new Wt(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new Wt(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Qt)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=Yt(a),l=Yt(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new jt('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var A=Yt(a),c=Yt(o);if("string"!==A.kind||"string"!==c.kind)return t(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):t(i,a,o)},i.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},i}()}Cn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,xt),n=t.parse(e[2],2,vt);if(!r||!n)return null;if(!Rt(r.type,[kt(xt),Et,xt]))return t.error("Expected first argument to be of type array or string, but found "+Dt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,vt);return i?new Cn(r.type,r,n,i):null}return new Cn(r.type,r,n)},Cn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Lt(t,["string","array"]))throw new jt("Expected first argument to be of type array or string, but found "+Dt(Yt(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},Cn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Cn.prototype.outputDefined=function(){return!1},Cn.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Fn=Nn("==",bn,kn),On=Nn("!=",xn,Dn),Pn=Nn("<",wn,Tn),Gn=Nn(">",Qn,Mn),Un=Nn("<=",_n,Rn),zn=Nn(">=",Sn,Ln),qn=function(e,t,r,n,i){this.type=Et,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};qn.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,vt);if(!r)return null;var n=e[2];if("object"!==typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=t.parse(n.locale,1,Et)))return null;var a=null;if(n.currency&&!(a=t.parse(n.currency,1,Et)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=t.parse(n["min-fraction-digits"],1,vt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,vt))?null:new qn(r,i,a,o,s)},qn.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},qn.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},qn.prototype.outputDefined=function(){return!1},qn.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Hn=function(e){this.type=vt,this.input=e};Hn.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+Dt(r.type)+" instead."):new Hn(r):null},Hn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"===typeof t)return t.length;if(Array.isArray(t))return t.length;throw new jt("Expected value to be of type string or array, but found "+Dt(Yt(t))+" instead.")},Hn.prototype.eachChild=function(e){e(this.input)},Hn.prototype.outputDefined=function(){return!1},Hn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Yn={"==":Fn,"!=":On,">":Gn,"<":Pn,">=":zn,"<=":Un,array:Wt,at:yn,boolean:Wt,case:En,coalesce:dn,collator:ar,format:Zt,image:Xt,in:mn,"index-of":In,interpolate:fn,"interpolate-hcl":fn,"interpolate-lab":fn,length:Hn,let:pn,literal:Kt,match:vn,number:Wt,"number-format":qn,object:Wt,slice:Cn,step:Or,string:Wt,"to-boolean":er,"to-color":er,"to-number":er,"to-string":er,var:Rr,within:kr};function Jn(e,t){var r=t[0],n=t[1],i=t[2],a=t[3];r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);var o=a?a.evaluate(e):1,s=qt(r,n,i,o);if(s)throw new jt(s);return new Ot(r/255*o,n/255*o,i/255*o,o)}function Kn(e,t){return e in t}function jn(e,t){var r=t[e];return"undefined"===typeof r?null:r}function Vn(e,t,r,n){for(;r<=n;){var i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}function Wn(e){return{type:e}}function Zn(e){return{result:"success",value:e}}function Xn(e){return{result:"error",value:e}}function $n(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function ei(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ti(e){return!!e.expression&&e.expression.interpolated}function ri(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ni(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)}function ii(e){return e}function ai(e,t){var r,n,i,a="color"===t.type,o=e.stops&&"object"===typeof e.stops[0][0],s=o||void 0!==e.property,l=o||!s,A=e.type||(ti(t)?"exponential":"interval");if(a&&((e=ht({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],Ot.parse(e[1])]}))),e.default?e.default=Ot.parse(e.default):e.default=Ot.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!gn[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===A)r=Ai;else if("interval"===A)r=li;else if("categorical"===A){r=si,n=Object.create(null);for(var c=0,u=e.stops;c=e.stops[n-1][0])return e.stops[n-1][1];var i=Fr(e.stops.map((function(e){return e[0]})),r);return e.stops[i][1]}function Ai(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==ri(r))return oi(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];var a=Fr(e.stops.map((function(e){return e[0]})),r),o=ui(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],A=zr[t.type]||ii;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=gn[e.colorSpace];A=function(e,t){return c.reverse(c.interpolate(c.forward(e),c.forward(t),o))}}return"function"===typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return A(r,n,o)}}:A(s,l,o)}function ci(e,t,r){return"color"===t.type?r=Ot.parse(r):"formatted"===t.type?r=Ut.fromString(r.toString()):"resolvedImage"===t.type?r=zt.fromString(r.toString()):ri(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),oi(r,e.default,t.default)}function ui(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}nr.register(Yn,{error:[wt,[Et],function(e,t){var r=t[0];throw new jt(r.evaluate(e))}],typeof:[Et,[xt],function(e,t){return Dt(Yt(t[0].evaluate(e)))}],"to-rgba":[kt(vt,4),[Bt],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Bt,[vt,vt,vt],Jn],rgba:[Bt,[vt,vt,vt,vt],Jn],has:{type:Ct,overloads:[[[Et],function(e,t){return Kn(t[0].evaluate(e),e.properties())}],[[Et,bt],function(e,t){var r=t[0],n=t[1];return Kn(r.evaluate(e),n.evaluate(e))}]]},get:{type:xt,overloads:[[[Et],function(e,t){return jn(t[0].evaluate(e),e.properties())}],[[Et,bt],function(e,t){var r=t[0],n=t[1];return jn(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[xt,[Et],function(e,t){return jn(t[0].evaluate(e),e.featureState||{})}],properties:[bt,[],function(e){return e.properties()}],"geometry-type":[Et,[],function(e){return e.geometryType()}],id:[xt,[],function(e){return e.id()}],zoom:[vt,[],function(e){return e.globals.zoom}],"heatmap-density":[vt,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[vt,[],function(e){return e.globals.lineProgress||0}],accumulated:[xt,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[vt,Wn(vt),function(e,t){for(var r=0,n=0,i=t;n":[Ct,[Et,xt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>a}],"filter-id->":[Ct,[xt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>i}],"filter-<=":[Ct,[Et,xt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i<=a}],"filter-id-<=":[Ct,[xt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n<=i}],"filter->=":[Ct,[Et,xt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>=a}],"filter-id->=":[Ct,[xt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>=i}],"filter-has":[Ct,[xt],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Ct,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[Ct,[kt(Et)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Ct,[kt(xt)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Ct,[Et,kt(xt)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Ct,[Et,kt(xt)],function(e,t){var r=t[0],n=t[1];return Vn(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Ct,overloads:[[[Ct,Ct],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[Wn(Ct),function(e,t){for(var r=0,n=t;r0&&"string"===typeof e[0]&&e[0]in Yn}function hi(e,t){var r=new Lr(Yn,[],t?Ei(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Zn(new gi(n,t)):Xn(r.errors)}gi.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},gi.prototype.evaluate=function(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null===o||void 0===o||"number"===typeof o&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new jt("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!==typeof console&&console.warn(s.message)),this._defaultValue}};var di=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Tr(t.expression)};di.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},di.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)};var pi=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Tr(t.expression),this.interpolationType=n};function yi(e,t){if("error"===(e=hi(e,t)).result)return e;var r=e.value.expression,n=Dr(r);if(!n&&!$n(t))return Xn([new yt("","data expressions not supported")]);var i=Mr(r,["zoom"]);if(!i&&!ei(t))return Xn([new yt("","zoom expressions not supported")]);var a=vi(r);if(!a&&!i)return Xn([new yt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof yt)return Xn([a]);if(a instanceof fn&&!ti(t))return Xn([new yt("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Zn(new di(n?"constant":"source",e.value));var o=a instanceof fn?a.interpolation:void 0;return Zn(new pi(n?"camera":"composite",e.value,a.labels,o))}pi.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},pi.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)},pi.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?fn.interpolationFactor(this.interpolationType,e,t,r):0};var mi=function(e,t){this._parameters=e,this._specification=t,ht(this,ai(this._parameters,this._specification))};function Ii(e,t){if(ni(e))return new mi(e,t);if(fi(e)){var r=yi(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"===typeof e&&"color"===t.type&&(n=Ot.parse(e)),{kind:"constant",evaluate:function(){return n}}}function vi(e){var t=null;if(e instanceof pn)t=vi(e.result);else if(e instanceof dn)for(var r=0,n=e.args;rn.maximum?[new gt(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function wi(e){var t,r,n,i=e.valueSpec,a=dt(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,A="array"===ri(e.value.stops)&&"array"===ri(e.value.stops[0])&&"object"===ri(e.value.stops[0][0]),c=Bi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:u,default:h}});return"identity"===a&&s&&c.push(new gt(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||c.push(new gt(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!ti(e.valueSpec)&&c.push(new gt(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!$n(e.valueSpec)?c.push(new gt(e.key,e.value,"property functions not supported")):s&&!ei(e.valueSpec)&&c.push(new gt(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!A||void 0!==e.value.property||c.push(new gt(e.key,e.value,'"property" property is required')),c;function u(e){if("identity"===a)return[new gt(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(bi({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:g})),"array"===ri(r)&&0===r.length&&t.push(new gt(e.key,r,"array must have at least one stop")),t}function g(e){var t=[],a=e.value,s=e.key;if("array"!==ri(a))return[new gt(s,a,"array expected, "+ri(a)+" found")];if(2!==a.length)return[new gt(s,a,"array length 2 expected, length "+a.length+" found")];if(A){if("object"!==ri(a[0]))return[new gt(s,a,"object expected, "+ri(a[0])+" found")];if(void 0===a[0].zoom)return[new gt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new gt(s,a,"object stop key must have value")];if(n&&n>dt(a[0].zoom))return[new gt(s,a[0].zoom,"stop zoom values must appear in ascending order")];dt(a[0].zoom)!==n&&(n=dt(a[0].zoom),r=void 0,o={}),t=t.concat(Bi({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:xi,value:f}}))}else t=t.concat(f({key:s+"[0]",value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return fi(pt(a[1]))?t.concat([new gt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):t.concat(ra({key:s+"[1]",value:a[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function f(e,n){var s=ri(e.value),l=dt(e.value),A=null!==e.value?e.value:n;if(t){if(s!==t)return[new gt(e.key,A,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new gt(e.key,A,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return $n(i)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new gt(e.key,A,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!==typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);tt?1:0}function Li(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t"===t||"<="===t||">="===t?Fi(e[1],e[2],t):"any"===t?Oi(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(Ni)):"none"===t?["all"].concat(e.slice(1).map(Ni).map(Ui)):"in"===t?Pi(e[1],e.slice(2)):"!in"===t?Ui(Pi(e[1],e.slice(2))):"has"===t?Gi(e[1]):"!has"===t?Ui(Gi(e[1])):"within"!==t||e}function Fi(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Oi(e){return["any"].concat(e.map(Ni))}function Pi(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!==typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Ri)]]:["filter-in-small",e,["literal",t]]}}function Gi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Ui(e){return["!",e]}function zi(e){return Di(pt(e.value))?Qi(ht({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):qi(e)}function qi(e){var t=e.value,r=e.key;if("array"!==ri(t))return[new gt(r,t,"array expected, "+ri(t)+" found")];var n,i=e.styleSpec,a=[];if(t.length<1)return[new gt(r,t,"filter array must have at least 1 element")];switch(a=a.concat(ki({key:r+"[0]",value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),dt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===dt(t[1])&&a.push(new gt(r,t,'"$type" cannot be use with operator "'+t[0]+'"'));case"==":case"!=":3!==t.length&&a.push(new gt(r,t,'filter array for operator "'+t[0]+'" must have 3 elements'));case"in":case"!in":t.length>=2&&"string"!==(n=ri(t[1]))&&a.push(new gt(r+"[1]",t[1],"string expected, "+n+" found"));for(var o=2;o=c[f+0]&&n>=c[f+1])?(o[g]=!0,a.push(A[g])):o[g]=!1}}},ha.prototype._forEachCell=function(e,t,r,n,i,a,o,s){for(var l=this._convertToCellCoord(e),A=this._convertToCellCoord(t),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),g=l;g<=c;g++)for(var f=A;f<=u;f++){var h=this.d*f+g;if((!s||s(this._convertFromCellCoord(g),this._convertFromCellCoord(f),this._convertFromCellCoord(g+1),this._convertFromCellCoord(f+1)))&&i.call(this,e,t,r,n,h,a,o,s))return}},ha.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ha.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ha.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=fa+this.cells.length+1+1,r=0,n=0;n=0)){var u=e[c];A[c]=ya[l].shallow.indexOf(c)>=0?u:Ca(u,t)}e instanceof Error&&(A.message=e.message)}if(A.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(A.$name=l),A}throw new Error("can't serialize object of type "+typeof e)}function Ba(e){if(null===e||void 0===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||va(e)||Ea(e)||ArrayBuffer.isView(e)||e instanceof da)return e;if(Array.isArray(e))return e.map(Ba);if("object"===typeof e){var t=e.$name||"Object",r=ya[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var n=Object.create(r.prototype),i=0,a=Object.keys(e);i=0?s:Ba(s)}}return n}throw new Error("can't deserialize object of type "+typeof e)}var ba=function(){this.first=!0};ba.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function wa(e){for(var t=0,r=e;t=65097&&e<=65103)||!!xa["CJK Compatibility Ideographs"](e)||!!xa["CJK Compatibility"](e)||!!xa["CJK Radicals Supplement"](e)||!!xa["CJK Strokes"](e)||!(!xa["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||!!xa["CJK Unified Ideographs Extension A"](e)||!!xa["CJK Unified Ideographs"](e)||!!xa["Enclosed CJK Letters and Months"](e)||!!xa["Hangul Compatibility Jamo"](e)||!!xa["Hangul Jamo Extended-A"](e)||!!xa["Hangul Jamo Extended-B"](e)||!!xa["Hangul Jamo"](e)||!!xa["Hangul Syllables"](e)||!!xa.Hiragana(e)||!!xa["Ideographic Description Characters"](e)||!!xa.Kanbun(e)||!!xa["Kangxi Radicals"](e)||!!xa["Katakana Phonetic Extensions"](e)||!(!xa.Katakana(e)||12540===e)||!(!xa["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!xa["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||!!xa["Unified Canadian Aboriginal Syllabics"](e)||!!xa["Unified Canadian Aboriginal Syllabics Extended"](e)||!!xa["Vertical Forms"](e)||!!xa["Yijing Hexagram Symbols"](e)||!!xa["Yi Syllables"](e)||!!xa["Yi Radicals"](e))}function Da(e){return!(!xa["Latin-1 Supplement"](e)||167!==e&&169!==e&&174!==e&&177!==e&&188!==e&&189!==e&&190!==e&&215!==e&&247!==e)||!(!xa["General Punctuation"](e)||8214!==e&&8224!==e&&8225!==e&&8240!==e&&8241!==e&&8251!==e&&8252!==e&&8258!==e&&8263!==e&&8264!==e&&8265!==e&&8273!==e)||!!xa["Letterlike Symbols"](e)||!!xa["Number Forms"](e)||!(!xa["Miscellaneous Technical"](e)||!(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215))||!(!xa["Control Pictures"](e)||9251===e)||!!xa["Optical Character Recognition"](e)||!!xa["Enclosed Alphanumerics"](e)||!!xa["Geometric Shapes"](e)||!(!xa["Miscellaneous Symbols"](e)||e>=9754&&e<=9759)||!(!xa["Miscellaneous Symbols and Arrows"](e)||!(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243))||!!xa["CJK Symbols and Punctuation"](e)||!!xa.Katakana(e)||!!xa["Private Use Area"](e)||!!xa["CJK Compatibility Forms"](e)||!!xa["Small Form Variants"](e)||!!xa["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e}function Ta(e){return!(ka(e)||Da(e))}function Ma(e){return xa.Arabic(e)||xa["Arabic Supplement"](e)||xa["Arabic Extended-A"](e)||xa["Arabic Presentation Forms-A"](e)||xa["Arabic Presentation Forms-B"](e)}function Ra(e){return e>=1424&&e<=2303||xa["Arabic Presentation Forms-A"](e)||xa["Arabic Presentation Forms-B"](e)}function La(e,t){return!(!t&&Ra(e))&&!(e>=2304&&e<=3583||e>=3840&&e<=4255||xa.Khmer(e))}function Na(e){for(var t=0,r=e;t-1&&(Ga=Oa.error),Pa&&Pa(e)};function qa(){Ha.fire(new lt("pluginStateChange",{pluginStatus:Ga,pluginURL:Ua}))}var Ha=new ct,Ya=function(){return Ga},Ja=function(e){return e({pluginStatus:Ga,pluginURL:Ua}),Ha.on("pluginStateChange",e),e},Ka=function(e,t,r){if(void 0===r&&(r=!1),Ga===Oa.deferred||Ga===Oa.loading||Ga===Oa.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ua=W.resolveURL(e),Ga=Oa.deferred,Pa=t,qa(),r||ja()},ja=function(){if(Ga!==Oa.deferred||!Ua)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ga=Oa.loading,qa(),Ua&&We({url:Ua},(function(e){e?za(e):(Ga=Oa.loaded,qa())}))},Va={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ga===Oa.loaded||null!=Va.applyArabicShaping},isLoading:function(){return Ga===Oa.loading},setState:function(e){Ga=e.pluginStatus,Ua=e.pluginURL},isParsed:function(){return null!=Va.applyArabicShaping&&null!=Va.processBidirectionalText&&null!=Va.processStyledBidirectionalText},getPluginURL:function(){return Ua}},Wa=function(){Va.isLoading()||Va.isLoaded()||"deferred"!==Ya()||ja()},Za=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ba,this.transition={})};Za.prototype.isSupportedScript=function(e){return Fa(e,Va.isLoaded())},Za.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Za.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Xa=function(e,t){this.property=e,this.value=t,this.expression=Ii(void 0===t?e.specification.default:t,e.specification)};Xa.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Xa.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var $a=function(e){this.property=e,this.value=new Xa(e,void 0)};$a.prototype.transitioned=function(e,t){return new to(this.property,this.value,t,m({},e.transition,this.transition),e.now)},$a.prototype.untransitioned=function(){return new to(this.property,this.value,null,{},0)};var eo=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};eo.prototype.getValue=function(e){return S(this._values[e].value.value)},eo.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new $a(this._values[e].property)),this._values[e].value=new Xa(this._values[e].property,null===t?void 0:S(t))},eo.prototype.getTransition=function(e){return S(this._values[e].transition)},eo.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new $a(this._values[e].property)),this._values[e].transition=S(t)||void 0},eo.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);tthis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(nn.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},t.prototype.interpolate=function(e){return e},t}(so),Ao=function(e){this.specification=e};Ao.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new Za(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Za(Math.floor(t.zoom),t)),e.expression.evaluate(new Za(Math.floor(t.zoom+1),t)),t)}},Ao.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Ao.prototype.interpolate=function(e){return e};var co=function(e){this.specification=e};co.prototype.possiblyEvaluate=function(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)},co.prototype.interpolate=function(){return!1};var uo=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var n=this.defaultPropertyValues[t]=new Xa(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new $a(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}};ma("DataDrivenProperty",so),ma("DataConstantProperty",oo),ma("CrossFadedDataDrivenProperty",lo),ma("CrossFadedProperty",Ao),ma("ColorRampProperty",co);var go="-transition",fo=function(e){function t(t,r){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new no(r.layout)),r.paint)){for(var n in this._transitionablePaint=new eo(r.paint),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ao(r.paint)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".layout."+e;if(this._validate(ca,n,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t},t.prototype.getPaintProperty=function(e){return w(e,go)?this._transitionablePaint.getTransition(e.slice(0,-go.length)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".paint."+e;if(this._validate(Aa,n,e,t,r))return!1}if(w(e,go))return this._transitionablePaint.setTransition(e.slice(0,-go.length),t||void 0),!1;var i=this._transitionablePaint._values[e],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var l=this._transitionablePaint._values[e].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(e,s,l)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,r){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)},t.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),_(e,(function(e,t){return void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&ua(this,e.call(sa,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:ut,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof io&&$n(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(ct),ho={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},po=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},yo=128,mo=5,Io=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function vo(e,t){void 0===t&&(t=1);var r=0,n=0;return{members:e.map((function(e){var i=Eo(e.type),a=r=Co(r,Math.max(t,i)),o=e.components||1;return n=Math.max(n,i),r+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:Co(r,Math.max(n,t)),alignment:t}}function Eo(e){return ho[e].BYTES_PER_ELEMENT}function Co(e,t){return Math.ceil(e/t)*t}Io.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Io.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Io.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Io.prototype.clear=function(){this.length=0},Io.prototype.resize=function(e){this.reserve(e),this.length=e},Io.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*mo),yo),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Io.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Bo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e},t}(Io);Bo.prototype.bytesPerElement=4,ma("StructArrayLayout2i4",Bo);var bo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e},t}(Io);bo.prototype.bytesPerElement=8,ma("StructArrayLayout4i8",bo);var xo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Io);xo.prototype.bytesPerElement=12,ma("StructArrayLayout2i4i12",xo);var wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e},t}(Io);wo.prototype.bytesPerElement=8,ma("StructArrayLayout2i4ub8",wo);var Qo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e},t}(Io);Qo.prototype.bytesPerElement=8,ma("StructArrayLayout2f8",Qo);var _o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,A){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l,A)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A,c){var u=10*e;return this.uint16[u+0]=t,this.uint16[u+1]=r,this.uint16[u+2]=n,this.uint16[u+3]=i,this.uint16[u+4]=a,this.uint16[u+5]=o,this.uint16[u+6]=s,this.uint16[u+7]=l,this.uint16[u+8]=A,this.uint16[u+9]=c,e},t}(Io);_o.prototype.bytesPerElement=20,ma("StructArrayLayout10ui20",_o);var So=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,A,c,u){var g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,n,i,a,o,s,l,A,c,u)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A,c,u,g){var f=12*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=A,this.int16[f+9]=c,this.int16[f+10]=u,this.int16[f+11]=g,e},t}(Io);So.prototype.bytesPerElement=24,ma("StructArrayLayout4i4ui4i24",So);var ko=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e},t}(Io);ko.prototype.bytesPerElement=12,ma("StructArrayLayout3f12",ko);var Do=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint32[r+0]=t,e},t}(Io);Do.prototype.bytesPerElement=4,ma("StructArrayLayout1ul4",Do);var To=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l){var A=this.length;return this.resize(A+1),this.emplace(A,e,t,r,n,i,a,o,s,l)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A){var c=10*e,u=5*e;return this.int16[c+0]=t,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[u+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=A,e},t}(Io);To.prototype.bytesPerElement=20,ma("StructArrayLayout6i1ul2ui20",To);var Mo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Io);Mo.prototype.bytesPerElement=12,ma("StructArrayLayout2i2i2i12",Mo);var Ro=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)},t.prototype.emplace=function(e,t,r,n,i,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e},t}(Io);Ro.prototype.bytesPerElement=16,ma("StructArrayLayout2f1f2i16",Ro);var Lo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,e},t}(Io);Lo.prototype.bytesPerElement=12,ma("StructArrayLayout2ub2f12",Lo);var No=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e},t}(Io);No.prototype.bytesPerElement=6,ma("StructArrayLayout3ui6",No);var Fo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p){var y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y){var m=24*e,I=12*e,v=48*e;return this.int16[m+0]=t,this.int16[m+1]=r,this.uint16[m+2]=n,this.uint16[m+3]=i,this.uint32[I+2]=a,this.uint32[I+3]=o,this.uint32[I+4]=s,this.uint16[m+10]=l,this.uint16[m+11]=A,this.uint16[m+12]=c,this.float32[I+7]=u,this.float32[I+8]=g,this.uint8[v+36]=f,this.uint8[v+37]=h,this.uint8[v+38]=d,this.uint32[I+10]=p,this.int16[m+22]=y,e},t}(Io);Fo.prototype.bytesPerElement=48,ma("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Fo);var Oo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q){var _=this.length;return this.resize(_+1),this.emplace(_,e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q,_){var S=34*e,k=17*e;return this.int16[S+0]=t,this.int16[S+1]=r,this.int16[S+2]=n,this.int16[S+3]=i,this.int16[S+4]=a,this.int16[S+5]=o,this.int16[S+6]=s,this.int16[S+7]=l,this.uint16[S+8]=A,this.uint16[S+9]=c,this.uint16[S+10]=u,this.uint16[S+11]=g,this.uint16[S+12]=f,this.uint16[S+13]=h,this.uint16[S+14]=d,this.uint16[S+15]=p,this.uint16[S+16]=y,this.uint16[S+17]=m,this.uint16[S+18]=I,this.uint16[S+19]=v,this.uint16[S+20]=E,this.uint16[S+21]=C,this.uint16[S+22]=B,this.uint32[k+12]=b,this.float32[k+13]=x,this.float32[k+14]=w,this.float32[k+15]=Q,this.float32[k+16]=_,e},t}(Io);Oo.prototype.bytesPerElement=68,ma("StructArrayLayout8i15ui1ul4f68",Oo);var Po=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.float32[r+0]=t,e},t}(Io);Po.prototype.bytesPerElement=4,ma("StructArrayLayout1f4",Po);var Go=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e},t}(Io);Go.prototype.bytesPerElement=6,ma("StructArrayLayout3i6",Go);var Uo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=2*e,a=4*e;return this.uint32[i+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=n,e},t}(Io);Uo.prototype.bytesPerElement=8,ma("StructArrayLayout1ul2ui8",Uo);var zo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e},t}(Io);zo.prototype.bytesPerElement=4,ma("StructArrayLayout2ui4",zo);var qo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint16[r+0]=t,e},t}(Io);qo.prototype.bytesPerElement=2,ma("StructArrayLayout1ui2",qo);var Ho=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e},t}(Io);Ho.prototype.bytesPerElement=16,ma("StructArrayLayout4f16",Ho);var Yo=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(po);Yo.prototype.size=20;var Jo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Yo(this,e)},t}(To);ma("CollisionBoxArray",Jo);var Ko=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(po);Ko.prototype.size=48;var jo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ko(this,e)},t}(Fo);ma("PlacedSymbolArray",jo);var Vo=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(po);Vo.prototype.size=68;var Wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Vo(this,e)},t}(Oo);ma("SymbolInstanceArray",Wo);var Zo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t}(Po);ma("GlyphOffsetArray",Zo);var Xo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(Go);ma("SymbolLineVertexArray",Xo);var $o=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(po);$o.prototype.size=8;var es=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new $o(this,e)},t}(Uo);ma("FeatureIndexArray",es);var ts=vo([{name:"a_pos",components:2,type:"Int16"}],4).members,rs=function(e){void 0===e&&(e=[]),this.segments=e};function ns(e,t){return 256*(e=f(Math.floor(e),0,255))+(t=f(Math.floor(t),0,255))}rs.prototype.prepareSegment=function(e,t,r,n){var i=this.segments[this.segments.length-1];return e>rs.MAX_VERTEX_ARRAY_LENGTH&&T("Max vertices per segment is "+rs.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!i||i.vertexLength+e>rs.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},rs.prototype.get=function(){return this.segments},rs.prototype.destroy=function(){for(var e=0,t=this.segments;e>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(A+2))<<16;case 2:l^=(255&e.charCodeAt(A+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(A)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}e.exports=t})),os=t((function(e){function t(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}e.exports=t})),ss=as,ls=as,As=os;ss.murmur3=ls,ss.murmur2=As;var cs=function(){this.ids=[],this.positions=[],this.indexed=!1};cs.prototype.add=function(e,t,r,n){this.ids.push(gs(e)),this.positions.push(t,r,n)},cs.prototype.getPositions=function(e){for(var t=gs(e),r=0,n=this.ids.length-1;r>1;this.ids[i]>=t?n=i:r=i+1}for(var a=[];this.ids[r]===t;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},cs.serialize=function(e,t){var r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return fs(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}},cs.deserialize=function(e){var t=new cs;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var us=Math.pow(2,53)-1;function gs(e){var t=+e;return!isNaN(t)&&t<=us?t:ss(String(e))}function fs(e,t,r,n){for(;r>1],a=r-1,o=n+1;;){do{a++}while(e[a]i);if(a>=o)break;hs(e,a,o),hs(t,3*a,3*o),hs(t,3*a+1,3*o+1),hs(t,3*a+2,3*o+2)}o-ro.x+1||lo.y+1)&&T("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Gs(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Ps(e):[]}}function Us(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}var zs=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Bo,this.indexArray=new No,this.segments=new rs,this.programConfigurations=new Ds(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function qs(e,t){for(var r=0;r=3)for(var a=0;a1){if(js(e,t))return!0;for(var n=0;n1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function Xs(e,t){for(var r,n,i,a=!1,o=0;ot.y!==i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function $s(e,t){for(var r=!1,n=0,i=e.length-1;nt.y!==o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function el(e,t,r,n,i){for(var o=0,s=e;o=l.x&&i>=l.y)return!0}var A=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(var c=0,u=A;ci.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;var a=M(e,t,r[0]);return a!==M(e,t,r[1])||a!==M(e,t,r[2])||a!==M(e,t,r[3])}function rl(e,t,r){var n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function nl(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function il(e,t,r,n,i){if(!t[0]&&!t[1])return e;var o=a.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=Ls||c<0||c>=Ls)){var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),g=u.vertexLength;Us(this.layoutVertexArray,A,c,-1,-1),Us(this.layoutVertexArray,A,c,1,-1),Us(this.layoutVertexArray,A,c,1,1),Us(this.layoutVertexArray,A,c,-1,1),this.indexArray.emplaceBack(g,g+1,g+2),this.indexArray.emplaceBack(g,g+3,g+2),u.vertexLength+=4,u.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)},ma("CircleBucket",zs,{omit:["layers"]});var al=new uo({"circle-sort-key":new so(ut.layout_circle["circle-sort-key"])}),ol={paint:new uo({"circle-radius":new so(ut.paint_circle["circle-radius"]),"circle-color":new so(ut.paint_circle["circle-color"]),"circle-blur":new so(ut.paint_circle["circle-blur"]),"circle-opacity":new so(ut.paint_circle["circle-opacity"]),"circle-translate":new oo(ut.paint_circle["circle-translate"]),"circle-translate-anchor":new oo(ut.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new oo(ut.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new oo(ut.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new so(ut.paint_circle["circle-stroke-width"]),"circle-stroke-color":new so(ut.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new so(ut.paint_circle["circle-stroke-opacity"])}),layout:al},sl="undefined"!==typeof Float32Array?Float32Array:Array;function ll(){var e=new sl(4);return sl!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function Al(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=n*-s+a*l,e[3]=i*-s+o*l,e}function cl(){var e=new sl(9);return sl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ul(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function gl(){var e=new sl(16);return sl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function fl(e){var t=new sl(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function hl(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dl(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],A=t[7],c=t[8],u=t[9],g=t[10],f=t[11],h=t[12],d=t[13],p=t[14],y=t[15],m=r*s-n*o,I=r*l-i*o,v=r*A-a*o,E=n*l-i*s,C=n*A-a*s,B=i*A-a*l,b=c*d-u*h,x=c*p-g*h,w=c*y-f*h,Q=u*p-g*d,_=u*y-f*d,S=g*y-f*p,k=m*S-I*_+v*Q+E*w-C*x+B*b;return k?(k=1/k,e[0]=(s*S-l*_+A*Q)*k,e[1]=(i*_-n*S-a*Q)*k,e[2]=(d*B-p*C+y*E)*k,e[3]=(g*C-u*B-f*E)*k,e[4]=(l*w-o*S-A*x)*k,e[5]=(r*S-i*w+a*x)*k,e[6]=(p*v-h*B-y*I)*k,e[7]=(c*B-g*v+f*I)*k,e[8]=(o*_-s*w+A*b)*k,e[9]=(n*w-r*_-a*b)*k,e[10]=(h*C-d*v+y*m)*k,e[11]=(u*v-c*C-f*m)*k,e[12]=(s*x-o*Q-l*b)*k,e[13]=(r*Q-n*x+i*b)*k,e[14]=(d*I-h*E-p*m)*k,e[15]=(c*E-u*I+g*m)*k,e):null}function pl(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],A=t[6],c=t[7],u=t[8],g=t[9],f=t[10],h=t[11],d=t[12],p=t[13],y=t[14],m=t[15],I=r[0],v=r[1],E=r[2],C=r[3];return e[0]=I*n+v*s+E*u+C*d,e[1]=I*i+v*l+E*g+C*p,e[2]=I*a+v*A+E*f+C*y,e[3]=I*o+v*c+E*h+C*m,I=r[4],v=r[5],E=r[6],C=r[7],e[4]=I*n+v*s+E*u+C*d,e[5]=I*i+v*l+E*g+C*p,e[6]=I*a+v*A+E*f+C*y,e[7]=I*o+v*c+E*h+C*m,I=r[8],v=r[9],E=r[10],C=r[11],e[8]=I*n+v*s+E*u+C*d,e[9]=I*i+v*l+E*g+C*p,e[10]=I*a+v*A+E*f+C*y,e[11]=I*o+v*c+E*h+C*m,I=r[12],v=r[13],E=r[14],C=r[15],e[12]=I*n+v*s+E*u+C*d,e[13]=I*i+v*l+E*g+C*p,e[14]=I*a+v*A+E*f+C*y,e[15]=I*o+v*c+E*h+C*m,e}function yl(e,t,r){var n,i,a,o,s,l,A,c,u,g,f,h,d=r[0],p=r[1],y=r[2];return t===e?(e[12]=t[0]*d+t[4]*p+t[8]*y+t[12],e[13]=t[1]*d+t[5]*p+t[9]*y+t[13],e[14]=t[2]*d+t[6]*p+t[10]*y+t[14],e[15]=t[3]*d+t[7]*p+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],A=t[6],c=t[7],u=t[8],g=t[9],f=t[10],h=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=A,e[7]=c,e[8]=u,e[9]=g,e[10]=f,e[11]=h,e[12]=n*d+s*p+u*y+t[12],e[13]=i*d+l*p+g*y+t[13],e[14]=a*d+A*p+f*y+t[14],e[15]=o*d+c*p+h*y+t[15]),e}function ml(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Il(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],A=t[8],c=t[9],u=t[10],g=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+A*n,e[5]=o*i+c*n,e[6]=s*i+u*n,e[7]=l*i+g*n,e[8]=A*i-a*n,e[9]=c*i-o*n,e[10]=u*i-s*n,e[11]=g*i-l*n,e}function vl(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],A=t[4],c=t[5],u=t[6],g=t[7];return t!==e&&(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[0]=a*i+A*n,e[1]=o*i+c*n,e[2]=s*i+u*n,e[3]=l*i+g*n,e[4]=A*i-a*n,e[5]=c*i-o*n,e[6]=u*i-s*n,e[7]=g*i-l*n,e}function El(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e}function Cl(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),A=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*A,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*A,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Bl=pl;function bl(){var e=new sl(3);return sl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function xl(e){var t=new sl(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function wl(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Ql(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function _l(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function Sl(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function kl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Dl(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}function Tl(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}var Ml=Ql;function Rl(){var e=new sl(4);return sl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Ll(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Nl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Fl(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function Ol(){var e=new sl(2);return sl!=Float32Array&&(e[0]=0,e[1]=0),e}function Pl(e){var t=e[0],r=e[1];return t*t+r*r}bl(),Rl();var Gl=Pl,Ul=(Ol(),function(e){function t(t){e.call(this,t,ol)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new zs(e)},t.prototype.queryRadius=function(e){var t=e;return rl("circle-radius",this,t)+rl("circle-stroke-width",this,t)+nl(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o,s){for(var l=il(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),A=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),c="map"===this.paint.get("circle-pitch-alignment"),u=c?l:ql(l,s),g=c?A*o:A,f=0,h=n;fe.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=e.data,s=t.data,l=0;l80*r){n=a=e[0],i=o=e[1];for(var h=r;ha&&(a=s),l>o&&(o=l);A=0!==(A=Math.max(a-n,o-i))?1/A:0}return sA(g,f,r,n,i,A),f}function aA(e,t,r,n,i){var a,o;if(i===LA(e,t,r,n)>0)for(a=t;a=t;a-=n)o=TA(a,e[a],e[a+1],o);return o&&bA(o,o.next)&&(MA(o),o=o.next),o}function oA(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!bA(n,n.next)&&0!==BA(n.prev,n,n.next))n=n.next;else{if(MA(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function sA(e,t,r,n,i,a,o){if(e){!o&&a&&yA(e,n,i,a);for(var s,l,A=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?AA(e,n,i,a):lA(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),MA(e),e=l.next,A=l.next;else if((e=l)===A){o?1===o?sA(e=cA(oA(e),t,r),t,r,n,i,a,2):2===o&&uA(e,t,r,n,i,a):sA(oA(e),t,r,n,i,a,1);break}}}function lA(e){var t=e.prev,r=e,n=e.next;if(BA(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(EA(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&BA(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function AA(e,t,r,n){var i=e.prev,a=e,o=e.next;if(BA(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,u=IA(s,l,t,r,n),g=IA(A,c,t,r,n),f=e.prevZ,h=e.nextZ;f&&f.z>=u&&h&&h.z<=g;){if(f!==e.prev&&f!==e.next&&EA(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&BA(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,h!==e.prev&&h!==e.next&&EA(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&BA(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;f&&f.z>=u;){if(f!==e.prev&&f!==e.next&&EA(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&BA(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;h&&h.z<=g;){if(h!==e.prev&&h!==e.next&&EA(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&BA(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function cA(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!bA(i,a)&&xA(i,n,n.next,a)&&SA(i,a)&&SA(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),MA(n),MA(n.next),n=e=a),n=n.next}while(n!==e);return oA(n)}function uA(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&CA(o,s)){var l=DA(o,s);return o=oA(o,o.next),l=oA(l,l.next),sA(o,t,r,n,i,a),void sA(l,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function gA(e,t,r,n){var i,a,o,s=[];for(i=0,a=t.length;i=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&EA(ar.x||n.x===r.x&&pA(r,n)))&&(r=n,g=l)),n=n.next}while(n!==A);return r}function pA(e,t){return BA(e.prev,e,t.prev)<0&&BA(t.next,e,e.next)<0}function yA(e,t,r,n){var i=e;do{null===i.z&&(i.z=IA(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,mA(i)}function mA(e){var t,r,n,i,a,o,s,l,A=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,A*=2}while(o>1);return e}function IA(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vA(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function CA(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!_A(e,t)&&(SA(e,t)&&SA(t,e)&&kA(e,t)&&(BA(e.prev,e,t.prev)||BA(e,t.prev,t))||bA(e,t)&&BA(e.prev,e,e.next)>0&&BA(t.prev,t,t.next)>0)}function BA(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function bA(e,t){return e.x===t.x&&e.y===t.y}function xA(e,t,r,n){var i=QA(BA(e,t,r)),a=QA(BA(e,t,n)),o=QA(BA(r,n,e)),s=QA(BA(r,n,t));return i!==a&&o!==s||!(0!==i||!wA(e,r,t))||!(0!==a||!wA(e,n,t))||!(0!==o||!wA(r,e,n))||!(0!==s||!wA(r,t,n))}function wA(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function QA(e){return e>0?1:e<0?-1:0}function _A(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&xA(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function SA(e,t){return BA(e.prev,e,e.next)<0?BA(e,t,e.next)>=0&&BA(e,e.prev,t)>=0:BA(e,t,e.prev)<0||BA(e,e.next,t)<0}function kA(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}function DA(e,t){var r=new RA(e.i,e.x,e.y),n=new RA(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function TA(e,t,r,n){var i=new RA(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function MA(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function RA(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function LA(e,t,r,n){for(var i=0,a=t,o=r-n;ar;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),A=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);FA(e,t,Math.max(r,Math.floor(t-o*l/a+A)),Math.min(n,Math.floor(t+(a-o)*l/a+A)),i)}var c=e[t],u=r,g=n;for(OA(e,r,t),i(e[n],c)>0&&OA(e,r,n);u0;)g--}0===i(e[r],c)?OA(e,r,g):OA(e,++g,n),g<=t&&(r=g+1),t<=g&&(n=g-1)}}function OA(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function PA(e,t){return et?1:0}function GA(e,t){var r=e.length;if(r<=1)return[e];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=e[i-1].length,r.holes.push(n))}return r},rA.default=nA;var HA=500,YA=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Bo,this.indexArray=new No,this.indexArray2=new zo,this.programConfigurations=new Ds(e.layers,e.zoom),this.segments=new rs,this.segments2=new rs,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};YA.prototype.populate=function(e,t,r){this.hasPattern=zA("fill",this.layers,t);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=e;a>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},ZA.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,A=-1/0;e.pos>3}if(n--,1===r||2===r)(i+=e.readSVarint())s&&(s=i),(a+=e.readSVarint())A&&(A=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,A]},ZA.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),A=ZA.types[this.type];function c(e){for(var t=0;t>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}function oc(e,t){this.layers=e.readFields(sc,{},t)}function sc(e,t,r){if(3===e){var n=new rc(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}nc.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new WA(this._pbf,t,this.extent,this._keys,this._values)};var lc={VectorTile:oc,VectorTileFeature:WA,VectorTileLayer:rc},Ac=lc.VectorTileFeature.types,cc=500,uc=Math.pow(2,13);function gc(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*uc)+o,i*uc*2,a*uc*2,Math.round(s))}var fc=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new xo,this.indexArray=new No,this.programConfigurations=new Ds(e.layers,e.zoom),this.segments=new rs,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function hc(e,t){return e.x===t.x&&(e.x<0||e.x>Ls)||e.y===t.y&&(e.y<0||e.y>Ls)}function dc(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>Ls}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>Ls}))}fc.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=zA("fill-extrusion",this.layers,t);for(var n=0,i=e;n=1){var m=h[p-1];if(!hc(y,m)){u.vertexLength+4>rs.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var I=y.sub(m)._perp()._unit(),v=m.dist(y);d+v>32768&&(d=0),gc(this.layoutVertexArray,y.x,y.y,I.x,I.y,0,0,d),gc(this.layoutVertexArray,y.x,y.y,I.x,I.y,0,1,d),d+=v,gc(this.layoutVertexArray,m.x,m.y,I.x,I.y,0,0,d),gc(this.layoutVertexArray,m.x,m.y,I.x,I.y,0,1,d);var E=u.vertexLength;this.indexArray.emplaceBack(E,E+2,E+1),this.indexArray.emplaceBack(E+1,E+2,E+3),u.vertexLength+=4,u.primitiveLength+=2}}}}if(u.vertexLength+l>rs.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Ac[e.type]){for(var C=[],B=[],b=u.vertexLength,x=0,w=s;x=2&&e[l-1].equals(e[l-2]);)l--;for(var A=0;A0;if(B&&y>A){var x=c.dist(f);if(x>2*u){var w=c.sub(c.sub(f)._mult(u/x)._round());this.updateDistance(f,w),this.addCurrentVertex(w,d,0,0,g),f=w}}var Q=f&&h,_=Q?r:s?"butt":n;if(Q&&"round"===_&&(Ei&&(_="bevel"),"bevel"===_&&(E>2&&(_="flipbevel"),E100)m=p.mult(-1);else{var S=E*d.add(p).mag()/d.sub(p).mag();m._perp()._mult(S*(b?-1:1))}this.addCurrentVertex(c,m,0,0,g),this.addCurrentVertex(c,m.mult(-1),0,0,g)}else if("bevel"===_||"fakeround"===_){var k=-Math.sqrt(E*E-1),D=b?k:0,T=b?0:k;if(f&&this.addCurrentVertex(c,d,D,T,g),"fakeround"===_)for(var M=Math.round(180*C/Math.PI/Sc),R=1;R2*u){var G=c.add(h.sub(c)._mult(u/P)._round());this.updateDistance(c,G),this.addCurrentVertex(G,p,0,0,g),c=G}}}}},Mc.prototype.addCurrentVertex=function(e,t,r,n,i,a){void 0===a&&(a=!1);var o=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*n,A=-t.y-t.x*n;this.addHalfVertex(e,o,s,a,!1,r,i),this.addHalfVertex(e,l,A,a,!0,-n,i),this.distance>Tc/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,n,i,a))},Mc.prototype.addHalfVertex=function(e,t,r,n,i,a,o){var s=e.x,l=e.y,A=(this.lineClips?this.scaledDistance*(Tc-1):this.scaledDistance)*Dc;if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(wc*t)+128,Math.round(wc*r)+128,1+(0===a?0:a<0?-1:1)|(63&A)<<2,A>>6),this.lineClips){var c=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(c,this.lineClipsArray.length)}var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u},Mc.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Mc.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},ma("LineBucket",Mc,{omit:["layers","patternFeatures"]});var Rc=new uo({"line-cap":new oo(ut.layout_line["line-cap"]),"line-join":new so(ut.layout_line["line-join"]),"line-miter-limit":new oo(ut.layout_line["line-miter-limit"]),"line-round-limit":new oo(ut.layout_line["line-round-limit"]),"line-sort-key":new so(ut.layout_line["line-sort-key"])}),Lc={paint:new uo({"line-opacity":new so(ut.paint_line["line-opacity"]),"line-color":new so(ut.paint_line["line-color"]),"line-translate":new oo(ut.paint_line["line-translate"]),"line-translate-anchor":new oo(ut.paint_line["line-translate-anchor"]),"line-width":new so(ut.paint_line["line-width"]),"line-gap-width":new so(ut.paint_line["line-gap-width"]),"line-offset":new so(ut.paint_line["line-offset"]),"line-blur":new so(ut.paint_line["line-blur"]),"line-dasharray":new Ao(ut.paint_line["line-dasharray"]),"line-pattern":new lo(ut.paint_line["line-pattern"]),"line-gradient":new co(ut.paint_line["line-gradient"])}),layout:Rc},Nc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,r){return r=new Za(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),e.prototype.possiblyEvaluate.call(this,t,r)},t.prototype.evaluate=function(t,r,n,i){return r=m({},r,{zoom:Math.floor(r.zoom)}),e.prototype.evaluate.call(this,t,r,n,i)},t}(so),Fc=new Nc(Lc.paint.properties["line-width"].specification);Fc.useIntegerZoom=!0;var Oc=function(e){function t(t){e.call(this,t,Lc),this.gradientVersion=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){if("line-gradient"===e){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression.expression instanceof Or,this.gradientVersion=(this.gradientVersion+1)%A}},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=Fc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new Mc(e)},t.prototype.queryRadius=function(e){var t=e,r=Pc(rl("line-width",this,t),rl("line-gap-width",this,t)),n=rl("line-offset",this,t);return r/2+Math.abs(n)+nl(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o){var s=il(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*Pc(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),A=this.paint.get("line-offset").evaluate(t,r);return A&&(n=Gc(n,A*o)),Js(s,n,l)},t.prototype.isTileClipped=function(){return!0},t}(fo);function Pc(e,t){return t>0?t+2*e:e}function Gc(e,t){for(var r=[],n=new a(0,0),i=0;i":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};function Wc(e){for(var t="",r=0;r>1,c=-7,u=r?i-1:0,g=r?-1:1,f=e[t+u];for(u+=g,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=g,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+u],u+=g,c-=8);if(0===a)a=1-A;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=A}return(f?-1:1)*o*Math.pow(2,a-n)},write:function(e,t,r,n,i,a){var o,s,l,A=8*a-i-1,c=(1<>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,h=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?g/l:g*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,i),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&s,f+=h,s/=256,i-=8);for(o=o<0;e[r+f]=255&o,f+=h,o/=256,A-=8);e[r+f-h]|=128*d}},$c=eu;function eu(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}eu.Varint=0,eu.Fixed64=1,eu.Bytes=2,eu.Fixed32=5;var tu=4294967296,ru=1/tu,nu=12,iu="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function au(e,t,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return su(e,n,t);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return su(e,n,t);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return su(e,n,t);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return su(e,n,t);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return su(e,n,t);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return su(e,n,t);throw new Error("Expected varint not more than 10 bytes")}function ou(e){return e.type===eu.Bytes?e.readVarint()+e.pos:e.pos+1}function su(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function lu(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),Au(r,n,t),cu(n,t)}function Au(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}function cu(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}function uu(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function gu(e,t){for(var r=0;r>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Bu(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function bu(e,t,r){for(var n="",i=t;i239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(A=l):2===c?128===(192&(a=e[i+1]))&&(A=(31&l)<<6|63&a)<=127&&(A=null):3===c?(a=e[i+1],o=e[i+2],128===(192&a)&&128===(192&o)&&((A=(15&l)<<12|(63&a)<<6|63&o)<=2047||A>=55296&&A<=57343)&&(A=null)):4===c&&(a=e[i+1],o=e[i+2],s=e[i+3],128===(192&a)&&128===(192&o)&&128===(192&s)&&((A=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||A>=1114112)&&(A=null)),null===A?(A=65533,c=1):A>65535&&(A-=65536,n+=String.fromCharCode(A>>>10&1023|55296),A=56320|1023&A),n+=String.fromCharCode(A),i+=c}return n}function xu(e,t,r){return iu.decode(e.subarray(t,r))}function wu(e,t,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}eu.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Eu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Bu(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Eu(this.buf,this.pos)+Eu(this.buf,this.pos+4)*tu;return this.pos+=8,e},readSFixed64:function(){var e=Eu(this.buf,this.pos)+Bu(this.buf,this.pos+4)*tu;return this.pos+=8,e},readFloat:function(){var e=Xc.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Xc.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:au(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=nu&&iu?xu(this.buf,t,e):bu(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==eu.Bytes)return e.push(this.readVarint(t));var r=ou(this);for(e=e||[];this.pos127;);else if(t===eu.Bytes)this.pos=this.readVarint()+this.pos;else if(t===eu.Fixed32)this.pos+=4;else{if(t!==eu.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?lu(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=wu(this.buf,e,this.pos);var r=this.pos-t;r>=128&&uu(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Xc.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Xc.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&uu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,eu.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,gu,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,fu,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,pu,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,hu,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,du,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,yu,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,mu,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Iu,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,vu,t)},writeBytesField:function(e,t){this.writeTag(e,eu.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,eu.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,eu.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,eu.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,eu.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,eu.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,eu.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,eu.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,eu.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,eu.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var Qu=3;function _u(e,t,r){1===e&&r.readMessage(Su,t)}function Su(e,t,r){if(3===e){var n=r.readMessage(ku,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,A=n.top,c=n.advance;t.push({id:i,bitmap:new jl({width:o+2*Qu,height:s+2*Qu},a),metrics:{width:o,height:s,left:l,top:A,advance:c}})}}function ku(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function Du(e){return new $c(e).readFields(_u,[])}var Tu=Qu;function Mu(e){for(var t=0,r=0,n=0,i=e;n=0;g--){var f=o[g];if(!(u.w>f.w||u.h>f.h)){if(u.x=f.x,u.y=f.y,l=Math.max(l,u.y+u.h),s=Math.max(s,u.x+u.w),u.w===f.w&&u.h===f.h){var h=o.pop();g=0&&n>=e&&Ku[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Hu.prototype.substring=function(e,t){var r=new Hu;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Hu.prototype.toString=function(){return this.text},Hu.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Hu.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(qu.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,n=0;n=zu?null:++this.imageSectionID:(this.imageSectionID=Uu,this.imageSectionID)};var Ku={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ju={};function Vu(e,t,r,n,i,a){if(t.imageName){var o=n[t.imageName];return o?o.displaySize[0]*t.scale*Zc/a+i:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+i:0}function Wu(e,t,r,n,i,a){for(var o=0,s=0;s=0,c=0,u=0;u0&&O>x&&(x=O)}else{var P=r[Q.fontStack],G=P&&P[S];if(G&&G.rect)T=G.rect,D=G.metrics;else{var U=t[Q.fontStack],z=U&&U[S];if(!z)continue;D=z.metrics}k=(E-Q.scale)*Zc}L?(e.verticalizable=!0,b.push({glyph:S,imageName:M,x:g,y:f+k,vertical:L,scale:Q.scale,fontStack:Q.fontStack,sectionIndex:_,metrics:D,rect:T}),g+=R*Q.scale+A):(b.push({glyph:S,imageName:M,x:g,y:f+k,vertical:L,scale:Q.scale,fontStack:Q.fontStack,sectionIndex:_,metrics:D,rect:T}),g+=D.advance*Q.scale+A)}if(0!==b.length){var q=g-A;h=Math.max(q,h),ig(b,0,b.length-1,p,x)}g=0;var H=a*E+x;B.lineOffset=Math.max(x,C),f+=H,d=Math.max(H,d),++y}else f+=a,++y}var Y=f-Pu,J=rg(o),K=J.horizontalAlign,j=J.verticalAlign;ag(e.positionedLines,p,K,j,h,d,a,Y,i.length),e.top+=-j*Y,e.bottom=e.top+Y,e.left+=-K*h,e.right=e.left+h}function ig(e,t,r,n,i){if(n||i)for(var a=e[r],o=a.metrics.advance*a.scale,s=(e[r].x+o)*n,l=t;l<=r;l++)e[l].x-=s,e[l].y+=i}function ag(e,t,r,n,i,a,o,s,l){var A=(t-r)*i,c=0;c=a!==o?-s*n-Pu:(-n*l+.5)*o;for(var u=0,g=e;u-r/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],A=0;sn;)A-=l.shift().angleDelta;if(A>i)return!1;o++,s+=u.dist(g)}return!0}function dg(e){for(var t=0,r=0;rA){var h=(A-l)/f,d=Pr(u.x,g.x,h),p=Pr(u.y,g.y,h),y=new lg(d,p,g.angleTo(u),c);return y._round(),!o||hg(e,y,s,o,t)?y:void 0}l+=f}}function Ig(e,t,r,n,i,a,o,s,l){var A=pg(n,a,o),c=yg(n,i),u=c*o,g=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-u=0&&v=0&&E=0&&g+A<=c){var C=new lg(v,E,m,h);C._round(),n&&!hg(e,C,a,n,i)||f.push(C)}}u+=y}return s||f.length||o||(f=vg(e,u/2,r,n,i,a,o,!0,l)),f}function Eg(e,t,r,n,i){for(var o=[],s=0;s=n&&g.x>=n||(u.x>=n?u=new a(n,u.y+(g.y-u.y)*((n-u.x)/(g.x-u.x)))._round():g.x>=n&&(g=new a(n,u.y+(g.y-u.y)*((n-u.x)/(g.x-u.x)))._round()),u.y>=i&&g.y>=i||(u.y>=i?u=new a(u.x+(g.x-u.x)*((i-u.y)/(g.y-u.y)),i)._round():g.y>=i&&(g=new a(u.x+(g.x-u.x)*((i-u.y)/(g.y-u.y)),i)._round()),A&&u.equals(A[A.length-1])||(A=[u],o.push(A)),A.push(g)))))}return o}var Cg=Ru;function Bg(e,t,r,n){var i=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2*Cg,A=o.paddedRect.h-2*Cg,c=e.right-e.left,u=e.bottom-e.top,g=o.stretchX||[[0,l]],f=o.stretchY||[[0,A]],h=function(e,t){return e+t[1]-t[0]},d=g.reduce(h,0),p=f.reduce(h,0),y=l-d,m=A-p,I=0,v=d,E=0,C=p,B=0,b=y,x=0,w=m;if(o.content&&n){var Q=o.content;I=bg(g,0,Q[0]),E=bg(f,0,Q[1]),v=bg(g,Q[0],Q[2]),C=bg(f,Q[1],Q[3]),B=Q[0]-I,x=Q[1]-E,b=Q[2]-Q[0]-v,w=Q[3]-Q[1]-C}var _=function(n,i,l,A){var g=wg(n.stretch-I,v,c,e.left),f=Qg(n.fixed-B,b,n.stretch,d),h=wg(i.stretch-E,C,u,e.top),y=Qg(i.fixed-x,w,i.stretch,p),m=wg(l.stretch-I,v,c,e.left),Q=Qg(l.fixed-B,b,l.stretch,d),_=wg(A.stretch-E,C,u,e.top),S=Qg(A.fixed-x,w,A.stretch,p),k=new a(g,h),D=new a(m,h),T=new a(m,_),M=new a(g,_),R=new a(f/s,y/s),L=new a(Q/s,S/s),N=t*Math.PI/180;if(N){var F=Math.sin(N),O=Math.cos(N),P=[O,-F,F,O];k._matMult(P),D._matMult(P),M._matMult(P),T._matMult(P)}var G=n.stretch+n.fixed,U=l.stretch+l.fixed,z=i.stretch+i.fixed,q=A.stretch+A.fixed;return{tl:k,tr:D,bl:M,br:T,tex:{x:o.paddedRect.x+Cg+G,y:o.paddedRect.y+Cg+z,w:U-G,h:q-z},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:L,minFontScaleX:b/s/c,minFontScaleY:w/s/u,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var S=xg(g,y,d),k=xg(f,m,p),D=0;D0&&(h=Math.max(10,h),this.circleDiameter=h)}else{var d=o.top*s-l,p=o.bottom*s+l,y=o.left*s-l,m=o.right*s+l,I=o.collisionPadding;if(I&&(y-=I[0]*s,d-=I[1]*s,m+=I[2]*s,p+=I[3]*s),c){var v=new a(y,d),E=new a(m,d),C=new a(y,p),B=new a(m,p),b=c*Math.PI/180;v._rotate(b),E._rotate(b),C._rotate(b),B._rotate(b),y=Math.min(v.x,E.x,C.x,B.x),m=Math.max(v.x,E.x,C.x,B.x),d=Math.min(v.y,E.y,C.y,B.y),p=Math.max(v.y,E.y,C.y,B.y)}e.emplaceBack(t.x,t.y,y,d,m,p,r,n,i)}this.boxEndIndex=e.length},kg=function(e,t){if(void 0===e&&(e=[]),void 0===t&&(t=Dg),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Dg(e,t){return et?1:0}function Tg(e,t,r){void 0===t&&(t=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=e[0],A=0;Ao)&&(o=c.x),(!A||c.y>s)&&(s=c.y)}var u=o-n,g=s-i,f=Math.min(u,g),h=f/2,d=new kg([],Mg);if(0===f)return new a(n,i);for(var p=n;pm.d||!m.d)&&(m=v,r&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,I)),v.max-m.d<=t||(h=v.h/2,d.push(new Rg(v.p.x-h,v.p.y-h,h,e)),d.push(new Rg(v.p.x+h,v.p.y-h,h,e)),d.push(new Rg(v.p.x-h,v.p.y+h,h,e)),d.push(new Rg(v.p.x+h,v.p.y+h,h,e)),I+=4)}return r&&(console.log("num probes: "+I),console.log("best distance: "+m.d)),m.p}function Mg(e,t){return t.max-e.max}function Rg(e,t,r,n){this.p=new a(e,t),this.h=r,this.d=Lg(this.p,n),this.max=this.d+this.h*Math.SQRT2}function Lg(e,t){for(var r=!1,n=1/0,i=0;ie.y!==c.y>e.y&&e.x<(c.x-A.x)*(e.y-A.y)/(c.y-A.y)+A.x&&(r=!r),n=Math.min(n,Zs(e,A,c))}return(r?1:-1)*Math.sqrt(n)}function Ng(e){for(var t=0,r=0,n=0,i=e[0],a=0,o=i.length,s=o-1;a0&&(this.data[0]=t,this._down(0)),e}},kg.prototype.peek=function(){return this.data[0]},kg.prototype._up=function(e){for(var t=this,r=t.data,n=t.compare,i=r[e];e>0;){var a=e-1>>1,o=r[a];if(n(i,o)>=0)break;r[e]=o,e=a}r[e]=i},kg.prototype._down=function(e){for(var t=this,r=t.data,n=t.compare,i=this.length>>1,a=r[e];e=0)break;r[e]=s,e=o}r[e]=a};var Fg=7,Og=Number.POSITIVE_INFINITY;function Pg(e,t){function r(e,t){var r=0,n=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":n=i-Fg;break;case"bottom-right":case"bottom-left":n=-i+Fg;break;case"bottom":n=-t+Fg;break;case"top":n=t-Fg}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}function n(e,t,r){var n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-Fg;break;case"bottom-right":case"bottom-left":case"bottom":i=-r+Fg}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}return t[1]!==Og?n(e,t[0],t[1]):r(e,t[0])}function Gg(e,t,r,n,i,a,o){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=Ls/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,A=e.layers[0]._unevaluatedLayout._values,c={};if("composite"===e.textSizeData.kind){var u=e.textSizeData,g=u.minZoom,f=u.maxZoom;c.compositeTextSizes=[A["text-size"].possiblyEvaluate(new Za(g),o),A["text-size"].possiblyEvaluate(new Za(f),o)]}if("composite"===e.iconSizeData.kind){var h=e.iconSizeData,d=h.minZoom,p=h.maxZoom;c.compositeIconSizes=[A["icon-size"].possiblyEvaluate(new Za(d),o),A["icon-size"].possiblyEvaluate(new Za(p),o)]}c.layoutTextSize=A["text-size"].possiblyEvaluate(new Za(e.zoom+1),o),c.layoutIconSize=A["icon-size"].possiblyEvaluate(new Za(e.zoom+1),o),c.textMaxSize=A["text-size"].possiblyEvaluate(new Za(18));for(var y=l.get("text-line-height")*Zc,m="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),I=l.get("text-keep-upright"),v=l.get("text-size"),E=function(){var a=B[C],s=l.get("text-font").evaluate(a,{},o).join(","),A=v.evaluate(a,{},o),u=c.layoutTextSize.evaluate(a,{},o),g=c.layoutIconSize.evaluate(a,{},o),f={horizontal:{},vertical:void 0},h=a.text,d=[0,0];if(h){var p=h.toString(),E=l.get("text-letter-spacing").evaluate(a,{},o)*Zc,b=Qa(p)?E:0,x=l.get("text-anchor").evaluate(a,{},o),w=l.get("text-variable-anchor");if(!w){var Q=l.get("text-radial-offset").evaluate(a,{},o);d=Q?Pg(x,[Q*Zc,Og]):l.get("text-offset").evaluate(a,{},o).map((function(e){return e*Zc}))}var _=m?"center":l.get("text-justify").evaluate(a,{},o),S=l.get("symbol-placement"),k="point"===S?l.get("text-max-width").evaluate(a,{},o)*Zc:0,D=function(){e.allowVerticalPlacement&&wa(p)&&(f.vertical=Ju(h,t,r,i,s,k,y,x,"left",b,d,Ou.vertical,!0,S,u,A))};if(!m&&w){for(var M="auto"===_?w.map((function(e){return Ug(e)})):[_],R=!1,L=0;L=Ls||u.y<0||u.y>=Ls||Kg(e,u,s,r,n,i,g,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,m,C,x,l,v,B,w,h,t,a,A,c,o)};if("line"===Q)for(var D=0,T=Eg(t.geometry,0,0,Ls,Ls);D1){var G=mg(P,b,r.vertical||d,n,p,I);G&&k(P,G)}}else if("Polygon"===t.type)for(var U=0,z=GA(t.geometry,0);UHg&&T(e.layerIds[0]+': Value for "text-size" is >= '+qg+'. Reduce your "text-size".'):"composite"===p.kind&&((y=[Ag*f.compositeTextSizes[0].evaluate(o,{},h),Ag*f.compositeTextSizes[1].evaluate(o,{},h)])[0]>Hg||y[1]>Hg)&&T(e.layerIds[0]+': Value for "text-size" is >= '+qg+'. Reduce your "text-size".'),e.addSymbols(e.text,d,y,s,a,o,A,t,l.lineStartIndex,l.lineLength,g,h);for(var m=0,I=c;mHg&&T(e.layerIds[0]+': Value for "icon-size" is >= '+qg+'. Reduce your "icon-size".'):"composite"===j.kind&&((V=[Ag*E.compositeIconSizes[0].evaluate(v,{},B),Ag*E.compositeIconSizes[1].evaluate(v,{},B)])[0]>Hg||V[1]>Hg)&&T(e.layerIds[0]+': Value for "icon-size" is >= '+qg+'. Reduce your "icon-size".'),e.addSymbols(e.icon,J,V,I,m,v,!1,t,k.lineStartIndex,k.lineLength,-1,B),N=e.icon.placedSymbolArray.length-1,K&&(M=4*K.length,e.addSymbols(e.icon,K,V,I,m,v,Ou.vertical,t,k.lineStartIndex,k.lineLength,-1,B),F=e.icon.placedSymbolArray.length-1)}for(var W in n.horizontal){var Z=n.horizontal[W];if(!w){P=ss(Z.text);var X=s.layout.get("text-rotate").evaluate(v,{},B);w=new Sg(l,t,A,c,u,Z,g,f,h,X)}var $=1===Z.positionedLines.length;if(R+=Yg(e,t,Z,a,s,h,v,d,k,n.vertical?Ou.horizontal:Ou.horizontalOnly,$?Object.keys(n.horizontal):[W],O,N,E,B),$)break}n.vertical&&(L+=Yg(e,t,n.vertical,a,s,h,v,d,k,Ou.vertical,["vertical"],O,F,E,B));var ee=w?w.boxStartIndex:e.collisionBoxArray.length,te=w?w.boxEndIndex:e.collisionBoxArray.length,re=_?_.boxStartIndex:e.collisionBoxArray.length,ne=_?_.boxEndIndex:e.collisionBoxArray.length,ie=Q?Q.boxStartIndex:e.collisionBoxArray.length,ae=Q?Q.boxEndIndex:e.collisionBoxArray.length,oe=S?S.boxStartIndex:e.collisionBoxArray.length,se=S?S.boxEndIndex:e.collisionBoxArray.length,le=-1,Ae=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};le=Ae(w,le),le=Ae(_,le),le=Ae(Q,le);var ce=(le=Ae(S,le))>-1?1:0;ce&&(le*=b/Zc),e.glyphOffsetArray.length>=rf.MAX_GLYPHS&&T("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==v.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,v.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,O.right>=0?O.right:-1,O.center>=0?O.center:-1,O.left>=0?O.left:-1,O.vertical||-1,N,F,P,ee,te,re,ne,ie,ae,oe,se,A,R,L,D,M,ce,0,g,G,U,le)}function jg(e,t,r,n){var i=e.compareText;if(t in i){for(var a=i[t],o=a.length-1;o>=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),A="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],l||A){for(var u=t.iconDependencies,g=t.glyphDependencies,f=t.availableImages,h=new Za(this.zoom),d=0,p=e;d=0;for(var M=0,R=b.sections;M=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var l=0;l0},rf.prototype.hasIconData=function(){return this.icon.segments.get().length>0},rf.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},rf.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},rf.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},rf.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(e)===r&&t.addIndicesForPlacedSymbol(t.text,e)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},ma("SymbolBucket",rf,{omit:["layers","collisionBoxArray","features","compareText"]}),rf.MAX_GLYPHS=65535,rf.addDynamicAttributes=Xg;var af=new uo({"symbol-placement":new oo(ut.layout_symbol["symbol-placement"]),"symbol-spacing":new oo(ut.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new oo(ut.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new so(ut.layout_symbol["symbol-sort-key"]),"symbol-z-order":new oo(ut.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new oo(ut.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new oo(ut.layout_symbol["icon-ignore-placement"]),"icon-optional":new oo(ut.layout_symbol["icon-optional"]),"icon-rotation-alignment":new oo(ut.layout_symbol["icon-rotation-alignment"]),"icon-size":new so(ut.layout_symbol["icon-size"]),"icon-text-fit":new oo(ut.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new oo(ut.layout_symbol["icon-text-fit-padding"]),"icon-image":new so(ut.layout_symbol["icon-image"]),"icon-rotate":new so(ut.layout_symbol["icon-rotate"]),"icon-padding":new oo(ut.layout_symbol["icon-padding"]),"icon-keep-upright":new oo(ut.layout_symbol["icon-keep-upright"]),"icon-offset":new so(ut.layout_symbol["icon-offset"]),"icon-anchor":new so(ut.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new oo(ut.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new oo(ut.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new oo(ut.layout_symbol["text-rotation-alignment"]),"text-field":new so(ut.layout_symbol["text-field"]),"text-font":new so(ut.layout_symbol["text-font"]),"text-size":new so(ut.layout_symbol["text-size"]),"text-max-width":new so(ut.layout_symbol["text-max-width"]),"text-line-height":new oo(ut.layout_symbol["text-line-height"]),"text-letter-spacing":new so(ut.layout_symbol["text-letter-spacing"]),"text-justify":new so(ut.layout_symbol["text-justify"]),"text-radial-offset":new so(ut.layout_symbol["text-radial-offset"]),"text-variable-anchor":new oo(ut.layout_symbol["text-variable-anchor"]),"text-anchor":new so(ut.layout_symbol["text-anchor"]),"text-max-angle":new oo(ut.layout_symbol["text-max-angle"]),"text-writing-mode":new oo(ut.layout_symbol["text-writing-mode"]),"text-rotate":new so(ut.layout_symbol["text-rotate"]),"text-padding":new oo(ut.layout_symbol["text-padding"]),"text-keep-upright":new oo(ut.layout_symbol["text-keep-upright"]),"text-transform":new so(ut.layout_symbol["text-transform"]),"text-offset":new so(ut.layout_symbol["text-offset"]),"text-allow-overlap":new oo(ut.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new oo(ut.layout_symbol["text-ignore-placement"]),"text-optional":new oo(ut.layout_symbol["text-optional"])}),of={paint:new uo({"icon-opacity":new so(ut.paint_symbol["icon-opacity"]),"icon-color":new so(ut.paint_symbol["icon-color"]),"icon-halo-color":new so(ut.paint_symbol["icon-halo-color"]),"icon-halo-width":new so(ut.paint_symbol["icon-halo-width"]),"icon-halo-blur":new so(ut.paint_symbol["icon-halo-blur"]),"icon-translate":new oo(ut.paint_symbol["icon-translate"]),"icon-translate-anchor":new oo(ut.paint_symbol["icon-translate-anchor"]),"text-opacity":new so(ut.paint_symbol["text-opacity"]),"text-color":new so(ut.paint_symbol["text-color"],{runtimeType:Bt,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new so(ut.paint_symbol["text-halo-color"]),"text-halo-width":new so(ut.paint_symbol["text-halo-width"]),"text-halo-blur":new so(ut.paint_symbol["text-halo-blur"]),"text-translate":new oo(ut.paint_symbol["text-translate"]),"text-translate-anchor":new oo(ut.paint_symbol["text-translate-anchor"])}),layout:af},sf=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:It,this.defaultValue=e};sf.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},sf.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},sf.prototype.outputDefined=function(){return!1},sf.prototype.serialize=function(){return null},ma("FormatSectionOverride",sf,{omit:["defaultValue"]});var lf=function(e){function t(t){e.call(this,t,of)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){if(e.prototype.recalculate.call(this,t,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},bf.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(""===t.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else N()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},bf.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},bf.prototype.processTask=function(e,t){var r=this;if(""===t.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(Ba(t.error)):n(null,Ba(t.data)))}else{var i=!1,a=P(this.globalScope)?void 0:[],o=t.hasCallback?function(t,n){i=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"",sourceMapId:r.mapId,error:t?Ca(t):null,data:Ca(n,a)},a)}:function(e){i=!0},s=null,l=Ba(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,l,o);else if(this.parent.getWorkerSource){var A=t.type.split(".");s=this.parent.getWorkerSource(t.sourceMapId,A[0],l.source)[A[1]](l,o)}else o(new Error("Could not find function "+t.type));!i&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},bf.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Qf=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};Qf.prototype.setNorthEast=function(e){return this._ne=e instanceof Sf?new Sf(e.lng,e.lat):Sf.convert(e),this},Qf.prototype.setSouthWest=function(e){return this._sw=e instanceof Sf?new Sf(e.lng,e.lat):Sf.convert(e),this},Qf.prototype.extend=function(e){var t,r,n=this._sw,i=this._ne;if(e instanceof Sf)t=e,r=e;else{if(!(e instanceof Qf)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){var a=e;return this.extend(Qf.convert(a))}var o=e;return this.extend(Sf.convert(o))}return this}if(t=e._sw,r=e._ne,!t||!r)return this}return n||i?(n.lng=Math.min(t.lng,n.lng),n.lat=Math.min(t.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Sf(t.lng,t.lat),this._ne=new Sf(r.lng,r.lat)),this},Qf.prototype.getCenter=function(){return new Sf((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Qf.prototype.getSouthWest=function(){return this._sw},Qf.prototype.getNorthEast=function(){return this._ne},Qf.prototype.getNorthWest=function(){return new Sf(this.getWest(),this.getNorth())},Qf.prototype.getSouthEast=function(){return new Sf(this.getEast(),this.getSouth())},Qf.prototype.getWest=function(){return this._sw.lng},Qf.prototype.getSouth=function(){return this._sw.lat},Qf.prototype.getEast=function(){return this._ne.lng},Qf.prototype.getNorth=function(){return this._ne.lat},Qf.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Qf.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Qf.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Qf.prototype.contains=function(e){var t=Sf.convert(e),r=t.lng,n=t.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Qf.convert=function(e){return!e||e instanceof Qf?e:new Qf(e)};var _f=6371008.8,Sf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Sf.prototype.wrap=function(){return new Sf(h(this.lng,-180,180),this.lat)},Sf.prototype.toArray=function(){return[this.lng,this.lat]},Sf.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Sf.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return _f*Math.acos(Math.min(i,1))},Sf.prototype.toBounds=function(e){void 0===e&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new Qf(new Sf(this.lng-r,this.lat-t),new Sf(this.lng+r,this.lat+t))},Sf.convert=function(e){if(e instanceof Sf)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Sf(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"===typeof e&&null!==e)return new Sf(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var kf=2*Math.PI*_f;function Df(e){return kf*Math.cos(e*Math.PI/180)}function Tf(e){return(180+e)/360}function Mf(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Rf(e,t){return e/Df(t)}function Lf(e){return 360*e-180}function Nf(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function Ff(e,t){return e*Df(Nf(t))}function Of(e){return 1/Math.cos(e*Math.PI/180)}var Pf=function(e,t,r){void 0===r&&(r=0),this.x=+e,this.y=+t,this.z=+r};Pf.fromLngLat=function(e,t){void 0===t&&(t=0);var r=Sf.convert(e);return new Pf(Tf(r.lng),Mf(r.lat),Rf(t,r.lat))},Pf.prototype.toLngLat=function(){return new Sf(Lf(this.x),Nf(this.y))},Pf.prototype.toAltitude=function(){return Ff(this.z,this.y)},Pf.prototype.meterInMercatorCoordinateUnits=function(){return 1/kf*Of(Nf(this.y))};var Gf=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=qf(0,e,e,t,r)};Gf.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Gf.prototype.url=function(e,t){var r=xf(this.x,this.y,this.z),n=Hf(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)},Gf.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new a((e.x*t-this.x)*Ls,(e.y*t-this.y)*Ls)},Gf.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Uf=function(e,t){this.wrap=e,this.canonical=t,this.key=qf(e,t.z,t.z,t.x,t.y)},zf=function(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new Gf(r,+n,+i),this.key=qf(t,e,r,n,i)};function qf(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);var a=1<0;a--)i+=(t&(n=1<this.canonical.z?new zf(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new zf(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},zf.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?qf(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):qf(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},zf.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t},zf.prototype.children=function(e){if(this.overscaledZ>=e)return[new zf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new zf(t,this.wrap,t,r,n),new zf(t,this.wrap,t,r+1,n),new zf(t,this.wrap,t,r,n+1),new zf(t,this.wrap,t,r+1,n+1)]},zf.prototype.isLessThan=function(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Yf.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Yf.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Yf.prototype.getPixels=function(){return new Vl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Yf.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,l=-r*this.dim,A=a;A=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},Zf.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new lc.VectorTile(new $c(this.rawTileData)).layers,this.sourceLayerCoder=new Kf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Zf.prototype.query=function(e,t,r,n){var i=this;this.loadVTLayers();for(var a=e.params||{},o=Ls/e.tileSize/e.scale,s=Mi(a.filter),l=e.queryGeometry,A=e.queryPadding*o,c=$f(l),u=this.grid.query(c.minX-A,c.minY-A,c.maxX+A,c.maxY+A),g=$f(e.cameraQueryGeometry),f=0,h=this.grid3D.query(g.minX-A,g.minY-A,g.maxX+A,g.maxY+A,(function(t,r,n,i){return el(e.cameraQueryGeometry,t-A,r-A,n+A,i+A)}));fn)i=!1;else if(t)if(this.expirationTime=_.maxzoom||"none"!==_.visibility&&(l(Q,this.zoom,n),(d[_.id]=_.createBucket({index:c.bucketLayerIDs.length,layers:Q,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:v,sourceID:this.source})).populate(E,p,this.tileID.canonical),c.bucketLayerIDs.push(Q.map((function(e){return e.id}))))}}}var S=e.mapObject(p.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(S).length?i.send("getGlyphs",{uid:this.uid,stacks:S},(function(e,t){u||(u=e,g=t,T.call(s))})):g={};var k=Object.keys(p.iconDependencies);k.length?i.send("getImages",{icons:k,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){u||(u=e,f=t,T.call(s))})):f={};var D=Object.keys(p.patternDependencies);function T(){if(u)return a(u);if(g&&f&&h){var t=new o(g),r=new e.ImageAtlas(f,h);for(var i in d){var s=d[i];s instanceof e.SymbolBucket?(l(s.layers,this.zoom,n),e.performSymbolLayout(s,g,t.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):s.hasPattern&&(s instanceof e.LineBucket||s instanceof e.FillBucket||s instanceof e.FillExtrusionBucket)&&(l(s.layers,this.zoom,n),s.addFeatures(p,this.tileID.canonical,r.patternPositions))}this.status="done",a(null,{buckets:e.values(d).filter((function(e){return!e.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?g:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?t.positions:null})}}D.length?i.send("getImages",{icons:D,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){u||(u=e,h=t,T.call(s))})):h={},T.call(this)};var c=function(e,t,r,n){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=n||A,this.loading={},this.loaded={}};c.prototype.loadTile=function(t,r){var n=this,i=t.uid;this.loading||(this.loading={});var a=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),o=this.loading[i]=new s(t);o.abort=this.loadVectorData(t,(function(t,s){if(delete n.loading[i],t||!s)return o.status="done",n.loaded[i]=o,r(t);var l=s.rawData,A={};s.expires&&(A.expires=s.expires),s.cacheControl&&(A.cacheControl=s.cacheControl);var c={};if(a){var u=a.finish();u&&(c.resourceTiming=JSON.parse(JSON.stringify(u)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(t,n){if(t||!n)return r(t);r(null,e.extend({rawTileData:l.slice(0)},n,A,c))})),n.loaded=n.loaded||{},n.loaded[i]=o}))},c.prototype.reloadTile=function(e,t){var r=this,n=this.loaded,i=e.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),t(e,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},c.prototype.abortTile=function(e,t){var r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),t()},c.prototype.removeTile=function(e,t){var r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()};var u=e.window.ImageBitmap,g=function(){this.loaded={}};g.prototype.loadTile=function(t,r){var n=t.uid,i=t.encoding,a=t.rawImageData,o=u&&a instanceof u?this.getImageData(a):a,s=new e.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},g.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},g.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]};var f=h;function h(e,t){var r,n=e&&e.type;if("FeatureCollection"===n)for(r=0;r=0!==!!t&&e.reverse()}var y=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,n=this._feature.geometry;r>31}function N(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;s>1;P(e,t,o,n,i,a%2),O(e,t,r,n,o-1,a+1),O(e,t,r,o+1,i,a+1)}}function P(e,t,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),A=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*A*(o-A)/o)*(s-o/2<0?-1:1);P(e,t,r,Math.max(n,Math.floor(r-s*A/o+c)),Math.min(i,Math.floor(r+(o-s)*A/o+c)),a)}var u=t[2*r+a],g=n,f=i;for(G(e,t,n,r),t[2*i+a]>u&&G(e,t,n,i);gu;)f--}t[2*n+a]===u?G(e,t,n,f):G(e,t,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}function G(e,t,r,n){U(e,r,n),U(t,2*r,2*n),U(t,2*r+1,2*n+1)}function U(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function z(e,t,r,n,i,a,o){for(var s,l,A=[0,e.length-1,0],c=[];A.length;){var u=A.pop(),g=A.pop(),f=A.pop();if(g-f<=o)for(var h=f;h<=g;h++)s=t[2*h],l=t[2*h+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(e[h]);else{var d=Math.floor((f+g)/2);s=t[2*d],l=t[2*d+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(e[d]);var p=(u+1)%2;(0===u?r<=s:n<=l)&&(A.push(f),A.push(d-1),A.push(p)),(0===u?i>=s:a>=l)&&(A.push(d+1),A.push(g),A.push(p))}}return c}function q(e,t,r,n,i,a){for(var o=[0,e.length-1,0],s=[],l=i*i;o.length;){var A=o.pop(),c=o.pop(),u=o.pop();if(c-u<=a)for(var g=u;g<=c;g++)H(t[2*g],t[2*g+1],r,n)<=l&&s.push(e[g]);else{var f=Math.floor((u+c)/2),h=t[2*f],d=t[2*f+1];H(h,d,r,n)<=l&&s.push(e[f]);var p=(A+1)%2;(0===A?r-i<=h:n-i<=d)&&(o.push(u),o.push(f-1),o.push(p)),(0===A?r+i>=h:n+i>=d)&&(o.push(f+1),o.push(c),o.push(p))}}return s}function H(e,t,r,n){var i=e-r,a=t-n;return i*i+a*a}b.fromVectorTileJs=x,b.fromGeojsonVt=w,b.GeoJSONWrapper=Q;var Y=function(e){return e[0]},J=function(e){return e[1]},K=function(e,t,r,n,i){void 0===t&&(t=Y),void 0===r&&(r=J),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=e;for(var a=e.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(e.length),s=this.coords=new i(2*e.length),l=0;l=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return ie(ie({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function ee(e){return e/360+.5}function te(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function re(e){return 360*(e-.5)}function ne(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function ie(e,t){for(var r in t)e[r]=t[r];return e}function ae(e){return e.x}function oe(e){return e.y}function se(e,t,r,n){for(var i,a=n,o=r-t>>1,s=r-t,l=e[t],A=e[t+1],c=e[r],u=e[r+1],g=t+3;ga)i=g,a=f;else if(f===a){var h=Math.abs(g-o);hn&&(i-t>3&&se(e,t,i,n),e[i+2]=a,r-i>3&&se(e,i,r,n))}function le(e,t,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=e-r)*o+(s=t-n)*s}function Ae(e,t,r,n){var i={id:"undefined"===typeof e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return ce(i),i}function ce(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)ue(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*A-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(A-a,2))),i=l,a=A}var c=t.length-3;t[2]=1,se(t,0,c,r),t[c+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function pe(e,t,r,n){for(var i=0;i1?1:r}function Ie(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o=n)return null;for(var l=[],A=0;A=r&&h=n)){var d=[];if("Point"===g||"MultiPoint"===g)ve(u,d,r,n,i);else if("LineString"===g)Ee(u,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===g)Be(u,d,r,n,i,!1);else if("Polygon"===g)Be(u,d,r,n,i,!0);else if("MultiPolygon"===g)for(var p=0;p=r&&o<=n&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function Ee(e,t,r,n,i,a,o){for(var s,l,A=Ce(e),c=0===i?xe:we,u=e.start,g=0;gr&&(l=c(A,f,h,p,y,r),o&&(A.start=u+s*l)):m>n?I=r&&(l=c(A,f,h,p,y,r),v=!0),I>n&&m<=n&&(l=c(A,f,h,p,y,n),v=!0),!a&&v&&(o&&(A.end=u+s*l),t.push(A),A=Ce(e)),o&&(u+=s)}var E=e.length-3;f=e[E],h=e[E+1],d=e[E+2],(m=0===i?f:h)>=r&&m<=n&&be(A,f,h,d),E=A.length-3,a&&E>=3&&(A[E]!==A[0]||A[E+1]!==A[1])&&be(A,A[0],A[1],A[2]),A.length&&t.push(A)}function Ce(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function Be(e,t,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=c),u>o.maxY&&(o.maxY=u)}return o}function Me(e,t,r,n){var i=t.geometry,a=t.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&t.size<(i?o:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;i&&Le(s,a),e.push(s)}}function Le(e,t){for(var r=0,n=0,i=e.length,a=i-2;n0===t)for(n=0,i=e.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=ge(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=Qe(n,t)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Oe(e,t,r){return 32*((1<=n;A--){var c=+Date.now();s=this._cluster(s,A),this.trees[A]=new K(s,ae,oe,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",A,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},V.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],t),s=this.getClusters([-180,n,i,a],t);return o.concat(s)}for(var l=this.trees[this._limitZoom(t)],A=[],c=0,u=l.range(ee(r),te(a),ee(i),te(n));ct&&(h+=m.numPoints||1)}if(h>=s){for(var I=c.x*f,v=c.y*f,E=o&&f>1?this._map(c,!0):null,C=(A<<5)+(t+1)+this.points.length,B=0,b=g;B1)for(var _=0,S=g;_>5},V.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},V.prototype._map=function(e,t){if(e.numPoints)return t?ie({},e.properties):e.properties;var r=this.points[e.index].properties,n=this.options.map(r);return t&&n===r?ie({},n):n},Fe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Fe.prototype.splitTile=function(e,t,r,n,i,a,o){for(var s=[e,t,r,n],l=this.options,A=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var c=1<1&&console.time("creation"),g=this.tiles[u]=Te(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),A)){A>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,g.numFeatures,g.numPoints,g.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(g.source=e,i){if(t===l.maxZoom||t===i)continue;var h=1<1&&console.time("clipping");var d,p,y,m,I,v,E=.5*l.buffer/l.extent,C=.5-E,B=.5+E,b=1+E;d=p=y=m=null,I=Ie(e,c,r-E,r+B,0,g.minX,g.maxX,l),v=Ie(e,c,r+C,r+b,0,g.minX,g.maxX,l),e=null,I&&(d=Ie(I,c,n-E,n+B,1,g.minY,g.maxY,l),p=Ie(I,c,n+C,n+b,1,g.minY,g.maxY,l),I=null),v&&(y=Ie(v,c,n-E,n+B,1,g.minY,g.maxY,l),m=Ie(v,c,n+C,n+b,1,g.minY,g.maxY,l),v=null),A>1&&console.timeEnd("clipping"),s.push(d||[],t+1,2*r,2*n),s.push(p||[],t+1,2*r,2*n+1),s.push(y||[],t+1,2*r+1,2*n),s.push(m||[],t+1,2*r+1,2*n+1)}}},Fe.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent,a=n.debug;if(e<0||e>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,A=e,c=t,u=r;!l&&A>0;)A--,c=Math.floor(c/2),u=Math.floor(u/2),l=this.tiles[Oe(A,c,u)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",A,c,u),a>1&&console.time("drilling down"),this.splitTile(l.source,A,c,u,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?ke(this.tiles[s],i):null):null};var Ue=function(t){function r(e,r,n,i){t.call(this,e,r,n,Ge),i&&(this.loadGeoJSON=i)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new e.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!==typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));f(o,!0);try{if(n.filter){var s=e.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(e){return e.key+": "+e.message})).join(", "));var l=o.features.filter((function(e){return s.value.evaluate({zoom:0},e)}));o={type:"FeatureCollection",features:l}}t._geoJSONIndex=n.cluster?new V(ze(n)).load(o.features):Ne(o,n.geojsonVtOptions)}catch(a){return r(a)}t.loaded={};var A={};if(i){var c=i.finish();c&&(A.resourceTiming={},A.resourceTiming[n.source]=JSON.parse(JSON.stringify(c)))}r(null,A)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(e,r){var n=this.loaded,i=e.uid;return n&&n[i]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else{if("string"!==typeof t.data)return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch(n){return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()},r.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(r){t(r)}},r}(c);function ze(t){var r=t.superclusterOptions,n=t.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),A=0,c=l;A1?"@2x":"",l=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),(function(e,t){l=null,o||(o=e,i=t,c())})),A=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),(function(e,t){A=null,o||(o=e,a=t,c())}));function c(){if(o)n(o);else if(i&&a){var t=e.browser.getImageData(a),r={};for(var s in i){var l=i[s],A=l.width,c=l.height,u=l.x,g=l.y,f=l.sdf,h=l.pixelRatio,d=l.stretchX,p=l.stretchY,y=l.content,m=new e.RGBAImage({width:A,height:c});e.RGBAImage.copy(t,m,{x:u,y:g},{x:0,y:0},{width:A,height:c}),r[s]={data:m,pixelRatio:h,sdf:f,stretchX:d,stretchY:p,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),A&&(A.cancel(),A=null)}}}function g(e){var t=e.userImage;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}r.suppressClick=function(){e.window.addEventListener("click",c,!0),e.window.setTimeout((function(){e.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(t,r){var n=t.getBoundingClientRect();return new e.Point(r.clientX-n.left-t.clientLeft,r.clientY-n.top-t.clientTop)},r.touchPos=function(t,r){for(var n=t.getBoundingClientRect(),i=[],a=0;a=0?0:t.button},r.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var f=1,h=function(t){function r(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,r=this.requestors;t=0?1.2:1))}function v(e,t,r,n,i,a,o){for(var s=0;s65535)t(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])t(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],C.loadGlyphRange(r,s,n.url,n.requestManager,(function(e,t){if(t){for(var r in t)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=t[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=e[++s]);var c=Math.abs(A-l.left),u=Math.abs(A-l.right),g=Math.min(c,u),f=void 0,h=i/r*(n+1);if(l.isDash){var d=n-Math.abs(h);f=Math.sqrt(g*g+d*d)}else f=n-Math.sqrt(g*g+h*h);this.data[o+A]=Math.max(0,Math.min(255,f+128))}},Q.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}var i=e[0],a=e[e.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=e[s],A=0;A1&&(l=e[++s]);var c=Math.abs(A-l.left),u=Math.abs(A-l.right),g=Math.min(c,u),f=l.isDash?g:-g;this.data[o+A]=Math.max(0,Math.min(255,f+128))}},Q.prototype.addDash=function(t,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n.minX&&t.x=n.minY&&t.y0&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event("data",n))}}))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setData=function(t){var r=this;return this._data=t,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)r.fire(new e.ErrorEvent(t));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new e.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this},r.prototype.getClusterChildren=function(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this},r.prototype.getClusterLeaves=function(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},n),this},r.prototype._updateWorkerData=function(t){var r=this;this._loaded=!1;var n=e.extend({},this.workerOptions),i=this._data;"string"===typeof i?(n.request=this.map._requestManager.transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(e,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),t(e))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(t,r){var n=this,i=t.actor?"reloadTile":"loadTile";t.actor=this.actor;var a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(i,a,(function(e,a){return delete t.request,t.unloadVectorData(),t.aborted?r(null):e?r(e):(t.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},r.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(e.Evented),L=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),N=function(t){function r(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(t,r){var n=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new e.ErrorEvent(i)):a&&(n.image=a,t&&(n.coordinates=t),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setCoordinates=function(t){var r=this;this.coordinates=t;var n=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=F(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(e){return r.tileID.getTilePoint(e)._round()}));return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(e.Evented);function F(t){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=t;or.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=t}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(N),P=function(t){function r(r,n,i,a){t.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!==typeof e}))}))||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!==typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"===typeof n.canvas||n.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];ethis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Z.prototype.has=function(e){return e.wrapped().key in this.data},Z.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},Z.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},Z.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},Z.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},Z.prototype.remove=function(e,t){if(!this.has(e))return this;var r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},Z.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this},Z.prototype.filter=function(e){var t=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(e){return this.getTileByID(e.key)},r.prototype.getTileByID=function(e){return this._tiles[e]},r.prototype._retainLoadedChildren=function(e,t,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(var n=e.overscaledZ-1;n>=t;n--){var i=e.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},r.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),r=5,n=Math.floor(t*r),i="number"===typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(e){var t=(e-(void 0===this._prevLng?e:this._prevLng))/360,r=Math.round(t);if(this._prevLng=e,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(t){var n=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(e){return n._source.hasTile(e)})))):i=[];var a=t.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Xe(this._source.type)){for(var A={},c={},u=0,g=Object.keys(l);uthis._source.maxzoom){var p=h.children(this._source.maxzoom)[0],y=this.getTile(p);if(y&&y.hasData()){n[p.key]=p;continue}}else{var m=h.children(this._source.maxzoom);if(n[m[0].key]&&n[m[1].key]&&n[m[2].key]&&n[m[3].key])continue}for(var I=d.wasRequested(),v=h.overscaledZ-1;v>=a;--v){var E=h.scaledTo(v);if(i[E.key])break;if(i[E.key]=!0,!(d=this.getTile(E))&&I&&(d=this._addTile(E)),d&&(n[E.key]=E,I=d.wasRequested(),d.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],r=void 0,n=this._tiles[e].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=t;a0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},r.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},r.prototype.tilesIn=function(t,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(t):t,l=t.map((function(e){return o.pointCoordinate(e)})),A=s.map((function(e){return o.pointCoordinate(e)})),c=this.getIds(),u=1/0,g=1/0,f=-1/0,h=-1/0,d=0,p=A;d=0&&y[1].y+p>=0){var m=l.map((function(e){return s.getTilePoint(e)})),I=A.map((function(e){return s.getTilePoint(e)}));a.push({tile:n,tileID:s,queryGeometry:m,cameraQueryGeometry:I,scale:d})}}},I=0;I=e.browser.now())return!0}return!1},r.prototype.setFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.updateState(e,t,r)},r.prototype.removeFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,t,r)},r.prototype.getFeatureState=function(e,t){return e=e||"_geojsonTileLayer",this._state.getState(e,t)},r.prototype.setDependencies=function(e,t,r){var n=this._tiles[e];n&&n.setDependencies(t,r)},r.prototype.reloadTilesForDependencies=function(e,t){for(var r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(e,t)}))},r}(e.Evented);function Ze(e,t){var r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Xe(e){return"raster"===e||"image"===e||"video"===e}function $e(){return new e.window.Worker(hs.workerUrl)}We.maxOverzooming=10,We.maxUnderzooming=3;var et="mapboxgl_preloaded_worker_pool",tt=function(){this.active={}};tt.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Ct=function(e,t,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(var a=0;a=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function _t(t,r,n,i,a,o,s,l){var A=i?t.textSizeData:t.iconSizeData,c=e.evaluateSizeForZoom(A,n.transform.zoom),u=[256/n.width*2+1,256/n.height*2+1],g=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();for(var f=t.lineVertexArray,h=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,d=n.transform.width/n.transform.height,p=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function Dt(t,r,n,i,a,o,s,l,A,c,u,g,f,h){var d,p=r/24,y=t.lineOffsetX*p,m=t.lineOffsetY*p;if(t.numGlyphs>1){var I=t.glyphStartIndex+t.numGlyphs,v=t.lineStartIndex,E=t.lineStartIndex+t.lineLength,C=St(p,l,y,m,n,u,g,t,A,o,f);if(!C)return{notEnoughRoom:!0};var B=xt(C.first.point,s).point,b=xt(C.last.point,s).point;if(i&&!n){var x=kt(t.writingMode,B,b,h);if(x)return x}d=[C.first];for(var w=t.glyphStartIndex+1;w0?k.point:Tt(g,S,Q,1,a),T=kt(t.writingMode,Q,D,h);if(T)return T}var M=Mt(p*l.getoffsetX(t.glyphStartIndex),y,m,n,u,g,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,A,o,f);if(!M)return{notEnoughRoom:!0};d=[M]}for(var R=0,L=d;R0?1:-1,d=0;i&&(h*=-1,d=Math.PI),h<0&&(d+=Math.PI);for(var p=h>0?l+s:l+s+1,y=a,m=a,I=0,v=0,E=Math.abs(f),C=[];I+v<=E;){if((p+=h)=A)return null;if(m=y,C.push(y),void 0===(y=g[p])){var B=new e.Point(c.getx(p),c.gety(p)),b=xt(B,u);if(b.signedDistanceFromCamera>0)y=g[p]=b.point;else{var x=p-h;y=Tt(0===I?o:new e.Point(c.getx(x),c.gety(x)),B,m,E-I+1,u)}}I+=v,v=m.dist(y)}var w=(E-I)/v,Q=y.sub(m),_=Q.mult(w)._add(m);_._add(Q._unit()._perp()._mult(n*h));var S=d+Math.atan2(y.y-m.y,y.x-m.x);return C.push(_),{point:_,angle:S,path:C}}Ct.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ct.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Ct.prototype.insertCircle=function(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)},Ct.prototype._insertBoxCell=function(e,t,r,n,i,a){this.boxCells[i].push(a)},Ct.prototype._insertCircleCell=function(e,t,r,n,i,a){this.circleCells[i].push(a)},Ct.prototype._query=function(e,t,r,n,i,a){if(r<0||e>this.width||n<0||t>this.height)return!i&&[];var o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Ct.prototype._queryCircle=function(e,t,r,n,i){var a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var A=[],c={hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,A,c,i),n?A.length>0:A},Ct.prototype.query=function(e,t,r,n,i){return this._query(e,t,r,n,!1,i)},Ct.prototype.hitTest=function(e,t,r,n,i){return this._query(e,t,r,n,!0,i)},Ct.prototype.hitTestCircle=function(e,t,r,n){return this._queryCircle(e,t,r,!0,n)},Ct.prototype._queryCell=function(e,t,r,n,i,a,o,s){var l=o.seenUids,A=this.boxCells[i];if(null!==A)for(var c=this.bboxes,u=0,g=A;u=c[h+0]&&n>=c[h+1]&&(!s||s(this.boxKeys[f]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[f],x1:c[h],y1:c[h+1],x2:c[h+2],y2:c[h+3]})}}}var d=this.circleCells[i];if(null!==d)for(var p=this.circles,y=0,m=d;yo*o+s*s},Ct.prototype._circleAndRectCollide=function(e,t,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;var A=(o-i)/2,c=Math.abs(t-(i+A));if(c>A+r)return!1;if(l<=s||c<=A)return!0;var u=l-s,g=c-A;return u*u+g*g<=r*r};var Rt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Lt(e,t){for(var r=0;r=1;T--)D.push(S.path[T]);for(var M=1;M0){for(var F=D[0].clone(),O=D[0].clone(),P=1;P=w.x&&O.x<=Q.x&&F.y>=w.y&&O.y<=Q.y?[D]:O.xQ.x||O.yQ.y?[]:e.clipLine([D],w.x,w.y,Q.x,Q.y)}for(var G=0,U=N;G=this.screenRightBoundary||nthis.screenBottomBoundary},Ot.prototype.isInsideGrid=function(e,t,r,n){return r>=0&&e=0&&t0?(this.prevPlacement&&this.prevPlacement.variableOffsets[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID].text&&(d=this.prevPlacement.variableOffsets[u.crossTileID].anchor),this.variableOffsets[u.crossTileID]={textOffset:p,width:r,height:n,anchor:e,textBoxScale:i,prevAnchor:d},this.markUsedJustification(g,e,u,f),g.allowVerticalPlacement&&(this.markUsedOrientation(g,f,u),this.placedOrientations[u.crossTileID]=f),{shift:y,placedGlyphBoxes:m}):void 0},jt.prototype.placeLayerBucketPart=function(t,r,n){var i=this,a=t.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,A=a.textLabelPlaneMatrix,c=a.labelToScreenMatrix,u=a.textPixelRatio,g=a.holdingForFade,f=a.collisionBoxArray,h=a.partiallyEvaluatedTextSize,d=a.collisionGroup,p=s.get("text-optional"),y=s.get("icon-optional"),m=s.get("text-allow-overlap"),I=s.get("icon-allow-overlap"),v="map"===s.get("text-rotation-alignment"),E="map"===s.get("text-pitch-alignment"),C="none"!==s.get("icon-text-fit"),B="viewport-y"===s.get("symbol-z-order"),b=m&&(I||!o.hasIconData()||y),x=I&&(m||!o.hasTextData()||p);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f);var w=function(t,a){if(!r[t.crossTileID])if(g)i.placements[t.crossTileID]=new zt(!1,!1,!1);else{var f=!1,B=!1,w=!0,Q=null,_={box:null,offscreen:null},S={box:null,offscreen:null},k=null,D=null,T=null,M=0,R=0,L=0;a.textFeatureIndex?M=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(M=t.featureIndex),a.verticalTextFeatureIndex&&(R=a.verticalTextFeatureIndex);var N=a.textBox;if(N){var F=function(r){var n=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[t.crossTileID];a&&(i.placedOrientations[t.crossTileID]=a,n=a,i.markUsedOrientation(o,n,t))}return n},O=function(r,n){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(P=P.filter((function(e){return e!==G.anchor}))).unshift(G.anchor)}var U=function(e,r,n){for(var a=e.x2-e.x1,s=e.y2-e.y1,A=t.textBoxScale,c=C&&!I?r:null,g={box:[],offscreen:!1},h=m?2*P.length:P.length,p=0;p=P.length,b=i.attemptAnchorPlacement(y,e,a,s,A,v,E,u,l,d,B,t,o,n,c);if(b&&(g=b.placedGlyphBoxes)&&g.box&&g.box.length){f=!0,Q=b.shift;break}}return g};O((function(){return U(N,a.iconBox,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=_&&_.box&&_.box.length;return o.allowVerticalPlacement&&!n&&t.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),_&&(f=_.box,w=_.offscreen);var z=F(_&&_.box);if(!f&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[t.crossTileID];q&&(i.variableOffsets[t.crossTileID]=q,i.markUsedJustification(o,q.anchor,t,z))}}else{var H=function(e,r){var n=i.collisionIndex.placeCollisionBox(e,m,u,l,d.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,t),i.placedOrientations[t.crossTileID]=r),n};O((function(){return H(N,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?H(r,e.WritingMode.vertical):{box:null,offscreen:null}})),F(_&&_.box&&_.box.length)}}if(f=(k=_)&&k.box&&k.box.length>0,w=k&&k.offscreen,t.useRuntimeCollisionCircles){var Y=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),J=e.evaluateSizeForFeature(o.textSizeData,h,Y),K=s.get("text-padding"),j=t.collisionCircleDiameter;D=i.collisionIndex.placeCollisionCircles(m,Y,o.lineVertexArray,o.glyphOffsetArray,J,l,A,c,n,E,d.predicate,j,K),f=m||D.circles.length>0&&!D.collisionDetected,w=w&&D.offscreen}if(a.iconFeatureIndex&&(L=a.iconFeatureIndex),a.iconBox){var V=function(e){var t=C&&Q?Kt(e,Q.x,Q.y,v,E,i.transform.angle):e;return i.collisionIndex.placeCollisionBox(t,I,u,l,d.predicate)};B=S&&S.box&&S.box.length&&a.verticalIconBox?(T=V(a.verticalIconBox)).box.length>0:(T=V(a.iconBox)).box.length>0,w=w&&T.offscreen}var W=p||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,Z=y||0===t.numIconVertices;if(W||Z?Z?W||(B=B&&f):f=B&&f:B=f=B&&f,f&&k&&k.box&&(S&&S.box&&R?i.collisionIndex.insertCollisionBox(k.box,s.get("text-ignore-placement"),o.bucketInstanceId,R,d.ID):i.collisionIndex.insertCollisionBox(k.box,s.get("text-ignore-placement"),o.bucketInstanceId,M,d.ID)),B&&T&&i.collisionIndex.insertCollisionBox(T.box,s.get("icon-ignore-placement"),o.bucketInstanceId,L,d.ID),D&&(f&&i.collisionIndex.insertCollisionCircles(D.circles,s.get("text-ignore-placement"),o.bucketInstanceId,M,d.ID),n)){var X=o.bucketInstanceId,$=i.collisionCircleArrays[X];void 0===$&&($=i.collisionCircleArrays[X]=new qt);for(var ee=0;ee=0;--_){var S=Q[_];w(o.symbolInstances.get(S),o.collisionArrays[S])}else for(var k=t.symbolInstanceStart;k=0&&(t.text.placedSymbolArray.get(A).crossTileID=a>=0&&A!==a?0:n.crossTileID)}},jt.prototype.markUsedOrientation=function(t,r,n){for(var i=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,a=r===e.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,I=a.numIconVertices>0,v=i.placedOrientations[a.crossTileID],E=v===e.WritingMode.vertical,C=v===e.WritingMode.horizontal||v===e.WritingMode.horizontalOnly;if(m){var B=nr(y.text),b=E?ir:B;h(t.text,s,b);var x=C?ir:B;h(t.text,l,x);var w=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=w||E?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=w||C?1:0);var Q=i.variableOffsets[a.crossTileID];Q&&i.markUsedJustification(t,Q.anchor,a,v);var _=i.placedOrientations[a.crossTileID];_&&(i.markUsedJustification(t,"left",a,_),i.markUsedOrientation(t,_,a))}if(I){var S=nr(y.icon),k=!(g&&a.verticalPlacedIconSymbolIndex&&E);if(a.placedIconSymbolIndex>=0){var D=k?S:ir;h(t.icon,a.numIconVertices,D),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var T=k?ir:S;h(t.icon,a.numVerticalIconVertices,T),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var M=t.collisionArrays[n];if(M){var R=new e.Point(0,0);if(M.textBox||M.verticalTextBox){var L=!0;if(A){var N=i.variableOffsets[d];N?(R=Jt(N.anchor,N.width,N.height,N.textOffset,N.textBoxScale),c&&R._rotate(u?i.transform.angle:-i.transform.angle)):L=!1}M.textBox&&Vt(t.textCollisionBox.collisionVertexArray,y.text.placed,!L||E,R.x,R.y),M.verticalTextBox&&Vt(t.textCollisionBox.collisionVertexArray,y.text.placed,!L||C,R.x,R.y)}var F=Boolean(!C&&M.verticalIconBox);M.iconBox&&Vt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,F,g?R.x:0,g?R.y:0),M.verticalIconBox&&Vt(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,g?R.x:0,g?R.y:0)}}},p=0;pe},jt.prototype.setStale=function(){this.stale=!0};var Wt=Math.pow(2,25),Zt=Math.pow(2,24),Xt=Math.pow(2,17),$t=Math.pow(2,16),er=Math.pow(2,9),tr=Math.pow(2,8),rr=Math.pow(2,1);function nr(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*Wt+t*Zt+r*Xt+t*$t+r*er+t*tr+r*rr+t}var ir=0,ar=function(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ar.prototype.continuePlacement=function(e,t,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new ar(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},or.prototype.commit=function(e){return this.placement.commit(e),this.placement};var sr=512/e.EXTENT/2,lr=function(e,t,r){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;ne.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,i)}else{var A=o[e.scaledTo(Number(a)).key];A&&A.findMatches(t.symbolInstances,e,i)}}for(var c=0;c0)throw new Error("Unimplemented: "+i.map((function(e){return e.command})).join(", ")+".");return n.forEach((function(e){"setTransition"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=t,!0},r.prototype.addImage=function(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,r),this._afterImageUpdated(t)},r.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},r.prototype.getImage=function(e){return this.imageManager.getImage(e)},r.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._afterImageUpdated(t)},r.prototype._afterImageUpdated=function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(t,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(e.validateStyle.source,"sources."+t,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[t]=new We(t,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:t}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},r.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},r.prototype.addLayer=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===t.type){if(gr(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if("object"===typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,"layers."+i,t,{arrayIndex:-1},n))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(t,r){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==r){var n=this._order.indexOf(t);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(t){this._checkLoaded();var r=this._layers[t];if(r){r.setEventedParent(null);var n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(e){return this._layers[e]},r.prototype.hasLayer=function(e){return e in this._layers},r.prototype.setLayerZoomRange=function(t,r,n){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!e.deepEqual(i.filter,r))return null===r||void 0===r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=e.clone$1(r),this._updateLayer(i)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},r.prototype.setLayoutProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,r){var n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},r.prototype.setFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!==typeof t.id&&"number"!==typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(t){this._checkLoaded();var r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))},r.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,r=function(e){return"fill-extrusion"===t._layers[e].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=e;s=0;h--){var d=this._order[h];if(r(d))for(var p=i.length-1;p>=0;p--){var y=i[p].feature;if(n[y.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}",Dr="attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}",Tr="varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}",Mr="attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}",Rr="uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}",Lr="attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}",Nr="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Fr="attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}",Or="varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Pr="attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}",Gr="uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Ur="uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}",zr="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",qr="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}",Hr="varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Yr="uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}",Jr="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Kr="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}",jr="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Vr="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",Wr="uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Zr="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Xr="uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",$r="\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}",en="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",tn="\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}",rn="uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",nn="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}",an="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",on="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}",sn="uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",ln="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",An="uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",cn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}",un="#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",gn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}",fn="#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",hn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}",dn=Un("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),pn=Un(mr,Ir),yn=Un(vr,Er),mn=Un(Cr,Br),In=Un(br,xr),vn=Un(wr,Qr),En=Un(_r,Sr),Cn=Un(kr,Dr),Bn=Un(Tr,Mr),bn=Un(Rr,Lr),xn=Un(Nr,Fr),wn=Un(Or,Pr),Qn=Un(Gr,Ur),_n=Un(zr,qr),Sn=Un(Hr,Yr),kn=Un(Jr,Kr),Dn=Un(jr,Vr),Tn=Un(Wr,Zr),Mn=Un(Xr,$r),Rn=Un(en,tn),Ln=Un(rn,nn),Nn=Un(an,on),Fn=Un(sn,ln),On=Un(An,cn),Pn=Un(un,gn),Gn=Un(fn,hn);function Un(e,t){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:e=e.replace(r,(function(e,t,r,n,i){return s[i]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:t=t.replace(r,(function(e,t,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:o}}var zn=Object.freeze({__proto__:null,prelude:dn,background:pn,backgroundPattern:yn,circle:mn,clippingMask:In,heatmap:vn,heatmapTexture:En,collisionBox:Cn,collisionCircle:Bn,debug:bn,fill:xn,fillOutline:wn,fillOutlinePattern:Qn,fillPattern:_n,fillExtrusion:Sn,fillExtrusionPattern:kn,hillshadePrepare:Dn,hillshade:Tn,line:Mn,lineGradient:Rn,linePattern:Ln,lineSDF:Nn,raster:Fn,symbolIcon:On,symbolSDF:Pn,symbolTextAndIcon:Gn}),qn=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Hn(e){for(var t=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}function Kn(e,t,r,n){var i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,A=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/A,u=c*(n.tileID.canonical.x+n.tileID.wrap*A),g=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/Pt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,g>>16],u_pixel_coord_lower:[65535&u,65535&g]}}Yn.prototype.draw=function(e,t,r,n,i,a,o,s,l,A,c,u,g,f,h,d){var p,y=e.gl;if(!this.failedToCreate){for(var m in e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(a),this.fixedUniforms)this.fixedUniforms[m].set(o[m]);f&&f.setUniforms(e,this.binderUniforms,u,{zoom:g});for(var I=(p={},p[y.LINES]=2,p[y.TRIANGLES]=3,p[y.LINE_STRIP]=1,p)[t],v=0,E=c.get();v0?1/(1-e):1+e}function Ii(e){return e>0?1-1/(1.001-e):-e}var vi,Ei=function(e,t,r,n,i,a,o,s,l,A){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:A,u_texture:0}},Ci=function(t,r,n,i,a,o,s,l,A,c,u){var g=a.transform;return e.extend(Ei(t,r,n,i,a,o,s,l,A,c),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+u})},Bi=function(t,r,n,i,a,o,s,l,A,c){return e.extend(Ci(t,r,n,i,a,o,s,l,!0,A,!0),{u_texsize_icon:c,u_texture_icon:1})},bi=function(e,t,r){return{u_matrix:e,u_opacity:t,u_color:r}},xi=function(t,r,n,i,a,o){return e.extend(Kn(i,o,n,a),{u_matrix:t,u_opacity:r})},wi={fillExtrusion:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fillExtrusionPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fill:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},fillPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},fillOutline:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}},fillOutlinePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},circle:function(t,r){return{u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},collisionBox:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}},collisionCircle:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}},debug:function(t,r){return{u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}},clippingMask:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmap:function(t,r){return{u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmapTexture:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}},hillshade:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}},hillshadePrepare:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}},line:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}},lineGradient:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image),u_image_height:new e.Uniform1f(t,r.u_image_height)}},linePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},lineSDF:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}},raster:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}},symbolIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}},symbolSDF:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},symbolTextAndIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},background:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}},backgroundPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}}};function Qi(t,r,n,i,a,o,s){for(var l=t.context,A=l.gl,c=t.useProgram("collisionBox"),u=[],g=0,f=0,h=0;h0){var E=e.create(),C=m;e.mul(E,y.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(E,E,y.placementViewportMatrix),u.push({circleArray:v,circleOffset:f,transform:C,invTransform:E}),f=g+=v.length/4}I&&c.draw(l,A.LINES,Oe.disabled,Ue.disabled,t.colorModeForRenderPass(),je.disabled,ti(m,t.transform,p),n.id,I.layoutVertexBuffer,I.indexBuffer,I.segments,null,t.transform.zoom,null,null,I.collisionVertexBuffer)}}if(s&&u.length){var B=t.useProgram("collisionCircle"),b=new e.StructArrayLayout2f1f2i16;b.resize(4*g),b._trim();for(var x=0,w=0,Q=u;w=0&&(d[y.associatedIconIndex]={shiftedAnchor:Q,angle:_})}else Lt(y.numGlyphs,f)}if(u){h.clear();for(var k=t.icon.placedSymbolArray,D=0;D0){var s=e.browser.now(),l=(s-t.timeAdded)/o,A=r?(s-r.timeAdded)/o:-1,c=n.getSource(),u=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),g=!r||Math.abs(r.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),f=g&&t.refreshedUponExpiration?1:e.clamp(g?l:1-A,0,1);return t.refreshedUponExpiration&&l>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}function Xi(e,t,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=e.context,o=a.gl,s=e.transform,l=s.tileSize,A=r.paint.get("background-pattern");if(!e.isPatternMissing(A)){var c=!A&&1===n.a&&1===i&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===c){var u=Ue.disabled,g=e.depthModeForSublayer(0,"opaque"===c?Oe.ReadWrite:Oe.ReadOnly),f=e.colorModeForRenderPass(),h=e.useProgram(A?"backgroundPattern":"background"),d=s.coveringTiles({tileSize:l});A&&(a.activeTexture.set(o.TEXTURE0),e.imageManager.bind(e.context));for(var p=r.getCrossfadeParameters(),y=0,m=d;y "+n.overscaledZ),ua(t,y+" "+h+"kb"),s.draw(i,a.TRIANGLES,l,A,Ye.alphaBlended,je.disabled,ni(o,e.Color.transparent,p),u,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}function ua(e,t){e.initDebugOverlayCanvas();var r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}function ga(e,t,r){var n=e.context,i=r.implementation;if("offscreen"===e.renderPass){var a=i.prerender;a&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),a.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Ue.disabled);var o="3d"===i.renderingMode?new Oe(e.context.gl.LEQUAL,Oe.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Oe.ReadOnly);n.setDepthMode(o),i.render(n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}var fa={symbol:ki,circle:Fi,heatmap:Oi,line:zi,fill:qi,"fill-extrusion":Yi,hillshade:Ki,raster:Wi,background:Xi,debug:Aa,custom:ga},ha=function(e,t){this.context=new Ve(e),this.transform=t,this._tileTextures={},this.setup(),this.numSublayers=We.maxUnderzooming+We.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ur,this.gpuTimers={}};ha.prototype.resize=function(t,r){if(this.width=t*e.browser.devicePixelRatio,this.height=r*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n256&&this.clearStencil(),r.setColorMode(Ye.disabled),r.setDepthMode(Oe.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=t;a256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Ue({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},ha.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new Ue({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},ha.prototype.stencilConfigForOverlap=function(e){var t,r=this.context.gl,n=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var C=this.style._layers[i[this.currentLayer]],B=a[C.source],b=c[C.source];this._renderTileClippingMasks(C,b),this.renderLayer(this,B,C,b)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?t.pop():null},ha.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r},ha.prototype.useProgram=function(e,t){this.cache=this.cache||{};var r=""+e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Yn(this.context,e,zn[e],t,wi[e],this._showOverdrawInspector)),this.cache[r]},ha.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},ha.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)},ha.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var t=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,t.RGBA)}},ha.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var da=function(e,t){this.points=e,this.planes=t};da.fromInvProjectionMatrix=function(t,r,n){var i=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],a=Math.pow(2,n),o=i.map((function(r){return e.transformMat4([],r,t)})).map((function(t){return e.scale$1([],t,1/t[3]/r*a)})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var r=e.sub([],o[t[0]],o[t[1]]),n=e.sub([],o[t[2]],o[t[1]]),i=e.normalize([],e.cross([],r,n)),a=-e.dot(i,o[t[1]]);return i.concat(a)}));return new da(o,s)};var pa=function(t,r){this.min=t,this.max=r,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};pa.prototype.quadrant=function(t){for(var r=[t%2===0,t<2],n=e.clone$2(this.min),i=e.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var A=Number.MAX_VALUE,c=-Number.MAX_VALUE,u=0;uthis.max[l]-this.min[l])return 0}return 1};var ya=function(e,t,r,n){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n};ya.prototype.interpolate=function(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,n)),this},ya.prototype.getCenter=function(t,r){var n=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.Point(n,i)},ya.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},ya.prototype.clone=function(){return new ya(this.top,this.bottom,this.left,this.right)},ya.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var ma=function(t,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=void 0===n||null===n?0:n,this._maxPitch=void 0===i||null===i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ya,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ia={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};function va(e,t){var r=!1,n=null,i=function(){n=null,r&&(e(),n=setTimeout(i,t),r=!1)};return function(){return r=!0,n||i(),n}}ma.prototype.clone=function(){var e=new ma(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e},Ia.minZoom.get=function(){return this._minZoom},Ia.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},Ia.maxZoom.get=function(){return this._maxZoom},Ia.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},Ia.minPitch.get=function(){return this._minPitch},Ia.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},Ia.maxPitch.get=function(){return this._maxPitch},Ia.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},Ia.renderWorldCopies.get=function(){return this._renderWorldCopies},Ia.renderWorldCopies.set=function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e},Ia.worldSize.get=function(){return this.tileSize*this.scale},Ia.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ia.size.get=function(){return new e.Point(this.width,this.height)},Ia.bearing.get=function(){return-this.angle/Math.PI*180},Ia.bearing.set=function(t){var r=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ia.pitch.get=function(){return this._pitch/Math.PI*180},Ia.pitch.set=function(t){var r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Ia.fov.get=function(){return this._fov/Math.PI*180},Ia.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},Ia.zoom.get=function(){return this._zoom},Ia.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},Ia.center.get=function(){return this._center},Ia.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},Ia.padding.get=function(){return this._edgeInsets.toJSON()},Ia.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},Ia.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},ma.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},ma.prototype.interpolatePadding=function(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()},ma.prototype.coveringZoomLevel=function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)},ma.prototype.getVisibleUnwrappedCoordinates=function(t){var r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),a=this.pointCoordinate(new e.Point(this.width,this.height)),o=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),A=1,c=s-A;c<=l+A;c++)0!==c&&r.push(new e.UnwrappedTileID(c,t));return r},ma.prototype.coveringTiles=function(t){var r=this.coveringZoomLevel(t),n=r;if(void 0!==t.minzoom&&rt.maxzoom&&(r=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=da.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var A=3,c=function(e){return{aabb:new pa([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},u=[],g=[],f=r,h=t.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var p=u.pop(),y=p.x,m=p.y,I=p.fullyVisible;if(!I){var v=p.aabb.intersects(s);if(0===v)continue;I=2===v}var E=p.aabb.distanceX(o),C=p.aabb.distanceY(o),B=Math.max(Math.abs(E),Math.abs(C)),b=A+(1<b&&p.zoom>=l)g.push({tileID:new e.OverscaledTileID(p.zoom===f?h:p.zoom,p.wrap,p.zoom,y,m),distanceSq:e.sqrLen([o[0]-.5-y,o[1]-.5-m])});else for(var x=0;x<4;x++){var w=(y<<1)+x%2,Q=(m<<1)+(x>>1);u.push({aabb:p.aabb.quadrant(x),zoom:p.zoom+1,x:w,y:Q,wrap:p.wrap,fullyVisible:I})}}return g.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))},ma.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},Ia.unmodified.get=function(){return this._unmodified},ma.prototype.zoomScale=function(e){return Math.pow(2,e)},ma.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},ma.prototype.project=function(t){var r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)},ma.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},Ia.point.get=function(){return this.project(this.center)},ma.prototype.setLocationAtPoint=function(t,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},ma.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},ma.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},ma.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},ma.prototype.coordinateLocation=function(e){return e.toLngLat()},ma.prototype.pointCoordinate=function(t){var r=0,n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.transformMat4(n,n,this.pixelMatrixInverse),e.transformMat4(i,i,this.pixelMatrixInverse);var a=n[3],o=i[3],s=n[0]/a,l=i[0]/o,A=n[1]/a,c=i[1]/o,u=n[2]/a,g=i[2]/o,f=u===g?0:(r-u)/(g-u);return new e.MercatorCoordinate(e.number(s,l,f)/this.worldSize,e.number(A,c,f)/this.worldSize)},ma.prototype.coordinatePoint=function(t){var r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix),new e.Point(r[0]/r[3],r[1]/r[3])},ma.prototype.getBounds=function(){return(new e.LngLatBounds).extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},ma.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},ma.prototype.setMaxBounds=function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},ma.prototype.calculatePosMatrix=function(t,r){void 0===r&&(r=!1);var n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*o,a.y*o,0]),e.scale(l,l,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},ma.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},ma.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,r,n,i,a=-90,o=90,s=-180,l=180,A=this.size,c=this._unmodified;if(this.latRange){var u=this.latRange;a=e.mercatorYfromLat(u[1])*this.worldSize,t=(o=e.mercatorYfromLat(u[0])*this.worldSize)-ao&&(i=o-p)}if(this.lngRange){var y=f.x,m=A.x/2;y-ml&&(n=l-m)}void 0===n&&void 0===i||(this.center=this.unproject(new e.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},ma.prototype._calcMatrices=function(){if(this.height){var t=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,A=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),c=this.height/50,u=new Float64Array(16);e.perspective(u,this._fov,this.width/this.height,c,A),u[8]=2*-r.x/this.width,u[9]=2*r.y/this.height,e.scale(u,u,[1,-1,1]),e.translate(u,u,[0,0,-this.cameraToCenterDistance]),e.rotateX(u,u,this._pitch),e.rotateZ(u,u,this.angle),e.translate(u,u,[-s,-l,0]),this.mercatorMatrix=e.scale([],u,[this.worldSize,this.worldSize,this.worldSize]),e.scale(u,u,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=u,this.invProjMatrix=e.invert([],this.projMatrix);var g=this.width%2/2,f=this.height%2/2,h=Math.cos(this.angle),d=Math.sin(this.angle),p=s-Math.round(s)+h*g+d*f,y=l-Math.round(l)+h*f+d*g,m=new Float64Array(u);if(e.translate(m,m,[p>.5?p-1:p,y>.5?y-1:y,0]),this.alignedProjMatrix=m,u=e.create(),e.scale(u,u,[this.width/2,-this.height/2,1]),e.translate(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=e.create(),e.scale(u,u,[1,-1,1]),e.translate(u,u,[-1,-1,0]),e.scale(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(u=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=u,this._posMatrixCache={},this._alignedPosMatrixCache={}}},ma.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},ma.prototype.getCameraPoint=function(){var t=this._pitch,r=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,r))},ma.prototype.getCameraQueryGeometry=function(t){var r=this.getCameraPoint();if(1===t.length)return[t[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=t;s=3&&!e.some((function(e){return isNaN(e)}))){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},Ea.prototype._updateHashUnthrottled=function(){var t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,t)}catch(r){}};var Ca={linearity:.3,easing:e.bezier(0,0,.3,1)},Ba=e.extend({deceleration:2500,maxSpeed:1400},Ca),ba=e.extend({deceleration:20,maxSpeed:1400},Ca),xa=e.extend({deceleration:1e3,maxSpeed:360},Ca),wa=e.extend({deceleration:1e3,maxSpeed:90},Ca),Qa=function(e){this._map=e,this.clear()};function _a(e,t){(!e.duration||e.duration0&&r-t[0].time>n;)t.shift()},Qa.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new ka(e.type,this._map,e))},Ma.prototype.dblclick=function(e){return this._firePreventable(new ka(e.type,this._map,e))},Ma.prototype.mouseover=function(e){this._map.fire(new ka(e.type,this._map,e))},Ma.prototype.mouseout=function(e){this._map.fire(new ka(e.type,this._map,e))},Ma.prototype.touchstart=function(e){return this._firePreventable(new Da(e.type,this._map,e))},Ma.prototype.touchmove=function(e){this._map.fire(new Da(e.type,this._map,e))},Ma.prototype.touchend=function(e){this._map.fire(new Da(e.type,this._map,e))},Ma.prototype.touchcancel=function(e){this._map.fire(new Da(e.type,this._map,e))},Ma.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},Ma.prototype.isEnabled=function(){return!0},Ma.prototype.isActive=function(){return!1},Ma.prototype.enable=function(){},Ma.prototype.disable=function(){};var Ra=function(e){this._map=e};Ra.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ra.prototype.mousemove=function(e){this._map.fire(new ka(e.type,this._map,e))},Ra.prototype.mousedown=function(){this._delayContextMenu=!0},Ra.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ka("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ra.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new ka(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()},Ra.prototype.isEnabled=function(){return!0},Ra.prototype.isActive=function(){return!1},Ra.prototype.enable=function(){},Ra.prototype.disable=function(){};var La=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};function Na(e,t){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=Fa(t),this.touches=Na(r,t)))},Ua.prototype.touchmove=function(e,t,r){if(!this.aborted&&this.centroid){var n=Na(r,t);for(var i in this.touches){var a=this.touches[i],o=n[i];(!o||o.dist(a)>Ga)&&(this.aborted=!0)}}},Ua.prototype.touchend=function(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>Pa)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var za=function(e){this.singleTap=new Ua(e),this.numTaps=e.numTaps,this.reset()};za.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},za.prototype.touchstart=function(e,t,r){this.singleTap.touchstart(e,t,r)},za.prototype.touchmove=function(e,t,r){this.singleTap.touchmove(e,t,r)},za.prototype.touchend=function(e,t,r){var n=this.singleTap.touchend(e,t,r);if(n){var i=e.timeStamp-this.lastTime0&&(this._active=!0);var i=Na(n,r),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var l in i){var A=i[l],c=this._touches[l];c&&(a._add(A),o._add(A.sub(c)),s++,i[l]=A)}if(this._touches=i,!(sMath.abs(e.x)}var lo=100,Ao=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},t.prototype._start=function(e){this._lastPoints=e,so(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,r){var n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,r){if(void 0!==this._valid)return this._valid;var n=2,i=e.mag()>=n,a=t.mag()>=n;if(i||a){if(!i||!a)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove0===t.y>0;return so(e)&&so(t)&&o}},t}($a),co={panStep:100,bearingStep:15,pitchStep:10},uo=function(){var e=co;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1};function go(e){return e*(2-e)}uo.prototype.reset=function(){this._active=!1},uo.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:go,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+n*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},uo.prototype.enable=function(){this._enabled=!0},uo.prototype.disable=function(){this._enabled=!1,this.reset()},uo.prototype.isEnabled=function(){return this._enabled},uo.prototype.isActive=function(){return this._active},uo.prototype.disableRotation=function(){this._rotationDisabled=!0},uo.prototype.enableRotation=function(){this._rotationDisabled=!1};var fo=4.000244140625,ho=.01,po=1/450,yo=2,mo=function(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=ho,this._wheelZoomRate=po,e.bindAll(["_onTimeout"],this)};mo.prototype.setZoomRate=function(e){this._defaultZoomRate=e},mo.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},mo.prototype.isEnabled=function(){return!!this._enabled},mo.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},mo.prototype.isZooming=function(){return!!this._zooming},mo.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},mo.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},mo.prototype.wheel=function(t){if(this.isEnabled()){var r=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,n=e.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%fo===0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}},mo.prototype._onTimeout=function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},mo.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},mo.prototype.renderFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>fo?this._wheelZoomRate:this._defaultZoomRate,i=yo/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"===typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"===typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,A=this._easing,c=!1;if("wheel"===this._type&&l&&A){var u=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),g=A(u);o=e.number(l,s,g),u<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},mo.prototype._smoothOutEasing=function(t){var r=e.ease;if(this._prevEase){var n=this._prevEase,i=(e.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:r},r},mo.prototype.reset=function(){this._active=!1};var Io=function(e,t){this._clickZoom=e,this._tapZoom=t};Io.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Io.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Io.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Io.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var vo=function(){this.reset()};vo.prototype.reset=function(){this._active=!1},vo.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}},vo.prototype.enable=function(){this._enabled=!0},vo.prototype.disable=function(){this._enabled=!1,this.reset()},vo.prototype.isEnabled=function(){return this._enabled},vo.prototype.isActive=function(){return this._active};var Eo=function(){this._tap=new za({numTouches:1,numTaps:1}),this.reset()};Eo.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Eo.prototype.touchstart=function(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>Oa&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))},Eo.prototype.touchmove=function(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)},Eo.prototype.touchend=function(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)},Eo.prototype.touchcancel=function(){this.reset()},Eo.prototype.enable=function(){this._enabled=!0},Eo.prototype.disable=function(){this._enabled=!1,this.reset()},Eo.prototype.isEnabled=function(){return this._enabled},Eo.prototype.isActive=function(){return this._active};var Co=function(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r};Co.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Co.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Co.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Co.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Bo=function(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r};Bo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Bo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Bo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Bo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var bo=function(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};bo.prototype.enable=function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},bo.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},bo.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},bo.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},bo.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},bo.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var xo=function(e){return e.zoom||e.drag||e.pitch||e.rotate},wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(e.Event);function Qo(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var _o=function(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Qa(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),e.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[e.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,E):Math.max(.5,E),C=Math.pow(p,1-t),B=i.unproject(I.add(v.mult(t*C)).mult(d));i.setLocationAtPoint(i.renderWorldCopies?B.wrap():B,h)}n._fireMoveEvents(r)}),(function(e){n._afterEase(r,e)}),t),this},r.prototype._prepareEase=function(t,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.Event("pitchstart",t))},r.prototype._fireMoveEvents=function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))},r.prototype._afterEase=function(t,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.Event("zoomend",t)),i&&this.fire(new e.Event("rotateend",t)),a&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}},r.prototype.flyTo=function(t,r){var n=this;if(!t.essential&&e.browser.prefersReducedMotion){var i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),A=this.getPadding(),c="zoom"in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,u="bearing"in t?this._normalizeBearing(t.bearing,s):s,g="pitch"in t?+t.pitch:l,f="padding"in t?t.padding:a.padding,h=a.zoomScale(c-o),d=e.Point.convert(t.offset),p=a.centerPoint.add(d),y=a.pointLocation(p),m=e.LngLat.convert(t.center||y);this._normalizeCenter(m);var I=a.project(y),v=a.project(m).sub(I),E=t.curve,C=Math.max(a.width,a.height),B=C/h,b=v.mag();if("minZoom"in t){var x=e.clamp(Math.min(t.minZoom,o,c),a.minZoom,a.maxZoom),w=C/a.zoomScale(x-o);E=Math.sqrt(w/b*2)}var Q=E*E;function _(e){var t=(B*B-C*C+(e?-1:1)*Q*Q*b*b)/(2*(e?B:C)*Q*b);return Math.log(Math.sqrt(t*t+1)-t)}function S(e){return(Math.exp(e)-Math.exp(-e))/2}function k(e){return(Math.exp(e)+Math.exp(-e))/2}function D(e){return S(e)/k(e)}var T=_(0),M=function(e){return k(T)/k(T+E*e)},R=function(e){return C*((k(T)*D(T+E*e)-S(T))/Q)/b},L=(_(1)-T)/E;if(Math.abs(b)<1e-6||!isFinite(L)){if(Math.abs(C-B)<1e-6)return this.easeTo(t,r);var N=Bt.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=g!==l,this._padding=!a.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(t){var i=t*L,h=1/M(i);a.zoom=1===t?c:o+a.scaleZoom(h),n._rotating&&(a.bearing=e.number(s,u,t)),n._pitching&&(a.pitch=e.number(l,g,t)),n._padding&&(a.interpolatePadding(A,f,t),p=a.centerPoint.add(d));var y=1===t?m:a.unproject(I.add(v.mult(R(i))).mult(h));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,p),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),t),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}if(!e){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.browser.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(t,r){t=e.wrap(t,-180,180);var n=Math.abs(t-r);return Math.abs(t-360-r)180?-360:r<-180?360:0}},r}(e.Evented),ko=function(t){void 0===t&&(t={}),this.options=t,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ko.prototype.getDefaultPosition=function(){return"bottom-right"},ko.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ko.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},ko.prototype._setElementTitle=function(e,t){var r=this._map._getUIString("AttributionControl."+t);e.title=r,e.setAttribute("aria-label",r)},ko.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},ko.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var n=r.reduce((function(e,t,n){return t.value&&(e+=t.key+"="+t.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},ko.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Do=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Do.prototype.onAdd=function(e){this._map=e,this._container=r.create("div","mapboxgl-ctrl");var t=r.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Do.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Do.prototype.getDefaultPosition=function(){return"bottom-left"},Do.prototype._updateLogo=function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Do.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},Do.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}};var To=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};To.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},To.prototype.remove=function(e){for(var t=this._currentlyRunning,r=0,n=t?this._queue.concat(t):this._queue;rt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitchGo)throw new Error("maxPitch must be less than or equal to "+Go);var i=new ma(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(n.call(this,i,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new To,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Mo,t.locale),this._clickTolerance=t.clickTolerance,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),"string"===typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof Lo))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),"undefined"!==typeof e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new _o(this,t);var a="string"===typeof t.hash&&t.hash||void 0;this._hash=t.hash&&new Ea(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new ko({customAttribution:t.customAttribution})),this.addControl(new Do,t.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new e.Event(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new e.Event(t.dataType+"dataloading",t))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this},i.prototype.hasControl=function(e){return this._controls.indexOf(e)>-1},i.prototype.resize=function(t){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t))),this.fire(new e.Event("resize",t)),a&&this.fire(new e.Event("moveend",t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},i.prototype.setMinZoom=function(e){if((e=null===e||void 0===e?Fo:e)>=Fo&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(e){if((e=null===e||void 0===e?Po:e)=Po&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()Go)throw new Error("maxPitch must be less than or equal to "+Go);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(e,t,r){var n,i=this;if("mouseenter"===e||"mouseover"===e){var a=!1,o=function(n){var o=i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[];o.length?a||(a=!0,r.call(i,new ka(e,i,n.originalEvent,{features:o}))):a=!1};return{layer:t,listener:r,delegates:{mousemove:o,mouseout:function(){a=!1}}}}if("mouseleave"===e||"mouseout"===e){var s=!1,l=function(n){(i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?s=!0:s&&(s=!1,r.call(i,new ka(e,i,n.originalEvent)))},A=function(t){s&&(s=!1,r.call(i,new ka(e,i,t.originalEvent)))};return{layer:t,listener:r,delegates:{mousemove:l,mouseout:A}}}var c=function(e){var n=i.getLayer(t)?i.queryRenderedFeatures(e.point,{layers:[t]}):[];n.length&&(e.features=n,r.call(i,e),delete e.features)};return{layer:t,listener:r,delegates:(n={},n[e]=c,n)}},i.prototype.on=function(e,t,r){if(void 0===r)return n.prototype.on.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(e,t,r){if(void 0===r)return n.prototype.once.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(e,t,r){var i=this;if(void 0===r)return n.prototype.off.call(this,e,t);var a=function(n){for(var a=n[e],o=0;o180;){var s=n.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}Jo.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),r.disableDrag()},Jo.prototype.move=function(e,t){var r=this.map,n=this.mouseRotate.mousemoveWindow(e,t);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Jo.prototype.off=function(){var e=this.element;r.removeEventListener(e,"mousedown",this.mousedown),r.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(e,"touchmove",this.touchmove),r.removeEventListener(e,"touchend",this.touchend),r.removeEventListener(e,"touchcancel",this.reset),this.offTemp()},Jo.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},Jo.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),r.mousePos(this.element,t)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},Jo.prototype.mousemove=function(e){this.move(e,r.mousePos(this.element,e))},Jo.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},Jo.prototype.touchstart=function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))},Jo.prototype.touchmove=function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))},Jo.prototype.touchend=function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(e){this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(e){return this._rotation=e||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(e){return this._rotationAlignment=e||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(e.Evented),Xo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};function $o(t){void 0!==Wo?t(Wo):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((function(e){Wo="denied"!==e.state,t(Wo)})):(Wo=!!e.window.navigator.geolocation,t(Wo))}var es=0,ts=!1,rs=function(t){function n(r){t.call(this),this.options=e.extend({},Xo,r),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),$o(this._setupUI),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,es=0,ts=!1},n.prototype._isOutOfMapMaxBounds=function(e){var t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitudet.getEast()||r.latitudet.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}},n.prototype._updateCamera=function(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(t){if(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),n=t.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&ts)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(t){var n=this;if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Zo(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){var r=t.originalEvent&&"resize"===t.originalEvent.type;t.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new e.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":es--,ts=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++es>1?(t={maximumAge:6e5,timeout:0},ts=!0):(t=this.options.positionOptions,ts=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(e.Evented),ns={maxWidth:100,unit:"metric"},is=function(t){this.options=e.extend({},ns,t),e.bindAll(["_onMove","setUnit"],this)};function as(e,t,r){var n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?os(t,n,l/5280,e._getUIString("ScaleControl.Miles")):os(t,n,l,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?os(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?os(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):os(t,n,s,e._getUIString("ScaleControl.Meters"))}function os(e,t,r,n){var i=ls(r),a=i/r;e.style.width=t*a+"px",e.innerHTML=i+" "+n}function ss(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}function ls(e){var t=Math.pow(10,(""+Math.floor(e)).length-1),r=e/t;return t*(r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:ss(r))}is.prototype.getDefaultPosition=function(){return"bottom-left"},is.prototype._onMove=function(){as(this._map,this._container,this.options)},is.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},is.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},is.prototype.setUnit=function(e){this.options.unit=e,as(this._map,this._container,this.options)};var As=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};As.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},As.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},As.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},As.prototype._setupUI=function(){var t=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},As.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e},As.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},As.prototype._isFullscreen=function(){return this._fullscreen},As.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},As.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var cs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},us=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),gs=function(t){function n(r){t.call(this),this.options=e.extend(Object.create(cs),r),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},n.prototype.setHTML=function(t){var r,n=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");for(i.innerHTML=t;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},n.prototype.setDOMContent=function(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},n.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},n.prototype.setOffset=function(e){return this.options.offset=e,this._update(),this},n.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(e){this._update(e.point)},n.prototype._onMouseMove=function(e){this._update(e.point)},n.prototype._onDrag=function(e){this._update(e.point)},n.prototype._update=function(e){var t=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(e){return t._container.classList.add(e)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ko(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,o=fs(this.options.offset);if(!a){var s,l=this._container.offsetWidth,A=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-A?["bottom"]:[],i.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var c=i.add(o[a]).round();r.setTransform(this._container,jo[a]+" translate("+c.x+"px,"+c.y+"px)"),Vo(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var e=this._container.querySelector(us);e&&e.focus()}},n.prototype._onClose=function(){this.remove()},n}(e.Evented);function fs(t){if(t){if("number"===typeof t){var r=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{center:new e.Point(0,0),top:new e.Point(0,t),"top-left":new e.Point(r,r),"top-right":new e.Point(-r,r),bottom:new e.Point(0,-t),"bottom-left":new e.Point(r,-r),"bottom-right":new e.Point(-r,-r),left:new e.Point(t,0),right:new e.Point(-t,0)}}if(t instanceof e.Point||Array.isArray(t)){var n=e.Point.convert(t);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:e.Point.convert(t.center||[0,0]),top:e.Point.convert(t.top||[0,0]),"top-left":e.Point.convert(t["top-left"]||[0,0]),"top-right":e.Point.convert(t["top-right"]||[0,0]),bottom:e.Point.convert(t.bottom||[0,0]),"bottom-left":e.Point.convert(t["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(t["bottom-right"]||[0,0]),left:e.Point.convert(t.left||[0,0]),right:e.Point.convert(t.right||[0,0])}}return fs(new e.Point(0,0))}var hs={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:zo,NavigationControl:Yo,GeolocateControl:rs,AttributionControl:ko,ScaleControl:is,FullscreenControl:As,Popup:gs,Marker:Zo,Style:pr,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:at,clearPrewarmedResources:ot,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return tt.workerCount},set workerCount(e){tt.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:""};return hs})),r}()},3108:function(e,t,r){"use strict";e.exports=r(26099)},26099:function(e,t,r){"use strict";var n=r(64928),i=r(32420),a=r(51160),o=r(76752),s=r(55616),l=r(31264),A=r(47520),c=r(18400),u=r(72512),g=r(76244);function f(e,t){for(var r=t[0],n=t[1],a=1/(t[2]-r),o=1/(t[3]-n),s=new Array(e.length),l=0,A=e.length/2;l>>1;t.dtype||(t.dtype="array"),"string"===typeof t.dtype?h=new(u(t.dtype))(p):t.dtype&&(h=t.dtype,Array.isArray(h)&&(h.length=p));for(var y=0;yr||s>1073741824){for(var g=0;gr+i||w>n+i||Q=k)&&o!==s){var l=m[a];void 0===s&&(s=l.length);for(var A=o;A=p&&u<=C&&g>=y&&g<=B&&D.push(c)}var f=I[a],h=f[4*o+0],d=f[4*o+1],v=f[4*o+2],E=f[4*o+3],b=function(e,t){for(var r=null,n=0;null===r;)if(r=e[4*t+n],++n>e.length)return null;return r}(f,o+1),_=.5*i,T=a+1;t(r,n,_,T,h,d||v||E||b),t(r,n+_,_,T,d,v||E||b),t(r+_,n,_,T,v,E||b),t(r+_,n+_,_,T,E,b)}}(0,0,1,0,0,1),D},h;function _(e,t,r){for(var n=1,i=.5,a=.5,o=.5,s=0;s0){t+=Math.abs(o(e[0]));for(var r=1;r2){for(l=0;l=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=u,t.lengthToDegrees=function(e,t){return g(u(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=g,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(u(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=f,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!f(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},3256:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(46284);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,A,c,u,g=0,f=0,h=e.type,d="FeatureCollection"===h,p="Feature"===h,y=d?e.features.length:1,m=0;mA||f>c||h>u)return l=i,A=r,c=f,u=h,void(o=0);var d=n.lineString([l,i],e.properties);if(!1===t(d,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;se[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=u,t.lengthToDegrees=function(e,t){return g(u(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=g,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(u(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=f,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!f(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},84880:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(76796);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,A,c,u,g=0,f=0,h=e.type,d="FeatureCollection"===h,p="Feature"===h,y=d?e.features.length:1,m=0;mA||f>c||h>u)return l=i,A=r,c=f,u=h,void(o=0);var d=n.lineString([l,i],e.properties);if(!1===t(d,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=u,t.lengthToDegrees=function(e,t){return g(u(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=g,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(u(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=f,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!f(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")},t.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},t.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},t.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},t.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},t.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},t.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},t.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},43752:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(49840);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,A,c,u,g=0,f=0,h=e.type,d="FeatureCollection"===h,p="Feature"===h,y=d?e.features.length:1,m=0;mA||f>c||h>u)return l=i,A=r,c=f,u=h,void(o=0);var d=n.lineString([l,i],e.properties);if(!1===t(d,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;si&&(i=e[o]),e[o]1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;ie.length)&&(r=e.length),e.substring(r-t.length,r)===t}var p="",y="",m="",I="",v={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function E(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function C(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function B(e,t,r){var i="",a="",o=0,s="",l=!1,A=C(e),c=A.split("\n"),u=C(t).split("\n"),f=0,h="";if("strictEqual"===r&&"object"===g(e)&&"object"===g(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===u.length&&c[0]!==u[0]){var E=c[0].length+u[0].length;if(E<=10){if(("object"!==g(e)||null===e)&&("object"!==g(t)||null===t)&&(0!==e||0!==t))return"".concat(v[r],"\n\n")+"".concat(c[0]," !== ").concat(u[0],"\n")}else if("strictEqualObject"!==r&&E<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][f]===u[0][f];)f++;f>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}for(var B=c[c.length-1],b=u[u.length-1];B===b&&(f++<2?s="\n ".concat(B).concat(s):i=B,c.pop(),u.pop(),0!==c.length&&0!==u.length);)B=c[c.length-1],b=u[u.length-1];var x=Math.max(c.length,u.length);if(0===x){var w=A.split("\n");if(w.length>30)for(w[26]="".concat(p,"...").concat(I);w.length>27;)w.pop();return"".concat(v.notIdentical,"\n\n").concat(w.join("\n"),"\n")}f>3&&(s="\n".concat(p,"...").concat(I).concat(s),l=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var Q=0,_=v[r]+"\n".concat(y,"+ actual").concat(I," ").concat(m,"- expected").concat(I),S=" ".concat(p,"...").concat(I," Lines skipped");for(f=0;f1&&f>2&&(k>4?(a+="\n".concat(p,"...").concat(I),l=!0):k>3&&(a+="\n ".concat(u[f-2]),Q++),a+="\n ".concat(u[f-1]),Q++),o=f,i+="\n".concat(m,"-").concat(I," ").concat(u[f]),Q++;else if(u.length1&&f>2&&(k>4?(a+="\n".concat(p,"...").concat(I),l=!0):k>3&&(a+="\n ".concat(c[f-2]),Q++),a+="\n ".concat(c[f-1]),Q++),o=f,a+="\n".concat(y,"+").concat(I," ").concat(c[f]),Q++;else{var D=u[f],T=c[f],M=T!==D&&(!d(T,",")||T.slice(0,-1)!==D);M&&d(D,",")&&D.slice(0,-1)===T&&(M=!1,T+=","),M?(k>1&&f>2&&(k>4?(a+="\n".concat(p,"...").concat(I),l=!0):k>3&&(a+="\n ".concat(c[f-2]),Q++),a+="\n ".concat(c[f-1]),Q++),o=f,a+="\n".concat(y,"+").concat(I," ").concat(T),i+="\n".concat(m,"-").concat(I," ").concat(D),Q+=2):(a+=i,i="",1!==k&&0!==f||(a+="\n ".concat(T),Q++))}if(Q>20&&f30)for(b[26]="".concat(p,"...").concat(I);b.length>27;)b.pop();r=1===b.length?o(this,u(t).call(this,"".concat(d," ").concat(b[0]))):o(this,u(t).call(this,"".concat(d,"\n\n").concat(b.join("\n"),"\n")))}else{var x=C(A),w="",Q=v[a];"notDeepEqual"===a||"notEqual"===a?(x="".concat(v[a],"\n\n").concat(x)).length>1024&&(x="".concat(x.slice(0,1021),"...")):(w="".concat(C(c)),x.length>512&&(x="".concat(x.slice(0,509),"...")),w.length>512&&(w="".concat(w.slice(0,509),"...")),"deepEqual"===a||"equal"===a?x="".concat(Q,"\n\n").concat(x,"\n\nshould equal\n\n"):w=" ".concat(a," ").concat(w)),r=o(this,u(t).call(this,"".concat(x).concat(w)))}return Error.stackTraceLimit=f,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=A,r.expected=c,r.operator=a,Error.captureStackTrace&&Error.captureStackTrace(s(r),l),r.stack,r.name="AssertionError",o(r)}var r,l,A;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(e,t){return f(this,function(e){for(var t=1;t2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var a,o,l,A;if(void 0===s&&(s=r(45408)),s("string"===typeof e,"'name' must be a string"),"string"===typeof t&&(o="not ",t.substr(!l||l<0?0:+l,o.length)===o)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))A="The ".concat(e," ").concat(a," ").concat(u(t,"type"));else{var c=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";A='The "'.concat(e,'" ').concat(c," ").concat(a," ").concat(u(t,"type"))}return A+=". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===l&&(l=r(35840));var i=l.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",a=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),a){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,a-1).join(", "),i+=", and ".concat(t[a-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=A},25116:function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(l){i=!0,a=l}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=void 0!==/a/g.flags,o=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(39896),A=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:r(1560);function u(e){return e.call.bind(e)}var g=u(Object.prototype.hasOwnProperty),f=u(Object.prototype.propertyIsEnumerable),h=u(Object.prototype.toString),d=r(35840).types,p=d.isAnyArrayBuffer,y=d.isArrayBufferView,m=d.isDate,I=d.isMap,v=d.isRegExp,E=d.isSet,C=d.isNativeError,B=d.isBoxedPrimitive,b=d.isNumberObject,x=d.isStringObject,w=d.isBooleanObject,Q=d.isBigIntObject,_=d.isSymbolObject,S=d.isFloat32Array,k=d.isFloat64Array;function D(e){if(0===e.length||e.length>10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function T(e){return Object.keys(e).filter(D).concat(A(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function M(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i>2],a+=n[(3&r[t])<<4|r[t+1]>>4],a+=n[(15&r[t+1])<<2|r[t+2]>>6],a+=n[63&r[t+2]];return i%3===2?a=a.substring(0,a.length-1)+"=":i%3===1&&(a=a.substring(0,a.length-2)+"=="),a},s=function(e){var t,r,n,a,o,s=.75*e.length,l=e.length,A=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var c=new ArrayBuffer(s),u=new Uint8Array(c);for(t=0;t>4,u[A++]=(15&n)<<4|a>>2,u[A++]=(3&a)<<6|63&o;return c}},59968:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],l=a[1],A=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,l)),c=0,u=l>0?o-4:o;for(r=0;r>16&255,A[c++]=t>>8&255,A[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,A[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,A[c++]=t>>8&255,A[c++]=255&t),A},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,A=n-i;sA?A:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},64928:function(e){"use strict";function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},308:function(e,t){"use strict";function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},29620:function(e,t,r){"use strict";var n=r(32420);e.exports=function(e,t){t||(t={});var r,o,s,l,A,c,u,g,f,h,d,p=null==t.cutoff?.25:t.cutoff,y=null==t.radius?8:t.radius,m=t.channel||0;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,o=t.height,l=e,c=t.stride?t.stride:Math.floor(e.length/r/o)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(u=(g=e).getContext("2d"),r=g.width,o=g.height,l=(f=u.getImageData(0,0,r,o)).data,c=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(u=e,r=(g=e.canvas).width,o=g.height,l=(f=u.getImageData(0,0,r,o)).data,c=4):window.ImageData&&e instanceof window.ImageData&&(f=e,r=e.width,o=e.height,l=f.data,c=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(A=l,l=Array(r*o),h=0,d=A.length;h-1?i(r):r}},57916:function(e,t,r){"use strict";var n=r(8844),i=r(53664),a=r(14500),o=i("%TypeError%"),s=i("%Function.prototype.apply%"),l=i("%Function.prototype.call%"),A=i("%Reflect.apply%",!0)||n.call(l,s),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(f){c=null}e.exports=function(e){if("function"!==typeof e)throw new o("a function is required");var t=A(n,l,arguments);return a(t,1+u(0,e.length-(arguments.length-1)),!0)};var g=function(){return A(n,s,arguments)};c?c(e.exports,"apply",{value:g}):e.exports.apply=g},32420:function(e){e.exports=function(e,t,r){return tr?r:e:et?t:e}},3808:function(e,t,r){"use strict";var n=r(32420);function i(e,t){null==t&&(t=!0);var r=e[0],i=e[1],a=e[2],o=e[3];return null==o&&(o=t?1:255),t&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(e,t){var r=(e=+e)>>>24,n=(16711680&e)>>>16,i=(65280&e)>>>8,a=255&e;return!1===t?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},17592:function(e){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},72160:function(e,t,r){"use strict";var n=r(96824),i=r(32420),a=r(72512);e.exports=function(e,t){"float"!==t&&t||(t="array"),"uint"===t&&(t="uint8"),"uint_clamped"===t&&(t="uint8_clamped");var r=new(a(t))(4),o="uint8"!==t&&"uint8_clamped"!==t;return e.length&&"string"!==typeof e||((e=n(e))[0]/=255,e[1]/=255,e[2]/=255),function(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||!!(Array.isArray(e)&&(e[0]>1||0===e[0])&&(e[1]>1||0===e[1])&&(e[2]>1||0===e[2])&&(!e[3]||e[3]>1))}(e)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:1):(r[0]=i(Math.floor(255*e[0]),0,255),r[1]=i(Math.floor(255*e[1]),0,255),r[2]=i(Math.floor(255*e[2]),0,255),r[3]=null==e[3]?255:i(Math.floor(255*e[3]),0,255)),r)}},96824:function(e,t,r){"use strict";var n=r(95532),i=r(53576),a=r(32420);e.exports=function(e){var t,r=n(e);return r.space?((t=Array(3))[0]=a(r.values[0],0,255),t[1]=a(r.values[1],0,255),t[2]=a(r.values[2],0,255),"h"===r.space[0]&&(t=i.rgb(t)),t.push(a(r.alpha,0,1)),t):[]}},95532:function(e,t,r){"use strict";var n=r(17592);e.exports=function(e){var t,r,a=[],o=1;if("string"===typeof e)if(e=e.toLowerCase(),n[e])a=n[e].slice(),r="rgb";else if("transparent"===e)o=0,r="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var s=e.slice(1);o=1,(c=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===c&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===c&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),r="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var l=t[1],A="rgb"===l;r=s=l.replace(/a$/,"");var c="cmyk"===s?4:"gray"===s?1:3;a=t[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(e,t){if(/%$/.test(e))return t===c?parseFloat(e)/100:"rgb"===s?255*parseFloat(e)/100:parseFloat(e);if("h"===s[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==i[e])return i[e]}return parseFloat(e)})),l===s&&a.push(1),o=A||void 0===a[c]?1:a[c],a=a.slice(0,c)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(a=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),r=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(a=[e[0],e[1],e[2]],r="rgb",o=4===e.length?e[3]:1):e instanceof Object&&(null!=e.r||null!=e.red||null!=e.R?(r="rgb",a=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(r="hsl",a=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),o=e.a||e.alpha||e.opacity||1,null!=e.opacity&&(o/=100)):(r="rgb",a=[e>>>16,(65280&e)>>>8,255&e]);return{space:r,values:a,alpha:o}};var i={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},53576:function(e,t,r){"use strict";var n=r(19336);e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[a=255*l,a,a];t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var A=0;A<3;A++)(n=o+1/3*-(A-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[A]=255*a;return i}},n.hsl=function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?t=0:n===s?t=(i-a)/l:i===s?t=2+(a-n)/l:a===s&&(t=4+(n-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},19336:function(e){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},36116:function(e){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},42771:function(e,t,r){"use strict";e.exports={parse:r(46416),stringify:r(49395)}},8744:function(e,t,r){"use strict";var n=r(30584);e.exports={isSize:function(e){return/^[\d\.]/.test(e)||-1!==e.indexOf("/")||-1!==n.indexOf(e)}}},46416:function(e,t,r){"use strict";var n=r(92384),i=r(68194),a=r(3748),o=r(2904),s=r(47916),l=r(7294),A=r(39956),c=r(8744).isSize;e.exports=g;var u=g.cache={};function g(e){if("string"!==typeof e)throw new Error("Font argument must be a string.");if(u[e])return u[e];if(""===e)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(e))return u[e]={system:e};for(var t,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},g=A(e,/\s+/);t=g.shift();){if(-1!==i.indexOf(t))return["style","variant","weight","stretch"].forEach((function(e){r[e]=t})),u[e]=r;if(-1===s.indexOf(t))if("normal"!==t&&"small-caps"!==t)if(-1===l.indexOf(t)){if(-1===o.indexOf(t)){if(c(t)){var h=A(t,"/");if(r.size=h[0],null!=h[1]?r.lineHeight=f(h[1]):"/"===g[0]&&(g.shift(),r.lineHeight=f(g.shift())),!g.length)throw new Error("Missing required font-family.");return r.family=A(g.join(" "),/\s*,\s*/).map(n),u[e]=r}throw new Error("Unknown or unsupported font token: "+t)}r.weight=t}else r.stretch=t;else r.variant=t;else r.style=t}throw new Error("Missing required font-size.")}function f(e){var t=parseFloat(e);return t.toString()===e?t:e}},49395:function(e,t,r){"use strict";var n=r(55616),i=r(8744).isSize,a=d(r(68194)),o=d(r(3748)),s=d(r(2904)),l=d(r(47916)),A=d(r(7294)),c={normal:1,"small-caps":1},u={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},g="1rem",f="serif";function h(e,t){if(e&&!t[e]&&!a[e])throw Error("Unknown keyword `"+e+"`");return e}function d(e){for(var t={},r=0;rt?1:e>=t?0:NaN}r.d(t,{XE:function(){return n},kv:function(){return o},mo:function(){return l},Uf:function(){return A},SY:function(){return c},ik:function(){return u},oh:function(){return g}});var i=function(e){var t;return 1===e.length&&(t=e,e=function(e,r){return n(t(e),r)}),{left:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}(n),a=(i.right,i.left,Array.prototype);function o(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n}function s(e){return null===e?NaN:+e}function l(e,t){var r,n=e.length,i=n,a=-1,o=0;if(null==t)for(;++a=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r}function c(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function u(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=new Array(i);++n=n.length)return null!=e&&r.sort(e),null!=t?t(r):r;for(var A,c,u,g=-1,f=r.length,h=n[i++],d=o(),p=s();++gn.length)return e;var a,o=i[r-1];return null!=t&&r>=n.length?a=e.entries():(a=[],e.each((function(e,t){a.push({key:t,values:s(e,r)})}))),null!=o?a.sort((function(e,t){return o(e.key,t.key)})):a}return r={object:function(e){return a(e,0,l,A)},map:function(e){return a(e,0,c,u)},entries:function(e){return s(a(e,0,c,u),0)},key:function(e){return n.push(e),r},sortKeys:function(e){return i[n.length-1]=e,r},sortValues:function(t){return e=t,r},rollup:function(e){return t=e,r}}}function l(){return{}}function A(e,t,r){e[t]=r}function c(){return o()}function u(e,t,r){e.set(t,r)}function g(){}var f=o.prototype;g.prototype=function(e,t){var r=new g;if(e instanceof g)e.each((function(e){r.add(e)}));else if(e){var n=-1,i=e.length;if(null==t)for(;++n=(a=(d+y)/2))?d=a:y=a,(c=r>=(o=(p+m)/2))?p=o:m=o,i=f,!(f=f[u=c<<1|A]))return i[u]=h,e;if(s=+e._x.call(null,f.data),l=+e._y.call(null,f.data),t===s&&r===l)return h.next=f,i?i[u]=h:e._root=h,e;do{i=i?i[u]=new Array(4):e._root=new Array(4),(A=t>=(a=(d+y)/2))?d=a:y=a,(c=r>=(o=(p+m)/2))?p=o:m=o}while((u=c<<1|A)===(g=(l>=o)<<1|s>=a));return i[g]=f,i[u]=h,e}function s(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function l(e){return e[0]}function A(e){return e[1]}function c(e,t,r){var n=new u(null==t?l:t,null==r?A:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function u(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function g(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}r.r(t),r.d(t,{forceCenter:function(){return n},forceCollide:function(){return p},forceLink:function(){return v},forceManyBody:function(){return W},forceRadial:function(){return Z},forceSimulation:function(){return V},forceX:function(){return X},forceY:function(){return $}});var f=c.prototype=u.prototype;function h(e){return e.x+e.vx}function d(e){return e.y+e.vy}function p(e){var t,r,n=1,o=1;function s(){for(var e,i,s,A,u,g,f,p=t.length,y=0;yA+h||iu+h||os.index){var d=A-l.x-l.vx,p=u-l.y-l.vy,y=d*d+p*p;ye.r&&(e.r=e[t].r)}function A(){if(t){var n,i,a=t.length;for(r=new Array(a),n=0;nu&&(u=n),ig&&(g=i));if(A>u||c>g)return this;for(this.cover(A,c).cover(u,g),r=0;re||e>=i||n>t||t>=a;)switch(s=(tf||(a=A.y0)>h||(o=A.x1)=m)<<1|e>=y)&&(A=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=A)}else{var I=e-+this._x.call(null,p.data),v=t-+this._y.call(null,p.data),E=I*I+v*v;if(E=(s=(h+p)/2))?h=s:p=s,(c=o>=(l=(d+y)/2))?d=l:y=l,t=f,!(f=f[u=c<<1|A]))return this;if(!f.length)break;(t[u+1&3]||t[u+2&3]||t[u+3&3])&&(r=t,g=u)}for(;f.data!==e;)if(n=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,n?(i?n.next=i:delete n.next,this):t?(i?t[u]=i:delete t[u],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(r?r[g]=f:this._root=f),this):(this._root=i,this)},f.removeAll=function(e){for(var t=0,r=e.length;t=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++o0)for(var r,n,i=new Array(r),a=0;a=0&&t._call.call(null,e),t=t._next;--S}()}finally{S=0,function(){for(var e,t,r=w,n=1/0;r;)r._call?(n>r._time&&(n=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:w=t);Q=e,H(n)}(),R=0}}function q(){var e=N.now(),t=e-M;t>T&&(L-=t,M=e)}function H(e){S||(k&&(k=clearTimeout(k)),e-R>24?(e<1/0&&(k=setTimeout(z,e-N.now()-L)),D&&(D=clearInterval(D))):(D||(M=N.now(),D=setInterval(q,T)),S=1,F(z)))}function Y(e){return e.x}function J(e){return e.y}G.prototype=U.prototype={constructor:G,restart:function(e,t,r){if("function"!==typeof e)throw new TypeError("callback is not a function");r=(null==r?O():+r)+(null==t?0:+t),this._next||Q===this||(Q?Q._next=this:w=this,Q=this),this._call=e,this._time=r,H()},stop:function(){this._call&&(this._call=null,this._time=1/0,H())}};var K=10,j=Math.PI*(3-Math.sqrt(5));function V(e){var t,r=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=(0,y.kH)(),l=U(c),A=_("tick","end");function c(){u(),A.call("tick",t),r1?(null==r?s.remove(e):s.set(e,f(r)),t):s.get(e)},find:function(t,r,n){var i,a,o,s,l,A=0,c=e.length;for(null==n?n=1/0:n*=n,A=0;A1?(A.on(e,r),t):A.on(e)}}}function W(){var e,t,r,n,o=i(-30),s=1,l=1/0,A=.81;function u(n){var i,a=e.length,o=c(e,Y,J).visitAfter(f);for(r=n,i=0;i=l)){(e.data!==t||e.next)&&(0===u&&(h+=(u=a())*u),0===g&&(h+=(g=a())*g),h1?n[0]+n.slice(2):n,+e.slice(r+1)]}r.d(t,{E9:function(){return g},SO:function(){return d}});var i,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(e){if(!(t=a.exec(e)))throw new Error("invalid format: "+e);var t;return new s({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function s(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function l(e,t){var r=n(e,t);if(!r)return e+"";var i=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}o.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var A={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return l(100*e,t)},r:l,s:function(e,t){var r=n(e,t);if(!r)return e+"";var a=r[0],o=r[1],s=o-(i=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+n(e,Math.max(0,t+s-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var u,g,f=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function d(e){var t,r,a=void 0===e.grouping||void 0===e.thousands?c:(t=f.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var i=e.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(e.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(r)}),s=void 0===e.currency?"":e.currency[0]+"",l=void 0===e.currency?"":e.currency[1]+"",u=void 0===e.decimal?".":e.decimal+"",g=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(f.call(e.numerals,String)),d=void 0===e.percent?"%":e.percent+"",p=void 0===e.minus?"-":e.minus+"",y=void 0===e.nan?"NaN":e.nan+"";function m(e){var t=(e=o(e)).fill,r=e.align,n=e.sign,c=e.symbol,f=e.zero,m=e.width,I=e.comma,v=e.precision,E=e.trim,C=e.type;"n"===C?(I=!0,C="g"):A[C]||(void 0===v&&(v=12),E=!0,C="g"),(f||"0"===t&&"="===r)&&(f=!0,t="0",r="=");var B="$"===c?s:"#"===c&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",b="$"===c?l:/[%p]/.test(C)?d:"",x=A[C],w=/[defgprs%]/.test(C);function Q(e){var o,s,l,A=B,c=b;if("c"===C)c=x(e)+c,e="";else{var d=(e=+e)<0||1/e<0;if(e=isNaN(e)?y:x(Math.abs(e),v),E&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),d&&0===+e&&"+"!==n&&(d=!1),A=(d?"("===n?n:p:"-"===n||"("===n?"":n)+A,c=("s"===C?h[8+i/3]:"")+c+(d&&"("===n?")":""),w)for(o=-1,s=e.length;++o(l=e.charCodeAt(o))||l>57){c=(46===l?u+e.slice(o+1):e.slice(o))+c,e=e.slice(0,o);break}}I&&!f&&(e=a(e,1/0));var Q=A.length+e.length+c.length,_=Q>1)+A+e+c+_.slice(Q);break;default:e=_+A+e+c}return g(e)}return v=void 0===v?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),Q.toString=function(){return e+""},Q}return{format:m,formatPrefix:function(e,t){var r,i=m(((e=o(e)).type="f",e)),a=3*Math.max(-8,Math.min(8,Math.floor((r=t,((r=n(Math.abs(r)))?r[1]:NaN)/3)))),s=Math.pow(10,-a),l=h[8+a/3];return function(e){return i(s*e)+l}}}}u=d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),g=u.format,u.formatPrefix},87108:function(e,t,r){"use strict";r.r(t),r.d(t,{geoAiry:function(){return L},geoAiryRaw:function(){return R},geoAitoff:function(){return F},geoAitoffRaw:function(){return N},geoArmadillo:function(){return P},geoArmadilloRaw:function(){return O},geoAugust:function(){return U},geoAugustRaw:function(){return G},geoBaker:function(){return Y},geoBakerRaw:function(){return H},geoBerghaus:function(){return j},geoBerghausRaw:function(){return K},geoBertin1953:function(){return re},geoBertin1953Raw:function(){return te},geoBoggs:function(){return ce},geoBoggsRaw:function(){return Ae},geoBonne:function(){return de},geoBonneRaw:function(){return he},geoBottomley:function(){return ye},geoBottomleyRaw:function(){return pe},geoBromley:function(){return Ie},geoBromleyRaw:function(){return me},geoChamberlin:function(){return _e},geoChamberlinAfrica:function(){return Qe},geoChamberlinRaw:function(){return xe},geoCollignon:function(){return ke},geoCollignonRaw:function(){return Se},geoCraig:function(){return Te},geoCraigRaw:function(){return De},geoCraster:function(){return Le},geoCrasterRaw:function(){return Re},geoCylindricalEqualArea:function(){return Fe},geoCylindricalEqualAreaRaw:function(){return Ne},geoCylindricalStereographic:function(){return Pe},geoCylindricalStereographicRaw:function(){return Oe},geoEckert1:function(){return Ue},geoEckert1Raw:function(){return Ge},geoEckert2:function(){return qe},geoEckert2Raw:function(){return ze},geoEckert3:function(){return Ye},geoEckert3Raw:function(){return He},geoEckert4:function(){return Ke},geoEckert4Raw:function(){return Je},geoEckert5:function(){return Ve},geoEckert5Raw:function(){return je},geoEckert6:function(){return Ze},geoEckert6Raw:function(){return We},geoEisenlohr:function(){return et},geoEisenlohrRaw:function(){return $e},geoFahey:function(){return nt},geoFaheyRaw:function(){return rt},geoFoucaut:function(){return at},geoFoucautRaw:function(){return it},geoFoucautSinusoidal:function(){return st},geoFoucautSinusoidalRaw:function(){return ot},geoGilbert:function(){return gt},geoGingery:function(){return pt},geoGingeryRaw:function(){return ft},geoGinzburg4:function(){return It},geoGinzburg4Raw:function(){return mt},geoGinzburg5:function(){return Et},geoGinzburg5Raw:function(){return vt},geoGinzburg6:function(){return Bt},geoGinzburg6Raw:function(){return Ct},geoGinzburg8:function(){return xt},geoGinzburg8Raw:function(){return bt},geoGinzburg9:function(){return Qt},geoGinzburg9Raw:function(){return wt},geoGringorten:function(){return kt},geoGringortenQuincuncial:function(){return ai},geoGringortenRaw:function(){return St},geoGuyou:function(){return Rt},geoGuyouRaw:function(){return Mt},geoHammer:function(){return X},geoHammerRaw:function(){return W},geoHammerRetroazimuthal:function(){return Ot},geoHammerRetroazimuthalRaw:function(){return Nt},geoHealpix:function(){return Kt},geoHealpixRaw:function(){return qt},geoHill:function(){return Vt},geoHillRaw:function(){return jt},geoHomolosine:function(){return tr},geoHomolosineRaw:function(){return er},geoHufnagel:function(){return nr},geoHufnagelRaw:function(){return rr},geoHyperelliptical:function(){return sr},geoHyperellipticalRaw:function(){return or},geoInterrupt:function(){return cr},geoInterruptedBoggs:function(){return gr},geoInterruptedHomolosine:function(){return hr},geoInterruptedMollweide:function(){return pr},geoInterruptedMollweideHemispheres:function(){return mr},geoInterruptedQuarticAuthalic:function(){return un},geoInterruptedSinuMollweide:function(){return vr},geoInterruptedSinusoidal:function(){return Cr},geoKavrayskiy7:function(){return br},geoKavrayskiy7Raw:function(){return Br},geoLagrange:function(){return wr},geoLagrangeRaw:function(){return xr},geoLarrivee:function(){return Sr},geoLarriveeRaw:function(){return _r},geoLaskowski:function(){return Dr},geoLaskowskiRaw:function(){return kr},geoLittrow:function(){return Mr},geoLittrowRaw:function(){return Tr},geoLoximuthal:function(){return Lr},geoLoximuthalRaw:function(){return Rr},geoMiller:function(){return Fr},geoMillerRaw:function(){return Nr},geoModifiedStereographic:function(){return Vr},geoModifiedStereographicAlaska:function(){return Hr},geoModifiedStereographicGs48:function(){return Yr},geoModifiedStereographicGs50:function(){return Jr},geoModifiedStereographicLee:function(){return jr},geoModifiedStereographicMiller:function(){return Kr},geoModifiedStereographicRaw:function(){return Or},geoMollweide:function(){return oe},geoMollweideRaw:function(){return ae},geoMtFlatPolarParabolic:function(){return $r},geoMtFlatPolarParabolicRaw:function(){return Xr},geoMtFlatPolarQuartic:function(){return tn},geoMtFlatPolarQuarticRaw:function(){return en},geoMtFlatPolarSinusoidal:function(){return nn},geoMtFlatPolarSinusoidalRaw:function(){return rn},geoNaturalEarth:function(){return an.c},geoNaturalEarth2:function(){return sn},geoNaturalEarth2Raw:function(){return on},geoNaturalEarthRaw:function(){return an.g},geoNellHammer:function(){return An},geoNellHammerRaw:function(){return ln},geoNicolosi:function(){return fn},geoNicolosiRaw:function(){return gn},geoPatterson:function(){return bn},geoPattersonRaw:function(){return Bn},geoPeirceQuincuncial:function(){return oi},geoPierceQuincuncial:function(){return oi},geoPolyconic:function(){return wn},geoPolyconicRaw:function(){return xn},geoPolyhedral:function(){return Mn},geoPolyhedralButterfly:function(){return Gn},geoPolyhedralCollignon:function(){return qn},geoPolyhedralWaterman:function(){return Hn},geoProject:function(){return Vn},geoQuantize:function(){return si},geoQuincuncial:function(){return ii},geoRectangularPolyconic:function(){return Ai},geoRectangularPolyconicRaw:function(){return li},geoRobinson:function(){return gi},geoRobinsonRaw:function(){return ui},geoSatellite:function(){return hi},geoSatelliteRaw:function(){return fi},geoSinuMollweide:function(){return $t},geoSinuMollweideRaw:function(){return Xt},geoSinusoidal:function(){return fe},geoSinusoidalRaw:function(){return ge},geoStitch:function(){return Mi},geoTimes:function(){return Li},geoTimesRaw:function(){return Ri},geoTwoPointAzimuthal:function(){return Pi},geoTwoPointAzimuthalRaw:function(){return Fi},geoTwoPointAzimuthalUsa:function(){return Oi},geoTwoPointEquidistant:function(){return zi},geoTwoPointEquidistantRaw:function(){return Gi},geoTwoPointEquidistantUsa:function(){return Ui},geoVanDerGrinten:function(){return Hi},geoVanDerGrinten2:function(){return Ji},geoVanDerGrinten2Raw:function(){return Yi},geoVanDerGrinten3:function(){return ji},geoVanDerGrinten3Raw:function(){return Ki},geoVanDerGrinten4:function(){return Wi},geoVanDerGrinten4Raw:function(){return Vi},geoVanDerGrintenRaw:function(){return qi},geoWagner:function(){return Xi},geoWagner4:function(){return na},geoWagner4Raw:function(){return ra},geoWagner6:function(){return aa},geoWagner6Raw:function(){return ia},geoWagner7:function(){return $i},geoWagnerRaw:function(){return Zi},geoWiechel:function(){return sa},geoWiechelRaw:function(){return oa},geoWinkel3:function(){return Aa},geoWinkel3Raw:function(){return la}});var n=r(87952),i=Math.abs,a=Math.atan,o=Math.atan2,s=(Math.ceil,Math.cos),l=Math.exp,A=Math.floor,c=Math.log,u=Math.max,g=Math.min,f=Math.pow,h=Math.round,d=Math.sign||function(e){return e>0?1:e<0?-1:0},p=Math.sin,y=Math.tan,m=1e-6,I=1e-12,v=Math.PI,E=v/2,C=v/4,B=Math.SQRT1_2,b=D(2),x=D(v),w=2*v,Q=180/v,_=v/180;function S(e){return e>1?E:e<-1?-E:Math.asin(e)}function k(e){return e>1?0:e<-1?v:Math.acos(e)}function D(e){return e>0?Math.sqrt(e):0}function T(e){return(l(e)-l(-e))/2}function M(e){return(l(e)+l(-e))/2}function R(e){var t=y(e/2),r=2*c(s(e/2))/(t*t);function n(e,t){var n=s(e),i=s(t),a=p(t),o=i*n,l=-((1-o?c((1+o)/2)/(1-o):-.5)+r/(1+o));return[l*i*p(e),l*a]}return n.invert=function(t,n){var a,l=D(t*t+n*n),A=-e/2,u=50;if(!l)return[0,0];do{var g=A/2,f=s(g),h=p(g),d=h/f,y=-c(i(f));A-=a=(2/d*y-r*d-l)/(-y/(h*h)+1-r/(2*f*f))*(f<0?.7:1)}while(i(a)>m&&--u>0);var I=p(A);return[o(t*I,l*s(A)),S(n*I/l)]},n}function L(){var e=E,t=(0,n.U)(R),r=t(e);return r.radius=function(r){return arguments.length?t(e=r*_):e*Q},r.scale(179.976).clipAngle(147)}function N(e,t){var r=s(t),n=function(e){return e?e/Math.sin(e):1}(k(r*s(e/=2)));return[2*r*p(e)*n,p(t)*n]}function F(){return(0,n.c)(N).scale(152.63)}function O(e){var t=p(e),r=s(e),n=e>=0?1:-1,a=y(n*e),l=(1+t-r)/2;function A(e,i){var A=s(i),c=s(e/=2);return[(1+A)*p(e),(n*i>-o(c,a)-.001?0:10*-n)+l+p(i)*r-(1+A)*t*c]}return A.invert=function(e,A){var c=0,u=0,g=50;do{var f=s(c),h=p(c),d=s(u),y=p(u),I=1+d,v=I*h-e,E=l+y*r-I*t*f-A,C=I*f/2,B=-h*y,b=t*I*h/2,x=r*d+t*f*y,w=B*b-x*C,Q=(E*B-v*x)/w/2,_=(v*b-E*C)/w;i(_)>2&&(_/=2),c-=Q,u-=_}while((i(Q)>m||i(_)>m)&&--g>0);return n*u>-o(s(c),a)-.001?[2*c,u]:null},A}function P(){var e=20*_,t=e>=0?1:-1,r=y(t*e),i=(0,n.U)(O),a=i(e),l=a.stream;return a.parallel=function(n){return arguments.length?(r=y((t=(e=n*_)>=0?1:-1)*e),i(e)):e*Q},a.stream=function(n){var i=a.rotate(),A=l(n),c=(a.rotate([0,0]),l(n)),u=a.precision();return a.rotate(i),A.sphere=function(){c.polygonStart(),c.lineStart();for(var n=-180*t;t*n<180;n+=90*t)c.point(n,90*t);if(e)for(;t*(n-=3*t*u)>=-180;)c.point(n,t*-o(s(n*_/2),r)*Q);c.lineEnd(),c.polygonEnd()},A},a.scale(218.695).center([0,28.0974])}function G(e,t){var r=y(t/2),n=D(1-r*r),i=1+n*s(e/=2),a=p(e)*n/i,o=r/i,l=a*a,A=o*o;return[4/3*a*(3+l-3*A),4/3*o*(3+3*l-A)]}function U(){return(0,n.c)(G).scale(66.1603)}N.invert=function(e,t){if(!(e*e+4*t*t>v*v+m)){var r=e,n=t,a=25;do{var o,l=p(r),A=p(r/2),c=s(r/2),u=p(n),g=s(n),f=p(2*n),h=u*u,d=g*g,y=A*A,I=1-d*c*c,E=I?k(g*c)*D(o=1/I):o=0,C=2*E*g*A-e,B=E*u-t,b=o*(d*y+E*g*c*h),x=o*(.5*l*f-2*E*u*A),w=.25*o*(f*A-E*u*d*l),Q=o*(h*c+E*y*g),_=x*w-Q*b;if(!_)break;var S=(B*x-C*Q)/_,T=(C*w-B*b)/_;r-=S,n-=T}while((i(S)>m||i(T)>m)&&--a>0);return[r,n]}},G.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&i(t)>1)return null;var r=1+e*e+t*t,n=D((r-D(r*r-4*t*t))/2),a=S(n)/3,l=n?function(e){return c(e+D(e*e-1))}(i(t/n))/3:function(e){return c(e+D(e*e+1))}(i(e))/3,A=s(a),u=M(l),g=u*u-A*A;return[2*d(e)*o(T(l)*A,.25-g),2*d(t)*o(u*p(a),.25+g)]};var z=D(8),q=c(1+b);function H(e,t){var r=i(t);return rI&&--A>0);return[e/(s(o)*(z-1/p(o))),d(t)*o]};var J=r(69020);function K(e){var t=2*v/e;function r(e,r){var n=(0,J.O)(e,r);if(i(e)>E){var a=o(n[1],n[0]),l=D(n[0]*n[0]+n[1]*n[1]),A=t*h((a-E)/t)+E,c=o(p(a-=A),2-s(a));a=A+S(v/l*p(c))-c,n[0]=l*s(a),n[1]=l*p(a)}return n}return r.invert=function(e,r){var n=D(e*e+r*r);if(n>E){var i=o(r,e),l=t*h((i-E)/t)+E,A=i>l?-1:1,c=n*s(l-i),u=1/y(A*k((c-v)/D(v*(v-2*c)+n*n)));i=l+2*a((u+A*D(u*u-3))/3),e=n*s(i),r=n*p(i)}return J.O.invert(e,r)},r}function j(){var e=5,t=(0,n.U)(K),r=t(e),i=r.stream,a=.01,l=-s(a*_),A=p(a*_);return r.lobes=function(r){return arguments.length?t(e=+r):e},r.stream=function(t){var n=r.rotate(),c=i(t),u=(r.rotate([0,0]),i(t));return r.rotate(n),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=0,r=360/e,n=2*v/e,i=90-180/e,c=E;t0&&i(n)>m);return s<0?NaN:r}function ee(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=I),function(n,a,o,s){var l,A,c;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var u=0;ul)o-=A/=2,s-=c/=2;else{l=d;var p=(o>0?-1:1)*r,y=(s>0?-1:1)*r,m=e(o+p,s),I=e(o,s+y),v=(m[0]-g[0])/p,E=(m[1]-g[1])/p,C=(I[0]-g[0])/y,B=(I[1]-g[1])/y,b=B*v-E*C,x=(i(b)<.5?.5:1)/b;if(o+=A=(h*C-f*B)*x,s+=c=(f*E-h*v)*x,i(A)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return t.invert=ee(t),t}function re(){return(0,n.c)(te()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ne(e,t){var r,n=e*p(t),a=30;do{t-=r=(t+p(t)-n)/(1+s(t))}while(i(r)>m&&--a>0);return t/2}function ie(e,t,r){function n(n,i){return[e*n*s(i=ne(r,i)),t*p(i)]}return n.invert=function(n,i){return i=S(i/t),[n/(e*s(i)),S((2*i+p(2*i))/r)]},n}Z.invert=function(e,t){var r=2*S(t/2);return[e*s(r/2)/s(r),r]};var ae=ie(b/E,b,v);function oe(){return(0,n.c)(ae).scale(169.529)}var se=2.00276,le=1.11072;function Ae(e,t){var r=ne(v,t);return[se*e/(1/s(t)+le/s(r)),(t+b*p(r))/se]}function ce(){return(0,n.c)(Ae).scale(160.857)}function ue(e){var t=0,r=(0,n.U)(e),i=r(t);return i.parallel=function(e){return arguments.length?r(t=e*_):t*Q},i}function ge(e,t){return[e*s(t),t]}function fe(){return(0,n.c)(ge).scale(152.63)}function he(e){if(!e)return ge;var t=1/y(e);function r(r,n){var i=t+e-n,a=i?r*s(n)/i:i;return[i*p(a),t-i*s(a)]}return r.invert=function(r,n){var i=D(r*r+(n=t-n)*n),a=t+e-i;return[i/s(a)*o(r,n),a]},r}function de(){return ue(he).scale(123.082).center([0,26.1441]).parallel(45)}function pe(e){function t(t,r){var n=E-r,i=n?t*e*p(n)/n:n;return[n*p(i)/e,E-n*s(i)]}return t.invert=function(t,r){var n=t*e,i=E-r,a=D(n*n+i*i),s=o(n,i);return[(a?a/p(a):1)*s/e,E-a]},t}function ye(){var e=.5,t=(0,n.U)(pe),r=t(e);return r.fraction=function(r){return arguments.length?t(e=+r):e},r.scale(158.837)}Ae.invert=function(e,t){var r,n,a=se*t,o=t<0?-C:C,l=25;do{n=a-b*p(o),o-=r=(p(2*o)+2*o-v*p(n))/(2*s(2*o)+2+v*s(n)*b*s(o))}while(i(r)>m&&--l>0);return n=a-b*p(o),[e*(1/s(n)+le/s(o))/se,n]},ge.invert=function(e,t){return[e/s(t),t]};var me=ie(1,4/v,v);function Ie(){return(0,n.c)(me).scale(152.63)}var ve=r(24052),Ee=r(92992);function Ce(e,t,r,n,a,l){var A,c=s(l);if(i(e)>1||i(l)>1)A=k(r*a+t*n*c);else{var u=p(e/2),g=p(l/2);A=2*S(D(u*u+t*n*g*g))}return i(A)>m?[A,o(n*p(l),t*a-r*n*c)]:[0,0]}function Be(e,t,r){return k((e*e+t*t-r*r)/(2*e*t))}function be(e){return e-2*v*A((e+v)/(2*v))}function xe(e,t,r){for(var n,i=[[e[0],e[1],p(e[1]),s(e[1])],[t[0],t[1],p(t[1]),s(t[1])],[r[0],r[1],p(r[1]),s(r[1])]],a=i[2],o=0;o<3;++o,a=n)n=i[o],a.v=Ce(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=Be(i[0].v[0],i[2].v[0],i[1].v[0]),A=Be(i[0].v[0],i[1].v[0],i[2].v[0]),c=v-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var u=[i[2].point[0]=i[0].point[0]+i[2].v[0]*s(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*p(l))];return function(e,t){var r,n=p(t),a=s(t),o=new Array(3);for(r=0;r<3;++r){var l=i[r];if(o[r]=Ce(t-l[1],l[3],l[2],a,n,e-l[0]),!o[r][0])return l.point;o[r][1]=be(o[r][1]-l.v[1])}var g=u.slice();for(r=0;r<3;++r){var f=2==r?0:r+1,h=Be(i[r].v[0],o[r][0],o[f][0]);o[r][1]<0&&(h=-h),r?1==r?(h=A-h,g[0]-=o[r][0]*s(h),g[1]-=o[r][0]*p(h)):(h=c-h,g[0]+=o[r][0]*s(h),g[1]+=o[r][0]*p(h)):(g[0]+=o[r][0]*s(h),g[1]-=o[r][0]*p(h))}return g[0]/=3,g[1]/=3,g}}function we(e){return e[0]*=_,e[1]*=_,e}function Qe(){return _e([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function _e(e,t,r){var i=(0,ve.c)({type:"MultiPoint",coordinates:[e,t,r]}),a=[-i[0],-i[1]],o=(0,Ee.c)(a),s=xe(we(o(e)),we(o(t)),we(o(r)));s.invert=ee(s);var l=(0,n.c)(s).rotate(a),A=l.center;return delete l.rotate,l.center=function(e){return arguments.length?A(o(e)):o.invert(A())},l.clipAngle(90)}function Se(e,t){var r=D(1-p(t));return[2/x*e*r,x*(1-r)]}function ke(){return(0,n.c)(Se).scale(95.6464).center([0,30])}function De(e){var t=y(e);function r(e,r){return[e,(e?e/p(e):1)*(p(r)*s(e)-t*s(r))]}return r.invert=t?function(e,r){e&&(r*=p(e)/e);var n=s(e);return[e,2*o(D(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,S(e?t*y(e)/e:t)]},r}function Te(){return ue(De).scale(249.828).clipAngle(90)}Se.invert=function(e,t){var r=(r=t/x-1)*r;return[r>0?e*D(v/r)/2:0,S(1-r)]};var Me=D(3);function Re(e,t){return[Me*e*(2*s(2*t/3)-1)/x,Me*x*p(t/3)]}function Le(){return(0,n.c)(Re).scale(156.19)}function Ne(e){var t=s(e);function r(e,r){return[e*t,p(r)/t]}return r.invert=function(e,r){return[e/t,S(r*t)]},r}function Fe(){return ue(Ne).parallel(38.58).scale(195.044)}function Oe(e){var t=s(e);function r(e,r){return[e*t,(1+t)*y(r/2)]}return r.invert=function(e,r){return[e/t,2*a(r/(1+t))]},r}function Pe(){return ue(Oe).scale(124.75)}function Ge(e,t){var r=D(8/(3*v));return[r*e*(1-i(t)/v),r*t]}function Ue(){return(0,n.c)(Ge).scale(165.664)}function ze(e,t){var r=D(4-3*p(i(t)));return[2/D(6*v)*e*r,d(t)*D(2*v/3)*(2-r)]}function qe(){return(0,n.c)(ze).scale(165.664)}function He(e,t){var r=D(v*(4+v));return[2/r*e*(1+D(1-4*t*t/(v*v))),4/r*t]}function Ye(){return(0,n.c)(He).scale(180.739)}function Je(e,t){var r=(2+E)*p(t);t/=2;for(var n=0,a=1/0;n<10&&i(a)>m;n++){var o=s(t);t-=a=(t+p(t)*(o+2)-r)/(2*o*(1+o))}return[2/D(v*(4+v))*e*(1+s(t)),2*D(v/(4+v))*p(t)]}function Ke(){return(0,n.c)(Je).scale(180.739)}function je(e,t){return[e*(1+s(t))/D(2+v),2*t/D(2+v)]}function Ve(){return(0,n.c)(je).scale(173.044)}function We(e,t){for(var r=(1+E)*p(t),n=0,a=1/0;n<10&&i(a)>m;n++)t-=a=(t+p(t)-r)/(1+s(t));return r=D(2+v),[e*(1+s(t))/r,2*t/r]}function Ze(){return(0,n.c)(We).scale(173.044)}Re.invert=function(e,t){var r=3*S(t/(Me*x));return[x*e/(Me*(2*s(2*r/3)-1)),r]},Ge.invert=function(e,t){var r=D(8/(3*v)),n=t/r;return[e/(r*(1-i(n)/v)),n]},ze.invert=function(e,t){var r=2-i(t)/D(2*v/3);return[e*D(6*v)/(2*r),d(t)*S((4-r*r)/3)]},He.invert=function(e,t){var r=D(v*(4+v))/2;return[e*r/(1+D(1-t*t*(4+v)/(4*v))),t*r/2]},Je.invert=function(e,t){var r=t*D((4+v)/v)/2,n=S(r),i=s(n);return[e/(2/D(v*(4+v))*(1+i)),S((n+r*(i+2))/(2+E))]},je.invert=function(e,t){var r=D(2+v),n=t*r/2;return[r*e/(1+s(n)),n]},We.invert=function(e,t){var r=1+E,n=D(r/2);return[2*e*n/(1+s(t*=n)),S((t+p(t))/r)]};var Xe=3+2*b;function $e(e,t){var r=p(e/=2),n=s(e),i=D(s(t)),o=s(t/=2),l=p(t)/(o+b*n*i),A=D(2/(1+l*l)),u=D((b*o+(n+r)*i)/(b*o+(n-r)*i));return[Xe*(A*(u-1/u)-2*c(u)),Xe*(A*l*(u+1/u)-2*a(l))]}function et(){return(0,n.c)($e).scale(62.5271)}$e.invert=function(e,t){if(!(r=G.invert(e/1.2,1.065*t)))return null;var r,n=r[0],o=r[1],l=20;e/=Xe,t/=Xe;do{var A=n/2,f=o/2,h=p(A),d=s(A),y=p(f),I=s(f),v=s(o),C=D(v),x=y/(I+b*d*C),w=x*x,Q=D(2/(1+w)),_=(b*I+(d+h)*C)/(b*I+(d-h)*C),S=D(_),k=S-1/S,T=S+1/S,M=Q*k-2*c(S)-e,R=Q*x*T-2*a(x)-t,L=y&&B*C*h*w/y,N=(b*d*I+C)/(2*(I+b*d*C)*(I+b*d*C)*C),F=-.5*x*Q*Q*Q,O=F*L,P=F*N,U=(U=2*I+b*C*(d-h))*U*S,z=(b*d*I*C+v)/U,q=-b*h*y/(C*U),H=k*O-2*z/S+Q*(z+z/_),Y=k*P-2*q/S+Q*(q+q/_),J=x*T*O-2*L/(1+w)+Q*T*L+Q*x*(z-z/_),K=x*T*P-2*N/(1+w)+Q*T*N+Q*x*(q-q/_),j=Y*J-K*H;if(!j)break;var V=(R*Y-M*K)/j,W=(M*J-R*H)/j;n-=V,o=u(-E,g(E,o-W))}while((i(V)>m||i(W)>m)&&--l>0);return i(i(o)-E)n){var g=D(u),f=o(c,A),d=r*h(f/r),y=f-d,I=e*s(y),C=(e*p(y)-y*p(I))/(E-I),B=ht(y,C),b=(v-e)/dt(B,I,v);A=g;var x,w=50;do{A-=x=(e+dt(B,I,A)*b-g)/(B(A)*b)}while(i(x)>m&&--w>0);c=y*p(A),An){var A=D(l),c=o(a,t),u=r*h(c/r),g=c-u;t=A*s(g),a=A*p(g);for(var f=t-E,d=p(t),y=a/d,m=tm||i(f)>m)&&--y>0);return[h,d]},c}var mt=yt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function It(){return(0,n.c)(mt).scale(149.995)}var vt=yt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Et(){return(0,n.c)(vt).scale(153.93)}var Ct=yt(5/6*v,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Bt(){return(0,n.c)(Ct).scale(130.945)}function bt(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}function xt(){return(0,n.c)(bt).scale(131.747)}bt.invert=function(e,t){var r,n=e,a=t,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-t)/(1+s/4)}while(i(r)>m&&--o>0);o=50,e/=1-.162388*s;do{var l=(l=n*n)*l;n-=r=(n*(.87-952426e-9*l)-e)/(.87-.00476213*l)}while(i(r)>m&&--o>0);return[n,a]};var wt=yt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Qt(){return(0,n.c)(wt).scale(131.087)}function _t(e){var t=e(E,0)[0]-e(-E,0)[0];function r(r,n){var i=r>0?-.5:.5,a=e(r+i*v,n);return a[0]-=i*t,a}return e.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=e.invert(r+i*t,n),o=a[0]-i*v;return o<-v?o+=2*v:o>v&&(o-=2*v),a[0]=o,a}),r}function St(e,t){var r=d(e),n=d(t),a=s(t),l=s(e)*a,A=p(e)*a,c=p(n*t);e=i(o(A,c)),t=S(l),i(e-E)>m&&(e%=E);var u=function(e,t){if(t===E)return[0,0];var r,n,a=p(t),o=a*a,l=o*o,A=1+l,c=1+3*l,u=1-l,g=S(1/D(A)),f=u+o*A*g,h=(1-a)/f,d=D(h),y=h*A,I=D(y),C=d*u;if(0===e)return[0,-(C+o*I)];var B,b=s(t),x=1/b,w=2*a*b,Q=(-3*o+g*c)*w,_=(-f*b-(1-a)*Q)/(f*f),k=o*A*_+h*c*w,T=-x*w,M=-x*k,R=-2*x*(u*(.5*_/d)-2*o*d*w),L=4*e/v;if(e>.222*v||t.175*v){if(r=(C+o*D(y*(1+l)-C*C))/(1+l),e>v/4)return[r,r];var N=r,F=.5*r;r=.5*(F+N),n=50;do{var O=r*(R+T*D(y-r*r))+M*S(r/I)-L;if(!O)break;O<0?F=r:N=r,r=.5*(F+N)}while(i(N-F)>m&&--n>0)}else{r=m,n=25;do{var P=r*r,G=D(y-P),U=R+T*G,z=r*U+M*S(r/I)-L;r-=B=G?z/(U+(M-T*P)/G):0}while(i(B)>m&&--n>0)}return[r,-C-o*D(y-r*r)]}(e>v/4?E-e:e,t);return e>v/4&&(c=u[0],u[0]=-u[1],u[1]=-c),u[0]*=r,u[1]*=-n,u}function kt(){return(0,n.c)(_t(St)).scale(239.75)}function Dt(e,t){var r,n,o,A,c,u;if(t=1-m)return r=(1-t)/4,o=1/(n=M(e)),[(A=((u=l(2*(u=e)))-1)/(u+1))+r*((c=n*T(e))-e)/(n*n),o-r*A*o*(c-e),o+r*A*o*(c+e),2*a(l(e))-E+r*(c-e)/n];var g=[1,0,0,0,0,0,0,0,0],f=[D(t),0,0,0,0,0,0,0,0],h=0;for(n=D(1-t),c=1;i(f[h]/g[h])>m&&h<8;)r=g[h++],f[h]=(r-n)/2,g[h]=(r+n)/2,n=D(r*n),c*=2;o=c*g[h]*e;do{o=(S(A=f[h]*p(n=o)/g[h])+o)/2}while(--h);return[p(o),A=s(o),A/s(o-n),o]}function Tt(e,t){if(!t)return e;if(1===t)return c(y(e/2+C));for(var r=1,n=D(1-t),o=D(t),s=0;i(o)>m;s++){if(e%v){var l=a(n*y(e)/r);l<0&&(l+=v),e+=l+~~(e/v)*v}else e+=e;o=(r+n)/2,n=D(r*n),o=((r=o)-n)/2}return e/(f(2,s)*r)}function Mt(e,t){var r=(b-1)/(b+1),n=D(1-r*r),A=Tt(E,n*n),u=c(y(v/4+i(t)/2)),g=l(-1*u)/D(r),f=function(e,t){var r=e*e,n=t+1,i=1-r-t*t;return[.5*((e>=0?E:-E)-o(i,2*e)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(g*s(-1*e),g*p(-1*e)),h=function(e,t,r){var n=i(e),o=T(i(t));if(n){var s=1/p(n),l=1/(y(n)*y(n)),A=-(l+r*(o*o*s*s)-1+r),c=(-A+D(A*A-(r-1)*l*4))/2;return[Tt(a(1/D(c)),r)*d(e),Tt(a(D((c/l-1)/r)),1-r)*d(t)]}return[0,Tt(a(o),1-r)*d(t)]}(f[0],f[1],n*n);return[-h[1],(t>=0?1:-1)*(.5*A-h[0])]}function Rt(){return(0,n.c)(_t(Mt)).scale(151.496)}St.invert=function(e,t){i(e)>1&&(e=2*d(e)-e),i(t)>1&&(t=2*d(t)-t);var r=d(e),n=d(t),a=-r*e,l=-n*t,A=l/a<1,c=function(e,t){for(var r=0,n=1,a=.5,o=50;;){var l=a*a,A=D(a),c=S(1/D(1+l)),u=1-l+a*(1+l)*c,g=(1-A)/u,f=D(g),h=g*(1+l),d=f*(1-l),p=D(h-e*e),y=t+d+a*p;if(i(n-r)0?r=a:n=a,a=.5*(r+n)}if(!o)return null;var m=S(A),E=s(m),C=1/E,B=2*A*E,b=(-u*E-(-3*a+c*(1+3*l))*B*(1-A))/(u*u),x=.5*b/f,w=(1-l)*x-2*a*f*B;return[v/4*(e*(-2*C*w+-C*B*p)+-C*(a*(1+l)*b+g*(1+3*l)*B)*S(e/D(h))),m]}(A?l:a,A?a:l),u=c[0],g=c[1],f=s(g);return A&&(u=-E-u),[r*(o(p(u)*f,-p(g))+v),n*S(s(u)*f)]},Mt.invert=function(e,t){var r=(b-1)/(b+1),n=D(1-r*r),i=function(e,t,r){var n,i,a;return e?(n=Dt(e,r),t?(a=(i=Dt(t,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=Dt(t,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*Tt(E,n*n)-t,-e,n*n),s=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(i[0],i[1]);return[o(s[1],s[0])/-1,2*a(l(-.5*c(r*s[0]*s[0]+r*s[1]*s[1])))-E]};var Lt=r(61780);function Nt(e){var t=p(e),r=s(e),n=Ft(e);function a(e,a){var o=n(e,a);e=o[0],a=o[1];var l=p(a),A=s(a),c=s(e),u=k(t*l+r*A*c),g=p(u),f=i(g)>m?u/g:1;return[f*r*p(e),(i(e)>E?f:-f)*(t*A-r*l*c)]}return n.invert=Ft(-e),a.invert=function(e,r){var i=D(e*e+r*r),a=-p(i),l=s(i),A=i*l,c=-r*a,u=i*t,g=D(A*A+c*c-u*u),f=o(A*u+c*g,c*u-A*g),h=(i>E?-1:1)*o(e*a,i*s(f)*l+r*p(f)*a);return n.invert(h,f)},a}function Ft(e){var t=p(e),r=s(e);return function(e,n){var i=s(n),a=s(e)*i,l=p(e)*i,A=p(n);return[o(l,a*r-A*t),S(A*r+a*t)]}}function Ot(){var e=0,t=(0,n.U)(Nt),r=t(e),i=r.rotate,a=r.stream,o=(0,Lt.c)();return r.parallel=function(n){if(!arguments.length)return e*Q;var i=r.rotate();return t(e=n*_).rotate(i)},r.rotate=function(t){return arguments.length?(i.call(r,[t[0],t[1]-e*Q]),o.center([-t[0],-t[1]]),r):((t=i.call(r))[1]+=e*Q,t)},r.stream=function(e){return(e=a(e)).sphere=function(){e.polygonStart();var t,r=o.radius(89.99)().coordinates[0],n=r.length-1,i=-1;for(e.lineStart();++i=0;)e.point((t=r[i])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},r.scale(79.4187).parallel(45).clipAngle(179.999)}var Pt=r(84706),Gt=r(16016),Ut=S(1-1/3)*Q,zt=Ne(0);function qt(e){var t=Ut*_,r=Se(v,t)[0]-Se(-v,t)[0],n=zt(0,t)[1],a=Se(0,t)[1],o=x-a,s=w/e,l=4/w,c=n+o*o*4/w;function f(f,h){var d,p=i(h);if(p>t){var y=g(e-1,u(0,A((f+v)/s)));(d=Se(f+=v*(e-1)/e-y*s,p))[0]=d[0]*w/r-w*(e-1)/(2*e)+y*w/e,d[1]=n+4*(d[1]-a)*o/w,h<0&&(d[1]=-d[1])}else d=zt(f,h);return d[0]*=l,d[1]/=c,d}return f.invert=function(t,f){t/=l;var h=i(f*=c);if(h>n){var d=g(e-1,u(0,A((t+v)/s)));t=(t+v*(e-1)/e-d*s)*r/w;var p=Se.invert(t,.25*(h-n)*w/o+a);return p[0]-=v*(e-1)/e-d*s,f<0&&(p[1]=-p[1]),p}return zt.invert(t,f)},f}function Ht(e,t){return[e,1&t?90-m:Ut]}function Yt(e,t){return[e,1&t?-90+m:-Ut]}function Jt(e){return[e[0]*(1-m),e[1]]}function Kt(){var e=4,t=(0,n.U)(qt),r=t(e),i=r.stream;return r.lobes=function(r){return arguments.length?t(e=+r):e},r.stream=function(t){var n=r.rotate(),a=i(t),o=(r.rotate([0,0]),i(t));return r.rotate(n),a.sphere=function(){(0,Gt.c)(function(e){var t=[].concat((0,Pt.ik)(-180,180+e/2,e).map(Ht),(0,Pt.ik)(180,-180-e/2,-e).map(Yt));return{type:"Polygon",coordinates:[180===e?t.map(Jt):t]}}(180/e),o)},a},r.scale(239.75)}function jt(e){var t,r=1+e,n=S(p(1/r)),a=2*D(v/(t=v+4*n*r)),l=.5*a*(r+D(e*(2+e))),A=e*e,c=r*r;function u(u,g){var f,h,d=1-p(g);if(d&&d<2){var y,m=E-g,C=25;do{var B=p(m),b=s(m),x=n+o(B,r-b),w=1+c-2*r*b;m-=y=(m-A*n-r*B+w*x-.5*d*t)/(2*r*B*x)}while(i(y)>I&&--C>0);f=a*D(w),h=u*x/v}else f=a*(e+d),h=u*n/v;return[f*p(h),l-f*s(h)]}return u.invert=function(e,i){var s=e*e+(i-=l)*i,u=(1+c-s/(a*a))/(2*r),g=k(u),f=p(g),h=n+o(f,r-u);return[S(e/D(s))*v/h,S(1-2*(g-A*n-r*f+(1+c-2*r*u)*h)/t)]},u}function Vt(){var e=1,t=(0,n.U)(jt),r=t(e);return r.ratio=function(r){return arguments.length?t(e=+r):e},r.scale(167.774).center([0,18.67])}var Wt=.7109889596207567,Zt=.0528035274542;function Xt(e,t){return t>-Wt?((e=ae(e,t))[1]+=Zt,e):ge(e,t)}function $t(){return(0,n.c)(Xt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function er(e,t){return i(t)>Wt?((e=ae(e,t))[1]-=t>0?Zt:-Zt,e):ge(e,t)}function tr(){return(0,n.c)(er).scale(152.63)}function rr(e,t,r,n){var i=D(4*v/(2*r+(1+e-t/2)*p(2*r)+(e+t)/2*p(4*r)+t/2*p(6*r))),a=D(n*p(r)*D((1+e*s(2*r)+t*s(4*r))/(1+e+t))),o=r*A(1);function l(r){return D(1+e*s(2*r)+t*s(4*r))}function A(n){var i=n*r;return(2*i+(1+e-t/2)*p(2*i)+(e+t)/2*p(4*i)+t/2*p(6*i))/r}function c(e){return l(e)*p(e)}var u=function(e,t){var n=r*$(A,o*p(t)/r,t/v);isNaN(n)&&(n=r*d(t));var c=i*l(n);return[c*a*e/v*s(n),c/a*p(n)]};return u.invert=function(e,t){var n=$(c,t*a/i);return[e*v/(s(n)*i*a*l(n)),S(r*A(n/r)/o)]},0===r&&(i=D(n/v),(u=function(e,t){return[e*i,p(t)/i]}).invert=function(e,t){return[e/i,S(t*i)]}),u}function nr(){var e=1,t=0,r=45*_,i=2,a=(0,n.U)(rr),o=a(e,t,r,i);return o.a=function(n){return arguments.length?a(e=+n,t,r,i):e},o.b=function(n){return arguments.length?a(e,t=+n,r,i):t},o.psiMax=function(n){return arguments.length?a(e,t,r=+n*_,i):r*Q},o.ratio=function(n){return arguments.length?a(e,t,r,i=+n):i},o.scale(180.739)}function ir(e,t,r,n,i,a,o,s,l,A,c){if(c.nanEncountered)return NaN;var u,g,f,h,d,p,y,m,I,v;if(g=e(t+.25*(u=r-t)),f=e(r-.25*u),isNaN(g))c.nanEncountered=!0;else{if(!isNaN(f))return v=((p=(h=u*(n+4*g+i)/12)+(d=u*(i+4*f+a)/12))-o)/15,A>l?(c.maxDepthCount++,p+v):Math.abs(v)e?r=n:t=n,n=t+r>>1}while(n>t);var i=A[n+1]-A[n];return i&&(i=(e-A[n+1])/i),(n+1+i)/s}var g=2*u(1)/v*o/r,h=function(e,t){var r=u(i(p(t))),a=n(r)*e;return r/=g,[a,t>=0?r:-r]};return h.invert=function(e,t){var r;return i(t*=g)<1&&(r=d(t)*S(a(i(t))*o)),[e/n(i(t)),r]},h}function sr(){var e=0,t=2.5,r=1.183136,i=(0,n.U)(or),a=i(e,t,r);return a.alpha=function(n){return arguments.length?i(e=+n,t,r):e},a.k=function(n){return arguments.length?i(e,t=+n,r):t},a.gamma=function(n){return arguments.length?i(e,t,r=+n):r},a.scale(152.63)}function lr(e,t){return i(e[0]-t[0])a[o][2][0];++o);var l=e(r-a[o][1][0],n);return l[0]+=e(a[o][1][0],i*n>i*a[o][0][1]?a[o][0][1]:n)[0],l}r?o.invert=r(o):e.invert&&(o.invert=function(r,n){for(var i=a[+(n<0)],s=t[+(n<0)],l=0,A=i.length;l=0;--s)r=(t=e[1][s])[0][0],n=t[0][1],i=t[1][1],a=t[2][0],o=t[2][1],l.push(Ar([[a-m,o-m],[a-m,i+m],[r+m,i+m],[r+m,n-m]],30));return{type:"Polygon",coordinates:[(0,Pt.Uf)(l)]}}(r),t=r.map((function(e){return e.map((function(e){return[[e[0][0]*_,e[0][1]*_],[e[1][0]*_,e[1][1]*_],[e[2][0]*_,e[2][1]*_]]}))})),a=t.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),s):t.map((function(e){return e.map((function(e){return[[e[0][0]*Q,e[0][1]*Q],[e[1][0]*Q,e[1][1]*Q],[e[2][0]*Q,e[2][1]*Q]]}))}))},null!=t&&s.lobes(t),s}Xt.invert=function(e,t){return t>-Wt?ae.invert(e,t-Zt):ge.invert(e,t)},er.invert=function(e,t){return i(t)>Wt?ae.invert(e,t+(t>0?Zt:-Zt)):ge.invert(e,t)};var ur=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function gr(){return cr(Ae,ur).scale(160.857)}var fr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function hr(){return cr(er,fr).scale(152.63)}var dr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function pr(){return cr(ae,dr).scale(169.529)}var yr=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function mr(){return cr(ae,yr).scale(169.529).rotate([20,0])}var Ir=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function vr(){return cr(Xt,Ir,ee).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Er=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function Cr(){return cr(ge,Er).scale(152.63).rotate([-20,0])}function Br(e,t){return[3/w*e*D(v*v/3-t*t),t]}function br(){return(0,n.c)(Br).scale(158.837)}function xr(e){function t(t,r){if(i(i(r)-E)2)return null;var a=(t/=2)*t,s=(r/=2)*r,l=2*r/(1+a+s);return l=f((1+l)/(1-l),1/e),[o(2*t,1-a-s)/e,S((l-1)/(l+1))]},t}function wr(){var e=.5,t=(0,n.U)(xr),r=t(e);return r.spacing=function(r){return arguments.length?t(e=+r):e},r.scale(124.75)}Br.invert=function(e,t){return[w/3*e/D(v*v/3-t*t),t]};var Qr=v/b;function _r(e,t){return[e*(1+D(s(t)))/2,t/(s(t/2)*s(e/6))]}function Sr(){return(0,n.c)(_r).scale(97.2672)}function kr(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function Dr(){return(0,n.c)(kr).scale(139.98)}function Tr(e,t){return[p(e)/s(t),y(t)*s(e)]}function Mr(){return(0,n.c)(Tr).scale(144.049).clipAngle(89.999)}function Rr(e){var t=s(e),r=y(C+e/2);function n(n,a){var o=a-e,s=i(o)=0;)g=(u=e[c])[0]+l*(i=g)-A*f,f=u[1]+l*f+A*i;return[g=l*(i=g)-A*f,f=l*f+A*i]}return r.invert=function(r,n){var l=20,A=r,c=n;do{for(var u,g=t,f=e[g],h=f[0],d=f[1],y=0,I=0;--g>=0;)y=h+A*(u=y)-c*I,I=d+A*I+c*u,h=(f=e[g])[0]+A*(u=h)-c*d,d=f[1]+A*d+c*u;var v,E,C=(y=h+A*(u=y)-c*I)*y+(I=d+A*I+c*u)*I;A-=v=((h=A*(u=h)-c*d-r)*y+(d=A*d+c*u-n)*I)/C,c-=E=(d*y-h*I)/C}while(i(v)+i(E)>m*m&&--l>0);if(l){var B=D(A*A+c*c),b=2*a(.5*B),x=p(b);return[o(A*x,B*s(b)),B?S(c*x/B):0]}},r}_r.invert=function(e,t){var r=i(e),n=i(t),a=m,o=E;nm||i(I)>m)&&--a>0);return a&&[r,n]},Tr.invert=function(e,t){var r=e*e,n=t*t+1,i=r+n,a=e?B*D((i-D(i*i-4*r))/r):1/D(n);return[S(e*a),d(t)*k(a)]},Nr.invert=function(e,t){return[e,2.5*a(l(.8*t))-.625*v]};var Pr=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Gr=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ur=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],zr=[[.9245,0],[0,0],[.01943,0]],qr=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Hr(){return Vr(Pr,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Yr(){return Vr(Gr,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Jr(){return Vr(Ur,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Kr(){return Vr(zr,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function jr(){return Vr(qr,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Vr(e,t){var r=(0,n.c)(Or(e)).rotate(t).clipAngle(90),i=(0,Ee.c)(t),a=r.center;return delete r.rotate,r.center=function(e){return arguments.length?a(i(e)):i.invert(a())},r}var Wr=D(6),Zr=D(7);function Xr(e,t){var r=S(7*p(t)/(3*Wr));return[Wr*e*(2*s(2*r/3)-1)/Zr,9*p(r/3)/Zr]}function $r(){return(0,n.c)(Xr).scale(164.859)}function en(e,t){for(var r,n=(1+B)*p(t),a=t,o=0;o<25&&(a-=r=(p(a/2)+p(a)-n)/(.5*s(a/2)+s(a)),!(i(r)I&&--l>0);return[e/(.84719-.13063*(n=s*s)+(o=n*(a=n*n))*o*(.05494*n-.04515-.02326*a+.00331*o)),s]},ln.invert=function(e,t){for(var r=t/2,n=0,a=1/0;n<10&&i(a)>m;++n){var o=s(t/2);t-=a=(t-y(t/2)-r)/(1-.5/(o*o))}return[2*e/(1+s(t)),t]};var cn=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function un(){return cr(W(1/0),cn).rotate([20,0]).scale(152.63)}function gn(e,t){var r=p(t),n=s(t),a=d(e);if(0===e||i(t)===E)return[0,t];if(0===t)return[e,0];if(i(e)===E)return[e*n,E*r];var o=v/(2*e)-2*e/v,l=2*t/v,A=(1-l*l)/(r-l),c=o*o,u=A*A,g=1+c/u,f=1+u/c,h=(o*r/A-o/2)/g,y=(u*r/c+A/2)/f,m=y*y-(u*r*r/c+A*r-1)/f;return[E*(h+D(h*h+n*n/g)*a),E*(y+D(m<0?0:m)*d(-t*o)*a)]}function fn(){return(0,n.c)(gn).scale(127.267)}gn.invert=function(e,t){var r=(e/=E)*e,n=r+(t/=E)*t,i=v*v;return[e?(n-1+D((1-n)*(1-n)+4*r))/(2*e)*E:0,$((function(e){return n*(v*p(e)-2*e)*v+4*e*e*(t-p(e))+2*v*e-i*t}),0)]};var hn=1.0148,dn=.23185,pn=-.14499,yn=.02406,mn=hn,In=5*dn,vn=7*pn,En=9*yn,Cn=1.790857183;function Bn(e,t){var r=t*t;return[e,t*(hn+r*r*(dn+r*(pn+yn*r)))]}function bn(){return(0,n.c)(Bn).scale(139.319)}function xn(e,t){if(i(t)Cn?t=Cn:t<-1.790857183&&(t=-1.790857183);var r,n=t;do{var a=n*n;n-=r=(n*(hn+a*a*(dn+a*(pn+yn*a)))-t)/(mn+a*a*(In+a*(vn+En*a)))}while(i(r)>m);return[e,n]},xn.invert=function(e,t){if(i(t)m&&--o>0);return l=y(a),[(i(t)=0;)if(n=t[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(t.face,r.face),i=Sn(n.map(r.project),n.map(t.project));t.transform=r.transform?kn(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o0?[-t[0],0]:[180-t[0],180])};var t=Pn.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,r){var n=t[e];n&&(n.children||(n.children=[])).push(t[r])})),Mn(t[0],(function(e,r){return t[e<-v/2?r<0?6:4:e<0?r<0?2:0:en^f>n&&r<(g-A)*(n-c)/(f-c)+A&&(i=!i)}return i}(e[0],r))return e.push(t),!0}))||e.push([t])})),ei=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function ii(e){var t=e(E,0)[0]-e(-E,0)[0];function r(r,n){var a=i(r)0?r-v:r+v,n),s=(o[0]-o[1])*B,l=(o[0]+o[1])*B;if(a)return[s,l];var A=t*B,c=s>0^l>0?-1:1;return[c*s-d(l)*A,c*l-d(s)*A]}return e.invert&&(r.invert=function(r,n){var a=(r+n)*B,o=(n-r)*B,s=i(a)<.5*t&&i(o)<.5*t;if(!s){var l=t*B,A=a>0^o>0?-1:1,c=-A*r+(o>0?1:-1)*l,u=-A*n+(a>0?1:-1)*l;a=(-c-u)*B,o=(c-u)*B}var g=e.invert(a,o);return s||(g[0]+=a>0?v:-v),g}),(0,n.c)(r).rotate([-90,-90,45]).clipAngle(179.999)}function ai(){return ii(St).scale(176.423)}function oi(){return ii(Mt).scale(111.48)}function si(e,t){if(!(0<=(t=+t)&&t<=20))throw new Error("invalid digits");function r(e){var r=e.length,n=2,i=new Array(r);for(i[0]=+e[0].toFixed(t),i[1]=+e[1].toFixed(t);n2||a[0]!=t[0]||a[1]!=t[1])&&(n.push(a),t=a)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function a(e){return e.map(i)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(e.coordinates)};break;case"LineString":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:a(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(a)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function s(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return s(e);case"FeatureCollection":var l={type:"FeatureCollection",features:e.features.map(s)};return null!=e.bbox&&(l.bbox=e.bbox),l;default:return o(e)}return e}function li(e){var t=p(e);function r(r,n){var i=t?y(r*t/2)/t:r/2;if(!n)return[2*i,-e];var o=2*a(i*p(n)),l=1/y(n);return[p(o)*l,n+(1-s(o))*l-e]}return r.invert=function(r,n){if(i(n+=e)m&&--c>0);var h=r*(u=y(A)),d=y(i(n)0?E:-E)*(u+o*(h-l)/2+o*o*(h-2*u+l)/2)]}function gi(){return(0,n.c)(ui).scale(152.63)}function fi(e,t){var r=function(e){function t(t,r){var n=s(r),i=(e-1)/(e-n*s(t));return[i*n*p(t),i*p(r)]}return t.invert=function(t,r){var n=t*t+r*r,i=D(n),a=(e-D(1-n*(e+1)/(e-1)))/((e-1)/i+i/(e-1));return[o(t*a,i*D(1-a*a)),i?S(r*a/i):0]},t}(e);if(!t)return r;var n=s(t),i=p(t);function a(t,a){var o=r(t,a),s=o[1],l=s*i/(e-1)+n;return[o[0]*n/l,s/l]}return a.invert=function(t,a){var o=(e-1)/(e-1-a*i);return r.invert(o*t,o*a*n)},a}function hi(){var e=2,t=0,r=(0,n.U)(fi),i=r(e,t);return i.distance=function(n){return arguments.length?r(e=+n,t):e},i.tilt=function(n){return arguments.length?r(e,t=n*_):t*Q},i.scale(432.147).clipAngle(k(1/e)*Q-1e-6)}ci.forEach((function(e){e[1]*=1.0144})),ui.invert=function(e,t){var r=t/E,n=90*r,a=g(18,i(n/5)),o=u(0,A(a));do{var s=ci[o][1],l=ci[o+1][1],c=ci[g(19,o+2)][1],f=c-s,h=c-2*l+s,d=2*(i(r)-l)/f,p=h/f,y=d*(1-p*d*(1-2*p*d));if(y>=0||1===o){n=(t>=0?5:-5)*(y+a);var m,v=50;do{y=(a=g(18,i(n)/5))-(o=A(a)),s=ci[o][1],l=ci[o+1][1],c=ci[g(19,o+2)][1],n-=(m=(t>=0?E:-E)*(l+y*(c-s)/2+y*y*(c-2*l+s)/2)-t)*Q}while(i(m)>I&&--v>0);break}}while(--o>=0);var C=ci[o][0],B=ci[o+1][0],b=ci[g(19,o+2)][0];return[e/(B+y*(b-C)/2+y*y*(b-2*B+C)/2),n*_]};var di=1e-4,pi=1e4,yi=-180,mi=yi+di,Ii=180,vi=Ii-di,Ei=-90,Ci=Ei+di,Bi=90,bi=Bi-di;function xi(e){return e.length>0}function wi(e){return e===Ei||e===Bi?[0,e]:[yi,(t=e,Math.floor(t*pi)/pi)];var t}function Qi(e){var t=e[0],r=e[1],n=!1;return t<=mi?(t=yi,n=!0):t>=vi&&(t=Ii,n=!0),r<=Ci?(r=Ei,n=!0):r>=bi&&(r=Bi,n=!0),n?[t,r]:e}function _i(e){return e.map(Qi)}function Si(e,t,r){for(var n=0,i=e.length;n=vi||c<=Ci||c>=bi){a[o]=Qi(l);for(var u=o+1;umi&&fCi&&h=s)break;r.push({index:-1,polygon:t,ring:a=a.slice(u-1)}),a[0]=wi(a[0][1]),o=-1,s=a.length}}}}function ki(e){var t,r,n,i,a,o,s=e.length,l={},A={};for(t=0;t0?v-l:l)*Q],c=(0,n.c)(e(s)).rotate(A),u=(0,Ee.c)(A),g=c.center;return delete c.rotate,c.center=function(e){return arguments.length?g(u(e)):u.invert(g())},c.clipAngle(90)}function Fi(e){var t=s(e);function r(e,r){var n=(0,Fn.Y)(e,r);return n[0]*=t,n}return r.invert=function(e,r){return Fn.Y.invert(e/t,r)},r}function Oi(){return Pi([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Pi(e,t){return Ni(Fi,e,t)}function Gi(e){if(!(e*=2))return J.O;var t=-e/2,r=-t,n=e*e,i=y(r),a=.5/p(r);function l(i,a){var o=k(s(a)*s(i-t)),l=k(s(a)*s(i-r));return[((o*=o)-(l*=l))/(2*e),(a<0?-1:1)*D(4*n*l-(n-o+l)*(n-o+l))/(2*e)]}return l.invert=function(e,n){var l,A,c=n*n,u=s(D(c+(l=e+t)*l)),g=s(D(c+(l=e+r)*l));return[o(A=u-g,l=(u+g)*i),(n<0?-1:1)*k(D(l*l+A*A)*a)]},l}function Ui(){return zi([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function zi(e,t){return Ni(Gi,e,t)}function qi(e,t){if(i(t)m&&--l>0);return[d(e)*(D(a*a+4)+a)*v/4,E*s]};var ea=4*v+3*D(3),ta=2*D(2*v*D(3)/ea),ra=ie(ta*D(3)/v,ta,ea/6);function na(){return(0,n.c)(ra).scale(176.84)}function ia(e,t){return[e*D(1-3*t*t/(v*v)),t]}function aa(){return(0,n.c)(ia).scale(152.63)}function oa(e,t){var r=s(t),n=s(e)*r,i=1-n,a=s(e=o(p(e)*r,-p(t))),l=p(e);return[l*(r=D(1-n*n))-a*i,-a*r-l*i]}function sa(){return(0,n.c)(oa).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)}function la(e,t){var r=N(e,t);return[(r[0]+e/E)/2,(r[1]+t)/2]}function Aa(){return(0,n.c)(la).scale(158.837)}ia.invert=function(e,t){return[e/D(1-3*t*t/(v*v)),t]},oa.invert=function(e,t){var r=(e*e+t*t)/-2,n=D(-r*(2+r)),i=t*r+e*n,a=e*r-t*n,s=D(a*a+i*i);return[o(n*i,s*(1+r)),s?-S(n*a/s):0]},la.invert=function(e,t){var r=e,n=t,a=25;do{var o,l=s(n),A=p(n),c=p(2*n),u=A*A,g=l*l,f=p(r),h=s(r/2),d=p(r/2),y=d*d,I=1-g*h*h,v=I?k(l*h)*D(o=1/I):o=0,C=.5*(2*v*l*d+r/E)-e,B=.5*(v*A+n)-t,b=.5*o*(g*y+v*l*h*u)+.5/E,x=o*(f*c/4-v*A*d),w=.125*o*(c*d-v*A*g*f),Q=.5*o*(u*h+v*y*l)+.5,_=x*w-Q*b,S=(B*x-C*Q)/_,T=(C*w-B*b)/_;r-=S,n-=T}while((i(S)>m||i(T)>m)&&--a>0);return[r,n]}},88728:function(e,t,r){"use strict";function n(){return new i}function i(){this.reset()}r.d(t,{c:function(){return n}}),i.prototype={constructor:i,reset:function(){this.s=this.t=0},add:function(e){o(a,e,this.t),o(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new i;function o(e,t,r){var n=e.s=t+r,i=n-t,a=n-i;e.t=t-a+(r-i)}},95384:function(e,t,r){"use strict";r.d(t,{cp:function(){return I},mQ:function(){return g},oB:function(){return h}});var n,i,a,o,s,l=r(88728),A=r(64528),c=r(70932),u=r(16016),g=(0,l.c)(),f=(0,l.c)(),h={point:c.c,lineStart:c.c,lineEnd:c.c,polygonStart:function(){g.reset(),h.lineStart=d,h.lineEnd=p},polygonEnd:function(){var e=+g;f.add(e<0?A.kD+e:e),this.lineStart=this.lineEnd=this.point=c.c},sphere:function(){f.add(A.kD)}};function d(){h.point=y}function p(){m(n,i)}function y(e,t){h.point=m,n=e,i=t,e*=A.qw,t*=A.qw,a=e,o=(0,A.W8)(t=t/2+A.wL),s=(0,A.g$)(t)}function m(e,t){e*=A.qw,t=(t*=A.qw)/2+A.wL;var r=e-a,n=r>=0?1:-1,i=n*r,l=(0,A.W8)(t),c=(0,A.g$)(t),u=s*c,f=o*l+u*(0,A.W8)(i),h=u*n*(0,A.g$)(i);g.add((0,A.WE)(h,f)),a=e,o=l,s=c}function I(e){return f.reset(),(0,u.c)(e,h),2*f}},13696:function(e,t,r){"use strict";r.d(t,{c:function(){return k}});var n,i,a,o,s,l,A,c,u,g,f=r(88728),h=r(95384),d=r(84220),p=r(64528),y=r(16016),m=(0,f.c)(),I={point:v,lineStart:C,lineEnd:B,polygonStart:function(){I.point=b,I.lineStart=x,I.lineEnd=w,m.reset(),h.oB.polygonStart()},polygonEnd:function(){h.oB.polygonEnd(),I.point=v,I.lineStart=C,I.lineEnd=B,h.mQ<0?(n=-(a=180),i=-(o=90)):m>p.Gg?o=90:m<-p.Gg&&(i=-90),g[0]=n,g[1]=a},sphere:function(){n=-(a=180),i=-(o=90)}};function v(e,t){u.push(g=[n=e,a=e]),to&&(o=t)}function E(e,t){var r=(0,d.ux)([e*p.qw,t*p.qw]);if(c){var l=(0,d.CW)(c,r),A=[l[1],-l[0],0],f=(0,d.CW)(A,l);(0,d.cJ)(f),f=(0,d.G)(f);var h,y=e-s,m=y>0?1:-1,I=f[0]*p.oh*m,v=(0,p.a2)(y)>180;v^(m*so&&(o=h):v^(m*s<(I=(I+360)%360-180)&&Io&&(o=t)),v?eQ(n,a)&&(a=e):Q(e,a)>Q(n,a)&&(n=e):a>=n?(ea&&(a=e)):e>s?Q(n,e)>Q(n,a)&&(a=e):Q(e,a)>Q(n,a)&&(n=e)}else u.push(g=[n=e,a=e]);to&&(o=t),c=r,s=e}function C(){I.point=E}function B(){g[0]=n,g[1]=a,I.point=v,c=null}function b(e,t){if(c){var r=e-s;m.add((0,p.a2)(r)>180?r+(r>0?360:-360):r)}else l=e,A=t;h.oB.point(e,t),E(e,t)}function x(){h.oB.lineStart()}function w(){b(l,A),h.oB.lineEnd(),(0,p.a2)(m)>p.Gg&&(n=-(a=180)),g[0]=n,g[1]=a,c=null}function Q(e,t){return(t-=e)<0?t+360:t}function _(e,t){return e[0]-t[0]}function S(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tQ(s[0],s[1])&&(s[1]=l[1]),Q(l[0],s[1])>Q(s[0],s[1])&&(s[0]=l[0])):A.push(s=l);for(c=-1/0,t=0,s=A[r=A.length-1];t<=r;s=l,++t)l=A[t],(f=Q(s[1],l[0]))>c&&(c=f,n=l[0],a=s[1])}return u=g=null,n===1/0||i===1/0?[[NaN,NaN],[NaN,NaN]]:[[n,i],[a,o]]}},84220:function(e,t,r){"use strict";r.d(t,{CW:function(){return s},Ez:function(){return o},G:function(){return i},cJ:function(){return c},mg:function(){return l},ux:function(){return a},wx:function(){return A}});var n=r(64528);function i(e){return[(0,n.WE)(e[1],e[0]),(0,n.qR)(e[2])]}function a(e){var t=e[0],r=e[1],i=(0,n.W8)(r);return[i*(0,n.W8)(t),i*(0,n.g$)(t),(0,n.g$)(r)]}function o(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function s(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function l(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function A(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function c(e){var t=(0,n._I)(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}},24052:function(e,t,r){"use strict";r.d(t,{c:function(){return M}});var n,i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I=r(64528),v=r(70932),E=r(16016),C={sphere:v.c,point:B,lineStart:x,lineEnd:_,polygonStart:function(){C.lineStart=S,C.lineEnd=k},polygonEnd:function(){C.lineStart=x,C.lineEnd=_}};function B(e,t){e*=I.qw,t*=I.qw;var r=(0,I.W8)(t);b(r*(0,I.W8)(e),r*(0,I.g$)(e),(0,I.g$)(t))}function b(e,t,r){++n,a+=(e-a)/n,o+=(t-o)/n,s+=(r-s)/n}function x(){C.point=w}function w(e,t){e*=I.qw,t*=I.qw;var r=(0,I.W8)(t);p=r*(0,I.W8)(e),y=r*(0,I.g$)(e),m=(0,I.g$)(t),C.point=Q,b(p,y,m)}function Q(e,t){e*=I.qw,t*=I.qw;var r=(0,I.W8)(t),n=r*(0,I.W8)(e),a=r*(0,I.g$)(e),o=(0,I.g$)(t),s=(0,I.WE)((0,I._I)((s=y*o-m*a)*s+(s=m*n-p*o)*s+(s=p*a-y*n)*s),p*n+y*a+m*o);i+=s,l+=s*(p+(p=n)),A+=s*(y+(y=a)),c+=s*(m+(m=o)),b(p,y,m)}function _(){C.point=B}function S(){C.point=D}function k(){T(h,d),C.point=B}function D(e,t){h=e,d=t,e*=I.qw,t*=I.qw,C.point=T;var r=(0,I.W8)(t);p=r*(0,I.W8)(e),y=r*(0,I.g$)(e),m=(0,I.g$)(t),b(p,y,m)}function T(e,t){e*=I.qw,t*=I.qw;var r=(0,I.W8)(t),n=r*(0,I.W8)(e),a=r*(0,I.g$)(e),o=(0,I.g$)(t),s=y*o-m*a,h=m*n-p*o,d=p*a-y*n,v=(0,I._I)(s*s+h*h+d*d),E=(0,I.qR)(v),C=v&&-E/v;u+=C*s,g+=C*h,f+=C*d,i+=E,l+=E*(p+(p=n)),A+=E*(y+(y=a)),c+=E*(m+(m=o)),b(p,y,m)}function M(e){n=i=a=o=s=l=A=c=u=g=f=0,(0,E.c)(e,C);var t=u,r=g,h=f,d=t*t+r*r+h*h;return d0?os)&&(o+=i*a.kD));for(var g,f=o;i>0?f>s:f0?i.pi:-i.pi,A=(0,i.a2)(o-r);(0,i.a2)(A-i.pi)0?i.or:-i.or),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),e.point(o,n),t=0):a!==l&&A>=i.pi&&((0,i.a2)(r-a)i.Gg?(0,i.MQ)(((0,i.g$)(t)*(o=(0,i.W8)(n))*(0,i.g$)(r)-(0,i.g$)(n)*(a=(0,i.W8)(t))*(0,i.g$)(e))/(a*o*s)):(t+n)/2}(r,n,o,s),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),t=0),e.point(r=o,n=s),a=l},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var a;if(null==e)a=r*i.or,n.point(-i.pi,a),n.point(0,a),n.point(i.pi,a),n.point(i.pi,0),n.point(i.pi,-a),n.point(0,-a),n.point(-i.pi,-a),n.point(-i.pi,0),n.point(-i.pi,a);else if((0,i.a2)(e[0]-t[0])>i.Gg){var o=e[0]1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}},2728:function(e,t,r){"use strict";r.d(t,{c:function(){return l}});var n=r(84220),i=r(61780),a=r(64528),o=r(41860),s=r(14229);function l(e){var t=(0,a.W8)(e),r=6*a.qw,l=t>0,A=(0,a.a2)(t)>a.Gg;function c(e,r){return(0,a.W8)(e)*(0,a.W8)(r)>t}function u(e,r,i){var o=(0,n.ux)(e),s=(0,n.ux)(r),l=[1,0,0],A=(0,n.CW)(o,s),c=(0,n.Ez)(A,A),u=A[0],g=c-u*u;if(!g)return!i&&e;var f=t*c/g,h=-t*u/g,d=(0,n.CW)(l,A),p=(0,n.wx)(l,f),y=(0,n.wx)(A,h);(0,n.mg)(p,y);var m=d,I=(0,n.Ez)(p,m),v=(0,n.Ez)(m,m),E=I*I-v*((0,n.Ez)(p,p)-1);if(!(E<0)){var C=(0,a._I)(E),B=(0,n.wx)(m,(-I-C)/v);if((0,n.mg)(B,p),B=(0,n.G)(B),!i)return B;var b,x=e[0],w=r[0],Q=e[1],_=r[1];w0^B[1]<((0,a.a2)(B[0]-x)a.pi^(x<=B[0]&&B[0]<=w)){var D=(0,n.wx)(m,(-I+C)/v);return(0,n.mg)(D,p),[B,(0,n.G)(D)]}}}function g(t,r){var n=l?e:a.pi-e,i=0;return t<-n?i|=1:t>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}return(0,s.c)(c,(function(e){var t,r,n,i,s;return{lineStart:function(){i=n=!1,s=1},point:function(f,h){var d,p=[f,h],y=c(f,h),m=l?y?0:g(f,h):y?g(f+(f<0?a.pi:-a.pi),h):0;if(!t&&(i=n=y)&&e.lineStart(),y!==n&&(!(d=u(t,p))||(0,o.c)(t,d)||(0,o.c)(p,d))&&(p[2]=1),y!==n)s=0,y?(e.lineStart(),d=u(p,t),e.point(d[0],d[1])):(d=u(t,p),e.point(d[0],d[1],2),e.lineEnd()),t=d;else if(A&&t&&l^y){var I;m&r||!(I=u(p,t,!0))||(s=0,l?(e.lineStart(),e.point(I[0][0],I[0][1]),e.point(I[1][0],I[1][1]),e.lineEnd()):(e.point(I[1][0],I[1][1]),e.lineEnd(),e.lineStart(),e.point(I[0][0],I[0][1],3)))}!y||t&&(0,o.c)(t,p)||e.point(p[0],p[1]),t=p,n=y,r=m},lineEnd:function(){n&&e.lineEnd(),t=null},clean:function(){return s|(i&&n)<<1}}}),(function(t,n,a,o){(0,i.Q)(o,e,r,a,t,n)}),l?[0,-e]:[-a.pi,e-a.pi])}},14229:function(e,t,r){"use strict";r.d(t,{c:function(){return l}});var n=r(97208),i=r(32232),a=r(64528),o=r(58196),s=r(84706);function l(e,t,r,a){return function(l){var u,g,f,h=t(l),d=(0,n.c)(),p=t(d),y=!1,m={point:I,lineStart:E,lineEnd:C,polygonStart:function(){m.point=B,m.lineStart=b,m.lineEnd=x,g=[],u=[]},polygonEnd:function(){m.point=I,m.lineStart=E,m.lineEnd=C,g=(0,s.Uf)(g);var e=(0,o.c)(u,a);g.length?(y||(l.polygonStart(),y=!0),(0,i.c)(g,c,e,r,l)):e&&(y||(l.polygonStart(),y=!0),l.lineStart(),r(null,null,1,l),l.lineEnd()),y&&(l.polygonEnd(),y=!1),g=u=null},sphere:function(){l.polygonStart(),l.lineStart(),r(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function I(t,r){e(t,r)&&l.point(t,r)}function v(e,t){h.point(e,t)}function E(){m.point=v,h.lineStart()}function C(){m.point=I,h.lineEnd()}function B(e,t){f.push([e,t]),p.point(e,t)}function b(){p.lineStart(),f=[]}function x(){B(f[0][0],f[0][1]),p.lineEnd();var e,t,r,n,i=p.clean(),a=d.result(),o=a.length;if(f.pop(),u.push(f),f=null,o)if(1&i){if((t=(r=a[0]).length-1)>0){for(y||(l.polygonStart(),y=!0),l.lineStart(),e=0;e1&&2&i&&a.push(a.pop().concat(a.shift())),g.push(a.filter(A))}return m}}function A(e){return e.length>1}function c(e,t){return((e=e.x)[0]<0?e[1]-a.or-a.Gg:a.or-e[1])-((t=t.x)[0]<0?t[1]-a.or-a.Gg:a.or-t[1])}},21676:function(e,t,r){"use strict";r.d(t,{c:function(){return A}});var n=r(64528),i=r(97208),a=r(32232),o=r(84706),s=1e9,l=-s;function A(e,t,r,A){function c(n,i){return e<=n&&n<=r&&t<=i&&i<=A}function u(n,i,a,o){var s=0,l=0;if(null==n||(s=g(n,a))!==(l=g(i,a))||h(n,i)<0^a>0)do{o.point(0===s||3===s?e:r,s>1?A:t)}while((s=(s+a+4)%4)!==l);else o.point(i[0],i[1])}function g(i,a){return(0,n.a2)(i[0]-e)0?0:3:(0,n.a2)(i[0]-r)0?2:1:(0,n.a2)(i[1]-t)0?1:0:a>0?3:2}function f(e,t){return h(e.x,t.x)}function h(e,t){var r=g(e,1),n=g(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(n){var g,h,d,p,y,m,I,v,E,C,B,b=n,x=(0,i.c)(),w={point:Q,lineStart:function(){w.point=_,h&&h.push(d=[]),C=!0,E=!1,I=v=NaN},lineEnd:function(){g&&(_(p,y),m&&E&&x.rejoin(),g.push(x.result())),w.point=Q,E&&b.lineEnd()},polygonStart:function(){b=x,g=[],h=[],B=!0},polygonEnd:function(){var t=function(){for(var t=0,r=0,n=h.length;rA&&(u-i)*(A-a)>(g-a)*(e-i)&&++t:g<=A&&(u-i)*(A-a)<(g-a)*(e-i)&&--t;return t}(),r=B&&t,i=(g=(0,o.Uf)(g)).length;(r||i)&&(n.polygonStart(),r&&(n.lineStart(),u(null,null,1,n),n.lineEnd()),i&&(0,a.c)(g,f,t,u,n),n.polygonEnd()),b=n,g=h=d=null}};function Q(e,t){c(e,t)&&b.point(e,t)}function _(n,i){var a=c(n,i);if(h&&d.push([n,i]),C)p=n,y=i,m=a,C=!1,a&&(b.lineStart(),b.point(n,i));else if(a&&E)b.point(n,i);else{var o=[I=Math.max(l,Math.min(s,I)),v=Math.max(l,Math.min(s,v))],u=[n=Math.max(l,Math.min(s,n)),i=Math.max(l,Math.min(s,i))];!function(e,t,r,n,i,a){var o,s=e[0],l=e[1],A=0,c=1,u=t[0]-s,g=t[1]-l;if(o=r-s,u||!(o>0)){if(o/=u,u<0){if(o0){if(o>c)return;o>A&&(A=o)}if(o=i-s,u||!(o<0)){if(o/=u,u<0){if(o>c)return;o>A&&(A=o)}else if(u>0){if(o0)){if(o/=g,g<0){if(o0){if(o>c)return;o>A&&(A=o)}if(o=a-l,g||!(o<0)){if(o/=g,g<0){if(o>c)return;o>A&&(A=o)}else if(g>0){if(o0&&(e[0]=s+A*u,e[1]=l+A*g),c<1&&(t[0]=s+c*u,t[1]=l+c*g),!0}}}}}(o,u,e,t,r,A)?a&&(b.lineStart(),b.point(n,i),B=!1):(E||(b.lineStart(),b.point(o[0],o[1])),b.point(u[0],u[1]),a||b.lineEnd(),B=!1)}I=n,v=i,E=a}return w}}},32232:function(e,t,r){"use strict";r.d(t,{c:function(){return o}});var n=r(41860),i=r(64528);function a(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function o(e,t,r,o,l){var A,c,u=[],g=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,r,o=e[0],s=e[t];if((0,n.c)(o,s)){if(!o[2]&&!s[2]){for(l.lineStart(),A=0;A=0;--A)l.point((h=f[A])[0],h[1]);else o(p.x,p.p.x,-1,l);p=p.p}f=(p=p.o).z,y=!y}while(!p.v);l.lineEnd()}}}function s(e){if(t=e.length){for(var t,r,n=0,i=e[0];++n0&&(i=Q(e[a],e[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))p.Gg})).map(l)).concat((0,F.ik)((0,p.Km)(a/f)*f,i,f).filter((function(e){return(0,p.a2)(e%d)>p.Gg})).map(A))}return m.lines=function(){return I().map((function(e){return{type:"LineString",coordinates:e}}))},m.outline=function(){return{type:"Polygon",coordinates:[c(n).concat(u(o).slice(1),c(r).reverse().slice(1),u(s).reverse().slice(1))]}},m.extent=function(e){return arguments.length?m.extentMajor(e).extentMinor(e):m.extentMinor()},m.extentMajor=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),m.precision(y)):[[n,s],[r,o]]},m.extentMinor=function(r){return arguments.length?(t=+r[0][0],e=+r[1][0],a=+r[0][1],i=+r[1][1],t>e&&(r=t,t=e,e=r),a>i&&(r=a,a=i,i=r),m.precision(y)):[[t,a],[e,i]]},m.step=function(e){return arguments.length?m.stepMajor(e).stepMinor(e):m.stepMinor()},m.stepMajor=function(e){return arguments.length?(h=+e[0],d=+e[1],m):[h,d]},m.stepMinor=function(e){return arguments.length?(g=+e[0],f=+e[1],m):[g,f]},m.precision=function(g){return arguments.length?(y=+g,l=O(a,i,90),A=P(t,e,y),c=O(s,o,90),u=P(n,r,y),m):y},m.extentMajor([[-180,-90+p.Gg],[180,90-p.Gg]]).extentMinor([[-180,-80-p.Gg],[180,80+p.Gg]])}function U(){return G()()}var z,q,H,Y,J=r(27284),K=r(7376),j=(0,d.c)(),V=(0,d.c)(),W={point:y.c,lineStart:y.c,lineEnd:y.c,polygonStart:function(){W.lineStart=Z,W.lineEnd=ee},polygonEnd:function(){W.lineStart=W.lineEnd=W.point=y.c,j.add((0,p.a2)(V)),V.reset()},result:function(){var e=j/2;return j.reset(),e}};function Z(){W.point=X}function X(e,t){W.point=$,z=H=e,q=Y=t}function $(e,t){V.add(Y*e-H*t),H=e,Y=t}function ee(){$(z,q)}var te,re,ne,ie,ae=W,oe=r(73784),se=0,le=0,Ae=0,ce=0,ue=0,ge=0,fe=0,he=0,de=0,pe={point:ye,lineStart:me,lineEnd:Ee,polygonStart:function(){pe.lineStart=Ce,pe.lineEnd=Be},polygonEnd:function(){pe.point=ye,pe.lineStart=me,pe.lineEnd=Ee},result:function(){var e=de?[fe/de,he/de]:ge?[ce/ge,ue/ge]:Ae?[se/Ae,le/Ae]:[NaN,NaN];return se=le=Ae=ce=ue=ge=fe=he=de=0,e}};function ye(e,t){se+=e,le+=t,++Ae}function me(){pe.point=Ie}function Ie(e,t){pe.point=ve,ye(ne=e,ie=t)}function ve(e,t){var r=e-ne,n=t-ie,i=(0,p._I)(r*r+n*n);ce+=i*(ne+e)/2,ue+=i*(ie+t)/2,ge+=i,ye(ne=e,ie=t)}function Ee(){pe.point=ye}function Ce(){pe.point=be}function Be(){xe(te,re)}function be(e,t){pe.point=xe,ye(te=ne=e,re=ie=t)}function xe(e,t){var r=e-ne,n=t-ie,i=(0,p._I)(r*r+n*n);ce+=i*(ne+e)/2,ue+=i*(ie+t)/2,ge+=i,fe+=(i=ie*e-ne*t)*(ne+e),he+=i*(ie+t),de+=3*i,ye(ne=e,ie=t)}var we=pe;function Qe(e){this._context=e}Qe.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,p.kD)}},result:y.c};var _e,Se,ke,De,Te,Me=(0,d.c)(),Re={point:y.c,lineStart:function(){Re.point=Le},lineEnd:function(){_e&&Ne(Se,ke),Re.point=y.c},polygonStart:function(){_e=!0},polygonEnd:function(){_e=null},result:function(){var e=+Me;return Me.reset(),e}};function Le(e,t){Re.point=Ne,Se=De=e,ke=Te=t}function Ne(e,t){De-=e,Te-=t,Me.add((0,p._I)(De*De+Te*Te)),De=e,Te=t}var Fe=Re;function Oe(){this._string=[]}function Pe(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Ge(e,t){var r,n,i=4.5;function a(e){return e&&("function"===typeof i&&n.pointRadius(+i.apply(this,arguments)),(0,m.c)(e,r(n))),n.result()}return a.area=function(e){return(0,m.c)(e,r(ae)),ae.result()},a.measure=function(e){return(0,m.c)(e,r(Fe)),Fe.result()},a.bounds=function(e){return(0,m.c)(e,r(oe.c)),oe.c.result()},a.centroid=function(e){return(0,m.c)(e,r(we)),we.result()},a.projection=function(t){return arguments.length?(r=null==t?(e=null,K.c):(e=t).stream,a):e},a.context=function(e){return arguments.length?(n=null==e?(t=null,new Oe):new Qe(t=e),"function"!==typeof i&&n.pointRadius(i),a):t},a.pointRadius=function(e){return arguments.length?(i="function"===typeof e?e:(n.pointRadius(+e),+e),a):i},a.projection(e).context(t)}Oe.prototype={_radius:4.5,_circle:Pe(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=Pe(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}};var Ue=r(87952);function ze(e){var t=0,r=p.pi/3,n=(0,Ue.U)(e),i=n(t,r);return i.parallels=function(e){return arguments.length?n(t=e[0]*p.qw,r=e[1]*p.qw):[t*p.oh,r*p.oh]},i}function qe(e,t){var r=(0,p.g$)(e),n=(r+(0,p.g$)(t))/2;if((0,p.a2)(n)=.12&&i<.234&&n>=-.425&&n<-.214?s:i>=.166&&i<.234&&n>=-.214&&n<-.115?l:o).invert(e)},c.stream=function(r){return e&&t===r?e:e=function(e){var t=e.length;return{point:function(r,n){for(var i=-1;++i0?t<-p.or+p.Gg&&(t=-p.or+p.Gg):t>p.or-p.Gg&&(t=p.or-p.Gg);var r=i/(0,p.g3)(et(t),n);return[r*(0,p.g$)(n*e),i-r*(0,p.W8)(n*e)]}return a.invert=function(e,t){var r=i-t,a=(0,p.kq)(n)*(0,p._I)(e*e+r*r),o=(0,p.WE)(e,(0,p.a2)(r))*(0,p.kq)(r);return r*n<0&&(o-=p.pi*(0,p.kq)(e)*(0,p.kq)(r)),[o/n,2*(0,p.MQ)((0,p.g3)(i/a,1/n))-p.or]},a}function rt(){return ze(tt).scale(109.5).parallels([30,30])}Ze.invert=function(e,t){return[e,2*(0,p.MQ)((0,p.oN)(t))-p.or]};var nt=r(69604);function it(e,t){var r=(0,p.W8)(e),n=e===t?(0,p.g$)(e):(r-(0,p.W8)(t))/(t-e),i=r/n+e;if((0,p.a2)(n)2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)}It.invert=(0,mt.g)((function(e){return 2*(0,p.MQ)(e)})),Et.invert=function(e,t){return[-t,2*(0,p.MQ)((0,p.oN)(e))-p.or]}},27284:function(e,t,r){"use strict";r.d(t,{c:function(){return i}});var n=r(64528);function i(e,t){var r=e[0]*n.qw,i=e[1]*n.qw,a=t[0]*n.qw,o=t[1]*n.qw,s=(0,n.W8)(i),l=(0,n.g$)(i),A=(0,n.W8)(o),c=(0,n.g$)(o),u=s*(0,n.W8)(r),g=s*(0,n.g$)(r),f=A*(0,n.W8)(a),h=A*(0,n.g$)(a),d=2*(0,n.qR)((0,n._I)((0,n.SD)(o-i)+s*A*(0,n.SD)(a-r))),p=(0,n.g$)(d),y=d?function(e){var t=(0,n.g$)(e*=d)/p,r=(0,n.g$)(d-e)/p,i=r*u+t*f,a=r*g+t*h,o=r*l+t*c;return[(0,n.WE)(a,i)*n.oh,(0,n.WE)(o,(0,n._I)(i*i+a*a))*n.oh]}:function(){return[r*n.oh,i*n.oh]};return y.distance=d,y}},64528:function(e,t,r){"use strict";r.d(t,{Gg:function(){return n},Km:function(){return d},MQ:function(){return g},SD:function(){return x},W8:function(){return h},WE:function(){return f},Yz:function(){return y},_I:function(){return E},a2:function(){return u},a6:function(){return C},a8:function(){return i},g$:function(){return I},g3:function(){return m},kD:function(){return l},kq:function(){return v},mE:function(){return B},oN:function(){return p},oh:function(){return A},or:function(){return o},pi:function(){return a},qR:function(){return b},qw:function(){return c},wL:function(){return s}});var n=1e-6,i=1e-12,a=Math.PI,o=a/2,s=a/4,l=2*a,A=180/a,c=a/180,u=Math.abs,g=Math.atan,f=Math.atan2,h=Math.cos,d=Math.ceil,p=Math.exp,y=(Math.floor,Math.log),m=Math.pow,I=Math.sin,v=Math.sign||function(e){return e>0?1:e<0?-1:0},E=Math.sqrt,C=Math.tan;function B(e){return e>1?0:e<-1?a:Math.acos(e)}function b(e){return e>1?o:e<-1?-o:Math.asin(e)}function x(e){return(e=I(e/2))*e}},70932:function(e,t,r){"use strict";function n(){}r.d(t,{c:function(){return n}})},73784:function(e,t,r){"use strict";var n=r(70932),i=1/0,a=i,o=-i,s=o,l={point:function(e,t){eo&&(o=e),ts&&(s=t)},lineStart:n.c,lineEnd:n.c,polygonStart:n.c,polygonEnd:n.c,result:function(){var e=[[i,a],[o,s]];return o=s=-(a=i=1/0),e}};t.c=l},41860:function(e,t,r){"use strict";r.d(t,{c:function(){return i}});var n=r(64528);function i(e,t){return(0,n.a2)(e[0]-t[0])=0?1:-1,S=_*Q,k=S>a.pi,D=I*x;if(o.add((0,a.WE)(D*_*(0,a.g$)(S),v*w+D*(0,a.W8)(S))),c+=k?Q+_*a.kD:Q,k^y>=r^B>=r){var T=(0,i.CW)((0,i.ux)(p),(0,i.ux)(C));(0,i.cJ)(T);var M=(0,i.CW)(A,T);(0,i.cJ)(M);var R=(k^Q>=0?-1:1)*(0,a.qR)(M[2]);(n>R||n===R&&(T[0]||T[1]))&&(u+=k^Q>=0?1:-1)}}return(c<-a.Gg||c4*t&&y--){var C=o+f,B=s+d,b=A+p,x=(0,l._I)(C*C+B*B+b*b),w=(0,l.qR)(b/=x),Q=(0,l.a2)((0,l.a2)(b)-1)t||(0,l.a2)((I*D+v*T)/E-.5)>.3||o*f+s*d+A*p2?e[2]%360*l.qw:0,z()):[S*l.oh,k*l.oh,D*l.oh]},G.angle=function(e){return arguments.length?(T=e%360*l.qw,z()):T*l.oh},G.reflectX=function(e){return arguments.length?(M=e?-1:1,z()):M<0},G.reflectY=function(e){return arguments.length?(R=e?-1:1,z()):R<0},G.precision=function(e){return arguments.length?(I=d(v,P=e*e),q()):(0,l._I)(P)},G.fitExtent=function(e,t){return(0,u.QX)(G,e,t)},G.fitSize=function(e,t){return(0,u.UV)(G,e,t)},G.fitWidth=function(e,t){return(0,u.Qx)(G,e,t)},G.fitHeight=function(e,t){return(0,u.OW)(G,e,t)},function(){return t=e.apply(this,arguments),G.invert=t.invert&&U,z()}}},47984:function(e,t,r){"use strict";r.d(t,{c:function(){return o},g:function(){return a}});var n=r(87952),i=r(64528);function a(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function o(){return(0,n.c)(a).scale(175.295)}a.invert=function(e,t){var r,n=t,a=25;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-t)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while((0,i.a2)(r)>i.Gg&&--a>0);return[e/(.8707+(o=n*n)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),n]}},4888:function(e,t,r){"use strict";r.d(t,{c:function(){return s},t:function(){return o}});var n=r(64528),i=r(62280),a=r(87952);function o(e,t){return[(0,n.W8)(t)*(0,n.g$)(e),(0,n.g$)(t)]}function s(){return(0,a.c)(o).scale(249.5).clipAngle(90+n.Gg)}o.invert=(0,i.g)(n.qR)},92992:function(e,t,r){"use strict";r.d(t,{O:function(){return o},c:function(){return c}});var n=r(68120),i=r(64528);function a(e,t){return[(0,i.a2)(e)>i.pi?e+Math.round(-e/i.kD)*i.kD:e,t]}function o(e,t,r){return(e%=i.kD)?t||r?(0,n.c)(l(e),A(t,r)):l(e):t||r?A(t,r):a}function s(e){return function(t,r){return[(t+=e)>i.pi?t-i.kD:t<-i.pi?t+i.kD:t,r]}}function l(e){var t=s(e);return t.invert=s(-e),t}function A(e,t){var r=(0,i.W8)(e),n=(0,i.g$)(e),a=(0,i.W8)(t),o=(0,i.g$)(t);function s(e,t){var s=(0,i.W8)(t),l=(0,i.W8)(e)*s,A=(0,i.g$)(e)*s,c=(0,i.g$)(t),u=c*r+l*n;return[(0,i.WE)(A*a-u*o,l*r-c*n),(0,i.qR)(u*a+A*o)]}return s.invert=function(e,t){var s=(0,i.W8)(t),l=(0,i.W8)(e)*s,A=(0,i.g$)(e)*s,c=(0,i.g$)(t),u=c*a-A*o;return[(0,i.WE)(A*a+c*o,l*r+u*n),(0,i.qR)(u*r-l*n)]},s}function c(e){function t(t){return(t=e(t[0]*i.qw,t[1]*i.qw))[0]*=i.oh,t[1]*=i.oh,t}return e=o(e[0]*i.qw,e[1]*i.qw,e.length>2?e[2]*i.qw:0),t.invert=function(t){return(t=e.invert(t[0]*i.qw,t[1]*i.qw))[0]*=i.oh,t[1]*=i.oh,t},t}a.invert=a},16016:function(e,t,r){"use strict";function n(e,t){e&&a.hasOwnProperty(e.type)&&a[e.type](e,t)}r.d(t,{c:function(){return l}});var i={Feature:function(e,t){n(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,i=-1,a=r.length;++i=0;)t+=r[n].value;else t=1;e.value=t}function l(e,t){var r,n,i,a,o,s=new g(e),l=+e.value&&(s.value=e.value),c=[s];for(null==t&&(t=A);r=c.pop();)if(l&&(r.value=+r.data.value),(i=t(r.data))&&(o=i.length))for(r.children=new Array(o),a=o-1;a>=0;--a)c.push(n=r.children[a]=new g(i[a])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(u)}function A(e){return e.children}function c(e){e.data=e.data.data}function u(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function g(e){this.data=e,this.depth=this.height=0,this.parent=null}r.r(t),r.d(t,{cluster:function(){return o},hierarchy:function(){return l},pack:function(){return T},packEnclose:function(){return h},packSiblings:function(){return Q},partition:function(){return O},stratify:function(){return H},tree:function(){return Z},treemap:function(){return re},treemapBinary:function(){return ne},treemapDice:function(){return F},treemapResquarify:function(){return ae},treemapSlice:function(){return X},treemapSliceDice:function(){return ie},treemapSquarify:function(){return te}}),g.prototype=l.prototype={constructor:g,count:function(){return this.eachAfter(s)},each:function(e){var t,r,n,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return l(this).eachBefore(c)}};var f=Array.prototype.slice;function h(e){for(var t,r,n=0,i=(e=function(e){for(var t,r,n=e.length;n;)r=Math.random()*n--|0,t=e[n],e[n]=e[r],e[r]=t;return e}(f.call(e))).length,a=[];n0&&r*r>n*n+i*i}function m(e,t){for(var r=0;r(o*=o)?(n=(A+o-i)/(2*A),a=Math.sqrt(Math.max(0,o/A-n*n)),r.x=e.x-n*s-a*l,r.y=e.y-n*l+a*s):(n=(A+i-o)/(2*A),a=Math.sqrt(Math.max(0,i/A-n*n)),r.x=t.x+n*s-a*l,r.y=t.y+n*l+a*s)):(r.x=t.x+r.r,r.y=t.y)}function B(e,t){var r=e.r+t.r-1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function b(e){var t=e._,r=e.next._,n=t.r+r.r,i=(t.x*r.r+r.x*t.r)/n,a=(t.y*r.r+r.y*t.r)/n;return i*i+a*a}function x(e){this._=e,this.next=null,this.previous=null}function w(e){if(!(i=e.length))return 0;var t,r,n,i,a,o,s,l,A,c,u;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(i>2))return t.r+r.r;C(r,t,n=e[2]),t=new x(t),r=new x(r),n=new x(n),t.next=n.previous=r,r.next=t.previous=n,n.next=r.previous=t;e:for(s=3;s0)throw new Error("cycle");return a}return r.id=function(t){return arguments.length?(e=_(t),r):e},r.parentId=function(e){return arguments.length?(t=_(e),r):t},r}function Y(e,t){return e.parent===t.parent?1:2}function J(e){var t=e.children;return t?t[0]:e.t}function K(e){var t=e.children;return t?t[t.length-1]:e.t}function j(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function V(e,t,r){return e.a.parent===t.parent?e.a:r}function W(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function Z(){var e=Y,t=1,r=1,n=null;function i(i){var l=function(e){for(var t,r,n,i,a,o=new W(e,0),s=[o];t=s.pop();)if(n=t._.children)for(t.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=t.children[i]=new W(n[i],i)),r.parent=t;return(o.parent=new W(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var A=i,c=i,u=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>u.depth&&(u=e)}));var g=A===c?1:e(A,c)/2,f=g-A.x,h=t/(c.x+g+f),d=r/(u.depth||1);i.eachBefore((function(e){e.x=(e.x+f)*h,e.y=e.depth*d}))}return i}function a(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],A=a.m,c=o.m,u=s.m,g=l.m;s=K(s),a=J(a),s&&a;)l=J(l),(o=K(o)).a=t,(i=s.z+u-a.z-A+e(s._,a._))>0&&(j(V(s,t,n),t,i),A+=i,c+=i),u+=s.m,A+=a.m,g+=l.m,c+=o.m;s&&!K(o)&&(o.t=s,o.m+=u-c),a&&!J(l)&&(l.t=a,l.m+=A-g,n=t)}return n}(t,i,t.parent.A||n[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],i):n?null:[t,r]},i.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],i):n?[t,r]:null},i}function X(e,t,r,n,i){for(var a,o=e.children,s=-1,l=o.length,A=e.value&&(i-r)/e.value;++sg&&(g=s),p=c*c*d,(f=Math.max(g/p,p/u))>h){c-=s;break}h=f}y.push(o={value:c,dice:l1?t:1)},r}($);function re(){var e=te,t=!1,r=1,n=1,i=[0],a=S,o=S,s=S,l=S,A=S;function c(e){return e.x0=e.y0=0,e.x1=r,e.y1=n,e.eachBefore(u),i=[0],t&&e.eachBefore(N),e}function u(t){var r=i[t.depth],n=t.x0+r,c=t.y0+r,u=t.x1-r,g=t.y1-r;u=r-1){var c=s[t];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=l)}for(var u=A[t],g=n/2+u,f=t+1,h=r-1;f>>1;A[d]l-a){var m=(i*y+o*p)/n;e(t,f,p,i,a,m,l),e(f,r,y,m,a,o,l)}else{var I=(a*y+l*p)/n;e(t,f,p,i,a,o,I),e(f,r,y,i,I,o,l)}}(0,l,e.value,t,r,n,i)}function ie(e,t,r,n,i){(1&e.depth?X:F)(e,t,r,n,i)}var ae=function e(t){function r(e,r,n,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,l,A,c,u=-1,g=o.length,f=e.value;++u1?t:1)},r}($)},10132:function(e,t,r){"use strict";r.d(t,{ak:function(){return m}});var n=Math.PI,i=2*n,a=1e-6,o=i-a;function s(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function l(){return new s}s.prototype=l.prototype={constructor:s,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,i,a){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,r,i,o){e=+e,t=+t,r=+r,i=+i,o=+o;var s=this._x1,l=this._y1,A=r-e,c=i-t,u=s-e,g=l-t,f=u*u+g*g;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(f>a)if(Math.abs(g*A-c*u)>a&&o){var h=r-s,d=i-l,p=A*A+c*c,y=h*h+d*d,m=Math.sqrt(p),I=Math.sqrt(f),v=o*Math.tan((n-Math.acos((p+f-y)/(2*m*I)))/2),E=v/I,C=v/m;Math.abs(E-1)>a&&(this._+="L"+(e+E*u)+","+(t+E*g)),this._+="A"+o+","+o+",0,0,"+ +(g*h>u*d)+","+(this._x1=e+C*A)+","+(this._y1=t+C*c)}else this._+="L"+(this._x1=e)+","+(this._y1=t)},arc:function(e,t,r,s,l,A){e=+e,t=+t,A=!!A;var c=(r=+r)*Math.cos(s),u=r*Math.sin(s),g=e+c,f=t+u,h=1^A,d=A?s-l:l-s;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+g+","+f:(Math.abs(this._x1-g)>a||Math.abs(this._y1-f)>a)&&(this._+="L"+g+","+f),r&&(d<0&&(d=d%i+i),d>o?this._+="A"+r+","+r+",0,1,"+h+","+(e-c)+","+(t-u)+"A"+r+","+r+",0,1,"+h+","+(this._x1=g)+","+(this._y1=f):d>a&&(this._+="A"+r+","+r+",0,"+ +(d>=n)+","+h+","+(this._x1=e+r*Math.cos(l))+","+(this._y1=t+r*Math.sin(l))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};var A=l,c=Array.prototype.slice;function u(e){return function(){return e}}function g(e){return e[0]}function f(e){return e[1]}function h(e){return e.source}function d(e){return e.target}function p(e){var t=h,r=d,n=g,i=f,a=null;function o(){var o,s=c.call(arguments),l=t.apply(this,s),u=r.apply(this,s);if(a||(a=o=A()),e(a,+n.apply(this,(s[0]=l,s)),+i.apply(this,s),+n.apply(this,(s[0]=u,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(r=e,o):r},o.x=function(e){return arguments.length?(n="function"===typeof e?e:u(+e),o):n},o.y=function(e){return arguments.length?(i="function"===typeof e?e:u(+e),o):i},o.context=function(e){return arguments.length?(a=null==e?null:e,o):a},o}function y(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function m(){return p(y)}},94336:function(e,t,r){"use strict";r.d(t,{Yn:function(){return h},m_:function(){return g},E9:function(){return d}});var n=r(8208),i=r(58931),a=r(46192),o=r(68936),s=r(32171),l=r(53528);function A(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function c(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function u(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function g(e){var t=e.dateTime,r=e.date,s=e.time,l=e.periods,g=e.days,f=e.shortDays,h=e.months,d=e.shortMonths,y=C(l),m=B(l),I=C(g),v=B(g),E=C(f),Qe=B(f),_e=C(h),Se=B(h),ke=C(d),De=B(d),Te={a:function(e){return f[e.getDay()]},A:function(e){return g[e.getDay()]},b:function(e){return d[e.getMonth()]},B:function(e){return h[e.getMonth()]},c:null,d:H,e:H,f:V,H:Y,I:J,j:K,L:j,m:W,M:Z,p:function(e){return l[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:xe,s:we,S:X,u:$,U:ee,V:te,w:re,W:ne,x:null,X:null,y:ie,Y:ae,Z:oe,"%":be},Me={a:function(e){return f[e.getUTCDay()]},A:function(e){return g[e.getUTCDay()]},b:function(e){return d[e.getUTCMonth()]},B:function(e){return h[e.getUTCMonth()]},c:null,d:se,e:se,f:ge,H:le,I:Ae,j:ce,L:ue,m:fe,M:he,p:function(e){return l[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:xe,s:we,S:de,u:pe,U:ye,V:me,w:Ie,W:ve,x:null,X:null,y:Ee,Y:Ce,Z:Be,"%":be},Re={a:function(e,t,r){var n=E.exec(t.slice(r));return n?(e.w=Qe[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=I.exec(t.slice(r));return n?(e.w=v[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=ke.exec(t.slice(r));return n?(e.m=De[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=_e.exec(t.slice(r));return n?(e.m=Se[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,r,n){return Fe(e,t,r,n)},d:R,e:R,f:G,H:N,I:N,j:L,L:P,m:M,M:F,p:function(e,t,r){var n=y.exec(t.slice(r));return n?(e.p=m[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:q,S:O,u:x,U:w,V:Q,w:b,W:_,x:function(e,t,n){return Fe(e,r,t,n)},X:function(e,t,r){return Fe(e,s,t,r)},y:k,Y:S,Z:D,"%":U};function Le(e,t){return function(r){var n,i,a,o=[],s=-1,l=0,A=e.length;for(r instanceof Date||(r=new Date(+r));++s53)return null;"w"in g||(g.w=1),"Z"in g?(l=(s=c(u(g.y,0,1))).getUTCDay(),s=l>4||0===l?n.ot.ceil(s):(0,n.ot)(s),s=i.c.offset(s,7*(g.V-1)),g.y=s.getUTCFullYear(),g.m=s.getUTCMonth(),g.d=s.getUTCDate()+(g.w+6)%7):(l=(s=A(u(g.y,0,1))).getDay(),s=l>4||0===l?a.qT.ceil(s):(0,a.qT)(s),s=o.c.offset(s,7*(g.V-1)),g.y=s.getFullYear(),g.m=s.getMonth(),g.d=s.getDate()+(g.w+6)%7)}else("W"in g||"U"in g)&&("w"in g||(g.w="u"in g?g.u%7:"W"in g?1:0),l="Z"in g?c(u(g.y,0,1)).getUTCDay():A(u(g.y,0,1)).getDay(),g.m=0,g.d="W"in g?(g.w+6)%7+7*g.W-(l+5)%7:g.w+7*g.U-(l+6)%7);return"Z"in g?(g.H+=g.Z/100|0,g.M+=g.Z%100,c(g)):A(g)}}function Fe(e,t,r,n){for(var i,a,o=0,s=t.length,l=r.length;o=l)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=Re[i in p?t.charAt(o++):i])||(n=a(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Te.x=Le(r,Te),Te.X=Le(s,Te),Te.c=Le(t,Te),Me.x=Le(r,Me),Me.X=Le(s,Me),Me.c=Le(t,Me),{format:function(e){var t=Le(e+="",Te);return t.toString=function(){return e},t},parse:function(e){var t=Ne(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Le(e+="",Me);return t.toString=function(){return e},t},utcParse:function(e){var t=Ne(e+="",!0);return t.toString=function(){return e},t}}}var f,h,d,p={"-":"",_:" ",0:"0"},y=/^\s*\d+/,m=/^%/,I=/[\\^$*+?|[\]().{}]/g;function v(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function D(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(e,t,r){var n=y.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function M(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function R(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function L(e,t,r){var n=y.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function N(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function F(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function O(e,t,r){var n=y.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function P(e,t,r){var n=y.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function G(e,t,r){var n=y.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function U(e,t,r){var n=m.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function z(e,t,r){var n=y.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function q(e,t,r){var n=y.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function H(e,t){return v(e.getDate(),t,2)}function Y(e,t){return v(e.getHours(),t,2)}function J(e,t){return v(e.getHours()%12||12,t,2)}function K(e,t){return v(1+o.c.count((0,s.c)(e),e),t,3)}function j(e,t){return v(e.getMilliseconds(),t,3)}function V(e,t){return j(e,t)+"000"}function W(e,t){return v(e.getMonth()+1,t,2)}function Z(e,t){return v(e.getMinutes(),t,2)}function X(e,t){return v(e.getSeconds(),t,2)}function $(e){var t=e.getDay();return 0===t?7:t}function ee(e,t){return v(a.uU.count((0,s.c)(e)-1,e),t,2)}function te(e,t){var r=e.getDay();return e=r>=4||0===r?(0,a.kD)(e):a.kD.ceil(e),v(a.kD.count((0,s.c)(e),e)+(4===(0,s.c)(e).getDay()),t,2)}function re(e){return e.getDay()}function ne(e,t){return v(a.qT.count((0,s.c)(e)-1,e),t,2)}function ie(e,t){return v(e.getFullYear()%100,t,2)}function ae(e,t){return v(e.getFullYear()%1e4,t,4)}function oe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+v(t/60|0,"0",2)+v(t%60,"0",2)}function se(e,t){return v(e.getUTCDate(),t,2)}function le(e,t){return v(e.getUTCHours(),t,2)}function Ae(e,t){return v(e.getUTCHours()%12||12,t,2)}function ce(e,t){return v(1+i.c.count((0,l.c)(e),e),t,3)}function ue(e,t){return v(e.getUTCMilliseconds(),t,3)}function ge(e,t){return ue(e,t)+"000"}function fe(e,t){return v(e.getUTCMonth()+1,t,2)}function he(e,t){return v(e.getUTCMinutes(),t,2)}function de(e,t){return v(e.getUTCSeconds(),t,2)}function pe(e){var t=e.getUTCDay();return 0===t?7:t}function ye(e,t){return v(n.EV.count((0,l.c)(e)-1,e),t,2)}function me(e,t){var r=e.getUTCDay();return e=r>=4||0===r?(0,n.yA)(e):n.yA.ceil(e),v(n.yA.count((0,l.c)(e),e)+(4===(0,l.c)(e).getUTCDay()),t,2)}function Ie(e){return e.getUTCDay()}function ve(e,t){return v(n.ot.count((0,l.c)(e)-1,e),t,2)}function Ee(e,t){return v(e.getUTCFullYear()%100,t,2)}function Ce(e,t){return v(e.getUTCFullYear()%1e4,t,4)}function Be(){return"+0000"}function be(){return"%"}function xe(e){return+e}function we(e){return Math.floor(+e/1e3)}f=g({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]}),h=f.format,f.parse,d=f.utcFormat,f.utcParse},68936:function(e,t,r){"use strict";r.d(t,{m:function(){return o}});var n=r(81628),i=r(69792),a=(0,n.c)((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.iy)/i.SK}),(function(e){return e.getDate()-1}));t.c=a;var o=a.range},69792:function(e,t,r){"use strict";r.d(t,{KK:function(){return s},SK:function(){return o},cg:function(){return a},iy:function(){return i},yc:function(){return n}});var n=1e3,i=6e4,a=36e5,o=864e5,s=6048e5},73220:function(e,t,r){"use strict";r.r(t),r.d(t,{timeDay:function(){return y.c},timeDays:function(){return y.m},timeFriday:function(){return m.iB},timeFridays:function(){return m.sJ},timeHour:function(){return d},timeHours:function(){return p},timeInterval:function(){return n.c},timeMillisecond:function(){return a},timeMilliseconds:function(){return o},timeMinute:function(){return g},timeMinutes:function(){return f},timeMonday:function(){return m.qT},timeMondays:function(){return m.QP},timeMonth:function(){return v},timeMonths:function(){return E},timeSaturday:function(){return m.Wc},timeSaturdays:function(){return m.aI},timeSecond:function(){return A},timeSeconds:function(){return c},timeSunday:function(){return m.uU},timeSundays:function(){return m.Ab},timeThursday:function(){return m.kD},timeThursdays:function(){return m.eC},timeTuesday:function(){return m.Mf},timeTuesdays:function(){return m.Oc},timeWednesday:function(){return m.eg},timeWednesdays:function(){return m.sn},timeWeek:function(){return m.uU},timeWeeks:function(){return m.Ab},timeYear:function(){return C.c},timeYears:function(){return C.Q},utcDay:function(){return S.c},utcDays:function(){return S.o},utcFriday:function(){return k.od},utcFridays:function(){return k.iG},utcHour:function(){return Q},utcHours:function(){return _},utcMillisecond:function(){return a},utcMilliseconds:function(){return o},utcMinute:function(){return b},utcMinutes:function(){return x},utcMonday:function(){return k.ot},utcMondays:function(){return k.iO},utcMonth:function(){return T},utcMonths:function(){return M},utcSaturday:function(){return k.Ad},utcSaturdays:function(){return k.K8},utcSecond:function(){return A},utcSeconds:function(){return c},utcSunday:function(){return k.EV},utcSundays:function(){return k.Wq},utcThursday:function(){return k.yA},utcThursdays:function(){return k.ob},utcTuesday:function(){return k.sG},utcTuesdays:function(){return k.kl},utcWednesday:function(){return k._6},utcWednesdays:function(){return k.W_},utcWeek:function(){return k.EV},utcWeeks:function(){return k.Wq},utcYear:function(){return R.c},utcYears:function(){return R.i}});var n=r(81628),i=(0,n.c)((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?(0,n.c)((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):i:null};var a=i,o=i.range,s=r(69792),l=(0,n.c)((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*s.yc)}),(function(e,t){return(t-e)/s.yc}),(function(e){return e.getUTCSeconds()})),A=l,c=l.range,u=(0,n.c)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*s.yc)}),(function(e,t){e.setTime(+e+t*s.iy)}),(function(e,t){return(t-e)/s.iy}),(function(e){return e.getMinutes()})),g=u,f=u.range,h=(0,n.c)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*s.yc-e.getMinutes()*s.iy)}),(function(e,t){e.setTime(+e+t*s.cg)}),(function(e,t){return(t-e)/s.cg}),(function(e){return e.getHours()})),d=h,p=h.range,y=r(68936),m=r(46192),I=(0,n.c)((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),v=I,E=I.range,C=r(32171),B=(0,n.c)((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*s.iy)}),(function(e,t){return(t-e)/s.iy}),(function(e){return e.getUTCMinutes()})),b=B,x=B.range,w=(0,n.c)((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*s.cg)}),(function(e,t){return(t-e)/s.cg}),(function(e){return e.getUTCHours()})),Q=w,_=w.range,S=r(58931),k=r(8208),D=(0,n.c)((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),T=D,M=D.range,R=r(53528)},81628:function(e,t,r){"use strict";r.d(t,{c:function(){return a}});var n=new Date,i=new Date;function a(e,t,r,o){function s(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return s.floor=function(t){return e(t=new Date(+t)),t},s.ceil=function(r){return e(r=new Date(r-1)),t(r,1),e(r),r},s.round=function(e){var t=s(e),r=s.ceil(e);return e-t0))return o;do{o.push(a=new Date(+r)),t(r,i),e(r)}while(a=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}))},r&&(s.count=function(t,a){return n.setTime(+t),i.setTime(+a),e(n),e(i),Math.floor(r(n,i))},s.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?s.filter(o?function(t){return o(t)%e===0}:function(t){return s.count(0,t)%e===0}):s:null}),s}},58931:function(e,t,r){"use strict";r.d(t,{o:function(){return o}});var n=r(81628),i=r(69792),a=(0,n.c)((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/i.SK}),(function(e){return e.getUTCDate()-1}));t.c=a;var o=a.range},8208:function(e,t,r){"use strict";r.d(t,{Ad:function(){return g},EV:function(){return o},K8:function(){return I},W_:function(){return p},Wq:function(){return f},_6:function(){return A},iG:function(){return m},iO:function(){return h},kl:function(){return d},ob:function(){return y},od:function(){return u},ot:function(){return s},sG:function(){return l},yA:function(){return c}});var n=r(81628),i=r(69792);function a(e){return(0,n.c)((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/i.KK}))}var o=a(0),s=a(1),l=a(2),A=a(3),c=a(4),u=a(5),g=a(6),f=o.range,h=s.range,d=l.range,p=A.range,y=c.range,m=u.range,I=g.range},53528:function(e,t,r){"use strict";r.d(t,{i:function(){return a}});var n=r(81628),i=(0,n.c)((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?(0,n.c)((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null},t.c=i;var a=i.range},46192:function(e,t,r){"use strict";r.d(t,{Ab:function(){return f},Mf:function(){return l},Oc:function(){return d},QP:function(){return h},Wc:function(){return g},aI:function(){return I},eC:function(){return y},eg:function(){return A},iB:function(){return u},kD:function(){return c},qT:function(){return s},sJ:function(){return m},sn:function(){return p},uU:function(){return o}});var n=r(81628),i=r(69792);function a(e){return(0,n.c)((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.iy)/i.KK}))}var o=a(0),s=a(1),l=a(2),A=a(3),c=a(4),u=a(5),g=a(6),f=o.range,h=s.range,d=l.range,p=A.range,y=c.range,m=u.range,I=g.range},32171:function(e,t,r){"use strict";r.d(t,{Q:function(){return a}});var n=r(81628),i=(0,n.c)((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?(0,n.c)((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null},t.c=i;var a=i.range},64348:function(e,t,r){"use strict";var n=r(39640)(),i=r(53664),a=n&&i("%Object.defineProperty%",!0);if(a)try{a({},"a",{value:1})}catch(A){a=!1}var o=i("%SyntaxError%"),s=i("%TypeError%"),l=r(2304);e.exports=function(e,t,r){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new s("`obj` must be an object or a function`");if("string"!==typeof t&&"symbol"!==typeof t)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,A=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],u=!!l&&l(e,t);if(a)a(e,t,{configurable:null===A&&u?u.configurable:!A,enumerable:null===n&&u?u.enumerable:!n,value:r,writable:null===i&&u?u.writable:!i});else{if(!c&&(n||i||A))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},81288:function(e,t,r){"use strict";var n=r(41820),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),a=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,l=r(39640)(),A=s&&l,c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!==typeof(i=n)||"[object Function]"!==a.call(i)||!n())return;var i;A?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r},u=function(e,t){var r=arguments.length>2?arguments[2]:{},a=n(t);i&&(a=o.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;ss*l){var f=(g-u)/s;o[c]=1e3*f}}return o}function i(e){for(var t=[],r=e[0];r<=e[1];r++)for(var n=String.fromCharCode(r),i=e[0];i0)return function(e,t){var r,n;for(r=new Array(e),n=0;n80*a){o=l=e[0],s=u=e[1];for(var v=a;vl&&(l=g),h>u&&(u=h);d=0!==(d=Math.max(l-o,u-s))?1/d:0}return i(m,I,a,o,s,d),I}function r(e,t,r,n,i){var a,o;if(i===w(e,t,r,n)>0)for(a=t;a=t;a-=n)o=B(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(b(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!y(n,n.next)&&0!==p(n.prev,n,n.next))n=n.next;else{if(b(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function i(e,t,r,A,c,u,f){if(e){!f&&u&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=g(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,A=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,A*=2}while(o>1)}(i)}(e,A,c,u);for(var h,d,p=e;e.prev!==e.next;)if(h=e.prev,d=e.next,u?o(e,A,c,u):a(e))t.push(h.i/r),t.push(e.i/r),t.push(d.i/r),b(e),e=d.next,p=d.next;else if((e=d)===p){f?1===f?i(e=s(n(e),t,r),t,r,A,c,u,2):2===f&&l(e,t,r,A,c,u):i(n(e),t,r,A,c,u,1);break}}}function a(e){var t=e.prev,r=e,n=e.next;if(p(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(h(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&p(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function o(e,t,r,n){var i=e.prev,a=e,o=e.next;if(p(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,u=g(s,l,t,r,n),f=g(A,c,t,r,n),d=e.prevZ,y=e.nextZ;d&&d.z>=u&&y&&y.z<=f;){if(d!==e.prev&&d!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&p(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,y!==e.prev&&y!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&p(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;d&&d.z>=u;){if(d!==e.prev&&d!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&p(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;y&&y.z<=f;){if(y!==e.prev&&y!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&p(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function s(e,t,r){var i=e;do{var a=i.prev,o=i.next.next;!y(a,o)&&m(a,i,i.next,o)&&E(a,o)&&E(o,a)&&(t.push(a.i/r),t.push(i.i/r),t.push(o.i/r),b(i),b(i.next),i=e=o),i=i.next}while(i!==e);return n(i)}function l(e,t,r,a,o,s){var l=e;do{for(var A=l.next.next;A!==l.prev;){if(l.i!==A.i&&d(l,A)){var c=C(l,A);return l=n(l,l.next),c=n(c,c.next),i(l,t,r,a,o,s),void i(c,t,r,a,o,s)}A=A.next}l=l.next}while(l!==e)}function A(e,t){return e.x-t.x}function c(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&h(ar.x||n.x===r.x&&u(r,n)))&&(r=n,f=l)),n=n.next}while(n!==A);return r}(e,t),t){var r=C(t,e);n(t,t.next),n(r,r.next)}}function u(e,t){return p(e.prev,e,t.prev)<0&&p(t.next,e,e.next)<0}function g(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function f(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function d(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&m(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(E(e,t)&&E(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(p(e.prev,e,t.prev)||p(e,t.prev,t))||y(e,t)&&p(e.prev,e,e.next)>0&&p(t.prev,t,t.next)>0)}function p(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function m(e,t,r,n){var i=v(p(e,t,r)),a=v(p(e,t,n)),o=v(p(r,n,e)),s=v(p(r,n,t));return i!==a&&o!==s||!(0!==i||!I(e,r,t))||!(0!==a||!I(e,n,t))||!(0!==o||!I(r,e,n))||!(0!==s||!I(r,t,n))}function I(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function v(e){return e>0?1:e<0?-1:0}function E(e,t){return p(e.prev,e,e.next)<0?p(e,t,e.next)>=0&&p(e,e.prev,t)>=0:p(e,t,e.prev)<0||p(e,e.next,t)<0}function C(e,t){var r=new x(e.i,e.x,e.y),n=new x(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function B(e,t,r,n){var i=new x(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function b(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function x(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function w(e,t,r,n){for(var i=0,a=t,o=r-n;a0&&(n+=e[i-1].length,r.holes.push(n))}return r}},6688:function(e,t,r){var n=r(78484);e.exports=function(e,t){var r,i=[],a=[],o=[],s={},l=[];function A(e){o[e]=!1,s.hasOwnProperty(e)&&Object.keys(s[e]).forEach((function(t){delete s[e][t],o[t]&&A(t)}))}function c(e){var t,n,i=!1;for(a.push(e),o[e]=!0,t=0;t=t}))}(t);for(var r,i=n(e).components.filter((function(e){return e.length>1})),a=1/0,o=0;o=55296&&m<=56319&&(C+=e[++r]),C=B?g.call(B,b,C,d):C,t?(f.value=C,h(p,d,f)):p[d]=C,++d;y=d}if(void 0===y)for(y=o(e.length),t&&(p=new t(y)),r=0;r0?1:-1}},96936:function(e,t,r){"use strict";var n=r(85608),i=Math.abs,a=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?n(e)*a(i(e)):e}},81304:function(e,t,r){"use strict";var n=r(96936),i=Math.max;e.exports=function(e){return i(0,n(e))}},14428:function(e,t,r){"use strict";var n=r(34044),i=r(9252),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(r,A){var c,u=arguments[2],g=arguments[3];return r=Object(i(r)),n(A),c=s(r),g&&c.sort("function"===typeof g?a.call(g,r):void 0),"function"!==typeof e&&(e=c[e]),o.call(e,c,(function(e,n){return l.call(r,e)?o.call(A,u,r[e],e,r,n):t}))}}},38452:function(e,t,r){"use strict";e.exports=r(96276)()?Object.assign:r(81892)},96276:function(e){"use strict";e.exports=function(){var e,t=Object.assign;return"function"===typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},81892:function(e,t,r){"use strict";var n=r(54768),i=r(9252),a=Math.max;e.exports=function(e,t){var r,o,s,l=a(arguments.length,2);for(e=Object(i(e)),s=function(n){try{e[n]=t[n]}catch(i){r||(r=i)}},o=1;o-1}},29768:function(e){"use strict";var t=Object.prototype.toString,r=t.call("");e.exports=function(e){return"string"===typeof e||e&&"object"===typeof e&&(e instanceof String||t.call(e)===r)||!1}},82252:function(e){"use strict";var t=Object.create(null),r=Math.random;e.exports=function(){var e;do{e=r().toString(36).slice(2)}while(t[e]);return e}},52104:function(e,t,r){"use strict";var n,i=r(69932),a=r(71056),o=r(21092),s=r(92664),l=r(85512),A=Object.defineProperty;n=e.exports=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,e),t=t?a.call(t,"key+value")?"key+value":a.call(t,"key")?"key":"value":"value",A(this,"__kind__",o("",t))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),A(n.prototype,s.toStringTag,o("c","Array Iterator"))},76024:function(e,t,r){"use strict";var n=r(60948),i=r(34044),a=r(29768),o=r(76252),s=Array.isArray,l=Function.prototype.call,A=Array.prototype.some;e.exports=function(e,t){var r,c,u,g,f,h,d,p,y=arguments[2];if(s(e)||n(e)?r="array":a(e)?r="string":e=o(e),i(t),u=function(){g=!0},"array"!==r)if("string"!==r)for(c=e.next();!c.done;){if(l.call(t,y,c.value,u),g)return;c=e.next()}else for(h=e.length,f=0;f=55296&&p<=56319&&(d+=e[++f]),l.call(t,y,d,u),!g);++f);else A.call(e,(function(e){return l.call(t,y,e,u),g}))}},76252:function(e,t,r){"use strict";var n=r(60948),i=r(29768),a=r(52104),o=r(80940),s=r(52891),l=r(92664).iterator;e.exports=function(e){return"function"===typeof s(e)[l]?e[l]():n(e)?new a(e):i(e)?new o(e):new a(e)}},85512:function(e,t,r){"use strict";var n,i=r(41476),a=r(38452),o=r(34044),s=r(9252),l=r(21092),A=r(27940),c=r(92664),u=Object.defineProperty,g=Object.defineProperties;e.exports=n=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");g(this,{__list__:l("w",s(e)),__context__:l("w",t),__nextIndex__:l("w",0)}),t&&(o(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete n.prototype.constructor,g(n.prototype,a({_next:l((function(){var e;if(this.__list__)return this.__redo__&&void 0!==(e=this.__redo__.shift())?e:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,r){t>=e&&(this.__redo__[r]=++t)}),this),this.__redo__.push(e)):u(this,"__redo__",l("c",[e])))})),_onDelete:l((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,r){t>e&&(this.__redo__[r]=--t)}),this)))})),_onClear:l((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),u(n.prototype,c.iterator,l((function(){return this})))},76368:function(e,t,r){"use strict";var n=r(60948),i=r(42584),a=r(29768),o=r(92664).iterator,s=Array.isArray;e.exports=function(e){return!!i(e)&&(!!s(e)||!!a(e)||!!n(e)||"function"===typeof e[o])}},80940:function(e,t,r){"use strict";var n,i=r(69932),a=r(21092),o=r(92664),s=r(85512),l=Object.defineProperty;n=e.exports=function(e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");e=String(e),s.call(this,e),l(this,"__length__",a("",e.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:a((function(){if(this.__list__)return this.__nextIndex__=55296&&t<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,a("c","String Iterator"))},52891:function(e,t,r){"use strict";var n=r(76368);e.exports=function(e){if(!n(e))throw new TypeError(e+" is not iterable");return e}},60964:function(e){"use strict";function t(e,t){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,A=c,console&&console.warn&&console.warn(A)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function g(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"===typeof l)n(l,this,t);else{var A=l.length,c=h(l,A);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return g(this,e,!0)},a.prototype.rawListeners=function(e){return g(this,e,!1)},a.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},39072:function(e){var t=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},12296:function(e,t,r){"use strict";e.exports=r(45072)()?globalThis:r(39072)},45072:function(e){"use strict";e.exports=function(){return"object"===typeof globalThis&&!!globalThis&&globalThis.Array===Array}},38248:function(e,t,r){"use strict";var n=r(94576);e.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0===(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},47520:function(e,t,r){var n=r(72512);e.exports=function(e,t,r){if(!e)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(e)&&e[0]&&"number"===typeof e[0][0]){var i,a,o,s,l=e[0].length,A=e.length*l;t&&"string"!==typeof t||(t=new(n(t||"float32"))(A+r));var c=t.length-r;if(A!==c)throw new Error("source length "+A+" ("+l+"x"+e.length+") does not match destination length "+c);for(i=0,o=r;it[0]-o[0]/2&&(g=o[0]/2,f+=o[1]);return r}},71920:function(e){"use strict";function t(e,a){a||(a={}),("string"===typeof e||Array.isArray(e))&&(a.family=e);var o=Array.isArray(a.family)?a.family.join(", "):a.family;if(!o)throw Error("`family` must be defined");var s=a.size||a.fontSize||a.em||48,l=a.weight||a.fontWeight||"",A=(e=[a.style||a.fontStyle||"",l,s].join(" ")+"px "+o,a.origin||"top");if(t.cache[o]&&s<=t.cache[o].em)return r(t.cache[o],A);var c=a.canvas||t.canvas,u=c.getContext("2d"),g={upper:void 0!==a.upper?a.upper:"H",lower:void 0!==a.lower?a.lower:"x",descent:void 0!==a.descent?a.descent:"p",ascent:void 0!==a.ascent?a.ascent:"h",tittle:void 0!==a.tittle?a.tittle:"i",overshoot:void 0!==a.overshoot?a.overshoot:"O"},f=Math.ceil(1.5*s);c.height=f,c.width=.5*f,u.font=e;var h="H",d={top:0};u.clearRect(0,0,f,f),u.textBaseline="top",u.fillStyle="black",u.fillText(h,0,0);var p=n(u.getImageData(0,0,f,f));u.clearRect(0,0,f,f),u.textBaseline="bottom",u.fillText(h,0,f);var y=n(u.getImageData(0,0,f,f));d.lineHeight=d.bottom=f-y+p,u.clearRect(0,0,f,f),u.textBaseline="alphabetic",u.fillText(h,0,f);var m=f-n(u.getImageData(0,0,f,f))-1+p;d.baseline=d.alphabetic=m,u.clearRect(0,0,f,f),u.textBaseline="middle",u.fillText(h,0,.5*f);var I=n(u.getImageData(0,0,f,f));d.median=d.middle=f-I-1+p-.5*f,u.clearRect(0,0,f,f),u.textBaseline="hanging",u.fillText(h,0,.5*f);var v=n(u.getImageData(0,0,f,f));d.hanging=f-v-1+p-.5*f,u.clearRect(0,0,f,f),u.textBaseline="ideographic",u.fillText(h,0,f);var E=n(u.getImageData(0,0,f,f));if(d.ideographic=f-E-1+p,g.upper&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.upper,0,0),d.upper=n(u.getImageData(0,0,f,f)),d.capHeight=d.baseline-d.upper),g.lower&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.lower,0,0),d.lower=n(u.getImageData(0,0,f,f)),d.xHeight=d.baseline-d.lower),g.tittle&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.tittle,0,0),d.tittle=n(u.getImageData(0,0,f,f))),g.ascent&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.ascent,0,0),d.ascent=n(u.getImageData(0,0,f,f))),g.descent&&(u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.descent,0,0),d.descent=i(u.getImageData(0,0,f,f))),g.overshoot){u.clearRect(0,0,f,f),u.textBaseline="top",u.fillText(g.overshoot,0,0);var C=i(u.getImageData(0,0,f,f));d.overshoot=C-m}for(var B in d)d[B]/=s;return d.em=s,t.cache[o]=d,r(d,A)}function r(e,t){var r={};for(var n in"string"===typeof t&&(t=e[t]),e)"em"!==n&&(r[n]=e[n]-t);return r}function n(e){for(var t=e.height,r=e.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}e.exports=t,t.canvas=document.createElement("canvas"),t.cache={}},46492:function(e,t,r){"use strict";var n=r(90720),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n1&&"boolean"!==typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===w(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=x(e,0,1),r=x(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return b(e,Q,(function(e,t,r,i){n[n.length]=r?b(i,_,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",a=S("%"+n+"%",t),s=a.name,A=a.value,c=!1,u=a.alias;u&&(n=u[0],B(r,C([0,1],u)));for(var g=1,f=!0;g=r.length){var m=l(A,h);A=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:A[h]}else f=E(A,h),A=A[h];f&&!c&&(p[s]=A)}}return A}},12408:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],A=t[7],c=t[8],u=t[9],g=t[10],f=t[11],h=t[12],d=t[13],p=t[14],y=t[15];return e[0]=s*(g*y-f*p)-u*(l*y-A*p)+d*(l*f-A*g),e[1]=-(n*(g*y-f*p)-u*(i*y-a*p)+d*(i*f-a*g)),e[2]=n*(l*y-A*p)-s*(i*y-a*p)+d*(i*A-a*l),e[3]=-(n*(l*f-A*g)-s*(i*f-a*g)+u*(i*A-a*l)),e[4]=-(o*(g*y-f*p)-c*(l*y-A*p)+h*(l*f-A*g)),e[5]=r*(g*y-f*p)-c*(i*y-a*p)+h*(i*f-a*g),e[6]=-(r*(l*y-A*p)-o*(i*y-a*p)+h*(i*A-a*l)),e[7]=r*(l*f-A*g)-o*(i*f-a*g)+c*(i*A-a*l),e[8]=o*(u*y-f*d)-c*(s*y-A*d)+h*(s*f-A*u),e[9]=-(r*(u*y-f*d)-c*(n*y-a*d)+h*(n*f-a*u)),e[10]=r*(s*y-A*d)-o*(n*y-a*d)+h*(n*A-a*s),e[11]=-(r*(s*f-A*u)-o*(n*f-a*u)+c*(n*A-a*s)),e[12]=-(o*(u*p-g*d)-c*(s*p-l*d)+h*(s*g-l*u)),e[13]=r*(u*p-g*d)-c*(n*p-i*d)+h*(n*g-i*u),e[14]=-(r*(s*p-l*d)-o*(n*p-i*d)+h*(n*l-i*s)),e[15]=r*(s*g-l*u)-o*(n*g-i*u)+c*(n*l-i*s),e}},76860:function(e){e.exports=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},64492:function(e){e.exports=function(e,t){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}},54212:function(e){e.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},70800:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],A=e[8],c=e[9],u=e[10],g=e[11],f=e[12],h=e[13],d=e[14],p=e[15];return(t*o-r*a)*(u*p-g*d)-(t*s-n*a)*(c*p-g*h)+(t*l-i*a)*(c*d-u*h)+(r*s-n*o)*(A*p-g*f)-(r*l-i*o)*(A*d-u*f)+(n*l-i*s)*(A*h-c*f)}},61784:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,l=i+i,A=r*o,c=n*o,u=n*s,g=i*o,f=i*s,h=i*l,d=a*o,p=a*s,y=a*l;return e[0]=1-u-h,e[1]=c+y,e[2]=g-p,e[3]=0,e[4]=c-y,e[5]=1-A-h,e[6]=f+d,e[7]=0,e[8]=g+p,e[9]=f-d,e[10]=1-A-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},91616:function(e){e.exports=function(e,t,r){var n,i,a,o=r[0],s=r[1],l=r[2],A=Math.sqrt(o*o+s*s+l*l);return Math.abs(A)<1e-6?null:(o*=A=1/A,s*=A,l*=A,n=Math.sin(t),i=Math.cos(t),a=1-i,e[0]=o*o*a+i,e[1]=s*o*a+l*n,e[2]=l*o*a-s*n,e[3]=0,e[4]=o*s*a-l*n,e[5]=s*s*a+i,e[6]=l*s*a+o*n,e[7]=0,e[8]=o*l*a+s*n,e[9]=s*l*a-o*n,e[10]=l*l*a+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}},51944:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,l=i+i,A=a+a,c=n*s,u=n*l,g=n*A,f=i*l,h=i*A,d=a*A,p=o*s,y=o*l,m=o*A;return e[0]=1-(f+d),e[1]=u+m,e[2]=g-y,e[3]=0,e[4]=u-m,e[5]=1-(c+d),e[6]=h+p,e[7]=0,e[8]=g+y,e[9]=h-p,e[10]=1-(c+f),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},69444:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},48268:function(e){e.exports=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}},21856:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},79216:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},57736:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},38848:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(r-t),l=1/(i-n),A=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*l,e[10]=(o+a)*A,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*A,e[15]=0,e}},36635:function(e){e.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},36524:function(e,t,r){e.exports={create:r(54212),clone:r(76860),copy:r(64492),identity:r(36635),transpose:r(86520),invert:r(4308),adjoint:r(12408),determinant:r(70800),multiply:r(80944),translate:r(35176),scale:r(68152),rotate:r(30016),rotateX:r(15456),rotateY:r(64840),rotateZ:r(4192),fromRotation:r(91616),fromRotationTranslation:r(51944),fromScaling:r(69444),fromTranslation:r(48268),fromXRotation:r(21856),fromYRotation:r(79216),fromZRotation:r(57736),fromQuat:r(61784),frustum:r(38848),perspective:r(51296),perspectiveFromFieldOfView:r(63688),ortho:r(97688),lookAt:r(56508),str:r(89412)}},4308:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],A=t[7],c=t[8],u=t[9],g=t[10],f=t[11],h=t[12],d=t[13],p=t[14],y=t[15],m=r*s-n*o,I=r*l-i*o,v=r*A-a*o,E=n*l-i*s,C=n*A-a*s,B=i*A-a*l,b=c*d-u*h,x=c*p-g*h,w=c*y-f*h,Q=u*p-g*d,_=u*y-f*d,S=g*y-f*p,k=m*S-I*_+v*Q+E*w-C*x+B*b;return k?(k=1/k,e[0]=(s*S-l*_+A*Q)*k,e[1]=(i*_-n*S-a*Q)*k,e[2]=(d*B-p*C+y*E)*k,e[3]=(g*C-u*B-f*E)*k,e[4]=(l*w-o*S-A*x)*k,e[5]=(r*S-i*w+a*x)*k,e[6]=(p*v-h*B-y*I)*k,e[7]=(c*B-g*v+f*I)*k,e[8]=(o*_-s*w+A*b)*k,e[9]=(n*w-r*_-a*b)*k,e[10]=(h*C-d*v+y*m)*k,e[11]=(u*v-c*C-f*m)*k,e[12]=(s*x-o*Q-l*b)*k,e[13]=(r*Q-n*x+i*b)*k,e[14]=(d*I-h*E-p*m)*k,e[15]=(c*E-u*I+g*m)*k,e):null}},56508:function(e,t,r){var n=r(36635);e.exports=function(e,t,r,i){var a,o,s,l,A,c,u,g,f,h,d=t[0],p=t[1],y=t[2],m=i[0],I=i[1],v=i[2],E=r[0],C=r[1],B=r[2];return Math.abs(d-E)<1e-6&&Math.abs(p-C)<1e-6&&Math.abs(y-B)<1e-6?n(e):(u=d-E,g=p-C,f=y-B,h=1/Math.sqrt(u*u+g*g+f*f),a=I*(f*=h)-v*(g*=h),o=v*(u*=h)-m*f,s=m*g-I*u,(h=Math.sqrt(a*a+o*o+s*s))?(a*=h=1/h,o*=h,s*=h):(a=0,o=0,s=0),l=g*s-f*o,A=f*a-u*s,c=u*o-g*a,(h=Math.sqrt(l*l+A*A+c*c))?(l*=h=1/h,A*=h,c*=h):(l=0,A=0,c=0),e[0]=a,e[1]=l,e[2]=u,e[3]=0,e[4]=o,e[5]=A,e[6]=g,e[7]=0,e[8]=s,e[9]=c,e[10]=f,e[11]=0,e[12]=-(a*d+o*p+s*y),e[13]=-(l*d+A*p+c*y),e[14]=-(u*d+g*p+f*y),e[15]=1,e)}},80944:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],A=t[6],c=t[7],u=t[8],g=t[9],f=t[10],h=t[11],d=t[12],p=t[13],y=t[14],m=t[15],I=r[0],v=r[1],E=r[2],C=r[3];return e[0]=I*n+v*s+E*u+C*d,e[1]=I*i+v*l+E*g+C*p,e[2]=I*a+v*A+E*f+C*y,e[3]=I*o+v*c+E*h+C*m,I=r[4],v=r[5],E=r[6],C=r[7],e[4]=I*n+v*s+E*u+C*d,e[5]=I*i+v*l+E*g+C*p,e[6]=I*a+v*A+E*f+C*y,e[7]=I*o+v*c+E*h+C*m,I=r[8],v=r[9],E=r[10],C=r[11],e[8]=I*n+v*s+E*u+C*d,e[9]=I*i+v*l+E*g+C*p,e[10]=I*a+v*A+E*f+C*y,e[11]=I*o+v*c+E*h+C*m,I=r[12],v=r[13],E=r[14],C=r[15],e[12]=I*n+v*s+E*u+C*d,e[13]=I*i+v*l+E*g+C*p,e[14]=I*a+v*A+E*f+C*y,e[15]=I*o+v*c+E*h+C*m,e}},97688:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),A=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*A,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*A,e[15]=1,e}},51296:function(e){e.exports=function(e,t,r,n,i){var a=1/Math.tan(t/2),o=1/(n-i);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*o,e[15]=0,e}},63688:function(e){e.exports=function(e,t,r,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+s),A=2/(i+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=A,e[6]=0,e[7]=0,e[8]=-(o-s)*l*.5,e[9]=(i-a)*A*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}},30016:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,A,c,u,g,f,h,d,p,y,m,I,v,E,C,B,b,x,w,Q,_=n[0],S=n[1],k=n[2],D=Math.sqrt(_*_+S*S+k*k);return Math.abs(D)<1e-6?null:(_*=D=1/D,S*=D,k*=D,i=Math.sin(r),a=Math.cos(r),o=1-a,s=t[0],l=t[1],A=t[2],c=t[3],u=t[4],g=t[5],f=t[6],h=t[7],d=t[8],p=t[9],y=t[10],m=t[11],I=_*_*o+a,v=S*_*o+k*i,E=k*_*o-S*i,C=_*S*o-k*i,B=S*S*o+a,b=k*S*o+_*i,x=_*k*o+S*i,w=S*k*o-_*i,Q=k*k*o+a,e[0]=s*I+u*v+d*E,e[1]=l*I+g*v+p*E,e[2]=A*I+f*v+y*E,e[3]=c*I+h*v+m*E,e[4]=s*C+u*B+d*b,e[5]=l*C+g*B+p*b,e[6]=A*C+f*B+y*b,e[7]=c*C+h*B+m*b,e[8]=s*x+u*w+d*Q,e[9]=l*x+g*w+p*Q,e[10]=A*x+f*w+y*Q,e[11]=c*x+h*w+m*Q,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},15456:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],A=t[8],c=t[9],u=t[10],g=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+A*n,e[5]=o*i+c*n,e[6]=s*i+u*n,e[7]=l*i+g*n,e[8]=A*i-a*n,e[9]=c*i-o*n,e[10]=u*i-s*n,e[11]=g*i-l*n,e}},64840:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],A=t[8],c=t[9],u=t[10],g=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-A*n,e[1]=o*i-c*n,e[2]=s*i-u*n,e[3]=l*i-g*n,e[8]=a*n+A*i,e[9]=o*n+c*i,e[10]=s*n+u*i,e[11]=l*n+g*i,e}},4192:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],A=t[4],c=t[5],u=t[6],g=t[7];return t!==e&&(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[0]=a*i+A*n,e[1]=o*i+c*n,e[2]=s*i+u*n,e[3]=l*i+g*n,e[4]=A*i-a*n,e[5]=c*i-o*n,e[6]=u*i-s*n,e[7]=g*i-l*n,e}},68152:function(e){e.exports=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},89412:function(e){e.exports=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}},35176:function(e){e.exports=function(e,t,r){var n,i,a,o,s,l,A,c,u,g,f,h,d=r[0],p=r[1],y=r[2];return t===e?(e[12]=t[0]*d+t[4]*p+t[8]*y+t[12],e[13]=t[1]*d+t[5]*p+t[9]*y+t[13],e[14]=t[2]*d+t[6]*p+t[10]*y+t[14],e[15]=t[3]*d+t[7]*p+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],A=t[6],c=t[7],u=t[8],g=t[9],f=t[10],h=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=A,e[7]=c,e[8]=u,e[9]=g,e[10]=f,e[11]=h,e[12]=n*d+s*p+u*y+t[12],e[13]=i*d+l*p+g*y+t[13],e[14]=a*d+A*p+f*y+t[14],e[15]=o*d+c*p+h*y+t[15]),e}},86520:function(e){e.exports=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},23352:function(e,t,r){"use strict";var n=r(42771),i=r(55616),a=r(28624),o=r(55212),s=r(60463),l=r(72160),A=r(33888),c=r(14144),u=r(51160),g=r(58908),f=r(65819),h=r(23464),d=r(63768),p=r(50896),y=r(71920),m=r(47520),I=r(308).nextPow2,v=new s,E=!1;if(document.body){var C=document.body.appendChild(document.createElement("div"));C.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(C).fontStretch&&(E=!0),document.body.removeChild(C)}var B=function(e){!function(e){return"function"===typeof e&&e._gl&&e.prop&&e.texture&&e.buffer}(e)?this.gl=o(e):(e={regl:e},this.gl=e.regl._gl),this.shader=v.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=e.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),v.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(g(e)?e:{})};B.prototype.createShader=function(){var e=this.regl,t=e({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:e.prop("count"),offset:e.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:e.this("sizeBuffer")},width:{offset:0,stride:8,buffer:e.this("sizeBuffer")},char:e.this("charBuffer"),position:e.this("position")},uniforms:{atlasSize:function(e,t){return[t.atlas.width,t.atlas.height]},atlasDim:function(e,t){return[t.atlas.cols,t.atlas.rows]},atlas:function(e,t){return t.atlas.texture},charStep:function(e,t){return t.atlas.step},em:function(e,t){return t.atlas.em},color:e.prop("color"),opacity:e.prop("opacity"),viewport:e.this("viewportArray"),scale:e.this("scale"),align:e.prop("align"),baseline:e.prop("baseline"),translate:e.this("translate"),positionOffset:e.prop("positionOffset")},primitive:"points",viewport:e.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:e,draw:t,atlas:{}}},B.prototype.update=function(e){var t=this;if("string"===typeof e)e={text:e};else if(!e)return;null!=(e=i(e,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map((function(e){return parseFloat(e)})):this.opacity=parseFloat(e.opacity)),null!=e.viewport&&(this.viewport=u(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=e.kerning&&(this.kerning=e.kerning),null!=e.offset&&("number"===typeof e.offset&&(e.offset=[e.offset,0]),this.positionOffset=m(e.offset)),e.direction&&(this.direction=e.direction),e.range&&(this.range=e.range,this.scale=[1/(e.range[2]-e.range[0]),1/(e.range[3]-e.range[1])],this.translate=[-e.range[0],-e.range[1]]),e.scale&&(this.scale=e.scale),e.translate&&(this.translate=e.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||e.font||(e.font=B.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach((function(e,r){if("string"===typeof e)try{e=n.parse(e)}catch(m){e=n.parse(B.baseFontSize+"px "+e)}else{var i=e.style,s=e.weight,l=e.stretch,A=e.variant;e=n.parse(n.stringify(e)),i&&(e.style=i),s&&(e.weight=s),l&&(e.stretch=l),A&&(e.variant=A)}var c=n.stringify({size:B.baseFontSize,family:e.family,stretch:E?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),u=f(e.size),g=Math.round(u[0]*h(u[1]));if(g!==t.fontSize[r]&&(o=!0,t.fontSize[r]=g),(!t.font[r]||c!=t.font[r].baseString)&&(a=!0,t.font[r]=B.fonts[c],!t.font[r])){var d=e.family.join(", "),p=[e.style];e.style!=e.variant&&p.push(e.variant),e.variant!=e.weight&&p.push(e.weight),E&&e.weight!=e.stretch&&p.push(e.stretch),t.font[r]={baseString:c,family:d,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:y(d,{origin:"top",fontSize:B.baseFontSize,fontStyle:p.join(" ")})},B.fonts[c]=t.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:t.fontSize[i],family:r.family,stretch:E?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(t.fontAtlas[i]=t.shader.atlas[a],!t.fontAtlas[i]){var o=r.metrics;t.shader.atlas[a]=t.fontAtlas[i]={fontString:a,step:2*Math.ceil(t.fontSize[i]*o.bottom*.5),em:t.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:t.regl.texture()}}null==e.text&&(e.text=t.text)})),"string"===typeof e.text&&e.position&&e.position.length>2){for(var s=Array(.5*e.position.length),g=0;g2){for(var C=!e.position[0].length,b=c.mallocFloat(2*this.count),x=0,w=0;x1?t.align[r]:t.align[0]:t.align;if("number"===typeof n)return n;switch(n){case"right":case"end":return-e;case"center":case"centre":case"middle":return.5*-e}return 0}))),null==this.baseline&&null==e.baseline&&(e.baseline=0),null!=e.baseline&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(e,r){var n=(t.font[r]||t.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"===typeof e?e-n.baseline:-n[e],i*=-1}))),null!=e.color)if(e.color||(e.color="transparent"),"string"!==typeof e.color&&isNaN(e.color)){var H;if("number"===typeof e.color[0]&&e.color.length>this.counts.length){var Y=e.color.length;H=c.mallocUint8(Y);for(var J=(e.color.subarray||e.color.slice).bind(e.color),K=0;K4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var W=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(W);for(var Z=0;Z1?this.counts[Z]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Z]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*Z,4*Z+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Z]:this.opacity,baseline:null!=this.baselineOffset[Z]?this.baselineOffset[Z]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[Z]?this.alignOffset[Z]:this.alignOffset[0]:0,atlas:this.fontAtlas[Z]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*Z,2*Z+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},B.prototype.destroy=function(){},B.prototype.kerning=!0,B.prototype.position={constant:new Float32Array(2)},B.prototype.translate=null,B.prototype.scale=null,B.prototype.font=null,B.prototype.text="",B.prototype.positionOffset=[0,0],B.prototype.opacity=1,B.prototype.color=new Uint8Array([0,0,0,255]),B.prototype.alignOffset=[0,0],B.maxAtlasSize=1024,B.atlasCanvas=document.createElement("canvas"),B.atlasContext=B.atlasCanvas.getContext("2d",{alpha:!1}),B.baseFontSize=64,B.fonts={},e.exports=B},55212:function(e,t,r){"use strict";var n=r(55616);function i(e){if(e.container)if(e.container==document.body)document.body.style.width||(e.canvas.width=e.width||e.pixelRatio*r.g.innerWidth),document.body.style.height||(e.canvas.height=e.height||e.pixelRatio*r.g.innerHeight);else{var t=e.container.getBoundingClientRect();e.canvas.width=e.width||t.right-t.left,e.canvas.height=e.height||t.bottom-t.top}}function a(e){return"function"===typeof e.getContext&&"width"in e&&"height"in e}function o(){var e=document.createElement("canvas");return e.style.position="absolute",e.style.top=0,e.style.left=0,e}e.exports=function(e){var t;if(e?"string"===typeof e&&(e={container:e}):e={},(e=a(e)||"string"===typeof(t=e).nodeName&&"function"===typeof t.appendChild&&"function"===typeof t.getBoundingClientRect?{container:e}:function(e){return"function"===typeof e.drawArrays||"function"===typeof e.drawElements}(e)?{gl:e}:n(e,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(e.pixelRatio=r.g.pixelRatio||1),e.gl)return e.gl;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if("string"===typeof e.container){var s=document.querySelector(e.container);if(!s)throw Error("Element "+e.container+" is not found");e.container=s}a(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=o(),e.container.appendChild(e.canvas),i(e))}else if(!e.canvas){if("undefined"===typeof document)throw Error("Not DOM environment. Use headless-gl.");e.container=document.body||document.documentElement,e.canvas=o(),e.container.appendChild(e.canvas),i(e)}return e.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(r){try{e.gl=e.canvas.getContext(r,e.attrs)}catch(t){}return e.gl})),e.gl}},26444:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,u=r?i-1:0,g=r?-1:1,f=e[t+u];for(u+=g,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=g,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+u],u+=g,c-=8);if(0===a)a=1-A;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=A}return(f?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,A=8*a-i-1,c=(1<>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,h=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?g/l:g*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,i),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&s,f+=h,s/=256,i-=8);for(o=o<0;e[r+f]=255&o,f+=h,o/=256,A-=8);e[r+f-h]|=128*d}},6768:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},91148:function(e,t,r){"use strict";var n=r(46672)(),i=r(99676)("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},24200:function(e){e.exports=!0},90720:function(e){"use strict";var t,r,n=Function.prototype.toString,i="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof i&&"function"===typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(f){f!==r&&(i=null)}else i=null;var a=/^\s*class\b/,o=function(e){try{var t=n.call(e);return a.test(t)}catch(r){return!1}},s=function(e){try{return!o(e)&&(n.call(e),!0)}catch(t){return!1}},l=Object.prototype.toString,A="function"===typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),u=function(){return!1};if("object"===typeof document){var g=document.all;l.call(g)===l.call(document.all)&&(u=function(e){if((c||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(r){}return!1})}e.exports=i?function(e){if(u(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{i(e,null,t)}catch(n){if(n!==r)return!1}return!o(e)&&s(e)}:function(e){if(u(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(A)return s(e);if(o(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},84420:function(e,t,r){"use strict";var n,i=Object.prototype.toString,a=Function.prototype.toString,o=/^\s*(?:function)?\*/,s=r(46672)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!==typeof e)return!1;if(o.test(a.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if("undefined"===typeof n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},96604:function(e){"use strict";e.exports="undefined"!==typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},85992:function(e){"use strict";e.exports=function(e){return e!==e}},1560:function(e,t,r){"use strict";var n=r(57916),i=r(81288),a=r(85992),o=r(57740),s=r(59736),l=n(o(),Number);i(l,{getPolyfill:o,implementation:a,shim:s}),e.exports=l},57740:function(e,t,r){"use strict";var n=r(85992);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},59736:function(e,t,r){"use strict";var n=r(81288),i=r(57740);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},18400:function(e){"use strict";e.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},58908:function(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r;return"[object Object]"===t.call(e)&&(null===(r=Object.getPrototypeOf(e))||r===Object.getPrototypeOf({}))}},94576:function(e){"use strict";e.exports=function(e){for(var t,r=e.length,n=0;n13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},53520:function(e){"use strict";e.exports=function(e){return"string"===typeof e&&(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4))}},7728:function(e,t,r){"use strict";var n=r(46492),i=r(63436),a=r(99676),o=a("Object.prototype.toString"),s=r(46672)(),l=r(2304),A="undefined"===typeof globalThis?r.g:globalThis,c=i(),u=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!l&&function(e){var t=!1;return n(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch(i){}})),t}(e)}},76244:function(e){"use strict";e.exports=Math.log2||function(e){return Math.log(e)*Math.LOG2E}},62644:function(e,t,r){"use strict";e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function A(e,s){var A=n.x(s),c=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||A!==i||c!==a||l(s))&&(r=0|e,i=A||0,a=c||0,t&&t(r,i,a,o))}function c(e){A(0,e)}function u(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function g(e){l(e)&&t&&t(r,i,a,o)}function f(e){0===n.buttons(e)?A(0,e):A(r,e)}function h(e){A(r|n.buttons(e),e)}function d(e){A(r&~n.buttons(e),e)}function p(){s||(s=!0,e.addEventListener("mousemove",f),e.addEventListener("mousedown",h),e.addEventListener("mouseup",d),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",u),e.addEventListener("keyup",g),e.addEventListener("keydown",g),e.addEventListener("keypress",g),e!==window&&(window.addEventListener("blur",u),window.addEventListener("keyup",g),window.addEventListener("keydown",g),window.addEventListener("keypress",g)))}p();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?p():s&&(s=!1,e.removeEventListener("mousemove",f),e.removeEventListener("mousedown",h),e.removeEventListener("mouseup",d),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",u),e.removeEventListener("keyup",g),e.removeEventListener("keydown",g),e.removeEventListener("keypress",g),e!==window&&(window.removeEventListener("blur",u),window.removeEventListener("keyup",g),window.removeEventListener("keydown",g),window.removeEventListener("keypress",g)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(93784)},29128:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},93784:function(e,t){"use strict";function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1<0&&a(s,r))}catch(p){c.call(new g(r),p)}}}function c(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function u(e,t,r,n){for(var i=0;i1&&(i*=y=Math.sqrt(y),s*=y);var m=i*i,I=s*s,v=(A==c?-1:1)*Math.sqrt(Math.abs((m*I-m*p*p-I*d*d)/(m*p*p+I*d*d)));v==1/0&&(v=1);var E=v*i*p/s+(e+u)/2,C=v*-s*d/i+(n+g)/2,B=Math.asin(((n-C)/s).toFixed(9)),b=Math.asin(((g-C)/s).toFixed(9));(B=eb&&(B-=2*t),!c&&b>B&&(b-=2*t)}if(Math.abs(b-B)>r){var x=b,w=u,Q=g;b=B+r*(c&&b>B?1:-1);var _=a(u=E+i*Math.cos(b),g=C+s*Math.sin(b),i,s,l,0,c,w,Q,[b,x,E,C])}var S=Math.tan((b-B)/4),k=4/3*i*S,D=4/3*s*S,T=[2*e-(e+k*Math.sin(B)),2*n-(n-D*Math.cos(B)),u+k*Math.sin(b),g-D*Math.cos(b),u,g];if(f)return T;_&&(T=T.concat(_));for(var M=0;M7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var I=f,v=h;"C"!=t&&"S"!=t||(I+=I-o,v+=v-l),y=["C",I,v,y[1],y[2],y[3],y[4]];break;case"T":"Q"==t||"T"==t?(u=2*f-u,g=2*h-g):(u=f,g=h),y=i(f,h,u,g,y[1],y[2]);break;case"Q":u=y[1],g=y[2],y=i(f,h,y[1],y[2],y[3],y[4]);break;case"L":y=n(f,h,y[1],y[2]);break;case"H":y=n(f,h,y[1],h);break;case"V":y=n(f,h,f,y[1]);break;case"Z":y=n(f,h,A,c)}t=m,f=y[y.length-2],h=y[y.length-1],y.length>4?(o=y[y.length-4],l=y[y.length-3]):(o=f,l=h),r.push(y)}return r}},50896:function(e){"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,i){for(var a,o,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l0&&!i.call(e,0))for(var d=0;d0)for(var p=0;p=0&&"[object Function]"===t.call(e.callee)),n}},32868:function(e){"use strict";function t(e,t){if("string"!==typeof e)return[e];var r=[e];"string"===typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",a=!!t.flat;n.forEach((function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function a(t,a,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(s),i+s+i}r.forEach((function(e,n){for(var i,o=0;e!=i;)if(i=e,e=e.replace(t,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=e})),n=n.reverse(),r=r.map((function(t){return n.forEach((function(r){t=t.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),e[0]+"$1"+e[1])})),t}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function e(t,r,n){for(var i,a=[],s=0;i=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(t.slice(0,i.index)),a.push(e(r[i[1]],r)),t=t.slice(i.index+i[0].length)}return a.push(t),a}(r[0],r)}function r(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",i=e[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=i,i=i.replace(a,s)}return i}return e.reduce((function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r}),"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function n(e,n){return Array.isArray(e)?r(e,n):t(e,n)}n.parse=t,n.stringify=r,e.exports=n},51160:function(e,t,r){"use strict";var n=r(55616);e.exports=function(e){var t;return arguments.length>1&&(e=arguments),"string"===typeof e?e=e.split(/\s/).map(parseFloat):"number"===typeof e&&(e=[e]),e.length&&"number"===typeof e[0]?t=1===e.length?{width:e[0],height:e[0],x:0,y:0}:2===e.length?{width:e[0],height:e[1],x:0,y:0}:{x:e[0],y:e[1],width:e[2]-e[0]||0,height:e[3]-e[1]||0}:e&&(t={x:(e=n(e,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:e.top||0},null==e.width?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,null==e.height?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}},21984:function(e){e.exports=function(e){var i=[];return e.replace(r,(function(e,r,a){var o=r.toLowerCase();for(a=function(e){var t=e.match(n);return t?t.map(Number):[]}(a),"m"==o&&a.length>2&&(i.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==t[o])return a.unshift(r),i.push(a);if(a.lengtha!==f>a&&i<(g-c)*(a-u)/(f-u)+c&&(o=!o)}return o}},14756:function(e,t,r){var n,i=r(7688),a=r(28648),o=r(72200),s=r(11403),l=r(82368),A=r(17792),c=!1,u=a();function g(e,t,r){var i=n.segments(e),a=n.segments(t),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(e){return!0===e?c=i():!1===e&&(c=!1),!1!==c&&c.list},epsilon:function(e){return u.epsilon(e)},segments:function(e){var t=o(!0,u,c);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,u,c).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:l.union(e.combined,c),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:l.intersect(e.combined,c),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:l.difference(e.combined,c),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:l.differenceRev(e.combined,c),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:l.xor(e.combined,c),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:s(e.segments,u,c),inverted:e.inverted}},polygonFromGeoJSON:function(e){return A.toPolygon(n,e)},polygonToGeoJSON:function(e){return A.fromPolygon(n,u,e)},union:function(e,t){return g(e,t,n.selectUnion)},intersect:function(e,t){return g(e,t,n.selectIntersect)},difference:function(e,t){return g(e,t,n.selectDifference)},differenceRev:function(e,t){return g(e,t,n.selectDifferenceRev)},xor:function(e,t){return g(e,t,n.selectXor)}},"object"===typeof window&&(window.PolyBool=n),e.exports=n},7688:function(e){e.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!==typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},28648:function(e){e.exports=function(e){"number"!==typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"===typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=t[0];return(o-i)*(t[1]-a)-(s-a)*(l-i)>=-e},pointBetween:function(t,r,n){var i=t[1]-r[1],a=n[0]-r[0],o=t[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-i>e&&(a-A)*(i-c)/(o-c)+A-n>e&&(s=!s),a=A,o=c}return s}};return t}},17792:function(e){var t={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),i=1;i0}))}function c(e,n){var i=e.seg,a=n.seg,o=i.start,s=i.end,A=a.start,c=a.end;r&&r.checkIntersection(i,a);var u=t.linesIntersect(o,s,A,c);if(!1===u){if(!t.pointsCollinear(o,s,A))return!1;if(t.pointsSame(o,c)||t.pointsSame(s,A))return!1;var g=t.pointsSame(o,A),f=t.pointsSame(s,c);if(g&&f)return n;var h=!g&&t.pointBetween(o,A,c),d=!f&&t.pointBetween(s,A,c);if(g)return d?l(n,s):l(e,c),n;h&&(f||(d?l(n,s):l(e,c)),l(n,o))}else 0===u.alongA&&(-1===u.alongB?l(e,A):0===u.alongB?l(e,u.pt):1===u.alongB&&l(e,c)),0===u.alongB&&(-1===u.alongA?l(n,o):0===u.alongA?l(n,u.pt):1===u.alongA&&l(n,s));return!1}for(var u=[];!a.isEmpty();){var g=a.getHead();if(r&&r.vert(g.pt[0]),g.isStart){r&&r.segmentNew(g.seg,g.primary);var f=A(g),h=f.before?f.before.ev:null,d=f.after?f.after.ev:null;function p(){if(h){var e=c(g,h);if(e)return e}return!!d&&c(g,d)}r&&r.tempStatus(g.seg,!!h&&h.seg,!!d&&d.seg);var y,m,I=p();if(I)e?(m=null===g.seg.myFill.below||g.seg.myFill.above!==g.seg.myFill.below)&&(I.seg.myFill.above=!I.seg.myFill.above):I.seg.otherFill=g.seg.myFill,r&&r.segmentUpdate(I.seg),g.other.remove(),g.remove();if(a.getHead()!==g){r&&r.rewind(g.seg);continue}e?(m=null===g.seg.myFill.below||g.seg.myFill.above!==g.seg.myFill.below,g.seg.myFill.below=d?d.seg.myFill.above:i,g.seg.myFill.above=m?!g.seg.myFill.below:g.seg.myFill.below):null===g.seg.otherFill&&(y=d?g.primary===d.primary?d.seg.otherFill.above:d.seg.myFill.above:g.primary?o:i,g.seg.otherFill={above:y,below:y}),r&&r.status(g.seg,!!h&&h.seg,!!d&&d.seg),g.other.status=f.insert(n.node({ev:g}))}else{var v=g.status;if(null===v)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(v.prev)&&s.exists(v.next)&&c(v.prev.ev,v.next.ev),r&&r.statusRemove(v.ev.seg),v.remove(),!g.primary){var E=g.seg.myFill;g.seg.myFill=g.seg.otherFill,g.seg.otherFill=E}u.push(g.seg)}a.getHead().remove()}return r&&r.done(),u}return e?{addRegion:function(e){for(var n,i,a,o=e[e.length-1],l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},n.prototype.read_uint16=function(e){var r=this.input;if(e+2>r.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?256*r[e]+r[e+1]:r[e]+256*r[e+1]},n.prototype.read_uint32=function(e){var r=this.input;if(e+4>r.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?16777216*r[e]+65536*r[e+1]+256*r[e+2]+r[e+3]:r[e]+256*r[e+1]+65536*r[e+2]+16777216*r[e+3]},n.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},n.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},n.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));default:return null}},n.prototype.scan_ifd=function(e,n,i){var a=this.read_uint16(n);n+=2;for(var o=0;othis.input.length)throw t("unexpected EOF","EBADDATA");for(var h=[],d=g,p=0;p0&&(this.ifds_to_read.push({id:s,offset:h[0]}),f=!0),!1===i({is_big_endian:this.big_endian,ifd:e,tag:s,format:l,count:A,entry_offset:n+this.start,data_length:u,data_offset:g+this.start,value:h,is_subifd_link:f}))return void(this.aborted=!0);n+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(n)})},e.exports.ExifParser=n,e.exports.get_orientation=function(e){var t=0;try{return new n(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(r){return-1}}},44600:function(e,t,r){"use strict";var n=r(9696).eW,i=r(9696).eI;function a(e,t){if(e.length<4+t)return null;var r=i(e,t);return e.length>4&15,i=15&e[4],a=e[5]>>4&15,o=n(e,6),l=8,A=0;At.width||e.width===t.width&&e.height>t.height?e:t})),r=e.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t}));return t.width>r.height||t.width===r.height&&t.height>r.width?t:r}(t.sizes),n=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(n=0===e.value?r[n]:t[n=t[n=r[n]]]),"irot"===e.type)for(var i=0;i1&&(g.variants=u.variants),u.orientation&&(g.orientation=u.orientation),u.exif_location&&u.exif_location.offset+u.exif_location.length<=e.length){var f=a(e,u.exif_location.offset),h=e.slice(u.exif_location.offset+f+4,u.exif_location.offset+u.exif_location.length),d=s.get_orientation(h);d>0&&(g.orientation=d)}return g}}}}}}},38728:function(e,t,r){"use strict";var n=r(9696).wR,i=r(9696).gS,a=r(9696).Bz,o=n("BM");e.exports=function(e){if(!(e.length<26)&&i(e,0,o))return{width:a(e,18),height:a(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},5588:function(e,t,r){"use strict";var n=r(9696).wR,i=r(9696).gS,a=r(9696).Bz,o=n("GIF87a"),s=n("GIF89a");e.exports=function(e){if(!(e.length<10)&&(i(e,0,o)||i(e,0,s)))return{width:a(e,6),height:a(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},41924:function(e,t,r){"use strict";var n=r(9696).Bz;e.exports=function(e){var t=n(e,0),r=n(e,2),i=n(e,4);if(0===t&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||A>o.height)&&(o=c)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},87968:function(e,t,r){"use strict";var n=r(9696).eW,i=r(9696).wR,a=r(9696).gS,o=r(11688),s=i("Exif\0\0");e.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var r,i,l=e[t++];255===l;)l=e[t++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(e.length-t<2)return;r=n(e,t)-2,t+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(e,t,s)&&(i=o.get_orientation(e.slice(t+6,t+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(e.length-t0&&(A.orientation=i),A}t+=r}}},37276:function(e,t,r){"use strict";var n=r(9696).wR,i=r(9696).gS,a=r(9696).eI,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(e){if(!(e.length<24)&&i(e,0,o)&&i(e,12,s))return{width:a(e,16),height:a(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},90328:function(e,t,r){"use strict";var n=r(9696).wR,i=r(9696).gS,a=r(9696).eI,o=n("8BPS\0\x01");e.exports=function(e){if(!(e.length<22)&&i(e,0,o))return{width:a(e,18),height:a(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},16024:function(e){"use strict";function t(e){return"number"===typeof e&&isFinite(e)&&e>0}var r=/<[-_.:a-zA-Z0-9][^>]*>/,n=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,i=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,a=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,s=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function l(e){return s.test(e)?e.match(s)[0]:"px"}e.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function g(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<e.length)){for(;t+8=10?r=r||c(e,t+8):"VP8L"===f&&h>=9?r=r||u(e,t+8):"VP8X"===f&&h>=10?r=r||g(e,t+8):"EXIF"===f&&(n=s.get_orientation(e.slice(t+8,t+8+h)),t=1/0),t+=8+h}else t++;if(r)return n>0&&(r.orientation=n),r}}}},87480:function(e,t,r){"use strict";e.exports={avif:r(40528),bmp:r(38728),gif:r(5588),ico:r(41924),jpeg:r(87968),png:r(37276),psd:r(90328),svg:r(16024),tiff:r(98792),webp:r(20704)}},19480:function(e,t,r){"use strict";var n=r(87480);e.exports=function(e){return function(e){for(var t=Object.keys(n),r=0;r1)for(var r=1;r1&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],r(e),e.after&&e.after(e))}function B(e){if(e){null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var t=0,r=0;if(v.groups=I=e.map((function(e,A){var c=I[A];return e?("function"===typeof e?e={after:e}:"number"===typeof e[0]&&(e={positions:e}),e=o(e,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(I[A]=c={id:A,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=s({},m,e)),a(c,e,[{lineWidth:function(e){return.5*+e},capSize:function(e){return.5*+e},opacity:parseFloat,errors:function(e){return e=l(e),r+=e.length,e},positions:function(e,r){return e=l(e,"float64"),r.count=Math.floor(e.length/2),r.bounds=n(e,2),r.offset=t,t+=r.count,e}},{color:function(e,t){var r=t.count;if(e||(e="transparent"),!Array.isArray(e)||"number"===typeof e[0]){var n=e;e=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:e.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(o){t=i}return{fill:e({primitive:"triangle",elements:function(e,t){return t.triangles},offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:e.prop("scale"),color:e.prop("fill"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),viewport:function(e,t){return[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]}},attributes:{position:{buffer:e.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:t}},p.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},p.prototype.render=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];t.length&&(e=this).update.apply(e,t),this.draw()},p.prototype.draw=function(){for(var e=this,t=[],r=arguments.length;r--;)t[r]=arguments[r];return(t.length?t:this.passes).forEach((function(t,r){var n;if(t&&Array.isArray(t))return(n=e).draw.apply(n,t);"number"===typeof t&&(t=e.passes[t]),t&&t.count>1&&t.opacity&&(e.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&e.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>p.precisionThreshold||t.scale[1]*t.viewport.height>p.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=p.maxPoints)?e.shaders.rect(t):e.shaders.miter(t)))})),this},p.prototype.update=function(e){var t=this;if(e){null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=this.regl,c=this.gl;if(e.forEach((function(e,f){var y=t.passes[f];if(void 0!==e)if(null!==e){if("number"===typeof e[0]&&(e={positions:e}),e=o(e,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),y||(t.passes[f]=y={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},e=a({},p.defaults,e)),null!=e.thickness&&(y.thickness=parseFloat(e.thickness)),null!=e.opacity&&(y.opacity=parseFloat(e.opacity)),null!=e.miterLimit&&(y.miterLimit=parseFloat(e.miterLimit)),null!=e.overlay&&(y.overlay=!!e.overlay,f=L}));(T=T.slice(0,N)).push(L)}for(var F=function(e){var t=b.slice(2*R,2*T[e]).concat(L?b.slice(2*L):[]),r=(y.hole||[]).map((function(t){return t-L+(T[e]-R)})),n=l(t,r);n=n.map((function(t){return t+R+(t+Re.length)&&(t=e.length);for(var r=0,n=new Array(t);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),A.vert=g(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),p&&(A.frag=A.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=e(A)}v.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},v.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},v.prototype.draw=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;nn)?t.tree=c(e,{bounds:u}):n&&n.length&&(t.tree=n),t.tree){var g={primitive:"points",usage:"static",data:t.tree,type:"uint32"};t.elements?t.elements(g):t.elements=o.elements(g)}var f=y.float32(e);return i({data:f,usage:"dynamic"}),a({data:y.fract32(e,f),usage:"dynamic"}),s({data:new Uint8Array(A),type:"uint8",usage:"stream"}),e}},{marker:function(t,r,n){var i=r.activation;if(i.forEach((function(e){return e&&e.destroy&&e.destroy()})),i.length=0,t&&"number"!==typeof t[0]){for(var a=[],s=0,l=Math.min(t.length,r.count);s=0)return a;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)t=e;else{t=new Uint8Array(e.length);for(var o=0,s=e.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},v.prototype.updatePalette=function(e){if(!this.tooManyColors){var t=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*e.length/t);if(n>1)for(var i=.25*(e=e.slice()).length%t;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x,s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y,l.height),[a,n,o,i]}function f(e){if("number"===typeof e)return[e,e,e,e];if(2===e.length)return[e[0],e[1],e[0],e[1]];var t=l(e);return[t.x,t.y,t.x+t.width,t.y+t.height]}e.exports=c,c.prototype.render=function(){for(var e,t=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(e=this).update.apply(e,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){t.draw(),t.dirty=!0,t.planned=null}))):(this.draw(),this.dirty=!0,o((function(){t.dirty=!1}))),this)},c.prototype.update=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t.length){for(var n=0;nb))&&(s.lower||!(B>>=t))<<3,(t|=r=(15<(e>>>=r))<<2)|(r=(3<(e>>>=r))<<1)|e>>>r>>1}function f(){function e(e){e:{for(var t=16;268435456>=t;t*=16)if(e<=t){e=t;break e}e=0}return 0<(t=r[g(e)>>2]).length?t.pop():new ArrayBuffer(e)}function t(e){r[g(e.byteLength)>>2].push(e)}var r=u(8,(function(){return[]}));return{alloc:e,free:t,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){t(e.buffer)}}}function h(e){return!!e&&"object"===typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"===typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||oe(e.data))}function d(e,t,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===c?i>>=1:5125===c&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(e){n.elementsCount--,delete s[e.id],e.buffer.destroy(),e.buffer=null}var s={},l=0,A={uint8:5121,uint16:5123};t.oes_element_index_uint&&(A.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var c=[];return{create:function(e,t){function s(e){if(e)if("number"===typeof e)l(e),c.primType=4,c.vertCount=0|e,c.type=5121;else{var t=null,r=35044,n=-1,i=-1,o=0,u=0;Array.isArray(e)||oe(e)||h(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=ue[e.usage]),"primitive"in e&&(n=de[e.primitive]),"count"in e&&(i=0|e.count),"type"in e&&(u=A[e.type]),"length"in e?o=0|e.length:(o=i,5123===u||5122===u?o*=2:5125!==u&&5124!==u||(o*=4))),a(c,t,r,n,i,o,u)}else l(),c.primType=4,c.vertCount=0,c.type=5121;return s}var l=r.create(null,34963,!0),c=new i(l._buffer);return n.elementsCount++,s(e),s._reglType="elements",s._elements=c,s.subdata=function(e,t){return l.subdata(e,t),s},s.destroy=function(){o(c)},s},createStream:function(e){var t=c.pop();return t||(t=new i(r.create(null,34963,!0,!1)._buffer)),a(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){c.push(e)},getElements:function(e){return"function"===typeof e&&e._elements instanceof i?e._elements:null},clear:function(){se(s).forEach(o)}}}function C(e){for(var t=ie.allocType(5123,e.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;t[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,g(r,n[i]),e.mipmask|=1<t;++t)e.images[t]=null;return e}function b(e){for(var t=e.images,r=0;rt){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var e=0;return Object.keys(ae).forEach((function(t){e+=ae[t].stats.size})),e}),{create2D:function(t,r){function n(e,t){var r=i.texInfo;D.call(r);var a=E();return"number"===typeof e?m(a,0|e,"number"===typeof t?0|t:0|e):e?(T(r,e),I(a,e)):m(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,l(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,L(i),v(a,3553),M(r,3553),N(),b(a),o.profile&&(i.stats.size=k(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=j[i.internalformat],n.type=V[i.type],n.mag=W[r.magFilter],n.min=Z[r.minFilter],n.wrapS=X[r.wrapS],n.wrapT=X[r.wrapT],n}var i=new R(3553);return ae[i.id]=i,a.textureCount++,n(t,r),n.subimage=function(e,t,r,a){t|=0,r|=0,a|=0;var o=d();return l(o,i),o.width=0,o.height=0,g(o,e),o.width=o.width||(i.width>>a)-t,o.height=o.height||(i.height>>a)-r,L(i),f(o,3553,t,r,a),N(),p(o),n},n.resize=function(t,r){var a=0|t,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,L(i);for(var l=0;i.mipmask>>l;++l){var A=a>>l,c=s>>l;if(!A||!c)break;e.texImage2D(3553,l,i.format,A,c,0,i.format,i.type,null)}return N(),o.profile&&(i.stats.size=k(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(t,r,n,i,s,c){function u(e,t,r,n,i,a){var s,c=h.texInfo;for(D.call(c),s=0;6>s;++s)y[s]=E();if("number"!==typeof e&&e){if("object"===typeof e)if(t)I(y[0],e),I(y[1],t),I(y[2],r),I(y[3],n),I(y[4],i),I(y[5],a);else if(T(c,e),A(h,e),"faces"in e)for(e=e.faces,s=0;6>s;++s)l(y[s],h),I(y[s],e[s]);else for(s=0;6>s;++s)I(y[s],e)}else for(e=0|e||1,s=0;6>s;++s)m(y[s],e,e);for(l(h,y[0]),h.mipmask=c.genMipmaps?(y[0].width<<1)-1:y[0].mipmask,h.internalformat=y[0].internalformat,u.width=y[0].width,u.height=y[0].height,L(h),s=0;6>s;++s)v(y[s],34069+s);for(M(c,34067),N(),o.profile&&(h.stats.size=k(h.internalformat,h.type,u.width,u.height,c.genMipmaps,!0)),u.format=j[h.internalformat],u.type=V[h.type],u.mag=W[c.magFilter],u.min=Z[c.minFilter],u.wrapS=X[c.wrapS],u.wrapT=X[c.wrapT],s=0;6>s;++s)b(y[s]);return u}var h=new R(34067);ae[h.id]=h,a.cubeCount++;var y=Array(6);return u(t,r,n,i,s,c),u.subimage=function(e,t,r,n,i){r|=0,n|=0,i|=0;var a=d();return l(a,h),a.width=0,a.height=0,g(a,t),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,L(h),f(a,34069+e,r,n,i),N(),p(a),u},u.resize=function(t){if((t|=0)!==h.width){u.width=h.width=t,u.height=h.height=t,L(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)e.texImage2D(34069+r,n,h.format,t>>n,t>>n,0,h.format,h.type,null);return N(),o.profile&&(h.stats.size=k(h.internalformat,h.type,u.width,u.height,!1,!0)),u}},u._reglType="textureCube",u._texture=h,o.profile&&(u.stats=h.stats),u.destroy=function(){h.decRef()},u},clear:function(){for(var t=0;tr;++r)if(0!==(t.mipmask&1<>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;6>n;++n)e.texImage2D(34069+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);M(t.texInfo,t.target)}))},refresh:function(){for(var t=0;ti;++i){for(A=0;Ae;++e)r[e].resize(n);return t.width=t.height=n,t},_reglType:"framebufferCube",destroy:function(){r.forEach((function(e){e.destroy()}))}})},clear:function(){se(b).forEach(p)},restore:function(){I.cur=null,I.next=null,I.dirty=!0,se(b).forEach((function(t){t.framebuffer=e.createFramebuffer(),y(t)}))}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function R(e,t,r,n,i,a,o){function s(e){if(e!==y.currentVAO){var r=t.oes_vertex_array_object;e?r.bindVertexArrayOES(e.vao):r.bindVertexArrayOES(null),y.currentVAO=e}}function l(r){if(r!==y.currentVAO){if(r)r.bindAttrs();else{for(var n=t.angle_instanced_arrays,i=0;i=u.byteLength?l.subdata(u):(l.destroy(),r.buffers[s]=null)),r.buffers[s]||(l=r.buffers[s]=i.create(A,34962,!1,!0)),c.buffer=i.getBuffer(l),c.size=0|c.buffer.dimension,c.normalized=!1,c.type=c.buffer.dtype,c.offset=0,c.stride=0,c.divisor=0,c.state=1,e[s]=1):i.getBuffer(A)?(c.buffer=i.getBuffer(A),c.size=0|c.buffer.dimension,c.normalized=!1,c.type=c.buffer.dtype,c.offset=0,c.stride=0,c.divisor=0,c.state=1):i.getBuffer(A.buffer)?(c.buffer=i.getBuffer(A.buffer),c.size=0|(+A.size||c.buffer.dimension),c.normalized=!!A.normalized||!1,c.type="type"in A?ce[A.type]:c.buffer.dtype,c.offset=0|(A.offset||0),c.stride=0|(A.stride||0),c.divisor=0|(A.divisor||0),c.state=1):"x"in A&&(c.x=+A.x||0,c.y=+A.y||0,c.z=+A.z||0,c.w=+A.w||0,c.state=2)}for(l=0;le&&(e=t.stats.uniformsCount)})),e},r.getMaxAttributesCount=function(){var e=0;return g.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);se(A).forEach(t),A={},se(c).forEach(t),c={},g.forEach((function(t){e.deleteProgram(t.program)})),g.length=0,u={},r.shaderCount=0},program:function(t,n,i,a){var o=u[n];o||(o=u[n]={});var f=o[t];if(f&&(f.refCount++,!a))return f;var h=new s(n,t);return r.shaderCount++,l(h,i,a),f||(o[t]=h),g.push(h),$(h,{destroy:function(){if(h.refCount--,0>=h.refCount){e.deleteProgram(h.program);var t=g.indexOf(h);g.splice(t,1),r.shaderCount--}0>=o[h.vertId].refCount&&(e.deleteShader(c[h.vertId]),delete c[h.vertId],delete u[h.fragId][h.vertId]),Object.keys(u[h.fragId]).length||(e.deleteShader(A[h.fragId]),delete A[h.fragId],delete u[h.fragId])}})},restore:function(){A={},c={};for(var e=0;e>2),r=0;r>5]|=(255&e.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,A,c,u,g,f,h=8*e.length;for(e=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),t[h>>5]|=128<<24-h%32,t[15+(h+64>>9<<4)]=h,c=0;cu;u++){var d;16>u?r[u]=t[u+c]:(g=u,f=U(f=G(f=r[u-2],17)^G(f,19)^f>>>10,r[u-7]),d=G(d=r[u-15],7)^G(d,18)^d>>>3,r[g]=U(U(f,d),r[u-16])),g=U(U(U(U(A,g=G(g=o,6)^G(g,11)^G(g,25)),o&s^~o&l),Re[u]),r[u]),f=U(A=G(A=h,2)^G(A,13)^G(A,22),h&n^h&i^n&i),A=l,l=s,s=o,o=U(a,g),a=i,i=n,n=h,h=U(g,f)}e[0]=U(h,e[0]),e[1]=U(n,e[1]),e[2]=U(i,e[2]),e[3]=U(a,e[3]),e[4]=U(o,e[4]),e[5]=U(s,e[5]),e[6]=U(l,e[6]),e[7]=U(A,e[7])}for(t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}function O(e){for(var t,r="",n=0;n>>4&15)+"0123456789abcdef".charAt(15&t);return r}function P(e){for(var t,r,n="",i=-1;++i=t&&56320<=r&&57343>=r&&(t=65536+((1023&t)<<10)+(1023&r),i++),127>=t?n+=String.fromCharCode(t):2047>=t?n+=String.fromCharCode(192|t>>>6&31,128|63&t):65535>=t?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):2097151>=t&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return n}function G(e,t){return e>>>t|e<<32-t}function U(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function z(e){return Array.prototype.slice.call(e)}function q(e){return z(e).join("")}function H(e){function t(){var e=[],t=[];return $((function(){e.push.apply(e,z(arguments))}),{def:function(){var r="v"+i++;return t.push(r),0"+t+"?"+i+".constant["+t+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",c,"=",a,".createStream(",34962,",",i,".buffer);","}else{",c,"=",a,".getBuffer(",i,".buffer);","}",u,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",c,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",c,");","}"),l}))})),o}function D(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=V((function(e,t){return"number"===typeof r||"boolean"===typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=W(t,(function(e,r){return e.invoke(r,t)}))})),n}function T(e,t,n,i,a){function o(e){var t=l[e];t&&(u[e]=t)}var s=x(e,t),l=b(e,f=C(e,a),a),c=Q(e,a),u=_(e,a),g=w(e,a,s);o("viewport"),o(y("scissor.box"));var f,h=0>1)",s],");")}function t(){r(l,".drawArraysInstancedANGLE(",[h,d,p,s],");")}f&&"null"!==f?m?e():(r("if(",f,"){"),e(),r("}else{"),t(),r("}")):t()}function o(){function e(){r(c+".drawElements("+[h,p,y,d+"<<(("+y+"-5121)>>1)"]+");")}function t(){r(c+".drawArrays("+[h,d,p]+");")}f&&"null"!==f?m?e():(r("if(",f,"){"),e(),r("}else{"),t(),r("}")):t()}var s,l,A=e.shared,c=A.gl,u=A.draw,g=n.draw,f=function(){var i=g.elements,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a),g.elementsActive&&a("if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",u,".","elements",";","if(",i,"){",c,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",A.vao,".currentVAO){",i,"=",e.shared.elements+".getElements("+A.vao,".currentVAO.elements);",ue?"":"if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),h=i("primitive"),d=i("offset"),p=function(){var i=g.count,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a)):i=a.def(u,".","count"),i}();if("number"===typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");le&&(s=i("instances"),l=e.instancing);var y=f+".type",m=g.elements&&j(g.elements)&&!g.vaoActive;le&&("number"!==typeof s||0<=s)?"string"===typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function z(e,t,r,n,i){return i=(t=v()).proc("body",i),le&&(t.instancing=i.def(t.shared.extensions,".angle_instanced_arrays")),e(t,i,r,n),t.compile().body}function q(e,t,r,n){F(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),P(e,t,r,n.attributes,(function(){return!0}))),G(e,t,r,n.uniforms,(function(){return!0}),!1),U(e,t,t,r)}function Z(e,t){var r=e.proc("draw",1);F(e,r),M(e,r,t.context),R(e,r,t.framebuffer),L(e,r,t),N(e,r,t.state),O(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)q(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link((function(r){return z(q,e,t,r,1)})),"(",n,");",o,".call(this,a0);"))}0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(c).forEach((function(t){e+=c[t].stats.size})),e}),{create:function(t,r){function o(t,r){var n=0,a=0,c=32854;if("object"===typeof t&&t?("shape"in t?(n=0|(a=t.shape)[0],a=0|a[1]):("radius"in t&&(n=a=0|t.radius),"width"in t&&(n=0|t.width),"height"in t&&(a=0|t.height)),"format"in t&&(c=s[t.format])):"number"===typeof t?(n=0|t,a="number"===typeof r?0|r:n):t||(n=a=1),n!==A.width||a!==A.height||c!==A.format)return o.width=A.width=n,o.height=A.height=a,A.format=c,e.bindRenderbuffer(36161,A.renderbuffer),e.renderbufferStorage(36161,c,n,a),i.profile&&(A.stats.size=ke[A.format]*A.width*A.height),o.format=l[A.format],o}var A=new a(e.createRenderbuffer());return c[A.id]=A,n.renderbufferCount++,o(t,r),o.resize=function(t,r){var n=0|t,a=0|r||n;return n===A.width&&a===A.height||(o.width=A.width=n,o.height=A.height=a,e.bindRenderbuffer(36161,A.renderbuffer),e.renderbufferStorage(36161,A.format,n,a),i.profile&&(A.stats.size=ke[A.format]*A.width*A.height)),o},o._reglType="renderbuffer",o._renderbuffer=A,i.profile&&(o.stats=A.stats),o.destroy=function(){A.decRef()},o},clear:function(){se(c).forEach(o)},restore:function(){se(c).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)})),e.bindRenderbuffer(36161,null)}}},Te=[];Te[6408]=4,Te[6407]=3;var Me=[];Me[5121]=1,Me[5126]=4,Me[36193]=2;var Re=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Le=["x","y","z","w"],Ne="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Fe={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Oe={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Pe={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ge={cw:2304,ccw:2305},Ue=new K(!1,!1,!1,(function(){})),ze=function(e,t){function r(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null}function n(e,t,n){var i=o.pop()||new r;i.startQueryIndex=e,i.endQueryIndex=t,i.sum=0,i.stats=n,s.push(i)}if(!t.ext_disjoint_timer_query)return null;var i=[],a=[],o=[],s=[],l=[],A=[];return{beginQuery:function(e){var r=i.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,r),a.push(r),n(a.length-1,a.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:n,update:function(){var e,r;if(0!==(e=a.length)){A.length=Math.max(A.length,e+1),l.length=Math.max(l.length,e+1),l[0]=0;var n=A[0]=0;for(r=e=0;r=J.length&&n()}var r=X(J,e);J[r]=t}}}function g(){var e=H.viewport,t=H.scissor_box;e[0]=e[1]=t[0]=t[1]=0,S.viewportWidth=S.framebufferWidth=S.drawingBufferWidth=e[2]=t[2]=p.drawingBufferWidth,S.viewportHeight=S.framebufferHeight=S.drawingBufferHeight=e[3]=t[3]=p.drawingBufferHeight}function f(){S.tick+=1,S.time=d(),g(),q.procs.poll()}function h(){G.refresh(),g(),q.procs.refresh(),x&&x.update()}function d(){return(ne()-w)/1e3}if(!(e=A(e)))return null;var p=e.gl,y=p.getContextAttributes();p.isContextLost();var m=c(p,e);if(!m)return null;var I=i(),C={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},B=e.cachedCode||{},b=m.extensions,x=ze(p,b),w=ne(),Q=p.drawingBufferWidth,_=p.drawingBufferHeight,S={tick:0,time:0,viewportWidth:Q,viewportHeight:_,framebufferWidth:Q,framebufferHeight:_,drawingBufferWidth:Q,drawingBufferHeight:_,pixelRatio:e.pixelRatio},k=(Q={elements:null,primitive:4,count:-1,offset:0,instances:-1},ae(p,b)),M=v(p,C,e,(function(e){return O.destroyBuffer(e)})),F=E(p,b,M,C),O=R(p,b,k,C,M,F,Q),P=L(p,I,C,e),G=D(p,b,k,(function(){q.procs.poll()}),S,C,e),U=De(p,b,k,C,e),z=T(p,b,k,G,U,C),q=Z(p,I,b,k,M,F,G,z,{},O,P,Q,S,x,B,e),H=(I=N(p,z,q.procs.poll,S,y,b,k),q.next),Y=p.canvas,J=[],K=[],j=[],V=[e.onDestroy],W=null;Y&&(Y.addEventListener("webglcontextlost",a,!1),Y.addEventListener("webglcontextrestored",o,!1));var ee=z.setFBO=s({framebuffer:te.define.call(null,1,"framebuffer")});return h(),y=$(s,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var t=0;6>t;++t)ee($({framebuffer:e.framebuffer.faces[t]},e),l);else ee(e,l);else l(null,e)},prop:te.define.bind(null,1),context:te.define.bind(null,2),this:te.define.bind(null,3),draw:s({}),buffer:function(e){return M.create(e,34962,!1,!1)},elements:function(e){return F.create(e,!1)},texture:G.create2D,cube:G.createCube,renderbuffer:U.create,framebuffer:z.create,framebufferCube:z.createCube,vao:O.createVAO,attributes:y,frame:u,on:function(e,t){var r;switch(e){case"frame":return u(t);case"lost":r=K;break;case"restore":r=j;break;case"destroy":r=V}return r.push(t),{cancel:function(){for(var e=0;e4294967295||l(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,A=!0;if("length"in e&&o){var c=o(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(A=!1)}return(n||A||!r)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},29936:function(e,t,r){e.exports=i;var n=r(61252).EventEmitter;function i(){n.call(this)}r(6768)(i,n),i.Readable=r(12348),i.Writable=r(11288),i.Duplex=r(15316),i.Transform=r(22477),i.PassThrough=r(27136),i.finished=r(15932),i.pipeline=r(38180),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"===typeof e.destroy&&e.destroy())}function A(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",A),e.removeListener("error",A),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",A),e.on("error",A),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},92784:function(e){"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"===typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,a,o,s;if("string"===typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.i=t},15316:function(e,t,r){"use strict";var n=r(4168),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var a=r(12348),o=r(11288);r(6768)(c,a);for(var s=i(o.prototype),l=0;l0)if("string"===typeof t||s.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)s.endEmitted?C(e,new E):Q(e,s,t,!0);else if(s.ended)C(e,new I);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?Q(e,s,t,!1):T(e,s)):Q(e,s,t,!1)}else n||(s.reading=!1,T(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(D,e))}function D(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,F(e)}function T(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(M,e,t))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){a("readable nexttick read 0"),e.read(0)}function N(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),F(e),t.flowing&&!t.reading&&e.read(0)}function F(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function P(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(G,t,e))}function G(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?O(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(e){C(this,new v("_read()"))},x.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===i.stdout||e===i.stderr?p:A;function l(t,i){a("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,a("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",l),r.removeListener("end",A),r.removeListener("end",p),r.removeListener("data",g),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function A(){a("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",l);var c=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,F(e))}}(r);e.on("drain",c);var u=!1;function g(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==U(n.pipes,e))&&!u&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){a("onerror",t),p(),e.removeListener("error",f),0===o(e,"error")&&C(e,t)}function h(){e.removeListener("finish",d),p()}function d(){a("onfinish"),e.removeListener("close",h),p()}function p(){a("unpipe"),r.unpipe(e)}return r.on("data",g),function(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",h),e.once("finish",d),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?k(this):n.reading||i.nextTick(L,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(R,this),r},x.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(R,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(N,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,r){r(new d("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,r){var n=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,D(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=u.destroy,x.prototype._undestroy=u.undestroy,x.prototype._destroy=function(e,t){t(e)}},60328:function(e,t,r){"use strict";var n,i=r(4168);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(15932),s=Symbol("lastResolve"),l=Symbol("lastReject"),A=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),g=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function d(e){var t=e[s];if(null!==t){var r=e[f].read();null!==r&&(e[u]=null,e[s]=null,e[l]=null,t(h(r,!1)))}}function p(e){i.nextTick(d,e)}var y=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((a(n={get stream(){return this[f]},next:function(){var e=this,t=this[A];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[A]?r(e[A]):t(h(void 0,!0))}))}));var r,n=this[u];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[g](r,n)}),n)}}(n,this));else{var a=this[f].read();if(null!==a)return Promise.resolve(h(a,!1));r=new Promise(this[g])}return this[u]=r,r}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[f].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),y);e.exports=function(e){var t,r=Object.create(m,(a(t={},f,{value:e,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,A,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,g,{value:function(e,t){var n=r[f].read();n?(r[u]=null,r[s]=null,r[l]=null,e(h(n,!1))):(r[s]=e,r[l]=t)},writable:!0}),t));return r[u]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[u]=null,r[s]=null,r[l]=null,t(e)),void(r[A]=e)}var n=r[s];null!==n&&(r[u]=null,r[s]=null,r[l]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",p.bind(null,r)),r}},47264:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,i=o.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=i,n=s,o.prototype.copy.call(t,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0===(e-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&g.forEach(l),a||(g.forEach(l),u(c))}))}));return t.reduce(A)}},24888:function(e,t,r){"use strict";var n=r(92784).i.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},4776:function(e,t,r){e.exports=r(61252).EventEmitter},86032:function(e,t,r){"use strict";var n=r(30456).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!==typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=A,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=u,t=3;break;default:return this.write=g,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function A(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.o=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},55619:function(e,t,r){var n=r(45408),i=r(86844)("stream-parser");e.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),e._bytes=c,e._skipBytes=u,t&&(e._passthrough=g),t?e._transform=h:e._write=f};var a=-1,o=0,s=1,l=2;function A(e){i("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=a,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function c(e,t){n(!this._parserCallback,'there is already a "callback" set!'),n(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||A(this),i("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=o}function u(e,t){n(!this._parserCallback,'there is already a "callback" set!'),n(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||A(this),i("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=s}function g(e,t){n(!this._parserCallback,'There is already a "callback" set!'),n(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||A(this),i("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=l}function f(e,t,r){this._parserInit||A(this),i("write(%o bytes)",e.length),"function"==typeof t&&(r=t),p(this,e,null,r)}function h(e,t,r){this._parserInit||A(this),i("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),p(this,e,t,r)}function d(e,t,r,n){if(e._parserBytesLeft-=t.length,i("%o bytes left for stream piece",e._parserBytesLeft),e._parserState===o?(e._parserBuffers.push(t),e._parserBuffered+=t.length):e._parserState===l&&r(t),0!==e._parserBytesLeft)return n;var s=e._parserCallback;if(s&&e._parserState===o&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),e._parserState!==o&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=a,e._parserBuffers.splice(0),s){var A=[];t&&A.push(t),r&&A.push(r);var c=s.length>A.length;c&&A.push(y(n));var u=s.apply(e,A);if(!c||n===u)return n}}var p=y((function e(t,r,n,i){return t._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return d(t,r,n,i)}:function(){var a=r.slice(0,t._parserBytesLeft);return d(t,a,n,(function(o){return o?i(o):r.length>a.length?function(){return e(t,r.slice(a.length),n,i)}:void 0}))}}));function y(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}},86844:function(e,t,r){var n=r(4168);function i(){var e;try{e=t.storage.debug}catch(r){}return!e&&"undefined"!==typeof n&&"env"in n&&(e=n.env.DEBUG),e}(t=e.exports=r(89416)).log=function(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))})),e.splice(a,0,n)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(r){}},t.load=i,t.useColors=function(){return!("undefined"===typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(i())},89416:function(e,t,r){var n;function i(e){function r(){if(r.enabled){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(e){if(!((e=String(e)).length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*a;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===A&&!1===isNaN(e))return s.long?o(l=e,i,"day")||o(l,n,"hour")||o(l,r,"minute")||o(l,t,"second")||l+" ms":function(e){return e>=i?Math.round(e/i)+"d":e>=n?Math.round(e/n)+"h":e>=r?Math.round(e/r)+"m":e>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},39956:function(e,t,r){"use strict";var n=r(32868);e.exports=function(e,t,r){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");r?("string"===typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"===typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(e){return 1===e.length&&(e+=e),e})));var i=n.parse(e,{flat:!0,brackets:r.ignore}),a=i[0].split(t);if(r.escape){for(var o=[],s=0;s0;){t=A[A.length-1];var f=e[t];if(a[t]=0&&s[t].push(o[d])}a[t]=h}else{if(n[t]===r[t]){var p=[],y=[],m=0;for(h=l.length-1;h>=0;--h){var I=l[h];if(i[I]=!1,p.push(I),y.push(s[I]),m+=s[I].length,o[I]=u.length,I===t){l.length=h;break}}u.push(p);var v=new Array(m);for(h=0;h1&&(i=1),i<-1&&(i=-1),(e*n-t*r<0?-1:1)*Math.acos(i)};t.default=function(e){var t=e.px,r=e.py,l=e.cx,A=e.cy,c=e.rx,u=e.ry,g=e.xAxisRotation,f=void 0===g?0:g,h=e.largeArcFlag,d=void 0===h?0:h,p=e.sweepFlag,y=void 0===p?0:p,m=[];if(0===c||0===u)return[];var I=Math.sin(f*i/360),v=Math.cos(f*i/360),E=v*(t-l)/2+I*(r-A)/2,C=-I*(t-l)/2+v*(r-A)/2;if(0===E&&0===C)return[];c=Math.abs(c),u=Math.abs(u);var B=Math.pow(E,2)/Math.pow(c,2)+Math.pow(C,2)/Math.pow(u,2);B>1&&(c*=Math.sqrt(B),u*=Math.sqrt(B));var b=function(e,t,r,n,a,o,l,A,c,u,g,f){var h=Math.pow(a,2),d=Math.pow(o,2),p=Math.pow(g,2),y=Math.pow(f,2),m=h*d-h*y-d*p;m<0&&(m=0),m/=h*y+d*p;var I=(m=Math.sqrt(m)*(l===A?-1:1))*a/o*f,v=m*-o/a*g,E=u*I-c*v+(e+r)/2,C=c*I+u*v+(t+n)/2,B=(g-I)/a,b=(f-v)/o,x=(-g-I)/a,w=(-f-v)/o,Q=s(1,0,B,b),_=s(B,b,x,w);return 0===A&&_>0&&(_-=i),1===A&&_<0&&(_+=i),[E,C,Q,_]}(t,r,l,A,c,u,d,y,I,v,E,C),x=n(b,4),w=x[0],Q=x[1],_=x[2],S=x[3],k=Math.abs(S)/(i/4);Math.abs(1-k)<1e-7&&(k=1);var D=Math.max(Math.ceil(k),1);S/=D;for(var T=0;Tt[2]&&(t[2]=A[c+0]),A[c+1]>t[3]&&(t[3]=A[c+1]);return t}},41976:function(e,t,r){"use strict";e.exports=function(e){for(var t,r=[],o=0,s=0,l=0,A=0,c=null,u=null,g=0,f=0,h=0,d=e.length;h4?(o=p[p.length-4],s=p[p.length-3]):(o=g,s=f),r.push(p)}return r};var n=r(92848);function i(e,t,r,n){return["C",e,t,r,n,r,n]}function a(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},20472:function(e,t,r){"use strict";var n,i=r(74840),a=r(21984),o=r(22235),s=r(53520),l=r(29620),A=document.createElement("canvas"),c=A.getContext("2d");e.exports=function(e,t){if(!s(e))throw Error("Argument should be valid svg path string");var r,u;t||(t={}),t.shape?(r=t.shape[0],u=t.shape[1]):(r=A.width=t.w||t.width||200,u=A.height=t.h||t.height||200);var g=Math.min(r,u),f=t.stroke||0,h=t.viewbox||t.viewBox||i(e),d=[r/(h[2]-h[0]),u/(h[3]-h[1])],p=Math.min(d[0]||0,d[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,r,u),c.fillStyle="white",f&&("number"!=typeof f&&(f=1),c.strokeStyle=f>0?"white":"black",c.lineWidth=Math.abs(f)),c.translate(.5*r,.5*u),c.scale(p,p),function(){if(null!=n)return n;var e=document.createElement("canvas").getContext("2d");if(e.canvas.width=e.canvas.height=1,!window.Path2D)return n=!1;var t=new Path2D("M0,0h1v1h-1v-1Z");e.fillStyle="black",e.fill(t);var r=e.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var y=new Path2D(e);c.fill(y),f&&c.stroke(y)}else{var m=a(e);o(c,m),c.fill(),f&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=t.cutoff?t.cutoff:.5,radius:null!=t.radius?t.radius:.5*g})}},49760:function(e,t,r){var n;!function(i){var a=/^\s+/,o=/\s+$/,s=0,l=i.round,A=i.min,c=i.max,u=i.random;function g(e,t){if(t=t||{},(e=e||"")instanceof g)return e;if(!(this instanceof g))return new g(e,t);var r=function(e){var t,r,n,s={r:0,g:0,b:0},l=1,u=null,g=null,f=null,h=!1,d=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(o,"").toLowerCase();var t,r=!1;if(k[e])e=k[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=G.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=G.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=G.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=G.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=G.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=G.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=G.hex8.exec(e))?{r:L(t[1]),g:L(t[2]),b:L(t[3]),a:P(t[4]),format:r?"name":"hex8"}:(t=G.hex6.exec(e))?{r:L(t[1]),g:L(t[2]),b:L(t[3]),format:r?"name":"hex"}:(t=G.hex4.exec(e))?{r:L(t[1]+""+t[1]),g:L(t[2]+""+t[2]),b:L(t[3]+""+t[3]),a:P(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=G.hex3.exec(e))&&{r:L(t[1]+""+t[1]),g:L(t[2]+""+t[2]),b:L(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(t=e.r,r=e.g,n=e.b,s={r:255*M(t,255),g:255*M(r,255),b:255*M(n,255)},h=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(u=F(e.s),g=F(e.v),s=function(e,t,r){e=6*M(e,360),t=M(t,100),r=M(r,100);var n=i.floor(e),a=e-n,o=r*(1-t),s=r*(1-a*t),l=r*(1-(1-a)*t),A=n%6,c=[r,s,o,o,l,r][A],u=[l,r,r,s,o,o][A],g=[o,o,l,r,r,s][A];return{r:255*c,g:255*u,b:255*g}}(e.h,u,g),h=!0,d="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(u=F(e.s),f=F(e.l),s=function(e,t,r){var n,i,a;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=M(e,360),t=M(t,100),r=M(r,100),0===t)n=i=a=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,u,f),h=!0,d="hsl"),e.hasOwnProperty("a")&&(l=e.a)),l=T(l),{ok:h,format:e.format||d,r:A(255,c(s.r,0)),g:A(255,c(s.g,0)),b:A(255,c(s.b,0)),a:l}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=l(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=r.ok,this._tc_id=s++}function f(e,t,r){e=M(e,255),t=M(t,255),r=M(r,255);var n,i,a=c(e,t,r),o=A(e,t,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case e:n=(t-r)/l+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(g(n));return a}function S(e,t){t=t||6;for(var r=g(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(g({h:n,s:i,v:a})),a=(a+s)%1;return o}g.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:i.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=T(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=f(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,i){var a=[N(l(e).toString(16)),N(l(t).toString(16)),N(l(r).toString(16)),N(O(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*M(this._r,255))+"%",g:l(100*M(this._g,255))+"%",b:l(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*M(this._r,255))+"%, "+l(100*M(this._g,255))+"%, "+l(100*M(this._b,255))+"%)":"rgba("+l(100*M(this._r,255))+"%, "+l(100*M(this._g,255))+"%, "+l(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(D[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=g(e);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return g(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(E,arguments)},darken:function(){return this._applyModification(C,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(I,arguments)},spin:function(){return this._applyModification(B,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(_,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(Q,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},g.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:F(e[n]));e=r}return g(e,t)},g.equals=function(e,t){return!(!e||!t)&&g(e).toRgbString()==g(t).toRgbString()},g.random=function(){return g.fromRatio({r:u(),g:u(),b:u()})},g.mix=function(e,t,r){r=0===r?0:r||50;var n=g(e).toRgb(),i=g(t).toRgb(),a=r/100;return g({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},g.readability=function(e,t){var r=g(e),n=g(t);return(i.max(r.getLuminance(),n.getLuminance())+.05)/(i.min(r.getLuminance(),n.getLuminance())+.05)},g.isReadable=function(e,t,r){var n,i,a=g.readability(e,t);switch(i=!1,(n=function(e){var t,r;return t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},g.mostReadable=function(e,t,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var A=0;Al&&(l=n,s=g(t[A]));return g.isReadable(e,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,g.mostReadable(e,["#fff","#000"],r))};var k=g.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"},D=g.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(k);function T(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function M(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(e);return e=A(t,c(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),i.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function R(e){return A(1,c(0,e))}function L(e){return parseInt(e,16)}function N(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function O(e){return i.round(255*parseFloat(e)).toString(16)}function P(e){return L(e)/255}var G=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",r="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+r),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})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function U(e){return!!G.CSS_UNIT.exec(e)}e.exports?e.exports=g:void 0===(n=function(){return g}.call(t,r,t,e))||(e.exports=n)}(Math)},37816:function(e){"use strict";e.exports=r,e.exports.float32=e.exports.float=r,e.exports.fract32=e.exports.fract=function(e,t){if(e.length){if(e instanceof Float32Array)return new Float32Array(e.length);t instanceof Float32Array||(t=r(e));for(var n=0,i=t.length;n":(t.length>100&&(t=t.slice(0,99)+"\u2026"),t=t.replace(i,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},7328:function(e,t,r){"use strict";var n=r(81680),i={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!n(e)&&hasOwnProperty.call(i,typeof e)}},87396:function(e,t,r){"use strict";var n=r(57980),i=r(85488);e.exports=function(e){return i(e)?e:n(e,"%v is not a plain function",arguments[1])}},85488:function(e,t,r){"use strict";var n=r(73384),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(e){return!!n(e)&&!i.test(a.call(e))}},54612:function(e,t,r){"use strict";var n=r(7328);e.exports=function(e){if(!n(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}}},33940:function(e,t,r){"use strict";var n=r(81680),i=r(7328),a=Object.prototype.toString;e.exports=function(e){if(!n(e))return null;if(i(e)){var t=e.toString;if("function"!==typeof t)return null;if(t===a)return null}try{return""+e}catch(r){return null}}},18496:function(e,t,r){"use strict";var n=r(57980),i=r(81680);e.exports=function(e){return i(e)?e:n(e,"Cannot use %v",arguments[1])}},81680:function(e){"use strict";e.exports=function(e){return void 0!==e&&null!==e}},14144:function(e,t,r){"use strict";var n=r(308),i=r(10352),a=r(33576).Buffer;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!==typeof Uint8ClampedArray,s="undefined"!==typeof BigUint64Array,l="undefined"!==typeof BigInt64Array,A=r.g.__TYPEDARRAY_POOL;A.UINT8C||(A.UINT8C=i([32,0])),A.BIGUINT64||(A.BIGUINT64=i([32,0])),A.BIGINT64||(A.BIGINT64=i([32,0])),A.BUFFER||(A.BUFFER=i([32,0]));var c=A.DATA,u=A.BUFFER;function g(e){if(e){var t=e.length||e.byteLength,r=n.log2(t);c[r].push(e)}}function f(e){e=n.nextPow2(e);var t=n.log2(e),r=c[t];return r.length>0?r.pop():new ArrayBuffer(e)}function h(e){return new Uint8Array(f(e),0,e)}function d(e){return new Uint16Array(f(2*e),0,e)}function p(e){return new Uint32Array(f(4*e),0,e)}function y(e){return new Int8Array(f(e),0,e)}function m(e){return new Int16Array(f(2*e),0,e)}function I(e){return new Int32Array(f(4*e),0,e)}function v(e){return new Float32Array(f(4*e),0,e)}function E(e){return new Float64Array(f(8*e),0,e)}function C(e){return o?new Uint8ClampedArray(f(e),0,e):h(e)}function B(e){return s?new BigUint64Array(f(8*e),0,e):null}function b(e){return l?new BigInt64Array(f(8*e),0,e):null}function x(e){return new DataView(f(e),0,e)}function w(e){e=n.nextPow2(e);var t=n.log2(e),r=u[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))u[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);c[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){g(e.buffer)},t.freeArrayBuffer=g,t.freeBuffer=function(e){u[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return f(e);switch(t){case"uint8":return h(e);case"uint16":return d(e);case"uint32":return p(e);case"int8":return y(e);case"int16":return m(e);case"int32":return I(e);case"float":case"float32":return v(e);case"double":case"float64":return E(e);case"uint8_clamped":return C(e);case"bigint64":return b(e);case"biguint64":return B(e);case"buffer":return w(e);case"data":case"dataview":return x(e);default:return null}return null},t.mallocArrayBuffer=f,t.mallocUint8=h,t.mallocUint16=d,t.mallocUint32=p,t.mallocInt8=y,t.mallocInt16=m,t.mallocInt32=I,t.mallocFloat32=t.mallocFloat=v,t.mallocFloat64=t.mallocDouble=E,t.mallocUint8Clamped=C,t.mallocBigUint64=B,t.mallocBigInt64=b,t.mallocDataView=x,t.mallocBuffer=w,t.clearCache=function(){for(var e=0;e<32;++e)A.UINT8[e].length=0,A.UINT16[e].length=0,A.UINT32[e].length=0,A.INT8[e].length=0,A.INT16[e].length=0,A.INT32[e].length=0,A.FLOAT[e].length=0,A.DOUBLE[e].length=0,A.BIGUINT64[e].length=0,A.BIGINT64[e].length=0,A.UINT8C[e].length=0,c[e].length=0,u[e].length=0}},92384:function(e){var t=/[\'\"]/;e.exports=function(e){return e?(t.test(e.charAt(0))&&(e=e.substr(1)),t.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}},45223:function(e){"use strict";e.exports=function(e,t,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),g(n,e,n.depth)}function c(e,t){var r=A.styles[t];return r?"\x1b["+A.colors[r][0]+"m"+e+"\x1b["+A.colors[r][1]+"m":e}function u(e,t){return e}function g(e,r,n){if(e.customInspect&&r&&x(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return I(i)||(i=g(e,i,n)),i}var a=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(I(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),b(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(x(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(B(r))return e.stylize(Date.prototype.toString.call(r),"date");if(b(r))return f(r)}var A,c="",u=!1,C=["{","}"];return d(r)&&(u=!0,C=["[","]"]),x(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(c=" "+RegExp.prototype.toString.call(r)),B(r)&&(c=" "+Date.prototype.toUTCString.call(r)),b(r)&&(c=" "+f(r)),0!==o.length||u&&0!=r.length?n<0?E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),A=u?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(A,c,C)):C[0]+c+C[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),S(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=y(r)?g(e,l.value,null):g(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),v(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"===typeof e}function y(e){return null===e}function m(e){return"number"===typeof e}function I(e){return"string"===typeof e}function v(e){return void 0===e}function E(e){return C(e)&&"[object RegExp]"===w(e)}function C(e){return"object"===typeof e&&null!==e}function B(e){return C(e)&&"[object Date]"===w(e)}function b(e){return C(e)&&("[object Error]"===w(e)||e instanceof Error)}function x(e){return"function"===typeof e}function w(e){return Object.prototype.toString.call(e)}function Q(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(s.test(e)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=A,A.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},A.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(41088),t.isArray=d,t.isBoolean=p,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=I,t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=v,t.isRegExp=E,t.types.isRegExp=E,t.isObject=C,t.isDate=B,t.types.isDate=B,t.isError=b,t.types.isNativeError=b,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=r(75272);var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",function(){var e=new Date,t=[Q(e.getHours()),Q(e.getMinutes()),Q(e.getSeconds())].join(":");return[e.getDate(),_[e.getMonth()],t].join(" ")}(),t.format.apply(t,arguments))},t.inherits=r(6768),t._extend=function(e,t){if(!t||!C(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var k="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function D(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var t;if("function"!==typeof(t=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a-1?t:"Object"===t&&function(e){var t=!1;return n(d,(function(r,n){if(!t)try{r(e),t=g(n,1)}catch(i){}})),t}(e)}return s?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{"$"+r(e)===n&&(t=g(n,1))}catch(i){}})),t}(e):null}},67020:function(e,t,r){var n=r(38700),i=r(50896),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"===typeof e){var r=e.match(l);return r?r[0]:""}var n=this._validateYear(e),i=e.month(),a=""+this.toChineseMonth(n,i);return t&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(e){if("string"===typeof e){var t=e.match(A);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(e){if("string"===typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var i=t[t.length-1];r="i"===i||"I"===i}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!==typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var i=this.intercalaryMonth(e);if(r&&t!==i||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&t<=i?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var i,o=this._validateYear(e,n.local.invalidyear),s=g[o-g[0]],l=s>>9&4095,A=s>>5&15,c=31&s;(i=a.newDate(l,A,c)).add(4-(i.dayOfWeek()||7),"d");var u=this.toJD(e,t,r)-i.toJD();return 1+Math.floor(u/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=u[e-u[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,s,r,n.local.invalidDate);e=this._validateYear(i.year()),t=i.month(),r=i.day();var o=this.isIntercalaryMonth(e,t),s=this.toChineseMonth(e,t),l=function(e,t,r,n,i){var a,o,s;if("object"===typeof e)o=e,a=t||{};else{var l;if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"===typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:e,month:t,day:r,isIntercalary:l}}s=o.day-1;var A,c=u[o.year-u[0]],f=c>>13;A=f&&(o.month>f||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(d>>5&15)-1,(31&d)+s);return a.year=p.getFullYear(),a.month=1+p.getMonth(),a.day=p.getDate(),a}(e,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(e){var t=a.fromJD(e),r=function(e,t,r,n){var i,a;if("object"===typeof e)i=e,a=t||{};else{if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:e,month:t,day:r},a=n||{}}var o=g[i.year-g[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=g[a.year-g[0]];var l,A=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(i.year,i.month-1,i.day);l=Math.round((c-A)/864e5);var f,h=u[a.year-u[0]];for(f=0;f<13;f++){var d=h&1<<12-f?30:29;if(l>13;return!p||f=2&&n<=6},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year()+(i.year()<0?1:0),t=i.month(),(r=i.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},65168:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4===3||e%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},2084:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=e<=0?e+1:e,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(t<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=a},26368:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year(),t=i.month(),e=e<=0?e+1:e,(r=i.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=a},24747:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4===0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year(),t=i.month(),r=i.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((t-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=t-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},65616:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function s(e,t){return o(e-1,t)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o(8+(e-=this.jdEpoch)+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[s(20+(e-=this.jdEpoch),20),s(e+4,13)]},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=a},30632:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidMonth);(e=i.year())<0&&e++;for(var a=i.day(),s=1;s=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=a},73040:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=n.instance(),o=0,s=t,l=e;this._createMissingCalendarData(e);var A=e-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==t&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(A)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(A,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),i=t.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var A=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,A)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=e-(e>=0?474:473),s=474+o(a,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var A=e-this.toJD(l,1,1)+1,c=A<=186?Math.ceil(A/31):Math.ceil((A-6)/30),u=e-this.toJD(l,c,1)+1;return this.newDate(l,c,u)}}),n.calendars.persian=a,n.calendars.jalali=a},51456:function(e,t,r){var n=r(38700),i=r(50896),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),a.leapYear(e)},weekOfYear:function(e,t,r){var i=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(i.year()),a.weekOfYear(e,i.month(),i.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(i.year()),a.toJD(e,i.month(),i.day())},fromJD:function(e){var t=a.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},4592:function(e,t,r){var n=r(38700),i=r(50896),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),a.leapYear(e)},weekOfYear:function(e,t,r){var i=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(i.year()),a.weekOfYear(e,i.month(),i.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(i.year()),a.toJD(e,i.month(),i.day())},fromJD:function(e){var t=a.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},45348:function(e,t,r){var n=r(38700),i=r(50896);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,A=t-o[r-1]+1;return this.newDate(s,l,A)},isValid:function(e,t,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(e=null!=e.year?e.year:e)>=1276&&e<=1500),i},_validate:function(e,t,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},38700:function(e,t,r){var n=r(50896);function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(A.local.invalidDate||A.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function s(){this.shortYearCutoff="+10"}function l(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(i.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,i){return(n=(null!=e&&e.year?e.calendar():"string"===typeof n?this.instance(n,i):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":e[a]+t[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(a.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(A.local.invalidDate||A.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(A.local.differentCalendars||A.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new a(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,A.local.invalidYear||A.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,A.local.invalidYear||A.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,A.local.invalidYear||A.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,A.local.invalidMonth||A.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,A.local.invalidMonth||A.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,A.local.invalidYear||A.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,A.local.invalidDate||A.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),i=e.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);i=e.day(),"y"===r?(e.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(e){for(;ot-1+e.minMonth;)a++,o-=t,t=e.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(l){throw this._validateLevel--,l}},_correctAdd:function(e,t,r,n){if(!this.hasYearZero&&("y"===n||"m"===n)&&(0===t[0]||e.year()>0!==t[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;t=this._add(e,r*i[0]+a*i[1],i[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,A.local.invalidDate||A.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),i="m"===r?t:e.month(),a="d"===r?t:e.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),e.date(n,i,a)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var i=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),A=i-(l>2.5?4716:4715);return A<=0&&A--,this.newDate(A,l,s)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,A.local.invalidDate||A.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var A=e.exports=new i;A.cdate=a,A.baseCalendar=s,A.calendars.gregorian=l},15168:function(e,t,r){var n=r(50896),i=r(38700);n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(e,t){return"string"!==typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!==typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,A=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,u=r.monthNamesShort||this.local.monthNamesShort,g=r.monthNames||this.local.monthNames,f=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;C+n1}),h=function(e,t,r,n){var i=""+t;if(f(e,n))for(;i.length1},I=function(e,r){var n=m(e,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=t.substring(x).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,x);return x+=s[0].length,parseInt(s[0],10)},v=this,E=function(){if("function"===typeof l){m("m");var e=l.call(v,t.substring(x));return x+=e.length,e}return I("m")},C=function(e,r,n,a){for(var o=m(e,a)?n:r,s=0;s-1){f=1,h=d;for(var _=this.daysInMonth(g,f);h>_;_=this.daysInMonth(g,f))f++,h-=_}return u>-1?this.fromJD(u):this.newDate(g,f,h)},determineDate:function(e,t,r,n,i){r&&"object"!==typeof r&&(i=n,n=r,r=null),"string"!==typeof n&&(i=n,n="");var a=this;return t=t?t.newDate():null,e=null==e?t:"string"===typeof e?function(e){try{return a.parseDate(n,e,i)}catch(l){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(e);s;)t.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(e);return t}(e):"number"===typeof e?isNaN(e)||e===1/0||e===-1/0?t:a.today().add(e,"d"):a.newDate(e)}})},21576:function(){},19768:function(){},63436:function(e,t,r){"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"===typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?B(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?B(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=g.exec(e))?new x(t[1],t[2],t[3],1):(t=f.exec(e))?new x(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=h.exec(e))?B(t[1],t[2],t[3],t[4]):(t=d.exec(e))?B(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=p.exec(e))?D(t[1],t[2]/100,t[3]/100,1):(t=y.exec(e))?D(t[1],t[2]/100,t[3]/100,t[4]):m.hasOwnProperty(e)?C(m[e]):"transparent"===e?new x(NaN,NaN,NaN,0):null}function C(e){return new x(e>>16&255,e>>8&255,255&e,1)}function B(e,t,r,n){return n<=0&&(e=t=r=NaN),new x(e,t,r,n)}function b(e,t,r,n){return 1===arguments.length?((i=e)instanceof a||(i=E(i)),i?new x((i=i.rgb()).r,i.g,i.b,i.opacity):new x):new x(e,t,r,null==n?1:n);var i}function x(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function w(){return"#".concat(k(this.r)).concat(k(this.g)).concat(k(this.b))}function Q(){var e=_(this.opacity);return"".concat(1===e?"rgb(":"rgba(").concat(S(this.r),", ").concat(S(this.g),", ").concat(S(this.b)).concat(1===e?")":", ".concat(e,")"))}function _(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function S(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function k(e){return((e=S(e))<16?"0":"")+e.toString(16)}function D(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new M(e,t,r,n)}function T(e){if(e instanceof M)return new M(e.h,e.s,e.l,e.opacity);if(e instanceof a||(e=E(e)),!e)return new M;if(e instanceof M)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=NaN,l=o-i,A=(o+i)/2;return l?(s=t===o?(r-n)/l+6*(r0&&A<1?0:s,new M(s,l,A,e.opacity)}function M(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function R(e){return(e=(e||0)%360)<0?e+360:e}function L(e){return Math.max(0,Math.min(1,e||0))}function N(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function F(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}n(a,E,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:I,formatHex:I,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return T(this).formatHsl()},formatRgb:v,toString:v}),n(x,b,i(a,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new x(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?o:Math.pow(o,e),new x(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},clamp:function(){return new x(S(this.r),S(this.g),S(this.b),_(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:w,formatHex:w,formatHex8:function(){return"#".concat(k(this.r)).concat(k(this.g)).concat(k(this.b)).concat(k(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:Q,toString:Q})),n(M,(function(e,t,r,n){return 1===arguments.length?T(e):new M(e,t,r,null==n?1:n)}),i(a,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new M(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?o:Math.pow(o,e),new M(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new x(N(e>=240?e-240:e+120,i,n),N(e,i,n),N(e<120?e+240:e-120,i,n),this.opacity)},clamp:function(){return new M(R(this.h),L(this.s),L(this.l),_(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=_(this.opacity);return"".concat(1===e?"hsl(":"hsla(").concat(R(this.h),", ").concat(100*L(this.s),"%, ").concat(100*L(this.l),"%").concat(1===e?")":", ".concat(e,")"))}}));var O=function(e){return function(){return e}};function P(e,t){return function(r){return e+r*t}}function G(e){return 1===(e=+e)?U:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):O(isNaN(t)?r:t)}}function U(e,t){var r=t-e;return r?P(e,r):O(isNaN(e)?t:e)}var z=function e(t){var r=G(t);function n(e,t){var n=r((e=b(e)).r,(t=b(t)).r),i=r(e.g,t.g),a=r(e.b,t.b),o=U(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1);function q(e){return function(t){var r,n,i=t.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=na&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:J(r,n)})),a=W.lastIndex;return a{"use strict";var n=r(4141),i=r(3275),a=r(2803),o="data";e.exports=function(e,t){var r=n(t),g=t,f=a;if(r in e.normal)return e.property[e.normal[r]];r.length>4&&r.slice(0,4)===o&&s.test(t)&&("-"===t.charAt(4)?g=function(e){var t=e.slice(5).replace(l,u);return o+t.charAt(0).toUpperCase()+t.slice(1)}(t):t=function(e){var t=e.slice(4);if(l.test(t))return e;t=t.replace(A,c),"-"!==t.charAt(0)&&(t="-"+t);return o+t}(t),f=i);return new f(g,t)};var s=/^data[-\w.:]+$/i,l=/-[a-z]/g,A=/[A-Z]/g;function c(e){return"-"+e.toLowerCase()}function u(e){return e.charAt(1).toUpperCase()}},4509:(e,t,r)=>{"use strict";var n=r(2723),i=r(9366),a=r(8599),o=r(9696),s=r(5349),l=r(7321);e.exports=n([a,i,o,s,l])},5349:(e,t,r)=>{"use strict";var n=r(3498),i=r(6155),a=n.booleanish,o=n.number,s=n.spaceSeparated;e.exports=i({transform:function(e,t){return"role"===t?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:a,ariaAutoComplete:null,ariaBusy:a,ariaChecked:a,ariaColCount:o,ariaColIndex:o,ariaColSpan:o,ariaControls:s,ariaCurrent:null,ariaDescribedBy:s,ariaDetails:null,ariaDisabled:a,ariaDropEffect:s,ariaErrorMessage:null,ariaExpanded:a,ariaFlowTo:s,ariaGrabbed:a,ariaHasPopup:null,ariaHidden:a,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:s,ariaLevel:o,ariaLive:null,ariaModal:a,ariaMultiLine:a,ariaMultiSelectable:a,ariaOrientation:null,ariaOwns:s,ariaPlaceholder:null,ariaPosInSet:o,ariaPressed:a,ariaReadOnly:a,ariaRelevant:null,ariaRequired:a,ariaRoleDescription:s,ariaRowCount:o,ariaRowIndex:o,ariaRowSpan:o,ariaSelected:a,ariaSetSize:o,ariaSort:null,ariaValueMax:o,ariaValueMin:o,ariaValueNow:o,ariaValueText:null,role:null}})},7321:(e,t,r)=>{"use strict";var n=r(3498),i=r(6155),a=r(9010),o=n.boolean,s=n.overloadedBoolean,l=n.booleanish,A=n.number,c=n.spaceSeparated,u=n.commaSeparated;e.exports=i({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:a,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:u,acceptCharset:c,accessKey:c,action:null,allow:null,allowFullScreen:o,allowPaymentRequest:o,allowUserMedia:o,alt:null,as:null,async:o,autoCapitalize:null,autoComplete:c,autoFocus:o,autoPlay:o,capture:o,charSet:null,checked:o,cite:null,className:c,cols:A,colSpan:null,content:null,contentEditable:l,controls:o,controlsList:c,coords:A|u,crossOrigin:null,data:null,dateTime:null,decoding:null,default:o,defer:o,dir:null,dirName:null,disabled:o,download:s,draggable:l,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:o,formTarget:null,headers:c,height:A,hidden:o,high:A,href:null,hrefLang:null,htmlFor:c,httpEquiv:c,id:null,imageSizes:null,imageSrcSet:u,inputMode:null,integrity:null,is:null,isMap:o,itemId:null,itemProp:c,itemRef:c,itemScope:o,itemType:c,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:o,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:o,muted:o,name:null,nonce:null,noModule:o,noValidate:o,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:o,optimum:A,pattern:null,ping:c,placeholder:null,playsInline:o,poster:null,preload:null,readOnly:o,referrerPolicy:null,rel:c,required:o,reversed:o,rows:A,rowSpan:A,sandbox:c,scope:null,scoped:o,seamless:o,selected:o,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:l,src:null,srcDoc:null,srcLang:null,srcSet:u,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:o,useMap:null,value:l,width:A,wrap:null,align:null,aLink:null,archive:c,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:o,declare:o,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:o,noHref:o,noShade:o,noWrap:o,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:l,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:o,disableRemotePlayback:o,prefix:null,property:null,results:A,security:null,unselectable:null}})},9010:(e,t,r)=>{"use strict";var n=r(2367);e.exports=function(e,t){return n(e,t.toLowerCase())}},2367:e=>{"use strict";e.exports=function(e,t){return t in e?e[t]:t}},6155:(e,t,r)=>{"use strict";var n=r(4141),i=r(5224),a=r(3275);e.exports=function(e){var t,r,o=e.space,s=e.mustUseProperty||[],l=e.attributes||{},A=e.properties,c=e.transform,u={},g={};for(t in A)r=new a(t,c(l,t),A[t],o),-1!==s.indexOf(t)&&(r.mustUseProperty=!0),u[t]=r,g[n(t)]=t,g[n(r.attribute)]=t;return new i(u,g,o)}},3275:(e,t,r)=>{"use strict";var n=r(2803),i=r(3498);e.exports=s,s.prototype=new n,s.prototype.defined=!0;var a=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],o=a.length;function s(e,t,r,s){var A,c=-1;for(l(this,"space",s),n.call(this,e,t);++c{"use strict";e.exports=r;var t=r.prototype;function r(e,t){this.property=e,this.attribute=t}t.space=null,t.attribute=null,t.property=null,t.boolean=!1,t.booleanish=!1,t.overloadedBoolean=!1,t.number=!1,t.commaSeparated=!1,t.spaceSeparated=!1,t.commaOrSpaceSeparated=!1,t.mustUseProperty=!1,t.defined=!1},2723:(e,t,r)=>{"use strict";var n=r(49),i=r(5224);e.exports=function(e){var t,r,a=e.length,o=[],s=[],l=-1;for(;++l{"use strict";e.exports=r;var t=r.prototype;function r(e,t,r){this.property=e,this.normal=t,r&&(this.space=r)}t.space=null,t.normal={},t.property={}},3498:(e,t)=>{"use strict";var r=0;function n(){return Math.pow(2,++r)}t.boolean=n(),t.booleanish=n(),t.overloadedBoolean=n(),t.number=n(),t.spaceSeparated=n(),t.commaSeparated=n(),t.commaOrSpaceSeparated=n()},9366:(e,t,r)=>{"use strict";var n=r(6155);e.exports=n({space:"xlink",transform:function(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}})},8599:(e,t,r)=>{"use strict";var n=r(6155);e.exports=n({space:"xml",transform:function(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}})},9696:(e,t,r)=>{"use strict";var n=r(6155),i=r(9010);e.exports=n({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:i,properties:{xmlns:null,xmlnsXLink:null}})},4141:e=>{"use strict";e.exports=function(e){return e.toLowerCase()}},2730:(e,t,r)=>{"use strict";var n=r(5043),i=r(8853);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r