diff --git "a/gradio-modified/templates/frontend/assets/index.03f37f65.js" "b/gradio-modified/templates/frontend/assets/index.03f37f65.js" new file mode 100644--- /dev/null +++ "b/gradio-modified/templates/frontend/assets/index.03f37f65.js" @@ -0,0 +1,3744 @@ +import{S as by,i as _y,s as wy,w as Fp,b as Aa,f as uf,g as zf,x as cu,n as cf,e as Gh,F as TG,J as FD,I as gA,O as AG,c as u0,m as c0,L as MG,j as Bh,k as jh,o as f0,K as Z4,ap as Cf,B as SG,D as EG,E as CG,a5 as OG,a6 as M5,M as bC,t as LG,h as PG,a as J4,P as DG,R as IG,T as zG,U as RG,V as FG}from"./index.396f4a72.js";import{c as Ro,a as Jx,g as NG}from"./_commonjsHelpers.88e99c8f.js";import{g as BG}from"./color.509e5f03.js";import{a as Vv,n as jG,b as UG,c as V2,t as b0,f as K4,p as VG,d as qG,e as HG,g as ND,h as $G,i as GG,j as Yo,k as Bm,l as WG,_ as BD,m as jD,x as YG,y as XG,o as Zh,R as q2,r as UD,q as mA,s as vA,C as yA,u as _C,v as wC,w as H2,z as Xp,A as Q4,B as zl,D as ky,E as ZG,F as JG,G as KG,H as QG,I as eW,J as tW,K as $2,L as nW,M as rW,N as iW,O as aW,P as kC,Q as jm,S as xA,T as G2,U as TC,V as Ed,W as W2,X as oW,Y as cp,Z as sW,$ as ek,a0 as lW,a1 as c_,a2 as uW}from"./linear.955f0731.js";import{d as cW}from"./dsv.7fe76a93.js";import{B as fW}from"./BlockLabel.37da86a3.js";function hW(t){let n,e,o,f,r,a,u;return{c(){n=Fp("svg"),e=Fp("circle"),o=Fp("circle"),f=Fp("circle"),r=Fp("circle"),a=Fp("circle"),u=Fp("path"),Aa(e,"cx","20"),Aa(e,"cy","4"),Aa(e,"r","2"),Aa(e,"fill","currentColor"),Aa(o,"cx","8"),Aa(o,"cy","16"),Aa(o,"r","2"),Aa(o,"fill","currentColor"),Aa(f,"cx","28"),Aa(f,"cy","12"),Aa(f,"r","2"),Aa(f,"fill","currentColor"),Aa(r,"cx","11"),Aa(r,"cy","7"),Aa(r,"r","2"),Aa(r,"fill","currentColor"),Aa(a,"cx","16"),Aa(a,"cy","24"),Aa(a,"r","2"),Aa(a,"fill","currentColor"),Aa(u,"fill","currentColor"),Aa(u,"d","M30 3.413L28.586 2L4 26.585V2H2v26a2 2 0 0 0 2 2h26v-2H5.413Z"),Aa(n,"xmlns","http://www.w3.org/2000/svg"),Aa(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),Aa(n,"aria-hidden","true"),Aa(n,"role","img"),Aa(n,"class","iconify iconify--carbon"),Aa(n,"width","100%"),Aa(n,"height","100%"),Aa(n,"preserveAspectRatio","xMidYMid meet"),Aa(n,"viewBox","0 0 32 32")},m(c,i){uf(c,n,i),zf(n,e),zf(n,o),zf(n,f),zf(n,r),zf(n,a),zf(n,u)},p:cu,i:cu,o:cu,d(c){c&&cf(n)}}}class VD extends by{constructor(n){super(),_y(this,n,null,hW,wy,{})}}var qD={exports:{}};(function(t,n){(function(e){t.exports=e()})(function(){return function e(o,f,r){function a(i,s){if(!f[i]){if(!o[i]){var l=typeof Jx=="function"&&Jx;if(!s&&l)return l(i,!0);if(u)return u(i,!0);var d=new Error("Cannot find module '"+i+"'");throw d.code="MODULE_NOT_FOUND",d}var h=f[i]={exports:{}};o[i][0].call(h.exports,function(m){return a(o[i][1][m]||m)},h,h.exports,e,o,f,r)}return f[i].exports}for(var u=typeof Jx=="function"&&Jx,c=0;c: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:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#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 transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",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 u in a){var c=u.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");r.addStyleRule(c,a[u])}},{"../src/lib":503}],2:[function(e,o,f){o.exports=e("../src/transforms/aggregate")},{"../src/transforms/aggregate":1118}],3:[function(e,o,f){o.exports=e("../src/traces/bar")},{"../src/traces/bar":656}],4:[function(e,o,f){o.exports=e("../src/traces/barpolar")},{"../src/traces/barpolar":669}],5:[function(e,o,f){o.exports=e("../src/traces/box")},{"../src/traces/box":679}],6:[function(e,o,f){o.exports=e("../src/components/calendars")},{"../src/components/calendars":364}],7:[function(e,o,f){o.exports=e("../src/traces/candlestick")},{"../src/traces/candlestick":688}],8:[function(e,o,f){o.exports=e("../src/traces/carpet")},{"../src/traces/carpet":707}],9:[function(e,o,f){o.exports=e("../src/traces/choropleth")},{"../src/traces/choropleth":721}],10:[function(e,o,f){o.exports=e("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":728}],11:[function(e,o,f){o.exports=e("../src/traces/cone")},{"../src/traces/cone":734}],12:[function(e,o,f){o.exports=e("../src/traces/contour")},{"../src/traces/contour":749}],13:[function(e,o,f){o.exports=e("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":760}],14:[function(e,o,f){o.exports=e("../src/core")},{"../src/core":481}],15:[function(e,o,f){o.exports=e("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":768}],16:[function(e,o,f){o.exports=e("../src/transforms/filter")},{"../src/transforms/filter":1119}],17:[function(e,o,f){o.exports=e("../src/traces/funnel")},{"../src/traces/funnel":778}],18:[function(e,o,f){o.exports=e("../src/traces/funnelarea")},{"../src/traces/funnelarea":787}],19:[function(e,o,f){o.exports=e("../src/transforms/groupby")},{"../src/transforms/groupby":1120}],20:[function(e,o,f){o.exports=e("../src/traces/heatmap")},{"../src/traces/heatmap":800}],21:[function(e,o,f){o.exports=e("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":811}],22:[function(e,o,f){o.exports=e("../src/traces/histogram")},{"../src/traces/histogram":823}],23:[function(e,o,f){o.exports=e("../src/traces/histogram2d")},{"../src/traces/histogram2d":829}],24:[function(e,o,f){o.exports=e("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":833}],25:[function(e,o,f){o.exports=e("../src/traces/icicle")},{"../src/traces/icicle":839}],26:[function(e,o,f){o.exports=e("../src/traces/image")},{"../src/traces/image":852}],27:[function(e,o,f){var r=e("./core");r.register([e("./bar"),e("./box"),e("./heatmap"),e("./histogram"),e("./histogram2d"),e("./histogram2dcontour"),e("./contour"),e("./scatterternary"),e("./violin"),e("./funnel"),e("./waterfall"),e("./image"),e("./pie"),e("./sunburst"),e("./treemap"),e("./icicle"),e("./funnelarea"),e("./scatter3d"),e("./surface"),e("./isosurface"),e("./volume"),e("./mesh3d"),e("./cone"),e("./streamtube"),e("./scattergeo"),e("./choropleth"),e("./scattergl"),e("./splom"),e("./pointcloud"),e("./heatmapgl"),e("./parcoords"),e("./parcats"),e("./scattermapbox"),e("./choroplethmapbox"),e("./densitymapbox"),e("./sankey"),e("./indicator"),e("./table"),e("./carpet"),e("./scattercarpet"),e("./contourcarpet"),e("./ohlc"),e("./candlestick"),e("./scatterpolar"),e("./scatterpolargl"),e("./barpolar"),e("./scattersmith"),e("./aggregate"),e("./filter"),e("./groupby"),e("./sort"),e("./calendars")]),o.exports=r},{"./aggregate":2,"./bar":3,"./barpolar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./choroplethmapbox":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./densitymapbox":15,"./filter":16,"./funnel":17,"./funnelarea":18,"./groupby":19,"./heatmap":20,"./heatmapgl":21,"./histogram":22,"./histogram2d":23,"./histogram2dcontour":24,"./icicle":25,"./image":26,"./indicator":28,"./isosurface":29,"./mesh3d":30,"./ohlc":31,"./parcats":32,"./parcoords":33,"./pie":34,"./pointcloud":35,"./sankey":36,"./scatter3d":37,"./scattercarpet":38,"./scattergeo":39,"./scattergl":40,"./scattermapbox":41,"./scatterpolar":42,"./scatterpolargl":43,"./scattersmith":44,"./scatterternary":45,"./sort":46,"./splom":47,"./streamtube":48,"./sunburst":49,"./surface":50,"./table":51,"./treemap":52,"./violin":53,"./volume":54,"./waterfall":55}],28:[function(e,o,f){o.exports=e("../src/traces/indicator")},{"../src/traces/indicator":860}],29:[function(e,o,f){o.exports=e("../src/traces/isosurface")},{"../src/traces/isosurface":866}],30:[function(e,o,f){o.exports=e("../src/traces/mesh3d")},{"../src/traces/mesh3d":871}],31:[function(e,o,f){o.exports=e("../src/traces/ohlc")},{"../src/traces/ohlc":876}],32:[function(e,o,f){o.exports=e("../src/traces/parcats")},{"../src/traces/parcats":885}],33:[function(e,o,f){o.exports=e("../src/traces/parcoords")},{"../src/traces/parcoords":896}],34:[function(e,o,f){o.exports=e("../src/traces/pie")},{"../src/traces/pie":907}],35:[function(e,o,f){o.exports=e("../src/traces/pointcloud")},{"../src/traces/pointcloud":916}],36:[function(e,o,f){o.exports=e("../src/traces/sankey")},{"../src/traces/sankey":922}],37:[function(e,o,f){o.exports=e("../src/traces/scatter3d")},{"../src/traces/scatter3d":960}],38:[function(e,o,f){o.exports=e("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":967}],39:[function(e,o,f){o.exports=e("../src/traces/scattergeo")},{"../src/traces/scattergeo":975}],40:[function(e,o,f){o.exports=e("../src/traces/scattergl")},{"../src/traces/scattergl":989}],41:[function(e,o,f){o.exports=e("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":999}],42:[function(e,o,f){o.exports=e("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1007}],43:[function(e,o,f){o.exports=e("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1015}],44:[function(e,o,f){o.exports=e("../src/traces/scattersmith")},{"../src/traces/scattersmith":1022}],45:[function(e,o,f){o.exports=e("../src/traces/scatterternary")},{"../src/traces/scatterternary":1030}],46:[function(e,o,f){o.exports=e("../src/transforms/sort")},{"../src/transforms/sort":1122}],47:[function(e,o,f){o.exports=e("../src/traces/splom")},{"../src/traces/splom":1040}],48:[function(e,o,f){o.exports=e("../src/traces/streamtube")},{"../src/traces/streamtube":1048}],49:[function(e,o,f){o.exports=e("../src/traces/sunburst")},{"../src/traces/sunburst":1056}],50:[function(e,o,f){o.exports=e("../src/traces/surface")},{"../src/traces/surface":1065}],51:[function(e,o,f){o.exports=e("../src/traces/table")},{"../src/traces/table":1073}],52:[function(e,o,f){o.exports=e("../src/traces/treemap")},{"../src/traces/treemap":1084}],53:[function(e,o,f){o.exports=e("../src/traces/violin")},{"../src/traces/violin":1097}],54:[function(e,o,f){o.exports=e("../src/traces/volume")},{"../src/traces/volume":1105}],55:[function(e,o,f){o.exports=e("../src/traces/waterfall")},{"../src/traces/waterfall":1113}],56:[function(e,o,f){(function(r,a){typeof f=="object"&&o!==void 0?a(f,e("d3-array"),e("d3-collection"),e("d3-shape"),e("elementary-circuits-directed-graph")):a(r.d3=r.d3||{},r.d3,r.d3,r.d3,null)})(this,function(r,a,u,c,i){function s(ie){return ie.target.depth}function l(ie,ae){return ie.sourceLinks.length?ie.depth:ae-1}function d(ie){return function(){return ie}}i=i&&i.hasOwnProperty("default")?i.default:i;var h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ie){return typeof ie}:function(ie){return ie&&typeof Symbol=="function"&&ie.constructor===Symbol&&ie!==Symbol.prototype?"symbol":typeof ie};function m(ie,ae){return p(ie.source,ae.source)||ie.index-ae.index}function g(ie,ae){return p(ie.target,ae.target)||ie.index-ae.index}function p(ie,ae){return ie.partOfCycle===ae.partOfCycle?ie.y0-ae.y0:ie.circularLinkType==="top"||ae.circularLinkType==="bottom"?-1:1}function v(ie){return ie.value}function y(ie){return(ie.y0+ie.y1)/2}function x(ie){return y(ie.source)}function w(ie){return y(ie.target)}function k(ie){return ie.index}function b(ie){return ie.nodes}function T(ie){return ie.links}function _(ie,ae){var ue=ie.get(ae);if(!ue)throw new Error("missing: "+ae);return ue}function M(ie,ae){return ae(ie)}function A(ie,ae,ue){var le=0;if(ue===null){for(var ge=[],fe=0;fe1||ge>1)}function R(ie,ae,ue){return ie.sort(L),ie.forEach(function(le,ge){var fe,me,_e=0;if(Q(le,ue)&&O(le))le.circularPathData.verticalBuffer=_e+le.width/2;else{for(var we=0;weme.source.column)){var Te=ie[we].circularPathData.verticalBuffer+ie[we].width/2+ae;_e=Te>_e?Te:_e}le.circularPathData.verticalBuffer=_e+le.width/2}}),ie}function z(ie,ae,ue,le){var ge=a.min(ie.links,function(fe){return fe.source.y0});ie.links.forEach(function(fe){fe.circular&&(fe.circularPathData={})}),R(ie.links.filter(function(fe){return fe.circularLinkType=="top"}),ae,le),R(ie.links.filter(function(fe){return fe.circularLinkType=="bottom"}),ae,le),ie.links.forEach(function(fe){if(fe.circular){if(fe.circularPathData.arcRadius=fe.width+10,fe.circularPathData.leftNodeBuffer=5,fe.circularPathData.rightNodeBuffer=5,fe.circularPathData.sourceWidth=fe.source.x1-fe.source.x0,fe.circularPathData.sourceX=fe.source.x0+fe.circularPathData.sourceWidth,fe.circularPathData.targetX=fe.target.x0,fe.circularPathData.sourceY=fe.y0,fe.circularPathData.targetY=fe.y1,Q(fe,le)&&O(fe))fe.circularPathData.leftSmallArcRadius=10+fe.width/2,fe.circularPathData.leftLargeArcRadius=10+fe.width/2,fe.circularPathData.rightSmallArcRadius=10+fe.width/2,fe.circularPathData.rightLargeArcRadius=10+fe.width/2,fe.circularLinkType=="bottom"?(fe.circularPathData.verticalFullExtent=fe.source.y1+25+fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.rightLargeArcRadius):(fe.circularPathData.verticalFullExtent=fe.source.y0-25-fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.rightLargeArcRadius);else{var me=fe.source.column,_e=fe.circularLinkType,we=ie.links.filter(function(de){return de.source.column==me&&de.circularLinkType==_e});fe.circularLinkType=="bottom"?we.sort(N):we.sort(P);var Te=0;we.forEach(function(de,ye){de.circularLinkID==fe.circularLinkID&&(fe.circularPathData.leftSmallArcRadius=10+fe.width/2+Te,fe.circularPathData.leftLargeArcRadius=10+fe.width/2+ye*ae+Te),Te+=de.width}),me=fe.target.column,we=ie.links.filter(function(de){return de.target.column==me&&de.circularLinkType==_e}),fe.circularLinkType=="bottom"?we.sort(G):we.sort(B),Te=0,we.forEach(function(de,ye){de.circularLinkID==fe.circularLinkID&&(fe.circularPathData.rightSmallArcRadius=10+fe.width/2+Te,fe.circularPathData.rightLargeArcRadius=10+fe.width/2+ye*ae+Te),Te+=de.width}),fe.circularLinkType=="bottom"?(fe.circularPathData.verticalFullExtent=Math.max(ue,fe.source.y1,fe.target.y1)+25+fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.rightLargeArcRadius):(fe.circularPathData.verticalFullExtent=ge-25-fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.rightLargeArcRadius)}fe.circularPathData.leftInnerExtent=fe.circularPathData.sourceX+fe.circularPathData.leftNodeBuffer,fe.circularPathData.rightInnerExtent=fe.circularPathData.targetX-fe.circularPathData.rightNodeBuffer,fe.circularPathData.leftFullExtent=fe.circularPathData.sourceX+fe.circularPathData.leftLargeArcRadius+fe.circularPathData.leftNodeBuffer,fe.circularPathData.rightFullExtent=fe.circularPathData.targetX-fe.circularPathData.rightLargeArcRadius-fe.circularPathData.rightNodeBuffer}if(fe.circular)fe.path=function(de){var ye="";return ye=de.circularLinkType=="top"?"M"+de.circularPathData.sourceX+" "+de.circularPathData.sourceY+" L"+de.circularPathData.leftInnerExtent+" "+de.circularPathData.sourceY+" A"+de.circularPathData.leftLargeArcRadius+" "+de.circularPathData.leftSmallArcRadius+" 0 0 0 "+de.circularPathData.leftFullExtent+" "+(de.circularPathData.sourceY-de.circularPathData.leftSmallArcRadius)+" L"+de.circularPathData.leftFullExtent+" "+de.circularPathData.verticalLeftInnerExtent+" A"+de.circularPathData.leftLargeArcRadius+" "+de.circularPathData.leftLargeArcRadius+" 0 0 0 "+de.circularPathData.leftInnerExtent+" "+de.circularPathData.verticalFullExtent+" L"+de.circularPathData.rightInnerExtent+" "+de.circularPathData.verticalFullExtent+" A"+de.circularPathData.rightLargeArcRadius+" "+de.circularPathData.rightLargeArcRadius+" 0 0 0 "+de.circularPathData.rightFullExtent+" "+de.circularPathData.verticalRightInnerExtent+" L"+de.circularPathData.rightFullExtent+" "+(de.circularPathData.targetY-de.circularPathData.rightSmallArcRadius)+" A"+de.circularPathData.rightLargeArcRadius+" "+de.circularPathData.rightSmallArcRadius+" 0 0 0 "+de.circularPathData.rightInnerExtent+" "+de.circularPathData.targetY+" L"+de.circularPathData.targetX+" "+de.circularPathData.targetY:"M"+de.circularPathData.sourceX+" "+de.circularPathData.sourceY+" L"+de.circularPathData.leftInnerExtent+" "+de.circularPathData.sourceY+" A"+de.circularPathData.leftLargeArcRadius+" "+de.circularPathData.leftSmallArcRadius+" 0 0 1 "+de.circularPathData.leftFullExtent+" "+(de.circularPathData.sourceY+de.circularPathData.leftSmallArcRadius)+" L"+de.circularPathData.leftFullExtent+" "+de.circularPathData.verticalLeftInnerExtent+" A"+de.circularPathData.leftLargeArcRadius+" "+de.circularPathData.leftLargeArcRadius+" 0 0 1 "+de.circularPathData.leftInnerExtent+" "+de.circularPathData.verticalFullExtent+" L"+de.circularPathData.rightInnerExtent+" "+de.circularPathData.verticalFullExtent+" A"+de.circularPathData.rightLargeArcRadius+" "+de.circularPathData.rightLargeArcRadius+" 0 0 1 "+de.circularPathData.rightFullExtent+" "+de.circularPathData.verticalRightInnerExtent+" L"+de.circularPathData.rightFullExtent+" "+(de.circularPathData.targetY+de.circularPathData.rightSmallArcRadius)+" A"+de.circularPathData.rightLargeArcRadius+" "+de.circularPathData.rightSmallArcRadius+" 0 0 1 "+de.circularPathData.rightInnerExtent+" "+de.circularPathData.targetY+" L"+de.circularPathData.targetX+" "+de.circularPathData.targetY,ye}(fe);else{var Oe=c.linkHorizontal().source(function(de){return[de.source.x0+(de.source.x1-de.source.x0),de.y0]}).target(function(de){return[de.target.x0,de.y1]});fe.path=Oe(fe)}})}function L(ie,ae){return W(ie)==W(ae)?ie.circularLinkType=="bottom"?N(ie,ae):P(ie,ae):W(ae)-W(ie)}function P(ie,ae){return ie.y0-ae.y0}function N(ie,ae){return ae.y0-ie.y0}function B(ie,ae){return ie.y1-ae.y1}function G(ie,ae){return ae.y1-ie.y1}function W(ie){return ie.target.column-ie.source.column}function K(ie){return ie.target.x0-ie.source.x1}function te(ie,ae){var ue=E(ie),le=K(ae)/Math.tan(ue);return H(ie)=="up"?ie.y1+le:ie.y1-le}function Y(ie,ae){var ue=E(ie),le=K(ae)/Math.tan(ue);return H(ie)=="up"?ie.y1-le:ie.y1+le}function Z(ie,ae,ue,le){ie.links.forEach(function(ge){if(!ge.circular&&ge.target.column-ge.source.column>1){var fe=ge.source.column+1,me=ge.target.column-1,_e=1,we=me-fe+1;for(_e=1;fe<=me;fe++,_e++)ie.nodes.forEach(function(Te){if(Te.column==fe){var Oe,de=_e/(we+1),ye=Math.pow(1-de,3),Me=3*de*Math.pow(1-de,2),ke=3*Math.pow(de,2)*(1-de),Ee=Math.pow(de,3),ze=ye*ge.y0+Me*ge.y0+ke*ge.y1+Ee*ge.y1,Fe=ze-ge.width/2,Ve=ze+ge.width/2;Fe>Te.y0&&FeTe.y0&&VeTe.y1)&&(Oe=Ve-Te.y0+10,Te=U(Te,Oe,ae,ue),ie.nodes.forEach(function(Ke){M(Ke,le)!=M(Te,le)&&Ke.column==Te.column&&Ke.y0Te.y1&&U(Ke,Oe,ae,ue)}))}})}})}function re(ie,ae){return ie.y0>ae.y0&&ie.y0ae.y0&&ie.y1ae.y1}function U(ie,ae,ue,le){return ie.y0+ae>=ue&&ie.y1+ae<=le&&(ie.y0=ie.y0+ae,ie.y1=ie.y1+ae,ie.targetLinks.forEach(function(ge){ge.y1=ge.y1+ae}),ie.sourceLinks.forEach(function(ge){ge.y0=ge.y0+ae})),ie}function q(ie,ae,ue,le){ie.nodes.forEach(function(ge){le&&ge.y+(ge.y1-ge.y0)>ae&&(ge.y=ge.y-(ge.y+(ge.y1-ge.y0)-ae));var fe=ie.links.filter(function(we){return M(we.source,ue)==M(ge,ue)}),me=fe.length;me>1&&fe.sort(function(we,Te){if(!we.circular&&!Te.circular){if(we.target.column==Te.target.column||!ne(we,Te))return we.y1-Te.y1;if(we.target.column>Te.target.column){var Oe=Y(Te,we);return we.y1-Oe}if(Te.target.column>we.target.column)return Y(we,Te)-Te.y1}return we.circular&&!Te.circular?we.circularLinkType=="top"?-1:1:Te.circular&&!we.circular?Te.circularLinkType=="top"?1:-1:we.circular&&Te.circular?we.circularLinkType===Te.circularLinkType&&we.circularLinkType=="top"?we.target.column===Te.target.column?we.target.y1-Te.target.y1:Te.target.column-we.target.column:we.circularLinkType===Te.circularLinkType&&we.circularLinkType=="bottom"?we.target.column===Te.target.column?Te.target.y1-we.target.y1:we.target.column-Te.target.column:we.circularLinkType=="top"?-1:1:void 0});var _e=ge.y0;fe.forEach(function(we){we.y0=_e+we.width/2,_e+=we.width}),fe.forEach(function(we,Te){if(we.circularLinkType=="bottom"){for(var Oe=Te+1,de=0;Oe1&&ge.sort(function(_e,we){if(!_e.circular&&!we.circular){if(_e.source.column==we.source.column||!ne(_e,we))return _e.y0-we.y0;if(we.source.column<_e.source.column){var Te=te(we,_e);return _e.y0-Te}if(_e.source.column0?"up":"down"}function Q(ie,ae){return M(ie.source,ae)==M(ie.target,ae)}function ee(ie,ae,ue){var le=ie.nodes,ge=ie.links,fe=!1,me=!1;if(ge.forEach(function(Te){Te.circularLinkType=="top"?fe=!0:Te.circularLinkType=="bottom"&&(me=!0)}),fe==0||me==0){var _e=a.min(le,function(Te){return Te.y0}),we=(ue-ae)/(a.max(le,function(Te){return Te.y1})-_e);le.forEach(function(Te){var Oe=(Te.y1-Te.y0)*we;Te.y0=(Te.y0-_e)*we,Te.y1=Te.y0+Oe}),ge.forEach(function(Te){Te.y0=(Te.y0-_e)*we,Te.y1=(Te.y1-_e)*we,Te.width=Te.width*we})}}r.sankeyCircular=function(){var ie,ae,ue=0,le=0,ge=1,fe=1,me=24,_e=k,we=l,Te=b,Oe=T,de=32,ye=2,Me=null;function ke(){var Re={nodes:Te.apply(null,arguments),links:Oe.apply(null,arguments)};Ee(Re),A(Re,_e,Me),ze(Re),Fe(Re),S(Re,_e),Ve(Re,de,_e),Ke(Re);for(var qe=4,We=0;We0?Be+25+10:Be,bottom:Ge=Ge>0?Ge+25+10:Ge,left:dt=dt>0?dt+25+10:dt,right:Tt=Tt>0?Tt+25+10:Tt}}(Re),Wt=function(Jt,Be){var Ge=a.max(Jt.nodes,function(Ae){return Ae.column}),Tt=ge-ue,dt=fe-le,Pe=Tt/(Tt+Be.right+Be.left),Ie=dt/(dt+Be.top+Be.bottom);return ue=ue*Pe+Be.left,ge=Be.right==0?ge:ge*Pe,le=le*Ie+Be.top,fe*=Ie,Jt.nodes.forEach(function(Ae){Ae.x0=ue+Ae.column*((ge-ue-me)/Ge),Ae.x1=Ae.x0+me}),Ie}(Re,Ot);et*=Wt,Re.links.forEach(function(Jt){Jt.width=Jt.value*et}),Ye.forEach(function(Jt){var Be=Jt.length;Jt.forEach(function(Ge,Tt){Ge.depth==Ye.length-1&&Be==1||Ge.depth==0&&Be==1?(Ge.y0=fe/2-Ge.value*et,Ge.y1=Ge.y0+Ge.value*et):Ge.partOfCycle?D(Ge,At)==0?(Ge.y0=fe/2+Tt,Ge.y1=Ge.y0+Ge.value*et):Ge.circularLinkType=="top"?(Ge.y0=le+Tt,Ge.y1=Ge.y0+Ge.value*et):(Ge.y0=fe-Ge.value*et-Tt,Ge.y1=Ge.y0+Ge.value*et):Ot.top==0||Ot.bottom==0?(Ge.y0=(fe-le)/Be*Tt,Ge.y1=Ge.y0+Ge.value*et):(Ge.y0=(fe-le)/2-Be/2+Tt,Ge.y1=Ge.y0+Ge.value*et)})})})(We),Pt();for(var nt=1,ft=qe;ft>0;--ft)vt(nt*=.99,We),Pt();function vt(At,at){var et=Ye.length;Ye.forEach(function(Ot){var Wt=Ot.length,Jt=Ot[0].depth;Ot.forEach(function(Be){var Ge;if((Be.sourceLinks.length||Be.targetLinks.length)&&!(Be.partOfCycle&&D(Be,at)>0))if(Jt==0&&Wt==1)Ge=Be.y1-Be.y0,Be.y0=fe/2-Ge/2,Be.y1=fe/2+Ge/2;else if(Jt==et-1&&Wt==1)Ge=Be.y1-Be.y0,Be.y0=fe/2-Ge/2,Be.y1=fe/2+Ge/2;else{var Tt=a.mean(Be.sourceLinks,w),dt=a.mean(Be.targetLinks,x),Pe=((Tt&&dt?(Tt+dt)/2:Tt||dt)-y(Be))*At;Be.y0+=Pe,Be.y1+=Pe}})})}function Pt(){Ye.forEach(function(At){var at,et,Ot,Wt=le,Jt=At.length;for(At.sort(p),Ot=0;Ot0&&(at.y0+=et,at.y1+=et),Wt=at.y1+ie;if((et=Wt-ie-fe)>0)for(Wt=at.y0-=et,at.y1-=et,Ot=Jt-2;Ot>=0;--Ot)(et=(at=At[Ot]).y1+ie-Wt)>0&&(at.y0-=et,at.y1-=et),Wt=at.y0})}}function Ke(Re){Re.nodes.forEach(function(qe){qe.sourceLinks.sort(g),qe.targetLinks.sort(m)}),Re.nodes.forEach(function(qe){var We=qe.y0,Ye=We,nt=qe.y1,ft=nt;qe.sourceLinks.forEach(function(vt){vt.circular?(vt.y0=nt-vt.width/2,nt-=vt.width):(vt.y0=We+vt.width/2,We+=vt.width)}),qe.targetLinks.forEach(function(vt){vt.circular?(vt.y1=ft-vt.width/2,ft-=vt.width):(vt.y1=Ye+vt.width/2,Ye+=vt.width)})})}return ke.nodeId=function(Re){return arguments.length?(_e=typeof Re=="function"?Re:d(Re),ke):_e},ke.nodeAlign=function(Re){return arguments.length?(we=typeof Re=="function"?Re:d(Re),ke):we},ke.nodeWidth=function(Re){return arguments.length?(me=+Re,ke):me},ke.nodePadding=function(Re){return arguments.length?(ie=+Re,ke):ie},ke.nodes=function(Re){return arguments.length?(Te=typeof Re=="function"?Re:d(Re),ke):Te},ke.links=function(Re){return arguments.length?(Oe=typeof Re=="function"?Re:d(Re),ke):Oe},ke.size=function(Re){return arguments.length?(ue=le=0,ge=+Re[0],fe=+Re[1],ke):[ge-ue,fe-le]},ke.extent=function(Re){return arguments.length?(ue=+Re[0][0],ge=+Re[1][0],le=+Re[0][1],fe=+Re[1][1],ke):[[ue,le],[ge,fe]]},ke.iterations=function(Re){return arguments.length?(de=+Re,ke):de},ke.circularLinkGap=function(Re){return arguments.length?(ye=+Re,ke):ye},ke.nodePaddingRatio=function(Re){return arguments.length?(ae=+Re,ke):ae},ke.sortNodes=function(Re){return arguments.length?(Me=Re,ke):Me},ke.update=function(Re){return S(Re,_e),Ke(Re),Re.links.forEach(function(qe){qe.circular&&(qe.circularLinkType=qe.y0+qe.y1ee&&(O=ee);var ie=a.min(re,function(ae){return(E-A-(ae.length-1)*O)/a.sum(ae,g)});re.forEach(function(ae){ae.forEach(function(ue,le){ue.y1=(ue.y0=le)+ue.value*ie})}),Z.links.forEach(function(ae){ae.width=ae.value*ie})})(),H();for(var U=1,q=N;q>0;--q)ne(U*=.99),H(),$(U),H();function $(Q){re.forEach(function(ee){ee.forEach(function(ie){if(ie.targetLinks.length){var ae=(a.sum(ie.targetLinks,v)/a.sum(ie.targetLinks,g)-p(ie))*Q;ie.y0+=ae,ie.y1+=ae}})})}function ne(Q){re.slice().reverse().forEach(function(ee){ee.forEach(function(ie){if(ie.sourceLinks.length){var ae=(a.sum(ie.sourceLinks,y)/a.sum(ie.sourceLinks,g)-p(ie))*Q;ie.y0+=ae,ie.y1+=ae}})})}function H(){re.forEach(function(Q){var ee,ie,ae,ue=A,le=Q.length;for(Q.sort(m),ae=0;ae0&&(ee.y0+=ie,ee.y1+=ie),ue=ee.y1+O;if((ie=ue-O-E)>0)for(ue=ee.y0-=ie,ee.y1-=ie,ae=le-2;ae>=0;--ae)(ie=(ee=Q[ae]).y1+O-ue)>0&&(ee.y0-=ie,ee.y1-=ie),ue=ee.y0})}}function Y(Z){Z.nodes.forEach(function(re){re.sourceLinks.sort(h),re.targetLinks.sort(d)}),Z.nodes.forEach(function(re){var U=re.y0,q=U;re.sourceLinks.forEach(function($){$.y0=U+$.width/2,U+=$.width}),re.targetLinks.forEach(function($){$.y1=q+$.width/2,q+=$.width})})}return B.update=function(Z){return Y(Z),Z},B.nodeId=function(Z){return arguments.length?(R=typeof Z=="function"?Z:l(Z),B):R},B.nodeAlign=function(Z){return arguments.length?(z=typeof Z=="function"?Z:l(Z),B):z},B.nodeWidth=function(Z){return arguments.length?(D=+Z,B):D},B.nodePadding=function(Z){return arguments.length?(O=+Z,B):O},B.nodes=function(Z){return arguments.length?(L=typeof Z=="function"?Z:l(Z),B):L},B.links=function(Z){return arguments.length?(P=typeof Z=="function"?Z:l(Z),B):P},B.size=function(Z){return arguments.length?(M=A=0,S=+Z[0],E=+Z[1],B):[S-M,E-A]},B.extent=function(Z){return arguments.length?(M=+Z[0][0],S=+Z[1][0],A=+Z[0][1],E=+Z[1][1],B):[[M,A],[S,E]]},B.iterations=function(Z){return arguments.length?(N=+Z,B):N},B},r.sankeyCenter=function(M){return M.targetLinks.length?M.depth:M.sourceLinks.length?a.min(M.sourceLinks,i)-1:0},r.sankeyLeft=function(M){return M.depth},r.sankeyRight=function(M,A){return A-1-M.height},r.sankeyJustify=s,r.sankeyLinkHorizontal=function(){return c.linkHorizontal().source(T).target(_)},Object.defineProperty(r,"__esModule",{value:!0})})},{"d3-array":107,"d3-collection":108,"d3-shape":119}],58:[function(e,o,f){(function(){var r={version:"3.8.0"},a=[].slice,u=function(ce){return a.call(ce)},c=self.document;function i(ce){return ce&&(ce.ownerDocument||ce.document||ce).documentElement}function s(ce){return ce&&(ce.ownerDocument&&ce.ownerDocument.defaultView||ce.document&&ce||ce.defaultView)}if(c)try{u(c.documentElement.childNodes)[0].nodeType}catch{u=function(I){for(var j=I.length,V=new Array(j);j--;)V[j]=I[j];return V}}if(Date.now||(Date.now=function(){return+new Date}),c)try{c.createElement("DIV").style.setProperty("opacity",0,"")}catch{var l=this.Element.prototype,d=l.setAttribute,h=l.setAttributeNS,m=this.CSSStyleDeclaration.prototype,g=m.setProperty;l.setAttribute=function(I,j){d.call(this,I,j+"")},l.setAttributeNS=function(I,j,V){h.call(this,I,j,V+"")},m.setProperty=function(I,j,V){g.call(this,I,j+"",V)}}function p(ce,I){return ceI?1:ce>=I?0:NaN}function v(ce){return ce===null?NaN:+ce}function y(ce){return!isNaN(ce)}function x(ce){return{left:function(I,j,V,X){for(arguments.length<3&&(V=0),arguments.length<4&&(X=I.length);V>>1;ce(I[se],j)<0?V=se+1:X=se}return V},right:function(I,j,V,X){for(arguments.length<3&&(V=0),arguments.length<4&&(X=I.length);V>>1;ce(I[se],j)>0?X=se:V=se+1}return V}}}r.ascending=p,r.descending=function(ce,I){return Ice?1:I>=ce?0:NaN},r.min=function(ce,I){var j,V,X=-1,se=ce.length;if(arguments.length===1){for(;++X=V){j=V;break}for(;++XV&&(j=V)}else{for(;++X=V){j=V;break}for(;++XV&&(j=V)}return j},r.max=function(ce,I){var j,V,X=-1,se=ce.length;if(arguments.length===1){for(;++X=V){j=V;break}for(;++Xj&&(j=V)}else{for(;++X=V){j=V;break}for(;++Xj&&(j=V)}return j},r.extent=function(ce,I){var j,V,X,se=-1,he=ce.length;if(arguments.length===1){for(;++se=V){j=X=V;break}for(;++seV&&(j=V),X=V){j=X=V;break}for(;++seV&&(j=V),X1)return he/(be-1)},r.deviation=function(){var ce=r.variance.apply(this,arguments);return ce&&Math.sqrt(ce)};var w=x(p);function k(ce){return ce.length}r.bisectLeft=w.left,r.bisect=r.bisectRight=w.right,r.bisector=function(ce){return x(ce.length===1?function(I,j){return p(ce(I),j)}:ce)},r.shuffle=function(ce,I,j){(se=arguments.length)<3&&(j=ce.length,se<2&&(I=0));for(var V,X,se=j-I;se;)X=Math.random()*se--|0,V=ce[se+I],ce[se+I]=ce[X+I],ce[X+I]=V;return ce},r.permute=function(ce,I){for(var j=I.length,V=new Array(j);j--;)V[j]=ce[I[j]];return V},r.pairs=function(ce){for(var I=0,j=ce.length-1,V=ce[0],X=new Array(j<0?0:j);I=0;)for(I=(V=ce[X]).length;--I>=0;)j[--he]=V[I];return j};var b=Math.abs;function T(ce){for(var I=1;ce*I%1;)I*=10;return I}function _(ce,I){for(var j in I)Object.defineProperty(ce.prototype,j,{value:I[j],enumerable:!1})}function M(){this._=Object.create(null)}r.range=function(ce,I,j){if(arguments.length<3&&(j=1,arguments.length<2&&(I=ce,ce=0)),(I-ce)/j==1/0)throw new Error("infinite range");var V,X=[],se=T(b(j)),he=-1;if(ce*=se,I*=se,(j*=se)<0)for(;(V=ce+j*++he)>I;)X.push(V/se);else for(;(V=ce+j*++he)=V.length)return I?I.call(j,ve):ce?ve.sort(ce):ve;for(var Se,Ue,Xe,it,xt=-1,Lt=ve.length,_t=V[be++],Mt=new M;++xt=V.length)return be;var Ue=[],Xe=X[Se++];return be.forEach(function(it,xt){Ue.push({key:it,values:ve(xt,Se)})}),Xe?Ue.sort(function(it,xt){return Xe(it.key,xt.key)}):Ue}(se(r.map,he,0),0)},j.key=function(he){return V.push(he),j},j.sortKeys=function(he){return X[V.length-1]=he,j},j.sortValues=function(he){return ce=he,j},j.rollup=function(he){return I=he,j},j},r.set=function(ce){var I=new L;if(ce)for(var j=0,V=ce.length;j=0&&(V=ce.slice(j+1),ce=ce.slice(0,j)),ce)return arguments.length<2?this[ce].on(V):this[ce].on(V,I);if(arguments.length===2){if(I==null)for(ce in this)this.hasOwnProperty(ce)&&this[ce].on(V,null);return this}},r.event=null,r.requote=function(ce){return ce.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,q=function(ce,I){for(var j in I)ce[j]=I[j]};function $(ce){return q(ce,ee),ce}var ne=function(ce,I){return I.querySelector(ce)},H=function(ce,I){return I.querySelectorAll(ce)},Q=function(ce,I){var j=ce.matches||ce[B(ce,"matchesSelector")];return(Q=function(V,X){return j.call(V,X)})(ce,I)};typeof Sizzle=="function"&&(ne=function(ce,I){return Sizzle(ce,I)[0]||null},H=Sizzle,Q=Sizzle.matchesSelector),r.selection=function(){return r.select(c.documentElement)};var ee=r.selection.prototype=[];function ie(ce){return typeof ce=="function"?ce:function(){return ne(ce,this)}}function ae(ce){return typeof ce=="function"?ce:function(){return H(ce,this)}}ee.select=function(ce){var I,j,V,X,se=[];ce=ie(ce);for(var he=-1,ve=this.length;++he=0&&(j=ce.slice(0,I))!=="xmlns"&&(ce=ce.slice(I+1)),le.hasOwnProperty(j)?{space:le[j],local:ce}:ce}},ee.attr=function(ce,I){if(arguments.length<2){if(typeof ce=="string"){var j=this.node();return(ce=r.ns.qualify(ce)).local?j.getAttributeNS(ce.space,ce.local):j.getAttribute(ce)}for(I in ce)this.each(ge(I,ce[I]));return this}return this.each(ge(ce,I))},ee.classed=function(ce,I){if(arguments.length<2){if(typeof ce=="string"){var j=this.node(),V=(ce=_e(ce)).length,X=-1;if(I=j.classList){for(;++X=0;)(j=V[X])&&(se&&se!==j.nextSibling&&se.parentNode.insertBefore(j,se),se=j);return this},ee.sort=function(ce){ce=ze.apply(this,arguments);for(var I=-1,j=this.length;++I=I&&(I=X+1);!(he=ve[I])&&++I0&&(ce=ce.slice(0,X));var he=We.get(ce);function ve(){var be=this[V];be&&(this.removeEventListener(ce,be,be.$),delete this[V])}return he&&(ce=he,se=nt),X?I?function(){var be=se(I,u(arguments));ve.call(this),this.addEventListener(ce,this[V]=be,be.$=j),be._=I}:ve:I?W:function(){var be,Se=new RegExp("^__on([^.]+)"+r.requote(ce)+"$");for(var Ue in this)if(be=Ue.match(Se)){var Xe=this[Ue];this.removeEventListener(be[1],Xe,Xe.$),delete this[Ue]}}}r.selection.enter=Ve,r.selection.enter.prototype=Ke,Ke.append=ee.append,Ke.empty=ee.empty,Ke.node=ee.node,Ke.call=ee.call,Ke.size=ee.size,Ke.select=function(ce){for(var I,j,V,X,se,he=[],ve=-1,be=this.length;++ve1?Ge:ce<-1?-Ge:Math.asin(ce)}function Ie(ce){return((ce=Math.exp(ce))+1/ce)/2}var Ae=Math.SQRT2;r.interpolateZoom=function(ce,I){var j,V,X=ce[0],se=ce[1],he=ce[2],ve=I[0],be=I[1],Se=I[2],Ue=ve-X,Xe=be-se,it=Ue*Ue+Xe*Xe;if(it<1e-12)V=Math.log(Se/he)/Ae,j=function(Nt){return[X+Nt*Ue,se+Nt*Xe,he*Math.exp(Ae*Nt*V)]};else{var xt=Math.sqrt(it),Lt=(Se*Se-he*he+4*it)/(2*he*2*xt),_t=(Se*Se-he*he-4*it)/(2*Se*2*xt),Mt=Math.log(Math.sqrt(Lt*Lt+1)-Lt),yt=Math.log(Math.sqrt(_t*_t+1)-_t);V=(yt-Mt)/Ae,j=function(Nt){var Rt,qt=Nt*V,rn=Ie(Mt),dn=he/(2*xt)*(rn*(Rt=Ae*qt+Mt,((Rt=Math.exp(2*Rt))-1)/(Rt+1))-function(Sn){return((Sn=Math.exp(Sn))-1/Sn)/2}(Mt));return[X+dn*Ue,se+dn*Xe,he*rn/Ie(Ae*qt+Mt)]}}return j.duration=1e3*V,j},r.behavior.zoom=function(){var ce,I,j,V,X,se,he,ve,be,Se={x:0,y:0,k:1},Ue=[960,500],Xe=rt,it=250,xt=0,Lt="mousedown.zoom",_t="mousemove.zoom",Mt="mouseup.zoom",yt="touchstart.zoom",Nt=re(Rt,"zoomstart","zoom","zoomend");function Rt(Gn){Gn.on(Lt,cr).on(He+".zoom",ii).on("dblclick.zoom",Ti).on(yt,Yr)}function qt(Gn){return[(Gn[0]-Se.x)/Se.k,(Gn[1]-Se.y)/Se.k]}function rn(Gn){Se.k=Math.max(Xe[0],Math.min(Xe[1],Gn))}function dn(Gn,Mr){Mr=function(ai){return[ai[0]*Se.k+Se.x,ai[1]*Se.k+Se.y]}(Mr),Se.x+=Gn[0]-Mr[0],Se.y+=Gn[1]-Mr[1]}function Sn(Gn,Mr,ai,Qr){Gn.__chart__={x:Se.x,y:Se.y,k:Se.k},rn(Math.pow(2,Qr)),dn(I=Mr,ai),Gn=r.select(Gn),it>0&&(Gn=Gn.transition().duration(it)),Gn.call(Rt.event)}function An(){he&&he.domain(se.range().map(function(Gn){return(Gn-Se.x)/Se.k}).map(se.invert)),be&&be.domain(ve.range().map(function(Gn){return(Gn-Se.y)/Se.k}).map(ve.invert))}function tr(Gn){xt++||Gn({type:"zoomstart"})}function er(Gn){An(),Gn({type:"zoom",scale:Se.k,translate:[Se.x,Se.y]})}function gr(Gn){--xt||(Gn({type:"zoomend"}),I=null)}function cr(){var Gn=this,Mr=Nt.of(Gn,arguments),ai=0,Qr=r.select(s(Gn)).on(_t,Yi).on(Mt,ci),gi=qt(r.mouse(Gn)),Mi=Pt(Gn);function Yi(){ai=1,dn(r.mouse(Gn),gi),er(Mr)}function ci(){Qr.on(_t,null).on(Mt,null),Mi(ai),gr(Mr)}Oc.call(Gn),tr(Mr)}function Yr(){var Gn,Mr=this,ai=Nt.of(Mr,arguments),Qr={},gi=0,Mi=".zoom-"+r.event.changedTouches[0].identifier,Yi="touchmove"+Mi,ci="touchend"+Mi,zi=[],Li=r.select(Mr),Qi=Pt(Mr);function Ri(){var xo=r.touches(Mr);return Gn=Se.k,xo.forEach(function(bo){bo.identifier in Qr&&(Qr[bo.identifier]=qt(bo))}),xo}function ea(){var xo=r.event.target;r.select(xo).on(Yi,fa).on(ci,Ha),zi.push(xo);for(var bo=r.event.changedTouches,qa=0,co=bo.length;qa1){Uo=eo[0];var Js=eo[1],sc=Uo[0]-Js[0],Af=Uo[1]-Js[1];gi=sc*sc+Af*Af}}function fa(){var xo,bo,qa,co,eo=r.touches(Mr);Oc.call(Mr);for(var As=0,Uo=eo.length;As360?ve-=360:ve<0&&(ve+=360),ve<60?V+(X-V)*ve/60:ve<180?X:ve<240?V+(X-V)*(240-ve)/60:V}(he))}return ce=isNaN(ce)?0:(ce%=360)<0?ce+360:ce,I=isNaN(I)||I<0?0:I>1?1:I,V=2*(j=j<0?0:j>1?1:j)-(X=j<=.5?j*(1+I):j+I-j*I),new It(se(ce+120),se(ce),se(ce-120))}function Vt(ce,I,j){return this instanceof Vt?(this.h=+ce,this.c=+I,void(this.l=+j)):arguments.length<2?ce instanceof Vt?new Vt(ce.h,ce.c,ce.l):Le(ce instanceof bt?ce.l:(ce=tn((ce=r.rgb(ce)).r,ce.g,ce.b)).l,ce.a,ce.b):new Vt(ce,I,j)}kt.brighter=function(ce){return ce=Math.pow(.7,arguments.length?ce:1),new ot(this.h,this.s,this.l/ce)},kt.darker=function(ce){return ce=Math.pow(.7,arguments.length?ce:1),new ot(this.h,this.s,ce*this.l)},kt.rgb=function(){return wt(this.h,this.s,this.l)},r.hcl=Vt;var Ut=Vt.prototype=new lt;function tt(ce,I,j){return isNaN(ce)&&(ce=0),isNaN(I)&&(I=0),new bt(j,Math.cos(ce*=Tt)*I,Math.sin(ce)*I)}function bt(ce,I,j){return this instanceof bt?(this.l=+ce,this.a=+I,void(this.b=+j)):arguments.length<2?ce instanceof bt?new bt(ce.l,ce.a,ce.b):ce instanceof Vt?tt(ce.h,ce.c,ce.l):tn((ce=It(ce)).r,ce.g,ce.b):new bt(ce,I,j)}Ut.brighter=function(ce){return new Vt(this.h,this.c,Math.min(100,this.l+zt*(arguments.length?ce:1)))},Ut.darker=function(ce){return new Vt(this.h,this.c,Math.max(0,this.l-zt*(arguments.length?ce:1)))},Ut.rgb=function(){return tt(this.h,this.c,this.l).rgb()},r.lab=bt;var zt=18,St=bt.prototype=new lt;function Dt(ce,I,j){var V=(ce+16)/116,X=V+I/500,se=V-j/200;return new It(Et(3.2404542*(X=.95047*Je(X))-1.5371385*(V=1*Je(V))-.4985314*(se=1.08883*Je(se))),Et(-.969266*X+1.8760108*V+.041556*se),Et(.0556434*X-.2040259*V+1.0572252*se))}function Le(ce,I,j){return ce>0?new Vt(Math.atan2(j,I)*dt,Math.sqrt(I*I+j*j),ce):new Vt(NaN,NaN,ce)}function Je(ce){return ce>.206893034?ce*ce*ce:(ce-4/29)/7.787037}function st(ce){return ce>.008856?Math.pow(ce,1/3):7.787037*ce+4/29}function Et(ce){return Math.round(255*(ce<=.00304?12.92*ce:1.055*Math.pow(ce,1/2.4)-.055))}function It(ce,I,j){return this instanceof It?(this.r=~~ce,this.g=~~I,void(this.b=~~j)):arguments.length<2?ce instanceof It?new It(ce.r,ce.g,ce.b):zn(""+ce,It,wt):new It(ce,I,j)}function Zt(ce){return new It(ce>>16,ce>>8&255,255&ce)}function Kt(ce){return Zt(ce)+""}St.brighter=function(ce){return new bt(Math.min(100,this.l+zt*(arguments.length?ce:1)),this.a,this.b)},St.darker=function(ce){return new bt(Math.max(0,this.l-zt*(arguments.length?ce:1)),this.a,this.b)},St.rgb=function(){return Dt(this.l,this.a,this.b)},r.rgb=It;var Ht=It.prototype=new lt;function mn(ce){return ce<16?"0"+Math.max(0,ce).toString(16):Math.min(255,ce).toString(16)}function zn(ce,I,j){var V,X,se,he=0,ve=0,be=0;if(V=/([a-z]+)\((.*)\)/.exec(ce=ce.toLowerCase()))switch(X=V[2].split(","),V[1]){case"hsl":return j(parseFloat(X[0]),parseFloat(X[1])/100,parseFloat(X[2])/100);case"rgb":return I(sn(X[0]),sn(X[1]),sn(X[2]))}return(se=gn.get(ce))?I(se.r,se.g,se.b):(ce==null||ce.charAt(0)!=="#"||isNaN(se=parseInt(ce.slice(1),16))||(ce.length===4?(he=(3840&se)>>4,he|=he>>4,ve=240&se,ve|=ve>>4,be=15&se,be|=be<<4):ce.length===7&&(he=(16711680&se)>>16,ve=(65280&se)>>8,be=255&se)),I(he,ve,be))}function pn(ce,I,j){var V,X,se=Math.min(ce/=255,I/=255,j/=255),he=Math.max(ce,I,j),ve=he-se,be=(he+se)/2;return ve?(X=be<.5?ve/(he+se):ve/(2-he-se),V=ce==he?(I-j)/ve+(I0&&be<1?0:V),new ot(V,X,be)}function tn(ce,I,j){var V=st((.4124564*(ce=nn(ce))+.3575761*(I=nn(I))+.1804375*(j=nn(j)))/.95047),X=st((.2126729*ce+.7151522*I+.072175*j)/1);return bt(116*X-16,500*(V-X),200*(X-st((.0193339*ce+.119192*I+.9503041*j)/1.08883)))}function nn(ce){return(ce/=255)<=.04045?ce/12.92:Math.pow((ce+.055)/1.055,2.4)}function sn(ce){var I=parseFloat(ce);return ce.charAt(ce.length-1)==="%"?Math.round(2.55*I):I}Ht.brighter=function(ce){ce=Math.pow(.7,arguments.length?ce:1);var I=this.r,j=this.g,V=this.b,X=30;return I||j||V?(I&&I=200&&Xe<300||Xe===304){try{Ue=j.call(X,ve)}catch(it){return void se.error.call(X,it)}se.load.call(X,Ue)}else se.error.call(X,ve)}return self.XDomainRequest&&!("withCredentials"in ve)&&/^(http(s)?:)?\/\//.test(ce)&&(ve=new XDomainRequest),"onload"in ve?ve.onload=ve.onerror=Se:ve.onreadystatechange=function(){ve.readyState>3&&Se()},ve.onprogress=function(Ue){var Xe=r.event;r.event=Ue;try{se.progress.call(X,ve)}finally{r.event=Xe}},X.header=function(Ue,Xe){return Ue=(Ue+"").toLowerCase(),arguments.length<2?he[Ue]:(Xe==null?delete he[Ue]:he[Ue]=Xe+"",X)},X.mimeType=function(Ue){return arguments.length?(I=Ue==null?null:Ue+"",X):I},X.responseType=function(Ue){return arguments.length?(be=Ue,X):be},X.response=function(Ue){return j=Ue,X},["get","post"].forEach(function(Ue){X[Ue]=function(){return X.send.apply(X,[Ue].concat(u(arguments)))}}),X.send=function(Ue,Xe,it){if(arguments.length===2&&typeof Xe=="function"&&(it=Xe,Xe=null),ve.open(Ue,ce,!0),I==null||"accept"in he||(he.accept=I+",*/*"),ve.setRequestHeader)for(var xt in he)ve.setRequestHeader(xt,he[xt]);return I!=null&&ve.overrideMimeType&&ve.overrideMimeType(I),be!=null&&(ve.responseType=be),it!=null&&X.on("error",it).on("load",function(Lt){it(null,Lt)}),se.beforesend.call(X,ve),ve.send(Xe??null),X},X.abort=function(){return ve.abort(),X},r.rebind(X,se,"on"),V==null?X:X.get(function(Ue){return Ue.length===1?function(Xe,it){Ue(Xe==null?it:null)}:Ue}(V))}gn.forEach(function(ce,I){gn.set(ce,Zt(I))}),r.functor=bn,r.xhr=In(P),r.dsv=function(ce,I){var j=new RegExp('["'+ce+` +]`),V=ce.charCodeAt(0);function X(Se,Ue,Xe){arguments.length<3&&(Xe=Ue,Ue=null);var it=Hn(Se,I,Ue==null?se:he(Ue),Xe);return it.row=function(xt){return arguments.length?it.response((Ue=xt)==null?se:he(xt)):Ue},it}function se(Se){return X.parse(Se.responseText)}function he(Se){return function(Ue){return X.parse(Ue.responseText,Se)}}function ve(Se){return Se.map(be).join(ce)}function be(Se){return j.test(Se)?'"'+Se.replace(/\"/g,'""')+'"':Se}return X.parse=function(Se,Ue){var Xe;return X.parseRows(Se,function(it,xt){if(Xe)return Xe(it,xt-1);var Lt=function(_t){for(var Mt={},yt=it.length,Nt=0;Nt=Mt)return Lt;if(it)return it=!1,xt;var rn=yt;if(Se.charCodeAt(rn)===34){for(var dn=rn;dn++24?(isFinite(I)&&(clearTimeout(vr),vr=setTimeout(Ln,I)),Or=0):(Or=1,Er(Ln))}function lr(){for(var ce=Date.now(),I=Wn;I;)ce>=I.t&&I.c(ce-I.t)&&(I.c=null),I=I.n;return ce}function Wr(){for(var ce,I=Wn,j=1/0;I;)I.c?(I.t1&&(I=ce[se[he-2]],j=ce[se[he-1]],V=ce[ve],(j[0]-I[0])*(V[1]-I[1])-(j[1]-I[1])*(V[0]-I[0])<=0);)--he;se[he++]=ve}return se.slice(0,he)}function Bn(ce,I){return ce[0]-I[0]||ce[1]-I[1]}r.timer=function(){Kn.apply(this,arguments)},r.timer.flush=function(){lr(),Wr()},r.round=function(ce,I){return I?Math.round(ce*(I=Math.pow(10,I)))/I:Math.round(ce)},r.geom={},r.geom.hull=function(ce){var I=Mn,j=rr;if(arguments.length)return V(ce);function V(X){if(X.length<3)return[];var se,he=bn(I),ve=bn(j),be=X.length,Se=[],Ue=[];for(se=0;se=0;--se)_t.push(X[Se[Xe[se]][2]]);for(se=+xt;seOt)ve=ve.L;else{if(!((X=se-Dn(ve,he))>Ot)){V>-Ot?(I=ve.P,j=ve):X>-Ot?(I=ve,j=ve.N):I=j=ve;break}if(!ve.R){I=ve;break}ve=ve.R}var be=Nn(ce);if(jn.insert(I,be),I||j){if(I===j)return xr(I),j=Nn(I.site),jn.insert(be,j),be.edge=j.edge=Dr(I.site,be.site),or(I),void or(j);if(j){xr(I),xr(j);var Se=I.site,Ue=Se.x,Xe=Se.y,it=ce.x-Ue,xt=ce.y-Xe,Lt=j.site,_t=Lt.x-Ue,Mt=Lt.y-Xe,yt=2*(it*Mt-xt*_t),Nt=it*it+xt*xt,Rt=_t*_t+Mt*Mt,qt={x:(Mt*Nt-xt*Rt)/yt+Ue,y:(it*Rt-_t*Nt)/yt+Xe};ri(j.edge,Se,Lt,qt),be.edge=Dr(Se,ce,null,qt),j.edge=Dr(ce,Lt,null,qt),or(I),or(j)}else be.edge=Dr(I.site,be.site)}}function Tn(ce,I){var j=ce.site,V=j.x,X=j.y,se=X-I;if(!se)return V;var he=ce.P;if(!he)return-1/0;var ve=(j=he.site).x,be=j.y,Se=be-I;if(!Se)return ve;var Ue=ve-V,Xe=1/se-1/Se,it=Ue/Se;return Xe?(-it+Math.sqrt(it*it-2*Xe*(Ue*Ue/(-2*Se)-be+Se/2+X-se/2)))/Xe+V:(V+ve)/2}function Dn(ce,I){var j=ce.N;if(j)return Tn(j,I);var V=ce.site;return V.y===I?V.x:1/0}function Zn(ce){this.site=ce,this.edges=[]}function Yn(ce,I){return I.angle-ce.angle}function ir(){Sr(this),this.x=this.y=this.arc=this.site=this.cy=null}function or(ce){var I=ce.P,j=ce.N;if(I&&j){var V=I.site,X=ce.site,se=j.site;if(V!==se){var he=X.x,ve=X.y,be=V.x-he,Se=V.y-ve,Ue=se.x-he,Xe=2*(be*(Mt=se.y-ve)-Se*Ue);if(!(Xe>=-1e-12)){var it=be*be+Se*Se,xt=Ue*Ue+Mt*Mt,Lt=(Mt*it-Se*xt)/Xe,_t=(be*xt-Ue*it)/Xe,Mt=_t+ve,yt=$n.pop()||new ir;yt.arc=ce,yt.site=X,yt.x=Lt+he,yt.y=Mt+Math.sqrt(Lt*Lt+_t*_t),yt.cy=Mt,ce.circle=yt;for(var Nt=null,Rt=fn._;Rt;)if(yt.y=ve)return;if(it>Lt){if(se){if(se.y>=Se)return}else se={x:Mt,y:be};j={x:Mt,y:Se}}else{if(se){if(se.y1)if(it>Lt){if(se){if(se.y>=Se)return}else se={x:(be-X)/V,y:be};j={x:(Se-X)/V,y:Se}}else{if(se){if(se.y=ve)return}else se={x:he,y:V*he+X};j={x:ve,y:V*ve+X}}else{if(se){if(se.x0)){if(yt/=An,An<0){if(yt0){if(yt>Sn)return;yt>dn&&(dn=yt)}if(yt=Xe-qt,An||!(yt<0)){if(yt/=An,An<0){if(yt>Sn)return;yt>dn&&(dn=yt)}else if(An>0){if(yt0)){if(yt/=tr,tr<0){if(yt0){if(yt>Sn)return;yt>dn&&(dn=yt)}if(yt=it-rn,tr||!(yt<0)){if(yt/=tr,tr<0){if(yt>Sn)return;yt>dn&&(dn=yt)}else if(tr>0){if(yt0&&(Mt.a={x:qt+dn*An,y:rn+dn*tr}),Sn<1&&(Mt.b={x:qt+Sn*An,y:rn+Sn*tr}),Mt}}}}}),_t=xt.length;_t--;)(!wr(be=xt[_t],ve)||!Lt(be)||b(be.a.x-be.b.x)Ot||b(Xe-Se)>Ot)&&(Lt.splice(xt,0,new ji(Nr(it.site,yt,b(Ue-Nt)Ot?{x:Nt,y:b(be-Nt)Ot?{x:b(Se-rn)Ot?{x:Rt,y:b(be-Rt)Ot?{x:b(Se-qt)=Ue&&yt.x<=it&&yt.y>=Xe&&yt.y<=xt?[[Ue,xt],[it,xt],[it,Xe],[Ue,Xe]]:[]).point=be[_t]}),Se}function ve(be){return be.map(function(Se,Ue){return{x:Math.round(V(Se,Ue)/Ot)*Ot,y:Math.round(X(Se,Ue)/Ot)*Ot,i:Ue}})}return he.links=function(be){return Ja(ve(be)).edges.filter(function(Se){return Se.l&&Se.r}).map(function(Se){return{source:be[Se.l.i],target:be[Se.r.i]}})},he.triangles=function(be){var Se=[];return Ja(ve(be)).cells.forEach(function(Ue,Xe){for(var it,xt,Lt,_t,Mt=Ue.site,yt=Ue.edges.sort(Yn),Nt=-1,Rt=yt.length,qt=yt[Rt-1].edge,rn=qt.l===Mt?qt.r:qt.l;++Ntse||it>he||xt=dn)<<1|I>=rn,An=Sn+4;Snse&&(X=I.slice(se,X),ve[he]?ve[he]+=X:ve[++he]=X),(j=j[0])===(V=V[0])?ve[he]?ve[he]+=V:ve[++he]=V:(ve[++he]=null,be.push({i:he,x:so(j,V)})),se=Ls.lastIndex;return seyt&&(yt=Ue.x),Ue.y>Nt&&(Nt=Ue.y),Xe.push(Ue.x),it.push(Ue.y);else for(xt=0;xtyt&&(yt=rn),dn>Nt&&(Nt=dn),Xe.push(rn),it.push(dn)}var Sn=yt-_t,An=Nt-Mt;function tr(cr,Yr,ii,Ti,Gn,Mr,ai,Qr){if(!isNaN(ii)&&!isNaN(Ti))if(cr.leaf){var gi=cr.x,Mi=cr.y;if(gi!=null)if(b(gi-ii)+b(Mi-Ti)<.01)er(cr,Yr,ii,Ti,Gn,Mr,ai,Qr);else{var Yi=cr.point;cr.x=cr.y=cr.point=null,er(cr,Yi,gi,Mi,Gn,Mr,ai,Qr),er(cr,Yr,ii,Ti,Gn,Mr,ai,Qr)}else cr.x=ii,cr.y=Ti,cr.point=Yr}else er(cr,Yr,ii,Ti,Gn,Mr,ai,Qr)}function er(cr,Yr,ii,Ti,Gn,Mr,ai,Qr){var gi=.5*(Gn+ai),Mi=.5*(Mr+Qr),Yi=ii>=gi,ci=Ti>=Mi,zi=ci<<1|Yi;cr.leaf=!1,Yi?Gn=gi:ai=gi,ci?Mr=Mi:Qr=Mi,tr(cr=cr.nodes[zi]||(cr.nodes[zi]={leaf:!0,nodes:[],point:null,x:null,y:null}),Yr,ii,Ti,Gn,Mr,ai,Qr)}Sn>An?Nt=Mt+Sn:yt=_t+An;var gr={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(cr){tr(gr,cr,+Rt(cr,++xt),+qt(cr,xt),_t,Mt,yt,Nt)},visit:function(cr){Zo(cr,gr,_t,Mt,yt,Nt)},find:function(cr){return oa(gr,cr[0],cr[1],_t,Mt,yt,Nt)}};if(xt=-1,I==null){for(;++xt=0&&!(j=r.interpolators[V](ce,I)););return j}function Ka(ce,I){var j,V=[],X=[],se=ce.length,he=I.length,ve=Math.min(ce.length,I.length);for(j=0;j=1?1:ce(I)}}function ju(ce){return function(I){return 1-ce(1-I)}}function Wl(ce){return function(I){return .5*(I<.5?ce(2*I):2-ce(2-2*I))}}function Sc(ce){return ce*ce}function Ec(ce){return ce*ce*ce}function ac(ce){if(ce<=0)return 0;if(ce>=1)return 1;var I=ce*ce,j=I*ce;return 4*(ce<.5?j:3*(ce-I)+j-.75)}function Cc(ce){return 1-Math.cos(ce*Ge)}function Ns(ce){return Math.pow(2,10*(ce-1))}function Bs(ce){return 1-Math.sqrt(1-ce*ce)}function fl(ce){return ce<1/2.75?7.5625*ce*ce:ce<2/2.75?7.5625*(ce-=1.5/2.75)*ce+.75:ce<2.5/2.75?7.5625*(ce-=2.25/2.75)*ce+.9375:7.5625*(ce-=2.625/2.75)*ce+.984375}function hl(ce,I){return I-=ce,function(j){return Math.round(ce+I*j)}}function dl(ce){var I,j,V,X=[ce.a,ce.b],se=[ce.c,ce.d],he=ws(X),ve=Yl(X,se),be=ws(((I=se)[0]+=(V=-ve)*(j=X)[0],I[1]+=V*j[1],I))||0;X[0]*se[1]=0?ce.slice(0,I):ce,V=I>=0?ce.slice(I+1):"in";return j=ic.get(j)||$o,ba((V=Mc.get(V)||P)(j.apply(null,a.call(arguments,1))))},r.interpolateHcl=function(ce,I){ce=r.hcl(ce),I=r.hcl(I);var j=ce.h,V=ce.c,X=ce.l,se=I.h-j,he=I.c-V,ve=I.l-X;return isNaN(he)&&(he=0,V=isNaN(V)?I.c:V),isNaN(se)?(se=0,j=isNaN(j)?I.h:j):se>180?se-=360:se<-180&&(se+=360),function(be){return tt(j+se*be,V+he*be,X+ve*be)+""}},r.interpolateHsl=function(ce,I){ce=r.hsl(ce),I=r.hsl(I);var j=ce.h,V=ce.s,X=ce.l,se=I.h-j,he=I.s-V,ve=I.l-X;return isNaN(he)&&(he=0,V=isNaN(V)?I.s:V),isNaN(se)?(se=0,j=isNaN(j)?I.h:j):se>180?se-=360:se<-180&&(se+=360),function(be){return wt(j+se*be,V+he*be,X+ve*be)+""}},r.interpolateLab=function(ce,I){ce=r.lab(ce),I=r.lab(I);var j=ce.l,V=ce.a,X=ce.b,se=I.l-j,he=I.a-V,ve=I.b-X;return function(be){return Dt(j+se*be,V+he*be,X+ve*be)+""}},r.interpolateRound=hl,r.transform=function(ce){var I=c.createElementNS(r.ns.prefix.svg,"g");return(r.transform=function(j){if(j!=null){I.setAttribute("transform",j);var V=I.transform.baseVal.consolidate()}return new dl(V?V.matrix:Uu)})(ce)},dl.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Uu={a:1,b:0,c:0,d:1,e:0,f:0};function ds(ce){return ce.length?ce.pop()+",":""}function pl(ce,I){var j=[],V=[];return ce=r.transform(ce),I=r.transform(I),function(X,se,he,ve){if(X[0]!==se[0]||X[1]!==se[1]){var be=he.push("translate(",null,",",null,")");ve.push({i:be-4,x:so(X[0],se[0])},{i:be-2,x:so(X[1],se[1])})}else(se[0]||se[1])&&he.push("translate("+se+")")}(ce.translate,I.translate,j,V),function(X,se,he,ve){X!==se?(X-se>180?se+=360:se-X>180&&(X+=360),ve.push({i:he.push(ds(he)+"rotate(",null,")")-2,x:so(X,se)})):se&&he.push(ds(he)+"rotate("+se+")")}(ce.rotate,I.rotate,j,V),function(X,se,he,ve){X!==se?ve.push({i:he.push(ds(he)+"skewX(",null,")")-2,x:so(X,se)}):se&&he.push(ds(he)+"skewX("+se+")")}(ce.skew,I.skew,j,V),function(X,se,he,ve){if(X[0]!==se[0]||X[1]!==se[1]){var be=he.push(ds(he)+"scale(",null,",",null,")");ve.push({i:be-4,x:so(X[0],se[0])},{i:be-2,x:so(X[1],se[1])})}else se[0]===1&&se[1]===1||he.push(ds(he)+"scale("+se+")")}(ce.scale,I.scale,j,V),ce=I=null,function(X){for(var se,he=-1,ve=V.length;++he0?j=qt:(ce.c=null,ce.t=NaN,ce=null,ve.end({type:"end",alpha:j=0})):qt>0&&(ve.start({type:"start",alpha:j=qt}),ce=Kn(he.tick)),he):j},he.start=function(){var qt,rn,dn,Sn=Mt.length,An=yt.length,tr=be[0],er=be[1];for(qt=0;qt=0;)j.push(X[V])}function an(ce,I){for(var j=[ce],V=[];(ce=j.pop())!=null;)if(V.push(ce),(se=ce.children)&&(X=se.length))for(var X,se,he=-1;++he=0;)he.push(Ue=Se[be]),Ue.parent=se,Ue.depth=se.depth+1;j&&(se.value=0),se.children=Se}else j&&(se.value=+j.call(V,se,se.depth)||0),delete se.children;return an(X,function(Xe){var it,xt;ce&&(it=Xe.children)&&it.sort(ce),j&&(xt=Xe.parent)&&(xt.value+=Xe.value)}),ve}return V.sort=function(X){return arguments.length?(ce=X,V):ce},V.children=function(X){return arguments.length?(I=X,V):I},V.value=function(X){return arguments.length?(j=X,V):j},V.revalue=function(X){return j&&(Yt(X,function(se){se.children&&(se.value=0)}),an(X,function(se){var he;se.children||(se.value=+j.call(V,se,se.depth)||0),(he=se.parent)&&(he.value+=se.value)})),X},V},r.layout.partition=function(){var ce=r.layout.hierarchy(),I=[1,1];function j(V,X){var se=ce.call(this,V,X);return function he(ve,be,Se,Ue){var Xe=ve.children;if(ve.x=be,ve.y=ve.depth*Ue,ve.dx=Se,ve.dy=Ue,Xe&&(it=Xe.length)){var it,xt,Lt,_t=-1;for(Se=ve.value?Se/ve.value:0;++_tve&&(ve=V),he.push(V)}for(j=0;jX&&(V=j,X=I);return V}function sa(ce){return ce.reduce(ca,0)}function ca(ce,I){return ce+I[1]}function lo(ce,I){return io(ce,Math.ceil(Math.log(I.length)/Math.LN2+1))}function io(ce,I){for(var j=-1,V=+ce[0],X=(ce[1]-V)/I,se=[];++j<=I;)se[j]=X*j+V;return se}function za(ce){return[r.min(ce),r.max(ce)]}function Ra(ce,I){return ce.value-I.value}function ao(ce,I){var j=ce._pack_next;ce._pack_next=I,I._pack_prev=ce,I._pack_next=j,j._pack_prev=I}function Lo(ce,I){ce._pack_next=I,I._pack_prev=ce}function Ko(ce,I){var j=I.x-ce.x,V=I.y-ce.y,X=ce.r+I.r;return .999*X*X>j*j+V*V}function Qo(ce){if((I=ce.children)&&(be=I.length)){var I,j,V,X,se,he,ve,be,Se=1/0,Ue=-1/0,Xe=1/0,it=-1/0;if(I.forEach(es),(j=I[0]).x=-j.r,j.y=0,Rt(j),be>1&&((V=I[1]).x=V.r,V.y=0,Rt(V),be>2))for(na(j,V,X=I[2]),Rt(X),ao(j,X),j._pack_prev=X,ao(X,V),V=j._pack_next,se=3;se0)for(he=-1;++he=Xe[0]&&be<=Xe[1]&&((ve=Se[r.bisect(it,be,1,Lt)-1]).y+=_t,ve.push(se[he]));return Se}return X.value=function(se){return arguments.length?(I=se,X):I},X.range=function(se){return arguments.length?(j=bn(se),X):j},X.bins=function(se){return arguments.length?(V=typeof se=="number"?function(he){return io(he,se)}:bn(se),X):V},X.frequency=function(se){return arguments.length?(ce=!!se,X):ce},X},r.layout.pack=function(){var ce,I=r.layout.hierarchy().sort(Ra),j=0,V=[1,1];function X(se,he){var ve=I.call(this,se,he),be=ve[0],Se=V[0],Ue=V[1],Xe=ce==null?Math.sqrt:typeof ce=="function"?ce:function(){return ce};if(be.x=be.y=0,an(be,function(xt){xt.r=+Xe(xt.value)}),an(be,Qo),j){var it=j*(ce?1:Math.max(2*be.r/Se,2*be.r/Ue))/2;an(be,function(xt){xt.r+=it}),an(be,Qo),an(be,function(xt){xt.r-=it})}return function xt(Lt,_t,Mt,yt){var Nt=Lt.children;if(Lt.x=_t+=yt*Lt.x,Lt.y=Mt+=yt*Lt.y,Lt.r*=yt,Nt)for(var Rt=-1,qt=Nt.length;++RtLt.x&&(Lt=Rt),Rt.depth>_t.depth&&(_t=Rt)});var Mt=I(xt,Lt)/2-xt.x,yt=j[0]/(Lt.x+I(Lt,xt)/2+Mt),Nt=j[1]/(_t.depth||1);Yt(Xe,function(Rt){Rt.x=(Rt.x+Mt)*yt,Rt.y=Rt.depth*Nt})}return Ue}function se(be){var Se=be.children,Ue=be.parent.children,Xe=be.i?Ue[be.i-1]:null;if(Se.length){(function(xt){for(var Lt,_t=0,Mt=0,yt=xt.children,Nt=yt.length;--Nt>=0;)(Lt=yt[Nt]).z+=_t,Lt.m+=_t,_t+=Lt.s+(Mt+=Lt.c)})(be);var it=(Se[0].z+Se[Se.length-1].z)/2;Xe?(be.z=Xe.z+I(be._,Xe._),be.m=be.z-it):be.z=it}else Xe&&(be.z=Xe.z+I(be._,Xe._));be.parent.A=function(xt,Lt,_t){if(Lt){for(var Mt,yt=xt,Nt=xt,Rt=Lt,qt=yt.parent.children[0],rn=yt.m,dn=Nt.m,Sn=Rt.m,An=qt.m;Rt=ln(Rt),yt=Ft(yt),Rt&&yt;)qt=Ft(qt),(Nt=ln(Nt)).a=xt,(Mt=Rt.z+Sn-yt.z-rn+I(Rt._,yt._))>0&&($t(un(Rt,xt,_t),xt,Mt),rn+=Mt,dn+=Mt),Sn+=Rt.m,rn+=yt.m,An+=qt.m,dn+=Nt.m;Rt&&!ln(Nt)&&(Nt.t=Rt,Nt.m+=Sn-dn),yt&&!Ft(qt)&&(qt.t=yt,qt.m+=rn-An,_t=xt)}return _t}(be,Xe,be.parent.A||Ue[0])}function he(be){be._.x=be.z+be.parent.m,be.m+=be.parent.m}function ve(be){be.x*=j[0],be.y=be.depth*j[1]}return X.separation=function(be){return arguments.length?(I=be,X):I},X.size=function(be){return arguments.length?(V=(j=be)==null?ve:null,X):V?null:j},X.nodeSize=function(be){return arguments.length?(V=(j=be)==null?null:ve,X):V?j:null},en(X,ce)},r.layout.cluster=function(){var ce=r.layout.hierarchy().sort(null).value(null),I=ht,j=[1,1],V=!1;function X(se,he){var ve,be=ce.call(this,se,he),Se=be[0],Ue=0;an(Se,function(_t){var Mt=_t.children;Mt&&Mt.length?(_t.x=function(yt){return yt.reduce(function(Nt,Rt){return Nt+Rt.x},0)/yt.length}(Mt),_t.y=function(yt){return 1+r.max(yt,function(Nt){return Nt.y})}(Mt)):(_t.x=ve?Ue+=I(_t,ve):0,_t.y=0,ve=_t)});var Xe=function _t(Mt){var yt=Mt.children;return yt&&yt.length?_t(yt[0]):Mt}(Se),it=function _t(Mt){var yt,Nt=Mt.children;return Nt&&(yt=Nt.length)?_t(Nt[yt-1]):Mt}(Se),xt=Xe.x-I(Xe,it)/2,Lt=it.x+I(it,Xe)/2;return an(Se,V?function(_t){_t.x=(_t.x-Se.x)*j[0],_t.y=(Se.y-_t.y)*j[1]}:function(_t){_t.x=(_t.x-xt)/(Lt-xt)*j[0],_t.y=(1-(Se.y?_t.y/Se.y:1))*j[1]}),be}return X.separation=function(se){return arguments.length?(I=se,X):I},X.size=function(se){return arguments.length?(V=(j=se)==null,X):V?null:j},X.nodeSize=function(se){return arguments.length?(V=(j=se)!=null,X):V?j:null},en(X,ce)},r.layout.treemap=function(){var ce,I=r.layout.hierarchy(),j=Math.round,V=[1,1],X=null,se=On,he=!1,ve="squarify",be=.5*(1+Math.sqrt(5));function Se(_t,Mt){for(var yt,Nt,Rt=-1,qt=_t.length;++Rt0;)rn.push(yt=dn[Rt-1]),rn.area+=yt.area,ve!=="squarify"||(Nt=it(rn,An))<=Sn?(dn.pop(),Sn=Nt):(rn.area-=rn.pop().area,xt(rn,An,qt,!1),An=Math.min(qt.dx,qt.dy),rn.length=rn.area=0,Sn=1/0);rn.length&&(xt(rn,An,qt,!0),rn.length=rn.area=0),Mt.forEach(Ue)}}function Xe(_t){var Mt=_t.children;if(Mt&&Mt.length){var yt,Nt=se(_t),Rt=Mt.slice(),qt=[];for(Se(Rt,Nt.dx*Nt.dy/_t.value),qt.area=0;yt=Rt.pop();)qt.push(yt),qt.area+=yt.area,yt.z!=null&&(xt(qt,yt.z?Nt.dx:Nt.dy,Nt,!Rt.length),qt.length=qt.area=0);Mt.forEach(Xe)}}function it(_t,Mt){for(var yt,Nt=_t.area,Rt=0,qt=1/0,rn=-1,dn=_t.length;++rnRt&&(Rt=yt));return Mt*=Mt,(Nt*=Nt)?Math.max(Mt*Rt*be/Nt,Nt/(Mt*qt*be)):1/0}function xt(_t,Mt,yt,Nt){var Rt,qt=-1,rn=_t.length,dn=yt.x,Sn=yt.y,An=Mt?j(_t.area/Mt):0;if(Mt==yt.dx){for((Nt||An>yt.dy)&&(An=yt.dy);++qtyt.dx)&&(An=yt.dx);++qt1);return ce+I*V*Math.sqrt(-2*Math.log(se)/se)}},logNormal:function(){var ce=r.random.normal.apply(r,arguments);return function(){return Math.exp(ce())}},bates:function(ce){var I=r.random.irwinHall(ce);return function(){return I()/ce}},irwinHall:function(ce){return function(){for(var I=0,j=0;j2?Ar:ur,Ue=X?js:Vu;return se=Se(I,j,Ue,V),he=Se(j,I,Ue,Oo),be}function be(Se){return se(Se)}return be.invert=function(Se){return he(Se)},be.domain=function(Se){return arguments.length?(I=Se.map(Number),ve()):I},be.range=function(Se){return arguments.length?(j=Se,ve()):j},be.rangeRound=function(Se){return be.range(Se).interpolate(hl)},be.clamp=function(Se){return arguments.length?(X=Se,ve()):X},be.interpolate=function(Se){return arguments.length?(V=Se,ve()):V},be.ticks=function(Se){return Qn(I,Se)},be.tickFormat=function(Se,Ue){return d3_scale_linearTickFormat(I,Se,Ue)},be.nice=function(Se){return Zr(I,Se),ve()},be.copy=function(){return ce(I,j,V,X)},ve()}([0,1],[0,1],Oo,!1)},r.scale.log=function(){return function ce(I,j,V,X){function se(be){return(V?Math.log(be<0?0:be):-Math.log(be>0?0:-be))/Math.log(j)}function he(be){return V?Math.pow(j,be):-Math.pow(j,-be)}function ve(be){return I(se(be))}return ve.invert=function(be){return he(I.invert(be))},ve.domain=function(be){return arguments.length?(V=be[0]>=0,I.domain((X=be.map(Number)).map(se)),ve):X},ve.base=function(be){return arguments.length?(j=+be,I.domain(X.map(se)),ve):j},ve.nice=function(){var be=yr(X.map(se),V?Math:di);return I.domain(be),X=be.map(he),ve},ve.ticks=function(){var be=Jn(X),Se=[],Ue=be[0],Xe=be[1],it=Math.floor(se(Ue)),xt=Math.ceil(se(Xe)),Lt=j%1?2:j;if(isFinite(xt-it)){if(V){for(;it0;_t--)Se.push(he(it)*_t);for(it=0;Se[it]Xe;xt--);Se=Se.slice(it,xt)}return Se},ve.copy=function(){return ce(I.copy(),j,V,X)},Ur(ve,I)}(r.scale.linear().domain([0,1]),10,!0,[1,10])};var di={floor:function(ce){return-Math.ceil(-ce)},ceil:function(ce){return-Math.floor(-ce)}};function Rr(ce){return function(I){return I<0?-Math.pow(-I,ce):Math.pow(I,ce)}}r.scale.pow=function(){return function ce(I,j,V){var X=Rr(j),se=Rr(1/j);function he(ve){return I(X(ve))}return he.invert=function(ve){return se(I.invert(ve))},he.domain=function(ve){return arguments.length?(I.domain((V=ve.map(Number)).map(X)),he):V},he.ticks=function(ve){return Qn(V,ve)},he.tickFormat=function(ve,be){return d3_scale_linearTickFormat(V,ve,be)},he.nice=function(ve){return he.domain(Zr(V,ve))},he.exponent=function(ve){return arguments.length?(X=Rr(j=ve),se=Rr(1/j),I.domain(V.map(X)),he):j},he.copy=function(){return ce(I.copy(),j,V)},Ur(he,I)}(r.scale.linear(),1,[0,1])},r.scale.sqrt=function(){return r.scale.pow().exponent(.5)},r.scale.ordinal=function(){return function ce(I,j){var V,X,se;function he(be){return X[((V.get(be)||(j.t==="range"?V.set(be,I.push(be)):NaN))-1)%X.length]}function ve(be,Se){return r.range(I.length).map(function(Ue){return be+Se*Ue})}return he.domain=function(be){if(!arguments.length)return I;I=[],V=new M;for(var Se,Ue=-1,Xe=be.length;++Ue0?V[he-1]:I[0],heit?0:1;if(Ue=Be)return be(Ue,Lt)+(Se?be(Se,1-Lt):"")+"Z";var _t,Mt,yt,Nt,Rt,qt,rn,dn,Sn,An,tr,er,gr=0,cr=0,Yr=[];if((Nt=(+he.apply(this,arguments)||0)/2)&&(yt=V===ra?Math.sqrt(Se*Se+Ue*Ue):+V.apply(this,arguments),Lt||(cr*=-1),Ue&&(cr=Pe(yt/Ue*Math.sin(Nt))),Se&&(gr=Pe(yt/Se*Math.sin(Nt)))),Ue){Rt=Ue*Math.cos(Xe+cr),qt=Ue*Math.sin(Xe+cr),rn=Ue*Math.cos(it-cr),dn=Ue*Math.sin(it-cr);var ii=Math.abs(it-Xe-2*cr)<=Wt?0:1;if(cr&&pi(Rt,qt,rn,dn)===Lt^ii){var Ti=(Xe+it)/2;Rt=Ue*Math.cos(Ti),qt=Ue*Math.sin(Ti),rn=dn=null}}else Rt=qt=0;if(Se){Sn=Se*Math.cos(it-gr),An=Se*Math.sin(it-gr),tr=Se*Math.cos(Xe+gr),er=Se*Math.sin(Xe+gr);var Gn=Math.abs(Xe-it+2*gr)<=Wt?0:1;if(gr&&pi(Sn,An,tr,er)===1-Lt^Gn){var Mr=(Xe+it)/2;Sn=Se*Math.cos(Mr),An=Se*Math.sin(Mr),tr=er=null}}else Sn=An=0;if(xt>Ot&&(_t=Math.min(Math.abs(Ue-Se)/2,+j.apply(this,arguments)))>.001){Mt=Se0?0:1}function _a(ce,I,j,V,X){var se=ce[0]-I[0],he=ce[1]-I[1],ve=(X?V:-V)/Math.sqrt(se*se+he*he),be=ve*he,Se=-ve*se,Ue=ce[0]+be,Xe=ce[1]+Se,it=I[0]+be,xt=I[1]+Se,Lt=(Ue+it)/2,_t=(Xe+xt)/2,Mt=it-Ue,yt=xt-Xe,Nt=Mt*Mt+yt*yt,Rt=j-V,qt=Ue*xt-it*Xe,rn=(yt<0?-1:1)*Math.sqrt(Math.max(0,Rt*Rt*Nt-qt*qt)),dn=(qt*yt-Mt*rn)/Nt,Sn=(-qt*Mt-yt*rn)/Nt,An=(qt*yt+Mt*rn)/Nt,tr=(-qt*Mt+yt*rn)/Nt,er=dn-Lt,gr=Sn-_t,cr=An-Lt,Yr=tr-_t;return er*er+gr*gr>cr*cr+Yr*Yr&&(dn=An,Sn=tr),[[dn-be,Sn-Se],[dn*j/Rt,Sn*j/Rt]]}function Po(){return!0}function Al(ce){var I=Mn,j=rr,V=Po,X=ks,se=X.key,he=.7;function ve(be){var Se,Ue=[],Xe=[],it=-1,xt=be.length,Lt=bn(I),_t=bn(j);function Mt(){Ue.push("M",X(ce(Xe),he))}for(;++it1&&X.push("H",V[0]),X.join("")},"step-before":Qa,"step-after":Ts,basis:jo,"basis-open":function(ce){if(ce.length<4)return ks(ce);for(var I,j=[],V=-1,X=ce.length,se=[0],he=[0];++V<3;)I=ce[V],se.push(I[0]),he.push(I[1]);for(j.push(La(ns,se)+","+La(ns,he)),--V;++V9&&(se=3*j/Math.sqrt(se),ve[be]=se*V,ve[be+1]=se*X));for(be=-1;++be<=Se;)se=(I[Math.min(Se,be+1)][0]-I[Math.max(0,be-1)][0])/(6*(1+ve[be]*ve[be])),he.push([se||0,ve[be]*se||0]);return he}(ce))}});function ks(ce){return ce.length>1?ce.join("L"):ce+"Z"}function Pi(ce){return ce.join("L")+"Z"}function Qa(ce){for(var I=0,j=ce.length,V=ce[0],X=[V[0],",",V[1]];++I1){ve=I[1],se=ce[be],be++,V+="C"+(X[0]+he[0])+","+(X[1]+he[1])+","+(se[0]-ve[0])+","+(se[1]-ve[1])+","+se[0]+","+se[1];for(var Se=2;SeWt)+",1 "+Ue}function be(Se,Ue,Xe,it){return"Q 0,0 "+it}return se.radius=function(Se){return arguments.length?(j=bn(Se),se):j},se.source=function(Se){return arguments.length?(ce=bn(Se),se):ce},se.target=function(Se){return arguments.length?(I=bn(Se),se):I},se.startAngle=function(Se){return arguments.length?(V=bn(Se),se):V},se.endAngle=function(Se){return arguments.length?(X=bn(Se),se):X},se},r.svg.diagonal=function(){var ce=wf,I=So,j=wi;function V(X,se){var he=ce.call(this,X,se),ve=I.call(this,X,se),be=(he.y+ve.y)/2,Se=[he,{x:he.x,y:be},{x:ve.x,y:be},ve];return"M"+(Se=Se.map(j))[0]+"C"+Se[1]+" "+Se[2]+" "+Se[3]}return V.source=function(X){return arguments.length?(ce=bn(X),V):ce},V.target=function(X){return arguments.length?(I=bn(X),V):I},V.projection=function(X){return arguments.length?(j=X,V):j},V},r.svg.diagonal.radial=function(){var ce=r.svg.diagonal(),I=wi,j=ce.projection;return ce.projection=function(V){return arguments.length?j(Di(I=V)):I},ce},r.svg.symbol=function(){var ce=Tf,I=kf;function j(V,X){return(Us.get(ce.call(this,V,X))||Jl)(I.call(this,V,X))}return j.type=function(V){return arguments.length?(ce=bn(V),j):ce},j.size=function(V){return arguments.length?(I=bn(V),j):I},j};var Us=r.map({circle:Jl,cross:function(ce){var I=Math.sqrt(ce/5)/2;return"M"+-3*I+","+-I+"H"+-I+"V"+-3*I+"H"+I+"V"+-I+"H"+3*I+"V"+I+"H"+I+"V"+3*I+"H"+-I+"V"+I+"H"+-3*I+"Z"},diamond:function(ce){var I=Math.sqrt(ce/(2*od)),j=I*od;return"M0,"+-I+"L"+j+",0 0,"+I+" "+-j+",0Z"},square:function(ce){var I=Math.sqrt(ce)/2;return"M"+-I+","+-I+"L"+I+","+-I+" "+I+","+I+" "+-I+","+I+"Z"},"triangle-down":function(ce){var I=Math.sqrt(ce/ml),j=I*ml/2;return"M0,"+j+"L"+I+","+-j+" "+-I+","+-j+"Z"},"triangle-up":function(ce){var I=Math.sqrt(ce/ml),j=I*ml/2;return"M0,"+-j+"L"+I+","+j+" "+-I+","+j+"Z"}});r.svg.symbolTypes=Us.keys();var ml=Math.sqrt(3),od=Math.tan(30*Tt);ee.transition=function(ce){for(var I,j,V=qu||++Hu,X=Pc(ce),se=[],he=yu||{time:Date.now(),ease:ac,delay:0,duration:250},ve=-1,be=this.length;++ve0;)Se[--yt].call(ce,Mt);if(_t>=1)return Xe.event&&Xe.event.end.call(ce,ce.__data__,I),--Ue.count?delete Ue[V]:delete ce[j],1}Xe||(se=X.time,he=Kn(function(Lt){var _t=Xe.delay;if(he.t=_t+se,_t<=Lt)return it(Lt-_t);he.c=it},0,se),Xe=Ue[V]={tween:new M,time:se,timer:he,delay:X.delay,duration:X.duration,ease:X.ease,index:I},X=null,++Ue.count)}yo.call=ee.call,yo.empty=ee.empty,yo.node=ee.node,yo.size=ee.size,r.transition=function(ce,I){return ce&&ce.transition?qu?ce.transition(I):ce:r.selection().transition(ce)},r.transition.prototype=yo,yo.select=function(ce){var I,j,V,X=this.id,se=this.namespace,he=[];ce=ie(ce);for(var ve=-1,be=this.length;++verect,.s>rect").attr("width",se[1]-se[0])}function xt(_t){_t.select(".extent").attr("y",he[0]),_t.selectAll(".extent,.e>rect,.w>rect").attr("height",he[1]-he[0])}function Lt(){var _t,Mt,yt=this,Nt=r.select(r.event.target),Rt=j.of(yt,arguments),qt=r.select(yt),rn=Nt.datum(),dn=!/^(n|s)$/.test(rn)&&V,Sn=!/^(e|w)$/.test(rn)&&X,An=Nt.classed("extent"),tr=Pt(yt),er=r.mouse(yt),gr=r.select(s(yt)).on("keydown.brush",ii).on("keyup.brush",Ti);if(r.event.changedTouches?gr.on("touchmove.brush",Gn).on("touchend.brush",ai):gr.on("mousemove.brush",Gn).on("mouseup.brush",ai),qt.interrupt().selectAll("*").interrupt(),An)er[0]=se[0]-er[0],er[1]=he[0]-er[1];else if(rn){var cr=+/w$/.test(rn),Yr=+/^n/.test(rn);Mt=[se[1-cr]-er[0],he[1-Yr]-er[1]],er[0]=se[cr],er[1]=he[Yr]}else r.event.altKey&&(_t=er.slice());function ii(){r.event.keyCode==32&&(An||(_t=null,er[0]-=se[1],er[1]-=he[1],An=2),Y())}function Ti(){r.event.keyCode==32&&An==2&&(er[0]+=se[1],er[1]+=he[1],An=0,Y())}function Gn(){var Qr=r.mouse(yt),gi=!1;Mt&&(Qr[0]+=Mt[0],Qr[1]+=Mt[1]),An||(r.event.altKey?(_t||(_t=[(se[0]+se[1])/2,(he[0]+he[1])/2]),er[0]=se[+(Qr[0]<_t[0])],er[1]=he[+(Qr[1]<_t[1])]):_t=null),dn&&Mr(Qr,V,0)&&(it(qt),gi=!0),Sn&&Mr(Qr,X,1)&&(xt(qt),gi=!0),gi&&(Xe(qt),Rt({type:"brush",mode:An?"move":"resize"}))}function Mr(Qr,gi,Mi){var Yi,ci,zi=fr(gi),Li=zi[0],Qi=zi[1],Ri=er[Mi],ea=Mi?he:se,fa=ea[1]-ea[0];if(An&&(Li-=Ri,Qi-=fa+Ri),Yi=(Mi?be:ve)?Math.max(Li,Math.min(Qi,Qr[Mi])):Qr[Mi],An?ci=(Yi+=Ri)+fa:(_t&&(Ri=Math.max(Li,Math.min(Qi,2*_t[Mi]-Yi))),Ri>>1;v.dtype||(v.dtype="array"),typeof v.dtype=="string"?w=new(h(v.dtype))(b):v.dtype&&(w=v.dtype,Array.isArray(w)&&(w.length=b));for(var T=0;Ty||Z>1073741824){for(var ne=0;nefe+_e||H>me+_e||Q=ie||Te===Oe)){var de=_[we];Oe===void 0&&(Oe=de.length);for(var ye=Te;ye=Z&&ke<=U&&Ee>=re&&Ee<=q&&ue.push(Me)}var ze=M[we],Fe=ze[4*Te+0],Ve=ze[4*Te+1],Ke=ze[4*Te+2],Re=ze[4*Te+3],qe=ge(ze,Te+1),We=.5*_e,Ye=we+1;le(fe,me,We,Ye,Fe,Ve||Ke||Re||qe),le(fe,me+We,We,Ye,Ve,Ke||Re||qe),le(fe+We,me,We,Ye,Ke,Re||qe),le(fe+We,me+We,We,Ye,Re,qe)}}function ge(fe,me){for(var _e=null,we=0;_e===null;)if(_e=fe[4*me+we],++we>fe.length)return null;return _e}return le(0,0,1,0,0,1),ue},w;function P(B,G,W,K,te){for(var Y=[],Z=0;Z0){s+=Math.abs(u(i[0]));for(var l=1;l2){for(g=0;g=0))throw new Error("precision must be a positive number");var x=Math.pow(10,y||0);return Math.round(v*x)/x},f.radiansToLength=h,f.lengthToRadians=m,f.lengthToDegrees=function(v,y){return g(m(v,y))},f.bearingToAzimuth=function(v){var y=v%360;return y<0&&(y+=360),y},f.radiansToDegrees=g,f.degreesToRadians=function(v){return v%360*Math.PI/180},f.convertLength=function(v,y,x){if(y===void 0&&(y="kilometers"),x===void 0&&(x="kilometers"),!(v>=0))throw new Error("length must be a positive number");return h(m(v,y),x)},f.convertArea=function(v,y,x){if(y===void 0&&(y="meters"),x===void 0&&(x="kilometers"),!(v>=0))throw new Error("area must be a positive number");var w=f.areaFactors[y];if(!w)throw new Error("invalid original units");var k=f.areaFactors[x];if(!k)throw new Error("invalid final units");return v/w*k},f.isNumber=p,f.isObject=function(v){return!!v&&v.constructor===Object},f.validateBBox=function(v){if(!v)throw new Error("bbox is required");if(!Array.isArray(v))throw new Error("bbox must be an Array");if(v.length!==4&&v.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");v.forEach(function(y){if(!p(y))throw new Error("bbox must only contain numbers")})},f.validateId=function(v){if(!v)throw new Error("id is required");if(["string","number"].indexOf(typeof v)===-1)throw new Error("id must be a number or a string")}},{}],63:[function(e,o,f){Object.defineProperty(f,"__esModule",{value:!0});var r=e("@turf/helpers");function a(h,m,g){if(h!==null)for(var p,v,y,x,w,k,b,T,_=0,M=0,A=h.type,S=A==="FeatureCollection",E=A==="Feature",D=S?h.features.length:1,O=0;Ok||S>b||E>T)return w=_,k=p,b=S,T=E,void(y=0);var D=r.lineString([w,_],g.properties);if(m(D,p,v,E,y)===!1)return!1;y++,w=_})!==!1&&void 0}}})}function d(h,m){if(!h)throw new Error("geojson is required");s(h,function(g,p,v){if(g.geometry!==null){var y=g.geometry.type,x=g.geometry.coordinates;switch(y){case"LineString":if(m(g,p,v,0,0)===!1)return!1;break;case"Polygon":for(var w=0;wi[0]&&(c[0]=i[0]),c[1]>i[1]&&(c[1]=i[1]),c[2]=0))throw new Error("precision must be a positive number");var x=Math.pow(10,y||0);return Math.round(v*x)/x},f.radiansToLength=h,f.lengthToRadians=m,f.lengthToDegrees=function(v,y){return g(m(v,y))},f.bearingToAzimuth=function(v){var y=v%360;return y<0&&(y+=360),y},f.radiansToDegrees=g,f.degreesToRadians=function(v){return v%360*Math.PI/180},f.convertLength=function(v,y,x){if(y===void 0&&(y="kilometers"),x===void 0&&(x="kilometers"),!(v>=0))throw new Error("length must be a positive number");return h(m(v,y),x)},f.convertArea=function(v,y,x){if(y===void 0&&(y="meters"),x===void 0&&(x="kilometers"),!(v>=0))throw new Error("area must be a positive number");var w=f.areaFactors[y];if(!w)throw new Error("invalid original units");var k=f.areaFactors[x];if(!k)throw new Error("invalid final units");return v/w*k},f.isNumber=p,f.isObject=function(v){return!!v&&v.constructor===Object},f.validateBBox=function(v){if(!v)throw new Error("bbox is required");if(!Array.isArray(v))throw new Error("bbox must be an Array");if(v.length!==4&&v.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");v.forEach(function(y){if(!p(y))throw new Error("bbox must only contain numbers")})},f.validateId=function(v){if(!v)throw new Error("id is required");if(["string","number"].indexOf(typeof v)===-1)throw new Error("id must be a number or a string")},f.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},f.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},f.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},f.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},f.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},f.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},f.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],69:[function(e,o,f){Object.defineProperty(f,"__esModule",{value:!0});var r=e("@turf/helpers");function a(h,m,g){if(h!==null)for(var p,v,y,x,w,k,b,T,_=0,M=0,A=h.type,S=A==="FeatureCollection",E=A==="Feature",D=S?h.features.length:1,O=0;Ok||S>b||E>T)return w=_,k=p,b=S,T=E,void(y=0);var D=r.lineString([w,_],g.properties);if(m(D,p,v,E,y)===!1)return!1;y++,w=_})!==!1&&void 0}}})}function d(h,m){if(!h)throw new Error("geojson is required");s(h,function(g,p,v){if(g.geometry!==null){var y=g.geometry.type,x=g.geometry.coordinates;switch(y){case"LineString":if(m(g,p,v,0,0)===!1)return!1;break;case"Polygon":for(var w=0;wi&&(i=r[l]),r[l] + * @license MIT + */function u(S,E){if(S===E)return 0;for(var D=S.length,O=E.length,R=0,z=Math.min(D,O);R=0;K--)if(te[K]!==Y[K])return!1;for(K=te.length-1;K>=0;K--)if(W=te[K],!b(z[W],L[W],P,N))return!1;return!0}(S,E,D,O))}return D?S===E:S==E}function T(S){return Object.prototype.toString.call(S)=="[object Arguments]"}function _(S,E){if(!S||!E)return!1;if(Object.prototype.toString.call(E)=="[object RegExp]")return E.test(S);try{if(S instanceof E)return!0}catch{}return!Error.isPrototypeOf(E)&&E.call({},S)===!0}function M(S,E,D,O){var R;if(typeof E!="function")throw new TypeError('"block" argument must be a function');typeof D=="string"&&(O=D,D=null),R=function(P){var N;try{P()}catch(B){N=B}return N}(E),O=(D&&D.name?" ("+D.name+").":".")+(O?" "+O:"."),S&&!R&&w(R,D,"Missing expected exception"+O);var z=typeof O=="string",L=!S&&R&&!D;if((!S&&i.isError(R)&&z&&_(R,D)||L)&&w(R,D,"Got unwanted exception"+O),S&&R&&D&&!_(R,D)||!S&&R)throw R}g.AssertionError=function(S){this.name="AssertionError",this.actual=S.actual,this.expected=S.expected,this.operator=S.operator,S.message?(this.message=S.message,this.generatedMessage=!1):(this.message=function(P){return y(x(P.actual),128)+" "+P.operator+" "+y(x(P.expected),128)}(this),this.generatedMessage=!0);var E=S.stackStartFunction||w;if(Error.captureStackTrace)Error.captureStackTrace(this,E);else{var D=new Error;if(D.stack){var O=D.stack,R=v(E),z=O.indexOf(` +`+R);if(z>=0){var L=O.indexOf(` +`,z+1);O=O.substring(L+1)}this.stack=O}}},i.inherits(g.AssertionError,Error),g.fail=w,g.ok=k,g.equal=function(S,E,D){S!=E&&w(S,E,D,"==",g.equal)},g.notEqual=function(S,E,D){S==E&&w(S,E,D,"!=",g.notEqual)},g.deepEqual=function(S,E,D){b(S,E,!1)||w(S,E,D,"deepEqual",g.deepEqual)},g.deepStrictEqual=function(S,E,D){b(S,E,!0)||w(S,E,D,"deepStrictEqual",g.deepStrictEqual)},g.notDeepEqual=function(S,E,D){b(S,E,!1)&&w(S,E,D,"notDeepEqual",g.notDeepEqual)},g.notDeepStrictEqual=function S(E,D,O){b(E,D,!0)&&w(E,D,O,"notDeepStrictEqual",S)},g.strictEqual=function(S,E,D){S!==E&&w(S,E,D,"===",g.strictEqual)},g.notStrictEqual=function(S,E,D){S===E&&w(S,E,D,"!==",g.notStrictEqual)},g.throws=function(S,E,D){M(!0,S,E,D)},g.doesNotThrow=function(S,E,D){M(!1,S,E,D)},g.ifError=function(S){if(S)throw S},g.strict=a(function S(E,D){E||w(E,!0,D,"==",S)},g,{equal:g.strictEqual,deepEqual:g.deepStrictEqual,notEqual:g.notStrictEqual,notDeepEqual:g.notDeepStrictEqual}),g.strict.strict=g.strict;var A=Object.keys||function(S){var E=[];for(var D in S)s.call(S,D)&&E.push(D);return E}}).call(this)}).call(this,typeof Ro<"u"?Ro:typeof self<"u"?self:typeof window<"u"?window:{})},{"object-assign":247,"util/":78}],76:[function(e,o,f){typeof Object.create=="function"?o.exports=function(r,a){r.super_=a,r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:o.exports=function(r,a){r.super_=a;var u=function(){};u.prototype=a.prototype,r.prototype=new u,r.prototype.constructor=r}},{}],77:[function(e,o,f){o.exports=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"}},{}],78:[function(e,o,f){(function(r,a){(function(){var u=/%[sdj%]/g;f.format=function(z){if(!w(z)){for(var L=[],P=0;P=B)return K;switch(K){case"%s":return String(N[P++]);case"%d":return Number(N[P++]);case"%j":try{return JSON.stringify(N[P++])}catch{return"[Circular]"}default:return K}}),W=N[P];P=3&&(P.depth=arguments[2]),arguments.length>=4&&(P.colors=arguments[3]),v(L)?P.showHidden=L:L&&f._extend(P,L),k(P.showHidden)&&(P.showHidden=!1),k(P.depth)&&(P.depth=2),k(P.colors)&&(P.colors=!1),k(P.customInspect)&&(P.customInspect=!0),P.colors&&(P.stylize=l),h(P,z,P.depth)}function l(z,L){var P=s.styles[L];return P?"\x1B["+s.colors[P][0]+"m"+z+"\x1B["+s.colors[P][1]+"m":z}function d(z,L){return z}function h(z,L,P){if(z.customInspect&&L&&A(L.inspect)&&L.inspect!==f.inspect&&(!L.constructor||L.constructor.prototype!==L)){var N=L.inspect(P,z);return w(N)||(N=h(z,N,P)),N}var B=function(U,q){if(k(q))return U.stylize("undefined","undefined");if(w(q)){var $="'"+JSON.stringify(q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize($,"string")}if(x(q))return U.stylize(""+q,"number");if(v(q))return U.stylize(""+q,"boolean");if(y(q))return U.stylize("null","null")}(z,L);if(B)return B;var G=Object.keys(L),W=function(U){var q={};return U.forEach(function($,ne){q[$]=!0}),q}(G);if(z.showHidden&&(G=Object.getOwnPropertyNames(L)),M(L)&&(G.indexOf("message")>=0||G.indexOf("description")>=0))return m(L);if(G.length===0){if(A(L)){var K=L.name?": "+L.name:"";return z.stylize("[Function"+K+"]","special")}if(b(L))return z.stylize(RegExp.prototype.toString.call(L),"regexp");if(_(L))return z.stylize(Date.prototype.toString.call(L),"date");if(M(L))return m(L)}var te,Y="",Z=!1,re=["{","}"];return p(L)&&(Z=!0,re=["[","]"]),A(L)&&(Y=" [Function"+(L.name?": "+L.name:"")+"]"),b(L)&&(Y=" "+RegExp.prototype.toString.call(L)),_(L)&&(Y=" "+Date.prototype.toUTCString.call(L)),M(L)&&(Y=" "+m(L)),G.length!==0||Z&&L.length!=0?P<0?b(L)?z.stylize(RegExp.prototype.toString.call(L),"regexp"):z.stylize("[Object]","special"):(z.seen.push(L),te=Z?function(U,q,$,ne,H){for(var Q=[],ee=0,ie=q.length;ee=0,ne+H.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?$[0]+(q===""?"":q+` + `)+" "+U.join(`, + `)+" "+$[1]:$[0]+q+" "+U.join(", ")+" "+$[1]}(te,Y,re)):re[0]+Y+re[1]}function m(z){return"["+Error.prototype.toString.call(z)+"]"}function g(z,L,P,N,B,G){var W,K,te;if((te=Object.getOwnPropertyDescriptor(L,B)||{value:L[B]}).get?K=te.set?z.stylize("[Getter/Setter]","special"):z.stylize("[Getter]","special"):te.set&&(K=z.stylize("[Setter]","special")),R(N,B)||(W="["+B+"]"),K||(z.seen.indexOf(te.value)<0?(K=y(P)?h(z,te.value,null):h(z,te.value,P-1)).indexOf(` +`)>-1&&(K=G?K.split(` +`).map(function(Y){return" "+Y}).join(` +`).substr(2):` +`+K.split(` +`).map(function(Y){return" "+Y}).join(` +`)):K=z.stylize("[Circular]","special")),k(W)){if(G&&B.match(/^\d+$/))return K;(W=JSON.stringify(""+B)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(W=W.substr(1,W.length-2),W=z.stylize(W,"name")):(W=W.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),W=z.stylize(W,"string"))}return W+": "+K}function p(z){return Array.isArray(z)}function v(z){return typeof z=="boolean"}function y(z){return z===null}function x(z){return typeof z=="number"}function w(z){return typeof z=="string"}function k(z){return z===void 0}function b(z){return T(z)&&S(z)==="[object RegExp]"}function T(z){return typeof z=="object"&&z!==null}function _(z){return T(z)&&S(z)==="[object Date]"}function M(z){return T(z)&&(S(z)==="[object Error]"||z instanceof Error)}function A(z){return typeof z=="function"}function S(z){return Object.prototype.toString.call(z)}function E(z){return z<10?"0"+z.toString(10):z.toString(10)}f.debuglog=function(z){if(k(c)&&(c=r.env.NODE_DEBUG||""),z=z.toUpperCase(),!i[z])if(new RegExp("\\b"+z+"\\b","i").test(c)){var L=r.pid;i[z]=function(){var P=f.format.apply(f,arguments);console.error("%s %d: %s",z,L,P)}}else i[z]=function(){};return i[z]},f.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},f.isArray=p,f.isBoolean=v,f.isNull=y,f.isNullOrUndefined=function(z){return z==null},f.isNumber=x,f.isString=w,f.isSymbol=function(z){return typeof z=="symbol"},f.isUndefined=k,f.isRegExp=b,f.isObject=T,f.isDate=_,f.isError=M,f.isFunction=A,f.isPrimitive=function(z){return z===null||typeof z=="boolean"||typeof z=="number"||typeof z=="string"||typeof z=="symbol"||z===void 0},f.isBuffer=e("./support/isBuffer");var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(){var z=new Date,L=[E(z.getHours()),E(z.getMinutes()),E(z.getSeconds())].join(":");return[z.getDate(),D[z.getMonth()],L].join(" ")}function R(z,L){return Object.prototype.hasOwnProperty.call(z,L)}f.log=function(){console.log("%s - %s",O(),f.format.apply(f,arguments))},f.inherits=e("inherits"),f._extend=function(z,L){if(!L||!T(L))return z;for(var P=Object.keys(L),N=P.length;N--;)z[P[N]]=L[P[N]];return z}}).call(this)}).call(this,e("_process"),typeof Ro<"u"?Ro:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":77,_process:277,inherits:76}],79:[function(e,o,f){f.byteLength=function(h){var m=l(h),g=m[0],p=m[1];return 3*(g+p)/4-p},f.toByteArray=function(h){var m,g,p=l(h),v=p[0],y=p[1],x=new u(function(b,T,_){return 3*(T+_)/4-_}(0,v,y)),w=0,k=y>0?v-4:v;for(g=0;g>16&255,x[w++]=m>>8&255,x[w++]=255&m;return y===2&&(m=a[h.charCodeAt(g)]<<2|a[h.charCodeAt(g+1)]>>4,x[w++]=255&m),y===1&&(m=a[h.charCodeAt(g)]<<10|a[h.charCodeAt(g+1)]<<4|a[h.charCodeAt(g+2)]>>2,x[w++]=m>>8&255,x[w++]=255&m),x},f.fromByteArray=function(h){for(var m,g=h.length,p=g%3,v=[],y=0,x=g-p;yx?x:y+16383));return p===1?(m=h[g-1],v.push(r[m>>2]+r[m<<4&63]+"==")):p===2&&(m=(h[g-2]<<8)+h[g-1],v.push(r[m>>10]+r[m>>4&63]+r[m<<2&63]+"=")),v.join("")};for(var r=[],a=[],u=typeof Uint8Array<"u"?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=c.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var g=h.indexOf("=");return g===-1&&(g=m),[g,g===m?0:4-g%4]}function d(h,m,g){for(var p,v,y=[],x=m;x>18&63]+r[v>>12&63]+r[v>>6&63]+r[63&v]);return y.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],80:[function(e,o,f){function r(l,d,h,m,g){for(var p=g+1;m<=g;){var v=m+g>>>1,y=l[v];(h!==void 0?h(y,d):y-d)>=0?(p=v,g=v-1):m=v+1}return p}function a(l,d,h,m,g){for(var p=g+1;m<=g;){var v=m+g>>>1,y=l[v];(h!==void 0?h(y,d):y-d)>0?(p=v,g=v-1):m=v+1}return p}function u(l,d,h,m,g){for(var p=m-1;m<=g;){var v=m+g>>>1,y=l[v];(h!==void 0?h(y,d):y-d)<0?(p=v,m=v+1):g=v-1}return p}function c(l,d,h,m,g){for(var p=m-1;m<=g;){var v=m+g>>>1,y=l[v];(h!==void 0?h(y,d):y-d)<=0?(p=v,m=v+1):g=v-1}return p}function i(l,d,h,m,g){for(;m<=g;){var p=m+g>>>1,v=l[p],y=h!==void 0?h(v,d):v-d;if(y===0)return p;y<=0?m=p+1:g=p-1}return-1}function s(l,d,h,m,g,p){return typeof h=="function"?p(l,d,h,m===void 0?0:0|m,g===void 0?l.length-1:0|g):p(l,d,void 0,h===void 0?0:0|h,m===void 0?l.length-1:0|m)}o.exports={ge:function(l,d,h,m,g){return s(l,d,h,m,g,r)},gt:function(l,d,h,m,g){return s(l,d,h,m,g,a)},lt:function(l,d,h,m,g){return s(l,d,h,m,g,u)},le:function(l,d,h,m,g){return s(l,d,h,m,g,c)},eq:function(l,d,h,m,g){return s(l,d,h,m,g,i)}}},{}],81:[function(e,o,f){function r(u){var c=32;return(u&=-u)&&c--,65535&u&&(c-=16),16711935&u&&(c-=8),252645135&u&&(c-=4),858993459&u&&(c-=2),1431655765&u&&(c-=1),c}f.INT_BITS=32,f.INT_MAX=2147483647,f.INT_MIN=-1<<31,f.sign=function(u){return(u>0)-(u<0)},f.abs=function(u){var c=u>>31;return(u^c)-c},f.min=function(u,c){return c^(u^c)&-(u65535)<<4,c|=i=((u>>>=c)>255)<<3,c|=i=((u>>>=i)>15)<<2,(c|=i=((u>>>=i)>3)<<1)|(u>>>=i)>>1},f.log10=function(u){return u>=1e9?9:u>=1e8?8:u>=1e7?7:u>=1e6?6:u>=1e5?5:u>=1e4?4:u>=1e3?3:u>=100?2:u>=10?1:0},f.popCount=function(u){return 16843009*((u=(858993459&(u-=u>>>1&1431655765))+(u>>>2&858993459))+(u>>>4)&252645135)>>>24},f.countTrailingZeros=r,f.nextPow2=function(u){return u+=u===0,--u,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,(u|=u>>>16)+1},f.prevPow2=function(u){return u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,(u|=u>>>16)-(u>>>1)},f.parity=function(u){return u^=u>>>16,u^=u>>>8,u^=u>>>4,27030>>>(u&=15)&1};var a=new Array(256);(function(u){for(var c=0;c<256;++c){var i=c,s=c,l=7;for(i>>>=1;i;i>>>=1)s<<=1,s|=1&i,--l;u[c]=s<>>8&255]<<16|a[u>>>16&255]<<8|a[u>>>24&255]},f.interleave2=function(u,c){return(u=1431655765&((u=858993459&((u=252645135&((u=16711935&((u&=65535)|u<<8))|u<<4))|u<<2))|u<<1))|(c=1431655765&((c=858993459&((c=252645135&((c=16711935&((c&=65535)|c<<8))|c<<4))|c<<2))|c<<1))<<1},f.deinterleave2=function(u,c){return(u=65535&((u=16711935&((u=252645135&((u=858993459&((u=u>>>c&1431655765)|u>>>1))|u>>>2))|u>>>4))|u>>>16))<<16>>16},f.interleave3=function(u,c,i){return u=1227133513&((u=3272356035&((u=251719695&((u=4278190335&((u&=1023)|u<<16))|u<<8))|u<<4))|u<<2),(u|=(c=1227133513&((c=3272356035&((c=251719695&((c=4278190335&((c&=1023)|c<<16))|c<<8))|c<<4))|c<<2))<<1)|(i=1227133513&((i=3272356035&((i=251719695&((i=4278190335&((i&=1023)|i<<16))|i<<8))|i<<4))|i<<2))<<2},f.deinterleave3=function(u,c){return(u=1023&((u=4278190335&((u=251719695&((u=3272356035&((u=u>>>c&1227133513)|u>>>2))|u>>>4))|u>>>8))|u>>>16))<<22>>22},f.nextCombination=function(u){var c=u|u-1;return c+1|(~c&-~c)-1>>>r(u)+1}},{}],82:[function(e,o,f){var r=e("clamp");o.exports=function(i,s){s||(s={});var l,d,h,m,g,p,v,y,x,w,k,b=s.cutoff==null?.25:s.cutoff,T=s.radius==null?8:s.radius,_=s.channel||0;if(ArrayBuffer.isView(i)||Array.isArray(i)){if(!s.width||!s.height)throw Error("For raw data width and height should be provided by options");l=s.width,d=s.height,m=i,p=s.stride?s.stride:Math.floor(i.length/l/d)}else window.HTMLCanvasElement&&i instanceof window.HTMLCanvasElement?(v=(y=i).getContext("2d"),l=y.width,d=y.height,x=v.getImageData(0,0,l,d),m=x.data,p=4):window.CanvasRenderingContext2D&&i instanceof window.CanvasRenderingContext2D?(y=i.canvas,v=i,l=y.width,d=y.height,x=v.getImageData(0,0,l,d),m=x.data,p=4):window.ImageData&&i instanceof window.ImageData&&(x=i,l=i.width,d=i.height,m=x.data,p=4);if(h=Math.max(l,d),window.Uint8ClampedArray&&m instanceof window.Uint8ClampedArray||window.Uint8Array&&m instanceof window.Uint8Array)for(g=m,m=Array(l*d),w=0,k=g.length;w0&&M.length>T&&!M.warned){M.warned=!0;var S=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");S.name="MaxListenersExceededWarning",S.emitter=x,S.type=w,S.count=M.length,A=S,console&&console.warn&&console.warn(A)}return x}function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(x,w,k){var b={fired:!1,wrapFn:void 0,target:x,type:w,listener:k},T=m.bind(b);return T.listener=k,b.wrapFn=T,T}function p(x,w,k){var b=x._events;if(b===void 0)return[];var T=b[w];return T===void 0?[]:typeof T=="function"?k?[T.listener||T]:[T]:k?function(_){for(var M=new Array(_.length),A=0;A0&&(_=w[0]),_ instanceof Error)throw _;var M=new Error("Unhandled error."+(_?" ("+_.message+")":""));throw M.context=_,M}var A=T[x];if(A===void 0)return!1;if(typeof A=="function")u(A,this,w);else{var S=A.length,E=y(A,S);for(k=0;k=0;_--)if(k[_]===w||k[_].listener===w){M=k[_].listener,T=_;break}if(T<0)return this;T===0?k.shift():function(A,S){for(;S+1=0;b--)this.removeListener(x,w[b]);return this},i.prototype.listeners=function(x){return p(this,x,!0)},i.prototype.rawListeners=function(x){return p(this,x,!1)},i.listenerCount=function(x,w){return typeof x.listenerCount=="function"?x.listenerCount(w):v.call(x,w)},i.prototype.listenerCount=v,i.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},{}],85:[function(e,o,f){(function(r){(function(){var a=e("base64-js"),u=e("ieee754");f.Buffer=i,f.SlowBuffer=function(U){return+U!=U&&(U=0),i.alloc(+U)},f.INSPECT_MAX_BYTES=50;function c(U){if(U>2147483647)throw new RangeError('The value "'+U+'" is invalid for option "size"');var q=new Uint8Array(U);return q.__proto__=i.prototype,q}function i(U,q,$){if(typeof U=="number"){if(typeof q=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(U)}return s(U,q,$)}function s(U,q,$){if(typeof U=="string")return function(Q,ee){if(typeof ee=="string"&&ee!==""||(ee="utf8"),!i.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);var ie=0|g(Q,ee),ae=c(ie),ue=ae.write(Q,ee);return ue!==ie&&(ae=ae.slice(0,ue)),ae}(U,q);if(ArrayBuffer.isView(U))return h(U);if(U==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(Z(U,ArrayBuffer)||U&&Z(U.buffer,ArrayBuffer))return function(Q,ee,ie){if(ee<0||Q.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|U}function g(U,q){if(i.isBuffer(U))return U.length;if(ArrayBuffer.isView(U)||Z(U,ArrayBuffer))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);var $=U.length,ne=arguments.length>2&&arguments[2]===!0;if(!ne&&$===0)return 0;for(var H=!1;;)switch(q){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return K(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*$;case"hex":return $>>>1;case"base64":return te(U).length;default:if(H)return ne?-1:K(U).length;q=(""+q).toLowerCase(),H=!0}}function p(U,q,$){var ne=!1;if((q===void 0||q<0)&&(q=0),q>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0)<=(q>>>=0))return"";for(U||(U="utf8");;)switch(U){case"hex":return O(this,q,$);case"utf8":case"utf-8":return S(this,q,$);case"ascii":return E(this,q,$);case"latin1":case"binary":return D(this,q,$);case"base64":return A(this,q,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,q,$);default:if(ne)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),ne=!0}}function v(U,q,$){var ne=U[q];U[q]=U[$],U[$]=ne}function y(U,q,$,ne,H){if(U.length===0)return-1;if(typeof $=="string"?(ne=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),re($=+$)&&($=H?0:U.length-1),$<0&&($=U.length+$),$>=U.length){if(H)return-1;$=U.length-1}else if($<0){if(!H)return-1;$=0}if(typeof q=="string"&&(q=i.from(q,ne)),i.isBuffer(q))return q.length===0?-1:x(U,q,$,ne,H);if(typeof q=="number")return q&=255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(U,q,$):Uint8Array.prototype.lastIndexOf.call(U,q,$):x(U,[q],$,ne,H);throw new TypeError("val must be string, number or Buffer")}function x(U,q,$,ne,H){var Q,ee=1,ie=U.length,ae=q.length;if(ne!==void 0&&((ne=String(ne).toLowerCase())==="ucs2"||ne==="ucs-2"||ne==="utf16le"||ne==="utf-16le")){if(U.length<2||q.length<2)return-1;ee=2,ie/=2,ae/=2,$/=2}function ue(me,_e){return ee===1?me[_e]:me.readUInt16BE(_e*ee)}if(H){var le=-1;for(Q=$;Qie&&($=ie-ae),Q=$;Q>=0;Q--){for(var ge=!0,fe=0;feH&&(ne=H):ne=H;var Q=q.length;ne>Q/2&&(ne=Q/2);for(var ee=0;ee>8,ae=ee%256,ue.push(ae),ue.push(ie);return ue}(q,U.length-$),U,$,ne)}function A(U,q,$){return q===0&&$===U.length?a.fromByteArray(U):a.fromByteArray(U.slice(q,$))}function S(U,q,$){$=Math.min(U.length,$);for(var ne=[],H=q;H<$;){var Q,ee,ie,ae,ue=U[H],le=null,ge=ue>239?4:ue>223?3:ue>191?2:1;if(H+ge<=$)switch(ge){case 1:ue<128&&(le=ue);break;case 2:(192&(Q=U[H+1]))==128&&(ae=(31&ue)<<6|63&Q)>127&&(le=ae);break;case 3:Q=U[H+1],ee=U[H+2],(192&Q)==128&&(192&ee)==128&&(ae=(15&ue)<<12|(63&Q)<<6|63&ee)>2047&&(ae<55296||ae>57343)&&(le=ae);break;case 4:Q=U[H+1],ee=U[H+2],ie=U[H+3],(192&Q)==128&&(192&ee)==128&&(192&ie)==128&&(ae=(15&ue)<<18|(63&Q)<<12|(63&ee)<<6|63&ie)>65535&&ae<1114112&&(le=ae)}le===null?(le=65533,ge=1):le>65535&&(le-=65536,ne.push(le>>>10&1023|55296),le=56320|1023&le),ne.push(le),H+=ge}return function(fe){var me=fe.length;if(me<=4096)return String.fromCharCode.apply(String,fe);for(var _e="",we=0;we"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(U,q,$){return s(U,q,$)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(U,q,$){return function(ne,H,Q){return l(ne),ne<=0?c(ne):H!==void 0?typeof Q=="string"?c(ne).fill(H,Q):c(ne).fill(H):c(ne)}(U,q,$)},i.allocUnsafe=function(U){return d(U)},i.allocUnsafeSlow=function(U){return d(U)},i.isBuffer=function(U){return U!=null&&U._isBuffer===!0&&U!==i.prototype},i.compare=function(U,q){if(Z(U,Uint8Array)&&(U=i.from(U,U.offset,U.byteLength)),Z(q,Uint8Array)&&(q=i.from(q,q.offset,q.byteLength)),!i.isBuffer(U)||!i.isBuffer(q))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(U===q)return 0;for(var $=U.length,ne=q.length,H=0,Q=Math.min($,ne);Hq&&(U+=" ... "),""},i.prototype.compare=function(U,q,$,ne,H){if(Z(U,Uint8Array)&&(U=i.from(U,U.offset,U.byteLength)),!i.isBuffer(U))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof U);if(q===void 0&&(q=0),$===void 0&&($=U?U.length:0),ne===void 0&&(ne=0),H===void 0&&(H=this.length),q<0||$>U.length||ne<0||H>this.length)throw new RangeError("out of range index");if(ne>=H&&q>=$)return 0;if(ne>=H)return-1;if(q>=$)return 1;if(this===U)return 0;for(var Q=(H>>>=0)-(ne>>>=0),ee=($>>>=0)-(q>>>=0),ie=Math.min(Q,ee),ae=this.slice(ne,H),ue=U.slice(q,$),le=0;le>>=0,isFinite($)?($>>>=0,ne===void 0&&(ne="utf8")):(ne=$,$=void 0)}var H=this.length-q;if(($===void 0||$>H)&&($=H),U.length>0&&($<0||q<0)||q>this.length)throw new RangeError("Attempt to write outside buffer bounds");ne||(ne="utf8");for(var Q=!1;;)switch(ne){case"hex":return w(this,U,q,$);case"utf8":case"utf-8":return k(this,U,q,$);case"ascii":return b(this,U,q,$);case"latin1":case"binary":return T(this,U,q,$);case"base64":return _(this,U,q,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,U,q,$);default:if(Q)throw new TypeError("Unknown encoding: "+ne);ne=(""+ne).toLowerCase(),Q=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(U,q,$){var ne="";$=Math.min(U.length,$);for(var H=q;H<$;++H)ne+=String.fromCharCode(127&U[H]);return ne}function D(U,q,$){var ne="";$=Math.min(U.length,$);for(var H=q;H<$;++H)ne+=String.fromCharCode(U[H]);return ne}function O(U,q,$){var ne=U.length;(!q||q<0)&&(q=0),(!$||$<0||$>ne)&&($=ne);for(var H="",Q=q;Q<$;++Q)H+=W(U[Q]);return H}function R(U,q,$){for(var ne=U.slice(q,$),H="",Q=0;Q$)throw new RangeError("Trying to access beyond buffer length")}function L(U,q,$,ne,H,Q){if(!i.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(q>H||qU.length)throw new RangeError("Index out of range")}function P(U,q,$,ne,H,Q){if($+ne>U.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function N(U,q,$,ne,H){return q=+q,$>>>=0,H||P(U,0,$,4),u.write(U,q,$,ne,23,4),$+4}function B(U,q,$,ne,H){return q=+q,$>>>=0,H||P(U,0,$,8),u.write(U,q,$,ne,52,8),$+8}i.prototype.slice=function(U,q){var $=this.length;(U=~~U)<0?(U+=$)<0&&(U=0):U>$&&(U=$),(q=q===void 0?$:~~q)<0?(q+=$)<0&&(q=0):q>$&&(q=$),q>>=0,q>>>=0,$||z(U,q,this.length);for(var ne=this[U],H=1,Q=0;++Q>>=0,q>>>=0,$||z(U,q,this.length);for(var ne=this[U+--q],H=1;q>0&&(H*=256);)ne+=this[U+--q]*H;return ne},i.prototype.readUInt8=function(U,q){return U>>>=0,q||z(U,1,this.length),this[U]},i.prototype.readUInt16LE=function(U,q){return U>>>=0,q||z(U,2,this.length),this[U]|this[U+1]<<8},i.prototype.readUInt16BE=function(U,q){return U>>>=0,q||z(U,2,this.length),this[U]<<8|this[U+1]},i.prototype.readUInt32LE=function(U,q){return U>>>=0,q||z(U,4,this.length),(this[U]|this[U+1]<<8|this[U+2]<<16)+16777216*this[U+3]},i.prototype.readUInt32BE=function(U,q){return U>>>=0,q||z(U,4,this.length),16777216*this[U]+(this[U+1]<<16|this[U+2]<<8|this[U+3])},i.prototype.readIntLE=function(U,q,$){U>>>=0,q>>>=0,$||z(U,q,this.length);for(var ne=this[U],H=1,Q=0;++Q=(H*=128)&&(ne-=Math.pow(2,8*q)),ne},i.prototype.readIntBE=function(U,q,$){U>>>=0,q>>>=0,$||z(U,q,this.length);for(var ne=q,H=1,Q=this[U+--ne];ne>0&&(H*=256);)Q+=this[U+--ne]*H;return Q>=(H*=128)&&(Q-=Math.pow(2,8*q)),Q},i.prototype.readInt8=function(U,q){return U>>>=0,q||z(U,1,this.length),128&this[U]?-1*(255-this[U]+1):this[U]},i.prototype.readInt16LE=function(U,q){U>>>=0,q||z(U,2,this.length);var $=this[U]|this[U+1]<<8;return 32768&$?4294901760|$:$},i.prototype.readInt16BE=function(U,q){U>>>=0,q||z(U,2,this.length);var $=this[U+1]|this[U]<<8;return 32768&$?4294901760|$:$},i.prototype.readInt32LE=function(U,q){return U>>>=0,q||z(U,4,this.length),this[U]|this[U+1]<<8|this[U+2]<<16|this[U+3]<<24},i.prototype.readInt32BE=function(U,q){return U>>>=0,q||z(U,4,this.length),this[U]<<24|this[U+1]<<16|this[U+2]<<8|this[U+3]},i.prototype.readFloatLE=function(U,q){return U>>>=0,q||z(U,4,this.length),u.read(this,U,!0,23,4)},i.prototype.readFloatBE=function(U,q){return U>>>=0,q||z(U,4,this.length),u.read(this,U,!1,23,4)},i.prototype.readDoubleLE=function(U,q){return U>>>=0,q||z(U,8,this.length),u.read(this,U,!0,52,8)},i.prototype.readDoubleBE=function(U,q){return U>>>=0,q||z(U,8,this.length),u.read(this,U,!1,52,8)},i.prototype.writeUIntLE=function(U,q,$,ne){U=+U,q>>>=0,$>>>=0,ne||L(this,U,q,$,Math.pow(2,8*$)-1,0);var H=1,Q=0;for(this[q]=255&U;++Q<$&&(H*=256);)this[q+Q]=U/H&255;return q+$},i.prototype.writeUIntBE=function(U,q,$,ne){U=+U,q>>>=0,$>>>=0,ne||L(this,U,q,$,Math.pow(2,8*$)-1,0);var H=$-1,Q=1;for(this[q+H]=255&U;--H>=0&&(Q*=256);)this[q+H]=U/Q&255;return q+$},i.prototype.writeUInt8=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,1,255,0),this[q]=255&U,q+1},i.prototype.writeUInt16LE=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,2,65535,0),this[q]=255&U,this[q+1]=U>>>8,q+2},i.prototype.writeUInt16BE=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,2,65535,0),this[q]=U>>>8,this[q+1]=255&U,q+2},i.prototype.writeUInt32LE=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,4,4294967295,0),this[q+3]=U>>>24,this[q+2]=U>>>16,this[q+1]=U>>>8,this[q]=255&U,q+4},i.prototype.writeUInt32BE=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,4,4294967295,0),this[q]=U>>>24,this[q+1]=U>>>16,this[q+2]=U>>>8,this[q+3]=255&U,q+4},i.prototype.writeIntLE=function(U,q,$,ne){if(U=+U,q>>>=0,!ne){var H=Math.pow(2,8*$-1);L(this,U,q,$,H-1,-H)}var Q=0,ee=1,ie=0;for(this[q]=255&U;++Q<$&&(ee*=256);)U<0&&ie===0&&this[q+Q-1]!==0&&(ie=1),this[q+Q]=(U/ee>>0)-ie&255;return q+$},i.prototype.writeIntBE=function(U,q,$,ne){if(U=+U,q>>>=0,!ne){var H=Math.pow(2,8*$-1);L(this,U,q,$,H-1,-H)}var Q=$-1,ee=1,ie=0;for(this[q+Q]=255&U;--Q>=0&&(ee*=256);)U<0&&ie===0&&this[q+Q+1]!==0&&(ie=1),this[q+Q]=(U/ee>>0)-ie&255;return q+$},i.prototype.writeInt8=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,1,127,-128),U<0&&(U=255+U+1),this[q]=255&U,q+1},i.prototype.writeInt16LE=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,2,32767,-32768),this[q]=255&U,this[q+1]=U>>>8,q+2},i.prototype.writeInt16BE=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,2,32767,-32768),this[q]=U>>>8,this[q+1]=255&U,q+2},i.prototype.writeInt32LE=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,4,2147483647,-2147483648),this[q]=255&U,this[q+1]=U>>>8,this[q+2]=U>>>16,this[q+3]=U>>>24,q+4},i.prototype.writeInt32BE=function(U,q,$){return U=+U,q>>>=0,$||L(this,U,q,4,2147483647,-2147483648),U<0&&(U=4294967295+U+1),this[q]=U>>>24,this[q+1]=U>>>16,this[q+2]=U>>>8,this[q+3]=255&U,q+4},i.prototype.writeFloatLE=function(U,q,$){return N(this,U,q,!0,$)},i.prototype.writeFloatBE=function(U,q,$){return N(this,U,q,!1,$)},i.prototype.writeDoubleLE=function(U,q,$){return B(this,U,q,!0,$)},i.prototype.writeDoubleBE=function(U,q,$){return B(this,U,q,!1,$)},i.prototype.copy=function(U,q,$,ne){if(!i.isBuffer(U))throw new TypeError("argument should be a Buffer");if($||($=0),ne||ne===0||(ne=this.length),q>=U.length&&(q=U.length),q||(q=0),ne>0&&ne<$&&(ne=$),ne===$||U.length===0||this.length===0)return 0;if(q<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("sourceEnd out of bounds");ne>this.length&&(ne=this.length),U.length-q=0;--Q)U[Q+q]=this[Q+$];else Uint8Array.prototype.set.call(U,this.subarray($,ne),q);return H},i.prototype.fill=function(U,q,$,ne){if(typeof U=="string"){if(typeof q=="string"?(ne=q,q=0,$=this.length):typeof $=="string"&&(ne=$,$=this.length),ne!==void 0&&typeof ne!="string")throw new TypeError("encoding must be a string");if(typeof ne=="string"&&!i.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);if(U.length===1){var H=U.charCodeAt(0);(ne==="utf8"&&H<128||ne==="latin1")&&(U=H)}}else typeof U=="number"&&(U&=255);if(q<0||this.length>>=0,$=$===void 0?this.length:$>>>0,U||(U=0),typeof U=="number")for(Q=q;Q<$;++Q)this[Q]=U;else{var ee=i.isBuffer(U)?U:i.from(U,ne),ie=ee.length;if(ie===0)throw new TypeError('The value "'+U+'" is invalid for argument "value"');for(Q=0;Q<$-q;++Q)this[Q+q]=ee[Q%ie]}return this};var G=/[^+/0-9A-Za-z-_]/g;function W(U){return U<16?"0"+U.toString(16):U.toString(16)}function K(U,q){var $;q=q||1/0;for(var ne=U.length,H=null,Q=[],ee=0;ee55295&&$<57344){if(!H){if($>56319){(q-=3)>-1&&Q.push(239,191,189);continue}if(ee+1===ne){(q-=3)>-1&&Q.push(239,191,189);continue}H=$;continue}if($<56320){(q-=3)>-1&&Q.push(239,191,189),H=$;continue}$=65536+(H-55296<<10|$-56320)}else H&&(q-=3)>-1&&Q.push(239,191,189);if(H=null,$<128){if((q-=1)<0)break;Q.push($)}else if($<2048){if((q-=2)<0)break;Q.push($>>6|192,63&$|128)}else if($<65536){if((q-=3)<0)break;Q.push($>>12|224,$>>6&63|128,63&$|128)}else{if(!($<1114112))throw new Error("Invalid code point");if((q-=4)<0)break;Q.push($>>18|240,$>>12&63|128,$>>6&63|128,63&$|128)}}return Q}function te(U){return a.toByteArray(function(q){if((q=(q=q.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;q.length%4!=0;)q+="=";return q}(U))}function Y(U,q,$,ne){for(var H=0;H=q.length||H>=U.length);++H)q[H+$]=U[H];return H}function Z(U,q){return U instanceof q||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===q.name}function re(U){return U!=U}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":79,buffer:85,ieee754:230}],86:[function(e,o,f){o.exports=function(r,a,u){return au?u:r:ra?a:r}},{}],87:[function(e,o,f){var r=e("clamp");function a(u,c){c==null&&(c=!0);var i=u[0],s=u[1],l=u[2],d=u[3];return d==null&&(d=c?1:255),c&&(i*=255,s*=255,l*=255,d*=255),16777216*(i=255&r(i,0,255))+((s=255&r(s,0,255))<<16)+((l=255&r(l,0,255))<<8)+(d=255&r(d,0,255))}o.exports=a,o.exports.to=a,o.exports.from=function(u,c){var i=(u=+u)>>>24,s=(16711680&u)>>>16,l=(65280&u)>>>8,d=255&u;return c===!1?[i,s,l,d]:[i/255,s/255,l/255,d/255]}},{clamp:86}],88:[function(e,o,f){o.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]}},{}],89:[function(e,o,f){var r=e("color-rgba"),a=e("clamp"),u=e("dtype");o.exports=function(c,i){i!=="float"&&i||(i="array"),i==="uint"&&(i="uint8"),i==="uint_clamped"&&(i="uint8_clamped");var s=new(u(i))(4),l=i!=="uint8"&&i!=="uint8_clamped";return c.length&&typeof c!="string"||((c=r(c))[0]/=255,c[1]/=255,c[2]/=255),function(d){return d instanceof Uint8Array||d instanceof Uint8ClampedArray||!!(Array.isArray(d)&&(d[0]>1||d[0]===0)&&(d[1]>1||d[1]===0)&&(d[2]>1||d[2]===0)&&(!d[3]||d[3]>1))}(c)?(s[0]=c[0],s[1]=c[1],s[2]=c[2],s[3]=c[3]!=null?c[3]:255,l&&(s[0]/=255,s[1]/=255,s[2]/=255,s[3]/=255),s):(l?(s[0]=c[0],s[1]=c[1],s[2]=c[2],s[3]=c[3]!=null?c[3]:1):(s[0]=a(Math.floor(255*c[0]),0,255),s[1]=a(Math.floor(255*c[1]),0,255),s[2]=a(Math.floor(255*c[2]),0,255),s[3]=c[3]==null?255:a(Math.floor(255*c[3]),0,255)),s)}},{clamp:86,"color-rgba":91,dtype:127}],90:[function(e,o,f){(function(r){(function(){var a=e("color-name"),u=e("is-plain-obj"),c=e("defined");o.exports=function(s){var l,d,h=[],m=1;if(typeof s=="string")if(a[s])h=a[s].slice(),d="rgb";else if(s==="transparent")m=0,d="rgb",h=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(s)){var g=(y=s.slice(1)).length;m=1,g<=4?(h=[parseInt(y[0]+y[0],16),parseInt(y[1]+y[1],16),parseInt(y[2]+y[2],16)],g===4&&(m=parseInt(y[3]+y[3],16)/255)):(h=[parseInt(y[0]+y[1],16),parseInt(y[2]+y[3],16),parseInt(y[4]+y[5],16)],g===8&&(m=parseInt(y[6]+y[7],16)/255)),h[0]||(h[0]=0),h[1]||(h[1]=0),h[2]||(h[2]=0),d="rgb"}else if(l=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(s)){var p=l[1],v=p==="rgb",y=p.replace(/a$/,"");d=y,g=y==="cmyk"?4:y==="gray"?1:3,h=l[2].trim().split(/\s*,\s*/).map(function(w,k){if(/%$/.test(w))return k===g?parseFloat(w)/100:y==="rgb"?255*parseFloat(w)/100:parseFloat(w);if(y[k]==="h"){if(/deg$/.test(w))return parseFloat(w);if(i[w]!==void 0)return i[w]}return parseFloat(w)}),p===y&&h.push(1),m=v||h[g]===void 0?1:h[g],h=h.slice(0,g)}else s.length>10&&/[0-9](?:\s|\/)/.test(s)&&(h=s.match(/([0-9]+)/g).map(function(w){return parseFloat(w)}),d=s.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(s))if(u(s)){var x=c(s.r,s.red,s.R,null);x!==null?(d="rgb",h=[x,c(s.g,s.green,s.G),c(s.b,s.blue,s.B)]):(d="hsl",h=[c(s.h,s.hue,s.H),c(s.s,s.saturation,s.S),c(s.l,s.lightness,s.L,s.b,s.brightness)]),m=c(s.a,s.alpha,s.opacity,1),s.opacity!=null&&(m/=100)}else(Array.isArray(s)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(s))&&(h=[s[0],s[1],s[2]],d="rgb",m=s.length===4?s[3]:1);else d="rgb",h=[s>>>16,(65280&s)>>>8,255&s];return{space:d,values:h,alpha:m}};var i={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,typeof Ro<"u"?Ro:typeof self<"u"?self:typeof window<"u"?window:{})},{"color-name":88,defined:124,"is-plain-obj":236}],91:[function(e,o,f){var r=e("color-parse"),a=e("color-space/hsl"),u=e("clamp");o.exports=function(c){var i,s=r(c);return s.space?((i=Array(3))[0]=u(s.values[0],0,255),i[1]=u(s.values[1],0,255),i[2]=u(s.values[2],0,255),s.space[0]==="h"&&(i=a.rgb(i)),i.push(u(s.alpha,0,1)),i):[]}},{clamp:86,"color-parse":90,"color-space/hsl":92}],92:[function(e,o,f){var r=e("./rgb");o.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(a){var u,c,i,s,l,d=a[0]/360,h=a[1]/100,m=a[2]/100;if(h===0)return[l=255*m,l,l];u=2*m-(c=m<.5?m*(1+h):m+h-m*h),s=[0,0,0];for(var g=0;g<3;g++)(i=d+1/3*-(g-1))<0?i++:i>1&&i--,l=6*i<1?u+6*(c-u)*i:2*i<1?c:3*i<2?u+(c-u)*(2/3-i)*6:u,s[g]=255*l;return s}},r.hsl=function(a){var u,c,i=a[0]/255,s=a[1]/255,l=a[2]/255,d=Math.min(i,s,l),h=Math.max(i,s,l),m=h-d;return h===d?u=0:i===h?u=(s-l)/m:s===h?u=2+(l-i)/m:l===h&&(u=4+(i-s)/m),(u=Math.min(60*u,360))<0&&(u+=360),c=(d+h)/2,[u,100*(h===d?0:c<=.5?m/(h+d):m/(2-h-d)),100*c]}},{"./rgb":93}],93:[function(e,o,f){o.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],94:[function(e,o,f){o.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"}},{}],95:[function(e,o,f){o.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],96:[function(e,o,f){o.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],97:[function(e,o,f){o.exports=["normal","italic","oblique"]},{}],98:[function(e,o,f){o.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],99:[function(e,o,f){o.exports={parse:e("./parse"),stringify:e("./stringify")}},{"./parse":101,"./stringify":102}],100:[function(e,o,f){var r=e("css-font-size-keywords");o.exports={isSize:function(a){return/^[\d\.]/.test(a)||a.indexOf("/")!==-1||r.indexOf(a)!==-1}}},{"css-font-size-keywords":95}],101:[function(e,o,f){var r=e("unquote"),a=e("css-global-keywords"),u=e("css-system-font-keywords"),c=e("css-font-weight-keywords"),i=e("css-font-style-keywords"),s=e("css-font-stretch-keywords"),l=e("string-split-by"),d=e("./lib/util").isSize;o.exports=m;var h=m.cache={};function m(p){if(typeof p!="string")throw new Error("Font argument must be a string.");if(h[p])return h[p];if(p==="")throw new Error("Cannot parse an empty string.");if(u.indexOf(p)!==-1)return h[p]={system:p};for(var v,y={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},x=l(p,/\s+/);v=x.shift();){if(a.indexOf(v)!==-1)return["style","variant","weight","stretch"].forEach(function(k){y[k]=v}),h[p]=y;if(i.indexOf(v)===-1)if(v!=="normal"&&v!=="small-caps")if(s.indexOf(v)===-1){if(c.indexOf(v)===-1){if(d(v)){var w=l(v,"/");if(y.size=w[0],w[1]!=null?y.lineHeight=g(w[1]):x[0]==="/"&&(x.shift(),y.lineHeight=g(x.shift())),!x.length)throw new Error("Missing required font-family.");return y.family=l(x.join(" "),/\s*,\s*/).map(r),h[p]=y}throw new Error("Unknown or unsupported font token: "+v)}y.weight=v}else y.stretch=v;else y.variant=v;else y.style=v}throw new Error("Missing required font-size.")}function g(p){var v=parseFloat(p);return v.toString()===p?v:p}},{"./lib/util":100,"css-font-stretch-keywords":96,"css-font-style-keywords":97,"css-font-weight-keywords":98,"css-global-keywords":103,"css-system-font-keywords":104,"string-split-by":305,unquote:328}],102:[function(e,o,f){var r=e("pick-by-alias"),a=e("./lib/util").isSize,u=v(e("css-global-keywords")),c=v(e("css-system-font-keywords")),i=v(e("css-font-weight-keywords")),s=v(e("css-font-style-keywords")),l=v(e("css-font-stretch-keywords")),d={normal:1,"small-caps":1},h={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},m="1rem",g="serif";function p(y,x){if(y&&!x[y]&&!u[y])throw Error("Unknown keyword `"+y+"`");return y}function v(y){for(var x={},w=0;wL?1:z>=L?0:NaN}function u(z){var L;return z.length===1&&(L=z,z=function(P,N){return a(L(P),N)}),{left:function(P,N,B,G){for(B==null&&(B=0),G==null&&(G=P.length);B>>1;z(P[W],N)<0?B=W+1:G=W}return B},right:function(P,N,B,G){for(B==null&&(B=0),G==null&&(G=P.length);B>>1;z(P[W],N)>0?G=W:B=W+1}return B}}}var c=u(a),i=c.right,s=c.left;function l(z,L){return[z,L]}function d(z){return z===null?NaN:+z}function h(z,L){var P,N,B=z.length,G=0,W=-1,K=0,te=0;if(L==null)for(;++W1)return te/(G-1)}function m(z,L){var P=h(z,L);return P&&Math.sqrt(P)}function g(z,L){var P,N,B,G=z.length,W=-1;if(L==null){for(;++W=P)for(N=B=P;++WP&&(N=P),B=P)for(N=B=P;++WP&&(N=P),B=0?(G>=b?10:G>=T?5:G>=_?2:1)*Math.pow(10,B):-Math.pow(10,-B)/(G>=b?10:G>=T?5:G>=_?2:1)}function A(z,L,P){var N=Math.abs(L-z)/Math.max(0,P),B=Math.pow(10,Math.floor(Math.log(N)/Math.LN10)),G=N/B;return G>=b?B*=10:G>=T?B*=5:G>=_&&(B*=2),L=1)return+P(z[N-1],N-1,z);var N,B=(N-1)*L,G=Math.floor(B),W=+P(z[G],G,z);return W+(+P(z[G+1],G+1,z)-W)*(B-G)}}function D(z,L){var P,N,B=z.length,G=-1;if(L==null){for(;++G=P)for(N=P;++GP&&(N=P)}else for(;++G=P)for(N=P;++GP&&(N=P);return N}function O(z){if(!(B=z.length))return[];for(var L=-1,P=D(z,R),N=new Array(P);++Lz?1:L>=z?0:NaN},r.deviation=m,r.extent=g,r.histogram=function(){var z=w,L=g,P=S;function N(B){var G,W,K=B.length,te=new Array(K);for(G=0;Gre;)U.pop(),--q;var $,ne=new Array(q+1);for(G=0;G<=q;++G)($=ne[G]=[]).x0=G>0?U[G-1]:Z,$.x1=G=P)for(N=P;++GN&&(N=P)}else for(;++G=P)for(N=P;++GN&&(N=P);return N},r.mean=function(z,L){var P,N=z.length,B=N,G=-1,W=0;if(L==null)for(;++G=0;)for(L=(N=z[B]).length;--L>=0;)P[--W]=N[L];return P},r.min=D,r.pairs=function(z,L){L==null&&(L=l);for(var P=0,N=z.length-1,B=z[0],G=new Array(N<0?0:N);P0)return[z];if((N=L0)for(z=Math.ceil(z/W),L=Math.floor(L/W),G=new Array(B=Math.ceil(L-z+1));++K=y.length)return g!=null&&k.sort(g),p!=null?p(k):k;for(var M,A,S,E=-1,D=k.length,O=y[b++],R=u(),z=T();++Ey.length)return T;var M,A=x[_-1];return p!=null&&_>=y.length?M=T.entries():(M=[],T.each(function(S,E){M.push({key:E,values:b(S,_)})})),A!=null?M.sort(function(S,E){return A(S.key,E.key)}):M}(w(k,0,s,l),0)},key:function(k){return y.push(k),v},sortKeys:function(k){return x[y.length-1]=k,v},sortValues:function(k){return g=k,v},rollup:function(k){return p=k,v}}},r.set=m,r.map=u,r.keys=function(g){var p=[];for(var v in g)p.push(v);return p},r.values=function(g){var p=[];for(var v in g)p.push(g[v]);return p},r.entries=function(g){var p=[];for(var v in g)p.push({key:v,value:g[v]});return p},Object.defineProperty(r,"__esModule",{value:!0})})},{}],109:[function(e,o,f){(function(r,a){a(typeof f=="object"&&o!==void 0?f:(r=r||self).d3=r.d3||{})})(this,function(r){function a(de,ye,Me){de.prototype=ye.prototype=Me,Me.constructor=de}function u(de,ye){var Me=Object.create(de.prototype);for(var ke in ye)Me[ke]=ye[ke];return Me}function c(){}var i="\\s*([+-]?\\d+)\\s*",s="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",l="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",d=/^#([0-9a-f]{3,8})$/,h=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),m=new RegExp("^rgb\\("+[l,l,l]+"\\)$"),g=new RegExp("^rgba\\("+[i,i,i,s]+"\\)$"),p=new RegExp("^rgba\\("+[l,l,l,s]+"\\)$"),v=new RegExp("^hsl\\("+[s,l,l]+"\\)$"),y=new RegExp("^hsla\\("+[s,l,l,s]+"\\)$"),x={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function w(){return this.rgb().formatHex()}function k(){return this.rgb().formatRgb()}function b(de){var ye,Me;return de=(de+"").trim().toLowerCase(),(ye=d.exec(de))?(Me=ye[1].length,ye=parseInt(ye[1],16),Me===6?T(ye):Me===3?new S(ye>>8&15|ye>>4&240,ye>>4&15|240&ye,(15&ye)<<4|15&ye,1):Me===8?_(ye>>24&255,ye>>16&255,ye>>8&255,(255&ye)/255):Me===4?_(ye>>12&15|ye>>8&240,ye>>8&15|ye>>4&240,ye>>4&15|240&ye,((15&ye)<<4|15&ye)/255):null):(ye=h.exec(de))?new S(ye[1],ye[2],ye[3],1):(ye=m.exec(de))?new S(255*ye[1]/100,255*ye[2]/100,255*ye[3]/100,1):(ye=g.exec(de))?_(ye[1],ye[2],ye[3],ye[4]):(ye=p.exec(de))?_(255*ye[1]/100,255*ye[2]/100,255*ye[3]/100,ye[4]):(ye=v.exec(de))?R(ye[1],ye[2]/100,ye[3]/100,1):(ye=y.exec(de))?R(ye[1],ye[2]/100,ye[3]/100,ye[4]):x.hasOwnProperty(de)?T(x[de]):de==="transparent"?new S(NaN,NaN,NaN,0):null}function T(de){return new S(de>>16&255,de>>8&255,255&de,1)}function _(de,ye,Me,ke){return ke<=0&&(de=ye=Me=NaN),new S(de,ye,Me,ke)}function M(de){return de instanceof c||(de=b(de)),de?new S((de=de.rgb()).r,de.g,de.b,de.opacity):new S}function A(de,ye,Me,ke){return arguments.length===1?M(de):new S(de,ye,Me,ke??1)}function S(de,ye,Me,ke){this.r=+de,this.g=+ye,this.b=+Me,this.opacity=+ke}function E(){return"#"+O(this.r)+O(this.g)+O(this.b)}function D(){var de=this.opacity;return((de=isNaN(de)?1:Math.max(0,Math.min(1,de)))===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(de===1?")":", "+de+")")}function O(de){return((de=Math.max(0,Math.min(255,Math.round(de)||0)))<16?"0":"")+de.toString(16)}function R(de,ye,Me,ke){return ke<=0?de=ye=Me=NaN:Me<=0||Me>=1?de=ye=NaN:ye<=0&&(de=NaN),new P(de,ye,Me,ke)}function z(de){if(de instanceof P)return new P(de.h,de.s,de.l,de.opacity);if(de instanceof c||(de=b(de)),!de)return new P;if(de instanceof P)return de;var ye=(de=de.rgb()).r/255,Me=de.g/255,ke=de.b/255,Ee=Math.min(ye,Me,ke),ze=Math.max(ye,Me,ke),Fe=NaN,Ve=ze-Ee,Ke=(ze+Ee)/2;return Ve?(Fe=ye===ze?(Me-ke)/Ve+6*(Me0&&Ke<1?0:Fe,new P(Fe,Ve,Ke,de.opacity)}function L(de,ye,Me,ke){return arguments.length===1?z(de):new P(de,ye,Me,ke??1)}function P(de,ye,Me,ke){this.h=+de,this.s=+ye,this.l=+Me,this.opacity=+ke}function N(de,ye,Me){return 255*(de<60?ye+(Me-ye)*de/60:de<180?Me:de<240?ye+(Me-ye)*(240-de)/60:ye)}a(c,b,{copy:function(de){return Object.assign(new this.constructor,this,de)},displayable:function(){return this.rgb().displayable()},hex:w,formatHex:w,formatHsl:function(){return z(this).formatHsl()},formatRgb:k,toString:k}),a(S,A,u(c,{brighter:function(de){return de=de==null?1/.7:Math.pow(1/.7,de),new S(this.r*de,this.g*de,this.b*de,this.opacity)},darker:function(de){return de=de==null?.7:Math.pow(.7,de),new S(this.r*de,this.g*de,this.b*de,this.opacity)},rgb:function(){return this},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:E,formatHex:E,formatRgb:D,toString:D})),a(P,L,u(c,{brighter:function(de){return de=de==null?1/.7:Math.pow(1/.7,de),new P(this.h,this.s,this.l*de,this.opacity)},darker:function(de){return de=de==null?.7:Math.pow(.7,de),new P(this.h,this.s,this.l*de,this.opacity)},rgb:function(){var de=this.h%360+360*(this.h<0),ye=isNaN(de)||isNaN(this.s)?0:this.s,Me=this.l,ke=Me+(Me<.5?Me:1-Me)*ye,Ee=2*Me-ke;return new S(N(de>=240?de-240:de+120,Ee,ke),N(de,Ee,ke),N(de<120?de+240:de-120,Ee,ke),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 de=this.opacity;return((de=isNaN(de)?1:Math.max(0,Math.min(1,de)))===1?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(de===1?")":", "+de+")")}}));var B=Math.PI/180,G=180/Math.PI,W=6/29,K=3*W*W;function te(de){if(de instanceof Z)return new Z(de.l,de.a,de.b,de.opacity);if(de instanceof Q)return ee(de);de instanceof S||(de=M(de));var ye,Me,ke=$(de.r),Ee=$(de.g),ze=$(de.b),Fe=re((.2225045*ke+.7168786*Ee+.0606169*ze)/1);return ke===Ee&&Ee===ze?ye=Me=Fe:(ye=re((.4360747*ke+.3850649*Ee+.1430804*ze)/.96422),Me=re((.0139322*ke+.0971045*Ee+.7141733*ze)/.82521)),new Z(116*Fe-16,500*(ye-Fe),200*(Fe-Me),de.opacity)}function Y(de,ye,Me,ke){return arguments.length===1?te(de):new Z(de,ye,Me,ke??1)}function Z(de,ye,Me,ke){this.l=+de,this.a=+ye,this.b=+Me,this.opacity=+ke}function re(de){return de>.008856451679035631?Math.pow(de,1/3):de/K+4/29}function U(de){return de>W?de*de*de:K*(de-4/29)}function q(de){return 255*(de<=.0031308?12.92*de:1.055*Math.pow(de,1/2.4)-.055)}function $(de){return(de/=255)<=.04045?de/12.92:Math.pow((de+.055)/1.055,2.4)}function ne(de){if(de instanceof Q)return new Q(de.h,de.c,de.l,de.opacity);if(de instanceof Z||(de=te(de)),de.a===0&&de.b===0)return new Q(NaN,0=0&&(g=m.slice(p+1),m=m.slice(0,p)),m&&!h.hasOwnProperty(m))throw new Error("unknown type: "+m);return{type:m,name:g}})}function s(d,h){for(var m,g=0,p=d.length;g0)for(var m,g,p=new Array(m),v=0;vO+U||teR+U||YD.index){var q=O-Z.x-Z.vx,$=R-Z.y-Z.vy,ne=q*q+$*$;neS.r&&(S.r=S[E].r)}function A(){if(w){var S,E,D=w.length;for(k=new Array(D),S=0;S=M)){(R.data!==w||R.next)&&(N===0&&(W+=(N=l())*N),B===0&&(W+=(B=l())*B),W<_&&(W=Math.sqrt(_*W)));do R.data!==w&&(G=b[R.data.index]*k/W,w.vx+=N*G,w.vy+=B*G);while(R=R.next)}}return S.initialize=function(R){x=R,E()},S.strength=function(R){return arguments.length?(T=typeof R=="function"?R:s(+R),E(),S):T},S.distanceMin=function(R){return arguments.length?(_=R*R,S):Math.sqrt(_)},S.distanceMax=function(R){return arguments.length?(M=R*R,S):Math.sqrt(M)},S.theta=function(R){return arguments.length?(A=R*R,S):Math.sqrt(A)},S},r.forceRadial=function(x,w,k){var b,T,_,M=s(.1);function A(E){for(var D=0,O=b.length;D1?(P==null?A.remove(L):A.set(L,z(P)),w):A.get(L)},find:function(L,P,N){var B,G,W,K,te,Y=0,Z=x.length;for(N==null?N=1/0:N*=N,Y=0;Y1?(E.on(L,P),w):E.on(L)}}},r.forceX=function(x){var w,k,b,T=s(.1);function _(A){for(var S,E=0,D=w.length;E1?T[0]+T.slice(2):T,+w.slice(b+1)]}function u(w){return(w=a(Math.abs(w)))?w[1]:NaN}var c,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function s(w){if(!(k=i.exec(w)))throw new Error("invalid format: "+w);var k;return new l({fill:k[1],align:k[2],sign:k[3],symbol:k[4],zero:k[5],width:k[6],comma:k[7],precision:k[8]&&k[8].slice(1),trim:k[9],type:k[10]})}function l(w){this.fill=w.fill===void 0?" ":w.fill+"",this.align=w.align===void 0?">":w.align+"",this.sign=w.sign===void 0?"-":w.sign+"",this.symbol=w.symbol===void 0?"":w.symbol+"",this.zero=!!w.zero,this.width=w.width===void 0?void 0:+w.width,this.comma=!!w.comma,this.precision=w.precision===void 0?void 0:+w.precision,this.trim=!!w.trim,this.type=w.type===void 0?"":w.type+""}function d(w,k){var b=a(w,k);if(!b)return w+"";var T=b[0],_=b[1];return _<0?"0."+new Array(-_).join("0")+T:T.length>_+1?T.slice(0,_+1)+"."+T.slice(_+1):T+new Array(_-T.length+2).join("0")}s.prototype=l.prototype,l.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,0|this.width))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var h={"%":function(w,k){return(100*w).toFixed(k)},b:function(w){return Math.round(w).toString(2)},c:function(w){return w+""},d:function(w){return Math.abs(w=Math.round(w))>=1e21?w.toLocaleString("en").replace(/,/g,""):w.toString(10)},e:function(w,k){return w.toExponential(k)},f:function(w,k){return w.toFixed(k)},g:function(w,k){return w.toPrecision(k)},o:function(w){return Math.round(w).toString(8)},p:function(w,k){return d(100*w,k)},r:d,s:function(w,k){var b=a(w,k);if(!b)return w+"";var T=b[0],_=b[1],M=_-(c=3*Math.max(-8,Math.min(8,Math.floor(_/3))))+1,A=T.length;return M===A?T:M>A?T+new Array(M-A+1).join("0"):M>0?T.slice(0,M)+"."+T.slice(M):"0."+new Array(1-M).join("0")+a(w,Math.max(0,k+M-1))[0]},X:function(w){return Math.round(w).toString(16).toUpperCase()},x:function(w){return Math.round(w).toString(16)}};function m(w){return w}var g,p=Array.prototype.map,v=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function y(w){var k,b,T=w.grouping===void 0||w.thousands===void 0?m:(k=p.call(w.grouping,Number),b=w.thousands+"",function(z,L){for(var P=z.length,N=[],B=0,G=k[0],W=0;P>0&&G>0&&(W+G+1>L&&(G=Math.max(1,L-W)),N.push(z.substring(P-=G,P+G)),!((W+=G+1)>L));)G=k[B=(B+1)%k.length];return N.reverse().join(b)}),_=w.currency===void 0?"":w.currency[0]+"",M=w.currency===void 0?"":w.currency[1]+"",A=w.decimal===void 0?".":w.decimal+"",S=w.numerals===void 0?m:function(z){return function(L){return L.replace(/[0-9]/g,function(P){return z[+P]})}}(p.call(w.numerals,String)),E=w.percent===void 0?"%":w.percent+"",D=w.minus===void 0?"-":w.minus+"",O=w.nan===void 0?"NaN":w.nan+"";function R(z){var L=(z=s(z)).fill,P=z.align,N=z.sign,B=z.symbol,G=z.zero,W=z.width,K=z.comma,te=z.precision,Y=z.trim,Z=z.type;Z==="n"?(K=!0,Z="g"):h[Z]||(te===void 0&&(te=12),Y=!0,Z="g"),(G||L==="0"&&P==="=")&&(G=!0,L="0",P="=");var re=B==="$"?_:B==="#"&&/[boxX]/.test(Z)?"0"+Z.toLowerCase():"",U=B==="$"?M:/[%p]/.test(Z)?E:"",q=h[Z],$=/[defgprs%]/.test(Z);function ne(H){var Q,ee,ie,ae=re,ue=U;if(Z==="c")ue=q(H)+ue,H="";else{var le=(H=+H)<0||1/H<0;if(H=isNaN(H)?O:q(Math.abs(H),te),Y&&(H=function(me){e:for(var _e,we=me.length,Te=1,Oe=-1;Te0&&(Oe=0)}return Oe>0?me.slice(0,Oe)+me.slice(_e+1):me}(H)),le&&+H==0&&N!=="+"&&(le=!1),ae=(le?N==="("?N:D:N==="-"||N==="("?"":N)+ae,ue=(Z==="s"?v[8+c/3]:"")+ue+(le&&N==="("?")":""),$){for(Q=-1,ee=H.length;++Q(ie=H.charCodeAt(Q))||ie>57){ue=(ie===46?A+H.slice(Q+1):H.slice(Q))+ue,H=H.slice(0,Q);break}}}K&&!G&&(H=T(H,1/0));var ge=ae.length+H.length+ue.length,fe=ge>1)+ae+H+ue+fe.slice(ge);break;default:H=fe+ae+H+ue}return S(H)}return te=te===void 0?6:/[gprs]/.test(Z)?Math.max(1,Math.min(21,te)):Math.max(0,Math.min(20,te)),ne.toString=function(){return z+""},ne}return{format:R,formatPrefix:function(z,L){var P=R(((z=s(z)).type="f",z)),N=3*Math.max(-8,Math.min(8,Math.floor(u(L)/3))),B=Math.pow(10,-N),G=v[8+N/3];return function(W){return P(B*W)+G}}}}function x(w){return g=y(w),r.format=g.format,r.formatPrefix=g.formatPrefix,g}x({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),r.FormatSpecifier=l,r.formatDefaultLocale=x,r.formatLocale=y,r.formatSpecifier=s,r.precisionFixed=function(w){return Math.max(0,-u(Math.abs(w)))},r.precisionPrefix=function(w,k){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(u(k)/3)))-u(Math.abs(w)))},r.precisionRound=function(w,k){return w=Math.abs(w),k=Math.abs(k)-w,Math.max(0,u(k)-u(w))+1},Object.defineProperty(r,"__esModule",{value:!0})})},{}],113:[function(e,o,f){(function(r,a){typeof f=="object"&&o!==void 0?a(f,e("d3-geo"),e("d3-array")):a(r.d3=r.d3||{},r.d3,r.d3)})(this,function(r,a,u){var c=Math.abs,i=Math.atan,s=Math.atan2,l=Math.cos,d=Math.exp,h=Math.floor,m=Math.log,g=Math.max,p=Math.min,v=Math.pow,y=Math.round,x=Math.sign||function(je){return je>0?1:je<0?-1:0},w=Math.sin,k=Math.tan,b=1e-6,T=Math.PI,_=T/2,M=T/4,A=Math.SQRT1_2,S=P(2),E=P(T),D=2*T,O=180/T,R=T/180;function z(je){return je>1?_:je<-1?-_:Math.asin(je)}function L(je){return je>1?0:je<-1?T:Math.acos(je)}function P(je){return je>0?Math.sqrt(je):0}function N(je){return(d(je)-d(-je))/2}function B(je){return(d(je)+d(-je))/2}function G(je){var $e=k(je/2),Qe=2*m(l(je/2))/($e*$e);function ut(mt,pt){var Ct=l(mt),Qt=l(pt),en=w(pt),Yt=Qt*Ct,an=-((1-Yt?m((1+Yt)/2)/(1-Yt):-.5)+Qe/(1+Yt));return[an*Qt*w(mt),an*en]}return ut.invert=function(mt,pt){var Ct,Qt=P(mt*mt+pt*pt),en=-je/2,Yt=50;if(!Qt)return[0,0];do{var an=en/2,hn=l(an),xn=w(an),_n=xn/hn,Pn=-m(c(hn));en-=Ct=(2/_n*Pn-Qe*_n-Qt)/(-Pn/(xn*xn)+1-Qe/(2*hn*hn))*(hn<0?.7:1)}while(c(Ct)>b&&--Yt>0);var sr=w(en);return[s(mt*sr,Qt*l(en)),z(pt*sr/Qt)]},ut}function W(je,$e){var Qe=l($e),ut=function(mt){return mt?mt/Math.sin(mt):1}(L(Qe*l(je/=2)));return[2*Qe*w(je)*ut,w($e)*ut]}function K(je){var $e=w(je),Qe=l(je),ut=je>=0?1:-1,mt=k(ut*je),pt=(1+$e-Qe)/2;function Ct(Qt,en){var Yt=l(en),an=l(Qt/=2);return[(1+Yt)*w(Qt),(ut*en>-s(an,mt)-.001?0:10*-ut)+pt+w(en)*Qe-(1+Yt)*$e*an]}return Ct.invert=function(Qt,en){var Yt=0,an=0,hn=50;do{var xn=l(Yt),_n=w(Yt),Pn=l(an),sr=w(an),mr=1+Pn,zr=mr*_n-Qt,Br=pt+sr*Qe-mr*$e*xn-en,Jr=mr*xn/2,jr=-_n*sr,Oi=$e*mr*_n/2,Ui=Qe*Pn+$e*xn*sr,ua=jr*Oi-Ui*Jr,sa=(Br*jr-zr*Ui)/ua/2,ca=(zr*Oi-Br*Jr)/ua;c(ca)>2&&(ca/=2),Yt-=sa,an-=ca}while((c(sa)>b||c(ca)>b)&&--hn>0);return ut*an>-s(l(Yt),mt)-.001?[2*Yt,an]:null},Ct}function te(je,$e){var Qe=k($e/2),ut=P(1-Qe*Qe),mt=1+ut*l(je/=2),pt=w(je)*ut/mt,Ct=Qe/mt,Qt=pt*pt,en=Ct*Ct;return[4/3*pt*(3+Qt-3*en),4/3*Ct*(3+3*Qt-en)]}W.invert=function(je,$e){if(!(je*je+4*$e*$e>T*T+b)){var Qe=je,ut=$e,mt=25;do{var pt,Ct=w(Qe),Qt=w(Qe/2),en=l(Qe/2),Yt=w(ut),an=l(ut),hn=w(2*ut),xn=Yt*Yt,_n=an*an,Pn=Qt*Qt,sr=1-_n*en*en,mr=sr?L(an*en)*P(pt=1/sr):pt=0,zr=2*mr*an*Qt-je,Br=mr*Yt-$e,Jr=pt*(_n*Pn+mr*an*en*xn),jr=pt*(.5*Ct*hn-2*mr*Yt*Qt),Oi=.25*pt*(hn*Qt-mr*Yt*_n*Ct),Ui=pt*(xn*en+mr*Pn*an),ua=jr*Oi-Ui*Jr;if(!ua)break;var sa=(Br*jr-zr*Ui)/ua,ca=(zr*Oi-Br*Jr)/ua;Qe-=sa,ut-=ca}while((c(sa)>b||c(ca)>b)&&--mt>0);return[Qe,ut]}},te.invert=function(je,$e){if($e*=3/8,!(je*=3/8)&&c($e)>1)return null;var Qe=1+je*je+$e*$e,ut=P((Qe-P(Qe*Qe-4*$e*$e))/2),mt=z(ut)/3,pt=ut?function(Yt){return m(Yt+P(Yt*Yt-1))}(c($e/ut))/3:function(Yt){return m(Yt+P(Yt*Yt+1))}(c(je))/3,Ct=l(mt),Qt=B(pt),en=Qt*Qt-Ct*Ct;return[2*x(je)*s(N(pt)*Ct,.25-en),2*x($e)*s(Qt*w(mt),.25+en)]};var Y=P(8),Z=m(1+S);function re(je,$e){var Qe=c($e);return Qe_){var Ct=s(pt[1],pt[0]),Qt=P(pt[0]*pt[0]+pt[1]*pt[1]),en=$e*y((Ct-_)/$e)+_,Yt=s(w(Ct-=en),2-l(Ct));Ct=en+z(T/Qt*w(Yt))-Yt,pt[0]=Qt*l(Ct),pt[1]=Qt*w(Ct)}return pt}return Qe.invert=function(ut,mt){var pt=P(ut*ut+mt*mt);if(pt>_){var Ct=s(mt,ut),Qt=$e*y((Ct-_)/$e)+_,en=Ct>Qt?-1:1,Yt=pt*l(Qt-Ct),an=1/k(en*L((Yt-T)/P(T*(T-2*Yt)+pt*pt)));Ct=Qt+2*i((an+en*P(an*an-3))/3),ut=pt*l(Ct),mt=pt*w(Ct)}return a.geoAzimuthalEquidistantRaw.invert(ut,mt)},Qe}function q(je,$e){if(arguments.length<2&&($e=je),$e===1)return a.geoAzimuthalEqualAreaRaw;if($e===1/0)return $;function Qe(ut,mt){var pt=a.geoAzimuthalEqualAreaRaw(ut/$e,mt);return pt[0]*=je,pt}return Qe.invert=function(ut,mt){var pt=a.geoAzimuthalEqualAreaRaw.invert(ut/je,mt);return pt[0]*=$e,pt},Qe}function $(je,$e){return[je*l($e)/l($e/=2),2*w($e)]}function ne(je,$e,Qe){var ut,mt,pt,Ct=100;Qe=Qe===void 0?0:+Qe,$e=+$e;do(mt=je(Qe))===(pt=je(Qe+b))&&(pt=mt+b),Qe-=ut=-1*b*(mt-$e)/(mt-pt);while(Ct-- >0&&c(ut)>b);return Ct<0?NaN:Qe}function H(je,$e,Qe){return $e===void 0&&($e=40),Qe===void 0&&(Qe=1e-12),function(ut,mt,pt,Ct){var Qt,en,Yt;pt=pt===void 0?0:+pt,Ct=Ct===void 0?0:+Ct;for(var an=0;an<$e;an++){var hn=je(pt,Ct),xn=hn[0]-ut,_n=hn[1]-mt;if(c(xn)Qt)pt-=en/=2,Ct-=Yt/=2;else{Qt=Pn;var sr=(pt>0?-1:1)*Qe,mr=(Ct>0?-1:1)*Qe,zr=je(pt+sr,Ct),Br=je(pt,Ct+mr),Jr=(zr[0]-hn[0])/sr,jr=(zr[1]-hn[1])/sr,Oi=(Br[0]-hn[0])/mr,Ui=(Br[1]-hn[1])/mr,ua=Ui*Jr-jr*Oi,sa=(c(ua)<.5?.5:1)/ua;if(pt+=en=(_n*Oi-xn*Ui)*sa,Ct+=Yt=(xn*jr-_n*Jr)*sa,c(en)0&&(pt[1]*=1+Ct/1.5*pt[0]*pt[0]),pt}return $e.invert=H($e),$e}function ee(je,$e){var Qe,ut=je*w($e),mt=30;do $e-=Qe=($e+w($e)-ut)/(1+l($e));while(c(Qe)>b&&--mt>0);return $e/2}function ie(je,$e,Qe){function ut(mt,pt){return[je*mt*l(pt=ee(Qe,pt)),$e*w(pt)]}return ut.invert=function(mt,pt){return pt=z(pt/$e),[mt/(je*l(pt)),z((2*pt+w(2*pt))/Qe)]},ut}re.invert=function(je,$e){if((ut=c($e))1e-12&&--pt>0);return[je/(l(mt)*(Y-1/w(mt))),x($e)*mt]},$.invert=function(je,$e){var Qe=2*z($e/2);return[je*l(Qe/2)/l(Qe),Qe]};var ae=ie(S/_,S,T),ue=2.00276,le=1.11072;function ge(je,$e){var Qe=ee(T,$e);return[ue*je/(1/l($e)+le/l(Qe)),($e+S*w(Qe))/ue]}function fe(je){var $e=0,Qe=a.geoProjectionMutator(je),ut=Qe($e);return ut.parallel=function(mt){return arguments.length?Qe($e=mt*R):$e*O},ut}function me(je,$e){return[je*l($e),$e]}function _e(je){if(!je)return me;var $e=1/k(je);function Qe(ut,mt){var pt=$e+je-mt,Ct=pt&&ut*l(mt)/pt;return[pt*w(Ct),$e-pt*l(Ct)]}return Qe.invert=function(ut,mt){var pt=P(ut*ut+(mt=$e-mt)*mt),Ct=$e+je-pt;return[pt/l(Ct)*s(ut,mt),Ct]},Qe}function we(je){function $e(Qe,ut){var mt=_-ut,pt=mt&&Qe*je*w(mt)/mt;return[mt*w(pt)/je,_-mt*l(pt)]}return $e.invert=function(Qe,ut){var mt=Qe*je,pt=_-ut,Ct=P(mt*mt+pt*pt),Qt=s(mt,pt);return[(Ct?Ct/w(Ct):1)*Qt/je,_-Ct]},$e}ge.invert=function(je,$e){var Qe,ut,mt=ue*$e,pt=$e<0?-M:M,Ct=25;do ut=mt-S*w(pt),pt-=Qe=(w(2*pt)+2*pt-T*w(ut))/(2*l(2*pt)+2+T*l(ut)*S*l(pt));while(c(Qe)>b&&--Ct>0);return ut=mt-S*w(pt),[je*(1/l(ut)+le/l(pt))/ue,ut]},me.invert=function(je,$e){return[je/l($e),$e]};var Te=ie(1,4/T,T);function Oe(je,$e,Qe,ut,mt,pt){var Ct,Qt=l(pt);if(c(je)>1||c(pt)>1)Ct=L(Qe*mt+$e*ut*Qt);else{var en=w(je/2),Yt=w(pt/2);Ct=2*z(P(en*en+$e*ut*Yt*Yt))}return c(Ct)>b?[Ct,s(ut*w(pt),$e*mt-Qe*ut*Qt)]:[0,0]}function de(je,$e,Qe){return L((je*je+$e*$e-Qe*Qe)/(2*je*$e))}function ye(je){return je-2*T*h((je+T)/(2*T))}function Me(je,$e,Qe){for(var ut,mt=[[je[0],je[1],w(je[1]),l(je[1])],[$e[0],$e[1],w($e[1]),l($e[1])],[Qe[0],Qe[1],w(Qe[1]),l(Qe[1])]],pt=mt[2],Ct=0;Ct<3;++Ct,pt=ut)ut=mt[Ct],pt.v=Oe(ut[1]-pt[1],pt[3],pt[2],ut[3],ut[2],ut[0]-pt[0]),pt.point=[0,0];var Qt=de(mt[0].v[0],mt[2].v[0],mt[1].v[0]),en=de(mt[0].v[0],mt[1].v[0],mt[2].v[0]),Yt=T-Qt;mt[2].point[1]=0,mt[0].point[0]=-(mt[1].point[0]=mt[0].v[0]/2);var an=[mt[2].point[0]=mt[0].point[0]+mt[2].v[0]*l(Qt),2*(mt[0].point[1]=mt[1].point[1]=mt[2].v[0]*w(Qt))];return function(hn,xn){var _n,Pn=w(xn),sr=l(xn),mr=new Array(3);for(_n=0;_n<3;++_n){var zr=mt[_n];if(mr[_n]=Oe(xn-zr[1],zr[3],zr[2],sr,Pn,hn-zr[0]),!mr[_n][0])return zr.point;mr[_n][1]=ye(mr[_n][1]-zr.v[1])}var Br=an.slice();for(_n=0;_n<3;++_n){var Jr=_n==2?0:_n+1,jr=de(mt[_n].v[0],mr[_n][0],mr[Jr][0]);mr[_n][1]<0&&(jr=-jr),_n?_n==1?(jr=en-jr,Br[0]-=mr[_n][0]*l(jr),Br[1]-=mr[_n][0]*w(jr)):(jr=Yt-jr,Br[0]+=mr[_n][0]*l(jr),Br[1]+=mr[_n][0]*w(jr)):(Br[0]+=mr[_n][0]*l(jr),Br[1]-=mr[_n][0]*w(jr))}return Br[0]/=3,Br[1]/=3,Br}}function ke(je){return je[0]*=R,je[1]*=R,je}function Ee(je,$e,Qe){var ut=a.geoCentroid({type:"MultiPoint",coordinates:[je,$e,Qe]}),mt=[-ut[0],-ut[1]],pt=a.geoRotation(mt),Ct=Me(ke(pt(je)),ke(pt($e)),ke(pt(Qe)));Ct.invert=H(Ct);var Qt=a.geoProjection(Ct).rotate(mt),en=Qt.center;return delete Qt.rotate,Qt.center=function(Yt){return arguments.length?en(pt(Yt)):pt.invert(en())},Qt.clipAngle(90)}function ze(je,$e){var Qe=P(1-w($e));return[2/E*je*Qe,E*(1-Qe)]}function Fe(je){var $e=k(je);function Qe(ut,mt){return[ut,(ut?ut/w(ut):1)*(w(mt)*l(ut)-$e*l(mt))]}return Qe.invert=$e?function(ut,mt){ut&&(mt*=w(ut)/ut);var pt=l(ut);return[ut,2*s(P(pt*pt+$e*$e-mt*mt)-pt,$e-mt)]}:function(ut,mt){return[ut,z(ut?mt*k(ut)/ut:mt)]},Qe}ze.invert=function(je,$e){var Qe=(Qe=$e/E-1)*Qe;return[Qe>0?je*P(T/Qe)/2:0,z(1-Qe)]};var Ve=P(3);function Ke(je,$e){return[Ve*je*(2*l(2*$e/3)-1)/E,Ve*E*w($e/3)]}function Re(je){var $e=l(je);function Qe(ut,mt){return[ut*$e,w(mt)/$e]}return Qe.invert=function(ut,mt){return[ut/$e,z(mt*$e)]},Qe}function qe(je){var $e=l(je);function Qe(ut,mt){return[ut*$e,(1+$e)*k(mt/2)]}return Qe.invert=function(ut,mt){return[ut/$e,2*i(mt/(1+$e))]},Qe}function We(je,$e){var Qe=P(8/(3*T));return[Qe*je*(1-c($e)/T),Qe*$e]}function Ye(je,$e){var Qe=P(4-3*w(c($e)));return[2/P(6*T)*je*Qe,x($e)*P(2*T/3)*(2-Qe)]}function nt(je,$e){var Qe=P(T*(4+T));return[2/Qe*je*(1+P(1-4*$e*$e/(T*T))),4/Qe*$e]}function ft(je,$e){var Qe=(2+_)*w($e);$e/=2;for(var ut=0,mt=1/0;ut<10&&c(mt)>b;ut++){var pt=l($e);$e-=mt=($e+w($e)*(pt+2)-Qe)/(2*pt*(1+pt))}return[2/P(T*(4+T))*je*(1+l($e)),2*P(T/(4+T))*w($e)]}function vt(je,$e){return[je*(1+l($e))/P(2+T),2*$e/P(2+T)]}function Pt(je,$e){for(var Qe=(1+_)*w($e),ut=0,mt=1/0;ut<10&&c(mt)>b;ut++)$e-=mt=($e+w($e)-Qe)/(1+l($e));return Qe=P(2+T),[je*(1+l($e))/Qe,2*$e/Qe]}Ke.invert=function(je,$e){var Qe=3*z($e/(Ve*E));return[E*je/(Ve*(2*l(2*Qe/3)-1)),Qe]},We.invert=function(je,$e){var Qe=P(8/(3*T)),ut=$e/Qe;return[je/(Qe*(1-c(ut)/T)),ut]},Ye.invert=function(je,$e){var Qe=2-c($e)/P(2*T/3);return[je*P(6*T)/(2*Qe),x($e)*z((4-Qe*Qe)/3)]},nt.invert=function(je,$e){var Qe=P(T*(4+T))/2;return[je*Qe/(1+P(1-$e*$e*(4+T)/(4*T))),$e*Qe/2]},ft.invert=function(je,$e){var Qe=$e*P((4+T)/T)/2,ut=z(Qe),mt=l(ut);return[je/(2/P(T*(4+T))*(1+mt)),z((ut+Qe*(mt+2))/(2+_))]},vt.invert=function(je,$e){var Qe=P(2+T),ut=$e*Qe/2;return[Qe*je/(1+l(ut)),ut]},Pt.invert=function(je,$e){var Qe=1+_,ut=P(Qe/2);return[2*je*ut/(1+l($e*=ut)),z(($e+w($e))/Qe)]};var At=3+2*S;function at(je,$e){var Qe=w(je/=2),ut=l(je),mt=P(l($e)),pt=l($e/=2),Ct=w($e)/(pt+S*ut*mt),Qt=P(2/(1+Ct*Ct)),en=P((S*pt+(ut+Qe)*mt)/(S*pt+(ut-Qe)*mt));return[At*(Qt*(en-1/en)-2*m(en)),At*(Qt*Ct*(en+1/en)-2*i(Ct))]}at.invert=function(je,$e){if(!(Qe=te.invert(je/1.2,1.065*$e)))return null;var Qe,ut=Qe[0],mt=Qe[1],pt=20;je/=At,$e/=At;do{var Ct=ut/2,Qt=mt/2,en=w(Ct),Yt=l(Ct),an=w(Qt),hn=l(Qt),xn=l(mt),_n=P(xn),Pn=an/(hn+S*Yt*_n),sr=Pn*Pn,mr=P(2/(1+sr)),zr=(S*hn+(Yt+en)*_n)/(S*hn+(Yt-en)*_n),Br=P(zr),Jr=Br-1/Br,jr=Br+1/Br,Oi=mr*Jr-2*m(Br)-je,Ui=mr*Pn*jr-2*i(Pn)-$e,ua=an&&A*_n*en*sr/an,sa=(S*Yt*hn+_n)/(2*(hn+S*Yt*_n)*(hn+S*Yt*_n)*_n),ca=-.5*Pn*mr*mr*mr,lo=ca*ua,io=ca*sa,za=(za=2*hn+S*_n*(Yt-en))*za*Br,Ra=(S*Yt*hn*_n+xn)/za,ao=-S*en*an/(_n*za),Lo=Jr*lo-2*Ra/Br+mr*(Ra+Ra/zr),Ko=Jr*io-2*ao/Br+mr*(ao+ao/zr),Qo=Pn*jr*lo-2*ua/(1+sr)+mr*jr*ua+mr*Pn*(Ra-Ra/zr),es=Pn*jr*io-2*sa/(1+sr)+mr*jr*sa+mr*Pn*(ao-ao/zr),ts=Ko*Qo-es*Lo;if(!ts)break;var na=(Ui*Ko-Oi*es)/ts,ht=(Oi*Qo-Ui*Lo)/ts;ut-=na,mt=g(-_,p(_,mt-ht))}while((c(na)>b||c(ht)>b)&&--pt>0);return c(c(mt)-_)ut){var hn=P(an),xn=s(Yt,en),_n=Qe*y(xn/Qe),Pn=xn-_n,sr=je*l(Pn),mr=(je*w(Pn)-Pn*w(sr))/(_-sr),zr=dt(Pn,mr),Br=(T-je)/Pe(zr,sr,T);en=hn;var Jr,jr=50;do en-=Jr=(je+Pe(zr,sr,en)*Br-hn)/(zr(en)*Br);while(c(Jr)>b&&--jr>0);Yt=Pn*w(en),en<_&&(Yt-=mr*(en-_));var Oi=w(_n),Ui=l(_n);Qt[0]=en*Ui-Yt*Oi,Qt[1]=en*Oi+Yt*Ui}return Qt}return mt.invert=function(pt,Ct){var Qt=pt*pt+Ct*Ct;if(Qt>ut){var en=P(Qt),Yt=s(Ct,pt),an=Qe*y(Yt/Qe),hn=Yt-an;pt=en*l(hn),Ct=en*w(hn);for(var xn=pt-_,_n=w(pt),Pn=Ct/_n,sr=pt<_?1/0:0,mr=10;;){var zr=je*w(Pn),Br=je*l(Pn),Jr=w(Br),jr=_-Br,Oi=(zr-Pn*Jr)/jr,Ui=dt(Pn,Oi);if(c(sr)<1e-12||!--mr)break;Pn-=sr=(Pn*_n-Oi*xn-Ct)/(_n-2*xn*(jr*(Br+Pn*zr*l(Br)-Jr)-zr*(zr-Pn*Jr))/(jr*jr))}pt=(en=je+Pe(Ui,Br,pt)*(T-je)/Pe(Ui,Br,T))*l(Yt=an+Pn),Ct=en*w(Yt)}return a.geoAzimuthalEquidistantRaw.invert(pt,Ct)},mt}function dt(je,$e){return function(Qe){var ut=je*l(Qe);return Qe<_&&(ut-=$e),P(1+ut*ut)}}function Pe(je,$e,Qe){for(var ut=(Qe-$e)/50,mt=je($e)+je(Qe),pt=1,Ct=$e;pt<50;++pt)mt+=2*je(Ct+=ut);return .5*mt*ut}function Ie(je,$e,Qe,ut,mt,pt,Ct,Qt){function en(Yt,an){if(!an)return[je*Yt/T,0];var hn=an*an,xn=je+hn*($e+hn*(Qe+hn*ut)),_n=an*(mt-1+hn*(pt-Qt+hn*Ct)),Pn=(xn*xn+_n*_n)/(2*_n),sr=Yt*z(xn/Pn)/T;return[Pn*w(sr),an*(1+hn*Qt)+Pn*(1-l(sr))]}return arguments.length<8&&(Qt=0),en.invert=function(Yt,an){var hn,xn,_n=T*Yt/je,Pn=an,sr=50;do{var mr=Pn*Pn,zr=je+mr*($e+mr*(Qe+mr*ut)),Br=Pn*(mt-1+mr*(pt-Qt+mr*Ct)),Jr=zr*zr+Br*Br,jr=2*Br,Oi=Jr/jr,Ui=Oi*Oi,ua=z(zr/Oi)/T,sa=_n*ua,ca=zr*zr,lo=(2*$e+mr*(4*Qe+6*mr*ut))*Pn,io=mt+mr*(3*pt+5*mr*Ct),za=(2*(zr*lo+Br*(io-1))*jr-Jr*(2*(io-1)))/(jr*jr),Ra=l(sa),ao=w(sa),Lo=Oi*Ra,Ko=Oi*ao,Qo=_n/T*(1/P(1-ca/Ui))*(lo*Oi-zr*za)/Ui,es=Ko-Yt,ts=Pn*(1+mr*Qt)+Oi-Lo-an,na=za*ao+Lo*Qo,ht=Lo*ua,Ft=1+za-(za*Ra-Ko*Qo),ln=Ko*ua,$t=na*ln-Ft*ht;if(!$t)break;_n-=hn=(ts*na-es*Ft)/$t,Pn-=xn=(es*ln-ts*ht)/$t}while((c(hn)>b||c(xn)>b)&&--sr>0);return[_n,Pn]},en}Ot.invert=function(je,$e){var Qe=$e/(1+et);return[je&&je/(et*P(1-Qe*Qe)),2*i(Qe)]},Wt.invert=function(je,$e){var Qe=i($e/E),ut=l(Qe),mt=2*Qe;return[je*E/2/(l(mt)*ut*ut),mt]};var Ae=Ie(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),De=Ie(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),He=Ie(5/6*T,-.62636,-.0344,0,1.3493,-.05524,0,.045);function rt(je,$e){var Qe=je*je,ut=$e*$e;return[je*(1-.162388*ut)*(.87-952426e-9*Qe*Qe),$e*(1+ut/12)]}rt.invert=function(je,$e){var Qe,ut=je,mt=$e,pt=50;do{var Ct=mt*mt;mt-=Qe=(mt*(1+Ct/12)-$e)/(1+Ct/4)}while(c(Qe)>b&&--pt>0);pt=50,je/=1-.162388*Ct;do{var Qt=(Qt=ut*ut)*Qt;ut-=Qe=(ut*(.87-952426e-9*Qt)-je)/(.87-.00476213*Qt)}while(c(Qe)>b&&--pt>0);return[ut,mt]};var lt=Ie(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function ot(je){var $e=je(_,0)[0]-je(-_,0)[0];function Qe(ut,mt){var pt=ut>0?-.5:.5,Ct=je(ut+pt*T,mt);return Ct[0]-=pt*$e,Ct}return je.invert&&(Qe.invert=function(ut,mt){var pt=ut>0?-.5:.5,Ct=je.invert(ut+pt*$e,mt),Qt=Ct[0]-pt*T;return Qt<-T?Qt+=2*T:Qt>T&&(Qt-=2*T),Ct[0]=Qt,Ct}),Qe}function kt(je,$e){var Qe=x(je),ut=x($e),mt=l($e),pt=l(je)*mt,Ct=w(je)*mt,Qt=w(ut*$e);je=c(s(Ct,Qt)),$e=z(pt),c(je-_)>b&&(je%=_);var en=function(Yt,an){if(an===_)return[0,0];var hn,xn,_n=w(an),Pn=_n*_n,sr=Pn*Pn,mr=1+sr,zr=1+3*sr,Br=1-sr,Jr=z(1/P(mr)),jr=Br+Pn*mr*Jr,Oi=(1-_n)/jr,Ui=P(Oi),ua=Oi*mr,sa=P(ua),ca=Ui*Br;if(Yt===0)return[0,-(ca+Pn*sa)];var lo,io=l(an),za=1/io,Ra=2*_n*io,ao=(-jr*io-(-3*Pn+Jr*zr)*Ra*(1-_n))/(jr*jr),Lo=-za*Ra,Ko=-za*(Pn*mr*ao+Oi*zr*Ra),Qo=-2*za*(Br*(.5*ao/Ui)-2*Pn*Ui*Ra),es=4*Yt/T;if(Yt>.222*T||an.175*T){if(hn=(ca+Pn*P(ua*(1+sr)-ca*ca))/(1+sr),Yt>T/4)return[hn,hn];var ts=hn,na=.5*hn;hn=.5*(na+ts),xn=50;do{var ht=P(ua-hn*hn),Ft=hn*(Qo+Lo*ht)+Ko*z(hn/sa)-es;if(!Ft)break;Ft<0?na=hn:ts=hn,hn=.5*(na+ts)}while(c(ts-na)>b&&--xn>0)}else{hn=b,xn=25;do{var ln=hn*hn,$t=P(ua-ln),un=Qo+Lo*$t,On=hn*un+Ko*z(hn/sa)-es,Fn=un+(Ko-Lo*ln)/$t;hn-=lo=$t?On/Fn:0}while(c(lo)>b&&--xn>0)}return[hn,-ca-Pn*P(ua-hn*hn)]}(je>T/4?_-je:je,$e);return je>T/4&&(Qt=en[0],en[0]=-en[1],en[1]=-Qt),en[0]*=Qe,en[1]*=-ut,en}function wt(je,$e){var Qe,ut,mt,pt,Ct,Qt;if($e=1-b)return Qe=(1-$e)/4,mt=1/(ut=B(je)),[(pt=((Qt=d(2*(Qt=je)))-1)/(Qt+1))+Qe*((Ct=ut*N(je))-je)/(ut*ut),mt-Qe*pt*mt*(Ct-je),mt+Qe*pt*mt*(Ct+je),2*i(d(je))-_+Qe*(Ct-je)/ut];var en=[1,0,0,0,0,0,0,0,0],Yt=[P($e),0,0,0,0,0,0,0,0],an=0;for(ut=P(1-$e),Ct=1;c(Yt[an]/en[an])>b&&an<8;)Qe=en[an++],Yt[an]=(Qe-ut)/2,en[an]=(Qe+ut)/2,ut=P(Qe*ut),Ct*=2;mt=Ct*en[an]*je;do mt=(z(pt=Yt[an]*w(ut=mt)/en[an])+mt)/2;while(--an);return[w(mt),pt=l(mt),pt/l(mt-ut),mt]}function Vt(je,$e){if(!$e)return je;if($e===1)return m(k(je/2+M));for(var Qe=1,ut=P(1-$e),mt=P($e),pt=0;c(mt)>b;pt++){if(je%T){var Ct=i(ut*k(je)/Qe);Ct<0&&(Ct+=T),je+=Ct+~~(je/T)*T}else je+=je;mt=(Qe+ut)/2,ut=P(Qe*ut),mt=((Qe=mt)-ut)/2}return je/(v(2,pt)*Qe)}function Ut(je,$e){var Qe=(S-1)/(S+1),ut=P(1-Qe*Qe),mt=Vt(_,ut*ut),pt=m(k(T/4+c($e)/2)),Ct=d(-1*pt)/P(Qe),Qt=function(Yt,an){var hn=Yt*Yt,xn=an+1,_n=1-hn-an*an;return[.5*((Yt>=0?_:-_)-s(_n,2*Yt)),-.25*m(_n*_n+4*hn)+.5*m(xn*xn+hn)]}(Ct*l(-1*je),Ct*w(-1*je)),en=function(Yt,an,hn){var xn=c(Yt),_n=N(c(an));if(xn){var Pn=1/w(xn),sr=1/(k(xn)*k(xn)),mr=-(sr+hn*(_n*_n*Pn*Pn)-1+hn),zr=(-mr+P(mr*mr-4*((hn-1)*sr)))/2;return[Vt(i(1/P(zr)),hn)*x(Yt),Vt(i(P((zr/sr-1)/hn)),1-hn)*x(an)]}return[0,Vt(i(_n),1-hn)*x(an)]}(Qt[0],Qt[1],ut*ut);return[-en[1],($e>=0?1:-1)*(.5*mt-en[0])]}function tt(je){var $e=w(je),Qe=l(je),ut=bt(je);function mt(pt,Ct){var Qt=ut(pt,Ct);pt=Qt[0],Ct=Qt[1];var en=w(Ct),Yt=l(Ct),an=l(pt),hn=L($e*en+Qe*Yt*an),xn=w(hn),_n=c(xn)>b?hn/xn:1;return[_n*Qe*w(pt),(c(pt)>_?_n:-_n)*($e*Yt-Qe*en*an)]}return ut.invert=bt(-je),mt.invert=function(pt,Ct){var Qt=P(pt*pt+Ct*Ct),en=-w(Qt),Yt=l(Qt),an=Qt*Yt,hn=-Ct*en,xn=Qt*$e,_n=P(an*an+hn*hn-xn*xn),Pn=s(an*xn+hn*_n,hn*xn-an*_n),sr=(Qt>_?-1:1)*s(pt*en,Qt*l(Pn)*Yt+Ct*w(Pn)*en);return ut.invert(sr,Pn)},mt}function bt(je){var $e=w(je),Qe=l(je);return function(ut,mt){var pt=l(mt),Ct=l(ut)*pt,Qt=w(ut)*pt,en=w(mt);return[s(Qt,Ct*Qe-en*$e),z(en*Qe+Ct*$e)]}}kt.invert=function(je,$e){c(je)>1&&(je=2*x(je)-je),c($e)>1&&($e=2*x($e)-$e);var Qe=x(je),ut=x($e),mt=-Qe*je,pt=-ut*$e,Ct=pt/mt<1,Qt=function(hn,xn){for(var _n=0,Pn=1,sr=.5,mr=50;;){var zr=sr*sr,Br=P(sr),Jr=z(1/P(1+zr)),jr=1-zr+sr*(1+zr)*Jr,Oi=(1-Br)/jr,Ui=P(Oi),ua=Oi*(1+zr),sa=Ui*(1-zr),ca=P(ua-hn*hn),lo=xn+sa+sr*ca;if(c(Pn-_n)<1e-12||--mr==0||lo===0)break;lo>0?_n=sr:Pn=sr,sr=.5*(_n+Pn)}if(!mr)return null;var io=z(Br),za=l(io),Ra=1/za,ao=2*Br*za,Lo=(-jr*za-(-3*sr+Jr*(1+3*zr))*ao*(1-Br))/(jr*jr);return[T/4*(hn*(-2*Ra*(.5*Lo/Ui*(1-zr)-2*sr*Ui*ao)+-Ra*ao*ca)+-Ra*(sr*(1+zr)*Lo+Oi*(1+3*zr)*ao)*z(hn/P(ua))),io]}(Ct?pt:mt,Ct?mt:pt),en=Qt[0],Yt=Qt[1],an=l(Yt);return Ct&&(en=-_-en),[Qe*(s(w(en)*an,-w(Yt))+T),ut*z(l(en)*an)]},Ut.invert=function(je,$e){var Qe,ut,mt,pt,Ct,Qt,en=(S-1)/(S+1),Yt=P(1-en*en),an=Vt(_,Yt*Yt),hn=(ut=-je,mt=Yt*Yt,(Qe=.5*an-$e)?(pt=wt(Qe,mt),ut?(Qt=(Ct=wt(ut,1-mt))[1]*Ct[1]+mt*pt[0]*pt[0]*Ct[0]*Ct[0],[[pt[0]*Ct[2]/Qt,pt[1]*pt[2]*Ct[0]*Ct[1]/Qt],[pt[1]*Ct[1]/Qt,-pt[0]*pt[2]*Ct[0]*Ct[2]/Qt],[pt[2]*Ct[1]*Ct[2]/Qt,-mt*pt[0]*pt[1]*Ct[0]/Qt]]):[[pt[0],0],[pt[1],0],[pt[2],0]]):[[0,(Ct=wt(ut,1-mt))[0]/Ct[1]],[1/Ct[1],0],[Ct[2]/Ct[1],0]]),xn=function(_n,Pn){var sr=Pn[0]*Pn[0]+Pn[1]*Pn[1];return[(_n[0]*Pn[0]+_n[1]*Pn[1])/sr,(_n[1]*Pn[0]-_n[0]*Pn[1])/sr]}(hn[0],hn[1]);return[s(xn[1],xn[0])/-1,2*i(d(-.5*m(en*xn[0]*xn[0]+en*xn[1]*xn[1])))-_]};var zt=z(1-1/3)*O,St=Re(0);function Dt(je){var $e=zt*R,Qe=ze(T,$e)[0]-ze(-T,$e)[0],ut=St(0,$e)[1],mt=ze(0,$e)[1],pt=E-mt,Ct=D/je,Qt=4/D,en=ut+pt*pt*4/D;function Yt(an,hn){var xn,_n=c(hn);if(_n>$e){var Pn=p(je-1,g(0,h((an+T)/Ct)));(xn=ze(an+=T*(je-1)/je-Pn*Ct,_n))[0]=xn[0]*D/Qe-D*(je-1)/(2*je)+Pn*D/je,xn[1]=ut+4*(xn[1]-mt)*pt/D,hn<0&&(xn[1]=-xn[1])}else xn=St(an,hn);return xn[0]*=Qt,xn[1]/=en,xn}return Yt.invert=function(an,hn){an/=Qt;var xn=c(hn*=en);if(xn>ut){var _n=p(je-1,g(0,h((an+T)/Ct)));an=(an+T*(je-1)/je-_n*Ct)*Qe/D;var Pn=ze.invert(an,.25*(xn-ut)*D/pt+mt);return Pn[0]-=T*(je-1)/je-_n*Ct,hn<0&&(Pn[1]=-Pn[1]),Pn}return St.invert(an,hn)},Yt}function Le(je,$e){return[je,1&$e?90-b:zt]}function Je(je,$e){return[je,1&$e?-90+b:-zt]}function st(je){return[je[0]*(1-b),je[1]]}function Et(je){var $e,Qe=1+je,ut=z(w(1/Qe)),mt=2*P(T/($e=T+4*ut*Qe)),pt=.5*mt*(Qe+P(je*(2+je))),Ct=je*je,Qt=Qe*Qe;function en(Yt,an){var hn,xn,_n=1-w(an);if(_n&&_n<2){var Pn,sr=_-an,mr=25;do{var zr=w(sr),Br=l(sr),Jr=ut+s(zr,Qe-Br),jr=1+Qt-2*Qe*Br;sr-=Pn=(sr-Ct*ut-Qe*zr+jr*Jr-.5*_n*$e)/(2*Qe*zr*Jr)}while(c(Pn)>1e-12&&--mr>0);hn=mt*P(jr),xn=Yt*Jr/T}else hn=mt*(je+_n),xn=Yt*ut/T;return[hn*w(xn),pt-hn*l(xn)]}return en.invert=function(Yt,an){var hn=Yt*Yt+(an-=pt)*an,xn=(1+Qt-hn/(mt*mt))/(2*Qe),_n=L(xn),Pn=w(_n),sr=ut+s(Pn,Qe-xn);return[z(Yt/P(hn))*T/sr,z(1-2*(_n-Ct*ut-Qe*Pn+(1+Qt-2*Qe*xn)*sr)/$e)]},en}function It(je,$e){return $e>-.7109889596207567?((je=ae(je,$e))[1]+=.0528035274542,je):me(je,$e)}function Zt(je,$e){return c($e)>.7109889596207567?((je=ae(je,$e))[1]-=$e>0?.0528035274542:-.0528035274542,je):me(je,$e)}function Kt(je,$e,Qe,ut){var mt=P(4*T/(2*Qe+(1+je-$e/2)*w(2*Qe)+(je+$e)/2*w(4*Qe)+$e/2*w(6*Qe))),pt=P(ut*w(Qe)*P((1+je*l(2*Qe)+$e*l(4*Qe))/(1+je+$e))),Ct=Qe*en(1);function Qt(hn){return P(1+je*l(2*hn)+$e*l(4*hn))}function en(hn){var xn=hn*Qe;return(2*xn+(1+je-$e/2)*w(2*xn)+(je+$e)/2*w(4*xn)+$e/2*w(6*xn))/Qe}function Yt(hn){return Qt(hn)*w(hn)}var an=function(hn,xn){var _n=Qe*ne(en,Ct*w(xn)/Qe,xn/T);isNaN(_n)&&(_n=Qe*x(xn));var Pn=mt*Qt(_n);return[Pn*pt*hn/T*l(_n),Pn/pt*w(_n)]};return an.invert=function(hn,xn){var _n=ne(Yt,xn*pt/mt);return[hn*T/(l(_n)*mt*pt*Qt(_n)),z(Qe*en(_n/Qe)/Ct)]},Qe===0&&(mt=P(ut/T),(an=function(hn,xn){return[hn*mt,w(xn)/mt]}).invert=function(hn,xn){return[hn/mt,z(xn*mt)]}),an}function Ht(je,$e,Qe,ut,mt){ut===void 0&&(ut=1e-8),mt===void 0&&(mt=20);var pt=je($e),Ct=je(.5*($e+Qe)),Qt=je(Qe);return function en(Yt,an,hn,xn,_n,Pn,sr,mr,zr,Br,Jr){if(Jr.nanEncountered)return NaN;var jr,Oi,Ui,ua,sa,ca,lo,io,za,Ra;if(Oi=Yt(an+.25*(jr=hn-an)),Ui=Yt(hn-.25*jr),isNaN(Oi))Jr.nanEncountered=!0;else{if(!isNaN(Ui))return Ra=((ca=(ua=jr*(xn+4*Oi+_n)/12)+(sa=jr*(_n+4*Ui+Pn)/12))-sr)/15,Br>zr?(Jr.maxDepthCount++,ca+Ra):Math.abs(Ra)_n?sr=mr:Pn=mr,mr=Pn+sr>>1;while(mr>Pn);var zr=en[mr+1]-en[mr];return zr&&(zr=(_n-en[mr+1])/zr),(mr+1+zr)/Ct}var hn=2*an(1)/T*pt/Qe,xn=function(_n,Pn){var sr=an(c(w(Pn))),mr=ut(sr)*_n;return sr/=hn,[mr,Pn>=0?sr:-sr]};return xn.invert=function(_n,Pn){var sr;return c(Pn*=hn)<1&&(sr=x(Pn)*z(mt(c(Pn))*pt)),[_n/ut(c(Pn)),sr]},xn}function zn(je,$e){return c(je[0]-$e[0])=0;--Qt)Qe=($e=je[1][Qt])[0][0],ut=$e[0][1],mt=$e[1][1],pt=$e[2][0],Ct=$e[2][1],en.push(pn([[pt-b,Ct-b],[pt-b,mt+b],[Qe+b,mt+b],[Qe+b,ut-b]],30));return{type:"Polygon",coordinates:[u.merge(en)]}}function nn(je,$e,Qe){var ut,mt;function pt(en,Yt){for(var an=Yt<0?-1:1,hn=$e[+(Yt<0)],xn=0,_n=hn.length-1;xn<_n&&en>hn[xn][2][0];++xn);var Pn=je(en-hn[xn][1][0],Yt);return Pn[0]+=je(hn[xn][1][0],an*Yt>an*hn[xn][0][1]?hn[xn][0][1]:Yt)[0],Pn}Qe?pt.invert=Qe(pt):je.invert&&(pt.invert=function(en,Yt){for(var an=mt[+(Yt<0)],hn=$e[+(Yt<0)],xn=0,_n=an.length;xn<_n;++xn){var Pn=an[xn];if(Pn[0][0]<=en&&ensr&&(hn=Pn,Pn=sr,sr=hn),[[xn,Pn],[_n,sr]]})}),Ct):$e.map(function(Yt){return Yt.map(function(an){return[[an[0][0]*O,an[0][1]*O],[an[1][0]*O,an[1][1]*O],[an[2][0]*O,an[2][1]*O]]})})},$e!=null&&Ct.lobes($e),Ct}It.invert=function(je,$e){return $e>-.7109889596207567?ae.invert(je,$e-.0528035274542):me.invert(je,$e)},Zt.invert=function(je,$e){return c($e)>.7109889596207567?ae.invert(je,$e+($e>0?.0528035274542:-.0528035274542)):me.invert(je,$e)};var sn=[[[[-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]]]],gn=[[[[-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]]]],bn=[[[[-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]]]],In=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],Hn=[[[[-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]]]],Wn=[[[[-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 ar(je,$e){return[3/D*je*P(T*T/3-$e*$e),$e]}function Or(je){function $e(Qe,ut){if(c(c(ut)-_)2)return null;var pt=(Qe/=2)*Qe,Ct=(ut/=2)*ut,Qt=2*ut/(1+pt+Ct);return Qt=v((1+Qt)/(1-Qt),1/je),[s(2*Qe,1-pt-Ct)/je,z((Qt-1)/(Qt+1))]},$e}ar.invert=function(je,$e){return[D/3*je/P(T*T/3-$e*$e),$e]};var vr=T/S;function Er(je,$e){return[je*(1+P(l($e)))/2,$e/(l($e/2)*l(je/6))]}function Kn(je,$e){var Qe=je*je,ut=$e*$e;return[je*(.975534+ut*(-.0143059*Qe-.119161+-.0547009*ut)),$e*(1.00384+Qe*(.0802894+-.02855*ut+199025e-9*Qe)+ut*(.0998909+-.0491032*ut))]}function Ln(je,$e){return[w(je)/l($e),k($e)*l(je)]}function lr(je){var $e=l(je),Qe=k(M+je/2);function ut(mt,pt){var Ct=pt-je,Qt=c(Ct)=0;)xn=(hn=je[an])[0]+en*(pt=xn)-Yt*_n,_n=hn[1]+en*_n+Yt*pt;return[xn=en*(pt=xn)-Yt*_n,_n=en*_n+Yt*pt]}return Qe.invert=function(ut,mt){var pt=20,Ct=ut,Qt=mt;do{for(var en,Yt=$e,an=je[Yt],hn=an[0],xn=an[1],_n=0,Pn=0;--Yt>=0;)_n=hn+Ct*(en=_n)-Qt*Pn,Pn=xn+Ct*Pn+Qt*en,hn=(an=je[Yt])[0]+Ct*(en=hn)-Qt*xn,xn=an[1]+Ct*xn+Qt*en;var sr,mr,zr=(_n=hn+Ct*(en=_n)-Qt*Pn)*_n+(Pn=xn+Ct*Pn+Qt*en)*Pn;Ct-=sr=((hn=Ct*(en=hn)-Qt*xn-ut)*_n+(xn=Ct*xn+Qt*en-mt)*Pn)/zr,Qt-=mr=(xn*_n-hn*Pn)/zr}while(c(sr)+c(mr)>1e-12&&--pt>0);if(pt){var Br=P(Ct*Ct+Qt*Qt),Jr=2*i(.5*Br),jr=w(Jr);return[s(Ct*jr,Br*l(Jr)),Br?z(Qt*jr/Br):0]}},Qe}Er.invert=function(je,$e){var Qe=c(je),ut=c($e),mt=b,pt=_;utb||c(mr)>b)&&--mt>0);return mt&&[Qe,ut]},Ln.invert=function(je,$e){var Qe=je*je,ut=$e*$e+1,mt=Qe+ut,pt=je?A*P((mt-P(mt*mt-4*Qe))/Qe):1/P(ut);return[z(je*pt),x($e)*L(pt)]},Wr.invert=function(je,$e){return[je,2.5*i(d(.8*$e))-.625*T]};var rr=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],nr=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Bn=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Fr=[[.9245,0],[0,0],[.01943,0]],$r=[[.721316,0],[0,0],[-.00881625,-.00617325]];function pr(je,$e){var Qe=a.geoProjection(Mn(je)).rotate($e).clipAngle(90),ut=a.geoRotation($e),mt=Qe.center;return delete Qe.rotate,Qe.center=function(pt){return arguments.length?mt(ut(pt)):ut.invert(mt())},Qe}var qr=P(6),_i=P(7);function cn(je,$e){var Qe=z(7*w($e)/(3*qr));return[qr*je*(2*l(2*Qe/3)-1)/_i,9*w(Qe/3)/_i]}function jn(je,$e){for(var Qe,ut=(1+A)*w($e),mt=$e,pt=0;pt<25&&(mt-=Qe=(w(mt/2)+w(mt)-ut)/(.5*l(mt/2)+l(mt)),!(c(Qe)1e-12&&--Qt>0);return[je/(.84719-.13063*(ut=Ct*Ct)+(pt=ut*(mt=ut*ut))*pt*(.05494*ut-.04515-.02326*mt+.00331*pt)),Ct]},yn.invert=function(je,$e){for(var Qe=$e/2,ut=0,mt=1/0;ut<10&&c(mt)>b;++ut){var pt=l($e/2);$e-=mt=($e-k($e/2)-Qe)/(1-.5/(pt*pt))}return[2*je/(1+l($e)),$e]};var $n=[[[[-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(je,$e){var Qe=w($e),ut=l($e),mt=x(je);if(je===0||c($e)===_)return[0,$e];if($e===0)return[je,0];if(c(je)===_)return[je*ut,_*Qe];var pt=T/(2*je)-2*je/T,Ct=2*$e/T,Qt=(1-Ct*Ct)/(Qe-Ct),en=pt*pt,Yt=Qt*Qt,an=1+en/Yt,hn=1+Yt/en,xn=(pt*Qe/Qt-pt/2)/an,_n=(Yt*Qe/en+Qt/2)/hn,Pn=_n*_n-(Yt*Qe*Qe/en+Qt*Qe-1)/hn;return[_*(xn+P(xn*xn+ut*ut/an)*mt),_*(_n+P(Pn<0?0:Pn)*x(-$e*pt)*mt)]}Un.invert=function(je,$e){var Qe=(je/=_)*je,ut=Qe+($e/=_)*$e,mt=T*T;return[je?(ut-1+P((1-ut)*(1-ut)+4*Qe))/(2*je)*_:0,ne(function(pt){return ut*(T*w(pt)-2*pt)*T+4*pt*pt*($e-w(pt))+2*T*pt-mt*$e},0)]};function Nn(je,$e){var Qe=$e*$e;return[je,$e*(1.0148+Qe*Qe*(.23185+Qe*(.02406*Qe-.14499)))]}function Rn(je,$e){if(c($e)=0;)if(zr=sr[Oi],mr[0]===zr[0]&&mr[1]===zr[1]){if(Jr)return[Jr,mr];Jr=mr}}}(Qt.face,en.face),an=wn(Yt.map(en.project),Yt.map(Qt.project));Qt.transform=en.transform?kn(en.transform,an):an;for(var hn=en.edges,xn=0,_n=hn.length;xn<_n;++xn)Yn(Yt[0],hn[xn][1])&&Yn(Yt[1],hn[xn][0])&&(hn[xn]=Qt),Yn(Yt[0],hn[xn][0])&&Yn(Yt[1],hn[xn][1])&&(hn[xn]=Qt);for(hn=Qt.edges,xn=0,_n=hn.length;xn<_n;++xn)Yn(Yt[0],hn[xn][0])&&Yn(Yt[1],hn[xn][1])&&(hn[xn]=en),Yn(Yt[0],hn[xn][1])&&Yn(Yt[1],hn[xn][0])&&(hn[xn]=en)}else Qt.transform=en.transform;return Qt.children&&Qt.children.forEach(function(Pn){Ct(Pn,Qt)}),Qt})(je,{transform:null}),ir(je)&&(ut.invert=function(Ct,Qt){var en=function Yt(an,hn){var xn=an.project.invert,_n=an.transform,Pn=hn;if(_n&&(_n=function(Jr){var jr=1/(Jr[0]*Jr[4]-Jr[1]*Jr[3]);return[jr*Jr[4],-jr*Jr[1],jr*(Jr[1]*Jr[5]-Jr[2]*Jr[4]),-jr*Jr[3],jr*Jr[0],jr*(Jr[2]*Jr[3]-Jr[0]*Jr[5])]}(_n),Pn=[_n[0]*Pn[0]+_n[1]*Pn[1]+_n[2],_n[3]*Pn[0]+_n[4]*Pn[1]+_n[5]]),xn&&an===function(Jr){return $e(Jr[0]*R,Jr[1]*R)}(sr=xn(Pn)))return sr;for(var sr,mr=an.children,zr=0,Br=mr&&mr.length;zr1.790857183?$e=1.790857183:$e<-1.790857183&&($e=-1.790857183);var Qe,ut=$e;do{var mt=ut*ut;ut-=Qe=(ut*(1.0148+mt*mt*(.23185+mt*(.02406*mt-.14499)))-$e)/(1.0148+mt*mt*(5*.23185+mt*(.21654*mt-1.01493)))}while(c(Qe)>b);return[je,ut]},Rn.invert=function(je,$e){if(c($e)b&&--pt>0);return Ct=k(mt),[(c($e)en^Br>en&&Qt<(zr-Pn)*(en-sr)/(Br-sr)+Pn&&(Yt=!Yt)}return Yt}(mt[0],ut))return mt.push(Qe),!0})||je.push([Qe])}),ta=[],je.length?je.length>1?{type:"MultiPolygon",coordinates:je}:{type:"Polygon",coordinates:je[0]}:null}};function ya(je){var $e=je(_,0)[0]-je(-_,0)[0];function Qe(ut,mt){var pt=c(ut)<_,Ct=je(pt?ut:ut>0?ut-T:ut+T,mt),Qt=(Ct[0]-Ct[1])*A,en=(Ct[0]+Ct[1])*A;if(pt)return[Qt,en];var Yt=$e*A,an=Qt>0^en>0?-1:1;return[an*Qt-x(en)*Yt,an*en-x(Qt)*Yt]}return je.invert&&(Qe.invert=function(ut,mt){var pt=(ut+mt)*A,Ct=(mt-ut)*A,Qt=c(pt)<.5*$e&&c(Ct)<.5*$e;if(!Qt){var en=$e*A,Yt=pt>0^Ct>0?-1:1,an=-Yt*ut+(Ct>0?1:-1)*en,hn=-Yt*mt+(pt>0?1:-1)*en;pt=(-an-hn)*A,Ct=(an-hn)*A}var xn=je.invert(pt,Ct);return Qt||(xn[0]+=pt>0?T:-T),xn}),a.geoProjection(Qe).rotate([-90,-90,45]).clipAngle(179.999)}function xa(){return ya(Ut).scale(111.48)}function Zo(je){var $e=w(je);function Qe(ut,mt){var pt=$e?k(ut*$e/2)/$e:ut/2;if(!mt)return[2*pt,-je];var Ct=2*i(pt*w(mt)),Qt=1/k(mt);return[w(Ct)*Qt,mt+(1-l(Ct))*Qt-je]}return Qe.invert=function(ut,mt){if(c(mt+=je)b&&--en>0);var xn=ut*(Yt=k(Qt)),_n=k(c(mt)0?_:-_)*(Yt+pt*(hn-Qt)/2+pt*pt*(hn-2*Yt+Qt)/2)]}function bs(je,$e){var Qe=function(Ct){function Qt(en,Yt){var an=l(Yt),hn=(Ct-1)/(Ct-an*l(en));return[hn*an*w(en),hn*w(Yt)]}return Qt.invert=function(en,Yt){var an=en*en+Yt*Yt,hn=P(an),xn=(Ct-P(1-an*(Ct+1)/(Ct-1)))/((Ct-1)/hn+hn/(Ct-1));return[s(en*xn,hn*P(1-xn*xn)),hn?z(Yt*xn/hn):0]},Qt}(je);if(!$e)return Qe;var ut=l($e),mt=w($e);function pt(Ct,Qt){var en=Qe(Ct,Qt),Yt=en[1],an=Yt*mt/(je-1)+ut;return[en[0]*ut/an,Yt/an]}return pt.invert=function(Ct,Qt){var en=(je-1)/(je-1-Qt*mt);return Qe.invert(en*Ct,en*Qt*ut)},pt}oa.forEach(function(je){je[1]*=1.0144}),hs.invert=function(je,$e){var Qe=$e/_,ut=90*Qe,mt=p(18,c(ut/5)),pt=g(0,h(mt));do{var Ct=oa[pt][1],Qt=oa[pt+1][1],en=oa[p(19,pt+2)][1],Yt=en-Ct,an=en-2*Qt+Ct,hn=2*(c(Qe)-Qt)/Yt,xn=an/Yt,_n=hn*(1-xn*hn*(1-2*xn*hn));if(_n>=0||pt===1){ut=($e>=0?5:-5)*(_n+mt);var Pn,sr=50;do _n=(mt=p(18,c(ut)/5))-(pt=h(mt)),Ct=oa[pt][1],Qt=oa[pt+1][1],en=oa[p(19,pt+2)][1],ut-=(Pn=($e>=0?_:-_)*(Qt+_n*(en-Ct)/2+_n*_n*(en-2*Qt+Ct)/2)-$e)*O;while(c(Pn)>1e-12&&--sr>0);break}}while(--pt>=0);var mr=oa[pt][0],zr=oa[pt+1][0],Br=oa[p(19,pt+2)][0];return[je/(zr+_n*(Br-mr)/2+_n*_n*(Br-2*zr+mr)/2),ut*R]};var so=-179.9999,Jo=179.9999,_s=-89.9999;function Ls(je){return je.length>0}function Oo(je){return je===-90||je===90?[0,je]:[-180,($e=je,Math.floor(1e4*$e)/1e4)];var $e}function Ka(je){var $e=je[0],Qe=je[1],ut=!1;return $e<=so?($e=-180,ut=!0):$e>=Jo&&($e=180,ut=!0),Qe<=_s?(Qe=-90,ut=!0):Qe>=89.9999&&(Qe=90,ut=!0),ut?[$e,Qe]:je}function $o(je){return je.map(Ka)}function ic(je,$e,Qe){for(var ut=0,mt=je.length;ut=Jo||an<=_s||an>=89.9999){pt[Ct]=Ka(en);for(var hn=Ct+1;hnso&&_n_s&&Pn<89.9999)break}if(hn===Ct+1)continue;if(Ct){var sr={index:-1,polygon:$e,ring:pt.slice(0,Ct+1)};sr.ring[sr.ring.length-1]=Oo(an),Qe[Qe.length-1]=sr}else Qe.pop();if(hn>=Qt)break;Qe.push({index:-1,polygon:$e,ring:pt=pt.slice(hn-1)}),pt[0]=Oo(pt[0][1]),Ct=-1,Qt=pt.length}}}}function Mc(je){var $e,Qe,ut,mt,pt,Ct,Qt=je.length,en={},Yt={};for($e=0;$e0?T-Qt:Qt)*O],Yt=a.geoProjection(je(Ct)).rotate(en),an=a.geoRotation(en),hn=Yt.center;return delete Yt.rotate,Yt.center=function(xn){return arguments.length?hn(an(xn)):an.invert(hn())},Yt.clipAngle(90)}function Ec(je){var $e=l(je);function Qe(ut,mt){var pt=a.geoGnomonicRaw(ut,mt);return pt[0]*=$e,pt}return Qe.invert=function(ut,mt){return a.geoGnomonicRaw.invert(ut/$e,mt)},Qe}function ac(je,$e){return Sc(Ec,je,$e)}function Cc(je){if(!(je*=2))return a.geoAzimuthalEquidistantRaw;var $e=-je/2,Qe=-$e,ut=je*je,mt=k(Qe),pt=.5/w(Qe);function Ct(Qt,en){var Yt=L(l(en)*l(Qt-$e)),an=L(l(en)*l(Qt-Qe));return[((Yt*=Yt)-(an*=an))/(2*je),(en<0?-1:1)*P(4*ut*an-(ut-Yt+an)*(ut-Yt+an))/(2*je)]}return Ct.invert=function(Qt,en){var Yt,an,hn=en*en,xn=l(P(hn+(Yt=Qt+$e)*Yt)),_n=l(P(hn+(Yt=Qt+Qe)*Yt));return[s(an=xn-_n,Yt=(xn+_n)*mt),(en<0?-1:1)*L(P(Yt*Yt+an*an)*pt)]},Ct}function Ns(je,$e){return Sc(Cc,je,$e)}function Bs(je,$e){if(c($e)b&&--Qt>0);return[x(je)*(P(mt*mt+4)+mt)*T/4,_*Ct]};var Uu=4*T+3*P(3),ds=2*P(2*T*P(3)/Uu),pl=ie(ds*P(3)/T,ds,Uu/6);function Vu(je,$e){return[je*P(1-3*$e*$e/(T*T)),$e]}function js(je,$e){var Qe=l($e),ut=l(je)*Qe,mt=1-ut,pt=l(je=s(w(je)*Qe,-w($e))),Ct=w(je);return[Ct*(Qe=P(1-ut*ut))-pt*mt,-pt*Qe-Ct*mt]}function ma(je,$e){var Qe=W(je,$e);return[(Qe[0]+je/_)/2,(Qe[1]+$e)/2]}Vu.invert=function(je,$e){return[je/P(1-3*$e*$e/(T*T)),$e]},js.invert=function(je,$e){var Qe=(je*je+$e*$e)/-2,ut=P(-Qe*(2+Qe)),mt=$e*Qe+je*ut,pt=je*Qe-$e*ut,Ct=P(pt*pt+mt*mt);return[s(ut*mt,Ct*(1+Qe)),Ct?-z(ut*pt/Ct):0]},ma.invert=function(je,$e){var Qe=je,ut=$e,mt=25;do{var pt,Ct=l(ut),Qt=w(ut),en=w(2*ut),Yt=Qt*Qt,an=Ct*Ct,hn=w(Qe),xn=l(Qe/2),_n=w(Qe/2),Pn=_n*_n,sr=1-an*xn*xn,mr=sr?L(Ct*xn)*P(pt=1/sr):pt=0,zr=.5*(2*mr*Ct*_n+Qe/_)-je,Br=.5*(mr*Qt+ut)-$e,Jr=.5*pt*(an*Pn+mr*Ct*xn*Yt)+.5/_,jr=pt*(hn*en/4-mr*Qt*_n),Oi=.125*pt*(en*_n-mr*Qt*an*hn),Ui=.5*pt*(Yt*xn+mr*Pn*Ct)+.5,ua=jr*Oi-Ui*Jr,sa=(Br*jr-zr*Ui)/ua,ca=(zr*Oi-Br*Jr)/ua;Qe-=sa,ut-=ca}while((c(sa)>b||c(ca)>b)&&--mt>0);return[Qe,ut]},r.geoNaturalEarth=a.geoNaturalEarth1,r.geoNaturalEarthRaw=a.geoNaturalEarth1Raw,r.geoAiry=function(){var je=_,$e=a.geoProjectionMutator(G),Qe=$e(je);return Qe.radius=function(ut){return arguments.length?$e(je=ut*R):je*O},Qe.scale(179.976).clipAngle(147)},r.geoAiryRaw=G,r.geoAitoff=function(){return a.geoProjection(W).scale(152.63)},r.geoAitoffRaw=W,r.geoArmadillo=function(){var je=20*R,$e=je>=0?1:-1,Qe=k($e*je),ut=a.geoProjectionMutator(K),mt=ut(je),pt=mt.stream;return mt.parallel=function(Ct){return arguments.length?(Qe=k(($e=(je=Ct*R)>=0?1:-1)*je),ut(je)):je*O},mt.stream=function(Ct){var Qt=mt.rotate(),en=pt(Ct),Yt=(mt.rotate([0,0]),pt(Ct)),an=mt.precision();return mt.rotate(Qt),en.sphere=function(){Yt.polygonStart(),Yt.lineStart();for(var hn=-180*$e;$e*hn<180;hn+=90*$e)Yt.point(hn,90*$e);if(je)for(;$e*(hn-=3*$e*an)>=-180;)Yt.point(hn,$e*-s(l(hn*R/2),Qe)*O);Yt.lineEnd(),Yt.polygonEnd()},en},mt.scale(218.695).center([0,28.0974])},r.geoArmadilloRaw=K,r.geoAugust=function(){return a.geoProjection(te).scale(66.1603)},r.geoAugustRaw=te,r.geoBaker=function(){return a.geoProjection(re).scale(112.314)},r.geoBakerRaw=re,r.geoBerghaus=function(){var je=5,$e=a.geoProjectionMutator(U),Qe=$e(je),ut=Qe.stream,mt=-l(.01*R),pt=w(.01*R);return Qe.lobes=function(Ct){return arguments.length?$e(je=+Ct):je},Qe.stream=function(Ct){var Qt=Qe.rotate(),en=ut(Ct),Yt=(Qe.rotate([0,0]),ut(Ct));return Qe.rotate(Qt),en.sphere=function(){Yt.polygonStart(),Yt.lineStart();for(var an=0,hn=360/je,xn=2*T/je,_n=90-180/je,Pn=_;an=0;)Ct.point((Qt=en[an])[0],Qt[1]);Ct.lineEnd(),Ct.polygonEnd()},Ct},Qe.scale(79.4187).parallel(45).clipAngle(179.999)},r.geoHammerRetroazimuthalRaw=tt,r.geoHealpix=function(){var je=4,$e=a.geoProjectionMutator(Dt),Qe=$e(je),ut=Qe.stream;return Qe.lobes=function(mt){return arguments.length?$e(je=+mt):je},Qe.stream=function(mt){var pt=Qe.rotate(),Ct=ut(mt),Qt=(Qe.rotate([0,0]),ut(mt));return Qe.rotate(pt),Ct.sphere=function(){var en,Yt;a.geoStream((en=180/je,Yt=[].concat(u.range(-180,180+en/2,en).map(Le),u.range(180,-180-en/2,-en).map(Je)),{type:"Polygon",coordinates:[en===180?Yt.map(st):Yt]}),Qt)},Ct},Qe.scale(239.75)},r.geoHealpixRaw=Dt,r.geoHill=function(){var je=1,$e=a.geoProjectionMutator(Et),Qe=$e(je);return Qe.ratio=function(ut){return arguments.length?$e(je=+ut):je},Qe.scale(167.774).center([0,18.67])},r.geoHillRaw=Et,r.geoHomolosine=function(){return a.geoProjection(Zt).scale(152.63)},r.geoHomolosineRaw=Zt,r.geoHufnagel=function(){var je=1,$e=0,Qe=45*R,ut=2,mt=a.geoProjectionMutator(Kt),pt=mt(je,$e,Qe,ut);return pt.a=function(Ct){return arguments.length?mt(je=+Ct,$e,Qe,ut):je},pt.b=function(Ct){return arguments.length?mt(je,$e=+Ct,Qe,ut):$e},pt.psiMax=function(Ct){return arguments.length?mt(je,$e,Qe=+Ct*R,ut):Qe*O},pt.ratio=function(Ct){return arguments.length?mt(je,$e,Qe,ut=+Ct):ut},pt.scale(180.739)},r.geoHufnagelRaw=Kt,r.geoHyperelliptical=function(){var je=0,$e=2.5,Qe=1.183136,ut=a.geoProjectionMutator(mn),mt=ut(je,$e,Qe);return mt.alpha=function(pt){return arguments.length?ut(je=+pt,$e,Qe):je},mt.k=function(pt){return arguments.length?ut(je,$e=+pt,Qe):$e},mt.gamma=function(pt){return arguments.length?ut(je,$e,Qe=+pt):Qe},mt.scale(152.63)},r.geoHyperellipticalRaw=mn,r.geoInterrupt=nn,r.geoInterruptedBoggs=function(){return nn(ge,sn).scale(160.857)},r.geoInterruptedHomolosine=function(){return nn(Zt,gn).scale(152.63)},r.geoInterruptedMollweide=function(){return nn(ae,bn).scale(169.529)},r.geoInterruptedMollweideHemispheres=function(){return nn(ae,In).scale(169.529).rotate([20,0])},r.geoInterruptedSinuMollweide=function(){return nn(It,Hn,H).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},r.geoInterruptedSinusoidal=function(){return nn(me,Wn).scale(152.63).rotate([-20,0])},r.geoKavrayskiy7=function(){return a.geoProjection(ar).scale(158.837)},r.geoKavrayskiy7Raw=ar,r.geoLagrange=function(){var je=.5,$e=a.geoProjectionMutator(Or),Qe=$e(je);return Qe.spacing=function(ut){return arguments.length?$e(je=+ut):je},Qe.scale(124.75)},r.geoLagrangeRaw=Or,r.geoLarrivee=function(){return a.geoProjection(Er).scale(97.2672)},r.geoLarriveeRaw=Er,r.geoLaskowski=function(){return a.geoProjection(Kn).scale(139.98)},r.geoLaskowskiRaw=Kn,r.geoLittrow=function(){return a.geoProjection(Ln).scale(144.049).clipAngle(89.999)},r.geoLittrowRaw=Ln,r.geoLoximuthal=function(){return fe(lr).parallel(40).scale(158.837)},r.geoLoximuthalRaw=lr,r.geoMiller=function(){return a.geoProjection(Wr).scale(108.318)},r.geoMillerRaw=Wr,r.geoModifiedStereographic=pr,r.geoModifiedStereographicRaw=Mn,r.geoModifiedStereographicAlaska=function(){return pr(rr,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},r.geoModifiedStereographicGs48=function(){return pr(nr,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},r.geoModifiedStereographicGs50=function(){return pr(Bn,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},r.geoModifiedStereographicMiller=function(){return pr(Fr,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},r.geoModifiedStereographicLee=function(){return pr($r,[165,10]).scale(250).clipAngle(130).center([-165,-10])},r.geoMollweide=function(){return a.geoProjection(ae).scale(169.529)},r.geoMollweideRaw=ae,r.geoMtFlatPolarParabolic=function(){return a.geoProjection(cn).scale(164.859)},r.geoMtFlatPolarParabolicRaw=cn,r.geoMtFlatPolarQuartic=function(){return a.geoProjection(jn).scale(188.209)},r.geoMtFlatPolarQuarticRaw=jn,r.geoMtFlatPolarSinusoidal=function(){return a.geoProjection(jt).scale(166.518)},r.geoMtFlatPolarSinusoidalRaw=jt,r.geoNaturalEarth2=function(){return a.geoProjection(fn).scale(175.295)},r.geoNaturalEarth2Raw=fn,r.geoNellHammer=function(){return a.geoProjection(yn).scale(152.63)},r.geoNellHammerRaw=yn,r.geoInterruptedQuarticAuthalic=function(){return nn(q(1/0),$n).rotate([20,0]).scale(152.63)},r.geoNicolosi=function(){return a.geoProjection(Un).scale(127.267)},r.geoNicolosiRaw=Un,r.geoPatterson=function(){return a.geoProjection(Nn).scale(139.319)},r.geoPattersonRaw=Nn,r.geoPolyconic=function(){return a.geoProjection(Rn).scale(103.74)},r.geoPolyconicRaw=Rn,r.geoPolyhedral=Zn,r.geoPolyhedralButterfly=function(je){je=je||function(Qe){var ut=a.geoCentroid({type:"MultiPoint",coordinates:Qe});return a.geoGnomonic().scale(1).translate([0,0]).rotate([-ut[0],-ut[1]])};var $e=xr.map(function(Qe){return{face:Qe,project:je(Qe)}});return[-1,0,0,1,0,1,4,5].forEach(function(Qe,ut){var mt=$e[Qe];mt&&(mt.children||(mt.children=[])).push($e[ut])}),Zn($e[0],function(Qe,ut){return $e[Qe<-T/2?ut<0?6:4:Qe<0?ut<0?2:0:Qe0?[-ut[0],0]:[180-ut[0],180])};var $e=xr.map(function(Qe){return{face:Qe,project:je(Qe)}});return[-1,0,0,1,0,1,4,5].forEach(function(Qe,ut){var mt=$e[Qe];mt&&(mt.children||(mt.children=[])).push($e[ut])}),Zn($e[0],function(Qe,ut){return $e[Qe<-T/2?ut<0?6:4:Qe<0?ut<0?2:0:Qe2||_n[0]!=an[0]||_n[1]!=an[1])&&(hn.push(_n),an=_n)}return hn.length===1&&Yt.length>1&&hn.push(Qe(Yt[Yt.length-1])),hn}function pt(Yt){return Yt.map(mt)}function Ct(Yt){if(Yt==null)return Yt;var an;switch(Yt.type){case"GeometryCollection":an={type:"GeometryCollection",geometries:Yt.geometries.map(Ct)};break;case"Point":an={type:"Point",coordinates:Qe(Yt.coordinates)};break;case"MultiPoint":an={type:Yt.type,coordinates:ut(Yt.coordinates)};break;case"LineString":an={type:Yt.type,coordinates:mt(Yt.coordinates)};break;case"MultiLineString":case"Polygon":an={type:Yt.type,coordinates:pt(Yt.coordinates)};break;case"MultiPolygon":an={type:"MultiPolygon",coordinates:Yt.coordinates.map(pt)};break;default:return Yt}return Yt.bbox!=null&&(an.bbox=Yt.bbox),an}function Qt(Yt){var an={type:"Feature",properties:Yt.properties,geometry:Ct(Yt.geometry)};return Yt.id!=null&&(an.id=Yt.id),Yt.bbox!=null&&(an.bbox=Yt.bbox),an}if(je!=null)switch(je.type){case"Feature":return Qt(je);case"FeatureCollection":var en={type:"FeatureCollection",features:je.features.map(Qt)};return je.bbox!=null&&(en.bbox=je.bbox),en;default:return Ct(je)}return je},r.geoQuincuncial=ya,r.geoRectangularPolyconic=function(){return fe(Zo).scale(131.215)},r.geoRectangularPolyconicRaw=Zo,r.geoRobinson=function(){return a.geoProjection(hs).scale(152.63)},r.geoRobinsonRaw=hs,r.geoSatellite=function(){var je=2,$e=0,Qe=a.geoProjectionMutator(bs),ut=Qe(je,$e);return ut.distance=function(mt){return arguments.length?Qe(je=+mt,$e):je},ut.tilt=function(mt){return arguments.length?Qe(je,$e=mt*R):$e*O},ut.scale(432.147).clipAngle(L(1/je)*O-1e-6)},r.geoSatelliteRaw=bs,r.geoSinuMollweide=function(){return a.geoProjection(It).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},r.geoSinuMollweideRaw=It,r.geoSinusoidal=function(){return a.geoProjection(me).scale(152.63)},r.geoSinusoidalRaw=me,r.geoStitch=function(je){if(je==null)return je;switch(je.type){case"Feature":return ba(je);case"FeatureCollection":var $e={type:"FeatureCollection",features:je.features.map(ba)};return je.bbox!=null&&($e.bbox=je.bbox),$e;default:return ju(je)}},r.geoTimes=function(){return a.geoProjection(Wl).scale(146.153)},r.geoTimesRaw=Wl,r.geoTwoPointAzimuthal=ac,r.geoTwoPointAzimuthalRaw=Ec,r.geoTwoPointAzimuthalUsa=function(){return ac([-158,21.5],[-77,39]).clipAngle(60).scale(400)},r.geoTwoPointEquidistant=Ns,r.geoTwoPointEquidistantRaw=Cc,r.geoTwoPointEquidistantUsa=function(){return Ns([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},r.geoVanDerGrinten=function(){return a.geoProjection(Bs).scale(79.4183)},r.geoVanDerGrintenRaw=Bs,r.geoVanDerGrinten2=function(){return a.geoProjection(fl).scale(79.4183)},r.geoVanDerGrinten2Raw=fl,r.geoVanDerGrinten3=function(){return a.geoProjection(hl).scale(79.4183)},r.geoVanDerGrinten3Raw=hl,r.geoVanDerGrinten4=function(){return a.geoProjection(dl).scale(127.16)},r.geoVanDerGrinten4Raw=dl,r.geoWagner=ws,r.geoWagner7=function(){return ws().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},r.geoWagnerRaw=Yl,r.geoWagner4=function(){return a.geoProjection(pl).scale(176.84)},r.geoWagner4Raw=pl,r.geoWagner6=function(){return a.geoProjection(Vu).scale(152.63)},r.geoWagner6Raw=Vu,r.geoWiechel=function(){return a.geoProjection(js).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},r.geoWiechelRaw=js,r.geoWinkel3=function(){return a.geoProjection(ma).scale(158.837)},r.geoWinkel3Raw=ma,Object.defineProperty(r,"__esModule",{value:!0})})},{"d3-array":107,"d3-geo":114}],114:[function(e,o,f){(function(r,a){typeof f=="object"&&o!==void 0?a(f,e("d3-array")):a((r=r||self).d3=r.d3||{},r.d3)})(this,function(r,a){function u(){return new c}function c(){this.reset()}c.prototype={constructor:c,reset:function(){this.s=this.t=0},add:function(ht){s(i,ht,this.t),s(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new c;function s(ht,Ft,ln){var $t=ht.s=Ft+ln,un=$t-Ft,On=$t-un;ht.t=Ft-On+(ln-un)}var l=1e-6,d=Math.PI,h=d/2,m=d/4,g=2*d,p=180/d,v=d/180,y=Math.abs,x=Math.atan,w=Math.atan2,k=Math.cos,b=Math.ceil,T=Math.exp,_=Math.log,M=Math.pow,A=Math.sin,S=Math.sign||function(ht){return ht>0?1:ht<0?-1:0},E=Math.sqrt,D=Math.tan;function O(ht){return ht>1?0:ht<-1?d:Math.acos(ht)}function R(ht){return ht>1?h:ht<-1?-h:Math.asin(ht)}function z(ht){return(ht=A(ht/2))*ht}function L(){}function P(ht,Ft){ht&&B.hasOwnProperty(ht.type)&&B[ht.type](ht,Ft)}var N={Feature:function(ht,Ft){P(ht.geometry,Ft)},FeatureCollection:function(ht,Ft){for(var ln=ht.features,$t=-1,un=ln.length;++$t=0?1:-1,un=$t*ln,On=k(Ft=(Ft*=v)/2+m),Fn=A(Ft),Jn=U*Fn,fr=re*On+Jn*k(un),ur=Jn*$t*A(un);q.add(w(ur,fr)),Z=ht,re=On,U=Fn}function ae(ht){return[w(ht[1],ht[0]),R(ht[2])]}function ue(ht){var Ft=ht[0],ln=ht[1],$t=k(ln);return[$t*k(Ft),$t*A(Ft),A(ln)]}function le(ht,Ft){return ht[0]*Ft[0]+ht[1]*Ft[1]+ht[2]*Ft[2]}function ge(ht,Ft){return[ht[1]*Ft[2]-ht[2]*Ft[1],ht[2]*Ft[0]-ht[0]*Ft[2],ht[0]*Ft[1]-ht[1]*Ft[0]]}function fe(ht,Ft){ht[0]+=Ft[0],ht[1]+=Ft[1],ht[2]+=Ft[2]}function me(ht,Ft){return[ht[0]*Ft,ht[1]*Ft,ht[2]*Ft]}function _e(ht){var Ft=E(ht[0]*ht[0]+ht[1]*ht[1]+ht[2]*ht[2]);ht[0]/=Ft,ht[1]/=Ft,ht[2]/=Ft}var we,Te,Oe,de,ye,Me,ke,Ee,ze,Fe,Ve,Ke,Re,qe,We,Ye,nt,ft,vt,Pt,At,at,et,Ot,Wt,Jt,Be=u(),Ge={point:Tt,lineStart:Pe,lineEnd:Ie,polygonStart:function(){Ge.point=Ae,Ge.lineStart=De,Ge.lineEnd=He,Be.reset(),ne.polygonStart()},polygonEnd:function(){ne.polygonEnd(),Ge.point=Tt,Ge.lineStart=Pe,Ge.lineEnd=Ie,q<0?(we=-(Oe=180),Te=-(de=90)):Be>l?de=90:Be<-l&&(Te=-90),Fe[0]=we,Fe[1]=Oe},sphere:function(){we=-(Oe=180),Te=-(de=90)}};function Tt(ht,Ft){ze.push(Fe=[we=ht,Oe=ht]),Ftde&&(de=Ft)}function dt(ht,Ft){var ln=ue([ht*v,Ft*v]);if(Ee){var $t=ge(Ee,ln),un=ge([$t[1],-$t[0],0],$t);_e(un),un=ae(un);var On,Fn=ht-ye,Jn=Fn>0?1:-1,fr=un[0]*p*Jn,ur=y(Fn)>180;ur^(Jn*yede&&(de=On):ur^(Jn*ye<(fr=(fr+360)%360-180)&&frde&&(de=Ft)),ur?htrt(we,Oe)&&(Oe=ht):rt(ht,Oe)>rt(we,Oe)&&(we=ht):Oe>=we?(htOe&&(Oe=ht)):ht>ye?rt(we,ht)>rt(we,Oe)&&(Oe=ht):rt(ht,Oe)>rt(we,Oe)&&(we=ht)}else ze.push(Fe=[we=ht,Oe=ht]);Ftde&&(de=Ft),Ee=ln,ye=ht}function Pe(){Ge.point=dt}function Ie(){Fe[0]=we,Fe[1]=Oe,Ge.point=Tt,Ee=null}function Ae(ht,Ft){if(Ee){var ln=ht-ye;Be.add(y(ln)>180?ln+(ln>0?360:-360):ln)}else Me=ht,ke=Ft;ne.point(ht,Ft),dt(ht,Ft)}function De(){ne.lineStart()}function He(){Ae(Me,ke),ne.lineEnd(),y(Be)>l&&(we=-(Oe=180)),Fe[0]=we,Fe[1]=Oe,Ee=null}function rt(ht,Ft){return(Ft-=ht)<0?Ft+360:Ft}function lt(ht,Ft){return ht[0]-Ft[0]}function ot(ht,Ft){return ht[0]<=ht[1]?ht[0]<=Ft&&Ft<=ht[1]:Ftd?ht+Math.round(-ht/g)*g:ht,Ft]}function Zt(ht,Ft,ln){return(ht%=g)?Ft||ln?Et(Ht(ht),mn(Ft,ln)):Ht(ht):Ft||ln?mn(Ft,ln):It}function Kt(ht){return function(Ft,ln){return[(Ft+=ht)>d?Ft-g:Ft<-d?Ft+g:Ft,ln]}}function Ht(ht){var Ft=Kt(ht);return Ft.invert=Kt(-ht),Ft}function mn(ht,Ft){var ln=k(ht),$t=A(ht),un=k(Ft),On=A(Ft);function Fn(Jn,fr){var ur=k(fr),yr=k(Jn)*ur,Tr=A(Jn)*ur,hr=A(fr),Ar=hr*ln+yr*$t;return[w(Tr*un-Ar*On,yr*ln-hr*$t),R(Ar*un+Tr*On)]}return Fn.invert=function(Jn,fr){var ur=k(fr),yr=k(Jn)*ur,Tr=A(Jn)*ur,hr=A(fr),Ar=hr*un-Tr*On;return[w(Tr*un+hr*On,yr*ln+Ar*$t),R(Ar*ln-yr*$t)]},Fn}function zn(ht){function Ft(ln){return(ln=ht(ln[0]*v,ln[1]*v))[0]*=p,ln[1]*=p,ln}return ht=Zt(ht[0]*v,ht[1]*v,ht.length>2?ht[2]*v:0),Ft.invert=function(ln){return(ln=ht.invert(ln[0]*v,ln[1]*v))[0]*=p,ln[1]*=p,ln},Ft}function pn(ht,Ft,ln,$t,un,On){if(ln){var Fn=k(Ft),Jn=A(Ft),fr=$t*ln;un==null?(un=Ft+$t*g,On=Ft-fr/2):(un=tn(Fn,un),On=tn(Fn,On),($t>0?unOn)&&(un+=$t*g));for(var ur,yr=un;$t>0?yr>On:yr1&&Ft.push(Ft.pop().concat(Ft.shift()))},result:function(){var ln=Ft;return Ft=[],ht=null,ln}}}function sn(ht,Ft){return y(ht[0]-Ft[0])=0;--On)un.point((yr=ur[On])[0],yr[1]);else $t(hr.x,hr.p.x,-1,un);hr=hr.p}ur=(hr=hr.o).z,Ar=!Ar}while(!hr.v);un.lineEnd()}}}function In(ht){if(Ft=ht.length){for(var Ft,ln,$t=0,un=ht[0];++$t=0?1:-1,ra=Lr*Ki,Ji=ra>d,Ci=Zr*fi;if(Hn.add(w(Ci*Lr*A(ra),mi*Ni+Ci*k(ra))),Fn+=Ji?Ki+Lr*g:Ki,Ji^Ar>=ln^Rr>=ln){var ia=ge(ue(hr),ue(di));_e(ia);var Wi=ge(On,ia);_e(Wi);var Ca=(Ji^Ki>=0?-1:1)*R(Wi[2]);($t>Ca||$t===Ca&&(ia[0]||ia[1]))&&(Jn+=Ji^Ki>=0?1:-1)}}return(Fn<-l||Fn0){for(Tr||(un.polygonStart(),Tr=!0),un.lineStart(),Gr=0;Gr1&&2&Lr&&ra.push(ra.pop().concat(ra.shift())),Fn.push(ra.filter(vr))}return hr}}function vr(ht){return ht.length>1}function Er(ht,Ft){return((ht=ht.x)[0]<0?ht[1]-h-l:h-ht[1])-((Ft=Ft.x)[0]<0?Ft[1]-h-l:h-Ft[1])}var Kn=Or(function(){return!0},function(ht){var Ft,ln=NaN,$t=NaN,un=NaN;return{lineStart:function(){ht.lineStart(),Ft=1},point:function(On,Fn){var Jn=On>0?d:-d,fr=y(On-ln);y(fr-d)0?h:-h),ht.point(un,$t),ht.lineEnd(),ht.lineStart(),ht.point(Jn,$t),ht.point(On,$t),Ft=0):un!==Jn&&fr>=d&&(y(ln-un)l?x((A(yr)*(Ur=k(hr))*A(Tr)-A(hr)*(Ar=k(yr))*A(ur))/(Ar*Ur*Zr)):(yr+hr)/2}(ln,$t,On,Fn),ht.point(un,$t),ht.lineEnd(),ht.lineStart(),ht.point(Jn,$t),Ft=0),ht.point(ln=On,$t=Fn),un=Jn},lineEnd:function(){ht.lineEnd(),ln=$t=NaN},clean:function(){return 2-Ft}}},function(ht,Ft,ln,$t){var un;if(ht==null)un=ln*h,$t.point(-d,un),$t.point(0,un),$t.point(d,un),$t.point(d,0),$t.point(d,-un),$t.point(0,-un),$t.point(-d,-un),$t.point(-d,0),$t.point(-d,un);else if(y(ht[0]-Ft[0])>l){var On=ht[0]0,un=y(Ft)>l;function On(fr,ur){return k(fr)*k(ur)>Ft}function Fn(fr,ur,yr){var Tr=[1,0,0],hr=ge(ue(fr),ue(ur)),Ar=le(hr,hr),Ur=hr[0],Zr=Ar-Ur*Ur;if(!Zr)return!yr&&fr;var mi=Ft*Ar/Zr,Qn=-Ft*Ur/Zr,di=ge(Tr,hr),Rr=me(Tr,mi);fe(Rr,me(hr,Qn));var Gr=di,fi=le(Rr,Gr),Ni=le(Gr,Gr),Ki=fi*fi-Ni*(le(Rr,Rr)-1);if(!(Ki<0)){var Lr=E(Ki),ra=me(Gr,(-fi-Lr)/Ni);if(fe(ra,Rr),ra=ae(ra),!yr)return ra;var Ji,Ci=fr[0],ia=ur[0],Wi=fr[1],Ca=ur[1];ia0^ra[1]<(y(ra[0]-Ci)d^(Ci<=ra[0]&&ra[0]<=ia)){var Po=me(Gr,(-fi+Lr)/Ni);return fe(Po,Rr),[ra,ae(Po)]}}}function Jn(fr,ur){var yr=$t?ht:d-ht,Tr=0;return fr<-yr?Tr|=1:fr>yr&&(Tr|=2),ur<-yr?Tr|=4:ur>yr&&(Tr|=8),Tr}return Or(On,function(fr){var ur,yr,Tr,hr,Ar;return{lineStart:function(){hr=Tr=!1,Ar=1},point:function(Ur,Zr){var mi,Qn=[Ur,Zr],di=On(Ur,Zr),Rr=$t?di?0:Jn(Ur,Zr):di?Jn(Ur+(Ur<0?d:-d),Zr):0;if(!ur&&(hr=Tr=di)&&fr.lineStart(),di!==Tr&&(!(mi=Fn(ur,Qn))||sn(ur,mi)||sn(Qn,mi))&&(Qn[2]=1),di!==Tr)Ar=0,di?(fr.lineStart(),mi=Fn(Qn,ur),fr.point(mi[0],mi[1])):(mi=Fn(ur,Qn),fr.point(mi[0],mi[1],2),fr.lineEnd()),ur=mi;else if(un&&ur&&$t^di){var Gr;Rr&yr||!(Gr=Fn(Qn,ur,!0))||(Ar=0,$t?(fr.lineStart(),fr.point(Gr[0][0],Gr[0][1]),fr.point(Gr[1][0],Gr[1][1]),fr.lineEnd()):(fr.point(Gr[1][0],Gr[1][1]),fr.lineEnd(),fr.lineStart(),fr.point(Gr[0][0],Gr[0][1],3)))}!di||ur&&sn(ur,Qn)||fr.point(Qn[0],Qn[1]),ur=Qn,Tr=di,yr=Rr},lineEnd:function(){Tr&&fr.lineEnd(),ur=null},clean:function(){return Ar|(hr&&Tr)<<1}}},function(fr,ur,yr,Tr){pn(Tr,ht,ln,yr,fr,ur)},$t?[0,-ht]:[-d,ht-d])}function lr(ht,Ft,ln,$t){function un(ur,yr){return ht<=ur&&ur<=ln&&Ft<=yr&&yr<=$t}function On(ur,yr,Tr,hr){var Ar=0,Ur=0;if(ur==null||(Ar=Fn(ur,Tr))!==(Ur=Fn(yr,Tr))||fr(ur,yr)<0^Tr>0)do hr.point(Ar===0||Ar===3?ht:ln,Ar>1?$t:Ft);while((Ar=(Ar+Tr+4)%4)!==Ur);else hr.point(yr[0],yr[1])}function Fn(ur,yr){return y(ur[0]-ht)0?0:3:y(ur[0]-ln)0?2:1:y(ur[1]-Ft)0?1:0:yr>0?3:2}function Jn(ur,yr){return fr(ur.x,yr.x)}function fr(ur,yr){var Tr=Fn(ur,1),hr=Fn(yr,1);return Tr!==hr?Tr-hr:Tr===0?yr[1]-ur[1]:Tr===1?ur[0]-yr[0]:Tr===2?ur[1]-yr[1]:yr[0]-ur[0]}return function(ur){var yr,Tr,hr,Ar,Ur,Zr,mi,Qn,di,Rr,Gr,fi=ur,Ni=nn(),Ki={point:Lr,lineStart:function(){Ki.point=ra,Tr&&Tr.push(hr=[]),Rr=!0,di=!1,mi=Qn=NaN},lineEnd:function(){yr&&(ra(Ar,Ur),Zr&&di&&Ni.rejoin(),yr.push(Ni.result())),Ki.point=Lr,di&&fi.lineEnd()},polygonStart:function(){fi=Ni,yr=[],Tr=[],Gr=!0},polygonEnd:function(){var Ji=function(){for(var Wi=0,Ca=0,pi=Tr.length;Ca$t&&(Qa-_a)*($t-Po)>(Ts-Po)*(ht-_a)&&++Wi:Ts<=$t&&(Qa-_a)*($t-Po)<(Ts-Po)*(ht-_a)&&--Wi;return Wi}(),Ci=Gr&&Ji,ia=(yr=a.merge(yr)).length;(Ci||ia)&&(ur.polygonStart(),Ci&&(ur.lineStart(),On(null,null,1,ur),ur.lineEnd()),ia&&bn(yr,Jn,Ji,On,ur),ur.polygonEnd()),fi=ur,yr=Tr=hr=null}};function Lr(Ji,Ci){un(Ji,Ci)&&fi.point(Ji,Ci)}function ra(Ji,Ci){var ia=un(Ji,Ci);if(Tr&&hr.push([Ji,Ci]),Rr)Ar=Ji,Ur=Ci,Zr=ia,Rr=!1,ia&&(fi.lineStart(),fi.point(Ji,Ci));else if(ia&&di)fi.point(Ji,Ci);else{var Wi=[mi=Math.max(-1e9,Math.min(1e9,mi)),Qn=Math.max(-1e9,Math.min(1e9,Qn))],Ca=[Ji=Math.max(-1e9,Math.min(1e9,Ji)),Ci=Math.max(-1e9,Math.min(1e9,Ci))];(function(pi,_a,Po,Al,Zs,ks){var Pi,Qa=pi[0],Ts=pi[1],wa=0,uo=1,jo=_a[0]-Qa,La=_a[1]-Ts;if(Pi=Po-Qa,jo||!(Pi>0)){if(Pi/=jo,jo<0){if(Pi0){if(Pi>uo)return;Pi>wa&&(wa=Pi)}if(Pi=Zs-Qa,jo||!(Pi<0)){if(Pi/=jo,jo<0){if(Pi>uo)return;Pi>wa&&(wa=Pi)}else if(jo>0){if(Pi0)){if(Pi/=La,La<0){if(Pi0){if(Pi>uo)return;Pi>wa&&(wa=Pi)}if(Pi=ks-Ts,La||!(Pi<0)){if(Pi/=La,La<0){if(Pi>uo)return;Pi>wa&&(wa=Pi)}else if(La>0){if(Pi0&&(pi[0]=Qa+wa*jo,pi[1]=Ts+wa*La),uo<1&&(_a[0]=Qa+uo*jo,_a[1]=Ts+uo*La),!0}}}}})(Wi,Ca,ht,Ft,ln,$t)?(di||(fi.lineStart(),fi.point(Wi[0],Wi[1])),fi.point(Ca[0],Ca[1]),ia||fi.lineEnd(),Gr=!1):ia&&(fi.lineStart(),fi.point(Ji,Ci),Gr=!1)}mi=Ji,Qn=Ci,di=ia}return Ki}}var Wr,Mn,rr,nr=u(),Bn={sphere:L,point:L,lineStart:function(){Bn.point=$r,Bn.lineEnd=Fr},lineEnd:L,polygonStart:L,polygonEnd:L};function Fr(){Bn.point=Bn.lineEnd=L}function $r(ht,Ft){Wr=ht*=v,Mn=A(Ft*=v),rr=k(Ft),Bn.point=pr}function pr(ht,Ft){ht*=v;var ln=A(Ft*=v),$t=k(Ft),un=y(ht-Wr),On=k(un),Fn=$t*A(un),Jn=rr*ln-Mn*$t*On,fr=Mn*ln+rr*$t*On;nr.add(w(E(Fn*Fn+Jn*Jn),fr)),Wr=ht,Mn=ln,rr=$t}function qr(ht){return nr.reset(),K(ht,Bn),+nr}var _i=[null,null],cn={type:"LineString",coordinates:_i};function jn(ht,Ft){return _i[0]=ht,_i[1]=Ft,qr(cn)}var jt={Feature:function(ht,Ft){return yn(ht.geometry,Ft)},FeatureCollection:function(ht,Ft){for(var ln=ht.features,$t=-1,un=ln.length;++$t0&&(un=jn(ht[On],ht[On-1]))>0&&ln<=un&&$t<=un&&(ln+$t-un)*(1-Math.pow((ln-$t)/un,2))<1e-12*un)return!0;ln=$t}return!1}function Nn(ht,Ft){return!!ar(ht.map(Rn),wn(Ft))}function Rn(ht){return(ht=ht.map(wn)).pop(),ht}function wn(ht){return[ht[0]*v,ht[1]*v]}function kn(ht,Ft,ln){var $t=a.range(ht,Ft-l,ln).concat(Ft);return function(un){return $t.map(function(On){return[un,On]})}}function Tn(ht,Ft,ln){var $t=a.range(ht,Ft-l,ln).concat(Ft);return function(un){return $t.map(function(On){return[On,un]})}}function Dn(){var ht,Ft,ln,$t,un,On,Fn,Jn,fr,ur,yr,Tr,hr=10,Ar=hr,Ur=90,Zr=360,mi=2.5;function Qn(){return{type:"MultiLineString",coordinates:di()}}function di(){return a.range(b($t/Ur)*Ur,ln,Ur).map(yr).concat(a.range(b(Jn/Zr)*Zr,Fn,Zr).map(Tr)).concat(a.range(b(Ft/hr)*hr,ht,hr).filter(function(Rr){return y(Rr%Ur)>l}).map(fr)).concat(a.range(b(On/Ar)*Ar,un,Ar).filter(function(Rr){return y(Rr%Zr)>l}).map(ur))}return Qn.lines=function(){return di().map(function(Rr){return{type:"LineString",coordinates:Rr}})},Qn.outline=function(){return{type:"Polygon",coordinates:[yr($t).concat(Tr(Fn).slice(1),yr(ln).reverse().slice(1),Tr(Jn).reverse().slice(1))]}},Qn.extent=function(Rr){return arguments.length?Qn.extentMajor(Rr).extentMinor(Rr):Qn.extentMinor()},Qn.extentMajor=function(Rr){return arguments.length?($t=+Rr[0][0],ln=+Rr[1][0],Jn=+Rr[0][1],Fn=+Rr[1][1],$t>ln&&(Rr=$t,$t=ln,ln=Rr),Jn>Fn&&(Rr=Jn,Jn=Fn,Fn=Rr),Qn.precision(mi)):[[$t,Jn],[ln,Fn]]},Qn.extentMinor=function(Rr){return arguments.length?(Ft=+Rr[0][0],ht=+Rr[1][0],On=+Rr[0][1],un=+Rr[1][1],Ft>ht&&(Rr=Ft,Ft=ht,ht=Rr),On>un&&(Rr=On,On=un,un=Rr),Qn.precision(mi)):[[Ft,On],[ht,un]]},Qn.step=function(Rr){return arguments.length?Qn.stepMajor(Rr).stepMinor(Rr):Qn.stepMinor()},Qn.stepMajor=function(Rr){return arguments.length?(Ur=+Rr[0],Zr=+Rr[1],Qn):[Ur,Zr]},Qn.stepMinor=function(Rr){return arguments.length?(hr=+Rr[0],Ar=+Rr[1],Qn):[hr,Ar]},Qn.precision=function(Rr){return arguments.length?(mi=+Rr,fr=kn(On,un,90),ur=Tn(Ft,ht,mi),yr=kn(Jn,Fn,90),Tr=Tn($t,ln,mi),Qn):mi},Qn.extentMajor([[-180,-90+l],[180,90-l]]).extentMinor([[-180,-80-l],[180,80+l]])}function Zn(ht){return ht}var Yn,ir,or,xr,wr=u(),kr=u(),Dr={point:L,lineStart:L,lineEnd:L,polygonStart:function(){Dr.lineStart=Nr,Dr.lineEnd=Bi},polygonEnd:function(){Dr.lineStart=Dr.lineEnd=Dr.point=L,wr.add(y(kr)),kr.reset()},result:function(){var ht=wr/2;return wr.reset(),ht}};function Nr(){Dr.point=ri}function ri(ht,Ft){Dr.point=ji,Yn=or=ht,ir=xr=Ft}function ji(ht,Ft){kr.add(xr*ht-or*Ft),or=ht,xr=Ft}function Bi(){ji(Yn,ir)}var Sr=1/0,ui=Sr,si=-Sr,ta=si,Ja={point:function(ht,Ft){htsi&&(si=ht),Ftta&&(ta=Ft)},lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var ht=[[Sr,ui],[si,ta]];return si=ta=-(ui=Sr=1/0),ht}},Ao,fs,ya,xa,Zo=0,oa=0,hs=0,bs=0,so=0,Jo=0,_s=0,Ls=0,Oo=0,Ka={point:$o,lineStart:ic,lineEnd:ju,polygonStart:function(){Ka.lineStart=Wl,Ka.lineEnd=Sc},polygonEnd:function(){Ka.point=$o,Ka.lineStart=ic,Ka.lineEnd=ju},result:function(){var ht=Oo?[_s/Oo,Ls/Oo]:Jo?[bs/Jo,so/Jo]:hs?[Zo/hs,oa/hs]:[NaN,NaN];return Zo=oa=hs=bs=so=Jo=_s=Ls=Oo=0,ht}};function $o(ht,Ft){Zo+=ht,oa+=Ft,++hs}function ic(){Ka.point=Mc}function Mc(ht,Ft){Ka.point=ba,$o(ya=ht,xa=Ft)}function ba(ht,Ft){var ln=ht-ya,$t=Ft-xa,un=E(ln*ln+$t*$t);bs+=un*(ya+ht)/2,so+=un*(xa+Ft)/2,Jo+=un,$o(ya=ht,xa=Ft)}function ju(){Ka.point=$o}function Wl(){Ka.point=Ec}function Sc(){ac(Ao,fs)}function Ec(ht,Ft){Ka.point=ac,$o(Ao=ya=ht,fs=xa=Ft)}function ac(ht,Ft){var ln=ht-ya,$t=Ft-xa,un=E(ln*ln+$t*$t);bs+=un*(ya+ht)/2,so+=un*(xa+Ft)/2,Jo+=un,_s+=(un=xa*ht-ya*Ft)*(ya+ht),Ls+=un*(xa+Ft),Oo+=3*un,$o(ya=ht,xa=Ft)}function Cc(ht){this._context=ht}Cc.prototype={_radius:4.5,pointRadius:function(ht){return this._radius=ht,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(ht,Ft){switch(this._point){case 0:this._context.moveTo(ht,Ft),this._point=1;break;case 1:this._context.lineTo(ht,Ft);break;default:this._context.moveTo(ht+this._radius,Ft),this._context.arc(ht,Ft,this._radius,0,g)}},result:L};var Ns,Bs,fl,hl,dl,Yl=u(),ws={point:L,lineStart:function(){ws.point=Uu},lineEnd:function(){Ns&&ds(Bs,fl),ws.point=L},polygonStart:function(){Ns=!0},polygonEnd:function(){Ns=null},result:function(){var ht=+Yl;return Yl.reset(),ht}};function Uu(ht,Ft){ws.point=ds,Bs=hl=ht,fl=dl=Ft}function ds(ht,Ft){hl-=ht,dl-=Ft,Yl.add(E(hl*hl+dl*dl)),hl=ht,dl=Ft}function pl(){this._string=[]}function Vu(ht){return"m0,"+ht+"a"+ht+","+ht+" 0 1,1 0,"+-2*ht+"a"+ht+","+ht+" 0 1,1 0,"+2*ht+"z"}function js(ht){return function(Ft){var ln=new ma;for(var $t in ht)ln[$t]=ht[$t];return ln.stream=Ft,ln}}function ma(){}function je(ht,Ft,ln){var $t=ht.clipExtent&&ht.clipExtent();return ht.scale(150).translate([0,0]),$t!=null&&ht.clipExtent(null),K(ln,ht.stream(Ja)),Ft(Ja.result()),$t!=null&&ht.clipExtent($t),ht}function $e(ht,Ft,ln){return je(ht,function($t){var un=Ft[1][0]-Ft[0][0],On=Ft[1][1]-Ft[0][1],Fn=Math.min(un/($t[1][0]-$t[0][0]),On/($t[1][1]-$t[0][1])),Jn=+Ft[0][0]+(un-Fn*($t[1][0]+$t[0][0]))/2,fr=+Ft[0][1]+(On-Fn*($t[1][1]+$t[0][1]))/2;ht.scale(150*Fn).translate([Jn,fr])},ln)}function Qe(ht,Ft,ln){return $e(ht,[[0,0],Ft],ln)}function ut(ht,Ft,ln){return je(ht,function($t){var un=+Ft,On=un/($t[1][0]-$t[0][0]),Fn=(un-On*($t[1][0]+$t[0][0]))/2,Jn=-On*$t[0][1];ht.scale(150*On).translate([Fn,Jn])},ln)}function mt(ht,Ft,ln){return je(ht,function($t){var un=+Ft,On=un/($t[1][1]-$t[0][1]),Fn=-On*$t[0][0],Jn=(un-On*($t[1][1]+$t[0][1]))/2;ht.scale(150*On).translate([Fn,Jn])},ln)}pl.prototype={_radius:4.5,_circle:Vu(4.5),pointRadius:function(ht){return(ht=+ht)!==this._radius&&(this._radius=ht,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(ht,Ft){switch(this._point){case 0:this._string.push("M",ht,",",Ft),this._point=1;break;case 1:this._string.push("L",ht,",",Ft);break;default:this._circle==null&&(this._circle=Vu(this._radius)),this._string.push("M",ht,",",Ft,this._circle)}},result:function(){if(this._string.length){var ht=this._string.join("");return this._string=[],ht}return null}},ma.prototype={constructor:ma,point:function(ht,Ft){this.stream.point(ht,Ft)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var pt=k(30*v);function Ct(ht,Ft){return+Ft?function(ln,$t){function un(On,Fn,Jn,fr,ur,yr,Tr,hr,Ar,Ur,Zr,mi,Qn,di){var Rr=Tr-On,Gr=hr-Fn,fi=Rr*Rr+Gr*Gr;if(fi>4*$t&&Qn--){var Ni=fr+Ur,Ki=ur+Zr,Lr=yr+mi,ra=E(Ni*Ni+Ki*Ki+Lr*Lr),Ji=R(Lr/=ra),Ci=y(y(Lr)-1)$t||y((Rr*pi+Gr*_a)/fi-.5)>.3||fr*Ur+ur*Zr+yr*mi2?pi[2]%360*v:0,Wi()):[mi*p,Qn*p,di*p]},Ci.angle=function(pi){return arguments.length?(Rr=pi%360*v,Wi()):Rr*p},Ci.reflectX=function(pi){return arguments.length?(Gr=pi?-1:1,Wi()):Gr<0},Ci.reflectY=function(pi){return arguments.length?(fi=pi?-1:1,Wi()):fi<0},Ci.precision=function(pi){return arguments.length?(Fn=Ct(Jn,Ji=pi*pi),Ca()):E(Ji)},Ci.fitExtent=function(pi,_a){return $e(Ci,pi,_a)},Ci.fitSize=function(pi,_a){return Qe(Ci,pi,_a)},Ci.fitWidth=function(pi,_a){return ut(Ci,pi,_a)},Ci.fitHeight=function(pi,_a){return mt(Ci,pi,_a)},function(){return Ft=ht.apply(this,arguments),Ci.invert=Ft.invert&&ia,Wi()}}function xn(ht){var Ft=0,ln=d/3,$t=hn(ht),un=$t(Ft,ln);return un.parallels=function(On){return arguments.length?$t(Ft=On[0]*v,ln=On[1]*v):[Ft*p,ln*p]},un}function _n(ht,Ft){var ln=A(ht),$t=(ln+A(Ft))/2;if(y($t)0?Jn<-h+l&&(Jn=-h+l):Jn>h-l&&(Jn=h-l);var fr=un/M(Ui(Jn),$t);return[fr*A($t*Fn),un-fr*k($t*Fn)]}return On.invert=function(Fn,Jn){var fr=un-Jn,ur=S($t)*E(Fn*Fn+fr*fr),yr=w(Fn,y(fr))*S(fr);return fr*$t<0&&(yr-=d*S(Fn)*S(fr)),[yr/$t,2*x(M(un/ur,1/$t))-h]},On}function sa(ht,Ft){return[ht,Ft]}function ca(ht,Ft){var ln=k(ht),$t=ht===Ft?A(ht):(ln-k(Ft))/(Ft-ht),un=ln/$t+ht;if(y($t)l&&--un>0);return[ht/(.8707+(On=$t*$t)*(On*(On*On*On*(.003971-.001529*On)-.013791)-.131979)),$t]},es.invert=zr(R),ts.invert=zr(function(ht){return 2*x(ht)}),na.invert=function(ht,Ft){return[-Ft,2*x(T(ht))-h]},r.geoAlbers=sr,r.geoAlbersUsa=function(){var ht,Ft,ln,$t,un,On,Fn=sr(),Jn=Pn().rotate([154,0]).center([-2,58.5]).parallels([55,65]),fr=Pn().rotate([157,0]).center([-3,19.9]).parallels([8,18]),ur={point:function(hr,Ar){On=[hr,Ar]}};function yr(hr){var Ar=hr[0],Ur=hr[1];return On=null,ln.point(Ar,Ur),On||($t.point(Ar,Ur),On)||(un.point(Ar,Ur),On)}function Tr(){return ht=Ft=null,yr}return yr.invert=function(hr){var Ar=Fn.scale(),Ur=Fn.translate(),Zr=(hr[0]-Ur[0])/Ar,mi=(hr[1]-Ur[1])/Ar;return(mi>=.12&&mi<.234&&Zr>=-.425&&Zr<-.214?Jn:mi>=.166&&mi<.234&&Zr>=-.214&&Zr<-.115?fr:Fn).invert(hr)},yr.stream=function(hr){return ht&&Ft===hr?ht:(Ar=[Fn.stream(Ft=hr),Jn.stream(hr),fr.stream(hr)],Ur=Ar.length,ht={point:function(Zr,mi){for(var Qn=-1;++Qnrt($t[0],$t[1])&&($t[1]=un[1]),rt(un[0],$t[1])>rt($t[0],$t[1])&&($t[0]=un[0])):On.push($t=un);for(Fn=-1/0,Ft=0,$t=On[ln=On.length-1];Ft<=ln;$t=un,++Ft)un=On[Ft],(Jn=rt($t[1],un[0]))>Fn&&(Fn=Jn,we=un[0],Oe=$t[1])}return ze=Fe=null,we===1/0||Te===1/0?[[NaN,NaN],[NaN,NaN]]:[[we,Te],[Oe,de]]},r.geoCentroid=function(ht){Ve=Ke=Re=qe=We=Ye=nt=ft=vt=Pt=At=0,K(ht,kt);var Ft=vt,ln=Pt,$t=At,un=Ft*Ft+ln*ln+$t*$t;return un<1e-12&&(Ft=Ye,ln=nt,$t=ft,Ke2?$t[2]+90:90]):[($t=ln())[0],$t[1],$t[2]-90]},ln([0,0,90]).scale(159.155)},r.geoTransverseMercatorRaw=na,Object.defineProperty(r,"__esModule",{value:!0})})},{"d3-array":107}],115:[function(e,o,f){(function(r,a){a(typeof f=="object"&&o!==void 0?f:(r=r||self).d3=r.d3||{})})(this,function(r){function a(le,ge){return le.parent===ge.parent?1:2}function u(le,ge){return le+ge.x}function c(le,ge){return Math.max(le,ge.y)}function i(le){var ge=0,fe=le.children,me=fe&&fe.length;if(me)for(;--me>=0;)ge+=fe[me].value;else ge=1;le.value=ge}function s(le,ge){var fe,me,_e,we,Te,Oe=new m(le),de=+le.value&&(Oe.value=le.value),ye=[Oe];for(ge==null&&(ge=l);fe=ye.pop();)if(de&&(fe.value=+fe.data.value),(_e=ge(fe.data))&&(Te=_e.length))for(fe.children=new Array(Te),we=Te-1;we>=0;--we)ye.push(me=fe.children[we]=new m(_e[we])),me.parent=fe,me.depth=fe.depth+1;return Oe.eachBefore(h)}function l(le){return le.children}function d(le){le.data=le.data.data}function h(le){var ge=0;do le.height=ge;while((le=le.parent)&&le.height<++ge)}function m(le){this.data=le,this.depth=this.height=0,this.parent=null}m.prototype=s.prototype={constructor:m,count:function(){return this.eachAfter(i)},each:function(le){var ge,fe,me,_e,we=this,Te=[we];do for(ge=Te.reverse(),Te=[];we=ge.pop();)if(le(we),fe=we.children)for(me=0,_e=fe.length;me<_e;++me)Te.push(fe[me]);while(Te.length);return this},eachAfter:function(le){for(var ge,fe,me,_e=this,we=[_e],Te=[];_e=we.pop();)if(Te.push(_e),ge=_e.children)for(fe=0,me=ge.length;fe=0;--fe)_e.push(ge[fe]);return this},sum:function(le){return this.eachAfter(function(ge){for(var fe=+le(ge.data)||0,me=ge.children,_e=me&&me.length;--_e>=0;)fe+=me[_e].value;ge.value=fe})},sort:function(le){return this.eachBefore(function(ge){ge.children&&ge.children.sort(le)})},path:function(le){for(var ge=this,fe=function(we,Te){if(we===Te)return we;var Oe=we.ancestors(),de=Te.ancestors(),ye=null;for(we=Oe.pop(),Te=de.pop();we===Te;)ye=we,we=Oe.pop(),Te=de.pop();return ye}(ge,le),me=[ge];ge!==fe;)ge=ge.parent,me.push(ge);for(var _e=me.length;le!==fe;)me.splice(_e,0,le),le=le.parent;return me},ancestors:function(){for(var le=this,ge=[le];le=le.parent;)ge.push(le);return ge},descendants:function(){var le=[];return this.each(function(ge){le.push(ge)}),le},leaves:function(){var le=[];return this.eachBefore(function(ge){ge.children||le.push(ge)}),le},links:function(){var le=this,ge=[];return le.each(function(fe){fe!==le&&ge.push({source:fe.parent,target:fe})}),ge},copy:function(){return s(this).eachBefore(d)}};var g=Array.prototype.slice;function p(le){for(var ge,fe,me=0,_e=(le=function(Te){for(var Oe,de,ye=Te.length;ye;)de=Math.random()*ye--|0,Oe=Te[ye],Te[ye]=Te[de],Te[de]=Oe;return Te}(g.call(le))).length,we=[];me<_e;)ge=le[me],fe&&x(fe,ge)?++me:(fe=k(we=v(we,ge)),me=0);return fe}function v(le,ge){var fe,me;if(w(ge,le))return[ge];for(fe=0;fe0&&fe*fe>me*me+_e*_e}function w(le,ge){for(var fe=0;fe(Te*=Te)?(me=(ye+Te-_e)/(2*ye),we=Math.sqrt(Math.max(0,Te/ye-me*me)),fe.x=le.x-me*Oe-we*de,fe.y=le.y-me*de+we*Oe):(me=(ye+_e-Te)/(2*ye),we=Math.sqrt(Math.max(0,_e/ye-me*me)),fe.x=ge.x+me*Oe-we*de,fe.y=ge.y+me*de+we*Oe)):(fe.x=ge.x+fe.r,fe.y=ge.y)}function M(le,ge){var fe=le.r+ge.r-1e-6,me=ge.x-le.x,_e=ge.y-le.y;return fe>0&&fe*fe>me*me+_e*_e}function A(le){var ge=le._,fe=le.next._,me=ge.r+fe.r,_e=(ge.x*fe.r+fe.x*ge.r)/me,we=(ge.y*fe.r+fe.y*ge.r)/me;return _e*_e+we*we}function S(le){this._=le,this.next=null,this.previous=null}function E(le){if(!(_e=le.length))return 0;var ge,fe,me,_e,we,Te,Oe,de,ye,Me,ke;if((ge=le[0]).x=0,ge.y=0,!(_e>1))return ge.r;if(fe=le[1],ge.x=-fe.r,fe.x=ge.r,fe.y=0,!(_e>2))return ge.r+fe.r;_(fe,ge,me=le[2]),ge=new S(ge),fe=new S(fe),me=new S(me),ge.next=me.previous=fe,fe.next=ge.previous=me,me.next=fe.previous=ge;e:for(Oe=3;Oe<_e;++Oe){_(ge._,fe._,me=le[Oe]),me=new S(me),de=fe.next,ye=ge.previous,Me=fe._.r,ke=ge._.r;do if(Me<=ke){if(M(de._,me._)){fe=de,ge.next=fe,fe.previous=ge,--Oe;continue e}Me+=de._.r,de=de.next}else{if(M(ye._,me._)){(ge=ye).next=fe,fe.previous=ge,--Oe;continue e}ke+=ye._.r,ye=ye.previous}while(de!==ye.next);for(me.previous=ge,me.next=fe,ge.next=fe.previous=fe=me,we=A(ge);(me=me.next)!==fe;)(Te=A(me))Ee&&(Ee=Oe),Ke=Me*Me*Ve,(ze=Math.max(Ee/Ke,Ke/ke))>Fe){Me-=Oe;break}Fe=ze}Re.push(Te={value:Me,dice:de1?me:1)},fe}(ee),ue=function le(ge){function fe(me,_e,we,Te,Oe){if((de=me._squarify)&&de.ratio===ge)for(var de,ye,Me,ke,Ee,ze=-1,Fe=de.length,Ve=me.value;++ze1?me:1)},fe}(ee);r.cluster=function(){var le=a,ge=1,fe=1,me=!1;function _e(we){var Te,Oe=0;we.eachAfter(function(Ee){var ze=Ee.children;ze?(Ee.x=function(Fe){return Fe.reduce(u,0)/Fe.length}(ze),Ee.y=function(Fe){return 1+Fe.reduce(c,0)}(ze)):(Ee.x=Te?Oe+=le(Ee,Te):0,Ee.y=0,Te=Ee)});var de=function(Ee){for(var ze;ze=Ee.children;)Ee=ze[0];return Ee}(we),ye=function(Ee){for(var ze;ze=Ee.children;)Ee=ze[ze.length-1];return Ee}(we),Me=de.x-le(de,ye)/2,ke=ye.x+le(ye,de)/2;return we.eachAfter(me?function(Ee){Ee.x=(Ee.x-we.x)*ge,Ee.y=(we.y-Ee.y)*fe}:function(Ee){Ee.x=(Ee.x-Me)/(ke-Me)*ge,Ee.y=(1-(we.y?Ee.y/we.y:1))*fe})}return _e.separation=function(we){return arguments.length?(le=we,_e):le},_e.size=function(we){return arguments.length?(me=!1,ge=+we[0],fe=+we[1],_e):me?null:[ge,fe]},_e.nodeSize=function(we){return arguments.length?(me=!0,ge=+we[0],fe=+we[1],_e):me?[ge,fe]:null},_e},r.hierarchy=s,r.pack=function(){var le=null,ge=1,fe=1,me=R;function _e(we){return we.x=ge/2,we.y=fe/2,le?we.eachBefore(P(le)).eachAfter(N(me,.5)).eachBefore(B(1)):we.eachBefore(P(L)).eachAfter(N(R,1)).eachAfter(N(me,we.r/Math.min(ge,fe))).eachBefore(B(Math.min(ge,fe)/(2*we.r))),we}return _e.radius=function(we){return arguments.length?(le=D(we),_e):le},_e.size=function(we){return arguments.length?(ge=+we[0],fe=+we[1],_e):[ge,fe]},_e.padding=function(we){return arguments.length?(me=typeof we=="function"?we:z(+we),_e):me},_e},r.packEnclose=p,r.packSiblings=function(le){return E(le),le},r.partition=function(){var le=1,ge=1,fe=0,me=!1;function _e(we){var Te=we.height+1;return we.x0=we.y0=fe,we.x1=le,we.y1=ge/Te,we.eachBefore(function(Oe,de){return function(ye){ye.children&&W(ye,ye.x0,Oe*(ye.depth+1)/de,ye.x1,Oe*(ye.depth+2)/de);var Me=ye.x0,ke=ye.y0,Ee=ye.x1-fe,ze=ye.y1-fe;Ee0)throw new Error("cycle");return Te}return fe.id=function(me){return arguments.length?(le=O(me),fe):le},fe.parentId=function(me){return arguments.length?(ge=O(me),fe):ge},fe},r.tree=function(){var le=re,ge=1,fe=1,me=null;function _e(de){var ye=function(Re){for(var qe,We,Ye,nt,ft,vt=new H(Re,0),Pt=[vt];qe=Pt.pop();)if(Ye=qe._.children)for(qe.children=new Array(ft=Ye.length),nt=ft-1;nt>=0;--nt)Pt.push(We=qe.children[nt]=new H(Ye[nt],nt)),We.parent=qe;return(vt.parent=new H(null,0)).children=[vt],vt}(de);if(ye.eachAfter(we),ye.parent.m=-ye.z,ye.eachBefore(Te),me)de.eachBefore(Oe);else{var Me=de,ke=de,Ee=de;de.eachBefore(function(Re){Re.xke.x&&(ke=Re),Re.depth>Ee.depth&&(Ee=Re)});var ze=Me===ke?1:le(Me,ke)/2,Fe=ze-Me.x,Ve=ge/(ke.x+ze+Fe),Ke=fe/(Ee.depth||1);de.eachBefore(function(Re){Re.x=(Re.x+Fe)*Ve,Re.y=Re.depth*Ke})}return de}function we(de){var ye=de.children,Me=de.parent.children,ke=de.i?Me[de.i-1]:null;if(ye){(function(ze){for(var Fe,Ve=0,Ke=0,Re=ze.children,qe=Re.length;--qe>=0;)(Fe=Re[qe]).z+=Ve,Fe.m+=Ve,Ve+=Fe.s+(Ke+=Fe.c)})(de);var Ee=(ye[0].z+ye[ye.length-1].z)/2;ke?(de.z=ke.z+le(de._,ke._),de.m=de.z-Ee):de.z=Ee}else ke&&(de.z=ke.z+le(de._,ke._));de.parent.A=function(ze,Fe,Ve){if(Fe){for(var Ke,Re=ze,qe=ze,We=Fe,Ye=Re.parent.children[0],nt=Re.m,ft=qe.m,vt=We.m,Pt=Ye.m;We=q(We),Re=U(Re),We&ℜ)Ye=U(Ye),(qe=q(qe)).a=ze,(Ke=We.z+vt-Re.z-nt+le(We._,Re._))>0&&($(ne(We,ze,Ve),ze,Ke),nt+=Ke,ft+=Ke),vt+=We.m,nt+=Re.m,Pt+=Ye.m,ft+=qe.m;We&&!q(qe)&&(qe.t=We,qe.m+=vt-ft),Re&&!U(Ye)&&(Ye.t=Re,Ye.m+=nt-Pt,Ve=ze)}return Ve}(de,ke,de.parent.A||Me[0])}function Te(de){de._.x=de.z+de.parent.m,de.m+=de.parent.m}function Oe(de){de.x*=ge,de.y=de.depth*fe}return _e.separation=function(de){return arguments.length?(le=de,_e):le},_e.size=function(de){return arguments.length?(me=!1,ge=+de[0],fe=+de[1],_e):me?null:[ge,fe]},_e.nodeSize=function(de){return arguments.length?(me=!0,ge=+de[0],fe=+de[1],_e):me?[ge,fe]:null},_e},r.treemap=function(){var le=ae,ge=!1,fe=1,me=1,_e=[0],we=R,Te=R,Oe=R,de=R,ye=R;function Me(Ee){return Ee.x0=Ee.y0=0,Ee.x1=fe,Ee.y1=me,Ee.eachBefore(ke),_e=[0],ge&&Ee.eachBefore(G),Ee}function ke(Ee){var ze=_e[Ee.depth],Fe=Ee.x0+ze,Ve=Ee.y0+ze,Ke=Ee.x1-ze,Re=Ee.y1-ze;Ke=Ee-1){var qe=Oe[ke];return qe.x0=Fe,qe.y0=Ve,qe.x1=Ke,void(qe.y1=Re)}for(var We=ye[ke],Ye=ze/2+We,nt=ke+1,ft=Ee-1;nt>>1;ye[vt]Re-Ve){var at=(Fe*At+Ke*Pt)/ze;Me(ke,nt,Pt,Fe,Ve,at,Re),Me(nt,Ee,At,at,Ve,Ke,Re)}else{var et=(Ve*At+Re*Pt)/ze;Me(ke,nt,Pt,Fe,Ve,Ke,et),Me(nt,Ee,At,Fe,et,Ke,Re)}})(0,de,le.value,ge,fe,me,_e)},r.treemapDice=W,r.treemapResquarify=ue,r.treemapSlice=Q,r.treemapSliceDice=function(le,ge,fe,me,_e){(1&le.depth?Q:W)(le,ge,fe,me,_e)},r.treemapSquarify=ae,Object.defineProperty(r,"__esModule",{value:!0})})},{}],116:[function(e,o,f){(function(r,a){typeof f=="object"&&o!==void 0?a(f,e("d3-color")):a((r=r||self).d3=r.d3||{},r.d3)})(this,function(r,a){function u(ee,ie,ae,ue,le){var ge=ee*ee,fe=ge*ee;return((1-3*ee+3*ge-fe)*ie+(4-6*ge+3*fe)*ae+(1+3*ee+3*ge-3*fe)*ue+fe*le)/6}function c(ee){var ie=ee.length-1;return function(ae){var ue=ae<=0?ae=0:ae>=1?(ae=1,ie-1):Math.floor(ae*ie),le=ee[ue],ge=ee[ue+1],fe=ue>0?ee[ue-1]:2*le-ge,me=ue180||ae<-180?ae-360*Math.round(ae/360):ae):s(isNaN(ee)?ie:ee)}function h(ee){return(ee=+ee)==1?m:function(ie,ae){return ae-ie?function(ue,le,ge){return ue=Math.pow(ue,ge),le=Math.pow(le,ge)-ue,ge=1/ge,function(fe){return Math.pow(ue+fe*le,ge)}}(ie,ae,ee):s(isNaN(ie)?ae:ie)}}function m(ee,ie){var ae=ie-ee;return ae?l(ee,ae):s(isNaN(ee)?ie:ee)}var g=function ee(ie){var ae=h(ie);function ue(le,ge){var fe=ae((le=a.rgb(le)).r,(ge=a.rgb(ge)).r),me=ae(le.g,ge.g),_e=ae(le.b,ge.b),we=m(le.opacity,ge.opacity);return function(Te){return le.r=fe(Te),le.g=me(Te),le.b=_e(Te),le.opacity=we(Te),le+""}}return ue.gamma=ee,ue}(1);function p(ee){return function(ie){var ae,ue,le=ie.length,ge=new Array(le),fe=new Array(le),me=new Array(le);for(ae=0;aege&&(le=ie.slice(ge,le),me[fe]?me[fe]+=le:me[++fe]=le),(ae=ae[0])===(ue=ue[0])?me[fe]?me[fe]+=ue:me[++fe]=ue:(me[++fe]=null,_e.push({i:fe,x:T(ae,ue)})),ge=A.lastIndex;return ge180?Te+=360:Te-we>180&&(we+=360),de.push({i:Oe.push(le(Oe)+"rotate(",null,ue)-2,x:T(we,Te)})):Te&&Oe.push(le(Oe)+"rotate("+Te+ue)}(ge.rotate,fe.rotate,me,_e),function(we,Te,Oe,de){we!==Te?de.push({i:Oe.push(le(Oe)+"skewX(",null,ue)-2,x:T(we,Te)}):Te&&Oe.push(le(Oe)+"skewX("+Te+ue)}(ge.skewX,fe.skewX,me,_e),function(we,Te,Oe,de,ye,Me){if(we!==Oe||Te!==de){var ke=ye.push(le(ye)+"scale(",null,",",null,")");Me.push({i:ke-4,x:T(we,Oe)},{i:ke-2,x:T(Te,de)})}else Oe===1&&de===1||ye.push(le(ye)+"scale("+Oe+","+de+")")}(ge.scaleX,ge.scaleY,fe.scaleX,fe.scaleY,me,_e),ge=fe=null,function(we){for(var Te,Oe=-1,de=_e.length;++Oe1e-6)if(Math.abs(k*y-x*w)>1e-6&&g){var T=h-p,_=m-v,M=y*y+x*x,A=T*T+_*_,S=Math.sqrt(M),E=Math.sqrt(b),D=g*Math.tan((a-Math.acos((M+b-A)/(2*S*E)))/2),O=D/E,R=D/S;Math.abs(O-1)>1e-6&&(this._+="L"+(l+O*w)+","+(d+O*k)),this._+="A"+g+","+g+",0,0,"+ +(k*T>w*_)+","+(this._x1=l+R*y)+","+(this._y1=d+R*x)}else this._+="L"+(this._x1=l)+","+(this._y1=d)},arc:function(l,d,h,m,g,p){l=+l,d=+d,p=!!p;var v=(h=+h)*Math.cos(m),y=h*Math.sin(m),x=l+v,w=d+y,k=1^p,b=p?m-g:g-m;if(h<0)throw new Error("negative radius: "+h);this._x1===null?this._+="M"+x+","+w:(Math.abs(this._x1-x)>1e-6||Math.abs(this._y1-w)>1e-6)&&(this._+="L"+x+","+w),h&&(b<0&&(b=b%u+u),b>c?this._+="A"+h+","+h+",0,1,"+k+","+(l-v)+","+(d-y)+"A"+h+","+h+",0,1,"+k+","+(this._x1=x)+","+(this._y1=w):b>1e-6&&(this._+="A"+h+","+h+",0,"+ +(b>=a)+","+k+","+(this._x1=l+h*Math.cos(g))+","+(this._y1=d+h*Math.sin(g))))},rect:function(l,d,h,m){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+d)+"h"+ +h+"v"+ +m+"h"+-h+"Z"},toString:function(){return this._}},r.path=s,Object.defineProperty(r,"__esModule",{value:!0})})},{}],118:[function(e,o,f){(function(r,a){a(typeof f=="object"&&o!==void 0?f:(r=r||self).d3=r.d3||{})})(this,function(r){function a(m,g,p,v){if(isNaN(g)||isNaN(p))return m;var y,x,w,k,b,T,_,M,A,S=m._root,E={data:v},D=m._x0,O=m._y0,R=m._x1,z=m._y1;if(!S)return m._root=E,m;for(;S.length;)if((T=g>=(x=(D+R)/2))?D=x:R=x,(_=p>=(w=(O+z)/2))?O=w:z=w,y=S,!(S=S[M=_<<1|T]))return y[M]=E,m;if(k=+m._x.call(null,S.data),b=+m._y.call(null,S.data),g===k&&p===b)return E.next=S,y?y[M]=E:m._root=E,m;do y=y?y[M]=new Array(4):m._root=new Array(4),(T=g>=(x=(D+R)/2))?D=x:R=x,(_=p>=(w=(O+z)/2))?O=w:z=w;while((M=_<<1|T)==(A=(b>=w)<<1|k>=x));return y[A]=S,y[M]=E,m}function u(m,g,p,v,y){this.node=m,this.x0=g,this.y0=p,this.x1=v,this.y1=y}function c(m){return m[0]}function i(m){return m[1]}function s(m,g,p){var v=new l(g??c,p??i,NaN,NaN,NaN,NaN);return m==null?v:v.addAll(m)}function l(m,g,p,v,y,x){this._x=m,this._y=g,this._x0=p,this._y0=v,this._x1=y,this._y1=x,this._root=void 0}function d(m){for(var g={data:m.data},p=g;m=m.next;)p=p.next={data:m.data};return g}var h=s.prototype=l.prototype;h.copy=function(){var m,g,p=new l(this._x,this._y,this._x0,this._y0,this._x1,this._y1),v=this._root;if(!v)return p;if(!v.length)return p._root=d(v),p;for(m=[{source:v,target:p._root=new Array(4)}];v=m.pop();)for(var y=0;y<4;++y)(g=v.source[y])&&(g.length?m.push({source:g,target:v.target[y]=new Array(4)}):v.target[y]=d(g));return p},h.add=function(m){var g=+this._x.call(null,m),p=+this._y.call(null,m);return a(this.cover(g,p),g,p,m)},h.addAll=function(m){var g,p,v,y,x=m.length,w=new Array(x),k=new Array(x),b=1/0,T=1/0,_=-1/0,M=-1/0;for(p=0;p_&&(_=v),yM&&(M=y));if(b>_||T>M)return this;for(this.cover(b,T).cover(_,M),p=0;pm||m>=y||v>g||g>=x;)switch(k=(gA||(x=b.y0)>S||(w=b.x1)<_||(k=b.y1)=R)<<1|m>=O)&&(b=E[E.length-1],E[E.length-1]=E[E.length-1-T],E[E.length-1-T]=b)}else{var z=m-+this._x.call(null,D.data),L=g-+this._y.call(null,D.data),P=z*z+L*L;if(P=(k=(E+O)/2))?E=k:O=k,(_=w>=(b=(D+R)/2))?D=b:R=b,g=S,!(S=S[M=_<<1|T]))return this;if(!S.length)break;(g[M+1&3]||g[M+2&3]||g[M+3&3])&&(p=g,A=M)}for(;S.data!==m;)if(v=S,!(S=S.next))return this;return(y=S.next)&&delete S.next,v?(y?v.next=y:delete v.next,this):g?(y?g[M]=y:delete g[M],(S=g[0]||g[1]||g[2]||g[3])&&S===(g[3]||g[2]||g[1]||g[0])&&!S.length&&(p?p[A]=S:this._root=S),this):(this._root=y,this)},h.removeAll=function(m){for(var g=0,p=m.length;g1?0:Le<-1?g:Math.acos(Le)}function x(Le){return Le>=1?p:Le<=-1?-p:Math.asin(Le)}function w(Le){return Le.innerRadius}function k(Le){return Le.outerRadius}function b(Le){return Le.startAngle}function T(Le){return Le.endAngle}function _(Le){return Le&&Le.padAngle}function M(Le,Je,st,Et,It,Zt,Kt,Ht){var mn=st-Le,zn=Et-Je,pn=Kt-It,tn=Ht-Zt,nn=tn*mn-pn*zn;if(!(nn*nn<1e-12))return[Le+(nn=(pn*(Je-Zt)-tn*(Le-It))/nn)*mn,Je+nn*zn]}function A(Le,Je,st,Et,It,Zt,Kt){var Ht=Le-st,mn=Je-Et,zn=(Kt?Zt:-Zt)/m(Ht*Ht+mn*mn),pn=zn*mn,tn=-zn*Ht,nn=Le+pn,sn=Je+tn,gn=st+pn,bn=Et+tn,In=(nn+gn)/2,Hn=(sn+bn)/2,Wn=gn-nn,ar=bn-sn,Or=Wn*Wn+ar*ar,vr=It-Zt,Er=nn*bn-gn*sn,Kn=(ar<0?-1:1)*m(l(0,vr*vr*Or-Er*Er)),Ln=(Er*ar-Wn*Kn)/Or,lr=(-Er*Wn-ar*Kn)/Or,Wr=(Er*ar+Wn*Kn)/Or,Mn=(-Er*Wn+ar*Kn)/Or,rr=Ln-In,nr=lr-Hn,Bn=Wr-In,Fr=Mn-Hn;return rr*rr+nr*nr>Bn*Bn+Fr*Fr&&(Ln=Wr,lr=Mn),{cx:Ln,cy:lr,x01:-pn,y01:-tn,x11:Ln*(It/vr-1),y11:lr*(It/vr-1)}}function S(Le){this._context=Le}function E(Le){return new S(Le)}function D(Le){return Le[0]}function O(Le){return Le[1]}function R(){var Le=D,Je=O,st=u(!0),Et=null,It=E,Zt=null;function Kt(Ht){var mn,zn,pn,tn=Ht.length,nn=!1;for(Et==null&&(Zt=It(pn=a.path())),mn=0;mn<=tn;++mn)!(mn=nn;--sn)Ht.point(Wn[sn],ar[sn]);Ht.lineEnd(),Ht.areaEnd()}Hn&&(Wn[tn]=+Le(gn,tn,pn),ar[tn]=+st(gn,tn,pn),Ht.point(Je?+Je(gn,tn,pn):Wn[tn],Et?+Et(gn,tn,pn):ar[tn]))}if(bn)return Ht=null,bn+""||null}function zn(){return R().defined(It).curve(Kt).context(Zt)}return mn.x=function(pn){return arguments.length?(Le=typeof pn=="function"?pn:u(+pn),Je=null,mn):Le},mn.x0=function(pn){return arguments.length?(Le=typeof pn=="function"?pn:u(+pn),mn):Le},mn.x1=function(pn){return arguments.length?(Je=pn==null?null:typeof pn=="function"?pn:u(+pn),mn):Je},mn.y=function(pn){return arguments.length?(st=typeof pn=="function"?pn:u(+pn),Et=null,mn):st},mn.y0=function(pn){return arguments.length?(st=typeof pn=="function"?pn:u(+pn),mn):st},mn.y1=function(pn){return arguments.length?(Et=pn==null?null:typeof pn=="function"?pn:u(+pn),mn):Et},mn.lineX0=mn.lineY0=function(){return zn().x(Le).y(st)},mn.lineY1=function(){return zn().x(Le).y(Et)},mn.lineX1=function(){return zn().x(Je).y(st)},mn.defined=function(pn){return arguments.length?(It=typeof pn=="function"?pn:u(!!pn),mn):It},mn.curve=function(pn){return arguments.length?(Kt=pn,Zt!=null&&(Ht=Kt(Zt)),mn):Kt},mn.context=function(pn){return arguments.length?(pn==null?Zt=Ht=null:Ht=Kt(Zt=pn),mn):Zt},mn}function L(Le,Je){return JeLe?1:Je>=Le?0:NaN}function P(Le){return Le}S.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Le,Je){switch(Le=+Le,Je=+Je,this._point){case 0:this._point=1,this._line?this._context.lineTo(Le,Je):this._context.moveTo(Le,Je);break;case 1:this._point=2;default:this._context.lineTo(Le,Je)}}};var N=G(E);function B(Le){this._curve=Le}function G(Le){function Je(st){return new B(Le(st))}return Je._curve=Le,Je}function W(Le){var Je=Le.curve;return Le.angle=Le.x,delete Le.x,Le.radius=Le.y,delete Le.y,Le.curve=function(st){return arguments.length?Je(G(st)):Je()._curve},Le}function K(){return W(R().curve(N))}function te(){var Le=z().curve(N),Je=Le.curve,st=Le.lineX0,Et=Le.lineX1,It=Le.lineY0,Zt=Le.lineY1;return Le.angle=Le.x,delete Le.x,Le.startAngle=Le.x0,delete Le.x0,Le.endAngle=Le.x1,delete Le.x1,Le.radius=Le.y,delete Le.y,Le.innerRadius=Le.y0,delete Le.y0,Le.outerRadius=Le.y1,delete Le.y1,Le.lineStartAngle=function(){return W(st())},delete Le.lineX0,Le.lineEndAngle=function(){return W(Et())},delete Le.lineX1,Le.lineInnerRadius=function(){return W(It())},delete Le.lineY0,Le.lineOuterRadius=function(){return W(Zt())},delete Le.lineY1,Le.curve=function(Kt){return arguments.length?Je(G(Kt)):Je()._curve},Le}function Y(Le,Je){return[(Je=+Je)*Math.cos(Le-=Math.PI/2),Je*Math.sin(Le)]}B.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(Le,Je){this._curve.point(Je*Math.sin(Le),Je*-Math.cos(Le))}};var Z=Array.prototype.slice;function re(Le){return Le.source}function U(Le){return Le.target}function q(Le){var Je=re,st=U,Et=D,It=O,Zt=null;function Kt(){var Ht,mn=Z.call(arguments),zn=Je.apply(this,mn),pn=st.apply(this,mn);if(Zt||(Zt=Ht=a.path()),Le(Zt,+Et.apply(this,(mn[0]=zn,mn)),+It.apply(this,mn),+Et.apply(this,(mn[0]=pn,mn)),+It.apply(this,mn)),Ht)return Zt=null,Ht+""||null}return Kt.source=function(Ht){return arguments.length?(Je=Ht,Kt):Je},Kt.target=function(Ht){return arguments.length?(st=Ht,Kt):st},Kt.x=function(Ht){return arguments.length?(Et=typeof Ht=="function"?Ht:u(+Ht),Kt):Et},Kt.y=function(Ht){return arguments.length?(It=typeof Ht=="function"?Ht:u(+Ht),Kt):It},Kt.context=function(Ht){return arguments.length?(Zt=Ht??null,Kt):Zt},Kt}function $(Le,Je,st,Et,It){Le.moveTo(Je,st),Le.bezierCurveTo(Je=(Je+Et)/2,st,Je,It,Et,It)}function ne(Le,Je,st,Et,It){Le.moveTo(Je,st),Le.bezierCurveTo(Je,st=(st+It)/2,Et,st,Et,It)}function H(Le,Je,st,Et,It){var Zt=Y(Je,st),Kt=Y(Je,st=(st+It)/2),Ht=Y(Et,st),mn=Y(Et,It);Le.moveTo(Zt[0],Zt[1]),Le.bezierCurveTo(Kt[0],Kt[1],Ht[0],Ht[1],mn[0],mn[1])}var Q={draw:function(Le,Je){var st=Math.sqrt(Je/g);Le.moveTo(st,0),Le.arc(0,0,st,0,v)}},ee={draw:function(Le,Je){var st=Math.sqrt(Je/5)/2;Le.moveTo(-3*st,-st),Le.lineTo(-st,-st),Le.lineTo(-st,-3*st),Le.lineTo(st,-3*st),Le.lineTo(st,-st),Le.lineTo(3*st,-st),Le.lineTo(3*st,st),Le.lineTo(st,st),Le.lineTo(st,3*st),Le.lineTo(-st,3*st),Le.lineTo(-st,st),Le.lineTo(-3*st,st),Le.closePath()}},ie=Math.sqrt(1/3),ae=2*ie,ue={draw:function(Le,Je){var st=Math.sqrt(Je/ae),Et=st*ie;Le.moveTo(0,-st),Le.lineTo(Et,0),Le.lineTo(0,st),Le.lineTo(-Et,0),Le.closePath()}},le=Math.sin(g/10)/Math.sin(7*g/10),ge=Math.sin(v/10)*le,fe=-Math.cos(v/10)*le,me={draw:function(Le,Je){var st=Math.sqrt(.8908130915292852*Je),Et=ge*st,It=fe*st;Le.moveTo(0,-st),Le.lineTo(Et,It);for(var Zt=1;Zt<5;++Zt){var Kt=v*Zt/5,Ht=Math.cos(Kt),mn=Math.sin(Kt);Le.lineTo(mn*st,-Ht*st),Le.lineTo(Ht*Et-mn*It,mn*Et+Ht*It)}Le.closePath()}},_e={draw:function(Le,Je){var st=Math.sqrt(Je),Et=-st/2;Le.rect(Et,Et,st,st)}},we=Math.sqrt(3),Te={draw:function(Le,Je){var st=-Math.sqrt(Je/(3*we));Le.moveTo(0,2*st),Le.lineTo(-we*st,-st),Le.lineTo(we*st,-st),Le.closePath()}},Oe=-.5,de=Math.sqrt(3)/2,ye=1/Math.sqrt(12),Me=3*(ye/2+1),ke={draw:function(Le,Je){var st=Math.sqrt(Je/Me),Et=st/2,It=st*ye,Zt=Et,Kt=st*ye+st,Ht=-Zt,mn=Kt;Le.moveTo(Et,It),Le.lineTo(Zt,Kt),Le.lineTo(Ht,mn),Le.lineTo(Oe*Et-de*It,de*Et+Oe*It),Le.lineTo(Oe*Zt-de*Kt,de*Zt+Oe*Kt),Le.lineTo(Oe*Ht-de*mn,de*Ht+Oe*mn),Le.lineTo(Oe*Et+de*It,Oe*It-de*Et),Le.lineTo(Oe*Zt+de*Kt,Oe*Kt-de*Zt),Le.lineTo(Oe*Ht+de*mn,Oe*mn-de*Ht),Le.closePath()}},Ee=[Q,ee,ue,_e,me,Te,ke];function ze(){}function Fe(Le,Je,st){Le._context.bezierCurveTo((2*Le._x0+Le._x1)/3,(2*Le._y0+Le._y1)/3,(Le._x0+2*Le._x1)/3,(Le._y0+2*Le._y1)/3,(Le._x0+4*Le._x1+Je)/6,(Le._y0+4*Le._y1+st)/6)}function Ve(Le){this._context=Le}function Ke(Le){this._context=Le}function Re(Le){this._context=Le}function qe(Le,Je){this._basis=new Ve(Le),this._beta=Je}Ve.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Fe(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Le,Je){switch(Le=+Le,Je=+Je,this._point){case 0:this._point=1,this._line?this._context.lineTo(Le,Je):this._context.moveTo(Le,Je);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Fe(this,Le,Je)}this._x0=this._x1,this._x1=Le,this._y0=this._y1,this._y1=Je}},Ke.prototype={areaStart:ze,areaEnd:ze,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(Le,Je){switch(Le=+Le,Je=+Je,this._point){case 0:this._point=1,this._x2=Le,this._y2=Je;break;case 1:this._point=2,this._x3=Le,this._y3=Je;break;case 2:this._point=3,this._x4=Le,this._y4=Je,this._context.moveTo((this._x0+4*this._x1+Le)/6,(this._y0+4*this._y1+Je)/6);break;default:Fe(this,Le,Je)}this._x0=this._x1,this._x1=Le,this._y0=this._y1,this._y1=Je}},Re.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(Le,Je){switch(Le=+Le,Je=+Je,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var st=(this._x0+4*this._x1+Le)/6,Et=(this._y0+4*this._y1+Je)/6;this._line?this._context.lineTo(st,Et):this._context.moveTo(st,Et);break;case 3:this._point=4;default:Fe(this,Le,Je)}this._x0=this._x1,this._x1=Le,this._y0=this._y1,this._y1=Je}},qe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var Le=this._x,Je=this._y,st=Le.length-1;if(st>0)for(var Et,It=Le[0],Zt=Je[0],Kt=Le[st]-It,Ht=Je[st]-Zt,mn=-1;++mn<=st;)Et=mn/st,this._basis.point(this._beta*Le[mn]+(1-this._beta)*(It+Et*Kt),this._beta*Je[mn]+(1-this._beta)*(Zt+Et*Ht));this._x=this._y=null,this._basis.lineEnd()},point:function(Le,Je){this._x.push(+Le),this._y.push(+Je)}};var We=function Le(Je){function st(Et){return Je===1?new Ve(Et):new qe(Et,Je)}return st.beta=function(Et){return Le(+Et)},st}(.85);function Ye(Le,Je,st){Le._context.bezierCurveTo(Le._x1+Le._k*(Le._x2-Le._x0),Le._y1+Le._k*(Le._y2-Le._y0),Le._x2+Le._k*(Le._x1-Je),Le._y2+Le._k*(Le._y1-st),Le._x2,Le._y2)}function nt(Le,Je){this._context=Le,this._k=(1-Je)/6}nt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ye(this,this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Le,Je){switch(Le=+Le,Je=+Je,this._point){case 0:this._point=1,this._line?this._context.lineTo(Le,Je):this._context.moveTo(Le,Je);break;case 1:this._point=2,this._x1=Le,this._y1=Je;break;case 2:this._point=3;default:Ye(this,Le,Je)}this._x0=this._x1,this._x1=this._x2,this._x2=Le,this._y0=this._y1,this._y1=this._y2,this._y2=Je}};var ft=function Le(Je){function st(Et){return new nt(Et,Je)}return st.tension=function(Et){return Le(+Et)},st}(0);function vt(Le,Je){this._context=Le,this._k=(1-Je)/6}vt.prototype={areaStart:ze,areaEnd:ze,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(Le,Je){switch(Le=+Le,Je=+Je,this._point){case 0:this._point=1,this._x3=Le,this._y3=Je;break;case 1:this._point=2,this._context.moveTo(this._x4=Le,this._y4=Je);break;case 2:this._point=3,this._x5=Le,this._y5=Je;break;default:Ye(this,Le,Je)}this._x0=this._x1,this._x1=this._x2,this._x2=Le,this._y0=this._y1,this._y1=this._y2,this._y2=Je}};var Pt=function Le(Je){function st(Et){return new vt(Et,Je)}return st.tension=function(Et){return Le(+Et)},st}(0);function At(Le,Je){this._context=Le,this._k=(1-Je)/6}At.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(Le,Je){switch(Le=+Le,Je=+Je,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ye(this,Le,Je)}this._x0=this._x1,this._x1=this._x2,this._x2=Le,this._y0=this._y1,this._y1=this._y2,this._y2=Je}};var at=function Le(Je){function st(Et){return new At(Et,Je)}return st.tension=function(Et){return Le(+Et)},st}(0);function et(Le,Je,st){var Et=Le._x1,It=Le._y1,Zt=Le._x2,Kt=Le._y2;if(Le._l01_a>1e-12){var Ht=2*Le._l01_2a+3*Le._l01_a*Le._l12_a+Le._l12_2a,mn=3*Le._l01_a*(Le._l01_a+Le._l12_a);Et=(Et*Ht-Le._x0*Le._l12_2a+Le._x2*Le._l01_2a)/mn,It=(It*Ht-Le._y0*Le._l12_2a+Le._y2*Le._l01_2a)/mn}if(Le._l23_a>1e-12){var zn=2*Le._l23_2a+3*Le._l23_a*Le._l12_a+Le._l12_2a,pn=3*Le._l23_a*(Le._l23_a+Le._l12_a);Zt=(Zt*zn+Le._x1*Le._l23_2a-Je*Le._l12_2a)/pn,Kt=(Kt*zn+Le._y1*Le._l23_2a-st*Le._l12_2a)/pn}Le._context.bezierCurveTo(Et,It,Zt,Kt,Le._x2,Le._y2)}function Ot(Le,Je){this._context=Le,this._alpha=Je}Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Le,Je){if(Le=+Le,Je=+Je,this._point){var st=this._x2-Le,Et=this._y2-Je;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(st*st+Et*Et,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Le,Je):this._context.moveTo(Le,Je);break;case 1:this._point=2;break;case 2:this._point=3;default:et(this,Le,Je)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=Le,this._y0=this._y1,this._y1=this._y2,this._y2=Je}};var Wt=function Le(Je){function st(Et){return Je?new Ot(Et,Je):new nt(Et,0)}return st.alpha=function(Et){return Le(+Et)},st}(.5);function Jt(Le,Je){this._context=Le,this._alpha=Je}Jt.prototype={areaStart:ze,areaEnd:ze,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(Le,Je){if(Le=+Le,Je=+Je,this._point){var st=this._x2-Le,Et=this._y2-Je;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(st*st+Et*Et,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=Le,this._y3=Je;break;case 1:this._point=2,this._context.moveTo(this._x4=Le,this._y4=Je);break;case 2:this._point=3,this._x5=Le,this._y5=Je;break;default:et(this,Le,Je)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=Le,this._y0=this._y1,this._y1=this._y2,this._y2=Je}};var Be=function Le(Je){function st(Et){return Je?new Jt(Et,Je):new vt(Et,0)}return st.alpha=function(Et){return Le(+Et)},st}(.5);function Ge(Le,Je){this._context=Le,this._alpha=Je}Ge.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(Le,Je){if(Le=+Le,Je=+Je,this._point){var st=this._x2-Le,Et=this._y2-Je;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(st*st+Et*Et,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:et(this,Le,Je)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=Le,this._y0=this._y1,this._y1=this._y2,this._y2=Je}};var Tt=function Le(Je){function st(Et){return Je?new Ge(Et,Je):new At(Et,0)}return st.alpha=function(Et){return Le(+Et)},st}(.5);function dt(Le){this._context=Le}function Pe(Le){return Le<0?-1:1}function Ie(Le,Je,st){var Et=Le._x1-Le._x0,It=Je-Le._x1,Zt=(Le._y1-Le._y0)/(Et||It<0&&-0),Kt=(st-Le._y1)/(It||Et<0&&-0),Ht=(Zt*It+Kt*Et)/(Et+It);return(Pe(Zt)+Pe(Kt))*Math.min(Math.abs(Zt),Math.abs(Kt),.5*Math.abs(Ht))||0}function Ae(Le,Je){var st=Le._x1-Le._x0;return st?(3*(Le._y1-Le._y0)/st-Je)/2:Je}function De(Le,Je,st){var Et=Le._x0,It=Le._y0,Zt=Le._x1,Kt=Le._y1,Ht=(Zt-Et)/3;Le._context.bezierCurveTo(Et+Ht,It+Ht*Je,Zt-Ht,Kt-Ht*st,Zt,Kt)}function He(Le){this._context=Le}function rt(Le){this._context=new lt(Le)}function lt(Le){this._context=Le}function ot(Le){this._context=Le}function kt(Le){var Je,st,Et=Le.length-1,It=new Array(Et),Zt=new Array(Et),Kt=new Array(Et);for(It[0]=0,Zt[0]=2,Kt[0]=Le[0]+2*Le[1],Je=1;Je=0;--Je)It[Je]=(Kt[Je]-It[Je+1])/Zt[Je];for(Zt[Et-1]=(Le[Et]+It[Et-1])/2,Je=0;Je1)for(var st,Et,It,Zt=1,Kt=Le[Je[0]],Ht=Kt.length;Zt=0;)st[Je]=Je;return st}function tt(Le,Je){return Le[Je]}function bt(Le){var Je=Le.map(zt);return Ut(Le).sort(function(st,Et){return Je[st]-Je[Et]})}function zt(Le){for(var Je,st=-1,Et=0,It=Le.length,Zt=-1/0;++stZt&&(Zt=Je,Et=st);return Et}function St(Le){var Je=Le.map(Dt);return Ut(Le).sort(function(st,Et){return Je[st]-Je[Et]})}function Dt(Le){for(var Je,st=0,Et=-1,It=Le.length;++Et=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(Le,Je){switch(Le=+Le,Je=+Je,this._point){case 0:this._point=1,this._line?this._context.lineTo(Le,Je):this._context.moveTo(Le,Je);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,Je),this._context.lineTo(Le,Je);else{var st=this._x*(1-this._t)+Le*this._t;this._context.lineTo(st,this._y),this._context.lineTo(st,Je)}}this._x=Le,this._y=Je}},r.arc=function(){var Le=w,Je=k,st=u(0),Et=null,It=b,Zt=T,Kt=_,Ht=null;function mn(){var zn,pn,tn=+Le.apply(this,arguments),nn=+Je.apply(this,arguments),sn=It.apply(this,arguments)-p,gn=Zt.apply(this,arguments)-p,bn=c(gn-sn),In=gn>sn;if(Ht||(Ht=zn=a.path()),nn1e-12)if(bn>v-1e-12)Ht.moveTo(nn*s(sn),nn*h(sn)),Ht.arc(0,0,nn,sn,gn,!In),tn>1e-12&&(Ht.moveTo(tn*s(gn),tn*h(gn)),Ht.arc(0,0,tn,gn,sn,In));else{var Hn,Wn,ar=sn,Or=gn,vr=sn,Er=gn,Kn=bn,Ln=bn,lr=Kt.apply(this,arguments)/2,Wr=lr>1e-12&&(Et?+Et.apply(this,arguments):m(tn*tn+nn*nn)),Mn=d(c(nn-tn)/2,+st.apply(this,arguments)),rr=Mn,nr=Mn;if(Wr>1e-12){var Bn=x(Wr/tn*h(lr)),Fr=x(Wr/nn*h(lr));(Kn-=2*Bn)>1e-12?(vr+=Bn*=In?1:-1,Er-=Bn):(Kn=0,vr=Er=(sn+gn)/2),(Ln-=2*Fr)>1e-12?(ar+=Fr*=In?1:-1,Or-=Fr):(Ln=0,ar=Or=(sn+gn)/2)}var $r=nn*s(ar),pr=nn*h(ar),qr=tn*s(Er),_i=tn*h(Er);if(Mn>1e-12){var cn,jn=nn*s(Or),jt=nn*h(Or),fn=tn*s(vr),yn=tn*h(vr);if(bn1e-12?nr>1e-12?(Hn=A(fn,yn,$r,pr,nn,nr,In),Wn=A(jn,jt,qr,_i,nn,nr,In),Ht.moveTo(Hn.cx+Hn.x01,Hn.cy+Hn.y01),nr1e-12&&Kn>1e-12?rr>1e-12?(Hn=A(qr,_i,jn,jt,tn,-rr,In),Wn=A($r,pr,fn,yn,tn,-rr,In),Ht.lineTo(Hn.cx+Hn.x01,Hn.cy+Hn.y01),rr0&&(gn+=nn);for(Je!=null?bn.sort(function(vr,Er){return Je(In[vr],In[Er])}):st!=null&&bn.sort(function(vr,Er){return st(Ht[vr],Ht[Er])}),mn=0,pn=gn?(Wn-sn*Or)/gn:0;mn0?nn*pn:0)+Or,In[zn]={data:Ht[zn],index:mn,value:nn,startAngle:Hn,endAngle:tn,padAngle:ar};return In}return Kt.value=function(Ht){return arguments.length?(Le=typeof Ht=="function"?Ht:u(+Ht),Kt):Le},Kt.sortValues=function(Ht){return arguments.length?(Je=Ht,st=null,Kt):Je},Kt.sort=function(Ht){return arguments.length?(st=Ht,Je=null,Kt):st},Kt.startAngle=function(Ht){return arguments.length?(Et=typeof Ht=="function"?Ht:u(+Ht),Kt):Et},Kt.endAngle=function(Ht){return arguments.length?(It=typeof Ht=="function"?Ht:u(+Ht),Kt):It},Kt.padAngle=function(Ht){return arguments.length?(Zt=typeof Ht=="function"?Ht:u(+Ht),Kt):Zt},Kt},r.pointRadial=Y,r.radialArea=te,r.radialLine=K,r.stack=function(){var Le=u([]),Je=Ut,st=Vt,Et=tt;function It(Zt){var Kt,Ht,mn=Le.apply(this,arguments),zn=Zt.length,pn=mn.length,tn=new Array(pn);for(Kt=0;Kt0)for(var st,Et,It,Zt,Kt,Ht,mn=0,zn=Le[Je[0]].length;mn0?(Et[0]=Zt,Et[1]=Zt+=It):It<0?(Et[1]=Kt,Et[0]=Kt+=It):(Et[0]=0,Et[1]=It)},r.stackOffsetExpand=function(Le,Je){if((Et=Le.length)>0){for(var st,Et,It,Zt=0,Kt=Le[0].length;Zt0){for(var st,Et=0,It=Le[Je[0]],Zt=It.length;Et0&&(Et=(st=Le[Je[0]]).length)>0){for(var st,Et,It,Zt=0,Kt=1;Kt=12)]},q:function(Dt){return 1+~~(Dt.getMonth()/3)},Q:nt,s:ft,S:H,u:Q,U:ee,V:ie,w:ae,W:ue,x:null,X:null,y:le,Y:ge,Z:fe,"%":Ye},Ut={a:function(Dt){return Ge[Dt.getUTCDay()]},A:function(Dt){return Be[Dt.getUTCDay()]},b:function(Dt){return dt[Dt.getUTCMonth()]},B:function(Dt){return Tt[Dt.getUTCMonth()]},c:null,d:me,e:me,f:de,H:_e,I:we,j:Te,L:Oe,m:ye,M:Me,p:function(Dt){return Jt[+(Dt.getUTCHours()>=12)]},q:function(Dt){return 1+~~(Dt.getUTCMonth()/3)},Q:nt,s:ft,S:ke,u:Ee,U:ze,V:Fe,w:Ve,W:Ke,x:null,X:null,y:Re,Y:qe,Z:We,"%":Ye},tt={a:function(Dt,Le,Je){var st=He.exec(Le.slice(Je));return st?(Dt.w=rt[st[0].toLowerCase()],Je+st[0].length):-1},A:function(Dt,Le,Je){var st=Ae.exec(Le.slice(Je));return st?(Dt.w=De[st[0].toLowerCase()],Je+st[0].length):-1},b:function(Dt,Le,Je){var st=kt.exec(Le.slice(Je));return st?(Dt.m=wt[st[0].toLowerCase()],Je+st[0].length):-1},B:function(Dt,Le,Je){var st=lt.exec(Le.slice(Je));return st?(Dt.m=ot[st[0].toLowerCase()],Je+st[0].length):-1},c:function(Dt,Le,Je){return St(Dt,et,Le,Je)},d:O,e:O,f:B,H:z,I:z,j:R,L:N,m:D,M:L,p:function(Dt,Le,Je){var st=Pe.exec(Le.slice(Je));return st?(Dt.p=Ie[st[0].toLowerCase()],Je+st[0].length):-1},q:E,Q:W,s:K,S:P,u:k,U:b,V:T,w,W:_,x:function(Dt,Le,Je){return St(Dt,Ot,Le,Je)},X:function(Dt,Le,Je){return St(Dt,Wt,Le,Je)},y:A,Y:M,Z:S,"%":G};function bt(Dt,Le){return function(Je){var st,Et,It,Zt=[],Kt=-1,Ht=0,mn=Dt.length;for(Je instanceof Date||(Je=new Date(+Je));++Kt53)return null;"w"in It||(It.w=1),"Z"in It?(Et=(st=c(i(It.y,0,1))).getUTCDay(),st=Et>4||Et===0?a.utcMonday.ceil(st):a.utcMonday(st),st=a.utcDay.offset(st,7*(It.V-1)),It.y=st.getUTCFullYear(),It.m=st.getUTCMonth(),It.d=st.getUTCDate()+(It.w+6)%7):(Et=(st=u(i(It.y,0,1))).getDay(),st=Et>4||Et===0?a.timeMonday.ceil(st):a.timeMonday(st),st=a.timeDay.offset(st,7*(It.V-1)),It.y=st.getFullYear(),It.m=st.getMonth(),It.d=st.getDate()+(It.w+6)%7)}else("W"in It||"U"in It)&&("w"in It||(It.w="u"in It?It.u%7:"W"in It?1:0),Et="Z"in It?c(i(It.y,0,1)).getUTCDay():u(i(It.y,0,1)).getDay(),It.m=0,It.d="W"in It?(It.w+6)%7+7*It.W-(Et+5)%7:It.w+7*It.U-(Et+6)%7);return"Z"in It?(It.H+=It.Z/100|0,It.M+=It.Z%100,c(It)):u(It)}}function St(Dt,Le,Je,st){for(var Et,It,Zt=0,Kt=Le.length,Ht=Je.length;Zt=Ht)return-1;if((Et=Le.charCodeAt(Zt++))===37){if(Et=Le.charAt(Zt++),!(It=tt[Et in d?Le.charAt(Zt++):Et])||(st=It(Dt,Je,st))<0)return-1}else if(Et!=Je.charCodeAt(st++))return-1}return st}return Vt.x=bt(Ot,Vt),Vt.X=bt(Wt,Vt),Vt.c=bt(et,Vt),Ut.x=bt(Ot,Ut),Ut.X=bt(Wt,Ut),Ut.c=bt(et,Ut),{format:function(Dt){var Le=bt(Dt+="",Vt);return Le.toString=function(){return Dt},Le},parse:function(Dt){var Le=zt(Dt+="",!1);return Le.toString=function(){return Dt},Le},utcFormat:function(Dt){var Le=bt(Dt+="",Ut);return Le.toString=function(){return Dt},Le},utcParse:function(Dt){var Le=zt(Dt+="",!0);return Le.toString=function(){return Dt},Le}}}var l,d={"-":"",_:" ",0:"0"},h=/^\s*\d+/,m=/^%/,g=/[\\^$*+?|[\]().{}]/g;function p(at,et,Ot){var Wt=at<0?"-":"",Jt=(Wt?-at:at)+"",Be=Jt.length;return Wt+(Be68?1900:2e3),Ot+Wt[0].length):-1}function S(at,et,Ot){var Wt=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(et.slice(Ot,Ot+6));return Wt?(at.Z=Wt[1]?0:-(Wt[2]+(Wt[3]||"00")),Ot+Wt[0].length):-1}function E(at,et,Ot){var Wt=h.exec(et.slice(Ot,Ot+1));return Wt?(at.q=3*Wt[0]-3,Ot+Wt[0].length):-1}function D(at,et,Ot){var Wt=h.exec(et.slice(Ot,Ot+2));return Wt?(at.m=Wt[0]-1,Ot+Wt[0].length):-1}function O(at,et,Ot){var Wt=h.exec(et.slice(Ot,Ot+2));return Wt?(at.d=+Wt[0],Ot+Wt[0].length):-1}function R(at,et,Ot){var Wt=h.exec(et.slice(Ot,Ot+3));return Wt?(at.m=0,at.d=+Wt[0],Ot+Wt[0].length):-1}function z(at,et,Ot){var Wt=h.exec(et.slice(Ot,Ot+2));return Wt?(at.H=+Wt[0],Ot+Wt[0].length):-1}function L(at,et,Ot){var Wt=h.exec(et.slice(Ot,Ot+2));return Wt?(at.M=+Wt[0],Ot+Wt[0].length):-1}function P(at,et,Ot){var Wt=h.exec(et.slice(Ot,Ot+2));return Wt?(at.S=+Wt[0],Ot+Wt[0].length):-1}function N(at,et,Ot){var Wt=h.exec(et.slice(Ot,Ot+3));return Wt?(at.L=+Wt[0],Ot+Wt[0].length):-1}function B(at,et,Ot){var Wt=h.exec(et.slice(Ot,Ot+6));return Wt?(at.L=Math.floor(Wt[0]/1e3),Ot+Wt[0].length):-1}function G(at,et,Ot){var Wt=m.exec(et.slice(Ot,Ot+1));return Wt?Ot+Wt[0].length:-1}function W(at,et,Ot){var Wt=h.exec(et.slice(Ot));return Wt?(at.Q=+Wt[0],Ot+Wt[0].length):-1}function K(at,et,Ot){var Wt=h.exec(et.slice(Ot));return Wt?(at.s=+Wt[0],Ot+Wt[0].length):-1}function te(at,et){return p(at.getDate(),et,2)}function Y(at,et){return p(at.getHours(),et,2)}function Z(at,et){return p(at.getHours()%12||12,et,2)}function re(at,et){return p(1+a.timeDay.count(a.timeYear(at),at),et,3)}function U(at,et){return p(at.getMilliseconds(),et,3)}function q(at,et){return U(at,et)+"000"}function $(at,et){return p(at.getMonth()+1,et,2)}function ne(at,et){return p(at.getMinutes(),et,2)}function H(at,et){return p(at.getSeconds(),et,2)}function Q(at){var et=at.getDay();return et===0?7:et}function ee(at,et){return p(a.timeSunday.count(a.timeYear(at)-1,at),et,2)}function ie(at,et){var Ot=at.getDay();return at=Ot>=4||Ot===0?a.timeThursday(at):a.timeThursday.ceil(at),p(a.timeThursday.count(a.timeYear(at),at)+(a.timeYear(at).getDay()===4),et,2)}function ae(at){return at.getDay()}function ue(at,et){return p(a.timeMonday.count(a.timeYear(at)-1,at),et,2)}function le(at,et){return p(at.getFullYear()%100,et,2)}function ge(at,et){return p(at.getFullYear()%1e4,et,4)}function fe(at){var et=at.getTimezoneOffset();return(et>0?"-":(et*=-1,"+"))+p(et/60|0,"0",2)+p(et%60,"0",2)}function me(at,et){return p(at.getUTCDate(),et,2)}function _e(at,et){return p(at.getUTCHours(),et,2)}function we(at,et){return p(at.getUTCHours()%12||12,et,2)}function Te(at,et){return p(1+a.utcDay.count(a.utcYear(at),at),et,3)}function Oe(at,et){return p(at.getUTCMilliseconds(),et,3)}function de(at,et){return Oe(at,et)+"000"}function ye(at,et){return p(at.getUTCMonth()+1,et,2)}function Me(at,et){return p(at.getUTCMinutes(),et,2)}function ke(at,et){return p(at.getUTCSeconds(),et,2)}function Ee(at){var et=at.getUTCDay();return et===0?7:et}function ze(at,et){return p(a.utcSunday.count(a.utcYear(at)-1,at),et,2)}function Fe(at,et){var Ot=at.getUTCDay();return at=Ot>=4||Ot===0?a.utcThursday(at):a.utcThursday.ceil(at),p(a.utcThursday.count(a.utcYear(at),at)+(a.utcYear(at).getUTCDay()===4),et,2)}function Ve(at){return at.getUTCDay()}function Ke(at,et){return p(a.utcMonday.count(a.utcYear(at)-1,at),et,2)}function Re(at,et){return p(at.getUTCFullYear()%100,et,2)}function qe(at,et){return p(at.getUTCFullYear()%1e4,et,4)}function We(){return"+0000"}function Ye(){return"%"}function nt(at){return+at}function ft(at){return Math.floor(+at/1e3)}function vt(at){return l=s(at),r.timeFormat=l.format,r.timeParse=l.parse,r.utcFormat=l.utcFormat,r.utcParse=l.utcParse,l}vt({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"]});var Pt=Date.prototype.toISOString?function(at){return at.toISOString()}:r.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ"),At=+new Date("2000-01-01T00:00:00.000Z")?function(at){var et=new Date(at);return isNaN(et)?null:et}:r.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");r.isoFormat=Pt,r.isoParse=At,r.timeFormatDefaultLocale=vt,r.timeFormatLocale=s,Object.defineProperty(r,"__esModule",{value:!0})})},{"d3-time":121}],121:[function(e,o,f){(function(r,a){a(typeof f=="object"&&o!==void 0?f:(r=r||self).d3=r.d3||{})})(this,function(r){var a=new Date,u=new Date;function c(ye,Me,ke,Ee){function ze(Fe){return ye(Fe=arguments.length===0?new Date:new Date(+Fe)),Fe}return ze.floor=function(Fe){return ye(Fe=new Date(+Fe)),Fe},ze.ceil=function(Fe){return ye(Fe=new Date(Fe-1)),Me(Fe,1),ye(Fe),Fe},ze.round=function(Fe){var Ve=ze(Fe),Ke=ze.ceil(Fe);return Fe-Ve0))return qe;do qe.push(Re=new Date(+Fe)),Me(Fe,Ke),ye(Fe);while(Re=Ve)for(;ye(Ve),!Fe(Ve);)Ve.setTime(Ve-1)},function(Ve,Ke){if(Ve>=Ve)if(Ke<0)for(;++Ke<=0;)for(;Me(Ve,-1),!Fe(Ve););else for(;--Ke>=0;)for(;Me(Ve,1),!Fe(Ve););})},ke&&(ze.count=function(Fe,Ve){return a.setTime(+Fe),u.setTime(+Ve),ye(a),ye(u),Math.floor(ke(a,u))},ze.every=function(Fe){return Fe=Math.floor(Fe),isFinite(Fe)&&Fe>0?Fe>1?ze.filter(Ee?function(Ve){return Ee(Ve)%Fe==0}:function(Ve){return ze.count(0,Ve)%Fe==0}):ze:null}),ze}var i=c(function(){},function(ye,Me){ye.setTime(+ye+Me)},function(ye,Me){return Me-ye});i.every=function(ye){return ye=Math.floor(ye),isFinite(ye)&&ye>0?ye>1?c(function(Me){Me.setTime(Math.floor(Me/ye)*ye)},function(Me,ke){Me.setTime(+Me+ke*ye)},function(Me,ke){return(ke-Me)/ye}):i:null};var s=i.range,l=c(function(ye){ye.setTime(ye-ye.getMilliseconds())},function(ye,Me){ye.setTime(+ye+1e3*Me)},function(ye,Me){return(Me-ye)/1e3},function(ye){return ye.getUTCSeconds()}),d=l.range,h=c(function(ye){ye.setTime(ye-ye.getMilliseconds()-1e3*ye.getSeconds())},function(ye,Me){ye.setTime(+ye+6e4*Me)},function(ye,Me){return(Me-ye)/6e4},function(ye){return ye.getMinutes()}),m=h.range,g=c(function(ye){ye.setTime(ye-ye.getMilliseconds()-1e3*ye.getSeconds()-6e4*ye.getMinutes())},function(ye,Me){ye.setTime(+ye+36e5*Me)},function(ye,Me){return(Me-ye)/36e5},function(ye){return ye.getHours()}),p=g.range,v=c(function(ye){ye.setHours(0,0,0,0)},function(ye,Me){ye.setDate(ye.getDate()+Me)},function(ye,Me){return(Me-ye-6e4*(Me.getTimezoneOffset()-ye.getTimezoneOffset()))/864e5},function(ye){return ye.getDate()-1}),y=v.range;function x(ye){return c(function(Me){Me.setDate(Me.getDate()-(Me.getDay()+7-ye)%7),Me.setHours(0,0,0,0)},function(Me,ke){Me.setDate(Me.getDate()+7*ke)},function(Me,ke){return(ke-Me-6e4*(ke.getTimezoneOffset()-Me.getTimezoneOffset()))/6048e5})}var w=x(0),k=x(1),b=x(2),T=x(3),_=x(4),M=x(5),A=x(6),S=w.range,E=k.range,D=b.range,O=T.range,R=_.range,z=M.range,L=A.range,P=c(function(ye){ye.setDate(1),ye.setHours(0,0,0,0)},function(ye,Me){ye.setMonth(ye.getMonth()+Me)},function(ye,Me){return Me.getMonth()-ye.getMonth()+12*(Me.getFullYear()-ye.getFullYear())},function(ye){return ye.getMonth()}),N=P.range,B=c(function(ye){ye.setMonth(0,1),ye.setHours(0,0,0,0)},function(ye,Me){ye.setFullYear(ye.getFullYear()+Me)},function(ye,Me){return Me.getFullYear()-ye.getFullYear()},function(ye){return ye.getFullYear()});B.every=function(ye){return isFinite(ye=Math.floor(ye))&&ye>0?c(function(Me){Me.setFullYear(Math.floor(Me.getFullYear()/ye)*ye),Me.setMonth(0,1),Me.setHours(0,0,0,0)},function(Me,ke){Me.setFullYear(Me.getFullYear()+ke*ye)}):null};var G=B.range,W=c(function(ye){ye.setUTCSeconds(0,0)},function(ye,Me){ye.setTime(+ye+6e4*Me)},function(ye,Me){return(Me-ye)/6e4},function(ye){return ye.getUTCMinutes()}),K=W.range,te=c(function(ye){ye.setUTCMinutes(0,0,0)},function(ye,Me){ye.setTime(+ye+36e5*Me)},function(ye,Me){return(Me-ye)/36e5},function(ye){return ye.getUTCHours()}),Y=te.range,Z=c(function(ye){ye.setUTCHours(0,0,0,0)},function(ye,Me){ye.setUTCDate(ye.getUTCDate()+Me)},function(ye,Me){return(Me-ye)/864e5},function(ye){return ye.getUTCDate()-1}),re=Z.range;function U(ye){return c(function(Me){Me.setUTCDate(Me.getUTCDate()-(Me.getUTCDay()+7-ye)%7),Me.setUTCHours(0,0,0,0)},function(Me,ke){Me.setUTCDate(Me.getUTCDate()+7*ke)},function(Me,ke){return(ke-Me)/6048e5})}var q=U(0),$=U(1),ne=U(2),H=U(3),Q=U(4),ee=U(5),ie=U(6),ae=q.range,ue=$.range,le=ne.range,ge=H.range,fe=Q.range,me=ee.range,_e=ie.range,we=c(function(ye){ye.setUTCDate(1),ye.setUTCHours(0,0,0,0)},function(ye,Me){ye.setUTCMonth(ye.getUTCMonth()+Me)},function(ye,Me){return Me.getUTCMonth()-ye.getUTCMonth()+12*(Me.getUTCFullYear()-ye.getUTCFullYear())},function(ye){return ye.getUTCMonth()}),Te=we.range,Oe=c(function(ye){ye.setUTCMonth(0,1),ye.setUTCHours(0,0,0,0)},function(ye,Me){ye.setUTCFullYear(ye.getUTCFullYear()+Me)},function(ye,Me){return Me.getUTCFullYear()-ye.getUTCFullYear()},function(ye){return ye.getUTCFullYear()});Oe.every=function(ye){return isFinite(ye=Math.floor(ye))&&ye>0?c(function(Me){Me.setUTCFullYear(Math.floor(Me.getUTCFullYear()/ye)*ye),Me.setUTCMonth(0,1),Me.setUTCHours(0,0,0,0)},function(Me,ke){Me.setUTCFullYear(Me.getUTCFullYear()+ke*ye)}):null};var de=Oe.range;r.timeDay=v,r.timeDays=y,r.timeFriday=M,r.timeFridays=z,r.timeHour=g,r.timeHours=p,r.timeInterval=c,r.timeMillisecond=i,r.timeMilliseconds=s,r.timeMinute=h,r.timeMinutes=m,r.timeMonday=k,r.timeMondays=E,r.timeMonth=P,r.timeMonths=N,r.timeSaturday=A,r.timeSaturdays=L,r.timeSecond=l,r.timeSeconds=d,r.timeSunday=w,r.timeSundays=S,r.timeThursday=_,r.timeThursdays=R,r.timeTuesday=b,r.timeTuesdays=D,r.timeWednesday=T,r.timeWednesdays=O,r.timeWeek=w,r.timeWeeks=S,r.timeYear=B,r.timeYears=G,r.utcDay=Z,r.utcDays=re,r.utcFriday=ee,r.utcFridays=me,r.utcHour=te,r.utcHours=Y,r.utcMillisecond=i,r.utcMilliseconds=s,r.utcMinute=W,r.utcMinutes=K,r.utcMonday=$,r.utcMondays=ue,r.utcMonth=we,r.utcMonths=Te,r.utcSaturday=ie,r.utcSaturdays=_e,r.utcSecond=l,r.utcSeconds=d,r.utcSunday=q,r.utcSundays=ae,r.utcThursday=Q,r.utcThursdays=fe,r.utcTuesday=ne,r.utcTuesdays=le,r.utcWednesday=H,r.utcWednesdays=ge,r.utcWeek=q,r.utcWeeks=ae,r.utcYear=Oe,r.utcYears=de,Object.defineProperty(r,"__esModule",{value:!0})})},{}],122:[function(e,o,f){arguments[4][121][0].apply(f,arguments)},{dup:121}],123:[function(e,o,f){(function(r,a){a(typeof f=="object"&&o!==void 0?f:(r=r||self).d3=r.d3||{})})(this,function(r){var a,u,c=0,i=0,s=0,l=0,d=0,h=0,m=typeof performance=="object"&&performance.now?performance:Date,g=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_){setTimeout(_,17)};function p(){return d||(g(v),d=m.now()+h)}function v(){d=0}function y(){this._call=this._time=this._next=null}function x(_,M,A){var S=new y;return S.restart(_,M,A),S}function w(){p(),++c;for(var _,M=a;M;)(_=d-M._time)>=0&&M._call.call(null,_),M=M._next;--c}function k(){d=(l=m.now())+h,c=i=0;try{w()}finally{c=0,function(){for(var _,M,A=a,S=1/0;A;)A._call?(S>A._time&&(S=A._time),_=A,A=A._next):(M=A._next,A._next=null,A=_?_._next=M:a=M);u=_,T(S)}(),d=0}}function b(){var _=m.now(),M=_-l;M>1e3&&(h-=M,l=_)}function T(_){c||(i&&(i=clearTimeout(i)),_-d>24?(_<1/0&&(i=setTimeout(k,_-m.now()-h)),s&&(s=clearInterval(s))):(s||(l=m.now(),s=setInterval(b,1e3)),c=1,g(k)))}y.prototype=x.prototype={constructor:y,restart:function(_,M,A){if(typeof _!="function")throw new TypeError("callback is not a function");A=(A==null?p():+A)+(M==null?0:+M),this._next||u===this||(u?u._next=this:a=this,u=this),this._call=_,this._time=A,T()},stop:function(){this._call&&(this._call=null,this._time=1/0,T())}},r.interval=function(_,M,A){var S=new y,E=M;return M==null?(S.restart(_,M,A),S):(M=+M,A=A==null?p():+A,S.restart(function D(O){O+=E,S.restart(D,E+=M,A),_(O)},M,A),S)},r.now=p,r.timeout=function(_,M,A){var S=new y;return M=M==null?0:+M,S.restart(function(E){S.stop(),_(E+M)},M,A),S},r.timer=x,r.timerFlush=w,Object.defineProperty(r,"__esModule",{value:!0})})},{}],124:[function(e,o,f){o.exports=function(){for(var r=0;rh*m){var x=(y-v)/h;d[p]=1e3*x}}return d}function c(i){for(var s=[],l=i[0];l<=i[1];l++)for(var d=String.fromCharCode(l),h=i[0];h0)return function(u,c){var i,s;for(i=new Array(u),s=0;s80*L){P=B=R[0],N=G=R[1];for(var q=L;qB&&(B=W),K>G&&(G=K);te=(te=Math.max(B-P,G-N))!==0?1/te:0}return c(re,U,L,P,N,te),U}function a(R,z,L,P,N){var B,G;if(N===O(R,z,L,P)>0)for(B=z;B=z;B-=P)G=S(B,R[B],R[B+1],G);return G&&k(G,G.next)&&(E(G),G=G.next),G}function u(R,z){if(!R)return R;z||(z=R);var L,P=R;do if(L=!1,P.steiner||!k(P,P.next)&&w(P.prev,P,P.next)!==0)P=P.next;else{if(E(P),(P=z=P.prev)===P.next)break;L=!0}while(L||P!==z);return z}function c(R,z,L,P,N,B,G){if(R){!G&&B&&function(Y,Z,re,U){var q=Y;do q.z===null&&(q.z=p(q.x,q.y,Z,re,U)),q.prevZ=q.prev,q.nextZ=q.next,q=q.next;while(q!==Y);q.prevZ.nextZ=null,q.prevZ=null,function($){var ne,H,Q,ee,ie,ae,ue,le,ge=1;do{for(H=$,$=null,ie=null,ae=0;H;){for(ae++,Q=H,ue=0,ne=0;ne0||le>0&&Q;)ue!==0&&(le===0||!Q||H.z<=Q.z)?(ee=H,H=H.nextZ,ue--):(ee=Q,Q=Q.nextZ,le--),ie?ie.nextZ=ee:$=ee,ee.prevZ=ie,ie=ee;H=Q}ie.nextZ=null,ge*=2}while(ae>1)}(q)}(R,P,N,B);for(var W,K,te=R;R.prev!==R.next;)if(W=R.prev,K=R.next,B?s(R,P,N,B):i(R))z.push(W.i/L),z.push(R.i/L),z.push(K.i/L),E(R),R=K.next,te=K.next;else if((R=K)===te){G?G===1?c(R=l(u(R),z,L),z,L,P,N,B,2):G===2&&d(R,z,L,P,N,B):c(u(R),z,L,P,N,B,1);break}}}function i(R){var z=R.prev,L=R,P=R.next;if(w(z,L,P)>=0)return!1;for(var N=R.next.next;N!==R.prev;){if(y(z.x,z.y,L.x,L.y,P.x,P.y,N.x,N.y)&&w(N.prev,N,N.next)>=0)return!1;N=N.next}return!0}function s(R,z,L,P){var N=R.prev,B=R,G=R.next;if(w(N,B,G)>=0)return!1;for(var W=N.xB.x?N.x>G.x?N.x:G.x:B.x>G.x?B.x:G.x,Y=N.y>B.y?N.y>G.y?N.y:G.y:B.y>G.y?B.y:G.y,Z=p(W,K,z,L,P),re=p(te,Y,z,L,P),U=R.prevZ,q=R.nextZ;U&&U.z>=Z&&q&&q.z<=re;){if(U!==R.prev&&U!==R.next&&y(N.x,N.y,B.x,B.y,G.x,G.y,U.x,U.y)&&w(U.prev,U,U.next)>=0||(U=U.prevZ,q!==R.prev&&q!==R.next&&y(N.x,N.y,B.x,B.y,G.x,G.y,q.x,q.y)&&w(q.prev,q,q.next)>=0))return!1;q=q.nextZ}for(;U&&U.z>=Z;){if(U!==R.prev&&U!==R.next&&y(N.x,N.y,B.x,B.y,G.x,G.y,U.x,U.y)&&w(U.prev,U,U.next)>=0)return!1;U=U.prevZ}for(;q&&q.z<=re;){if(q!==R.prev&&q!==R.next&&y(N.x,N.y,B.x,B.y,G.x,G.y,q.x,q.y)&&w(q.prev,q,q.next)>=0)return!1;q=q.nextZ}return!0}function l(R,z,L){var P=R;do{var N=P.prev,B=P.next.next;!k(N,B)&&b(N,P,P.next,B)&&M(N,B)&&M(B,N)&&(z.push(N.i/L),z.push(P.i/L),z.push(B.i/L),E(P),E(P.next),P=R=B),P=P.next}while(P!==R);return u(P)}function d(R,z,L,P,N,B){var G=R;do{for(var W=G.next.next;W!==G.prev;){if(G.i!==W.i&&x(G,W)){var K=A(G,W);return G=u(G,G.next),K=u(K,K.next),c(G,z,L,P,N,B),void c(K,z,L,P,N,B)}W=W.next}G=G.next}while(G!==R)}function h(R,z){return R.x-z.x}function m(R,z){if(z=function(P,N){var B,G=N,W=P.x,K=P.y,te=-1/0;do{if(K<=G.y&&K>=G.next.y&&G.next.y!==G.y){var Y=G.x+(K-G.y)*(G.next.x-G.x)/(G.next.y-G.y);if(Y<=W&&Y>te){if(te=Y,Y===W){if(K===G.y)return G;if(K===G.next.y)return G.next}B=G.x=G.x&&G.x>=U&&W!==G.x&&y(KB.x||G.x===B.x&&g(B,G)))&&(B=G,$=Z)),G=G.next;while(G!==re);return B}(R,z)){var L=A(z,R);u(z,z.next),u(L,L.next)}}function g(R,z){return w(R.prev,R,z.prev)<0&&w(z.next,R,R.next)<0}function p(R,z,L,P,N){return(R=1431655765&((R=858993459&((R=252645135&((R=16711935&((R=32767*(R-L)*N)|R<<8))|R<<4))|R<<2))|R<<1))|(z=1431655765&((z=858993459&((z=252645135&((z=16711935&((z=32767*(z-P)*N)|z<<8))|z<<4))|z<<2))|z<<1))<<1}function v(R){var z=R,L=R;do(z.x=0&&(R-G)*(P-W)-(L-G)*(z-W)>=0&&(L-G)*(B-W)-(N-G)*(P-W)>=0}function x(R,z){return R.next.i!==z.i&&R.prev.i!==z.i&&!function(L,P){var N=L;do{if(N.i!==L.i&&N.next.i!==L.i&&N.i!==P.i&&N.next.i!==P.i&&b(N,N.next,L,P))return!0;N=N.next}while(N!==L);return!1}(R,z)&&(M(R,z)&&M(z,R)&&function(L,P){var N=L,B=!1,G=(L.x+P.x)/2,W=(L.y+P.y)/2;do N.y>W!=N.next.y>W&&N.next.y!==N.y&&G<(N.next.x-N.x)*(W-N.y)/(N.next.y-N.y)+N.x&&(B=!B),N=N.next;while(N!==L);return B}(R,z)&&(w(R.prev,R,z.prev)||w(R,z.prev,z))||k(R,z)&&w(R.prev,R,R.next)>0&&w(z.prev,z,z.next)>0)}function w(R,z,L){return(z.y-R.y)*(L.x-z.x)-(z.x-R.x)*(L.y-z.y)}function k(R,z){return R.x===z.x&&R.y===z.y}function b(R,z,L,P){var N=_(w(R,z,L)),B=_(w(R,z,P)),G=_(w(L,P,R)),W=_(w(L,P,z));return N!==B&&G!==W||!(N!==0||!T(R,L,z))||!(B!==0||!T(R,P,z))||!(G!==0||!T(L,R,P))||!(W!==0||!T(L,z,P))}function T(R,z,L){return z.x<=Math.max(R.x,L.x)&&z.x>=Math.min(R.x,L.x)&&z.y<=Math.max(R.y,L.y)&&z.y>=Math.min(R.y,L.y)}function _(R){return R>0?1:R<0?-1:0}function M(R,z){return w(R.prev,R,R.next)<0?w(R,z,R.next)>=0&&w(R,R.prev,z)>=0:w(R,z,R.prev)<0||w(R,R.next,z)<0}function A(R,z){var L=new D(R.i,R.x,R.y),P=new D(z.i,z.x,z.y),N=R.next,B=z.prev;return R.next=z,z.prev=R,L.next=N,N.prev=L,P.next=L,L.prev=P,B.next=P,P.prev=B,P}function S(R,z,L,P){var N=new D(R,z,L);return P?(N.next=P.next,N.prev=P,P.next.prev=N,P.next=N):(N.prev=N,N.next=N),N}function E(R){R.next.prev=R.prev,R.prev.next=R.next,R.prevZ&&(R.prevZ.nextZ=R.nextZ),R.nextZ&&(R.nextZ.prevZ=R.prevZ)}function D(R,z,L){this.i=R,this.x=z,this.y=L,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(R,z,L,P){for(var N=0,B=z,G=L-P;B0&&(P+=R[N-1].length,L.holes.push(P))}return L}},{}],130:[function(e,o,f){var r=e("strongly-connected-components");o.exports=function(a,u){var c,i=[],s=[],l=[],d={},h=[];function m(b){var T,_,M=!1;for(s.push(b),l[b]=!0,T=0;T=D})})(b);for(var T,_=r(a).components.filter(function(D){return D.length>1}),M=1/0,A=0;A<_.length;A++)for(var S=0;S<_[A].length;S++)_[A][S]=55296&&T<=56319&&(S+=v[++x]),S=E?m.call(E,D,S,w):S,y?(g.value=S,p(k,w,g)):k[w]=S,++w;b=w}}if(b===void 0)for(b=c(v.length),y&&(k=new y(b)),x=0;x0?1:-1}},{}],141:[function(e,o,f){var r=e("../math/sign"),a=Math.abs,u=Math.floor;o.exports=function(c){return isNaN(c)?0:(c=Number(c))!==0&&isFinite(c)?r(c)*u(a(c)):c}},{"../math/sign":138}],142:[function(e,o,f){var r=e("./to-integer"),a=Math.max;o.exports=function(u){return a(0,r(u))}},{"./to-integer":141}],143:[function(e,o,f){var r=e("./valid-callable"),a=e("./valid-value"),u=Function.prototype.bind,c=Function.prototype.call,i=Object.keys,s=Object.prototype.propertyIsEnumerable;o.exports=function(l,d){return function(h,m){var g,p=arguments[2],v=arguments[3];return h=Object(a(h)),r(m),g=i(h),v&&g.sort(typeof v=="function"?u.call(v,h):void 0),typeof l!="function"&&(l=g[l]),c.call(l,g,function(y,x){return s.call(h,y)?c.call(m,p,h[y],y,h,x):d})}}},{"./valid-callable":160,"./valid-value":162}],144:[function(e,o,f){o.exports=e("./is-implemented")()?Object.assign:e("./shim")},{"./is-implemented":145,"./shim":146}],145:[function(e,o,f){o.exports=function(){var r,a=Object.assign;return typeof a=="function"&&(a(r={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),r.foo+r.bar+r.trzy==="razdwatrzy")}},{}],146:[function(e,o,f){var r=e("../keys"),a=e("../valid-value"),u=Math.max;o.exports=function(c,i){var s,l,d,h=u(arguments.length,2);for(c=Object(a(c)),d=function(m){try{c[m]=i[m]}catch(g){s||(s=g)}},l=1;l-1}},{}],166:[function(e,o,f){var r=Object.prototype.toString,a=r.call("");o.exports=function(u){return typeof u=="string"||u&&typeof u=="object"&&(u instanceof String||r.call(u)===a)||!1}},{}],167:[function(e,o,f){var r=Object.create(null),a=Math.random;o.exports=function(){var u;do u=a().toString(36).slice(2);while(r[u]);return u}},{}],168:[function(e,o,f){var r,a=e("es5-ext/object/set-prototype-of"),u=e("es5-ext/string/#/contains"),c=e("d"),i=e("es6-symbol"),s=e("./"),l=Object.defineProperty;r=o.exports=function(d,h){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");s.call(this,d),h=h?u.call(h,"key+value")?"key+value":u.call(h,"key")?"key":"value":"value",l(this,"__kind__",c("",h))},a&&a(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:c(function(d){return this.__kind__==="value"?this.__list__[d]:this.__kind__==="key+value"?[d,this.__list__[d]]:d})}),l(r.prototype,i.toStringTag,c("c","Array Iterator"))},{"./":171,d:106,"es5-ext/object/set-prototype-of":157,"es5-ext/string/#/contains":163,"es6-symbol":175}],169:[function(e,o,f){var r=e("es5-ext/function/is-arguments"),a=e("es5-ext/object/valid-callable"),u=e("es5-ext/string/is-string"),c=e("./get"),i=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;o.exports=function(d,h){var m,g,p,v,y,x,w,k,b=arguments[2];if(i(d)||r(d)?m="array":u(d)?m="string":d=c(d),a(h),p=function(){v=!0},m!=="array")if(m!=="string")for(g=d.next();!g.done;){if(s.call(h,b,g.value,p),v)return;g=d.next()}else for(x=d.length,y=0;y=55296&&k<=56319&&(w+=d[++y]),s.call(h,b,w,p),!v);++y);else l.call(d,function(T){return s.call(h,b,T,p),v})}},{"./get":170,"es5-ext/function/is-arguments":135,"es5-ext/object/valid-callable":160,"es5-ext/string/is-string":166}],170:[function(e,o,f){var r=e("es5-ext/function/is-arguments"),a=e("es5-ext/string/is-string"),u=e("./array"),c=e("./string"),i=e("./valid-iterable"),s=e("es6-symbol").iterator;o.exports=function(l){return typeof i(l)[s]=="function"?l[s]():r(l)?new u(l):a(l)?new c(l):new u(l)}},{"./array":168,"./string":173,"./valid-iterable":174,"es5-ext/function/is-arguments":135,"es5-ext/string/is-string":166,"es6-symbol":175}],171:[function(e,o,f){var r,a=e("es5-ext/array/#/clear"),u=e("es5-ext/object/assign"),c=e("es5-ext/object/valid-callable"),i=e("es5-ext/object/valid-value"),s=e("d"),l=e("d/auto-bind"),d=e("es6-symbol"),h=Object.defineProperty,m=Object.defineProperties;o.exports=r=function(g,p){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");m(this,{__list__:s("w",i(g)),__context__:s("w",p),__nextIndex__:s("w",0)}),p&&(c(p.on),p.on("_add",this._onAdd),p.on("_delete",this._onDelete),p.on("_clear",this._onClear))},delete r.prototype.constructor,m(r.prototype,u({_next:s(function(){var g;if(this.__list__)return this.__redo__&&(g=this.__redo__.shift())!==void 0?g:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(p,v){p>=g&&(this.__redo__[v]=++p)},this),this.__redo__.push(g)):h(this,"__redo__",s("c",[g])))}),_onDelete:s(function(g){var p;g>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&((p=this.__redo__.indexOf(g))!==-1&&this.__redo__.splice(p,1),this.__redo__.forEach(function(v,y){v>g&&(this.__redo__[y]=--v)},this)))}),_onClear:s(function(){this.__redo__&&a.call(this.__redo__),this.__nextIndex__=0})}))),h(r.prototype,d.iterator,s(function(){return this}))},{d:106,"d/auto-bind":105,"es5-ext/array/#/clear":131,"es5-ext/object/assign":144,"es5-ext/object/valid-callable":160,"es5-ext/object/valid-value":162,"es6-symbol":175}],172:[function(e,o,f){var r=e("es5-ext/function/is-arguments"),a=e("es5-ext/object/is-value"),u=e("es5-ext/string/is-string"),c=e("es6-symbol").iterator,i=Array.isArray;o.exports=function(s){return!!a(s)&&(!!i(s)||!!u(s)||!!r(s)||typeof s[c]=="function")}},{"es5-ext/function/is-arguments":135,"es5-ext/object/is-value":151,"es5-ext/string/is-string":166,"es6-symbol":175}],173:[function(e,o,f){var r,a=e("es5-ext/object/set-prototype-of"),u=e("d"),c=e("es6-symbol"),i=e("./"),s=Object.defineProperty;r=o.exports=function(l){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");l=String(l),i.call(this,l),s(this,"__length__",u("",l.length))},a&&a(r,i),delete r.prototype.constructor,r.prototype=Object.create(i.prototype,{_next:u(function(){if(this.__list__)return this.__nextIndex__=55296&&d<=56319?h+this.__list__[this.__nextIndex__++]:h})}),s(r.prototype,c.toStringTag,u("c","String Iterator"))},{"./":171,d:106,"es5-ext/object/set-prototype-of":157,"es6-symbol":175}],174:[function(e,o,f){var r=e("./is-iterable");o.exports=function(a){if(!r(a))throw new TypeError(a+" is not iterable");return a}},{"./is-iterable":172}],175:[function(e,o,f){o.exports=e("./is-implemented")()?e("ext/global-this").Symbol:e("./polyfill")},{"./is-implemented":176,"./polyfill":181,"ext/global-this":188}],176:[function(e,o,f){var r=e("ext/global-this"),a={object:!0,symbol:!0};o.exports=function(){var u,c=r.Symbol;if(typeof c!="function")return!1;u=c("test symbol");try{String(u)}catch{return!1}return!!a[typeof c.iterator]&&!!a[typeof c.toPrimitive]&&!!a[typeof c.toStringTag]}},{"ext/global-this":188}],177:[function(e,o,f){o.exports=function(r){return!!r&&(typeof r=="symbol"||!!r.constructor&&r.constructor.name==="Symbol"&&r[r.constructor.toStringTag]==="Symbol")}},{}],178:[function(e,o,f){var r=e("d"),a=Object.create,u=Object.defineProperty,c=Object.prototype,i=a(null);o.exports=function(s){for(var l,d,h=0;i[s+(h||"")];)++h;return i[s+=h||""]=!0,u(c,l="@@"+s,r.gs(null,function(m){d||(d=!0,u(this,l,r(m)),d=!1)})),l}},{d:106}],179:[function(e,o,f){var r=e("d"),a=e("ext/global-this").Symbol;o.exports=function(u){return Object.defineProperties(u,{hasInstance:r("",a&&a.hasInstance||u("hasInstance")),isConcatSpreadable:r("",a&&a.isConcatSpreadable||u("isConcatSpreadable")),iterator:r("",a&&a.iterator||u("iterator")),match:r("",a&&a.match||u("match")),replace:r("",a&&a.replace||u("replace")),search:r("",a&&a.search||u("search")),species:r("",a&&a.species||u("species")),split:r("",a&&a.split||u("split")),toPrimitive:r("",a&&a.toPrimitive||u("toPrimitive")),toStringTag:r("",a&&a.toStringTag||u("toStringTag")),unscopables:r("",a&&a.unscopables||u("unscopables"))})}},{d:106,"ext/global-this":188}],180:[function(e,o,f){var r=e("d"),a=e("../../../validate-symbol"),u=Object.create(null);o.exports=function(c){return Object.defineProperties(c,{for:r(function(i){return u[i]?u[i]:u[i]=c(String(i))}),keyFor:r(function(i){var s;for(s in a(i),u)if(u[s]===i)return s})})}},{"../../../validate-symbol":182,d:106}],181:[function(e,o,f){var r,a,u,c=e("d"),i=e("./validate-symbol"),s=e("ext/global-this").Symbol,l=e("./lib/private/generate-name"),d=e("./lib/private/setup/standard-symbols"),h=e("./lib/private/setup/symbol-registry"),m=Object.create,g=Object.defineProperties,p=Object.defineProperty;if(typeof s=="function")try{String(s()),u=!0}catch{}else s=null;a=function(v){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return r(v)},o.exports=r=function v(y){var x;if(this instanceof v)throw new TypeError("Symbol is not a constructor");return u?s(y):(x=m(a.prototype),y=y===void 0?"":String(y),g(x,{__description__:c("",y),__name__:c("",l(y))}))},d(r),h(r),g(a.prototype,{constructor:c(r),toString:c("",function(){return this.__name__})}),g(r.prototype,{toString:c(function(){return"Symbol ("+i(this).__description__+")"}),valueOf:c(function(){return i(this)})}),p(r.prototype,r.toPrimitive,c("",function(){var v=i(this);return typeof v=="symbol"?v:v.toString()})),p(r.prototype,r.toStringTag,c("c","Symbol")),p(a.prototype,r.toStringTag,c("c",r.prototype[r.toStringTag])),p(a.prototype,r.toPrimitive,c("c",r.prototype[r.toPrimitive]))},{"./lib/private/generate-name":178,"./lib/private/setup/standard-symbols":179,"./lib/private/setup/symbol-registry":180,"./validate-symbol":182,d:106,"ext/global-this":188}],182:[function(e,o,f){var r=e("./is-symbol");o.exports=function(a){if(!r(a))throw new TypeError(a+" is not a symbol");return a}},{"./is-symbol":177}],183:[function(e,o,f){o.exports=e("./is-implemented")()?WeakMap:e("./polyfill")},{"./is-implemented":184,"./polyfill":186}],184:[function(e,o,f){o.exports=function(){var r,a;if(typeof WeakMap!="function")return!1;try{r=new WeakMap([[a={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return String(r)==="[object WeakMap]"&&typeof r.set=="function"&&r.set({},1)===r&&typeof r.delete=="function"&&typeof r.has=="function"&&r.get(a)==="one"}},{}],185:[function(e,o,f){o.exports=typeof WeakMap=="function"&&Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"},{}],186:[function(e,o,f){var r,a=e("es5-ext/object/is-value"),u=e("es5-ext/object/set-prototype-of"),c=e("es5-ext/object/valid-object"),i=e("es5-ext/object/valid-value"),s=e("es5-ext/string/random-uniq"),l=e("d"),d=e("es6-iterator/get"),h=e("es6-iterator/for-of"),m=e("es6-symbol").toStringTag,g=e("./is-native-implemented"),p=Array.isArray,v=Object.defineProperty,y=Object.prototype.hasOwnProperty,x=Object.getPrototypeOf;o.exports=r=function(){var w,k=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return w=g&&u&&WeakMap!==r?u(new WeakMap,x(this)):this,a(k)&&(p(k)||(k=d(k))),v(w,"__weakMapData__",l("c","$weakMap$"+s())),k&&h(k,function(b){i(b),w.set(b[0],b[1])}),w},g&&(u&&u(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l(function(w){return!!y.call(c(w),this.__weakMapData__)&&(delete w[this.__weakMapData__],!0)}),get:l(function(w){if(y.call(c(w),this.__weakMapData__))return w[this.__weakMapData__]}),has:l(function(w){return y.call(c(w),this.__weakMapData__)}),set:l(function(w,k){return v(c(w),this.__weakMapData__,l("c",k)),this}),toString:l(function(){return"[object WeakMap]"})}),v(r.prototype,m,l("c","WeakMap"))},{"./is-native-implemented":185,d:106,"es5-ext/object/is-value":151,"es5-ext/object/set-prototype-of":157,"es5-ext/object/valid-object":161,"es5-ext/object/valid-value":162,"es5-ext/string/random-uniq":167,"es6-iterator/for-of":169,"es6-iterator/get":170,"es6-symbol":175}],187:[function(e,o,f){var r=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};o.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()},{}],188:[function(e,o,f){o.exports=e("./is-implemented")()?globalThis:e("./implementation")},{"./implementation":187,"./is-implemented":189}],189:[function(e,o,f){o.exports=function(){return typeof globalThis=="object"&&!!globalThis&&globalThis.Array===Array}},{}],190:[function(e,o,f){var r=e("is-string-blank");o.exports=function(a){var u=typeof a;if(u==="string"){var c=a;if((a=+a)==0&&r(c))return!1}else if(u!=="number")return!1;return a-a<1}},{"is-string-blank":237}],191:[function(e,o,f){var r=e("dtype");o.exports=function(a,u,c){if(!a)throw new TypeError("must specify data as first parameter");if(c=0|+(c||0),Array.isArray(a)&&a[0]&&typeof a[0][0]=="number"){var i,s,l,d,h=a[0].length,m=a.length*h;u&&typeof u!="string"||(u=new(r(u||"float32"))(m+c));var g=u.length-c;if(m!==g)throw new Error("source length "+m+" ("+h+"x"+a.length+") does not match destination length "+g);for(i=0,l=c;ic[0]-l[0]/2&&(v=l[0]/2,y+=l[1]);return i}},{"css-font/stringify":102}],193:[function(e,o,f){function r(i,s){s||(s={}),(typeof i=="string"||Array.isArray(i))&&(s.family=i);var l=Array.isArray(s.family)?s.family.join(", "):s.family;if(!l)throw Error("`family` must be defined");var d=s.size||s.fontSize||s.em||48,h=s.weight||s.fontWeight||"",m=(i=[s.style||s.fontStyle||"",h,d].join(" ")+"px "+l,s.origin||"top");if(r.cache[l]&&d<=r.cache[l].em)return a(r.cache[l],m);var g=s.canvas||r.canvas,p=g.getContext("2d"),v={upper:s.upper!==void 0?s.upper:"H",lower:s.lower!==void 0?s.lower:"x",descent:s.descent!==void 0?s.descent:"p",ascent:s.ascent!==void 0?s.ascent:"h",tittle:s.tittle!==void 0?s.tittle:"i",overshoot:s.overshoot!==void 0?s.overshoot:"O"},y=Math.ceil(1.5*d);g.height=y,g.width=.5*y,p.font=i;var x={top:0};p.clearRect(0,0,y,y),p.textBaseline="top",p.fillStyle="black",p.fillText("H",0,0);var w=u(p.getImageData(0,0,y,y));p.clearRect(0,0,y,y),p.textBaseline="bottom",p.fillText("H",0,y);var k=u(p.getImageData(0,0,y,y));x.lineHeight=x.bottom=y-k+w,p.clearRect(0,0,y,y),p.textBaseline="alphabetic",p.fillText("H",0,y);var b=y-u(p.getImageData(0,0,y,y))-1+w;x.baseline=x.alphabetic=b,p.clearRect(0,0,y,y),p.textBaseline="middle",p.fillText("H",0,.5*y);var T=u(p.getImageData(0,0,y,y));x.median=x.middle=y-T-1+w-.5*y,p.clearRect(0,0,y,y),p.textBaseline="hanging",p.fillText("H",0,.5*y);var _=u(p.getImageData(0,0,y,y));x.hanging=y-_-1+w-.5*y,p.clearRect(0,0,y,y),p.textBaseline="ideographic",p.fillText("H",0,y);var M=u(p.getImageData(0,0,y,y));if(x.ideographic=y-M-1+w,v.upper&&(p.clearRect(0,0,y,y),p.textBaseline="top",p.fillText(v.upper,0,0),x.upper=u(p.getImageData(0,0,y,y)),x.capHeight=x.baseline-x.upper),v.lower&&(p.clearRect(0,0,y,y),p.textBaseline="top",p.fillText(v.lower,0,0),x.lower=u(p.getImageData(0,0,y,y)),x.xHeight=x.baseline-x.lower),v.tittle&&(p.clearRect(0,0,y,y),p.textBaseline="top",p.fillText(v.tittle,0,0),x.tittle=u(p.getImageData(0,0,y,y))),v.ascent&&(p.clearRect(0,0,y,y),p.textBaseline="top",p.fillText(v.ascent,0,0),x.ascent=u(p.getImageData(0,0,y,y))),v.descent&&(p.clearRect(0,0,y,y),p.textBaseline="top",p.fillText(v.descent,0,0),x.descent=c(p.getImageData(0,0,y,y))),v.overshoot){p.clearRect(0,0,y,y),p.textBaseline="top",p.fillText(v.overshoot,0,0);var A=c(p.getImageData(0,0,y,y));x.overshoot=A-b}for(var S in x)x[S]/=d;return x.em=d,r.cache[l]=x,a(x,m)}function a(i,s){var l={};for(var d in typeof s=="string"&&(s=i[s]),i)d!=="em"&&(l[d]=i[d]-s);return l}function u(i){for(var s=i.height,l=i.data,d=3;d0;d-=4)if(l[d]!==0)return Math.floor(.25*(d-3)/s)}o.exports=r,r.canvas=document.createElement("canvas"),r.cache={}},{}],194:[function(e,o,f){o.exports=function(r,a){if(typeof r!="string")throw new TypeError("must specify type string");if(a=a||{},typeof document>"u"&&!a.canvas)return null;var u=a.canvas||document.createElement("canvas");typeof a.width=="number"&&(u.width=a.width),typeof a.height=="number"&&(u.height=a.height);var c,i=a;try{var s=[r];r.indexOf("webgl")===0&&s.push("experimental-"+r);for(var l=0;l halfCharStep + halfCharWidth || + floor(uv.x) < halfCharStep - halfCharWidth) return; + + uv += charId * charStep; + uv = uv / atlasSize; + + vec4 color = fontColor; + vec4 mask = texture2D(atlas, uv); + + float maskY = lightness(mask); + // float colorY = lightness(color); + color.a *= maskY; + color.a *= opacity; + + // color.a += .1; + + // antialiasing, see yiq color space y-channel formula + // color.rgb += (1. - color.rgb) * (1. - mask.rgb); + + gl_FragColor = color; + }`});return{regl:A,draw:S,atlas:{}}},M.prototype.update=function(A){var S=this;if(typeof A=="string")A={text:A};else if(!A)return;(A=a(A,{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!=null&&(Array.isArray(A.opacity)?this.opacity=A.opacity.map(function(ye){return parseFloat(ye)}):this.opacity=parseFloat(A.opacity)),A.viewport!=null&&(this.viewport=h(A.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(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]),A.kerning!=null&&(this.kerning=A.kerning),A.offset!=null&&(typeof A.offset=="number"&&(A.offset=[A.offset,0]),this.positionOffset=w(A.offset)),A.direction&&(this.direction=A.direction),A.range&&(this.range=A.range,this.scale=[1/(A.range[2]-A.range[0]),1/(A.range[3]-A.range[1])],this.translate=[-A.range[0],-A.range[1]]),A.scale&&(this.scale=A.scale),A.translate&&(this.translate=A.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||A.font||(A.font=M.baseFontSize+"px sans-serif");var E,D=!1,O=!1;if(A.font&&(Array.isArray(A.font)?A.font:[A.font]).forEach(function(ye,Me){if(typeof ye=="string")try{ye=r.parse(ye)}catch{ye=r.parse(M.baseFontSize+"px "+ye)}else ye=r.parse(r.stringify(ye));var ke=r.stringify({size:M.baseFontSize,family:ye.family,stretch:T?ye.stretch:void 0,variant:ye.variant,weight:ye.weight,style:ye.style}),Ee=g(ye.size),ze=Math.round(Ee[0]*p(Ee[1]));if(ze!==S.fontSize[Me]&&(O=!0,S.fontSize[Me]=ze),!(S.font[Me]&&ke==S.font[Me].baseString||(D=!0,S.font[Me]=M.fonts[ke],S.font[Me]))){var Fe=ye.family.join(", "),Ve=[ye.style];ye.style!=ye.variant&&Ve.push(ye.variant),ye.variant!=ye.weight&&Ve.push(ye.weight),T&&ye.weight!=ye.stretch&&Ve.push(ye.stretch),S.font[Me]={baseString:ke,family:Fe,weight:ye.weight,stretch:ye.stretch,style:ye.style,variant:ye.variant,width:{},kerning:{},metrics:x(Fe,{origin:"top",fontSize:M.baseFontSize,fontStyle:Ve.join(" ")})},M.fonts[ke]=S.font[Me]}}),(D||O)&&this.font.forEach(function(ye,Me){var ke=r.stringify({size:S.fontSize[Me],family:ye.family,stretch:T?ye.stretch:void 0,variant:ye.variant,weight:ye.weight,style:ye.style});if(S.fontAtlas[Me]=S.shader.atlas[ke],!S.fontAtlas[Me]){var Ee=ye.metrics;S.shader.atlas[ke]=S.fontAtlas[Me]={fontString:ke,step:2*Math.ceil(S.fontSize[Me]*Ee.bottom*.5),em:S.fontSize[Me],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:S.regl.texture()}}A.text==null&&(A.text=S.text)}),typeof A.text=="string"&&A.position&&A.position.length>2){for(var R=Array(.5*A.position.length),z=0;z2){for(var P=!A.position[0].length,N=d.mallocFloat(2*this.count),B=0,G=0;B1?S.align[Me]:S.align[0]:S.align;if(typeof ke=="number")return ke;switch(ke){case"right":case"end":return-ye;case"center":case"centre":case"middle":return .5*-ye}return 0})),this.baseline==null&&A.baseline==null&&(A.baseline=0),A.baseline!=null&&(this.baseline=A.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(ye,Me){var ke=(S.font[Me]||S.font[0]).metrics,Ee=0;return Ee+=.5*ke.bottom,Ee+=typeof ye=="number"?ye-ke.baseline:-ke[ye],Ee*=-1})),A.color!=null)if(A.color||(A.color="transparent"),typeof A.color!="string"&&isNaN(A.color)){var ge;if(typeof A.color[0]=="number"&&A.color.length>this.counts.length){var fe=A.color.length;ge=d.mallocUint8(fe);for(var me=(A.color.subarray||A.color.slice).bind(A.color),_e=0;_e4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var Oe=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(Oe);for(var de=0;de1?this.counts[de]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[de]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*de,4*de+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[de]:this.opacity,baseline:this.baselineOffset[de]!=null?this.baselineOffset[de]:this.baselineOffset[0],align:this.align?this.alignOffset[de]!=null?this.alignOffset[de]:this.alignOffset[0]:0,atlas:this.fontAtlas[de]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*de,2*de+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=[]},M.prototype.destroy=function(){},M.prototype.kerning=!0,M.prototype.position={constant:new Float32Array(2)},M.prototype.translate=null,M.prototype.scale=null,M.prototype.font=null,M.prototype.text="",M.prototype.positionOffset=[0,0],M.prototype.opacity=1,M.prototype.color=new Uint8Array([0,0,0,255]),M.prototype.alignOffset=[0,0],M.maxAtlasSize=1024,M.atlasCanvas=document.createElement("canvas"),M.atlasContext=M.atlasCanvas.getContext("2d",{alpha:!1}),M.baseFontSize=64,M.fonts={},o.exports=M},{"bit-twiddle":81,"color-normalize":89,"css-font":99,"detect-kerning":125,"es6-weak-map":183,"flatten-vertex-data":191,"font-atlas":192,"font-measure":193,"gl-util/context":226,"is-plain-obj":236,"object-assign":247,"parse-rect":249,"parse-unit":251,"pick-by-alias":253,regl:283,"to-px":314,"typedarray-pool":327}],226:[function(e,o,f){(function(r){(function(){var a=e("pick-by-alias");function u(s){if(s.container)if(s.container==document.body)document.body.style.width||(s.canvas.width=s.width||s.pixelRatio*r.innerWidth),document.body.style.height||(s.canvas.height=s.height||s.pixelRatio*r.innerHeight);else{var l=s.container.getBoundingClientRect();s.canvas.width=s.width||l.right-l.left,s.canvas.height=s.height||l.bottom-l.top}}function c(s){return typeof s.getContext=="function"&&"width"in s&&"height"in s}function i(){var s=document.createElement("canvas");return s.style.position="absolute",s.style.top=0,s.style.left=0,s}o.exports=function(s){var l;if(s?typeof s=="string"&&(s={container:s}):s={},c(s)?s={container:s}:s=typeof(l=s).nodeName=="string"&&typeof l.appendChild=="function"&&typeof l.getBoundingClientRect=="function"?{container:s}:function(h){return typeof h.drawArrays=="function"||typeof h.drawElements=="function"}(s)?{gl:s}:a(s,{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),s.pixelRatio||(s.pixelRatio=r.pixelRatio||1),s.gl)return s.gl;if(s.canvas&&(s.container=s.canvas.parentNode),s.container){if(typeof s.container=="string"){var d=document.querySelector(s.container);if(!d)throw Error("Element "+s.container+" is not found");s.container=d}c(s.container)?(s.canvas=s.container,s.container=s.canvas.parentNode):s.canvas||(s.canvas=i(),s.container.appendChild(s.canvas),u(s))}else if(!s.canvas){if(typeof document>"u")throw Error("Not DOM environment. Use headless-gl.");s.container=document.body||document.documentElement,s.canvas=i(),s.container.appendChild(s.canvas),u(s)}return s.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(h){try{s.gl=s.canvas.getContext(h,s.attrs)}catch{}return s.gl}),s.gl}}).call(this)}).call(this,typeof Ro<"u"?Ro:typeof self<"u"?self:typeof window<"u"?window:{})},{"pick-by-alias":253}],227:[function(e,o,f){o.exports=function(r){typeof r=="string"&&(r=[r]);for(var a=[].slice.call(arguments,1),u=[],c=0;c>1,g=-7,p=u?i-1:0,v=u?-1:1,y=r[a+p];for(p+=v,s=y&(1<<-g)-1,y>>=-g,g+=d;g>0;s=256*s+r[a+p],p+=v,g-=8);for(l=s&(1<<-g)-1,s>>=-g,g+=c;g>0;l=256*l+r[a+p],p+=v,g-=8);if(s===0)s=1-m;else{if(s===h)return l?NaN:1/0*(y?-1:1);l+=Math.pow(2,c),s-=m}return(y?-1:1)*l*Math.pow(2,s-c)},f.write=function(r,a,u,c,i,s){var l,d,h,m=8*s-i-1,g=(1<>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=c?0:s-1,x=c?1:-1,w=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(d=isNaN(a)?1:0,l=g):(l=Math.floor(Math.log(a)/Math.LN2),a*(h=Math.pow(2,-l))<1&&(l--,h*=2),(a+=l+p>=1?v/h:v*Math.pow(2,1-p))*h>=2&&(l++,h/=2),l+p>=g?(d=0,l=g):l+p>=1?(d=(a*h-1)*Math.pow(2,i),l+=p):(d=a*Math.pow(2,p-1)*Math.pow(2,i),l=0));i>=8;r[u+y]=255&d,y+=x,d/=256,i-=8);for(l=l<0;r[u+y]=255&l,y+=x,l/=256,m-=8);r[u+y-x]|=128*w}},{}],231:[function(e,o,f){typeof Object.create=="function"?o.exports=function(r,a){a&&(r.super_=a,r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:o.exports=function(r,a){if(a){r.super_=a;var u=function(){};u.prototype=a.prototype,r.prototype=new u,r.prototype.constructor=r}}},{}],232:[function(e,o,f){o.exports=!0},{}],233:[function(e,o,f){o.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],234:[function(e,o,f){o.exports=u,o.exports.isMobile=u,o.exports.default=u;var r=/(android|bb\d+|meego).+mobile|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|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(android|bb\d+|meego).+mobile|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|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function u(c){c||(c={});var i=c.ua;if(i||typeof navigator>"u"||(i=navigator.userAgent),i&&i.headers&&typeof i.headers["user-agent"]=="string"&&(i=i.headers["user-agent"]),typeof i!="string")return!1;var s=c.tablet?a.test(i):r.test(i);return!s&&c.tablet&&c.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(s=!0),s}},{}],235:[function(e,o,f){o.exports=function(r){var a=typeof r;return r!==null&&(a==="object"||a==="function")}},{}],236:[function(e,o,f){var r=Object.prototype.toString;o.exports=function(a){var u;return r.call(a)==="[object Object]"&&((u=Object.getPrototypeOf(a))===null||u===Object.getPrototypeOf({}))}},{}],237:[function(e,o,f){o.exports=function(r){for(var a,u=r.length,c=0;c13)&&a!==32&&a!==133&&a!==160&&a!==5760&&a!==6158&&(a<8192||a>8205)&&a!==8232&&a!==8233&&a!==8239&&a!==8287&&a!==8288&&a!==12288&&a!==65279)return!1;return!0}},{}],238:[function(e,o,f){o.exports=function(r){return typeof r=="string"&&(r=r.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(r)&&/[\dz]$/i.test(r)&&r.length>4))}},{}],239:[function(e,o,f){(function(r,a){typeof f=="object"&&o!==void 0?o.exports=a():(r=r||self).mapboxgl=a()})(this,function(){var r,a,u;function c(i,s){if(r)if(a){var l="var sharedChunk = {}; ("+r+")(sharedChunk); ("+a+")(sharedChunk);",d={};r(d),(u=s(d)).workerUrl=window.URL.createObjectURL(new Blob([l],{type:"text/javascript"}))}else a=s;else r=s}return c(0,function(i){function s(C,F){return C(F={exports:{}},F.exports),F.exports}var l=d;function d(C,F,J,oe){this.cx=3*C,this.bx=3*(J-C)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*F,this.by=3*(oe-F)-this.cy,this.ay=1-this.cy-this.by,this.p1x=C,this.p1y=oe,this.p2x=J,this.p2y=oe}d.prototype.sampleCurveX=function(C){return((this.ax*C+this.bx)*C+this.cx)*C},d.prototype.sampleCurveY=function(C){return((this.ay*C+this.by)*C+this.cy)*C},d.prototype.sampleCurveDerivativeX=function(C){return(3*this.ax*C+2*this.bx)*C+this.cx},d.prototype.solveCurveX=function(C,F){var J,oe,pe,xe,Ce;for(F===void 0&&(F=1e-6),pe=C,Ce=0;Ce<8;Ce++){if(xe=this.sampleCurveX(pe)-C,Math.abs(xe)(oe=1))return oe;for(;Jxe?J=pe:oe=pe,pe=.5*(oe-J)+J}return pe},d.prototype.solve=function(C,F){return this.sampleCurveY(this.solveCurveX(C,F))};var h=m;function m(C,F){this.x=C,this.y=F}function g(C,F,J,oe){var pe=new l(C,F,J,oe);return function(xe){return pe.solve(xe)}}m.prototype={clone:function(){return new m(this.x,this.y)},add:function(C){return this.clone()._add(C)},sub:function(C){return this.clone()._sub(C)},multByPoint:function(C){return this.clone()._multByPoint(C)},divByPoint:function(C){return this.clone()._divByPoint(C)},mult:function(C){return this.clone()._mult(C)},div:function(C){return this.clone()._div(C)},rotate:function(C){return this.clone()._rotate(C)},rotateAround:function(C,F){return this.clone()._rotateAround(C,F)},matMult:function(C){return this.clone()._matMult(C)},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(C){return this.x===C.x&&this.y===C.y},dist:function(C){return Math.sqrt(this.distSqr(C))},distSqr:function(C){var F=C.x-this.x,J=C.y-this.y;return F*F+J*J},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(C){return Math.atan2(this.y-C.y,this.x-C.x)},angleWith:function(C){return this.angleWithSep(C.x,C.y)},angleWithSep:function(C,F){return Math.atan2(this.x*F-this.y*C,this.x*C+this.y*F)},_matMult:function(C){var F=C[0]*this.x+C[1]*this.y,J=C[2]*this.x+C[3]*this.y;return this.x=F,this.y=J,this},_add:function(C){return this.x+=C.x,this.y+=C.y,this},_sub:function(C){return this.x-=C.x,this.y-=C.y,this},_mult:function(C){return this.x*=C,this.y*=C,this},_div:function(C){return this.x/=C,this.y/=C,this},_multByPoint:function(C){return this.x*=C.x,this.y*=C.y,this},_divByPoint:function(C){return this.x/=C.x,this.y/=C.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var C=this.y;return this.y=this.x,this.x=-C,this},_rotate:function(C){var F=Math.cos(C),J=Math.sin(C),oe=F*this.x-J*this.y,pe=J*this.x+F*this.y;return this.x=oe,this.y=pe,this},_rotateAround:function(C,F){var J=Math.cos(C),oe=Math.sin(C),pe=F.x+J*(this.x-F.x)-oe*(this.y-F.y),xe=F.y+oe*(this.x-F.x)+J*(this.y-F.y);return this.x=pe,this.y=xe,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},m.convert=function(C){return C instanceof m?C:Array.isArray(C)?new m(C[0],C[1]):C};var p=g(.25,.1,.25,1);function v(C,F,J){return Math.min(J,Math.max(F,C))}function y(C,F,J){var oe=J-F,pe=((C-F)%oe+oe)%oe+F;return pe===F?J:pe}function x(C){for(var F=[],J=arguments.length-1;J-- >0;)F[J]=arguments[J+1];for(var oe=0,pe=F;oe>F/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,C)}()}function T(C){return!!C&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(C)}function _(C,F){C.forEach(function(J){F[J]&&(F[J]=F[J].bind(F))})}function M(C,F){return C.indexOf(F,C.length-F.length)!==-1}function A(C,F,J){var oe={};for(var pe in C)oe[pe]=F.call(J||this,C[pe],pe,C);return oe}function S(C,F,J){var oe={};for(var pe in C)F.call(J||this,C[pe],pe,C)&&(oe[pe]=C[pe]);return oe}function E(C){return Array.isArray(C)?C.map(E):typeof C=="object"&&C?A(C,E):C}var D={};function O(C){D[C]||(typeof console<"u"&&console.warn(C),D[C]=!0)}function R(C,F,J){return(J.y-C.y)*(F.x-C.x)>(F.y-C.y)*(J.x-C.x)}function z(C){for(var F=0,J=0,oe=C.length,pe=oe-1,xe=void 0,Ce=void 0;J@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(oe,pe,xe,Ce){var Ne=xe||Ce;return F[pe]=!Ne||Ne.toLowerCase(),""}),F["max-age"]){var J=parseInt(F["max-age"],10);isNaN(J)?delete F["max-age"]:F["max-age"]=J}return F}var N=null;function B(C){if(N==null){var F=C.navigator?C.navigator.userAgent:null;N=!!C.safari||!(!F||!(/\b(iPad|iPhone|iPod)\b/.test(F)||F.match("Safari")&&!F.match("Chrome")))}return N}function G(C){try{var F=self[C];return F.setItem("_mapbox_test_",1),F.removeItem("_mapbox_test_"),!0}catch{return!1}}var W,K,te,Y,Z=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),re=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,U=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,q={now:Z,frame:function(C){var F=re(C);return{cancel:function(){return U(F)}}},getImageData:function(C,F){F===void 0&&(F=0);var J=self.document.createElement("canvas"),oe=J.getContext("2d");if(!oe)throw new Error("failed to create canvas 2d context");return J.width=C.width,J.height=C.height,oe.drawImage(C,0,0,C.width,C.height),oe.getImageData(-F,-F,C.width+2*F,C.height+2*F)},resolveURL:function(C){return W||(W=self.document.createElement("a")),W.href=C,W.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(K==null&&(K=self.matchMedia("(prefers-reduced-motion: reduce)")),K.matches)}},$={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"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},ne={supported:!1,testSupport:function(C){H||!Y||(Q?ee(C):te=C)}},H=!1,Q=!1;function ee(C){var F=C.createTexture();C.bindTexture(C.TEXTURE_2D,F);try{if(C.texImage2D(C.TEXTURE_2D,0,C.RGBA,C.RGBA,C.UNSIGNED_BYTE,Y),C.isContextLost())return;ne.supported=!0}catch{}C.deleteTexture(F),H=!0}self.document&&((Y=self.document.createElement("img")).onload=function(){te&&ee(te),te=null,Q=!0},Y.onerror=function(){H=!0,te=null},Y.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var ie="01",ae=function(C,F){this._transformRequestFn=C,this._customAccessToken=F,this._createSkuToken()};function ue(C){return C.indexOf("mapbox:")===0}ae.prototype._createSkuToken=function(){var C=function(){for(var F="",J=0;J<10;J++)F+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",ie,F].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},ae.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ae.prototype.transformRequest=function(C,F){return this._transformRequestFn&&this._transformRequestFn(C,F)||{url:C}},ae.prototype.normalizeStyleURL=function(C,F){if(!ue(C))return C;var J=me(C);return J.path="/styles/v1"+J.path,this._makeAPIURL(J,this._customAccessToken||F)},ae.prototype.normalizeGlyphsURL=function(C,F){if(!ue(C))return C;var J=me(C);return J.path="/fonts/v1"+J.path,this._makeAPIURL(J,this._customAccessToken||F)},ae.prototype.normalizeSourceURL=function(C,F){if(!ue(C))return C;var J=me(C);return J.path="/v4/"+J.authority+".json",J.params.push("secure"),this._makeAPIURL(J,this._customAccessToken||F)},ae.prototype.normalizeSpriteURL=function(C,F,J,oe){var pe=me(C);return ue(C)?(pe.path="/styles/v1"+pe.path+"/sprite"+F+J,this._makeAPIURL(pe,this._customAccessToken||oe)):(pe.path+=""+F+J,_e(pe))},ae.prototype.normalizeTileURL=function(C,F){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!ue(C))return C;var J=me(C),oe=q.devicePixelRatio>=2||F===512?"@2x":"",pe=ne.supported?".webp":"$1";J.path=J.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+oe+pe),J.path=J.path.replace(/^.+\/v4\//,"/"),J.path="/v4"+J.path;var xe=this._customAccessToken||function(Ce){for(var Ne=0,Ze=Ce;Ne=1&&self.localStorage.setItem(F,JSON.stringify(this.eventData))}catch{O("Unable to write to LocalStorage")}},Te.prototype.processRequests=function(C){},Te.prototype.postEvent=function(C,F,J,oe){var pe=this;if($.EVENTS_URL){var xe=me($.EVENTS_URL);xe.params.push("access_token="+(oe||$.ACCESS_TOKEN||""));var Ce={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:ie,userId:this.anonId},Ne=F?x(Ce,F):Ce,Ze={url:_e(xe),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Ne])};this.pendingRequest=Wt(Ze,function(ct){pe.pendingRequest=null,J(ct),pe.saveEventData(),pe.processRequests(oe)})}},Te.prototype.queueRequest=function(C,F){this.queue.push(C),this.processRequests(F)};var Oe,de,ye=function(C){function F(){C.call(this,"map.load"),this.success={},this.skuToken=""}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.postMapLoadEvent=function(J,oe,pe,xe){this.skuToken=pe,($.EVENTS_URL&&xe||$.ACCESS_TOKEN&&Array.isArray(J)&&J.some(function(Ce){return ue(Ce)||ge(Ce)}))&&this.queueRequest({id:oe,timestamp:Date.now()},xe)},F.prototype.processRequests=function(J){var oe=this;if(!this.pendingRequest&&this.queue.length!==0){var pe=this.queue.shift(),xe=pe.id,Ce=pe.timestamp;xe&&this.success[xe]||(this.anonId||this.fetchEventData(),T(this.anonId)||(this.anonId=b()),this.postEvent(Ce,{skuToken:this.skuToken},function(Ne){Ne||xe&&(oe.success[xe]=!0)},J))}},F}(Te),Me=new(function(C){function F(J){C.call(this,"appUserTurnstile"),this._customAccessToken=J}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.postTurnstileEvent=function(J,oe){$.EVENTS_URL&&$.ACCESS_TOKEN&&Array.isArray(J)&&J.some(function(pe){return ue(pe)||ge(pe)})&&this.queueRequest(Date.now(),oe)},F.prototype.processRequests=function(J){var oe=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var pe=we($.ACCESS_TOKEN),xe=pe?pe.u:$.ACCESS_TOKEN,Ce=xe!==this.eventData.tokenU;T(this.anonId)||(this.anonId=b(),Ce=!0);var Ne=this.queue.shift();if(this.eventData.lastSuccess){var Ze=new Date(this.eventData.lastSuccess),ct=new Date(Ne),gt=(Ne-this.eventData.lastSuccess)/864e5;Ce=Ce||gt>=1||gt<-1||Ze.getDate()!==ct.getDate()}else Ce=!0;if(!Ce)return this.processRequests();this.postEvent(Ne,{"enabled.telemetry":!1},function(Bt){Bt||(oe.eventData.lastSuccess=Ne,oe.eventData.tokenU=xe)},J)}},F}(Te)),ke=Me.postTurnstileEvent.bind(Me),Ee=new ye,ze=Ee.postMapLoadEvent.bind(Ee),Fe=500,Ve=50;function Ke(){self.caches&&!Oe&&(Oe=self.caches.open("mapbox-tiles"))}function Re(C,F,J){if(Ke(),Oe){var oe={status:F.status,statusText:F.statusText,headers:new self.Headers};F.headers.forEach(function(xe,Ce){return oe.headers.set(Ce,xe)});var pe=P(F.headers.get("Cache-Control")||"");pe["no-store"]||(pe["max-age"]&&oe.headers.set("Expires",new Date(J+1e3*pe["max-age"]).toUTCString()),new Date(oe.headers.get("Expires")).getTime()-J<42e4||function(xe,Ce){if(de===void 0)try{new Response(new ReadableStream),de=!0}catch{de=!1}de?Ce(xe.body):xe.blob().then(Ce)}(F,function(xe){var Ce=new self.Response(xe,oe);Ke(),Oe&&Oe.then(function(Ne){return Ne.put(qe(C.url),Ce)}).catch(function(Ne){return O(Ne.message)})}))}}function qe(C){var F=C.indexOf("?");return F<0?C:C.slice(0,F)}function We(C,F){if(Ke(),!Oe)return F(null);var J=qe(C.url);Oe.then(function(oe){oe.match(J).then(function(pe){var xe=function(Ce){if(!Ce)return!1;var Ne=new Date(Ce.headers.get("Expires")||0),Ze=P(Ce.headers.get("Cache-Control")||"");return Ne>Date.now()&&!Ze["no-cache"]}(pe);oe.delete(J),xe&&oe.put(J,pe.clone()),F(null,pe,xe)}).catch(F)}).catch(F)}var Ye,nt=1/0;function ft(){return Ye==null&&(Ye=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&typeof self.createImageBitmap=="function"),Ye}var vt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(vt);var Pt=function(C){function F(J,oe,pe){oe===401&&ge(pe)&&(J+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),C.call(this,J),this.status=oe,this.url=pe,this.name=this.constructor.name,this.message=J}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},F}(Error),At=L()?function(){return self.worker&&self.worker.referrer}:function(){return(self.location.protocol==="blob:"?self.parent:self).location.href};function at(C,F){var J,oe=new self.AbortController,pe=new self.Request(C.url,{method:C.method||"GET",body:C.body,credentials:C.credentials,headers:C.headers,referrer:At(),signal:oe.signal}),xe=!1,Ce=!1,Ne=(J=pe.url).indexOf("sku=")>0&&ge(J);C.type==="json"&&pe.headers.set("Accept","application/json");var Ze=function(gt,Bt,Xt){if(!Ce){if(gt&>.message!=="SecurityError"&&O(gt),Bt&&Xt)return ct(Bt);var Gt=Date.now();self.fetch(pe).then(function(on){if(on.ok){var vn=Ne?on.clone():null;return ct(on,vn,Gt)}return F(new Pt(on.statusText,on.status,C.url))}).catch(function(on){on.code!==20&&F(new Error(on.message))})}},ct=function(gt,Bt,Xt){(C.type==="arrayBuffer"?gt.arrayBuffer():C.type==="json"?gt.json():gt.text()).then(function(Gt){Ce||(Bt&&Xt&&Re(pe,Bt,Xt),xe=!0,F(null,Gt,gt.headers.get("Cache-Control"),gt.headers.get("Expires")))}).catch(function(Gt){Ce||F(new Error(Gt.message))})};return Ne?We(pe,Ze):Ze(null,null),{cancel:function(){Ce=!0,xe||oe.abort()}}}var et=function(C,F){if(J=C.url,!(/^file:/.test(J)||/^file:/.test(At())&&!/^\w+:/.test(J))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return at(C,F);if(L()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",C,F,void 0,!0)}var J;return function(oe,pe){var xe=new self.XMLHttpRequest;for(var Ce in xe.open(oe.method||"GET",oe.url,!0),oe.type==="arrayBuffer"&&(xe.responseType="arraybuffer"),oe.headers)xe.setRequestHeader(Ce,oe.headers[Ce]);return oe.type==="json"&&(xe.responseType="text",xe.setRequestHeader("Accept","application/json")),xe.withCredentials=oe.credentials==="include",xe.onerror=function(){pe(new Error(xe.statusText))},xe.onload=function(){if((xe.status>=200&&xe.status<300||xe.status===0)&&xe.response!==null){var Ne=xe.response;if(oe.type==="json")try{Ne=JSON.parse(xe.response)}catch(Ze){return pe(Ze)}pe(null,Ne,xe.getResponseHeader("Cache-Control"),xe.getResponseHeader("Expires"))}else pe(new Pt(xe.statusText,xe.status,oe.url))},xe.send(oe.body),{cancel:function(){return xe.abort()}}}(C,F)},Ot=function(C,F){return et(x(C,{type:"arrayBuffer"}),F)},Wt=function(C,F){return et(x(C,{method:"POST"}),F)},Jt,Be;Jt=[],Be=0;var Ge=function(C,F){if(ne.supported&&(C.headers||(C.headers={}),C.headers.accept="image/webp,*/*"),Be>=$.MAX_PARALLEL_IMAGE_REQUESTS){var J={requestParameters:C,callback:F,cancelled:!1,cancel:function(){this.cancelled=!0}};return Jt.push(J),J}Be++;var oe=!1,pe=function(){if(!oe)for(oe=!0,Be--;Jt.length&&Be<$.MAX_PARALLEL_IMAGE_REQUESTS;){var Ce=Jt.shift(),Ne=Ce.requestParameters,Ze=Ce.callback;Ce.cancelled||(Ce.cancel=Ge(Ne,Ze).cancel)}},xe=Ot(C,function(Ce,Ne,Ze,ct){pe(),Ce?F(Ce):Ne&&(ft()?function(gt,Bt){var Xt=new self.Blob([new Uint8Array(gt)],{type:"image/png"});self.createImageBitmap(Xt).then(function(Gt){Bt(null,Gt)}).catch(function(Gt){Bt(new Error("Could not load image because of "+Gt.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(Ne,F):function(gt,Bt,Xt,Gt){var on=new self.Image,vn=self.URL;on.onload=function(){Bt(null,on),vn.revokeObjectURL(on.src)},on.onerror=function(){return Bt(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 Cn=new self.Blob([new Uint8Array(gt)],{type:"image/png"});on.cacheControl=Xt,on.expires=Gt,on.src=gt.byteLength?vn.createObjectURL(Cn):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}(Ne,F,Ze,ct))});return{cancel:function(){xe.cancel(),pe()}}};function Tt(C,F,J){J[C]&&J[C].indexOf(F)!==-1||(J[C]=J[C]||[],J[C].push(F))}function dt(C,F,J){if(J&&J[C]){var oe=J[C].indexOf(F);oe!==-1&&J[C].splice(oe,1)}}var Pe=function(C,F){F===void 0&&(F={}),x(this,F),this.type=C},Ie=function(C){function F(J,oe){oe===void 0&&(oe={}),C.call(this,"error",x({error:J},oe))}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F}(Pe),Ae=function(){};Ae.prototype.on=function(C,F){return this._listeners=this._listeners||{},Tt(C,F,this._listeners),this},Ae.prototype.off=function(C,F){return dt(C,F,this._listeners),dt(C,F,this._oneTimeListeners),this},Ae.prototype.once=function(C,F){return this._oneTimeListeners=this._oneTimeListeners||{},Tt(C,F,this._oneTimeListeners),this},Ae.prototype.fire=function(C,F){typeof C=="string"&&(C=new Pe(C,F||{}));var J=C.type;if(this.listens(J)){C.target=this;for(var oe=0,pe=this._listeners&&this._listeners[J]?this._listeners[J].slice():[];oe0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},Ae.prototype.setEventedParent=function(C,F){return this._eventedParent=C,this._eventedParentData=F,this};var De={$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"},"*":{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"},"*":{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"},"*":{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},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{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},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},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"}}},He=function(C,F,J,oe){this.message=(C?C+": ":"")+J,oe&&(this.identifier=oe),F!=null&&F.__line__&&(this.line=F.__line__)};function rt(C){var F=C.key,J=C.value;return J?[new He(F,J,"constants have been deprecated as of v8")]:[]}function lt(C){for(var F=[],J=arguments.length-1;J-- >0;)F[J]=arguments[J+1];for(var oe=0,pe=F;oe":C.itemType.kind==="value"?"array":"array<"+F+">"}return C.kind}var Kt=[Ut,tt,bt,zt,St,st,Dt,It(Le),Et];function Ht(C,F){if(F.kind==="error")return null;if(C.kind==="array"){if(F.kind==="array"&&(F.N===0&&F.itemType.kind==="value"||!Ht(C.itemType,F.itemType))&&(typeof C.N!="number"||C.N===F.N))return null}else{if(C.kind===F.kind)return null;if(C.kind==="value"){for(var J=0,oe=Kt;J255?255:Ze}function pe(Ze){return Ze<0?0:Ze>1?1:Ze}function xe(Ze){return Ze[Ze.length-1]==="%"?oe(parseFloat(Ze)/100*255):oe(parseInt(Ze))}function Ce(Ze){return Ze[Ze.length-1]==="%"?pe(parseFloat(Ze)/100):pe(parseFloat(Ze))}function Ne(Ze,ct,gt){return gt<0?gt+=1:gt>1&&(gt-=1),6*gt<1?Ze+(ct-Ze)*gt*6:2*gt<1?ct:3*gt<2?Ze+(ct-Ze)*(2/3-gt)*6:Ze}try{F.parseCSSColor=function(Ze){var ct,gt=Ze.replace(/ /g,"").toLowerCase();if(gt in J)return J[gt].slice();if(gt[0]==="#")return gt.length===4?(ct=parseInt(gt.substr(1),16))>=0&&ct<=4095?[(3840&ct)>>4|(3840&ct)>>8,240&ct|(240&ct)>>4,15&ct|(15&ct)<<4,1]:null:gt.length===7&&(ct=parseInt(gt.substr(1),16))>=0&&ct<=16777215?[(16711680&ct)>>16,(65280&ct)>>8,255&ct,1]:null;var Bt=gt.indexOf("("),Xt=gt.indexOf(")");if(Bt!==-1&&Xt+1===gt.length){var Gt=gt.substr(0,Bt),on=gt.substr(Bt+1,Xt-(Bt+1)).split(","),vn=1;switch(Gt){case"rgba":if(on.length!==4)return null;vn=Ce(on.pop());case"rgb":return on.length!==3?null:[xe(on[0]),xe(on[1]),xe(on[2]),vn];case"hsla":if(on.length!==4)return null;vn=Ce(on.pop());case"hsl":if(on.length!==3)return null;var Cn=(parseFloat(on[0])%360+360)%360/360,En=Ce(on[1]),Vn=Ce(on[2]),qn=Vn<=.5?Vn*(En+1):Vn+En-Vn*En,Xn=2*Vn-qn;return[oe(255*Ne(Xn,qn,Cn+1/3)),oe(255*Ne(Xn,qn,Cn)),oe(255*Ne(Xn,qn,Cn-1/3)),vn];default:return null}}return null}}catch{}}).parseCSSColor,tn=function(C,F,J,oe){oe===void 0&&(oe=1),this.r=C,this.g=F,this.b=J,this.a=oe};tn.parse=function(C){if(C){if(C instanceof tn)return C;if(typeof C=="string"){var F=pn(C);if(F)return new tn(F[0]/255*F[3],F[1]/255*F[3],F[2]/255*F[3],F[3])}}},tn.prototype.toString=function(){var C=this.toArray(),F=C[0],J=C[1],oe=C[2],pe=C[3];return"rgba("+Math.round(F)+","+Math.round(J)+","+Math.round(oe)+","+pe+")"},tn.prototype.toArray=function(){var C=this.r,F=this.g,J=this.b,oe=this.a;return oe===0?[0,0,0,0]:[255*C/oe,255*F/oe,255*J/oe,oe]},tn.black=new tn(0,0,0,1),tn.white=new tn(1,1,1,1),tn.transparent=new tn(0,0,0,0),tn.red=new tn(1,0,0,1);var nn=function(C,F,J){this.sensitivity=C?F?"variant":"case":F?"accent":"base",this.locale=J,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};nn.prototype.compare=function(C,F){return this.collator.compare(C,F)},nn.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var sn=function(C,F,J,oe,pe){this.text=C,this.image=F,this.scale=J,this.fontStack=oe,this.textColor=pe},gn=function(C){this.sections=C};gn.fromString=function(C){return new gn([new sn(C,null,null,null,null)])},gn.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},gn.factory=function(C){return C instanceof gn?C:gn.fromString(C)},gn.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},gn.prototype.serialize=function(){for(var C=["format"],F=0,J=this.sections;F=0&&C<=255&&typeof F=="number"&&F>=0&&F<=255&&typeof J=="number"&&J>=0&&J<=255?oe===void 0||typeof oe=="number"&&oe>=0&&oe<=1?null:"Invalid rgba value ["+[C,F,J,oe].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof oe=="number"?[C,F,J,oe]:[C,F,J]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Hn(C){if(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number"||C instanceof tn||C instanceof nn||C instanceof gn||C instanceof bn)return!0;if(Array.isArray(C)){for(var F=0,J=C;F2){var Ne=C[1];if(typeof Ne!="string"||!(Ne in Er)||Ne==="object")return F.error('The item type argument of "array" must be one of string, number, boolean',1);xe=Er[Ne],oe++}else xe=Le;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return F.error('The length argument to "array" must be a positive integer literal',2);Ce=C[2],oe++}J=It(xe,Ce)}else J=Er[pe];for(var Ze=[];oe1)&&F.push(oe)}}return F.concat(this.args.map(function(pe){return pe.serialize()}))};var Ln=function(C){this.type=st,this.sections=C};Ln.parse=function(C,F){if(C.length<2)return F.error("Expected at least one argument.");var J=C[1];if(!Array.isArray(J)&&typeof J=="object")return F.error("First argument must be an image or text section.");for(var oe=[],pe=!1,xe=1;xe<=C.length-1;++xe){var Ce=C[xe];if(pe&&typeof Ce=="object"&&!Array.isArray(Ce)){pe=!1;var Ne=null;if(Ce["font-scale"]&&!(Ne=F.parse(Ce["font-scale"],1,tt)))return null;var Ze=null;if(Ce["text-font"]&&!(Ze=F.parse(Ce["text-font"],1,It(bt))))return null;var ct=null;if(Ce["text-color"]&&!(ct=F.parse(Ce["text-color"],1,St)))return null;var gt=oe[oe.length-1];gt.scale=Ne,gt.font=Ze,gt.textColor=ct}else{var Bt=F.parse(C[xe],1,Le);if(!Bt)return null;var Xt=Bt.type.kind;if(Xt!=="string"&&Xt!=="value"&&Xt!=="null"&&Xt!=="resolvedImage")return F.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");pe=!0,oe.push({content:Bt,scale:null,font:null,textColor:null})}}return new Ln(oe)},Ln.prototype.evaluate=function(C){return new gn(this.sections.map(function(F){var J=F.content.evaluate(C);return Wn(J)===Et?new sn("",J,null,null,null):new sn(ar(J),null,F.scale?F.scale.evaluate(C):null,F.font?F.font.evaluate(C).join(","):null,F.textColor?F.textColor.evaluate(C):null)}))},Ln.prototype.eachChild=function(C){for(var F=0,J=this.sections;F-1),J},lr.prototype.eachChild=function(C){C(this.input)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){return["image",this.input.serialize()]};var Wr={"to-boolean":zt,"to-color":St,"to-number":tt,"to-string":bt},Mn=function(C,F){this.type=C,this.args=F};Mn.parse=function(C,F){if(C.length<2)return F.error("Expected at least one argument.");var J=C[0];if((J==="to-boolean"||J==="to-string")&&C.length!==2)return F.error("Expected one argument.");for(var oe=Wr[J],pe=[],xe=1;xe4?"Invalid rbga value "+JSON.stringify(F)+": expected an array containing either three or four numeric values.":In(F[0],F[1],F[2],F[3])))return new tn(F[0]/255,F[1]/255,F[2]/255,F[3])}throw new vr(J||"Could not parse color from value '"+(typeof F=="string"?F:String(JSON.stringify(F)))+"'")}if(this.type.kind==="number"){for(var Ce=null,Ne=0,Ze=this.args;Ne=F[2])&&!(C[1]<=F[1])&&!(C[3]>=F[3])}function qr(C,F){var J,oe=(180+C[0])/360,pe=(J=C[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+J*Math.PI/360)))/360),xe=Math.pow(2,F.z);return[Math.round(oe*xe*8192),Math.round(pe*xe*8192)]}function _i(C,F,J){return F[1]>C[1]!=J[1]>C[1]&&C[0]<(J[0]-F[0])*(C[1]-F[1])/(J[1]-F[1])+F[0]}function cn(C,F){for(var J,oe,pe,xe,Ce,Ne,Ze,ct=!1,gt=0,Bt=F.length;gt0&&Bt<0||gt<0&&Bt>0}function fn(C,F,J){for(var oe=0,pe=J;oeJ[2]){var pe=.5*oe,xe=C[0]-J[0]>pe?-oe:J[0]-C[0]>pe?oe:0;xe===0&&(xe=C[0]-J[2]>pe?-oe:J[2]-C[0]>pe?oe:0),C[0]+=xe}$r(F,C)}function wn(C,F,J,oe){for(var pe=8192*Math.pow(2,oe.z),xe=[8192*oe.x,8192*oe.y],Ce=[],Ne=0,Ze=C;Ne=0)return!1;var J=!0;return C.eachChild(function(oe){J&&!Yn(oe,F)&&(J=!1)}),J}Tn.parse=function(C,F){if(C.length!==2)return F.error("'within' expression requires exactly one argument, but found "+(C.length-1)+" instead.");if(Hn(C[1])){var J=C[1];if(J.type==="FeatureCollection")for(var oe=0;oeF))throw new vr("Input is not a number.");Ce=Ne-1}return 0}or.prototype.parse=function(C,F,J,oe,pe){return pe===void 0&&(pe={}),F?this.concat(F,J,oe)._parse(C,pe):this._parse(C,pe)},or.prototype._parse=function(C,F){function J(ct,gt,Bt){return Bt==="assert"?new Kn(gt,[ct]):Bt==="coerce"?new Mn(gt,[ct]):ct}if(C!==null&&typeof C!="string"&&typeof C!="boolean"&&typeof C!="number"||(C=["literal",C]),Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var oe=C[0];if(typeof oe!="string")return this.error("Expression name must be a string, but found "+typeof oe+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var pe=this.registry[oe];if(pe){var xe=pe.parse(C,this);if(!xe)return null;if(this.expectedType){var Ce=this.expectedType,Ne=xe.type;if(Ce.kind!=="string"&&Ce.kind!=="number"&&Ce.kind!=="boolean"&&Ce.kind!=="object"&&Ce.kind!=="array"||Ne.kind!=="value")if(Ce.kind!=="color"&&Ce.kind!=="formatted"&&Ce.kind!=="resolvedImage"||Ne.kind!=="value"&&Ne.kind!=="string"){if(this.checkSubtype(Ce,Ne))return null}else xe=J(xe,Ce,F.typeAnnotation||"coerce");else xe=J(xe,Ce,F.typeAnnotation||"assert")}if(!(xe instanceof Or)&&xe.type.kind!=="resolvedImage"&&function ct(gt){if(gt instanceof ir)return ct(gt.boundExpression);if(gt instanceof Bn&>.name==="error"||gt instanceof Fr||gt instanceof Tn)return!1;var Bt=gt instanceof Mn||gt instanceof Kn,Xt=!0;return gt.eachChild(function(Gt){Xt=Bt?Xt&&ct(Gt):Xt&&Gt instanceof Or}),Xt?Dn(gt)&&Yn(gt,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}(xe)){var Ze=new nr;try{xe=new Or(xe.type,xe.evaluate(Ze))}catch(ct){return this.error(ct.message),null}}return xe}return this.error('Unknown expression "'+oe+'". If you wanted a literal array, use ["literal", [...]].',0)}return C===void 0?this.error("'undefined' value invalid. Use null instead."):typeof C=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof C+" instead.")},or.prototype.concat=function(C,F,J){var oe=typeof C=="number"?this.path.concat(C):this.path,pe=J?this.scope.concat(J):this.scope;return new or(this.registry,oe,F||null,pe,this.errors)},or.prototype.error=function(C){for(var F=[],J=arguments.length-1;J-- >0;)F[J]=arguments[J+1];var oe=""+this.key+F.map(function(pe){return"["+pe+"]"}).join("");this.errors.push(new wt(oe,C))},or.prototype.checkSubtype=function(C,F){var J=Ht(C,F);return J&&this.error(J),J};var wr=function(C,F,J){this.type=C,this.input=F,this.labels=[],this.outputs=[];for(var oe=0,pe=J;oe=Ce)return F.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ze);var gt=F.parse(Ne,ct,pe);if(!gt)return null;pe=pe||gt.type,oe.push([Ce,gt])}return new wr(pe,J,oe)},wr.prototype.evaluate=function(C){var F=this.labels,J=this.outputs;if(F.length===1)return J[0].evaluate(C);var oe=this.input.evaluate(C);if(oe<=F[0])return J[0].evaluate(C);var pe=F.length;return oe>=F[pe-1]?J[pe-1].evaluate(C):J[xr(F,oe)].evaluate(C)},wr.prototype.eachChild=function(C){C(this.input);for(var F=0,J=this.outputs;F0&&C.push(this.labels[F]),C.push(this.outputs[F].serialize());return C};var Dr=Object.freeze({__proto__:null,number:kr,color:function(C,F,J){return new tn(kr(C.r,F.r,J),kr(C.g,F.g,J),kr(C.b,F.b,J),kr(C.a,F.a,J))},array:function(C,F,J){return C.map(function(oe,pe){return kr(oe,F[pe],J)})}}),Nr=6/29,ri=3*Nr*Nr,ji=Math.PI/180,Bi=180/Math.PI;function Sr(C){return C>.008856451679035631?Math.pow(C,1/3):C/ri+4/29}function ui(C){return C>Nr?C*C*C:ri*(C-4/29)}function si(C){return 255*(C<=.0031308?12.92*C:1.055*Math.pow(C,1/2.4)-.055)}function ta(C){return(C/=255)<=.04045?C/12.92:Math.pow((C+.055)/1.055,2.4)}function Ja(C){var F=ta(C.r),J=ta(C.g),oe=ta(C.b),pe=Sr((.4124564*F+.3575761*J+.1804375*oe)/.95047),xe=Sr((.2126729*F+.7151522*J+.072175*oe)/1);return{l:116*xe-16,a:500*(pe-xe),b:200*(xe-Sr((.0193339*F+.119192*J+.9503041*oe)/1.08883)),alpha:C.a}}function Ao(C){var F=(C.l+16)/116,J=isNaN(C.a)?F:F+C.a/500,oe=isNaN(C.b)?F:F-C.b/200;return F=1*ui(F),J=.95047*ui(J),oe=1.08883*ui(oe),new tn(si(3.2404542*J-1.5371385*F-.4985314*oe),si(-.969266*J+1.8760108*F+.041556*oe),si(.0556434*J-.2040259*F+1.0572252*oe),C.alpha)}function fs(C,F,J){var oe=F-C;return C+J*(oe>180||oe<-180?oe-360*Math.round(oe/360):oe)}var ya={forward:Ja,reverse:Ao,interpolate:function(C,F,J){return{l:kr(C.l,F.l,J),a:kr(C.a,F.a,J),b:kr(C.b,F.b,J),alpha:kr(C.alpha,F.alpha,J)}}},xa={forward:function(C){var F=Ja(C),J=F.l,oe=F.a,pe=F.b,xe=Math.atan2(pe,oe)*Bi;return{h:xe<0?xe+360:xe,c:Math.sqrt(oe*oe+pe*pe),l:J,alpha:C.a}},reverse:function(C){var F=C.h*ji,J=C.c;return Ao({l:C.l,a:Math.cos(F)*J,b:Math.sin(F)*J,alpha:C.alpha})},interpolate:function(C,F,J){return{h:fs(C.h,F.h,J),c:kr(C.c,F.c,J),l:kr(C.l,F.l,J),alpha:kr(C.alpha,F.alpha,J)}}},Zo=Object.freeze({__proto__:null,lab:ya,hcl:xa}),oa=function(C,F,J,oe,pe){this.type=C,this.operator=F,this.interpolation=J,this.input=oe,this.labels=[],this.outputs=[];for(var xe=0,Ce=pe;xe1}))return F.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);oe={name:"cubic-bezier",controlPoints:Ne}}if(C.length-1<4)return F.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!=0)return F.error("Expected an even number of arguments.");if(!(pe=F.parse(pe,2,tt)))return null;var Ze=[],ct=null;J==="interpolate-hcl"||J==="interpolate-lab"?ct=St:F.expectedType&&F.expectedType.kind!=="value"&&(ct=F.expectedType);for(var gt=0;gt=Bt)return F.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Gt);var vn=F.parse(Xt,on,ct);if(!vn)return null;ct=ct||vn.type,Ze.push([Bt,vn])}return ct.kind==="number"||ct.kind==="color"||ct.kind==="array"&&ct.itemType.kind==="number"&&typeof ct.N=="number"?new oa(ct,J,oe,pe,Ze):F.error("Type "+Zt(ct)+" is not interpolatable.")},oa.prototype.evaluate=function(C){var F=this.labels,J=this.outputs;if(F.length===1)return J[0].evaluate(C);var oe=this.input.evaluate(C);if(oe<=F[0])return J[0].evaluate(C);var pe=F.length;if(oe>=F[pe-1])return J[pe-1].evaluate(C);var xe=xr(F,oe),Ce=F[xe],Ne=F[xe+1],Ze=oa.interpolationFactor(this.interpolation,oe,Ce,Ne),ct=J[xe].evaluate(C),gt=J[xe+1].evaluate(C);return this.operator==="interpolate"?Dr[this.type.kind.toLowerCase()](ct,gt,Ze):this.operator==="interpolate-hcl"?xa.reverse(xa.interpolate(xa.forward(ct),xa.forward(gt),Ze)):ya.reverse(ya.interpolate(ya.forward(ct),ya.forward(gt),Ze))},oa.prototype.eachChild=function(C){C(this.input);for(var F=0,J=this.outputs;F=J.length)throw new vr("Array index out of bounds: "+F+" > "+(J.length-1)+".");if(F!==Math.floor(F))throw new vr("Array index must be an integer, but found "+F+" instead.");return J[F]},Jo.prototype.eachChild=function(C){C(this.index),C(this.input)},Jo.prototype.outputDefined=function(){return!1},Jo.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var _s=function(C,F){this.type=zt,this.needle=C,this.haystack=F};_s.parse=function(C,F){if(C.length!==3)return F.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var J=F.parse(C[1],1,Le),oe=F.parse(C[2],2,Le);return J&&oe?mn(J.type,[zt,bt,tt,Ut,Le])?new _s(J,oe):F.error("Expected first argument to be of type boolean, string, number or null, but found "+Zt(J.type)+" instead"):null},_s.prototype.evaluate=function(C){var F=this.needle.evaluate(C),J=this.haystack.evaluate(C);if(!J)return!1;if(!zn(F,["boolean","string","number","null"]))throw new vr("Expected first argument to be of type boolean, string, number or null, but found "+Zt(Wn(F))+" instead.");if(!zn(J,["string","array"]))throw new vr("Expected second argument to be of type array or string, but found "+Zt(Wn(J))+" instead.");return J.indexOf(F)>=0},_s.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},_s.prototype.outputDefined=function(){return!0},_s.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ls=function(C,F,J){this.type=tt,this.needle=C,this.haystack=F,this.fromIndex=J};Ls.parse=function(C,F){if(C.length<=2||C.length>=5)return F.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var J=F.parse(C[1],1,Le),oe=F.parse(C[2],2,Le);if(!J||!oe)return null;if(!mn(J.type,[zt,bt,tt,Ut,Le]))return F.error("Expected first argument to be of type boolean, string, number or null, but found "+Zt(J.type)+" instead");if(C.length===4){var pe=F.parse(C[3],3,tt);return pe?new Ls(J,oe,pe):null}return new Ls(J,oe)},Ls.prototype.evaluate=function(C){var F=this.needle.evaluate(C),J=this.haystack.evaluate(C);if(!zn(F,["boolean","string","number","null"]))throw new vr("Expected first argument to be of type boolean, string, number or null, but found "+Zt(Wn(F))+" instead.");if(!zn(J,["string","array"]))throw new vr("Expected second argument to be of type array or string, but found "+Zt(Wn(J))+" instead.");if(this.fromIndex){var oe=this.fromIndex.evaluate(C);return J.indexOf(F,oe)}return J.indexOf(F)},Ls.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},Ls.prototype.outputDefined=function(){return!1},Ls.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var C=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),C]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Oo=function(C,F,J,oe,pe,xe){this.inputType=C,this.type=F,this.input=J,this.cases=oe,this.outputs=pe,this.otherwise=xe};Oo.parse=function(C,F){if(C.length<5)return F.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!=1)return F.error("Expected an even number of arguments.");var J,oe;F.expectedType&&F.expectedType.kind!=="value"&&(oe=F.expectedType);for(var pe={},xe=[],Ce=2;CeNumber.MAX_SAFE_INTEGER)return ct.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Xt=="number"&&Math.floor(Xt)!==Xt)return ct.error("Numeric branch labels must be integer values.");if(J){if(ct.checkSubtype(J,Wn(Xt)))return null}else J=Wn(Xt);if(pe[String(Xt)]!==void 0)return ct.error("Branch labels must be unique.");pe[String(Xt)]=xe.length}var Gt=F.parse(Ze,Ce,oe);if(!Gt)return null;oe=oe||Gt.type,xe.push(Gt)}var on=F.parse(C[1],1,Le);if(!on)return null;var vn=F.parse(C[C.length-1],C.length-1,oe);return vn?on.type.kind!=="value"&&F.concat(1).checkSubtype(J,on.type)?null:new Oo(J,oe,on,pe,xe,vn):null},Oo.prototype.evaluate=function(C){var F=this.input.evaluate(C);return(Wn(F)===this.inputType&&this.outputs[this.cases[F]]||this.otherwise).evaluate(C)},Oo.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},Oo.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},Oo.prototype.serialize=function(){for(var C=this,F=["match",this.input.serialize()],J=[],oe={},pe=0,xe=Object.keys(this.cases).sort();pe=5)return F.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var J=F.parse(C[1],1,Le),oe=F.parse(C[2],2,tt);if(!J||!oe)return null;if(!mn(J.type,[It(Le),bt,Le]))return F.error("Expected first argument to be of type array or string, but found "+Zt(J.type)+" instead");if(C.length===4){var pe=F.parse(C[3],3,tt);return pe?new $o(J.type,J,oe,pe):null}return new $o(J.type,J,oe)},$o.prototype.evaluate=function(C){var F=this.input.evaluate(C),J=this.beginIndex.evaluate(C);if(!zn(F,["string","array"]))throw new vr("Expected first argument to be of type array or string, but found "+Zt(Wn(F))+" instead.");if(this.endIndex){var oe=this.endIndex.evaluate(C);return F.slice(J,oe)}return F.slice(J)},$o.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},$o.prototype.outputDefined=function(){return!1},$o.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var C=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),C]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var ju=ba("==",function(C,F,J){return F===J},Mc),Wl=ba("!=",function(C,F,J){return F!==J},function(C,F,J,oe){return!Mc(0,F,J,oe)}),Sc=ba("<",function(C,F,J){return F",function(C,F,J){return F>J},function(C,F,J,oe){return oe.compare(F,J)>0}),ac=ba("<=",function(C,F,J){return F<=J},function(C,F,J,oe){return oe.compare(F,J)<=0}),Cc=ba(">=",function(C,F,J){return F>=J},function(C,F,J,oe){return oe.compare(F,J)>=0}),Ns=function(C,F,J,oe,pe){this.type=bt,this.number=C,this.locale=F,this.currency=J,this.minFractionDigits=oe,this.maxFractionDigits=pe};Ns.parse=function(C,F){if(C.length!==3)return F.error("Expected two arguments.");var J=F.parse(C[1],1,tt);if(!J)return null;var oe=C[2];if(typeof oe!="object"||Array.isArray(oe))return F.error("NumberFormat options argument must be an object.");var pe=null;if(oe.locale&&!(pe=F.parse(oe.locale,1,bt)))return null;var xe=null;if(oe.currency&&!(xe=F.parse(oe.currency,1,bt)))return null;var Ce=null;if(oe["min-fraction-digits"]&&!(Ce=F.parse(oe["min-fraction-digits"],1,tt)))return null;var Ne=null;return oe["max-fraction-digits"]&&!(Ne=F.parse(oe["max-fraction-digits"],1,tt))?null:new Ns(J,pe,xe,Ce,Ne)},Ns.prototype.evaluate=function(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))},Ns.prototype.eachChild=function(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)},Ns.prototype.outputDefined=function(){return!1},Ns.prototype.serialize=function(){var C={};return this.locale&&(C.locale=this.locale.serialize()),this.currency&&(C.currency=this.currency.serialize()),this.minFractionDigits&&(C["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(C["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),C]};var Bs=function(C){this.type=tt,this.input=C};Bs.parse=function(C,F){if(C.length!==2)return F.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var J=F.parse(C[1],1);return J?J.type.kind!=="array"&&J.type.kind!=="string"&&J.type.kind!=="value"?F.error("Expected argument of type string or array, but found "+Zt(J.type)+" instead."):new Bs(J):null},Bs.prototype.evaluate=function(C){var F=this.input.evaluate(C);if(typeof F=="string"||Array.isArray(F))return F.length;throw new vr("Expected value to be of type string or array, but found "+Zt(Wn(F))+" instead.")},Bs.prototype.eachChild=function(C){C(this.input)},Bs.prototype.outputDefined=function(){return!1},Bs.prototype.serialize=function(){var C=["length"];return this.eachChild(function(F){C.push(F.serialize())}),C};var fl={"==":ju,"!=":Wl,">":Ec,"<":Sc,">=":Cc,"<=":ac,array:Kn,at:Jo,boolean:Kn,case:Ka,coalesce:bs,collator:Fr,format:Ln,image:lr,in:_s,"index-of":Ls,interpolate:oa,"interpolate-hcl":oa,"interpolate-lab":oa,length:Bs,let:so,literal:Or,match:Oo,number:Kn,"number-format":Ns,object:Kn,slice:$o,step:wr,string:Kn,"to-boolean":Mn,"to-color":Mn,"to-number":Mn,"to-string":Mn,var:ir,within:Tn};function hl(C,F){var J=F[0],oe=F[1],pe=F[2],xe=F[3];J=J.evaluate(C),oe=oe.evaluate(C),pe=pe.evaluate(C);var Ce=xe?xe.evaluate(C):1,Ne=In(J,oe,pe,Ce);if(Ne)throw new vr(Ne);return new tn(J/255*Ce,oe/255*Ce,pe/255*Ce,Ce)}function dl(C,F){return C in F}function Yl(C,F){var J=F[C];return J===void 0?null:J}function ws(C){return{type:C}}function Uu(C){return{result:"success",value:C}}function ds(C){return{result:"error",value:C}}function pl(C){return C["property-type"]==="data-driven"||C["property-type"]==="cross-faded-data-driven"}function Vu(C){return!!C.expression&&C.expression.parameters.indexOf("zoom")>-1}function js(C){return!!C.expression&&C.expression.interpolated}function ma(C){return C instanceof Number?"number":C instanceof String?"string":C instanceof Boolean?"boolean":Array.isArray(C)?"array":C===null?"null":typeof C}function je(C){return typeof C=="object"&&C!==null&&!Array.isArray(C)}function $e(C){return C}function Qe(C,F,J){return C!==void 0?C:F!==void 0?F:J!==void 0?J:void 0}function ut(C,F,J,oe,pe){return Qe(typeof J===pe?oe[J]:void 0,C.default,F.default)}function mt(C,F,J){if(ma(J)!=="number")return Qe(C.default,F.default);var oe=C.stops.length;if(oe===1||J<=C.stops[0][0])return C.stops[0][1];if(J>=C.stops[oe-1][0])return C.stops[oe-1][1];var pe=xr(C.stops.map(function(xe){return xe[0]}),J);return C.stops[pe][1]}function pt(C,F,J){var oe=C.base!==void 0?C.base:1;if(ma(J)!=="number")return Qe(C.default,F.default);var pe=C.stops.length;if(pe===1||J<=C.stops[0][0])return C.stops[0][1];if(J>=C.stops[pe-1][0])return C.stops[pe-1][1];var xe=xr(C.stops.map(function(Bt){return Bt[0]}),J),Ce=function(Bt,Xt,Gt,on){var vn=on-Gt,Cn=Bt-Gt;return vn===0?0:Xt===1?Cn/vn:(Math.pow(Xt,Cn)-1)/(Math.pow(Xt,vn)-1)}(J,oe,C.stops[xe][0],C.stops[xe+1][0]),Ne=C.stops[xe][1],Ze=C.stops[xe+1][1],ct=Dr[F.type]||$e;if(C.colorSpace&&C.colorSpace!=="rgb"){var gt=Zo[C.colorSpace];ct=function(Bt,Xt){return gt.reverse(gt.interpolate(gt.forward(Bt),gt.forward(Xt),Ce))}}return typeof Ne.evaluate=="function"?{evaluate:function(){for(var Bt=[],Xt=arguments.length;Xt--;)Bt[Xt]=arguments[Xt];var Gt=Ne.evaluate.apply(void 0,Bt),on=Ze.evaluate.apply(void 0,Bt);if(Gt!==void 0&&on!==void 0)return ct(Gt,on,Ce)}}:ct(Ne,Ze,Ce)}function Ct(C,F,J){return F.type==="color"?J=tn.parse(J):F.type==="formatted"?J=gn.fromString(J.toString()):F.type==="resolvedImage"?J=bn.fromString(J.toString()):ma(J)===F.type||F.type==="enum"&&F.values[J]||(J=void 0),Qe(J,C.default,F.default)}Bn.register(fl,{error:[{kind:"error"},[bt],function(C,F){var J=F[0];throw new vr(J.evaluate(C))}],typeof:[bt,[Le],function(C,F){return Zt(Wn(F[0].evaluate(C)))}],"to-rgba":[It(tt,4),[St],function(C,F){return F[0].evaluate(C).toArray()}],rgb:[St,[tt,tt,tt],hl],rgba:[St,[tt,tt,tt,tt],hl],has:{type:zt,overloads:[[[bt],function(C,F){return dl(F[0].evaluate(C),C.properties())}],[[bt,Dt],function(C,F){var J=F[0],oe=F[1];return dl(J.evaluate(C),oe.evaluate(C))}]]},get:{type:Le,overloads:[[[bt],function(C,F){return Yl(F[0].evaluate(C),C.properties())}],[[bt,Dt],function(C,F){var J=F[0],oe=F[1];return Yl(J.evaluate(C),oe.evaluate(C))}]]},"feature-state":[Le,[bt],function(C,F){return Yl(F[0].evaluate(C),C.featureState||{})}],properties:[Dt,[],function(C){return C.properties()}],"geometry-type":[bt,[],function(C){return C.geometryType()}],id:[Le,[],function(C){return C.id()}],zoom:[tt,[],function(C){return C.globals.zoom}],"heatmap-density":[tt,[],function(C){return C.globals.heatmapDensity||0}],"line-progress":[tt,[],function(C){return C.globals.lineProgress||0}],accumulated:[Le,[],function(C){return C.globals.accumulated===void 0?null:C.globals.accumulated}],"+":[tt,ws(tt),function(C,F){for(var J=0,oe=0,pe=F;oe":[zt,[bt,Le],function(C,F){var J=F[0],oe=F[1],pe=C.properties()[J.value],xe=oe.value;return typeof pe==typeof xe&&pe>xe}],"filter-id->":[zt,[Le],function(C,F){var J=F[0],oe=C.id(),pe=J.value;return typeof oe==typeof pe&&oe>pe}],"filter-<=":[zt,[bt,Le],function(C,F){var J=F[0],oe=F[1],pe=C.properties()[J.value],xe=oe.value;return typeof pe==typeof xe&&pe<=xe}],"filter-id-<=":[zt,[Le],function(C,F){var J=F[0],oe=C.id(),pe=J.value;return typeof oe==typeof pe&&oe<=pe}],"filter->=":[zt,[bt,Le],function(C,F){var J=F[0],oe=F[1],pe=C.properties()[J.value],xe=oe.value;return typeof pe==typeof xe&&pe>=xe}],"filter-id->=":[zt,[Le],function(C,F){var J=F[0],oe=C.id(),pe=J.value;return typeof oe==typeof pe&&oe>=pe}],"filter-has":[zt,[Le],function(C,F){return F[0].value in C.properties()}],"filter-has-id":[zt,[],function(C){return C.id()!==null&&C.id()!==void 0}],"filter-type-in":[zt,[It(bt)],function(C,F){return F[0].value.indexOf(C.geometryType())>=0}],"filter-id-in":[zt,[It(Le)],function(C,F){return F[0].value.indexOf(C.id())>=0}],"filter-in-small":[zt,[bt,It(Le)],function(C,F){var J=F[0];return F[1].value.indexOf(C.properties()[J.value])>=0}],"filter-in-large":[zt,[bt,It(Le)],function(C,F){var J=F[0],oe=F[1];return function(pe,xe,Ce,Ne){for(;Ce<=Ne;){var Ze=Ce+Ne>>1;if(xe[Ze]===pe)return!0;xe[Ze]>pe?Ne=Ze-1:Ce=Ze+1}return!1}(C.properties()[J.value],oe.value,0,oe.value.length-1)}],all:{type:zt,overloads:[[[zt,zt],function(C,F){var J=F[0],oe=F[1];return J.evaluate(C)&&oe.evaluate(C)}],[ws(zt),function(C,F){for(var J=0,oe=F;J0&&typeof C[0]=="string"&&C[0]in fl}function Yt(C,F){var J=new or(fl,[],F?function(pe){var xe={color:St,string:bt,number:tt,enum:bt,boolean:zt,formatted:st,resolvedImage:Et};return pe.type==="array"?It(xe[pe.value]||Le,pe.length):xe[pe.type]}(F):void 0),oe=J.parse(C,void 0,void 0,void 0,F&&F.type==="string"?{typeAnnotation:"coerce"}:void 0);return oe?Uu(new Qt(oe,F)):ds(J.errors)}Qt.prototype.evaluateWithoutErrorHandling=function(C,F,J,oe,pe,xe){return this._evaluator.globals=C,this._evaluator.feature=F,this._evaluator.featureState=J,this._evaluator.canonical=oe,this._evaluator.availableImages=pe||null,this._evaluator.formattedSection=xe,this.expression.evaluate(this._evaluator)},Qt.prototype.evaluate=function(C,F,J,oe,pe,xe){this._evaluator.globals=C,this._evaluator.feature=F||null,this._evaluator.featureState=J||null,this._evaluator.canonical=oe,this._evaluator.availableImages=pe||null,this._evaluator.formattedSection=xe||null;try{var Ce=this.expression.evaluate(this._evaluator);if(Ce==null||typeof Ce=="number"&&Ce!=Ce)return this._defaultValue;if(this._enumValues&&!(Ce in this._enumValues))throw new vr("Expected value to be one of "+Object.keys(this._enumValues).map(function(Ne){return JSON.stringify(Ne)}).join(", ")+", but found "+JSON.stringify(Ce)+" instead.");return Ce}catch(Ne){return this._warningHistory[Ne.message]||(this._warningHistory[Ne.message]=!0,typeof console<"u"&&console.warn(Ne.message)),this._defaultValue}};var an=function(C,F){this.kind=C,this._styleExpression=F,this.isStateDependent=C!=="constant"&&!Zn(F.expression)};an.prototype.evaluateWithoutErrorHandling=function(C,F,J,oe,pe,xe){return this._styleExpression.evaluateWithoutErrorHandling(C,F,J,oe,pe,xe)},an.prototype.evaluate=function(C,F,J,oe,pe,xe){return this._styleExpression.evaluate(C,F,J,oe,pe,xe)};var hn=function(C,F,J,oe){this.kind=C,this.zoomStops=J,this._styleExpression=F,this.isStateDependent=C!=="camera"&&!Zn(F.expression),this.interpolationType=oe};function xn(C,F){if((C=Yt(C,F)).result==="error")return C;var J=C.value.expression,oe=Dn(J);if(!oe&&!pl(F))return ds([new wt("","data expressions not supported")]);var pe=Yn(J,["zoom"]);if(!pe&&!Vu(F))return ds([new wt("","zoom expressions not supported")]);var xe=function Ne(Ze){var ct=null;if(Ze instanceof so)ct=Ne(Ze.result);else if(Ze instanceof bs)for(var gt=0,Bt=Ze.args;gtoe.maximum?[new He(F,J,J+" is greater than the maximum value "+oe.maximum)]:[]}function zr(C){var F,J,oe,pe=C.valueSpec,xe=ot(C.value.type),Ce={},Ne=xe!=="categorical"&&C.value.property===void 0,Ze=!Ne,ct=ma(C.value.stops)==="array"&&ma(C.value.stops[0])==="array"&&ma(C.value.stops[0][0])==="object",gt=Pn({key:C.key,value:C.value,valueSpec:C.styleSpec.function,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{stops:function(Gt){if(xe==="identity")return[new He(Gt.key,Gt.value,'identity function may not have a "stops" property')];var on=[],vn=Gt.value;return on=on.concat(sr({key:Gt.key,value:vn,valueSpec:Gt.valueSpec,style:Gt.style,styleSpec:Gt.styleSpec,arrayElementValidator:Bt})),ma(vn)==="array"&&vn.length===0&&on.push(new He(Gt.key,vn,"array must have at least one stop")),on},default:function(Gt){return ln({key:Gt.key,value:Gt.value,valueSpec:pe,style:Gt.style,styleSpec:Gt.styleSpec})}}});return xe==="identity"&&Ne&>.push(new He(C.key,C.value,'missing required property "property"')),xe==="identity"||C.value.stops||gt.push(new He(C.key,C.value,'missing required property "stops"')),xe==="exponential"&&C.valueSpec.expression&&!js(C.valueSpec)&>.push(new He(C.key,C.value,"exponential functions not supported")),C.styleSpec.$version>=8&&(Ze&&!pl(C.valueSpec)?gt.push(new He(C.key,C.value,"property functions not supported")):Ne&&!Vu(C.valueSpec)&>.push(new He(C.key,C.value,"zoom functions not supported"))),xe!=="categorical"&&!ct||C.value.property!==void 0||gt.push(new He(C.key,C.value,'"property" property is required')),gt;function Bt(Gt){var on=[],vn=Gt.value,Cn=Gt.key;if(ma(vn)!=="array")return[new He(Cn,vn,"array expected, "+ma(vn)+" found")];if(vn.length!==2)return[new He(Cn,vn,"array length 2 expected, length "+vn.length+" found")];if(ct){if(ma(vn[0])!=="object")return[new He(Cn,vn,"object expected, "+ma(vn[0])+" found")];if(vn[0].zoom===void 0)return[new He(Cn,vn,"object stop key must have zoom")];if(vn[0].value===void 0)return[new He(Cn,vn,"object stop key must have value")];if(oe&&oe>ot(vn[0].zoom))return[new He(Cn,vn[0].zoom,"stop zoom values must appear in ascending order")];ot(vn[0].zoom)!==oe&&(oe=ot(vn[0].zoom),J=void 0,Ce={}),on=on.concat(Pn({key:Cn+"[0]",value:vn[0],valueSpec:{zoom:{}},style:Gt.style,styleSpec:Gt.styleSpec,objectElementValidators:{zoom:mr,value:Xt}}))}else on=on.concat(Xt({key:Cn+"[0]",value:vn[0],valueSpec:{},style:Gt.style,styleSpec:Gt.styleSpec},vn));return en(kt(vn[1]))?on.concat([new He(Cn+"[1]",vn[1],"expressions are not allowed in function stops.")]):on.concat(ln({key:Cn+"[1]",value:vn[1],valueSpec:pe,style:Gt.style,styleSpec:Gt.styleSpec}))}function Xt(Gt,on){var vn=ma(Gt.value),Cn=ot(Gt.value),En=Gt.value!==null?Gt.value:on;if(F){if(vn!==F)return[new He(Gt.key,En,vn+" stop domain type must match previous stop domain type "+F)]}else F=vn;if(vn!=="number"&&vn!=="string"&&vn!=="boolean")return[new He(Gt.key,En,"stop domain value must be a number, string, or boolean")];if(vn!=="number"&&xe!=="categorical"){var Vn="number expected, "+vn+" found";return pl(pe)&&xe===void 0&&(Vn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new He(Gt.key,En,Vn)]}return xe!=="categorical"||vn!=="number"||isFinite(Cn)&&Math.floor(Cn)===Cn?xe!=="categorical"&&vn==="number"&&J!==void 0&&Cn=2&&C[1]!=="$id"&&C[1]!=="$type";case"in":return C.length>=3&&(typeof C[1]!="string"||Array.isArray(C[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return C.length!==3||Array.isArray(C[1])||Array.isArray(C[2]);case"any":case"all":for(var F=0,J=C.slice(1);FF?1:0}function sa(C){if(!C)return!0;var F,J=C[0];return C.length<=1?J!=="any":J==="=="?ca(C[1],C[2],"=="):J==="!="?za(ca(C[1],C[2],"==")):J==="<"||J===">"||J==="<="||J===">="?ca(C[1],C[2],J):J==="any"?(F=C.slice(1),["any"].concat(F.map(sa))):J==="all"?["all"].concat(C.slice(1).map(sa)):J==="none"?["all"].concat(C.slice(1).map(sa).map(za)):J==="in"?lo(C[1],C.slice(2)):J==="!in"?za(lo(C[1],C.slice(2))):J==="has"?io(C[1]):J==="!has"?za(io(C[1])):J!=="within"||C}function ca(C,F,J){switch(C){case"$type":return["filter-type-"+J,F];case"$id":return["filter-id-"+J,F];default:return["filter-"+J,C,F]}}function lo(C,F){if(F.length===0)return!1;switch(C){case"$type":return["filter-type-in",["literal",F]];case"$id":return["filter-id-in",["literal",F]];default:return F.length>200&&!F.some(function(J){return typeof J!=typeof F[0]})?["filter-in-large",C,["literal",F.sort(ua)]]:["filter-in-small",C,["literal",F]]}}function io(C){switch(C){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",C]}}function za(C){return["!",C]}function Ra(C){return jr(kt(C.value))?Br(lt({},C,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function F(J){var oe=J.value,pe=J.key;if(ma(oe)!=="array")return[new He(pe,oe,"array expected, "+ma(oe)+" found")];var xe,Ce=J.styleSpec,Ne=[];if(oe.length<1)return[new He(pe,oe,"filter array must have at least 1 element")];switch(Ne=Ne.concat(Jr({key:pe+"[0]",value:oe[0],valueSpec:Ce.filter_operator,style:J.style,styleSpec:J.styleSpec})),ot(oe[0])){case"<":case"<=":case">":case">=":oe.length>=2&&ot(oe[1])==="$type"&&Ne.push(new He(pe,oe,'"$type" cannot be use with operator "'+oe[0]+'"'));case"==":case"!=":oe.length!==3&&Ne.push(new He(pe,oe,'filter array for operator "'+oe[0]+'" must have 3 elements'));case"in":case"!in":oe.length>=2&&(xe=ma(oe[1]))!=="string"&&Ne.push(new He(pe+"[1]",oe[1],"string expected, "+xe+" found"));for(var Ze=2;Ze=gt[Gt+0]&&oe>=gt[Gt+1])?(Ce[Xt]=!0,xe.push(ct[Xt])):Ce[Xt]=!1}}},Ar.prototype._forEachCell=function(C,F,J,oe,pe,xe,Ce,Ne){for(var Ze=this._convertToCellCoord(C),ct=this._convertToCellCoord(F),gt=this._convertToCellCoord(J),Bt=this._convertToCellCoord(oe),Xt=Ze;Xt<=gt;Xt++)for(var Gt=ct;Gt<=Bt;Gt++){var on=this.d*Gt+Xt;if((!Ne||Ne(this._convertFromCellCoord(Xt),this._convertFromCellCoord(Gt),this._convertFromCellCoord(Xt+1),this._convertFromCellCoord(Gt+1)))&&pe.call(this,C,F,J,oe,on,xe,Ce,Ne))return}},Ar.prototype._convertFromCellCoord=function(C){return(C-this.padding)/this.scale},Ar.prototype._convertToCellCoord=function(C){return Math.max(0,Math.min(this.d-1,Math.floor(C*this.scale)+this.padding))},Ar.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var C=this.cells,F=3+this.cells.length+1+1,J=0,oe=0;oe=0)){var Bt=C[gt];ct[gt]=mi[Ze].shallow.indexOf(gt)>=0?Bt:fi(Bt,F)}C instanceof Error&&(ct.message=C.message)}if(ct.$name)throw new Error("$name property is reserved for worker serialization logic.");return Ze!=="Object"&&(ct.$name=Ze),ct}throw new Error("can't serialize object of type "+typeof C)}function Ni(C){if(C==null||typeof C=="boolean"||typeof C=="number"||typeof C=="string"||C instanceof Boolean||C instanceof Number||C instanceof String||C instanceof Date||C instanceof RegExp||Rr(C)||Gr(C)||ArrayBuffer.isView(C)||C instanceof Ur)return C;if(Array.isArray(C))return C.map(Ni);if(typeof C=="object"){var F=C.$name||"Object",J=mi[F].klass;if(!J)throw new Error("can't deserialize unregistered class "+F);if(J.deserialize)return J.deserialize(C);for(var oe=Object.create(J.prototype),pe=0,xe=Object.keys(C);pe=0?Ne:Ni(Ne)}}return oe}throw new Error("can't deserialize object of type "+typeof C)}var Ki=function(){this.first=!0};Ki.prototype.update=function(C,F){var J=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=J,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=J,!0):(this.lastFloorZoom>J?(this.lastIntegerZoom=J+1,this.lastIntegerZoomTime=F):this.lastFloorZoom=128&&C<=255},Arabic:function(C){return C>=1536&&C<=1791},"Arabic Supplement":function(C){return C>=1872&&C<=1919},"Arabic Extended-A":function(C){return C>=2208&&C<=2303},"Hangul Jamo":function(C){return C>=4352&&C<=4607},"Unified Canadian Aboriginal Syllabics":function(C){return C>=5120&&C<=5759},Khmer:function(C){return C>=6016&&C<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(C){return C>=6320&&C<=6399},"General Punctuation":function(C){return C>=8192&&C<=8303},"Letterlike Symbols":function(C){return C>=8448&&C<=8527},"Number Forms":function(C){return C>=8528&&C<=8591},"Miscellaneous Technical":function(C){return C>=8960&&C<=9215},"Control Pictures":function(C){return C>=9216&&C<=9279},"Optical Character Recognition":function(C){return C>=9280&&C<=9311},"Enclosed Alphanumerics":function(C){return C>=9312&&C<=9471},"Geometric Shapes":function(C){return C>=9632&&C<=9727},"Miscellaneous Symbols":function(C){return C>=9728&&C<=9983},"Miscellaneous Symbols and Arrows":function(C){return C>=11008&&C<=11263},"CJK Radicals Supplement":function(C){return C>=11904&&C<=12031},"Kangxi Radicals":function(C){return C>=12032&&C<=12255},"Ideographic Description Characters":function(C){return C>=12272&&C<=12287},"CJK Symbols and Punctuation":function(C){return C>=12288&&C<=12351},Hiragana:function(C){return C>=12352&&C<=12447},Katakana:function(C){return C>=12448&&C<=12543},Bopomofo:function(C){return C>=12544&&C<=12591},"Hangul Compatibility Jamo":function(C){return C>=12592&&C<=12687},Kanbun:function(C){return C>=12688&&C<=12703},"Bopomofo Extended":function(C){return C>=12704&&C<=12735},"CJK Strokes":function(C){return C>=12736&&C<=12783},"Katakana Phonetic Extensions":function(C){return C>=12784&&C<=12799},"Enclosed CJK Letters and Months":function(C){return C>=12800&&C<=13055},"CJK Compatibility":function(C){return C>=13056&&C<=13311},"CJK Unified Ideographs Extension A":function(C){return C>=13312&&C<=19903},"Yijing Hexagram Symbols":function(C){return C>=19904&&C<=19967},"CJK Unified Ideographs":function(C){return C>=19968&&C<=40959},"Yi Syllables":function(C){return C>=40960&&C<=42127},"Yi Radicals":function(C){return C>=42128&&C<=42191},"Hangul Jamo Extended-A":function(C){return C>=43360&&C<=43391},"Hangul Syllables":function(C){return C>=44032&&C<=55215},"Hangul Jamo Extended-B":function(C){return C>=55216&&C<=55295},"Private Use Area":function(C){return C>=57344&&C<=63743},"CJK Compatibility Ideographs":function(C){return C>=63744&&C<=64255},"Arabic Presentation Forms-A":function(C){return C>=64336&&C<=65023},"Vertical Forms":function(C){return C>=65040&&C<=65055},"CJK Compatibility Forms":function(C){return C>=65072&&C<=65103},"Small Form Variants":function(C){return C>=65104&&C<=65135},"Arabic Presentation Forms-B":function(C){return C>=65136&&C<=65279},"Halfwidth and Fullwidth Forms":function(C){return C>=65280&&C<=65519}};function ra(C){for(var F=0,J=C;F=65097&&C<=65103)||!!Lr["CJK Compatibility Ideographs"](C)||!!Lr["CJK Compatibility"](C)||!!Lr["CJK Radicals Supplement"](C)||!!Lr["CJK Strokes"](C)||!(!Lr["CJK Symbols and Punctuation"](C)||C>=12296&&C<=12305||C>=12308&&C<=12319||C===12336)||!!Lr["CJK Unified Ideographs Extension A"](C)||!!Lr["CJK Unified Ideographs"](C)||!!Lr["Enclosed CJK Letters and Months"](C)||!!Lr["Hangul Compatibility Jamo"](C)||!!Lr["Hangul Jamo Extended-A"](C)||!!Lr["Hangul Jamo Extended-B"](C)||!!Lr["Hangul Jamo"](C)||!!Lr["Hangul Syllables"](C)||!!Lr.Hiragana(C)||!!Lr["Ideographic Description Characters"](C)||!!Lr.Kanbun(C)||!!Lr["Kangxi Radicals"](C)||!!Lr["Katakana Phonetic Extensions"](C)||!(!Lr.Katakana(C)||C===12540)||!(!Lr["Halfwidth and Fullwidth Forms"](C)||C===65288||C===65289||C===65293||C>=65306&&C<=65310||C===65339||C===65341||C===65343||C>=65371&&C<=65503||C===65507||C>=65512&&C<=65519)||!(!Lr["Small Form Variants"](C)||C>=65112&&C<=65118||C>=65123&&C<=65126)||!!Lr["Unified Canadian Aboriginal Syllabics"](C)||!!Lr["Unified Canadian Aboriginal Syllabics Extended"](C)||!!Lr["Vertical Forms"](C)||!!Lr["Yijing Hexagram Symbols"](C)||!!Lr["Yi Syllables"](C)||!!Lr["Yi Radicals"](C))}function ia(C){return!(Ci(C)||function(F){return!(!Lr["Latin-1 Supplement"](F)||F!==167&&F!==169&&F!==174&&F!==177&&F!==188&&F!==189&&F!==190&&F!==215&&F!==247)||!(!Lr["General Punctuation"](F)||F!==8214&&F!==8224&&F!==8225&&F!==8240&&F!==8241&&F!==8251&&F!==8252&&F!==8258&&F!==8263&&F!==8264&&F!==8265&&F!==8273)||!!Lr["Letterlike Symbols"](F)||!!Lr["Number Forms"](F)||!(!Lr["Miscellaneous Technical"](F)||!(F>=8960&&F<=8967||F>=8972&&F<=8991||F>=8996&&F<=9e3||F===9003||F>=9085&&F<=9114||F>=9150&&F<=9165||F===9167||F>=9169&&F<=9179||F>=9186&&F<=9215))||!(!Lr["Control Pictures"](F)||F===9251)||!!Lr["Optical Character Recognition"](F)||!!Lr["Enclosed Alphanumerics"](F)||!!Lr["Geometric Shapes"](F)||!(!Lr["Miscellaneous Symbols"](F)||F>=9754&&F<=9759)||!(!Lr["Miscellaneous Symbols and Arrows"](F)||!(F>=11026&&F<=11055||F>=11088&&F<=11097||F>=11192&&F<=11243))||!!Lr["CJK Symbols and Punctuation"](F)||!!Lr.Katakana(F)||!!Lr["Private Use Area"](F)||!!Lr["CJK Compatibility Forms"](F)||!!Lr["Small Form Variants"](F)||!!Lr["Halfwidth and Fullwidth Forms"](F)||F===8734||F===8756||F===8757||F>=9984&&F<=10087||F>=10102&&F<=10131||F===65532||F===65533}(C))}function Wi(C){return C>=1424&&C<=2303||Lr["Arabic Presentation Forms-A"](C)||Lr["Arabic Presentation Forms-B"](C)}function Ca(C,F){return!(!F&&Wi(C))&&!(C>=2304&&C<=3583||C>=3840&&C<=4255||Lr.Khmer(C))}function pi(C){for(var F=0,J=C;F-1&&(Pi=Zs),ks&&ks(C)};function wa(){uo.fire(new Pe("pluginStateChange",{pluginStatus:Pi,pluginURL:Qa}))}var uo=new Ae,jo=function(){return Pi},La=function(){if(Pi!==_a||!Qa)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Pi=Po,wa(),Qa&&Ot({url:Qa},function(C){C?Ts(C):(Pi=Al,wa())})},ps={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Pi===Al||ps.applyArabicShaping!=null},isLoading:function(){return Pi===Po},setState:function(C){Pi=C.pluginStatus,Qa=C.pluginURL},isParsed:function(){return ps.applyArabicShaping!=null&&ps.processBidirectionalText!=null&&ps.processStyledBidirectionalText!=null},getPluginURL:function(){return Qa}},Pa=function(C,F){this.zoom=C,F?(this.now=F.now,this.fadeDuration=F.fadeDuration,this.zoomHistory=F.zoomHistory,this.transition=F.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ki,this.transition={})};Pa.prototype.isSupportedScript=function(C){return function(F,J){for(var oe=0,pe=F;oethis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:F+(1-F)*J}:{fromScale:.5,toScale:1,t:1-(1-J)*F}};var ns=function(C,F){this.property=C,this.value=F,this.expression=function(J,oe){if(je(J))return new _n(J,oe);if(en(J)){var pe=xn(J,oe);if(pe.result==="error")throw new Error(pe.value.map(function(Ce){return Ce.key+": "+Ce.message}).join(", "));return pe.value}var xe=J;return typeof J=="string"&&oe.type==="color"&&(xe=tn.parse(J)),{kind:"constant",evaluate:function(){return xe}}}(F===void 0?C.specification.default:F,C.specification)};ns.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},ns.prototype.possiblyEvaluate=function(C,F,J){return this.property.possiblyEvaluate(this,C,F,J)};var vu=function(C){this.property=C,this.value=new ns(C,void 0)};vu.prototype.transitioned=function(C,F){return new _f(this.property,this.value,F,x({},C.transition,this.transition),C.now)},vu.prototype.untransitioned=function(){return new _f(this.property,this.value,null,{},0)};var Xl=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};Xl.prototype.getValue=function(C){return E(this._values[C].value.value)},Xl.prototype.setValue=function(C,F){this._values.hasOwnProperty(C)||(this._values[C]=new vu(this._values[C].property)),this._values[C].value=new ns(this._values[C].property,F===null?void 0:E(F))},Xl.prototype.getTransition=function(C){return E(this._values[C].transition)},Xl.prototype.setTransition=function(C,F){this._values.hasOwnProperty(C)||(this._values[C]=new vu(this._values[C].property)),this._values[C].transition=E(F)||void 0},Xl.prototype.serialize=function(){for(var C={},F=0,J=Object.keys(this._values);Fthis.end)return this.prior=null,pe;if(this.value.isDataDriven())return this.prior=null,pe;if(oe=1)return 1;var Ze=Ne*Ne,ct=Ze*Ne;return 4*(Ne<.5?ct:3*(Ne-Ze)+ct-.75)}(Ce))}return pe};var Mo=function(C){this._properties=C,this._values=Object.create(C.defaultTransitioningPropertyValues)};Mo.prototype.possiblyEvaluate=function(C,F,J){for(var oe=new Zl(this._properties),pe=0,xe=Object.keys(this._values);pexe.zoomHistory.lastIntegerZoom?{from:J,to:oe}:{from:pe,to:oe}},F.prototype.interpolate=function(J){return J},F}(Di),Tf=function(C){this.specification=C};Tf.prototype.possiblyEvaluate=function(C,F,J,oe){if(C.value!==void 0){if(C.expression.kind==="constant"){var pe=C.expression.evaluate(F,null,{},J,oe);return this._calculate(pe,pe,pe,F)}return this._calculate(C.expression.evaluate(new Pa(Math.floor(F.zoom-1),F)),C.expression.evaluate(new Pa(Math.floor(F.zoom),F)),C.expression.evaluate(new Pa(Math.floor(F.zoom+1),F)),F)}},Tf.prototype._calculate=function(C,F,J,oe){return oe.zoom>oe.zoomHistory.lastIntegerZoom?{from:C,to:F}:{from:J,to:F}},Tf.prototype.interpolate=function(C){return C};var Jl=function(C){this.specification=C};Jl.prototype.possiblyEvaluate=function(C,F,J,oe){return!!C.expression.evaluate(F,null,{},J,oe)},Jl.prototype.interpolate=function(){return!1};var Us=function(C){for(var F in this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],C){var J=C[F];J.specification.overridable&&this.overridableProperties.push(F);var oe=this.defaultPropertyValues[F]=new ns(J,void 0),pe=this.defaultTransitionablePropertyValues[F]=new vu(J);this.defaultTransitioningPropertyValues[F]=pe.untransitioned(),this.defaultPossiblyEvaluatedValues[F]=oe.possiblyEvaluate({})}};Qn("DataDrivenProperty",Di),Qn("DataConstantProperty",wi),Qn("CrossFadedDataDrivenProperty",kf),Qn("CrossFadedProperty",Tf),Qn("ColorRampProperty",Jl);var ml=function(C){function F(J,oe){if(C.call(this),this.id=J.id,this.type=J.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},J.type!=="custom"&&(J=J,this.metadata=J.metadata,this.minzoom=J.minzoom,this.maxzoom=J.maxzoom,J.type!=="background"&&(this.source=J.source,this.sourceLayer=J["source-layer"],this.filter=J.filter),oe.layout&&(this._unevaluatedLayout=new wf(oe.layout)),oe.paint)){for(var pe in this._transitionablePaint=new Xl(oe.paint),J.paint)this.setPaintProperty(pe,J.paint[pe],{validate:!1});for(var xe in J.layout)this.setLayoutProperty(xe,J.layout[xe],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Zl(oe.paint)}}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},F.prototype.getLayoutProperty=function(J){return J==="visibility"?this.visibility:this._unevaluatedLayout.getValue(J)},F.prototype.setLayoutProperty=function(J,oe,pe){if(pe===void 0&&(pe={}),oe!=null){var xe="layers."+this.id+".layout."+J;if(this._validate(yr,xe,J,oe,pe))return}J!=="visibility"?this._unevaluatedLayout.setValue(J,oe):this.visibility=oe},F.prototype.getPaintProperty=function(J){return M(J,"-transition")?this._transitionablePaint.getTransition(J.slice(0,-11)):this._transitionablePaint.getValue(J)},F.prototype.setPaintProperty=function(J,oe,pe){if(pe===void 0&&(pe={}),oe!=null){var xe="layers."+this.id+".paint."+J;if(this._validate(ur,xe,J,oe,pe))return!1}if(M(J,"-transition"))return this._transitionablePaint.setTransition(J.slice(0,-11),oe||void 0),!1;var Ce=this._transitionablePaint._values[J],Ne=Ce.property.specification["property-type"]==="cross-faded-data-driven",Ze=Ce.value.isDataDriven(),ct=Ce.value;this._transitionablePaint.setValue(J,oe),this._handleSpecialPaintPropertyUpdate(J);var gt=this._transitionablePaint._values[J].value;return gt.isDataDriven()||Ze||Ne||this._handleOverridablePaintPropertyUpdate(J,ct,gt)},F.prototype._handleSpecialPaintPropertyUpdate=function(J){},F.prototype._handleOverridablePaintPropertyUpdate=function(J,oe,pe){return!1},F.prototype.isHidden=function(J){return!!(this.minzoom&&J=this.maxzoom)||this.visibility==="none"},F.prototype.updateTransitions=function(J){this._transitioningPaint=this._transitionablePaint.transitioned(J,this._transitioningPaint)},F.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},F.prototype.recalculate=function(J,oe){J.getCrossfadeParameters&&(this._crossfadeParameters=J.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(J,void 0,oe)),this.paint=this._transitioningPaint.possiblyEvaluate(J,void 0,oe)},F.prototype.serialize=function(){var J={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&&(J.layout=J.layout||{},J.layout.visibility=this.visibility),S(J,function(oe,pe){return!(oe===void 0||pe==="layout"&&!Object.keys(oe).length||pe==="paint"&&!Object.keys(oe).length)})},F.prototype._validate=function(J,oe,pe,xe,Ce){return Ce===void 0&&(Ce={}),(!Ce||Ce.validate!==!1)&&Tr(this,J.call(Jn,{key:oe,layerType:this.type,objectKey:pe,value:xe,styleSpec:De,style:{glyphs:!0,sprite:!0}}))},F.prototype.is3D=function(){return!1},F.prototype.isTileClipped=function(){return!1},F.prototype.hasOffscreenPass=function(){return!1},F.prototype.resize=function(){},F.prototype.isStateDependent=function(){for(var J in this.paint._values){var oe=this.paint.get(J);if(oe instanceof So&&pl(oe.property.specification)&&(oe.value.kind==="source"||oe.value.kind==="composite")&&oe.value.isStateDependent)return!0}return!1},F}(Ae),od={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Oc=function(C,F){this._structArray=C,this._pos1=F*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},ka=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Da(C,F){F===void 0&&(F=1);var J=0,oe=0;return{members:C.map(function(pe){var xe,Ce=(xe=pe.type,od[xe].BYTES_PER_ELEMENT),Ne=J=qu(J,Math.max(F,Ce)),Ze=pe.components||1;return oe=Math.max(oe,Ce),J+=Ce*Ze,{name:pe.name,type:pe.type,components:Ze,offset:Ne}}),size:qu(J,Math.max(oe,F)),alignment:F}}function qu(C,F){return Math.ceil(C/F)*F}ka.serialize=function(C,F){return C._trim(),F&&(C.isTransferred=!0,F.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},ka.deserialize=function(C){var F=Object.create(this.prototype);return F.arrayBuffer=C.arrayBuffer,F.length=C.length,F.capacity=C.arrayBuffer.byteLength/F.bytesPerElement,F._refreshViews(),F},ka.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ka.prototype.clear=function(){this.length=0},ka.prototype.resize=function(C){this.reserve(C),this.length=C},ka.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var F=this.uint8;this._refreshViews(),F&&this.uint8.set(F)}},ka.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var yu=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe){var pe=this.length;return this.resize(pe+1),this.emplace(pe,J,oe)},F.prototype.emplace=function(J,oe,pe){var xe=2*J;return this.int16[xe+0]=oe,this.int16[xe+1]=pe,J},F}(ka);yu.prototype.bytesPerElement=4,Qn("StructArrayLayout2i4",yu);var yo=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe,xe){var Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,J,oe,pe,xe)},F.prototype.emplace=function(J,oe,pe,xe,Ce){var Ne=4*J;return this.int16[Ne+0]=oe,this.int16[Ne+1]=pe,this.int16[Ne+2]=xe,this.int16[Ne+3]=Ce,J},F}(ka);yo.prototype.bytesPerElement=8,Qn("StructArrayLayout4i8",yo);var Hu=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe,xe,Ce,Ne){var Ze=this.length;return this.resize(Ze+1),this.emplace(Ze,J,oe,pe,xe,Ce,Ne)},F.prototype.emplace=function(J,oe,pe,xe,Ce,Ne,Ze){var ct=6*J;return this.int16[ct+0]=oe,this.int16[ct+1]=pe,this.int16[ct+2]=xe,this.int16[ct+3]=Ce,this.int16[ct+4]=Ne,this.int16[ct+5]=Ze,J},F}(ka);Hu.prototype.bytesPerElement=12,Qn("StructArrayLayout2i4i12",Hu);var Lc=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe,xe,Ce,Ne){var Ze=this.length;return this.resize(Ze+1),this.emplace(Ze,J,oe,pe,xe,Ce,Ne)},F.prototype.emplace=function(J,oe,pe,xe,Ce,Ne,Ze){var ct=4*J,gt=8*J;return this.int16[ct+0]=oe,this.int16[ct+1]=pe,this.uint8[gt+4]=xe,this.uint8[gt+5]=Ce,this.uint8[gt+6]=Ne,this.uint8[gt+7]=Ze,J},F}(ka);Lc.prototype.bytesPerElement=8,Qn("StructArrayLayout2i4ub8",Lc);var oc=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt){var Xt=this.length;return this.resize(Xt+1),this.emplace(Xt,J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt)},F.prototype.emplace=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt){var Gt=9*J,on=18*J;return this.uint16[Gt+0]=oe,this.uint16[Gt+1]=pe,this.uint16[Gt+2]=xe,this.uint16[Gt+3]=Ce,this.uint16[Gt+4]=Ne,this.uint16[Gt+5]=Ze,this.uint16[Gt+6]=ct,this.uint16[Gt+7]=gt,this.uint8[on+16]=Bt,this.uint8[on+17]=Xt,J},F}(ka);oc.prototype.bytesPerElement=18,Qn("StructArrayLayout8ui2ub18",oc);var Pc=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt){var on=this.length;return this.resize(on+1),this.emplace(on,J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt)},F.prototype.emplace=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt,on){var vn=12*J;return this.int16[vn+0]=oe,this.int16[vn+1]=pe,this.int16[vn+2]=xe,this.int16[vn+3]=Ce,this.uint16[vn+4]=Ne,this.uint16[vn+5]=Ze,this.uint16[vn+6]=ct,this.uint16[vn+7]=gt,this.int16[vn+8]=Bt,this.int16[vn+9]=Xt,this.int16[vn+10]=Gt,this.int16[vn+11]=on,J},F}(ka);Pc.prototype.bytesPerElement=24,Qn("StructArrayLayout4i4ui4i24",Pc);var xu=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe){var xe=this.length;return this.resize(xe+1),this.emplace(xe,J,oe,pe)},F.prototype.emplace=function(J,oe,pe,xe){var Ce=3*J;return this.float32[Ce+0]=oe,this.float32[Ce+1]=pe,this.float32[Ce+2]=xe,J},F}(ka);xu.prototype.bytesPerElement=12,Qn("StructArrayLayout3f12",xu);var sd=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J){var oe=this.length;return this.resize(oe+1),this.emplace(oe,J)},F.prototype.emplace=function(J,oe){var pe=1*J;return this.uint32[pe+0]=oe,J},F}(ka);sd.prototype.bytesPerElement=4,Qn("StructArrayLayout1ul4",sd);var Tp=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.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)},F.prototype.emplaceBack=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt){var Bt=this.length;return this.resize(Bt+1),this.emplace(Bt,J,oe,pe,xe,Ce,Ne,Ze,ct,gt)},F.prototype.emplace=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt){var Xt=10*J,Gt=5*J;return this.int16[Xt+0]=oe,this.int16[Xt+1]=pe,this.int16[Xt+2]=xe,this.int16[Xt+3]=Ce,this.int16[Xt+4]=Ne,this.int16[Xt+5]=Ze,this.uint32[Gt+3]=ct,this.uint16[Xt+8]=gt,this.uint16[Xt+9]=Bt,J},F}(ka);Tp.prototype.bytesPerElement=20,Qn("StructArrayLayout6i1ul2ui20",Tp);var $u=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe,xe,Ce,Ne){var Ze=this.length;return this.resize(Ze+1),this.emplace(Ze,J,oe,pe,xe,Ce,Ne)},F.prototype.emplace=function(J,oe,pe,xe,Ce,Ne,Ze){var ct=6*J;return this.int16[ct+0]=oe,this.int16[ct+1]=pe,this.int16[ct+2]=xe,this.int16[ct+3]=Ce,this.int16[ct+4]=Ne,this.int16[ct+5]=Ze,J},F}(ka);$u.prototype.bytesPerElement=12,Qn("StructArrayLayout2i2i2i12",$u);var ld=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe,xe,Ce){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,J,oe,pe,xe,Ce)},F.prototype.emplace=function(J,oe,pe,xe,Ce,Ne){var Ze=4*J,ct=8*J;return this.float32[Ze+0]=oe,this.float32[Ze+1]=pe,this.float32[Ze+2]=xe,this.int16[ct+6]=Ce,this.int16[ct+7]=Ne,J},F}(ka);ld.prototype.bytesPerElement=16,Qn("StructArrayLayout2f1f2i16",ld);var Dc=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe,xe){var Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,J,oe,pe,xe)},F.prototype.emplace=function(J,oe,pe,xe,Ce){var Ne=12*J,Ze=3*J;return this.uint8[Ne+0]=oe,this.uint8[Ne+1]=pe,this.float32[Ze+1]=xe,this.float32[Ze+2]=Ce,J},F}(ka);Dc.prototype.bytesPerElement=12,Qn("StructArrayLayout2ub2f12",Dc);var rs=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe){var xe=this.length;return this.resize(xe+1),this.emplace(xe,J,oe,pe)},F.prototype.emplace=function(J,oe,pe,xe){var Ce=3*J;return this.uint16[Ce+0]=oe,this.uint16[Ce+1]=pe,this.uint16[Ce+2]=xe,J},F}(ka);rs.prototype.bytesPerElement=6,Qn("StructArrayLayout3ui6",rs);var Ap=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.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)},F.prototype.emplaceBack=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt,on,vn,Cn,En,Vn){var qn=this.length;return this.resize(qn+1),this.emplace(qn,J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt,on,vn,Cn,En,Vn)},F.prototype.emplace=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt,on,vn,Cn,En,Vn,qn){var Xn=24*J,dr=12*J,br=48*J;return this.int16[Xn+0]=oe,this.int16[Xn+1]=pe,this.uint16[Xn+2]=xe,this.uint16[Xn+3]=Ce,this.uint32[dr+2]=Ne,this.uint32[dr+3]=Ze,this.uint32[dr+4]=ct,this.uint16[Xn+10]=gt,this.uint16[Xn+11]=Bt,this.uint16[Xn+12]=Xt,this.float32[dr+7]=Gt,this.float32[dr+8]=on,this.uint8[br+36]=vn,this.uint8[br+37]=Cn,this.uint8[br+38]=En,this.uint32[dr+10]=Vn,this.int16[Xn+22]=qn,J},F}(ka);Ap.prototype.bytesPerElement=48,Qn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ap);var Mp=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.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)},F.prototype.emplaceBack=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt,on,vn,Cn,En,Vn,qn,Xn,dr,br,Hr,Vr,ei,vi,yi,li,Si){var Ai=this.length;return this.resize(Ai+1),this.emplace(Ai,J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt,on,vn,Cn,En,Vn,qn,Xn,dr,br,Hr,Vr,ei,vi,yi,li,Si)},F.prototype.emplace=function(J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt,on,vn,Cn,En,Vn,qn,Xn,dr,br,Hr,Vr,ei,vi,yi,li,Si,Ai){var xi=34*J,Ta=17*J;return this.int16[xi+0]=oe,this.int16[xi+1]=pe,this.int16[xi+2]=xe,this.int16[xi+3]=Ce,this.int16[xi+4]=Ne,this.int16[xi+5]=Ze,this.int16[xi+6]=ct,this.int16[xi+7]=gt,this.uint16[xi+8]=Bt,this.uint16[xi+9]=Xt,this.uint16[xi+10]=Gt,this.uint16[xi+11]=on,this.uint16[xi+12]=vn,this.uint16[xi+13]=Cn,this.uint16[xi+14]=En,this.uint16[xi+15]=Vn,this.uint16[xi+16]=qn,this.uint16[xi+17]=Xn,this.uint16[xi+18]=dr,this.uint16[xi+19]=br,this.uint16[xi+20]=Hr,this.uint16[xi+21]=Vr,this.uint16[xi+22]=ei,this.uint32[Ta+12]=vi,this.float32[Ta+13]=yi,this.float32[Ta+14]=li,this.float32[Ta+15]=Si,this.float32[Ta+16]=Ai,J},F}(ka);Mp.prototype.bytesPerElement=68,Qn("StructArrayLayout8i15ui1ul4f68",Mp);var ce=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J){var oe=this.length;return this.resize(oe+1),this.emplace(oe,J)},F.prototype.emplace=function(J,oe){var pe=1*J;return this.float32[pe+0]=oe,J},F}(ka);ce.prototype.bytesPerElement=4,Qn("StructArrayLayout1f4",ce);var I=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe){var xe=this.length;return this.resize(xe+1),this.emplace(xe,J,oe,pe)},F.prototype.emplace=function(J,oe,pe,xe){var Ce=3*J;return this.int16[Ce+0]=oe,this.int16[Ce+1]=pe,this.int16[Ce+2]=xe,J},F}(ka);I.prototype.bytesPerElement=6,Qn("StructArrayLayout3i6",I);var j=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe){var xe=this.length;return this.resize(xe+1),this.emplace(xe,J,oe,pe)},F.prototype.emplace=function(J,oe,pe,xe){var Ce=2*J,Ne=4*J;return this.uint32[Ce+0]=oe,this.uint16[Ne+2]=pe,this.uint16[Ne+3]=xe,J},F}(ka);j.prototype.bytesPerElement=8,Qn("StructArrayLayout1ul2ui8",j);var V=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe){var pe=this.length;return this.resize(pe+1),this.emplace(pe,J,oe)},F.prototype.emplace=function(J,oe,pe){var xe=2*J;return this.uint16[xe+0]=oe,this.uint16[xe+1]=pe,J},F}(ka);V.prototype.bytesPerElement=4,Qn("StructArrayLayout2ui4",V);var X=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J){var oe=this.length;return this.resize(oe+1),this.emplace(oe,J)},F.prototype.emplace=function(J,oe){var pe=1*J;return this.uint16[pe+0]=oe,J},F}(ka);X.prototype.bytesPerElement=2,Qn("StructArrayLayout1ui2",X);var se=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe){var pe=this.length;return this.resize(pe+1),this.emplace(pe,J,oe)},F.prototype.emplace=function(J,oe,pe){var xe=2*J;return this.float32[xe+0]=oe,this.float32[xe+1]=pe,J},F}(ka);se.prototype.bytesPerElement=8,Qn("StructArrayLayout2f8",se);var he=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},F.prototype.emplaceBack=function(J,oe,pe,xe){var Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,J,oe,pe,xe)},F.prototype.emplace=function(J,oe,pe,xe,Ce){var Ne=4*J;return this.float32[Ne+0]=oe,this.float32[Ne+1]=pe,this.float32[Ne+2]=xe,this.float32[Ne+3]=Ce,J},F}(ka);he.prototype.bytesPerElement=16,Qn("StructArrayLayout4f16",he);var ve=function(C){function F(){C.apply(this,arguments)}C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F;var J={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 J.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},J.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},J.x1.get=function(){return this._structArray.int16[this._pos2+2]},J.y1.get=function(){return this._structArray.int16[this._pos2+3]},J.x2.get=function(){return this._structArray.int16[this._pos2+4]},J.y2.get=function(){return this._structArray.int16[this._pos2+5]},J.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},J.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},J.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},J.anchorPoint.get=function(){return new h(this.anchorPointX,this.anchorPointY)},Object.defineProperties(F.prototype,J),F}(Oc);ve.prototype.size=20;var be=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.get=function(J){return new ve(this,J)},F}(Tp);Qn("CollisionBoxArray",be);var Se=function(C){function F(){C.apply(this,arguments)}C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F;var J={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 J.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},J.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},J.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},J.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},J.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},J.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},J.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},J.segment.get=function(){return this._structArray.uint16[this._pos2+10]},J.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},J.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},J.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},J.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},J.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},J.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},J.placedOrientation.set=function(oe){this._structArray.uint8[this._pos1+37]=oe},J.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},J.hidden.set=function(oe){this._structArray.uint8[this._pos1+38]=oe},J.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},J.crossTileID.set=function(oe){this._structArray.uint32[this._pos4+10]=oe},J.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(F.prototype,J),F}(Oc);Se.prototype.size=48;var Ue=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.get=function(J){return new Se(this,J)},F}(Ap);Qn("PlacedSymbolArray",Ue);var Xe=function(C){function F(){C.apply(this,arguments)}C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F;var J={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 J.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},J.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},J.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},J.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},J.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},J.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},J.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},J.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},J.key.get=function(){return this._structArray.uint16[this._pos2+8]},J.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},J.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},J.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},J.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},J.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},J.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},J.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},J.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},J.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},J.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},J.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},J.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},J.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},J.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},J.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},J.crossTileID.set=function(oe){this._structArray.uint32[this._pos4+12]=oe},J.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},J.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},J.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},J.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(F.prototype,J),F}(Oc);Xe.prototype.size=68;var it=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.get=function(J){return new Xe(this,J)},F}(Mp);Qn("SymbolInstanceArray",it);var xt=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.getoffsetX=function(J){return this.float32[1*J+0]},F}(ce);Qn("GlyphOffsetArray",xt);var Lt=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.getx=function(J){return this.int16[3*J+0]},F.prototype.gety=function(J){return this.int16[3*J+1]},F.prototype.gettileUnitDistanceFromAnchor=function(J){return this.int16[3*J+2]},F}(I);Qn("SymbolLineVertexArray",Lt);var _t=function(C){function F(){C.apply(this,arguments)}C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F;var J={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return J.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},J.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},J.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(F.prototype,J),F}(Oc);_t.prototype.size=8;var Mt=function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.get=function(J){return new _t(this,J)},F}(j);Qn("FeatureIndexArray",Mt);var yt=Da([{name:"a_pos",components:2,type:"Int16"}],4).members,Nt=function(C){C===void 0&&(C=[]),this.segments=C};function Rt(C,F){return 256*(C=v(Math.floor(C),0,255))+(F=v(Math.floor(F),0,255))}Nt.prototype.prepareSegment=function(C,F,J,oe){var pe=this.segments[this.segments.length-1];return C>Nt.MAX_VERTEX_ARRAY_LENGTH&&O("Max vertices per segment is "+Nt.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!pe||pe.vertexLength+C>Nt.MAX_VERTEX_ARRAY_LENGTH||pe.sortKey!==oe)&&(pe={vertexOffset:F.length,primitiveOffset:J.length,vertexLength:0,primitiveLength:0},oe!==void 0&&(pe.sortKey=oe),this.segments.push(pe)),pe},Nt.prototype.get=function(){return this.segments},Nt.prototype.destroy=function(){for(var C=0,F=this.segments;C>>16)*Ne&65535)<<16)&4294967295)<<15|ct>>>17))*Ze+(((ct>>>16)*Ze&65535)<<16)&4294967295)<<13|xe>>>19))+((5*(xe>>>16)&65535)<<16)&4294967295))+((58964+(Ce>>>16)&65535)<<16);switch(ct=0,oe){case 3:ct^=(255&F.charCodeAt(gt+2))<<16;case 2:ct^=(255&F.charCodeAt(gt+1))<<8;case 1:xe^=ct=(65535&(ct=(ct=(65535&(ct^=255&F.charCodeAt(gt)))*Ne+(((ct>>>16)*Ne&65535)<<16)&4294967295)<<15|ct>>>17))*Ze+(((ct>>>16)*Ze&65535)<<16)&4294967295}return xe^=F.length,xe=2246822507*(65535&(xe^=xe>>>16))+((2246822507*(xe>>>16)&65535)<<16)&4294967295,xe=3266489909*(65535&(xe^=xe>>>13))+((3266489909*(xe>>>16)&65535)<<16)&4294967295,(xe^=xe>>>16)>>>0}}),dn=s(function(C){C.exports=function(F,J){for(var oe,pe=F.length,xe=J^pe,Ce=0;pe>=4;)oe=1540483477*(65535&(oe=255&F.charCodeAt(Ce)|(255&F.charCodeAt(++Ce))<<8|(255&F.charCodeAt(++Ce))<<16|(255&F.charCodeAt(++Ce))<<24))+((1540483477*(oe>>>16)&65535)<<16),xe=1540483477*(65535&xe)+((1540483477*(xe>>>16)&65535)<<16)^(oe=1540483477*(65535&(oe^=oe>>>24))+((1540483477*(oe>>>16)&65535)<<16)),pe-=4,++Ce;switch(pe){case 3:xe^=(255&F.charCodeAt(Ce+2))<<16;case 2:xe^=(255&F.charCodeAt(Ce+1))<<8;case 1:xe=1540483477*(65535&(xe^=255&F.charCodeAt(Ce)))+((1540483477*(xe>>>16)&65535)<<16)}return xe=1540483477*(65535&(xe^=xe>>>13))+((1540483477*(xe>>>16)&65535)<<16),(xe^=xe>>>15)>>>0}}),Sn=rn,An=rn,tr=dn;Sn.murmur3=An,Sn.murmur2=tr;var er=function(){this.ids=[],this.positions=[],this.indexed=!1};er.prototype.add=function(C,F,J,oe){this.ids.push(cr(C)),this.positions.push(F,J,oe)},er.prototype.getPositions=function(C){for(var F=cr(C),J=0,oe=this.ids.length-1;J>1;this.ids[pe]>=F?oe=pe:J=pe+1}for(var xe=[];this.ids[J]===F;){var Ce=this.positions[3*J],Ne=this.positions[3*J+1],Ze=this.positions[3*J+2];xe.push({index:Ce,start:Ne,end:Ze}),J++}return xe},er.serialize=function(C,F){var J=new Float64Array(C.ids),oe=new Uint32Array(C.positions);return function pe(xe,Ce,Ne,Ze){for(;Ne>1],gt=Ne-1,Bt=Ze+1;;){do gt++;while(xe[gt]ct);if(gt>=Bt)break;Yr(xe,gt,Bt),Yr(Ce,3*gt,3*Bt),Yr(Ce,3*gt+1,3*Bt+1),Yr(Ce,3*gt+2,3*Bt+2)}Bt-Neco.max||Ce.yco.max)&&(O("Geometry exceeds allowed extent, reduce your vector tile buffer size"),Ce.x=v(Ce.x,co.min,co.max),Ce.y=v(Ce.y,co.min,co.max))}return J}function As(C,F,J,oe,pe){C.emplaceBack(2*F+(oe+1)/2,2*J+(pe+1)/2)}var Uo=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(F){return F.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new yu,this.indexArray=new rs,this.segments=new Nt,this.programConfigurations=new Ha(yt,C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(F){return F.isStateDependent()}).map(function(F){return F.id})};function Js(C,F){for(var J=0;J1){if(ud(C,F))return!0;for(var oe=0;oe1?C.distSqr(J):C.distSqr(J.sub(F)._mult(pe)._add(F))}function Ep(C,F){for(var J,oe,pe,xe=!1,Ce=0;CeF.y!=pe.y>F.y&&F.x<(pe.x-oe.x)*(F.y-oe.y)/(pe.y-oe.y)+oe.x&&(xe=!xe);return xe}function Kl(C,F){for(var J=!1,oe=0,pe=C.length-1;oeF.y!=Ce.y>F.y&&F.x<(Ce.x-xe.x)*(F.y-xe.y)/(Ce.y-xe.y)+xe.x&&(J=!J)}return J}function Cp(C,F,J){var oe=J[0],pe=J[2];if(C.xpe.x&&F.x>pe.x||C.ype.y&&F.y>pe.y)return!1;var xe=R(C,F,J[0]);return xe!==R(C,F,J[1])||xe!==R(C,F,J[2])||xe!==R(C,F,J[3])}function fo(C,F,J){var oe=F.paint.get(C).value;return oe.kind==="constant"?oe.value:J.programConfigurations.get(F.id).getMaxValue(C)}function Vs(C){return Math.sqrt(C[0]*C[0]+C[1]*C[1])}function qs(C,F,J,oe,pe){if(!F[0]&&!F[1])return C;var xe=h.convert(F)._mult(pe);J==="viewport"&&xe._rotate(-oe);for(var Ce=[],Ne=0;Ne=8192||gt<0||gt>=8192)){var Bt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),Xt=Bt.vertexLength;As(this.layoutVertexArray,ct,gt,-1,-1),As(this.layoutVertexArray,ct,gt,1,-1),As(this.layoutVertexArray,ct,gt,1,1),As(this.layoutVertexArray,ct,gt,-1,1),this.indexArray.emplaceBack(Xt,Xt+1,Xt+2),this.indexArray.emplaceBack(Xt,Xt+3,Xt+2),Bt.vertexLength+=4,Bt.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,J,{},oe)},Qn("CircleBucket",Uo,{omit:["layers"]});var rg=new Us({"circle-sort-key":new Di(De.layout_circle["circle-sort-key"])}),V3={paint:new Us({"circle-radius":new Di(De.paint_circle["circle-radius"]),"circle-color":new Di(De.paint_circle["circle-color"]),"circle-blur":new Di(De.paint_circle["circle-blur"]),"circle-opacity":new Di(De.paint_circle["circle-opacity"]),"circle-translate":new wi(De.paint_circle["circle-translate"]),"circle-translate-anchor":new wi(De.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new wi(De.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new wi(De.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Di(De.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Di(De.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Di(De.paint_circle["circle-stroke-opacity"])}),layout:rg},Ml=typeof Float32Array<"u"?Float32Array:Array;function c1(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C}function Op(C,F,J){var oe=F[0],pe=F[1],xe=F[2],Ce=F[3],Ne=F[4],Ze=F[5],ct=F[6],gt=F[7],Bt=F[8],Xt=F[9],Gt=F[10],on=F[11],vn=F[12],Cn=F[13],En=F[14],Vn=F[15],qn=J[0],Xn=J[1],dr=J[2],br=J[3];return C[0]=qn*oe+Xn*Ne+dr*Bt+br*vn,C[1]=qn*pe+Xn*Ze+dr*Xt+br*Cn,C[2]=qn*xe+Xn*ct+dr*Gt+br*En,C[3]=qn*Ce+Xn*gt+dr*on+br*Vn,qn=J[4],Xn=J[5],dr=J[6],br=J[7],C[4]=qn*oe+Xn*Ne+dr*Bt+br*vn,C[5]=qn*pe+Xn*Ze+dr*Xt+br*Cn,C[6]=qn*xe+Xn*ct+dr*Gt+br*En,C[7]=qn*Ce+Xn*gt+dr*on+br*Vn,qn=J[8],Xn=J[9],dr=J[10],br=J[11],C[8]=qn*oe+Xn*Ne+dr*Bt+br*vn,C[9]=qn*pe+Xn*Ze+dr*Xt+br*Cn,C[10]=qn*xe+Xn*ct+dr*Gt+br*En,C[11]=qn*Ce+Xn*gt+dr*on+br*Vn,qn=J[12],Xn=J[13],dr=J[14],br=J[15],C[12]=qn*oe+Xn*Ne+dr*Bt+br*vn,C[13]=qn*pe+Xn*Ze+dr*Xt+br*Cn,C[14]=qn*xe+Xn*ct+dr*Gt+br*En,C[15]=qn*Ce+Xn*gt+dr*on+br*Vn,C}Math.hypot||(Math.hypot=function(){for(var C=arguments,F=0,J=arguments.length;J--;)F+=C[J]*C[J];return Math.sqrt(F)});var q3=Op,yh,H3=function(C,F,J){return C[0]=F[0]-J[0],C[1]=F[1]-J[1],C[2]=F[2]-J[2],C};yh=new Ml(3),Ml!=Float32Array&&(yh[0]=0,yh[1]=0,yh[2]=0);function ig(C,F,J){var oe=F[0],pe=F[1],xe=F[2],Ce=F[3];return C[0]=J[0]*oe+J[4]*pe+J[8]*xe+J[12]*Ce,C[1]=J[1]*oe+J[5]*pe+J[9]*xe+J[13]*Ce,C[2]=J[2]*oe+J[6]*pe+J[10]*xe+J[14]*Ce,C[3]=J[3]*oe+J[7]*pe+J[11]*xe+J[15]*Ce,C}(function(){(function(){var C=new Ml(4);return Ml!=Float32Array&&(C[0]=0,C[1]=0,C[2]=0,C[3]=0),C})()})();var f1=function(C){var F=C[0],J=C[1];return F*F+J*J},WH=(function(){(function(){var C=new Ml(2);return Ml!=Float32Array&&(C[0]=0,C[1]=0),C})()}(),function(C){function F(J){C.call(this,J,V3)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.createBucket=function(J){return new Uo(J)},F.prototype.queryRadius=function(J){var oe=J;return fo("circle-radius",this,oe)+fo("circle-stroke-width",this,oe)+Vs(this.paint.get("circle-translate"))},F.prototype.queryIntersectsFeature=function(J,oe,pe,xe,Ce,Ne,Ze,ct){for(var gt=qs(J,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),Ne.angle,Ze),Bt=this.paint.get("circle-radius").evaluate(oe,pe)+this.paint.get("circle-stroke-width").evaluate(oe,pe),Xt=this.paint.get("circle-pitch-alignment")==="map",Gt=Xt?gt:function(Hr,Vr){return Hr.map(function(ei){return Y8(ei,Vr)})}(gt,ct),on=Xt?Bt*Ze:Bt,vn=0,Cn=xe;vnC.width||pe.height>C.height||J.x>C.width-pe.width||J.y>C.height-pe.height)throw new RangeError("out of range source coordinates for image copy");if(pe.width>F.width||pe.height>F.height||oe.x>F.width-pe.width||oe.y>F.height-pe.height)throw new RangeError("out of range destination coordinates for image copy");for(var Ce=C.data,Ne=F.data,Ze=0;Ze80*J){oe=xe=C[0],pe=Ce=C[1];for(var on=J;onxe&&(xe=Ne),Ze>Ce&&(Ce=Ze);ct=(ct=Math.max(xe-oe,Ce-pe))!==0?1/ct:0}return h1(Xt,Gt,J,oe,pe,ct),Gt}function Q8(C,F,J,oe,pe){var xe,Ce;if(pe===Z3(C,F,J,oe)>0)for(xe=F;xe=F;xe-=oe)Ce=n9(xe,C[xe],C[xe+1],Ce);return Ce&&gx(Ce,Ce.next)&&(p1(Ce),Ce=Ce.next),Ce}function fd(C,F){if(!C)return C;F||(F=C);var J,oe=C;do if(J=!1,oe.steiner||!gx(oe,oe.next)&&is(oe.prev,oe,oe.next)!==0)oe=oe.next;else{if(p1(oe),(oe=F=oe.prev)===oe.next)break;J=!0}while(J||oe!==F);return F}function h1(C,F,J,oe,pe,xe,Ce){if(C){!Ce&&xe&&function(gt,Bt,Xt,Gt){var on=gt;do on.z===null&&(on.z=Y3(on.x,on.y,Bt,Xt,Gt)),on.prevZ=on.prev,on.nextZ=on.next,on=on.next;while(on!==gt);on.prevZ.nextZ=null,on.prevZ=null,function(vn){var Cn,En,Vn,qn,Xn,dr,br,Hr,Vr=1;do{for(En=vn,vn=null,Xn=null,dr=0;En;){for(dr++,Vn=En,br=0,Cn=0;Cn0||Hr>0&&Vn;)br!==0&&(Hr===0||!Vn||En.z<=Vn.z)?(qn=En,En=En.nextZ,br--):(qn=Vn,Vn=Vn.nextZ,Hr--),Xn?Xn.nextZ=qn:vn=qn,qn.prevZ=Xn,Xn=qn;En=Vn}Xn.nextZ=null,Vr*=2}while(dr>1)}(on)}(C,oe,pe,xe);for(var Ne,Ze,ct=C;C.prev!==C.next;)if(Ne=C.prev,Ze=C.next,xe?e$(C,oe,pe,xe):QH(C))F.push(Ne.i/J),F.push(C.i/J),F.push(Ze.i/J),p1(C),C=Ze.next,ct=Ze.next;else if((C=Ze)===ct){Ce?Ce===1?h1(C=t$(fd(C),F,J),F,J,oe,pe,xe,2):Ce===2&&n$(C,F,J,oe,pe,xe):h1(fd(C),F,J,oe,pe,xe,1);break}}}function QH(C){var F=C.prev,J=C,oe=C.next;if(is(F,J,oe)>=0)return!1;for(var pe=C.next.next;pe!==C.prev;){if(ag(F.x,F.y,J.x,J.y,oe.x,oe.y,pe.x,pe.y)&&is(pe.prev,pe,pe.next)>=0)return!1;pe=pe.next}return!0}function e$(C,F,J,oe){var pe=C.prev,xe=C,Ce=C.next;if(is(pe,xe,Ce)>=0)return!1;for(var Ne=pe.xxe.x?pe.x>Ce.x?pe.x:Ce.x:xe.x>Ce.x?xe.x:Ce.x,gt=pe.y>xe.y?pe.y>Ce.y?pe.y:Ce.y:xe.y>Ce.y?xe.y:Ce.y,Bt=Y3(Ne,Ze,F,J,oe),Xt=Y3(ct,gt,F,J,oe),Gt=C.prevZ,on=C.nextZ;Gt&&Gt.z>=Bt&&on&&on.z<=Xt;){if(Gt!==C.prev&&Gt!==C.next&&ag(pe.x,pe.y,xe.x,xe.y,Ce.x,Ce.y,Gt.x,Gt.y)&&is(Gt.prev,Gt,Gt.next)>=0||(Gt=Gt.prevZ,on!==C.prev&&on!==C.next&&ag(pe.x,pe.y,xe.x,xe.y,Ce.x,Ce.y,on.x,on.y)&&is(on.prev,on,on.next)>=0))return!1;on=on.nextZ}for(;Gt&&Gt.z>=Bt;){if(Gt!==C.prev&&Gt!==C.next&&ag(pe.x,pe.y,xe.x,xe.y,Ce.x,Ce.y,Gt.x,Gt.y)&&is(Gt.prev,Gt,Gt.next)>=0)return!1;Gt=Gt.prevZ}for(;on&&on.z<=Xt;){if(on!==C.prev&&on!==C.next&&ag(pe.x,pe.y,xe.x,xe.y,Ce.x,Ce.y,on.x,on.y)&&is(on.prev,on,on.next)>=0)return!1;on=on.nextZ}return!0}function t$(C,F,J){var oe=C;do{var pe=oe.prev,xe=oe.next.next;!gx(pe,xe)&&e9(pe,oe,oe.next,xe)&&d1(pe,xe)&&d1(xe,pe)&&(F.push(pe.i/J),F.push(oe.i/J),F.push(xe.i/J),p1(oe),p1(oe.next),oe=C=xe),oe=oe.next}while(oe!==C);return fd(oe)}function n$(C,F,J,oe,pe,xe){var Ce=C;do{for(var Ne=Ce.next.next;Ne!==Ce.prev;){if(Ce.i!==Ne.i&&s$(Ce,Ne)){var Ze=t9(Ce,Ne);return Ce=fd(Ce,Ce.next),Ze=fd(Ze,Ze.next),h1(Ce,F,J,oe,pe,xe),void h1(Ze,F,J,oe,pe,xe)}Ne=Ne.next}Ce=Ce.next}while(Ce!==C)}function r$(C,F){return C.x-F.x}function i$(C,F){if(F=function(oe,pe){var xe,Ce=pe,Ne=oe.x,Ze=oe.y,ct=-1/0;do{if(Ze<=Ce.y&&Ze>=Ce.next.y&&Ce.next.y!==Ce.y){var gt=Ce.x+(Ze-Ce.y)*(Ce.next.x-Ce.x)/(Ce.next.y-Ce.y);if(gt<=Ne&>>ct){if(ct=gt,gt===Ne){if(Ze===Ce.y)return Ce;if(Ze===Ce.next.y)return Ce.next}xe=Ce.x=Ce.x&&Ce.x>=Gt&&Ne!==Ce.x&&ag(Zexe.x||Ce.x===xe.x&&a$(xe,Ce)))&&(xe=Ce,vn=Bt)),Ce=Ce.next;while(Ce!==Xt);return xe}(C,F)){var J=t9(F,C);fd(F,F.next),fd(J,J.next)}}function a$(C,F){return is(C.prev,C,F.prev)<0&&is(F.next,C,C.next)<0}function Y3(C,F,J,oe,pe){return(C=1431655765&((C=858993459&((C=252645135&((C=16711935&((C=32767*(C-J)*pe)|C<<8))|C<<4))|C<<2))|C<<1))|(F=1431655765&((F=858993459&((F=252645135&((F=16711935&((F=32767*(F-oe)*pe)|F<<8))|F<<4))|F<<2))|F<<1))<<1}function o$(C){var F=C,J=C;do(F.x=0&&(C-Ce)*(oe-Ne)-(J-Ce)*(F-Ne)>=0&&(J-Ce)*(xe-Ne)-(pe-Ce)*(oe-Ne)>=0}function s$(C,F){return C.next.i!==F.i&&C.prev.i!==F.i&&!function(J,oe){var pe=J;do{if(pe.i!==J.i&&pe.next.i!==J.i&&pe.i!==oe.i&&pe.next.i!==oe.i&&e9(pe,pe.next,J,oe))return!0;pe=pe.next}while(pe!==J);return!1}(C,F)&&(d1(C,F)&&d1(F,C)&&function(J,oe){var pe=J,xe=!1,Ce=(J.x+oe.x)/2,Ne=(J.y+oe.y)/2;do pe.y>Ne!=pe.next.y>Ne&&pe.next.y!==pe.y&&Ce<(pe.next.x-pe.x)*(Ne-pe.y)/(pe.next.y-pe.y)+pe.x&&(xe=!xe),pe=pe.next;while(pe!==J);return xe}(C,F)&&(is(C.prev,C,F.prev)||is(C,F.prev,F))||gx(C,F)&&is(C.prev,C,C.next)>0&&is(F.prev,F,F.next)>0)}function is(C,F,J){return(F.y-C.y)*(J.x-F.x)-(F.x-C.x)*(J.y-F.y)}function gx(C,F){return C.x===F.x&&C.y===F.y}function e9(C,F,J,oe){var pe=vx(is(C,F,J)),xe=vx(is(C,F,oe)),Ce=vx(is(J,oe,C)),Ne=vx(is(J,oe,F));return pe!==xe&&Ce!==Ne||!(pe!==0||!mx(C,J,F))||!(xe!==0||!mx(C,oe,F))||!(Ce!==0||!mx(J,C,oe))||!(Ne!==0||!mx(J,F,oe))}function mx(C,F,J){return F.x<=Math.max(C.x,J.x)&&F.x>=Math.min(C.x,J.x)&&F.y<=Math.max(C.y,J.y)&&F.y>=Math.min(C.y,J.y)}function vx(C){return C>0?1:C<0?-1:0}function d1(C,F){return is(C.prev,C,C.next)<0?is(C,F,C.next)>=0&&is(C,C.prev,F)>=0:is(C,F,C.prev)<0||is(C,C.next,F)<0}function t9(C,F){var J=new X3(C.i,C.x,C.y),oe=new X3(F.i,F.x,F.y),pe=C.next,xe=F.prev;return C.next=F,F.prev=C,J.next=pe,pe.prev=J,oe.next=J,J.prev=oe,xe.next=oe,oe.prev=xe,oe}function n9(C,F,J,oe){var pe=new X3(C,F,J);return oe?(pe.next=oe.next,pe.prev=oe,oe.next.prev=pe,oe.next=pe):(pe.prev=pe,pe.next=pe),pe}function p1(C){C.next.prev=C.prev,C.prev.next=C.next,C.prevZ&&(C.prevZ.nextZ=C.nextZ),C.nextZ&&(C.nextZ.prevZ=C.prevZ)}function X3(C,F,J){this.i=C,this.x=F,this.y=J,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Z3(C,F,J,oe){for(var pe=0,xe=F,Ce=J-oe;xeZe;){if(ct-Ze>600){var Bt=ct-Ze+1,Xt=Ne-Ze+1,Gt=Math.log(Bt),on=.5*Math.exp(2*Gt/3),vn=.5*Math.sqrt(Gt*on*(Bt-on)/Bt)*(Xt-Bt/2<0?-1:1),Cn=Math.max(Ze,Math.floor(Ne-Xt*on/Bt+vn)),En=Math.min(ct,Math.floor(Ne+(Bt-Xt)*on/Bt+vn));xe(Ce,Ne,Cn,En,gt)}var Vn=Ce[Ne],qn=Ze,Xn=ct;for(g1(Ce,Ze,Ne),gt(Ce[ct],Vn)>0&&g1(Ce,Ze,ct);qn0;)Xn--}gt(Ce[Ze],Vn)===0?g1(Ce,Ze,Xn):(Xn++,g1(Ce,Xn,ct)),Xn<=Ne&&(Ze=Xn+1),Ne<=Xn&&(ct=Xn-1)}})(C,F,J||0,oe||C.length-1,pe||u$)}function g1(C,F,J){var oe=C[F];C[F]=C[J],C[J]=oe}function u$(C,F){return CF?1:0}function J3(C,F){var J=C.length;if(J<=1)return[C];for(var oe,pe,xe=[],Ce=0;Ce1)for(var Ze=0;Ze0&&(oe+=C[pe-1].length,J.holes.push(oe))}return J},W3.default=KH;var Ic=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(F){return F.id}),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new yu,this.indexArray=new rs,this.indexArray2=new V,this.programConfigurations=new Ha(K8,C.layers,C.zoom),this.segments=new Nt,this.segments2=new Nt,this.stateDependentLayerIds=this.layers.filter(function(F){return F.isStateDependent()}).map(function(F){return F.id})};Ic.prototype.populate=function(C,F,J){this.hasPattern=K3("fill",this.layers,F);for(var oe=this.layers[0].layout.get("fill-sort-key"),pe=[],xe=0,Ce=C;xe>3}if(pe--,oe===1||oe===2)xe+=C.readSVarint(),Ce+=C.readSVarint(),oe===1&&(F&&Ne.push(F),F=[]),F.push(new h(xe,Ce));else{if(oe!==7)throw new Error("unknown command "+oe);F&&F.push(F[0].clone())}}return F&&Ne.push(F),Ne},og.prototype.bbox=function(){var C=this._pbf;C.pos=this._geometry;for(var F=C.readVarint()+C.pos,J=1,oe=0,pe=0,xe=0,Ce=1/0,Ne=-1/0,Ze=1/0,ct=-1/0;C.pos>3}if(oe--,J===1||J===2)(pe+=C.readSVarint())Ne&&(Ne=pe),(xe+=C.readSVarint())ct&&(ct=xe);else if(J!==7)throw new Error("unknown command "+J)}return[Ce,Ze,Ne,ct]},og.prototype.toGeoJSON=function(C,F,J){var oe,pe,xe=this.extent*Math.pow(2,J),Ce=this.extent*C,Ne=this.extent*F,Ze=this.loadGeometry(),ct=og.types[this.type];function gt(Gt){for(var on=0;on>3;pe=Ce===1?oe.readString():Ce===2?oe.readFloat():Ce===3?oe.readDouble():Ce===4?oe.readVarint64():Ce===5?oe.readVarint():Ce===6?oe.readSVarint():Ce===7?oe.readBoolean():null}return pe}(J))}function v$(C,F,J){if(C===3){var oe=new a9(J,J.readVarint()+J.pos);oe.length&&(F[oe.name]=oe)}}o9.prototype.feature=function(C){if(C<0||C>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[C];var F=this._pbf.readVarint()+this._pbf.pos;return new i9(this._pbf,F,this.extent,this._keys,this._values)};var sg={VectorTile:function(C,F){this.layers=C.readFields(v$,{},F)},VectorTileFeature:i9,VectorTileLayer:a9},y$=sg.VectorTileFeature.types,e5=Math.pow(2,13);function m1(C,F,J,oe,pe,xe,Ce,Ne){C.emplaceBack(F,J,2*Math.floor(oe*e5)+Ce,pe*e5*2,xe*e5*2,Math.round(Ne))}var zc=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(F){return F.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Hu,this.indexArray=new rs,this.programConfigurations=new Ha(r9,C.layers,C.zoom),this.segments=new Nt,this.stateDependentLayerIds=this.layers.filter(function(F){return F.isStateDependent()}).map(function(F){return F.id})};function x$(C,F){return C.x===F.x&&(C.x<0||C.x>8192)||C.y===F.y&&(C.y<0||C.y>8192)}function b$(C){return C.every(function(F){return F.x<0})||C.every(function(F){return F.x>8192})||C.every(function(F){return F.y<0})||C.every(function(F){return F.y>8192})}zc.prototype.populate=function(C,F,J){this.features=[],this.hasPattern=K3("fill-extrusion",this.layers,F);for(var oe=0,pe=C;oe=1){var Vn=on[Cn-1];if(!x$(En,Vn)){Bt.vertexLength+4>Nt.MAX_VERTEX_ARRAY_LENGTH&&(Bt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var qn=En.sub(Vn)._perp()._unit(),Xn=Vn.dist(En);vn+Xn>32768&&(vn=0),m1(this.layoutVertexArray,En.x,En.y,qn.x,qn.y,0,0,vn),m1(this.layoutVertexArray,En.x,En.y,qn.x,qn.y,0,1,vn),vn+=Xn,m1(this.layoutVertexArray,Vn.x,Vn.y,qn.x,qn.y,0,0,vn),m1(this.layoutVertexArray,Vn.x,Vn.y,qn.x,qn.y,0,1,vn);var dr=Bt.vertexLength;this.indexArray.emplaceBack(dr,dr+2,dr+1),this.indexArray.emplaceBack(dr+1,dr+2,dr+3),Bt.vertexLength+=4,Bt.primitiveLength+=2}}}}if(Bt.vertexLength+Ze>Nt.MAX_VERTEX_ARRAY_LENGTH&&(Bt=this.segments.prepareSegment(Ze,this.layoutVertexArray,this.indexArray)),y$[C.type]==="Polygon"){for(var br=[],Hr=[],Vr=Bt.vertexLength,ei=0,vi=Ne;ei=2&&C[Ze-1].equals(C[Ze-2]);)Ze--;for(var ct=0;ct0;if(Hr&&En>ct){var ei=gt.dist(Gt);if(ei>2*Bt){var vi=gt.sub(gt.sub(Gt)._mult(Bt/ei)._round());this.updateDistance(Gt,vi),this.addCurrentVertex(vi,vn,0,0,Xt),Gt=vi}}var yi=Gt&&on,li=yi?J:Ne?"butt":oe;if(yi&&li==="round"&&(drpe&&(li="bevel"),li==="bevel"&&(dr>2&&(li="flipbevel"),dr100)Vn=Cn.mult(-1);else{var Si=dr*vn.add(Cn).mag()/vn.sub(Cn).mag();Vn._perp()._mult(Si*(Vr?-1:1))}this.addCurrentVertex(gt,Vn,0,0,Xt),this.addCurrentVertex(gt,Vn.mult(-1),0,0,Xt)}else if(li==="bevel"||li==="fakeround"){var Ai=-Math.sqrt(dr*dr-1),xi=Vr?Ai:0,Ta=Vr?0:Ai;if(Gt&&this.addCurrentVertex(gt,vn,xi,Ta,Xt),li==="fakeround")for(var da=Math.round(180*br/Math.PI/20),Oa=1;Oa2*Bt){var Ga=gt.add(on.sub(gt)._mult(Bt/po)._round());this.updateDistance(gt,Ga),this.addCurrentVertex(Ga,Cn,0,0,Xt),gt=Ga}}}}},El.prototype.addCurrentVertex=function(C,F,J,oe,pe,xe){xe===void 0&&(xe=!1);var Ce=F.x+F.y*J,Ne=F.y-F.x*J,Ze=-F.x+F.y*oe,ct=-F.y-F.x*oe;this.addHalfVertex(C,Ce,Ne,xe,!1,J,pe),this.addHalfVertex(C,Ze,ct,xe,!0,-oe,pe),this.distance>u9/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,F,J,oe,pe,xe))},El.prototype.addHalfVertex=function(C,F,J,oe,pe,xe,Ce){var Ne=C.x,Ze=C.y,ct=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((Ne<<1)+(oe?1:0),(Ze<<1)+(pe?1:0),Math.round(63*F)+128,Math.round(63*J)+128,1+(xe===0?0:xe<0?-1:1)|(63&ct)<<2,ct>>6);var gt=Ce.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,gt),Ce.primitiveLength++),pe?this.e2=gt:this.e1=gt},El.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(u9-1):this.distance},El.prototype.updateDistance=function(C,F){this.distance+=C.dist(F),this.updateScaledDistance()},Qn("LineBucket",El,{omit:["layers","patternFeatures"]});var A$=new Us({"line-cap":new wi(De.layout_line["line-cap"]),"line-join":new Di(De.layout_line["line-join"]),"line-miter-limit":new wi(De.layout_line["line-miter-limit"]),"line-round-limit":new wi(De.layout_line["line-round-limit"]),"line-sort-key":new Di(De.layout_line["line-sort-key"])}),c9={paint:new Us({"line-opacity":new Di(De.paint_line["line-opacity"]),"line-color":new Di(De.paint_line["line-color"]),"line-translate":new wi(De.paint_line["line-translate"]),"line-translate-anchor":new wi(De.paint_line["line-translate-anchor"]),"line-width":new Di(De.paint_line["line-width"]),"line-gap-width":new Di(De.paint_line["line-gap-width"]),"line-offset":new Di(De.paint_line["line-offset"]),"line-blur":new Di(De.paint_line["line-blur"]),"line-dasharray":new Tf(De.paint_line["line-dasharray"]),"line-pattern":new kf(De.paint_line["line-pattern"]),"line-gradient":new Jl(De.paint_line["line-gradient"])}),layout:A$},f9=new(function(C){function F(){C.apply(this,arguments)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.possiblyEvaluate=function(J,oe){return oe=new Pa(Math.floor(oe.zoom),{now:oe.now,fadeDuration:oe.fadeDuration,zoomHistory:oe.zoomHistory,transition:oe.transition}),C.prototype.possiblyEvaluate.call(this,J,oe)},F.prototype.evaluate=function(J,oe,pe,xe){return oe=x({},oe,{zoom:Math.floor(oe.zoom)}),C.prototype.evaluate.call(this,J,oe,pe,xe)},F}(Di))(c9.paint.properties["line-width"].specification);f9.useIntegerZoom=!0;var M$=function(C){function F(J){C.call(this,J,c9)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype._handleSpecialPaintPropertyUpdate=function(J){J==="line-gradient"&&this._updateGradient()},F.prototype._updateGradient=function(){var J=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=J8(J,"lineProgress"),this.gradientTexture=null},F.prototype.recalculate=function(J,oe){C.prototype.recalculate.call(this,J,oe),this.paint._values["line-floorwidth"]=f9.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,J)},F.prototype.createBucket=function(J){return new El(J)},F.prototype.queryRadius=function(J){var oe=J,pe=h9(fo("line-width",this,oe),fo("line-gap-width",this,oe)),xe=fo("line-offset",this,oe);return pe/2+Math.abs(xe)+Vs(this.paint.get("line-translate"))},F.prototype.queryIntersectsFeature=function(J,oe,pe,xe,Ce,Ne,Ze){var ct=qs(J,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ne.angle,Ze),gt=Ze/2*h9(this.paint.get("line-width").evaluate(oe,pe),this.paint.get("line-gap-width").evaluate(oe,pe)),Bt=this.paint.get("line-offset").evaluate(oe,pe);return Bt&&(xe=function(Xt,Gt){for(var on=[],vn=new h(0,0),Cn=0;Cn=3){for(var En=0;En0?F+2*C:C}var t5=Da([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),S$=Da([{name:"a_projected_pos",components:3,type:"Float32"}],4),E$=(Da([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Da([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),d9=(Da([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Da([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),C$=Da([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Da([{name:"triangle",components:3,type:"Uint16"}]),Da([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Da([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Da([{type:"Float32",name:"offsetX"}]),Da([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function O$(C,F,J){return C.sections.forEach(function(oe){oe.text=function(pe,xe,Ce){var Ne=xe.layout.get("text-transform").evaluate(Ce,{});return Ne==="uppercase"?pe=pe.toLocaleUpperCase():Ne==="lowercase"&&(pe=pe.toLocaleLowerCase()),ps.applyArabicShaping&&(pe=ps.applyArabicShaping(pe)),pe}(oe.text,F,J)}),C}var y1={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\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"},p9=function(C,F,J,oe,pe){var xe,Ce,Ne=8*pe-oe-1,Ze=(1<>1,gt=-7,Bt=J?pe-1:0,Xt=J?-1:1,Gt=C[F+Bt];for(Bt+=Xt,xe=Gt&(1<<-gt)-1,Gt>>=-gt,gt+=Ne;gt>0;xe=256*xe+C[F+Bt],Bt+=Xt,gt-=8);for(Ce=xe&(1<<-gt)-1,xe>>=-gt,gt+=oe;gt>0;Ce=256*Ce+C[F+Bt],Bt+=Xt,gt-=8);if(xe===0)xe=1-ct;else{if(xe===Ze)return Ce?NaN:1/0*(Gt?-1:1);Ce+=Math.pow(2,oe),xe-=ct}return(Gt?-1:1)*Ce*Math.pow(2,xe-oe)},g9=function(C,F,J,oe,pe,xe){var Ce,Ne,Ze,ct=8*xe-pe-1,gt=(1<>1,Xt=pe===23?Math.pow(2,-24)-Math.pow(2,-77):0,Gt=oe?0:xe-1,on=oe?1:-1,vn=F<0||F===0&&1/F<0?1:0;for(F=Math.abs(F),isNaN(F)||F===1/0?(Ne=isNaN(F)?1:0,Ce=gt):(Ce=Math.floor(Math.log(F)/Math.LN2),F*(Ze=Math.pow(2,-Ce))<1&&(Ce--,Ze*=2),(F+=Ce+Bt>=1?Xt/Ze:Xt*Math.pow(2,1-Bt))*Ze>=2&&(Ce++,Ze/=2),Ce+Bt>=gt?(Ne=0,Ce=gt):Ce+Bt>=1?(Ne=(F*Ze-1)*Math.pow(2,pe),Ce+=Bt):(Ne=F*Math.pow(2,Bt-1)*Math.pow(2,pe),Ce=0));pe>=8;C[J+Gt]=255&Ne,Gt+=on,Ne/=256,pe-=8);for(Ce=Ce<0;C[J+Gt]=255&Ce,Gt+=on,Ce/=256,ct-=8);C[J+Gt-on]|=128*vn},yx=to;function to(C){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(C)?C:new Uint8Array(C||0),this.pos=0,this.type=0,this.length=this.buf.length}to.Varint=0,to.Fixed64=1,to.Bytes=2,to.Fixed32=5;var m9=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function xh(C){return C.type===to.Bytes?C.readVarint()+C.pos:C.pos+1}function lg(C,F,J){return J?4294967296*F+(C>>>0):4294967296*(F>>>0)+(C>>>0)}function v9(C,F,J){var oe=F<=16383?1:F<=2097151?2:F<=268435455?3:Math.floor(Math.log(F)/(7*Math.LN2));J.realloc(oe);for(var pe=J.pos-1;pe>=C;pe--)J.buf[pe+oe]=J.buf[pe]}function L$(C,F){for(var J=0;J>>8,C[J+2]=F>>>16,C[J+3]=F>>>24}function y9(C,F){return(C[F]|C[F+1]<<8|C[F+2]<<16)+(C[F+3]<<24)}to.prototype={destroy:function(){this.buf=null},readFields:function(C,F,J){for(J=J||this.length;this.pos>3,xe=this.pos;this.type=7&oe,C(pe,F,this),this.pos===xe&&this.skip(oe)}return F},readMessage:function(C,F){return this.readFields(C,F,this.readVarint()+this.pos)},readFixed32:function(){var C=xx(this.buf,this.pos);return this.pos+=4,C},readSFixed32:function(){var C=y9(this.buf,this.pos);return this.pos+=4,C},readFixed64:function(){var C=xx(this.buf,this.pos)+4294967296*xx(this.buf,this.pos+4);return this.pos+=8,C},readSFixed64:function(){var C=xx(this.buf,this.pos)+4294967296*y9(this.buf,this.pos+4);return this.pos+=8,C},readFloat:function(){var C=p9(this.buf,this.pos,!0,23,4);return this.pos+=4,C},readDouble:function(){var C=p9(this.buf,this.pos,!0,52,8);return this.pos+=8,C},readVarint:function(C){var F,J,oe=this.buf;return F=127&(J=oe[this.pos++]),J<128?F:(F|=(127&(J=oe[this.pos++]))<<7,J<128?F:(F|=(127&(J=oe[this.pos++]))<<14,J<128?F:(F|=(127&(J=oe[this.pos++]))<<21,J<128?F:function(pe,xe,Ce){var Ne,Ze,ct=Ce.buf;if(Ze=ct[Ce.pos++],Ne=(112&Ze)>>4,Ze<128||(Ze=ct[Ce.pos++],Ne|=(127&Ze)<<3,Ze<128)||(Ze=ct[Ce.pos++],Ne|=(127&Ze)<<10,Ze<128)||(Ze=ct[Ce.pos++],Ne|=(127&Ze)<<17,Ze<128)||(Ze=ct[Ce.pos++],Ne|=(127&Ze)<<24,Ze<128)||(Ze=ct[Ce.pos++],Ne|=(1&Ze)<<31,Ze<128))return lg(pe,Ne,xe);throw new Error("Expected varint not more than 10 bytes")}(F|=(15&(J=oe[this.pos]))<<28,C,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var C=this.readVarint();return C%2==1?(C+1)/-2:C/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var C=this.readVarint()+this.pos,F=this.pos;return this.pos=C,C-F>=12&&m9?function(J,oe,pe){return m9.decode(J.subarray(oe,pe))}(this.buf,F,C):function(J,oe,pe){for(var xe="",Ce=oe;Ce239?4:gt>223?3:gt>191?2:1;if(Ce+Xt>pe)break;Xt===1?gt<128&&(Bt=gt):Xt===2?(192&(Ne=J[Ce+1]))==128&&(Bt=(31>)<<6|63&Ne)<=127&&(Bt=null):Xt===3?(Ne=J[Ce+1],Ze=J[Ce+2],(192&Ne)==128&&(192&Ze)==128&&((Bt=(15>)<<12|(63&Ne)<<6|63&Ze)<=2047||Bt>=55296&&Bt<=57343)&&(Bt=null)):Xt===4&&(Ne=J[Ce+1],Ze=J[Ce+2],ct=J[Ce+3],(192&Ne)==128&&(192&Ze)==128&&(192&ct)==128&&((Bt=(15>)<<18|(63&Ne)<<12|(63&Ze)<<6|63&ct)<=65535||Bt>=1114112)&&(Bt=null)),Bt===null?(Bt=65533,Xt=1):Bt>65535&&(Bt-=65536,xe+=String.fromCharCode(Bt>>>10&1023|55296),Bt=56320|1023&Bt),xe+=String.fromCharCode(Bt),Ce+=Xt}return xe}(this.buf,F,C)},readBytes:function(){var C=this.readVarint()+this.pos,F=this.buf.subarray(this.pos,C);return this.pos=C,F},readPackedVarint:function(C,F){if(this.type!==to.Bytes)return C.push(this.readVarint(F));var J=xh(this);for(C=C||[];this.pos127;);else if(F===to.Bytes)this.pos=this.readVarint()+this.pos;else if(F===to.Fixed32)this.pos+=4;else{if(F!==to.Fixed64)throw new Error("Unimplemented type: "+F);this.pos+=8}},writeTag:function(C,F){this.writeVarint(C<<3|F)},realloc:function(C){for(var F=this.length||16;F268435455||C<0?function(F,J){var oe,pe;if(F>=0?(oe=F%4294967296|0,pe=F/4294967296|0):(pe=~(-F/4294967296),4294967295^(oe=~(-F%4294967296))?oe=oe+1|0:(oe=0,pe=pe+1|0)),F>=18446744073709552e3||F<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");J.realloc(10),function(xe,Ce,Ne){Ne.buf[Ne.pos++]=127&xe|128,xe>>>=7,Ne.buf[Ne.pos++]=127&xe|128,xe>>>=7,Ne.buf[Ne.pos++]=127&xe|128,xe>>>=7,Ne.buf[Ne.pos++]=127&xe|128,xe>>>=7,Ne.buf[Ne.pos]=127&xe}(oe,0,J),function(xe,Ce){var Ne=(7&xe)<<4;Ce.buf[Ce.pos++]|=Ne|((xe>>>=3)?128:0),xe&&(Ce.buf[Ce.pos++]=127&xe|((xe>>>=7)?128:0),xe&&(Ce.buf[Ce.pos++]=127&xe|((xe>>>=7)?128:0),xe&&(Ce.buf[Ce.pos++]=127&xe|((xe>>>=7)?128:0),xe&&(Ce.buf[Ce.pos++]=127&xe|((xe>>>=7)?128:0),xe&&(Ce.buf[Ce.pos++]=127&xe)))))}(pe,J)}(C,this):(this.realloc(4),this.buf[this.pos++]=127&C|(C>127?128:0),C<=127||(this.buf[this.pos++]=127&(C>>>=7)|(C>127?128:0),C<=127||(this.buf[this.pos++]=127&(C>>>=7)|(C>127?128:0),C<=127||(this.buf[this.pos++]=C>>>7&127))))},writeSVarint:function(C){this.writeVarint(C<0?2*-C-1:2*C)},writeBoolean:function(C){this.writeVarint(Boolean(C))},writeString:function(C){C=String(C),this.realloc(4*C.length),this.pos++;var F=this.pos;this.pos=function(oe,pe,xe){for(var Ce,Ne,Ze=0;Ze55295&&Ce<57344){if(!Ne){Ce>56319||Ze+1===pe.length?(oe[xe++]=239,oe[xe++]=191,oe[xe++]=189):Ne=Ce;continue}if(Ce<56320){oe[xe++]=239,oe[xe++]=191,oe[xe++]=189,Ne=Ce;continue}Ce=Ne-55296<<10|Ce-56320|65536,Ne=null}else Ne&&(oe[xe++]=239,oe[xe++]=191,oe[xe++]=189,Ne=null);Ce<128?oe[xe++]=Ce:(Ce<2048?oe[xe++]=Ce>>6|192:(Ce<65536?oe[xe++]=Ce>>12|224:(oe[xe++]=Ce>>18|240,oe[xe++]=Ce>>12&63|128),oe[xe++]=Ce>>6&63|128),oe[xe++]=63&Ce|128)}return xe}(this.buf,C,this.pos);var J=this.pos-F;J>=128&&v9(F,J,this),this.pos=F-1,this.writeVarint(J),this.pos+=J},writeFloat:function(C){this.realloc(4),g9(this.buf,C,this.pos,!0,23,4),this.pos+=4},writeDouble:function(C){this.realloc(8),g9(this.buf,C,this.pos,!0,52,8),this.pos+=8},writeBytes:function(C){var F=C.length;this.writeVarint(F),this.realloc(F);for(var J=0;J=128&&v9(J,oe,this),this.pos=J-1,this.writeVarint(oe),this.pos+=oe},writeMessage:function(C,F,J){this.writeTag(C,to.Bytes),this.writeRawMessage(F,J)},writePackedVarint:function(C,F){F.length&&this.writeMessage(C,L$,F)},writePackedSVarint:function(C,F){F.length&&this.writeMessage(C,P$,F)},writePackedBoolean:function(C,F){F.length&&this.writeMessage(C,z$,F)},writePackedFloat:function(C,F){F.length&&this.writeMessage(C,D$,F)},writePackedDouble:function(C,F){F.length&&this.writeMessage(C,I$,F)},writePackedFixed32:function(C,F){F.length&&this.writeMessage(C,R$,F)},writePackedSFixed32:function(C,F){F.length&&this.writeMessage(C,F$,F)},writePackedFixed64:function(C,F){F.length&&this.writeMessage(C,N$,F)},writePackedSFixed64:function(C,F){F.length&&this.writeMessage(C,B$,F)},writeBytesField:function(C,F){this.writeTag(C,to.Bytes),this.writeBytes(F)},writeFixed32Field:function(C,F){this.writeTag(C,to.Fixed32),this.writeFixed32(F)},writeSFixed32Field:function(C,F){this.writeTag(C,to.Fixed32),this.writeSFixed32(F)},writeFixed64Field:function(C,F){this.writeTag(C,to.Fixed64),this.writeFixed64(F)},writeSFixed64Field:function(C,F){this.writeTag(C,to.Fixed64),this.writeSFixed64(F)},writeVarintField:function(C,F){this.writeTag(C,to.Varint),this.writeVarint(F)},writeSVarintField:function(C,F){this.writeTag(C,to.Varint),this.writeSVarint(F)},writeStringField:function(C,F){this.writeTag(C,to.Bytes),this.writeString(F)},writeFloatField:function(C,F){this.writeTag(C,to.Fixed32),this.writeFloat(F)},writeDoubleField:function(C,F){this.writeTag(C,to.Fixed64),this.writeDouble(F)},writeBooleanField:function(C,F){this.writeVarintField(C,Boolean(F))}};function j$(C,F,J){C===1&&J.readMessage(U$,F)}function U$(C,F,J){if(C===3){var oe=J.readMessage(V$,{}),pe=oe.id,xe=oe.bitmap,Ce=oe.width,Ne=oe.height,Ze=oe.left,ct=oe.top,gt=oe.advance;F.push({id:pe,bitmap:new Lp({width:Ce+6,height:Ne+6},xe),metrics:{width:Ce,height:Ne,left:Ze,top:ct,advance:gt}})}}function V$(C,F,J){C===1?F.id=J.readVarint():C===2?F.bitmap=J.readBytes():C===3?F.width=J.readVarint():C===4?F.height=J.readVarint():C===5?F.left=J.readSVarint():C===6?F.top=J.readSVarint():C===7&&(F.advance=J.readVarint())}function x9(C){for(var F=0,J=0,oe=0,pe=C;oe=0;Xt--){var Gt=Ce[Xt];if(!(Bt.w>Gt.w||Bt.h>Gt.h)){if(Bt.x=Gt.x,Bt.y=Gt.y,Ze=Math.max(Ze,Bt.y+Bt.h),Ne=Math.max(Ne,Bt.x+Bt.w),Bt.w===Gt.w&&Bt.h===Gt.h){var on=Ce.pop();Xt0&&yg>Eo&&(Eo=yg)}else{var Lx=da[Ia.fontStack],zp=Lx&&Lx[yl];if(zp&&zp.rect)Rc=zp.rect,el=zp.metrics;else{var Px=Ta[Ia.fontStack],Dx=Px&&Px[yl];if(!Dx)continue;el=Dx.metrics}eu=24*(aa-Ia.scale)}Fc?(xi.verticalizable=!0,Io.push({glyph:yl,imageName:wh,x:Hs,y:Es+eu,vertical:Fc,scale:Ia.scale,fontStack:Ia.fontStack,sectionIndex:zo,metrics:el,rect:Rc}),Hs+=Cs*Ia.scale+Ga):(Io.push({glyph:yl,imageName:wh,x:Hs,y:Es+eu,vertical:Fc,scale:Ia.scale,fontStack:Ia.fontStack,sectionIndex:zo,metrics:el,rect:Rc}),Hs+=el.advance*Ia.scale+Ga)}if(Io.length!==0){var Ix=Hs-Ga;Ps=Math.max(Ix,Ps),H$(Io,0,Io.length-1,Qs,Eo)}Hs=0;var zx=va*aa+Eo;Do.lineOffset=Math.max(Eo,Ma),Es+=zx,vl=Math.max(zx,vl),++ls}else Es+=va,++ls}var dd,xg=Es- -17,Rx=r5(no),bg=Rx.horizontalAlign,pd=Rx.verticalAlign;(function(k1,Fx,Nx,Bx,T1,jx,A1,Ux,M1){var Vx=(Fx-Nx)*T1,_g=0;_g=jx!==A1?-Ux*Bx- -17:(-Bx*M1+.5)*A1;for(var wg=0,kg=k1;wg=0&&oe>=C&&wx[this.text.charCodeAt(oe)];oe--)J--;this.text=this.text.substring(C,J),this.sectionIndex=this.sectionIndex.slice(C,J)},Ks.prototype.substring=function(C,F){var J=new Ks;return J.text=this.text.substring(C,F),J.sectionIndex=this.sectionIndex.slice(C,F),J.sections=this.sections,J},Ks.prototype.toString=function(){return this.text},Ks.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(F,J){return Math.max(F,C.sections[J].scale)},0)},Ks.prototype.addTextSection=function(C,F){this.text+=C.text,this.sections.push(cg.forText(C.scale,C.fontStack||F));for(var J=this.sections.length-1,oe=0;oe=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var wx={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ql={};function b9(C,F,J,oe,pe,xe){if(F.imageName){var Ce=oe[F.imageName];return Ce?Ce.displaySize[0]*F.scale*24/xe+pe:0}var Ne=J[F.fontStack],Ze=Ne&&Ne[C];return Ze?Ze.metrics.advance*F.scale+pe:0}function _9(C,F,J,oe){var pe=Math.pow(C-F,2);return oe?C=0,Bt=0,Xt=0;Xt-J/2;){if(--Ce<0)return!1;Ne-=C[Ce].dist(xe),xe=C[Ce]}Ne+=C[Ce].dist(C[Ce+1]),Ce++;for(var Ze=[],ct=0;Neoe;)ct-=Ze.shift().angleDelta;if(ct>pe)return!1;Ce++,Ne+=Bt.dist(Xt)}return!0}function S9(C){for(var F=0,J=0;Jct){var on=(ct-Ze)/Gt,vn=kr(Bt.x,Xt.x,on),Cn=kr(Bt.y,Xt.y,on),En=new fg(vn,Cn,Xt.angleTo(Bt),gt);return En._round(),!Ce||M9(C,En,Ne,Ce,F)?En:void 0}Ze+=Gt}}function W$(C,F,J,oe,pe,xe,Ce,Ne,Ze){var ct=E9(oe,xe,Ce),gt=C9(oe,pe),Bt=gt*Ce,Xt=C[0].x===0||C[0].x===Ze||C[0].y===0||C[0].y===Ze;return F-Bt=0&&Oa=0&&Fi=0&&vi+Hr<=Vr){var va=new fg(Oa,Fi,Ta,li);va._round(),En&&!M9(on,va,qn,En,Vn)||yi.push(va)}}ei+=xi}return dr||yi.length||Xn||(yi=Gt(on,ei/2,Cn,En,Vn,qn,Xn,!0,br)),yi}(C,Xt?F/2*Ne%F:(gt/2+2*xe)*Ce*Ne%F,F,ct,J,Bt,Xt,!1,Ze)}function O9(C,F,J,oe,pe){for(var xe=[],Ce=0;Ce=oe&&Bt.x>=oe||(gt.x>=oe?gt=new h(oe,gt.y+(Bt.y-gt.y)*((oe-gt.x)/(Bt.x-gt.x)))._round():Bt.x>=oe&&(Bt=new h(oe,gt.y+(Bt.y-gt.y)*((oe-gt.x)/(Bt.x-gt.x)))._round()),gt.y>=pe&&Bt.y>=pe||(gt.y>=pe?gt=new h(gt.x+(Bt.x-gt.x)*((pe-gt.y)/(Bt.y-gt.y)),pe)._round():Bt.y>=pe&&(Bt=new h(gt.x+(Bt.x-gt.x)*((pe-gt.y)/(Bt.y-gt.y)),pe)._round()),Ze&>.equals(Ze[Ze.length-1])||(Ze=[gt],xe.push(Ze)),Ze.push(Bt)))))}return xe}function L9(C,F,J,oe){var pe=[],xe=C.image,Ce=xe.pixelRatio,Ne=xe.paddedRect.w-2,Ze=xe.paddedRect.h-2,ct=C.right-C.left,gt=C.bottom-C.top,Bt=xe.stretchX||[[0,Ne]],Xt=xe.stretchY||[[0,Ze]],Gt=function(va,no){return va+no[1]-no[0]},on=Bt.reduce(Gt,0),vn=Xt.reduce(Gt,0),Cn=Ne-on,En=Ze-vn,Vn=0,qn=on,Xn=0,dr=vn,br=0,Hr=Cn,Vr=0,ei=En;if(xe.content&&oe){var vi=xe.content;Vn=kx(Bt,0,vi[0]),Xn=kx(Xt,0,vi[1]),qn=kx(Bt,vi[0],vi[2]),dr=kx(Xt,vi[1],vi[3]),br=vi[0]-Vn,Vr=vi[1]-Xn,Hr=vi[2]-vi[0]-qn,ei=vi[3]-vi[1]-dr}var yi=function(va,no,$a,po){var Ga=Tx(va.stretch-Vn,qn,ct,C.left),ss=Ax(va.fixed-br,Hr,va.stretch,on),go=Tx(no.stretch-Xn,dr,gt,C.top),Hs=Ax(no.fixed-Vr,ei,no.stretch,vn),Es=Tx($a.stretch-Vn,qn,ct,C.left),Ps=Ax($a.fixed-br,Hr,$a.stretch,on),vl=Tx(po.stretch-Xn,dr,gt,C.top),Qs=Ax(po.fixed-Vr,ei,po.stretch,vn),ls=new h(Ga,go),Ds=new h(Es,go),Go=new h(Es,vl),gs=new h(Ga,vl),aa=new h(ss/Ce,Hs/Ce),Ma=new h(Ps/Ce,Qs/Ce),Do=F*Math.PI/180;if(Do){var Io=Math.sin(Do),Eo=Math.cos(Do),mo=[Eo,-Io,Io,Eo];ls._matMult(mo),Ds._matMult(mo),gs._matMult(mo),Go._matMult(mo)}var Ia=va.stretch+va.fixed,zo=$a.stretch+$a.fixed,yl=no.stretch+no.fixed,eu=po.stretch+po.fixed;return{tl:ls,tr:Ds,bl:gs,br:Go,tex:{x:xe.paddedRect.x+1+Ia,y:xe.paddedRect.y+1+yl,w:zo-Ia,h:eu-yl},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:aa,pixelOffsetBR:Ma,minFontScaleX:Hr/Ce/ct,minFontScaleY:ei/Ce/gt,isSDF:J}};if(oe&&(xe.stretchX||xe.stretchY))for(var li=P9(Bt,Cn,on),Si=P9(Xt,En,vn),Ai=0;Ai0&&(Gt=Math.max(10,Gt),this.circleDiameter=Gt)}else{var on=xe.top*Ce-Ne,vn=xe.bottom*Ce+Ne,Cn=xe.left*Ce-Ne,En=xe.right*Ce+Ne,Vn=xe.collisionPadding;if(Vn&&(Cn-=Vn[0]*Ce,on-=Vn[1]*Ce,En+=Vn[2]*Ce,vn+=Vn[3]*Ce),ct){var qn=new h(Cn,on),Xn=new h(En,on),dr=new h(Cn,vn),br=new h(En,vn),Hr=ct*Math.PI/180;qn._rotate(Hr),Xn._rotate(Hr),dr._rotate(Hr),br._rotate(Hr),Cn=Math.min(qn.x,Xn.x,dr.x,br.x),En=Math.max(qn.x,Xn.x,dr.x,br.x),on=Math.min(qn.y,Xn.y,dr.y,br.y),vn=Math.max(qn.y,Xn.y,dr.y,br.y)}C.emplaceBack(F.x,F.y,Cn,on,En,vn,J,oe,pe)}this.boxEndIndex=C.length},hg=function(C,F){if(C===void 0&&(C=[]),F===void 0&&(F=Y$),this.data=C,this.length=this.data.length,this.compare=F,this.length>0)for(var J=(this.length>>1)-1;J>=0;J--)this._down(J)};function Y$(C,F){return CF?1:0}function X$(C,F,J){F===void 0&&(F=1),J===void 0&&(J=!1);for(var oe=1/0,pe=1/0,xe=-1/0,Ce=-1/0,Ne=C[0],Ze=0;Zexe)&&(xe=ct.x),(!Ze||ct.y>Ce)&&(Ce=ct.y)}var gt=xe-oe,Bt=Ce-pe,Xt=Math.min(gt,Bt),Gt=Xt/2,on=new hg([],Z$);if(Xt===0)return new h(oe,pe);for(var vn=oe;vnEn.d||!En.d)&&(En=qn,J&&console.log("found best %d after %d probes",Math.round(1e4*qn.d)/1e4,Vn)),qn.max-En.d<=F||(Gt=qn.h/2,on.push(new dg(qn.p.x-Gt,qn.p.y-Gt,Gt,C)),on.push(new dg(qn.p.x+Gt,qn.p.y-Gt,Gt,C)),on.push(new dg(qn.p.x-Gt,qn.p.y+Gt,Gt,C)),on.push(new dg(qn.p.x+Gt,qn.p.y+Gt,Gt,C)),Vn+=4)}return J&&(console.log("num probes: "+Vn),console.log("best distance: "+En.d)),En.p}function Z$(C,F){return F.max-C.max}function dg(C,F,J,oe){this.p=new h(C,F),this.h=J,this.d=function(pe,xe){for(var Ce=!1,Ne=1/0,Ze=0;Zepe.y!=on.y>pe.y&&pe.x<(on.x-Gt.x)*(pe.y-Gt.y)/(on.y-Gt.y)+Gt.x&&(Ce=!Ce),Ne=Math.min(Ne,vh(pe,Gt,on))}return(Ce?1:-1)*Math.sqrt(Ne)}(this.p,oe),this.max=this.d+this.h*Math.SQRT2}hg.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},hg.prototype.pop=function(){if(this.length!==0){var C=this.data[0],F=this.data.pop();return this.length--,this.length>0&&(this.data[0]=F,this._down(0)),C}},hg.prototype.peek=function(){return this.data[0]},hg.prototype._up=function(C){for(var F=this.data,J=this.compare,oe=F[C];C>0;){var pe=C-1>>1,xe=F[pe];if(J(oe,xe)>=0)break;F[C]=xe,C=pe}F[C]=oe},hg.prototype._down=function(C){for(var F=this.data,J=this.compare,oe=this.length>>1,pe=F[C];C=0)break;F[C]=Ce,C=xe}F[C]=pe};var a5=Number.POSITIVE_INFINITY;function D9(C,F){return F[1]!==a5?function(J,oe,pe){var xe=0,Ce=0;switch(oe=Math.abs(oe),pe=Math.abs(pe),J){case"top-right":case"top-left":case"top":Ce=pe-7;break;case"bottom-right":case"bottom-left":case"bottom":Ce=7-pe}switch(J){case"top-right":case"bottom-right":case"right":xe=-oe;break;case"top-left":case"bottom-left":case"left":xe=oe}return[xe,Ce]}(C,F[0],F[1]):function(J,oe){var pe=0,xe=0;oe<0&&(oe=0);var Ce=oe/Math.sqrt(2);switch(J){case"top-right":case"top-left":xe=Ce-7;break;case"bottom-right":case"bottom-left":xe=7-Ce;break;case"bottom":xe=7-oe;break;case"top":xe=oe-7}switch(J){case"top-right":case"bottom-right":pe=-Ce;break;case"top-left":case"bottom-left":pe=Ce;break;case"left":pe=oe;break;case"right":pe=-oe}return[pe,xe]}(C,F[0])}function o5(C){switch(C){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function I9(C,F,J,oe,pe,xe,Ce,Ne,Ze,ct,gt,Bt,Xt,Gt,on){var vn=function(Xn,dr,br,Hr,Vr,ei,vi,yi){for(var li=Hr.layout.get("text-rotate").evaluate(ei,{})*Math.PI/180,Si=[],Ai=0,xi=dr.positionedLines;Ai32640&&O(C.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):Cn.kind==="composite"&&((En=[128*Gt.compositeTextSizes[0].evaluate(Ce,{},on),128*Gt.compositeTextSizes[1].evaluate(Ce,{},on)])[0]>32640||En[1]>32640)&&O(C.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),C.addSymbols(C.text,vn,En,Ne,xe,Ce,ct,F,Ze.lineStartIndex,Ze.lineLength,Xt,on);for(var Vn=0,qn=gt;Vn=0;Ce--)if(oe.dist(xe[Ce])0)&&(xe.value.kind!=="constant"||xe.value.value.length>0),ct=Ne.value.kind!=="constant"||!!Ne.value.value||Object.keys(Ne.parameters).length>0,gt=pe.get("symbol-sort-key");if(this.features=[],Ze||ct){for(var Bt=F.iconDependencies,Xt=F.glyphDependencies,Gt=F.availableImages,on=new Pa(this.zoom),vn=0,Cn=C;vn=0;for(var da=0,Oa=Vr.sections;da=0;Ne--)xe[Ne]={x:F[Ne].x,y:F[Ne].y,tileUnitDistanceFromAnchor:pe},Ne>0&&(pe+=F[Ne-1].dist(F[Ne]));for(var Ze=0;Ze0},ja.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ja.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ja.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ja.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ja.prototype.addIndicesForPlacedSymbol=function(C,F){for(var J=C.placedSymbolArray.get(F),oe=J.vertexStartIndex+4*J.numGlyphs,pe=J.vertexStartIndex;pe1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var J=0,oe=this.symbolInstanceIndexes;J=0&&Ze.indexOf(Ce)===Ne&&F.addIndicesForPlacedSymbol(F.text,Ce)}),xe.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,xe.verticalPlacedTextSymbolIndex),xe.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,xe.placedIconSymbolIndex),xe.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,xe.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Qn("SymbolBucket",ja,{omit:["layers","collisionBoxArray","features","compareText"]}),ja.MAX_GLYPHS=65535,ja.addDynamicAttributes=s5;var tG=new Us({"symbol-placement":new wi(De.layout_symbol["symbol-placement"]),"symbol-spacing":new wi(De.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wi(De.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Di(De.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wi(De.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wi(De.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new wi(De.layout_symbol["icon-ignore-placement"]),"icon-optional":new wi(De.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wi(De.layout_symbol["icon-rotation-alignment"]),"icon-size":new Di(De.layout_symbol["icon-size"]),"icon-text-fit":new wi(De.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wi(De.layout_symbol["icon-text-fit-padding"]),"icon-image":new Di(De.layout_symbol["icon-image"]),"icon-rotate":new Di(De.layout_symbol["icon-rotate"]),"icon-padding":new wi(De.layout_symbol["icon-padding"]),"icon-keep-upright":new wi(De.layout_symbol["icon-keep-upright"]),"icon-offset":new Di(De.layout_symbol["icon-offset"]),"icon-anchor":new Di(De.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wi(De.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wi(De.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wi(De.layout_symbol["text-rotation-alignment"]),"text-field":new Di(De.layout_symbol["text-field"]),"text-font":new Di(De.layout_symbol["text-font"]),"text-size":new Di(De.layout_symbol["text-size"]),"text-max-width":new Di(De.layout_symbol["text-max-width"]),"text-line-height":new wi(De.layout_symbol["text-line-height"]),"text-letter-spacing":new Di(De.layout_symbol["text-letter-spacing"]),"text-justify":new Di(De.layout_symbol["text-justify"]),"text-radial-offset":new Di(De.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wi(De.layout_symbol["text-variable-anchor"]),"text-anchor":new Di(De.layout_symbol["text-anchor"]),"text-max-angle":new wi(De.layout_symbol["text-max-angle"]),"text-writing-mode":new wi(De.layout_symbol["text-writing-mode"]),"text-rotate":new Di(De.layout_symbol["text-rotate"]),"text-padding":new wi(De.layout_symbol["text-padding"]),"text-keep-upright":new wi(De.layout_symbol["text-keep-upright"]),"text-transform":new Di(De.layout_symbol["text-transform"]),"text-offset":new Di(De.layout_symbol["text-offset"]),"text-allow-overlap":new wi(De.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new wi(De.layout_symbol["text-ignore-placement"]),"text-optional":new wi(De.layout_symbol["text-optional"])}),l5={paint:new Us({"icon-opacity":new Di(De.paint_symbol["icon-opacity"]),"icon-color":new Di(De.paint_symbol["icon-color"]),"icon-halo-color":new Di(De.paint_symbol["icon-halo-color"]),"icon-halo-width":new Di(De.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Di(De.paint_symbol["icon-halo-blur"]),"icon-translate":new wi(De.paint_symbol["icon-translate"]),"icon-translate-anchor":new wi(De.paint_symbol["icon-translate-anchor"]),"text-opacity":new Di(De.paint_symbol["text-opacity"]),"text-color":new Di(De.paint_symbol["text-color"],{runtimeType:St,getOverride:function(C){return C.textColor},hasOverride:function(C){return!!C.textColor}}),"text-halo-color":new Di(De.paint_symbol["text-halo-color"]),"text-halo-width":new Di(De.paint_symbol["text-halo-width"]),"text-halo-blur":new Di(De.paint_symbol["text-halo-blur"]),"text-translate":new wi(De.paint_symbol["text-translate"]),"text-translate-anchor":new wi(De.paint_symbol["text-translate-anchor"])}),layout:tG},gg=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:Ut,this.defaultValue=C};gg.prototype.evaluate=function(C){if(C.formattedSection){var F=this.defaultValue.property.overrides;if(F&&F.hasOverride(C.formattedSection))return F.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},gg.prototype.eachChild=function(C){this.defaultValue.isConstant()||C(this.defaultValue.value._styleExpression.expression)},gg.prototype.outputDefined=function(){return!1},gg.prototype.serialize=function(){return null},Qn("FormatSectionOverride",gg,{omit:["defaultValue"]});var nG=function(C){function F(J){C.call(this,J,l5)}return C&&(F.__proto__=C),F.prototype=Object.create(C&&C.prototype),F.prototype.constructor=F,F.prototype.recalculate=function(J,oe){if(C.prototype.recalculate.call(this,J,oe),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var pe=this.layout.get("text-writing-mode");if(pe){for(var xe=[],Ce=0,Ne=pe;Ce",targetMapId:oe,sourceMapId:xe.mapId})}}},mg.prototype.receive=function(C){var F=C.data,J=F.id;if(J&&(!F.targetMapId||this.mapId===F.targetMapId))if(F.type===""){delete this.tasks[J];var oe=this.cancelCallbacks[J];delete this.cancelCallbacks[J],oe&&oe()}else L()||F.mustQueue?(this.tasks[J]=F,this.taskQueue.push(J),this.invoker.trigger()):this.processTask(J,F)},mg.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),F=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),F&&this.processTask(C,F)}},mg.prototype.processTask=function(C,F){var J=this;if(F.type===""){var oe=this.callbacks[C];delete this.callbacks[C],oe&&(F.error?oe(Ni(F.error)):oe(null,Ni(F.data)))}else{var pe=!1,xe=B(this.globalScope)?void 0:[],Ce=F.hasCallback?function(gt,Bt){pe=!0,delete J.cancelCallbacks[C],J.target.postMessage({id:C,type:"",sourceMapId:J.mapId,error:gt?fi(gt):null,data:fi(Bt,xe)},xe)}:function(gt){pe=!0},Ne=null,Ze=Ni(F.data);if(this.parent[F.type])Ne=this.parent[F.type](F.sourceMapId,Ze,Ce);else if(this.parent.getWorkerSource){var ct=F.type.split(".");Ne=this.parent.getWorkerSource(F.sourceMapId,ct[0],Ze.source)[ct[1]](Ze,Ce)}else Ce(new Error("Could not find function "+F.type));!pe&&Ne&&Ne.cancel&&(this.cancelCallbacks[C]=Ne.cancel)}},mg.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var as=function(C,F){C&&(F?this.setSouthWest(C).setNorthEast(F):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};as.prototype.setNorthEast=function(C){return this._ne=C instanceof ho?new ho(C.lng,C.lat):ho.convert(C),this},as.prototype.setSouthWest=function(C){return this._sw=C instanceof ho?new ho(C.lng,C.lat):ho.convert(C),this},as.prototype.extend=function(C){var F,J,oe=this._sw,pe=this._ne;if(C instanceof ho)F=C,J=C;else{if(!(C instanceof as)){if(Array.isArray(C)){if(C.length===4||C.every(Array.isArray)){var xe=C;return this.extend(as.convert(xe))}var Ce=C;return this.extend(ho.convert(Ce))}return this}if(F=C._sw,J=C._ne,!F||!J)return this}return oe||pe?(oe.lng=Math.min(F.lng,oe.lng),oe.lat=Math.min(F.lat,oe.lat),pe.lng=Math.max(J.lng,pe.lng),pe.lat=Math.max(J.lat,pe.lat)):(this._sw=new ho(F.lng,F.lat),this._ne=new ho(J.lng,J.lat)),this},as.prototype.getCenter=function(){return new ho((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},as.prototype.getSouthWest=function(){return this._sw},as.prototype.getNorthEast=function(){return this._ne},as.prototype.getNorthWest=function(){return new ho(this.getWest(),this.getNorth())},as.prototype.getSouthEast=function(){return new ho(this.getEast(),this.getSouth())},as.prototype.getWest=function(){return this._sw.lng},as.prototype.getSouth=function(){return this._sw.lat},as.prototype.getEast=function(){return this._ne.lng},as.prototype.getNorth=function(){return this._ne.lat},as.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},as.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},as.prototype.isEmpty=function(){return!(this._sw&&this._ne)},as.prototype.contains=function(C){var F=ho.convert(C),J=F.lng,oe=F.lat,pe=this._sw.lat<=oe&&oe<=this._ne.lat,xe=this._sw.lng<=J&&J<=this._ne.lng;return this._sw.lng>this._ne.lng&&(xe=this._sw.lng>=J&&J>=this._ne.lng),pe&&xe},as.convert=function(C){return!C||C instanceof as?C:new as(C)};var ho=function(C,F){if(isNaN(C)||isNaN(F))throw new Error("Invalid LngLat object: ("+C+", "+F+")");if(this.lng=+C,this.lat=+F,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};ho.prototype.wrap=function(){return new ho(y(this.lng,-180,180),this.lat)},ho.prototype.toArray=function(){return[this.lng,this.lat]},ho.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},ho.prototype.distanceTo=function(C){var F=Math.PI/180,J=this.lat*F,oe=C.lat*F,pe=Math.sin(J)*Math.sin(oe)+Math.cos(J)*Math.cos(oe)*Math.cos((C.lng-this.lng)*F);return 63710088e-1*Math.acos(Math.min(pe,1))},ho.prototype.toBounds=function(C){C===void 0&&(C=0);var F=360*C/40075017,J=F/Math.cos(Math.PI/180*this.lat);return new as(new ho(this.lng-J,this.lat-F),new ho(this.lng+J,this.lat+F))},ho.convert=function(C){if(C instanceof ho)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new ho(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new ho(Number("lng"in C?C.lng:C.lon),Number(C.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 U9=2*Math.PI*63710088e-1;function V9(C){return U9*Math.cos(C*Math.PI/180)}function q9(C){return(180+C)/360}function H9(C){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+C*Math.PI/360)))/360}function $9(C,F){return C/V9(F)}function c5(C){var F=180-360*C;return 360/Math.PI*Math.atan(Math.exp(F*Math.PI/180))-90}var Dp=function(C,F,J){J===void 0&&(J=0),this.x=+C,this.y=+F,this.z=+J};Dp.fromLngLat=function(C,F){F===void 0&&(F=0);var J=ho.convert(C);return new Dp(q9(J.lng),H9(J.lat),$9(F,J.lat))},Dp.prototype.toLngLat=function(){return new ho(360*this.x-180,c5(this.y))},Dp.prototype.toAltitude=function(){return C=this.z,F=this.y,C*V9(c5(F));var C,F},Dp.prototype.meterInMercatorCoordinateUnits=function(){return 1/U9*(C=c5(this.y),1/Math.cos(C*Math.PI/180));var C};var Ip=function(C,F,J){this.z=C,this.x=F,this.y=J,this.key=w1(0,C,C,F,J)};Ip.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},Ip.prototype.url=function(C,F){var J,oe,pe,xe,Ce,Ne=(J=this.x,oe=this.y,pe=this.z,xe=j9(256*J,256*(oe=Math.pow(2,pe)-oe-1),pe),Ce=j9(256*(J+1),256*(oe+1),pe),xe[0]+","+xe[1]+","+Ce[0]+","+Ce[1]),Ze=function(ct,gt,Bt){for(var Xt,Gt="",on=ct;on>0;on--)Gt+=(gt&(Xt=1<this.canonical.z?new os(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new os(C,this.wrap,C,this.canonical.x>>F,this.canonical.y>>F)},os.prototype.calculateScaledKey=function(C,F){var J=this.canonical.z-C;return C>this.canonical.z?w1(this.wrap*+F,C,this.canonical.z,this.canonical.x,this.canonical.y):w1(this.wrap*+F,C,C,this.canonical.x>>J,this.canonical.y>>J)},os.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var F=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>F&&C.canonical.y===this.canonical.y>>F},os.prototype.children=function(C){if(this.overscaledZ>=C)return[new os(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var F=this.canonical.z+1,J=2*this.canonical.x,oe=2*this.canonical.y;return[new os(F,this.wrap,F,J,oe),new os(F,this.wrap,F,J+1,oe),new os(F,this.wrap,F,J,oe+1),new os(F,this.wrap,F,J+1,oe+1)]},os.prototype.isLessThan=function(C){return this.wrapC.wrap)&&(this.overscaledZC.overscaledZ)&&(this.canonical.xC.canonical.x)&&this.canonical.y=this.dim+1||F<-1||F>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(F+1)*this.stride+(C+1)},bh.prototype._unpackMapbox=function(C,F,J){return(256*C*256+256*F+J)/10-1e4},bh.prototype._unpackTerrarium=function(C,F,J){return 256*C+F+J/256-32768},bh.prototype.getPixels=function(){return new Sl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},bh.prototype.backfillBorder=function(C,F,J){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var oe=F*this.dim,pe=F*this.dim+this.dim,xe=J*this.dim,Ce=J*this.dim+this.dim;switch(F){case-1:oe=pe-1;break;case 1:pe=oe+1}switch(J){case-1:xe=Ce-1;break;case 1:Ce=xe+1}for(var Ne=-F*this.dim,Ze=-J*this.dim,ct=xe;ct=0&>[3]>=0&&Ne.insert(Ce,gt[0],gt[1],gt[2],gt[3])}},_h.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new sg.VectorTile(new yx(this.rawTileData)).layers,this.sourceLayerCoder=new Cx(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},_h.prototype.query=function(C,F,J,oe){var pe=this;this.loadVTLayers();for(var xe=C.params||{},Ce=8192/C.tileSize/C.scale,Ne=Ui(xe.filter),Ze=C.queryGeometry,ct=C.queryPadding*Ce,gt=Y9(Ze),Bt=this.grid.query(gt.minX-ct,gt.minY-ct,gt.maxX+ct,gt.maxY+ct),Xt=Y9(C.cameraQueryGeometry),Gt=this.grid3D.query(Xt.minX-ct,Xt.minY-ct,Xt.maxX+ct,Xt.maxY+ct,function(dr,br,Hr,Vr){return function(ei,vi,yi,li,Si){for(var Ai=0,xi=ei;Ai=Ta.x&&Si>=Ta.y)return!0}var da=[new h(vi,yi),new h(vi,Si),new h(li,Si),new h(li,yi)];if(ei.length>2){for(var Oa=0,Fi=da;Oa=0)return!0;return!1}(xe,Bt)){var Xt=this.sourceLayerCoder.decode(J),Gt=this.vtLayers[Xt].feature(oe);if(pe.filter(new Pa(this.tileID.overscaledZ),Gt))for(var on=this.getId(Gt,Xt),vn=0;vnoe)pe=!1;else if(F)if(this.expirationTimeVe&&(C.getActor().send("enforceCacheSizeLimit",Fe),nt=0)},i.clamp=v,i.clearTileCache=function(C){var F=self.caches.delete("mapbox-tiles");C&&F.catch(C).then(function(){return C()})},i.clipLine=O9,i.clone=function(C){var F=new Ml(16);return F[0]=C[0],F[1]=C[1],F[2]=C[2],F[3]=C[3],F[4]=C[4],F[5]=C[5],F[6]=C[6],F[7]=C[7],F[8]=C[8],F[9]=C[9],F[10]=C[10],F[11]=C[11],F[12]=C[12],F[13]=C[13],F[14]=C[14],F[15]=C[15],F},i.clone$1=E,i.clone$2=function(C){var F=new Ml(3);return F[0]=C[0],F[1]=C[1],F[2]=C[2],F},i.collisionCircleLayout=C$,i.config=$,i.create=function(){var C=new Ml(16);return Ml!=Float32Array&&(C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=0,C[12]=0,C[13]=0,C[14]=0),C[0]=1,C[5]=1,C[10]=1,C[15]=1,C},i.create$1=function(){var C=new Ml(9);return Ml!=Float32Array&&(C[1]=0,C[2]=0,C[3]=0,C[5]=0,C[6]=0,C[7]=0),C[0]=1,C[4]=1,C[8]=1,C},i.create$2=function(){var C=new Ml(4);return Ml!=Float32Array&&(C[1]=0,C[2]=0),C[0]=1,C[3]=1,C},i.createCommonjsModule=s,i.createExpression=Yt,i.createLayout=Da,i.createStyleLayer=function(C){return C.type==="custom"?new sG(C):new lG[C.type](C)},i.cross=function(C,F,J){var oe=F[0],pe=F[1],xe=F[2],Ce=J[0],Ne=J[1],Ze=J[2];return C[0]=pe*Ze-xe*Ne,C[1]=xe*Ce-oe*Ze,C[2]=oe*Ne-pe*Ce,C},i.deepEqual=function C(F,J){if(Array.isArray(F)){if(!Array.isArray(J)||F.length!==J.length)return!1;for(var oe=0;oe0&&(xe=1/Math.sqrt(xe)),C[0]=F[0]*xe,C[1]=F[1]*xe,C[2]=F[2]*xe,C},i.number=kr,i.offscreenCanvasSupported=ft,i.ortho=function(C,F,J,oe,pe,xe,Ce){var Ne=1/(F-J),Ze=1/(oe-pe),ct=1/(xe-Ce);return C[0]=-2*Ne,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=-2*Ze,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=2*ct,C[11]=0,C[12]=(F+J)*Ne,C[13]=(pe+oe)*Ze,C[14]=(Ce+xe)*ct,C[15]=1,C},i.parseGlyphPBF=function(C){return new yx(C).readFields(j$,[])},i.pbf=yx,i.performSymbolLayout=function(C,F,J,oe,pe,xe,Ce){C.createArrays();var Ne=512*C.overscaling;C.tilePixelRatio=8192/Ne,C.compareText={},C.iconsNeedLinear=!1;var Ze=C.layers[0].layout,ct=C.layers[0]._unevaluatedLayout._values,gt={};if(C.textSizeData.kind==="composite"){var Bt=C.textSizeData,Xt=Bt.minZoom,Gt=Bt.maxZoom;gt.compositeTextSizes=[ct["text-size"].possiblyEvaluate(new Pa(Xt),Ce),ct["text-size"].possiblyEvaluate(new Pa(Gt),Ce)]}if(C.iconSizeData.kind==="composite"){var on=C.iconSizeData,vn=on.minZoom,Cn=on.maxZoom;gt.compositeIconSizes=[ct["icon-size"].possiblyEvaluate(new Pa(vn),Ce),ct["icon-size"].possiblyEvaluate(new Pa(Cn),Ce)]}gt.layoutTextSize=ct["text-size"].possiblyEvaluate(new Pa(C.zoom+1),Ce),gt.layoutIconSize=ct["icon-size"].possiblyEvaluate(new Pa(C.zoom+1),Ce),gt.textMaxSize=ct["text-size"].possiblyEvaluate(new Pa(18));for(var En=24*Ze.get("text-line-height"),Vn=Ze.get("text-rotation-alignment")==="map"&&Ze.get("symbol-placement")!=="point",qn=Ze.get("text-keep-upright"),Xn=Ze.get("text-size"),dr=function(){var Vr=Hr[br],ei=Ze.get("text-font").evaluate(Vr,{},Ce).join(","),vi=Xn.evaluate(Vr,{},Ce),yi=gt.layoutTextSize.evaluate(Vr,{},Ce),li=gt.layoutIconSize.evaluate(Vr,{},Ce),Si={horizontal:{},vertical:void 0},Ai=Vr.text,xi=[0,0];if(Ai){var Ta=Ai.toString(),da=24*Ze.get("text-letter-spacing").evaluate(Vr,{},Ce),Oa=function(aa){for(var Ma=0,Do=aa;Ma=8192||E1.y<0||E1.y>=8192||function(Vo,jc,hG,gd,v5,Q9,Hx,Mf,$x,C1,Gx,Wx,y5,eC,O1,tC,nC,rC,iC,aC,_u,Yx,oC,Sf,dG){var x5,Rp,Mg,Sg,Eg,Cg=Vo.addToLineVertexArray(jc,hG),sC=0,lC=0,uC=0,cC=0,b5=-1,_5=-1,kh={},fC=Sn(""),w5=0,k5=0;if(Mf._unevaluatedLayout.getValue("text-radial-offset")===void 0?(x5=Mf.layout.get("text-offset").evaluate(_u,{},Sf).map(function(P1){return 24*P1}),w5=x5[0],k5=x5[1]):(w5=24*Mf.layout.get("text-radial-offset").evaluate(_u,{},Sf),k5=a5),Vo.allowVerticalPlacement&&gd.vertical){var hC=Mf.layout.get("text-rotate").evaluate(_u,{},Sf)+90,pG=gd.vertical;Sg=new Mx($x,jc,C1,Gx,Wx,pG,y5,eC,O1,hC),Hx&&(Eg=new Mx($x,jc,C1,Gx,Wx,Hx,nC,rC,O1,hC))}if(v5){var T5=Mf.layout.get("icon-rotate").evaluate(_u,{}),dC=Mf.layout.get("icon-text-fit")!=="none",pC=L9(v5,T5,oC,dC),A5=Hx?L9(Hx,T5,oC,dC):void 0;Mg=new Mx($x,jc,C1,Gx,Wx,v5,nC,rC,!1,T5),sC=4*pC.length;var gC=Vo.iconSizeData,L1=null;gC.kind==="source"?(L1=[128*Mf.layout.get("icon-size").evaluate(_u,{})])[0]>32640&&O(Vo.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):gC.kind==="composite"&&((L1=[128*Yx.compositeIconSizes[0].evaluate(_u,{},Sf),128*Yx.compositeIconSizes[1].evaluate(_u,{},Sf)])[0]>32640||L1[1]>32640)&&O(Vo.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),Vo.addSymbols(Vo.icon,pC,L1,aC,iC,_u,!1,jc,Cg.lineStartIndex,Cg.lineLength,-1,Sf),b5=Vo.icon.placedSymbolArray.length-1,A5&&(lC=4*A5.length,Vo.addSymbols(Vo.icon,A5,L1,aC,iC,_u,bu.vertical,jc,Cg.lineStartIndex,Cg.lineLength,-1,Sf),_5=Vo.icon.placedSymbolArray.length-1)}for(var mC in gd.horizontal){var Xx=gd.horizontal[mC];if(!Rp){fC=Sn(Xx.text);var gG=Mf.layout.get("text-rotate").evaluate(_u,{},Sf);Rp=new Mx($x,jc,C1,Gx,Wx,Xx,y5,eC,O1,gG)}var vC=Xx.positionedLines.length===1;if(uC+=I9(Vo,jc,Xx,Q9,Mf,O1,_u,tC,Cg,gd.vertical?bu.horizontal:bu.horizontalOnly,vC?Object.keys(gd.horizontal):[mC],kh,b5,Yx,Sf),vC)break}gd.vertical&&(cC+=I9(Vo,jc,gd.vertical,Q9,Mf,O1,_u,tC,Cg,bu.vertical,["vertical"],kh,_5,Yx,Sf));var mG=Rp?Rp.boxStartIndex:Vo.collisionBoxArray.length,vG=Rp?Rp.boxEndIndex:Vo.collisionBoxArray.length,yG=Sg?Sg.boxStartIndex:Vo.collisionBoxArray.length,xG=Sg?Sg.boxEndIndex:Vo.collisionBoxArray.length,bG=Mg?Mg.boxStartIndex:Vo.collisionBoxArray.length,_G=Mg?Mg.boxEndIndex:Vo.collisionBoxArray.length,wG=Eg?Eg.boxStartIndex:Vo.collisionBoxArray.length,kG=Eg?Eg.boxEndIndex:Vo.collisionBoxArray.length,Ef=-1,Zx=function(P1,xC){return P1&&P1.circleDiameter?Math.max(P1.circleDiameter,xC):xC};Ef=Zx(Rp,Ef),Ef=Zx(Sg,Ef),Ef=Zx(Mg,Ef);var yC=(Ef=Zx(Eg,Ef))>-1?1:0;yC&&(Ef*=dG/24),Vo.glyphOffsetArray.length>=ja.MAX_GLYPHS&&O("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),_u.sortKey!==void 0&&Vo.addToSortKeyRanges(Vo.symbolInstances.length,_u.sortKey),Vo.symbolInstances.emplaceBack(jc.x,jc.y,kh.right>=0?kh.right:-1,kh.center>=0?kh.center:-1,kh.left>=0?kh.left:-1,kh.vertical||-1,b5,_5,fC,mG,vG,yG,xG,bG,_G,wG,kG,C1,uC,cC,sC,lC,yC,0,y5,w5,k5,Ef)}(aa,E1,fG,Do,Io,Eo,wh,aa.layers[0],aa.collisionBoxArray,Ma.index,Ma.sourceLayerIndex,aa.index,h5,Px,zx,yl,Lx,Dx,dd,Fc,Ma,mo,eu,el,Ia)};if(xg==="line")for(var k1=0,Fx=O9(Ma.geometry,0,0,8192,8192);k11){var wg=G$(_g,Ix,Do.vertical||Nc,Io,24,yg);wg&&pd(_g,wg)}}else if(Ma.type==="Polygon")for(var kg=0,qx=J3(Ma.geometry,0);kg=mn.maxzoom||mn.visibility!=="none"&&(g(Ht,this.zoom,Ae),(tt[mn.id]=mn.createBucket({index:ot.bucketLayerIDs.length,layers:Ht,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Le,sourceID:this.source})).populate(Je,bt,this.tileID.canonical),ot.bucketLayerIDs.push(Ht.map(function(sn){return sn.id})))}}}var zn=i.mapObject(bt.glyphDependencies,function(sn){return Object.keys(sn).map(Number)});Object.keys(zn).length?De.send("getGlyphs",{uid:this.uid,stacks:zn},function(sn,gn){kt||(kt=sn,wt=gn,nn.call(rt))}):wt={};var pn=Object.keys(bt.iconDependencies);pn.length?De.send("getImages",{icons:pn,source:this.source,tileID:this.tileID,type:"icons"},function(sn,gn){kt||(kt=sn,Vt=gn,nn.call(rt))}):Vt={};var tn=Object.keys(bt.patternDependencies);function nn(){if(kt)return He(kt);if(wt&&Vt&&Ut){var sn=new h(wt),gn=new i.ImageAtlas(Vt,Ut);for(var bn in tt){var In=tt[bn];In instanceof i.SymbolBucket?(g(In.layers,this.zoom,Ae),i.performSymbolLayout(In,wt,sn.positions,Vt,gn.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):In.hasPattern&&(In instanceof i.LineBucket||In instanceof i.FillBucket||In instanceof i.FillExtrusionBucket)&&(g(In.layers,this.zoom,Ae),In.addFeatures(bt,this.tileID.canonical,gn.patternPositions))}this.status="done",He(null,{buckets:i.values(tt).filter(function(Hn){return!Hn.isEmpty()}),featureIndex:ot,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:sn.image,imageAtlas:gn,glyphMap:this.returnDependencies?wt:null,iconMap:this.returnDependencies?Vt:null,glyphPositions:this.returnDependencies?sn.positions:null})}}tn.length?De.send("getImages",{icons:tn,source:this.source,tileID:this.tileID,type:"patterns"},function(sn,gn){kt||(kt=sn,Ut=gn,nn.call(rt))}):Ut={},nn.call(this)};var v=function(Pe,Ie,Ae,De){this.actor=Pe,this.layerIndex=Ie,this.availableImages=Ae,this.loadVectorData=De||p,this.loading={},this.loaded={}};v.prototype.loadTile=function(Pe,Ie){var Ae=this,De=Pe.uid;this.loading||(this.loading={});var He=!!(Pe&&Pe.request&&Pe.request.collectResourceTiming)&&new i.RequestPerformance(Pe.request),rt=this.loading[De]=new m(Pe);rt.abort=this.loadVectorData(Pe,function(lt,ot){if(delete Ae.loading[De],lt||!ot)return rt.status="done",Ae.loaded[De]=rt,Ie(lt);var kt=ot.rawData,wt={};ot.expires&&(wt.expires=ot.expires),ot.cacheControl&&(wt.cacheControl=ot.cacheControl);var Vt={};if(He){var Ut=He.finish();Ut&&(Vt.resourceTiming=JSON.parse(JSON.stringify(Ut)))}rt.vectorTile=ot.vectorTile,rt.parse(ot.vectorTile,Ae.layerIndex,Ae.availableImages,Ae.actor,function(tt,bt){if(tt||!bt)return Ie(tt);Ie(null,i.extend({rawTileData:kt.slice(0)},bt,wt,Vt))}),Ae.loaded=Ae.loaded||{},Ae.loaded[De]=rt})},v.prototype.reloadTile=function(Pe,Ie){var Ae=this,De=this.loaded,He=Pe.uid,rt=this;if(De&&De[He]){var lt=De[He];lt.showCollisionBoxes=Pe.showCollisionBoxes;var ot=function(kt,wt){var Vt=lt.reloadCallback;Vt&&(delete lt.reloadCallback,lt.parse(lt.vectorTile,rt.layerIndex,Ae.availableImages,rt.actor,Vt)),Ie(kt,wt)};lt.status==="parsing"?lt.reloadCallback=ot:lt.status==="done"&&(lt.vectorTile?lt.parse(lt.vectorTile,this.layerIndex,this.availableImages,this.actor,ot):ot())}},v.prototype.abortTile=function(Pe,Ie){var Ae=this.loading,De=Pe.uid;Ae&&Ae[De]&&Ae[De].abort&&(Ae[De].abort(),delete Ae[De]),Ie()},v.prototype.removeTile=function(Pe,Ie){var Ae=this.loaded,De=Pe.uid;Ae&&Ae[De]&&delete Ae[De],Ie()};var y=i.window.ImageBitmap,x=function(){this.loaded={}};x.prototype.loadTile=function(Pe,Ie){var Ae=Pe.uid,De=Pe.encoding,He=Pe.rawImageData,rt=y&&He instanceof y?this.getImageData(He):He,lt=new i.DEMData(Ae,rt,De);this.loaded=this.loaded||{},this.loaded[Ae]=lt,Ie(null,lt)},x.prototype.getImageData=function(Pe){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(Pe.width,Pe.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=Pe.width,this.offscreenCanvas.height=Pe.height,this.offscreenCanvasContext.drawImage(Pe,0,0,Pe.width,Pe.height);var Ie=this.offscreenCanvasContext.getImageData(-1,-1,Pe.width+2,Pe.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new i.RGBAImage({width:Ie.width,height:Ie.height},Ie.data)},x.prototype.removeTile=function(Pe){var Ie=this.loaded,Ae=Pe.uid;Ie&&Ie[Ae]&&delete Ie[Ae]};var w=function Pe(Ie,Ae){var De,He=Ie&&Ie.type;if(He==="FeatureCollection")for(De=0;De=0!=!!Ie&&Pe.reverse()}var T=i.vectorTile.VectorTileFeature.prototype.toGeoJSON,_=function(Pe){this._feature=Pe,this.extent=i.EXTENT,this.type=Pe.type,this.properties=Pe.tags,"id"in Pe&&!isNaN(Pe.id)&&(this.id=parseInt(Pe.id,10))};_.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Pe=[],Ie=0,Ae=this._feature.geometry;Ie>31}function te(Pe,Ie){for(var Ae=Pe.loadGeometry(),De=Pe.type,He=0,rt=0,lt=Ae.length,ot=0;ot>1;(function ot(kt,wt,Vt,Ut,tt,bt){for(;tt>Ut;){if(tt-Ut>600){var zt=tt-Ut+1,St=Vt-Ut+1,Dt=Math.log(zt),Le=.5*Math.exp(2*Dt/3),Je=.5*Math.sqrt(Dt*Le*(zt-Le)/zt)*(St-zt/2<0?-1:1),st=Math.max(Ut,Math.floor(Vt-St*Le/zt+Je)),Et=Math.min(tt,Math.floor(Vt+(zt-St)*Le/zt+Je));ot(kt,wt,Vt,st,Et,bt)}var It=wt[2*Vt+bt],Zt=Ut,Kt=tt;for(re(kt,wt,Ut,Vt),wt[2*tt+bt]>It&&re(kt,wt,Ut,tt);ZtIt;)Kt--}wt[2*Ut+bt]===It?re(kt,wt,Ut,Kt):(Kt++,re(kt,wt,Kt,tt)),Kt<=Vt&&(Ut=Kt+1),Vt<=Kt&&(tt=Kt-1)}})(Pe,Ie,lt,De,He,rt%2),Z(Pe,Ie,Ae,De,lt-1,rt+1),Z(Pe,Ie,Ae,lt+1,He,rt+1)}}function re(Pe,Ie,Ae,De){U(Pe,Ae,De),U(Ie,2*Ae,2*De),U(Ie,2*Ae+1,2*De+1)}function U(Pe,Ie,Ae){var De=Pe[Ie];Pe[Ie]=Pe[Ae],Pe[Ae]=De}function q(Pe,Ie,Ae,De){var He=Pe-Ae,rt=Ie-De;return He*He+rt*rt}O.fromVectorTileJs=R,O.fromGeojsonVt=z,O.GeoJSONWrapper=L;var $=function(Pe){return Pe[0]},ne=function(Pe){return Pe[1]},H=function(Pe,Ie,Ae,De,He){Ie===void 0&&(Ie=$),Ae===void 0&&(Ae=ne),De===void 0&&(De=64),He===void 0&&(He=Float64Array),this.nodeSize=De,this.points=Pe;for(var rt=Pe.length<65536?Uint16Array:Uint32Array,lt=this.ids=new rt(Pe.length),ot=this.coords=new He(2*Pe.length),kt=0;kt=lt&&Ut<=kt&&tt>=ot&&tt<=wt&&zt.push(He[Je]);else{var st=Math.floor((Le+Dt)/2);Ut=rt[2*st],tt=rt[2*st+1],Ut>=lt&&Ut<=kt&&tt>=ot&&tt<=wt&&zt.push(He[st]);var Et=(St+1)%2;(St===0?lt<=Ut:ot<=tt)&&(bt.push(Le),bt.push(st-1),bt.push(Et)),(St===0?kt>=Ut:wt>=tt)&&(bt.push(st+1),bt.push(Dt),bt.push(Et))}}return zt}(this.ids,this.coords,Pe,Ie,Ae,De,this.nodeSize)},H.prototype.within=function(Pe,Ie,Ae){return function(De,He,rt,lt,ot,kt){for(var wt=[0,De.length-1,0],Vt=[],Ut=ot*ot;wt.length;){var tt=wt.pop(),bt=wt.pop(),zt=wt.pop();if(bt-zt<=kt)for(var St=zt;St<=bt;St++)q(He[2*St],He[2*St+1],rt,lt)<=Ut&&Vt.push(De[St]);else{var Dt=Math.floor((zt+bt)/2),Le=He[2*Dt],Je=He[2*Dt+1];q(Le,Je,rt,lt)<=Ut&&Vt.push(De[Dt]);var st=(tt+1)%2;(tt===0?rt-ot<=Le:lt-ot<=Je)&&(wt.push(zt),wt.push(Dt-1),wt.push(st)),(tt===0?rt+ot>=Le:lt+ot>=Je)&&(wt.push(Dt+1),wt.push(bt),wt.push(st))}}return Vt}(this.ids,this.coords,Pe,Ie,Ae,this.nodeSize)};var Q={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(Pe){return Pe}},ee=function(Pe){this.options=me(Object.create(Q),Pe),this.trees=new Array(this.options.maxZoom+1)};function ie(Pe,Ie,Ae,De,He){return{x:Pe,y:Ie,zoom:1/0,id:Ae,parentId:-1,numPoints:De,properties:He}}function ae(Pe,Ie){var Ae=Pe.geometry.coordinates,De=Ae[0],He=Ae[1];return{x:ge(De),y:fe(He),zoom:1/0,index:Ie,parentId:-1}}function ue(Pe){return{type:"Feature",id:Pe.id,properties:le(Pe),geometry:{type:"Point",coordinates:[(De=Pe.x,360*(De-.5)),(Ie=Pe.y,Ae=(180-360*Ie)*Math.PI/180,360*Math.atan(Math.exp(Ae))/Math.PI-90)]}};var Ie,Ae,De}function le(Pe){var Ie=Pe.numPoints,Ae=Ie>=1e4?Math.round(Ie/1e3)+"k":Ie>=1e3?Math.round(Ie/100)/10+"k":Ie;return me(me({},Pe.properties),{cluster:!0,cluster_id:Pe.id,point_count:Ie,point_count_abbreviated:Ae})}function ge(Pe){return Pe/360+.5}function fe(Pe){var Ie=Math.sin(Pe*Math.PI/180),Ae=.5-.25*Math.log((1+Ie)/(1-Ie))/Math.PI;return Ae<0?0:Ae>1?1:Ae}function me(Pe,Ie){for(var Ae in Ie)Pe[Ae]=Ie[Ae];return Pe}function _e(Pe){return Pe.x}function we(Pe){return Pe.y}function Te(Pe,Ie,Ae,De,He,rt){var lt=He-Ae,ot=rt-De;if(lt!==0||ot!==0){var kt=((Pe-Ae)*lt+(Ie-De)*ot)/(lt*lt+ot*ot);kt>1?(Ae=He,De=rt):kt>0&&(Ae+=lt*kt,De+=ot*kt)}return(lt=Pe-Ae)*lt+(ot=Ie-De)*ot}function Oe(Pe,Ie,Ae,De){var He={id:Pe===void 0?null:Pe,type:Ie,geometry:Ae,tags:De,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(rt){var lt=rt.geometry,ot=rt.type;if(ot==="Point"||ot==="MultiPoint"||ot==="LineString")de(rt,lt);else if(ot==="Polygon"||ot==="MultiLineString")for(var kt=0;kt0&&(lt+=De?(He*wt-kt*rt)/2:Math.sqrt(Math.pow(kt-He,2)+Math.pow(wt-rt,2))),He=kt,rt=wt}var Vt=Ie.length-3;Ie[2]=1,function Ut(tt,bt,zt,St){for(var Dt,Le=St,Je=zt-bt>>1,st=zt-bt,Et=tt[bt],It=tt[bt+1],Zt=tt[zt],Kt=tt[zt+1],Ht=bt+3;HtLe)Dt=Ht,Le=mn;else if(mn===Le){var zn=Math.abs(Ht-Je);znSt&&(Dt-bt>3&&Ut(tt,bt,Dt,St),tt[Dt+2]=Le,zt-Dt>3&&Ut(tt,Dt,zt,St))}(Ie,0,Vt,Ae),Ie[Vt+2]=1,Ie.size=Math.abs(lt),Ie.start=0,Ie.end=Ie.size}function Ee(Pe,Ie,Ae,De){for(var He=0;He1?1:Ae}function Ve(Pe,Ie,Ae,De,He,rt,lt,ot){if(De/=Ie,rt>=(Ae/=Ie)&<=De)return null;for(var kt=[],wt=0;wt=Ae&&zt=De)){var St=[];if(tt==="Point"||tt==="MultiPoint")Ke(Ut,St,Ae,De,He);else if(tt==="LineString")Re(Ut,St,Ae,De,He,!1,ot.lineMetrics);else if(tt==="MultiLineString")We(Ut,St,Ae,De,He,!1);else if(tt==="Polygon")We(Ut,St,Ae,De,He,!0);else if(tt==="MultiPolygon")for(var Dt=0;Dt=Ae&<<=De&&(Ie.push(Pe[rt]),Ie.push(Pe[rt+1]),Ie.push(Pe[rt+2]))}}function Re(Pe,Ie,Ae,De,He,rt,lt){for(var ot,kt,wt=qe(Pe),Vt=He===0?nt:ft,Ut=Pe.start,tt=0;ttAe&&(kt=Vt(wt,bt,zt,Dt,Le,Ae),lt&&(wt.start=Ut+ot*kt)):Je>De?st=Ae&&(kt=Vt(wt,bt,zt,Dt,Le,Ae),Et=!0),st>De&&Je<=De&&(kt=Vt(wt,bt,zt,Dt,Le,De),Et=!0),!rt&&Et&&(lt&&(wt.end=Ut+ot*kt),Ie.push(wt),wt=qe(Pe)),lt&&(Ut+=ot)}var It=Pe.length-3;bt=Pe[It],zt=Pe[It+1],St=Pe[It+2],(Je=He===0?bt:zt)>=Ae&&Je<=De&&Ye(wt,bt,zt,St),It=wt.length-3,rt&&It>=3&&(wt[It]!==wt[0]||wt[It+1]!==wt[1])&&Ye(wt,wt[0],wt[1],wt[2]),wt.length&&Ie.push(wt)}function qe(Pe){var Ie=[];return Ie.size=Pe.size,Ie.start=Pe.start,Ie.end=Pe.end,Ie}function We(Pe,Ie,Ae,De,He,rt){for(var lt=0;ltlt.maxX&&(lt.maxX=Vt),Ut>lt.maxY&&(lt.maxY=Ut)}return lt}function Ot(Pe,Ie,Ae,De){var He=Ie.geometry,rt=Ie.type,lt=[];if(rt==="Point"||rt==="MultiPoint")for(var ot=0;ot0&&Ie.size<(He?lt:De))Ae.numPoints+=Ie.length/3;else{for(var ot=[],kt=0;ktlt)&&(Ae.numSimplified++,ot.push(Ie[kt]),ot.push(Ie[kt+1])),Ae.numPoints++;He&&function(wt,Vt){for(var Ut=0,tt=0,bt=wt.length,zt=bt-2;tt0===Vt)for(tt=0,bt=wt.length;tt24)throw new Error("maxZoom should be in the 0-24 range");if(Ie.promoteId&&Ie.generateId)throw new Error("promoteId and generateId cannot be used together.");var De=function(He,rt){var lt=[];if(He.type==="FeatureCollection")for(var ot=0;ot=De;wt--){var Vt=+Date.now();ot=this._cluster(ot,wt),this.trees[wt]=new H(ot,_e,we,rt,Float32Array),Ae&&console.log("z%d: %d clusters in %dms",wt,ot.length,+Date.now()-Vt)}return Ae&&console.timeEnd("total time"),this},ee.prototype.getClusters=function(Pe,Ie){var Ae=((Pe[0]+180)%360+360)%360-180,De=Math.max(-90,Math.min(90,Pe[1])),He=Pe[2]===180?180:((Pe[2]+180)%360+360)%360-180,rt=Math.max(-90,Math.min(90,Pe[3]));if(Pe[2]-Pe[0]>=360)Ae=-180,He=180;else if(Ae>He){var lt=this.getClusters([Ae,De,180,rt],Ie),ot=this.getClusters([-180,De,He,rt],Ie);return lt.concat(ot)}for(var kt=this.trees[this._limitZoom(Ie)],wt=[],Vt=0,Ut=kt.range(ge(Ae),fe(rt),ge(He),fe(De));Vt1?this._map(wt,!0):null,Dt=(kt<<5)+(Ie+1)+this.points.length,Le=0,Je=Ut;Le>5},ee.prototype._getOriginZoom=function(Pe){return(Pe-this.points.length)%32},ee.prototype._map=function(Pe,Ie){if(Pe.numPoints)return Ie?me({},Pe.properties):Pe.properties;var Ae=this.points[Pe.index].properties,De=this.options.map(Ae);return Ie&&De===Ae?me({},De):De},Jt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Jt.prototype.splitTile=function(Pe,Ie,Ae,De,He,rt,lt){for(var ot=[Pe,Ie,Ae,De],kt=this.options,wt=kt.debug;ot.length;){De=ot.pop(),Ae=ot.pop(),Ie=ot.pop(),Pe=ot.pop();var Vt=1<1&&console.time("creation"),tt=this.tiles[Ut]=et(Pe,Ie,Ae,De,kt),this.tileCoords.push({z:Ie,x:Ae,y:De}),wt)){wt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ie,Ae,De,tt.numFeatures,tt.numPoints,tt.numSimplified),console.timeEnd("creation"));var bt="z"+Ie;this.stats[bt]=(this.stats[bt]||0)+1,this.total++}if(tt.source=Pe,He){if(Ie===kt.maxZoom||Ie===He)continue;var zt=1<1&&console.time("clipping");var St,Dt,Le,Je,st,Et,It=.5*kt.buffer/kt.extent,Zt=.5-It,Kt=.5+It,Ht=1+It;St=Dt=Le=Je=null,st=Ve(Pe,Vt,Ae-It,Ae+Kt,0,tt.minX,tt.maxX,kt),Et=Ve(Pe,Vt,Ae+Zt,Ae+Ht,0,tt.minX,tt.maxX,kt),Pe=null,st&&(St=Ve(st,Vt,De-It,De+Kt,1,tt.minY,tt.maxY,kt),Dt=Ve(st,Vt,De+Zt,De+Ht,1,tt.minY,tt.maxY,kt),st=null),Et&&(Le=Ve(Et,Vt,De-It,De+Kt,1,tt.minY,tt.maxY,kt),Je=Ve(Et,Vt,De+Zt,De+Ht,1,tt.minY,tt.maxY,kt),Et=null),wt>1&&console.timeEnd("clipping"),ot.push(St||[],Ie+1,2*Ae,2*De),ot.push(Dt||[],Ie+1,2*Ae,2*De+1),ot.push(Le||[],Ie+1,2*Ae+1,2*De),ot.push(Je||[],Ie+1,2*Ae+1,2*De+1)}}},Jt.prototype.getTile=function(Pe,Ie,Ae){var De=this.options,He=De.extent,rt=De.debug;if(Pe<0||Pe>24)return null;var lt=1<1&&console.log("drilling down to z%d-%d-%d",Pe,Ie,Ae);for(var kt,wt=Pe,Vt=Ie,Ut=Ae;!kt&&wt>0;)wt--,Vt=Math.floor(Vt/2),Ut=Math.floor(Ut/2),kt=this.tiles[Be(wt,Vt,Ut)];return kt&&kt.source?(rt>1&&console.log("found parent tile z%d-%d-%d",wt,Vt,Ut),rt>1&&console.time("drilling down"),this.splitTile(kt.source,wt,Vt,Ut,Pe,Ie,Ae),rt>1&&console.timeEnd("drilling down"),this.tiles[ot]?At(this.tiles[ot],He):null):null};var Tt=function(Pe){function Ie(Ae,De,He,rt){Pe.call(this,Ae,De,He,Ge),rt&&(this.loadGeoJSON=rt)}return Pe&&(Ie.__proto__=Pe),Ie.prototype=Object.create(Pe&&Pe.prototype),Ie.prototype.constructor=Ie,Ie.prototype.loadData=function(Ae,De){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=De,this._pendingLoadDataParams=Ae,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},Ie.prototype._loadData=function(){var Ae=this;if(this._pendingCallback&&this._pendingLoadDataParams){var De=this._pendingCallback,He=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var rt=!!(He&&He.request&&He.request.collectResourceTiming)&&new i.RequestPerformance(He.request);this.loadGeoJSON(He,function(lt,ot){if(lt||!ot)return De(lt);if(typeof ot!="object")return De(new Error("Input data given to '"+He.source+"' is not a valid GeoJSON object."));w(ot,!0);try{Ae._geoJSONIndex=He.cluster?new ee(function(Vt){var Ut=Vt.superclusterOptions,tt=Vt.clusterProperties;if(!tt||!Ut)return Ut;for(var bt={},zt={},St={accumulated:null,zoom:0},Dt={properties:null},Le=Object.keys(tt),Je=0,st=Le;Je"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var he,ve,be=new Blob([""],{type:"text/javascript"}),Se=URL.createObjectURL(be);try{ve=new Worker(Se),he=!0}catch{he=!1}return ve&&ve.terminate(),URL.revokeObjectURL(Se),he}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var he=document.createElement("canvas");he.width=he.height=1;var ve=he.getContext("2d");if(!ve)return!1;var be=ve.getImageData(0,0,1,1);return be&&be.width===he.width}()?function(he){return X[he]===void 0&&(X[he]=function(ve){var be=function(Ue){var Xe=document.createElement("canvas"),it=Object.create(j.webGLContextAttributes);return it.failIfMajorPerformanceCaveat=Ue,Xe.probablySupportsContext?Xe.probablySupportsContext("webgl",it)||Xe.probablySupportsContext("experimental-webgl",it):Xe.supportsContext?Xe.supportsContext("webgl",it)||Xe.supportsContext("experimental-webgl",it):Xe.getContext("webgl",it)||Xe.getContext("experimental-webgl",it)}(ve);if(!be)return!1;var Se=be.createShader(be.VERTEX_SHADER);return!Se||be.isContextLost()?!1:(be.shaderSource(Se,"void main() {}"),be.compileShader(Se),be.getShaderParameter(Se,be.COMPILE_STATUS)===!0)}(he)),X[he]}(se&&se.failIfMajorPerformanceCaveat)?void 0:"insufficient WebGL support":"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support"}I.exports?I.exports=j:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=j,window.mapboxgl.notSupportedReason=V);var X={};j.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),l={create:function(I,j,V){var X=i.window.document.createElement(I);return j!==void 0&&(X.className=j),V&&V.appendChild(X),X},createNS:function(I,j){return i.window.document.createElementNS(I,j)}},d=i.window.document.documentElement.style;function h(I){if(!d)return I[0];for(var j=0;j=0?0:I.button},l.remove=function(I){I.parentNode&&I.parentNode.removeChild(I)};var k=function(I){function j(){I.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new i.RGBAImage({width:1,height:1}),this.dirty=!0}return I&&(j.__proto__=I),j.prototype=Object.create(I&&I.prototype),j.prototype.constructor=j,j.prototype.isLoaded=function(){return this.loaded},j.prototype.setLoaded=function(V){if(this.loaded!==V&&(this.loaded=V,V)){for(var X=0,se=this.requestors;X=0?1.2:1))}function A(I,j,V,X,se,he,ve){for(var be=0;be65535)Ue(new Error("glyphs > 65535 not supported"));else if(xt.ranges[_t])Ue(null,{stack:Xe,id:it,glyph:Lt});else{var Mt=xt.requests[_t];Mt||(Mt=xt.requests[_t]=[],E.loadGlyphRange(Xe,_t,V.url,V.requestManager,function(yt,Nt){if(Nt){for(var Rt in Nt)V._doesCharSupportLocalGlyph(+Rt)||(xt.glyphs[+Rt]=Nt[+Rt]);xt.ranges[_t]=!0}for(var qt=0,rn=Mt;qt1&&(Se=I[++be]);var Xe=Math.abs(Ue-Se.left),it=Math.abs(Ue-Se.right),xt=Math.min(Xe,it),Lt=void 0,_t=se/V*(X+1);if(Se.isDash){var Mt=X-Math.abs(_t);Lt=Math.sqrt(xt*xt+Mt*Mt)}else Lt=X-Math.sqrt(xt*xt+_t*_t);this.data[ve+Ue]=Math.max(0,Math.min(255,Lt+128))}},z.prototype.addRegularDash=function(I){for(var j=I.length-1;j>=0;--j){var V=I[j],X=I[j+1];V.zeroLength?I.splice(j,1):X&&X.isDash===V.isDash&&(X.left=V.left,I.splice(j,1))}var se=I[0],he=I[I.length-1];se.isDash===he.isDash&&(se.left=he.left-this.width,he.right=se.right+this.width);for(var ve=this.width*this.nextRow,be=0,Se=I[be],Ue=0;Ue1&&(Se=I[++be]);var Xe=Math.abs(Ue-Se.left),it=Math.abs(Ue-Se.right),xt=Math.min(Xe,it),Lt=Se.isDash?xt:-xt;this.data[ve+Ue]=Math.max(0,Math.min(255,Lt+128))}},z.prototype.addDash=function(I,j){var V=j?7:0,X=2*V+1;if(this.nextRow+X>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var se=0,he=0;he=V&&I.x=X&&I.y0&&(Ue[new i.OverscaledTileID(V.overscaledZ,ve,X.z,he,X.y-1).key]={backfilled:!1},Ue[new i.OverscaledTileID(V.overscaledZ,V.wrap,X.z,X.x,X.y-1).key]={backfilled:!1},Ue[new i.OverscaledTileID(V.overscaledZ,Se,X.z,be,X.y-1).key]={backfilled:!1}),X.y+10&&(se.resourceTiming=V._resourceTiming,V._resourceTiming=[]),V.fire(new i.Event("data",se))}})},j.prototype.onAdd=function(V){this.map=V,this.load()},j.prototype.setData=function(V){var X=this;return this._data=V,this.fire(new i.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(se){if(se)X.fire(new i.ErrorEvent(se));else{var he={dataType:"source",sourceDataType:"content"};X._collectResourceTiming&&X._resourceTiming&&X._resourceTiming.length>0&&(he.resourceTiming=X._resourceTiming,X._resourceTiming=[]),X.fire(new i.Event("data",he))}}),this},j.prototype.getClusterExpansionZoom=function(V,X){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:V,source:this.id},X),this},j.prototype.getClusterChildren=function(V,X){return this.actor.send("geojson.getClusterChildren",{clusterId:V,source:this.id},X),this},j.prototype.getClusterLeaves=function(V,X,se,he){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:V,limit:X,offset:se},he),this},j.prototype._updateWorkerData=function(V){var X=this;this._loaded=!1;var se=i.extend({},this.workerOptions),he=this._data;typeof he=="string"?(se.request=this.map._requestManager.transformRequest(i.browser.resolveURL(he),i.ResourceType.Source),se.request.collectResourceTiming=this._collectResourceTiming):se.data=JSON.stringify(he),this.actor.send(this.type+".loadData",se,function(ve,be){X._removed||be&&be.abandoned||(X._loaded=!0,be&&be.resourceTiming&&be.resourceTiming[X.id]&&(X._resourceTiming=be.resourceTiming[X.id].slice(0)),X.actor.send(X.type+".coalesce",{source:se.source},null),V(ve))})},j.prototype.loaded=function(){return this._loaded},j.prototype.loadTile=function(V,X){var se=this,he=V.actor?"reloadTile":"loadTile";V.actor=this.actor;var ve={type:this.type,uid:V.uid,tileID:V.tileID,zoom:V.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:i.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};V.request=this.actor.send(he,ve,function(be,Se){return delete V.request,V.unloadVectorData(),V.aborted?X(null):be?X(be):(V.loadVectorData(Se,se.map.painter,he==="reloadTile"),X(null))})},j.prototype.abortTile=function(V){V.request&&(V.request.cancel(),delete V.request),V.aborted=!0},j.prototype.unloadTile=function(V){V.unloadVectorData(),this.actor.send("removeTile",{uid:V.uid,type:this.type,source:this.id})},j.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},j.prototype.serialize=function(){return i.extend({},this._options,{type:this.type,data:this._data})},j.prototype.hasTransition=function(){return!1},j}(i.Evented),te=i.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Y=function(I){function j(V,X,se,he){I.call(this),this.id=V,this.dispatcher=se,this.coordinates=X.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(he),this.options=X}return I&&(j.__proto__=I),j.prototype=Object.create(I&&I.prototype),j.prototype.constructor=j,j.prototype.load=function(V,X){var se=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this.url=this.options.url,i.getImage(this.map._requestManager.transformRequest(this.url,i.ResourceType.Image),function(he,ve){se._loaded=!0,he?se.fire(new i.ErrorEvent(he)):ve&&(se.image=ve,V&&(se.coordinates=V),X&&X(),se._finishLoading())})},j.prototype.loaded=function(){return this._loaded},j.prototype.updateImage=function(V){var X=this;return this.image&&V.url?(this.options.url=V.url,this.load(V.coordinates,function(){X.texture=null}),this):this},j.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})))},j.prototype.onAdd=function(V){this.map=V,this.load()},j.prototype.setCoordinates=function(V){var X=this;this.coordinates=V;var se=V.map(i.MercatorCoordinate.fromLngLat);this.tileID=function(ve){for(var be=1/0,Se=1/0,Ue=-1/0,Xe=-1/0,it=0,xt=ve;itX.end(0)?this.fire(new i.ErrorEvent(new i.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+X.start(0)+" and "+X.end(0)+"-second mark."))):this.video.currentTime=V}},j.prototype.getVideo=function(){return this.video},j.prototype.onAdd=function(V){this.map||(this.map=V,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},j.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var V=this.map.painter.context,X=V.gl;for(var se in this.boundsBuffer||(this.boundsBuffer=V.createVertexBuffer(this._boundsArray,te.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(X.LINEAR,X.CLAMP_TO_EDGE),X.texSubImage2D(X.TEXTURE_2D,0,0,0,X.RGBA,X.UNSIGNED_BYTE,this.video)):(this.texture=new i.Texture(V,this.video,X.RGBA),this.texture.bind(X.LINEAR,X.CLAMP_TO_EDGE)),this.tiles){var he=this.tiles[se];he.state!=="loaded"&&(he.state="loaded",he.texture=this.texture)}}},j.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},j.prototype.hasTransition=function(){return this.video&&!this.video.paused},j}(Y),re=function(I){function j(V,X,se,he){I.call(this,V,X,se,he),X.coordinates?Array.isArray(X.coordinates)&&X.coordinates.length===4&&!X.coordinates.some(function(ve){return!Array.isArray(ve)||ve.length!==2||ve.some(function(be){return typeof be!="number"})})||this.fire(new i.ErrorEvent(new i.ValidationError("sources."+V,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+V,null,'missing required property "coordinates"'))),X.animate&&typeof X.animate!="boolean"&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+V,null,'optional "animate" property must be a boolean value'))),X.canvas?typeof X.canvas=="string"||X.canvas instanceof i.window.HTMLCanvasElement||this.fire(new i.ErrorEvent(new i.ValidationError("sources."+V,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 i.ErrorEvent(new i.ValidationError("sources."+V,null,'missing required property "canvas"'))),this.options=X,this.animate=X.animate===void 0||X.animate}return I&&(j.__proto__=I),j.prototype=Object.create(I&&I.prototype),j.prototype.constructor=j,j.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof i.window.HTMLCanvasElement?this.options.canvas:i.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new i.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())},j.prototype.getCanvas=function(){return this.canvas},j.prototype.onAdd=function(V){this.map=V,this.load(),this.canvas&&this.animate&&this.play()},j.prototype.onRemove=function(){this.pause()},j.prototype.prepare=function(){var V=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,V=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,V=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var X=this.map.painter.context,se=X.gl;for(var he in this.boundsBuffer||(this.boundsBuffer=X.createVertexBuffer(this._boundsArray,te.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(V||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new i.Texture(X,this.canvas,se.RGBA,{premultiply:!0}),this.tiles){var ve=this.tiles[he];ve.state!=="loaded"&&(ve.state="loaded",ve.texture=this.texture)}}},j.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},j.prototype.hasTransition=function(){return this._playing},j.prototype._hasInvalidDimensions=function(){for(var V=0,X=[this.canvas.width,this.canvas.height];Vthis.max){var ve=this._getAndRemoveByKey(this.order[0]);ve&&this.onRemove(ve)}return this},H.prototype.has=function(I){return I.wrapped().key in this.data},H.prototype.getAndRemove=function(I){return this.has(I)?this._getAndRemoveByKey(I.wrapped().key):null},H.prototype._getAndRemoveByKey=function(I){var j=this.data[I].shift();return j.timeout&&clearTimeout(j.timeout),this.data[I].length===0&&delete this.data[I],this.order.splice(this.order.indexOf(I),1),j.value},H.prototype.getByKey=function(I){var j=this.data[I];return j?j[0].value:null},H.prototype.get=function(I){return this.has(I)?this.data[I.wrapped().key][0].value:null},H.prototype.remove=function(I,j){if(!this.has(I))return this;var V=I.wrapped().key,X=j===void 0?0:this.data[V].indexOf(j),se=this.data[V][X];return this.data[V].splice(X,1),se.timeout&&clearTimeout(se.timeout),this.data[V].length===0&&delete this.data[V],this.onRemove(se.value),this.order.splice(this.order.indexOf(V),1),this},H.prototype.setMaxSize=function(I){for(this.max=I;this.order.length>this.max;){var j=this._getAndRemoveByKey(this.order[0]);j&&this.onRemove(j)}return this},H.prototype.filter=function(I){var j=[];for(var V in this.data)for(var X=0,se=this.data[V];X1||(Math.abs(Xe)>1&&(Math.abs(Xe+xt)===1?Xe+=xt:Math.abs(Xe-xt)===1&&(Xe-=xt)),Ue.dem&&Se.dem&&(Se.dem.backfillBorder(Ue.dem,Xe,it),Se.neighboringTiles&&Se.neighboringTiles[Lt]&&(Se.neighboringTiles[Lt].backfilled=!0)))}},j.prototype.getTile=function(V){return this.getTileByID(V.key)},j.prototype.getTileByID=function(V){return this._tiles[V]},j.prototype._retainLoadedChildren=function(V,X,se,he){for(var ve in this._tiles){var be=this._tiles[ve];if(!(he[ve]||!be.hasData()||be.tileID.overscaledZ<=X||be.tileID.overscaledZ>se)){for(var Se=be.tileID;be&&be.tileID.overscaledZ>X+1;){var Ue=be.tileID.scaledTo(be.tileID.overscaledZ-1);(be=this._tiles[Ue.key])&&be.hasData()&&(Se=Ue)}for(var Xe=Se;Xe.overscaledZ>X;)if(V[(Xe=Xe.scaledTo(Xe.overscaledZ-1)).key]){he[Se.key]=Se;break}}}},j.prototype.findLoadedParent=function(V,X){if(V.key in this._loadedParentTiles){var se=this._loadedParentTiles[V.key];return se&&se.tileID.overscaledZ>=X?se:null}for(var he=V.overscaledZ-1;he>=X;he--){var ve=V.scaledTo(he),be=this._getLoadedTile(ve);if(be)return be}},j.prototype._getLoadedTile=function(V){var X=this._tiles[V.key];return X&&X.hasData()?X:this._cache.getByKey(V.wrapped().key)},j.prototype.updateCacheSize=function(V){var X=(Math.ceil(V.width/this._source.tileSize)+1)*(Math.ceil(V.height/this._source.tileSize)+1),se=Math.floor(5*X),he=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,se):se;this._cache.setMaxSize(he)},j.prototype.handleWrapJump=function(V){var X=(V-(this._prevLng===void 0?V:this._prevLng))/360,se=Math.round(X);if(this._prevLng=V,se){var he={};for(var ve in this._tiles){var be=this._tiles[ve];be.tileID=be.tileID.unwrapTo(be.tileID.wrap+se),he[be.tileID.key]=be}for(var Se in this._tiles=he,this._timers)clearTimeout(this._timers[Se]),delete this._timers[Se];for(var Ue in this._tiles){var Xe=this._tiles[Ue];this._setTileReloadTimer(Ue,Xe)}}},j.prototype.update=function(V){var X=this;if(this.transform=V,this._sourceLoaded&&!this._paused){var se;this.updateCacheSize(V),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?se=V.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(An){return new i.OverscaledTileID(An.canonical.z,An.wrap,An.canonical.z,An.canonical.x,An.canonical.y)}):(se=V.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(se=se.filter(function(An){return X._source.hasTile(An)}))):se=[];var he=V.coveringZoomLevel(this._source),ve=Math.max(he-j.maxOverzooming,this._source.minzoom),be=Math.max(he+j.maxUnderzooming,this._source.minzoom),Se=this._updateRetainedTiles(se,he);if(lt(this._source.type)){for(var Ue={},Xe={},it=0,xt=Object.keys(Se);itthis._source.maxzoom){var Nt=Mt.children(this._source.maxzoom)[0],Rt=this.getTile(Nt);if(Rt&&Rt.hasData()){se[Nt.key]=Nt;continue}}else{var qt=Mt.children(this._source.maxzoom);if(se[qt[0].key]&&se[qt[1].key]&&se[qt[2].key]&&se[qt[3].key])continue}for(var rn=yt.wasRequested(),dn=Mt.overscaledZ-1;dn>=ve;--dn){var Sn=Mt.scaledTo(dn);if(he[Sn.key]||(he[Sn.key]=!0,!(yt=this.getTile(Sn))&&rn&&(yt=this._addTile(Sn)),yt&&(se[Sn.key]=Sn,rn=yt.wasRequested(),yt.hasData())))break}}}return se},j.prototype._updateLoadedParentTileCache=function(){for(var V in this._loadedParentTiles={},this._tiles){for(var X=[],se=void 0,he=this._tiles[V].tileID;he.overscaledZ>0;){if(he.key in this._loadedParentTiles){se=this._loadedParentTiles[he.key];break}X.push(he.key);var ve=he.scaledTo(he.overscaledZ-1);if(se=this._getLoadedTile(ve))break;he=ve}for(var be=0,Se=X;be0||(X.hasData()&&X.state!=="reloading"?this._cache.add(X.tileID,X,X.getExpiryTimeout()):(X.aborted=!0,this._abortTile(X),this._unloadTile(X))))},j.prototype.clearTiles=function(){for(var V in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(V);this._cache.reset()},j.prototype.tilesIn=function(V,X,se){var he=this,ve=[],be=this.transform;if(!be)return ve;for(var Se=se?be.getCameraQueryGeometry(V):V,Ue=V.map(function(dn){return be.pointCoordinate(dn)}),Xe=Se.map(function(dn){return be.pointCoordinate(dn)}),it=this.getIds(),xt=1/0,Lt=1/0,_t=-1/0,Mt=-1/0,yt=0,Nt=Xe;yt=0&&gr[1].y+er>=0){var cr=Ue.map(function(ii){return An.getTilePoint(ii)}),Yr=Xe.map(function(ii){return An.getTilePoint(ii)});ve.push({tile:Sn,tileID:An,queryGeometry:cr,cameraQueryGeometry:Yr,scale:tr})}}},rn=0;rn=i.browser.now())return!0}return!1},j.prototype.setFeatureState=function(V,X,se){V=V||"_geojsonTileLayer",this._state.updateState(V,X,se)},j.prototype.removeFeatureState=function(V,X,se){V=V||"_geojsonTileLayer",this._state.removeFeatureState(V,X,se)},j.prototype.getFeatureState=function(V,X){return V=V||"_geojsonTileLayer",this._state.getState(V,X)},j.prototype.setDependencies=function(V,X,se){var he=this._tiles[V];he&&he.setDependencies(X,se)},j.prototype.reloadTilesForDependencies=function(V,X){for(var se in this._tiles)this._tiles[se].hasDependency(V,X)&&this._reloadTile(se,"reloading");this._cache.filter(function(he){return!he.hasDependency(V,X)})},j}(i.Evented);function rt(I,j){var V=Math.abs(2*I.wrap)-+(I.wrap<0),X=Math.abs(2*j.wrap)-+(j.wrap<0);return I.overscaledZ-j.overscaledZ||X-V||j.canonical.y-I.canonical.y||j.canonical.x-I.canonical.x}function lt(I){return I==="raster"||I==="image"||I==="video"}function ot(){return new i.window.Worker(ce.workerUrl)}He.maxOverzooming=10,He.maxUnderzooming=3;var kt="mapboxgl_preloaded_worker_pool",wt=function(){this.active={}};wt.prototype.acquire=function(I){if(!this.workers)for(this.workers=[];this.workers.length0?(X-he)/ve:0;return this.points[se].mult(1-be).add(this.points[j].mult(be))};var mn=function(I,j,V){var X=this.boxCells=[],se=this.circleCells=[];this.xCellCount=Math.ceil(I/V),this.yCellCount=Math.ceil(j/V);for(var he=0;he=-j[0]&&V<=j[0]&&X>=-j[1]&&X<=j[1]}function gn(I,j,V,X,se,he,ve,be){var Se=X?I.textSizeData:I.iconSizeData,Ue=i.evaluateSizeForZoom(Se,V.transform.zoom),Xe=[256/V.width*2+1,256/V.height*2+1],it=X?I.text.dynamicLayoutVertexArray:I.icon.dynamicLayoutVertexArray;it.clear();for(var xt=I.lineVertexArray,Lt=X?I.text.placedSymbolArray:I.icon.placedSymbolArray,_t=V.transform.width/V.transform.height,Mt=!1,yt=0;ytMath.abs(V.x-j.x)*X?{useVertical:!0}:(I===i.WritingMode.vertical?j.yV.x)?{needsFlipping:!0}:null}function Hn(I,j,V,X,se,he,ve,be,Se,Ue,Xe,it,xt,Lt){var _t,Mt=j/24,yt=I.lineOffsetX*Mt,Nt=I.lineOffsetY*Mt;if(I.numGlyphs>1){var Rt=I.glyphStartIndex+I.numGlyphs,qt=I.lineStartIndex,rn=I.lineStartIndex+I.lineLength,dn=bn(Mt,be,yt,Nt,V,Xe,it,I,Se,he,xt);if(!dn)return{notEnoughRoom:!0};var Sn=tn(dn.first.point,ve).point,An=tn(dn.last.point,ve).point;if(X&&!V){var tr=In(I.writingMode,Sn,An,Lt);if(tr)return tr}_t=[dn.first];for(var er=I.glyphStartIndex+1;er0?ii.point:Wn(it,Yr,gr,1,se),Gn=In(I.writingMode,gr,Ti,Lt);if(Gn)return Gn}var Mr=ar(Mt*be.getoffsetX(I.glyphStartIndex),yt,Nt,V,Xe,it,I.segment,I.lineStartIndex,I.lineStartIndex+I.lineLength,Se,he,xt);if(!Mr)return{notEnoughRoom:!0};_t=[Mr]}for(var ai=0,Qr=_t;ai0?1:-1,_t=0;X&&(Lt*=-1,_t=Math.PI),Lt<0&&(_t+=Math.PI);for(var Mt=Lt>0?be+ve:be+ve+1,yt=se,Nt=se,Rt=0,qt=0,rn=Math.abs(xt),dn=[];Rt+qt<=rn;){if((Mt+=Lt)=Se)return null;if(Nt=yt,dn.push(yt),(yt=it[Mt])===void 0){var Sn=new i.Point(Ue.getx(Mt),Ue.gety(Mt)),An=tn(Sn,Xe);if(An.signedDistanceFromCamera>0)yt=it[Mt]=An.point;else{var tr=Mt-Lt;yt=Wn(Rt===0?he:new i.Point(Ue.getx(tr),Ue.gety(tr)),Sn,Nt,rn-Rt+1,Xe)}}Rt+=qt,qt=Nt.dist(yt)}var er=(rn-Rt)/qt,gr=yt.sub(Nt),cr=gr.mult(er)._add(Nt);cr._add(gr._unit()._perp()._mult(V*Lt));var Yr=_t+Math.atan2(yt.y-Nt.y,yt.x-Nt.x);return dn.push(cr),{point:cr,angle:Yr,path:dn}}mn.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},mn.prototype.insert=function(I,j,V,X,se){this._forEachCell(j,V,X,se,this._insertBoxCell,this.boxUid++),this.boxKeys.push(I),this.bboxes.push(j),this.bboxes.push(V),this.bboxes.push(X),this.bboxes.push(se)},mn.prototype.insertCircle=function(I,j,V,X){this._forEachCell(j-X,V-X,j+X,V+X,this._insertCircleCell,this.circleUid++),this.circleKeys.push(I),this.circles.push(j),this.circles.push(V),this.circles.push(X)},mn.prototype._insertBoxCell=function(I,j,V,X,se,he){this.boxCells[se].push(he)},mn.prototype._insertCircleCell=function(I,j,V,X,se,he){this.circleCells[se].push(he)},mn.prototype._query=function(I,j,V,X,se,he){if(V<0||I>this.width||X<0||j>this.height)return!se&&[];var ve=[];if(I<=0&&j<=0&&this.width<=V&&this.height<=X){if(se)return!0;for(var be=0;be0:ve},mn.prototype._queryCircle=function(I,j,V,X,se){var he=I-V,ve=I+V,be=j-V,Se=j+V;if(ve<0||he>this.width||Se<0||be>this.height)return!X&&[];var Ue=[],Xe={hitTest:X,circle:{x:I,y:j,radius:V},seenUids:{box:{},circle:{}}};return this._forEachCell(he,be,ve,Se,this._queryCellCircle,Ue,Xe,se),X?Ue.length>0:Ue},mn.prototype.query=function(I,j,V,X,se){return this._query(I,j,V,X,!1,se)},mn.prototype.hitTest=function(I,j,V,X,se){return this._query(I,j,V,X,!0,se)},mn.prototype.hitTestCircle=function(I,j,V,X){return this._queryCircle(I,j,V,!0,X)},mn.prototype._queryCell=function(I,j,V,X,se,he,ve,be){var Se=ve.seenUids,Ue=this.boxCells[se];if(Ue!==null)for(var Xe=this.bboxes,it=0,xt=Ue;it=Xe[_t+0]&&X>=Xe[_t+1]&&(!be||be(this.boxKeys[Lt]))){if(ve.hitTest)return he.push(!0),!0;he.push({key:this.boxKeys[Lt],x1:Xe[_t],y1:Xe[_t+1],x2:Xe[_t+2],y2:Xe[_t+3]})}}}var Mt=this.circleCells[se];if(Mt!==null)for(var yt=this.circles,Nt=0,Rt=Mt;Ntve*ve+be*be},mn.prototype._circleAndRectCollide=function(I,j,V,X,se,he,ve){var be=(he-X)/2,Se=Math.abs(I-(X+be));if(Se>be+V)return!1;var Ue=(ve-se)/2,Xe=Math.abs(j-(se+Ue));if(Xe>Ue+V)return!1;if(Se<=be||Xe<=Ue)return!0;var it=Se-be,xt=Xe-Ue;return it*it+xt*xt<=V*V};var Or=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function vr(I,j){for(var V=0;V=1;Ti--)ii.push(cr.path[Ti]);for(var Gn=1;Gn0){for(var gi=ii[0].clone(),Mi=ii[0].clone(),Yi=1;Yi=tr.x&&Mi.x<=er.x&&gi.y>=tr.y&&Mi.y<=er.y?[ii]:Mi.xer.x||Mi.yer.y?[]:i.clipLine([ii],tr.x,tr.y,er.x,er.y)}for(var ci=0,zi=Qr;ci=this.screenRightBoundary||X<100||j>this.screenBottomBoundary},Kn.prototype.isInsideGrid=function(I,j,V,X){return V>=0&&I=0&&j0)return this.prevPlacement&&this.prevPlacement.variableOffsets[it.crossTileID]&&this.prevPlacement.placements[it.crossTileID]&&this.prevPlacement.placements[it.crossTileID].text&&(Mt=this.prevPlacement.variableOffsets[it.crossTileID].anchor),this.variableOffsets[it.crossTileID]={textOffset:yt,width:V,height:X,anchor:I,textBoxScale:se,prevAnchor:Mt},this.markUsedJustification(xt,I,it,Lt),xt.allowVerticalPlacement&&(this.markUsedOrientation(xt,Lt,it),this.placedOrientations[it.crossTileID]=Lt),{shift:Nt,placedGlyphBoxes:Rt}},pr.prototype.placeLayerBucketPart=function(I,j,V){var X=this,se=I.parameters,he=se.bucket,ve=se.layout,be=se.posMatrix,Se=se.textLabelPlaneMatrix,Ue=se.labelToScreenMatrix,Xe=se.textPixelRatio,it=se.holdingForFade,xt=se.collisionBoxArray,Lt=se.partiallyEvaluatedTextSize,_t=se.collisionGroup,Mt=ve.get("text-optional"),yt=ve.get("icon-optional"),Nt=ve.get("text-allow-overlap"),Rt=ve.get("icon-allow-overlap"),qt=ve.get("text-rotation-alignment")==="map",rn=ve.get("text-pitch-alignment")==="map",dn=ve.get("icon-text-fit")!=="none",Sn=ve.get("symbol-z-order")==="viewport-y",An=Nt&&(Rt||!he.hasIconData()||yt),tr=Rt&&(Nt||!he.hasTextData()||Mt);!he.collisionArrays&&xt&&he.deserializeCollisionBoxes(xt);var er=function(Gn,Mr){if(!j[Gn.crossTileID])if(it)X.placements[Gn.crossTileID]=new Mn(!1,!1,!1);else{var ai,Qr=!1,gi=!1,Mi=!0,Yi=null,ci={box:null,offscreen:null},zi={box:null,offscreen:null},Li=null,Qi=null,Ri=0,ea=0,fa=0;Mr.textFeatureIndex?Ri=Mr.textFeatureIndex:Gn.useRuntimeCollisionCircles&&(Ri=Gn.featureIndex),Mr.verticalTextFeatureIndex&&(ea=Mr.verticalTextFeatureIndex);var Ha=Mr.textBox;if(Ha){var xo=function(fo){var Vs=i.WritingMode.horizontal;if(he.allowVerticalPlacement&&!fo&&X.prevPlacement){var qs=X.prevPlacement.placedOrientations[Gn.crossTileID];qs&&(X.placedOrientations[Gn.crossTileID]=qs,Vs=qs,X.markUsedOrientation(he,Vs,Gn))}return Vs},bo=function(fo,Vs){if(he.allowVerticalPlacement&&Gn.numVerticalGlyphVertices>0&&Mr.verticalTextBox)for(var qs=0,rg=he.writingModes;qs0&&(qa=qa.filter(function(fo){return fo!==co.anchor})).unshift(co.anchor)}var eo=function(fo,Vs,qs){for(var rg=fo.x2-fo.x1,V3=fo.y2-fo.y1,Ml=Gn.textBoxScale,c1=dn&&!Rt?Vs:null,Op={box:[],offscreen:!1},q3=Nt?2*qa.length:qa.length,yh=0;yh=qa.length,f1=X.attemptAnchorPlacement(H3,fo,rg,V3,Ml,qt,rn,Xe,be,_t,ig,Gn,he,qs,c1);if(f1&&(Op=f1.placedGlyphBoxes)&&Op.box&&Op.box.length){Qr=!0,Yi=f1.shift;break}}return Op};bo(function(){return eo(Ha,Mr.iconBox,i.WritingMode.horizontal)},function(){var fo=Mr.verticalTextBox,Vs=ci&&ci.box&&ci.box.length;return he.allowVerticalPlacement&&!Vs&&Gn.numVerticalGlyphVertices>0&&fo?eo(fo,Mr.verticalIconBox,i.WritingMode.vertical):{box:null,offscreen:null}}),ci&&(Qr=ci.box,Mi=ci.offscreen);var As=xo(ci&&ci.box);if(!Qr&&X.prevPlacement){var Uo=X.prevPlacement.variableOffsets[Gn.crossTileID];Uo&&(X.variableOffsets[Gn.crossTileID]=Uo,X.markUsedJustification(he,Uo.anchor,Gn,As))}}else{var Js=function(fo,Vs){var qs=X.collisionIndex.placeCollisionBox(fo,Nt,Xe,be,_t.predicate);return qs&&qs.box&&qs.box.length&&(X.markUsedOrientation(he,Vs,Gn),X.placedOrientations[Gn.crossTileID]=Vs),qs};bo(function(){return Js(Ha,i.WritingMode.horizontal)},function(){var fo=Mr.verticalTextBox;return he.allowVerticalPlacement&&Gn.numVerticalGlyphVertices>0&&fo?Js(fo,i.WritingMode.vertical):{box:null,offscreen:null}}),xo(ci&&ci.box&&ci.box.length)}}if(Qr=(ai=ci)&&ai.box&&ai.box.length>0,Mi=ai&&ai.offscreen,Gn.useRuntimeCollisionCircles){var sc=he.text.placedSymbolArray.get(Gn.centerJustifiedTextSymbolIndex),Af=i.evaluateSizeForFeature(he.textSizeData,Lt,sc),Sp=ve.get("text-padding"),ud=Gn.collisionCircleDiameter;Li=X.collisionIndex.placeCollisionCircles(Nt,sc,he.lineVertexArray,he.glyphOffsetArray,Af,be,Se,Ue,V,rn,_t.predicate,ud,Sp),Qr=Nt||Li.circles.length>0&&!Li.collisionDetected,Mi=Mi&&Li.offscreen}if(Mr.iconFeatureIndex&&(fa=Mr.iconFeatureIndex),Mr.iconBox){var cd=function(fo){var Vs=dn&&Yi?$r(fo,Yi.x,Yi.y,qt,rn,X.transform.angle):fo;return X.collisionIndex.placeCollisionBox(Vs,Rt,Xe,be,_t.predicate)};gi=zi&&zi.box&&zi.box.length&&Mr.verticalIconBox?(Qi=cd(Mr.verticalIconBox)).box.length>0:(Qi=cd(Mr.iconBox)).box.length>0,Mi=Mi&&Qi.offscreen}var Ms=Mt||Gn.numHorizontalGlyphVertices===0&&Gn.numVerticalGlyphVertices===0,vh=yt||Gn.numIconVertices===0;if(Ms||vh?vh?Ms||(gi=gi&&Qr):Qr=gi&&Qr:gi=Qr=gi&&Qr,Qr&&ai&&ai.box&&(zi&&zi.box&&ea?X.collisionIndex.insertCollisionBox(ai.box,ve.get("text-ignore-placement"),he.bucketInstanceId,ea,_t.ID):X.collisionIndex.insertCollisionBox(ai.box,ve.get("text-ignore-placement"),he.bucketInstanceId,Ri,_t.ID)),gi&&Qi&&X.collisionIndex.insertCollisionBox(Qi.box,ve.get("icon-ignore-placement"),he.bucketInstanceId,fa,_t.ID),Li&&(Qr&&X.collisionIndex.insertCollisionCircles(Li.circles,ve.get("text-ignore-placement"),he.bucketInstanceId,Ri,_t.ID),V)){var Ep=he.bucketInstanceId,Kl=X.collisionCircleArrays[Ep];Kl===void 0&&(Kl=X.collisionCircleArrays[Ep]=new rr);for(var Cp=0;Cp=0;--cr){var Yr=gr[cr];er(he.symbolInstances.get(Yr),he.collisionArrays[Yr])}else for(var ii=I.symbolInstanceStart;ii=0&&(I.text.placedSymbolArray.get(Se).crossTileID=se>=0&&Se!==se?0:V.crossTileID)}},pr.prototype.markUsedOrientation=function(I,j,V){for(var X=j===i.WritingMode.horizontal||j===i.WritingMode.horizontalOnly?j:0,se=j===i.WritingMode.vertical?j:0,he=0,ve=[V.leftJustifiedTextSymbolIndex,V.centerJustifiedTextSymbolIndex,V.rightJustifiedTextSymbolIndex];he0||rn>0,er=Rt.numIconVertices>0,gr=X.placedOrientations[Rt.crossTileID],cr=gr===i.WritingMode.vertical,Yr=gr===i.WritingMode.horizontal||gr===i.WritingMode.horizontalOnly;if(tr){var ii=Un(An.text),Ti=cr?Nn:ii;Lt(I.text,qt,Ti);var Gn=Yr?Nn:ii;Lt(I.text,rn,Gn);var Mr=An.text.isHidden();[Rt.rightJustifiedTextSymbolIndex,Rt.centerJustifiedTextSymbolIndex,Rt.leftJustifiedTextSymbolIndex].forEach(function(fa){fa>=0&&(I.text.placedSymbolArray.get(fa).hidden=Mr||cr?1:0)}),Rt.verticalPlacedTextSymbolIndex>=0&&(I.text.placedSymbolArray.get(Rt.verticalPlacedTextSymbolIndex).hidden=Mr||Yr?1:0);var ai=X.variableOffsets[Rt.crossTileID];ai&&X.markUsedJustification(I,ai.anchor,Rt,gr);var Qr=X.placedOrientations[Rt.crossTileID];Qr&&(X.markUsedJustification(I,"left",Rt,Qr),X.markUsedOrientation(I,Qr,Rt))}if(er){var gi=Un(An.icon),Mi=!(it&&Rt.verticalPlacedIconSymbolIndex&&cr);if(Rt.placedIconSymbolIndex>=0){var Yi=Mi?gi:Nn;Lt(I.icon,Rt.numIconVertices,Yi),I.icon.placedSymbolArray.get(Rt.placedIconSymbolIndex).hidden=An.icon.isHidden()}if(Rt.verticalPlacedIconSymbolIndex>=0){var ci=Mi?Nn:gi;Lt(I.icon,Rt.numVerticalIconVertices,ci),I.icon.placedSymbolArray.get(Rt.verticalPlacedIconSymbolIndex).hidden=An.icon.isHidden()}}if(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData()){var zi=I.collisionArrays[Nt];if(zi){var Li=new i.Point(0,0);if(zi.textBox||zi.verticalTextBox){var Qi=!0;if(Se){var Ri=X.variableOffsets[dn];Ri?(Li=Fr(Ri.anchor,Ri.width,Ri.height,Ri.textOffset,Ri.textBoxScale),Ue&&Li._rotate(Xe?X.transform.angle:-X.transform.angle)):Qi=!1}zi.textBox&&qr(I.textCollisionBox.collisionVertexArray,An.text.placed,!Qi||cr,Li.x,Li.y),zi.verticalTextBox&&qr(I.textCollisionBox.collisionVertexArray,An.text.placed,!Qi||Yr,Li.x,Li.y)}var ea=Boolean(!Yr&&zi.verticalIconBox);zi.iconBox&&qr(I.iconCollisionBox.collisionVertexArray,An.icon.placed,ea,it?Li.x:0,it?Li.y:0),zi.verticalIconBox&&qr(I.iconCollisionBox.collisionVertexArray,An.icon.placed,!ea,it?Li.x:0,it?Li.y:0)}}},Mt=0;MtI},pr.prototype.setStale=function(){this.stale=!0};var _i=Math.pow(2,25),cn=Math.pow(2,24),jn=Math.pow(2,17),jt=Math.pow(2,16),fn=Math.pow(2,9),yn=Math.pow(2,8),$n=Math.pow(2,1);function Un(I){if(I.opacity===0&&!I.placed)return 0;if(I.opacity===1&&I.placed)return 4294967295;var j=I.placed?1:0,V=Math.floor(127*I.opacity);return V*_i+j*cn+V*jn+j*jt+V*fn+j*yn+V*$n+j}var Nn=0,Rn=function(I){this._sortAcrossTiles=I.layout.get("symbol-z-order")!=="viewport-y"&&I.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Rn.prototype.continuePlacement=function(I,j,V,X,se){for(var he=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var ve=j[I[this._currentPlacementIndex]],be=this.placement.collisionIndex.transform.zoom;if(ve.type==="symbol"&&(!ve.minzoom||ve.minzoom<=be)&&(!ve.maxzoom||ve.maxzoom>be)){if(this._inProgressLayer||(this._inProgressLayer=new Rn(ve)),this._inProgressLayer.continuePlacement(V[ve.source],this.placement,this._showCollisionBoxes,ve,he))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},wn.prototype.commit=function(I){return this.placement.commit(I),this.placement};var kn=512/i.EXTENT/2,Tn=function(I,j,V){this.tileID=I,this.indexedSymbolInstances={},this.bucketInstanceId=V;for(var X=0;XI.overscaledZ)for(var be in ve){var Se=ve[be];Se.tileID.isChildOf(I)&&Se.findMatches(j.symbolInstances,I,se)}else{var Ue=ve[I.scaledTo(Number(he)).key];Ue&&Ue.findMatches(j.symbolInstances,I,se)}}for(var Xe=0;Xe1?"@2x":"",it=i.getJSON(he.transformRequest(he.normalizeSpriteURL(se,Xe,".json"),i.ResourceType.SpriteJSON),function(_t,Mt){it=null,Ue||(Ue=_t,be=Mt,Lt())}),xt=i.getImage(he.transformRequest(he.normalizeSpriteURL(se,Xe,".png"),i.ResourceType.SpriteImage),function(_t,Mt){xt=null,Ue||(Ue=_t,Se=Mt,Lt())});function Lt(){if(Ue)ve(Ue);else if(be&&Se){var _t=i.browser.getImageData(Se),Mt={};for(var yt in be){var Nt=be[yt],Rt=Nt.width,qt=Nt.height,rn=Nt.x,dn=Nt.y,Sn=Nt.sdf,An=Nt.pixelRatio,tr=Nt.stretchX,er=Nt.stretchY,gr=Nt.content,cr=new i.RGBAImage({width:Rt,height:qt});i.RGBAImage.copy(_t,cr,{x:rn,y:dn},{x:0,y:0},{width:Rt,height:qt}),Mt[yt]={data:cr,pixelRatio:An,sdf:Sn,stretchX:tr,stretchY:er,content:gr}}ve(null,Mt)}}return{cancel:function(){it&&(it.cancel(),it=null),xt&&(xt.cancel(),xt=null)}}}(V,this.map._requestManager,function(se,he){if(X._spriteRequest=null,se)X.fire(new i.ErrorEvent(se));else if(he)for(var ve in he)X.imageManager.addImage(ve,he[ve]);X.imageManager.setLoaded(!0),X._availableImages=X.imageManager.listImages(),X.dispatcher.broadcast("setImages",X._availableImages),X.fire(new i.Event("data",{dataType:"style"}))})},j.prototype._validateLayer=function(V){var X=this.sourceCaches[V.source];if(X){var se=V.sourceLayer;if(se){var he=X.getSource();(he.type==="geojson"||he.vectorLayerIds&&he.vectorLayerIds.indexOf(se)===-1)&&this.fire(new i.ErrorEvent(new Error('Source layer "'+se+'" does not exist on source "'+he.id+'" as specified by style layer "'+V.id+'"')))}}},j.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var V in this.sourceCaches)if(!this.sourceCaches[V].loaded())return!1;return!!this.imageManager.isLoaded()},j.prototype._serializeLayers=function(V){for(var X=[],se=0,he=V;se0)throw new Error("Unimplemented: "+he.map(function(ve){return ve.command}).join(", ")+".");return se.forEach(function(ve){ve.command!=="setTransition"&&X[ve.command].apply(X,ve.args)}),this.stylesheet=V,!0},j.prototype.addImage=function(V,X){if(this.getImage(V))return this.fire(new i.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(V,X),this._availableImages=this.imageManager.listImages(),this._changedImages[V]=!0,this._changed=!0,this.fire(new i.Event("data",{dataType:"style"}))},j.prototype.updateImage=function(V,X){this.imageManager.updateImage(V,X)},j.prototype.getImage=function(V){return this.imageManager.getImage(V)},j.prototype.removeImage=function(V){if(!this.getImage(V))return this.fire(new i.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(V),this._availableImages=this.imageManager.listImages(),this._changedImages[V]=!0,this._changed=!0,this.fire(new i.Event("data",{dataType:"style"}))},j.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},j.prototype.addSource=function(V,X,se){var he=this;if(se===void 0&&(se={}),this._checkLoaded(),this.sourceCaches[V]!==void 0)throw new Error("There is already a source with this ID");if(!X.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(X).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(X.type)>=0)||!this._validate(i.validateStyle.source,"sources."+V,X,null,se)){this.map&&this.map._collectResourceTiming&&(X.collectResourceTiming=!0);var ve=this.sourceCaches[V]=new He(V,X,this.dispatcher);ve.style=this,ve.setEventedParent(this,function(){return{isSourceLoaded:he.loaded(),source:ve.serialize(),sourceId:V}}),ve.onAdd(this.map),this._changed=!0}},j.prototype.removeSource=function(V){if(this._checkLoaded(),this.sourceCaches[V]===void 0)throw new Error("There is no source with this ID");for(var X in this._layers)if(this._layers[X].source===V)return this.fire(new i.ErrorEvent(new Error('Source "'+V+'" cannot be removed while layer "'+X+'" is using it.')));var se=this.sourceCaches[V];delete this.sourceCaches[V],delete this._updatedSources[V],se.fire(new i.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:V})),se.setEventedParent(null),se.clearTiles(),se.onRemove&&se.onRemove(this.map),this._changed=!0},j.prototype.setGeoJSONSourceData=function(V,X){this._checkLoaded(),this.sourceCaches[V].getSource().setData(X),this._changed=!0},j.prototype.getSource=function(V){return this.sourceCaches[V]&&this.sourceCaches[V].getSource()},j.prototype.addLayer=function(V,X,se){se===void 0&&(se={}),this._checkLoaded();var he=V.id;if(this.getLayer(he))this.fire(new i.ErrorEvent(new Error('Layer with id "'+he+'" already exists on this map')));else{var ve;if(V.type==="custom"){if(ir(this,i.validateCustomStyleLayer(V)))return;ve=i.createStyleLayer(V)}else{if(typeof V.source=="object"&&(this.addSource(he,V.source),V=i.clone$1(V),V=i.extend(V,{source:he})),this._validate(i.validateStyle.layer,"layers."+he,V,{arrayIndex:-1},se))return;ve=i.createStyleLayer(V),this._validateLayer(ve),ve.setEventedParent(this,{layer:{id:he}}),this._serializedLayers[ve.id]=ve.serialize()}var be=X?this._order.indexOf(X):this._order.length;if(X&&be===-1)this.fire(new i.ErrorEvent(new Error('Layer with id "'+X+'" does not exist on this map.')));else{if(this._order.splice(be,0,he),this._layerOrderChanged=!0,this._layers[he]=ve,this._removedLayers[he]&&ve.source&&ve.type!=="custom"){var Se=this._removedLayers[he];delete this._removedLayers[he],Se.type!==ve.type?this._updatedSources[ve.source]="clear":(this._updatedSources[ve.source]="reload",this.sourceCaches[ve.source].pause())}this._updateLayer(ve),ve.onAdd&&ve.onAdd(this.map)}}},j.prototype.moveLayer=function(V,X){if(this._checkLoaded(),this._changed=!0,this._layers[V]){if(V!==X){var se=this._order.indexOf(V);this._order.splice(se,1);var he=X?this._order.indexOf(X):this._order.length;X&&he===-1?this.fire(new i.ErrorEvent(new Error('Layer with id "'+X+'" does not exist on this map.'))):(this._order.splice(he,0,V),this._layerOrderChanged=!0)}}else this.fire(new i.ErrorEvent(new Error("The layer '"+V+"' does not exist in the map's style and cannot be moved.")))},j.prototype.removeLayer=function(V){this._checkLoaded();var X=this._layers[V];if(X){X.setEventedParent(null);var se=this._order.indexOf(V);this._order.splice(se,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[V]=X,delete this._layers[V],delete this._serializedLayers[V],delete this._updatedLayers[V],delete this._updatedPaintProps[V],X.onRemove&&X.onRemove(this.map)}else this.fire(new i.ErrorEvent(new Error("The layer '"+V+"' does not exist in the map's style and cannot be removed.")))},j.prototype.getLayer=function(V){return this._layers[V]},j.prototype.hasLayer=function(V){return V in this._layers},j.prototype.setLayerZoomRange=function(V,X,se){this._checkLoaded();var he=this.getLayer(V);he?he.minzoom===X&&he.maxzoom===se||(X!=null&&(he.minzoom=X),se!=null&&(he.maxzoom=se),this._updateLayer(he)):this.fire(new i.ErrorEvent(new Error("The layer '"+V+"' does not exist in the map's style and cannot have zoom extent.")))},j.prototype.setFilter=function(V,X,se){se===void 0&&(se={}),this._checkLoaded();var he=this.getLayer(V);if(he){if(!i.deepEqual(he.filter,X))return X==null?(he.filter=void 0,void this._updateLayer(he)):void(this._validate(i.validateStyle.filter,"layers."+he.id+".filter",X,null,se)||(he.filter=i.clone$1(X),this._updateLayer(he)))}else this.fire(new i.ErrorEvent(new Error("The layer '"+V+"' does not exist in the map's style and cannot be filtered.")))},j.prototype.getFilter=function(V){return i.clone$1(this.getLayer(V).filter)},j.prototype.setLayoutProperty=function(V,X,se,he){he===void 0&&(he={}),this._checkLoaded();var ve=this.getLayer(V);ve?i.deepEqual(ve.getLayoutProperty(X),se)||(ve.setLayoutProperty(X,se,he),this._updateLayer(ve)):this.fire(new i.ErrorEvent(new Error("The layer '"+V+"' does not exist in the map's style and cannot be styled.")))},j.prototype.getLayoutProperty=function(V,X){var se=this.getLayer(V);if(se)return se.getLayoutProperty(X);this.fire(new i.ErrorEvent(new Error("The layer '"+V+"' does not exist in the map's style.")))},j.prototype.setPaintProperty=function(V,X,se,he){he===void 0&&(he={}),this._checkLoaded();var ve=this.getLayer(V);ve?i.deepEqual(ve.getPaintProperty(X),se)||(ve.setPaintProperty(X,se,he)&&this._updateLayer(ve),this._changed=!0,this._updatedPaintProps[V]=!0):this.fire(new i.ErrorEvent(new Error("The layer '"+V+"' does not exist in the map's style and cannot be styled.")))},j.prototype.getPaintProperty=function(V,X){return this.getLayer(V).getPaintProperty(X)},j.prototype.setFeatureState=function(V,X){this._checkLoaded();var se=V.source,he=V.sourceLayer,ve=this.sourceCaches[se];if(ve!==void 0){var be=ve.getSource().type;be==="geojson"&&he?this.fire(new i.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):be!=="vector"||he?(V.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),ve.setFeatureState(he,V.id,X)):this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new i.ErrorEvent(new Error("The source '"+se+"' does not exist in the map's style.")))},j.prototype.removeFeatureState=function(V,X){this._checkLoaded();var se=V.source,he=this.sourceCaches[se];if(he!==void 0){var ve=he.getSource().type,be=ve==="vector"?V.sourceLayer:void 0;ve!=="vector"||be?X&&typeof V.id!="string"&&typeof V.id!="number"?this.fire(new i.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):he.removeFeatureState(be,V.id,X):this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new i.ErrorEvent(new Error("The source '"+se+"' does not exist in the map's style.")))},j.prototype.getFeatureState=function(V){this._checkLoaded();var X=V.source,se=V.sourceLayer,he=this.sourceCaches[X];if(he!==void 0){if(he.getSource().type!=="vector"||se)return V.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),he.getFeatureState(se,V.id);this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new i.ErrorEvent(new Error("The source '"+X+"' does not exist in the map's style.")))},j.prototype.getTransition=function(){return i.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},j.prototype.serialize=function(){return i.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:i.mapObject(this.sourceCaches,function(V){return V.serialize()}),layers:this._serializeLayers(this._order)},function(V){return V!==void 0})},j.prototype._updateLayer=function(V){this._updatedLayers[V.id]=!0,V.source&&!this._updatedSources[V.source]&&this.sourceCaches[V.source].getSource().type!=="raster"&&(this._updatedSources[V.source]="reload",this.sourceCaches[V.source].pause()),this._changed=!0},j.prototype._flattenAndSortRenderedFeatures=function(V){for(var X=this,se=function(gr){return X._layers[gr].type==="fill-extrusion"},he={},ve=[],be=this._order.length-1;be>=0;be--){var Se=this._order[be];if(se(Se)){he[Se]=be;for(var Ue=0,Xe=V;Ue=0;yt--){var Nt=this._order[yt];if(se(Nt))for(var Rt=ve.length-1;Rt>=0;Rt--){var qt=ve[Rt].feature;if(he[qt.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","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;}"),Ja=ba("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;}","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);}"),Ao=ba("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);}","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);}"),fs=ba(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),ya=ba(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),xa=ba(`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; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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;}`),Zo=ba(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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);}`),oa=ba(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 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;}`),hs=ba(`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; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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 +? a_pos +: 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;}`),bs=ba(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;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 exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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;}"),so=ba(`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; +#define PI 3.141592653589793 +void 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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;}"),Jo=ba(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute 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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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);}`),_s=ba(`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 float v_lineprogress; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define MAX_LINE_DISTANCE 32767.0 +#define scale 0.015873016 +attribute 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_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;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);}`),Ls=ba(`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; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute 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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float 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;}`),Oo=ba(`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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +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 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute 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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float 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);}`),Ka=ba(`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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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;}"),$o=ba(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 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 ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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));}`),ic=ba(`#define SDF_PX 8.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 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 ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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);}`),Mc=ba(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 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 ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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);}`);function ba(I,j){var V=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,X={};return{fragmentSource:I=I.replace(V,function(se,he,ve,be,Se){return X[Se]=!0,he==="define"?` +#ifndef HAS_UNIFORM_u_`+Se+` +varying `+ve+" "+be+" "+Se+`; +#else +uniform `+ve+" "+be+" u_"+Se+`; +#endif +`:` +#ifdef HAS_UNIFORM_u_`+Se+` + `+ve+" "+be+" "+Se+" = u_"+Se+`; +#endif +`}),vertexSource:j=j.replace(V,function(se,he,ve,be,Se){var Ue=be==="float"?"vec2":"vec4",Xe=Se.match(/color/)?"color":Ue;return X[Se]?he==="define"?` +#ifndef HAS_UNIFORM_u_`+Se+` +uniform lowp float u_`+Se+`_t; +attribute `+ve+" "+Ue+" a_"+Se+`; +varying `+ve+" "+be+" "+Se+`; +#else +uniform `+ve+" "+be+" u_"+Se+`; +#endif +`:Xe==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Se+` + `+Se+" = a_"+Se+`; +#else + `+ve+" "+be+" "+Se+" = u_"+Se+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Se+` + `+Se+" = unpack_mix_"+Xe+"(a_"+Se+", u_"+Se+`_t); +#else + `+ve+" "+be+" "+Se+" = u_"+Se+`; +#endif +`:he==="define"?` +#ifndef HAS_UNIFORM_u_`+Se+` +uniform lowp float u_`+Se+`_t; +attribute `+ve+" "+Ue+" a_"+Se+`; +#else +uniform `+ve+" "+be+" u_"+Se+`; +#endif +`:Xe==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Se+` + `+ve+" "+be+" "+Se+" = a_"+Se+`; +#else + `+ve+" "+be+" "+Se+" = u_"+Se+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Se+` + `+ve+" "+be+" "+Se+" = unpack_mix_"+Xe+"(a_"+Se+", u_"+Se+`_t); +#else + `+ve+" "+be+" "+Se+" = u_"+Se+`; +#endif +`})}}var ju=Object.freeze({__proto__:null,prelude:Nr,background:ri,backgroundPattern:ji,circle:Bi,clippingMask:Sr,heatmap:ui,heatmapTexture:si,collisionBox:ta,collisionCircle:Ja,debug:Ao,fill:fs,fillOutline:ya,fillOutlinePattern:xa,fillPattern:Zo,fillExtrusion:oa,fillExtrusionPattern:hs,hillshadePrepare:bs,hillshade:so,line:Jo,lineGradient:_s,linePattern:Ls,lineSDF:Oo,raster:Ka,symbolIcon:$o,symbolSDF:ic,symbolTextAndIcon:Mc}),Wl=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Wl.prototype.bind=function(I,j,V,X,se,he,ve,be){this.context=I;for(var Se=this.boundPaintVertexBuffers.length!==X.length,Ue=0;!Se&&Ue>16,be>>16],u_pixel_coord_lower:[65535&ve,65535&be]}}Sc.prototype.draw=function(I,j,V,X,se,he,ve,be,Se,Ue,Xe,it,xt,Lt,_t,Mt){var yt,Nt=I.gl;if(!this.failedToCreate){for(var Rt in I.program.set(this.program),I.setDepthMode(V),I.setStencilMode(X),I.setColorMode(se),I.setCullFace(he),this.fixedUniforms)this.fixedUniforms[Rt].set(ve[Rt]);Lt&&Lt.setUniforms(I,this.binderUniforms,it,{zoom:xt});for(var qt=(yt={},yt[Nt.LINES]=2,yt[Nt.TRIANGLES]=3,yt[Nt.LINE_STRIP]=1,yt)[j],rn=0,dn=Xe.get();rn0?1-1/(1.001-ve):-ve),u_contrast_factor:(he=se.paint.get("raster-contrast"),he>0?1/(1-he):1+he),u_spin_weights:pt(se.paint.get("raster-hue-rotate"))};var he,ve};function pt(I){I*=Math.PI/180;var j=Math.sin(I),V=Math.cos(I);return[(2*V+1)/3,(-Math.sqrt(3)*j-V+1)/3,(Math.sqrt(3)*j-V+1)/3]}var Ct,Qt=function(I,j,V,X,se,he,ve,be,Se,Ue){var Xe=se.transform;return{u_is_size_zoom_constant:+(I==="constant"||I==="source"),u_is_size_feature_constant:+(I==="constant"||I==="camera"),u_size_t:j?j.uSizeT:0,u_size:j?j.uSize:0,u_camera_to_center_distance:Xe.cameraToCenterDistance,u_pitch:Xe.pitch/360*2*Math.PI,u_rotate_symbol:+V,u_aspect_ratio:Xe.width/Xe.height,u_fade_change:se.options.fadeDuration?se.symbolFadeChange:1,u_matrix:he,u_label_plane_matrix:ve,u_coord_matrix:be,u_is_text:+Se,u_pitch_with_map:+X,u_texsize:Ue,u_texture:0}},en=function(I,j,V,X,se,he,ve,be,Se,Ue,Xe){var it=se.transform;return i.extend(Qt(I,j,V,X,se,he,ve,be,Se,Ue),{u_gamma_scale:X?Math.cos(it._pitch)*it.cameraToCenterDistance:1,u_device_pixel_ratio:i.browser.devicePixelRatio,u_is_halo:+Xe})},Yt=function(I,j,V,X,se,he,ve,be,Se,Ue){return i.extend(en(I,j,V,X,se,he,ve,be,!0,Se,!0),{u_texsize_icon:Ue,u_texture_icon:1})},an=function(I,j,V){return{u_matrix:I,u_opacity:j,u_color:V}},hn=function(I,j,V,X,se,he){return i.extend(function(ve,be,Se,Ue){var Xe=Se.imageManager.getPattern(ve.from.toString()),it=Se.imageManager.getPattern(ve.to.toString()),xt=Se.imageManager.getPixelSize(),Lt=xt.width,_t=xt.height,Mt=Math.pow(2,Ue.tileID.overscaledZ),yt=Ue.tileSize*Math.pow(2,Se.transform.tileZoom)/Mt,Nt=yt*(Ue.tileID.canonical.x+Ue.tileID.wrap*Mt),Rt=yt*Ue.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Xe.tl,u_pattern_br_a:Xe.br,u_pattern_tl_b:it.tl,u_pattern_br_b:it.br,u_texsize:[Lt,_t],u_mix:be.t,u_pattern_size_a:Xe.displaySize,u_pattern_size_b:it.displaySize,u_scale_a:be.fromScale,u_scale_b:be.toScale,u_tile_units_to_pixels:1/Ln(Ue,1,Se.transform.tileZoom),u_pixel_coord_upper:[Nt>>16,Rt>>16],u_pixel_coord_lower:[65535&Nt,65535&Rt]}}(X,he,V,se),{u_matrix:I,u_opacity:j})},xn={fillExtrusion:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_lightpos:new i.Uniform3f(I,j.u_lightpos),u_lightintensity:new i.Uniform1f(I,j.u_lightintensity),u_lightcolor:new i.Uniform3f(I,j.u_lightcolor),u_vertical_gradient:new i.Uniform1f(I,j.u_vertical_gradient),u_opacity:new i.Uniform1f(I,j.u_opacity)}},fillExtrusionPattern:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_lightpos:new i.Uniform3f(I,j.u_lightpos),u_lightintensity:new i.Uniform1f(I,j.u_lightintensity),u_lightcolor:new i.Uniform3f(I,j.u_lightcolor),u_vertical_gradient:new i.Uniform1f(I,j.u_vertical_gradient),u_height_factor:new i.Uniform1f(I,j.u_height_factor),u_image:new i.Uniform1i(I,j.u_image),u_texsize:new i.Uniform2f(I,j.u_texsize),u_pixel_coord_upper:new i.Uniform2f(I,j.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(I,j.u_pixel_coord_lower),u_scale:new i.Uniform3f(I,j.u_scale),u_fade:new i.Uniform1f(I,j.u_fade),u_opacity:new i.Uniform1f(I,j.u_opacity)}},fill:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix)}},fillPattern:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_image:new i.Uniform1i(I,j.u_image),u_texsize:new i.Uniform2f(I,j.u_texsize),u_pixel_coord_upper:new i.Uniform2f(I,j.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(I,j.u_pixel_coord_lower),u_scale:new i.Uniform3f(I,j.u_scale),u_fade:new i.Uniform1f(I,j.u_fade)}},fillOutline:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_world:new i.Uniform2f(I,j.u_world)}},fillOutlinePattern:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_world:new i.Uniform2f(I,j.u_world),u_image:new i.Uniform1i(I,j.u_image),u_texsize:new i.Uniform2f(I,j.u_texsize),u_pixel_coord_upper:new i.Uniform2f(I,j.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(I,j.u_pixel_coord_lower),u_scale:new i.Uniform3f(I,j.u_scale),u_fade:new i.Uniform1f(I,j.u_fade)}},circle:function(I,j){return{u_camera_to_center_distance:new i.Uniform1f(I,j.u_camera_to_center_distance),u_scale_with_map:new i.Uniform1i(I,j.u_scale_with_map),u_pitch_with_map:new i.Uniform1i(I,j.u_pitch_with_map),u_extrude_scale:new i.Uniform2f(I,j.u_extrude_scale),u_device_pixel_ratio:new i.Uniform1f(I,j.u_device_pixel_ratio),u_matrix:new i.UniformMatrix4f(I,j.u_matrix)}},collisionBox:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_camera_to_center_distance:new i.Uniform1f(I,j.u_camera_to_center_distance),u_pixels_to_tile_units:new i.Uniform1f(I,j.u_pixels_to_tile_units),u_extrude_scale:new i.Uniform2f(I,j.u_extrude_scale),u_overscale_factor:new i.Uniform1f(I,j.u_overscale_factor)}},collisionCircle:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_inv_matrix:new i.UniformMatrix4f(I,j.u_inv_matrix),u_camera_to_center_distance:new i.Uniform1f(I,j.u_camera_to_center_distance),u_viewport_size:new i.Uniform2f(I,j.u_viewport_size)}},debug:function(I,j){return{u_color:new i.UniformColor(I,j.u_color),u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_overlay:new i.Uniform1i(I,j.u_overlay),u_overlay_scale:new i.Uniform1f(I,j.u_overlay_scale)}},clippingMask:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix)}},heatmap:function(I,j){return{u_extrude_scale:new i.Uniform1f(I,j.u_extrude_scale),u_intensity:new i.Uniform1f(I,j.u_intensity),u_matrix:new i.UniformMatrix4f(I,j.u_matrix)}},heatmapTexture:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_world:new i.Uniform2f(I,j.u_world),u_image:new i.Uniform1i(I,j.u_image),u_color_ramp:new i.Uniform1i(I,j.u_color_ramp),u_opacity:new i.Uniform1f(I,j.u_opacity)}},hillshade:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_image:new i.Uniform1i(I,j.u_image),u_latrange:new i.Uniform2f(I,j.u_latrange),u_light:new i.Uniform2f(I,j.u_light),u_shadow:new i.UniformColor(I,j.u_shadow),u_highlight:new i.UniformColor(I,j.u_highlight),u_accent:new i.UniformColor(I,j.u_accent)}},hillshadePrepare:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_image:new i.Uniform1i(I,j.u_image),u_dimension:new i.Uniform2f(I,j.u_dimension),u_zoom:new i.Uniform1f(I,j.u_zoom),u_maxzoom:new i.Uniform1f(I,j.u_maxzoom),u_unpack:new i.Uniform4f(I,j.u_unpack)}},line:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_ratio:new i.Uniform1f(I,j.u_ratio),u_device_pixel_ratio:new i.Uniform1f(I,j.u_device_pixel_ratio),u_units_to_pixels:new i.Uniform2f(I,j.u_units_to_pixels)}},lineGradient:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_ratio:new i.Uniform1f(I,j.u_ratio),u_device_pixel_ratio:new i.Uniform1f(I,j.u_device_pixel_ratio),u_units_to_pixels:new i.Uniform2f(I,j.u_units_to_pixels),u_image:new i.Uniform1i(I,j.u_image)}},linePattern:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_texsize:new i.Uniform2f(I,j.u_texsize),u_ratio:new i.Uniform1f(I,j.u_ratio),u_device_pixel_ratio:new i.Uniform1f(I,j.u_device_pixel_ratio),u_image:new i.Uniform1i(I,j.u_image),u_units_to_pixels:new i.Uniform2f(I,j.u_units_to_pixels),u_scale:new i.Uniform3f(I,j.u_scale),u_fade:new i.Uniform1f(I,j.u_fade)}},lineSDF:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_ratio:new i.Uniform1f(I,j.u_ratio),u_device_pixel_ratio:new i.Uniform1f(I,j.u_device_pixel_ratio),u_units_to_pixels:new i.Uniform2f(I,j.u_units_to_pixels),u_patternscale_a:new i.Uniform2f(I,j.u_patternscale_a),u_patternscale_b:new i.Uniform2f(I,j.u_patternscale_b),u_sdfgamma:new i.Uniform1f(I,j.u_sdfgamma),u_image:new i.Uniform1i(I,j.u_image),u_tex_y_a:new i.Uniform1f(I,j.u_tex_y_a),u_tex_y_b:new i.Uniform1f(I,j.u_tex_y_b),u_mix:new i.Uniform1f(I,j.u_mix)}},raster:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_tl_parent:new i.Uniform2f(I,j.u_tl_parent),u_scale_parent:new i.Uniform1f(I,j.u_scale_parent),u_buffer_scale:new i.Uniform1f(I,j.u_buffer_scale),u_fade_t:new i.Uniform1f(I,j.u_fade_t),u_opacity:new i.Uniform1f(I,j.u_opacity),u_image0:new i.Uniform1i(I,j.u_image0),u_image1:new i.Uniform1i(I,j.u_image1),u_brightness_low:new i.Uniform1f(I,j.u_brightness_low),u_brightness_high:new i.Uniform1f(I,j.u_brightness_high),u_saturation_factor:new i.Uniform1f(I,j.u_saturation_factor),u_contrast_factor:new i.Uniform1f(I,j.u_contrast_factor),u_spin_weights:new i.Uniform3f(I,j.u_spin_weights)}},symbolIcon:function(I,j){return{u_is_size_zoom_constant:new i.Uniform1i(I,j.u_is_size_zoom_constant),u_is_size_feature_constant:new i.Uniform1i(I,j.u_is_size_feature_constant),u_size_t:new i.Uniform1f(I,j.u_size_t),u_size:new i.Uniform1f(I,j.u_size),u_camera_to_center_distance:new i.Uniform1f(I,j.u_camera_to_center_distance),u_pitch:new i.Uniform1f(I,j.u_pitch),u_rotate_symbol:new i.Uniform1i(I,j.u_rotate_symbol),u_aspect_ratio:new i.Uniform1f(I,j.u_aspect_ratio),u_fade_change:new i.Uniform1f(I,j.u_fade_change),u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_label_plane_matrix:new i.UniformMatrix4f(I,j.u_label_plane_matrix),u_coord_matrix:new i.UniformMatrix4f(I,j.u_coord_matrix),u_is_text:new i.Uniform1i(I,j.u_is_text),u_pitch_with_map:new i.Uniform1i(I,j.u_pitch_with_map),u_texsize:new i.Uniform2f(I,j.u_texsize),u_texture:new i.Uniform1i(I,j.u_texture)}},symbolSDF:function(I,j){return{u_is_size_zoom_constant:new i.Uniform1i(I,j.u_is_size_zoom_constant),u_is_size_feature_constant:new i.Uniform1i(I,j.u_is_size_feature_constant),u_size_t:new i.Uniform1f(I,j.u_size_t),u_size:new i.Uniform1f(I,j.u_size),u_camera_to_center_distance:new i.Uniform1f(I,j.u_camera_to_center_distance),u_pitch:new i.Uniform1f(I,j.u_pitch),u_rotate_symbol:new i.Uniform1i(I,j.u_rotate_symbol),u_aspect_ratio:new i.Uniform1f(I,j.u_aspect_ratio),u_fade_change:new i.Uniform1f(I,j.u_fade_change),u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_label_plane_matrix:new i.UniformMatrix4f(I,j.u_label_plane_matrix),u_coord_matrix:new i.UniformMatrix4f(I,j.u_coord_matrix),u_is_text:new i.Uniform1i(I,j.u_is_text),u_pitch_with_map:new i.Uniform1i(I,j.u_pitch_with_map),u_texsize:new i.Uniform2f(I,j.u_texsize),u_texture:new i.Uniform1i(I,j.u_texture),u_gamma_scale:new i.Uniform1f(I,j.u_gamma_scale),u_device_pixel_ratio:new i.Uniform1f(I,j.u_device_pixel_ratio),u_is_halo:new i.Uniform1i(I,j.u_is_halo)}},symbolTextAndIcon:function(I,j){return{u_is_size_zoom_constant:new i.Uniform1i(I,j.u_is_size_zoom_constant),u_is_size_feature_constant:new i.Uniform1i(I,j.u_is_size_feature_constant),u_size_t:new i.Uniform1f(I,j.u_size_t),u_size:new i.Uniform1f(I,j.u_size),u_camera_to_center_distance:new i.Uniform1f(I,j.u_camera_to_center_distance),u_pitch:new i.Uniform1f(I,j.u_pitch),u_rotate_symbol:new i.Uniform1i(I,j.u_rotate_symbol),u_aspect_ratio:new i.Uniform1f(I,j.u_aspect_ratio),u_fade_change:new i.Uniform1f(I,j.u_fade_change),u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_label_plane_matrix:new i.UniformMatrix4f(I,j.u_label_plane_matrix),u_coord_matrix:new i.UniformMatrix4f(I,j.u_coord_matrix),u_is_text:new i.Uniform1i(I,j.u_is_text),u_pitch_with_map:new i.Uniform1i(I,j.u_pitch_with_map),u_texsize:new i.Uniform2f(I,j.u_texsize),u_texsize_icon:new i.Uniform2f(I,j.u_texsize_icon),u_texture:new i.Uniform1i(I,j.u_texture),u_texture_icon:new i.Uniform1i(I,j.u_texture_icon),u_gamma_scale:new i.Uniform1f(I,j.u_gamma_scale),u_device_pixel_ratio:new i.Uniform1f(I,j.u_device_pixel_ratio),u_is_halo:new i.Uniform1i(I,j.u_is_halo)}},background:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_opacity:new i.Uniform1f(I,j.u_opacity),u_color:new i.UniformColor(I,j.u_color)}},backgroundPattern:function(I,j){return{u_matrix:new i.UniformMatrix4f(I,j.u_matrix),u_opacity:new i.Uniform1f(I,j.u_opacity),u_image:new i.Uniform1i(I,j.u_image),u_pattern_tl_a:new i.Uniform2f(I,j.u_pattern_tl_a),u_pattern_br_a:new i.Uniform2f(I,j.u_pattern_br_a),u_pattern_tl_b:new i.Uniform2f(I,j.u_pattern_tl_b),u_pattern_br_b:new i.Uniform2f(I,j.u_pattern_br_b),u_texsize:new i.Uniform2f(I,j.u_texsize),u_mix:new i.Uniform1f(I,j.u_mix),u_pattern_size_a:new i.Uniform2f(I,j.u_pattern_size_a),u_pattern_size_b:new i.Uniform2f(I,j.u_pattern_size_b),u_scale_a:new i.Uniform1f(I,j.u_scale_a),u_scale_b:new i.Uniform1f(I,j.u_scale_b),u_pixel_coord_upper:new i.Uniform2f(I,j.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(I,j.u_pixel_coord_lower),u_tile_units_to_pixels:new i.Uniform1f(I,j.u_tile_units_to_pixels)}}};function _n(I,j,V,X,se,he,ve){for(var be=I.context,Se=be.gl,Ue=I.useProgram("collisionBox"),Xe=[],it=0,xt=0,Lt=0;Lt0){var rn=i.create(),dn=Nt;i.mul(rn,yt.placementInvProjMatrix,I.transform.glCoordMatrix),i.mul(rn,rn,yt.placementViewportMatrix),Xe.push({circleArray:qt,circleOffset:xt,transform:dn,invTransform:rn}),xt=it+=qt.length/4}Rt&&Ue.draw(be,Se.LINES,dt.disabled,Pe.disabled,I.colorModeForRenderPass(),Ae.disabled,Yl(Nt,I.transform,Mt),V.id,Rt.layoutVertexBuffer,Rt.indexBuffer,Rt.segments,null,I.transform.zoom,null,null,Rt.collisionVertexBuffer)}}if(ve&&Xe.length){var Sn=I.useProgram("collisionCircle"),An=new i.StructArrayLayout2f1f2i16;An.resize(4*it),An._trim();for(var tr=0,er=0,gr=Xe;er=0&&(_t[yt.associatedIconIndex]={shiftedAnchor:gr,angle:cr})}else vr(yt.numGlyphs,xt)}if(Xe){Lt.clear();for(var ii=I.icon.placedSymbolArray,Ti=0;Ti0){var ve=i.browser.now(),be=(ve-I.timeAdded)/he,Se=j?(ve-j.timeAdded)/he:-1,Ue=V.getSource(),Xe=se.coveringZoomLevel({tileSize:Ue.tileSize,roundZoom:Ue.roundZoom}),it=!j||Math.abs(j.tileID.overscaledZ-Xe)>Math.abs(I.tileID.overscaledZ-Xe),xt=it&&I.refreshedUponExpiration?1:i.clamp(it?be:1-Se,0,1);return I.refreshedUponExpiration&&be>=1&&(I.refreshedUponExpiration=!1),j?{opacity:1,mix:1-xt}:{opacity:xt,mix:0}}return{opacity:1,mix:0}}var ca=new i.Color(1,0,0,1),lo=new i.Color(0,1,0,1),io=new i.Color(0,0,1,1),za=new i.Color(1,0,1,1),Ra=new i.Color(0,1,1,1);function ao(I){var j=I.transform.padding;Lo(I,I.transform.height-(j.top||0),3,ca),Lo(I,j.bottom||0,3,lo),Ko(I,j.left||0,3,io),Ko(I,I.transform.width-(j.right||0),3,za);var V=I.transform.centerPoint;(function(X,se,he,ve){Qo(X,se-1,he-10,2,20,ve),Qo(X,se-10,he-1,20,2,ve)})(I,V.x,I.transform.height-V.y,Ra)}function Lo(I,j,V,X){Qo(I,0,j+V/2,I.transform.width,V,X)}function Ko(I,j,V,X){Qo(I,j-V/2,0,V,I.transform.height,X)}function Qo(I,j,V,X,se,he){var ve=I.context,be=ve.gl;be.enable(be.SCISSOR_TEST),be.scissor(j*i.browser.devicePixelRatio,V*i.browser.devicePixelRatio,X*i.browser.devicePixelRatio,se*i.browser.devicePixelRatio),ve.clear({color:he}),be.disable(be.SCISSOR_TEST)}function es(I,j,V){var X=I.context,se=X.gl,he=V.posMatrix,ve=I.useProgram("debug"),be=dt.disabled,Se=Pe.disabled,Ue=I.colorModeForRenderPass();X.activeTexture.set(se.TEXTURE0),I.emptyTexture.bind(se.LINEAR,se.CLAMP_TO_EDGE),ve.draw(X,se.LINE_STRIP,be,Se,Ue,Ae.disabled,Uu(he,i.Color.red),"$debug",I.debugBuffer,I.tileBorderIndexBuffer,I.debugSegments);var Xe=j.getTileByID(V.key).latestRawTileData,it=Xe&&Xe.byteLength||0,xt=Math.floor(it/1024),Lt=j.getTile(V).tileSize,_t=512/Math.min(Lt,512)*(V.overscaledZ/I.transform.zoom)*.5,Mt=V.canonical.toString();V.overscaledZ!==V.canonical.z&&(Mt+=" => "+V.overscaledZ),function(yt,Nt){yt.initDebugOverlayCanvas();var Rt=yt.debugOverlayCanvas,qt=yt.context.gl,rn=yt.debugOverlayCanvas.getContext("2d");rn.clearRect(0,0,Rt.width,Rt.height),rn.shadowColor="white",rn.shadowBlur=2,rn.lineWidth=1.5,rn.strokeStyle="white",rn.textBaseline="top",rn.font="bold 36px Open Sans, sans-serif",rn.fillText(Nt,5,5),rn.strokeText(Nt,5,5),yt.debugOverlayTexture.update(Rt),yt.debugOverlayTexture.bind(qt.LINEAR,qt.CLAMP_TO_EDGE)}(I,Mt+" "+xt+"kb"),ve.draw(X,se.TRIANGLES,be,Se,Ie.alphaBlended,Ae.disabled,Uu(he,i.Color.transparent,_t),"$debug",I.debugBuffer,I.quadTriangleIndexBuffer,I.debugSegments)}var ts={symbol:function(I,j,V,X,se){if(I.renderPass==="translucent"){var he=Pe.disabled,ve=I.colorModeForRenderPass();V.layout.get("text-variable-anchor")&&function(be,Se,Ue,Xe,it,xt,Lt){for(var _t=Se.transform,Mt=it==="map",yt=xt==="map",Nt=0,Rt=be;Nt256&&this.clearStencil(),V.setColorMode(Ie.disabled),V.setDepthMode(dt.disabled);var se=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var he=0,ve=j;he256&&this.clearStencil();var I=this.nextStencilID++,j=this.context.gl;return new Pe({func:j.NOTEQUAL,mask:255},I,255,j.KEEP,j.KEEP,j.REPLACE)},na.prototype.stencilModeForClipping=function(I){var j=this.context.gl;return new Pe({func:j.EQUAL,mask:255},this._tileClippingMaskIDs[I.key],0,j.KEEP,j.KEEP,j.REPLACE)},na.prototype.stencilConfigForOverlap=function(I){var j,V=this.context.gl,X=I.sort(function(Se,Ue){return Ue.overscaledZ-Se.overscaledZ}),se=X[X.length-1].overscaledZ,he=X[0].overscaledZ-se+1;if(he>1){this.currentStencilSource=void 0,this.nextStencilID+he>256&&this.clearStencil();for(var ve={},be=0;be=0;this.currentLayer--){var dn=this.style._layers[X[this.currentLayer]],Sn=se[dn.source],An=Ue[dn.source];this._renderTileClippingMasks(dn,An),this.renderLayer(this,Sn,dn,An)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?j.pop():null},na.prototype.isPatternMissing=function(I){if(!I)return!1;if(!I.from||!I.to)return!0;var j=this.imageManager.getPattern(I.from.toString()),V=this.imageManager.getPattern(I.to.toString());return!j||!V},na.prototype.useProgram=function(I,j){this.cache=this.cache||{};var V=""+I+(j?j.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[V]||(this.cache[V]=new Sc(this.context,ju[I],j,xn[I],this._showOverdrawInspector)),this.cache[V]},na.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()},na.prototype.setBaseState=function(){var I=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(I.FUNC_ADD)},na.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=i.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var I=this.context.gl;this.debugOverlayTexture=new i.Texture(this.context,this.debugOverlayCanvas,I.RGBA)}},na.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var ht=function(I,j){this.points=I,this.planes=j};ht.fromInvProjectionMatrix=function(I,j,V){var X=Math.pow(2,V),se=[[-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]].map(function(ve){return i.transformMat4([],ve,I)}).map(function(ve){return i.scale$1([],ve,1/ve[3]/j*X)}),he=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(ve){var be=i.sub([],se[ve[0]],se[ve[1]]),Se=i.sub([],se[ve[2]],se[ve[1]]),Ue=i.normalize([],i.cross([],be,Se)),Xe=-i.dot(Ue,se[ve[1]]);return Ue.concat(Xe)});return new ht(se,he)};var Ft=function(I,j){this.min=I,this.max=j,this.center=i.scale$2([],i.add([],this.min,this.max),.5)};Ft.prototype.quadrant=function(I){for(var j=[I%2==0,I<2],V=i.clone$2(this.min),X=i.clone$2(this.max),se=0;se=0;if(he===0)return 0;he!==j.length&&(V=!1)}if(V)return 2;for(var be=0;be<3;be++){for(var Se=Number.MAX_VALUE,Ue=-Number.MAX_VALUE,Xe=0;Xethis.max[be]-this.min[be])return 0}return 1};var ln=function(I,j,V,X){if(I===void 0&&(I=0),j===void 0&&(j=0),V===void 0&&(V=0),X===void 0&&(X=0),isNaN(I)||I<0||isNaN(j)||j<0||isNaN(V)||V<0||isNaN(X)||X<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=I,this.bottom=j,this.left=V,this.right=X};ln.prototype.interpolate=function(I,j,V){return j.top!=null&&I.top!=null&&(this.top=i.number(I.top,j.top,V)),j.bottom!=null&&I.bottom!=null&&(this.bottom=i.number(I.bottom,j.bottom,V)),j.left!=null&&I.left!=null&&(this.left=i.number(I.left,j.left,V)),j.right!=null&&I.right!=null&&(this.right=i.number(I.right,j.right,V)),this},ln.prototype.getCenter=function(I,j){var V=i.clamp((this.left+I-this.right)/2,0,I),X=i.clamp((this.top+j-this.bottom)/2,0,j);return new i.Point(V,X)},ln.prototype.equals=function(I){return this.top===I.top&&this.bottom===I.bottom&&this.left===I.left&&this.right===I.right},ln.prototype.clone=function(){return new ln(this.top,this.bottom,this.left,this.right)},ln.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var $t=function(I,j,V,X,se){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=se===void 0||se,this._minZoom=I||0,this._maxZoom=j||22,this._minPitch=V??0,this._maxPitch=X??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new i.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ln,this._posMatrixCache={},this._alignedPosMatrixCache={}},un={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}};$t.prototype.clone=function(){var I=new $t(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return I.tileSize=this.tileSize,I.latRange=this.latRange,I.width=this.width,I.height=this.height,I._center=this._center,I.zoom=this.zoom,I.angle=this.angle,I._fov=this._fov,I._pitch=this._pitch,I._unmodified=this._unmodified,I._edgeInsets=this._edgeInsets.clone(),I._calcMatrices(),I},un.minZoom.get=function(){return this._minZoom},un.minZoom.set=function(I){this._minZoom!==I&&(this._minZoom=I,this.zoom=Math.max(this.zoom,I))},un.maxZoom.get=function(){return this._maxZoom},un.maxZoom.set=function(I){this._maxZoom!==I&&(this._maxZoom=I,this.zoom=Math.min(this.zoom,I))},un.minPitch.get=function(){return this._minPitch},un.minPitch.set=function(I){this._minPitch!==I&&(this._minPitch=I,this.pitch=Math.max(this.pitch,I))},un.maxPitch.get=function(){return this._maxPitch},un.maxPitch.set=function(I){this._maxPitch!==I&&(this._maxPitch=I,this.pitch=Math.min(this.pitch,I))},un.renderWorldCopies.get=function(){return this._renderWorldCopies},un.renderWorldCopies.set=function(I){I===void 0?I=!0:I===null&&(I=!1),this._renderWorldCopies=I},un.worldSize.get=function(){return this.tileSize*this.scale},un.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},un.size.get=function(){return new i.Point(this.width,this.height)},un.bearing.get=function(){return-this.angle/Math.PI*180},un.bearing.set=function(I){var j=-i.wrap(I,-180,180)*Math.PI/180;this.angle!==j&&(this._unmodified=!1,this.angle=j,this._calcMatrices(),this.rotationMatrix=i.create$2(),i.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},un.pitch.get=function(){return this._pitch/Math.PI*180},un.pitch.set=function(I){var j=i.clamp(I,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==j&&(this._unmodified=!1,this._pitch=j,this._calcMatrices())},un.fov.get=function(){return this._fov/Math.PI*180},un.fov.set=function(I){I=Math.max(.01,Math.min(60,I)),this._fov!==I&&(this._unmodified=!1,this._fov=I/180*Math.PI,this._calcMatrices())},un.zoom.get=function(){return this._zoom},un.zoom.set=function(I){var j=Math.min(Math.max(I,this.minZoom),this.maxZoom);this._zoom!==j&&(this._unmodified=!1,this._zoom=j,this.scale=this.zoomScale(j),this.tileZoom=Math.floor(j),this.zoomFraction=j-this.tileZoom,this._constrain(),this._calcMatrices())},un.center.get=function(){return this._center},un.center.set=function(I){I.lat===this._center.lat&&I.lng===this._center.lng||(this._unmodified=!1,this._center=I,this._constrain(),this._calcMatrices())},un.padding.get=function(){return this._edgeInsets.toJSON()},un.padding.set=function(I){this._edgeInsets.equals(I)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,I,1),this._calcMatrices())},un.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},$t.prototype.isPaddingEqual=function(I){return this._edgeInsets.equals(I)},$t.prototype.interpolatePadding=function(I,j,V){this._unmodified=!1,this._edgeInsets.interpolate(I,j,V),this._constrain(),this._calcMatrices()},$t.prototype.coveringZoomLevel=function(I){var j=(I.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/I.tileSize));return Math.max(0,j)},$t.prototype.getVisibleUnwrappedCoordinates=function(I){var j=[new i.UnwrappedTileID(0,I)];if(this._renderWorldCopies)for(var V=this.pointCoordinate(new i.Point(0,0)),X=this.pointCoordinate(new i.Point(this.width,0)),se=this.pointCoordinate(new i.Point(this.width,this.height)),he=this.pointCoordinate(new i.Point(0,this.height)),ve=Math.floor(Math.min(V.x,X.x,se.x,he.x)),be=Math.floor(Math.max(V.x,X.x,se.x,he.x)),Se=ve-1;Se<=be+1;Se++)Se!==0&&j.push(new i.UnwrappedTileID(Se,I));return j},$t.prototype.coveringTiles=function(I){var j=this.coveringZoomLevel(I),V=j;if(I.minzoom!==void 0&&jI.maxzoom&&(j=I.maxzoom);var X=i.MercatorCoordinate.fromLngLat(this.center),se=Math.pow(2,j),he=[se*X.x,se*X.y,0],ve=ht.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,j),be=I.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(be=j);var Se=function(gr){return{aabb:new Ft([gr*se,0,0],[(gr+1)*se,se,0]),zoom:0,x:0,y:0,wrap:gr,fullyVisible:!1}},Ue=[],Xe=[],it=j,xt=I.reparseOverscaled?V:j;if(this._renderWorldCopies)for(var Lt=1;Lt<=3;Lt++)Ue.push(Se(-Lt)),Ue.push(Se(Lt));for(Ue.push(Se(0));Ue.length>0;){var _t=Ue.pop(),Mt=_t.x,yt=_t.y,Nt=_t.fullyVisible;if(!Nt){var Rt=_t.aabb.intersects(ve);if(Rt===0)continue;Nt=Rt===2}var qt=_t.aabb.distanceX(he),rn=_t.aabb.distanceY(he),dn=Math.max(Math.abs(qt),Math.abs(rn)),Sn=3+(1<Sn&&_t.zoom>=be)Xe.push({tileID:new i.OverscaledTileID(_t.zoom===it?xt:_t.zoom,_t.wrap,_t.zoom,Mt,yt),distanceSq:i.sqrLen([he[0]-.5-Mt,he[1]-.5-yt])});else for(var An=0;An<4;An++){var tr=(Mt<<1)+An%2,er=(yt<<1)+(An>>1);Ue.push({aabb:_t.aabb.quadrant(An),zoom:_t.zoom+1,x:tr,y:er,wrap:_t.wrap,fullyVisible:Nt})}}return Xe.sort(function(gr,cr){return gr.distanceSq-cr.distanceSq}).map(function(gr){return gr.tileID})},$t.prototype.resize=function(I,j){this.width=I,this.height=j,this.pixelsToGLUnits=[2/I,-2/j],this._constrain(),this._calcMatrices()},un.unmodified.get=function(){return this._unmodified},$t.prototype.zoomScale=function(I){return Math.pow(2,I)},$t.prototype.scaleZoom=function(I){return Math.log(I)/Math.LN2},$t.prototype.project=function(I){var j=i.clamp(I.lat,-this.maxValidLatitude,this.maxValidLatitude);return new i.Point(i.mercatorXfromLng(I.lng)*this.worldSize,i.mercatorYfromLat(j)*this.worldSize)},$t.prototype.unproject=function(I){return new i.MercatorCoordinate(I.x/this.worldSize,I.y/this.worldSize).toLngLat()},un.point.get=function(){return this.project(this.center)},$t.prototype.setLocationAtPoint=function(I,j){var V=this.pointCoordinate(j),X=this.pointCoordinate(this.centerPoint),se=this.locationCoordinate(I),he=new i.MercatorCoordinate(se.x-(V.x-X.x),se.y-(V.y-X.y));this.center=this.coordinateLocation(he),this._renderWorldCopies&&(this.center=this.center.wrap())},$t.prototype.locationPoint=function(I){return this.coordinatePoint(this.locationCoordinate(I))},$t.prototype.pointLocation=function(I){return this.coordinateLocation(this.pointCoordinate(I))},$t.prototype.locationCoordinate=function(I){return i.MercatorCoordinate.fromLngLat(I)},$t.prototype.coordinateLocation=function(I){return I.toLngLat()},$t.prototype.pointCoordinate=function(I){var j=[I.x,I.y,0,1],V=[I.x,I.y,1,1];i.transformMat4(j,j,this.pixelMatrixInverse),i.transformMat4(V,V,this.pixelMatrixInverse);var X=j[3],se=V[3],he=j[0]/X,ve=V[0]/se,be=j[1]/X,Se=V[1]/se,Ue=j[2]/X,Xe=V[2]/se,it=Ue===Xe?0:(0-Ue)/(Xe-Ue);return new i.MercatorCoordinate(i.number(he,ve,it)/this.worldSize,i.number(be,Se,it)/this.worldSize)},$t.prototype.coordinatePoint=function(I){var j=[I.x*this.worldSize,I.y*this.worldSize,0,1];return i.transformMat4(j,j,this.pixelMatrix),new i.Point(j[0]/j[3],j[1]/j[3])},$t.prototype.getBounds=function(){return new i.LngLatBounds().extend(this.pointLocation(new i.Point(0,0))).extend(this.pointLocation(new i.Point(this.width,0))).extend(this.pointLocation(new i.Point(this.width,this.height))).extend(this.pointLocation(new i.Point(0,this.height)))},$t.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new i.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},$t.prototype.setMaxBounds=function(I){I?(this.lngRange=[I.getWest(),I.getEast()],this.latRange=[I.getSouth(),I.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},$t.prototype.calculatePosMatrix=function(I,j){j===void 0&&(j=!1);var V=I.key,X=j?this._alignedPosMatrixCache:this._posMatrixCache;if(X[V])return X[V];var se=I.canonical,he=this.worldSize/this.zoomScale(se.z),ve=se.x+Math.pow(2,se.z)*I.wrap,be=i.identity(new Float64Array(16));return i.translate(be,be,[ve*he,se.y*he,0]),i.scale(be,be,[he/i.EXTENT,he/i.EXTENT,1]),i.multiply(be,j?this.alignedProjMatrix:this.projMatrix,be),X[V]=new Float32Array(be),X[V]},$t.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},$t.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var I,j,V,X,se=-90,he=90,ve=-180,be=180,Se=this.size,Ue=this._unmodified;if(this.latRange){var Xe=this.latRange;se=i.mercatorYfromLat(Xe[1])*this.worldSize,I=(he=i.mercatorYfromLat(Xe[0])*this.worldSize)-sehe&&(X=he-Mt)}if(this.lngRange){var yt=xt.x,Nt=Se.x/2;yt-Ntbe&&(V=be-Nt)}V===void 0&&X===void 0||(this.center=this.unproject(new i.Point(V!==void 0?V:xt.x,X!==void 0?X:xt.y))),this._unmodified=Ue,this._constraining=!1}},$t.prototype._calcMatrices=function(){if(this.height){var I=this._fov/2,j=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(I)*this.height;var V=Math.PI/2+this._pitch,X=this._fov*(.5+j.y/this.height),se=Math.sin(X)*this.cameraToCenterDistance/Math.sin(i.clamp(Math.PI-V-X,.01,Math.PI-.01)),he=this.point,ve=he.x,be=he.y,Se=1.01*(Math.cos(Math.PI/2-this._pitch)*se+this.cameraToCenterDistance),Ue=this.height/50,Xe=new Float64Array(16);i.perspective(Xe,this._fov,this.width/this.height,Ue,Se),Xe[8]=2*-j.x/this.width,Xe[9]=2*j.y/this.height,i.scale(Xe,Xe,[1,-1,1]),i.translate(Xe,Xe,[0,0,-this.cameraToCenterDistance]),i.rotateX(Xe,Xe,this._pitch),i.rotateZ(Xe,Xe,this.angle),i.translate(Xe,Xe,[-ve,-be,0]),this.mercatorMatrix=i.scale([],Xe,[this.worldSize,this.worldSize,this.worldSize]),i.scale(Xe,Xe,[1,1,i.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Xe,this.invProjMatrix=i.invert([],this.projMatrix);var it=this.width%2/2,xt=this.height%2/2,Lt=Math.cos(this.angle),_t=Math.sin(this.angle),Mt=ve-Math.round(ve)+Lt*it+_t*xt,yt=be-Math.round(be)+Lt*xt+_t*it,Nt=new Float64Array(Xe);if(i.translate(Nt,Nt,[Mt>.5?Mt-1:Mt,yt>.5?yt-1:yt,0]),this.alignedProjMatrix=Nt,Xe=i.create(),i.scale(Xe,Xe,[this.width/2,-this.height/2,1]),i.translate(Xe,Xe,[1,-1,0]),this.labelPlaneMatrix=Xe,Xe=i.create(),i.scale(Xe,Xe,[1,-1,1]),i.translate(Xe,Xe,[-1,-1,0]),i.scale(Xe,Xe,[2/this.width,2/this.height,1]),this.glCoordMatrix=Xe,this.pixelMatrix=i.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(Xe=i.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=Xe,this._posMatrixCache={},this._alignedPosMatrixCache={}}},$t.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var I=this.pointCoordinate(new i.Point(0,0)),j=[I.x*this.worldSize,I.y*this.worldSize,0,1];return i.transformMat4(j,j,this.pixelMatrix)[3]/this.cameraToCenterDistance},$t.prototype.getCameraPoint=function(){var I=this._pitch,j=Math.tan(I)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new i.Point(0,j))},$t.prototype.getCameraQueryGeometry=function(I){var j=this.getCameraPoint();if(I.length===1)return[I[0],j];for(var V=j.x,X=j.y,se=j.x,he=j.y,ve=0,be=I;ve=3&&!I.some(function(V){return isNaN(V)})){var j=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(I[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+I[2],+I[1]],zoom:+I[0],bearing:j,pitch:+(I[4]||0)}),!0}return!1},On.prototype._updateHashUnthrottled=function(){var I=this.getHashString();try{i.window.history.replaceState(i.window.history.state,"",I)}catch{}};var Fn={linearity:.3,easing:i.bezier(0,0,.3,1)},Jn=i.extend({deceleration:2500,maxSpeed:1400},Fn),fr=i.extend({deceleration:20,maxSpeed:1400},Fn),ur=i.extend({deceleration:1e3,maxSpeed:360},Fn),yr=i.extend({deceleration:1e3,maxSpeed:90},Fn),Tr=function(I){this._map=I,this.clear()};function hr(I,j){(!I.duration||I.duration0&&j-I[0].time>160;)I.shift()},Tr.prototype._onMoveEnd=function(I){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var j={zoom:0,bearing:0,pitch:0,pan:new i.Point(0,0),pinchAround:void 0,around:void 0},V=0,X=this._inertiaBuffer;V=this._clickTolerance||this._map.fire(new Ur(I.type,this._map,I))},Qn.prototype.dblclick=function(I){return this._firePreventable(new Ur(I.type,this._map,I))},Qn.prototype.mouseover=function(I){this._map.fire(new Ur(I.type,this._map,I))},Qn.prototype.mouseout=function(I){this._map.fire(new Ur(I.type,this._map,I))},Qn.prototype.touchstart=function(I){return this._firePreventable(new Zr(I.type,this._map,I))},Qn.prototype.touchmove=function(I){this._map.fire(new Zr(I.type,this._map,I))},Qn.prototype.touchend=function(I){this._map.fire(new Zr(I.type,this._map,I))},Qn.prototype.touchcancel=function(I){this._map.fire(new Zr(I.type,this._map,I))},Qn.prototype._firePreventable=function(I){if(this._map.fire(I),I.defaultPrevented)return{}},Qn.prototype.isEnabled=function(){return!0},Qn.prototype.isActive=function(){return!1},Qn.prototype.enable=function(){},Qn.prototype.disable=function(){};var di=function(I){this._map=I};di.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},di.prototype.mousemove=function(I){this._map.fire(new Ur(I.type,this._map,I))},di.prototype.mousedown=function(){this._delayContextMenu=!0},di.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ur("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},di.prototype.contextmenu=function(I){this._delayContextMenu?this._contextMenuEvent=I:this._map.fire(new Ur(I.type,this._map,I)),this._map.listens("contextmenu")&&I.preventDefault()},di.prototype.isEnabled=function(){return!0},di.prototype.isActive=function(){return!1},di.prototype.enable=function(){},di.prototype.disable=function(){};var Rr=function(I,j){this._map=I,this._el=I.getCanvasContainer(),this._container=I.getContainer(),this._clickTolerance=j.clickTolerance||1};function Gr(I,j){for(var V={},X=0;Xthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=I.timeStamp),V.length===this.numTouches&&(this.centroid=function(X){for(var se=new i.Point(0,0),he=0,ve=X;he30)&&(this.aborted=!0)}}},fi.prototype.touchend=function(I,j,V){if((!this.centroid||I.timeStamp-this.startTime>500)&&(this.aborted=!0),V.length===0){var X=!this.aborted&&this.centroid;if(this.reset(),X)return X}};var Ni=function(I){this.singleTap=new fi(I),this.numTaps=I.numTaps,this.reset()};Ni.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ni.prototype.touchstart=function(I,j,V){this.singleTap.touchstart(I,j,V)},Ni.prototype.touchmove=function(I,j,V){this.singleTap.touchmove(I,j,V)},Ni.prototype.touchend=function(I,j,V){var X=this.singleTap.touchend(I,j,V);if(X){var se=I.timeStamp-this.lastTime<500,he=!this.lastTap||this.lastTap.dist(X)<30;if(se&&he||this.reset(),this.count++,this.lastTime=I.timeStamp,this.lastTap=X,this.count===this.numTaps)return this.reset(),X}};var Ki=function(){this._zoomIn=new Ni({numTouches:1,numTaps:2}),this._zoomOut=new Ni({numTouches:2,numTaps:1}),this.reset()};Ki.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Ki.prototype.touchstart=function(I,j,V){this._zoomIn.touchstart(I,j,V),this._zoomOut.touchstart(I,j,V)},Ki.prototype.touchmove=function(I,j,V){this._zoomIn.touchmove(I,j,V),this._zoomOut.touchmove(I,j,V)},Ki.prototype.touchend=function(I,j,V){var X=this,se=this._zoomIn.touchend(I,j,V),he=this._zoomOut.touchend(I,j,V);return se?(this._active=!0,I.preventDefault(),setTimeout(function(){return X.reset()},0),{cameraAnimation:function(ve){return ve.easeTo({duration:300,zoom:ve.getZoom()+1,around:ve.unproject(se)},{originalEvent:I})}}):he?(this._active=!0,I.preventDefault(),setTimeout(function(){return X.reset()},0),{cameraAnimation:function(ve){return ve.easeTo({duration:300,zoom:ve.getZoom()-1,around:ve.unproject(he)},{originalEvent:I})}}):void 0},Ki.prototype.touchcancel=function(){this.reset()},Ki.prototype.enable=function(){this._enabled=!0},Ki.prototype.disable=function(){this._enabled=!1,this.reset()},Ki.prototype.isEnabled=function(){return this._enabled},Ki.prototype.isActive=function(){return this._active};var Lr=function(I){this.reset(),this._clickTolerance=I.clickTolerance||1};Lr.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Lr.prototype._correctButton=function(I,j){return!1},Lr.prototype._move=function(I,j){return{}},Lr.prototype.mousedown=function(I,j){if(!this._lastPoint){var V=l.mouseButton(I);this._correctButton(I,V)&&(this._lastPoint=j,this._eventButton=V)}},Lr.prototype.mousemoveWindow=function(I,j){var V=this._lastPoint;if(V&&(I.preventDefault(),this._moved||!(j.dist(V)0&&(this._active=!0);var X=Gr(V,j),se=new i.Point(0,0),he=new i.Point(0,0),ve=0;for(var be in X){var Se=X[be],Ue=this._touches[be];Ue&&(se._add(Se),he._add(Se.sub(Ue)),ve++,X[be]=Se)}if(this._touches=X,!(veMath.abs(I.x)}var ks=function(I){function j(){I.apply(this,arguments)}return I&&(j.__proto__=I),j.prototype=Object.create(I&&I.prototype),j.prototype.constructor=j,j.prototype.reset=function(){I.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},j.prototype._start=function(V){this._lastPoints=V,Zs(V[0].sub(V[1]))&&(this._valid=!1)},j.prototype._move=function(V,X,se){var he=V[0].sub(this._lastPoints[0]),ve=V[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(he,ve,se.timeStamp),this._valid)return this._lastPoints=V,this._active=!0,{pitchDelta:-.5*((he.y+ve.y)/2)}},j.prototype.gestureBeginsVertically=function(V,X,se){if(this._valid!==void 0)return this._valid;var he=V.mag()>=2,ve=X.mag()>=2;if(he||ve){if(!he||!ve)return this._firstMove===void 0&&(this._firstMove=se),se-this._firstMove<100&&void 0;var be=V.y>0==X.y>0;return Zs(V)&&Zs(X)&&be}},j}(Wi),Pi={panStep:100,bearingStep:15,pitchStep:10},Qa=function(){var I=Pi;this._panStep=I.panStep,this._bearingStep=I.bearingStep,this._pitchStep=I.pitchStep};function Ts(I){return I*(2-I)}Qa.prototype.reset=function(){this._active=!1},Qa.prototype.keydown=function(I){var j=this;if(!(I.altKey||I.ctrlKey||I.metaKey)){var V=0,X=0,se=0,he=0,ve=0;switch(I.keyCode){case 61:case 107:case 171:case 187:V=1;break;case 189:case 109:case 173:V=-1;break;case 37:I.shiftKey?X=-1:(I.preventDefault(),he=-1);break;case 39:I.shiftKey?X=1:(I.preventDefault(),he=1);break;case 38:I.shiftKey?se=1:(I.preventDefault(),ve=-1);break;case 40:I.shiftKey?se=-1:(I.preventDefault(),ve=1);break;default:return}return{cameraAnimation:function(be){var Se=be.getZoom();be.easeTo({duration:300,easeId:"keyboardHandler",easing:Ts,zoom:V?Math.round(Se)+V*(I.shiftKey?2:1):Se,bearing:be.getBearing()+X*j._bearingStep,pitch:be.getPitch()+se*j._pitchStep,offset:[-he*j._panStep,-ve*j._panStep],center:be.getCenter()},{originalEvent:I})}}}},Qa.prototype.enable=function(){this._enabled=!0},Qa.prototype.disable=function(){this._enabled=!1,this.reset()},Qa.prototype.isEnabled=function(){return this._enabled},Qa.prototype.isActive=function(){return this._active};var wa=function(I,j){this._map=I,this._el=I.getCanvasContainer(),this._handler=j,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,i.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};wa.prototype.setZoomRate=function(I){this._defaultZoomRate=I},wa.prototype.setWheelZoomRate=function(I){this._wheelZoomRate=I},wa.prototype.isEnabled=function(){return!!this._enabled},wa.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},wa.prototype.isZooming=function(){return!!this._zooming},wa.prototype.enable=function(I){this.isEnabled()||(this._enabled=!0,this._aroundCenter=I&&I.around==="center")},wa.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},wa.prototype.wheel=function(I){if(this.isEnabled()){var j=I.deltaMode===i.window.WheelEvent.DOM_DELTA_LINE?40*I.deltaY:I.deltaY,V=i.browser.now(),X=V-(this._lastWheelEventTime||0);this._lastWheelEventTime=V,j!==0&&j%4.000244140625==0?this._type="wheel":j!==0&&Math.abs(j)<4?this._type="trackpad":X>400?(this._type=null,this._lastValue=j,this._timeout=setTimeout(this._onTimeout,40,I)):this._type||(this._type=Math.abs(X*j)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,j+=this._lastValue)),I.shiftKey&&j&&(j/=4),this._type&&(this._lastWheelEvent=I,this._delta-=j,this._active||this._start(I)),I.preventDefault()}},wa.prototype._onTimeout=function(I){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(I)},wa.prototype._start=function(I){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 j=l.mousePos(this._el,I);this._around=i.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(j)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},wa.prototype.renderFrame=function(){return this._onScrollFrame()},wa.prototype._onScrollFrame=function(){var I=this;if(this._frameId&&(this._frameId=null,this.isActive())){var j=this._map.transform;if(this._delta!==0){var V=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,X=2/(1+Math.exp(-Math.abs(this._delta*V)));this._delta<0&&X!==0&&(X=1/X);var se=typeof this._targetZoom=="number"?j.zoomScale(this._targetZoom):j.scale;this._targetZoom=Math.min(j.maxZoom,Math.max(j.minZoom,j.scaleZoom(se*X))),this._type==="wheel"&&(this._startZoom=j.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var he,ve=typeof this._targetZoom=="number"?this._targetZoom:j.zoom,be=this._startZoom,Se=this._easing,Ue=!1;if(this._type==="wheel"&&be&&Se){var Xe=Math.min((i.browser.now()-this._lastWheelEventTime)/200,1),it=Se(Xe);he=i.number(be,ve,it),Xe<1?this._frameId||(this._frameId=!0):Ue=!0}else he=ve,Ue=!0;return this._active=!0,Ue&&(this._active=!1,this._finishTimeout=setTimeout(function(){I._zooming=!1,I._handler._triggerRenderFrame(),delete I._targetZoom,delete I._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Ue,zoomDelta:he-j.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},wa.prototype._smoothOutEasing=function(I){var j=i.ease;if(this._prevEase){var V=this._prevEase,X=(i.browser.now()-V.start)/V.duration,se=V.easing(X+.01)-V.easing(X),he=.27/Math.sqrt(se*se+1e-4)*.01,ve=Math.sqrt(.0729-he*he);j=i.bezier(he,ve,.25,1)}return this._prevEase={start:i.browser.now(),duration:I,easing:j},j},wa.prototype.reset=function(){this._active=!1};var uo=function(I,j){this._clickZoom=I,this._tapZoom=j};uo.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},uo.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},uo.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},uo.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var jo=function(){this.reset()};jo.prototype.reset=function(){this._active=!1},jo.prototype.dblclick=function(I,j){return I.preventDefault(),{cameraAnimation:function(V){V.easeTo({duration:300,zoom:V.getZoom()+(I.shiftKey?-1:1),around:V.unproject(j)},{originalEvent:I})}}},jo.prototype.enable=function(){this._enabled=!0},jo.prototype.disable=function(){this._enabled=!1,this.reset()},jo.prototype.isEnabled=function(){return this._enabled},jo.prototype.isActive=function(){return this._active};var La=function(){this._tap=new Ni({numTouches:1,numTaps:1}),this.reset()};La.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},La.prototype.touchstart=function(I,j,V){this._swipePoint||(this._tapTime&&I.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?V.length>0&&(this._swipePoint=j[0],this._swipeTouch=V[0].identifier):this._tap.touchstart(I,j,V))},La.prototype.touchmove=function(I,j,V){if(this._tapTime){if(this._swipePoint){if(V[0].identifier!==this._swipeTouch)return;var X=j[0],se=X.y-this._swipePoint.y;return this._swipePoint=X,I.preventDefault(),this._active=!0,{zoomDelta:se/128}}}else this._tap.touchmove(I,j,V)},La.prototype.touchend=function(I,j,V){this._tapTime?this._swipePoint&&V.length===0&&this.reset():this._tap.touchend(I,j,V)&&(this._tapTime=I.timeStamp)},La.prototype.touchcancel=function(){this.reset()},La.prototype.enable=function(){this._enabled=!0},La.prototype.disable=function(){this._enabled=!1,this.reset()},La.prototype.isEnabled=function(){return this._enabled},La.prototype.isActive=function(){return this._active};var ps=function(I,j,V){this._el=I,this._mousePan=j,this._touchPan=V};ps.prototype.enable=function(I){this._inertiaOptions=I||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ps.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ps.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ps.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Pa=function(I,j,V){this._pitchWithRotate=I.pitchWithRotate,this._mouseRotate=j,this._mousePitch=V};Pa.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Pa.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Pa.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Pa.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var ns=function(I,j,V,X){this._el=I,this._touchZoom=j,this._touchRotate=V,this._tapDragZoom=X,this._rotationDisabled=!1,this._enabled=!0};ns.prototype.enable=function(I){this._touchZoom.enable(I),this._rotationDisabled||this._touchRotate.enable(I),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},ns.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},ns.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},ns.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},ns.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},ns.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var vu=function(I){return I.zoom||I.drag||I.pitch||I.rotate},Xl=function(I){function j(){I.apply(this,arguments)}return I&&(j.__proto__=I),j.prototype=Object.create(I&&I.prototype),j.prototype.constructor=j,j}(i.Event);function _f(I){return I.panDelta&&I.panDelta.mag()||I.zoomDelta||I.bearingDelta||I.pitchDelta}var Mo=function(I,j){this._map=I,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Tr(I),this._bearingSnap=j.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(j),i.bindAll(["handleEvent","handleWindowEvent"],this);var V=this._el;this._listeners=[[V,"touchstart",{passive:!1}],[V,"touchmove",{passive:!1}],[V,"touchend",void 0],[V,"touchcancel",void 0],[V,"mousedown",void 0],[V,"mousemove",void 0],[V,"mouseup",void 0],[i.window.document,"mousemove",{capture:!0}],[i.window.document,"mouseup",void 0],[V,"mouseover",void 0],[V,"mouseout",void 0],[V,"dblclick",void 0],[V,"click",void 0],[V,"keydown",{capture:!1}],[V,"keyup",void 0],[V,"wheel",{passive:!1}],[V,"contextmenu",void 0],[i.window,"blur",void 0]];for(var X=0,se=this._listeners;Xve?Math.min(2,Sn):Math.max(.5,Sn),cr=Math.pow(gr,1-tr),Yr=he.unproject(rn.add(dn.mult(tr*cr)).mult(er));he.setLocationAtPoint(he.renderWorldCopies?Yr.wrap():Yr,Mt)}se._fireMoveEvents(X)},function(tr){se._afterEase(X,tr)},V),this},j.prototype._prepareEase=function(V,X,se){se===void 0&&(se={}),this._moving=!0,X||se.moving||this.fire(new i.Event("movestart",V)),this._zooming&&!se.zooming&&this.fire(new i.Event("zoomstart",V)),this._rotating&&!se.rotating&&this.fire(new i.Event("rotatestart",V)),this._pitching&&!se.pitching&&this.fire(new i.Event("pitchstart",V))},j.prototype._fireMoveEvents=function(V){this.fire(new i.Event("move",V)),this._zooming&&this.fire(new i.Event("zoom",V)),this._rotating&&this.fire(new i.Event("rotate",V)),this._pitching&&this.fire(new i.Event("pitch",V))},j.prototype._afterEase=function(V,X){if(!this._easeId||!X||this._easeId!==X){delete this._easeId;var se=this._zooming,he=this._rotating,ve=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,se&&this.fire(new i.Event("zoomend",V)),he&&this.fire(new i.Event("rotateend",V)),ve&&this.fire(new i.Event("pitchend",V)),this.fire(new i.Event("moveend",V))}},j.prototype.flyTo=function(V,X){var se=this;if(!V.essential&&i.browser.prefersReducedMotion){var he=i.pick(V,["center","zoom","bearing","pitch","around"]);return this.jumpTo(he,X)}this.stop(),V=i.extend({offset:[0,0],speed:1.2,curve:1.42,easing:i.ease},V);var ve=this.transform,be=this.getZoom(),Se=this.getBearing(),Ue=this.getPitch(),Xe=this.getPadding(),it="zoom"in V?i.clamp(+V.zoom,ve.minZoom,ve.maxZoom):be,xt="bearing"in V?this._normalizeBearing(V.bearing,Se):Se,Lt="pitch"in V?+V.pitch:Ue,_t="padding"in V?V.padding:ve.padding,Mt=ve.zoomScale(it-be),yt=i.Point.convert(V.offset),Nt=ve.centerPoint.add(yt),Rt=ve.pointLocation(Nt),qt=i.LngLat.convert(V.center||Rt);this._normalizeCenter(qt);var rn=ve.project(Rt),dn=ve.project(qt).sub(rn),Sn=V.curve,An=Math.max(ve.width,ve.height),tr=An/Mt,er=dn.mag();if("minZoom"in V){var gr=i.clamp(Math.min(V.minZoom,be,it),ve.minZoom,ve.maxZoom),cr=An/ve.zoomScale(gr-be);Sn=Math.sqrt(cr/er*2)}var Yr=Sn*Sn;function ii(ci){var zi=(tr*tr-An*An+(ci?-1:1)*Yr*Yr*er*er)/(2*(ci?tr:An)*Yr*er);return Math.log(Math.sqrt(zi*zi+1)-zi)}function Ti(ci){return(Math.exp(ci)-Math.exp(-ci))/2}function Gn(ci){return(Math.exp(ci)+Math.exp(-ci))/2}var Mr=ii(0),ai=function(ci){return Gn(Mr)/Gn(Mr+Sn*ci)},Qr=function(ci){return An*((Gn(Mr)*(Ti(zi=Mr+Sn*ci)/Gn(zi))-Ti(Mr))/Yr)/er;var zi},gi=(ii(1)-Mr)/Sn;if(Math.abs(er)<1e-6||!isFinite(gi)){if(Math.abs(An-tr)<1e-6)return this.easeTo(V,X);var Mi=trV.maxDuration&&(V.duration=0),this._zooming=!0,this._rotating=Se!==xt,this._pitching=Lt!==Ue,this._padding=!ve.isPaddingEqual(_t),this._prepareEase(X,!1),this._ease(function(ci){var zi=ci*gi,Li=1/ai(zi);ve.zoom=ci===1?it:be+ve.scaleZoom(Li),se._rotating&&(ve.bearing=i.number(Se,xt,ci)),se._pitching&&(ve.pitch=i.number(Ue,Lt,ci)),se._padding&&(ve.interpolatePadding(Xe,_t,ci),Nt=ve.centerPoint.add(yt));var Qi=ci===1?qt:ve.unproject(rn.add(dn.mult(Qr(zi))).mult(Li));ve.setLocationAtPoint(ve.renderWorldCopies?Qi.wrap():Qi,Nt),se._fireMoveEvents(X)},function(){return se._afterEase(X)},V),this},j.prototype.isEasing=function(){return!!this._easeFrameId},j.prototype.stop=function(){return this._stop()},j.prototype._stop=function(V,X){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var se=this._onEaseEnd;delete this._onEaseEnd,se.call(this,X)}if(!V){var he=this.handlers;he&&he.stop()}return this},j.prototype._ease=function(V,X,se){se.animate===!1||se.duration===0?(V(1),X()):(this._easeStart=i.browser.now(),this._easeOptions=se,this._onEaseFrame=V,this._onEaseEnd=X,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},j.prototype._renderFrameCallback=function(){var V=Math.min((i.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(V)),V<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},j.prototype._normalizeBearing=function(V,X){V=i.wrap(V,-180,180);var se=Math.abs(V-X);return Math.abs(V-360-X)180?-360:se<-180?360:0}},j}(i.Evented),So=function(I){I===void 0&&(I={}),this.options=I,i.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};So.prototype.getDefaultPosition=function(){return"bottom-right"},So.prototype.onAdd=function(I){var j=this.options&&this.options.compact;return this._map=I,this._container=l.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=l.create("div","mapboxgl-ctrl-attrib-inner",this._container),j&&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),j===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},So.prototype.onRemove=function(){l.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},So.prototype._updateEditLink=function(){var I=this._editLink;I||(I=this._editLink=this._container.querySelector(".mapbox-improve-map"));var j=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||i.config.ACCESS_TOKEN}];if(I){var V=j.reduce(function(X,se,he){return se.value&&(X+=se.key+"="+se.value+(he=0)return!1;return!0})).join(" | ");ve!==this._attribHTML&&(this._attribHTML=ve,I.length?(this._innerContainer.innerHTML=ve,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},So.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Zl=function(){i.bindAll(["_updateLogo"],this),i.bindAll(["_updateCompact"],this)};Zl.prototype.onAdd=function(I){this._map=I,this._container=l.create("div","mapboxgl-ctrl");var j=l.create("a","mapboxgl-ctrl-logo");return j.target="_blank",j.rel="noopener nofollow",j.href="https://www.mapbox.com/",j.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),j.setAttribute("rel","noopener nofollow"),this._container.appendChild(j),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Zl.prototype.onRemove=function(){l.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Zl.prototype.getDefaultPosition=function(){return"bottom-left"},Zl.prototype._updateLogo=function(I){I&&I.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},Zl.prototype._logoRequired=function(){if(this._map.style){var I=this._map.style.sourceCaches;for(var j in I)if(I[j].getSource().mapbox_logo)return!0;return!1}},Zl.prototype._updateCompact=function(){var I=this._container.children;if(I.length){var j=I[0];this._map.getCanvasContainer().offsetWidth<250?j.classList.add("mapboxgl-compact"):j.classList.remove("mapboxgl-compact")}};var wi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wi.prototype.add=function(I){var j=++this._id;return this._queue.push({callback:I,id:j,cancelled:!1}),j},wi.prototype.remove=function(I){for(var j=this._currentlyRunning,V=0,X=j?this._queue.concat(j):this._queue;VX.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(X.minPitch!=null&&X.maxPitch!=null&&X.minPitch>X.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(X.minPitch!=null&&X.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(X.maxPitch!=null&&X.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var he=new $t(X.minZoom,X.maxZoom,X.minPitch,X.maxPitch,X.renderWorldCopies);if(I.call(this,he,X),this._interactive=X.interactive,this._maxTileCacheSize=X.maxTileCacheSize,this._failIfMajorPerformanceCaveat=X.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=X.preserveDrawingBuffer,this._antialias=X.antialias,this._trackResize=X.trackResize,this._bearingSnap=X.bearingSnap,this._refreshExpiredTiles=X.refreshExpiredTiles,this._fadeDuration=X.fadeDuration,this._crossSourceCollisions=X.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=X.collectResourceTiming,this._renderTaskQueue=new wi,this._controls=[],this._mapId=i.uniqueId(),this._locale=i.extend({},Di,X.locale),this._requestManager=new i.RequestManager(X.transformRequest,X.accessToken),typeof X.container=="string"){if(this._container=i.window.document.getElementById(X.container),!this._container)throw new Error("Container '"+X.container+"' not found.")}else{if(!(X.container instanceof Tf))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=X.container}if(X.maxBounds&&this.setMaxBounds(X.maxBounds),i.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return se._update(!1)}),this.on("moveend",function(){return se._update(!1)}),this.on("zoom",function(){return se._update(!0)}),i.window!==void 0&&(i.window.addEventListener("online",this._onWindowOnline,!1),i.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new Mo(this,X);var ve=typeof X.hash=="string"&&X.hash||void 0;this._hash=X.hash&&new On(ve).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:X.center,zoom:X.zoom,bearing:X.bearing,pitch:X.pitch}),X.bounds&&(this.resize(),this.fitBounds(X.bounds,i.extend({},X.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=X.localIdeographFontFamily,X.style&&this.setStyle(X.style,{localIdeographFontFamily:X.localIdeographFontFamily}),X.attributionControl&&this.addControl(new So({customAttribution:X.customAttribution})),this.addControl(new Zl,X.logoPosition),this.on("style.load",function(){se.transform.unmodified&&se.jumpTo(se.style.stylesheet)}),this.on("data",function(be){se._update(be.dataType==="style"),se.fire(new i.Event(be.dataType+"data",be))}),this.on("dataloading",function(be){se.fire(new i.Event(be.dataType+"dataloading",be))})}I&&(j.__proto__=I),j.prototype=Object.create(I&&I.prototype),j.prototype.constructor=j;var V={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return j.prototype._getMapId=function(){return this._mapId},j.prototype.addControl=function(X,se){if(se===void 0&&X.getDefaultPosition&&(se=X.getDefaultPosition()),se===void 0&&(se="top-right"),!X||!X.onAdd)return this.fire(new i.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var he=X.onAdd(this);this._controls.push(X);var ve=this._controlPositions[se];return se.indexOf("bottom")!==-1?ve.insertBefore(he,ve.firstChild):ve.appendChild(he),this},j.prototype.removeControl=function(X){if(!X||!X.onRemove)return this.fire(new i.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var se=this._controls.indexOf(X);return se>-1&&this._controls.splice(se,1),X.onRemove(this),this},j.prototype.resize=function(X){var se=this._containerDimensions(),he=se[0],ve=se[1];this._resizeCanvas(he,ve),this.transform.resize(he,ve),this.painter.resize(he,ve);var be=!this._moving;return be&&(this.stop(),this.fire(new i.Event("movestart",X)).fire(new i.Event("move",X))),this.fire(new i.Event("resize",X)),be&&this.fire(new i.Event("moveend",X)),this},j.prototype.getBounds=function(){return this.transform.getBounds()},j.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},j.prototype.setMaxBounds=function(X){return this.transform.setMaxBounds(i.LngLatBounds.convert(X)),this._update()},j.prototype.setMinZoom=function(X){if((X=X??-2)>=-2&&X<=this.transform.maxZoom)return this.transform.minZoom=X,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=X,this._update(),this.getZoom()>X&&this.setZoom(X),this;throw new Error("maxZoom must be greater than the current minZoom")},j.prototype.getMaxZoom=function(){return this.transform.maxZoom},j.prototype.setMinPitch=function(X){if((X=X??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(X>=0&&X<=this.transform.maxPitch)return this.transform.minPitch=X,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(X>=this.transform.minPitch)return this.transform.maxPitch=X,this._update(),this.getPitch()>X&&this.setPitch(X),this;throw new Error("maxPitch must be greater than the current minPitch")},j.prototype.getMaxPitch=function(){return this.transform.maxPitch},j.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},j.prototype.setRenderWorldCopies=function(X){return this.transform.renderWorldCopies=X,this._update()},j.prototype.project=function(X){return this.transform.locationPoint(i.LngLat.convert(X))},j.prototype.unproject=function(X){return this.transform.pointLocation(i.Point.convert(X))},j.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},j.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},j.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},j.prototype._createDelegatedListener=function(X,se,he){var ve,be=this;if(X==="mouseenter"||X==="mouseover"){var Se=!1;return{layer:se,listener:he,delegates:{mousemove:function(Xe){var it=be.getLayer(se)?be.queryRenderedFeatures(Xe.point,{layers:[se]}):[];it.length?Se||(Se=!0,he.call(be,new Ur(X,be,Xe.originalEvent,{features:it}))):Se=!1},mouseout:function(){Se=!1}}}}if(X==="mouseleave"||X==="mouseout"){var Ue=!1;return{layer:se,listener:he,delegates:{mousemove:function(Xe){(be.getLayer(se)?be.queryRenderedFeatures(Xe.point,{layers:[se]}):[]).length?Ue=!0:Ue&&(Ue=!1,he.call(be,new Ur(X,be,Xe.originalEvent)))},mouseout:function(Xe){Ue&&(Ue=!1,he.call(be,new Ur(X,be,Xe.originalEvent)))}}}}return{layer:se,listener:he,delegates:(ve={},ve[X]=function(Xe){var it=be.getLayer(se)?be.queryRenderedFeatures(Xe.point,{layers:[se]}):[];it.length&&(Xe.features=it,he.call(be,Xe),delete Xe.features)},ve)}},j.prototype.on=function(X,se,he){if(he===void 0)return I.prototype.on.call(this,X,se);var ve=this._createDelegatedListener(X,se,he);for(var be in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[X]=this._delegatedListeners[X]||[],this._delegatedListeners[X].push(ve),ve.delegates)this.on(be,ve.delegates[be]);return this},j.prototype.once=function(X,se,he){if(he===void 0)return I.prototype.once.call(this,X,se);var ve=this._createDelegatedListener(X,se,he);for(var be in ve.delegates)this.once(be,ve.delegates[be]);return this},j.prototype.off=function(X,se,he){var ve=this;return he===void 0?I.prototype.off.call(this,X,se):(this._delegatedListeners&&this._delegatedListeners[X]&&function(be){for(var Se=be[X],Ue=0;Ue180;){var ve=V.locationPoint(I);if(ve.x>=0&&ve.y>=0&&ve.x<=V.width&&ve.y<=V.height)break;I.lng>V.center.lng?I.lng-=360:I.lng+=360}return I}Da.prototype.down=function(I,j){this.mouseRotate.mousedown(I,j),this.mousePitch&&this.mousePitch.mousedown(I,j),l.disableDrag()},Da.prototype.move=function(I,j){var V=this.map,X=this.mouseRotate.mousemoveWindow(I,j);if(X&&X.bearingDelta&&V.setBearing(V.getBearing()+X.bearingDelta),this.mousePitch){var se=this.mousePitch.mousemoveWindow(I,j);se&&se.pitchDelta&&V.setPitch(V.getPitch()+se.pitchDelta)}},Da.prototype.off=function(){var I=this.element;l.removeEventListener(I,"mousedown",this.mousedown),l.removeEventListener(I,"touchstart",this.touchstart,{passive:!1}),l.removeEventListener(I,"touchmove",this.touchmove),l.removeEventListener(I,"touchend",this.touchend),l.removeEventListener(I,"touchcancel",this.reset),this.offTemp()},Da.prototype.offTemp=function(){l.enableDrag(),l.removeEventListener(i.window,"mousemove",this.mousemove),l.removeEventListener(i.window,"mouseup",this.mouseup)},Da.prototype.mousedown=function(I){this.down(i.extend({},I,{ctrlKey:!0,preventDefault:function(){return I.preventDefault()}}),l.mousePos(this.element,I)),l.addEventListener(i.window,"mousemove",this.mousemove),l.addEventListener(i.window,"mouseup",this.mouseup)},Da.prototype.mousemove=function(I){this.move(I,l.mousePos(this.element,I))},Da.prototype.mouseup=function(I){this.mouseRotate.mouseupWindow(I),this.mousePitch&&this.mousePitch.mouseupWindow(I),this.offTemp()},Da.prototype.touchstart=function(I){I.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=l.touchPos(this.element,I.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return I.preventDefault()}},this._startPos))},Da.prototype.touchmove=function(I){I.targetTouches.length!==1?this.reset():(this._lastPos=l.touchPos(this.element,I.targetTouches)[0],this.move({preventDefault:function(){return I.preventDefault()}},this._lastPos))},Da.prototype.touchend=function(I){I.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)X.getEast()||se.latitudeX.getNorth())},j.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")}},j.prototype._onSuccess=function(V){if(this._map){if(this._isOutOfMapMaxBounds(V))return this._setErrorState(),this.fire(new i.Event("outofmaxbounds",V)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=V,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&&this._watchState!=="OFF"&&this._updateMarker(V),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(V),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new i.Event("geolocate",V)),this._finish()}},j.prototype._updateCamera=function(V){var X=new i.LngLat(V.coords.longitude,V.coords.latitude),se=V.coords.accuracy,he=this._map.getBearing(),ve=i.extend({bearing:he},this.options.fitBoundsOptions);this._map.fitBounds(X.toBounds(se),ve,{geolocateSource:!0})},j.prototype._updateMarker=function(V){if(V){var X=new i.LngLat(V.coords.longitude,V.coords.latitude);this._accuracyCircleMarker.setLngLat(X).addTo(this._map),this._userLocationDotMarker.setLngLat(X).addTo(this._map),this._accuracy=V.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},j.prototype._updateCircleRadius=function(){var V=this._map._container.clientHeight/2,X=this._map.unproject([0,V]),se=this._map.unproject([1,V]),he=X.distanceTo(se),ve=Math.ceil(2*this._accuracy/he);this._circleElement.style.width=ve+"px",this._circleElement.style.height=ve+"px"},j.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},j.prototype._onError=function(V){if(this._map){if(this.options.trackUserLocation)if(V.code===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._geolocateButton.disabled=!0;var X=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=X,this._geolocateButton.setAttribute("aria-label",X),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(V.code===3&&xu)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new i.Event("error",V)),this._finish()}},j.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},j.prototype._setupUI=function(V){var X=this;if(this._container.addEventListener("contextmenu",function(ve){return ve.preventDefault()}),this._geolocateButton=l.create("button","mapboxgl-ctrl-geolocate",this._container),l.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",V===!1){i.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var se=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=se,this._geolocateButton.setAttribute("aria-label",se)}else{var he=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=he,this._geolocateButton.setAttribute("aria-label",he)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=l.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Lc(this._dotElement),this._circleElement=l.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Lc({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(ve){var be=ve.originalEvent&&ve.originalEvent.type==="resize";ve.geolocateSource||X._watchState!=="ACTIVE_LOCK"||be||(X._watchState="BACKGROUND",X._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),X._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),X.fire(new i.Event("trackuserlocationend")))})},j.prototype.trigger=function(){if(!this._setup)return i.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 i.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Pc--,xu=!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 i.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 i.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(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var V;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Pc>1?(V={maximumAge:6e5,timeout:0},xu=!0):(V=this.options.positionOptions,xu=!1),this._geolocationWatchID=i.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,V)}}else i.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},j.prototype._clearWatch=function(){i.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)},j}(i.Evented),Tp={maxWidth:100,unit:"metric"},$u=function(I){this.options=i.extend({},Tp,I),i.bindAll(["_onMove","setUnit"],this)};function ld(I,j,V){var X=V&&V.maxWidth||100,se=I._container.clientHeight/2,he=I.unproject([0,se]),ve=I.unproject([X,se]),be=he.distanceTo(ve);if(V&&V.unit==="imperial"){var Se=3.2808*be;Se>5280?Dc(j,X,Se/5280,I._getUIString("ScaleControl.Miles")):Dc(j,X,Se,I._getUIString("ScaleControl.Feet"))}else V&&V.unit==="nautical"?Dc(j,X,be/1852,I._getUIString("ScaleControl.NauticalMiles")):be>=1e3?Dc(j,X,be/1e3,I._getUIString("ScaleControl.Kilometers")):Dc(j,X,be,I._getUIString("ScaleControl.Meters"))}function Dc(I,j,V,X){var se,he,ve,be=(se=V,he=Math.pow(10,(""+Math.floor(se)).length-1),ve=(ve=se/he)>=10?10:ve>=5?5:ve>=3?3:ve>=2?2:ve>=1?1:function(Ue){var Xe=Math.pow(10,Math.ceil(-Math.log(Ue)/Math.LN10));return Math.round(Ue*Xe)/Xe}(ve),he*ve),Se=be/V;I.style.width=j*Se+"px",I.innerHTML=be+" "+X}$u.prototype.getDefaultPosition=function(){return"bottom-left"},$u.prototype._onMove=function(){ld(this._map,this._container,this.options)},$u.prototype.onAdd=function(I){return this._map=I,this._container=l.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",I.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},$u.prototype.onRemove=function(){l.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},$u.prototype.setUnit=function(I){this.options.unit=I,ld(this._map,this._container,this.options)};var rs=function(I){this._fullscreen=!1,I&&I.container&&(I.container instanceof i.window.HTMLElement?this._container=I.container:i.warnOnce("Full screen control 'container' must be a DOM element.")),i.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in i.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in i.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in i.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in i.window.document&&(this._fullscreenchange="MSFullscreenChange")};rs.prototype.onAdd=function(I){return this._map=I,this._container||(this._container=this._map.getContainer()),this._controlContainer=l.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",i.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},rs.prototype.onRemove=function(){l.remove(this._controlContainer),this._map=null,i.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},rs.prototype._checkFullscreenSupport=function(){return!!(i.window.document.fullscreenEnabled||i.window.document.mozFullScreenEnabled||i.window.document.msFullscreenEnabled||i.window.document.webkitFullscreenEnabled)},rs.prototype._setupUI=function(){var I=this._fullscreenButton=l.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);l.create("span","mapboxgl-ctrl-icon",I).setAttribute("aria-hidden",!0),I.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),i.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},rs.prototype._updateTitle=function(){var I=this._getTitle();this._fullscreenButton.setAttribute("aria-label",I),this._fullscreenButton.title=I},rs.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},rs.prototype._isFullscreen=function(){return this._fullscreen},rs.prototype._changeIcon=function(){(i.window.document.fullscreenElement||i.window.document.mozFullScreenElement||i.window.document.webkitFullscreenElement||i.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())},rs.prototype._onClickFullscreen=function(){this._isFullscreen()?i.window.document.exitFullscreen?i.window.document.exitFullscreen():i.window.document.mozCancelFullScreen?i.window.document.mozCancelFullScreen():i.window.document.msExitFullscreen?i.window.document.msExitFullscreen():i.window.document.webkitCancelFullScreen&&i.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 Ap={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Mp=function(I){function j(V){I.call(this),this.options=i.extend(Object.create(Ap),V),i.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return I&&(j.__proto__=I),j.prototype=Object.create(I&&I.prototype),j.prototype.constructor=j,j.prototype.addTo=function(V){return this._map&&this.remove(),this._map=V,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._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 i.Event("open")),this},j.prototype.isOpen=function(){return!!this._map},j.prototype.remove=function(){return this._content&&l.remove(this._content),this._container&&(l.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 i.Event("close")),this},j.prototype.getLngLat=function(){return this._lngLat},j.prototype.setLngLat=function(V){return this._lngLat=i.LngLat.convert(V),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},j.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},j.prototype.getElement=function(){return this._container},j.prototype.setText=function(V){return this.setDOMContent(i.window.document.createTextNode(V))},j.prototype.setHTML=function(V){var X,se=i.window.document.createDocumentFragment(),he=i.window.document.createElement("body");for(he.innerHTML=V;X=he.firstChild;)se.appendChild(X);return this.setDOMContent(se)},j.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},j.prototype.setMaxWidth=function(V){return this.options.maxWidth=V,this._update(),this},j.prototype.setDOMContent=function(V){return this._createContent(),this._content.appendChild(V),this._update(),this},j.prototype.addClassName=function(V){this._container&&this._container.classList.add(V)},j.prototype.removeClassName=function(V){this._container&&this._container.classList.remove(V)},j.prototype.toggleClassName=function(V){if(this._container)return this._container.classList.toggle(V)},j.prototype._createContent=function(){this._content&&l.remove(this._content),this._content=l.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=l.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))},j.prototype._onMouseUp=function(V){this._update(V.point)},j.prototype._onMouseMove=function(V){this._update(V.point)},j.prototype._onDrag=function(V){this._update(V.point)},j.prototype._update=function(V){var X=this,se=this._lngLat||this._trackPointer;if(this._map&&se&&this._content&&(this._container||(this._container=l.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=l.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(xt){return X._container.classList.add(xt)}),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=qu(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||V)){var he=this._pos=this._trackPointer&&V?V:this._map.project(this._lngLat),ve=this.options.anchor,be=function xt(Lt){if(Lt){if(typeof Lt=="number"){var _t=Math.round(Math.sqrt(.5*Math.pow(Lt,2)));return{center:new i.Point(0,0),top:new i.Point(0,Lt),"top-left":new i.Point(_t,_t),"top-right":new i.Point(-_t,_t),bottom:new i.Point(0,-Lt),"bottom-left":new i.Point(_t,-_t),"bottom-right":new i.Point(-_t,-_t),left:new i.Point(Lt,0),right:new i.Point(-Lt,0)}}if(Lt instanceof i.Point||Array.isArray(Lt)){var Mt=i.Point.convert(Lt);return{center:Mt,top:Mt,"top-left":Mt,"top-right":Mt,bottom:Mt,"bottom-left":Mt,"bottom-right":Mt,left:Mt,right:Mt}}return{center:i.Point.convert(Lt.center||[0,0]),top:i.Point.convert(Lt.top||[0,0]),"top-left":i.Point.convert(Lt["top-left"]||[0,0]),"top-right":i.Point.convert(Lt["top-right"]||[0,0]),bottom:i.Point.convert(Lt.bottom||[0,0]),"bottom-left":i.Point.convert(Lt["bottom-left"]||[0,0]),"bottom-right":i.Point.convert(Lt["bottom-right"]||[0,0]),left:i.Point.convert(Lt.left||[0,0]),right:i.Point.convert(Lt.right||[0,0])}}return xt(new i.Point(0,0))}(this.options.offset);if(!ve){var Se,Ue=this._container.offsetWidth,Xe=this._container.offsetHeight;Se=he.y+be.bottom.ythis._map.transform.height-Xe?["bottom"]:[],he.xthis._map.transform.width-Ue/2&&Se.push("right"),ve=Se.length===0?"bottom":Se.join("-")}var it=he.add(be[ve]).round();l.setTransform(this._container,yu[ve]+" translate("+it.x+"px,"+it.y+"px)"),yo(this._container,ve,"popup")}},j.prototype._onClose=function(){this.remove()},j}(i.Evented),ce={version:i.version,supported:s,setRTLTextPlugin:i.setRTLTextPlugin,getRTLTextPluginStatus:i.getRTLTextPluginStatus,Map:ml,NavigationControl:ka,GeolocateControl:sd,AttributionControl:So,ScaleControl:$u,FullscreenControl:rs,Popup:Mp,Marker:Lc,Style:kr,LngLat:i.LngLat,LngLatBounds:i.LngLatBounds,Point:i.Point,MercatorCoordinate:i.MercatorCoordinate,Evented:i.Evented,config:i.config,prewarm:function(){tt().acquire(kt)},clearPrewarmedResources:function(){var I=Vt;I&&(I.isPreloaded()&&I.numActive()===1?(I.release(kt),Vt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return i.config.ACCESS_TOKEN},set accessToken(I){i.config.ACCESS_TOKEN=I},get baseApiUrl(){return i.config.API_URL},set baseApiUrl(I){i.config.API_URL=I},get workerCount(){return wt.workerCount},set workerCount(I){wt.workerCount=I},get maxParallelImageRequests(){return i.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(I){i.config.MAX_PARALLEL_IMAGE_REQUESTS=I},clearStorage:function(I){i.clearTileCache(I)},workerUrl:""};return ce}),u})},{}],240:[function(e,o,f){o.exports=Math.log2||function(r){return Math.log(r)*Math.LOG2E}},{}],241:[function(e,o,f){o.exports=function(a,u){u||(u=a,a=window);var c=0,i=0,s=0,l={shift:!1,alt:!1,control:!1,meta:!1},d=!1;function h(T){var _=!1;return"altKey"in T&&(_=_||T.altKey!==l.alt,l.alt=!!T.altKey),"shiftKey"in T&&(_=_||T.shiftKey!==l.shift,l.shift=!!T.shiftKey),"ctrlKey"in T&&(_=_||T.ctrlKey!==l.control,l.control=!!T.ctrlKey),"metaKey"in T&&(_=_||T.metaKey!==l.meta,l.meta=!!T.metaKey),_}function m(T,_){var M=r.x(_),A=r.y(_);"buttons"in _&&(T=0|_.buttons),(T!==c||M!==i||A!==s||h(_))&&(c=0|T,i=M||0,s=A||0,u&&u(c,i,s,l))}function g(T){m(0,T)}function p(){(c||i||s||l.shift||l.alt||l.meta||l.control)&&(i=s=0,c=0,l.shift=l.alt=l.control=l.meta=!1,u&&u(0,0,0,l))}function v(T){h(T)&&u&&u(c,i,s,l)}function y(T){r.buttons(T)===0?m(0,T):m(c,T)}function x(T){m(c|r.buttons(T),T)}function w(T){m(c&~r.buttons(T),T)}function k(){d||(d=!0,a.addEventListener("mousemove",y),a.addEventListener("mousedown",x),a.addEventListener("mouseup",w),a.addEventListener("mouseleave",g),a.addEventListener("mouseenter",g),a.addEventListener("mouseout",g),a.addEventListener("mouseover",g),a.addEventListener("blur",p),a.addEventListener("keyup",v),a.addEventListener("keydown",v),a.addEventListener("keypress",v),a!==window&&(window.addEventListener("blur",p),window.addEventListener("keyup",v),window.addEventListener("keydown",v),window.addEventListener("keypress",v)))}k();var b={element:a};return Object.defineProperties(b,{enabled:{get:function(){return d},set:function(T){T?k():function(){!d||(d=!1,a.removeEventListener("mousemove",y),a.removeEventListener("mousedown",x),a.removeEventListener("mouseup",w),a.removeEventListener("mouseleave",g),a.removeEventListener("mouseenter",g),a.removeEventListener("mouseout",g),a.removeEventListener("mouseover",g),a.removeEventListener("blur",p),a.removeEventListener("keyup",v),a.removeEventListener("keydown",v),a.removeEventListener("keypress",v),a!==window&&(window.removeEventListener("blur",p),window.removeEventListener("keyup",v),window.removeEventListener("keydown",v),window.removeEventListener("keypress",v)))}()},enumerable:!0},buttons:{get:function(){return c},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return s},enumerable:!0},mods:{get:function(){return l},enumerable:!0}}),b};var r=e("mouse-event")},{"mouse-event":243}],242:[function(e,o,f){var r={left:0,top:0};o.exports=function(a,u,c){u=u||a.currentTarget||a.srcElement,Array.isArray(c)||(c=[0,0]);var i=a.clientX||0,s=a.clientY||0,l=(d=u,d===window||d===document||d===document.body?r:d.getBoundingClientRect()),d;return c[0]=i-l.left,c[1]=s-l.top,c}},{}],243:[function(e,o,f){function r(a){return a.target||a.srcElement||window}f.buttons=function(a){if(typeof a=="object"){if("buttons"in a)return a.buttons;if("which"in a){if((u=a.which)===2)return 4;if(u===3)return 2;if(u>0)return 1<=0)return 1<0&&d(m,M))}catch(A){v.call(new x(M),A)}}}function v(T){var _=this;_.triggered||(_.triggered=!0,_.def&&(_=_.def),_.msg=T,_.state=2,_.chain.length>0&&d(m,_))}function y(T,_,M,A){for(var S=0;S<_.length;S++)(function(E){T.resolve(_[E]).then(function(D){M(E,D)},A)})(S)}function x(T){this.def=T,this.triggered=!1}function w(T){this.promise=T,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function k(T){if(typeof T!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var _=new w(this);this.then=function(M,A){var S={success:typeof M!="function"||M,failure:typeof A=="function"&&A};return S.promise=new this.constructor(function(E,D){if(typeof E!="function"||typeof D!="function")throw TypeError("Not a function");S.resolve=E,S.reject=D}),_.chain.push(S),_.state!==0&&d(m,_),S.promise},this.catch=function(M){return this.then(void 0,M)};try{T.call(void 0,function(M){p.call(_,M)},function(M){v.call(_,M)})}catch(M){v.call(_,M)}}i=function(){var T,_,M;function A(S,E){this.fn=S,this.self=E,this.next=void 0}return{add:function(S,E){M=new A(S,E),_?_.next=M:T=M,_=M,M=void 0},drain:function(){var S=T;for(T=_=c=void 0;S;)S.fn.call(S.self),S=S.next}}}();var b=u({},"constructor",k,!1);return k.prototype=b,u(b,"__NPO__",0,!1),u(k,"resolve",function(T){return T&&typeof T=="object"&&T.__NPO__===1?T:new this(function(_,M){if(typeof _!="function"||typeof M!="function")throw TypeError("Not a function");_(T)})}),u(k,"reject",function(T){return new this(function(_,M){if(typeof _!="function"||typeof M!="function")throw TypeError("Not a function");M(T)})}),u(k,"all",function(T){var _=this;return s.call(T)!="[object Array]"?_.reject(TypeError("Not an array")):T.length===0?_.resolve([]):new _(function(M,A){if(typeof M!="function"||typeof A!="function")throw TypeError("Not a function");var S=T.length,E=Array(S),D=0;y(_,T,function(O,R){E[O]=R,++D===S&&M(E)},A)})}),u(k,"race",function(T){var _=this;return s.call(T)!="[object Array]"?_.reject(TypeError("Not an array")):new _(function(M,A){if(typeof M!="function"||typeof A!="function")throw TypeError("Not a function");y(_,T,function(S,E){M(E)},A)})}),k})}).call(this)}).call(this,typeof Ro<"u"?Ro:typeof self<"u"?self:typeof window<"u"?window:{},e("timers").setImmediate)},{timers:311}],246:[function(e,o,f){var r=Math.PI,a=l(120);function u(d,h,m,g){return["C",d,h,m,g,m,g]}function c(d,h,m,g,p,v){return["C",d/3+2/3*m,h/3+2/3*g,p/3+2/3*m,v/3+2/3*g,p,v]}function i(d,h,m,g,p,v,y,x,w,k){if(k)R=k[0],z=k[1],D=k[2],O=k[3];else{var b=s(d,h,-p);d=b.x,h=b.y;var T=(d-(x=(b=s(x,w,-p)).x))/2,_=(h-(w=b.y))/2,M=T*T/(m*m)+_*_/(g*g);M>1&&(m*=M=Math.sqrt(M),g*=M);var A=m*m,S=g*g,E=(v==y?-1:1)*Math.sqrt(Math.abs((A*S-A*_*_-S*T*T)/(A*_*_+S*T*T)));E==1/0&&(E=1);var D=E*m*_/g+(d+x)/2,O=E*-g*T/m+(h+w)/2,R=Math.asin(((h-O)/g).toFixed(9)),z=Math.asin(((w-O)/g).toFixed(9));(R=dz&&(R-=2*r),!y&&z>R&&(z-=2*r)}if(Math.abs(z-R)>a){var L=z,P=x,N=w;z=R+a*(y&&z>R?1:-1);var B=i(x=D+m*Math.cos(z),w=O+g*Math.sin(z),m,g,p,0,y,P,N,[z,L,D,O])}var G=Math.tan((z-R)/4),W=4/3*m*G,K=4/3*g*G,te=[2*d-(d+W*Math.sin(R)),2*h-(h-K*Math.cos(R)),x+W*Math.sin(z),w-K*Math.cos(z),x,w];if(k)return te;B&&(te=te.concat(B));for(var Y=0;Y7&&(m.push(M.splice(0,7)),M.unshift("C"));break;case"S":var S=k,E=b;h!="C"&&h!="S"||(S+=S-g,E+=E-p),M=["C",S,E,M[1],M[2],M[3],M[4]];break;case"T":h=="Q"||h=="T"?(x=2*k-x,w=2*b-w):(x=k,w=b),M=c(k,b,x,w,M[1],M[2]);break;case"Q":x=M[1],w=M[2],M=c(k,b,M[1],M[2],M[3],M[4]);break;case"L":M=u(k,b,M[1],M[2]);break;case"H":M=u(k,b,M[1],b);break;case"V":M=u(k,b,k,M[1]);break;case"Z":M=u(k,b,v,y)}h=A,k=M[M.length-2],b=M[M.length-1],M.length>4?(g=M[M.length-4],p=M[M.length-3]):(g=k,p=b),m.push(M)}return m}},{}],247:[function(e,o,f){var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function c(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}o.exports=function(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;if(Object.getOwnPropertyNames(s).map(function(h){return s[h]}).join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(h){d[h]=h}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(i,s){for(var l,d,h=c(i),m=1;m1e4)throw Error("References have circular dependency. Please, check them.");s[w]=x}),v=v.reverse(),s=s.map(function(x){return v.forEach(function(w){x=x.replace(new RegExp("(\\"+d+w+"\\"+d+")","g"),g[0]+"$1"+g[1])}),x})});var m=new RegExp("\\"+d+"([0-9]+)\\"+d);return h?s:function g(p,v,y){for(var x,w=[],k=0;x=m.exec(p);){if(k++>1e4)throw Error("Circular references in parenthesis");w.push(p.slice(0,x.index)),w.push(g(v[x[1]],v)),p=p.slice(x.index+x[0].length)}return w.push(p),w}(s[0],s)}function a(c,i){if(i&&i.flat){var s,l=i&&i.escape||"___",d=c[0];if(!d)return"";for(var h=new RegExp("\\"+l+"([0-9]+)\\"+l),m=0;d!=s;){if(m++>1e4)throw Error("Circular references in "+c);s=d,d=d.replace(h,g)}return d}return c.reduce(function p(v,y){return Array.isArray(y)&&(y=y.reduce(p,"")),v+y},"");function g(p,v){if(c[v]==null)throw Error("Reference "+v+"is undefined");return c[v]}}function u(c,i){return Array.isArray(c)?a(c,i):r(c,i)}u.parse=r,u.stringify=a,o.exports=u},{}],249:[function(e,o,f){var r=e("pick-by-alias");o.exports=function(a){var u;return arguments.length>1&&(a=arguments),typeof a=="string"?a=a.split(/\s/).map(parseFloat):typeof a=="number"&&(a=[a]),a.length&&typeof a[0]=="number"?u=a.length===1?{width:a[0],height:a[0],x:0,y:0}:a.length===2?{width:a[0],height:a[1],x:0,y:0}:{x:a[0],y:a[1],width:a[2]-a[0]||0,height:a[3]-a[1]||0}:a&&(a=r(a,{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"}),u={x:a.left||0,y:a.top||0},a.width==null?a.right?u.width=a.right-u.x:u.width=0:u.width=a.width,a.height==null?a.bottom?u.height=a.bottom-u.y:u.height=0:u.height=a.height),u}},{"pick-by-alias":253}],250:[function(e,o,f){o.exports=function(c){var i=[];return c.replace(a,function(s,l,d){var h=l.toLowerCase();for(d=function(m){var g=m.match(u);return g?g.map(Number):[]}(d),h=="m"&&d.length>2&&(i.push([l].concat(d.splice(0,2))),h="l",l=l=="m"?"l":"L");;){if(d.length==r[h])return d.unshift(l),i.push(d);if(d.length=-r},pointBetween:function(u,c,i){var s=u[1]-c[1],l=i[0]-c[0],d=u[0]-c[0],h=i[1]-c[1],m=d*l+s*h;return!(m-r)},pointsSameX:function(u,c){return Math.abs(u[0]-c[0])r!=d-s>r&&(l-g)*(s-p)/(d-p)+g-i>r&&(h=!h),l=g,d=p}return h}};return a}},{}],257:[function(e,o,f){var r={toPolygon:function(a,u){function c(l){if(l.length<=0)return a.segments({inverted:!1,regions:[]});function d(g){var p=g.slice(0,g.length-1);return a.segments({inverted:!1,regions:[p]})}for(var h=d(l[0]),m=1;m0})}function x(O,R){var z=O.seg,L=R.seg,P=z.start,N=z.end,B=L.start,G=L.end;c&&c.checkIntersection(z,L);var W=u.linesIntersect(P,N,B,G);if(W===!1){if(!u.pointsCollinear(P,N,B)||u.pointsSame(P,G)||u.pointsSame(N,B))return!1;var K=u.pointsSame(P,B),te=u.pointsSame(N,G);if(K&&te)return R;var Y=!K&&u.pointBetween(P,B,G),Z=!te&&u.pointBetween(N,B,G);if(K)return Z?h(R,N):h(O,G),R;Y&&(te||(Z?h(R,N):h(O,G)),h(R,P))}else W.alongA===0&&(W.alongB===-1?h(O,B):W.alongB===0?h(O,W.pt):W.alongB===1&&h(O,G)),W.alongB===0&&(W.alongA===-1?h(R,P):W.alongA===0?h(R,W.pt):W.alongA===1&&h(R,N));return!1}for(var w=[];!s.isEmpty();){var k=s.getHead();if(c&&c.vert(k.pt[0]),k.isStart){let O=function(){if(T){var R=x(k,T);if(R)return R}return!!_&&x(k,_)};c&&c.segmentNew(k.seg,k.primary);var b=y(k),T=b.before?b.before.ev:null,_=b.after?b.after.ev:null;c&&c.tempStatus(k.seg,!!T&&T.seg,!!_&&_.seg);var M,A=O();if(A){var S;a?(S=k.seg.myFill.below===null||k.seg.myFill.above!==k.seg.myFill.below)&&(A.seg.myFill.above=!A.seg.myFill.above):A.seg.otherFill=k.seg.myFill,c&&c.segmentUpdate(A.seg),k.other.remove(),k.remove()}if(s.getHead()!==k){c&&c.rewind(k.seg);continue}a?(S=k.seg.myFill.below===null||k.seg.myFill.above!==k.seg.myFill.below,k.seg.myFill.below=_?_.seg.myFill.above:g,k.seg.myFill.above=S?!k.seg.myFill.below:k.seg.myFill.below):k.seg.otherFill===null&&(M=_?k.primary===_.primary?_.seg.otherFill.above:_.seg.myFill.above:k.primary?p:g,k.seg.otherFill={above:M,below:M}),c&&c.status(k.seg,!!T&&T.seg,!!_&&_.seg),k.other.status=b.insert(r.node({ev:k}))}else{var E=k.status;if(E===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(v.exists(E.prev)&&v.exists(E.next)&&x(E.prev.ev,E.next.ev),c&&c.statusRemove(E.ev.seg),E.remove(),!k.primary){var D=k.seg.myFill;k.seg.myFill=k.seg.otherFill,k.seg.otherFill=D}w.push(k.seg)}s.getHead().remove()}return c&&c.done(),w}return a?{addRegion:function(g){for(var p,v,y,x=g[g.length-1],w=0;w0&&!this.aborted;){var s=this.ifds_to_read.shift();s.offset&&this.scan_ifd(s.id,s.offset,c)}},u.prototype.read_uint16=function(c){var i=this.input;if(c+2>i.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*i[c]+i[c+1]:i[c]+256*i[c+1]},u.prototype.read_uint32=function(c){var i=this.input;if(c+4>i.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?16777216*i[c]+65536*i[c+1]+256*i[c+2]+i[c+3]:i[c]+256*i[c+1]+65536*i[c+2]+16777216*i[c+3]},u.prototype.is_subifd_link=function(c,i){return c===0&&i===34665||c===0&&i===34853||c===34665&&i===40965},u.prototype.exif_format_length=function(c){switch(c){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}},u.prototype.exif_format_read=function(c,i){var s;switch(c){case 1:case 2:return s=this.input[i];case 6:return(s=this.input[i])|33554430*(128&s);case 3:return s=this.read_uint16(i);case 8:return(s=this.read_uint16(i))|131070*(32768&s);case 4:return s=this.read_uint32(i);case 9:return 0|(s=this.read_uint32(i));case 5:case 10:case 11:case 12:case 7:default:return null}},u.prototype.scan_ifd=function(c,i,s){var l=this.read_uint16(i);i+=2;for(var d=0;dthis.input.length)throw r("unexpected EOF","EBADDATA");for(var w=[],k=y,b=0;b0&&(this.ifds_to_read.push({id:h,offset:w[0]}),x=!0),s({is_big_endian:this.big_endian,ifd:c,tag:h,format:m,count:g,entry_offset:i+this.start,data_length:v,data_offset:y+this.start,value:w,is_subifd_link:x})===!1)return void(this.aborted=!0);i+=12}c===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(i)})},o.exports.ExifParser=u,o.exports.get_orientation=function(c){var i=0;try{return new u(c,0,c.length).each(function(s){if(s.ifd===0&&s.tag===274&&Array.isArray(s.value))return i=s.value[0],!1}),i}catch{return-1}}},{}],264:[function(e,o,f){var r=e("./common").readUInt16BE,a=e("./common").readUInt32BE;function u(h,m){if(h.length<4+m)return null;var g=a(h,m);return h.length>4&15,p=15&h[4],v=h[5]>>4&15,y=r(h,6),x=8,w=0;wb.width||k.width===b.width&&k.height>b.height?k:b}),v=g.reduce(function(k,b){return k.height>b.height||k.height===b.height&&k.width>b.width?k:b}),p.width>v.height||p.width===v.height&&p.height>v.width?p:v),x=1;m.transforms.forEach(function(k){var b={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},T={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(k.type==="imir"&&(x=k.value===0?T[x]:b[x=b[x=T[x]]]),k.type==="irot")for(var _=0;_1&&(y.variants=v.variants),v.orientation&&(y.orientation=v.orientation),v.exif_location&&v.exif_location.offset+v.exif_location.length<=l.length){var x=u(l,v.exif_location.offset),w=l.slice(v.exif_location.offset+x+4,v.exif_location.offset+v.exif_location.length),k=i.get_orientation(w);k>0&&(y.orientation=k)}return y}}}}}}},{"../common":262,"../exif_utils":263,"../miaf_utils":264}],266:[function(e,o,f){var r=e("../common").str2arr,a=e("../common").sliceEq,u=e("../common").readUInt16LE,c=r("BM");o.exports=function(i){if(!(i.length<26)&&a(i,0,c))return{width:u(i,18),height:u(i,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":262}],267:[function(e,o,f){var r=e("../common").str2arr,a=e("../common").sliceEq,u=e("../common").readUInt16LE,c=r("GIF87a"),i=r("GIF89a");o.exports=function(s){if(!(s.length<10)&&(a(s,0,c)||a(s,0,i)))return{width:u(s,6),height:u(s,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":262}],268:[function(e,o,f){var r=e("../common").readUInt16LE;o.exports=function(a){var u=r(a,0),c=r(a,2),i=r(a,4);if(u===0&&c===1&&i){for(var s=[],l={width:0,height:0},d=0;dl.width||m>l.height)&&(l=g)}return{width:l.width,height:l.height,variants:s,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":262}],269:[function(e,o,f){var r=e("../common").readUInt16BE,a=e("../common").str2arr,u=e("../common").sliceEq,c=e("../exif_utils"),i=a("Exif\0\0");o.exports=function(s){if(!(s.length<2)&&s[0]===255&&s[1]===216&&s[2]===255)for(var l=2;;){for(;;){if(s.length-l<2)return;if(s[l++]===255)break}for(var d,h,m=s[l++];m===255;)m=s[l++];if(208<=m&&m<=217||m===1)d=0;else{if(!(192<=m&&m<=254)||s.length-l<2)return;d=r(s,l)-2,l+=2}if(m===217||m===218)return;if(m===225&&d>=10&&u(s,l,i)&&(h=c.get_orientation(s.slice(l+6,l+d))),d>=5&&192<=m&&m<=207&&m!==196&&m!==200&&m!==204){if(s.length-l0&&(g.orientation=h),g}l+=d}}},{"../common":262,"../exif_utils":263}],270:[function(e,o,f){var r=e("../common").str2arr,a=e("../common").sliceEq,u=e("../common").readUInt32BE,c=r(`\x89PNG\r + +`),i=r("IHDR");o.exports=function(s){if(!(s.length<24)&&a(s,0,c)&&a(s,12,i))return{width:u(s,16),height:u(s,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":262}],271:[function(e,o,f){var r=e("../common").str2arr,a=e("../common").sliceEq,u=e("../common").readUInt32BE,c=r("8BPS\0");o.exports=function(i){if(!(i.length<22)&&a(i,0,c))return{width:u(i,18),height:u(i,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":262}],272:[function(e,o,f){function r(h){return typeof h=="number"&&isFinite(h)&&h>0}var a=/<[-_.:a-zA-Z0-9][^>]*>/,u=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,c=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,i=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,l=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function d(h){return l.test(h)?h.match(l)[0]:"px"}o.exports=function(h){if(function(M){var A,S=0,E=M.length;for(M[0]===239&&M[1]===187&&M[2]===191&&(S=3);S>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function m(g,p){return{width:1+(g[p+6]<<16|g[p+5]<<8|g[p+4]),height:1+(g[p+9]<g.length)){for(;p+8=10?v=v||d(g,p+8):w==="VP8L"&&k>=9?v=v||h(g,p+8):w==="VP8X"&&k>=10?v=v||m(g,p+8):w==="EXIF"&&(y=i.get_orientation(g.slice(p+8,p+8+k)),p=1/0),p+=8+k}else p++;if(v)return y>0&&(v.orientation=y),v}}}},{"../common":262,"../exif_utils":263}],275:[function(e,o,f){o.exports={avif:e("./parse_sync/avif"),bmp:e("./parse_sync/bmp"),gif:e("./parse_sync/gif"),ico:e("./parse_sync/ico"),jpeg:e("./parse_sync/jpeg"),png:e("./parse_sync/png"),psd:e("./parse_sync/psd"),svg:e("./parse_sync/svg"),tiff:e("./parse_sync/tiff"),webp:e("./parse_sync/webp")}},{"./parse_sync/avif":265,"./parse_sync/bmp":266,"./parse_sync/gif":267,"./parse_sync/ico":268,"./parse_sync/jpeg":269,"./parse_sync/png":270,"./parse_sync/psd":271,"./parse_sync/svg":272,"./parse_sync/tiff":273,"./parse_sync/webp":274}],276:[function(e,o,f){var r=e("./lib/parsers_sync");o.exports=function(a){return function(u){for(var c=Object.keys(r),i=0;i1)for(var k=1;k"u"?r:window,c=["moz","webkit"],i="AnimationFrame",s=u["request"+i],l=u["cancel"+i]||u["cancelRequest"+i],d=0;!s&&d1&&(R.scaleRatio=[R.scale[0]*R.viewport.width,R.scale[1]*R.viewport.height],v(R),R.after&&R.after(R))}function D(R){if(R){R.length!=null?typeof R[0]=="number"&&(R=[{positions:R}]):Array.isArray(R)||(R=[R]);var z=0,L=0;if(A.groups=M=R.map(function(te,Y){var Z=M[Y];return te&&(typeof te=="function"?te={after:te}:typeof te[0]=="number"&&(te={positions:te}),te=c(te,{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"}),Z||(M[Y]=Z={id:Y,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},te=i({},_,te)),u(Z,te,[{lineWidth:function(re){return .5*+re},capSize:function(re){return .5*+re},opacity:parseFloat,errors:function(re){return re=s(re),L+=re.length,re},positions:function(re,U){return re=s(re,"float64"),U.count=Math.floor(re.length/2),U.bounds=r(re,2),U.offset=z,z+=U.count,re}},{color:function(re,U){var q=U.count;if(re||(re="transparent"),!Array.isArray(re)||typeof re[0]=="number"){var $=re;re=Array(q);for(var ne=0;ne 0. && baClipping < length(normalWidth * endBotJoin)) { + //handle miter clipping + bTopCoord -= normalWidth * endTopJoin; + bTopCoord += normalize(endTopJoin * normalWidth) * baClipping; + } + + if (nextReverse) { + //make join rectangular + vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5; + float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.); + bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; + bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; + } + else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) { + //handle miter clipping + aBotCoord -= normalWidth * startBotJoin; + aBotCoord += normalize(startBotJoin * normalWidth) * abClipping; + } + + vec2 aTopPosition = (aTopCoord) * adjustedScale + translate; + vec2 aBotPosition = (aBotCoord) * adjustedScale + translate; + + vec2 bTopPosition = (bTopCoord) * adjustedScale + translate; + vec2 bBotPosition = (bBotCoord) * adjustedScale + translate; + + //position is normalized 0..1 coord on the screen + vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd; + + startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy; + endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2.0 - 1.0, depth, 1); + + enableStartMiter = step(dot(currTangent, prevTangent), .5); + enableEndMiter = step(dot(currTangent, nextTangent), .5); + + //bevel miter cutoffs + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } + + //round miter cutoffs + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } +} +`]),frag:c([`precision highp float; +#define GLSLIFY 1 + +uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode; +uniform sampler2D dashTexture; + +varying vec4 fragColor; +varying vec2 tangent; +varying vec4 startCutoff, endCutoff; +varying vec2 startCoord, endCoord; +varying float enableStartMiter, enableEndMiter; + +float distToLine(vec2 p, vec2 a, vec2 b) { + vec2 diff = b - a; + vec2 perp = normalize(vec2(-diff.y, diff.x)); + return dot(p - a, perp); +} + +void main() { + float alpha = 1., distToStart, distToEnd; + float cutoff = thickness * .5; + + //bevel miter + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < -1.) { + discard; + return; + } + alpha *= min(max(distToStart + 1., 0.), 1.); + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < -1.) { + discard; + return; + } + alpha *= min(max(distToEnd + 1., 0.), 1.); + } + } + + // round miter + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < 0.) { + float radius = length(gl_FragCoord.xy - startCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < 0.) { + float radius = length(gl_FragCoord.xy - endCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + } + + float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; + float dash = texture2D(dashTexture, vec2(t, .5)).r; + + gl_FragColor = fragColor; + gl_FragColor.a *= alpha * opacity * dash; +} +`]),attributes:{lineEnd:{buffer:b,divisor:0,stride:8,offset:0},lineTop:{buffer:b,divisor:0,stride:8,offset:4},aColor:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:w.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},T))}catch{k=_}return{fill:w({primitive:"triangle",elements:function(M,A){return A.triangles},offset:0,vert:c([`precision highp float; +#define GLSLIFY 1 + +attribute vec2 position, positionFract; + +uniform vec4 color; +uniform vec2 scale, scaleFract, translate, translateFract; +uniform float pixelRatio, id; +uniform vec4 viewport; +uniform float opacity; + +varying vec4 fragColor; + +const float MAX_LINES = 256.; + +void main() { + float depth = (MAX_LINES - 4. - id) / (MAX_LINES); + + vec2 position = position * scale + translate + + positionFract * scale + translateFract + + position * scaleFract + + positionFract * scaleFract; + + gl_Position = vec4(position * 2.0 - 1.0, depth, 1); + + fragColor = color / 255.; + fragColor.a *= opacity; +} +`]),frag:c([`precision highp float; +#define GLSLIFY 1 + +varying vec4 fragColor; + +void main() { + gl_FragColor = fragColor; +} +`]),uniforms:{scale:w.prop("scale"),color:w.prop("fill"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),viewport:function(M,A){return[A.viewport.x,A.viewport.y,M.viewportWidth,M.viewportHeight]}},attributes:{position:{buffer:w.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8}},blend:T.blend,depth:{enable:!1},scissor:T.scissor,stencil:T.stencil,viewport:T.viewport}),rect:_,miter:k}},x.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},x.prototype.render=function(){for(var w,k=[],b=arguments.length;b--;)k[b]=arguments[b];k.length&&(w=this).update.apply(w,k),this.draw()},x.prototype.draw=function(){for(var w=this,k=[],b=arguments.length;b--;)k[b]=arguments[b];return(k.length?k:this.passes).forEach(function(T,_){var M;if(T&&Array.isArray(T))return(M=w).draw.apply(M,T);typeof T=="number"&&(T=w.passes[T]),T&&T.count>1&&T.opacity&&(w.regl._refresh(),T.fill&&T.triangles&&T.triangles.length>2&&w.shaders.fill(T),T.thickness&&(T.scale[0]*T.viewport.width>x.precisionThreshold||T.scale[1]*T.viewport.height>x.precisionThreshold||T.join==="rect"||!T.join&&(T.thickness<=2||T.count>=x.maxPoints)?w.shaders.rect(T):w.shaders.miter(T)))}),this},x.prototype.update=function(w){var k=this;if(w){w.length!=null?typeof w[0]=="number"&&(w=[{positions:w}]):Array.isArray(w)||(w=[w]);var b=this.regl,T=this.gl;if(w.forEach(function(E,D){var O=k.passes[D];if(E!==void 0)if(E!==null){if(typeof E[0]=="number"&&(E={positions:E}),E=i(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"}),O||(k.passes[D]=O={id:D,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:b.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:b.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:b.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:b.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},E=u({},x.defaults,E)),E.thickness!=null&&(O.thickness=parseFloat(E.thickness)),E.opacity!=null&&(O.opacity=parseFloat(E.opacity)),E.miterLimit!=null&&(O.miterLimit=parseFloat(E.miterLimit)),E.overlay!=null&&(O.overlay=!!E.overlay,D=H});(q=q.slice(0,Q)).push(H)}for(var ee=function(Ot){var Wt=G.slice(2*ne,2*q[Ot]).concat(H?G.slice(2*H):[]),Jt=(O.hole||[]).map(function(Ge){return Ge-H+(q[Ot]-ne)}),Be=l(Wt,Jt);Be=Be.map(function(Ge){return Ge+ne+(Ge+ne_.length)&&(M=_.length);for(var A=0,S=new Array(M);A 1.0 + delta) { + discard; + } + + alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius); + + float borderRadius = fragBorderRadius; + float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius); + vec4 color = mix(fragColor, fragBorderColor, ratio); + color.a *= alpha * opacity; + gl_FragColor = color; +} +`]),z.vert=m([`precision highp float; +#define GLSLIFY 1 + +attribute float x, y, xFract, yFract; +attribute float size, borderSize; +attribute vec4 colorId, borderColorId; +attribute float isActive; + +uniform bool constPointSize; +uniform float pixelRatio; +uniform vec2 paletteSize, scale, scaleFract, translate, translateFract; +uniform sampler2D paletteTexture; + +const float maxSize = 100.; + +varying vec4 fragColor, fragBorderColor; +varying float fragBorderRadius, fragWidth; + +float pointSizeScale = (constPointSize) ? 2. : pixelRatio; + +bool isDirect = (paletteSize.x < 1.); + +vec4 getColor(vec4 id) { + return isDirect ? id / 255. : texture2D(paletteTexture, + vec2( + (id.x + .5) / paletteSize.x, + (id.y + .5) / paletteSize.y + ) + ); +} + +void main() { + // ignore inactive points + if (isActive == 0.) return; + + vec2 position = vec2(x, y); + vec2 positionFract = vec2(xFract, yFract); + + vec4 color = getColor(colorId); + vec4 borderColor = getColor(borderColorId); + + float size = size * maxSize / 255.; + float borderSize = borderSize * maxSize / 255.; + + gl_PointSize = (size + borderSize) * pointSizeScale; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + gl_Position = vec4(pos * 2. - 1., 0., 1.); + + fragBorderRadius = 1. - 2. * borderSize / (size + borderSize); + fragColor = color; + fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor; + fragWidth = 1. / gl_PointSize; +} +`]),y&&(z.frag=z.frag.replace("smoothstep","smoothStep"),R.frag=R.frag.replace("smoothstep","smoothStep")),this.drawCircle=_(z)}b.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},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var _=this,M=arguments.length,A=new Array(M),S=0;Swe)?me.tree=d(fe,{bounds:Me}):we&&we.length&&(me.tree=we),me.tree){var ke={primitive:"points",usage:"static",data:me.tree,type:"uint32"};me.elements?me.elements(ke):me.elements=O.elements(ke)}var Ee=x.float32(fe);return Te({data:Ee,usage:"dynamic"}),Oe({data:x.fract32(fe,Ee),usage:"dynamic"}),de({data:new Uint8Array(ye),type:"uint8",usage:"stream"}),fe}},{marker:function(fe,me,_e){var we=me.activation;if(we.forEach(function(Ee){return Ee&&Ee.destroy&&Ee.destroy()}),we.length=0,fe&&typeof fe[0]!="number"){for(var Te=[],Oe=0,de=Math.min(fe.length,me.count);Oe=0)return D;if(_ instanceof Uint8Array||_ instanceof Uint8ClampedArray)M=_;else{M=new Uint8Array(_.length);for(var O=0,R=_.length;O4*S&&(this.tooManyColors=!0),this.updatePalette(A),E.length===1?E[0]:E},b.prototype.updatePalette=function(_){if(!this.tooManyColors){var M=this.maxColors,A=this.paletteTexture,S=Math.ceil(.25*_.length/M);if(S>1)for(var E=.25*(_=_.slice()).length%M;E2?(T[0],T[2],x=T[1],w=T[3]):T.length?(x=T[0],w=T[1]):(T.x,x=T.y,T.x+T.width,w=T.y+T.height),_.length>2?(k=_[0],b=_[2],_[1],_[3]):_.length?(k=_[0],b=_[1]):(k=_.x,_.y,b=_.x+_.width,_.y+_.height),[k,x,b,w]}function g(p){if(typeof p=="number")return[p,p,p,p];if(p.length===2)return[p[0],p[1],p[0],p[1]];var v=s(p);return[v.x,v.y,v.x+v.width,v.y+v.height]}o.exports=d,d.prototype.render=function(){for(var p,v=this,y=[],x=arguments.length;x--;)y[x]=arguments[x];return y.length&&(p=this).update.apply(p,y),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=c(function(){v.draw(),v.dirty=!0,v.planned=null})):(this.draw(),this.dirty=!0,c(function(){v.dirty=!1})),this)},d.prototype.update=function(){for(var p,v=[],y=arguments.length;y--;)v[y]=arguments[y];if(v.length){for(var x=0;xL))&&(k.lower||!(z"u"?1:window.devicePixelRatio,Ut=!1,tt={},bt=function(St){},zt=function(){};if(typeof ot=="string"?De=document.querySelector(ot):typeof ot=="object"&&(typeof ot.nodeName=="string"&&typeof ot.appendChild=="function"&&typeof ot.getBoundingClientRect=="function"?De=ot:typeof ot.drawArrays=="function"||typeof ot.drawElements=="function"?rt=(lt=ot).canvas:("gl"in ot?lt=ot.gl:"canvas"in ot?rt=c(ot.canvas):"container"in ot&&(He=c(ot.container)),"attributes"in ot&&(Ae=ot.attributes),"extensions"in ot&&(kt=u(ot.extensions)),"optionalExtensions"in ot&&(wt=u(ot.optionalExtensions)),"onDone"in ot&&(bt=ot.onDone),"profile"in ot&&(Ut=!!ot.profile),"pixelRatio"in ot&&(Vt=+ot.pixelRatio),"cachedCode"in ot&&(tt=ot.cachedCode))),De&&(De.nodeName.toLowerCase()==="canvas"?rt=De:He=De),!lt){if(!rt){if(!(De=function(St,Dt,Le){function Je(){var It=window.innerWidth,Zt=window.innerHeight;St!==document.body&&(It=(Zt=Et.getBoundingClientRect()).right-Zt.left,Zt=Zt.bottom-Zt.top),Et.width=Le*It,Et.height=Le*Zt}var st,Et=document.createElement("canvas");return H(Et.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),St.appendChild(Et),St===document.body&&(Et.style.position="absolute",H(St.style,{margin:0,padding:0})),St!==document.body&&typeof ResizeObserver=="function"?(st=new ResizeObserver(function(){setTimeout(Je)})).observe(St):window.addEventListener("resize",Je,!1),Je(),{canvas:Et,onDestroy:function(){st?st.disconnect():window.removeEventListener("resize",Je),St.removeChild(Et)}}}(He||document.body,0,Vt)))return null;rt=De.canvas,zt=De.onDestroy}Ae.premultipliedAlpha===void 0&&(Ae.premultipliedAlpha=!0),lt=function(St,Dt){function Le(Je){try{return St.getContext(Je,Dt)}catch{return null}}return Le("webgl")||Le("experimental-webgl")||Le("webgl-experimental")}(rt,Ae)}return lt?{gl:lt,canvas:rt,container:He,extensions:kt,optionalExtensions:wt,pixelRatio:Vt,profile:Ut,cachedCode:tt,onDone:bt,onDestroy:zt}:(zt(),bt("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function s(Ae,De){for(var He=Array(Ae),rt=0;rt>>=De))<<3,(De|=He=(15<(Ae>>>=He))<<2)|(He=(3<(Ae>>>=He))<<1)|Ae>>>He>>1}function d(){function Ae(rt){e:{for(var lt=16;268435456>=lt;lt*=16)if(rt<=lt){rt=lt;break e}rt=0}return 0<(lt=He[l(rt)>>2]).length?lt.pop():new ArrayBuffer(rt)}function De(rt){He[l(rt.byteLength)>>2].push(rt)}var He=s(8,function(){return[]});return{alloc:Ae,free:De,allocType:function(rt,lt){var ot=null;switch(rt){case 5120:ot=new Int8Array(Ae(lt),0,lt);break;case 5121:ot=new Uint8Array(Ae(lt),0,lt);break;case 5122:ot=new Int16Array(Ae(2*lt),0,lt);break;case 5123:ot=new Uint16Array(Ae(2*lt),0,lt);break;case 5124:ot=new Int32Array(Ae(4*lt),0,lt);break;case 5125:ot=new Uint32Array(Ae(4*lt),0,lt);break;case 5126:ot=new Float32Array(Ae(4*lt),0,lt);break;default:return null}return ot.length!==lt?ot.subarray(0,lt):ot},freeType:function(rt){De(rt.buffer)}}}function h(Ae){return!!Ae&&typeof Ae=="object"&&Array.isArray(Ae.shape)&&Array.isArray(Ae.stride)&&typeof Ae.offset=="number"&&Ae.shape.length===Ae.stride.length&&(Array.isArray(Ae.data)||ge(Ae.data))}function m(Ae,De,He,rt,lt,ot){for(var kt=0;kt(zt=Le)&&(zt=bt.buffer.byteLength,Et===5123?zt>>=1:Et===5125&&(zt>>=2)),bt.vertCount=zt,zt=Dt,0>Dt&&(zt=4,(Dt=bt.buffer.dimension)===1&&(zt=0),Dt===2&&(zt=1),Dt===3&&(zt=4)),bt.primType=zt}function kt(bt){rt.elementsCount--,delete wt[bt.id],bt.buffer.destroy(),bt.buffer=null}var wt={},Vt=0,Ut={uint8:5121,uint16:5123};De.oes_element_index_uint&&(Ut.uint32=5125),lt.prototype.bind=function(){this.buffer.bind()};var tt=[];return{create:function(bt,zt){function St(Je){if(Je)if(typeof Je=="number")Dt(Je),Le.primType=4,Le.vertCount=0|Je,Le.type=5121;else{var st=null,Et=35044,It=-1,Zt=-1,Kt=0,Ht=0;Array.isArray(Je)||ge(Je)||h(Je)?st=Je:("data"in Je&&(st=Je.data),"usage"in Je&&(Et=Te[Je.usage]),"primitive"in Je&&(It=Me[Je.primitive]),"count"in Je&&(Zt=0|Je.count),"type"in Je&&(Ht=Ut[Je.type]),"length"in Je?Kt=0|Je.length:(Kt=Zt,Ht===5123||Ht===5122?Kt*=2:Ht!==5125&&Ht!==5124||(Kt*=4))),ot(Le,st,Et,It,Zt,Kt,Ht)}else Dt(),Le.primType=4,Le.vertCount=0,Le.type=5121;return St}var Dt=He.create(null,34963,!0),Le=new lt(Dt._buffer);return rt.elementsCount++,St(bt),St._reglType="elements",St._elements=Le,St.subdata=function(Je,st){return Dt.subdata(Je,st),St},St.destroy=function(){kt(Le)},St},createStream:function(bt){var zt=tt.pop();return zt||(zt=new lt(He.create(null,34963,!0,!1)._buffer)),ot(zt,bt,35040,-1,-1,0,0),zt},destroyStream:function(bt){tt.push(bt)},getElements:function(bt){return typeof bt=="function"&&bt._elements instanceof lt?bt._elements:null},clear:function(){fe(wt).forEach(kt)}}}function w(Ae){for(var De=ue.allocType(5123,Ae.length),He=0;He>>31<<15,lt=(ot<<1>>>24)-127,ot=ot>>13&1023;De[He]=-24>lt?rt:-14>lt?rt+(ot+1024>>-14-lt):15>=yn,jt.height>>=yn,zt(jt,fn[yn]),cn.mipmask|=1<jn;++jn)cn.images[jn]=null;return cn}function Kt(cn){for(var jn=cn.images,jt=0;jtcn){for(var jn=0;jn=--this.refCount&&sn(this)}}),kt.profile&&(ot.getTotalTextureSize=function(){var cn=0;return Object.keys(pr).forEach(function(jn){cn+=pr[jn].stats.size}),cn}),{create2D:function(cn,jn){function jt(yn,$n){var Un=fn.texInfo;Ht.call(Un);var Nn=Zt();return typeof yn=="number"?st(Nn,0|yn,typeof $n=="number"?0|$n:0|yn):yn?(mn(Un,yn),Et(Nn,yn)):st(Nn,1,1),Un.genMipmaps&&(Nn.mipmask=(Nn.width<<1)-1),fn.mipmask=Nn.mipmask,Vt(fn,Nn),fn.internalformat=Nn.internalformat,jt.width=Nn.width,jt.height=Nn.height,tn(fn),It(Nn,3553),zn(Un,3553),nn(),Kt(Nn),kt.profile&&(fn.stats.size=E(fn.internalformat,fn.type,Nn.width,Nn.height,Un.genMipmaps,!1)),jt.format=Ln[fn.internalformat],jt.type=lr[fn.type],jt.mag=Wr[Un.magFilter],jt.min=Mn[Un.minFilter],jt.wrapS=rr[Un.wrapS],jt.wrapT=rr[Un.wrapT],jt}var fn=new pn(3553);return pr[fn.id]=fn,ot.textureCount++,jt(cn,jn),jt.subimage=function(yn,$n,Un,Nn){$n|=0,Un|=0,Nn|=0;var Rn=Dt();return Vt(Rn,fn),Rn.width=0,Rn.height=0,zt(Rn,yn),Rn.width=Rn.width||(fn.width>>Nn)-$n,Rn.height=Rn.height||(fn.height>>Nn)-Un,tn(fn),St(Rn,3553,$n,Un,Nn),nn(),Le(Rn),jt},jt.resize=function(yn,$n){var Un=0|yn,Nn=0|$n||Un;if(Un===fn.width&&Nn===fn.height)return jt;jt.width=fn.width=Un,jt.height=fn.height=Nn,tn(fn);for(var Rn=0;fn.mipmask>>Rn;++Rn){var wn=Un>>Rn,kn=Nn>>Rn;if(!wn||!kn)break;Ae.texImage2D(3553,Rn,fn.format,wn,kn,0,fn.format,fn.type,null)}return nn(),kt.profile&&(fn.stats.size=E(fn.internalformat,fn.type,Un,Nn,!1,!1)),jt},jt._reglType="texture2d",jt._texture=fn,kt.profile&&(jt.stats=fn.stats),jt.destroy=function(){fn.decRef()},jt},createCube:function(cn,jn,jt,fn,yn,$n){function Un(wn,kn,Tn,Dn,Zn,Yn){var ir,or=Nn.texInfo;for(Ht.call(or),ir=0;6>ir;++ir)Rn[ir]=Zt();if(typeof wn!="number"&&wn){if(typeof wn=="object")if(kn)Et(Rn[0],wn),Et(Rn[1],kn),Et(Rn[2],Tn),Et(Rn[3],Dn),Et(Rn[4],Zn),Et(Rn[5],Yn);else if(mn(or,wn),Ut(Nn,wn),"faces"in wn)for(wn=wn.faces,ir=0;6>ir;++ir)Vt(Rn[ir],Nn),Et(Rn[ir],wn[ir]);else for(ir=0;6>ir;++ir)Et(Rn[ir],wn)}else for(wn=0|wn||1,ir=0;6>ir;++ir)st(Rn[ir],wn,wn);for(Vt(Nn,Rn[0]),Nn.mipmask=or.genMipmaps?(Rn[0].width<<1)-1:Rn[0].mipmask,Nn.internalformat=Rn[0].internalformat,Un.width=Rn[0].width,Un.height=Rn[0].height,tn(Nn),ir=0;6>ir;++ir)It(Rn[ir],34069+ir);for(zn(or,34067),nn(),kt.profile&&(Nn.stats.size=E(Nn.internalformat,Nn.type,Un.width,Un.height,or.genMipmaps,!0)),Un.format=Ln[Nn.internalformat],Un.type=lr[Nn.type],Un.mag=Wr[or.magFilter],Un.min=Mn[or.minFilter],Un.wrapS=rr[or.wrapS],Un.wrapT=rr[or.wrapT],ir=0;6>ir;++ir)Kt(Rn[ir]);return Un}var Nn=new pn(34067);pr[Nn.id]=Nn,ot.cubeCount++;var Rn=Array(6);return Un(cn,jn,jt,fn,yn,$n),Un.subimage=function(wn,kn,Tn,Dn,Zn){Tn|=0,Dn|=0,Zn|=0;var Yn=Dt();return Vt(Yn,Nn),Yn.width=0,Yn.height=0,zt(Yn,kn),Yn.width=Yn.width||(Nn.width>>Zn)-Tn,Yn.height=Yn.height||(Nn.height>>Zn)-Dn,tn(Nn),St(Yn,34069+wn,Tn,Dn,Zn),nn(),Le(Yn),Un},Un.resize=function(wn){if((wn|=0)!==Nn.width){Un.width=Nn.width=wn,Un.height=Nn.height=wn,tn(Nn);for(var kn=0;6>kn;++kn)for(var Tn=0;Nn.mipmask>>Tn;++Tn)Ae.texImage2D(34069+kn,Tn,Nn.format,wn>>Tn,wn>>Tn,0,Nn.format,Nn.type,null);return nn(),kt.profile&&(Nn.stats.size=E(Nn.internalformat,Nn.type,Un.width,Un.height,!1,!0)),Un}},Un._reglType="textureCube",Un._texture=Nn,kt.profile&&(Un.stats=Nn.stats),Un.destroy=function(){Nn.decRef()},Un},clear:function(){for(var cn=0;cnfn;++fn)if((jt.mipmask&1<>fn,jt.height>>fn,0,jt.internalformat,jt.type,null);else for(var yn=0;6>yn;++yn)Ae.texImage2D(34069+yn,fn,jt.internalformat,jt.width>>fn,jt.height>>fn,0,jt.internalformat,jt.type,null);zn(jt.texInfo,jt.target)})},refresh:function(){for(var cn=0;cngn;++gn){for(ar=0;arsn;++sn)nn[sn].resize(gn);return tn.width=tn.height=gn,tn},_reglType:"framebufferCube",destroy:function(){nn.forEach(function(sn){sn.destroy()})}})},clear:function(){fe(zn).forEach(Je)},restore:function(){It.cur=null,It.next=null,It.dirty=!0,fe(zn).forEach(function(pn){pn.framebuffer=Ae.createFramebuffer(),st(pn)})}})}function R(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function z(Ae,De,He,rt,lt,ot,kt){function wt(){this.id=++tt,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var St=De.oes_vertex_array_object;this.vao=St?St.createVertexArrayOES():null,bt[this.id]=this,this.buffers=[]}var Vt=He.maxAttributes,Ut=Array(Vt);for(He=0;He=mn.byteLength?Zt.subdata(mn):(Zt.destroy(),Le.buffers[It]=null)),Le.buffers[It]||(Zt=Le.buffers[It]=lt.create(Kt,34962,!1,!0)),Ht.buffer=lt.getBuffer(Zt),Ht.size=0|Ht.buffer.dimension,Ht.normalized=!1,Ht.type=Ht.buffer.dtype,Ht.offset=0,Ht.stride=0,Ht.divisor=0,Ht.state=1,Je[It]=1):lt.getBuffer(Kt)?(Ht.buffer=lt.getBuffer(Kt),Ht.size=0|Ht.buffer.dimension,Ht.normalized=!1,Ht.type=Ht.buffer.dtype,Ht.offset=0,Ht.stride=0,Ht.divisor=0,Ht.state=1):lt.getBuffer(Kt.buffer)?(Ht.buffer=lt.getBuffer(Kt.buffer),Ht.size=0|(+Kt.size||Ht.buffer.dimension),Ht.normalized=!!Kt.normalized||!1,Ht.type="type"in Kt?we[Kt.type]:Ht.buffer.dtype,Ht.offset=0|(Kt.offset||0),Ht.stride=0|(Kt.stride||0),Ht.divisor=0|(Kt.divisor||0),Ht.state=1):"x"in Kt&&(Ht.x=+Kt.x||0,Ht.y=+Kt.y||0,Ht.z=+Kt.z||0,Ht.w=+Kt.w||0,Ht.state=2)}for(Zt=0;ZtDt&&(Dt=Le.stats.uniformsCount)}),Dt},He.getMaxAttributesCount=function(){var Dt=0;return zt.forEach(function(Le){Le.stats.attributesCount>Dt&&(Dt=Le.stats.attributesCount)}),Dt}),{clear:function(){var Dt=Ae.deleteShader.bind(Ae);fe(Ut).forEach(Dt),Ut={},fe(tt).forEach(Dt),tt={},zt.forEach(function(Le){Ae.deleteProgram(Le.program)}),zt.length=0,bt={},He.shaderCount=0},program:function(Dt,Le,Je,st){var Et=bt[Le];Et||(Et=bt[Le]={});var It=Et[Dt];if(It&&(It.refCount++,!st))return It;var Zt=new wt(Le,Dt);return He.shaderCount++,Vt(Zt,Je,st),It||(Et[Dt]=Zt),zt.push(Zt),H(Zt,{destroy:function(){if(Zt.refCount--,0>=Zt.refCount){Ae.deleteProgram(Zt.program);var Kt=zt.indexOf(Zt);zt.splice(Kt,1),He.shaderCount--}0>=Et[Zt.vertId].refCount&&(Ae.deleteShader(tt[Zt.vertId]),delete tt[Zt.vertId],delete bt[Zt.fragId][Zt.vertId]),Object.keys(bt[Zt.fragId]).length||(Ae.deleteShader(Ut[Zt.fragId]),delete Ut[Zt.fragId],delete bt[Zt.fragId])}})},restore:function(){Ut={},tt={};for(var Dt=0;Dt>>De|Ae<<32-De}function B(Ae,De){var He=(65535&Ae)+(65535&De);return(Ae>>16)+(De>>16)+(He>>16)<<16|65535&He}function G(Ae){return Array.prototype.slice.call(Ae)}function W(Ae){return G(Ae).join("")}function K(Ae){function De(){var tt=[],bt=[];return H(function(){tt.push.apply(tt,G(arguments))},{def:function(){var zt="v"+lt++;return bt.push(zt),0>>4&15)+"0123456789abcdef".charAt(15&Dt);return Le}(function(St){for(var Dt=Array(St.length>>2),Le=0;Le>5]|=(255&St.charCodeAt(Le/8))<<24-Le%32;var Je,st,Et,It,Zt,Kt,Ht,mn,zn,pn,tn,nn=8*St.length;for(St=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],Le=Array(64),Dt[nn>>5]|=128<<24-nn%32,Dt[15+(nn+64>>9<<4)]=nn,mn=0;mnzn;zn++){var sn;16>zn?Le[zn]=Dt[zn+mn]:(pn=zn,tn=B(tn=N(tn=Le[zn-2],17)^N(tn,19)^tn>>>10,Le[zn-7]),sn=N(sn=Le[zn-15],7)^N(sn,18)^sn>>>3,Le[pn]=B(B(tn,sn),Le[zn-16])),pn=B(B(B(B(Ht,pn=N(pn=It,6)^N(pn,11)^N(pn,25)),It&Zt^~It&Kt),Wt[zn]),Le[zn]),tn=B(Ht=N(Ht=nn,2)^N(Ht,13)^N(Ht,22),nn&Je^nn&st^Je&st),Ht=Kt,Kt=Zt,Zt=It,It=B(Et,pn),Et=st,st=Je,Je=nn,nn=B(pn,tn)}St[0]=B(nn,St[0]),St[1]=B(Je,St[1]),St[2]=B(st,St[2]),St[3]=B(Et,St[3]),St[4]=B(It,St[4]),St[5]=B(Zt,St[5]),St[6]=B(Kt,St[6]),St[7]=B(Ht,St[7])}for(Dt="",Le=0;Le<32*St.length;Le+=8)Dt+=String.fromCharCode(St[Le>>5]>>>24-Le%32&255);return Dt}(function(St){for(var Dt,Le,Je="",st=-1;++st=Dt&&56320<=Le&&57343>=Le&&(Dt=65536+((1023&Dt)<<10)+(1023&Le),st++),127>=Dt?Je+=String.fromCharCode(Dt):2047>=Dt?Je+=String.fromCharCode(192|Dt>>>6&31,128|63&Dt):65535>=Dt?Je+=String.fromCharCode(224|Dt>>>12&15,128|Dt>>>6&63,128|63&Dt):2097151>=Dt&&(Je+=String.fromCharCode(240|Dt>>>18&7,128|Dt>>>12&63,128|Dt>>>6&63,128|63&Dt));return Je}(zt))),rt[bt])?rt[bt].apply(null,kt):(zt=Function.apply(null,ot.concat(zt)),rt&&(rt[bt]=zt),zt.apply(null,kt))}}}function te(Ae){return Array.isArray(Ae)||ge(Ae)||h(Ae)}function Y(Ae){return Ae.sort(function(De,He){return De==="viewport"?-1:He==="viewport"?1:De"+Nr+"?"+Dn+".constant["+Nr+"]:0;"}).join(""),"}}else{","if(",ir,"(",Dn,".buffer)){",wr,"=",Zn,".createStream(",34962,",",Dn,".buffer);","}else{",wr,"=",Zn,".getBuffer(",Dn,".buffer);","}",kr,'="type" in ',Dn,"?",Yn.glTypes,"[",Dn,".type]:",wr,".dtype;",or.normalized,"=!!",Dn,".normalized;"),Tn("size"),Tn("offset"),Tn("stride"),Tn("divisor"),kn("}}"),kn.exit("if(",or.isStream,"){",Zn,".destroyStream(",wr,");","}"),or})}),Un}function zn(jt,fn,yn,$n,Un){function Nn(xr){var wr=wn[xr];wr&&(Tn[xr]=wr)}var Rn=function(xr,wr){if(typeof(kr=xr.static).frag=="string"&&typeof kr.vert=="string"){if(0"u"?"Date.now()":"performance.now()"}function Rn(xr){xr(Tn=fn.def(),"=",Nn(),";"),typeof Un=="string"?xr(Yn,".count+=",Un,";"):xr(Yn,".count++;"),St&&($n?xr(Dn=fn.def(),"=",or,".getNumPendingQueries();"):xr(or,".beginQuery(",Yn,");"))}function wn(xr){xr(Yn,".cpuTime+=",Nn(),"-",Tn,";"),St&&($n?xr(or,".pushScopeStats(",Dn,",",or,".getNumPendingQueries(),",Yn,");"):xr(or,".endQuery();"))}function kn(xr){var wr=fn.def(ir,".profile");fn(ir,".profile=",xr,";"),fn.exit(ir,".profile=",wr,";")}var Tn,Dn,Zn=jt.shared,Yn=jt.stats,ir=Zn.current,or=Zn.timer;if(yn=yn.profile){if(re(yn))return void(yn.enable?(Rn(fn),wn(fn.exit),kn("true")):kn("false"));kn(yn=yn.append(jt,fn))}else yn=fn.def(ir,".profile");Rn(Zn=jt.block()),fn("if(",yn,"){",Zn,"}"),wn(jt=jt.block()),fn.exit("if(",yn,"){",jt,"}")}function In(jt,fn,yn,$n,Un){function Nn(wn,kn,Tn){function Dn(){fn("if(!",or,".buffer){",Yn,".enableVertexAttribArray(",ir,");}");var Dr,Nr=Tn.type;Dr=Tn.size?fn.def(Tn.size,"||",kn):kn,fn("if(",or,".type!==",Nr,"||",or,".size!==",Dr,"||",kr.map(function(ri){return or+"."+ri+"!=="+Tn[ri]}).join("||"),"){",Yn,".bindBuffer(",34962,",",xr,".buffer);",Yn,".vertexAttribPointer(",[ir,Dr,Nr,Tn.normalized,Tn.stride,Tn.offset],");",or,".type=",Nr,";",or,".size=",Dr,";",kr.map(function(ri){return or+"."+ri+"="+Tn[ri]+";"}).join(""),"}"),Mn&&(Nr=Tn.divisor,fn("if(",or,".divisor!==",Nr,"){",jt.instancing,".vertexAttribDivisorANGLE(",[ir,Nr],");",or,".divisor=",Nr,";}"))}function Zn(){fn("if(",or,".buffer){",Yn,".disableVertexAttribArray(",ir,");",or,".buffer=null;","}if(",Jt.map(function(Dr,Nr){return or+"."+Dr+"!=="+wr[Nr]}).join("||"),"){",Yn,".vertexAttrib4f(",ir,",",wr,");",Jt.map(function(Dr,Nr){return or+"."+Dr+"="+wr[Nr]+";"}).join(""),"}")}var Yn=Rn.gl,ir=fn.def(wn,".location"),or=fn.def(Rn.attributes,"[",ir,"]");wn=Tn.state;var xr=Tn.buffer,wr=[Tn.x,Tn.y,Tn.z,Tn.w],kr=["buffer","normalized","offset","stride"];wn===1?Dn():wn===2?Zn():(fn("if(",wn,"===",1,"){"),Dn(),fn("}else{"),Zn(),fn("}"))}var Rn=jt.shared;$n.forEach(function(wn){var kn,Tn=wn.name,Dn=yn.attributes[Tn];if(Dn){if(!Un(Dn))return;kn=Dn.append(jt,fn)}else{if(!Un(Ie))return;var Zn=jt.scopeAttrib(Tn);kn={},Object.keys(new lr).forEach(function(Yn){kn[Yn]=fn.def(Zn,".",Yn)})}Nn(jt.link(wn),function(Yn){switch(Yn){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(wn.info.type),kn)})}function Hn(jt,fn,yn,$n,Un,Nn){for(var Rn,wn=jt.shared,kn=wn.gl,Tn=0;Tn<$n.length;++Tn){var Dn,Zn=(or=$n[Tn]).name,Yn=or.info.type,ir=yn.uniforms[Zn],or=jt.link(or)+".location";if(ir){if(!Un(ir))continue;if(re(ir)){if(Zn=ir.value,Yn===35678||Yn===35680)fn(kn,".uniform1i(",or,",",(Yn=jt.link(Zn._texture||Zn.color[0]._texture))+".bind());"),fn.exit(Yn,".unbind();");else if(Yn===35674||Yn===35675||Yn===35676)ir=2,Yn===35675?ir=3:Yn===35676&&(ir=4),fn(kn,".uniformMatrix",ir,"fv(",or,",false,",Zn=jt.global.def("new Float32Array(["+Array.prototype.slice.call(Zn)+"])"),");");else{switch(Yn){case 5126:Rn="1f";break;case 35664:Rn="2f";break;case 35665:Rn="3f";break;case 35666:Rn="4f";break;case 35670:case 5124:Rn="1i";break;case 35671:case 35667:Rn="2i";break;case 35672:case 35668:Rn="3i";break;case 35673:Rn="4i";break;case 35669:Rn="4i"}fn(kn,".uniform",Rn,"(",or,",",k(Zn)?Array.prototype.slice.call(Zn):Zn,");")}continue}Dn=ir.append(jt,fn)}else{if(!Un(Ie))continue;Dn=fn.def(wn.uniforms,"[",De.id(Zn),"]")}switch(Yn===35678?fn("if(",Dn,"&&",Dn,'._reglType==="framebuffer"){',Dn,"=",Dn,".color[0];","}"):Yn===35680&&fn("if(",Dn,"&&",Dn,'._reglType==="framebufferCube"){',Dn,"=",Dn,".color[0];","}"),Zn=1,Yn){case 35678:case 35680:Yn=fn.def(Dn,"._texture"),fn(kn,".uniform1i(",or,",",Yn,".bind());"),fn.exit(Yn,".unbind();");continue;case 5124:case 35670:Rn="1i";break;case 35667:case 35671:Rn="2i",Zn=2;break;case 35668:case 35672:Rn="3i",Zn=3;break;case 35669:case 35673:Rn="4i",Zn=4;break;case 5126:Rn="1f";break;case 35664:Rn="2f",Zn=2;break;case 35665:Rn="3f",Zn=3;break;case 35666:Rn="4f",Zn=4;break;case 35674:Rn="Matrix2fv";break;case 35675:Rn="Matrix3fv";break;case 35676:Rn="Matrix4fv"}if(Rn.charAt(0)==="M"){fn(kn,".uniform",Rn,"(",or,","),or=Math.pow(Yn-35674+2,2);var xr=jt.global.def("new Float32Array(",or,")");Array.isArray(Dn)?fn("false,(",s(or,function(kr){return xr+"["+kr+"]="+Dn[kr]}),",",xr,")"):fn("false,(Array.isArray(",Dn,")||",Dn," instanceof Float32Array)?",Dn,":(",s(or,function(kr){return xr+"["+kr+"]="+Dn+"["+kr+"]"}),",",xr,")"),fn(");")}else{if(1>1)",wn],");")}function ri(){yn(kn,".drawArraysInstancedANGLE(",[or,xr,wr,wn],");")}ir&&ir!=="null"?Dr?Nr():(yn("if(",ir,"){"),Nr(),yn("}else{"),ri(),yn("}")):ri()}function Rn(){function Nr(){yn(Dn+".drawElements("+[or,wr,kr,xr+"<<(("+kr+"-5121)>>1)"]+");")}function ri(){yn(Dn+".drawArrays("+[or,xr,wr]+");")}ir&&ir!=="null"?Dr?Nr():(yn("if(",ir,"){"),Nr(),yn("}else{"),ri(),yn("}")):ri()}var wn,kn,Tn=jt.shared,Dn=Tn.gl,Zn=Tn.draw,Yn=$n.draw,ir=function(){var Nr=Yn.elements,ri=fn;return Nr?((Nr.contextDep&&$n.contextDynamic||Nr.propDep)&&(ri=yn),Nr=Nr.append(jt,ri),Yn.elementsActive&&ri("if("+Nr+")"+Dn+".bindBuffer(34963,"+Nr+".buffer.buffer);")):(Nr=ri.def(),ri(Nr,"=",Zn,".","elements",";","if(",Nr,"){",Dn,".bindBuffer(",34963,",",Nr,".buffer.buffer);}","else if(",Tn.vao,".currentVAO){",Nr,"=",jt.shared.elements+".getElements("+Tn.vao,".currentVAO.elements);",nr?"":"if("+Nr+")"+Dn+".bindBuffer(34963,"+Nr+".buffer.buffer);","}")),Nr}(),or=Un("primitive"),xr=Un("offset"),wr=function(){var Nr=Yn.count,ri=fn;return Nr?((Nr.contextDep&&$n.contextDynamic||Nr.propDep)&&(ri=yn),Nr=Nr.append(jt,ri)):Nr=ri.def(Zn,".","count"),Nr}();if(typeof wr=="number"){if(wr===0)return}else yn("if(",wr,"){"),yn.exit("}");Mn&&(wn=Un("instances"),kn=jt.instancing);var kr=ir+".type",Dr=Yn.elements&&re(Yn.elements)&&!Yn.vaoActive;Mn&&(typeof wn!="number"||0<=wn)?typeof wn=="string"?(yn("if(",wn,">0){"),Nn(),yn("}else if(",wn,"<0){"),Rn(),yn("}")):Nn():Rn()}function ar(jt,fn,yn,$n,Un){return Un=(fn=It()).proc("body",Un),Mn&&(fn.instancing=Un.def(fn.shared.extensions,".angle_instanced_arrays")),jt(fn,Un,yn,$n),fn.compile().body}function Or(jt,fn,yn,$n){gn(jt,fn),yn.useVAO?yn.drawVAO?fn(jt.shared.vao,".setVAO(",yn.drawVAO.append(jt,fn),");"):fn(jt.shared.vao,".setVAO(",jt.shared.vao,".targetVAO);"):(fn(jt.shared.vao,".setVAO(null);"),In(jt,fn,yn,$n.attributes,function(){return!0})),Hn(jt,fn,yn,$n.uniforms,function(){return!0},!1),Wn(jt,fn,fn,yn)}function vr(jt,fn,yn,$n){function Un(){return!0}jt.batchId="a1",gn(jt,fn),In(jt,fn,yn,$n.attributes,Un),Hn(jt,fn,yn,$n.uniforms,Un,!1),Wn(jt,fn,fn,yn)}function Er(jt,fn,yn,$n){function Un(Zn){return Zn.contextDep&&Rn||Zn.propDep}function Nn(Zn){return!Un(Zn)}gn(jt,fn);var Rn=yn.contextDep,wn=fn.def(),kn=fn.def();jt.shared.props=kn,jt.batchId=wn;var Tn=jt.scope(),Dn=jt.scope();fn(Tn.entry,"for(",wn,"=0;",wn,"<","a1",";++",wn,"){",kn,"=","a0","[",wn,"];",Dn,"}",Tn.exit),yn.needsContext&&pn(jt,Dn,yn.context),yn.needsFramebuffer&&tn(jt,Dn,yn.framebuffer),sn(jt,Dn,yn.state,Un),yn.profile&&Un(yn.profile)&&bn(jt,Dn,yn,!1,!0),$n?(yn.useVAO?yn.drawVAO?Un(yn.drawVAO)?Dn(jt.shared.vao,".setVAO(",yn.drawVAO.append(jt,Dn),");"):Tn(jt.shared.vao,".setVAO(",yn.drawVAO.append(jt,Tn),");"):Tn(jt.shared.vao,".setVAO(",jt.shared.vao,".targetVAO);"):(Tn(jt.shared.vao,".setVAO(null);"),In(jt,Tn,yn,$n.attributes,Nn),In(jt,Dn,yn,$n.attributes,Un)),Hn(jt,Tn,yn,$n.uniforms,Nn,!1),Hn(jt,Dn,yn,$n.uniforms,Un,!0),Wn(jt,Tn,Dn,yn)):(fn=jt.global.def("{}"),$n=yn.shader.progVar.append(jt,Dn),kn=Dn.def($n,".id"),Tn=Dn.def(fn,"[",kn,"]"),Dn(jt.shared.gl,".useProgram(",$n,".program);","if(!",Tn,"){",Tn,"=",fn,"[",kn,"]=",jt.link(function(Zn){return ar(vr,jt,yn,Zn,2)}),"(",$n,");}",Tn,".call(this,a0[",wn,"],",wn,");"))}function Kn(jt,fn){function yn(wn){var kn=fn.shader[wn];kn&&(kn=kn.append(jt,$n),isNaN(kn)?$n.set(Un.shader,"."+wn,kn):$n.set(Un.shader,"."+wn,jt.link(kn,{stable:!0})))}var $n=jt.proc("scope",3);jt.batchId="a2";var Un=jt.shared,Nn=Un.current;if(pn(jt,$n,fn.context),fn.framebuffer&&fn.framebuffer.append(jt,$n),Y(Object.keys(fn.state)).forEach(function(wn){var kn=fn.state[wn],Tn=kn.append(jt,$n);k(Tn)?Tn.forEach(function(Dn,Zn){isNaN(Dn)?$n.set(jt.next[wn],"["+Zn+"]",Dn):$n.set(jt.next[wn],"["+Zn+"]",jt.link(Dn,{stable:!0}))}):re(kn)?$n.set(Un.next,"."+wn,jt.link(Tn,{stable:!0})):$n.set(Un.next,"."+wn,Tn)}),bn(jt,$n,fn,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(wn){var kn=fn.draw[wn];kn&&(kn=kn.append(jt,$n),isNaN(kn)?$n.set(Un.draw,"."+wn,kn):$n.set(Un.draw,"."+wn,jt.link(kn),{stable:!0}))}),Object.keys(fn.uniforms).forEach(function(wn){var kn=fn.uniforms[wn].append(jt,$n);Array.isArray(kn)&&(kn="["+kn.map(function(Tn){return isNaN(Tn)?Tn:jt.link(Tn,{stable:!0})})+"]"),$n.set(Un.uniforms,"["+jt.link(De.id(wn),{stable:!0})+"]",kn)}),Object.keys(fn.attributes).forEach(function(wn){var kn=fn.attributes[wn].append(jt,$n),Tn=jt.scopeAttrib(wn);Object.keys(new lr).forEach(function(Dn){$n.set(Tn,"."+Dn,kn[Dn])})}),fn.scopeVAO){var Rn=fn.scopeVAO.append(jt,$n);isNaN(Rn)?$n.set(Un.vao,".targetVAO",Rn):$n.set(Un.vao,".targetVAO",jt.link(Rn,{stable:!0}))}yn("vert"),yn("frag"),0=--this.refCount&&kt(this)},lt.profile&&(rt.getTotalRenderbufferSize=function(){var bt=0;return Object.keys(tt).forEach(function(zt){bt+=tt[zt].stats.size}),bt}),{create:function(bt,zt){function St(Le,Je){var st=0,Et=0,It=32854;if(typeof Le=="object"&&Le?("shape"in Le?(st=0|(Et=Le.shape)[0],Et=0|Et[1]):("radius"in Le&&(st=Et=0|Le.radius),"width"in Le&&(st=0|Le.width),"height"in Le&&(Et=0|Le.height)),"format"in Le&&(It=wt[Le.format])):typeof Le=="number"?(st=0|Le,Et=typeof Je=="number"?0|Je:st):Le||(st=Et=1),st!==Dt.width||Et!==Dt.height||It!==Dt.format)return St.width=Dt.width=st,St.height=Dt.height=Et,Dt.format=It,Ae.bindRenderbuffer(36161,Dt.renderbuffer),Ae.renderbufferStorage(36161,It,st,Et),lt.profile&&(Dt.stats.size=At[Dt.format]*Dt.width*Dt.height),St.format=Vt[Dt.format],St}var Dt=new ot(Ae.createRenderbuffer());return tt[Dt.id]=Dt,rt.renderbufferCount++,St(bt,zt),St.resize=function(Le,Je){var st=0|Le,Et=0|Je||st;return st===Dt.width&&Et===Dt.height||(St.width=Dt.width=st,St.height=Dt.height=Et,Ae.bindRenderbuffer(36161,Dt.renderbuffer),Ae.renderbufferStorage(36161,Dt.format,st,Et),lt.profile&&(Dt.stats.size=At[Dt.format]*Dt.width*Dt.height)),St},St._reglType="renderbuffer",St._renderbuffer=Dt,lt.profile&&(St.stats=Dt.stats),St.destroy=function(){Dt.decRef()},St},clear:function(){fe(tt).forEach(kt)},restore:function(){fe(tt).forEach(function(bt){bt.renderbuffer=Ae.createRenderbuffer(),Ae.bindRenderbuffer(36161,bt.renderbuffer),Ae.renderbufferStorage(36161,bt.format,bt.width,bt.height)}),Ae.bindRenderbuffer(36161,null)}}},et=[];et[6408]=4,et[6407]=3;var Ot=[];Ot[5121]=1,Ot[5126]=4,Ot[36193]=2;var Wt=[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],Jt=["x","y","z","w"],Be="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Ge={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},Tt={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},dt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Pe={cw:2304,ccw:2305},Ie=new Z(!1,!1,!1,function(){});return function(Ae){function De(){if(vr.length===0)Zt&&Zt.update(),lr=null;else{lr=ie.next(De),tt();for(var Mn=vr.length-1;0<=Mn;--Mn){var rr=vr[Mn];rr&&rr(zn,null,0)}St.flush(),Zt&&Zt.update()}}function He(){!lr&&0=vr.length&&rt()}}}}function Ut(){var Mn=ar.viewport,rr=ar.scissor_box;Mn[0]=Mn[1]=rr[0]=rr[1]=0,zn.viewportWidth=zn.framebufferWidth=zn.drawingBufferWidth=Mn[2]=rr[2]=St.drawingBufferWidth,zn.viewportHeight=zn.framebufferHeight=zn.drawingBufferHeight=Mn[3]=rr[3]=St.drawingBufferHeight}function tt(){zn.tick+=1,zn.time=zt(),Ut(),Wn.procs.poll()}function bt(){bn.refresh(),Ut(),Wn.procs.refresh(),Zt&&Zt.update()}function zt(){return(ae()-Kt)/1e3}if(!(Ae=i(Ae)))return null;var St=Ae.gl,Dt=St.getContextAttributes();St.isContextLost();var Le=function(Mn,rr){function nr(pr){var qr;pr=pr.toLowerCase();try{qr=Bn[pr]=Mn.getExtension(pr)}catch{}return!!qr}for(var Bn={},Fr=0;Frrr;++rr)Wr(H({framebuffer:Mn.framebuffer.faces[rr]},Mn),wt);else Wr(Mn,wt);else wt(0,Mn)},prop:ee.define.bind(null,1),context:ee.define.bind(null,2),this:ee.define.bind(null,3),draw:kt({}),buffer:function(Mn){return tn.create(Mn,34962,!1,!1)},elements:function(Mn){return nn.create(Mn,!1)},texture:bn.create2D,cube:bn.createCube,renderbuffer:In.create,framebuffer:Hn.create,framebufferCube:Hn.createCube,vao:sn.createVAO,attributes:Dt,frame:Vt,on:function(Mn,rr){var nr;switch(Mn){case"frame":return Vt(rr);case"lost":nr=Er;break;case"restore":nr=Kn;break;case"destroy":nr=Ln}return nr.push(rr),{cancel:function(){for(var Bn=0;Bn2?"one of ".concat(i," ").concat(c.slice(0,s-1).join(", "),", or ")+c[s-1]:s===2?"one of ".concat(i," ").concat(c[0]," or ").concat(c[1]):"of ".concat(i," ").concat(c[0])}return"of ".concat(i," ").concat(String(c))}a("ERR_INVALID_OPT_VALUE",function(c,i){return'The value "'+i+'" is invalid for option "'+c+'"'},TypeError),a("ERR_INVALID_ARG_TYPE",function(c,i,s){var l,d,h;if(typeof i=="string"&&(d="not ",i.substr(0,d.length)===d)?(l="must not be",i=i.replace(/^not /,"")):l="must be",function(g,p,v){return(v===void 0||v>g.length)&&(v=g.length),g.substring(v-p.length,v)===p}(c," argument"))h="The ".concat(c," ").concat(l," ").concat(u(i,"type"));else{var m=function(g,p,v){return typeof v!="number"&&(v=0),!(v+p.length>g.length)&&g.indexOf(p,v)!==-1}(c,".")?"property":"argument";h='The "'.concat(c,'" ').concat(m," ").concat(l," ").concat(u(i,"type"))}return h+=". Received type ".concat(typeof s)},TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",function(c){return"The "+c+" method is not implemented"}),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",function(c){return"Cannot call "+c+" after a stream was destroyed"}),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",function(c){return"Unknown encoding: "+c},TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),o.exports.codes=r},{}],287:[function(e,o,f){(function(r){(function(){var a=Object.keys||function(g){var p=[];for(var v in g)p.push(v);return p};o.exports=d;var u=e("./_stream_readable"),c=e("./_stream_writable");e("inherits")(d,u);for(var i=a(c.prototype),s=0;s0)if(typeof q=="string"||ee.objectMode||Object.getPrototypeOf(q)===s.prototype||(q=function(ie){return s.from(ie)}(q)),ne)ee.endEmitted?M(U,new _):O(U,ee,q,!0);else if(ee.ended)M(U,new b);else{if(ee.destroyed)return!1;ee.reading=!1,ee.decoder&&!$?(q=ee.decoder.write(q),ee.objectMode||q.length!==0?O(U,ee,q,!1):P(U,ee)):O(U,ee,q,!1)}else ne||(ee.reading=!1,P(U,ee));return!ee.ended&&(ee.lengthq.highWaterMark&&(q.highWaterMark=function($){return $>=1073741824?$=1073741824:($--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++),$}(U)),U<=q.length?U:q.ended?q.length:(q.needReadable=!0,0))}function z(U){var q=U._readableState;d("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(d("emitReadable",q.flowing),q.emittedReadable=!0,r.nextTick(L,U))}function L(U){var q=U._readableState;d("emitReadable_",q.destroyed,q.length,q.ended),q.destroyed||!q.length&&!q.ended||(U.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,K(U)}function P(U,q){q.readingMore||(q.readingMore=!0,r.nextTick(N,U,q))}function N(U,q){for(;!q.reading&&!q.ended&&(q.length0,q.resumeScheduled&&!q.paused?q.flowing=!0:U.listenerCount("data")>0&&U.resume()}function G(U){d("readable nexttick read 0"),U.read(0)}function W(U,q){d("resume",q.reading),q.reading||U.read(0),q.resumeScheduled=!1,U.emit("resume"),K(U),q.flowing&&!q.reading&&U.read(0)}function K(U){var q=U._readableState;for(d("flow",q.flowing);q.flowing&&U.read()!==null;);}function te(U,q){return q.length===0?null:(q.objectMode?$=q.buffer.shift():!U||U>=q.length?($=q.decoder?q.buffer.join(""):q.buffer.length===1?q.buffer.first():q.buffer.concat(q.length),q.buffer.clear()):$=q.buffer.consume(U,q.decoder),$);var $}function Y(U){var q=U._readableState;d("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,r.nextTick(Z,q,U))}function Z(U,q){if(d("endReadableNT",U.endEmitted,U.length),!U.endEmitted&&U.length===0&&(U.endEmitted=!0,q.readable=!1,q.emit("end"),U.autoDestroy)){var $=q._writableState;(!$||$.autoDestroy&&$.finished)&&q.destroy()}}function re(U,q){for(var $=0,ne=U.length;$=q.highWaterMark:q.length>0)||q.ended))return d("read: emitReadable",q.length,q.ended),q.length===0&&q.ended?Y(this):z(this),null;if((U=R(U,q))===0&&q.ended)return q.length===0&&Y(this),null;var ne,H=q.needReadable;return d("need readable",H),(q.length===0||q.length-U0?te(U,q):null)===null?(q.needReadable=q.length<=q.highWaterMark,U=0):(q.length-=U,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),$!==U&&q.ended&&Y(this)),ne!==null&&this.emit("data",ne),ne},E.prototype._read=function(U){M(this,new T("_read()"))},E.prototype.pipe=function(U,q){var $=this,ne=this._readableState;switch(ne.pipesCount){case 0:ne.pipes=U;break;case 1:ne.pipes=[ne.pipes,U];break;default:ne.pipes.push(U)}ne.pipesCount+=1,d("pipe count=%d opts=%j",ne.pipesCount,q);var H=(!q||q.end!==!1)&&U!==r.stdout&&U!==r.stderr?ee:me;function Q(_e,we){d("onunpipe"),_e===$&&we&&we.hasUnpiped===!1&&(we.hasUnpiped=!0,d("cleanup"),U.removeListener("close",ge),U.removeListener("finish",fe),U.removeListener("drain",ie),U.removeListener("error",le),U.removeListener("unpipe",Q),$.removeListener("end",ee),$.removeListener("end",me),$.removeListener("data",ue),ae=!0,!ne.awaitDrain||U._writableState&&!U._writableState.needDrain||ie())}function ee(){d("onend"),U.end()}ne.endEmitted?r.nextTick(H):$.once("end",H),U.on("unpipe",Q);var ie=function(_e){return function(){var we=_e._readableState;d("pipeOnDrain",we.awaitDrain),we.awaitDrain&&we.awaitDrain--,we.awaitDrain===0&&c(_e,"data")&&(we.flowing=!0,K(_e))}}($);U.on("drain",ie);var ae=!1;function ue(_e){d("ondata");var we=U.write(_e);d("dest.write",we),we===!1&&((ne.pipesCount===1&&ne.pipes===U||ne.pipesCount>1&&re(ne.pipes,U)!==-1)&&!ae&&(d("false write response, pause",ne.awaitDrain),ne.awaitDrain++),$.pause())}function le(_e){d("onerror",_e),me(),U.removeListener("error",le),c(U,"error")===0&&M(U,_e)}function ge(){U.removeListener("finish",fe),me()}function fe(){d("onfinish"),U.removeListener("close",ge),me()}function me(){d("unpipe"),$.unpipe(U)}return $.on("data",ue),function(_e,we,Te){if(typeof _e.prependListener=="function")return _e.prependListener(we,Te);_e._events&&_e._events[we]?Array.isArray(_e._events[we])?_e._events[we].unshift(Te):_e._events[we]=[Te,_e._events[we]]:_e.on(we,Te)}(U,"error",le),U.once("close",ge),U.once("finish",fe),U.emit("pipe",$),ne.flowing||(d("pipe resume"),$.resume()),U},E.prototype.unpipe=function(U){var q=this._readableState,$={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return U&&U!==q.pipes||(U||(U=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,U&&U.emit("unpipe",this,$)),this;if(!U){var ne=q.pipes,H=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var Q=0;Q0,ne.flowing!==!1&&this.resume()):U==="readable"&&(ne.endEmitted||ne.readableListening||(ne.readableListening=ne.needReadable=!0,ne.flowing=!1,ne.emittedReadable=!1,d("on readable",ne.length,ne.reading),ne.length?z(this):ne.reading||r.nextTick(G,this))),$},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(U,q){var $=i.prototype.removeListener.call(this,U,q);return U==="readable"&&r.nextTick(B,this),$},E.prototype.removeAllListeners=function(U){var q=i.prototype.removeAllListeners.apply(this,arguments);return U!=="readable"&&U!==void 0||r.nextTick(B,this),q},E.prototype.resume=function(){var U=this._readableState;return U.flowing||(d("resume"),U.flowing=!U.readableListening,function(q,$){$.resumeScheduled||($.resumeScheduled=!0,r.nextTick(W,q,$))}(this,U)),U.paused=!1,this},E.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(U){var q=this,$=this._readableState,ne=!1;for(var H in U.on("end",function(){if(d("wrapped end"),$.decoder&&!$.ended){var ee=$.decoder.end();ee&&ee.length&&q.push(ee)}q.push(null)}),U.on("data",function(ee){d("wrapped data"),$.decoder&&(ee=$.decoder.write(ee)),$.objectMode&&ee==null||($.objectMode||ee&&ee.length)&&(q.push(ee)||(ne=!0,U.pause()))}),U)this[H]===void 0&&typeof U[H]=="function"&&(this[H]=function(ee){return function(){return U[ee].apply(U,arguments)}}(H));for(var Q=0;Q-1))throw new _(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(N,B,G){G(new y("_write()"))},E.prototype._writev=null,E.prototype.end=function(N,B,G){var W=this._writableState;return typeof N=="function"?(G=N,N=null,B=null):typeof B=="function"&&(G=B,B=null),N!=null&&this.write(N,B),W.corked&&(W.corked=1,this.uncork()),W.ending||function(K,te,Y){te.ending=!0,P(K,te),Y&&(te.finished?r.nextTick(Y):K.once("finish",Y)),te.ended=!0,K.writable=!1}(this,W,G),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(N){this._writableState&&(this._writableState.destroyed=N)}}),E.prototype.destroy=m.destroy,E.prototype._undestroy=m.undestroy,E.prototype._destroy=function(N,B){B(N)}}).call(this)}).call(this,e("_process"),typeof Ro<"u"?Ro:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":286,"./_stream_duplex":287,"./internal/streams/destroy":294,"./internal/streams/state":298,"./internal/streams/stream":299,_process:277,buffer:85,inherits:231,"util-deprecate":330}],292:[function(e,o,f){(function(r){(function(){var a;function u(k,b,T){return b in k?Object.defineProperty(k,b,{value:T,enumerable:!0,configurable:!0,writable:!0}):k[b]=T,k}var c=e("./end-of-stream"),i=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),d=Symbol("ended"),h=Symbol("lastPromise"),m=Symbol("handlePromise"),g=Symbol("stream");function p(k,b){return{value:k,done:b}}function v(k){var b=k[i];if(b!==null){var T=k[g].read();T!==null&&(k[h]=null,k[i]=null,k[s]=null,b(p(T,!1)))}}function y(k){r.nextTick(v,k)}var x=Object.getPrototypeOf(function(){}),w=Object.setPrototypeOf((u(a={get stream(){return this[g]},next:function(){var k=this,b=this[l];if(b!==null)return Promise.reject(b);if(this[d])return Promise.resolve(p(void 0,!0));if(this[g].destroyed)return new Promise(function(A,S){r.nextTick(function(){k[l]?S(k[l]):A(p(void 0,!0))})});var T,_=this[h];if(_)T=new Promise(function(A,S){return function(E,D){A.then(function(){S[d]?E(p(void 0,!0)):S[m](E,D)},D)}}(_,this));else{var M=this[g].read();if(M!==null)return Promise.resolve(p(M,!1));T=new Promise(this[m])}return this[h]=T,T}},Symbol.asyncIterator,function(){return this}),u(a,"return",function(){var k=this;return new Promise(function(b,T){k[g].destroy(null,function(_){_?T(_):b(p(void 0,!0))})})}),a),x);o.exports=function(k){var b,T=Object.create(w,(u(b={},g,{value:k,writable:!0}),u(b,i,{value:null,writable:!0}),u(b,s,{value:null,writable:!0}),u(b,l,{value:null,writable:!0}),u(b,d,{value:k._readableState.endEmitted,writable:!0}),u(b,m,{value:function(_,M){var A=T[g].read();A?(T[h]=null,T[i]=null,T[s]=null,_(p(A,!1))):(T[i]=_,T[s]=M)},writable:!0}),b));return T[h]=null,c(k,function(_){if(_&&_.code!=="ERR_STREAM_PREMATURE_CLOSE"){var M=T[s];return M!==null&&(T[h]=null,T[i]=null,T[s]=null,M(_)),void(T[l]=_)}var A=T[i];A!==null&&(T[h]=null,T[i]=null,T[s]=null,A(p(void 0,!0))),T[d]=!0}),k.on("readable",y.bind(null,T)),T}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":295,_process:277}],293:[function(e,o,f){function r(l,d){var h=Object.keys(l);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(l);d&&(m=m.filter(function(g){return Object.getOwnPropertyDescriptor(l,g).enumerable})),h.push.apply(h,m)}return h}function a(l,d,h){return d in l?Object.defineProperty(l,d,{value:h,enumerable:!0,configurable:!0,writable:!0}):l[d]=h,l}function u(l,d){for(var h=0;h0?this.tail.next=g:this.head=g,this.tail=g,++this.length}},{key:"unshift",value:function(m){var g={data:m,next:this.head};this.length===0&&(this.tail=g),this.head=g,++this.length}},{key:"shift",value:function(){if(this.length!==0){var m=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,m}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(m){if(this.length===0)return"";for(var g=this.head,p=""+g.data;g=g.next;)p+=m+g.data;return p}},{key:"concat",value:function(m){if(this.length===0)return c.alloc(0);for(var g,p,v,y=c.allocUnsafe(m>>>0),x=this.head,w=0;x;)g=x.data,p=y,v=w,c.prototype.copy.call(g,p,v),w+=x.data.length,x=x.next;return y}},{key:"consume",value:function(m,g){var p;return my.length?y.length:m;if(x===y.length?v+=y:v+=y.slice(0,m),(m-=x)==0){x===y.length?(++p,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=y.slice(x));break}++p}return this.length-=p,v}},{key:"_getBuffer",value:function(m){var g=c.allocUnsafe(m),p=this.head,v=1;for(p.data.copy(g),m-=p.data.length;p=p.next;){var y=p.data,x=m>y.length?y.length:m;if(y.copy(g,g.length-m,0,x),(m-=x)==0){x===y.length?(++v,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=y.slice(x));break}++v}return this.length-=v,g}},{key:s,value:function(m,g){return i(this,function(p){for(var v=1;v0,function(T){v||(v=T),T&&x.forEach(l),b||(x.forEach(l),y(v))})});return g.reduce(d)}},{"../../../errors":286,"./end-of-stream":295}],298:[function(e,o,f){var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;o.exports={getHighWaterMark:function(a,u,c,i){var s=function(l,d,h){return l.highWaterMark!=null?l.highWaterMark:d?l[h]:null}(u,i,c);if(s!=null){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new r(i?c:"highWaterMark",s);return Math.floor(s)}return a.objectMode?16:16384}}},{"../../../errors":286}],299:[function(e,o,f){o.exports=e("events").EventEmitter},{events:84}],300:[function(e,o,f){var r=e("safe-buffer").Buffer,a=r.isEncoding||function(p){switch((p=""+p)&&p.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 u(p){var v;switch(this.encoding=function(y){var x=function(w){if(!w)return"utf8";for(var k;;)switch(w){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 w;default:if(k)return;w=(""+w).toLowerCase(),k=!0}}(y);if(typeof x!="string"&&(r.isEncoding===a||!a(y)))throw new Error("Unknown encoding: "+y);return x||y}(p),this.encoding){case"utf16le":this.text=s,this.end=l,v=4;break;case"utf8":this.fillLast=i,v=4;break;case"base64":this.text=d,this.end=h,v=3;break;default:return this.write=m,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(v)}function c(p){return p<=127?0:p>>5==6?2:p>>4==14?3:p>>3==30?4:p>>6==2?-1:-2}function i(p){var v=this.lastTotal-this.lastNeed,y=function(x,w,k){if((192&w[0])!=128)return x.lastNeed=0,"\uFFFD";if(x.lastNeed>1&&w.length>1){if((192&w[1])!=128)return x.lastNeed=1,"\uFFFD";if(x.lastNeed>2&&w.length>2&&(192&w[2])!=128)return x.lastNeed=2,"\uFFFD"}}(this,p);return y!==void 0?y:this.lastNeed<=p.length?(p.copy(this.lastChar,v,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(p.copy(this.lastChar,v,0,p.length),void(this.lastNeed-=p.length))}function s(p,v){if((p.length-v)%2==0){var y=p.toString("utf16le",v);if(y){var x=y.charCodeAt(y.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",v,p.length-1)}function l(p){var v=p&&p.length?this.write(p):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return v+this.lastChar.toString("utf16le",0,y)}return v}function d(p,v){var y=(p.length-v)%3;return y===0?p.toString("base64",v):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",v,p.length-y))}function h(p){var v=p&&p.length?this.write(p):"";return this.lastNeed?v+this.lastChar.toString("base64",0,3-this.lastNeed):v}function m(p){return p.toString(this.encoding)}function g(p){return p&&p.length?this.write(p):""}f.StringDecoder=u,u.prototype.write=function(p){if(p.length===0)return"";var v,y;if(this.lastNeed){if((v=this.fillLast(p))===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y=0?(_>0&&(w.lastNeed=_-1),_):--T=0?(_>0&&(w.lastNeed=_-2),_):--T=0?(_>0&&(_===2?_=0:w.lastNeed=_-3),_):0}(this,p,v);if(!this.lastNeed)return p.toString("utf8",v);this.lastTotal=y;var x=p.length-(y-this.lastNeed);return p.copy(this.lastChar,0,x),p.toString("utf8",v,x)},u.prototype.fillLast=function(p){if(this.lastNeed<=p.length)return p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,p.length),this.lastNeed-=p.length}},{"safe-buffer":284}],301:[function(e,o,f){(function(r,a){(function(){var u=e("assert"),c=e("debug")("stream-parser");o.exports=function(y){var x=y&&typeof y._transform=="function",w=y&&typeof y._write=="function";if(!x&&!w)throw new Error("must pass a Writable or Transform stream in");c("extending Parser into stream"),y._bytes=s,y._skipBytes=l,x&&(y._passthrough=d),x?y._transform=m:y._write=h};function i(y){c("initializing parser stream"),y._parserBytesLeft=0,y._parserBuffers=[],y._parserBuffered=0,y._parserState=-1,y._parserCallback=null,typeof y.push=="function"&&(y._parserOutput=y.push.bind(y)),y._parserInit=!0}function s(y,x){u(!this._parserCallback,'there is already a "callback" set!'),u(isFinite(y)&&y>0,'can only buffer a finite number of bytes > 0, got "'+y+'"'),this._parserInit||i(this),c("buffering %o bytes",y),this._parserBytesLeft=y,this._parserCallback=x,this._parserState=0}function l(y,x){u(!this._parserCallback,'there is already a "callback" set!'),u(y>0,'can only skip > 0 bytes, got "'+y+'"'),this._parserInit||i(this),c("skipping %o bytes",y),this._parserBytesLeft=y,this._parserCallback=x,this._parserState=1}function d(y,x){u(!this._parserCallback,'There is already a "callback" set!'),u(y>0,'can only pass through > 0 bytes, got "'+y+'"'),this._parserInit||i(this),c("passing through %o bytes",y),this._parserBytesLeft=y,this._parserCallback=x,this._parserState=2}function h(y,x,w){this._parserInit||i(this),c("write(%o bytes)",y.length),typeof x=="function"&&(w=x),p(this,y,null,w)}function m(y,x,w){this._parserInit||i(this),c("transform(%o bytes)",y.length),typeof x!="function"&&(x=this._parserOutput),p(this,y,x,w)}function g(y,x,w,k){if(y._parserBytesLeft-=x.length,c("%o bytes left for stream piece",y._parserBytesLeft),y._parserState===0?(y._parserBuffers.push(x),y._parserBuffered+=x.length):y._parserState===2&&w(x),y._parserBytesLeft!==0)return k;var b=y._parserCallback;if(b&&y._parserState===0&&y._parserBuffers.length>1&&(x=a.concat(y._parserBuffers,y._parserBuffered)),y._parserState!==0&&(x=null),y._parserCallback=null,y._parserBuffered=0,y._parserState=-1,y._parserBuffers.splice(0),b){var T=[];x&&T.push(x),w&&T.push(w);var _=b.length>T.length;_&&T.push(v(k));var M=b.apply(y,T);if(!_||k===M)return k}}var p=v(function y(x,w,k,b){return x._parserBytesLeft<=0?b(new Error("got data but not currently parsing anything")):w.length<=x._parserBytesLeft?function(){return g(x,w,k,b)}:function(){var T=w.slice(0,x._parserBytesLeft);return g(x,T,k,function(_){return _?b(_):w.length>T.length?function(){return y(x,w.slice(T.length),k,b)}:void 0})}});function v(y){return function(){for(var x=y.apply(this,arguments);typeof x=="function";)x=x();return x}}}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:277,assert:75,buffer:85,debug:302}],302:[function(e,o,f){(function(r){(function(){function a(){var u;try{u=f.storage.debug}catch{}return!u&&r!==void 0&&"env"in r&&(u=r.env.DEBUG),u}(f=o.exports=e("./debug")).log=function(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},f.formatArgs=function(u){var c=this.useColors;if(u[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+u[0]+(c?"%c ":" ")+"+"+f.humanize(this.diff),!!c){var i="color: "+this.color;u.splice(1,0,i,"color: inherit");var s=0,l=0;u[0].replace(/%[a-zA-Z%]/g,function(d){d!=="%%"&&(s++,d==="%c"&&(l=s))}),u.splice(l,0,i)}},f.save=function(u){try{u==null?f.storage.removeItem("debug"):f.storage.debug=u}catch{}},f.load=a,f.useColors=function(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},f.storage=typeof chrome<"u"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch{}}(),f.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],f.formatters.j=function(u){try{return JSON.stringify(u)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}},f.enable(a())}).call(this)}).call(this,e("_process"))},{"./debug":303,_process:277}],303:[function(e,o,f){var r;function a(u){function c(){if(c.enabled){var i=c,s=+new Date,l=s-(r||s);i.diff=l,i.prev=r,i.curr=s,r=s;for(var d=new Array(arguments.length),h=0;h0)return function(m){if(!((m=String(m)).length>100)){var g=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(m);if(!!g){var p=parseFloat(g[1]);switch((g[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*p;case"days":case"day":case"d":return p*c;case"hours":case"hour":case"hrs":case"hr":case"h":return p*u;case"minutes":case"minute":case"mins":case"min":case"m":return p*a;case"seconds":case"second":case"secs":case"sec":case"s":return p*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}}}(s);if(h==="number"&&isNaN(s)===!1)return l.long?i(d=s,c,"day")||i(d,u,"hour")||i(d,a,"minute")||i(d,r,"second")||d+" ms":function(m){return m>=c?Math.round(m/c)+"d":m>=u?Math.round(m/u)+"h":m>=a?Math.round(m/a)+"m":m>=r?Math.round(m/r)+"s":m+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}},{}],305:[function(e,o,f){var r=e("parenthesis");o.exports=function(a,u,c){if(a==null)throw Error("First argument should be a string");if(u==null)throw Error("Separator should be a string or a RegExp");c?(typeof c=="string"||Array.isArray(c))&&(c={ignore:c}):c={},c.escape==null&&(c.escape=!0),c.ignore==null?c.ignore=["[]","()","{}","<>",'""',"''","``","\u201C\u201D","\xAB\xBB"]:(typeof c.ignore=="string"&&(c.ignore=[c.ignore]),c.ignore=c.ignore.map(function(g){return g.length===1&&(g+=g),g}));var i=r.parse(a,{flat:!0,brackets:c.ignore}),s=i[0].split(u);if(c.escape){for(var l=[],d=0;d0;){k=T[T.length-1];var _=r[k];if(s[k]<_.length){for(var M=s[k];M<_.length;++M){var A=_[M];if(u[A]<0){u[A]=c[A]=g,i[A]=!0,g+=1,b.push(A),T.push(A);break}i[A]&&(c[k]=0|Math.min(c[k],c[A])),l[A]>=0&&d[k].push(l[A])}s[k]=M}else{if(c[k]===u[k]){var S=[],E=[],D=0;for(M=b.length-1;M>=0;--M){var O=b[M];if(i[O]=!1,S.push(O),E.push(d[O]),D+=d[O].length,l[O]=p.length,O===k){b.length=M;break}}p.push(S);var R=new Array(D);for(M=0;M1&&(m=1),m<-1&&(m=-1),(s*h-l*d<0?-1:1)*Math.acos(m)};f.default=function(s){var l=s.px,d=s.py,h=s.cx,m=s.cy,g=s.rx,p=s.ry,v=s.xAxisRotation,y=v===void 0?0:v,x=s.largeArcFlag,w=x===void 0?0:x,k=s.sweepFlag,b=k===void 0?0:k,T=[];if(g===0||p===0)return[];var _=Math.sin(y*a/360),M=Math.cos(y*a/360),A=M*(l-h)/2+_*(d-m)/2,S=-_*(l-h)/2+M*(d-m)/2;if(A===0&&S===0)return[];g=Math.abs(g),p=Math.abs(p);var E=Math.pow(A,2)/Math.pow(g,2)+Math.pow(S,2)/Math.pow(p,2);E>1&&(g*=Math.sqrt(E),p*=Math.sqrt(E));var D=function(W,K,te,Y,Z,re,U,q,$,ne,H,Q){var ee=Math.pow(Z,2),ie=Math.pow(re,2),ae=Math.pow(H,2),ue=Math.pow(Q,2),le=ee*ie-ee*ue-ie*ae;le<0&&(le=0),le/=ee*ue+ie*ae;var ge=(le=Math.sqrt(le)*(U===q?-1:1))*Z/re*Q,fe=le*-re/Z*H,me=ne*ge-$*fe+(W+te)/2,_e=$*ge+ne*fe+(K+Y)/2,we=(H-ge)/Z,Te=(Q-fe)/re,Oe=(-H-ge)/Z,de=(-Q-fe)/re,ye=i(1,0,we,Te),Me=i(we,Te,Oe,de);return q===0&&Me>0&&(Me-=a),q===1&&Me<0&&(Me+=a),[me,_e,ye,Me]}(l,d,h,m,g,p,w,b,_,M,A,S),O=r(D,4),R=O[0],z=O[1],L=O[2],P=O[3],N=Math.abs(P)/(a/4);Math.abs(1-N)<1e-7&&(N=1);var B=Math.max(Math.ceil(N),1);P/=B;for(var G=0;Gl[2]&&(l[2]=m[g+0]),m[g+1]>l[3]&&(l[3]=m[g+1]);return l}},{"abs-svg-path":70,assert:75,"is-svg-path":238,"normalize-svg-path":309,"parse-svg-path":250}],309:[function(e,o,f){o.exports=function(c){for(var i,s=[],l=0,d=0,h=0,m=0,g=null,p=null,v=0,y=0,x=0,w=c.length;x4?(l=k[k.length-4],d=k[k.length-3]):(l=v,d=y),s.push(k)}return s};var r=e("svg-arc-to-cubic-bezier");function a(c,i,s,l){return["C",c,i,s,l,s,l]}function u(c,i,s,l,d,h){return["C",c/3+2/3*s,i/3+2/3*l,d/3+2/3*s,h/3+2/3*l,d,h]}},{"svg-arc-to-cubic-bezier":307}],310:[function(e,o,f){var r,a=e("svg-path-bounds"),u=e("parse-svg-path"),c=e("draw-svg-path"),i=e("is-svg-path"),s=e("bitmap-sdf"),l=document.createElement("canvas"),d=l.getContext("2d");o.exports=function(h,m){if(!i(h))throw Error("Argument should be valid svg path string");m||(m={});var g,p;m.shape?(g=m.shape[0],p=m.shape[1]):(g=l.width=m.w||m.width||200,p=l.height=m.h||m.height||200);var v=Math.min(g,p),y=m.stroke||0,x=m.viewbox||m.viewBox||a(h),w=[g/(x[2]-x[0]),p/(x[3]-x[1])],k=Math.min(w[0]||0,w[1]||0)/2;if(d.fillStyle="black",d.fillRect(0,0,g,p),d.fillStyle="white",y&&(typeof y!="number"&&(y=1),d.strokeStyle=y>0?"white":"black",d.lineWidth=Math.abs(y)),d.translate(.5*g,.5*p),d.scale(k,k),function(){if(r!=null)return r;var _=document.createElement("canvas").getContext("2d");if(_.canvas.width=_.canvas.height=1,!window.Path2D)return r=!1;var M=new Path2D("M0,0h1v1h-1v-1Z");_.fillStyle="black",_.fill(M);var A=_.getImageData(0,0,1,1);return r=A&&A.data&&A.data[3]===255}()){var b=new Path2D(h);d.fill(b),y&&d.stroke(b)}else{var T=u(h);c(d,T),d.fill(),y&&d.stroke()}return d.setTransform(1,0,0,1,0,0),s(d,{cutoff:m.cutoff!=null?m.cutoff:.5,radius:m.radius!=null?m.radius:.5*v})}},{"bitmap-sdf":82,"draw-svg-path":126,"is-svg-path":238,"parse-svg-path":250,"svg-path-bounds":308}],311:[function(e,o,f){(function(r,a){(function(){var u=e("process/browser.js").nextTick,c=Function.prototype.apply,i=Array.prototype.slice,s={},l=0;function d(h,m){this._id=h,this._clearFn=m}f.setTimeout=function(){return new d(c.call(setTimeout,window,arguments),clearTimeout)},f.setInterval=function(){return new d(c.call(setInterval,window,arguments),clearInterval)},f.clearTimeout=f.clearInterval=function(h){h.close()},d.prototype.unref=d.prototype.ref=function(){},d.prototype.close=function(){this._clearFn.call(window,this._id)},f.enroll=function(h,m){clearTimeout(h._idleTimeoutId),h._idleTimeout=m},f.unenroll=function(h){clearTimeout(h._idleTimeoutId),h._idleTimeout=-1},f._unrefActive=f.active=function(h){clearTimeout(h._idleTimeoutId);var m=h._idleTimeout;m>=0&&(h._idleTimeoutId=setTimeout(function(){h._onTimeout&&h._onTimeout()},m))},f.setImmediate=typeof r=="function"?r:function(h){var m=l++,g=!(arguments.length<2)&&i.call(arguments,1);return s[m]=!0,u(function(){s[m]&&(g?h.apply(null,g):h.call(null),f.clearImmediate(m))}),m},f.clearImmediate=typeof a=="function"?a:function(h){delete s[h]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":277,timers:311}],312:[function(e,o,f){(function(r){var a=/^\s+/,u=/\s+$/,c=0,i=r.round,s=r.min,l=r.max,d=r.random;function h($,ne){if(ne=ne||{},($=$||"")instanceof h)return $;if(!(this instanceof h))return new h($,ne);var H=function(Q){var ee={r:0,g:0,b:0},ie=1,ae=null,ue=null,le=null,ge=!1,fe=!1;typeof Q=="string"&&(Q=function(Te){Te=Te.replace(a,"").replace(u,"").toLowerCase();var Oe,de=!1;if(R[Te])Te=R[Te],de=!0;else if(Te=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(Oe=U.rgb.exec(Te))?{r:Oe[1],g:Oe[2],b:Oe[3]}:(Oe=U.rgba.exec(Te))?{r:Oe[1],g:Oe[2],b:Oe[3],a:Oe[4]}:(Oe=U.hsl.exec(Te))?{h:Oe[1],s:Oe[2],l:Oe[3]}:(Oe=U.hsla.exec(Te))?{h:Oe[1],s:Oe[2],l:Oe[3],a:Oe[4]}:(Oe=U.hsv.exec(Te))?{h:Oe[1],s:Oe[2],v:Oe[3]}:(Oe=U.hsva.exec(Te))?{h:Oe[1],s:Oe[2],v:Oe[3],a:Oe[4]}:(Oe=U.hex8.exec(Te))?{r:B(Oe[1]),g:B(Oe[2]),b:B(Oe[3]),a:te(Oe[4]),format:de?"name":"hex8"}:(Oe=U.hex6.exec(Te))?{r:B(Oe[1]),g:B(Oe[2]),b:B(Oe[3]),format:de?"name":"hex"}:(Oe=U.hex4.exec(Te))?{r:B(Oe[1]+""+Oe[1]),g:B(Oe[2]+""+Oe[2]),b:B(Oe[3]+""+Oe[3]),a:te(Oe[4]+""+Oe[4]),format:de?"name":"hex8"}:(Oe=U.hex3.exec(Te))?{r:B(Oe[1]+""+Oe[1]),g:B(Oe[2]+""+Oe[2]),b:B(Oe[3]+""+Oe[3]),format:de?"name":"hex"}:!1}(Q)),typeof Q=="object"&&(q(Q.r)&&q(Q.g)&&q(Q.b)?(me=Q.r,_e=Q.g,we=Q.b,ee={r:255*P(me,255),g:255*P(_e,255),b:255*P(we,255)},ge=!0,fe=String(Q.r).substr(-1)==="%"?"prgb":"rgb"):q(Q.h)&&q(Q.s)&&q(Q.v)?(ae=W(Q.s),ue=W(Q.v),ee=function(Te,Oe,de){Te=6*P(Te,360),Oe=P(Oe,100),de=P(de,100);var ye=r.floor(Te),Me=Te-ye,ke=de*(1-Oe),Ee=de*(1-Me*Oe),ze=de*(1-(1-Me)*Oe),Fe=ye%6;return{r:255*[de,Ee,ke,ke,ze,de][Fe],g:255*[ze,de,de,Ee,ke,ke][Fe],b:255*[ke,ke,ze,de,de,Ee][Fe]}}(Q.h,ae,ue),ge=!0,fe="hsv"):q(Q.h)&&q(Q.s)&&q(Q.l)&&(ae=W(Q.s),le=W(Q.l),ee=function(Te,Oe,de){var ye,Me,ke;function Ee(Ve,Ke,Re){return Re<0&&(Re+=1),Re>1&&(Re-=1),Re<1/6?Ve+6*(Ke-Ve)*Re:Re<.5?Ke:Re<2/3?Ve+(Ke-Ve)*(2/3-Re)*6:Ve}if(Te=P(Te,360),Oe=P(Oe,100),de=P(de,100),Oe===0)ye=Me=ke=de;else{var ze=de<.5?de*(1+Oe):de+Oe-de*Oe,Fe=2*de-ze;ye=Ee(Fe,ze,Te+1/3),Me=Ee(Fe,ze,Te),ke=Ee(Fe,ze,Te-1/3)}return{r:255*ye,g:255*Me,b:255*ke}}(Q.h,ae,le),ge=!0,fe="hsl"),Q.hasOwnProperty("a")&&(ie=Q.a));var me,_e,we;return ie=L(ie),{ok:ge,format:Q.format||fe,r:s(255,l(ee.r,0)),g:s(255,l(ee.g,0)),b:s(255,l(ee.b,0)),a:ie}}($);this._originalInput=$,this._r=H.r,this._g=H.g,this._b=H.b,this._a=H.a,this._roundA=i(100*this._a)/100,this._format=ne.format||H.format,this._gradientType=ne.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=H.ok,this._tc_id=c++}function m($,ne,H){$=P($,255),ne=P(ne,255),H=P(H,255);var Q,ee,ie=l($,ne,H),ae=s($,ne,H),ue=(ie+ae)/2;if(ie==ae)Q=ee=0;else{var le=ie-ae;switch(ee=ue>.5?le/(2-ie-ae):le/(ie+ae),ie){case $:Q=(ne-H)/le+(ne>1)+720)%360;--ne;)Q.h=(Q.h+ee)%360,ie.push(h(Q));return ie}function O($,ne){ne=ne||6;for(var H=h($).toHsv(),Q=H.h,ee=H.s,ie=H.v,ae=[],ue=1/ne;ne--;)ae.push(h({h:Q,s:ee,v:ie})),ie=(ie+ue)%1;return ae}h.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 $=this.toRgb();return(299*$.r+587*$.g+114*$.b)/1e3},getLuminance:function(){var $,ne,H,Q=this.toRgb();return $=Q.r/255,ne=Q.g/255,H=Q.b/255,.2126*($<=.03928?$/12.92:r.pow(($+.055)/1.055,2.4))+.7152*(ne<=.03928?ne/12.92:r.pow((ne+.055)/1.055,2.4))+.0722*(H<=.03928?H/12.92:r.pow((H+.055)/1.055,2.4))},setAlpha:function($){return this._a=L($),this._roundA=i(100*this._a)/100,this},toHsv:function(){var $=g(this._r,this._g,this._b);return{h:360*$.h,s:$.s,v:$.v,a:this._a}},toHsvString:function(){var $=g(this._r,this._g,this._b),ne=i(360*$.h),H=i(100*$.s),Q=i(100*$.v);return this._a==1?"hsv("+ne+", "+H+"%, "+Q+"%)":"hsva("+ne+", "+H+"%, "+Q+"%, "+this._roundA+")"},toHsl:function(){var $=m(this._r,this._g,this._b);return{h:360*$.h,s:$.s,l:$.l,a:this._a}},toHslString:function(){var $=m(this._r,this._g,this._b),ne=i(360*$.h),H=i(100*$.s),Q=i(100*$.l);return this._a==1?"hsl("+ne+", "+H+"%, "+Q+"%)":"hsla("+ne+", "+H+"%, "+Q+"%, "+this._roundA+")"},toHex:function($){return p(this._r,this._g,this._b,$)},toHexString:function($){return"#"+this.toHex($)},toHex8:function($){return function(ne,H,Q,ee,ie){var ae=[G(i(ne).toString(16)),G(i(H).toString(16)),G(i(Q).toString(16)),G(K(ee))];return ie&&ae[0].charAt(0)==ae[0].charAt(1)&&ae[1].charAt(0)==ae[1].charAt(1)&&ae[2].charAt(0)==ae[2].charAt(1)&&ae[3].charAt(0)==ae[3].charAt(1)?ae[0].charAt(0)+ae[1].charAt(0)+ae[2].charAt(0)+ae[3].charAt(0):ae.join("")}(this._r,this._g,this._b,this._a,$)},toHex8String:function($){return"#"+this.toHex8($)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*P(this._r,255))+"%",g:i(100*P(this._g,255))+"%",b:i(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%)":"rgba("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(z[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function($){var ne="#"+v(this._r,this._g,this._b,this._a),H=ne,Q=this._gradientType?"GradientType = 1, ":"";if($){var ee=h($);H="#"+v(ee._r,ee._g,ee._b,ee._a)}return"progid:DXImageTransform.Microsoft.gradient("+Q+"startColorstr="+ne+",endColorstr="+H+")"},toString:function($){var ne=!!$;$=$||this._format;var H=!1,Q=this._a<1&&this._a>=0;return ne||!Q||$!=="hex"&&$!=="hex6"&&$!=="hex3"&&$!=="hex4"&&$!=="hex8"&&$!=="name"?($==="rgb"&&(H=this.toRgbString()),$==="prgb"&&(H=this.toPercentageRgbString()),$!=="hex"&&$!=="hex6"||(H=this.toHexString()),$==="hex3"&&(H=this.toHexString(!0)),$==="hex4"&&(H=this.toHex8String(!0)),$==="hex8"&&(H=this.toHex8String()),$==="name"&&(H=this.toName()),$==="hsl"&&(H=this.toHslString()),$==="hsv"&&(H=this.toHsvString()),H||this.toHexString()):$==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return h(this.toString())},_applyModification:function($,ne){var H=$.apply(null,[this].concat([].slice.call(ne)));return this._r=H._r,this._g=H._g,this._b=H._b,this.setAlpha(H._a),this},lighten:function(){return this._applyModification(k,arguments)},brighten:function(){return this._applyModification(b,arguments)},darken:function(){return this._applyModification(T,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(x,arguments)},greyscale:function(){return this._applyModification(w,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function($,ne){return $.apply(null,[this].concat([].slice.call(ne)))},analogous:function(){return this._applyCombination(D,arguments)},complement:function(){return this._applyCombination(M,arguments)},monochromatic:function(){return this._applyCombination(O,arguments)},splitcomplement:function(){return this._applyCombination(E,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(S,arguments)}},h.fromRatio=function($,ne){if(typeof $=="object"){var H={};for(var Q in $)$.hasOwnProperty(Q)&&(H[Q]=Q==="a"?$[Q]:W($[Q]));$=H}return h($,ne)},h.equals=function($,ne){return!(!$||!ne)&&h($).toRgbString()==h(ne).toRgbString()},h.random=function(){return h.fromRatio({r:d(),g:d(),b:d()})},h.mix=function($,ne,H){H=H===0?0:H||50;var Q=h($).toRgb(),ee=h(ne).toRgb(),ie=H/100;return h({r:(ee.r-Q.r)*ie+Q.r,g:(ee.g-Q.g)*ie+Q.g,b:(ee.b-Q.b)*ie+Q.b,a:(ee.a-Q.a)*ie+Q.a})},h.readability=function($,ne){var H=h($),Q=h(ne);return(r.max(H.getLuminance(),Q.getLuminance())+.05)/(r.min(H.getLuminance(),Q.getLuminance())+.05)},h.isReadable=function($,ne,H){var Q,ee,ie=h.readability($,ne);switch(ee=!1,(Q=function(ae){var ue,le;return ue=((ae=ae||{level:"AA",size:"small"}).level||"AA").toUpperCase(),le=(ae.size||"small").toLowerCase(),ue!=="AA"&&ue!=="AAA"&&(ue="AA"),le!=="small"&&le!=="large"&&(le="small"),{level:ue,size:le}}(H)).level+Q.size){case"AAsmall":case"AAAlarge":ee=ie>=4.5;break;case"AAlarge":ee=ie>=3;break;case"AAAsmall":ee=ie>=7}return ee},h.mostReadable=function($,ne,H){var Q,ee,ie,ae,ue=null,le=0;ee=(H=H||{}).includeFallbackColors,ie=H.level,ae=H.size;for(var ge=0;gele&&(le=Q,ue=h(ne[ge]));return h.isReadable($,ue,{level:ie,size:ae})||!ee?ue:(H.includeFallbackColors=!1,h.mostReadable($,["#fff","#000"],H))};var R=h.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"},z=h.hexNames=function($){var ne={};for(var H in $)$.hasOwnProperty(H)&&(ne[$[H]]=H);return ne}(R);function L($){return $=parseFloat($),(isNaN($)||$<0||$>1)&&($=1),$}function P($,ne){(function(Q){return typeof Q=="string"&&Q.indexOf(".")!=-1&&parseFloat(Q)===1})($)&&($="100%");var H=function(Q){return typeof Q=="string"&&Q.indexOf("%")!=-1}($);return $=s(ne,l(0,parseFloat($))),H&&($=parseInt($*ne,10)/100),r.abs($-ne)<1e-6?1:$%ne/parseFloat(ne)}function N($){return s(1,l(0,$))}function B($){return parseInt($,16)}function G($){return $.length==1?"0"+$:""+$}function W($){return $<=1&&($=100*$+"%"),$}function K($){return r.round(255*parseFloat($)).toString(16)}function te($){return B($)/255}var Y,Z,re,U=(Z="[\\s|\\(]+("+(Y="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Y+")[,|\\s]+("+Y+")\\s*\\)?",re="[\\s|\\(]+("+Y+")[,|\\s]+("+Y+")[,|\\s]+("+Y+")[,|\\s]+("+Y+")\\s*\\)?",{CSS_UNIT:new RegExp(Y),rgb:new RegExp("rgb"+Z),rgba:new RegExp("rgba"+re),hsl:new RegExp("hsl"+Z),hsla:new RegExp("hsla"+re),hsv:new RegExp("hsv"+Z),hsva:new RegExp("hsva"+re),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 q($){return!!U.CSS_UNIT.exec($)}o!==void 0&&o.exports?o.exports=h:window.tinycolor=h})(Math)},{}],313:[function(e,o,f){o.exports=a,o.exports.float32=o.exports.float=a,o.exports.fract32=o.exports.fract=function(u,c){if(u.length){if(u instanceof Float32Array)return new Float32Array(u.length);c instanceof Float32Array||(c=a(u));for(var i=0,s=c.length;ib&&(b=A[0]),A[1]T&&(T=A[1])}function M(A){switch(A.type){case"GeometryCollection":A.geometries.forEach(M);break;case"Point":_(A.coordinates);break;case"MultiPoint":A.coordinates.forEach(_)}}for(y in v.arcs.forEach(function(A){for(var S,E=-1,D=A.length;++Eb&&(b=S[0]),S[1]T&&(T=S[1])}),v.objects)M(v.objects[y]);return[w,k,b,T]}function i(v,y){var x=y.id,w=y.bbox,k=y.properties==null?{}:y.properties,b=s(v,y);return x==null&&w==null?{type:"Feature",properties:k,geometry:b}:w==null?{type:"Feature",id:x,properties:k,geometry:b}:{type:"Feature",id:x,bbox:w,properties:k,geometry:b}}function s(v,y){var x=u(v.transform),w=v.arcs;function k(A,S){S.length&&S.pop();for(var E=w[A<0?~A:A],D=0,O=E.length;D1)w=h(v,y,x);else for(k=0,w=new Array(b=v.arcs.length);k1)for(var S,E,D=1,O=T(A[0]);DO&&(E=A[0],A[0]=A[D],A[D]=E,O=S);return A}).filter(function(_){return _.length>0})}}function g(v,y){for(var x=0,w=v.length;x>>1;v[k]=2))throw new Error("n must be \u22652");var x,w=(_=v.bbox||c(v))[0],k=_[1],b=_[2],T=_[3];y={scale:[b-w?(b-w)/(x-1):1,T-k?(T-k)/(x-1):1],translate:[w,k]}}var _,M,A=p(y),S=v.objects,E={};function D(R){return A(R)}function O(R){var z;switch(R.type){case"GeometryCollection":z={type:"GeometryCollection",geometries:R.geometries.map(O)};break;case"Point":z={type:"Point",coordinates:D(R.coordinates)};break;case"MultiPoint":z={type:"MultiPoint",coordinates:R.coordinates.map(D)};break;default:return R}return R.id!=null&&(z.id=R.id),R.bbox!=null&&(z.bbox=R.bbox),R.properties!=null&&(z.properties=R.properties),z}for(M in S)E[M]=O(S[M]);return{type:"Topology",bbox:_,transform:y,objects:E,arcs:v.arcs.map(function(R){var z,L=0,P=1,N=R.length,B=new Array(N);for(B[0]=A(R[0],0);++L":(c.length>100&&(c=c.slice(0,99)+"\u2026"),c=c.replace(a,function(i){switch(i){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}))}},{"./safe-to-string":318}],320:[function(e,o,f){var r=e("../value/is"),a={object:!0,function:!0,undefined:!0};o.exports=function(u){return!!r(u)&&hasOwnProperty.call(a,typeof u)}},{"../value/is":326}],321:[function(e,o,f){var r=e("../lib/resolve-exception"),a=e("./is");o.exports=function(u){return a(u)?u:r(u,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":317,"./is":322}],322:[function(e,o,f){var r=e("../function/is"),a=/^\s*class[\s{/}]/,u=Function.prototype.toString;o.exports=function(c){return!!r(c)&&!a.test(u.call(c))}},{"../function/is":316}],323:[function(e,o,f){var r=e("../object/is");o.exports=function(a){if(!r(a))return!1;try{return!!a.constructor&&a.constructor.prototype===a}catch{return!1}}},{"../object/is":320}],324:[function(e,o,f){var r=e("../value/is"),a=e("../object/is"),u=Object.prototype.toString;o.exports=function(c){if(!r(c))return null;if(a(c)){var i=c.toString;if(typeof i!="function"||i===u)return null}try{return""+c}catch{return null}}},{"../object/is":320,"../value/is":326}],325:[function(e,o,f){var r=e("../lib/resolve-exception"),a=e("./is");o.exports=function(u){return a(u)?u:r(u,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":317,"./is":326}],326:[function(e,o,f){o.exports=function(r){return r!=null}},{}],327:[function(e,o,f){(function(r){(function(){var a=e("bit-twiddle"),u=e("dup"),c=e("buffer").Buffer;r.__TYPEDARRAY_POOL||(r.__TYPEDARRAY_POOL={UINT8:u([32,0]),UINT16:u([32,0]),UINT32:u([32,0]),BIGUINT64:u([32,0]),INT8:u([32,0]),INT16:u([32,0]),INT32:u([32,0]),BIGINT64:u([32,0]),FLOAT:u([32,0]),DOUBLE:u([32,0]),DATA:u([32,0]),UINT8C:u([32,0]),BUFFER:u([32,0])});var i=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",l=typeof BigInt64Array<"u",d=r.__TYPEDARRAY_POOL;d.UINT8C||(d.UINT8C=u([32,0])),d.BIGUINT64||(d.BIGUINT64=u([32,0])),d.BIGINT64||(d.BIGINT64=u([32,0])),d.BUFFER||(d.BUFFER=u([32,0]));var h=d.DATA,m=d.BUFFER;function g(O){if(O){var R=O.length||O.byteLength,z=a.log2(R);h[z].push(O)}}function p(O){O=a.nextPow2(O);var R=a.log2(O),z=h[R];return z.length>0?z.pop():new ArrayBuffer(O)}function v(O){return new Uint8Array(p(O),0,O)}function y(O){return new Uint16Array(p(2*O),0,O)}function x(O){return new Uint32Array(p(4*O),0,O)}function w(O){return new Int8Array(p(O),0,O)}function k(O){return new Int16Array(p(2*O),0,O)}function b(O){return new Int32Array(p(4*O),0,O)}function T(O){return new Float32Array(p(4*O),0,O)}function _(O){return new Float64Array(p(8*O),0,O)}function M(O){return i?new Uint8ClampedArray(p(O),0,O):v(O)}function A(O){return s?new BigUint64Array(p(8*O),0,O):null}function S(O){return l?new BigInt64Array(p(8*O),0,O):null}function E(O){return new DataView(p(O),0,O)}function D(O){O=a.nextPow2(O);var R=a.log2(O),z=m[R];return z.length>0?z.pop():new c(O)}f.free=function(O){if(c.isBuffer(O))m[a.log2(O.length)].push(O);else{if(Object.prototype.toString.call(O)!=="[object ArrayBuffer]"&&(O=O.buffer),!O)return;var R=O.length||O.byteLength,z=0|a.log2(R);h[z].push(O)}},f.freeUint8=f.freeUint16=f.freeUint32=f.freeBigUint64=f.freeInt8=f.freeInt16=f.freeInt32=f.freeBigInt64=f.freeFloat32=f.freeFloat=f.freeFloat64=f.freeDouble=f.freeUint8Clamped=f.freeDataView=function(O){g(O.buffer)},f.freeArrayBuffer=g,f.freeBuffer=function(O){m[a.log2(O.length)].push(O)},f.malloc=function(O,R){if(R===void 0||R==="arraybuffer")return p(O);switch(R){case"uint8":return v(O);case"uint16":return y(O);case"uint32":return x(O);case"int8":return w(O);case"int16":return k(O);case"int32":return b(O);case"float":case"float32":return T(O);case"double":case"float64":return _(O);case"uint8_clamped":return M(O);case"bigint64":return S(O);case"biguint64":return A(O);case"buffer":return D(O);case"data":case"dataview":return E(O);default:return null}return null},f.mallocArrayBuffer=p,f.mallocUint8=v,f.mallocUint16=y,f.mallocUint32=x,f.mallocInt8=w,f.mallocInt16=k,f.mallocInt32=b,f.mallocFloat32=f.mallocFloat=T,f.mallocFloat64=f.mallocDouble=_,f.mallocUint8Clamped=M,f.mallocBigUint64=A,f.mallocBigInt64=S,f.mallocDataView=E,f.mallocBuffer=D,f.clearCache=function(){for(var O=0;O<32;++O)d.UINT8[O].length=0,d.UINT16[O].length=0,d.UINT32[O].length=0,d.INT8[O].length=0,d.INT16[O].length=0,d.INT32[O].length=0,d.FLOAT[O].length=0,d.DOUBLE[O].length=0,d.BIGUINT64[O].length=0,d.BIGINT64[O].length=0,d.UINT8C[O].length=0,h[O].length=0,m[O].length=0}}).call(this)}).call(this,typeof Ro<"u"?Ro:typeof self<"u"?self:typeof window<"u"?window:{})},{"bit-twiddle":81,buffer:85,dup:128}],328:[function(e,o,f){var r=/[\'\"]/;o.exports=function(a){return a?(r.test(a.charAt(0))&&(a=a.substr(1)),r.test(a.charAt(a.length-1))&&(a=a.substr(0,a.length-1)),a):""}},{}],329:[function(e,o,f){o.exports=function(r,a,u){Array.isArray(u)||(u=[].slice.call(arguments,2));for(var c=0,i=u.length;c2111)throw p.replace(/\{0\}/,this.local.name);return g},toMonthIndex:function(g,p,v){var y=this.intercalaryMonth(g);if(v&&p!==y||p<1||p>12)throw r.local.invalidMonth.replace(/\{0\}/,this.local.name);return y?!v&&p<=y?p-1:p:p-1},toChineseMonth:function(g,p){g.year&&(p=(g=g.year()).month());var v=this.intercalaryMonth(g);if(p<0||p>(v?12:11))throw r.local.invalidMonth.replace(/\{0\}/,this.local.name);return v?p>13},isIntercalaryMonth:function(g,p){g.year&&(p=(g=g.year()).month());var v=this.intercalaryMonth(g);return!!v&&v===p},leapYear:function(g){return this.intercalaryMonth(g)!==0},weekOfYear:function(g,p,v){var y,x=this._validateYear(g,r.local.invalidyear),w=m[x-m[0]],k=w>>9&4095,b=w>>5&15,T=31&w;(y=u.newDate(k,b,T)).add(4-(y.dayOfWeek()||7),"d");var _=this.toJD(g,p,v)-y.toJD();return 1+Math.floor(_/7)},monthsInYear:function(g){return this.leapYear(g)?13:12},daysInMonth:function(g,p){g.year&&(p=g.month(),g=g.year()),g=this._validateYear(g);var v=h[g-h[0]];if(p>(v>>13?12:11))throw r.local.invalidMonth.replace(/\{0\}/,this.local.name);return v&1<<12-p?30:29},weekDay:function(g,p,v){return(this.dayOfWeek(g,p,v)||7)<6},toJD:function(g,p,v){var y=this._validate(g,w,v,r.local.invalidDate);g=this._validateYear(y.year()),p=y.month(),v=y.day();var x=this.isIntercalaryMonth(g,p),w=this.toChineseMonth(g,p),k=function(b,T,_,M,A){var S,E,D;if(typeof b=="object")E=b,S=T||{};else{var O;if(!(typeof b=="number"&&b>=1888&&b<=2111))throw new Error("Lunar year outside range 1888-2111");if(!(typeof T=="number"&&T>=1&&T<=12))throw new Error("Lunar month outside range 1 - 12");if(!(typeof _=="number"&&_>=1&&_<=30))throw new Error("Lunar day outside range 1 - 30");typeof M=="object"?(O=!1,S=M):(O=!!M,S=A||{}),E={year:b,month:T,day:_,isIntercalary:O}}D=E.day-1;var R,z=h[E.year-h[0]],L=z>>13;R=L&&(E.month>L||E.isIntercalary)?E.month:E.month-1;for(var P=0;P>9&4095,(N>>5&15)-1,(31&N)+D);return S.year=B.getFullYear(),S.month=1+B.getMonth(),S.day=B.getDate(),S}(g,w,v,x);return u.toJD(k.year,k.month,k.day)},fromJD:function(g){var p=u.fromJD(g),v=function(x,w,k,b){var T,_;if(typeof x=="object")T=x,_=w||{};else{if(!(typeof x=="number"&&x>=1888&&x<=2111))throw new Error("Solar year outside range 1888-2111");if(!(typeof w=="number"&&w>=1&&w<=12))throw new Error("Solar month outside range 1 - 12");if(!(typeof k=="number"&&k>=1&&k<=31))throw new Error("Solar day outside range 1 - 31");T={year:x,month:w,day:k},_=b||{}}var M=m[T.year-m[0]],A=T.year<<9|T.month<<5|T.day;_.year=A>=M?T.year:T.year-1,M=m[_.year-m[0]];var S,E=new Date(M>>9&4095,(M>>5&15)-1,31&M),D=new Date(T.year,T.month-1,T.day);S=Math.round((D-E)/864e5);var O,R=h[_.year-h[0]];for(O=0;O<13;O++){var z=R&1<<12-O?30:29;if(S>13;return!L||O=2&&d<=6},extraInfo:function(i,s,l){var d=this._validate(i,s,l,r.local.invalidDate);return{century:c[Math.floor((d.year()-1)/100)+1]||""}},toJD:function(i,s,l){var d=this._validate(i,s,l,r.local.invalidDate);return i=d.year()+(d.year()<0?1:0),s=d.month(),(l=d.day())+(s>1?16:0)+(s>2?32*(s-2):0)+400*(i-1)+this.jdEpoch-1},fromJD:function(i){i=Math.floor(i+.5)-Math.floor(this.jdEpoch)-1;var s=Math.floor(i/400)+1;i-=400*(s-1),i+=i>15?16:0;var l=Math.floor(i/32)+1,d=i-32*(l-1)+1;return this.newDate(s<=0?s-1:s,l,d)}});var c={20:"Fruitbat",21:"Anchovy"};r.calendars.discworld=u},{"../main":346,"object-assign":247}],335:[function(e,o,f){var r=e("../main"),a=e("object-assign");function u(c){this.local=this.regionalOptions[c||""]||this.regionalOptions[""]}u.prototype=new r.baseCalendar,a(u.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,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(c){var i=this._validate(c,this.minMonth,this.minDay,r.local.invalidYear);return(c=i.year()+(i.year()<0?1:0))%4==3||c%4==-1},monthsInYear:function(c){return this._validate(c,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),13},weekOfYear:function(c,i,s){var l=this.newDate(c,i,s);return l.add(-l.dayOfWeek(),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInMonth:function(c,i){var s=this._validate(c,i,this.minDay,r.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===13&&this.leapYear(s.year())?1:0)},weekDay:function(c,i,s){return(this.dayOfWeek(c,i,s)||7)<6},toJD:function(c,i,s){var l=this._validate(c,i,s,r.local.invalidDate);return(c=l.year())<0&&c++,l.day()+30*(l.month()-1)+365*(c-1)+Math.floor(c/4)+this.jdEpoch-1},fromJD:function(c){var i=Math.floor(c)+.5-this.jdEpoch,s=Math.floor((i-Math.floor((i+366)/1461))/365)+1;s<=0&&s--,i=Math.floor(c)+.5-this.newDate(s,1,1).toJD();var l=Math.floor(i/30)+1,d=i-30*(l-1)+1;return this.newDate(s,l,d)}}),r.calendars.ethiopian=u},{"../main":346,"object-assign":247}],336:[function(e,o,f){var r=e("../main"),a=e("object-assign");function u(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}function c(i,s){return i-s*Math.floor(i/s)}u.prototype=new r.baseCalendar,a(u.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(i){var s=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear);return this._leapYear(s.year())},_leapYear:function(i){return c(7*(i=i<0?i+1:i)+1,19)<7},monthsInYear:function(i){return this._validate(i,this.minMonth,this.minDay,r.local.invalidYear),this._leapYear(i.year?i.year():i)?13:12},weekOfYear:function(i,s,l){var d=this.newDate(i,s,l);return d.add(-d.dayOfWeek(),"d"),Math.floor((d.dayOfYear()-1)/7)+1},daysInYear:function(i){return i=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear).year(),this.toJD(i===-1?1:i+1,7,1)-this.toJD(i,7,1)},daysInMonth:function(i,s){return i.year&&(s=i.month(),i=i.year()),this._validate(i,s,this.minDay,r.local.invalidMonth),s===12&&this.leapYear(i)||s===8&&c(this.daysInYear(i),10)===5?30:s===9&&c(this.daysInYear(i),10)===3?29:this.daysPerMonth[s-1]},weekDay:function(i,s,l){return this.dayOfWeek(i,s,l)!==6},extraInfo:function(i,s,l){var d=this._validate(i,s,l,r.local.invalidDate);return{yearType:(this.leapYear(d)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(d)%10-3]}},toJD:function(i,s,l){var d=this._validate(i,s,l,r.local.invalidDate);i=d.year(),s=d.month(),l=d.day();var h=i<=0?i+1:i,m=this.jdEpoch+this._delay1(h)+this._delay2(h)+l+1;if(s<7){for(var g=7;g<=this.monthsInYear(i);g++)m+=this.daysInMonth(i,g);for(g=1;g=this.toJD(s===-1?1:s+1,7,1);)s++;for(var l=ithis.toJD(s,l,this.daysInMonth(s,l));)l++;var d=i-this.toJD(s,l,1)+1;return this.newDate(s,l,d)}}),r.calendars.hebrew=u},{"../main":346,"object-assign":247}],337:[function(e,o,f){var r=e("../main"),a=e("object-assign");function u(c){this.local=this.regionalOptions[c||""]||this.regionalOptions[""]}u.prototype=new r.baseCalendar,a(u.prototype,{name:"Islamic",jdEpoch:19484395e-1,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(c){return(11*this._validate(c,this.minMonth,this.minDay,r.local.invalidYear).year()+14)%30<11},weekOfYear:function(c,i,s){var l=this.newDate(c,i,s);return l.add(-l.dayOfWeek(),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInYear:function(c){return this.leapYear(c)?355:354},daysInMonth:function(c,i){var s=this._validate(c,i,this.minDay,r.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===12&&this.leapYear(s.year())?1:0)},weekDay:function(c,i,s){return this.dayOfWeek(c,i,s)!==5},toJD:function(c,i,s){var l=this._validate(c,i,s,r.local.invalidDate);return c=l.year(),i=l.month(),c=c<=0?c+1:c,(s=l.day())+Math.ceil(29.5*(i-1))+354*(c-1)+Math.floor((3+11*c)/30)+this.jdEpoch-1},fromJD:function(c){c=Math.floor(c)+.5;var i=Math.floor((30*(c-this.jdEpoch)+10646)/10631);i=i<=0?i-1:i;var s=Math.min(12,Math.ceil((c-29-this.toJD(i,1,1))/29.5)+1),l=c-this.toJD(i,s,1)+1;return this.newDate(i,s,l)}}),r.calendars.islamic=u},{"../main":346,"object-assign":247}],338:[function(e,o,f){var r=e("../main"),a=e("object-assign");function u(c){this.local=this.regionalOptions[c||""]||this.regionalOptions[""]}u.prototype=new r.baseCalendar,a(u.prototype,{name:"Julian",jdEpoch:17214235e-1,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(c){var i=this._validate(c,this.minMonth,this.minDay,r.local.invalidYear);return(c=i.year()<0?i.year()+1:i.year())%4==0},weekOfYear:function(c,i,s){var l=this.newDate(c,i,s);return l.add(4-(l.dayOfWeek()||7),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInMonth:function(c,i){var s=this._validate(c,i,this.minDay,r.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===2&&this.leapYear(s.year())?1:0)},weekDay:function(c,i,s){return(this.dayOfWeek(c,i,s)||7)<6},toJD:function(c,i,s){var l=this._validate(c,i,s,r.local.invalidDate);return c=l.year(),i=l.month(),s=l.day(),c<0&&c++,i<=2&&(c--,i+=12),Math.floor(365.25*(c+4716))+Math.floor(30.6001*(i+1))+s-1524.5},fromJD:function(c){var i=Math.floor(c+.5)+1524,s=Math.floor((i-122.1)/365.25),l=Math.floor(365.25*s),d=Math.floor((i-l)/30.6001),h=d-Math.floor(d<14?1:13),m=s-Math.floor(h>2?4716:4715),g=i-l-Math.floor(30.6001*d);return m<=0&&m--,this.newDate(m,h,g)}}),r.calendars.julian=u},{"../main":346,"object-assign":247}],339:[function(e,o,f){var r=e("../main"),a=e("object-assign");function u(s){this.local=this.regionalOptions[s||""]||this.regionalOptions[""]}function c(s,l){return s-l*Math.floor(s/l)}function i(s,l){return c(s-1,l)+1}u.prototype=new r.baseCalendar,a(u.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(s){return this._validate(s,this.minMonth,this.minDay,r.local.invalidYear),!1},formatYear:function(s){s=this._validate(s,this.minMonth,this.minDay,r.local.invalidYear).year();var l=Math.floor(s/400);return s%=400,s+=s<0?400:0,l+"."+Math.floor(s/20)+"."+s%20},forYear:function(s){if((s=s.split(".")).length<3)throw"Invalid Mayan year";for(var l=0,d=0;d19||d>0&&h<0)throw"Invalid Mayan year";l=20*l+h}return l},monthsInYear:function(s){return this._validate(s,this.minMonth,this.minDay,r.local.invalidYear),18},weekOfYear:function(s,l,d){return this._validate(s,l,d,r.local.invalidDate),0},daysInYear:function(s){return this._validate(s,this.minMonth,this.minDay,r.local.invalidYear),360},daysInMonth:function(s,l){return this._validate(s,l,this.minDay,r.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(s,l,d){return this._validate(s,l,d,r.local.invalidDate).day()},weekDay:function(s,l,d){return this._validate(s,l,d,r.local.invalidDate),!0},extraInfo:function(s,l,d){var h=this._validate(s,l,d,r.local.invalidDate).toJD(),m=this._toHaab(h),g=this._toTzolkin(h);return{haabMonthName:this.local.haabMonths[m[0]-1],haabMonth:m[0],haabDay:m[1],tzolkinDayName:this.local.tzolkinMonths[g[0]-1],tzolkinDay:g[0],tzolkinTrecena:g[1]}},_toHaab:function(s){var l=c((s-=this.jdEpoch)+8+340,365);return[Math.floor(l/20)+1,c(l,20)]},_toTzolkin:function(s){return[i((s-=this.jdEpoch)+20,20),i(s+4,13)]},toJD:function(s,l,d){var h=this._validate(s,l,d,r.local.invalidDate);return h.day()+20*h.month()+360*h.year()+this.jdEpoch},fromJD:function(s){s=Math.floor(s)+.5-this.jdEpoch;var l=Math.floor(s/360);s%=360,s+=s<0?360:0;var d=Math.floor(s/20),h=s%20;return this.newDate(l,d,h)}}),r.calendars.mayan=u},{"../main":346,"object-assign":247}],340:[function(e,o,f){var r=e("../main"),a=e("object-assign");function u(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}u.prototype=new r.baseCalendar;var c=r.instance("gregorian");a(u.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,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(i){var s=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return c.leapYear(s.year()+(s.year()<1?1:0)+1469)},weekOfYear:function(i,s,l){var d=this.newDate(i,s,l);return d.add(1-(d.dayOfWeek()||7),"d"),Math.floor((d.dayOfYear()-1)/7)+1},daysInMonth:function(i,s){var l=this._validate(i,s,this.minDay,r.local.invalidMonth);return this.daysPerMonth[l.month()-1]+(l.month()===12&&this.leapYear(l.year())?1:0)},weekDay:function(i,s,l){return(this.dayOfWeek(i,s,l)||7)<6},toJD:function(i,s,l){var d=this._validate(i,s,l,r.local.invalidMonth);(i=d.year())<0&&i++;for(var h=d.day(),m=1;m=this.toJD(s+1,1,1);)s++;for(var l=i-Math.floor(this.toJD(s,1,1)+.5)+1,d=1;l>this.daysInMonth(s,d);)l-=this.daysInMonth(s,d),d++;return this.newDate(s,d,l)}}),r.calendars.nanakshahi=u},{"../main":346,"object-assign":247}],341:[function(e,o,f){var r=e("../main"),a=e("object-assign");function u(c){this.local=this.regionalOptions[c||""]||this.regionalOptions[""]}u.prototype=new r.baseCalendar,a(u.prototype,{name:"Nepali",jdEpoch:17007095e-1,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(c){return this.daysInYear(c)!==this.daysPerYear},weekOfYear:function(c,i,s){var l=this.newDate(c,i,s);return l.add(-l.dayOfWeek(),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInYear:function(c){if(c=this._validate(c,this.minMonth,this.minDay,r.local.invalidYear).year(),this.NEPALI_CALENDAR_DATA[c]===void 0)return this.daysPerYear;for(var i=0,s=this.minMonth;s<=12;s++)i+=this.NEPALI_CALENDAR_DATA[c][s];return i},daysInMonth:function(c,i){return c.year&&(i=c.month(),c=c.year()),this._validate(c,i,this.minDay,r.local.invalidMonth),this.NEPALI_CALENDAR_DATA[c]===void 0?this.daysPerMonth[i-1]:this.NEPALI_CALENDAR_DATA[c][i]},weekDay:function(c,i,s){return this.dayOfWeek(c,i,s)!==6},toJD:function(c,i,s){var l=this._validate(c,i,s,r.local.invalidDate);c=l.year(),i=l.month(),s=l.day();var d=r.instance(),h=0,m=i,g=c;this._createMissingCalendarData(c);var p=c-(m>9||m===9&&s>=this.NEPALI_CALENDAR_DATA[g][0]?56:57);for(i!==9&&(h=s,m--);m!==9;)m<=0&&(m=12,g--),h+=this.NEPALI_CALENDAR_DATA[g][m],m--;return i===9?(h+=s-this.NEPALI_CALENDAR_DATA[g][0])<0&&(h+=d.daysInYear(p)):h+=this.NEPALI_CALENDAR_DATA[g][9]-this.NEPALI_CALENDAR_DATA[g][0],d.newDate(p,1,1).add(h,"d").toJD()},fromJD:function(c){var i=r.instance().fromJD(c),s=i.year(),l=i.dayOfYear(),d=s+56;this._createMissingCalendarData(d);for(var h=9,m=this.NEPALI_CALENDAR_DATA[d][0],g=this.NEPALI_CALENDAR_DATA[d][h]-m+1;l>g;)++h>12&&(h=1,d++),g+=this.NEPALI_CALENDAR_DATA[d][h];var p=this.NEPALI_CALENDAR_DATA[d][h]-(g-l);return this.newDate(d,h,p)},_createMissingCalendarData:function(c){var i=this.daysPerMonth.slice(0);i.unshift(17);for(var s=c-1;s0?474:473))%2820+474+38)%2816<682},weekOfYear:function(i,s,l){var d=this.newDate(i,s,l);return d.add(-(d.dayOfWeek()+1)%7,"d"),Math.floor((d.dayOfYear()-1)/7)+1},daysInMonth:function(i,s){var l=this._validate(i,s,this.minDay,r.local.invalidMonth);return this.daysPerMonth[l.month()-1]+(l.month()===12&&this.leapYear(l.year())?1:0)},weekDay:function(i,s,l){return this.dayOfWeek(i,s,l)!==5},toJD:function(i,s,l){var d=this._validate(i,s,l,r.local.invalidDate);i=d.year(),s=d.month(),l=d.day();var h=i-(i>=0?474:473),m=474+c(h,2820);return l+(s<=7?31*(s-1):30*(s-1)+6)+Math.floor((682*m-110)/2816)+365*(m-1)+1029983*Math.floor(h/2820)+this.jdEpoch-1},fromJD:function(i){var s=(i=Math.floor(i)+.5)-this.toJD(475,1,1),l=Math.floor(s/1029983),d=c(s,1029983),h=2820;if(d!==1029982){var m=Math.floor(d/366),g=c(d,366);h=Math.floor((2134*m+2816*g+2815)/1028522)+m+1}var p=h+2820*l+474;p=p<=0?p-1:p;var v=i-this.toJD(p,1,1)+1,y=v<=186?Math.ceil(v/31):Math.ceil((v-6)/30),x=i-this.toJD(p,y,1)+1;return this.newDate(p,y,x)}}),r.calendars.persian=u,r.calendars.jalali=u},{"../main":346,"object-assign":247}],343:[function(e,o,f){var r=e("../main"),a=e("object-assign"),u=r.instance();function c(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}c.prototype=new r.baseCalendar,a(c.prototype,{name:"Taiwan",jdEpoch:24194025e-1,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(i){var s=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear);return i=this._t2gYear(s.year()),u.leapYear(i)},weekOfYear:function(i,s,l){var d=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear);return i=this._t2gYear(d.year()),u.weekOfYear(i,d.month(),d.day())},daysInMonth:function(i,s){var l=this._validate(i,s,this.minDay,r.local.invalidMonth);return this.daysPerMonth[l.month()-1]+(l.month()===2&&this.leapYear(l.year())?1:0)},weekDay:function(i,s,l){return(this.dayOfWeek(i,s,l)||7)<6},toJD:function(i,s,l){var d=this._validate(i,s,l,r.local.invalidDate);return i=this._t2gYear(d.year()),u.toJD(i,d.month(),d.day())},fromJD:function(i){var s=u.fromJD(i),l=this._g2tYear(s.year());return this.newDate(l,s.month(),s.day())},_t2gYear:function(i){return i+this.yearsOffset+(i>=-this.yearsOffset&&i<=-1?1:0)},_g2tYear:function(i){return i-this.yearsOffset-(i>=1&&i<=this.yearsOffset?1:0)}}),r.calendars.taiwan=c},{"../main":346,"object-assign":247}],344:[function(e,o,f){var r=e("../main"),a=e("object-assign"),u=r.instance();function c(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}c.prototype=new r.baseCalendar,a(c.prototype,{name:"Thai",jdEpoch:15230985e-1,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(i){var s=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear);return i=this._t2gYear(s.year()),u.leapYear(i)},weekOfYear:function(i,s,l){var d=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear);return i=this._t2gYear(d.year()),u.weekOfYear(i,d.month(),d.day())},daysInMonth:function(i,s){var l=this._validate(i,s,this.minDay,r.local.invalidMonth);return this.daysPerMonth[l.month()-1]+(l.month()===2&&this.leapYear(l.year())?1:0)},weekDay:function(i,s,l){return(this.dayOfWeek(i,s,l)||7)<6},toJD:function(i,s,l){var d=this._validate(i,s,l,r.local.invalidDate);return i=this._t2gYear(d.year()),u.toJD(i,d.month(),d.day())},fromJD:function(i){var s=u.fromJD(i),l=this._g2tYear(s.year());return this.newDate(l,s.month(),s.day())},_t2gYear:function(i){return i-this.yearsOffset-(i>=1&&i<=this.yearsOffset?1:0)},_g2tYear:function(i){return i+this.yearsOffset+(i>=-this.yearsOffset&&i<=-1?1:0)}}),r.calendars.thai=c},{"../main":346,"object-assign":247}],345:[function(e,o,f){var r=e("../main"),a=e("object-assign");function u(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}u.prototype=new r.baseCalendar,a(u.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(i){var s=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear);return this.daysInYear(s.year())===355},weekOfYear:function(i,s,l){var d=this.newDate(i,s,l);return d.add(-d.dayOfWeek(),"d"),Math.floor((d.dayOfYear()-1)/7)+1},daysInYear:function(i){for(var s=0,l=1;l<=12;l++)s+=this.daysInMonth(i,l);return s},daysInMonth:function(i,s){for(var l=this._validate(i,s,this.minDay,r.local.invalidMonth).toJD()-24e5+.5,d=0,h=0;hl)return c[d]-c[d-1];d++}return 30},weekDay:function(i,s,l){return this.dayOfWeek(i,s,l)!==5},toJD:function(i,s,l){var d=this._validate(i,s,l,r.local.invalidDate),h=12*(d.year()-1)+d.month()-15292;return d.day()+c[h-1]-1+24e5-.5},fromJD:function(i){for(var s=i-24e5+.5,l=0,d=0;ds);d++)l++;var h=l+15292,m=Math.floor((h-1)/12),g=m+1,p=h-12*m,v=s-c[l-1]+1;return this.newDate(g,p,v)},isValid:function(i,s,l){var d=r.baseCalendar.prototype.isValid.apply(this,arguments);return d&&(d=(i=i.year!=null?i.year:i)>=1276&&i<=1500),d},_validate:function(i,s,l,d){var h=r.baseCalendar.prototype._validate.apply(this,arguments);if(h.year<1276||h.year>1500)throw d.replace(/\{0\}/,this.local.name);return h}}),r.calendars.ummalqura=u;var c=[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]},{"../main":346,"object-assign":247}],346:[function(e,o,f){var r=e("object-assign");function a(){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 u(d,h,m,g){if(this._calendar=d,this._year=h,this._month=m,this._day=g,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function c(d,h){return"000000".substring(0,h-(d=""+d).length)+d}function i(){this.shortYearCutoff="+10"}function s(d){this.local=this.regionalOptions[d]||this.regionalOptions[""]}r(a.prototype,{instance:function(d,h){d=(d||"gregorian").toLowerCase(),h=h||"";var m=this._localCals[d+"-"+h];if(!m&&this.calendars[d]&&(m=new this.calendars[d](h),this._localCals[d+"-"+h]=m),!m)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,d);return m},newDate:function(d,h,m,g,p){return(g=(d!=null&&d.year?d.calendar():typeof g=="string"?this.instance(g,p):g)||this.instance()).newDate(d,h,m)},substituteDigits:function(d){return function(h){return(h+"").replace(/[0-9]/g,function(m){return d[m]})}},substituteChineseDigits:function(d,h){return function(m){for(var g="",p=0;m>0;){var v=m%10;g=(v===0?"":d[v]+h[p])+g,p++,m=Math.floor(m/10)}return g.indexOf(d[1]+h[1])===0&&(g=g.substr(1)),g||d[0]}}}),r(u.prototype,{newDate:function(d,h,m){return this._calendar.newDate(d??this,h,m)},year:function(d){return arguments.length===0?this._year:this.set(d,"y")},month:function(d){return arguments.length===0?this._month:this.set(d,"m")},day:function(d){return arguments.length===0?this._day:this.set(d,"d")},date:function(d,h,m){if(!this._calendar.isValid(d,h,m))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=d,this._month=h,this._day=m,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(d,h){return this._calendar.add(this,d,h)},set:function(d,h){return this._calendar.set(this,d,h)},compareTo:function(d){if(this._calendar.name!==d._calendar.name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,d._calendar.local.name);var h=this._year!==d._year?this._year-d._year:this._month!==d._month?this.monthOfYear()-d.monthOfYear():this._day-d._day;return h===0?0:h<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(d){return this._calendar.fromJD(d)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(d){return this._calendar.fromJSDate(d)},toString:function(){return(this.year()<0?"-":"")+c(Math.abs(this.year()),4)+"-"+c(this.month(),2)+"-"+c(this.day(),2)}}),r(i.prototype,{_validateLevel:0,newDate:function(d,h,m){return d==null?this.today():(d.year&&(this._validate(d,h,m,l.local.invalidDate||l.regionalOptions[""].invalidDate),m=d.day(),h=d.month(),d=d.year()),new u(this,d,h,m))},today:function(){return this.fromJSDate(new Date)},epoch:function(d){return this._validate(d,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(d){var h=this._validate(d,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(h.year()<0?"-":"")+c(Math.abs(h.year()),4)},monthsInYear:function(d){return this._validate(d,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(d,h){var m=this._validate(d,h,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(m.month()+this.monthsInYear(m)-this.firstMonth)%this.monthsInYear(m)+this.minMonth},fromMonthOfYear:function(d,h){var m=(h+this.firstMonth-2*this.minMonth)%this.monthsInYear(d)+this.minMonth;return this._validate(d,m,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),m},daysInYear:function(d){var h=this._validate(d,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(h)?366:365},dayOfYear:function(d,h,m){var g=this._validate(d,h,m,l.local.invalidDate||l.regionalOptions[""].invalidDate);return g.toJD()-this.newDate(g.year(),this.fromMonthOfYear(g.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(d,h,m){var g=this._validate(d,h,m,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(g))+2)%this.daysInWeek()},extraInfo:function(d,h,m){return this._validate(d,h,m,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(d,h,m){return this._validate(d,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(d,this._add(d,h,m),h,m)},_add:function(d,h,m){if(this._validateLevel++,m==="d"||m==="w"){var g=d.toJD()+h*(m==="w"?this.daysInWeek():1),p=d.calendar().fromJD(g);return this._validateLevel--,[p.year(),p.month(),p.day()]}try{var v=d.year()+(m==="y"?h:0),y=d.monthOfYear()+(m==="m"?h:0);p=d.day(),m==="y"?(d.month()!==this.fromMonthOfYear(v,y)&&(y=this.newDate(v,d.month(),this.minDay).monthOfYear()),y=Math.min(y,this.monthsInYear(v)),p=Math.min(p,this.daysInMonth(v,this.fromMonthOfYear(v,y)))):m==="m"&&(function(w){for(;yk-1+w.minMonth;)v++,y-=k,k=w.monthsInYear(v)}(this),p=Math.min(p,this.daysInMonth(v,this.fromMonthOfYear(v,y))));var x=[v,this.fromMonthOfYear(v,y),p];return this._validateLevel--,x}catch(w){throw this._validateLevel--,w}},_correctAdd:function(d,h,m,g){if(!(this.hasYearZero||g!=="y"&&g!=="m"||h[0]!==0&&d.year()>0==h[0]>0)){var p={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[g],v=m<0?-1:1;h=this._add(d,m*p[0]+v*p[1],p[2])}return d.date(h[0],h[1],h[2])},set:function(d,h,m){this._validate(d,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var g=m==="y"?h:d.year(),p=m==="m"?h:d.month(),v=m==="d"?h:d.day();return m!=="y"&&m!=="m"||(v=Math.min(v,this.daysInMonth(g,p))),d.date(g,p,v)},isValid:function(d,h,m){this._validateLevel++;var g=this.hasYearZero||d!==0;if(g){var p=this.newDate(d,h,this.minDay);g=h>=this.minMonth&&h-this.minMonth=this.minDay&&m-this.minDay13.5?13:1),k=p-(w>2.5?4716:4715);return k<=0&&k--,this.newDate(k,w,x)},toJSDate:function(d,h,m){var g=this._validate(d,h,m,l.local.invalidDate||l.regionalOptions[""].invalidDate),p=new Date(g.year(),g.month()-1,g.day());return p.setHours(0),p.setMinutes(0),p.setSeconds(0),p.setMilliseconds(0),p.setHours(p.getHours()>12?p.getHours()+2:0),p},fromJSDate:function(d){return this.newDate(d.getFullYear(),d.getMonth()+1,d.getDate())}});var l=o.exports=new a;l.cdate=u,l.baseCalendar=i,l.calendars.gregorian=s},{"object-assign":247}],347:[function(e,o,f){var r=e("object-assign"),a=e("./main");r(a.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"}),a.local=a.regionalOptions[""],r(a.cdate.prototype,{formatDate:function(u,c){return typeof u!="string"&&(c=u,u=""),this._calendar.formatDate(u||"",this,c)}}),r(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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(u,c,i){if(typeof u!="string"&&(i=c,c=u,u=""),!c)return"";if(c.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;u=u||this.local.dateFormat;for(var s,l,d,h,m=(i=i||{}).dayNamesShort||this.local.dayNamesShort,g=i.dayNames||this.local.dayNames,p=i.monthNumbers||this.local.monthNumbers,v=i.monthNamesShort||this.local.monthNamesShort,y=i.monthNames||this.local.monthNames,x=(i.calculateWeek||this.local.calculateWeek,function(D,O){for(var R=1;E+R1}),w=function(D,O,R,z){var L=""+O;if(x(D,z))for(;L.length1},M=function(N,B){var G=_(N,B),W=[2,3,G?4:2,G?4:2,10,11,20]["oyYJ@!".indexOf(N)+1],K=new RegExp("^-?\\d{1,"+W+"}"),te=c.substring(R).match(K);if(!te)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,R);return R+=te[0].length,parseInt(te[0],10)},A=this,S=function(){if(typeof m=="function"){_("m");var N=m.call(A,c.substring(R));return R+=N.length,N}return M("m")},E=function(N,B,G,W){for(var K=_(N,W)?G:B,te=0;te-1){x=1,w=k;for(var P=this.daysInMonth(y,x);w>P;P=this.daysInMonth(y,x))x++,w-=P}return v>-1?this.fromJD(v):this.newDate(y,x,w)},determineDate:function(u,c,i,s,l){i&&typeof i!="object"&&(l=s,s=i,i=null),typeof s!="string"&&(l=s,s="");var d=this;return c=c?c.newDate():null,u=u==null?c:typeof u=="string"?function(h){try{return d.parseDate(s,h,l)}catch{}for(var m=((h=h.toLowerCase()).match(/^c/)&&i?i.newDate():null)||d.today(),g=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,p=g.exec(h);p;)m.add(parseInt(p[1],10),p[2]||"d"),p=g.exec(h);return m}(u):typeof u=="number"?isNaN(u)||u===1/0||u===-1/0?c:d.today().add(u,"d"):d.newDate(u)}})},{"./main":346,"object-assign":247}],348:[function(e,o,f){o.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}]},{}],349:[function(e,o,f){var r=e("./arrow_paths"),a=e("../../plots/font_attributes"),u=e("../../plots/cartesian/constants"),c=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects"),o.exports=c("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({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:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.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",u.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",u.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",u.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",u.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:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":472,"../../plot_api/plot_template":543,"../../plots/cartesian/constants":561,"../../plots/font_attributes":585,"./arrow_paths":348}],350:[function(e,o,f){var r=e("../../lib"),a=e("../../plots/cartesian/axes"),u=e("./draw").draw;function c(s){var l=s._fullLayout;r.filterVisible(l.annotations).forEach(function(d){var h=a.getFromId(s,d.xref),m=a.getFromId(s,d.yref),g=a.getRefType(d.xref),p=a.getRefType(d.yref);d._extremes={},g==="range"&&i(d,h),p==="range"&&i(d,m)})}function i(s,l){var d,h=l._id,m=h.charAt(0),g=s[m],p=s["a"+m],v=s[m+"ref"],y=s["a"+m+"ref"],x=s["_"+m+"padplus"],w=s["_"+m+"padminus"],k={x:1,y:-1}[m]*s[m+"shift"],b=3*s.arrowsize*s.arrowwidth||0,T=b+k,_=b-k,M=3*s.startarrowsize*s.arrowwidth||0,A=M+k,S=M-k;if(y===v){var E=a.findExtremes(l,[l.r2c(g)],{ppadplus:T,ppadminus:_}),D=a.findExtremes(l,[l.r2c(p)],{ppadplus:Math.max(x,A),ppadminus:Math.max(w,S)});d={min:[E.min[0],D.min[0]],max:[E.max[0],D.max[0]]}}else A=p?A+p:A,S=p?S-p:S,d=a.findExtremes(l,[l.r2c(g)],{ppadplus:Math.max(x,T,A),ppadminus:Math.max(w,_,S)});s._extremes[h]=d}o.exports=function(s){var l=s._fullLayout;if(r.filterVisible(l.annotations).length&&s._fullData.length)return r.syncOrAsync([u,c],s)}},{"../../lib":503,"../../plots/cartesian/axes":554,"./draw":355}],351:[function(e,o,f){var r=e("../../lib"),a=e("../../registry"),u=e("../../plot_api/plot_template").arrayEditor;function c(s,l){var d,h,m,g,p,v,y,x=s._fullLayout.annotations,w=[],k=[],b=[],T=(l||[]).length;for(d=0;d0||d.explicitOff.length>0},onClick:function(s,l){var d,h,m=c(s,l),g=m.on,p=m.off.concat(m.explicitOff),v={},y=s._fullLayout.annotations;if(!(!g.length&&!p.length)){for(d=0;d2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[bt]}for(var Fe=!1,Ve=["x","y"],Ke=0;Ke1)&&(Pt===vt?((dt=At.r2fraction(T["a"+ft]))<0||dt>1)&&(Fe=!0):Fe=!0),Re=At._offset+At.r2p(T[ft]),Ye=.5}else{var Pe=Tt==="domain";ft==="x"?(We=T[ft],Re=Pe?At._offset+At._length*We:Re=R.l+R.w*We):(We=1-T[ft],Re=Pe?At._offset+At._length*We:Re=R.t+R.h*We),Ye=T.showarrow?.5:We}if(T.showarrow){Ge.head=Re;var Ie=T["a"+ft];if(nt=et*ze(.5,T.xanchor)-Ot*ze(.5,T.yanchor),Pt===vt){var Ae=s.getRefType(Pt);Ae==="domain"?(ft==="y"&&(Ie=1-Ie),Ge.tail=At._offset+At._length*Ie):Ae==="paper"?ft==="y"?(Ie=1-Ie,Ge.tail=R.t+R.h*Ie):Ge.tail=R.l+R.w*Ie:Ge.tail=At._offset+At.r2p(Ie),qe=nt}else Ge.tail=Re+Ie,qe=nt+Ie;Ge.text=Ge.tail+nt;var De=O[ft==="x"?"width":"height"];if(vt==="paper"&&(Ge.head=c.constrain(Ge.head,1,De-1)),Pt==="pixel"){var He=-Math.max(Ge.tail-3,Ge.text),rt=Math.min(Ge.tail+3,Ge.text)-De;He>0?(Ge.tail+=He,Ge.text+=He):rt>0&&(Ge.tail-=rt,Ge.text-=rt)}Ge.tail+=Be,Ge.head+=Be}else qe=nt=Wt*ze(Ye,Jt),Ge.text=Re+nt;Ge.text+=Be,nt+=Be,qe+=Be,T["_"+ft+"padplus"]=Wt/2+qe,T["_"+ft+"padminus"]=Wt/2-qe,T["_"+ft+"size"]=Wt,T["_"+ft+"shift"]=nt}if(Fe)U.remove();else{var lt=0,ot=0;if(T.align!=="left"&&(lt=(ye-Oe)*(T.align==="center"?.5:1)),T.valign!=="top"&&(ot=(Me-de)*(T.valign==="middle"?.5:1)),we)_e.select("svg").attr({x:ne+lt-1,y:ne+ot}).call(d.setClipUrl,Q?G:null,b);else{var kt=ne+ot-Te.top,wt=ne+lt-Te.left;ue.call(m.positionText,wt,kt).call(d.setClipUrl,Q?G:null,b)}ee.select("rect").call(d.setRect,ne,ne,ye,Me),H.call(d.setRect,q/2,q/2,ke-q,Ee-q),U.call(d.setTranslate,Math.round(W.x.text-ke/2),Math.round(W.y.text-Ee/2)),Y.attr({transform:"rotate("+K+","+W.x.text+","+W.y.text+")"});var Vt,Ut=function(tt,bt){te.selectAll(".annotation-arrow-g").remove();var zt=W.x.head,St=W.y.head,Dt=W.x.tail+tt,Le=W.y.tail+bt,Je=W.x.text+tt,st=W.y.text+bt,Et=c.rotationXYMatrix(K,Je,st),It=c.apply2DTransform(Et),Zt=c.apply2DTransform2(Et),Kt=+H.attr("width"),Ht=+H.attr("height"),mn=Je-.5*Kt,zn=mn+Kt,pn=st-.5*Ht,tn=pn+Ht,nn=[[mn,pn,mn,tn],[mn,tn,zn,tn],[zn,tn,zn,pn],[zn,pn,mn,pn]].map(Zt);if(!nn.reduce(function(Ln,lr){return Ln^!!c.segmentsIntersect(zt,St,zt+1e6,St+1e6,lr[0],lr[1],lr[2],lr[3])},!1)){nn.forEach(function(Ln){var lr=c.segmentsIntersect(Dt,Le,zt,St,Ln[0],Ln[1],Ln[2],Ln[3]);lr&&(Dt=lr.x,Le=lr.y)});var sn=T.arrowwidth,gn=T.arrowcolor,bn=T.arrowside,In=te.append("g").style({opacity:l.opacity(gn)}).classed("annotation-arrow-g",!0),Hn=In.append("path").attr("d","M"+Dt+","+Le+"L"+zt+","+St).style("stroke-width",sn+"px").call(l.stroke,l.rgb(gn));if(y(Hn,bn,T),z.annotationPosition&&Hn.node().parentNode&&!M){var Wn=zt,ar=St;if(T.standoff){var Or=Math.sqrt(Math.pow(zt-Dt,2)+Math.pow(St-Le,2));Wn+=T.standoff*(Dt-zt)/Or,ar+=T.standoff*(Le-St)/Or}var vr,Er,Kn=In.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Dt-Wn)+","+(Le-ar),transform:i(Wn,ar)}).style("stroke-width",sn+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:Kn.node(),gd:b,prepFn:function(){var Ln=d.getTranslate(U);vr=Ln.x,Er=Ln.y,A&&A.autorange&&P(A._name+".autorange",!0),S&&S.autorange&&P(S._name+".autorange",!0)},moveFn:function(Ln,lr){var Wr=It(vr,Er),Mn=Wr[0]+Ln,rr=Wr[1]+lr;U.call(d.setTranslate,Mn,rr),N("x",w(A,Ln,"x",R,T)),N("y",w(S,lr,"y",R,T)),T.axref===T.xref&&N("ax",w(A,Ln,"ax",R,T)),T.ayref===T.yref&&N("ay",w(S,lr,"ay",R,T)),In.attr("transform",i(Ln,lr)),Y.attr({transform:"rotate("+K+","+Mn+","+rr+")"})},doneFn:function(){a.call("_guiRelayout",b,B());var Ln=document.querySelector(".js-notes-box-panel");Ln&&Ln.redraw(Ln.selectedObj)}})}}};T.showarrow&&Ut(0,0),Z&&p.init({element:U.node(),gd:b,prepFn:function(){Vt=Y.attr("transform")},moveFn:function(tt,bt){var zt="pointer";if(T.showarrow)T.axref===T.xref?N("ax",w(A,tt,"ax",R,T)):N("ax",T.ax+tt),T.ayref===T.yref?N("ay",w(S,bt,"ay",R.w,T)):N("ay",T.ay+bt),Ut(tt,bt);else{if(M)return;var St,Dt;if(A)St=w(A,tt,"x",R,T);else{var Le=T._xsize/R.w,Je=T.x+(T._xshift-T.xshift)/R.w-Le/2;St=p.align(Je+tt/R.w,Le,0,1,T.xanchor)}if(S)Dt=w(S,bt,"y",R,T);else{var st=T._ysize/R.h,Et=T.y-(T._yshift+T.yshift)/R.h-st/2;Dt=p.align(Et-bt/R.h,st,0,1,T.yanchor)}N("x",St),N("y",Dt),A&&S||(zt=p.getCursor(A?.5:St,S?.5:Dt,T.xanchor,T.yanchor))}Y.attr({transform:i(tt,bt)+Vt}),g(U,zt)},clickFn:function(tt,bt){T.captureevents&&b.emit("plotly_clickannotation",le(bt))},doneFn:function(){g(U),a.call("_guiRelayout",b,B());var tt=document.querySelector(".js-notes-box-panel");tt&&tt.redraw(tt.selectedObj)}})}}}o.exports={draw:function(b){var T=b._fullLayout;T._infolayer.selectAll(".annotation").remove();for(var _=0;_=0,M=h.indexOf("end")>=0,A=w.backoff*b+m.standoff,S=k.backoff*T+m.startstandoff;if(x.nodeName==="line"){g={x:+d.attr("x1"),y:+d.attr("y1")},p={x:+d.attr("x2"),y:+d.attr("y2")};var E=g.x-p.x,D=g.y-p.y;if(y=(v=Math.atan2(D,E))+Math.PI,A&&S&&A+S>Math.sqrt(E*E+D*D))return void te();if(A){if(A*A>E*E+D*D)return void te();var O=A*Math.cos(v),R=A*Math.sin(v);p.x+=O,p.y+=R,d.attr({x2:p.x,y2:p.y})}if(S){if(S*S>E*E+D*D)return void te();var z=S*Math.cos(v),L=S*Math.sin(v);g.x-=z,g.y-=L,d.attr({x1:g.x,y1:g.y})}}else if(x.nodeName==="path"){var P=x.getTotalLength(),N="";if(P1){m=!0;break}}m?c.fullLayout._infolayer.select(".annotation-"+c.id+'[data-index="'+d+'"]').remove():(h._pdata=a(c.glplot.cameraParams,[i.xaxis.r2l(h.x)*s[0],i.yaxis.r2l(h.y)*s[1],i.zaxis.r2l(h.z)*s[2]]),r(c.graphDiv,h,d,c.id,h._xa,h._ya))}}},{"../../plots/gl3d/project":607,"../annotations/draw":355}],362:[function(e,o,f){var r=e("../../registry"),a=e("../../lib");o.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(u,c){var i=r.subplotsRegistry.gl3d;if(!!i)for(var s=i.attrRegex,l=Object.keys(u),d=0;d=0)))return h;if(y===3)p[y]>1&&(p[y]=1);else if(p[y]>=1)return h}var x=Math.round(255*p[0])+", "+Math.round(255*p[1])+", "+Math.round(255*p[2]);return v?"rgba("+x+", "+p[3]+")":"rgb("+x+")"}c.tinyRGB=function(h){var m=h.toRgb();return"rgb("+Math.round(m.r)+", "+Math.round(m.g)+", "+Math.round(m.b)+")"},c.rgb=function(h){return c.tinyRGB(r(h))},c.opacity=function(h){return h?r(h).getAlpha():0},c.addOpacity=function(h,m){var g=r(h).toRgb();return"rgba("+Math.round(g.r)+", "+Math.round(g.g)+", "+Math.round(g.b)+", "+m+")"},c.combine=function(h,m){var g=r(h).toRgb();if(g.a===1)return r(h).toRgbString();var p=r(m||l).toRgb(),v=p.a===1?p:{r:255*(1-p.a)+p.r*p.a,g:255*(1-p.a)+p.g*p.a,b:255*(1-p.a)+p.b*p.a},y={r:v.r*(1-g.a)+g.r*g.a,g:v.g*(1-g.a)+g.g*g.a,b:v.b*(1-g.a)+g.b*g.a};return r(y).toRgbString()},c.contrast=function(h,m,g){var p=r(h);return p.getAlpha()!==1&&(p=r(c.combine(h,l))),(p.isDark()?m?p.lighten(m):l:g?p.darken(g):s).toString()},c.stroke=function(h,m){var g=r(m);h.style({stroke:c.tinyRGB(g),"stroke-opacity":g.getAlpha()})},c.fill=function(h,m){var g=r(m);h.style({fill:c.tinyRGB(g),"fill-opacity":g.getAlpha()})},c.clean=function(h){if(h&&typeof h=="object"){var m,g,p,v,y=Object.keys(h);for(m=0;m0?Ie>=lt:Ie<=lt));Ae++)Ie>kt&&Ie0?Ie>=lt:Ie<=lt));Ae++)Ie>Pe[0]&&Ie1){var Pt=Math.pow(10,Math.floor(Math.log(vt)/Math.LN10));nt*=Pt*l.roundUp(vt/Pt,[2,5,10]),(Math.abs(we.start)/we.size+1e-6)%1<2e-6&&(We.tick0=0)}We.dtick=nt}We.domain=B?[Re+ne/ie.h,Re+Ee-ne/ie.h]:[Re+$/ie.w,Re+Ee-$/ie.w],We.setScale(),L.attr("transform",d(Math.round(ie.l),Math.round(ie.t)));var At,at=L.select("."+S.cbtitleunshift).attr("transform",d(-Math.round(ie.l),-Math.round(ie.t))),et=We.ticklabelposition,Ot=We.title.font.size,Wt=L.select("."+S.cbaxis),Jt=0,Be=0;function Ge(Tt,dt){var Pe={propContainer:We,propName:P._propPrefix+"title",traceIndex:P._traceIndex,_meta:P._meta,placeholder:ee._dfltTitle.colorbar,containerGroup:L.select("."+S.cbtitle)},Ie=Tt.charAt(0)==="h"?Tt.substr(1):"h"+Tt;L.selectAll("."+Ie+",."+Ie+"-math-group").remove(),v.draw(N,Tt,h(Pe,dt||{}))}return l.syncOrAsync([u.previousPromises,function(){var Tt,dt;(B&&Ye||!B&&!Ye)&&(ge==="top"&&(Tt=$+ie.l+ie.w*H,dt=ne+ie.t+ie.h*(1-Re-Ee)+3+.75*Ot),ge==="bottom"&&(Tt=$+ie.l+ie.w*H,dt=ne+ie.t+ie.h*(1-Re)-3-.25*Ot),ge==="right"&&(dt=ne+ie.t+ie.h*Q+3+.75*Ot,Tt=$+ie.l+ie.w*Re),Ge(We._id+"title",{attributes:{x:Tt,y:dt,"text-anchor":B?"start":"middle"}}))},function(){if(!B&&!Ye||B&&Ye){var Tt,dt=L.select("."+S.cbtitle),Pe=dt.select("text"),Ie=[-Y/2,Y/2],Ae=dt.select(".h"+We._id+"title-math-group").node(),De=15.6;if(Pe.node()&&(De=parseInt(Pe.node().style.fontSize,10)*_),Ae?(Tt=g.bBox(Ae),Be=Tt.width,(Jt=Tt.height)>De&&(Ie[1]-=(Jt-De)/2)):Pe.node()&&!Pe.classed(S.jsPlaceholder)&&(Tt=g.bBox(Pe.node()),Be=Tt.width,Jt=Tt.height),B){if(Jt){if(Jt+=5,ge==="top")We.domain[1]-=Jt/ie.h,Ie[1]*=-1;else{We.domain[0]+=Jt/ie.h;var He=y.lineCount(Pe);Ie[1]+=(1-He)*De}dt.attr("transform",d(Ie[0],Ie[1])),We.setScale()}}else Be&&(ge==="right"&&(We.domain[0]+=(Be+Ot/2)/ie.w),dt.attr("transform",d(Ie[0],Ie[1])),We.setScale())}L.selectAll("."+S.cbfills+",."+S.cblines).attr("transform",B?d(0,Math.round(ie.h*(1-We.domain[1]))):d(Math.round(ie.w*We.domain[0]),0)),Wt.attr("transform",B?d(0,Math.round(-ie.t)):d(Math.round(-ie.l),0));var rt=L.select("."+S.cbfills).selectAll("rect."+S.cbfill).attr("style","").data(Oe);rt.enter().append("rect").classed(S.cbfill,!0).style("stroke","none"),rt.exit().remove();var lt=fe.map(We.c2p).map(Math.round).sort(function(Ut,tt){return Ut-tt});rt.each(function(Ut,tt){var bt=[tt===0?fe[0]:(Oe[tt]+Oe[tt-1])/2,tt===Oe.length-1?fe[1]:(Oe[tt]+Oe[tt+1])/2].map(We.c2p).map(Math.round);B&&(bt[1]=l.constrain(bt[1]+(bt[1]>bt[0])?1:-1,lt[0],lt[1]));var zt=r.select(this).attr(B?"x":"y",ze).attr(B?"y":"x",r.min(bt)).attr(B?"width":"height",Math.max(ye,2)).attr(B?"height":"width",Math.max(r.max(bt)-r.min(bt),2));if(P._fillgradient)g.gradient(zt,N,P._id,B?"vertical":"horizontalreversed",P._fillgradient,"fill");else{var St=_e(Ut).replace("e-","");zt.attr("fill",a(St).toHexString())}});var ot=L.select("."+S.cblines).selectAll("path."+S.cbline).data(ue.color&&ue.width?de:[]);ot.enter().append("path").classed(S.cbline,!0),ot.exit().remove(),ot.each(function(Ut){var tt=ze,bt=Math.round(We.c2p(Ut))+ue.width/2%1;r.select(this).attr("d","M"+(B?tt+","+bt:bt+","+tt)+(B?"h":"v")+ye).call(g.lineGroupStyle,ue.width,me(Ut),ue.dash)}),Wt.selectAll("g."+We._id+"tick,path").remove();var kt=ze+ye+(Y||0)/2-(P.ticks==="outside"?1:0),wt=i.calcTicks(We),Vt=i.getTickSigns(We)[2];return i.drawTicks(N,We,{vals:We.ticks==="inside"?i.clipEnds(We,wt):wt,layer:Wt,path:i.makeTickPath(We,kt,Vt),transFn:i.makeTransTickFn(We)}),i.drawLabels(N,We,{vals:wt,layer:Wt,transFn:i.makeTransTickLabelFn(We),labelFns:i.makeLabelFns(We,kt)})},function(){if(B&&!Ye||!B&&Ye){var Tt,dt,Pe=We.position||0,Ie=We._offset+We._length/2;if(ge==="right")dt=Ie,Tt=ie.l+ie.w*Pe+10+Ot*(We.showticklabels?1:.5);else if(Tt=Ie,ge==="bottom"&&(dt=ie.t+ie.h*Pe+10+(et.indexOf("inside")===-1?We.tickfont.size:0)+(We.ticks!=="intside"&&P.ticklen||0)),ge==="top"){var Ae=le.text.split("
").length;dt=ie.t+ie.h*Pe+10-ye-_*Ot*Ae}Ge((B?"h":"v")+We._id+"title",{avoid:{selection:r.select(N).selectAll("g."+We._id+"tick"),side:ge,offsetTop:B?0:ie.t,offsetLeft:B?ie.l:0,maxShift:B?ee.width:ee.height},attributes:{x:Tt,y:dt,"text-anchor":"middle"},transform:{rotate:B?-90:0,offset:0}})}},u.previousPromises,function(){var Tt,dt=ye+Y/2;et.indexOf("inside")===-1&&(Tt=g.bBox(Wt.node()),dt+=B?Tt.width:Tt.height),At=at.select("text");var Pe=0,Ie=B&&ge==="top",Ae=!B&&ge==="right",De=0;if(At.node()&&!At.classed(S.jsPlaceholder)){var He,rt=at.select(".h"+We._id+"title-math-group").node();rt&&(B&&Ye||!B&&!Ye)?(Pe=(Tt=g.bBox(rt)).width,He=Tt.height):(Pe=(Tt=g.bBox(at.node())).right-ie.l-(B?ze:qe),He=Tt.bottom-ie.t-(B?qe:ze),B||ge!=="top"||(dt+=Tt.height,De=Tt.height)),Ae&&(At.attr("transform",d(Pe/2+Ot/2,0)),Pe*=2),dt=Math.max(dt,B?Pe:He)}var lt=2*(B?$:ne)+dt+Z+Y/2,ot=0;!B&&le.text&&q==="bottom"&&Q<=0&&(lt+=ot=lt/2,De+=ot),ee._hColorbarMoveTitle=ot,ee._hColorbarMoveCBTitle=De;var kt=Z+Y;L.select("."+S.cbbg).attr("x",(B?ze:qe)-kt/2-(B?$:0)).attr("y",(B?qe:ze)-(B?ke:ne+De-ot)).attr(B?"width":"height",Math.max(lt-ot,2)).attr(B?"height":"width",Math.max(ke+kt,2)).call(p.fill,re).call(p.stroke,P.bordercolor).style("stroke-width",Z);var wt=Ae?Math.max(Pe-10,0):0;if(L.selectAll("."+S.cboutline).attr("x",(B?ze:qe+$)+wt).attr("y",(B?qe+ne-ke:ze)+(Ie?Jt:0)).attr(B?"width":"height",Math.max(ye,2)).attr(B?"height":"width",Math.max(ke-(B?2*ne+Jt:2*$+wt),2)).call(p.stroke,P.outlinecolor).style({fill:"none","stroke-width":Y}),L.attr("transform",d(ie.l-(B?Fe*lt:0),ie.t-(B?0:(1-Ve)*lt-De))),!B&&(Z||a(re).getAlpha()&&!a.equals(ee.paper_bgcolor,re))){var Vt=Wt.selectAll("text"),Ut=Vt[0].length,tt=L.select("."+S.cbbg).node(),bt=g.bBox(tt),zt=g.getTranslate(L);Vt.each(function(It,Zt){var Kt=Ut-1;if(Zt===0||Zt===Kt){var Ht,mn=g.bBox(this),zn=g.getTranslate(this);if(Zt===Kt){var pn=mn.right+zn.x;(Ht=bt.right+zt.x+qe-Z-2+H-pn)>0&&(Ht=0)}else if(Zt===0){var tn=mn.left+zn.x;(Ht=bt.left+zt.x+qe+Z+2-tn)<0&&(Ht=0)}Ht&&(Ut<3?this.setAttribute("transform","translate("+Ht+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var St={},Dt=M[U],Le=A[U],Je=M[q],st=A[q],Et=lt-ye;B?(W==="pixels"?(St.y=Q,St.t=ke*Je,St.b=ke*st):(St.t=St.b=0,St.yt=Q+G*Je,St.yb=Q-G*st),te==="pixels"?(St.x=H,St.l=lt*Dt,St.r=lt*Le):(St.l=Et*Dt,St.r=Et*Le,St.xl=H-K*Dt,St.xr=H+K*Le)):(W==="pixels"?(St.x=H,St.l=ke*Dt,St.r=ke*Le):(St.l=St.r=0,St.xl=H+G*Dt,St.xr=H-G*Le),te==="pixels"?(St.y=1-Q,St.t=lt*Je,St.b=lt*st):(St.t=Et*Je,St.b=Et*st,St.yt=Q-K*Je,St.yb=Q+K*st)),u.autoMargin(N,P._id,St)}],N)}(R,O,E);z&&z.then&&(E._promises||[]).push(z),E._context.edits.colorbarPosition&&function(L,P,N){var B,G,W,K=P.orientation==="v",te=N._fullLayout._size;s.init({element:L.node(),gd:N,prepFn:function(){B=L.attr("transform"),m(L)},moveFn:function(Y,Z){L.attr("transform",B+d(Y,Z)),G=s.align((K?P._uFrac:P._vFrac)+Y/te.w,K?P._thickFrac:P._lenFrac,0,1,P.xanchor),W=s.align((K?P._vFrac:1-P._uFrac)-Z/te.h,K?P._lenFrac:P._thickFrac,0,1,P.yanchor);var re=s.getCursor(G,W,P.xanchor,P.yanchor);m(L,re)},doneFn:function(){if(m(L),G!==void 0&&W!==void 0){var Y={};Y[P._propPrefix+"x"]=G,Y[P._propPrefix+"y"]=W,P._traceIndex!==void 0?c.call("_guiRestyle",N,Y,P._traceIndex):c.call("_guiRelayout",N,Y)}}})}(R,O,E)}),D.exit().each(function(O){u.autoMargin(E,O._id)}).remove(),D.order()}}},{"../../constants/alignment":471,"../../lib":503,"../../lib/extend":493,"../../lib/setcursor":524,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../plots/cartesian/axis_defaults":556,"../../plots/cartesian/layout_attributes":569,"../../plots/cartesian/position_defaults":572,"../../plots/plots":619,"../../registry":638,"../color":366,"../colorscale/helpers":377,"../dragelement":385,"../drawing":388,"../titles":464,"./constants":368,"@plotly/d3":58,tinycolor2:312}],371:[function(e,o,f){var r=e("../../lib");o.exports=function(a){return r.isPlainObject(a.colorbar)}},{"../../lib":503}],372:[function(e,o,f){o.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":367,"./defaults":369,"./draw":370,"./has_colorbar":371}],373:[function(e,o,f){var r=e("../colorbar/attributes"),a=e("../../lib/regex").counter,u=e("../../lib/sort_object_keys"),c=e("./scales.js").scales;u(c);function i(s){return"`"+s+"`"}o.exports=function(s,l){s=s||"";var d,h=(l=l||{}).cLetter||"c",m=("onlyIfNumerical"in l?l.onlyIfNumerical:Boolean(s),"noScale"in l?l.noScale:s==="marker.line"),g="showScaleDflt"in l?l.showScaleDflt:h==="z",p=typeof l.colorscaleDflt=="string"?c[l.colorscaleDflt]:null,v=l.editTypeOverride||"",y=s?s+".":"";"colorAttr"in l?(d=l.colorAttr,l.colorAttr):i(y+(d={z:"z",c:"color"}[h]));var x=h+"auto",w=h+"min",k=h+"max",b=h+"mid",T={};T[w]=T[k]=void 0;var _={};_[x]=!1;var M={};return d==="color"&&(M.color={valType:"color",arrayOk:!0,editType:v||"style"},l.anim&&(M.color.anim=!0)),M[x]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:T},M[w]={valType:"number",dflt:null,editType:v||"plot",impliedEdits:_},M[k]={valType:"number",dflt:null,editType:v||"plot",impliedEdits:_},M[b]={valType:"number",dflt:null,editType:"calc",impliedEdits:T},M.colorscale={valType:"colorscale",editType:"calc",dflt:p,impliedEdits:{autocolorscale:!1}},M.autocolorscale={valType:"boolean",dflt:l.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},M.reversescale={valType:"boolean",dflt:!1,editType:"plot"},m||(M.showscale={valType:"boolean",dflt:g,editType:"calc"},M.colorbar=r),l.noColorAxis||(M.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),M}},{"../../lib/regex":520,"../../lib/sort_object_keys":526,"../colorbar/attributes":367,"./scales.js":381}],374:[function(e,o,f){var r=e("fast-isnumeric"),a=e("../../lib"),u=e("./helpers").extractOpts;o.exports=function(c,i,s){var l,d=c._fullLayout,h=s.vals,m=s.containerStr,g=m?a.nestedProperty(i,m).get():i,p=u(g),v=p.auto!==!1,y=p.min,x=p.max,w=p.mid,k=function(){return a.aggNums(Math.min,null,h)},b=function(){return a.aggNums(Math.max,null,h)};y===void 0?y=k():v&&(y=g._colorAx&&r(y)?Math.min(y,k()):k()),x===void 0?x=b():v&&(x=g._colorAx&&r(x)?Math.max(x,b()):b()),v&&w!==void 0&&(x-w>w-y?y=w-(x-w):x-w=0?d.colorscale.sequential:d.colorscale.sequentialminus,p._sync("colorscale",l))}},{"../../lib":503,"./helpers":377,"fast-isnumeric":190}],375:[function(e,o,f){var r=e("../../lib"),a=e("./helpers").hasColorscale,u=e("./helpers").extractOpts;o.exports=function(c,i){function s(v,y){var x=v["_"+y];x!==void 0&&(v[y]=x)}function l(v,y){var x=y.container?r.nestedProperty(v,y.container).get():v;if(x)if(x.coloraxis)x._colorAx=i[x.coloraxis];else{var w=u(x),k=w.auto;(k||w.min===void 0)&&s(x,y.min),(k||w.max===void 0)&&s(x,y.max),w.autocolorscale&&s(x,"colorscale")}}for(var d=0;d=0;k--,b++){var T=y[k];w[b]=[1-T[0],T[1]]}return w}function p(y,x){x=x||{};for(var w=y.domain,k=y.range,b=k.length,T=new Array(b),_=0;_4/3-d?l:d}},{}],383:[function(e,o,f){var r=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];o.exports=function(u,c,i,s){return u=i==="left"?0:i==="center"?1:i==="right"?2:r.constrain(Math.floor(3*u),0,2),c=s==="bottom"?0:s==="middle"?1:s==="top"?2:r.constrain(Math.floor(3*c),0,2),a[c][u]}},{"../../lib":503}],384:[function(e,o,f){f.selectMode=function(r){return r==="lasso"||r==="select"},f.drawMode=function(r){return r==="drawclosedpath"||r==="drawopenpath"||r==="drawline"||r==="drawrect"||r==="drawcircle"},f.openMode=function(r){return r==="drawline"||r==="drawopenpath"},f.rectMode=function(r){return r==="select"||r==="drawline"||r==="drawrect"||r==="drawcircle"},f.freeMode=function(r){return r==="lasso"||r==="drawclosedpath"||r==="drawopenpath"},f.selectingOrDrawing=function(r){return f.freeMode(r)||f.rectMode(r)}},{}],385:[function(e,o,f){var r=e("mouse-event-offset"),a=e("has-hover"),u=e("has-passive-events"),c=e("../../lib").removeElement,i=e("../../plots/cartesian/constants"),s=o.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var l=e("./unhover");function d(){var m=document.createElement("div");m.className="dragcover";var g=m.style;return g.position="fixed",g.left=0,g.right=0,g.top=0,g.bottom=0,g.zIndex=999999999,g.background="none",document.body.appendChild(m),m}function h(m){return r(m.changedTouches?m.changedTouches[0]:m,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(m){var g,p,v,y,x,w,k,b,T=m.gd,_=1,M=T._context.doubleClickDelay,A=m.element;T._mouseDownTime||(T._mouseDownTime=0),A.style.pointerEvents="all",A.onmousedown=E,u?(A._ontouchstart&&A.removeEventListener("touchstart",A._ontouchstart),A._ontouchstart=E,A.addEventListener("touchstart",E,{passive:!1})):A.ontouchstart=E;var S=m.clampFn||function(R,z,L){return Math.abs(R)M&&(_=Math.max(_-1,1)),T._dragged)m.doneFn&&m.doneFn();else if(m.clickFn&&m.clickFn(_,w),!b){var z;try{z=new MouseEvent("click",R)}catch{var L=h(R);(z=document.createEvent("MouseEvents")).initMouseEvent("click",R.bubbles,R.cancelable,R.view,R.detail,R.screenX,R.screenY,L[0],L[1],R.ctrlKey,R.altKey,R.shiftKey,R.metaKey,R.button,R.relatedTarget)}k.dispatchEvent(z)}T._dragging=!1,T._dragged=!1}else T._dragged=!1}},s.coverSlip=d},{"../../lib":503,"../../plots/cartesian/constants":561,"./align":382,"./cursor":383,"./unhover":386,"has-hover":228,"has-passive-events":229,"mouse-event-offset":242}],386:[function(e,o,f){var r=e("../../lib/events"),a=e("../../lib/throttle"),u=e("../../lib/dom").getGraphDiv,c=e("../fx/constants"),i=o.exports={};i.wrapped=function(s,l,d){(s=u(s))._fullLayout&&a.clear(s._fullLayout._uid+c.HOVERID),i.raw(s,l,d)},i.raw=function(s,l){var d=s._fullLayout,h=s._hoverdata;l||(l={}),l.target&&!s._dragged&&r.triggerHandler(s,"plotly_beforehover",l)===!1||(d._hoverlayer.selectAll("g").remove(),d._hoverlayer.selectAll("line").remove(),d._hoverlayer.selectAll("circle").remove(),s._hoverdata=void 0,l.target&&h&&s.emit("plotly_unhover",{event:l,points:h}))}},{"../../lib/dom":491,"../../lib/events":492,"../../lib/throttle":530,"../fx/constants":400}],387:[function(e,o,f){f.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},f.pattern={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"}},{}],388:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=a.numberFormat,c=e("fast-isnumeric"),i=e("tinycolor2"),s=e("../../registry"),l=e("../color"),d=e("../colorscale"),h=a.strTranslate,m=e("../../lib/svg_text_utils"),g=e("../../constants/xmlns_namespaces"),p=e("../../constants/alignment").LINE_SPACING,v=e("../../constants/interactions").DESELECTDIM,y=e("../../traces/scatter/subtypes"),x=e("../../traces/scatter/make_bubble_size_func"),w=e("../../components/fx/helpers").appendArrayPointValue,k=o.exports={};function b(Y,Z,re){var U=Z.fillpattern,q=U&&k.getPatternAttr(U.shape,0,"");if(q){var $=k.getPatternAttr(U.bgcolor,0,null),ne=k.getPatternAttr(U.fgcolor,0,null),H=U.fgopacity,Q=k.getPatternAttr(U.size,0,8),ee=k.getPatternAttr(U.solidity,0,.3),ie=Z.uid;k.pattern(Y,"point",re,ie,q,Q,ee,void 0,U.fillmode,$,ne,H)}else Z.fillcolor&&Y.call(l.fill,Z.fillcolor)}k.font=function(Y,Z,re,U){a.isPlainObject(Z)&&(U=Z.color,re=Z.size,Z=Z.family),Z&&Y.style("font-family",Z),re+1&&Y.style("font-size",re+"px"),U&&Y.call(l.fill,U)},k.setPosition=function(Y,Z,re){Y.attr("x",Z).attr("y",re)},k.setSize=function(Y,Z,re){Y.attr("width",Z).attr("height",re)},k.setRect=function(Y,Z,re,U,q){Y.call(k.setPosition,Z,re).call(k.setSize,U,q)},k.translatePoint=function(Y,Z,re,U){var q=re.c2p(Y.x),$=U.c2p(Y.y);return!!(c(q)&&c($)&&Z.node())&&(Z.node().nodeName==="text"?Z.attr("x",q).attr("y",$):Z.attr("transform",h(q,$)),!0)},k.translatePoints=function(Y,Z,re){Y.each(function(U){var q=r.select(this);k.translatePoint(U,q,Z,re)})},k.hideOutsideRangePoint=function(Y,Z,re,U,q,$){Z.attr("display",re.isPtWithinRange(Y,q)&&U.isPtWithinRange(Y,$)?null:"none")},k.hideOutsideRangePoints=function(Y,Z){if(Z._hasClipOnAxisFalse){var re=Z.xaxis,U=Z.yaxis;Y.each(function(q){var $=q[0].trace,ne=$.xcalendar,H=$.ycalendar,Q=s.traceIs($,"bar-like")?".bartext":".point,.textpoint";Y.selectAll(Q).each(function(ee){k.hideOutsideRangePoint(ee,r.select(this),re,U,ne,H)})})}},k.crispRound=function(Y,Z,re){return Z&&c(Z)?Y._context.staticPlot?Z:Z<1?1:Math.round(Z):re||0},k.singleLineStyle=function(Y,Z,re,U,q){Z.style("fill","none");var $=(((Y||[])[0]||{}).trace||{}).line||{},ne=re||$.width||0,H=q||$.dash||"";l.stroke(Z,U||$.color),k.dashLine(Z,H,ne)},k.lineGroupStyle=function(Y,Z,re,U){Y.style("fill","none").each(function(q){var $=(((q||[])[0]||{}).trace||{}).line||{},ne=Z||$.width||0,H=U||$.dash||"";r.select(this).call(l.stroke,re||$.color).call(k.dashLine,H,ne)})},k.dashLine=function(Y,Z,re){re=+re||0,Z=k.dashStyle(Z,re),Y.style({"stroke-dasharray":Z,"stroke-width":re+"px"})},k.dashStyle=function(Y,Z){Z=+Z||1;var re=Math.max(Z,3);return Y==="solid"?Y="":Y==="dot"?Y=re+"px,"+re+"px":Y==="dash"?Y=3*re+"px,"+3*re+"px":Y==="longdash"?Y=5*re+"px,"+5*re+"px":Y==="dashdot"?Y=3*re+"px,"+re+"px,"+re+"px,"+re+"px":Y==="longdashdot"&&(Y=5*re+"px,"+2*re+"px,"+re+"px,"+2*re+"px"),Y},k.singleFillStyle=function(Y,Z){var re=r.select(Y.node());b(Y,((re.data()[0]||[])[0]||{}).trace||{},Z)},k.fillGroupStyle=function(Y,Z){Y.style("stroke-width",0).each(function(re){var U=r.select(this);re[0].trace&&b(U,re[0].trace,Z)})};var T=e("./symbol_defs");k.symbolNames=[],k.symbolFuncs=[],k.symbolNeedLines={},k.symbolNoDot={},k.symbolNoFill={},k.symbolList=[],Object.keys(T).forEach(function(Y){var Z=T[Y],re=Z.n;k.symbolList.push(re,String(re),Y,re+100,String(re+100),Y+"-open"),k.symbolNames[re]=Y,k.symbolFuncs[re]=Z.f,Z.needLine&&(k.symbolNeedLines[re]=!0),Z.noDot?k.symbolNoDot[re]=!0:k.symbolList.push(re+200,String(re+200),Y+"-dot",re+300,String(re+300),Y+"-open-dot"),Z.noFill&&(k.symbolNoFill[re]=!0)});var _=k.symbolNames.length;function M(Y,Z){var re=Y%100;return k.symbolFuncs[re](Z)+(Y>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}k.symbolNumber=function(Y){if(c(Y))Y=+Y;else if(typeof Y=="string"){var Z=0;Y.indexOf("-open")>0&&(Z=100,Y=Y.replace("-open","")),Y.indexOf("-dot")>0&&(Z+=200,Y=Y.replace("-dot","")),(Y=k.symbolNames.indexOf(Y))>=0&&(Y+=Z)}return Y%100>=_||Y>=400?0:Math.floor(Math.max(Y,0))};var A={x1:1,x2:0,y1:0,y2:0},S={x1:0,x2:0,y1:1,y2:0},E=u("~f"),D={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:A},horizontalreversed:{node:"linearGradient",attrs:A,reversed:!0},vertical:{node:"linearGradient",attrs:S},verticalreversed:{node:"linearGradient",attrs:S,reversed:!0}};k.gradient=function(Y,Z,re,U,q,$){for(var ne=q.length,H=D[U],Q=new Array(ne),ee=0;ee=100,Z.attr("d",M(Q,H))}var ee,ie,ae,ue=!1;if(Y.so)ae=ne.outlierwidth,ie=ne.outliercolor,ee=$.outliercolor;else{var le=(ne||{}).width;ae=(Y.mlw+1||le+1||(Y.trace?(Y.trace.marker.line||{}).width:0)+1)-1||0,ie="mlc"in Y?Y.mlcc=U.lineScale(Y.mlc):a.isArrayOrTypedArray(ne.color)?l.defaultLine:ne.color,a.isArrayOrTypedArray($.color)&&(ee=l.defaultLine,ue=!0),ee="mc"in Y?Y.mcc=U.markerScale(Y.mc):$.color||"rgba(0,0,0,0)",U.selectedColorFn&&(ee=U.selectedColorFn(Y))}if(Y.om)Z.call(l.stroke,ee).style({"stroke-width":(ae||1)+"px",fill:"none"});else{Z.style("stroke-width",(Y.isBlank?0:ae)+"px");var ge=$.gradient,fe=Y.mgt;fe?ue=!0:fe=ge&&ge.type,a.isArrayOrTypedArray(fe)&&(fe=fe[0],D[fe]||(fe=0));var me=$.pattern,_e=me&&k.getPatternAttr(me.shape,Y.i,"");if(fe&&fe!=="none"){var we=Y.mgc;we?ue=!0:we=ge.color;var Te=re.uid;ue&&(Te+="-"+Y.i),k.gradient(Z,q,Te,fe,[[0,we],[1,ee]],"fill")}else if(_e){var Oe=k.getPatternAttr(me.bgcolor,Y.i,null),de=k.getPatternAttr(me.fgcolor,Y.i,null),ye=me.fgopacity,Me=k.getPatternAttr(me.size,Y.i,8),ke=k.getPatternAttr(me.solidity,Y.i,.3),Ee=Y.mcc||a.isArrayOrTypedArray(me.shape)||a.isArrayOrTypedArray(me.bgcolor)||a.isArrayOrTypedArray(me.size)||a.isArrayOrTypedArray(me.solidity),ze=re.uid;Ee&&(ze+="-"+Y.i),k.pattern(Z,"point",q,ze,_e,Me,ke,Y.mcc,me.fillmode,Oe,de,ye)}else l.fill(Z,ee);ae&&l.stroke(Z,ie)}},k.makePointStyleFns=function(Y){var Z={},re=Y.marker;return Z.markerScale=k.tryColorscale(re,""),Z.lineScale=k.tryColorscale(re,"line"),s.traceIs(Y,"symbols")&&(Z.ms2mrc=y.isBubble(Y)?x(Y):function(){return(re.size||6)/2}),Y.selectedpoints&&a.extendFlat(Z,k.makeSelectedPointStyleFns(Y)),Z},k.makeSelectedPointStyleFns=function(Y){var Z={},re=Y.selected||{},U=Y.unselected||{},q=Y.marker||{},$=re.marker||{},ne=U.marker||{},H=q.opacity,Q=$.opacity,ee=ne.opacity,ie=Q!==void 0,ae=ee!==void 0;(a.isArrayOrTypedArray(H)||ie||ae)&&(Z.selectedOpacityFn=function(Oe){var de=Oe.mo===void 0?q.opacity:Oe.mo;return Oe.selected?ie?Q:de:ae?ee:v*de});var ue=q.color,le=$.color,ge=ne.color;(le||ge)&&(Z.selectedColorFn=function(Oe){var de=Oe.mcc||ue;return Oe.selected?le||de:ge||de});var fe=q.size,me=$.size,_e=ne.size,we=me!==void 0,Te=_e!==void 0;return s.traceIs(Y,"symbols")&&(we||Te)&&(Z.selectedSizeFn=function(Oe){var de=Oe.mrc||fe/2;return Oe.selected?we?me/2:de:Te?_e/2:de}),Z},k.makeSelectedTextStyleFns=function(Y){var Z={},re=Y.selected||{},U=Y.unselected||{},q=Y.textfont||{},$=re.textfont||{},ne=U.textfont||{},H=q.color,Q=$.color,ee=ne.color;return Z.selectedTextColorFn=function(ie){var ae=ie.tc||H;return ie.selected?Q||ae:ee||(Q?ae:l.addOpacity(ae,v))},Z},k.selectedPointStyle=function(Y,Z){if(Y.size()&&Z.selectedpoints){var re=k.makeSelectedPointStyleFns(Z),U=Z.marker||{},q=[];re.selectedOpacityFn&&q.push(function($,ne){$.style("opacity",re.selectedOpacityFn(ne))}),re.selectedColorFn&&q.push(function($,ne){l.fill($,re.selectedColorFn(ne))}),re.selectedSizeFn&&q.push(function($,ne){var H=ne.mx||U.symbol||0,Q=re.selectedSizeFn(ne);$.attr("d",M(k.symbolNumber(H),Q)),ne.mrc2=Q}),q.length&&Y.each(function($){for(var ne=r.select(this),H=0;H0?re:0}k.textPointStyle=function(Y,Z,re){if(Y.size()){var U;if(Z.selectedpoints){var q=k.makeSelectedTextStyleFns(Z);U=q.selectedTextColorFn}var $=Z.texttemplate,ne=re._fullLayout;Y.each(function(H){var Q=r.select(this),ee=$?a.extractOption(H,Z,"txt","texttemplate"):a.extractOption(H,Z,"tx","text");if(ee||ee===0){if($){var ie=Z._module.formatLabels,ae=ie?ie(H,Z,ne):{},ue={};w(ue,Z,H.i);var le=Z._meta||{};ee=a.texttemplateString(ee,ae,ne._d3locale,ue,H,le)}var ge=H.tp||Z.textposition,fe=z(H,Z),me=U?U(H):H.tc||Z.textfont.color;Q.call(k.font,H.tf||Z.textfont.family,fe,me).text(ee).call(m.convertToTspans,re).call(R,ge,fe,H.mrc)}else Q.remove()})}},k.selectedTextStyle=function(Y,Z){if(Y.size()&&Z.selectedpoints){var re=k.makeSelectedTextStyleFns(Z);Y.each(function(U){var q=r.select(this),$=re.selectedTextColorFn(U),ne=U.tp||Z.textposition,H=z(U,Z);l.fill(q,$);var Q=s.traceIs(Z,"bar-like");R(q,ne,H,U.mrc2||U.mrc,Q)})}};function L(Y,Z,re,U){var q=Y[0]-Z[0],$=Y[1]-Z[1],ne=re[0]-Z[0],H=re[1]-Z[1],Q=Math.pow(q*q+$*$,.25),ee=Math.pow(ne*ne+H*H,.25),ie=(ee*ee*q-Q*Q*ne)*U,ae=(ee*ee*$-Q*Q*H)*U,ue=3*ee*(Q+ee),le=3*Q*(Q+ee);return[[r.round(Z[0]+(ue&&ie/ue),2),r.round(Z[1]+(ue&&ae/ue),2)],[r.round(Z[0]-(le&&ie/le),2),r.round(Z[1]-(le&&ae/le),2)]]}k.smoothopen=function(Y,Z){if(Y.length<3)return"M"+Y.join("L");var re,U="M"+Y[0],q=[];for(re=1;re=1e4&&(k.savedBBoxes={},B=0),re&&(k.savedBBoxes[re]=le),B++,a.extendFlat({},le)},k.setClipUrl=function(Y,Z,re){Y.attr("clip-path",W(Z,re))},k.getTranslate=function(Y){var Z=(Y[Y.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(re,U,q){return[U,q].join(" ")}).split(" ");return{x:+Z[0]||0,y:+Z[1]||0}},k.setTranslate=function(Y,Z,re){var U=Y.attr?"attr":"getAttribute",q=Y.attr?"attr":"setAttribute",$=Y[U]("transform")||"";return Z=Z||0,re=re||0,$=$.replace(/(\btranslate\(.*?\);?)/,"").trim(),$=($+=h(Z,re)).trim(),Y[q]("transform",$),$},k.getScale=function(Y){var Z=(Y[Y.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(re,U,q){return[U,q].join(" ")}).split(" ");return{x:+Z[0]||1,y:+Z[1]||1}},k.setScale=function(Y,Z,re){var U=Y.attr?"attr":"getAttribute",q=Y.attr?"attr":"setAttribute",$=Y[U]("transform")||"";return Z=Z||1,re=re||1,$=$.replace(/(\bscale\(.*?\);?)/,"").trim(),$=($+="scale("+Z+","+re+")").trim(),Y[q]("transform",$),$};var K=/\s*sc.*/;k.setPointGroupScale=function(Y,Z,re){if(Z=Z||1,re=re||1,Y){var U=Z===1&&re===1?"":"scale("+Z+","+re+")";Y.each(function(){var q=(this.getAttribute("transform")||"").replace(K,"");q=(q+=U).trim(),this.setAttribute("transform",q)})}};var te=/translate\([^)]*\)\s*$/;k.setTextPointsScale=function(Y,Z,re){Y&&Y.each(function(){var U,q=r.select(this),$=q.select("text");if($.node()){var ne=parseFloat($.attr("x")||0),H=parseFloat($.attr("y")||0),Q=(q.attr("transform")||"").match(te);U=Z===1&&re===1?[]:[h(ne,H),"scale("+Z+","+re+")",h(-ne,-H)],Q&&U.push(Q),q.attr("transform",U.join(""))}})}},{"../../components/fx/helpers":402,"../../constants/alignment":471,"../../constants/interactions":478,"../../constants/xmlns_namespaces":480,"../../lib":503,"../../lib/svg_text_utils":529,"../../registry":638,"../../traces/scatter/make_bubble_size_func":944,"../../traces/scatter/subtypes":952,"../color":366,"../colorscale":378,"./symbol_defs":389,"@plotly/d3":58,"fast-isnumeric":190,tinycolor2:312}],389:[function(e,o,f){var r=e("@plotly/d3");o.exports={circle:{n:0,f:function(a){var u=r.round(a,2);return"M"+u+",0A"+u+","+u+" 0 1,1 0,-"+u+"A"+u+","+u+" 0 0,1 "+u+",0Z"}},square:{n:1,f:function(a){var u=r.round(a,2);return"M"+u+","+u+"H-"+u+"V-"+u+"H"+u+"Z"}},diamond:{n:2,f:function(a){var u=r.round(1.3*a,2);return"M"+u+",0L0,"+u+"L-"+u+",0L0,-"+u+"Z"}},cross:{n:3,f:function(a){var u=r.round(.4*a,2),c=r.round(1.2*a,2);return"M"+c+","+u+"H"+u+"V"+c+"H-"+u+"V"+u+"H-"+c+"V-"+u+"H-"+u+"V-"+c+"H"+u+"V-"+u+"H"+c+"Z"}},x:{n:4,f:function(a){var u=r.round(.8*a/Math.sqrt(2),2),c="l"+u+","+u,i="l"+u+",-"+u,s="l-"+u+",-"+u,l="l-"+u+","+u;return"M0,"+u+c+i+s+i+s+l+s+l+c+l+c+"Z"}},"triangle-up":{n:5,f:function(a){var u=r.round(2*a/Math.sqrt(3),2);return"M-"+u+","+r.round(a/2,2)+"H"+u+"L0,-"+r.round(a,2)+"Z"}},"triangle-down":{n:6,f:function(a){var u=r.round(2*a/Math.sqrt(3),2);return"M-"+u+",-"+r.round(a/2,2)+"H"+u+"L0,"+r.round(a,2)+"Z"}},"triangle-left":{n:7,f:function(a){var u=r.round(2*a/Math.sqrt(3),2);return"M"+r.round(a/2,2)+",-"+u+"V"+u+"L-"+r.round(a,2)+",0Z"}},"triangle-right":{n:8,f:function(a){var u=r.round(2*a/Math.sqrt(3),2);return"M-"+r.round(a/2,2)+",-"+u+"V"+u+"L"+r.round(a,2)+",0Z"}},"triangle-ne":{n:9,f:function(a){var u=r.round(.6*a,2),c=r.round(1.2*a,2);return"M-"+c+",-"+u+"H"+u+"V"+c+"Z"}},"triangle-se":{n:10,f:function(a){var u=r.round(.6*a,2),c=r.round(1.2*a,2);return"M"+u+",-"+c+"V"+u+"H-"+c+"Z"}},"triangle-sw":{n:11,f:function(a){var u=r.round(.6*a,2),c=r.round(1.2*a,2);return"M"+c+","+u+"H-"+u+"V-"+c+"Z"}},"triangle-nw":{n:12,f:function(a){var u=r.round(.6*a,2),c=r.round(1.2*a,2);return"M-"+u+","+c+"V-"+u+"H"+c+"Z"}},pentagon:{n:13,f:function(a){var u=r.round(.951*a,2),c=r.round(.588*a,2),i=r.round(-a,2),s=r.round(-.309*a,2);return"M"+u+","+s+"L"+c+","+r.round(.809*a,2)+"H-"+c+"L-"+u+","+s+"L0,"+i+"Z"}},hexagon:{n:14,f:function(a){var u=r.round(a,2),c=r.round(a/2,2),i=r.round(a*Math.sqrt(3)/2,2);return"M"+i+",-"+c+"V"+c+"L0,"+u+"L-"+i+","+c+"V-"+c+"L0,-"+u+"Z"}},hexagon2:{n:15,f:function(a){var u=r.round(a,2),c=r.round(a/2,2),i=r.round(a*Math.sqrt(3)/2,2);return"M-"+c+","+i+"H"+c+"L"+u+",0L"+c+",-"+i+"H-"+c+"L-"+u+",0Z"}},octagon:{n:16,f:function(a){var u=r.round(.924*a,2),c=r.round(.383*a,2);return"M-"+c+",-"+u+"H"+c+"L"+u+",-"+c+"V"+c+"L"+c+","+u+"H-"+c+"L-"+u+","+c+"V-"+c+"Z"}},star:{n:17,f:function(a){var u=1.4*a,c=r.round(.225*u,2),i=r.round(.951*u,2),s=r.round(.363*u,2),l=r.round(.588*u,2),d=r.round(-u,2),h=r.round(-.309*u,2),m=r.round(.118*u,2),g=r.round(.809*u,2);return"M"+c+","+h+"H"+i+"L"+s+","+m+"L"+l+","+g+"L0,"+r.round(.382*u,2)+"L-"+l+","+g+"L-"+s+","+m+"L-"+i+","+h+"H-"+c+"L0,"+d+"Z"}},hexagram:{n:18,f:function(a){var u=r.round(.66*a,2),c=r.round(.38*a,2),i=r.round(.76*a,2);return"M-"+i+",0l-"+c+",-"+u+"h"+i+"l"+c+",-"+u+"l"+c+","+u+"h"+i+"l-"+c+","+u+"l"+c+","+u+"h-"+i+"l-"+c+","+u+"l-"+c+",-"+u+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(a){var u=r.round(a*Math.sqrt(3)*.8,2),c=r.round(.8*a,2),i=r.round(1.6*a,2),s=r.round(4*a,2),l="A "+s+","+s+" 0 0 1 ";return"M-"+u+","+c+l+u+","+c+l+"0,-"+i+l+"-"+u+","+c+"Z"}},"star-triangle-down":{n:20,f:function(a){var u=r.round(a*Math.sqrt(3)*.8,2),c=r.round(.8*a,2),i=r.round(1.6*a,2),s=r.round(4*a,2),l="A "+s+","+s+" 0 0 1 ";return"M"+u+",-"+c+l+"-"+u+",-"+c+l+"0,"+i+l+u+",-"+c+"Z"}},"star-square":{n:21,f:function(a){var u=r.round(1.1*a,2),c=r.round(2*a,2),i="A "+c+","+c+" 0 0 1 ";return"M-"+u+",-"+u+i+"-"+u+","+u+i+u+","+u+i+u+",-"+u+i+"-"+u+",-"+u+"Z"}},"star-diamond":{n:22,f:function(a){var u=r.round(1.4*a,2),c=r.round(1.9*a,2),i="A "+c+","+c+" 0 0 1 ";return"M-"+u+",0"+i+"0,"+u+i+u+",0"+i+"0,-"+u+i+"-"+u+",0Z"}},"diamond-tall":{n:23,f:function(a){var u=r.round(.7*a,2),c=r.round(1.4*a,2);return"M0,"+c+"L"+u+",0L0,-"+c+"L-"+u+",0Z"}},"diamond-wide":{n:24,f:function(a){var u=r.round(1.4*a,2),c=r.round(.7*a,2);return"M0,"+c+"L"+u+",0L0,-"+c+"L-"+u+",0Z"}},hourglass:{n:25,f:function(a){var u=r.round(a,2);return"M"+u+","+u+"H-"+u+"L"+u+",-"+u+"H-"+u+"Z"},noDot:!0},bowtie:{n:26,f:function(a){var u=r.round(a,2);return"M"+u+","+u+"V-"+u+"L-"+u+","+u+"V-"+u+"Z"},noDot:!0},"circle-cross":{n:27,f:function(a){var u=r.round(a,2);return"M0,"+u+"V-"+u+"M"+u+",0H-"+u+"M"+u+",0A"+u+","+u+" 0 1,1 0,-"+u+"A"+u+","+u+" 0 0,1 "+u+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(a){var u=r.round(a,2),c=r.round(a/Math.sqrt(2),2);return"M"+c+","+c+"L-"+c+",-"+c+"M"+c+",-"+c+"L-"+c+","+c+"M"+u+",0A"+u+","+u+" 0 1,1 0,-"+u+"A"+u+","+u+" 0 0,1 "+u+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(a){var u=r.round(a,2);return"M0,"+u+"V-"+u+"M"+u+",0H-"+u+"M"+u+","+u+"H-"+u+"V-"+u+"H"+u+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(a){var u=r.round(a,2);return"M"+u+","+u+"L-"+u+",-"+u+"M"+u+",-"+u+"L-"+u+","+u+"M"+u+","+u+"H-"+u+"V-"+u+"H"+u+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(a){var u=r.round(1.3*a,2);return"M"+u+",0L0,"+u+"L-"+u+",0L0,-"+u+"ZM0,-"+u+"V"+u+"M-"+u+",0H"+u},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(a){var u=r.round(1.3*a,2),c=r.round(.65*a,2);return"M"+u+",0L0,"+u+"L-"+u+",0L0,-"+u+"ZM-"+c+",-"+c+"L"+c+","+c+"M-"+c+","+c+"L"+c+",-"+c},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(a){var u=r.round(1.4*a,2);return"M0,"+u+"V-"+u+"M"+u+",0H-"+u},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(a){var u=r.round(a,2);return"M"+u+","+u+"L-"+u+",-"+u+"M"+u+",-"+u+"L-"+u+","+u},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(a){var u=r.round(1.2*a,2),c=r.round(.85*a,2);return"M0,"+u+"V-"+u+"M"+u+",0H-"+u+"M"+c+","+c+"L-"+c+",-"+c+"M"+c+",-"+c+"L-"+c+","+c},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(a){var u=r.round(a/2,2),c=r.round(a,2);return"M"+u+","+c+"V-"+c+"m-"+c+",0V"+c+"M"+c+","+u+"H-"+c+"m0,-"+c+"H"+c},needLine:!0,noFill:!0},"y-up":{n:37,f:function(a){var u=r.round(1.2*a,2),c=r.round(1.6*a,2),i=r.round(.8*a,2);return"M-"+u+","+i+"L0,0M"+u+","+i+"L0,0M0,-"+c+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(a){var u=r.round(1.2*a,2),c=r.round(1.6*a,2),i=r.round(.8*a,2);return"M-"+u+",-"+i+"L0,0M"+u+",-"+i+"L0,0M0,"+c+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(a){var u=r.round(1.2*a,2),c=r.round(1.6*a,2),i=r.round(.8*a,2);return"M"+i+","+u+"L0,0M"+i+",-"+u+"L0,0M-"+c+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(a){var u=r.round(1.2*a,2),c=r.round(1.6*a,2),i=r.round(.8*a,2);return"M-"+i+","+u+"L0,0M-"+i+",-"+u+"L0,0M"+c+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(a){var u=r.round(1.4*a,2);return"M"+u+",0H-"+u},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(a){var u=r.round(1.4*a,2);return"M0,"+u+"V-"+u},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(a){var u=r.round(a,2);return"M"+u+",-"+u+"L-"+u+","+u},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(a){var u=r.round(a,2);return"M"+u+","+u+"L-"+u+",-"+u},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(a){var u=r.round(a,2);return"M0,0L-"+u+","+r.round(2*a,2)+"H"+u+"Z"},noDot:!0},"arrow-down":{n:46,f:function(a){var u=r.round(a,2);return"M0,0L-"+u+",-"+r.round(2*a,2)+"H"+u+"Z"},noDot:!0},"arrow-left":{n:47,f:function(a){var u=r.round(2*a,2),c=r.round(a,2);return"M0,0L"+u+",-"+c+"V"+c+"Z"},noDot:!0},"arrow-right":{n:48,f:function(a){var u=r.round(2*a,2),c=r.round(a,2);return"M0,0L-"+u+",-"+c+"V"+c+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(a){var u=r.round(a,2);return"M-"+u+",0H"+u+"M0,0L-"+u+","+r.round(2*a,2)+"H"+u+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(a){var u=r.round(a,2);return"M-"+u+",0H"+u+"M0,0L-"+u+",-"+r.round(2*a,2)+"H"+u+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(a){var u=r.round(2*a,2),c=r.round(a,2);return"M0,-"+c+"V"+c+"M0,0L"+u+",-"+c+"V"+c+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(a){var u=r.round(2*a,2),c=r.round(a,2);return"M0,-"+c+"V"+c+"M0,0L-"+u+",-"+c+"V"+c+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":58}],390:[function(e,o,f){o.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],391:[function(e,o,f){var r=e("fast-isnumeric"),a=e("../../registry"),u=e("../../plots/cartesian/axes"),c=e("../../lib"),i=e("./compute_error");function s(l,d,h,m){var g=d["error_"+m]||{},p=[];if(g.visible&&["linear","log"].indexOf(h.type)!==-1){for(var v=i(g),y=0;y0;s.each(function(p){var v,y=p[0].trace,x=y.error_x||{},w=y.error_y||{};y.ids&&(v=function(_){return _.id});var k=c.hasMarkers(y)&&y.marker.maxdisplayed>0;w.visible||x.visible||(p=[]);var b=r.select(this).selectAll("g.errorbar").data(p,v);if(b.exit().remove(),p.length){x.visible||b.selectAll("path.xerror").remove(),w.visible||b.selectAll("path.yerror").remove(),b.style("opacity",1);var T=b.enter().append("g").classed("errorbar",!0);g&&T.style("opacity",0).transition().duration(d.duration).style("opacity",1),u.setClipUrl(b,l.layerClipId,i),b.each(function(_){var M=r.select(this),A=function(z,L,P){var N={x:L.c2p(z.x),y:P.c2p(z.y)};return z.yh!==void 0&&(N.yh=P.c2p(z.yh),N.ys=P.c2p(z.ys),a(N.ys)||(N.noYS=!0,N.ys=P.c2p(z.ys,!0))),z.xh!==void 0&&(N.xh=L.c2p(z.xh),N.xs=L.c2p(z.xs),a(N.xs)||(N.noXS=!0,N.xs=L.c2p(z.xs,!0))),N}(_,h,m);if(!k||_.vis){var S,E=M.select("path.yerror");if(w.visible&&a(A.x)&&a(A.yh)&&a(A.ys)){var D=w.width;S="M"+(A.x-D)+","+A.yh+"h"+2*D+"m-"+D+",0V"+A.ys,A.noYS||(S+="m-"+D+",0h"+2*D),E.size()?g&&(E=E.transition().duration(d.duration).ease(d.easing)):E=M.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0),E.attr("d",S)}else E.remove();var O=M.select("path.xerror");if(x.visible&&a(A.y)&&a(A.xh)&&a(A.xs)){var R=(x.copy_ystyle?w:x).width;S="M"+A.xh+","+(A.y-R)+"v"+2*R+"m0,-"+R+"H"+A.xs,A.noXS||(S+="m0,-"+R+"v"+2*R),O.size()?g&&(O=O.transition().duration(d.duration).ease(d.easing)):O=M.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0),O.attr("d",S)}else O.remove()}})}})}},{"../../traces/scatter/subtypes":952,"../drawing":388,"@plotly/d3":58,"fast-isnumeric":190}],396:[function(e,o,f){var r=e("@plotly/d3"),a=e("../color");o.exports=function(u){u.each(function(c){var i=c[0].trace,s=i.error_y||{},l=i.error_x||{},d=r.select(this);d.selectAll("path.yerror").style("stroke-width",s.thickness+"px").call(a.stroke,s.color),l.copy_ystyle&&(l=s),d.selectAll("path.xerror").style("stroke-width",l.thickness+"px").call(a.stroke,l.color)})}},{"../color":366,"@plotly/d3":58}],397:[function(e,o,f){var r=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,u=e("../../lib/extend").extendFlat;o.exports={hoverlabel:{bgcolor:u({},a.bgcolor,{arrayOk:!0}),bordercolor:u({},a.bordercolor,{arrayOk:!0}),font:r({arrayOk:!0,editType:"none"}),align:u({},a.align,{arrayOk:!0}),namelength:u({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":493,"../../plots/font_attributes":585,"./layout_attributes":407}],398:[function(e,o,f){var r=e("../../lib"),a=e("../../registry");function u(c,i,s,l){l=l||r.identity,Array.isArray(c)&&(i[0][s]=l(c))}o.exports=function(c){var i=c.calcdata,s=c._fullLayout;function l(p){return function(v){return r.coerceHoverinfo({hoverinfo:v},{_module:p._module},s)}}for(var d=0;d=0&&h.indexde[0]._length||Pe<0||Pe>ye[0]._length)return p.unhoverRaw(ee,ie)}if(ie.pointerX=dt+de[0]._offset,ie.pointerY=Pe+ye[0]._offset,Re="xval"in ie?x.flat(ge,ie.xval):x.p2c(de,dt),qe="yval"in ie?x.flat(ge,ie.yval):x.p2c(ye,Pe),!a(Re[0])||!a(qe[0]))return c.warn("Fx.hover failed",ie,ee),p.unhoverRaw(ee,ie)}var De=1/0;function He(Mn,rr){for(Ye=0;YeWt&&(Jt.splice(0,Wt),De=Jt[0].distance),we&&Ke!==0&&Jt.length===0){Ot.distance=Ke,Ot.index=!1;var pr=ft._module.hoverPoints(Ot,at,et,"closest",{hoverLayer:fe._hoverlayer});if(pr&&(pr=pr.filter(function(fn){return fn.spikeDistance<=Ke})),pr&&pr.length){var qr,_i=pr.filter(function(fn){return fn.xa.showspikes&&fn.xa.spikesnap!=="hovered data"});if(_i.length){var cn=_i[0];a(cn.x0)&&a(cn.y0)&&(qr=lt(cn),(!Ge.vLinePoint||Ge.vLinePoint.spikeDistance>qr.spikeDistance)&&(Ge.vLinePoint=qr))}var jn=pr.filter(function(fn){return fn.ya.showspikes&&fn.ya.spikesnap!=="hovered data"});if(jn.length){var jt=jn[0];a(jt.x0)&&a(jt.y0)&&(qr=lt(jt),(!Ge.hLinePoint||Ge.hLinePoint.spikeDistance>qr.spikeDistance)&&(Ge.hLinePoint=qr))}}}}}function rt(Mn,rr,nr){for(var Bn,Fr=null,$r=1/0,pr=0;pr0&&Math.abs(Mn.distance)Le-1;Et--)Ht(Jt[Et]);Jt=It,Vt()}var mn=ee._hoverdata,zn=[],pn=Z(ee),tn=re(ee);for(We=0;We1||Jt.length>1)||Fe==="closest"&&Tt&&Jt.length>1,Ln=g.combine(fe.plot_bgcolor||g.background,fe.paper_bgcolor),lr=P(Jt,{gd:ee,hovermode:Fe,rotateLabels:Kn,bgColor:Ln,container:fe._hoverlayer,outerContainer:fe._paper.node(),commonLabelOpts:fe.hoverlabel,hoverdistance:fe.hoverdistance});if(x.isUnifiedHover(Fe)||(function(Mn,rr,nr){var Bn,Fr,$r,pr,qr,_i,cn,jn=0,jt=1,fn=Mn.size(),yn=new Array(fn),$n=0;function Un(Yn){var ir=Yn[0],or=Yn[Yn.length-1];if(Fr=ir.pmin-ir.pos-ir.dp+ir.size,$r=or.pos+or.dp+or.size-ir.pmax,Fr>.01){for(qr=Yn.length-1;qr>=0;qr--)Yn[qr].dp+=Fr;Bn=!1}if(!($r<.01)){if(Fr<-.01){for(qr=Yn.length-1;qr>=0;qr--)Yn[qr].dp-=$r;Bn=!1}if(Bn){var xr=0;for(pr=0;prir.pmax&&xr++;for(pr=Yn.length-1;pr>=0&&!(xr<=0);pr--)(_i=Yn[pr]).pos>ir.pmax-1&&(_i.del=!0,xr--);for(pr=0;pr=0;qr--)Yn[qr].dp-=$r;for(pr=Yn.length-1;pr>=0&&!(xr<=0);pr--)(_i=Yn[pr]).pos+_i.dp+_i.size>ir.pmax&&(_i.del=!0,xr--)}}}for(Mn.each(function(Yn){var ir=Yn[rr],or=ir._id.charAt(0)==="x",xr=ir.range;$n===0&&xr&&xr[0]>xr[1]!==or&&(jt=-1),yn[$n++]=[{datum:Yn,traceIndex:Yn.trace.index,dp:0,pos:Yn.pos,posref:Yn.posref,size:Yn.by*(or?M:1)/2,pmin:0,pmax:or?nr.width:nr.height}]}),yn.sort(function(Yn,ir){return Yn[0].posref-ir[0].posref||jt*(ir[0].traceIndex-Yn[0].traceIndex)});!Bn&&jn<=fn;){for(jn++,Bn=!0,pr=0;pr.01&&wn.pmin===kn.pmin&&wn.pmax===kn.pmax){for(qr=Rn.length-1;qr>=0;qr--)Rn[qr].dp+=Fr;for(Nn.push.apply(Nn,Rn),yn.splice(pr+1,1),cn=0,qr=Nn.length-1;qr>=0;qr--)cn+=Nn[qr].dp;for($r=cn/Nn.length,qr=Nn.length-1;qr>=0;qr--)Nn[qr].dp-=$r;Bn=!1}else pr++}yn.forEach(Un)}for(pr=yn.length-1;pr>=0;pr--){var Tn=yn[pr];for(qr=Tn.length-1;qr>=0;qr--){var Dn=Tn[qr],Zn=Dn.datum;Zn.offset=Dn.dp,Zn.del=Dn.del}}}(lr,Kn?"xa":"ya",fe),B(lr,Kn,fe._invScaleX,fe._invScaleY)),le&&le.tagName){var Wr=y.getComponentMethod("annotations","hasClickToShow")(ee,zn);h(r.select(le),Wr?"pointer":"")}!le||ue||!function(Mn,rr,nr){if(!nr||nr.length!==Mn._hoverdata.length)return!0;for(var Bn=nr.length-1;Bn>=0;Bn--){var Fr=nr[Bn],$r=Mn._hoverdata[Bn];if(Fr.curveNumber!==$r.curveNumber||String(Fr.pointNumber)!==String($r.pointNumber)||String(Fr.pointNumbers)!==String($r.pointNumbers))return!0}return!1}(ee,0,mn)||(mn&&ee.emit("plotly_unhover",{event:ie,points:mn}),ee.emit("plotly_hover",{event:ie,points:ee._hoverdata,xaxes:de,yaxes:ye,xvals:Re,yvals:qe}))})(q,$,ne,H,Q)})},f.loneHover=function(q,$){var ne=!0;Array.isArray(q)||(ne=!1,q=[q]);var H=$.gd,Q=Z(H),ee=re(H),ie=P(q.map(function(le){var ge=le._x0||le.x0||le.x||0,fe=le._x1||le.x1||le.x||0,me=le._y0||le.y0||le.y||0,_e=le._y1||le.y1||le.y||0,we=le.eventData;if(we){var Te=Math.min(ge,fe),Oe=Math.max(ge,fe),de=Math.min(me,_e),ye=Math.max(me,_e),Me=le.trace;if(y.traceIs(Me,"gl3d")){var ke=H._fullLayout[Me.scene]._scene.container,Ee=ke.offsetLeft,ze=ke.offsetTop;Te+=Ee,Oe+=Ee,de+=ze,ye+=ze}we.bbox={x0:Te+ee,x1:Oe+ee,y0:de+Q,y1:ye+Q},$.inOut_bbox&&$.inOut_bbox.push(we.bbox)}else we=!1;return{color:le.color||g.defaultLine,x0:le.x0||le.x||0,x1:le.x1||le.x||0,y0:le.y0||le.y||0,y1:le.y1||le.y||0,xLabel:le.xLabel,yLabel:le.yLabel,zLabel:le.zLabel,text:le.text,name:le.name,idealAlign:le.idealAlign,borderColor:le.borderColor,fontFamily:le.fontFamily,fontSize:le.fontSize,fontColor:le.fontColor,nameLength:le.nameLength,textAlign:le.textAlign,trace:le.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:le.hovertemplate||!1,hovertemplateLabels:le.hovertemplateLabels||!1,eventData:we}}),{gd:H,hovermode:"closest",rotateLabels:!1,bgColor:$.bgColor||g.background,container:r.select($.container),outerContainer:$.outerContainer||$.container}),ae=0,ue=0;return ie.sort(function(le,ge){return le.y0-ge.y0}).each(function(le,ge){var fe=le.y0-le.by/2;le.offset=fe-5([\s\S]*)<\/extra>/;function P(q,$){var ne=$.gd,H=ne._fullLayout,Q=$.hovermode,ee=$.rotateLabels,ie=$.bgColor,ae=$.container,ue=$.outerContainer,le=$.commonLabelOpts||{};if(q.length===0)return[[]];var ge=$.fontFamily||w.HOVERFONT,fe=$.fontSize||w.HOVERFONTSIZE,me=q[0],_e=me.xa,we=me.ya,Te=Q.charAt(0),Oe=me[Te+"Label"],de=U(ne,ue),ye=de.top,Me=de.width,ke=de.height,Ee=Oe!==void 0&&me.distance<=$.hoverdistance&&(Q==="x"||Q==="y");if(Ee){var ze,Fe,Ve=!0;for(ze=0;zeH.width-Kt?(st=H.width-Kt,bt.attr("d","M"+(Kt-E)+",0L"+Kt+","+Zt+E+"v"+Zt+(2*D+It.height)+"H-"+Kt+"V"+Zt+E+"H"+(Kt-2*E)+"Z")):bt.attr("d","M0,0L"+E+","+Zt+E+"H"+(D+It.width/2)+"v"+Zt+(2*D+It.height)+"H-"+(D+It.width/2)+"V"+Zt+E+"H-"+E+"Z")}else{var Ht,mn,zn;we.side==="right"?(Ht="start",mn=1,zn="",st=_e._offset+_e._length):(Ht="end",mn=-1,zn="-",st=_e._offset),Et=we._offset+(me.y0+me.y1)/2,zt.attr("text-anchor",Ht),bt.attr("d","M0,0L"+zn+E+","+E+"V"+(D+It.height/2)+"h"+zn+(2*D+It.width)+"V-"+(D+It.height/2)+"H"+zn+E+"V-"+E+"Z");var pn,tn=It.height/2,nn=ye-It.top-tn,sn="clip"+H._uid+"commonlabel"+we._id;if(st=0?Ge:Tt+Ie=0?Tt:wt+Ie=0?Jt:Be+Ae=0?Be:Vt+Ae=0,tt.idealAlign!=="top"&&Hn||!Wn?Hn?(tn+=sn/2,tt.anchor="start"):tt.anchor="middle":(tn-=sn/2,tt.anchor="end");else if(tt.pos=tn,Hn=pn+nn/2+ar<=Me,Wn=pn-nn/2-ar>=0,tt.idealAlign!=="left"&&Hn||!Wn)if(Hn)pn+=nn/2,tt.anchor="start";else{tt.anchor="middle";var Or=ar/2,vr=pn+Or-Me,Er=pn-Or;vr>0&&(pn-=vr),Er<0&&(pn+=-Er)}else pn-=nn/2,tt.anchor="end";Zt.attr("text-anchor",tt.anchor),Ht&&Kt.attr("text-anchor",tt.anchor),bt.attr("transform",i(pn,tn)+(ee?s(T):""))}),Ut}function N(q,$,ne,H,Q,ee){var ie="",ae="";q.nameOverride!==void 0&&(q.name=q.nameOverride),q.name&&(q.trace._meta&&(q.name=c.templateString(q.name,q.trace._meta)),ie=te(q.name,q.nameLength));var ue=ne.charAt(0),le=ue==="x"?"y":"x";q.zLabel!==void 0?(q.xLabel!==void 0&&(ae+="x: "+q.xLabel+"
"),q.yLabel!==void 0&&(ae+="y: "+q.yLabel+"
"),q.trace.type!=="choropleth"&&q.trace.type!=="choroplethmapbox"&&(ae+=(ae?"z: ":"")+q.zLabel)):$&&q[ue+"Label"]===Q?ae=q[le+"Label"]||"":q.xLabel===void 0?q.yLabel!==void 0&&q.trace.type!=="scattercarpet"&&(ae=q.yLabel):ae=q.yLabel===void 0?q.xLabel:"("+q.xLabel+", "+q.yLabel+")",!q.text&&q.text!==0||Array.isArray(q.text)||(ae+=(ae?"
":"")+q.text),q.extraText!==void 0&&(ae+=(ae?"
":"")+q.extraText),ee&&ae===""&&!q.hovertemplate&&(ie===""&&ee.remove(),ae=ie);var ge=q.hovertemplate||!1;if(ge){var fe=q.hovertemplateLabels||q;q[ue+"Label"]!==Q&&(fe[ue+"other"]=fe[ue+"Val"],fe[ue+"otherLabel"]=fe[ue+"Label"]),ae=(ae=c.hovertemplateString(ge,fe,H._d3locale,q.eventData[0]||{},q.trace._meta)).replace(L,function(me,_e){return ie=te(_e,q.nameLength),""})}return[ae,ie]}function B(q,$,ne,H){var Q=function(ie){return ie*ne},ee=function(ie){return ie*H};q.each(function(ie){var ae=r.select(this);if(ie.del)return ae.remove();var ue=ae.select("text.nums"),le=ie.anchor,ge=le==="end"?-1:1,fe={start:1,end:-1,middle:0}[le],me=fe*(E+D),_e=me+fe*(ie.txwidth+D),we=0,Te=ie.offset,Oe=le==="middle";Oe&&(me-=ie.tx2width/2,_e+=ie.txwidth/2+D),$&&(Te*=-S,we=ie.offset*A),ae.select("path").attr("d",Oe?"M-"+Q(ie.bx/2+ie.tx2width/2)+","+ee(Te-ie.by/2)+"h"+Q(ie.bx)+"v"+ee(ie.by)+"h-"+Q(ie.bx)+"Z":"M0,0L"+Q(ge*E+we)+","+ee(E+Te)+"v"+ee(ie.by/2-E)+"h"+Q(ge*ie.bx)+"v-"+ee(ie.by)+"H"+Q(ge*E+we)+"V"+ee(Te-E)+"Z");var de=we+me,ye=Te+ie.ty0-ie.by/2+D,Me=ie.textAlign||"auto";Me!=="auto"&&(Me==="left"&&le!=="start"?(ue.attr("text-anchor","start"),de=Oe?-ie.bx/2-ie.tx2width/2+D:-ie.bx-D):Me==="right"&&le!=="end"&&(ue.attr("text-anchor","end"),de=Oe?ie.bx/2-ie.tx2width/2-D:ie.bx+D)),ue.call(d.positionText,Q(de),ee(ye)),ie.tx2width&&(ae.select("text.name").call(d.positionText,Q(_e+fe*D+we),ee(Te+ie.ty0-ie.by/2+D)),ae.select("rect").call(m.setRect,Q(_e+(fe-1)*ie.tx2width/2+we),ee(Te-ie.by/2-1),Q(ie.tx2width),ee(ie.by+2)))})}function G(q,$){var ne=q.index,H=q.trace||{},Q=q.cd[0],ee=q.cd[ne]||{};function ie(me){return me||a(me)&&me===0}var ae=Array.isArray(ne)?function(me,_e){var we=c.castOption(Q,ne,me);return ie(we)?we:c.extractOption({},H,"",_e)}:function(me,_e){return c.extractOption(ee,H,me,_e)};function ue(me,_e,we){var Te=ae(_e,we);ie(Te)&&(q[me]=Te)}if(ue("hoverinfo","hi","hoverinfo"),ue("bgcolor","hbg","hoverlabel.bgcolor"),ue("borderColor","hbc","hoverlabel.bordercolor"),ue("fontFamily","htf","hoverlabel.font.family"),ue("fontSize","hts","hoverlabel.font.size"),ue("fontColor","htc","hoverlabel.font.color"),ue("nameLength","hnl","hoverlabel.namelength"),ue("textAlign","hta","hoverlabel.align"),q.posref=$==="y"||$==="closest"&&H.orientation==="h"?q.xa._offset+(q.x0+q.x1)/2:q.ya._offset+(q.y0+q.y1)/2,q.x0=c.constrain(q.x0,0,q.xa._length),q.x1=c.constrain(q.x1,0,q.xa._length),q.y0=c.constrain(q.y0,0,q.ya._length),q.y1=c.constrain(q.y1,0,q.ya._length),q.xLabelVal!==void 0&&(q.xLabel="xLabel"in q?q.xLabel:v.hoverLabelText(q.xa,q.xLabelVal,H.xhoverformat),q.xVal=q.xa.c2d(q.xLabelVal)),q.yLabelVal!==void 0&&(q.yLabel="yLabel"in q?q.yLabel:v.hoverLabelText(q.ya,q.yLabelVal,H.yhoverformat),q.yVal=q.ya.c2d(q.yLabelVal)),q.zLabelVal!==void 0&&q.zLabel===void 0&&(q.zLabel=String(q.zLabelVal)),!(isNaN(q.xerr)||q.xa.type==="log"&&q.xerr<=0)){var le=v.tickText(q.xa,q.xa.c2l(q.xerr),"hover").text;q.xerrneg!==void 0?q.xLabel+=" +"+le+" / -"+v.tickText(q.xa,q.xa.c2l(q.xerrneg),"hover").text:q.xLabel+=" \xB1 "+le,$==="x"&&(q.distance+=1)}if(!(isNaN(q.yerr)||q.ya.type==="log"&&q.yerr<=0)){var ge=v.tickText(q.ya,q.ya.c2l(q.yerr),"hover").text;q.yerrneg!==void 0?q.yLabel+=" +"+ge+" / -"+v.tickText(q.ya,q.ya.c2l(q.yerrneg),"hover").text:q.yLabel+=" \xB1 "+ge,$==="y"&&(q.distance+=1)}var fe=q.hoverinfo||q.trace.hoverinfo;return fe&&fe!=="all"&&((fe=Array.isArray(fe)?fe:fe.split("+")).indexOf("x")===-1&&(q.xLabel=void 0),fe.indexOf("y")===-1&&(q.yLabel=void 0),fe.indexOf("z")===-1&&(q.zLabel=void 0),fe.indexOf("text")===-1&&(q.text=void 0),fe.indexOf("name")===-1&&(q.name=void 0)),q}function W(q,$,ne){var H,Q,ee=ne.container,ie=ne.fullLayout,ae=ie._size,ue=ne.event,le=!!$.hLinePoint,ge=!!$.vLinePoint;if(ee.selectAll(".spikeline").remove(),ge||le){var fe=g.combine(ie.plot_bgcolor,ie.paper_bgcolor);if(le){var me,_e,we=$.hLinePoint;H=we&&we.xa,(Q=we&&we.ya).spikesnap==="cursor"?(me=ue.pointerX,_e=ue.pointerY):(me=H._offset+we.x,_e=Q._offset+we.y);var Te,Oe,de=u.readability(we.color,fe)<1.5?g.contrast(fe):we.color,ye=Q.spikemode,Me=Q.spikethickness,ke=Q.spikecolor||de,Ee=v.getPxPosition(q,Q);if(ye.indexOf("toaxis")!==-1||ye.indexOf("across")!==-1){if(ye.indexOf("toaxis")!==-1&&(Te=Ee,Oe=me),ye.indexOf("across")!==-1){var ze=Q._counterDomainMin,Fe=Q._counterDomainMax;Q.anchor==="free"&&(ze=Math.min(ze,Q.position),Fe=Math.max(Fe,Q.position)),Te=ae.l+ze*ae.w,Oe=ae.l+Fe*ae.w}ee.insert("line",":first-child").attr({x1:Te,x2:Oe,y1:_e,y2:_e,"stroke-width":Me,stroke:ke,"stroke-dasharray":m.dashStyle(Q.spikedash,Me)}).classed("spikeline",!0).classed("crisp",!0),ee.insert("line",":first-child").attr({x1:Te,x2:Oe,y1:_e,y2:_e,"stroke-width":Me+2,stroke:fe}).classed("spikeline",!0).classed("crisp",!0)}ye.indexOf("marker")!==-1&&ee.insert("circle",":first-child").attr({cx:Ee+(Q.side!=="right"?Me:-Me),cy:_e,r:Me,fill:ke}).classed("spikeline",!0)}if(ge){var Ve,Ke,Re=$.vLinePoint;H=Re&&Re.xa,Q=Re&&Re.ya,H.spikesnap==="cursor"?(Ve=ue.pointerX,Ke=ue.pointerY):(Ve=H._offset+Re.x,Ke=Q._offset+Re.y);var qe,We,Ye=u.readability(Re.color,fe)<1.5?g.contrast(fe):Re.color,nt=H.spikemode,ft=H.spikethickness,vt=H.spikecolor||Ye,Pt=v.getPxPosition(q,H);if(nt.indexOf("toaxis")!==-1||nt.indexOf("across")!==-1){if(nt.indexOf("toaxis")!==-1&&(qe=Pt,We=Ke),nt.indexOf("across")!==-1){var At=H._counterDomainMin,at=H._counterDomainMax;H.anchor==="free"&&(At=Math.min(At,H.position),at=Math.max(at,H.position)),qe=ae.t+(1-at)*ae.h,We=ae.t+(1-At)*ae.h}ee.insert("line",":first-child").attr({x1:Ve,x2:Ve,y1:qe,y2:We,"stroke-width":ft,stroke:vt,"stroke-dasharray":m.dashStyle(H.spikedash,ft)}).classed("spikeline",!0).classed("crisp",!0),ee.insert("line",":first-child").attr({x1:Ve,x2:Ve,y1:qe,y2:We,"stroke-width":ft+2,stroke:fe}).classed("spikeline",!0).classed("crisp",!0)}nt.indexOf("marker")!==-1&&ee.insert("circle",":first-child").attr({cx:Ve,cy:Pt-(H.side!=="top"?ft:-ft),r:ft,fill:vt}).classed("spikeline",!0)}}}function K(q,$){return!$||$.vLinePoint!==q._spikepoints.vLinePoint||$.hLinePoint!==q._spikepoints.hLinePoint}function te(q,$){return d.plainText(q||"",{len:$,allowedTags:["br","sub","sup","b","i","em"]})}function Y(q,$,ne){var H=$[q+"a"],Q=$[q+"Val"],ee=$.cd[0];if(H.type==="category")Q=H._categoriesMap[Q];else if(H.type==="date"){var ie=$.trace[q+"periodalignment"];if(ie){var ae=$.cd[$.index],ue=ae[q+"Start"];ue===void 0&&(ue=ae[q]);var le=ae[q+"End"];le===void 0&&(le=ae[q]);var ge=le-ue;ie==="end"?Q+=ge:ie==="middle"&&(Q+=ge/2)}Q=H.d2c(Q)}return ee&&ee.t&&ee.t.posLetter===H._id&&(ne.boxmode!=="group"&&ne.violinmode!=="group"||(Q+=ee.t.dPos)),Q}function Z(q){return q.offsetTop+q.clientTop}function re(q){return q.offsetLeft+q.clientLeft}function U(q,$){var ne=q._fullLayout,H=$.getBoundingClientRect(),Q=H.x,ee=H.y,ie=Q+H.width,ae=ee+H.height,ue=c.apply3DTransform(ne._invTransform)(Q,ee),le=c.apply3DTransform(ne._invTransform)(ie,ae),ge=ue[0],fe=ue[1],me=le[0],_e=le[1];return{x:ge,y:fe,width:me-ge,height:_e-fe,top:Math.min(fe,_e),left:Math.min(ge,me),right:Math.max(ge,me),bottom:Math.max(fe,_e)}}},{"../../lib":503,"../../lib/events":492,"../../lib/override_cursor":514,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../registry":638,"../color":366,"../dragelement":385,"../drawing":388,"../legend/defaults":418,"../legend/draw":419,"./constants":400,"./helpers":402,"@plotly/d3":58,"fast-isnumeric":190,tinycolor2:312}],404:[function(e,o,f){var r=e("../../lib"),a=e("../color"),u=e("./helpers").isUnifiedHover;o.exports=function(c,i,s,l){l=l||{};var d=i.legend;function h(m){l.font[m]||(l.font[m]=d?i.legend.font[m]:i.font[m])}i&&u(i.hovermode)&&(l.font||(l.font={}),h("size"),h("family"),h("color"),d?(l.bgcolor||(l.bgcolor=a.combine(i.legend.bgcolor,i.paper_bgcolor)),l.bordercolor||(l.bordercolor=i.legend.bordercolor)):l.bgcolor||(l.bgcolor=i.paper_bgcolor)),s("hoverlabel.bgcolor",l.bgcolor),s("hoverlabel.bordercolor",l.bordercolor),s("hoverlabel.namelength",l.namelength),r.coerceFont(s,"hoverlabel.font",l.font),s("hoverlabel.align",l.align)}},{"../../lib":503,"../color":366,"./helpers":402}],405:[function(e,o,f){var r=e("../../lib"),a=e("./layout_attributes");o.exports=function(u,c){function i(s,l){return c[s]!==void 0?c[s]:r.coerce(u,c,a,s,l)}return i("clickmode"),i("hovermode")}},{"../../lib":503,"./layout_attributes":407}],406:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=e("../dragelement"),c=e("./helpers"),i=e("./layout_attributes"),s=e("./hover");o.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:i},attributes:e("./attributes"),layoutAttributes:i,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:c.getDistanceFunction,getClosest:c.getClosest,inbox:c.inbox,quadrature:c.quadrature,appendArrayPointValue:c.appendArrayPointValue,castHoverOption:function(l,d,h){return a.castOption(l,d,"hoverlabel."+h)},castHoverinfo:function(l,d,h){return a.castOption(l,h,"hoverinfo",function(m){return a.coerceHoverinfo({hoverinfo:m},{_module:l._module},d)})},hover:s.hover,unhover:u.unhover,loneHover:s.loneHover,loneUnhover:function(l){var d=a.isD3Selection(l)?l:r.select(l);d.selectAll("g.hovertext").remove(),d.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":503,"../dragelement":385,"./attributes":397,"./calc":398,"./click":399,"./constants":400,"./defaults":401,"./helpers":402,"./hover":403,"./layout_attributes":407,"./layout_defaults":408,"./layout_global_defaults":409,"@plotly/d3":58}],407:[function(e,o,f){var r=e("./constants"),a=e("../../plots/font_attributes"),u=a({editType:"none"});u.family.dflt=r.HOVERFONT,u.size.dflt=r.HOVERFONTSIZE,o.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"},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:u,grouptitlefont:a({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"}}},{"../../plots/font_attributes":585,"./constants":400}],408:[function(e,o,f){var r=e("../../lib"),a=e("./layout_attributes"),u=e("./hovermode_defaults"),c=e("./hoverlabel_defaults");o.exports=function(i,s){function l(g,p){return r.coerce(i,s,a,g,p)}u(i,s)&&(l("hoverdistance"),l("spikedistance")),l("dragmode")==="select"&&l("selectdirection");var d=s._has("mapbox"),h=s._has("geo"),m=s._basePlotModules.length;s.dragmode==="zoom"&&((d||h)&&m===1||d&&h&&m===2)&&(s.dragmode="pan"),c(i,s,l),r.coerceFont(l,"hoverlabel.grouptitlefont",s.hoverlabel.font)}},{"../../lib":503,"./hoverlabel_defaults":404,"./hovermode_defaults":405,"./layout_attributes":407}],409:[function(e,o,f){var r=e("../../lib"),a=e("./hoverlabel_defaults"),u=e("./layout_attributes");o.exports=function(c,i){a(c,i,function(s,l){return r.coerce(c,i,u,s,l)})}},{"../../lib":503,"./hoverlabel_defaults":404,"./layout_attributes":407}],410:[function(e,o,f){var r=e("../../lib"),a=e("../../lib/regex").counter,u=e("../../plots/domain").attributes,c=e("../../plots/cartesian/constants").idRegex,i=e("../../plot_api/plot_template"),s={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:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[c.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[c.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:u({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 l(m,g,p){var v=g[p+"axes"],y=Object.keys((m._splomAxes||{})[p]||{});return Array.isArray(v)?v:y.length?y:void 0}function d(m,g,p,v,y,x){var w=g(m+"gap",p),k=g("domain."+m);g(m+"side",v);for(var b=new Array(y),T=k[0],_=(k[1]-T)/(y-w),M=_*(1-w),A=0;A1){!k&&!b&&!T&&L("pattern")==="independent"&&(k=!0),M._hasSubplotGrid=k;var E,D,O=L("roworder")==="top to bottom",R=k?.2:.1,z=k?.3:.1;_&&g._splomGridDflt&&(E=g._splomGridDflt.xside,D=g._splomGridDflt.yside),M._domains={x:d("x",L,R,E,S),y:d("y",L,z,D,A,O)}}else delete g.grid}function L(P,N){return r.coerce(p,M,s,P,N)}},contentDefaults:function(m,g){var p=g.grid;if(p&&p._domains){var v,y,x,w,k,b,T,_=m.grid||{},M=g._subplots,A=p._hasSubplotGrid,S=p.rows,E=p.columns,D=p.pattern==="independent",O=p._axisMap={};if(A){var R=_.subplots||[];b=p.subplots=new Array(S);var z=1;for(v=0;v1);if(A===!1&&(h.legend=void 0),(A!==!1||p.uirevision)&&(y("uirevision",h.uirevision),A!==!1)){y("bgcolor",h.paper_bgcolor),y("bordercolor"),y("borderwidth");var S,E,D,O=a.coerceFont(y,"font",h.font),R=y("orientation")==="h";if(R?(S=0,r.getComponentMethod("rangeslider","isVisible")(d.xaxis)?(E=1.1,D="bottom"):(E=-.1,D="top")):(S=1.02,E=1,D="auto"),y("traceorder",_),l.isGrouped(h.legend)&&y("tracegroupgap"),y("itemsizing"),y("itemwidth"),y("itemclick"),y("itemdoubleclick"),y("groupclick"),y("x",S),y("xanchor"),y("y",E),y("yanchor",D),y("valign"),a.noneOrAll(p,v,["x","y"]),y("title.text")){y("title.side",R?"left":"top");var z=a.extendFlat({},O,{size:a.bigFont(O.size)});a.coerceFont(y,"title.font",z)}}}},{"../../lib":503,"../../plot_api/plot_template":543,"../../plots/attributes":550,"../../plots/layout_attributes":610,"../../registry":638,"./attributes":416,"./helpers":422}],419:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=e("../../plots/plots"),c=e("../../registry"),i=e("../../lib/events"),s=e("../dragelement"),l=e("../drawing"),d=e("../color"),h=e("../../lib/svg_text_utils"),m=e("./handle_click"),g=e("./constants"),p=e("../../constants/alignment"),v=p.LINE_SPACING,y=p.FROM_TL,x=p.FROM_BR,w=e("./get_legend_data"),k=e("./style"),b=e("./helpers");function T(O,R,z,L,P){var N=z.data()[0][0].trace,B={event:P,node:z.node(),curveNumber:N.index,expandedIndex:N._expandedIndex,data:O.data,layout:O.layout,frames:O._transitionData._frames,config:O._context,fullData:O._fullData,fullLayout:O._fullLayout};N._group&&(B.group=N._group),c.traceIs(N,"pie-like")&&(B.label=z.datum()[0].label),i.triggerHandler(O,"plotly_legendclick",B)!==!1&&(L===1?R._clickTimeout=setTimeout(function(){O._fullLayout&&m(z,O,L)},O._context.doubleClickDelay):L===2&&(R._clickTimeout&&clearTimeout(R._clickTimeout),O._legendMouseDownTime=0,i.triggerHandler(O,"plotly_legenddoubleclick",B)!==!1&&m(z,O,L)))}function _(O,R,z){var L,P,N=O.data()[0][0],B=N.trace,G=c.traceIs(B,"pie-like"),W=!z._inHover&&R._context.edits.legendText&&!G,K=z._maxNameLength;N.groupTitle?(L=N.groupTitle.text,P=N.groupTitle.font):(P=z.font,z.entries?L=N.text:(L=G?N.label:B.name,B._meta&&(L=a.templateString(L,B._meta))));var te=a.ensureSingle(O,"text","legendtext");te.attr("text-anchor","start").call(l.font,P).text(W?M(L,K):L);var Y=z.itemwidth+2*g.itemGap;h.positionText(te,Y,0),W?te.call(h.makeEditable,{gd:R,text:L}).call(S,O,R,z).on("edit",function(Z){this.text(M(Z,K)).call(S,O,R,z);var re=N.trace._fullInput||{},U={};if(c.hasTransform(re,"groupby")){var q=c.getTransformIndices(re,"groupby"),$=q[q.length-1],ne=a.keyedContainer(re,"transforms["+$+"].styles","target","value.name");ne.set(N.trace._group,Z),U=ne.constructUpdate()}else U.name=Z;return c.call("_guiRestyle",R,U,B.index)}):S(te,O,R,z)}function M(O,R){var z=Math.max(4,R);if(O&&O.trim().length>=z/2)return O;for(var L=z-(O=O||"").length;L>0;L--)O+=" ";return O}function A(O,R){var z,L=R._context.doubleClickDelay,P=1,N=a.ensureSingle(O,"rect","legendtoggle",function(B){R._context.staticPlot||B.style("cursor","pointer").attr("pointer-events","all"),B.call(d.fill,"rgba(0,0,0,0)")});R._context.staticPlot||(N.on("mousedown",function(){(z=new Date().getTime())-R._legendMouseDownTimeL&&(P=Math.max(P-1,1)),T(R,B,O,P,r.event)}}))}function S(O,R,z,L,P){L._inHover&&O.attr("data-notex",!0),h.convertToTspans(O,z,function(){(function(N,B,G,W){var K=N.data()[0][0];if(!G._inHover&&K&&!K.trace.showlegend)return void N.remove();var te=N.select("g[class*=math-group]"),Y=te.node();G||(G=B._fullLayout.legend);var Z,re=G.borderwidth;Z=W===1?G.title.font:K.groupTitle?K.groupTitle.font:G.font;var U,q,$=Z.size*v;if(Y){var ne=l.bBox(Y);U=ne.height,q=ne.width,W===1?l.setTranslate(te,re,re+.75*U):l.setTranslate(te,0,.25*U)}else{var H=N.select(W===1?".legendtitletext":".legendtext"),Q=h.lineCount(H),ee=H.node();if(U=$*Q,q=ee?l.bBox(ee).width:0,W===1)G.title.side==="left"&&(q+=2*g.itemGap),h.positionText(H,re+g.titlePad,re+$);else{var ie=2*g.itemGap+G.itemwidth;K.groupTitle&&(ie=g.itemGap,q-=G.itemwidth),h.positionText(H,ie,-$*((Q-1)/2-.3))}}W===1?(G._titleWidth=q,G._titleHeight=U):(K.lineHeight=$,K.height=Math.max(U,16)+3,K.width=q)})(R,z,L,P)})}function E(O){return a.isRightAnchor(O)?"right":a.isCenterAnchor(O)?"center":"left"}function D(O){return a.isBottomAnchor(O)?"bottom":a.isMiddleAnchor(O)?"middle":"top"}o.exports=function(O,R){return R||(R=O._fullLayout.legend||{}),function(z,L){var P,N,B=z._fullLayout,G="legend"+B._uid,W=L._inHover;if(W?(P=L.layer,G+="-hover"):P=B._infolayer,!!P){if(z._legendMouseDownTime||(z._legendMouseDownTime=0),W){if(!L.entries)return;N=w(L.entries,L)}else{if(!z.calcdata)return;N=B.showlegend&&w(z.calcdata,L)}var K=B.hiddenlabels||[];if(!(W||B.showlegend&&N.length))return P.selectAll(".legend").remove(),B._topdefs.select("#"+G).remove(),u.autoMargin(z,"legend");var te=a.ensureSingle(P,"g","legend",function(Q){W||Q.attr("pointer-events","all")}),Y=a.ensureSingleById(B._topdefs,"clipPath",G,function(Q){Q.append("rect")}),Z=a.ensureSingle(te,"rect","bg",function(Q){Q.attr("shape-rendering","crispEdges")});Z.call(d.stroke,L.bordercolor).call(d.fill,L.bgcolor).style("stroke-width",L.borderwidth+"px");var re=a.ensureSingle(te,"g","scrollbox"),U=L.title;if(L._titleWidth=0,L._titleHeight=0,U.text){var q=a.ensureSingle(re,"text","legendtitletext");q.attr("text-anchor","start").call(l.font,U.font).text(U.text),S(q,re,z,L,1)}else re.selectAll(".legendtitletext").remove();var $=a.ensureSingle(te,"rect","scrollbar",function(Q){Q.attr(g.scrollBarEnterAttrs).call(d.fill,g.scrollBarColor)}),ne=re.selectAll("g.groups").data(N);ne.enter().append("g").attr("class","groups"),ne.exit().remove();var H=ne.selectAll("g.traces").data(a.identity);H.enter().append("g").attr("class","traces"),H.exit().remove(),H.style("opacity",function(Q){var ee=Q[0].trace;return c.traceIs(ee,"pie-like")?K.indexOf(Q[0].label)!==-1?.5:1:ee.visible==="legendonly"?.5:1}).each(function(){r.select(this).call(_,z,L)}).call(k,z,L).each(function(){W||r.select(this).call(A,z)}),a.syncOrAsync([u.previousPromises,function(){return function(Q,ee,ie,ae){var ue=Q._fullLayout;ae||(ae=ue.legend);var le=ue._size,ge=b.isVertical(ae),fe=b.isGrouped(ae),me=ae.borderwidth,_e=2*me,we=g.itemGap,Te=ae.itemwidth+2*we,Oe=2*(me+we),de=D(ae),ye=ae.y<0||ae.y===0&&de==="top",Me=ae.y>1||ae.y===1&&de==="bottom",ke=ae.tracegroupgap;ae._maxHeight=Math.max(ye||Me?ue.height/2:le.h,30);var Ee=0;ae._width=0,ae._height=0;var ze=function(Tt){var dt=0,Pe=0,Ie=Tt.title.side;return Ie&&(Ie.indexOf("left")!==-1&&(dt=Tt._titleWidth),Ie.indexOf("top")!==-1&&(Pe=Tt._titleHeight)),[dt,Pe]}(ae);if(ge)ie.each(function(Tt){var dt=Tt[0].height;l.setTranslate(this,me+ze[0],me+ze[1]+ae._height+dt/2+we),ae._height+=dt,ae._width=Math.max(ae._width,Tt[0].width)}),Ee=Te+ae._width,ae._width+=we+Te+_e,ae._height+=Oe,fe&&(ee.each(function(Tt,dt){l.setTranslate(this,0,dt*ae.tracegroupgap)}),ae._height+=(ae._lgroupsLength-1)*ae.tracegroupgap);else{var Fe=E(ae),Ve=ae.x<0||ae.x===0&&Fe==="right",Ke=ae.x>1||ae.x===1&&Fe==="left",Re=Me||ye,qe=ue.width/2;ae._maxWidth=Math.max(Ve?Re&&Fe==="left"?le.l+le.w:qe:Ke?Re&&Fe==="right"?le.r+le.w:qe:le.w,2*Te);var We=0,Ye=0;ie.each(function(Tt){var dt=Tt[0].width+Te;We=Math.max(We,dt),Ye+=dt}),Ee=null;var nt=0;if(fe){var ft=0,vt=0,Pt=0;ee.each(function(){var Tt=0,dt=0;r.select(this).selectAll("g.traces").each(function(Ie){var Ae=Ie[0].width,De=Ie[0].height;l.setTranslate(this,ze[0],ze[1]+me+we+De/2+dt),dt+=De,Tt=Math.max(Tt,Te+Ae)});var Pe=Tt+we;vt>0&&Pe+me+vt>ae._maxWidth?(nt=Math.max(nt,vt),vt=0,Pt+=ft+ke,ft=dt):ft=Math.max(ft,dt),l.setTranslate(this,vt,Pt),vt+=Pe}),ae._width=Math.max(nt,vt)+me,ae._height=Pt+ft+Oe}else{var At=ie.size(),at=Ye+_e+(At-1)*we=ae._maxWidth&&(nt=Math.max(nt,Jt),Ot=0,Wt+=et,ae._height+=et,et=0),l.setTranslate(this,ze[0]+me+Ot,ze[1]+me+Wt+dt/2+we),Jt=Ot+Pe+we,Ot+=Ie,et=Math.max(et,dt)}),at?(ae._width=Ot+_e,ae._height=et+Oe):(ae._width=Math.max(nt,Jt)+_e,ae._height+=et+Oe)}}ae._width=Math.ceil(Math.max(ae._width+ze[0],ae._titleWidth+2*(me+g.titlePad))),ae._height=Math.ceil(Math.max(ae._height+ze[1],ae._titleHeight+2*(me+g.itemGap))),ae._effHeight=Math.min(ae._height,ae._maxHeight);var Be=Q._context.edits,Ge=Be.legendText||Be.legendPosition;ie.each(function(Tt){var dt=r.select(this).select(".legendtoggle"),Pe=Tt[0].height,Ie=Ge?Te:Ee||Te+Tt[0].width;ge||(Ie+=we/2),l.setRect(dt,0,-Pe/2,Ie,Pe)})}(z,ne,H,L)},function(){var Q,ee,ie,ae,ue=B._size,le=L.borderwidth;if(!W){if(function(Re){var qe=Re._fullLayout.legend,We=E(qe),Ye=D(qe);return u.autoMargin(Re,"legend",{x:qe.x,y:qe.y,l:qe._width*y[We],r:qe._width*x[We],b:qe._effHeight*x[Ye],t:qe._effHeight*y[Ye]})}(z))return;var ge=ue.l+ue.w*L.x-y[E(L)]*L._width,fe=ue.t+ue.h*(1-L.y)-y[D(L)]*L._effHeight;if(B.margin.autoexpand){var me=ge,_e=fe;ge=a.constrain(ge,0,B.width-L._width),fe=a.constrain(fe,0,B.height-L._effHeight),ge!==me&&a.log("Constrain legend.x to make legend fit inside graph"),fe!==_e&&a.log("Constrain legend.y to make legend fit inside graph")}l.setTranslate(te,ge,fe)}if($.on(".drag",null),te.on("wheel",null),W||L._height<=L._maxHeight||z._context.staticPlot){var we=L._effHeight;W&&(we=L._height),Z.attr({width:L._width-le,height:we-le,x:le/2,y:le/2}),l.setTranslate(re,0,0),Y.select("rect").attr({width:L._width-2*le,height:we-2*le,x:le,y:le}),l.setClipUrl(re,G,z),l.setRect($,0,0,0,0),delete L._scrollY}else{var Te,Oe,de,ye=Math.max(g.scrollBarMinHeight,L._effHeight*L._effHeight/L._height),Me=L._effHeight-ye-2*g.scrollBarMargin,ke=L._height-L._effHeight,Ee=Me/ke,ze=Math.min(L._scrollY||0,ke);Z.attr({width:L._width-2*le+g.scrollBarWidth+g.scrollBarMargin,height:L._effHeight-le,x:le/2,y:le/2}),Y.select("rect").attr({width:L._width-2*le+g.scrollBarWidth+g.scrollBarMargin,height:L._effHeight-2*le,x:le,y:le+ze}),l.setClipUrl(re,G,z),Ke(ze,ye,Ee),te.on("wheel",function(){Ke(ze=a.constrain(L._scrollY+r.event.deltaY/Me*ke,0,ke),ye,Ee),ze!==0&&ze!==ke&&r.event.preventDefault()});var Fe=r.behavior.drag().on("dragstart",function(){var Re=r.event.sourceEvent;Te=Re.type==="touchstart"?Re.changedTouches[0].clientY:Re.clientY,de=ze}).on("drag",function(){var Re=r.event.sourceEvent;Re.buttons===2||Re.ctrlKey||(Oe=Re.type==="touchmove"?Re.changedTouches[0].clientY:Re.clientY,Ke(ze=function(qe,We,Ye){var nt=(Ye-We)/Ee+qe;return a.constrain(nt,0,ke)}(de,Te,Oe),ye,Ee))});$.call(Fe);var Ve=r.behavior.drag().on("dragstart",function(){var Re=r.event.sourceEvent;Re.type==="touchstart"&&(Te=Re.changedTouches[0].clientY,de=ze)}).on("drag",function(){var Re=r.event.sourceEvent;Re.type==="touchmove"&&(Oe=Re.changedTouches[0].clientY,Ke(ze=function(qe,We,Ye){var nt=(We-Ye)/Ee+qe;return a.constrain(nt,0,ke)}(de,Te,Oe),ye,Ee))});re.call(Ve)}function Ke(Re,qe,We){L._scrollY=z._fullLayout.legend._scrollY=Re,l.setTranslate(re,0,-Re),l.setRect($,L._width,g.scrollBarMargin+Re*We,g.scrollBarWidth,qe),Y.select("rect").attr("y",le+Re)}z._context.edits.legendPosition&&(te.classed("cursor-move",!0),s.init({element:te.node(),gd:z,prepFn:function(){var Re=l.getTranslate(te);ie=Re.x,ae=Re.y},moveFn:function(Re,qe){var We=ie+Re,Ye=ae+qe;l.setTranslate(te,We,Ye),Q=s.align(We,0,ue.l,ue.l+ue.w,L.xanchor),ee=s.align(Ye,0,ue.t+ue.h,ue.t,L.yanchor)},doneFn:function(){Q!==void 0&&ee!==void 0&&c.call("_guiRelayout",z,{"legend.x":Q,"legend.y":ee})},clickFn:function(Re,qe){var We=P.selectAll("g.traces").filter(function(){var Ye=this.getBoundingClientRect();return qe.clientX>=Ye.left&&qe.clientX<=Ye.right&&qe.clientY>=Ye.top&&qe.clientY<=Ye.bottom});We.size()>0&&T(z,te,We,Re,qe)}}))}],z)}}(O,R)}},{"../../constants/alignment":471,"../../lib":503,"../../lib/events":492,"../../lib/svg_text_utils":529,"../../plots/plots":619,"../../registry":638,"../color":366,"../dragelement":385,"../drawing":388,"./constants":417,"./get_legend_data":420,"./handle_click":421,"./helpers":422,"./style":424,"@plotly/d3":58}],420:[function(e,o,f){var r=e("../../registry"),a=e("./helpers");o.exports=function(u,c){var i,s,l=c._inHover,d=a.isGrouped(c),h=a.isReversed(c),m={},g=[],p=!1,v={},y=0,x=0;function w(B,G){if(B!==""&&a.isGrouped(c))g.indexOf(B)===-1?(g.push(B),p=!0,m[B]=[G]):m[B].push(G);else{var W="~~i"+y;g.push(W),m[W]=[G],y++}}for(i=0;iO&&(D=O)}S[i][0]._groupMinRank=D,S[i][0]._preGroupSort=i}var R=function(B,G){return B.trace.legendrank-G.trace.legendrank||B._preSort-G._preSort};for(S.forEach(function(B,G){B[0]._preGroupSort=G}),S.sort(function(B,G){return B[0]._groupMinRank-G[0]._groupMinRank||B[0]._preGroupSort-G[0]._preGroupSort}),i=0;ik?k:x}o.exports=function(x,w,k){var b=w._fullLayout;k||(k=b.legend);var T=k.itemsizing==="constant",_=k.itemwidth,M=(_+2*g.itemGap)/2,A=c(M,0),S=function(O,R,z,L){var P;if(O+1)P=O;else{if(!(R&&R.width>0))return 0;P=R.width}return T?L:Math.min(P,z)};function E(O,R,z){var L=O[0].trace,P=L.marker||{},N=P.line||{},B=z?L.visible&&L.type===z:a.traceIs(L,"bar"),G=r.select(R).select("g.legendpoints").selectAll("path.legend"+z).data(B?[O]:[]);G.enter().append("path").classed("legend"+z,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",A),G.exit().remove(),G.each(function(W){var K=r.select(this),te=W[0],Y=S(te.mlw,P.line,5,2);K.style("stroke-width",Y+"px");var Z=te.mcc;if(!k._inHover&&"mc"in te){var re=l(P),U=re.mid;U===void 0&&(U=(re.max+re.min)/2),Z=i.tryColorscale(P,"")(U)}var q=Z||te.mc||P.color,$=P.pattern,ne=$&&i.getPatternAttr($.shape,0,"");if(ne){var H=i.getPatternAttr($.bgcolor,0,null),Q=i.getPatternAttr($.fgcolor,0,null),ee=$.fgopacity,ie=y($.size,8,10),ae=y($.solidity,.5,1),ue="legend-"+L.uid;K.call(i.pattern,"legend",w,ue,ne,ie,ae,Z,$.fillmode,H,Q,ee)}else K.call(s.fill,q);Y&&s.stroke(K,te.mlc||N.color)})}function D(O,R,z){var L=O[0],P=L.trace,N=z?P.visible&&P.type===z:a.traceIs(P,z),B=r.select(R).select("g.legendpoints").selectAll("path.legend"+z).data(N?[O]:[]);if(B.enter().append("path").classed("legend"+z,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",A),B.exit().remove(),B.size()){var G=(P.marker||{}).line,W=S(m(G.width,L.pts),G,5,2),K=u.minExtend(P,{marker:{line:{width:W}}});K.marker.line.color=G.color;var te=u.minExtend(L,{trace:K});h(B,te,K)}}x.each(function(O){var R=r.select(this),z=u.ensureSingle(R,"g","layers");z.style("opacity",O[0].trace.opacity);var L=k.valign,P=O[0].lineHeight,N=O[0].height;if(L!=="middle"&&P&&N){var B={top:1,bottom:-1}[L]*(.5*(P-N+3));z.attr("transform",c(0,B))}else z.attr("transform",null);z.selectAll("g.legendfill").data([O]).enter().append("g").classed("legendfill",!0),z.selectAll("g.legendlines").data([O]).enter().append("g").classed("legendlines",!0);var G=z.selectAll("g.legendsymbols").data([O]);G.enter().append("g").classed("legendsymbols",!0),G.selectAll("g.legendpoints").data([O]).enter().append("g").classed("legendpoints",!0)}).each(function(O){var R,z=O[0].trace,L=[];if(z.visible)switch(z.type){case"histogram2d":case"heatmap":L=[["M-15,-2V4H15V-2Z"]],R=!0;break;case"choropleth":case"choroplethmapbox":L=[["M-6,-6V6H6V-6Z"]],R=!0;break;case"densitymapbox":L=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],R="radial";break;case"cone":L=[["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":L=[["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":L=[["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":L=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],R=!1;break;case"volume":L=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],R=!0;break;case"isosurface":L=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],R=!1}var P=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(L);P.enter().append("path").classed("legend3dandfriends",!0).attr("transform",A).style("stroke-miterlimit",1),P.exit().remove(),P.each(function(N,B){var G,W=r.select(this),K=l(z),te=K.colorscale,Y=K.reversescale;if(te){if(!R){var Z=te.length;G=B===0?te[Y?Z-1:0][1]:B===1?te[Y?0:Z-1][1]:te[Math.floor((Z-1)/2)][1]}}else{var re=z.vertexcolor||z.facecolor||z.color;G=u.isArrayOrTypedArray(re)?re[B]||re[0]:re}W.attr("d",N[0]),G?W.call(s.fill,G):W.call(function(U){if(U.size()){var q="legendfill-"+z.uid;i.gradient(U,w,q,p(Y,R==="radial"),te,"fill")}})})}).each(function(O){var R=O[0].trace,z=R.type==="waterfall";if(O[0]._distinct&&z){var L=O[0].trace[O[0].dir].marker;return O[0].mc=L.color,O[0].mlw=L.line.width,O[0].mlc=L.line.color,E(O,this,"waterfall")}var P=[];R.visible&&z&&(P=O[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 N=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(P);N.enter().append("path").classed("legendwaterfall",!0).attr("transform",A).style("stroke-miterlimit",1),N.exit().remove(),N.each(function(B){var G=r.select(this),W=R[B[0]].marker,K=S(void 0,W.line,5,2);G.attr("d",B[1]).style("stroke-width",K+"px").call(s.fill,W.color),K&&G.call(s.stroke,W.line.color)})}).each(function(O){E(O,this,"funnel")}).each(function(O){E(O,this)}).each(function(O){var R=O[0].trace,z=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(R.visible&&a.traceIs(R,"box-violin")?[O]:[]);z.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",A),z.exit().remove(),z.each(function(){var L=r.select(this);if(R.boxpoints!=="all"&&R.points!=="all"||s.opacity(R.fillcolor)!==0||s.opacity((R.line||{}).color)!==0){var P=S(void 0,R.line,5,2);L.style("stroke-width",P+"px").call(s.fill,R.fillcolor),P&&s.stroke(L,R.line.color)}else{var N=u.minExtend(R,{marker:{size:T?12:u.constrain(R.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});z.call(i.pointStyle,N,w)}})}).each(function(O){D(O,this,"funnelarea")}).each(function(O){D(O,this,"pie")}).each(function(O){var R,z,L=v(O),P=L.showFill,N=L.showLine,B=L.showGradientLine,G=L.showGradientFill,W=L.anyFill,K=L.anyLine,te=O[0],Y=te.trace,Z=l(Y),re=Z.colorscale,U=Z.reversescale,q=d.hasMarkers(Y)||!W?"M5,0":K?"M5,-2":"M5,-3",$=r.select(this),ne=$.select(".legendfill").selectAll("path").data(P||G?[O]:[]);if(ne.enter().append("path").classed("js-fill",!0),ne.exit().remove(),ne.attr("d",q+"h"+_+"v6h-"+_+"z").call(function(ee){if(ee.size())if(P)i.fillGroupStyle(ee,w);else{var ie="legendfill-"+Y.uid;i.gradient(ee,w,ie,p(U),re,"fill")}}),N||B){var H=S(void 0,Y.line,10,5);z=u.minExtend(Y,{line:{width:H}}),R=[u.minExtend(te,{trace:z})]}var Q=$.select(".legendlines").selectAll("path").data(N||B?[R]:[]);Q.enter().append("path").classed("js-line",!0),Q.exit().remove(),Q.attr("d",q+(B?"l"+_+",0.0001":"h"+_)).call(N?i.lineGroupStyle:function(ee){if(ee.size()){var ie="legendline-"+Y.uid;i.lineGroupStyle(ee),i.gradient(ee,w,ie,p(U),re,"stroke")}})}).each(function(O){var R,z,L=v(O),P=L.anyFill,N=L.anyLine,B=L.showLine,G=L.showMarker,W=O[0],K=W.trace,te=!G&&!N&&!P&&d.hasText(K);function Y(Q,ee,ie,ae){var ue=u.nestedProperty(K,Q).get(),le=u.isArrayOrTypedArray(ue)&&ee?ee(ue):ue;if(T&&le&&ae!==void 0&&(le=ae),ie){if(leie[1])return ie[1]}return le}function Z(Q){return W._distinct&&W.index&&Q[W.index]?Q[W.index]:Q[0]}if(G||te||B){var re={},U={};if(G){re.mc=Y("marker.color",Z),re.mx=Y("marker.symbol",Z),re.mo=Y("marker.opacity",u.mean,[.2,1]),re.mlc=Y("marker.line.color",Z),re.mlw=Y("marker.line.width",u.mean,[0,5],2),U.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var q=Y("marker.size",u.mean,[2,16],12);re.ms=q,U.marker.size=q}B&&(U.line={width:Y("line.width",Z,[0,10],5)}),te&&(re.tx="Aa",re.tp=Y("textposition",Z),re.ts=10,re.tc=Y("textfont.color",Z),re.tf=Y("textfont.family",Z)),R=[u.minExtend(W,re)],(z=u.minExtend(K,U)).selectedpoints=null,z.texttemplate=null}var $=r.select(this).select("g.legendpoints"),ne=$.selectAll("path.scatterpts").data(G?R:[]);ne.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",A),ne.exit().remove(),ne.call(i.pointStyle,z,w),G&&(R[0].mrc=3);var H=$.selectAll("g.pointtext").data(te?R:[]);H.enter().append("g").classed("pointtext",!0).append("text").attr("transform",A),H.exit().remove(),H.selectAll("text").call(i.textPointStyle,z,w)}).each(function(O){var R=O[0].trace,z=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(R.visible&&R.type==="candlestick"?[O,O]:[]);z.enter().append("path").classed("legendcandle",!0).attr("d",function(L,P){return P?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",A).style("stroke-miterlimit",1),z.exit().remove(),z.each(function(L,P){var N=r.select(this),B=R[P?"increasing":"decreasing"],G=S(void 0,B.line,5,2);N.style("stroke-width",G+"px").call(s.fill,B.fillcolor),G&&s.stroke(N,B.line.color)})}).each(function(O){var R=O[0].trace,z=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(R.visible&&R.type==="ohlc"?[O,O]:[]);z.enter().append("path").classed("legendohlc",!0).attr("d",function(L,P){return P?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",A).style("stroke-miterlimit",1),z.exit().remove(),z.each(function(L,P){var N=r.select(this),B=R[P?"increasing":"decreasing"],G=S(void 0,B.line,5,2);N.style("fill","none").call(i.dashLine,B.line.dash,G),G&&s.stroke(N,B.line.color)})})}},{"../../lib":503,"../../registry":638,"../../traces/pie/helpers":906,"../../traces/pie/style_one":912,"../../traces/scatter/subtypes":952,"../color":366,"../colorscale/helpers":377,"../drawing":388,"./constants":417,"@plotly/d3":58}],425:[function(e,o,f){e("./constants"),o.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"}}},{"./constants":427}],426:[function(e,o,f){var r=e("../../registry"),a=e("../../plots/plots"),u=e("../../plots/cartesian/axis_ids"),c=e("../../fonts/ploticon"),i=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),l=s._,d=o.exports={};function h(b,T){var _,M,A=T.currentTarget,S=A.getAttribute("data-attr"),E=A.getAttribute("data-val")||!0,D=b._fullLayout,O={},R=u.list(b,null,!0),z=D._cartesianSpikesEnabled;if(S==="zoom"){var L,P=E==="in"?.5:2,N=(1+P)/2,B=(1-P)/2;for(M=0;M1?(U=["toggleHover"],q=["resetViews"]):D?(re=["zoomInGeo","zoomOutGeo"],U=["hoverClosestGeo"],q=["resetGeo"]):E?(U=["hoverClosest3d"],q=["resetCameraDefault3d","resetCameraLastSave3d"]):P?(re=["zoomInMapbox","zoomOutMapbox"],U=["toggleHover"],q=["resetViewMapbox"]):z?U=["hoverClosestGl2d"]:O?U=["hoverClosestPie"]:G?(U=["hoverClosestCartesian","hoverCompareCartesian"],q=["resetViewSankey"]):U=["toggleHover"],S&&(U=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),(function(ae){for(var ue=0;ue0)){var w=function(b,T,_){for(var M=_.filter(function(D){return T[D].anchor===b._id}),A=0,S=0;S=fe.max)le=ee[ge+1];else if(ue=fe.pmax)le=ee[ge+1];else if(ue0?b+x:x;return{ppad:x,ppadplus:w?_:M,ppadminus:w?M:_}}return{ppad:x}}function d(h,m,g,p,v){var y=h.type==="category"||h.type==="multicategory"?h.r2c:h.d2c;if(m!==void 0)return[y(m),y(g)];if(p){var x,w,k,b,T=1/0,_=-1/0,M=p.match(u.segmentRE);for(h.type==="date"&&(y=c.decodeDate(y)),x=0;x_&&(_=b)));return _>=T?[T,_]:void 0}}o.exports=function(h){var m=h._fullLayout,g=r.filterVisible(m.shapes);if(g.length&&h._fullData.length)for(var p=0;pge?(_e=ue,de="y0",we=ge,ye="y1"):(_e=ge,de="y1",we=ue,ye="y0"),Wt(dt),Ge(ee,H),function(Pe,Ie,Ae){var De=Ie.xref,He=Ie.yref,rt=u.getFromId(Ae,De),lt=u.getFromId(Ae,He),ot="";De==="paper"||rt.autorange||(ot+=De),He==="paper"||lt.autorange||(ot+=He),d.setClipUrl(Pe,ot?"clip"+Ae._fullLayout._uid+ot:null,Ae)}(ne,H,$),Ot.moveFn=ze==="move"?Jt:Be,Ot.altKey=dt.altKey)},doneFn:function(){x($)||(g(ne),Tt(ee),b(ne,$,H),r.call("_guiRelayout",$,ie.getUpdateObj()))},clickFn:function(){x($)||Tt(ee)}};function Wt(dt){if(x($))ze=null;else if(Ke)ze=dt.target.tagName==="path"?"move":dt.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var Pe=Ot.element.getBoundingClientRect(),Ie=Pe.right-Pe.left,Ae=Pe.bottom-Pe.top,De=dt.clientX-Pe.left,He=dt.clientY-Pe.top,rt=!Re&&Ie>10&&Ae>10&&!dt.shiftKey?m.getCursor(De/Ie,1-He/Ae):"move";g(ne,rt),ze=rt.split("-")[0]}}function Jt(dt,Pe){if(H.type==="path"){var Ie=function(He){return He},Ae=Ie,De=Ie;Fe?qe("xanchor",H.xanchor=At(fe+dt)):(Ae=function(He){return At(vt(He)+dt)},We&&We.type==="date"&&(Ae=v.encodeDate(Ae))),Ve?qe("yanchor",H.yanchor=at(me+Pe)):(De=function(He){return at(Pt(He)+Pe)},nt&&nt.type==="date"&&(De=v.encodeDate(De))),qe("path",H.path=_(Ee,Ae,De))}else Fe?qe("xanchor",H.xanchor=At(fe+dt)):(qe("x0",H.x0=At(ae+dt)),qe("x1",H.x1=At(le+dt))),Ve?qe("yanchor",H.yanchor=at(me+Pe)):(qe("y0",H.y0=at(ue+Pe)),qe("y1",H.y1=at(ge+Pe)));ne.attr("d",T($,H)),Ge(ee,H)}function Be(dt,Pe){if(Re){var Ie=function(Le){return Le},Ae=Ie,De=Ie;Fe?qe("xanchor",H.xanchor=At(fe+dt)):(Ae=function(Le){return At(vt(Le)+dt)},We&&We.type==="date"&&(Ae=v.encodeDate(Ae))),Ve?qe("yanchor",H.yanchor=at(me+Pe)):(De=function(Le){return at(Pt(Le)+Pe)},nt&&nt.type==="date"&&(De=v.encodeDate(De))),qe("path",H.path=_(Ee,Ae,De))}else if(Ke){if(ze==="resize-over-start-point"){var He=ae+dt,rt=Ve?ue-Pe:ue+Pe;qe("x0",H.x0=Fe?He:At(He)),qe("y0",H.y0=Ve?rt:at(rt))}else if(ze==="resize-over-end-point"){var lt=le+dt,ot=Ve?ge-Pe:ge+Pe;qe("x1",H.x1=Fe?lt:At(lt)),qe("y1",H.y1=Ve?ot:at(ot))}}else{var kt=function(Le){return ze.indexOf(Le)!==-1},wt=kt("n"),Vt=kt("s"),Ut=kt("w"),tt=kt("e"),bt=wt?_e+Pe:_e,zt=Vt?we+Pe:we,St=Ut?Te+dt:Te,Dt=tt?Oe+dt:Oe;Ve&&(wt&&(bt=_e-Pe),Vt&&(zt=we-Pe)),(!Ve&&zt-bt>10||Ve&&bt-zt>10)&&(qe(de,H[de]=Ve?bt:at(bt)),qe(ye,H[ye]=Ve?zt:at(zt))),Dt-St>10&&(qe(Me,H[Me]=Fe?St:At(St)),qe(ke,H[ke]=Fe?Dt:At(Dt)))}ne.attr("d",T($,H)),Ge(ee,H)}function Ge(dt,Pe){(Fe||Ve)&&function(){var Ie=Pe.type!=="path",Ae=dt.selectAll(".visual-cue").data([0]);Ae.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var De=vt(Fe?Pe.xanchor:a.midRange(Ie?[Pe.x0,Pe.x1]:v.extractPathCoords(Pe.path,p.paramIsX))),He=Pt(Ve?Pe.yanchor:a.midRange(Ie?[Pe.y0,Pe.y1]:v.extractPathCoords(Pe.path,p.paramIsY)));if(De=v.roundPositionForSharpStrokeRendering(De,1),He=v.roundPositionForSharpStrokeRendering(He,1),Fe&&Ve){var rt="M"+(De-1-1)+","+(He-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Ae.attr("d",rt)}else if(Fe){var lt="M"+(De-1-1)+","+(He-9-1)+"v18 h2 v-18 Z";Ae.attr("d",lt)}else{var ot="M"+(De-9-1)+","+(He-1-1)+"h18 v2 h-18 Z";Ae.attr("d",ot)}}()}function Tt(dt){dt.selectAll(".visual-cue").remove()}m.init(Ot),et.node().onmousemove=Wt}(A,re,D,S,z,Z):D.editable===!0&&re.style("pointer-events",te||l.opacity(B)*N<=.5?"stroke":"all");re.node().addEventListener("click",function(){return function($,ne){if(!!w($)){var H=+ne.node().getAttribute("data-index");if(H>=0){if(H===$._fullLayout._activeShapeIndex)return void M($);$._fullLayout._activeShapeIndex=H,$._fullLayout._deactivateShape=M,y($)}}}(A,re)})}}function b(A,S,E){var D=(E.xref+E.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");d.setClipUrl(A,D?"clip"+S._fullLayout._uid+D:null,S)}function T(A,S){var E,D,O,R,z,L,P,N,B=S.type,G=u.getRefType(S.xref),W=u.getRefType(S.yref),K=u.getFromId(A,S.xref),te=u.getFromId(A,S.yref),Y=A._fullLayout._size;if(K?G==="domain"?D=function(ee){return K._offset+K._length*ee}:(E=v.shapePositionToRange(K),D=function(ee){return K._offset+K.r2p(E(ee,!0))}):D=function(ee){return Y.l+Y.w*ee},te?W==="domain"?R=function(ee){return te._offset+te._length*(1-ee)}:(O=v.shapePositionToRange(te),R=function(ee){return te._offset+te.r2p(O(ee,!0))}):R=function(ee){return Y.t+Y.h*(1-ee)},B==="path")return K&&K.type==="date"&&(D=v.decodeDate(D)),te&&te.type==="date"&&(R=v.decodeDate(R)),function(ee,ie,ae){var ue=ee.path,le=ee.xsizemode,ge=ee.ysizemode,fe=ee.xanchor,me=ee.yanchor;return ue.replace(p.segmentRE,function(_e){var we=0,Te=_e.charAt(0),Oe=p.paramIsX[Te],de=p.paramIsY[Te],ye=p.numParams[Te],Me=_e.substr(1).replace(p.paramRE,function(ke){return Oe[we]?ke=le==="pixel"?ie(fe)+Number(ke):ie(ke):de[we]&&(ke=ge==="pixel"?ae(me)-Number(ke):ae(ke)),++we>ye&&(ke="X"),ke});return we>ye&&(Me=Me.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+_e)),Te+Me})}(S,D,R);if(S.xsizemode==="pixel"){var Z=D(S.xanchor);z=Z+S.x0,L=Z+S.x1}else z=D(S.x0),L=D(S.x1);if(S.ysizemode==="pixel"){var re=R(S.yanchor);P=re-S.y0,N=re-S.y1}else P=R(S.y0),N=R(S.y1);if(B==="line")return"M"+z+","+P+"L"+L+","+N;if(B==="rect")return"M"+z+","+P+"H"+L+"V"+N+"H"+z+"Z";var U=(z+L)/2,q=(P+N)/2,$=Math.abs(U-z),ne=Math.abs(q-P),H="A"+$+","+ne,Q=U+$+","+q;return"M"+Q+H+" 0 1,1 "+(U+","+(q-ne))+H+" 0 0,1 "+Q+"Z"}function _(A,S,E){return A.replace(p.segmentRE,function(D){var O=0,R=D.charAt(0),z=p.paramIsX[R],L=p.paramIsY[R],P=p.numParams[R];return R+D.substr(1).replace(p.paramRE,function(N){return O>=P||(z[O]?N=S(N):L[O]&&(N=E(N)),O++),N})})}function M(A){w(A)&&A._fullLayout._activeShapeIndex>=0&&(s(A),delete A._fullLayout._activeShapeIndex,y(A))}o.exports={draw:y,drawOne:k,eraseActiveShape:function(A){if(!!w(A)){s(A);var S=A._fullLayout._activeShapeIndex,E=(A.layout||{}).shapes||[];if(S=0&&h(_),k.attr("d",v(w)),z&&!T&&(R=function(Z,re){for(var U=0;U1&&(q.length!==2||q[1][0]!=="Z")&&(O===0&&(q[0][0]="M"),w[D]=q,M(),A())}}()}}function K(Z,re){(function(U,q){if(w.length)for(var $=0;$0&&_0&&(Y=Y.transition().duration(N.transition.duration).ease(N.transition.easing)),Y.attr("transform",s(te-.5*h.gripWidth,N._dims.currentValueTotalHeight))}}function O(P,N){var B=P._dims;return B.inputAreaStart+h.stepInset+(B.inputAreaLength-2*h.stepInset)*Math.min(1,Math.max(0,N))}function R(P,N){var B=P._dims;return Math.min(1,Math.max(0,(N-h.stepInset-B.inputAreaStart)/(B.inputAreaLength-2*h.stepInset-2*B.inputAreaStart)))}function z(P,N,B){var G=B._dims,W=i.ensureSingle(P,"rect",h.railTouchRectClass,function(K){K.call(S,N,P,B).style("pointer-events","all")});W.attr({width:G.inputAreaLength,height:Math.max(G.inputAreaWidth,h.tickOffset+B.ticklen+G.labelHeight)}).call(u.fill,B.bgcolor).attr("opacity",0),c.setTranslate(W,0,G.currentValueTotalHeight)}function L(P,N){var B=N._dims,G=B.inputAreaLength-2*h.railInset,W=i.ensureSingle(P,"rect",h.railRectClass);W.attr({width:G,height:h.railWidth,rx:h.railRadius,ry:h.railRadius,"shape-rendering":"crispEdges"}).call(u.stroke,N.bordercolor).call(u.fill,N.bgcolor).style("stroke-width",N.borderwidth+"px"),c.setTranslate(W,h.railInset,.5*(B.inputAreaWidth-h.railWidth)+B.currentValueTotalHeight)}o.exports=function(P){var N=P._fullLayout,B=function(Z,re){for(var U=Z[h.name],q=[],$=0;$0?[0]:[]);function W(Z){Z._commandObserver&&(Z._commandObserver.remove(),delete Z._commandObserver),a.autoMargin(P,y(Z))}if(G.enter().append("g").classed(h.containerClassName,!0).style("cursor","ew-resize"),G.exit().each(function(){r.select(this).selectAll("g."+h.groupClassName).each(W)}).remove(),B.length!==0){var K=G.selectAll("g."+h.groupClassName).data(B,x);K.enter().append("g").classed(h.groupClassName,!0),K.exit().each(W).remove();for(var te=0;te0||ae<0){var fe={left:[-ue,0],right:[ue,0],top:[0,-ue],bottom:[0,ue]}[M.side];$.attr("transform",s(fe[0],fe[1]))}}}return Y.call(Z),W&&(L?Y.on(".opacity",null):(O=0,R=!0,Y.text(T).on("mouseover.opacity",function(){r.select(this).transition().duration(m.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(m.HIDE_PLACEHOLDER).style("opacity",0)})),Y.call(h.makeEditable,{gd:v}).on("edit",function(q){_!==void 0?c.call("_guiRestyle",v,b,q,_):c.call("_guiRelayout",v,b,q)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Z)}).on("input",function(q){this.text(q||" ").call(h.positionText,A.x,A.y)})),Y.classed("js-placeholder",R),E}}},{"../../constants/alignment":471,"../../constants/interactions":478,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/plots":619,"../../registry":638,"../color":366,"../drawing":388,"@plotly/d3":58,"fast-isnumeric":190}],465:[function(e,o,f){var r=e("../../plots/font_attributes"),a=e("../color/attributes"),u=e("../../lib/extend").extendFlat,c=e("../../plot_api/edit_types").overrideAll,i=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,l=s("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}});o.exports=c(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:l,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:u(i({editType:"arraydraw"}),{}),font:r({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plot_api/plot_template":543,"../../plots/font_attributes":585,"../../plots/pad_attributes":618,"../color/attributes":365}],466:[function(e,o,f){o.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"}}},{}],467:[function(e,o,f){var r=e("../../lib"),a=e("../../plots/array_container_defaults"),u=e("./attributes"),c=e("./constants").name,i=u.buttons;function s(d,h,m){function g(p,v){return r.coerce(d,h,u,p,v)}g("visible",a(d,h,{name:"buttons",handleItemDefaults:l}).length>0)&&(g("active"),g("direction"),g("type"),g("showactive"),g("x"),g("y"),r.noneOrAll(d,h,["x","y"]),g("xanchor"),g("yanchor"),g("pad.t"),g("pad.r"),g("pad.b"),g("pad.l"),r.coerceFont(g,"font",m.font),g("bgcolor",m.paper_bgcolor),g("bordercolor"),g("borderwidth"))}function l(d,h){function m(g,p){return r.coerce(d,h,i,g,p)}m("visible",d.method==="skip"||Array.isArray(d.args))&&(m("method"),m("args"),m("args2"),m("label"),m("execute"))}o.exports=function(d,h){a(d,h,{name:c,handleItemDefaults:s})}},{"../../lib":503,"../../plots/array_container_defaults":549,"./attributes":465,"./constants":466}],468:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../plots/plots"),u=e("../color"),c=e("../drawing"),i=e("../../lib"),s=e("../../lib/svg_text_utils"),l=e("../../plot_api/plot_template").arrayEditor,d=e("../../constants/alignment").LINE_SPACING,h=e("./constants"),m=e("./scrollbox");function g(O){return O._index}function p(O,R){return+O.attr(h.menuIndexAttrName)===R._index}function v(O,R,z,L,P,N,B,G){R.active=B,l(O.layout,h.name,R).applyUpdate("active",B),R.type==="buttons"?x(O,L,null,null,R):R.type==="dropdown"&&(P.attr(h.menuIndexAttrName,"-1"),y(O,L,P,N,R),G||x(O,L,P,N,R))}function y(O,R,z,L,P){var N=i.ensureSingle(R,"g",h.headerClassName,function(Y){Y.style("pointer-events","all")}),B=P._dims,G=P.active,W=P.buttons[G]||h.blankHeaderOpts,K={y:P.pad.t,yPad:0,x:P.pad.l,xPad:0,index:0},te={width:B.headerWidth,height:B.headerHeight};N.call(w,P,W,O).call(E,P,K,te),i.ensureSingle(R,"text",h.headerArrowClassName,function(Y){Y.attr("text-anchor","end").call(c.font,P.font).text(h.arrowSymbol[P.direction])}).attr({x:B.headerWidth-h.arrowOffsetX+P.pad.l,y:B.headerHeight/2+h.textOffsetY+P.pad.t}),N.on("click",function(){z.call(D,String(p(z,P)?-1:P._index)),x(O,R,z,L,P)}),N.on("mouseover",function(){N.call(_)}),N.on("mouseout",function(){N.call(M,P)}),c.setTranslate(R,B.lx,B.ly)}function x(O,R,z,L,P){z||(z=R).attr("pointer-events","all");var N=function($){return+$.attr(h.menuIndexAttrName)==-1}(z)&&P.type!=="buttons"?[]:P.buttons,B=P.type==="dropdown"?h.dropdownButtonClassName:h.buttonClassName,G=z.selectAll("g."+B).data(i.filterVisible(N)),W=G.enter().append("g").classed(B,!0),K=G.exit();P.type==="dropdown"?(W.attr("opacity","0").transition().attr("opacity","1"),K.transition().attr("opacity","0").remove()):K.remove();var te=0,Y=0,Z=P._dims,re=["up","down"].indexOf(P.direction)!==-1;P.type==="dropdown"&&(re?Y=Z.headerHeight+h.gapButtonHeader:te=Z.headerWidth+h.gapButtonHeader),P.type==="dropdown"&&P.direction==="up"&&(Y=-h.gapButtonHeader+h.gapButton-Z.openHeight),P.type==="dropdown"&&P.direction==="left"&&(te=-h.gapButtonHeader+h.gapButton-Z.openWidth);var U={x:Z.lx+te+P.pad.l,y:Z.ly+Y+P.pad.t,yPad:h.gapButton,xPad:h.gapButton,index:0},q={l:U.x+P.borderwidth,t:U.y+P.borderwidth};G.each(function($,ne){var H=r.select(this);H.call(w,P,$,O).call(E,P,U),H.on("click",function(){r.event.defaultPrevented||($.execute&&($.args2&&P.active===ne?(v(O,P,0,R,z,L,-1),a.executeAPICommand(O,$.method,$.args2)):(v(O,P,0,R,z,L,ne),a.executeAPICommand(O,$.method,$.args))),O.emit("plotly_buttonclicked",{menu:P,button:$,active:P.active}))}),H.on("mouseover",function(){H.call(_)}),H.on("mouseout",function(){H.call(M,P),G.call(T,P)})}),G.call(T,P),re?(q.w=Math.max(Z.openWidth,Z.headerWidth),q.h=U.y-q.t):(q.w=U.x-q.l,q.h=Math.max(Z.openHeight,Z.headerHeight)),q.direction=P.direction,L&&(G.size()?function($,ne,H,Q,ee,ie){var ae,ue,le,ge=ee.direction,fe=ge==="up"||ge==="down",me=ee._dims,_e=ee.active;if(fe)for(ue=0,le=0;le<_e;le++)ue+=me.heights[le]+h.gapButton;else for(ae=0,le=0;le<_e;le++)ae+=me.widths[le]+h.gapButton;Q.enable(ie,ae,ue),Q.hbar&&Q.hbar.attr("opacity","0").transition().attr("opacity","1"),Q.vbar&&Q.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,L,P,q):function($){var ne=!!$.hbar,H=!!$.vbar;ne&&$.hbar.transition().attr("opacity","0").each("end",function(){ne=!1,H||$.disable()}),H&&$.vbar.transition().attr("opacity","0").each("end",function(){H=!1,ne||$.disable()})}(L))}function w(O,R,z,L){O.call(k,R).call(b,R,z,L)}function k(O,R){i.ensureSingle(O,"rect",h.itemRectClassName,function(z){z.attr({rx:h.rx,ry:h.ry,"shape-rendering":"crispEdges"})}).call(u.stroke,R.bordercolor).call(u.fill,R.bgcolor).style("stroke-width",R.borderwidth+"px")}function b(O,R,z,L){var P=i.ensureSingle(O,"text",h.itemTextClassName,function(G){G.attr({"text-anchor":"start","data-notex":1})}),N=z.label,B=L._fullLayout._meta;B&&(N=i.templateString(N,B)),P.call(c.font,R.font).text(N).call(s.convertToTspans,L)}function T(O,R){var z=R.active;O.each(function(L,P){var N=r.select(this);P===z&&R.showactive&&N.select("rect."+h.itemRectClassName).call(u.fill,h.activeColor)})}function _(O){O.select("rect."+h.itemRectClassName).call(u.fill,h.hoverColor)}function M(O,R){O.select("rect."+h.itemRectClassName).call(u.fill,R.bgcolor)}function A(O,R){var z=R._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},L=c.tester.selectAll("g."+h.dropdownButtonClassName).data(i.filterVisible(R.buttons));L.enter().append("g").classed(h.dropdownButtonClassName,!0);var P=["up","down"].indexOf(R.direction)!==-1;L.each(function(te,Y){var Z=r.select(this);Z.call(w,R,te,O);var re=Z.select("."+h.itemTextClassName),U=re.node()&&c.bBox(re.node()).width,q=Math.max(U+h.textPadX,h.minWidth),$=R.font.size*d,ne=s.lineCount(re),H=Math.max($*ne,h.minHeight)+h.textOffsetY;H=Math.ceil(H),q=Math.ceil(q),z.widths[Y]=q,z.heights[Y]=H,z.height1=Math.max(z.height1,H),z.width1=Math.max(z.width1,q),P?(z.totalWidth=Math.max(z.totalWidth,q),z.openWidth=z.totalWidth,z.totalHeight+=H+h.gapButton,z.openHeight+=H+h.gapButton):(z.totalWidth+=q+h.gapButton,z.openWidth+=q+h.gapButton,z.totalHeight=Math.max(z.totalHeight,H),z.openHeight=z.totalHeight)}),P?z.totalHeight-=h.gapButton:z.totalWidth-=h.gapButton,z.headerWidth=z.width1+h.arrowPadX,z.headerHeight=z.height1,R.type==="dropdown"&&(P?(z.width1+=h.arrowPadX,z.totalHeight=z.height1):z.totalWidth=z.width1,z.totalWidth+=h.arrowPadX),L.remove();var N=z.totalWidth+R.pad.l+R.pad.r,B=z.totalHeight+R.pad.t+R.pad.b,G=O._fullLayout._size;z.lx=G.l+G.w*R.x,z.ly=G.t+G.h*(1-R.y);var W="left";i.isRightAnchor(R)&&(z.lx-=N,W="right"),i.isCenterAnchor(R)&&(z.lx-=N/2,W="center");var K="top";i.isBottomAnchor(R)&&(z.ly-=B,K="bottom"),i.isMiddleAnchor(R)&&(z.ly-=B/2,K="middle"),z.totalWidth=Math.ceil(z.totalWidth),z.totalHeight=Math.ceil(z.totalHeight),z.lx=Math.round(z.lx),z.ly=Math.round(z.ly),a.autoMargin(O,S(R),{x:R.x,y:R.y,l:N*({right:1,center:.5}[W]||0),r:N*({left:1,center:.5}[W]||0),b:B*({top:1,middle:.5}[K]||0),t:B*({bottom:1,middle:.5}[K]||0)})}function S(O){return h.autoMarginIdRoot+O._index}function E(O,R,z,L){L=L||{};var P=O.select("."+h.itemRectClassName),N=O.select("."+h.itemTextClassName),B=R.borderwidth,G=z.index,W=R._dims;c.setTranslate(O,B+z.x,B+z.y);var K=["up","down"].indexOf(R.direction)!==-1,te=L.height||(K?W.heights[G]:W.height1);P.attr({x:0,y:0,width:L.width||(K?W.width1:W.widths[G]),height:te});var Y=R.font.size*d,Z=(s.lineCount(N)-1)*Y/2;s.positionText(N,h.textOffsetX,te/2-Z+h.textOffsetY),K?z.y+=W.heights[G]+z.yPad:z.x+=W.widths[G]+z.xPad,z.index++}function D(O,R){O.attr(h.menuIndexAttrName,R||"-1").selectAll("g."+h.dropdownButtonClassName).remove()}o.exports=function(O){var R=O._fullLayout,z=i.filterVisible(R[h.name]);function L(Y){a.autoMargin(O,S(Y))}var P=R._menulayer.selectAll("g."+h.containerClassName).data(z.length>0?[0]:[]);if(P.enter().append("g").classed(h.containerClassName,!0).style("cursor","pointer"),P.exit().each(function(){r.select(this).selectAll("g."+h.headerGroupClassName).each(L)}).remove(),z.length!==0){var N=P.selectAll("g."+h.headerGroupClassName).data(z,g);N.enter().append("g").classed(h.headerGroupClassName,!0);for(var B=i.ensureSingle(P,"g",h.dropdownButtonGroupClassName,function(Y){Y.style("pointer-events","all")}),G=0;GE,R=i.barLength+2*i.barPad,z=i.barWidth+2*i.barPad,L=w,P=b+T;P+z>g&&(P=g-z);var N=this.container.selectAll("rect.scrollbar-horizontal").data(O?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,i.barColor),O?(this.hbar=N.attr({rx:i.barRadius,ry:i.barRadius,x:L,y:P,width:R,height:z}),this._hbarXMin=L+R/2,this._hbarTranslateMax=E-R):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var B=T>D,G=i.barWidth+2*i.barPad,W=i.barLength+2*i.barPad,K=w+k,te=b;K+G>m&&(K=m-G);var Y=this.container.selectAll("rect.scrollbar-vertical").data(B?[0]:[]);Y.exit().on(".drag",null).remove(),Y.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,i.barColor),B?(this.vbar=Y.attr({rx:i.barRadius,ry:i.barRadius,x:K,y:te,width:G,height:W}),this._vbarYMin=te+W/2,this._vbarTranslateMax=D-W):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var Z=this.id,re=p-.5,U=B?v+G+.5:v+.5,q=y-.5,$=O?x+z+.5:x+.5,ne=h._topdefs.selectAll("#"+Z).data(O||B?[0]:[]);if(ne.exit().remove(),ne.enter().append("clipPath").attr("id",Z).append("rect"),O||B?(this._clipRect=ne.select("rect").attr({x:Math.floor(re),y:Math.floor(q),width:Math.ceil(U)-Math.floor(re),height:Math.ceil($)-Math.floor(q)}),this.container.call(u.setClipUrl,Z,this.gd),this.bg.attr({x:w,y:b,width:k,height:T})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(u.setClipUrl,null),delete this._clipRect),O||B){var H=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var Q=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));O&&this.hbar.on(".drag",null).call(Q),B&&this.vbar.on(".drag",null).call(Q)}this.setTranslate(l,d)},i.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(u.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)},i.prototype._onBoxDrag=function(){var s=this.translateX,l=this.translateY;this.hbar&&(s-=r.event.dx),this.vbar&&(l-=r.event.dy),this.setTranslate(s,l)},i.prototype._onBoxWheel=function(){var s=this.translateX,l=this.translateY;this.hbar&&(s+=r.event.deltaY),this.vbar&&(l+=r.event.deltaY),this.setTranslate(s,l)},i.prototype._onBarDrag=function(){var s=this.translateX,l=this.translateY;if(this.hbar){var d=s+this._hbarXMin,h=d+this._hbarTranslateMax;s=(c.constrain(r.event.x,d,h)-d)/(h-d)*(this.position.w-this._box.w)}if(this.vbar){var m=l+this._vbarYMin,g=m+this._vbarTranslateMax;l=(c.constrain(r.event.y,m,g)-m)/(g-m)*(this.position.h-this._box.h)}this.setTranslate(s,l)},i.prototype.setTranslate=function(s,l){var d=this.position.w-this._box.w,h=this.position.h-this._box.h;if(s=c.constrain(s||0,0,d),l=c.constrain(l||0,0,h),this.translateX=s,this.translateY=l,this.container.call(u.setTranslate,this._box.l-this.position.l-s,this._box.t-this.position.t-l),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+s-.5),y:Math.floor(this.position.t+l-.5)}),this.hbar){var m=s/d;this.hbar.call(u.setTranslate,s+m*this._hbarTranslateMax,l)}if(this.vbar){var g=l/h;this.vbar.call(u.setTranslate,s,l+g*this._vbarTranslateMax)}}},{"../../lib":503,"../color":366,"../drawing":388,"@plotly/d3":58}],471:[function(e,o,f){o.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"}}},{}],472:[function(e,o,f){o.exports={axisRefDescription:function(r,a,u){return["If set to a",r,"axis id (e.g. *"+r+"* or","*"+r+"2*), the `"+r+"` position refers to a",r,"coordinate. If set to *paper*, the `"+r+"`","position refers to the distance from the",a,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",a,"("+u+"). If set to a",r,"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",a,"of the domain of that axis: e.g.,","*"+r+"2 domain* refers to the domain of the second",r," axis and a",r,"position of 0.5 refers to the","point between the",a,"and the",u,"of the domain of the","second",r,"axis."].join(" ")}}},{}],473:[function(e,o,f){o.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25B2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25BC"}}},{}],474:[function(e,o,f){o.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"}},{}],475:[function(e,o,f){o.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],476:[function(e,o,f){o.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]}},{}],477:[function(e,o,f){o.exports={circle:"\u25CF","circle-open":"\u25CB",square:"\u25A0","square-open":"\u25A1",diamond:"\u25C6","diamond-open":"\u25C7",cross:"+",x:"\u274C"}},{}],478:[function(e,o,f){o.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],479:[function(e,o,f){o.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:24405875e-1,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],480:[function(e,o,f){f.xmlns="http://www.w3.org/2000/xmlns/",f.svg="http://www.w3.org/2000/svg",f.xlink="http://www.w3.org/1999/xlink",f.svgAttrs={xmlns:f.svg,"xmlns:xlink":f.xlink}},{}],481:[function(e,o,f){f.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var r=e("./registry"),a=f.register=r.register,u=e("./plot_api"),c=Object.keys(u),i=0;iplotly-logomark"}}},{}],483:[function(e,o,f){f.isLeftAnchor=function(r){return r.xanchor==="left"||r.xanchor==="auto"&&r.x<=1/3},f.isCenterAnchor=function(r){return r.xanchor==="center"||r.xanchor==="auto"&&r.x>1/3&&r.x<2/3},f.isRightAnchor=function(r){return r.xanchor==="right"||r.xanchor==="auto"&&r.x>=2/3},f.isTopAnchor=function(r){return r.yanchor==="top"||r.yanchor==="auto"&&r.y>=2/3},f.isMiddleAnchor=function(r){return r.yanchor==="middle"||r.yanchor==="auto"&&r.y>1/3&&r.y<2/3},f.isBottomAnchor=function(r){return r.yanchor==="bottom"||r.yanchor==="auto"&&r.y<=1/3}},{}],484:[function(e,o,f){var r=e("./mod"),a=r.mod,u=r.modHalf,c=Math.PI,i=2*c;function s(m){return Math.abs(m[1]-m[0])>i-1e-14}function l(m,g){return u(g-m,i)}function d(m,g){if(s(g))return!0;var p,v;g[0](v=a(v,i))&&(v+=i);var y=a(m,i),x=y+i;return y>=p&&y<=v||x>=p&&x<=v}function h(m,g,p,v,y,x,w){y=y||0,x=x||0;var k,b,T,_,M,A=s([p,v]);function S(R,z){return[R*Math.cos(z)+y,x-R*Math.sin(z)]}A?(k=0,b=c,T=i):p=y&&m<=x);var y,x},pathArc:function(m,g,p,v,y){return h(null,m,g,p,v,y,0)},pathSector:function(m,g,p,v,y){return h(null,m,g,p,v,y,1)},pathAnnulus:function(m,g,p,v,y,x){return h(m,g,p,v,y,x,1)}}},{"./mod":510}],485:[function(e,o,f){var r=Array.isArray,a=ArrayBuffer,u=DataView;function c(l){return a.isView(l)&&!(l instanceof u)}function i(l){return r(l)||c(l)}function s(l,d,h){if(i(l)){if(i(l[0])){for(var m=h,g=0;gx.max?v.set(y):v.set(+p)}},integer:{coerceFunction:function(p,v,y,x){p%1||!r(p)||x.min!==void 0&&px.max?v.set(y):v.set(+p)}},string:{coerceFunction:function(p,v,y,x){if(typeof p!="string"){var w=typeof p=="number";x.strict!==!0&&w?v.set(String(p)):v.set(y)}else x.noBlank&&!p?v.set(y):v.set(p)}},color:{coerceFunction:function(p,v,y){a(p).isValid()?v.set(p):v.set(y)}},colorlist:{coerceFunction:function(p,v,y){Array.isArray(p)&&p.length&&p.every(function(x){return a(x).isValid()})?v.set(p):v.set(y)}},colorscale:{coerceFunction:function(p,v,y){v.set(c.get(p,y))}},angle:{coerceFunction:function(p,v,y){p==="auto"?v.set("auto"):r(p)?v.set(h(+p,360)):v.set(y)}},subplotid:{coerceFunction:function(p,v,y,x){var w=x.regex||d(y);typeof p=="string"&&w.test(p)?v.set(p):v.set(y)},validateFunction:function(p,v){var y=v.dflt;return p===y||typeof p=="string"&&!!d(y).test(p)}},flaglist:{coerceFunction:function(p,v,y,x){if(typeof p=="string")if((x.extras||[]).indexOf(p)===-1){for(var w=p.split("+"),k=0;k=r&&N<=a?N:d}if(typeof N!="string"&&typeof N!="number")return d;N=String(N);var te=T(B),Y=N.charAt(0);!te||Y!=="G"&&Y!=="g"||(N=N.substr(1),B="");var Z=te&&B.substr(0,7)==="chinese",re=N.match(Z?k:w);if(!re)return d;var U=re[1],q=re[3]||"1",$=Number(re[5]||1),ne=Number(re[7]||0),H=Number(re[9]||0),Q=Number(re[11]||0);if(te){if(U.length===2)return d;var ee;U=Number(U);try{var ie=y.getComponentMethod("calendars","getCal")(B);if(Z){var ae=q.charAt(q.length-1)==="i";q=parseInt(q,10),ee=ie.newDate(U,ie.toMonthIndex(U,q,ae),$)}else ee=ie.newDate(U,Number(q),$)}catch{return d}return ee?(ee.toJD()-v)*h+ne*m+H*g+Q*p:d}U=U.length===2?(Number(U)+2e3-b)%100+b:Number(U),q-=1;var ue=new Date(Date.UTC(2e3,q,$,ne,H));return ue.setUTCFullYear(U),ue.getUTCMonth()!==q||ue.getUTCDate()!==$?d:ue.getTime()+Q*p},r=f.MIN_MS=f.dateTime2ms("-9999"),a=f.MAX_MS=f.dateTime2ms("9999-12-31 23:59:59.9999"),f.isDateTime=function(N,B){return f.dateTime2ms(N,B)!==d};var M=90*h,A=3*m,S=5*g;function E(N,B,G,W,K){if((B||G||W||K)&&(N+=" "+_(B,2)+":"+_(G,2),(W||K)&&(N+=":"+_(W,2),K))){for(var te=4;K%10==0;)te-=1,K/=10;N+="."+_(K,te)}return N}f.ms2DateTime=function(N,B,G){if(typeof N!="number"||!(N>=r&&N<=a))return d;B||(B=0);var W,K,te,Y,Z,re,U=Math.floor(10*s(N+.05,1)),q=Math.round(N-U/10);if(T(G)){var $=Math.floor(q/h)+v,ne=Math.floor(s(N,h));try{W=y.getComponentMethod("calendars","getCal")(G).fromJD($).formatDate("yyyy-mm-dd")}catch{W=x("G%Y-%m-%d")(new Date(q))}if(W.charAt(0)==="-")for(;W.length<11;)W="-0"+W.substr(1);else for(;W.length<10;)W="0"+W;K=B=r+h&&N<=a-h))return d;var B=Math.floor(10*s(N+.05,1)),G=new Date(Math.round(N-B/10));return E(u("%Y-%m-%d")(G),G.getHours(),G.getMinutes(),G.getSeconds(),10*G.getUTCMilliseconds()+B)},f.cleanDate=function(N,B,G){if(N===d)return B;if(f.isJSDate(N)||typeof N=="number"&&isFinite(N)){if(T(G))return i.error("JS Dates and milliseconds are incompatible with world calendars",N),B;if(!(N=f.ms2DateTimeLocal(+N))&&B!==void 0)return B}else if(!f.isDateTime(N,G))return i.error("unrecognized date",N),B;return N};var D=/%\d?f/g,O=/%h/g,R={1:"1",2:"1",3:"2",4:"2"};function z(N,B,G,W){N=N.replace(D,function(te){var Y=Math.min(+te.charAt(1)||6,6);return(B/1e3%1+2).toFixed(Y).substr(2).replace(/0+$/,"")||"0"});var K=new Date(Math.floor(B+.05));if(N=N.replace(O,function(){return R[G("%q")(K)]}),T(W))try{N=y.getComponentMethod("calendars","worldCalFmt")(N,B,W)}catch{return"Invalid"}return G(N)(K)}var L=[59,59.9,59.99,59.999,59.9999];f.formatDate=function(N,B,G,W,K,te){if(K=T(K)&&K,!B)if(G==="y")B=te.year;else if(G==="m")B=te.month;else{if(G!=="d")return function(Y,Z){var re=s(Y+.05,h),U=_(Math.floor(re/m),2)+":"+_(s(Math.floor(re/g),60),2);if(Z!=="M"){c(Z)||(Z=0);var q=(100+Math.min(s(Y/p,60),L[Z])).toFixed(Z).substr(1);Z>0&&(q=q.replace(/0+$/,"").replace(/[\.]$/,"")),U+=":"+q}return U}(N,G)+` +`+z(te.dayMonthYear,N,W,K);B=te.dayMonth+` +`+te.year}return z(B,N,W,K)};var P=3*h;f.incrementMonth=function(N,B,G){G=T(G)&&G;var W=s(N,h);if(N=Math.round(N-W),G)try{var K=Math.round(N/h)+v,te=y.getComponentMethod("calendars","getCal")(G),Y=te.fromJD(K);return B%12?te.add(Y,B,"m"):te.add(Y,B/12,"y"),(Y.toJD()-v)*h+W}catch{i.error("invalid ms "+N+" in calendar "+G)}var Z=new Date(N+P);return Z.setUTCMonth(Z.getUTCMonth()+B)+W-P},f.findExactDates=function(N,B){for(var G,W,K=0,te=0,Y=0,Z=0,re=T(B)&&y.getComponentMethod("calendars","getCal")(B),U=0;U0&&E[D+1][0]<0)return D;return null}switch(x=M==="RUS"||M==="FJI"?function(E){var D;if(S(E)===null)D=E;else for(D=new Array(E.length),b=0;bD?O[R++]=[E[b][0]+360,E[b][1]]:b===D?(O[R++]=E[b],O[R++]=[E[b][0],-90]):O[R++]=E[b];var z=m.tester(O);z.pts.pop(),A.push(z)}:function(E){A.push(m.tester(E))},T.type){case"MultiPolygon":for(w=0;w<_.length;w++)for(k=0;k<_[w].length;k++)x(_[w][k]);break;case"Polygon":for(w=0;w<_.length;w++)x(_[w])}return A},getTraceGeojson:v,extractTraceFeature:function(y){var x=y[0].trace,w=v(x);if(!w)return!1;var k,b={},T=[];for(k=0;kG&&(G=te,P=K)}else P=N;return c.default(P).geometry.coordinates}(z),O.fIn=E,O.fOut=z,T.push(z)}else l.log(["Location",O.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete b[D]}switch(w.type){case"FeatureCollection":var A=w.features;for(k=0;k100?(clearInterval(D),S("Unexpected error while fetching from "+M)):void E++},50)})}for(var T=0;T0&&(c.push(i),i=[])}return i.length>0&&c.push(i),c},f.makeLine=function(a){return a.length===1?{type:"LineString",coordinates:a[0]}:{type:"MultiLineString",coordinates:a}},f.makePolygon=function(a){if(a.length===1)return{type:"Polygon",coordinates:a};for(var u=new Array(a.length),c=0;c1||A<0||A>1?null:{x:l+x*A,y:d+b*A}}function s(l,d,h,m,g){var p=m*l+g*d;if(p<0)return m*m+g*g;if(p>h){var v=m-l,y=g-d;return v*v+y*y}var x=m*d-g*l;return x*x/h}f.segmentsIntersect=i,f.segmentDistance=function(l,d,h,m,g,p,v,y){if(i(l,d,h,m,g,p,v,y))return 0;var x=h-l,w=m-d,k=v-g,b=y-p,T=x*x+w*w,_=k*k+b*b,M=Math.min(s(x,w,T,g-l,p-d),s(x,w,T,v-l,y-d),s(k,b,_,l-g,d-p),s(k,b,_,h-g,m-p));return Math.sqrt(M)},f.getTextLocation=function(l,d,h,m){if(l===a&&m===u||(r={},a=l,u=m),r[h])return r[h];var g=l.getPointAtLength(c(h-m/2,d)),p=l.getPointAtLength(c(h+m/2,d)),v=Math.atan((p.y-g.y)/(p.x-g.x)),y=l.getPointAtLength(c(h,d)),x={x:(4*y.x+g.x+p.x)/6,y:(4*y.y+g.y+p.y)/6,theta:v};return r[h]=x,x},f.clearLocationCache=function(){a=null},f.getVisibleSegment=function(l,d,h){var m,g,p=d.left,v=d.right,y=d.top,x=d.bottom,w=0,k=l.getTotalLength(),b=k;function T(M){var A=l.getPointAtLength(M);M===0?m=A:M===k&&(g=A);var S=A.xv?A.x-v:0,E=A.yx?A.y-x:0;return Math.sqrt(S*S+E*E)}for(var _=T(w);_;){if((w+=_+h)>b)return;_=T(w)}for(_=T(b);_;){if(w>(b-=_+h))return;_=T(b)}return{min:w,max:b,len:b-w,total:k,isClosed:w===0&&b===k&&Math.abs(m.x-g.x)<.1&&Math.abs(m.y-g.y)<.1}},f.findPointOnPath=function(l,d,h,m){for(var g,p,v,y=(m=m||{}).pathLength||l.getTotalLength(),x=m.tolerance||.001,w=m.iterationLimit||30,k=l.getPointAtLength(0)[h]>l.getPointAtLength(y)[h]?-1:1,b=0,T=0,_=y;b0?_=g:T=g,b++}return p}},{"./mod":510}],499:[function(e,o,f){var r=e("fast-isnumeric"),a=e("tinycolor2"),u=e("color-normalize"),c=e("../components/colorscale"),i=e("../components/color/attributes").defaultLine,s=e("./array").isArrayOrTypedArray,l=u(i);function d(g,p){var v=g;return v[3]*=p,v}function h(g){if(r(g))return l;var p=u(g);return p.length?p:l}function m(g){return r(g)?g:1}o.exports={formatColor:function(g,p,v){var y,x,w,k,b,T=g.color,_=s(T),M=s(p),A=c.extractOpts(g),S=[];if(y=A.colorscale!==void 0?c.makeColorScaleFuncFromTrace(g):h,x=_?function(D,O){return D[O]===void 0?l:u(y(D[O]))}:h,w=M?function(D,O){return D[O]===void 0?1:m(D[O])}:m,_||M)for(var E=0;E1?(u*r+u*a)/u:r+a,i=String(c).length;if(i>16){var s=String(a).length;if(i>=String(r).length+s){var l=parseFloat(c).toPrecision(12);l.indexOf("e+")===-1&&(c=+l)}}return c}},{}],503:[function(e,o,f){var r=e("@plotly/d3"),a=e("d3-time-format").utcFormat,u=e("d3-format").format,c=e("fast-isnumeric"),i=e("../constants/numerical"),s=i.FP_SAFE,l=-s,d=i.BADNUM,h=o.exports={};h.adjustFormat=function(U){return!U||/^\d[.]\df/.test(U)||/[.]\d%/.test(U)?U:U==="0.f"?"~f":/^\d%/.test(U)?"~%":/^\ds/.test(U)?"~s":!/^[~,.0$]/.test(U)&&/[&fps]/.test(U)?"~"+U:U};var m={};h.warnBadFormat=function(U){var q=String(U);m[q]||(m[q]=1,h.warn('encountered bad format: "'+q+'"'))},h.noFormat=function(U){return String(U)},h.numberFormat=function(U){var q;try{q=u(h.adjustFormat(U))}catch{return h.warnBadFormat(U),h.noFormat}return q},h.nestedProperty=e("./nested_property"),h.keyedContainer=e("./keyed_container"),h.relativeAttr=e("./relative_attr"),h.isPlainObject=e("./is_plain_object"),h.toLogRange=e("./to_log_range"),h.relinkPrivateKeys=e("./relink_private");var g=e("./array");h.isTypedArray=g.isTypedArray,h.isArrayOrTypedArray=g.isArrayOrTypedArray,h.isArray1D=g.isArray1D,h.ensureArray=g.ensureArray,h.concat=g.concat,h.maxRowLength=g.maxRowLength,h.minRowLength=g.minRowLength;var p=e("./mod");h.mod=p.mod,h.modHalf=p.modHalf;var v=e("./coerce");h.valObjectMeta=v.valObjectMeta,h.coerce=v.coerce,h.coerce2=v.coerce2,h.coerceFont=v.coerceFont,h.coercePattern=v.coercePattern,h.coerceHoverinfo=v.coerceHoverinfo,h.coerceSelectionMarkerOpacity=v.coerceSelectionMarkerOpacity,h.validate=v.validate;var y=e("./dates");h.dateTime2ms=y.dateTime2ms,h.isDateTime=y.isDateTime,h.ms2DateTime=y.ms2DateTime,h.ms2DateTimeLocal=y.ms2DateTimeLocal,h.cleanDate=y.cleanDate,h.isJSDate=y.isJSDate,h.formatDate=y.formatDate,h.incrementMonth=y.incrementMonth,h.dateTick0=y.dateTick0,h.dfltRange=y.dfltRange,h.findExactDates=y.findExactDates,h.MIN_MS=y.MIN_MS,h.MAX_MS=y.MAX_MS;var x=e("./search");h.findBin=x.findBin,h.sorterAsc=x.sorterAsc,h.sorterDes=x.sorterDes,h.distinctVals=x.distinctVals,h.roundUp=x.roundUp,h.sort=x.sort,h.findIndexOfMin=x.findIndexOfMin,h.sortObjectKeys=e("./sort_object_keys");var w=e("./stats");h.aggNums=w.aggNums,h.len=w.len,h.mean=w.mean,h.median=w.median,h.midRange=w.midRange,h.variance=w.variance,h.stdev=w.stdev,h.interp=w.interp;var k=e("./matrix");h.init2dArray=k.init2dArray,h.transposeRagged=k.transposeRagged,h.dot=k.dot,h.translationMatrix=k.translationMatrix,h.rotationMatrix=k.rotationMatrix,h.rotationXYMatrix=k.rotationXYMatrix,h.apply3DTransform=k.apply3DTransform,h.apply2DTransform=k.apply2DTransform,h.apply2DTransform2=k.apply2DTransform2,h.convertCssMatrix=k.convertCssMatrix,h.inverseTransformMatrix=k.inverseTransformMatrix;var b=e("./angles");h.deg2rad=b.deg2rad,h.rad2deg=b.rad2deg,h.angleDelta=b.angleDelta,h.angleDist=b.angleDist,h.isFullCircle=b.isFullCircle,h.isAngleInsideSector=b.isAngleInsideSector,h.isPtInsideSector=b.isPtInsideSector,h.pathArc=b.pathArc,h.pathSector=b.pathSector,h.pathAnnulus=b.pathAnnulus;var T=e("./anchor_utils");h.isLeftAnchor=T.isLeftAnchor,h.isCenterAnchor=T.isCenterAnchor,h.isRightAnchor=T.isRightAnchor,h.isTopAnchor=T.isTopAnchor,h.isMiddleAnchor=T.isMiddleAnchor,h.isBottomAnchor=T.isBottomAnchor;var _=e("./geometry2d");h.segmentsIntersect=_.segmentsIntersect,h.segmentDistance=_.segmentDistance,h.getTextLocation=_.getTextLocation,h.clearLocationCache=_.clearLocationCache,h.getVisibleSegment=_.getVisibleSegment,h.findPointOnPath=_.findPointOnPath;var M=e("./extend");h.extendFlat=M.extendFlat,h.extendDeep=M.extendDeep,h.extendDeepAll=M.extendDeepAll,h.extendDeepNoArrays=M.extendDeepNoArrays;var A=e("./loggers");h.log=A.log,h.warn=A.warn,h.error=A.error;var S=e("./regex");h.counterRegex=S.counter;var E=e("./throttle");h.throttle=E.throttle,h.throttleDone=E.done,h.clearThrottle=E.clear;var D=e("./dom");function O(U){var q={};for(var $ in U)for(var ne=U[$],H=0;Hs||U=q)&&c(U)&&U>=0&&U%1==0},h.noop=e("./noop"),h.identity=e("./identity"),h.repeat=function(U,q){for(var $=new Array(q),ne=0;ne$?Math.max($,Math.min(q,U)):Math.max(q,Math.min($,U))},h.bBoxIntersect=function(U,q,$){return $=$||0,U.left<=q.right+$&&q.left<=U.right+$&&U.top<=q.bottom+$&&q.top<=U.bottom+$},h.simpleMap=function(U,q,$,ne,H){for(var Q=U.length,ee=new Array(Q),ie=0;ie=Math.pow(2,$)?H>10?(h.warn("randstr failed uniqueness"),ae):U(q,$,ne,(H||0)+1):ae},h.OptionControl=function(U,q){U||(U={}),q||(q="opt");var $={optionList:[],_newoption:function(ne){ne[q]=U,$[ne.name]=ne,$.optionList.push(ne)}};return $["_"+q]=U,$},h.smooth=function(U,q){if((q=Math.round(q)||0)<2)return U;var $,ne,H,Q,ee=U.length,ie=2*ee,ae=2*q-1,ue=new Array(ae),le=new Array(ee);for($=0;$=ie&&(H-=ie*Math.floor(H/ie)),H<0?H=-1-H:H>=ee&&(H=ie-1-H),Q+=U[H]*ue[ne];le[$]=Q}return le},h.syncOrAsync=function(U,q,$){var ne;function H(){return h.syncOrAsync(U,q,$)}for(;U.length;)if((ne=(0,U.splice(0,1)[0])(q))&&ne.then)return ne.then(H);return $&&$(q)},h.stripTrailingSlash=function(U){return U.substr(-1)==="/"?U.substr(0,U.length-1):U},h.noneOrAll=function(U,q,$){if(U){var ne,H=!1,Q=!0;for(ne=0;ne<$.length;ne++)U[$[ne]]!=null?H=!0:Q=!1;if(H&&!Q)for(ne=0;ne<$.length;ne++)U[$[ne]]=q[$[ne]]}},h.mergeArray=function(U,q,$,ne){var H=typeof ne=="function";if(h.isArrayOrTypedArray(U))for(var Q=Math.min(U.length,q.length),ee=0;ee0?H:0})},h.fillArray=function(U,q,$,ne){if(ne=ne||h.identity,h.isArrayOrTypedArray(U))for(var H=0;H1?H+ee[1]:"";if(Q&&(ee.length>1||ie.length>4||$))for(;ne.test(ie);)ie=ie.replace(ne,"$1"+Q+"$2");return ie+ae},h.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var B=/^\w*$/;h.templateString=function(U,q){var $={};return U.replace(h.TEMPLATE_STRING_REGEX,function(ne,H){var Q;return B.test(H)?Q=q[H]:($[H]=$[H]||h.nestedProperty(q,H).get,Q=$[H]()),h.isValidTextValue(Q)?Q:""})};var G={max:10,count:0,name:"hovertemplate"};h.hovertemplateString=function(){return te.apply(G,arguments)};var W={max:10,count:0,name:"texttemplate"};h.texttemplateString=function(){return te.apply(W,arguments)};var K=/^[:|\|]/;function te(U,q,$){var ne=this,H=arguments;q||(q={});var Q={};return U.replace(h.TEMPLATE_STRING_REGEX,function(ee,ie,ae){var ue,le,ge,fe=ie==="_xother"||ie==="_yother",me=ie==="_xother_"||ie==="_yother_",_e=ie==="xother_"||ie==="yother_",we=ie==="xother"||ie==="yother"||fe||_e||me,Te=ie;if((fe||me)&&(Te=Te.substring(1)),(_e||me)&&(Te=Te.substring(0,Te.length-1)),we){if((ue=q[Te])===void 0)return""}else for(ge=3;ge=48&&ee<=57,ue=ie>=48&&ie<=57;if(ae&&(ne=10*ne+ee-48),ue&&(H=10*H+ie-48),!ae||!ue){if(ne!==H)return ne-H;if(ee!==ie)return ee-ie}}return H-ne};var Y=2e9;h.seedPseudoRandom=function(){Y=2e9},h.pseudoRandom=function(){var U=Y;return Y=(69069*Y+1)%4294967296,Math.abs(Y-U)<429496729?h.pseudoRandom():Y/4294967296},h.fillText=function(U,q,$){var ne=Array.isArray($)?function(ee){$.push(ee)}:function(ee){$.text=ee},H=h.extractOption(U,q,"htx","hovertext");if(h.isValidTextValue(H))return ne(H);var Q=h.extractOption(U,q,"tx","text");return h.isValidTextValue(Q)?ne(Q):void 0},h.isValidTextValue=function(U){return U||U===0},h.formatPercent=function(U,q){q=q||0;for(var $=(Math.round(100*U*Math.pow(10,q))*Math.pow(.1,q)).toFixed(q)+"%",ne=0;ne1&&(ue=1):ue=0,h.strTranslate(H-ue*($+ee),Q-ue*(ne+ie))+h.strScale(ue)+(ae?"rotate("+ae+(q?"":" "+$+" "+ne)+")":"")},h.ensureUniformFontSize=function(U,q){var $=h.extendFlat({},q);return $.size=Math.max(q.size,U._fullLayout.uniformtext.minsize||0),$},h.join2=function(U,q,$){var ne=U.length;return ne>1?U.slice(0,-1).join(q)+$+U[ne-1]:U.join(q)},h.bigFont=function(U){return Math.round(1.2*U)};var Z=h.getFirefoxVersion(),re=Z!==null&&Z<86;h.getPositionFromD3Event=function(){return re?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}},{"../constants/numerical":479,"./anchor_utils":483,"./angles":484,"./array":485,"./clean_number":486,"./clear_responsive":488,"./coerce":489,"./dates":490,"./dom":491,"./extend":493,"./filter_unique":494,"./filter_visible":495,"./geometry2d":498,"./identity":501,"./increment":502,"./is_plain_object":504,"./keyed_container":505,"./localize":506,"./loggers":507,"./make_trace_groups":508,"./matrix":509,"./mod":510,"./nested_property":511,"./noop":512,"./notifier":513,"./preserve_drawing_buffer":517,"./push_unique":518,"./regex":520,"./relative_attr":521,"./relink_private":522,"./search":523,"./sort_object_keys":526,"./stats":527,"./throttle":530,"./to_log_range":531,"@plotly/d3":58,"d3-format":112,"d3-time-format":120,"fast-isnumeric":190}],504:[function(e,o,f){o.exports=function(r){return window&&window.process&&window.process.versions?Object.prototype.toString.call(r)==="[object Object]":Object.prototype.toString.call(r)==="[object Object]"&&Object.getPrototypeOf(r).hasOwnProperty("hasOwnProperty")}},{}],505:[function(e,o,f){var r=e("./nested_property"),a=/^\w*$/;o.exports=function(u,c,i,s){var l,d,h;i=i||"name",s=s||"value";var m={};c&&c.length?(h=r(u,c),d=h.get()):d=u,c=c||"";var g={};if(d)for(l=0;l2)return m[x]=2|m[x],v.set(y,null);if(p){for(l=x;l1){var i=["LOG:"];for(c=0;c1){var s=[];for(c=0;c"),"long")}},u.warn=function(){var c;if(r.logging>0){var i=["WARN:"];for(c=0;c0){var s=[];for(c=0;c"),"stick")}},u.error=function(){var c;if(r.logging>0){var i=["ERROR:"];for(c=0;c0){var s=[];for(c=0;c"),"stick")}}},{"../plot_api/plot_config":541,"./notifier":513}],508:[function(e,o,f){var r=e("@plotly/d3");o.exports=function(a,u,c){var i=a.selectAll("g."+c.replace(/\s/g,".")).data(u,function(l){return l[0].trace.uid});i.exit().remove(),i.enter().append("g").attr("class",c),i.order();var s=a.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each(function(l){l[0][s]=r.select(this)}),i}},{"@plotly/d3":58}],509:[function(e,o,f){var r=e("gl-mat4");f.init2dArray=function(a,u){for(var c=new Array(a),i=0;ia/2?r-Math.round(r/a)*a:r}}},{}],511:[function(e,o,f){var r=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function u(m,g){return function(){var p,v,y,x,w,k=m;for(x=0;x/g),v=0;vd||b===a||bm)&&(!w||!g(x))}:function(x,w){var k=x[0],b=x[1];if(k===a||kd||b===a||bm)return!1;var T,_,M,A,S,E=s.length,D=s[0][0],O=s[0][1],R=0;for(T=1;TMath.max(_,D)||b>Math.max(M,O)))if(bv||Math.abs(r(h,x))>l)return!0;return!1},u.filter=function(c,i){var s=[c[0]],l=0,d=0;function h(m){c.push(m);var g=s.length,p=l;s.splice(d+1);for(var v=p+1;v1&&h(c.pop()),{addPt:h,raw:c,filtered:s}}},{"../constants/numerical":479,"./matrix":509}],516:[function(e,o,f){(function(r){(function(){var a=e("./show_no_webgl_msg"),u=e("regl");o.exports=function(c,i,s){var l=c._fullLayout,d=!0;return l._glcanvas.each(function(h){if(h.regl)h.regl.preloadCachedCode(s);else if(!h.pick||l._has("parcoords")){try{h.regl=u({canvas:this,attributes:{antialias:!h.pick,preserveDrawingBuffer:!0},pixelRatio:c._context.plotGlPixelRatio||r.devicePixelRatio,extensions:i||[],cachedCode:s||{}})}catch{d=!1}h.regl||(d=!1),d&&this.addEventListener("webglcontextlost",function(m){c&&c.emit&&c.emit("plotly_webglcontextlost",{event:m,layer:h.key})},!1)}}),d||a({container:l._glcontainer.node()}),d}}).call(this)}).call(this,typeof Ro<"u"?Ro:typeof self<"u"?self:typeof window<"u"?window:{})},{"./show_no_webgl_msg":525,regl:283}],517:[function(e,o,f){var r=e("fast-isnumeric"),a=e("is-mobile");o.exports=function(u){var c;if(typeof(c=u&&u.hasOwnProperty("userAgent")?u.userAgent:function(){var g;return typeof navigator<"u"&&(g=navigator.userAgent),g&&g.headers&&typeof g.headers["user-agent"]=="string"&&(g=g.headers["user-agent"]),g}())!="string")return!0;var i=a({ua:{headers:{"user-agent":c}},tablet:!0,featureDetect:!1});if(!i){for(var s=c.split(" "),l=1;l-1;d--){var h=s[d];if(h.substr(0,8)==="Version/"){var m=h.substr(8).split(".")[0];if(r(m)&&(m=+m),m>=13)return!0}}}return i}},{"fast-isnumeric":190,"is-mobile":234}],518:[function(e,o,f){o.exports=function(r,a){if(a instanceof RegExp){for(var u=a.toString(),c=0;ca.queueLength&&(c.undoQueue.queue.shift(),c.undoQueue.index--))},startSequence:function(c){c.undoQueue=c.undoQueue||{index:0,queue:[],sequence:!1},c.undoQueue.sequence=!0,c.undoQueue.beginSequence=!0},stopSequence:function(c){c.undoQueue=c.undoQueue||{index:0,queue:[],sequence:!1},c.undoQueue.sequence=!1,c.undoQueue.beginSequence=!1},undo:function(c){var i,s;if(!(c.undoQueue===void 0||isNaN(c.undoQueue.index)||c.undoQueue.index<=0)){for(c.undoQueue.index--,i=c.undoQueue.queue[c.undoQueue.index],c.undoQueue.inSequence=!0,s=0;s=c.undoQueue.queue.length)){for(i=c.undoQueue.queue[c.undoQueue.index],c.undoQueue.inSequence=!0,s=0;sm}function d(h,m){return h>=m}f.findBin=function(h,m,g){if(r(m.start))return g?Math.ceil((h-m.start)/m.size-1e-9)-1:Math.floor((h-m.start)/m.size+1e-9);var p,v,y=0,x=m.length,w=0,k=x>1?(m[x-1]-m[0])/(x-1):1;for(v=k>=0?g?i:s:g?d:l,h+=1e-9*k*(g?-1:1)*(k>=0?1:-1);y90&&a.log("Long binary search..."),y-1},f.sorterAsc=function(h,m){return h-m},f.sorterDes=function(h,m){return m-h},f.distinctVals=function(h){var m,g=h.slice();for(g.sort(f.sorterAsc),m=g.length-1;m>-1&&g[m]===c;m--);for(var p,v=g[m]-g[0]||1,y=v/(m||1)/1e4,x=[],w=0;w<=m;w++){var k=g[w],b=k-p;p===void 0?(x.push(k),p=k):b>y&&(v=Math.min(v,b),x.push(k),p=k)}return{vals:x,minDiff:v}},f.roundUp=function(h,m,g){for(var p,v=0,y=m.length-1,x=0,w=g?0:1,k=g?1:0,b=g?Math.ceil:Math.floor;v0&&(p=1),g&&p)return h.sort(m)}return p?h:h.reverse()},f.findIndexOfMin=function(h,m){m=m||u;for(var g,p=1/0,v=0;vi.length)&&(s=i.length),r(c)||(c=!1),a(i[0])){for(d=new Array(s),l=0;lu.length-1)return u[u.length-1];var i=c%1;return i*u[Math.ceil(c)]+(1-i)*u[Math.floor(c)]}},{"./array":485,"fast-isnumeric":190}],528:[function(e,o,f){var r=e("color-normalize");o.exports=function(a){return a?r(a):[0,0,0,1]}},{"color-normalize":89}],529:[function(e,o,f){var r=e("@plotly/d3"),a=e("../lib"),u=a.strTranslate,c=e("../constants/xmlns_namespaces"),i=e("../constants/alignment").LINE_SPACING,s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;f.convertToTspans=function(L,P,N){var B=L.text(),G=!L.attr("data-notex")&&P&&P._context.typesetMath&&typeof MathJax<"u"&&B.match(s),W=r.select(L.node().parentNode);if(!W.empty()){var K=L.attr("class")?L.attr("class").split(" ")[0]:"text";return K+="-math",W.selectAll("svg."+K).remove(),W.selectAll("g."+K+"-group").remove(),L.style("display",null).attr({"data-unformatted":B,"data-math":"N"}),G?(P&&P._promises||[]).push(new Promise(function(Y){L.style("display","none");var Z=parseInt(L.node().style.fontSize,10),re={fontSize:Z};(function(U,q,$){var ne,H,Q,ee,ie=parseInt((MathJax.version||"").split(".")[0]);if(ie!==2&&ie!==3)return void a.warn("No MathJax version:",MathJax.version);var ae=function(){var le="math-output-"+a.randstr({},64),ge=(ee=r.select("body").append("div").attr({id:le}).style({visibility:"hidden",position:"absolute","font-size":q.fontSize+"px"}).text(U.replace(l,"\\lt ").replace(d,"\\gt "))).node();return ie===2?MathJax.Hub.Typeset(ge):MathJax.typeset([ge])},ue=function(){var le=ee.select(ie===2?".MathJax_SVG":".MathJax"),ge=!le.empty()&&ee.select("svg").node();if(ge){var fe,me=ge.getBoundingClientRect();fe=ie===2?r.select("body").select("#MathJax_SVG_glyphs"):le.select("defs"),$(le,fe,me)}else a.log("There was an error in the tex syntax.",U),$();ee.remove()};ie===2?MathJax.Hub.Queue(function(){return H=a.extendDeepAll({},MathJax.Hub.config),Q=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:h},displayAlign:"left"})},function(){if((ne=MathJax.Hub.config.menuSettings.renderer)!=="SVG")return MathJax.Hub.setRenderer("SVG")},ae,ue,function(){if(ne!=="SVG")return MathJax.Hub.setRenderer(ne)},function(){return Q!==void 0&&(MathJax.Hub.processSectionDelay=Q),MathJax.Hub.Config(H)}):ie===3&&(H=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=h,(ne=MathJax.config.startup.output)!=="svg"&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){ae(),ue(),ne!=="svg"&&(MathJax.config.startup.output=ne),MathJax.config=H}))})(G[2],re,function(U,q,$){W.selectAll("svg."+K).remove(),W.selectAll("g."+K+"-group").remove();var ne=U&&U.select("svg");if(!ne||!ne.node())return te(),void Y();var H=W.append("g").classed(K+"-group",!0).attr({"pointer-events":"none","data-unformatted":B,"data-math":"Y"});H.node().appendChild(ne.node()),q&&q.node()&&ne.node().insertBefore(q.node().cloneNode(!0),ne.node().firstChild);var Q=$.width,ee=$.height;ne.attr({class:K,height:ee,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var ie=L.node().style.fill||"black",ae=ne.select("g");ae.attr({fill:ie,stroke:ie});var ue=ae.node().getBoundingClientRect(),le=ue.width,ge=ue.height;(le>Q||ge>ee)&&(ne.style("overflow","hidden"),le=(ue=ne.node().getBoundingClientRect()).width,ge=ue.height);var fe=+L.attr("x"),me=+L.attr("y"),_e=-(Z||L.node().getBoundingClientRect().height)/4;if(K[0]==="y")H.attr({transform:"rotate("+[-90,fe,me]+")"+u(-le/2,_e-ge/2)});else if(K[0]==="l")me=_e-ge/2;else if(K[0]==="a"&&K.indexOf("atitle")!==0)fe=0,me=_e;else{var we=L.attr("text-anchor");fe-=le*(we==="middle"?.5:we==="end"?1:0),me=me+_e-ge/2}ne.attr({x:fe,y:me}),N&&N.call(L,H),Y(H)})})):te(),L}function te(){W.empty()||(K=L.attr("class")+"-math",W.select("svg."+K).remove()),L.text("").style("white-space","pre"),function(Y,Z){Z=Z.replace(y," ");var re,U=!1,q=[],$=-1;function ne(){$++;var de=document.createElementNS(c.svg,"tspan");r.select(de).attr({class:"line",dy:$*i+"em"}),Y.appendChild(de),re=de;var ye=q;if(q=[{node:de}],ye.length>1)for(var Me=1;Me doesnt match end tag <"+de+">. Pretending it did match.",Z),re=q[q.length-1].node}else a.log("Ignoring unexpected end tag .",Z)}k.test(Z)?ne():(re=Y,q=[{node:Y}]);for(var ie=Z.split(x),ae=0;ae|>|>)/g,h=[["$","$"],["\\(","\\)"]],m={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"},g={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},v=["http:","https:","mailto:","",void 0,":"],y=f.NEWLINES=/(\r\n?|\n)/g,x=/(<[^<>]*>)/,w=/<(\/?)([^ >]*)(\s+(.*))?>/i,k=//i;f.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,T=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function A(L,P){if(!L)return null;var N=L.match(P),B=N&&(N[3]||N[4]);return B&&O(B)}var S=/(^|;)\s*color:/;f.plainText=function(L,P){for(var N=(P=P||{}).len!==void 0&&P.len!==-1?P.len:1/0,B=P.allowedTags!==void 0?P.allowedTags:["br"],G=3,W=L.split(x),K=[],te="",Y=0,Z=0;ZG?K.push(re.substr(0,ne-G)+"..."):K.push(re.substr(0,ne));break}te=""}}return K.join("")};var E={mu:"\u03BC",amp:"&",lt:"<",gt:">",nbsp:"\xA0",times:"\xD7",plusmn:"\xB1",deg:"\xB0"},D=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function O(L){return L.replace(D,function(P,N){return(N.charAt(0)==="#"?function(B){if(!(B>1114111)){var G=String.fromCodePoint;if(G)return G(B);var W=String.fromCharCode;return B<=65535?W(B):W(55232+(B>>10),B%1024+56320)}}(N.charAt(1)==="x"?parseInt(N.substr(2),16):parseInt(N.substr(1),10)):E[N])||P})}function R(L){var P=encodeURI(decodeURI(L)),N=document.createElement("a"),B=document.createElement("a");N.href=L,B.href=P;var G=N.protocol,W=B.protocol;return v.indexOf(G)!==-1&&v.indexOf(W)!==-1?P:""}function z(L,P,N){var B,G,W,K=N.horizontalAlign,te=N.verticalAlign||"top",Y=L.node().getBoundingClientRect(),Z=P.node().getBoundingClientRect();return G=te==="bottom"?function(){return Y.bottom-B.height}:te==="middle"?function(){return Y.top+(Y.height-B.height)/2}:function(){return Y.top},W=K==="right"?function(){return Y.right-B.width}:K==="center"?function(){return Y.left+(Y.width-B.width)/2}:function(){return Y.left},function(){B=this.node().getBoundingClientRect();var re=W()-Z.left,U=G()-Z.top,q=N.gd||{};if(N.gd){q._fullLayout._calcInverseTransform(q);var $=a.apply3DTransform(q._fullLayout._invTransform)(re,U);re=$[0],U=$[1]}return this.style({top:U+"px",left:re+"px","z-index":1e3}),this}}f.convertEntities=O,f.sanitizeHTML=function(L){L=L.replace(y," ");for(var P=document.createElement("p"),N=P,B=[],G=L.split(x),W=0;Ws.ts+c?h():s.timer=setTimeout(function(){h(),s.timer=null},c)},f.done=function(u){var c=r[u];return c&&c.timer?new Promise(function(i){var s=c.onDone;c.onDone=function(){s&&s(),i(),c.onDone=null}}):Promise.resolve()},f.clear=function(u){if(u)a(r[u]),delete r[u];else for(var c in r)f.clear(c)}},{}],531:[function(e,o,f){var r=e("fast-isnumeric");o.exports=function(a,u){if(a>0)return Math.log(a)/Math.LN10;var c=Math.log(Math.min(u[0],u[1]))/Math.LN10;return r(c)||(c=Math.log(Math.max(u[0],u[1]))/Math.LN10-6),c}},{"fast-isnumeric":190}],532:[function(e,o,f){var r=o.exports={},a=e("../plots/geo/constants").locationmodeToLayer,u=e("topojson-client").feature;r.getTopojsonName=function(c){return[c.scope.replace(/ /g,"-"),"_",c.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(c,i){return c+i+".json"},r.getTopojsonFeatures=function(c,i){var s=a[c.locationmode],l=i.objects[s];return u(i,l).features}},{"../plots/geo/constants":587,"topojson-client":315}],533:[function(e,o,f){o.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],534:[function(e,o,f){o.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"}}},{}],535:[function(e,o,f){var r=e("../registry");o.exports=function(a){for(var u,c,i=r.layoutArrayContainers,s=r.layoutArrayRegexes,l=a.split("[")[0],d=0;d0&&c.log("Clearing previous rejected promises from queue."),_._promises=[]},f.cleanLayout=function(_){var M,A;_||(_={}),_.xaxis1&&(_.xaxis||(_.xaxis=_.xaxis1),delete _.xaxis1),_.yaxis1&&(_.yaxis||(_.yaxis=_.yaxis1),delete _.yaxis1),_.scene1&&(_.scene||(_.scene=_.scene1),delete _.scene1);var S=(i.subplotsRegistry.cartesian||{}).attrRegex,E=(i.subplotsRegistry.polar||{}).attrRegex,D=(i.subplotsRegistry.ternary||{}).attrRegex,O=(i.subplotsRegistry.gl3d||{}).attrRegex,R=Object.keys(_);for(M=0;M3?(H.x=1.02,H.xanchor="left"):H.x<-2&&(H.x=-.02,H.xanchor="right"),H.y>3?(H.y=1.02,H.yanchor="bottom"):H.y<-2&&(H.y=-.02,H.yanchor="top")),p(_),_.dragmode==="rotate"&&(_.dragmode="orbit"),l.clean(_),_.template&&_.template.layout&&f.cleanLayout(_.template.layout),_},f.cleanData=function(_){for(var M=0;M<_.length;M++){var A,S=_[M];if(S.type==="histogramy"&&"xbins"in S&&!("ybins"in S)&&(S.ybins=S.xbins,delete S.xbins),S.error_y&&"opacity"in S.error_y){var E=l.defaults,D=S.error_y.color||(m(S,"bar")?l.defaultLine:E[M%E.length]);S.error_y.color=l.addOpacity(l.rgb(D),l.opacity(D)*S.error_y.opacity),delete S.error_y.opacity}if("bardir"in S&&(S.bardir!=="h"||!m(S,"bar")&&S.type.substr(0,9)!=="histogram"||(S.orientation="h",f.swapXYData(S)),delete S.bardir),S.type==="histogramy"&&f.swapXYData(S),S.type!=="histogramx"&&S.type!=="histogramy"||(S.type="histogram"),"scl"in S&&!("colorscale"in S)&&(S.colorscale=S.scl,delete S.scl),"reversescl"in S&&!("reversescale"in S)&&(S.reversescale=S.reversescl,delete S.reversescl),S.xaxis&&(S.xaxis=d(S.xaxis,"x")),S.yaxis&&(S.yaxis=d(S.yaxis,"y")),m(S,"gl3d")&&S.scene&&(S.scene=i.subplotsRegistry.gl3d.cleanId(S.scene)),!m(S,"pie-like")&&!m(S,"bar-like"))if(Array.isArray(S.textposition))for(A=0;A0)return _.substr(0,M)}f.hasParent=function(_,M){for(var A=b(M);A;){if(A in _)return!0;A=b(A)}return!1};var T=["x","y","z"];f.clearAxisTypes=function(_,M,A){for(var S=0;S1&&u.warn("Full array edits are incompatible with other edits",v);var _=m[""][""];if(l(_))h.set(null);else{if(!Array.isArray(_))return u.warn("Unrecognized full array edit value",v,_),!0;h.set(_)}return!k&&(y(b,T),x(d),!0)}var M,A,S,E,D,O,R,z,L=Object.keys(m).map(Number).sort(c),P=h.get(),N=P||[],B=p(T,v).get(),G=[],W=-1,K=N.length;for(M=0;MN.length-(R?0:1))u.warn("index out of range",v,S);else if(O!==void 0)D.length>1&&u.warn("Insertion & removal are incompatible with edits to the same index.",v,S),l(O)?G.push(S):R?(O==="add"&&(O={}),N.splice(S,0,O),B&&B.splice(S,0,{})):u.warn("Unrecognized full object edit value",v,S,O),W===-1&&(W=S);else for(A=0;A=0;M--)N.splice(G[M],1),B&&B.splice(G[M],1);if(N.length?P||h.set(N):h.set(null),k)return!1;if(y(b,T),w!==a){var te;if(W===-1)te=L;else{for(K=Math.max(N.length,K),te=[],M=0;M=W);M++)te.push(S);for(M=W;M=de.data.length||Ee<-de.data.length)throw new Error(Me+" must be valid indices for gd.data.");if(ye.indexOf(Ee,ke+1)>-1||Ee>=0&&ye.indexOf(-de.data.length+Ee)>-1||Ee<0&&ye.indexOf(de.data.length+Ee)>-1)throw new Error("each index in "+Me+" must be unique.")}}function P(de,ye,Me){if(!Array.isArray(de.data))throw new Error("gd.data must be an array.");if(ye===void 0)throw new Error("currentIndices is a required argument.");if(Array.isArray(ye)||(ye=[ye]),L(de,ye,"currentIndices"),Me===void 0||Array.isArray(Me)||(Me=[Me]),Me!==void 0&&L(de,Me,"newIndices"),Me!==void 0&&ye.length!==Me.length)throw new Error("current and new indices must be of equal length.")}function N(de,ye,Me,ke,Ee){(function(Ye,nt,ft,vt){var Pt=c.isPlainObject(vt);if(!Array.isArray(Ye.data))throw new Error("gd.data must be an array");if(!c.isPlainObject(nt))throw new Error("update must be a key:value object");if(ft===void 0)throw new Error("indices must be an integer or array of integers");for(var At in L(Ye,ft,"indices"),nt){if(!Array.isArray(nt[At])||nt[At].length!==ft.length)throw new Error("attribute "+At+" must be an array of length equal to indices array length");if(Pt&&(!(At in vt)||!Array.isArray(vt[At])||vt[At].length!==nt[At].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")}})(de,ye,Me,ke);for(var ze=function(Ye,nt,ft,vt){var Pt,At,at,et,Ot,Wt=c.isPlainObject(vt),Jt=[];for(var Be in Array.isArray(ft)||(ft=[ft]),ft=z(ft,Ye.data.length-1),nt)for(var Ge=0;Ge-1&&Me.indexOf("grouptitlefont")===-1?Ve(Me,Me.replace("titlefont","title.font")):Me.indexOf("titleposition")>-1?Ve(Me,Me.replace("titleposition","title.position")):Me.indexOf("titleside")>-1?Ve(Me,Me.replace("titleside","title.side")):Me.indexOf("titleoffset")>-1&&Ve(Me,Me.replace("titleoffset","title.offset")):Ve(Me,Me.replace("title","title.text"));function Ve(Ke,Re){de[Re]=de[Ke],delete de[Ke]}}function re(de,ye,Me){de=c.getGraphDiv(de),T.clearPromiseQueue(de);var ke={};if(typeof ye=="string")ke[ye]=Me;else{if(!c.isPlainObject(ye))return c.warn("Relayout fail.",ye,Me),Promise.reject();ke=c.extendFlat({},ye)}Object.keys(ke).length&&(de.changed=!0);var Ee=Q(de,ke),ze=Ee.flags;ze.calc&&(de.calcdata=void 0);var Fe=[m.previousPromises];ze.layoutReplot?Fe.push(_.layoutReplot):Object.keys(ke).length&&(U(de,ze,Ee)||m.supplyDefaults(de),ze.legend&&Fe.push(_.doLegend),ze.layoutstyle&&Fe.push(_.layoutStyles),ze.axrange&&q(Fe,Ee.rangesAltered),ze.ticks&&Fe.push(_.doTicksRelayout),ze.modebar&&Fe.push(_.doModeBar),ze.camera&&Fe.push(_.doCamera),ze.colorbars&&Fe.push(_.doColorBars),Fe.push(E)),Fe.push(m.rehover,m.redrag),l.add(de,re,[de,Ee.undoit],re,[de,Ee.redoit]);var Ve=c.syncOrAsync(Fe,de);return Ve&&Ve.then||(Ve=Promise.resolve(de)),Ve.then(function(){return de.emit("plotly_relayout",Ee.eventData),de})}function U(de,ye,Me){var ke=de._fullLayout;if(!ye.axrange)return!1;for(var Ee in ye)if(Ee!=="axrange"&&ye[Ee])return!1;for(var ze in Me.rangesAltered){var Fe=g.id2name(ze),Ve=de.layout[Fe],Ke=ke[Fe];if(Ke.autorange=Ve.autorange,Ve.range&&(Ke.range=Ve.range.slice()),Ke.cleanRange(),Ke._matchGroup){for(var Re in Ke._matchGroup)if(Re!==ze){var qe=ke[g.id2name(Re)];qe.autorange=Ke.autorange,qe.range=Ke.range.slice(),qe._input.range=Ke.range.slice()}}}return!0}function q(de,ye){var Me=ye?function(ke){var Ee=[],ze=!0;for(var Fe in ye){var Ve=g.getFromId(ke,Fe);if(Ee.push(Fe),(Ve.ticklabelposition||"").indexOf("inside")!==-1&&Ve._anchorAxis&&Ee.push(Ve._anchorAxis._id),Ve._matchGroup)for(var Ke in Ve._matchGroup)ye[Ke]||Ee.push(Ke);Ve.automargin&&(ze=!1)}return g.draw(ke,Ee,{skipTitle:ze})}:function(ke){return g.draw(ke,"redraw")};de.push(w,_.doAutoRangeAndConstraints,Me,_.drawData,_.finalDraw)}var $=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,ne=/^[xyz]axis[0-9]*\.autorange$/,H=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Q(de,ye){var Me,ke,Ee,ze=de.layout,Fe=de._fullLayout,Ve=Fe._guiEditing,Ke=K(Fe._preGUI,Ve),Re=Object.keys(ye),qe=g.list(de),We=c.extendDeepAll({},ye),Ye={};for(Z(ye),Re=Object.keys(ye),ke=0;ke0&&typeof Ge.parts[dt]!="string";)dt--;var Pe=Ge.parts[dt],Ie=Ge.parts[dt-1]+"."+Pe,Ae=Ge.parts.slice(0,dt).join("."),De=i(de.layout,Ae).get(),He=i(Fe,Ae).get(),rt=Ge.get();if(Tt!==void 0){At[Be]=Tt,at[Be]=Pe==="reverse"?Tt:W(rt);var lt=h.getLayoutValObject(Fe,Ge.parts);if(lt&<.impliedEdits&&Tt!==null)for(var ot in lt.impliedEdits)et(c.relativeAttr(Be,ot),lt.impliedEdits[ot]);if(["width","height"].indexOf(Be)!==-1)if(Tt){et("autosize",null);var kt=Be==="height"?"width":"height";et(kt,Fe[kt])}else Fe[Be]=de._initialAutoSize[Be];else if(Be==="autosize")et("width",Tt?null:Fe.width),et("height",Tt?null:Fe.height);else if(Ie.match($))Jt(Ie),i(Fe,Ae+"._inputRange").set(null);else if(Ie.match(ne)){Jt(Ie),i(Fe,Ae+"._inputRange").set(null);var wt=i(Fe,Ae).get();wt._inputDomain&&(wt._input.domain=wt._inputDomain.slice())}else Ie.match(H)&&i(Fe,Ae+"._inputDomain").set(null);if(Pe==="type"){Ot=De;var Vt=He.type==="linear"&&Tt==="log",Ut=He.type==="log"&&Tt==="linear";if(Vt||Ut){if(Ot&&Ot.range)if(He.autorange)Vt&&(Ot.range=Ot.range[1]>Ot.range[0]?[1,2]:[2,1]);else{var tt=Ot.range[0],bt=Ot.range[1];Vt?(tt<=0&&bt<=0&&et(Ae+".autorange",!0),tt<=0?tt=bt/1e6:bt<=0&&(bt=tt/1e6),et(Ae+".range[0]",Math.log(tt)/Math.LN10),et(Ae+".range[1]",Math.log(bt)/Math.LN10)):(et(Ae+".range[0]",Math.pow(10,tt)),et(Ae+".range[1]",Math.pow(10,bt)))}else et(Ae+".autorange",!0);Array.isArray(Fe._subplots.polar)&&Fe._subplots.polar.length&&Fe[Ge.parts[0]]&&Ge.parts[1]==="radialaxis"&&delete Fe[Ge.parts[0]]._subplot.viewInitial["radialaxis.range"],d.getComponentMethod("annotations","convertCoords")(de,He,Tt,et),d.getComponentMethod("images","convertCoords")(de,He,Tt,et)}else et(Ae+".autorange",!0),et(Ae+".range",null);i(Fe,Ae+"._inputRange").set(null)}else if(Pe.match(A)){var zt=i(Fe,Be).get(),St=(Tt||{}).type;St&&St!=="-"||(St="linear"),d.getComponentMethod("annotations","convertCoords")(de,zt,St,et),d.getComponentMethod("images","convertCoords")(de,zt,St,et)}var Dt=b.containerArrayMatch(Be);if(Dt){Me=Dt.array,ke=Dt.index;var Le=Dt.property,Je=lt||{editType:"calc"};ke!==""&&Le===""&&(b.isAddVal(Tt)?at[Be]=null:b.isRemoveVal(Tt)?at[Be]=(i(ze,Me).get()||[])[ke]:c.warn("unrecognized full object value",ye)),M.update(Pt,Je),Ye[Me]||(Ye[Me]={});var st=Ye[Me][ke];st||(st=Ye[Me][ke]={}),st[Le]=Tt,delete ye[Be]}else Pe==="reverse"?(De.range?De.range.reverse():(et(Ae+".autorange",!0),De.range=[1,0]),He.autorange?Pt.calc=!0:Pt.plot=!0):(Fe._has("scatter-like")&&Fe._has("regl")&&Be==="dragmode"&&(Tt==="lasso"||Tt==="select")&&rt!=="lasso"&&rt!=="select"||Fe._has("gl2d")?Pt.plot=!0:lt?M.update(Pt,lt):Pt.calc=!0,Ge.set(Tt))}}for(Me in Ye)b.applyContainerArrayChanges(de,Ke(ze,Me),Ye[Me],Pt,Ke)||(Pt.plot=!0);for(var Et in Wt){var It=(Ot=g.getFromId(de,Et))&&Ot._constraintGroup;if(It)for(var Zt in Pt.calc=!0,It)Wt[Zt]||(g.getFromId(de,Zt)._constraintShrinkable=!0)}return(ee(de)||ye.height||ye.width)&&(Pt.plot=!0),(Pt.plot||Pt.calc)&&(Pt.layoutReplot=!0),{flags:Pt,rangesAltered:Wt,undoit:at,redoit:At,eventData:We}}function ee(de){var ye=de._fullLayout,Me=ye.width,ke=ye.height;return de.layout.autosize&&m.plotAutoSize(de,de.layout,ye),ye.width!==Me||ye.height!==ke}function ie(de,ye,Me,ke){de=c.getGraphDiv(de),T.clearPromiseQueue(de),c.isPlainObject(ye)||(ye={}),c.isPlainObject(Me)||(Me={}),Object.keys(ye).length&&(de.changed=!0),Object.keys(Me).length&&(de.changed=!0);var Ee=T.coerceTraceIndices(de,ke),ze=Y(de,c.extendFlat({},ye),Ee),Fe=ze.flags,Ve=Q(de,c.extendFlat({},Me)),Ke=Ve.flags;(Fe.calc||Ke.calc)&&(de.calcdata=void 0),Fe.clearAxisTypes&&T.clearAxisTypes(de,Ee,Me);var Re=[];Ke.layoutReplot?Re.push(_.layoutReplot):Fe.fullReplot?Re.push(f._doPlot):(Re.push(m.previousPromises),U(de,Ke,Ve)||m.supplyDefaults(de),Fe.style&&Re.push(_.doTraceStyle),(Fe.colorbars||Ke.colorbars)&&Re.push(_.doColorBars),Ke.legend&&Re.push(_.doLegend),Ke.layoutstyle&&Re.push(_.layoutStyles),Ke.axrange&&q(Re,Ve.rangesAltered),Ke.ticks&&Re.push(_.doTicksRelayout),Ke.modebar&&Re.push(_.doModeBar),Ke.camera&&Re.push(_.doCamera),Re.push(E)),Re.push(m.rehover,m.redrag),l.add(de,ie,[de,ze.undoit,Ve.undoit,ze.traces],ie,[de,ze.redoit,Ve.redoit,ze.traces]);var qe=c.syncOrAsync(Re,de);return qe&&qe.then||(qe=Promise.resolve(de)),qe.then(function(){return de.emit("plotly_update",{data:ze.eventData,layout:Ve.eventData}),de})}function ae(de){return function(ye){ye._fullLayout._guiEditing=!0;var Me=de.apply(null,arguments);return ye._fullLayout._guiEditing=!1,Me}}var ue=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],le=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function ge(de,ye){for(var Me=0;Me1;)if(ke.pop(),(Me=i(ye,ke.join(".")+".uirevision").get())!==void 0)return Me;return ye.uirevision}function me(de,ye){for(var Me=0;Me=Ee.length?Ee[0]:Ee[Re]:Ee}function Ve(Re){return Array.isArray(ze)?Re>=ze.length?ze[0]:ze[Re]:ze}function Ke(Re,qe){var We=0;return function(){if(Re&&++We===qe)return Re()}}return ke._frameWaitingCnt===void 0&&(ke._frameWaitingCnt=0),new Promise(function(Re,qe){function We(){ke._currentFrame&&ke._currentFrame.onComplete&&ke._currentFrame.onComplete();var Ge=ke._currentFrame=ke._frameQueue.shift();if(Ge){var Tt=Ge.name?Ge.name.toString():null;de._fullLayout._currentFrame=Tt,ke._lastFrameAt=Date.now(),ke._timeToNext=Ge.frameOpts.duration,m.transition(de,Ge.frame.data,Ge.frame.layout,T.coerceTraceIndices(de,Ge.frame.traces),Ge.frameOpts,Ge.transitionOpts).then(function(){Ge.onComplete&&Ge.onComplete()}),de.emit("plotly_animatingframe",{name:Tt,frame:Ge.frame,animation:{frame:Ge.frameOpts,transition:Ge.transitionOpts}})}else de.emit("plotly_animated"),window.cancelAnimationFrame(ke._animationRaf),ke._animationRaf=null}function Ye(){de.emit("plotly_animating"),ke._lastFrameAt=-1/0,ke._timeToNext=0,ke._runningTransitions=0,ke._currentFrame=null;var Ge=function(){ke._animationRaf=window.requestAnimationFrame(Ge),Date.now()-ke._lastFrameAt>ke._timeToNext&&We()};Ge()}var nt,ft,vt=0;function Pt(Ge){return Array.isArray(Ee)?vt>=Ee.length?Ge.transitionOpts=Ee[vt]:Ge.transitionOpts=Ee[0]:Ge.transitionOpts=Ee,vt++,Ge}var At=[],at=ye==null,et=Array.isArray(ye);if(!at&&!et&&c.isPlainObject(ye))At.push({type:"object",data:Pt(c.extendFlat({},ye))});else if(at||["string","number"].indexOf(typeof ye)!==-1)for(nt=0;nt0&&JtJt)&&Be.push(ft);At=Be}}At.length>0?function(Ge){if(Ge.length!==0){for(var Tt=0;Tt=0;ke--)if(c.isPlainObject(ye[ke])){var Ye=ye[ke].name,nt=(Ke[Ye]||We[Ye]||{}).name,ft=ye[ke].name,vt=Ke[nt]||We[nt];nt&&ft&&typeof ft=="number"&&vt&&S<5&&(S++,c.warn('addFrames: overwriting frame "'+(Ke[nt]||We[nt]).name+'" with a frame whose name of type "number" also equates to "'+nt+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),S===5&&c.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.")),We[Ye]={name:Ye},qe.push({frame:m.supplyFrameDefaults(ye[ke]),index:Me&&Me[ke]!==void 0&&Me[ke]!==null?Me[ke]:Re+ke})}qe.sort(function(Be,Ge){return Be.index>Ge.index?-1:Be.index=0;ke--){if(typeof(Ee=qe[ke].frame).name=="number"&&c.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Ee.name)for(;Ke[Ee.name="frame "+de._transitionData._counter++];);if(Ke[Ee.name]){for(ze=0;ze=0;Me--)ke=ye[Me],ze.push({type:"delete",index:ke}),Fe.unshift({type:"insert",index:ke,value:Ee[ke]});var Ve=m.modifyFrames,Ke=m.modifyFrames,Re=[de,Fe],qe=[de,ze];return l&&l.add(de,Ve,Re,Ke,qe),m.modifyFrames(de,ze)},f.addTraces=function de(ye,Me,ke){ye=c.getGraphDiv(ye);var Ee,ze,Fe=[],Ve=f.deleteTraces,Ke=de,Re=[ye,Fe],qe=[ye,Me];for(function(We,Ye,nt){var ft,vt;if(!Array.isArray(We.data))throw new Error("gd.data must be an array.");if(Ye===void 0)throw new Error("traces must be defined.");for(Array.isArray(Ye)||(Ye=[Ye]),ft=0;ft=0&&We=0&&We=R.length)return!1;if(A.dimensions===2){if(E++,S.length===E)return A;var z=S[E];if(!w(z))return!1;A=R[O][z]}else A=R[O]}else A=R}}return A}function w(A){return A===Math.round(A)&&A>=0}function k(){var A,S,E={};for(A in h(E,c),r.subplotsRegistry)if((S=r.subplotsRegistry[A]).layoutAttributes)if(Array.isArray(S.attr))for(var D=0;D=z.length)return!1;D=(E=(r.transformsRegistry[z[L].type]||{}).attributes)&&E[S[2]],R=3}else{var P=A._module;if(P||(P=(r.modules[A.type||u.type.dflt]||{})._module),!P)return!1;if(!(D=(E=P.attributes)&&E[O])){var N=P.basePlotModule;N&&N.attributes&&(D=N.attributes[O])}D||(D=u[O])}return x(D,S,R)},f.getLayoutValObject=function(A,S){return x(function(E,D){var O,R,z,L,P=E._basePlotModules;if(P){var N;for(O=0;O=h&&(d._input||{})._templateitemname;g&&(m=h);var p,v=l+"["+m+"]";function y(){p={},g&&(p[v]={},p[v].templateitemname=g)}function x(k,b){g?r.nestedProperty(p[v],k).set(b):p[v+"."+k]=b}function w(){var k=p;return y(),k}return y(),{modifyBase:function(k,b){p[k]=b},modifyItem:x,getUpdateObj:w,applyUpdate:function(k,b){k&&x(k,b);var T=w();for(var _ in T)r.nestedProperty(s,_).set(T[_])}}}},{"../lib":503,"../plots/attributes":550}],544:[function(e,o,f){var r=e("@plotly/d3"),a=e("../registry"),u=e("../plots/plots"),c=e("../lib"),i=e("../lib/clear_gl_canvases"),s=e("../components/color"),l=e("../components/drawing"),d=e("../components/titles"),h=e("../components/modebar"),m=e("../plots/cartesian/axes"),g=e("../constants/alignment"),p=e("../plots/cartesian/constraints"),v=p.enforce,y=p.clean,x=e("../plots/cartesian/autorange").doAutoRange;function w(S,E,D){for(var O=0;O=S[1]||R[1]<=S[0])&&z[0]E[0])return!0}return!1}function k(S){var E,D,O,R,z,L,P=S._fullLayout,N=P._size,B=N.p,G=m.list(S,"",!0);if(P._paperdiv.style({width:S._context.responsive&&P.autosize&&!S._context._hasZeroWidth&&!S.layout.width?"100%":P.width+"px",height:S._context.responsive&&P.autosize&&!S._context._hasZeroHeight&&!S.layout.height?"100%":P.height+"px"}).selectAll(".main-svg").call(l.setSize,P.width,P.height),S._context.setBackground(S,P.paper_bgcolor),f.drawMainTitle(S),h.manage(S),!P._has("cartesian"))return u.previousPromises(S);function W(Ye,nt,ft){var vt=Ye._lw/2;return Ye._id.charAt(0)==="x"?nt?ft==="top"?nt._offset-B-vt:nt._offset+nt._length+B+vt:N.t+N.h*(1-(Ye.position||0))+vt%1:nt?ft==="right"?nt._offset+nt._length+B+vt:nt._offset-B-vt:N.l+N.w*(Ye.position||0)+vt%1}for(E=0;EN?A.push({code:"unused",traceType:O,templateCount:P,dataCount:N}):N>P&&A.push({code:"reused",traceType:O,templateCount:P,dataCount:N})}}else A.push({code:"data"});if(function B(G,W){for(var K in G)if(K.charAt(0)!=="_"){var te=G[K],Y=v(G,K,W);a(te)?(Array.isArray(G)&&te._template===!1&&te.templateitemname&&A.push({code:"missing",path:Y,templateitemname:te.templateitemname}),B(te,Y)):Array.isArray(te)&&y(te)&&B(te,Y)}}({data:E,layout:S},""),A.length)return A.map(x)}},{"../lib":503,"../plots/attributes":550,"../plots/plots":619,"./plot_config":541,"./plot_schema":542,"./plot_template":543}],546:[function(e,o,f){var r=e("fast-isnumeric"),a=e("./plot_api"),u=e("../plots/plots"),c=e("../lib"),i=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),l=e("../snapshot/svgtoimg"),d=e("../version").version,h={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}};o.exports=function(m,g){var p,v,y,x;function w(N){return!(N in g)||c.validate(g[N],h[N])}if(g=g||{},c.isPlainObject(m)?(p=m.data||[],v=m.layout||{},y=m.config||{},x={}):(m=c.getGraphDiv(m),p=c.extendDeep([],m.data),v=c.extendDeep({},m.layout),y=m._context,x=m._fullLayout||{}),!w("width")&&g.width!==null||!w("height")&&g.height!==null)throw new Error("Height and width should be pixel values.");if(!w("format"))throw new Error("Export format is not "+c.join2(h.format.values,", "," or ")+".");var k={};function b(N,B){return c.coerce(g,k,h,N,B)}var T=b("format"),_=b("width"),M=b("height"),A=b("scale"),S=b("setBackground"),E=b("imageDataOnly"),D=document.createElement("div");D.style.position="absolute",D.style.left="-5000px",document.body.appendChild(D);var O=c.extendFlat({},v);_?O.width=_:g.width===null&&r(x.width)&&(O.width=x.width),M?O.height=M:g.height===null&&r(x.height)&&(O.height=x.height);var R=c.extendFlat({},y,{_exportedPlot:!0,staticPlot:!0,setBackground:S}),z=i.getRedrawFunc(D);function L(){return new Promise(function(N){setTimeout(N,i.getDelay(D._fullLayout))})}function P(){return new Promise(function(N,B){var G=s(D,T,A),W=D._fullLayout.width,K=D._fullLayout.height;function te(){a.purge(D),document.body.removeChild(D)}if(T==="full-json"){var Y=u.graphJson(D,!1,"keepdata","object",!0,!0);return Y.version=d,Y=JSON.stringify(Y),te(),N(E?Y:i.encodeJSON(Y))}if(te(),T==="svg")return N(E?G:i.encodeSVG(G));var Z=document.createElement("canvas");Z.id=c.randstr(),l({format:T,width:W,height:K,scale:A,canvas:Z,svg:G,promise:!0}).then(N).catch(B)})}return new Promise(function(N,B){a.newPlot(D,p,O,R).then(z).then(L).then(P).then(function(G){N(function(W){return E?W.replace(i.IMAGE_URL_PREFIX,""):W}(G))}).catch(function(G){B(G)})})}},{"../lib":503,"../plots/plots":619,"../snapshot/helpers":642,"../snapshot/svgtoimg":644,"../snapshot/tosvg":646,"../version":1123,"./plot_api":540,"fast-isnumeric":190}],547:[function(e,o,f){var r=e("../lib"),a=e("../plots/plots"),u=e("./plot_schema"),c=e("./plot_config").dfltConfig,i=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function d(k,b,T,_,M,A){A=A||[];for(var S=Object.keys(k),E=0;Ez.length&&_.push(p("unused",M,O.concat(z.length)));var W,K,te,Y,Z,re=z.length,U=Array.isArray(G);if(U&&(re=Math.min(re,G.length)),L.dimensions===2)for(K=0;Kz[K].length&&_.push(p("unused",M,O.concat(K,z[K].length)));var q=z[K].length;for(W=0;W<(U?Math.min(q,G[K].length):q);W++)te=U?G[K][W]:G,Y=R[K][W],Z=z[K][W],r.validate(Y,te)?Z!==Y&&Z!==+Y&&_.push(p("dynamic",M,O.concat(K,W),Y,Z)):_.push(p("value",M,O.concat(K,W),Y))}else _.push(p("array",M,O.concat(K),R[K]));else for(K=0;K1&&A.push(p("object","layout"))),a.supplyDefaults(S);for(var E=S._fullData,D=T.length,O=0;O0&&Math.round(v)===v))return{vals:h};g=v}for(var y=l.calendar,x=m==="start",w=m==="end",k=s[d+"period0"],b=u(k,y)||0,T=[],_=[],M=[],A=h.length,S=0;SR;)O=c(O,-g,y);for(;O<=R;)O=c(O,g,y);D=c(O,-g,y)}else{for(O=b+(E=Math.round((R-b)/p))*p;O>R;)O-=p;for(;O<=R;)O+=p;D=O-p}T[S]=x?D:w?O:(D+O)/2,_[S]=D,M[S]=O}return{vals:T,starts:_,ends:M}}},{"../../constants/numerical":479,"../../lib":503,"fast-isnumeric":190}],552:[function(e,o,f){o.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],553:[function(e,o,f){var r=e("@plotly/d3"),a=e("fast-isnumeric"),u=e("../../lib"),c=e("../../constants/numerical").FP_SAFE,i=e("../../registry"),s=e("../../components/drawing"),l=e("./axis_ids"),d=l.getFromId,h=l.isLinked;function m(_,M){var A,S,E=[],D=_._fullLayout,O=p(D,M,0),R=p(D,M,1),z=v(_,M),L=z.min,P=z.max;if(L.length===0||P.length===0)return u.simpleMap(M.range,M.r2l);var N=L[0].val,B=P[0].val;for(A=1;A0&&((re=H-O(K)-R(te))>Q?U/re>ee&&(Y=K,Z=te,ee=U/re):U/H>ee&&(Y={val:K.val,nopad:1},Z={val:te.val,nopad:1},ee=U/H));if(N===B){var ie=N-1,ae=N+1;if($)if(N===0)E=[0,1];else{var ue=(N>0?P:L).reduce(function(ge,fe){return Math.max(ge,R(fe))},0),le=N/(1-Math.min(.5,ue/H));E=N>0?[0,le]:[le,0]}else E=ne?[Math.max(0,ie),Math.max(1,ae)]:[ie,ae]}else $?(Y.val>=0&&(Y={val:0,nopad:1}),Z.val<=0&&(Z={val:0,nopad:1})):ne&&(Y.val-ee*O(Y)<0&&(Y={val:0,nopad:1}),Z.val<=0&&(Z={val:1,nopad:1})),ee=(Z.val-Y.val-g(M,K.val,te.val))/(H-O(Y)-R(Z)),E=[Y.val-ee*O(Y),Z.val+ee*R(Z)];return G&&E.reverse(),u.simpleMap(E,M.l2r||Number)}function g(_,M,A){var S=0;if(_.rangebreaks)for(var E=_.locateBreaks(M,A),D=0;D0?A.ppadplus:A.ppadminus)||A.ppad||0),$=U((_._m>0?A.ppadminus:A.ppadplus)||A.ppad||0),ne=U(A.vpadplus||A.vpad),H=U(A.vpadminus||A.vpad);if(!Z){if(P=1/0,N=-1/0,Y)for(S=0;S0&&(P=E),E>N&&E-c&&(P=E),E>N&&E=ie;S--)ee(S);return{min:B,max:G,opts:A}},concatExtremes:v};function v(_,M,A){var S,E,D,O=M._id,R=_._fullData,z=_._fullLayout,L=[],P=[];function N(te,Y){for(S=0;S=A&&(L.extrapad||!O)){R=!1;break}E(M,L.val)&&L.pad<=A&&(O||!L.extrapad)&&(_.splice(z,1),z--)}if(R){var P=D&&M===0;_.push({val:M,pad:P?0:A,extrapad:!P&&O})}}function k(_){return a(_)&&Math.abs(_)=M}},{"../../components/drawing":388,"../../constants/numerical":479,"../../lib":503,"../../registry":638,"./axis_ids":558,"@plotly/d3":58,"fast-isnumeric":190}],554:[function(e,o,f){var r=e("@plotly/d3"),a=e("fast-isnumeric"),u=e("../../plots/plots"),c=e("../../registry"),i=e("../../lib"),s=i.strTranslate,l=e("../../lib/svg_text_utils"),d=e("../../components/titles"),h=e("../../components/color"),m=e("../../components/drawing"),g=e("./layout_attributes"),p=e("./clean_ticks"),v=e("../../constants/numerical"),y=v.ONEMAXYEAR,x=v.ONEAVGYEAR,w=v.ONEMINYEAR,k=v.ONEMAXQUARTER,b=v.ONEAVGQUARTER,T=v.ONEMINQUARTER,_=v.ONEMAXMONTH,M=v.ONEAVGMONTH,A=v.ONEMINMONTH,S=v.ONEWEEK,E=v.ONEDAY,D=E/2,O=v.ONEHOUR,R=v.ONEMIN,z=v.ONESEC,L=v.MINUS_SIGN,P=v.BADNUM,N={K:"zeroline"},B={K:"gridline",L:"path"},G={K:"tick",L:"path"},W={K:"tick",L:"text"},K=e("../../constants/alignment"),te=K.MID_SHIFT,Y=K.CAP_SHIFT,Z=K.LINE_SPACING,re=K.OPPOSITE_SIDE,U=o.exports={};U.setConvert=e("./set_convert");var q=e("./axis_autotype"),$=e("./axis_ids"),ne=$.idSort,H=$.isLinked;U.id2name=$.id2name,U.name2id=$.name2id,U.cleanId=$.cleanId,U.list=$.list,U.listIds=$.listIds,U.getFromId=$.getFromId,U.getFromTrace=$.getFromTrace;var Q=e("./autorange");U.getAutoRange=Q.getAutoRange,U.findExtremes=Q.findExtremes;function ee(Be){var Ge=1e-4*(Be[1]-Be[0]);return[Be[0]-Ge,Be[1]+Ge]}U.coerceRef=function(Be,Ge,Tt,dt,Pe,Ie){var Ae=dt.charAt(dt.length-1),De=Tt._fullLayout._subplots[Ae+"axis"],He=dt+"ref",rt={};return Pe||(Pe=De[0]||(typeof Ie=="string"?Ie:Ie[0])),Ie||(Ie=Pe),De=De.concat(De.map(function(lt){return lt+" domain"})),rt[He]={valType:"enumerated",values:De.concat(Ie?typeof Ie=="string"?[Ie]:Ie:[]),dflt:Pe},i.coerce(Be,Ge,rt,He)},U.getRefType=function(Be){return Be===void 0?Be:Be==="paper"?"paper":Be==="pixel"?"pixel":/( domain)$/.test(Be)?"domain":"range"},U.coercePosition=function(Be,Ge,Tt,dt,Pe,Ie){var Ae,De;if(U.getRefType(dt)!=="range")Ae=i.ensureNumber,De=Tt(Pe,Ie);else{var He=U.getFromId(Ge,dt);De=Tt(Pe,Ie=He.fraction2r(Ie)),Ae=He.cleanPos}Be[Pe]=Ae(De)},U.cleanPosition=function(Be,Ge,Tt){return(Tt==="paper"||Tt==="pixel"?i.ensureNumber:U.getFromId(Ge,Tt).cleanPos)(Be)},U.redrawComponents=function(Be,Ge){Ge=Ge||U.listIds(Be);var Tt=Be._fullLayout;function dt(Pe,Ie,Ae,De){for(var He=c.getComponentMethod(Pe,Ie),rt={},lt=0;lt2e-6||((Tt-Be._forceTick0)/Be._minDtick%1+1.000001)%1>2e-6)&&(Be._minDtick=0)):Be._minDtick=0},U.saveRangeInitial=function(Be,Ge){for(var Tt=U.list(Be,"",!0),dt=!1,Pe=0;Pe.3*Kt||It(St)||It(Dt))){var Ht=zt.dtick/2;tt+=tt+Ht.8){var Je=Number(zt.substr(1));Le.exactYears>.8&&Je%12==0?tt=U.tickIncrement(tt,"M6","reverse")+1.5*E:Le.exactMonths>.8?tt=U.tickIncrement(tt,"M1","reverse")+15.5*E:tt-=D;var st=U.tickIncrement(tt,zt);if(st<=St)return st}return tt}(Ut,Be,Vt,De,Pe)),wt=Ut,0;wt<=He;)wt=U.tickIncrement(wt,Vt,!1,Pe);return{start:Ge.c2r(Ut,0,Pe),end:Ge.c2r(wt,0,Pe),size:Vt,_dataSpan:He-De}},U.prepTicks=function(Be,Ge){var Tt=i.simpleMap(Be.range,Be.r2l,void 0,void 0,Ge);if(Be._dtickInit=Be.dtick,Be._tick0Init=Be.tick0,Be.tickmode==="auto"||!Be.dtick){var dt,Pe=Be.nticks;Pe||(Be.type==="category"||Be.type==="multicategory"?(dt=Be.tickfont?i.bigFont(Be.tickfont.size||12):15,Pe=Be._length/dt):(dt=Be._id.charAt(0)==="y"?40:80,Pe=i.constrain(Be._length/dt,4,9)+1),Be._name==="radialaxis"&&(Pe*=2)),Be.tickmode==="array"&&(Pe*=100),Be._roughDTick=Math.abs(Tt[1]-Tt[0])/Pe,U.autoTicks(Be,Be._roughDTick),Be._minDtick>0&&Be.dtick<2*Be._minDtick&&(Be.dtick=Be._minDtick,Be.tick0=Be.l2r(Be._forceTick0))}Be.ticklabelmode==="period"&&function(Ie){var Ae;function De(){return!(a(Ie.dtick)||Ie.dtick.charAt(0)!=="M")}var He=De(),rt=U.getTickFormat(Ie);if(rt){var lt=Ie._dtickInit!==Ie.dtick;/%[fLQsSMX]/.test(rt)||(/%[HI]/.test(rt)?(Ae=O,lt&&!He&&Ie.dtickHn&&Er=Ie:kt<=Ie;kt=U.tickIncrement(kt,Be.dtick,Ae,Be.calendar)){if(Dt++,Be.rangebreaks&&!Ae){if(kt=He)break}if(tt.length>Ut||kt===bt)break;bt=kt;var Le=!1;lt&&kt!==(0|kt)&&(Le=!0);var Je={minor:Le,value:kt};Vt>1&&Dt%Vt&&(Je.skipLabel=!0),tt.push(Je)}if(ot&&function(nn,sn,gn){for(var bn=0;bn0?(Hn=bn-1,Wn=bn):(Hn=bn,Wn=bn);var ar,Or=nn[Hn].value,vr=nn[Wn].value,Er=Math.abs(vr-Or),Kn=gn||Er,Ln=0;Kn>=w?Ln=Er>=w&&Er<=y?Er:x:gn===b&&Kn>=T?Ln=Er>=T&&Er<=k?Er:b:Kn>=A?Ln=Er>=A&&Er<=_?Er:M:gn===S&&Kn>=S?Ln=S:Kn>=E?Ln=E:gn===D&&Kn>=D?Ln=D:gn===O&&Kn>=O&&(Ln=O),Ln>=Er&&(Ln=Er,ar=!0);var lr=In+Ln;if(sn.rangebreaks&&Ln>0){for(var Wr=0,Mn=0;Mn<84;Mn++){var rr=(Mn+.5)/84;sn.maskBreaks(In*(1-rr)+rr*lr)!==P&&Wr++}(Ln*=Wr/84)||(nn[bn].drop=!0),ar&&Er>S&&(Ln=Er)}(Ln>0||bn===0)&&(nn[bn].periodX=In+Ln/2)}}(tt,Be,Be._definedDelta),Be.rangebreaks){var st=Be._id.charAt(0)==="y",Et=1;Be.tickmode==="auto"&&(Et=Be.tickfont?Be.tickfont.size:12);var It=NaN;for(zt=tt.length-1;zt>-1;zt--)if(tt[zt].drop)tt.splice(zt,1);else{tt[zt].value=Ot(tt[zt].value,Be);var Zt=Be.c2p(tt[zt].value);(st?It>Zt-Et:ItHe||HtHe&&(Kt.periodX=He),Ht10||dt.substr(5)!=="01-01"?Be._tickround="d":Be._tickround=+Ge.substr(1)%12==0?"y":"m";else if(Ge>=E&&Pe<=10||Ge>=15*E)Be._tickround="d";else if(Ge>=R&&Pe<=16||Ge>=O)Be._tickround="M";else if(Ge>=z&&Pe<=19||Ge>=R)Be._tickround="S";else{var Ie=Be.l2r(Tt+Ge).replace(/^-/,"").length;Be._tickround=Math.max(Pe,Ie)-20,Be._tickround<0&&(Be._tickround=4)}}else if(a(Ge)||Ge.charAt(0)==="L"){var Ae=Be.range.map(Be.r2d||Number);a(Ge)||(Ge=Number(Ge.substr(1))),Be._tickround=2-Math.floor(Math.log(Ge)/Math.LN10+.01);var De=Math.max(Math.abs(Ae[0]),Math.abs(Ae[1])),He=Math.floor(Math.log(De)/Math.LN10+.01),rt=Be.minexponent===void 0?3:Be.minexponent;Math.abs(He)>rt&&(Ee(Be.exponentformat)&&!ze(He)?Be._tickexponent=3*Math.round((He-1)/3):Be._tickexponent=He)}else Be._tickround=null}function Me(Be,Ge,Tt){var dt=Be.tickfont||{};return{x:Ge,dx:0,dy:0,text:Tt||"",fontSize:dt.size,font:dt.family,fontColor:dt.color}}U.autoTicks=function(Be,Ge){var Tt;function dt(lt){return Math.pow(lt,Math.floor(Math.log(Ge)/Math.LN10))}if(Be.type==="date"){Be.tick0=i.dateTick0(Be.calendar,0);var Pe=2*Ge;if(Pe>x)Ge/=x,Tt=dt(10),Be.dtick="M"+12*de(Ge,Tt,ge);else if(Pe>M)Ge/=M,Be.dtick="M"+de(Ge,1,fe);else if(Pe>E){Be.dtick=de(Ge,E,Be._hasDayOfWeekBreaks?[1,2,7,14]:_e);var Ie=U.getTickFormat(Be),Ae=Be.ticklabelmode==="period";Ae&&(Be._rawTick0=Be.tick0),/%[uVW]/.test(Ie)?Be.tick0=i.dateTick0(Be.calendar,2):Be.tick0=i.dateTick0(Be.calendar,1),Ae&&(Be._dowTick0=Be.tick0)}else Pe>O?Be.dtick=de(Ge,O,fe):Pe>R?Be.dtick=de(Ge,R,me):Pe>z?Be.dtick=de(Ge,z,me):(Tt=dt(10),Be.dtick=de(Ge,Tt,ge))}else if(Be.type==="log"){Be.tick0=0;var De=i.simpleMap(Be.range,Be.r2l);if(Ge>.7)Be.dtick=Math.ceil(Ge);else if(Math.abs(De[1]-De[0])<1){var He=1.5*Math.abs((De[1]-De[0])/Ge);Ge=Math.abs(Math.pow(10,De[1])-Math.pow(10,De[0]))/He,Tt=dt(10),Be.dtick="L"+de(Ge,Tt,ge)}else Be.dtick=Ge>.3?"D2":"D1"}else Be.type==="category"||Be.type==="multicategory"?(Be.tick0=0,Be.dtick=Math.ceil(Math.max(Ge,1))):et(Be)?(Be.tick0=0,Tt=1,Be.dtick=de(Ge,Tt,Oe)):(Be.tick0=0,Tt=dt(10),Be.dtick=de(Ge,Tt,ge));if(Be.dtick===0&&(Be.dtick=1),!a(Be.dtick)&&typeof Be.dtick!="string"){var rt=Be.dtick;throw Be.dtick=1,"ax.dtick error: "+String(rt)}},U.tickIncrement=function(Be,Ge,Tt,dt){var Pe=Tt?-1:1;if(a(Ge))return i.increment(Be,Pe*Ge);var Ie=Ge.charAt(0),Ae=Pe*Number(Ge.substr(1));if(Ie==="M")return i.incrementMonth(Be,Ae,dt);if(Ie==="L")return Math.log(Math.pow(10,Be)+Ae)/Math.LN10;if(Ie==="D"){var De=Ge==="D2"?Te:we,He=Be+.01*Pe,rt=i.roundUp(i.mod(He,1),De,Tt);return Math.floor(He)+Math.log(r.round(Math.pow(10,rt),1))/Math.LN10}throw"unrecognized dtick "+String(Ge)},U.tickFirst=function(Be,Ge){var Tt=Be.r2l||Number,dt=i.simpleMap(Be.range,Tt,void 0,void 0,Ge),Pe=dt[1] ")}else Ut._prevDateHead=Le,Je+="
"+Le;tt.text=Je}(Be,Ie,Tt,De):He==="log"?function(Ut,tt,bt,zt,St){var Dt=Ut.dtick,Le=tt.x,Je=Ut.tickformat,st=typeof Dt=="string"&&Dt.charAt(0);if(St==="never"&&(St=""),zt&&st!=="L"&&(Dt="L3",st="L"),Je||st==="L")tt.text=Fe(Math.pow(10,Le),Ut,St,zt);else if(a(Dt)||st==="D"&&i.mod(Le+.01,1)<.1){var Et=Math.round(Le),It=Math.abs(Et),Zt=Ut.exponentformat;Zt==="power"||Ee(Zt)&&ze(Et)?(tt.text=Et===0?1:Et===1?"10":"10"+(Et>1?"":L)+It+"",tt.fontSize*=1.25):(Zt==="e"||Zt==="E")&&It>2?tt.text="1"+Zt+(Et>0?"+":L)+It:(tt.text=Fe(Math.pow(10,Le),Ut,"","fakehover"),Dt==="D1"&&Ut._id.charAt(0)==="y"&&(tt.dy-=tt.fontSize/6))}else{if(st!=="D")throw"unrecognized dtick "+String(Dt);tt.text=String(Math.round(Math.pow(10,i.mod(Le,1)))),tt.fontSize*=.75}if(Ut.dtick==="D1"){var Kt=String(tt.text).charAt(0);Kt!=="0"&&Kt!=="1"||(Ut._id.charAt(0)==="y"?tt.dx-=tt.fontSize/4:(tt.dy+=tt.fontSize/2,tt.dx+=(Ut.range[1]>Ut.range[0]?1:-1)*tt.fontSize*(Le<0?.5:.25)))}}(Be,Ie,0,De,wt):He==="category"?function(Ut,tt){var bt=Ut._categories[Math.round(tt.x)];bt===void 0&&(bt=""),tt.text=String(bt)}(Be,Ie):He==="multicategory"?function(Ut,tt,bt){var zt=Math.round(tt.x),St=Ut._categories[zt]||[],Dt=St[1]===void 0?"":String(St[1]),Le=St[0]===void 0?"":String(St[0]);bt?tt.text=Le+" - "+Dt:(tt.text=Dt,tt.text2=Le)}(Be,Ie,Tt):et(Be)?function(Ut,tt,bt,zt,St){if(Ut.thetaunit!=="radians"||bt)tt.text=Fe(tt.x,Ut,St,zt);else{var Dt=tt.x/180;if(Dt===0)tt.text="0";else{var Le=function(st){function Et(Ht,mn){return Math.abs(Ht-mn)<=1e-6}var It=function(Ht){for(var mn=1;!Et(Math.round(Ht*mn)/mn,Ht);)mn*=10;return mn}(st),Zt=st*It,Kt=Math.abs(function Ht(mn,zn){return Et(zn,0)?mn:Ht(zn,mn%zn)}(Zt,It));return[Math.round(Zt/Kt),Math.round(It/Kt)]}(Dt);if(Le[1]>=100)tt.text=Fe(i.deg2rad(tt.x),Ut,St,zt);else{var Je=tt.x<0;Le[1]===1?Le[0]===1?tt.text="\u03C0":tt.text=Le[0]+"\u03C0":tt.text=["",Le[0],"","\u2044","",Le[1],"","\u03C0"].join(""),Je&&(tt.text=L+tt.text)}}}}(Be,Ie,Tt,De,wt):function(Ut,tt,bt,zt,St){St==="never"?St="":Ut.showexponent==="all"&&Math.abs(tt.x/Ut.dtick)<1e-6&&(St="hide"),tt.text=Fe(tt.x,Ut,St,zt)}(Be,Ie,0,De,wt),dt||(Be.tickprefix&&!kt(Be.showtickprefix)&&(Ie.text=Be.tickprefix+Ie.text),Be.ticksuffix&&!kt(Be.showticksuffix)&&(Ie.text+=Be.ticksuffix)),Be.tickson==="boundaries"||Be.showdividers){var Vt=function(Ut){var tt=Be.l2p(Ut);return tt>=0&&tt<=Be._length?Ut:null};Ie.xbnd=[Vt(Ie.x-.5),Vt(Ie.x+Be.dtick-.5)]}return Ie},U.hoverLabelText=function(Be,Ge,Tt){Tt&&(Be=i.extendFlat({},Be,{hoverformat:Tt}));var dt=Array.isArray(Ge)?Ge[0]:Ge,Pe=Array.isArray(Ge)?Ge[1]:void 0;if(Pe!==void 0&&Pe!==dt)return U.hoverLabelText(Be,dt,Tt)+" - "+U.hoverLabelText(Be,Pe,Tt);var Ie=Be.type==="log"&&dt<=0,Ae=U.tickText(Be,Be.c2l(Ie?-dt:dt),"hover").text;return Ie?dt===0?"0":L+Ae:Ae};var ke=["f","p","n","\u03BC","m","","k","M","G","T"];function Ee(Be){return Be==="SI"||Be==="B"}function ze(Be){return Be>14||Be<-15}function Fe(Be,Ge,Tt,dt){var Pe=Be<0,Ie=Ge._tickround,Ae=Tt||Ge.exponentformat||"B",De=Ge._tickexponent,He=U.getTickFormat(Ge),rt=Ge.separatethousands;if(dt){var lt={exponentformat:Ae,minexponent:Ge.minexponent,dtick:Ge.showexponent==="none"?Ge.dtick:a(Be)&&Math.abs(Be)||1,range:Ge.showexponent==="none"?Ge.range.map(Ge.r2d):[0,Be||1]};ye(lt),Ie=(Number(lt._tickround)||0)+4,De=lt._tickexponent,Ge.hoverformat&&(He=Ge.hoverformat)}if(He)return Ge._numFormat(He)(Be).replace(/-/g,L);var ot,kt=Math.pow(10,-Ie)/2;if(Ae==="none"&&(De=0),(Be=Math.abs(Be))"+ot+"":Ae==="B"&&De===9?Be+="B":Ee(Ae)&&(Be+=ke[De/3+5])),Pe?L+Be:Be}function Ve(Be,Ge){for(var Tt=[],dt={},Pe=0;Pe1&&Tt=Pe.min&&Be=0,bt=lt(kt,wt[1])<=0;return(Vt||tt)&&(Ut||bt)}if(Be.tickformatstops&&Be.tickformatstops.length>0)switch(Be.type){case"date":case"linear":for(Ge=0;Ge=Ae(Pe)))){Tt=dt;break}break;case"log":for(Ge=0;Ge0?Kn.bottom-nr:0,Bn)))),Ge.automargin){Ln={x:0,y:0,r:0,l:0,t:0,b:0};var Fr=[0,1];if(He==="x"){if(Mn==="b"?Ln[Mn]=Ge._depth:(Ln[Mn]=Ge._depth=Math.max(Kn.width>0?nr-Kn.top:0,Bn),Fr.reverse()),Kn.width>0){var $r=Kn.right-(Ge._offset+Ge._length);$r>0&&(Ln.xr=1,Ln.r=$r);var pr=Ge._offset-Kn.left;pr>0&&(Ln.xl=0,Ln.l=pr)}}else if(Mn==="l"?Ln[Mn]=Ge._depth=Math.max(Kn.height>0?nr-Kn.left:0,Bn):(Ln[Mn]=Ge._depth=Math.max(Kn.height>0?Kn.right-nr:0,Bn),Fr.reverse()),Kn.height>0){var qr=Kn.bottom-(Ge._offset+Ge._length);qr>0&&(Ln.yb=0,Ln.b=qr);var _i=Ge._offset-Kn.top;_i>0&&(Ln.yt=1,Ln.t=_i)}Ln[rt]=Ge.anchor==="free"?Ge.position:Ge._anchorAxis.domain[Fr[0]],Ge.title.text!==Ae._dfltTitle[He]&&(Ln[Mn]+=qe(Ge)+(Ge.title.standoff||0)),Ge.mirror&&Ge.anchor!=="free"&&((lr={x:0,y:0,r:0,l:0,t:0,b:0})[rr]=Ge.linewidth,Ge.mirror&&Ge.mirror!==!0&&(lr[rr]+=Bn),Ge.mirror===!0||Ge.mirror==="ticks"?lr[rt]=Ge._anchorAxis.domain[Fr[1]]:Ge.mirror!=="all"&&Ge.mirror!=="allticks"||(lr[rt]=[Ge._counterDomainMin,Ge._counterDomainMax][Fr[1]]))}vr&&(Wr=c.getComponentMethod("rangeslider","autoMarginOpts")(Be,Ge)),u.autoMargin(Be,nt(Ge),Ln),u.autoMargin(Be,ft(Ge),lr),u.autoMargin(Be,vt(Ge),Wr)}),Tt.skipTitle||vr&&Ge.side==="bottom"||ar.push(function(){return function(Kn,Ln){var lr,Wr=Kn._fullLayout,Mn=Ln._id,rr=Mn.charAt(0),nr=Ln.title.font.size;if(Ln.title.hasOwnProperty("standoff"))lr=Ln._depth+Ln.title.standoff+qe(Ln);else{var Bn=Wt(Ln);if(Ln.type==="multicategory")lr=Ln._depth;else{var Fr=1.5*nr;Bn&&(Fr=.5*nr,Ln.ticks==="outside"&&(Fr+=Ln.ticklen)),lr=10+Fr+(Ln.linewidth?Ln.linewidth-1:0)}Bn||(lr+=rr==="x"?Ln.side==="top"?nr*(Ln.showticklabels?1:0):nr*(Ln.showticklabels?1.5:.5):Ln.side==="right"?nr*(Ln.showticklabels?1:.5):nr*(Ln.showticklabels?.5:0))}var $r,pr,qr,_i,cn=U.getPxPosition(Kn,Ln);if(rr==="x"?(pr=Ln._offset+Ln._length/2,qr=Ln.side==="top"?cn-lr:cn+lr):(qr=Ln._offset+Ln._length/2,pr=Ln.side==="right"?cn+lr:cn-lr,$r={rotate:"-90",offset:0}),Ln.type!=="multicategory"){var jn=Ln._selections[Ln._id+"tick"];if(_i={selection:jn,side:Ln.side},jn&&jn.node()&&jn.node().parentNode){var jt=m.getTranslate(jn.node().parentNode);_i.offsetLeft=jt.x,_i.offsetTop=jt.y}Ln.title.hasOwnProperty("standoff")&&(_i.pad=0)}return d.draw(Kn,Mn+"title",{propContainer:Ln,propName:Ln._name+".title.text",placeholder:Wr._dfltTitle[rr],avoid:_i,transform:$r,attributes:{x:pr,y:qr,"text-anchor":"middle"}})}(Be,Ge)}),i.syncOrAsync(ar)}}function Er(Kn){var Ln=De+(Kn||"tick");return tt[Ln]||(tt[Ln]=function(lr,Wr){var Mn,rr,nr,Bn;return lr._selections[Wr].size()?(Mn=1/0,rr=-1/0,nr=1/0,Bn=-1/0,lr._selections[Wr].each(function(){var Fr=Ye(this),$r=m.bBox(Fr.node().parentNode);Mn=Math.min(Mn,$r.top),rr=Math.max(rr,$r.bottom),nr=Math.min(nr,$r.left),Bn=Math.max(Bn,$r.right)})):(Mn=0,rr=0,nr=0,Bn=0),{top:Mn,bottom:rr,left:nr,right:Bn,height:rr-Mn,width:Bn-nr}}(Ge,Ln)),tt[Ln]}},U.getTickSigns=function(Be){var Ge=Be._id.charAt(0),Tt={x:"top",y:"right"}[Ge],dt=Be.side===Tt?1:-1,Pe=[-1,1,dt,-dt];return Be.ticks!=="inside"==(Ge==="x")&&(Pe=Pe.map(function(Ie){return-Ie})),Be.side&&Pe.push({l:-1,t:-1,r:1,b:1}[Be.side.charAt(0)]),Pe},U.makeTransTickFn=function(Be){return Be._id.charAt(0)==="x"?function(Ge){return s(Be._offset+Be.l2p(Ge.x),0)}:function(Ge){return s(0,Be._offset+Be.l2p(Ge.x))}},U.makeTransTickLabelFn=function(Be){var Ge=function(Pe){var Ie=Pe.ticklabelposition||"",Ae=function(bt){return Ie.indexOf(bt)!==-1},De=Ae("top"),He=Ae("left"),rt=Ae("right"),lt=Ae("bottom"),ot=Ae("inside"),kt=lt||He||De||rt;if(!kt&&!ot)return[0,0];var wt=Pe.side,Vt=kt?(Pe.tickwidth||0)/2:0,Ut=3,tt=Pe.tickfont?Pe.tickfont.size:12;return(lt||De)&&(Vt+=tt*Y,Ut+=(Pe.linewidth||0)/2),(He||rt)&&(Vt+=(Pe.linewidth||0)/2,Ut+=3),ot&&wt==="top"&&(Ut-=tt*(1-Y)),(He||De)&&(Vt=-Vt),wt!=="bottom"&&wt!=="right"||(Ut=-Ut),[kt?Vt:0,ot?Ut:0]}(Be),Tt=Ge[0],dt=Ge[1];return Be._id.charAt(0)==="x"?function(Pe){return s(Tt+Be._offset+Be.l2p(Ke(Pe)),dt)}:function(Pe){return s(dt,Tt+Be._offset+Be.l2p(Ke(Pe)))}},U.makeTickPath=function(Be,Ge,Tt,dt){dt=dt!==void 0?dt:Be.ticklen;var Pe=Be._id.charAt(0),Ie=(Be.linewidth||1)/2;return Pe==="x"?"M0,"+(Ge+Ie*Tt)+"v"+dt*Tt:"M"+(Ge+Ie*Tt)+",0h"+dt*Tt},U.makeLabelFns=function(Be,Ge,Tt){var dt=Be.ticklabelposition||"",Pe=function(Kt){return dt.indexOf(Kt)!==-1},Ie=Pe("top"),Ae=Pe("left"),De=Pe("right"),He=Pe("bottom")||Ae||Ie||De,rt=Pe("inside"),lt=dt==="inside"&&Be.ticks==="inside"||!rt&&Be.ticks==="outside"&&Be.tickson!=="boundaries",ot=0,kt=0,wt=lt?Be.ticklen:0;if(rt?wt*=-1:He&&(wt=0),lt&&(ot+=wt,Tt)){var Vt=i.deg2rad(Tt);ot=wt*Math.cos(Vt)+1,kt=wt*Math.sin(Vt)}Be.showticklabels&&(lt||Be.showline)&&(ot+=.2*Be.tickfont.size);var Ut,tt,bt,zt,St,Dt={labelStandoff:ot+=(Be.linewidth||1)/2*(rt?-1:1),labelShift:kt},Le=0,Je=Be.side,st=Be._id.charAt(0),Et=Be.tickangle;if(st==="x")zt=(St=!rt&&Je==="bottom"||rt&&Je==="top")?1:-1,rt&&(zt*=-1),Ut=kt*zt,tt=Ge+ot*zt,bt=St?1:-.2,Math.abs(Et)===90&&(rt?bt+=te:bt=Et===-90&&Je==="bottom"?Y:Et===90&&Je==="top"?te:.5,Le=te/2*(Et/90)),Dt.xFn=function(Kt){return Kt.dx+Ut+Le*Kt.fontSize},Dt.yFn=function(Kt){return Kt.dy+tt+Kt.fontSize*bt},Dt.anchorFn=function(Kt,Ht){if(He){if(Ae)return"end";if(De)return"start"}return a(Ht)&&Ht!==0&&Ht!==180?Ht*zt<0!==rt?"end":"start":"middle"},Dt.heightFn=function(Kt,Ht,mn){return Ht<-60||Ht>60?-.5*mn:Be.side==="top"!==rt?-mn:0};else if(st==="y"){if(zt=(St=!rt&&Je==="left"||rt&&Je==="right")?1:-1,rt&&(zt*=-1),Ut=ot,tt=kt*zt,bt=0,rt||Math.abs(Et)!==90||(bt=Et===-90&&Je==="left"||Et===90&&Je==="right"?Y:.5),rt){var It=a(Et)?+Et:0;if(It!==0){var Zt=i.deg2rad(It);Le=Math.abs(Math.sin(Zt))*Y*zt,bt=0}}Dt.xFn=function(Kt){return Kt.dx+Ge-(Ut+Kt.fontSize*bt)*zt+Le*Kt.fontSize},Dt.yFn=function(Kt){return Kt.dy+tt+Kt.fontSize*te},Dt.anchorFn=function(Kt,Ht){return a(Ht)&&Math.abs(Ht)===90?"middle":St?"end":"start"},Dt.heightFn=function(Kt,Ht,mn){return Be.side==="right"&&(Ht*=-1),Ht<-30?-mn:Ht<30?-.5*mn:0}}return Dt},U.drawTicks=function(Be,Ge,Tt){Tt=Tt||{};var dt=Ge._id+"tick",Pe=Tt.vals;Ge.ticklabelmode==="period"&&(Pe=Pe.slice()).shift();var Ie=Tt.layer.selectAll("path."+dt).data(Ge.ticks?Pe:[],Re);Ie.exit().remove(),Ie.enter().append("path").classed(dt,1).classed("ticks",1).classed("crisp",Tt.crisp!==!1).call(h.stroke,Ge.tickcolor).style("stroke-width",m.crispRound(Be,Ge.tickwidth,1)+"px").attr("d",Tt.path).style("display",null),Jt(Ge,[G]),Ie.attr("transform",Tt.transFn)},U.drawGrid=function(Be,Ge,Tt){Tt=Tt||{};var dt=Ge._id+"grid",Pe=Tt.vals,Ie=Tt.counterAxis;if(Ge.showgrid===!1)Pe=[];else if(Ie&&U.shouldShowZeroLine(Be,Ge,Ie))for(var Ae=Ge.tickmode==="array",De=0;DeIt||sn.leftIt||sn.top+(Ge.tickangle?0:tn.fontSize/4)Ge["_visibleLabelMin_"+st._id]?pn.style("display","none"):It.K!=="tick"||Et||pn.style("display",null)})})})})},wt(ot,lt+1?lt:rt);var Vt=null;Ge._selections&&(Ge._selections[Ae]=ot);var Ut=[function(){return kt.length&&Promise.all(kt)}];Ge.automargin&&dt._redrawFromAutoMarginCount&<===90?(Vt=90,Ut.push(function(){wt(ot,lt)})):Ut.push(function(){if(wt(ot,rt),De.length&&Ie==="x"&&!a(rt)&&(Ge.type!=="log"||String(Ge.dtick).charAt(0)!=="D")){Vt=0;var zt,St=0,Dt=[];if(ot.each(function(nn){St=Math.max(St,nn.fontSize);var sn=Ge.l2p(nn.x),gn=Ye(this),bn=m.bBox(gn.node());Dt.push({top:0,bottom:10,height:10,left:sn-bn.width/2,right:sn+bn.width/2+2,width:bn.width+2})}),Ge.tickson!=="boundaries"&&!Ge.showdividers||Tt.secondary){var Le=De.length,Je=Math.abs((De[Le-1].x-De[0].x)*Ge._m)/(Le-1),st=Ge.ticklabelposition||"",Et=function(nn){return st.indexOf(nn)!==-1},It=Et("top"),Zt=Et("left"),Kt=Et("right"),Ht=Et("bottom")||Zt||It||Kt?(Ge.tickwidth||0)+6:0,mn=Je<2.5*St||Ge.type==="multicategory"||Ge._name==="realaxis";for(zt=0;zt1)for(De=1;De2*E}(v,g))return"date";var b=p.autotypenumbers!=="strict";return function(T,_){for(var M=T.length,A=h(M),S=0,E=0,D={},O=0;O2*S}(v,b)?"category":function(T,_){for(var M=T.length,A=0;A=2){var S,E,D="";if(A.length===2){for(S=0;S<2;S++)if(E=k(A[S])){D=v;break}}var O=M("pattern",D);if(O===v)for(S=0;S<2;S++)(E=k(A[S]))&&(T.bounds[S]=A[S]=E-1);if(O)for(S=0;S<2;S++)switch(E=A[S],O){case v:if(!r(E)||(E=+E)!==Math.floor(E)||E<0||E>=7)return void(T.enabled=!1);T.bounds[S]=A[S]=E;break;case y:if(!r(E)||(E=+E)<0||E>24)return void(T.enabled=!1);T.bounds[S]=A[S]=E}if(_.autorange===!1){var R=_.range;if(R[0]R[1])return void(T.enabled=!1)}else if(A[0]>R[0]&&A[1]l?1:-1:+(c.substr(1)||1)-+(i.substr(1)||1)},f.ref2id=function(c){return!!/^[xyz]/.test(c)&&c.split(" ")[0]},f.isLinked=function(c,i){return u(i,c._axisMatchGroups)||u(i,c._axisConstraintGroups)}},{"../../registry":638,"./constants":561}],559:[function(e,o,f){o.exports=function(r,a,u,c){if(a.type==="category"){var i,s=r.categoryarray,l=Array.isArray(s)&&s.length>0;l&&(i="array");var d,h=u("categoryorder",i);h==="array"&&(d=u("categoryarray")),l||h!=="array"||(h=a.categoryorder="trace"),h==="trace"?a._initialCategories=[]:h==="array"?a._initialCategories=d.slice():(d=function(m,g){var p,v,y,x=g.dataAttr||m._id.charAt(0),w={};if(g.axData)p=g.axData;else for(p=[],v=0;vT?_.substr(T):M.substr(b))+A:_+M+w*k:A}function y(w,k){for(var b=k._size,T=b.h/b.w,_={},M=Object.keys(w),A=0;Al*L)||G){for(b=0;bne&&ieq&&(q=ie);E/=(q-U)/(2*$),U=M.l2r(U),q=M.l2r(q),M.range=M._input.range=Y=0?Math.min(ie,.9):1/(1/Math.max(ie,-.3)+3.222))}function Y(ie,ae,ue,le,ge){return ie.append("path").attr("class","zoombox").style({fill:ae>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(ue,le)).attr("d",ge+"Z")}function Z(ie,ae,ue){return ie.append("path").attr("class","zoombox-corners").style({fill:h.background,stroke:h.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(ae,ue)).attr("d","M0,0Z")}function re(ie,ae,ue,le,ge,fe){ie.attr("d",le+"M"+ue.l+","+ue.t+"v"+ue.h+"h"+ue.w+"v-"+ue.h+"h-"+ue.w+"Z"),U(ie,ae,ge,fe)}function U(ie,ae,ue,le){ue||(ie.transition().style("fill",le>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ae.transition().style("opacity",1).duration(200))}function q(ie){r.select(ie).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function $(ie){P&&ie.data&&ie._context.showTips&&(a.notifier(a._(ie,"Double-click to zoom back out"),"long"),P=!1)}function ne(ie){var ae=Math.floor(Math.min(ie.b-ie.t,ie.r-ie.l,L)/2);return"M"+(ie.l-3.5)+","+(ie.t-.5+ae)+"h3v"+-ae+"h"+ae+"v-3h-"+(ae+3)+"ZM"+(ie.r+3.5)+","+(ie.t-.5+ae)+"h-3v"+-ae+"h"+-ae+"v-3h"+(ae+3)+"ZM"+(ie.r+3.5)+","+(ie.b+.5-ae)+"h-3v"+ae+"h"+-ae+"v3h"+(ae+3)+"ZM"+(ie.l-3.5)+","+(ie.b+.5-ae)+"h3v"+ae+"h"+ae+"v3h-"+(ae+3)+"Z"}function H(ie,ae,ue,le,ge){for(var fe,me,_e,we,Te=!1,Oe={},de={},ye=(ge||{}).xaHash,Me=(ge||{}).yaHash,ke=0;ke=0)sn._fullLayout._deactivateShape(sn);else{var gn=sn._fullLayout.clickmode;if(q(sn),tn!==2||Jt||Zt(),Wt)gn.indexOf("select")>-1&&D(nn,sn,ye,Me,ae.id,wt),gn.indexOf("event")>-1&&g.click(sn,nn,ae.id);else if(tn===1&&Jt){var bn=me?Te:we,In=me==="s"||_e==="w"?0:1,Hn=bn._name+".range["+In+"]",Wn=function(vr,Er){var Kn,Ln=vr.range[Er],lr=Math.abs(Ln-vr.range[1-Er]);return vr.type==="date"?Ln:vr.type==="log"?(Kn=Math.ceil(Math.max(0,-Math.log(lr)/Math.LN10))+3,u("."+Kn+"g")(Math.pow(10,Ln))):(Kn=Math.floor(Math.log(Math.abs(Ln))/Math.LN10)-Math.floor(Math.log(lr)/Math.LN10)+4,u("."+String(Kn)+"g")(Ln))}(bn,In),ar="left",Or="middle";if(bn.fixedrange)return;me?(Or=me==="n"?"top":"bottom",bn.side==="right"&&(ar="right")):_e==="e"&&(ar="right"),sn._context.showAxisRangeEntryBoxes&&r.select(Tt).call(d.makeEditable,{gd:sn,immediate:!0,background:sn._fullLayout.paper_bgcolor,text:String(Wn),fill:bn.tickfont?bn.tickfont.color:"#444",horizontalAlign:ar,verticalAlign:Or}).on("edit",function(vr){var Er=bn.d2r(vr);Er!==void 0&&s.call("_guiRelayout",sn,Hn,Er)})}}}function tt(tn,nn){if(ie._transitioningWithDuration)return!1;var sn=Math.max(0,Math.min(ze,at*tn+dt)),gn=Math.max(0,Math.min(Fe,et*nn+Pe)),bn=Math.abs(sn-dt),In=Math.abs(gn-Pe);function Hn(){rt="",Ie.r=Ie.l,Ie.t=Ie.b,ot.attr("d","M0,0Z")}if(Ie.l=Math.min(dt,sn),Ie.r=Math.max(dt,sn),Ie.t=Math.min(Pe,gn),Ie.b=Math.max(Pe,gn),Ve.isSubplotConstrained)bn>L||In>L?(rt="xy",bn/ze>In/Fe?(In=bn*Fe/ze,Pe>gn?Ie.t=Pe-In:Ie.b=Pe+In):(bn=In*ze/Fe,dt>sn?Ie.l=dt-bn:Ie.r=dt+bn),ot.attr("d",ne(Ie))):Hn();else if(Ke.isSubplotConstrained)if(bn>L||In>L){rt="xy";var Wn=Math.min(Ie.l/ze,(Fe-Ie.b)/Fe),ar=Math.max(Ie.r/ze,(Fe-Ie.t)/Fe);Ie.l=Wn*ze,Ie.r=ar*ze,Ie.b=(1-Wn)*Fe,Ie.t=(1-ar)*Fe,ot.attr("d",ne(Ie))}else Hn();else!qe||In0){var Or;if(Ke.isSubplotConstrained||!Re&&qe.length===1){for(Or=0;Orw[1]-1/4096&&(c.domain=d),a.noneOrAll(u.domain,c.domain,d)}return i("layer"),c}},{"../../lib":503,"fast-isnumeric":190}],573:[function(e,o,f){var r=e("./show_dflt");o.exports=function(a,u,c,i,s){s||(s={});var l=s.tickSuffixDflt,d=r(a);c("tickprefix")&&c("showtickprefix",d),c("ticksuffix",l)&&c("showticksuffix",d)}},{"./show_dflt":577}],574:[function(e,o,f){var r=e("../../constants/alignment").FROM_BL;o.exports=function(a,u,c){c===void 0&&(c=r[a.constraintoward||"center"]);var i=[a.r2l(a.range[0]),a.r2l(a.range[1])],s=i[0]+(i[1]-i[0])*c;a.range=a._input.range=[a.l2r(s+(i[0]-s)*u),a.l2r(s+(i[1]-s)*u)],a.setScale()}},{"../../constants/alignment":471}],575:[function(e,o,f){var r=e("polybooljs"),a=e("../../registry"),u=e("../../components/drawing").dashStyle,c=e("../../components/color"),i=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,l=e("../../components/dragelement/helpers"),d=l.freeMode,h=l.rectMode,m=l.drawMode,g=l.openMode,p=l.selectMode,v=e("../../components/shapes/draw_newshape/display_outlines"),y=e("../../components/shapes/draw_newshape/helpers").handleEllipse,x=e("../../components/shapes/draw_newshape/newshapes"),w=e("../../lib"),k=e("../../lib/polygon"),b=e("../../lib/throttle"),T=e("./axis_ids").getFromId,_=e("../../lib/clear_gl_canvases"),M=e("../../plot_api/subroutines").redrawReglTraces,A=e("./constants"),S=A.MINSELECT,E=k.filter,D=k.tester,O=e("./handle_outline").clearSelect,R=e("./helpers"),z=R.p2r,L=R.axValue,P=R.getTransform;function N($,ne,H,Q,ee,ie,ae){var ue,le,ge,fe,me,_e,we,Te,Oe,de=ne._hoverdata,ye=ne._fullLayout.clickmode.indexOf("event")>-1,Me=[];if(function(Ve){return Ve&&Array.isArray(Ve)&&Ve[0].hoverOnBox!==!0}(de)){K($,ne,ie);var ke=function(Ve,Ke){var Re,qe,We=Ve[0],Ye=-1,nt=[];for(qe=0;qe0?function(Ve,Ke){var Re,qe,We,Ye=[];for(We=0;We0&&Ye.push(Re);if(Ye.length===1&&Ye[0]===Ke.searchInfo&&(qe=Ke.searchInfo.cd[0].trace).selectedpoints.length===Ke.pointNumbers.length){for(We=0;We1||(We+=Re.selectedpoints.length)>1))return!1;return We===1}(ue)&&(_e=Z(ke))){for(ae&&ae.remove(),Oe=0;Oe=0&&Q._fullLayout._deactivateShape(Q),m(ne)){var ee=Q._fullLayout._zoomlayer.selectAll(".select-outline-"+H.id);if(ee&&Q._fullLayout._drawing){var ie=x(ee,$);ie&&a.call("_guiRelayout",Q,{shapes:ie}),Q._fullLayout._drawing=!1}}H.selection={},H.selection.selectionDefs=$.selectionDefs=[],H.selection.mergedPolygons=$.mergedPolygons=[]}function Y($,ne,H,Q){var ee,ie,ae,ue=[],le=ne.map(function(we){return we._id}),ge=H.map(function(we){return we._id});for(ae=0;ae<$.calcdata.length;ae++)if((ie=(ee=$.calcdata[ae])[0].trace).visible===!0&&ie._module&&ie._module.selectPoints)if(!Q||ie.subplot!==Q&&ie.geo!==Q)if(ie.type==="splom"&&ie._xaxes[le[0]]&&ie._yaxes[ge[0]]){var fe=_e(ie._module,ee,ne[0],H[0]);fe.scene=$._fullLayout._splomScenes[ie.uid],ue.push(fe)}else if(ie.type==="sankey"){var me=_e(ie._module,ee,ne[0],H[0]);ue.push(me)}else{if(le.indexOf(ie.xaxis)===-1||ge.indexOf(ie.yaxis)===-1)continue;ue.push(_e(ie._module,ee,T($,ie.xaxis),T($,ie.yaxis)))}else ue.push(_e(ie._module,ee,ne[0],H[0]));return ue;function _e(we,Te,Oe,de){return{_module:we,cd:Te,xaxis:Oe,yaxis:de}}}function Z($){var ne=$.searchInfo.cd[0].trace,H=$.pointNumber,Q=$.pointNumbers,ee=Q.length>0?Q[0]:H;return!!ne.selectedpoints&&ne.selectedpoints.indexOf(ee)>-1}function re($,ne,H){var Q,ee,ie,ae;for(Q=0;Q=0)_e._fullLayout._deactivateShape(_e);else if(!le){var He=we.clickmode;b.done(Tt).then(function(){if(b.clear(Tt),Ae===2){for(Wt.remove(),Re=0;Re-1&&N(De,_e,Q.xaxes,Q.yaxes,Q.subplot,Q,Wt),He==="event"&&_e.emit("plotly_selected",void 0);i.click(_e,De)}).catch(w.error)}},Q.doneFn=function(){Ge.remove(),b.done(Tt).then(function(){b.clear(Tt),Q.gd.emit("plotly_selected",We),Ke&&Q.selectionDefs&&(Ke.subtract=Ot,Q.selectionDefs.push(Ke),Q.mergedPolygons.length=0,[].push.apply(Q.mergedPolygons,Ve)),Q.doneFnCompleted&&Q.doneFnCompleted(dt)}).catch(w.error),le&&te(Q)}},clearSelect:O,clearSelectionsCache:te,selectOnClick:N}},{"../../components/color":366,"../../components/dragelement/helpers":384,"../../components/drawing":388,"../../components/fx":406,"../../components/fx/helpers":402,"../../components/shapes/draw_newshape/display_outlines":454,"../../components/shapes/draw_newshape/helpers":455,"../../components/shapes/draw_newshape/newshapes":456,"../../lib":503,"../../lib/clear_gl_canvases":487,"../../lib/polygon":515,"../../lib/throttle":530,"../../plot_api/subroutines":544,"../../registry":638,"./axis_ids":558,"./constants":561,"./handle_outline":565,"./helpers":566,polybooljs:254}],576:[function(e,o,f){var r=e("@plotly/d3"),a=e("d3-time-format").utcFormat,u=e("../../lib"),c=u.numberFormat,i=e("fast-isnumeric"),s=u.cleanNumber,l=u.ms2DateTime,d=u.dateTime2ms,h=u.ensureNumber,m=u.isArrayOrTypedArray,g=e("../../constants/numerical"),p=g.FP_SAFE,v=g.BADNUM,y=g.LOG_CLIP,x=g.ONEWEEK,w=g.ONEDAY,k=g.ONEHOUR,b=g.ONEMIN,T=g.ONESEC,_=e("./axis_ids"),M=e("./constants"),A=M.HOUR_PATTERN,S=M.WEEKDAY_PATTERN;function E(O){return Math.pow(10,O)}function D(O){return O!=null}o.exports=function(O,R){R=R||{};var z=O._id||"x",L=z.charAt(0);function P(H,Q){if(H>0)return Math.log(H)/Math.LN10;if(H<=0&&Q&&O.range&&O.range.length===2){var ee=O.range[0],ie=O.range[1];return .5*(ee+ie-2*y*Math.abs(ee-ie))}return v}function N(H,Q,ee,ie){if((ie||{}).msUTC&&i(H))return+H;var ae=d(H,ee||O.calendar);if(ae===v){if(!i(H))return v;H=+H;var ue=Math.floor(10*u.mod(H+.05,1)),le=Math.round(H-ue/10);ae=d(new Date(le))+ue/10}return ae}function B(H,Q,ee){return l(H,Q,ee||O.calendar)}function G(H){return O._categories[Math.round(H)]}function W(H){if(D(H)){if(O._categoriesMap===void 0&&(O._categoriesMap={}),O._categoriesMap[H]!==void 0)return O._categoriesMap[H];O._categories.push(typeof H=="number"?String(H):H);var Q=O._categories.length-1;return O._categoriesMap[H]=Q,Q}return v}function K(H){if(O._categoriesMap)return O._categoriesMap[H]}function te(H){var Q=K(H);return Q!==void 0?Q:i(H)?+H:void 0}function Y(H){return i(H)?+H:K(H)}function Z(H,Q,ee){return r.round(ee+Q*H,2)}function re(H,Q,ee){return(H-ee)/Q}var U=function(H){return i(H)?Z(H,O._m,O._b):v},q=function(H){return re(H,O._m,O._b)};if(O.rangebreaks){var $=L==="y";U=function(H){if(!i(H))return v;var Q=O._rangebreaks.length;if(!Q)return Z(H,O._m,O._b);var ee=$;O.range[0]>O.range[1]&&(ee=!ee);for(var ie=ee?-1:1,ae=ie*H,ue=0,le=0;lefe)){ue=ae<(ge+fe)/2?le:le+1;break}ue=le+1}var me=O._B[ue]||0;return isFinite(me)?Z(H,O._m2,me):0},q=function(H){var Q=O._rangebreaks.length;if(!Q)return re(H,O._m,O._b);for(var ee=0,ie=0;ieO._rangebreaks[ie].pmax&&(ee=ie+1);return re(H,O._m2,O._B[ee])}}O.c2l=O.type==="log"?P:h,O.l2c=O.type==="log"?E:h,O.l2p=U,O.p2l=q,O.c2p=O.type==="log"?function(H,Q){return U(P(H,Q))}:U,O.p2c=O.type==="log"?function(H){return E(q(H))}:q,["linear","-"].indexOf(O.type)!==-1?(O.d2r=O.r2d=O.d2c=O.r2c=O.d2l=O.r2l=s,O.c2d=O.c2r=O.l2d=O.l2r=h,O.d2p=O.r2p=function(H){return O.l2p(s(H))},O.p2d=O.p2r=q,O.cleanPos=h):O.type==="log"?(O.d2r=O.d2l=function(H,Q){return P(s(H),Q)},O.r2d=O.r2c=function(H){return E(s(H))},O.d2c=O.r2l=s,O.c2d=O.l2r=h,O.c2r=P,O.l2d=E,O.d2p=function(H,Q){return O.l2p(O.d2r(H,Q))},O.p2d=function(H){return E(q(H))},O.r2p=function(H){return O.l2p(s(H))},O.p2r=q,O.cleanPos=h):O.type==="date"?(O.d2r=O.r2d=u.identity,O.d2c=O.r2c=O.d2l=O.r2l=N,O.c2d=O.c2r=O.l2d=O.l2r=B,O.d2p=O.r2p=function(H,Q,ee){return O.l2p(N(H,0,ee))},O.p2d=O.p2r=function(H,Q,ee){return B(q(H),Q,ee)},O.cleanPos=function(H){return u.cleanDate(H,v,O.calendar)}):O.type==="category"?(O.d2c=O.d2l=W,O.r2d=O.c2d=O.l2d=G,O.d2r=O.d2l_noadd=te,O.r2c=function(H){var Q=Y(H);return Q!==void 0?Q:O.fraction2r(.5)},O.l2r=O.c2r=h,O.r2l=Y,O.d2p=function(H){return O.l2p(O.r2c(H))},O.p2d=function(H){return G(q(H))},O.r2p=O.d2p,O.p2r=q,O.cleanPos=function(H){return typeof H=="string"&&H!==""?H:h(H)}):O.type==="multicategory"&&(O.r2d=O.c2d=O.l2d=G,O.d2r=O.d2l_noadd=te,O.r2c=function(H){var Q=te(H);return Q!==void 0?Q:O.fraction2r(.5)},O.r2c_just_indices=K,O.l2r=O.c2r=h,O.r2l=te,O.d2p=function(H){return O.l2p(O.r2c(H))},O.p2d=function(H){return G(q(H))},O.r2p=O.d2p,O.p2r=q,O.cleanPos=function(H){return Array.isArray(H)||typeof H=="string"&&H!==""?H:h(H)},O.setupMultiCategory=function(H){var Q,ee,ie=O._traceIndices,ae=O._matchGroup;if(ae&&O._categories.length===0){for(var ue in ae)if(ue!==z){var le=R[_.id2name(ue)];ie=ie.concat(le._traceIndices)}}var ge=[[0,{}],[0,{}]],fe=[];for(Q=0;Qp&&(ae[ee]=p),ae[0]===ae[1]){var le=Math.max(1,Math.abs(1e-6*ae[0]));ae[0]-=le,ae[1]+=le}}else u.nestedProperty(O,H).set(ie)},O.setScale=function(H){var Q=R._size;if(O.overlaying){var ee=_.getFromId({_fullLayout:R},O.overlaying);O.domain=ee.domain}var ie=H&&O._r?"_r":"range",ae=O.calendar;O.cleanRange(ie);var ue,le,ge=O.r2l(O[ie][0],ae),fe=O.r2l(O[ie][1],ae),me=L==="y";if(me?(O._offset=Q.t+(1-O.domain[1])*Q.h,O._length=Q.h*(O.domain[1]-O.domain[0]),O._m=O._length/(ge-fe),O._b=-O._m*fe):(O._offset=Q.l+O.domain[0]*Q.w,O._length=Q.w*(O.domain[1]-O.domain[0]),O._m=O._length/(fe-ge),O._b=-O._m*ge),O._rangebreaks=[],O._lBreaks=0,O._m2=0,O._B=[],O.rangebreaks&&(O._rangebreaks=O.locateBreaks(Math.min(ge,fe),Math.max(ge,fe)),O._rangebreaks.length)){for(ue=0;uefe&&(_e=!_e),_e&&O._rangebreaks.reverse();var we=_e?-1:1;for(O._m2=we*O._length/(Math.abs(fe-ge)-O._lBreaks),O._B.push(-O._m2*(me?fe:ge)),ue=0;ueie&&(ie+=7,aeie&&(ie+=24,ae=ee&&ae=ee&&H=Ke.min&&(EeKe.max&&(Ke.max=ze),Fe=!1)}Fe&&le.push({min:Ee,max:ze})}};for(ee=0;eed.duration?(function(){for(var A={},S=0;S rect").call(c.setTranslate,0,0).call(c.setScale,1,1),b.plot.call(c.setTranslate,T._offset,_._offset).call(c.setScale,1,1);var M=b.plot.selectAll(".scatterlayer .trace");M.selectAll(".point").call(c.setPointGroupScale,1,1),M.selectAll(".textpoint").call(c.setTextPointsScale,1,1),M.call(c.hideOutsideRangePoints,b)}function k(b,T){var _=b.plotinfo,M=_.xaxis,A=_.yaxis,S=M._length,E=A._length,D=!!b.xr1,O=!!b.yr1,R=[];if(D){var z=u.simpleMap(b.xr0,M.r2l),L=u.simpleMap(b.xr1,M.r2l),P=z[1]-z[0],N=L[1]-L[0];R[0]=(z[0]*(1-T)+T*L[0]-z[0])/(z[1]-z[0])*S,R[2]=S*(1-T+T*N/P),M.range[0]=M.l2r(z[0]*(1-T)+T*L[0]),M.range[1]=M.l2r(z[1]*(1-T)+T*L[1])}else R[0]=0,R[2]=S;if(O){var B=u.simpleMap(b.yr0,A.r2l),G=u.simpleMap(b.yr1,A.r2l),W=B[1]-B[0],K=G[1]-G[0];R[1]=(B[1]*(1-T)+T*G[1]-B[1])/(B[0]-B[1])*E,R[3]=E*(1-T+T*K/W),A.range[0]=M.l2r(B[0]*(1-T)+T*G[0]),A.range[1]=A.l2r(B[1]*(1-T)+T*G[1])}else R[1]=0,R[3]=E;i.drawOne(s,M,{skipTitle:!0}),i.drawOne(s,A,{skipTitle:!0}),i.redrawComponents(s,[M._id,A._id]);var te=D?S/R[2]:1,Y=O?E/R[3]:1,Z=D?R[0]:0,re=O?R[1]:0,U=D?R[0]/R[2]*S:0,q=O?R[1]/R[3]*E:0,$=M._offset-U,ne=A._offset-q;_.clipRect.call(c.setTranslate,Z,re).call(c.setScale,1/te,1/Y),_.plot.call(c.setTranslate,$,ne).call(c.setScale,te,Y),c.setPointGroupScale(_.zoomScalePts,1/te,1/Y),c.setTextPointsScale(_.zoomScaleTxt,1/te,1/Y)}i.redrawComponents(s)}},{"../../components/drawing":388,"../../lib":503,"../../registry":638,"./axes":554,"@plotly/d3":58}],582:[function(e,o,f){var r=e("../../registry").traceIs,a=e("./axis_autotype");function u(i){return{v:"x",h:"y"}[i.orientation||"v"]}function c(i,s){var l=u(i),d=r(i,"box-violin"),h=r(i._fullInput||{},"candlestick");return d&&!h&&s===l&&i[l]===void 0&&i[l+"0"]===void 0}o.exports=function(i,s,l,d){l("autotypenumbers",d.autotypenumbersDflt),l("type",(d.splomStash||{}).type)==="-"&&(function(h,m){if(h.type==="-"){var g,p=h._id,v=p.charAt(0);p.indexOf("scene")!==-1&&(p=v);var y=function(A,S,E){for(var D=0;D0&&(O["_"+E+"axes"]||{})[S]||(O[E+"axis"]||E)===S&&(c(O,E)||(O[E]||[]).length||O[E+"0"]))return O}}(m,p,v);if(!!y){if(y.type==="histogram"&&v==={v:"y",h:"x"}[y.orientation||"v"])return void(h.type="linear");var x=v+"calendar",w=y[x],k={noMultiCategory:!r(y,"cartesian")||r(y,"noMultiCategory")};if(y.type==="box"&&y._hasPreCompStats&&v==={h:"x",v:"y"}[y.orientation||"v"]&&(k.noMultiCategory=!0),k.autotypenumbers=h.autotypenumbers,c(y,v)){var b=u(y),T=[];for(g=0;g0?".":"")+g;a.isPlainObject(p)?s(p,d,v,m+1):d(v,g,p)}})}f.manageCommandObserver=function(l,d,h,m){var g={},p=!0;d&&d._commandObserver&&(g=d._commandObserver),g.cache||(g.cache={}),g.lookupTable={};var v=f.hasSimpleAPICommandBindings(l,h,g.lookupTable);if(d&&d._commandObserver){if(v)return g;if(d._commandObserver.remove)return d._commandObserver.remove(),d._commandObserver=null,g}if(v){u(l,v,g.cache),g.check=function(){if(p){var w=u(l,v,g.cache);return w.changed&&m&&g.lookupTable[w.value]!==void 0&&(g.disable(),Promise.resolve(m({value:w.value,type:v.type,prop:v.prop,traces:v.traces,index:g.lookupTable[w.value]})).then(g.enable,g.enable)),w.changed}};for(var y=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],x=0;x0&&N<0&&(N+=360);var W=(N-P)/4;return{type:"Polygon",coordinates:[[[P,B],[P,G],[P+W,G],[P+2*W,G],[P+3*W,G],[N,G],[N,B],[N-W,B],[N-2*W,B],[N-3*W,B],[P,B]]]}}o.exports=function(R){return new E(R)},D.plot=function(R,z,L){var P=this,N=z[this.id],B=[],G=!1;for(var W in _.layerNameToAdjective)if(W!=="frame"&&N["show"+W]){G=!0;break}for(var K=0;K0&&B._module.calcGeoJSON(N,z)}if(!this.updateProjection(R,z)){this.viewInitial&&this.scope===L.scope||this.saveViewInitial(L),this.scope=L.scope,this.updateBaseLayers(z,L),this.updateDims(z,L),this.updateFx(z,L),p.generalUpdatePerTraceModule(this.graphDiv,this,R,L);var G=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=G.selectAll(".point"),this.dataPoints.text=G.selectAll("text"),this.dataPaths.line=G.selectAll(".js-line");var W=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=W.selectAll("path"),this.render()}},D.updateProjection=function(R,z){var L=this.graphDiv,P=z[this.id],N=z._size,B=P.domain,G=P.projection,W=P.lonaxis,K=P.lataxis,te=W._ax,Y=K._ax,Z=this.projection=function(de){var ye=de.projection,Me=ye.type,ke=_.projNames[Me];ke="geo"+l.titleCase(ke);for(var Ee=(a[ke]||i[ke])(),ze=de._isSatellite?180*Math.acos(1/ye.distance)/Math.PI:de._isClipped?_.lonaxisSpan[Me]/2:null,Fe=["center","rotate","parallels","clipExtent"],Ve=function(qe){return qe?Ee:[]},Ke=0;Keze*Math.PI/180}return!1},Ee.getPath=function(){return u().projection(Ee)},Ee.getBounds=function(qe){return Ee.getPath().bounds(qe)},Ee.precision(_.precision),de._isSatellite&&Ee.tilt(ye.tilt).distance(ye.distance),ze&&Ee.clipAngle(ze-_.clipPad),Ee}(P),re=[[N.l+N.w*B.x[0],N.t+N.h*(1-B.y[1])],[N.l+N.w*B.x[1],N.t+N.h*(1-B.y[0])]],U=P.center||{},q=G.rotation||{},$=W.range||[],ne=K.range||[];if(P.fitbounds){te._length=re[1][0]-re[0][0],Y._length=re[1][1]-re[0][1],te.range=y(L,te),Y.range=y(L,Y);var H=(te.range[0]+te.range[1])/2,Q=(Y.range[0]+Y.range[1])/2;if(P._isScoped)U={lon:H,lat:Q};else if(P._isClipped){U={lon:H,lat:Q},q={lon:H,lat:Q,roll:q.roll};var ee=G.type,ie=_.lonaxisSpan[ee]/2||180,ae=_.lataxisSpan[ee]/2||90;$=[H-ie,H+ie],ne=[Q-ae,Q+ae]}else U={lon:H,lat:Q},q={lon:H,lat:q.lat,roll:q.roll}}Z.center([U.lon-q.lon,U.lat-q.lat]).rotate([-q.lon,-q.lat,q.roll]).parallels(G.parallels);var ue=O($,ne);Z.fitExtent(re,ue);var le=this.bounds=Z.getBounds(ue),ge=this.fitScale=Z.scale(),fe=Z.translate();if(P.fitbounds){var me=Z.getBounds(O(te.range,Y.range)),_e=Math.min((le[1][0]-le[0][0])/(me[1][0]-me[0][0]),(le[1][1]-le[0][1])/(me[1][1]-me[0][1]));isFinite(_e)?Z.scale(_e*ge):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else Z.scale(G.scale*ge);var we=this.midPt=[(le[0][0]+le[1][0])/2,(le[0][1]+le[1][1])/2];if(Z.translate([fe[0]+(we[0]-fe[0]),fe[1]+(we[1]-fe[1])]).clipExtent(le),P._isAlbersUsa){var Te=Z([U.lon,U.lat]),Oe=Z.translate();Z.translate([Oe[0]-(Te[0]-Oe[0]),Oe[1]-(Te[1]-Oe[1])])}},D.updateBaseLayers=function(R,z){var L=this,P=L.topojson,N=L.layers,B=L.basePaths;function G(Z){return Z==="lonaxis"||Z==="lataxis"}function W(Z){return Boolean(_.lineLayers[Z])}function K(Z){return Boolean(_.fillLayers[Z])}var te=(this.hasChoropleth?_.layersForChoropleth:_.layers).filter(function(Z){return W(Z)||K(Z)?z["show"+Z]:!G(Z)||z[Z].showgrid}),Y=L.framework.selectAll(".layer").data(te,String);Y.exit().each(function(Z){delete N[Z],delete B[Z],r.select(this).remove()}),Y.enter().append("g").attr("class",function(Z){return"layer "+Z}).each(function(Z){var re=N[Z]=r.select(this);Z==="bg"?L.bgRect=re.append("rect").style("pointer-events","all"):G(Z)?B[Z]=re.append("path").style("fill","none"):Z==="backplot"?re.append("g").classed("choroplethlayer",!0):Z==="frontplot"?re.append("g").classed("scatterlayer",!0):W(Z)?B[Z]=re.append("path").style("fill","none").style("stroke-miterlimit",2):K(Z)&&(B[Z]=re.append("path").style("stroke","none"))}),Y.order(),Y.each(function(Z){var re=B[Z],U=_.layerNameToAdjective[Z];Z==="frame"?re.datum(_.sphereSVG):W(Z)||K(Z)?re.datum(S(P,P.objects[Z])):G(Z)&&re.datum(function(q,$,ne){var H,Q,ee,ie=$[q],ae=_.scopeDefaults[$.scope];q==="lonaxis"?(H=ae.lonaxisRange,Q=ae.lataxisRange,ee=function(Oe,de){return[Oe,de]}):q==="lataxis"&&(H=ae.lataxisRange,Q=ae.lonaxisRange,ee=function(Oe,de){return[de,Oe]});var ue={type:"linear",range:[H[0],H[1]-1e-6],tick0:ie.tick0,dtick:ie.dtick};v.setConvert(ue,ne);var le=v.calcTicks(ue);$.isScoped||q!=="lonaxis"||le.pop();for(var ge=le.length,fe=new Array(ge),me=0;me-1&&b(r.event,P,[L.xaxis],[L.yaxis],L.id,K),G.indexOf("event")>-1&&g.click(P,r.event))})}function te(Y){return L.projection.invert([Y[0]+L.xaxis._offset,Y[1]+L.yaxis._offset])}},D.makeFramework=function(){var R=this,z=R.graphDiv,L=z._fullLayout,P="clip"+L._uid+R.id;R.clipDef=L._clips.append("clipPath").attr("id",P),R.clipRect=R.clipDef.append("rect"),R.framework=r.select(R.container).append("g").attr("class","geo "+R.id).call(m.setClipUrl,P,z),R.project=function(N){var B=R.projection(N);return B?[B[0]-R.xaxis._offset,B[1]-R.yaxis._offset]:[null,null]},R.xaxis={_id:"x",c2p:function(N){return R.project(N)[0]}},R.yaxis={_id:"y",c2p:function(N){return R.project(N)[1]}},R.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},v.setConvert(R.mockAxis,L)},D.saveViewInitial=function(R){var z,L=R.center||{},P=R.projection,N=P.rotation||{};this.viewInitial={fitbounds:R.fitbounds,"projection.scale":P.scale},z=R._isScoped?{"center.lon":L.lon,"center.lat":L.lat}:R._isClipped?{"projection.rotation.lon":N.lon,"projection.rotation.lat":N.lat}:{"center.lon":L.lon,"center.lat":L.lat,"projection.rotation.lon":N.lon},l.extendFlat(this.viewInitial,z)},D.render=function(){var R,z=this.projection,L=z.getPath();function P(B){var G=z(B.lonlat);return G?d(G[0],G[1]):null}function N(B){return z.isLonLatOverEdges(B.lonlat)?"none":null}for(R in this.basePaths)this.basePaths[R].attr("d",L);for(R in this.dataPaths)this.dataPaths[R].attr("d",function(B){return L(B.geojson)});for(R in this.dataPoints)this.dataPoints[R].attr("display",N).attr("transform",P)}},{"../../components/color":366,"../../components/dragelement":385,"../../components/drawing":388,"../../components/fx":406,"../../lib":503,"../../lib/geo_location_utils":496,"../../lib/topojson_utils":532,"../../registry":638,"../cartesian/autorange":553,"../cartesian/axes":554,"../cartesian/select":575,"../plots":619,"./constants":587,"./zoom":592,"@plotly/d3":58,"d3-geo":114,"d3-geo-projection":113,"topojson-client":315}],589:[function(e,o,f){var r=e("../../plots/get_data").getSubplotCalcData,a=e("../../lib").counterRegex,u=e("./geo"),c="geo",i=a(c),s={};s.geo={valType:"subplotid",dflt:c,editType:"calc"},o.exports={attr:c,name:c,idRoot:c,idRegex:i,attrRegex:i,attributes:s,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(l){for(var d=l._fullLayout,h=l.calcdata,m=d._subplots.geo,g=0;g0&&K<0&&(K+=360);var te,Y,Z,re=(W+K)/2;if(!k){var U=b?x.projRotate:[re,0,0];te=m("projection.rotation.lon",U[0]),m("projection.rotation.lat",U[1]),m("projection.rotation.roll",U[2]),m("showcoastlines",!b&&S)&&(m("coastlinecolor"),m("coastlinewidth")),m("showocean",!!S&&void 0)&&m("oceancolor")}k?(Y=-96.6,Z=38.7):(Y=b?re:te,Z=(G[0]+G[1])/2),m("center.lon",Y),m("center.lat",Z),T&&(m("projection.tilt"),m("projection.distance")),_&&m("projection.parallels",x.projParallels||[0,60]),m("projection.scale"),m("showland",!!S&&void 0)&&m("landcolor"),m("showlakes",!!S&&void 0)&&m("lakecolor"),m("showrivers",!!S&&void 0)&&(m("rivercolor"),m("riverwidth")),m("showcountries",b&&y!=="usa"&&S)&&(m("countrycolor"),m("countrywidth")),(y==="usa"||y==="north america"&&v===50)&&(m("showsubunits",S),m("subunitcolor"),m("subunitwidth")),b||m("showframe",S)&&(m("framecolor"),m("framewidth")),m("bgcolor"),m("fitbounds")&&(delete h.projection.scale,b?(delete h.center.lon,delete h.center.lat):M?(delete h.center.lon,delete h.center.lat,delete h.projection.rotation.lon,delete h.projection.rotation.lat,delete h.lonaxis.range,delete h.lataxis.range):(delete h.center.lon,delete h.center.lat,delete h.projection.rotation.lon))}o.exports=function(d,h,m){a(d,h,m,{type:"geo",attributes:i,handleDefaults:l,fullData:m,partition:"y"})}},{"../../lib":503,"../get_data":593,"../subplot_defaults":632,"./constants":587,"./layout_attributes":590}],592:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=e("../../registry"),c=Math.PI/180,i=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function d(S,E){return r.behavior.zoom().translate(E.translate()).scale(E.scale())}function h(S,E,D){var O=S.id,R=S.graphDiv,z=R.layout,L=z[O],P=R._fullLayout,N=P[O],B={},G={};function W(K,te){B[O+"."+K]=a.nestedProperty(L,K).get(),u.call("_storeDirectGUIEdit",z,P._preGUI,B);var Y=a.nestedProperty(N,K);Y.get()!==te&&(Y.set(te),a.nestedProperty(L,K).set(te),G[O+"."+K]=te)}D(W),W("projection.scale",E.scale()/S.fitScale),W("fitbounds",!1),R.emit("plotly_relayout",G)}function m(S,E){var D=d(0,E);function O(R){var z=E.invert(S.midPt);R("center.lon",z[0]),R("center.lat",z[1])}return D.on("zoomstart",function(){r.select(this).style(s)}).on("zoom",function(){E.scale(r.event.scale).translate(r.event.translate),S.render();var R=E.invert(S.midPt);S.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":E.scale()/S.fitScale,"geo.center.lon":R[0],"geo.center.lat":R[1]})}).on("zoomend",function(){r.select(this).style(l),h(S,E,O)}),D}function g(S,E){var D,O,R,z,L,P,N,B,G,W=d(0,E);function K(Y){return E.invert(Y)}function te(Y){var Z=E.rotate(),re=E.invert(S.midPt);Y("projection.rotation.lon",-Z[0]),Y("center.lon",re[0]),Y("center.lat",re[1])}return W.on("zoomstart",function(){r.select(this).style(s),D=r.mouse(this),O=E.rotate(),R=E.translate(),z=O,L=K(D)}).on("zoom",function(){if(P=r.mouse(this),function(re){var U=K(re);if(!U)return!0;var q=E(U);return Math.abs(q[0]-re[0])>2||Math.abs(q[1]-re[1])>2}(D))return W.scale(E.scale()),void W.translate(E.translate());E.scale(r.event.scale),E.translate([R[0],r.event.translate[1]]),L?K(P)&&(B=K(P),N=[z[0]+(B[0]-L[0]),O[1],O[2]],E.rotate(N),z=N):L=K(D=P),G=!0,S.render();var Y=E.rotate(),Z=E.invert(S.midPt);S.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":E.scale()/S.fitScale,"geo.center.lon":Z[0],"geo.center.lat":Z[1],"geo.projection.rotation.lon":-Y[0]})}).on("zoomend",function(){r.select(this).style(l),G&&h(S,E,te)}),W}function p(S,E){var D,O={r:E.rotate(),k:E.scale()},R=d(0,E),z=function(K){for(var te=0,Y=arguments.length,Z=[];++tete?(z=(G>0?90:-90)-K,R=0):(z=Math.asin(G/te)*i-K,R=Math.sqrt(te*te-G*G));var Y=180-z-2*K,Z=(Math.atan2(W,B)-Math.atan2(N,R))*i,re=(Math.atan2(W,B)-Math.atan2(N,-R))*i;return b(D[0],D[1],z,Z)<=b(D[0],D[1],Y,re)?[z,Z,D[2]]:[Y,re,D[2]]}function b(S,E,D,O){var R=T(D-S),z=T(O-E);return Math.sqrt(R*R+z*z)}function T(S){return(S%360+540)%360-180}function _(S,E,D){var O=D*c,R=S.slice(),z=E===0?1:0,L=E===2?1:2,P=Math.cos(O),N=Math.sin(O);return R[z]=S[z]*P-S[L]*N,R[L]=S[L]*P+S[z]*N,R}function M(S){return[Math.atan2(2*(S[0]*S[1]+S[2]*S[3]),1-2*(S[1]*S[1]+S[2]*S[2]))*i,Math.asin(Math.max(-1,Math.min(1,2*(S[0]*S[2]-S[3]*S[1]))))*i,Math.atan2(2*(S[0]*S[3]+S[1]*S[2]),1-2*(S[2]*S[2]+S[3]*S[3]))*i]}function A(S,E){for(var D=0,O=0,R=S.length;OMath.abs(k)?(m.boxEnd[1]=m.boxStart[1]+Math.abs(w)*L*(k>=0?1:-1),m.boxEnd[1]b[3]&&(m.boxEnd[1]=b[3],m.boxEnd[0]=m.boxStart[0]+(b[3]-m.boxStart[1])/Math.abs(L))):(m.boxEnd[0]=m.boxStart[0]+Math.abs(k)/L*(w>=0?1:-1),m.boxEnd[0]b[2]&&(m.boxEnd[0]=b[2],m.boxEnd[1]=m.boxStart[1]+(b[2]-m.boxStart[0])*Math.abs(L)))}}else m.boxEnabled?(w=m.boxStart[0]!==m.boxEnd[0],k=m.boxStart[1]!==m.boxEnd[1],w||k?(w&&(E(0,m.boxStart[0],m.boxEnd[0]),l.xaxis.autorange=!1),k&&(E(1,m.boxStart[1],m.boxEnd[1]),l.yaxis.autorange=!1),l.relayoutCallback()):l.glplot.setDirty(),m.boxEnabled=!1,m.boxInited=!1):m.boxInited&&(m.boxInited=!1);break;case"pan":m.boxEnabled=!1,m.boxInited=!1,v?(m.panning||(m.dragStart[0]=y,m.dragStart[1]=x),Math.abs(m.dragStart[0]-y).999&&(_="turntable"):_="turntable")}else _="turntable";g("dragmode",_),g("hovermode",p.getDfltFromLayout("hovermode"))}o.exports=function(h,m,g){var p=m._basePlotModules.length>1;c(h,m,g,{type:"gl3d",attributes:s,handleDefaults:d,fullLayout:m,font:m.font,fullData:g,getDfltFromLayout:function(v){if(!p)return r.validate(h[v],s[v])?h[v]:void 0},autotypenumbersDflt:m.autotypenumbers,paper_bgcolor:m.paper_bgcolor,calendar:m.calendar})}},{"../../../components/color":366,"../../../lib":503,"../../../registry":638,"../../get_data":593,"../../subplot_defaults":632,"./axis_defaults":601,"./layout_attributes":604}],604:[function(e,o,f){var r=e("./axis_attributes"),a=e("../../domain").attributes,u=e("../../../lib/extend").extendFlat,c=e("../../../lib").counterRegex;function i(s,l,d){return{x:{valType:"number",dflt:s,editType:"camera"},y:{valType:"number",dflt:l,editType:"camera"},z:{valType:"number",dflt:d,editType:"camera"},editType:"camera"}}o.exports={_arrayAttrRegexps:[c("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:u(i(0,0,1),{}),center:u(i(0,0,0),{}),eye:u(i(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:a({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:r,yaxis:r,zaxis:r,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"}}}},{"../../../lib":503,"../../../lib/extend":493,"../../domain":584,"./axis_attributes":600}],605:[function(e,o,f){var r=e("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];function u(){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]}u.prototype.merge=function(c){for(var i=0;i<3;++i){var s=c[a[i]];s.visible?(this.enabled[i]=s.showspikes,this.colors[i]=r(s.spikecolor),this.drawSides[i]=s.spikesides,this.lineWidth[i]=s.spikethickness):(this.enabled[i]=!1,this.drawSides[i]=!1)}},o.exports=function(c){var i=new u;return i.merge(c),i}},{"../../../lib/str2rgbarray":528}],606:[function(e,o,f){o.exports=function(i){for(var s=i.axesOptions,l=i.glplot.axesPixels,d=i.fullSceneLayout,h=[[],[],[]],m=0;m<3;++m){var g=d[u[m]];if(g._length=(l[m].hi-l[m].lo)*l[m].pixelsPerDataUnit/i.dataScale[m],Math.abs(g._length)===1/0||isNaN(g._length))h[m]=[];else{g._input_range=g.range.slice(),g.range[0]=l[m].lo/i.dataScale[m],g.range[1]=l[m].hi/i.dataScale[m],g._m=1/(i.dataScale[m]*l[m].pixelsPerDataUnit),g.range[0]===g.range[1]&&(g.range[0]-=1,g.range[1]+=1);var p=g.tickmode;if(g.tickmode==="auto"){g.tickmode="linear";var v=g.nticks||a.constrain(g._length/40,4,9);r.autoTicks(g,Math.abs(g.range[1]-g.range[0])/v)}for(var y=r.calcTicks(g,{msUTC:!0}),x=0;x/g," "));h[m]=y,g.tickmode=p}}for(s.ticks=h,m=0;m<3;++m)for(c[m]=.5*(i.glplot.bounds[0][m]+i.glplot.bounds[1][m]),x=0;x<2;++x)s.bounds[x][m]=i.glplot.bounds[x][m];i.contourLevels=function(w){for(var k=new Array(3),b=0;b<3;++b){for(var T=w[b],_=new Array(T.length),M=0;ML.deltaY?1.1:.9090909090909091,N=E.glplot.getAspectratio();E.glplot.setAspectratio({x:P*N.x,y:P*N.y,z:P*N.z})}z(E)}},!!l&&{passive:!1}),E.glplot.canvas.addEventListener("mousemove",function(){if(E.fullSceneLayout.dragmode!==!1&&E.camera.mouseListener.buttons!==0){var L=R();E.graphDiv.emit("plotly_relayouting",L)}}),E.staticMode||E.glplot.canvas.addEventListener("webglcontextlost",function(L){D&&D.emit&&D.emit("plotly_webglcontextlost",{event:L,layer:E.id})},!1)),E.glplot.oncontextloss=function(){E.recoverContext()},E.glplot.onrender=function(){E.render()},!0},_.render=function(){var E,D=this,O=D.graphDiv,R=D.svgContainer,z=D.container.getBoundingClientRect();O._fullLayout._calcInverseTransform(O);var L=O._fullLayout._invScaleX,P=O._fullLayout._invScaleY,N=z.width*L,B=z.height*P;R.setAttributeNS(null,"viewBox","0 0 "+N+" "+B),R.setAttributeNS(null,"width",N),R.setAttributeNS(null,"height",B),b(D),D.glplot.axes.update(D.axesOptions);for(var G=Object.keys(D.traces),W=null,K=D.glplot.selection,te=0;te")):E.type==="isosurface"||E.type==="volume"?($.valueLabel=g.hoverLabelText(D._mockAxis,D._mockAxis.d2l(K.traceCoordinate[3]),E.valuehoverformat),ee.push("value: "+$.valueLabel),K.textLabel&&ee.push(K.textLabel),re=ee.join("
")):re=K.textLabel;var ie={x:K.traceCoordinate[0],y:K.traceCoordinate[1],z:K.traceCoordinate[2],data:U._input,fullData:U,curveNumber:U.index,pointNumber:q};p.appendArrayPointValue(ie,U,q),E._module.eventData&&(ie=U._module.eventData(ie,K,U,{},q));var ae={points:[ie]};if(D.fullSceneLayout.hovermode){var ue=[];p.loneHover({trace:U,x:(.5+.5*Z[0]/Z[3])*N,y:(.5-.5*Z[1]/Z[3])*B,xLabel:$.xLabel,yLabel:$.yLabel,zLabel:$.zLabel,text:re,name:W.name,color:p.castHoverOption(U,q,"bgcolor")||W.color,borderColor:p.castHoverOption(U,q,"bordercolor"),fontFamily:p.castHoverOption(U,q,"font.family"),fontSize:p.castHoverOption(U,q,"font.size"),fontColor:p.castHoverOption(U,q,"font.color"),nameLength:p.castHoverOption(U,q,"namelength"),textAlign:p.castHoverOption(U,q,"align"),hovertemplate:h.castOption(U,q,"hovertemplate"),hovertemplateLabels:h.extendFlat({},ie,$),eventData:[ie]},{container:R,gd:O,inOut_bbox:ue}),ie.bbox=ue[0]}K.buttons&&K.distance<5?O.emit("plotly_click",ae):O.emit("plotly_hover",ae),this.oldEventData=ae}else p.loneUnhover(R),this.oldEventData&&O.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;D.drawAnnotations(D)},_.recoverContext=function(){var E=this;E.glplot.dispose();var D=function(){E.glplot.gl.isContextLost()?requestAnimationFrame(D):E.initializeGLPlot()?E.plot.apply(E,E.plotArgs):h.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(D)};var A=["xaxis","yaxis","zaxis"];function S(E,D,O){for(var R=E.fullSceneLayout,z=0;z<3;z++){var L=A[z],P=L.charAt(0),N=R[L],B=D[P],G=D[P+"calendar"],W=D["_"+P+"length"];if(h.isArrayOrTypedArray(B))for(var K,te=0;te<(W||B.length);te++)if(h.isArrayOrTypedArray(B[te]))for(var Y=0;Yre[1][L])re[0][L]=-1,re[1][L]=1;else{var le=re[1][L]-re[0][L];re[0][L]-=le/32,re[1][L]+=le/32}if(N.autorange==="reversed"){var ge=re[0][L];re[0][L]=re[1][L],re[1][L]=ge}}else{var fe=N.range;re[0][L]=N.r2l(fe[0]),re[1][L]=N.r2l(fe[1])}re[0][L]===re[1][L]&&(re[0][L]-=1,re[1][L]+=1),U[L]=re[1][L]-re[0][L],this.glplot.setBounds(L,{min:re[0][L]*te[L],max:re[1][L]*te[L]})}var me=G.aspectmode;if(me==="cube")Z=[1,1,1];else if(me==="manual"){var _e=G.aspectratio;Z=[_e.x,_e.y,_e.z]}else{if(me!=="auto"&&me!=="data")throw new Error("scene.js aspectRatio was not one of the enumerated types");var we=[1,1,1];for(L=0;L<3;++L){var Te=q[B=(N=G[A[L]]).type];we[L]=Math.pow(Te.acc,1/Te.count)/te[L]}Z=me==="data"||Math.max.apply(null,we)/Math.min.apply(null,we)<=4?we:[1,1,1]}G.aspectratio.x=W.aspectratio.x=Z[0],G.aspectratio.y=W.aspectratio.y=Z[1],G.aspectratio.z=W.aspectratio.z=Z[2],this.glplot.setAspectratio(G.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:G.aspectratio.x,y:G.aspectratio.y,z:G.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=G.aspectmode);var Oe=G.domain||null,de=D._size||null;if(Oe&&de){var ye=this.container.style;ye.position="absolute",ye.left=de.l+Oe.x[0]*de.w+"px",ye.top=de.t+(1-Oe.y[1])*de.h+"px",ye.width=de.w*(Oe.x[1]-Oe.x[0])+"px",ye.height=de.h*(Oe.y[1]-Oe.y[0])+"px"}this.glplot.redraw()}},_.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},_.getCamera=function(){var E;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(E=this.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:E._ortho===!0?"orthographic":"perspective"}}},_.setViewport=function(E){var D,O=E.camera;this.camera.lookAt.apply(this,[[(D=O).eye.x,D.eye.y,D.eye.z],[D.center.x,D.center.y,D.center.z],[D.up.x,D.up.y,D.up.z]]),this.glplot.setAspectratio(E.aspectratio),O.projection.type==="orthographic"!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},_.isCameraChanged=function(E){var D=this.getCamera(),O=h.nestedProperty(E,this.id+".camera").get();function R(N,B,G,W){var K=["up","center","eye"],te=["x","y","z"];return B[K[G]]&&N[K[G]][te[W]]===B[K[G]][te[W]]}var z=!1;if(O===void 0)z=!0;else{for(var L=0;L<3;L++)for(var P=0;P<3;P++)if(!R(D,O,L,P)){z=!0;break}(!O.projection||D.projection&&D.projection.type!==O.projection.type)&&(z=!0)}return z},_.isAspectChanged=function(E){var D=this.glplot.getAspectratio(),O=h.nestedProperty(E,this.id+".aspectratio").get();return O===void 0||O.x!==D.x||O.y!==D.y||O.z!==D.z},_.saveLayout=function(E){var D,O,R,z,L,P,N=this.fullLayout,B=this.isCameraChanged(E),G=this.isAspectChanged(E),W=B||G;if(W){var K={};B&&(D=this.getCamera(),R=(O=h.nestedProperty(E,this.id+".camera")).get(),K[this.id+".camera"]=R),G&&(z=this.glplot.getAspectratio(),P=(L=h.nestedProperty(E,this.id+".aspectratio")).get(),K[this.id+".aspectratio"]=P),d.call("_storeDirectGUIEdit",E,N._preGUI,K),B&&(O.set(D),h.nestedProperty(N,this.id+".camera").set(D)),G&&(L.set(z),h.nestedProperty(N,this.id+".aspectratio").set(z),this.glplot.redraw())}return W},_.updateFx=function(E,D){var O=this.camera;if(O)if(E==="orbit")O.mode="orbit",O.keyBindingMode="rotate";else if(E==="turntable"){O.up=[0,0,1],O.mode="turntable",O.keyBindingMode="rotate";var R=this.graphDiv,z=R._fullLayout,L=this.fullSceneLayout.camera,P=L.up.x,N=L.up.y,B=L.up.z;if(B/Math.sqrt(P*P+N*N+B*B)<.999){var G=this.id+".camera.up",W={x:0,y:0,z:1},K={};K[G]=W;var te=R.layout;d.call("_storeDirectGUIEdit",te,z._preGUI,K),L.up=W,h.nestedProperty(te,G).set(W)}}else O.keyBindingMode=E;this.fullSceneLayout.hovermode=D},_.toImage=function(E){E||(E="png"),this.staticMode&&this.container.appendChild(r),this.glplot.redraw();var D=this.glplot.gl,O=D.drawingBufferWidth,R=D.drawingBufferHeight;D.bindFramebuffer(D.FRAMEBUFFER,null);var z=new Uint8Array(O*R*4);D.readPixels(0,0,O,R,D.RGBA,D.UNSIGNED_BYTE,z),function(G,W,K){for(var te=0,Y=K-1;te0)for(var U=255/re,q=0;q<3;++q)G[Z+q]=Math.min(U*G[Z+q],255)}}(z,O,R);var L=document.createElement("canvas");L.width=O,L.height=R;var P,N=L.getContext("2d"),B=N.createImageData(O,R);switch(B.data.set(z),N.putImageData(B,0,0),E){case"jpeg":P=L.toDataURL("image/jpeg");break;case"webp":P=L.toDataURL("image/webp");break;default:P=L.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(r),P},_.setConvert=function(){for(var E=0;E<3;E++){var D=this.fullSceneLayout[A[E]];g.setConvert(D,this.fullLayout),D.setScale=h.noop}},_.make4thDimension=function(){var E=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},g.setConvert(this._mockAxis,E)},o.exports=T},{"../../../stackgl_modules":1124,"../../components/fx":406,"../../lib":503,"../../lib/show_no_webgl_msg":525,"../../lib/str2rgbarray":528,"../../plots/cartesian/axes":554,"../../registry":638,"./layout/convert":602,"./layout/spikes":605,"./layout/tick_marks":606,"./project":607,"has-passive-events":229,"webgl-context":331}],609:[function(e,o,f){o.exports=function(r,a,u,c){c=c||r.length;for(var i=new Array(c),s=0;sOpenStreetMap contributors',u=['\xA9 Carto',a].join(" "),c=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),i={"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}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:u,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}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:u,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}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:c,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:c,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"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://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},s=r(i);o.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:i,styleValuesNonMapbox:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join(` +`),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(` +`),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",s.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` +`),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(` +`),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')`}}},{"../../lib/sort_object_keys":526}],612:[function(e,o,f){var r=e("../../lib");o.exports=function(a,u){var c=a.split(" "),i=c[0],s=c[1],l=r.isArrayOrTypedArray(u)?r.mean(u):u,d=.5+l/100,h=1.5+l/100,m=["",""],g=[0,0];switch(i){case"top":m[0]="top",g[1]=-h;break;case"bottom":m[0]="bottom",g[1]=h}switch(s){case"left":m[1]="right",g[0]=-d;break;case"right":m[1]="left",g[0]=d}return{anchor:m[0]&&m[1]?m.join("-"):m[0]?m[0]:m[1]?m[1]:"center",offset:g}}},{"../../lib":503}],613:[function(e,o,f){var r=e("mapbox-gl/dist/mapbox-gl-unminified"),a=e("../../lib"),u=a.strTranslate,c=a.strScale,i=e("../../plots/get_data").getSubplotCalcData,s=e("../../constants/xmlns_namespaces"),l=e("@plotly/d3"),d=e("../../components/drawing"),h=e("../../lib/svg_text_utils"),m=e("./mapbox"),g=f.constants=e("./constants");function p(v){return typeof v=="string"&&(g.styleValuesMapbox.indexOf(v)!==-1||v.indexOf("mapbox://")===0)}f.name="mapbox",f.attr="subplot",f.idRoot="mapbox",f.idRegex=f.attrRegex=a.counterRegex("mapbox"),f.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},f.layoutAttributes=e("./layout_attributes"),f.supplyLayoutDefaults=e("./layout_defaults"),f.plot=function(v){var y=v._fullLayout,x=v.calcdata,w=y._subplots.mapbox;if(r.version!==g.requiredVersion)throw new Error(g.wrongVersionErrorMsg);var k=function(S,E){var D=S._fullLayout;if(S._context.mapboxAccessToken==="")return"";for(var O=[],R=[],z=!1,L=!1,P=0;P1&&a.warn(g.multipleTokensErrorMsg),O[0]):(R.length&&a.log(["Listed mapbox access token(s)",R.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(v,w);r.accessToken=k;for(var b=0;bR/2){var z=S.split("|").join("
");D.text(z).attr("data-unformatted",z).call(h.convertToTspans,v),O=d.bBox(D.node())}D.attr("transform",u(-3,8-O.height)),E.insert("rect",".static-attribution").attr({x:-O.width-6,y:-O.height-3,width:O.width+6,height:O.height+3,fill:"rgba(255, 255, 255, 0.75)"});var L=1;O.width+6>R&&(L=R/(O.width+6));var P=[w.l+w.w*T.x[1],w.t+w.h*(1-T.y[0])];E.attr("transform",u(P[0],P[1])+c(L))}},f.updateFx=function(v){for(var y=v._fullLayout,x=y._subplots.mapbox,w=0;w0){for(var g=0;g0}function d(h){var m={},g={};switch(h.type){case"circle":r.extendFlat(g,{"circle-radius":h.circle.radius,"circle-color":h.color,"circle-opacity":h.opacity});break;case"line":r.extendFlat(g,{"line-width":h.line.width,"line-color":h.color,"line-opacity":h.opacity,"line-dasharray":h.line.dash});break;case"fill":r.extendFlat(g,{"fill-color":h.color,"fill-outline-color":h.fill.outlinecolor,"fill-opacity":h.opacity});break;case"symbol":var p=h.symbol,v=u(p.textposition,p.iconsize);r.extendFlat(m,{"icon-image":p.icon+"-15","icon-size":p.iconsize/10,"text-field":p.text,"text-size":p.textfont.size,"text-anchor":v.anchor,"text-offset":v.offset,"symbol-placement":p.placement}),r.extendFlat(g,{"icon-color":h.color,"text-color":p.textfont.color,"text-opacity":h.opacity});break;case"raster":r.extendFlat(g,{"raster-fade-duration":0,"raster-opacity":h.opacity})}return{layout:m,paint:g}}s.update=function(h){this.visible?this.needsNewImage(h)?this.updateImage(h):this.needsNewSource(h)?(this.removeLayer(),this.updateSource(h),this.updateLayer(h)):this.needsNewLayer(h)?this.updateLayer(h):this.updateStyle(h):(this.updateSource(h),this.updateLayer(h)),this.visible=l(h)},s.needsNewImage=function(h){return this.subplot.map.getSource(this.idSource)&&this.sourceType==="image"&&h.sourcetype==="image"&&(this.source!==h.source||JSON.stringify(this.coordinates)!==JSON.stringify(h.coordinates))},s.needsNewSource=function(h){return this.sourceType!==h.sourcetype||JSON.stringify(this.source)!==JSON.stringify(h.source)||this.layerType!==h.type},s.needsNewLayer=function(h){return this.layerType!==h.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(h){this.subplot.map.getSource(this.idSource).updateImage({url:h.source,coordinates:h.coordinates});var m=this.findFollowingMapboxLayerId(this.lookupBelow());m!==null&&this.subplot.map.moveLayer(this.idLayer,m)},s.updateSource=function(h){var m=this.subplot.map;if(m.getSource(this.idSource)&&m.removeSource(this.idSource),this.sourceType=h.sourcetype,this.source=h.source,l(h)){var g=function(p){var v,y=p.sourcetype,x=p.source,w={type:y};return y==="geojson"?v="data":y==="vector"?v=typeof x=="string"?"url":"tiles":y==="raster"?(v="tiles",w.tileSize=256):y==="image"&&(v="url",w.coordinates=p.coordinates),w[v]=x,p.sourceattribution&&(w.attribution=a(p.sourceattribution)),w}(h);m.addSource(this.idSource,g)}},s.findFollowingMapboxLayerId=function(h){if(h==="traces")for(var m=this.subplot.getMapLayers(),g=0;g1)for(O=0;O-1&&x(B.originalEvent,R,[O.xaxis],[O.yaxis],O.id,N),G.indexOf("event")>-1&&l.click(R,B.originalEvent)}}},T.updateFx=function(E){var D=this,O=D.map,R=D.gd;if(!D.isStatic){var z,L=E.dragmode;z=h(L)?function(B,G){(B.range={})[D.id]=[N([G.xmin,G.ymin]),N([G.xmax,G.ymax])]}:function(B,G,W){(B.lassoPoints={})[D.id]=W.filtered.map(N)};var P=D.dragOptions;D.dragOptions=a.extendDeep(P||{},{dragmode:E.dragmode,element:D.div,gd:R,plotinfo:{id:D.id,domain:E[D.id].domain,xaxis:D.xaxis,yaxis:D.yaxis,fillRangeItems:z},xaxes:[D.xaxis],yaxes:[D.yaxis],subplot:D.id}),O.off("click",D.onClickInPanHandler),g(L)||m(L)?(O.dragPan.disable(),O.on("zoomstart",D.clearSelect),D.dragOptions.prepFn=function(B,G,W){p(B,G,W,D.dragOptions,L)},s.init(D.dragOptions)):(O.dragPan.enable(),O.off("zoomstart",D.clearSelect),D.div.onmousedown=null,D.onClickInPanHandler=D.onClickInPanFn(D.dragOptions),O.on("click",D.onClickInPanHandler))}function N(B){var G=D.map.unproject(B);return[G.lng,G.lat]}},T.updateFramework=function(E){var D=E[this.id].domain,O=E._size,R=this.div.style;R.width=O.w*(D.x[1]-D.x[0])+"px",R.height=O.h*(D.y[1]-D.y[0])+"px",R.left=O.l+D.x[0]*O.w+"px",R.top=O.t+(1-D.y[1])*O.h+"px",this.xaxis._offset=O.l+D.x[0]*O.w,this.xaxis._length=O.w*(D.x[1]-D.x[0]),this.yaxis._offset=O.t+(1-D.y[1])*O.h,this.yaxis._length=O.h*(D.y[1]-D.y[0])},T.updateLayers=function(E){var D,O=E[this.id].layers,R=this.layerList;if(O.length!==R.length){for(D=0;D=K.width-20?(Z["text-anchor"]="start",Z.x=5):(Z["text-anchor"]="end",Z.x=K._paper.attr("width")-7),te.attr(Z);var re=te.select(".js-link-to-tool"),U=te.select(".js-link-spacer"),q=te.select(".js-sourcelinks");W._context.showSources&&W._context.showSources(W),W._context.showLink&&function($,ne){ne.text("");var H=ne.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text($._context.linkText+" "+String.fromCharCode(187));if($._context.sendData)H.on("click",function(){b.sendDataToCloud($)});else{var Q=window.location.pathname.split("/"),ee=window.location.search;H.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+Q[2].split(".")[0]+"/"+Q[1]+ee})}}(W,re),U.text(re.text()&&q.text()?" - ":"")}},b.sendDataToCloud=function(W){var K=(window.PLOTLYENV||{}).BASE_URL||W._context.plotlyServerURL;if(K){W.emit("plotly_beforeexport");var te=r.select(W).append("div").attr("id","hiddenform").style("display","none"),Y=te.append("form").attr({action:K+"/external",method:"post",target:"_blank"});return Y.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(W,!1,"keepdata"),Y.node().submit(),te.remove(),W.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],A=["year","month","dayMonth","dayMonthYear"];function S(W,K){var te=W._context.locale;te||(te="en-US");var Y=!1,Z={};function re(Q){for(var ee=!0,ie=0;ie1&&Te.length>1){for(i.getComponentMethod("grid","sizeDefaults")(U,re),Z=0;Z15&&Te.length>15&&re.shapes.length===0&&re.images.length===0,b.linkSubplots($,re,q,Y),b.cleanPlot($,re,q,Y);var ke=!(!Y._has||!Y._has("gl2d")),Ee=!(!re._has||!re._has("gl2d")),ze=!(!Y._has||!Y._has("cartesian"))||ke,Fe=!(!re._has||!re._has("cartesian"))||Ee;ze&&!Fe?Y._bgLayer.remove():Fe&&!ze&&(re._shouldCreateBgLayer=!0),Y._zoomlayer&&!W._dragging&&p({_fullLayout:Y}),function(qe,We){var Ye,nt=[];We.meta&&(Ye=We._meta={meta:We.meta,layout:{meta:We.meta}});for(var ft=0;ft0){var ne=1-2*U;Y=Math.round(ne*Y),Z=Math.round(ne*Z)}}var H=b.layoutAttributes.width.min,Q=b.layoutAttributes.height.min;Y1,ie=!K.height&&Math.abs(te.height-Z)>1;(ie||ee)&&(ee&&(te.width=Y),ie&&(te.height=Z)),W._initialAutoSize||(W._initialAutoSize={width:Y,height:Z}),b.sanitizeMargins(te)},b.supplyLayoutModuleDefaults=function(W,K,te,Y){var Z,re,U,q=i.componentsRegistry,$=K._basePlotModules,ne=i.subplotsRegistry.cartesian;for(Z in q)(U=q[Z]).includeBasePlot&&U.includeBasePlot(W,K);for(var H in $.length||$.push(ne),K._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(W,K),ne.finalizeSubplots(W,K)),K._subplots)K._subplots[H].sort(d.subplotSort);for(re=0;re<$.length;re++)(U=$[re]).supplyLayoutDefaults&&U.supplyLayoutDefaults(W,K,te);var Q=K._modules;for(re=0;re1&&(te.l/=ae,te.r/=ae)}if(H){var ue=(te.t+te.b)/H;ue>1&&(te.t/=ue,te.b/=ue)}var le=te.xl!==void 0?te.xl:te.x,ge=te.xr!==void 0?te.xr:te.x,fe=te.yt!==void 0?te.yt:te.y,me=te.yb!==void 0?te.yb:te.y;Q[K]={l:{val:le,size:te.l+ie},r:{val:ge,size:te.r+ie},b:{val:me,size:te.b+ie},t:{val:fe,size:te.t+ie}},ee[K]=1}else delete Q[K],delete ee[K];if(!Y._replotting)return b.doAutoMargin(W)}},b.doAutoMargin=function(W){var K=W._fullLayout,te=K.width,Y=K.height;K._size||(K._size={}),z(K);var Z=K._size,re=K.margin,U=d.extendFlat({},Z),q=re.l,$=re.r,ne=re.t,H=re.b,Q=K._pushmargin,ee=K._pushmarginIds;if(K.margin.autoexpand!==!1){for(var ie in Q)ee[ie]||delete Q[ie];for(var ae in Q.base={l:{val:0,size:q},r:{val:1,size:$},t:{val:1,size:ne},b:{val:0,size:H}},Q){var ue=Q[ae].l||{},le=Q[ae].b||{},ge=ue.val,fe=ue.size,me=le.val,_e=le.size;for(var we in Q){if(c(fe)&&Q[we].r){var Te=Q[we].r.val,Oe=Q[we].r.size;if(Te>ge){var de=(fe*Te+(Oe-te)*ge)/(Te-ge),ye=(Oe*(1-ge)+(fe-te)*(1-Te))/(Te-ge);de+ye>q+$&&(q=de,$=ye)}}if(c(_e)&&Q[we].t){var Me=Q[we].t.val,ke=Q[we].t.size;if(Me>me){var Ee=(_e*Me+(ke-Y)*me)/(Me-me),ze=(ke*(1-me)+(_e-Y)*(1-Me))/(Me-me);Ee+ze>H+ne&&(H=Ee,ne=ze)}}}}}var Fe=d.constrain(te-re.l-re.r,2,64),Ve=d.constrain(Y-re.t-re.b,2,64),Ke=Math.max(0,te-Fe),Re=Math.max(0,Y-Ve);if(Ke){var qe=(q+$)/Ke;qe>1&&(q/=qe,$/=qe)}if(Re){var We=(H+ne)/Re;We>1&&(H/=We,ne/=We)}if(Z.l=Math.round(q),Z.r=Math.round($),Z.t=Math.round(ne),Z.b=Math.round(H),Z.p=Math.round(re.pad),Z.w=Math.round(te)-Z.l-Z.r,Z.h=Math.round(Y)-Z.t-Z.b,!K._replotting&&b.didMarginChange(U,Z)){"_redrawFromAutoMarginCount"in K?K._redrawFromAutoMarginCount++:K._redrawFromAutoMarginCount=1;var Ye=3*(1+Object.keys(ee).length);if(K._redrawFromAutoMarginCount0&&(W._transitioningWithDuration=!0),W._transitionData._interruptCallbacks.push(function(){Y=!0}),te.redraw&&W._transitionData._interruptCallbacks.push(function(){return i.call("redraw",W)}),W._transitionData._interruptCallbacks.push(function(){W.emit("plotly_transitioninterrupted",[])});var q=0,$=0;function ne(){return q++,function(){$++,Y||$!==q||function(H){!W._transitionData||(function(Q){if(Q)for(;Q.length;)Q.shift()}(W._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(te.redraw)return i.call("redraw",W)}).then(function(){W._transitioning=!1,W._transitioningWithDuration=!1,W.emit("plotly_transitioned",[])}).then(H))}(U)}}te.runFn(ne),setTimeout(ne())})}],re=d.syncOrAsync(Z,W);return re&&re.then||(re=Promise.resolve()),re.then(function(){return W})}b.didMarginChange=function(W,K){for(var te=0;te1)return!0}return!1},b.graphJson=function(W,K,te,Y,Z,re){(Z&&K&&!W._fullData||Z&&!K&&!W._fullLayout)&&b.supplyDefaults(W);var U=Z?W._fullData:W.data,q=Z?W._fullLayout:W.layout,$=(W._transitionData||{})._frames;function ne(ee,ie){if(typeof ee=="function")return ie?"_function_":null;if(d.isPlainObject(ee)){var ae,ue={};return Object.keys(ee).sort().forEach(function(le){if(["_","["].indexOf(le.charAt(0))===-1)if(typeof ee[le]!="function"){if(te==="keepdata"){if(le.substr(le.length-3)==="src")return}else if(te==="keepstream"){if(typeof(ae=ee[le+"src"])=="string"&&ae.indexOf(":")>0&&!d.isPlainObject(ee.stream))return}else if(te!=="keepall"&&typeof(ae=ee[le+"src"])=="string"&&ae.indexOf(":")>0)return;ue[le]=ne(ee[le],ie)}else ie&&(ue[le]="_function")}),ue}return Array.isArray(ee)?ee.map(function(le){return ne(le,ie)}):d.isTypedArray(ee)?d.simpleMap(ee,d.identity):d.isJSDate(ee)?d.ms2DateTimeLocal(+ee):ee}var H={data:(U||[]).map(function(ee){var ie=ne(ee);return K&&delete ie.fit,ie})};if(!K&&(H.layout=ne(q),Z)){var Q=q._size;H.layout.computed={margin:{b:Q.b,l:Q.l,r:Q.r,t:Q.t}}}return $&&(H.frames=ne($)),re&&(H.config=ne(W._context,!0)),Y==="object"?H:JSON.stringify(H)},b.modifyFrames=function(W,K){var te,Y,Z,re=W._transitionData._frames,U=W._transitionData._frameHash;for(te=0;te=0;re--)if(we[re].enabled){te._indexToPoints=we[re]._indexToPoints;break}Y&&Y.calc&&(_e=Y.calc(W,te))}Array.isArray(_e)&&_e[0]||(_e=[{x:m,y:m}]),_e[0].t||(_e[0].t={}),_e[0].trace=te,ne[fe]=_e}}for(B(U,q,$),Z=0;Z1e-10?g:0}function m(g,p,v){p=p||0,v=v||0;for(var y=g.length,x=new Array(y),w=0;w0?w:1/0}),y=r.mod(v+1,p.length);return[p[v],p[y]]},findIntersectionXY:l,findXYatLength:function(g,p,v,y){var x=-p*v,w=p*p+1,k=2*(p*x-v),b=x*x+v*v-g*g,T=Math.sqrt(k*k-4*w*b),_=(-k+T)/(2*w),M=(-k-T)/(2*w);return[[_,p*_+x+y],[M,p*M+x+y]]},clampTiny:h,pathPolygon:function(g,p,v,y,x,w){return"M"+m(d(g,p,v,y),x,w).join("L")},pathPolygonAnnulus:function(g,p,v,y,x,w,k){var b,T;g=90||Jt>90&&Be>=450?1:Tt<=0&&Pe<=0?0:Math.max(Tt,Pe),Pt=Jt<=180&&Be>=180||Jt>180&&Be>=540?-1:Ge>=0&&dt>=0?0:Math.min(Ge,dt),At=Jt<=270&&Be>=270||Jt>270&&Be>=630?-1:Tt>=0&&Pe>=0?0:Math.min(Tt,Pe),at=Be>=360?1:Ge<=0&&dt<=0?0:Math.max(Ge,dt),[Pt,At,at,et]}(ge),de=Oe[2]-Oe[0],ye=Oe[3]-Oe[1],Me=le/ue,ke=Math.abs(ye/de);Me>ke?(fe=ue,Te=(le-(me=ue*ke))/H.h/2,_e=[ie[0],ie[1]],we=[ae[0]+Te,ae[1]-Te]):(me=le,Te=(ue-(fe=le/ke))/H.w/2,_e=[ie[0]+Te,ie[1]-Te],we=[ae[0],ae[1]]),this.xLength2=fe,this.yLength2=me,this.xDomain2=_e,this.yDomain2=we;var Ee,ze=this.xOffset2=H.l+H.w*_e[0],Fe=this.yOffset2=H.t+H.h*(1-we[1]),Ve=this.radius=fe/de,Ke=this.innerRadius=this.getHole($)*Ve,Re=this.cx=ze-Ve*Oe[0],qe=this.cy=Fe+Ve*Oe[3],We=this.cxx=Re-ze,Ye=this.cyy=qe-Fe,nt=Q.side;nt==="counterclockwise"?(Ee=nt,nt="top"):nt==="clockwise"&&(Ee=nt,nt="bottom"),this.radialAxis=this.mockAxis(q,$,Q,{_id:"x",side:nt,_trueSide:Ee,domain:[Ke/H.w,Ve/H.w]}),this.angularAxis=this.mockAxis(q,$,ee,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(q,$),this.updateAngularAxis(q,$),this.updateRadialAxis(q,$),this.updateRadialAxisTitle(q,$),this.xaxis=this.mockCartesianAxis(q,$,{_id:"x",domain:_e}),this.yaxis=this.mockCartesianAxis(q,$,{_id:"y",domain:we});var ft=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",ft).attr("transform",s(We,Ye)),ne.frontplot.attr("transform",s(ze,Fe)).call(d.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),ne.bg.attr("d",ft).attr("transform",s(Re,qe)).call(l.fill,$.bgcolor)},Y.mockAxis=function(q,$,ne,H){var Q=c.extendFlat({},ne,H);return p(Q,$,q),Q},Y.mockCartesianAxis=function(q,$,ne){var H=this,Q=H.isSmith,ee=ne._id,ie=c.extendFlat({type:"linear"},ne);g(ie,q);var ae={x:[0,2],y:[1,3]};return ie.setRange=function(){var ue=H.sectorBBox,le=ae[ee],ge=H.radialAxis._rl,fe=(ge[1]-ge[0])/(1-H.getHole($));ie.range=[ue[le[0]]*fe,ue[le[1]]*fe]},ie.isPtWithinRange=ee!=="x"||Q?function(){return!0}:function(ue){return H.isPtInside(ue)},ie.setRange(),ie.setScale(),ie},Y.doAutoRange=function(q,$){var ne=this.gd,H=this.radialAxis,Q=this.getRadial($);v(ne,H);var ee=H.range;Q.range=ee.slice(),Q._input.range=ee.slice(),H._rl=[H.r2l(ee[0],null,"gregorian"),H.r2l(ee[1],null,"gregorian")]},Y.updateRadialAxis=function(q,$){var ne=this,H=ne.gd,Q=ne.layers,ee=ne.radius,ie=ne.innerRadius,ae=ne.cx,ue=ne.cy,le=ne.getRadial($),ge=G(ne.getSector($)[0],360),fe=ne.radialAxis,me=ie90&&ge<=270&&(fe.tickangle=180);var we=_e?function(Ve){var Ke=N(ne,z([Ve.x,0]));return s(Ke[0]-ae,Ke[1]-ue)}:function(Ve){return s(fe.l2p(Ve.x)+ie,0)},Te=_e?function(Ve){return P(ne,Ve.x,-1/0,1/0)}:function(Ve){return ne.pathArc(fe.r2p(Ve.x)+ie)},Oe=Z(le);if(ne.radialTickLayout!==Oe&&(Q["radial-axis"].selectAll(".xtick").remove(),ne.radialTickLayout=Oe),me){fe.setScale();var de=0,ye=_e?(fe.tickvals||[]).filter(function(Ve){return Ve>=0}).map(function(Ve){return m.tickText(fe,Ve,!0,!1)}):m.calcTicks(fe),Me=_e?ye:m.clipEnds(fe,ye),ke=m.getTickSigns(fe)[2];_e&&((fe.ticks==="top"&&fe.side==="bottom"||fe.ticks==="bottom"&&fe.side==="top")&&(ke=-ke),fe.ticks==="top"&&fe.side==="top"&&(de=-fe.ticklen),fe.ticks==="bottom"&&fe.side==="bottom"&&(de=fe.ticklen)),m.drawTicks(H,fe,{vals:ye,layer:Q["radial-axis"],path:m.makeTickPath(fe,0,ke),transFn:we,crisp:!1}),m.drawGrid(H,fe,{vals:Me,layer:Q["radial-grid"],path:Te,transFn:c.noop,crisp:!1}),m.drawLabels(H,fe,{vals:ye,layer:Q["radial-axis"],transFn:we,labelFns:m.makeLabelFns(fe,de)})}var Ee=ne.radialAxisAngle=ne.vangles?K(re(W(le.angle),ne.vangles)):le.angle,ze=s(ae,ue),Fe=ze+i(-Ee);U(Q["radial-axis"],me&&(le.showticklabels||le.ticks),{transform:Fe}),U(Q["radial-grid"],me&&le.showgrid,{transform:_e?"":ze}),U(Q["radial-line"].select("line"),me&&le.showline,{x1:_e?-ee:ie,y1:0,x2:ee,y2:0,transform:Fe}).attr("stroke-width",le.linewidth).call(l.stroke,le.linecolor)},Y.updateRadialAxisTitle=function(q,$,ne){if(!this.isSmith){var H=this.gd,Q=this.radius,ee=this.cx,ie=this.cy,ae=this.getRadial($),ue=this.id+"title",le=0;if(ae.title){var ge=d.bBox(this.layers["radial-axis"].node()).height,fe=ae.title.font.size,me=ae.side;le=me==="top"?fe:me==="counterclockwise"?-(ge+.4*fe):ge+.8*fe}var _e=ne!==void 0?ne:this.radialAxisAngle,we=W(_e),Te=Math.cos(we),Oe=Math.sin(we),de=ee+Q/2*Te+le*Oe,ye=ie-Q/2*Oe+le*Te;this.layers["radial-axis-title"]=k.draw(H,ue,{propContainer:ae,propName:this.id+".radialaxis.title",placeholder:B(H,"Click to enter radial axis title"),attributes:{x:de,y:ye,"text-anchor":"middle"},transform:{rotate:-_e}})}},Y.updateAngularAxis=function(q,$){var ne=this,H=ne.gd,Q=ne.layers,ee=ne.radius,ie=ne.innerRadius,ae=ne.cx,ue=ne.cy,le=ne.getAngular($),ge=ne.angularAxis,fe=ne.isSmith;fe||(ne.fillViewInitialKey("angularaxis.rotation",le.rotation),ge.setGeometry(),ge.setScale());var me=fe?function(Ve){var Ke=N(ne,z([0,Ve.x]));return Math.atan2(Ke[0]-ae,Ke[1]-ue)-Math.PI/2}:function(Ve){return ge.t2g(Ve.x)};ge.type==="linear"&&ge.thetaunit==="radians"&&(ge.tick0=K(ge.tick0),ge.dtick=K(ge.dtick));var _e=function(Ve){return s(ae+ee*Math.cos(Ve),ue-ee*Math.sin(Ve))},we=fe?function(Ve){var Ke=N(ne,z([0,Ve.x]));return s(Ke[0],Ke[1])}:function(Ve){return _e(me(Ve))},Te=fe?function(Ve){var Ke=N(ne,z([0,Ve.x])),Re=Math.atan2(Ke[0]-ae,Ke[1]-ue)-Math.PI/2;return s(Ke[0],Ke[1])+i(-K(Re))}:function(Ve){var Ke=me(Ve);return _e(Ke)+i(-K(Ke))},Oe=fe?function(Ve){return L(ne,Ve.x,0,1/0)}:function(Ve){var Ke=me(Ve),Re=Math.cos(Ke),qe=Math.sin(Ke);return"M"+[ae+ie*Re,ue-ie*qe]+"L"+[ae+ee*Re,ue-ee*qe]},de=m.makeLabelFns(ge,0).labelStandoff,ye={xFn:function(Ve){var Ke=me(Ve);return Math.cos(Ke)*de},yFn:function(Ve){var Ke=me(Ve),Re=Math.sin(Ke)>0?.2:1;return-Math.sin(Ke)*(de+Ve.fontSize*Re)+Math.abs(Math.cos(Ke))*(Ve.fontSize*E)},anchorFn:function(Ve){var Ke=me(Ve),Re=Math.cos(Ke);return Math.abs(Re)<.1?"middle":Re>0?"start":"end"},heightFn:function(Ve,Ke,Re){var qe=me(Ve);return-.5*(1+Math.sin(qe))*Re}},Me=Z(le);ne.angularTickLayout!==Me&&(Q["angular-axis"].selectAll("."+ge._id+"tick").remove(),ne.angularTickLayout=Me);var ke,Ee=fe?[1/0].concat(ge.tickvals||[]).map(function(Ve){return m.tickText(ge,Ve,!0,!1)}):m.calcTicks(ge);if(fe&&(Ee[0].text="\u221E",Ee[0].fontSize*=1.75),$.gridshape==="linear"?(ke=Ee.map(me),c.angleDelta(ke[0],ke[1])<0&&(ke=ke.slice().reverse())):ke=null,ne.vangles=ke,ge.type==="category"&&(Ee=Ee.filter(function(Ve){return c.isAngleInsideSector(me(Ve),ne.sectorInRad)})),ge.visible){var ze=ge.ticks==="inside"?-1:1,Fe=(ge.linewidth||1)/2;m.drawTicks(H,ge,{vals:Ee,layer:Q["angular-axis"],path:"M"+ze*Fe+",0h"+ze*ge.ticklen,transFn:Te,crisp:!1}),m.drawGrid(H,ge,{vals:Ee,layer:Q["angular-grid"],path:Oe,transFn:c.noop,crisp:!1}),m.drawLabels(H,ge,{vals:Ee,layer:Q["angular-axis"],repositionOnUpdate:!0,transFn:we,labelFns:ye})}U(Q["angular-line"].select("path"),le.showline,{d:ne.pathSubplot(),transform:s(ae,ue)}).attr("stroke-width",le.linewidth).call(l.stroke,le.linecolor)},Y.updateFx=function(q,$){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(q),this.updateRadialDrag(q,$,0),this.updateRadialDrag(q,$,1)),this.updateHoverAndMainDrag(q))},Y.updateHoverAndMainDrag=function(q){var $,ne,H=this,Q=H.isSmith,ee=H.gd,ie=H.layers,ae=q._zoomlayer,ue=D.MINZOOM,le=D.OFFEDGE,ge=H.radius,fe=H.innerRadius,me=H.cx,_e=H.cy,we=H.cxx,Te=H.cyy,Oe=H.sectorInRad,de=H.vangles,ye=H.radialAxis,Me=O.clampTiny,ke=O.findXYatLength,Ee=O.findEnclosingVertexAngles,ze=D.cornerHalfWidth,Fe=D.cornerLen/2,Ve=y.makeDragger(ie,"path","maindrag","crosshair");r.select(Ve).attr("d",H.pathSubplot()).attr("transform",s(me,_e)),Ve.onmousemove=function(rt){w.hover(ee,rt,H.id),ee._fullLayout._lasthover=Ve,ee._fullLayout._hoversubplot=H.id},Ve.onmouseout=function(rt){ee._dragging||x.unhover(ee,rt)};var Ke,Re,qe,We,Ye,nt,ft,vt,Pt,At={element:Ve,gd:ee,subplot:H.id,plotinfo:{id:H.id,xaxis:H.xaxis,yaxis:H.yaxis},xaxes:[H.xaxis],yaxes:[H.yaxis]};function at(rt,lt){return Math.sqrt(rt*rt+lt*lt)}function et(rt,lt){return at(rt-we,lt-Te)}function Ot(rt,lt){return Math.atan2(Te-lt,rt-we)}function Wt(rt,lt){return[rt*Math.cos(lt),rt*Math.sin(-lt)]}function Jt(rt,lt){if(rt===0)return H.pathSector(2*ze);var ot=Fe/rt,kt=lt-ot,wt=lt+ot,Vt=Math.max(0,Math.min(rt,ge)),Ut=Vt-ze,tt=Vt+ze;return"M"+Wt(Ut,kt)+"A"+[Ut,Ut]+" 0,0,0 "+Wt(Ut,wt)+"L"+Wt(tt,wt)+"A"+[tt,tt]+" 0,0,1 "+Wt(tt,kt)+"Z"}function Be(rt,lt,ot){if(rt===0)return H.pathSector(2*ze);var kt,wt,Vt=Wt(rt,lt),Ut=Wt(rt,ot),tt=Me((Vt[0]+Ut[0])/2),bt=Me((Vt[1]+Ut[1])/2);if(tt&&bt){var zt=bt/tt,St=-1/zt,Dt=ke(ze,zt,tt,bt);kt=ke(Fe,St,Dt[0][0],Dt[0][1]),wt=ke(Fe,St,Dt[1][0],Dt[1][1])}else{var Le,Je;bt?(Le=Fe,Je=ze):(Le=ze,Je=Fe),kt=[[tt-Le,bt-Je],[tt+Le,bt-Je]],wt=[[tt-Le,bt+Je],[tt+Le,bt+Je]]}return"M"+kt.join("L")+"L"+wt.reverse().join("L")+"Z"}function Ge(rt,lt){return lt=Math.max(Math.min(lt,ge),fe),rtue?(rt-1&&rt===1&&T(lt,ee,[H.xaxis],[H.yaxis],H.id,At),ot.indexOf("event")>-1&&w.click(ee,lt,H.id)}At.prepFn=function(rt,lt,ot){var kt=ee._fullLayout.dragmode,wt=Ve.getBoundingClientRect();ee._fullLayout._calcInverseTransform(ee);var Vt=ee._fullLayout._invTransform;$=ee._fullLayout._invScaleX,ne=ee._fullLayout._invScaleY;var Ut=c.apply3DTransform(Vt)(lt-wt.left,ot-wt.top);if(Ke=Ut[0],Re=Ut[1],de){var tt=O.findPolygonOffset(ge,Oe[0],Oe[1],de);Ke+=we+tt[0],Re+=Te+tt[1]}switch(kt){case"zoom":At.clickFn=He,Q||(At.moveFn=de?Ie:dt,At.doneFn=Ae,function(){qe=null,We=null,Ye=H.pathSubplot(),nt=!1;var bt=ee._fullLayout[H.id];ft=a(bt.bgcolor).getLuminance(),(vt=y.makeZoombox(ae,ft,me,_e,Ye)).attr("fill-rule","evenodd"),Pt=y.makeCorners(ae,me,_e),_(ee)}());break;case"select":case"lasso":b(rt,lt,ot,At,kt)}},x.init(At)},Y.updateRadialDrag=function(q,$,ne){var H=this,Q=H.gd,ee=H.layers,ie=H.radius,ae=H.innerRadius,ue=H.cx,le=H.cy,ge=H.radialAxis,fe=D.radialDragBoxSize,me=fe/2;if(ge.visible){var _e,we,Te,Oe=W(H.radialAxisAngle),de=ge._rl,ye=de[0],Me=de[1],ke=de[ne],Ee=.75*(de[1]-de[0])/(1-H.getHole($))/ie;ne?(_e=ue+(ie+me)*Math.cos(Oe),we=le-(ie+me)*Math.sin(Oe),Te="radialdrag"):(_e=ue+(ae-me)*Math.cos(Oe),we=le-(ae-me)*Math.sin(Oe),Te="radialdrag-inner");var ze,Fe,Ve,Ke=y.makeRectDragger(ee,Te,"crosshair",-me,-me,fe,fe),Re={element:Ke,gd:Q};U(r.select(Ke),ge.visible&&ae0==(ne?Ve>ye:Vep?function(k){return k<=0}:function(k){return k>=0};d.c2g=function(k){var b=d.c2l(k)-g;return(w(b)?b:0)+x},d.g2c=function(k){return d.l2c(k+g-x)},d.g2p=function(k){return k*y},d.c2p=function(k){return d.g2p(d.c2g(k))}}})(i,s);break;case"angularaxis":(function(d,h){var m=d.type;if(m==="linear"){var g=d.d2c,p=d.c2d;d.d2c=function(v,y){return function(x,w){return w==="degrees"?u(x):x}(g(v),y)},d.c2d=function(v,y){return p(function(x,w){return w==="degrees"?c(x):x}(v,y))}}d.makeCalcdata=function(v,y){var x,w,k=v[y],b=v._length,T=function(E){return d.d2c(E,v.thetaunit)};if(k){if(r.isTypedArray(k)&&m==="linear"){if(b===k.length)return k;if(k.subarray)return k.subarray(0,b)}for(x=new Array(b),w=0;w0?1:0}function a(i){var s=i[0],l=i[1];if(!isFinite(s)||!isFinite(l))return[1,0];var d=(s+1)*(s+1)+l*l;return[(s*s+l*l-1)/d,2*l/d]}function u(i,s){var l=s[0],d=s[1];return[l*i.radius+i.cx,-d*i.radius+i.cy]}function c(i,s){return s*i.radius}o.exports={smith:a,reactanceArc:function(i,s,l,d){var h=u(i,a([l,s])),m=h[0],g=h[1],p=u(i,a([d,s])),v=p[0],y=p[1];if(s===0)return["M"+m+","+g,"L"+v+","+y].join(" ");var x=c(i,1/Math.abs(s));return["M"+m+","+g,"A"+x+","+x+" 0 0,"+(s<0?1:0)+" "+v+","+y].join(" ")},resistanceArc:function(i,s,l,d){var h=c(i,1/(s+1)),m=u(i,a([s,l])),g=m[0],p=m[1],v=u(i,a([s,d])),y=v[0],x=v[1];if(r(l)!==r(d)){var w=u(i,a([s,0]));return["M"+g+","+p,"A"+h+","+h+" 0 0,"+(00){for(var s=[],l=0;l=A&&(E.min=0,D.min=0,O.min=0,y.aaxis&&delete y.aaxis.min,y.baxis&&delete y.baxis.min,y.caxis&&delete y.caxis.min)}function v(y,x,w,k){var b=m[x._name];function T(D,O){return u.coerce(y,x,b,D,O)}T("uirevision",k.uirevision),x.type="linear";var _=T("color"),M=_!==b.color.dflt?_:w.font.color,A=x._name.charAt(0).toUpperCase(),S="Component "+A,E=T("title.text",S);x._hovertitle=E===S?E:A,u.coerceFont(T,"title.font",{family:w.font.family,size:u.bigFont(w.font.size),color:M}),T("min"),d(y,x,T,"linear"),s(y,x,T,"linear"),i(y,x,T,"linear"),l(y,x,T,{outerTicks:!0}),T("showticklabels")&&(u.coerceFont(T,"tickfont",{family:w.font.family,size:w.font.size,color:M}),T("tickangle"),T("tickformat")),h(y,x,T,{dfltColor:_,bgColor:w.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:b}),T("hoverformat"),T("layer")}o.exports=function(y,x,w){c(y,x,w,{type:"ternary",attributes:m,handleDefaults:p,font:x.font,paper_bgcolor:x.paper_bgcolor})}},{"../../components/color":366,"../../lib":503,"../../plot_api/plot_template":543,"../cartesian/line_grid_defaults":571,"../cartesian/prefix_suffix_defaults":573,"../cartesian/tick_label_defaults":578,"../cartesian/tick_mark_defaults":579,"../cartesian/tick_value_defaults":580,"../subplot_defaults":632,"./layout_attributes":635}],637:[function(e,o,f){var r=e("@plotly/d3"),a=e("tinycolor2"),u=e("../../registry"),c=e("../../lib"),i=c.strTranslate,s=c._,l=e("../../components/color"),d=e("../../components/drawing"),h=e("../cartesian/set_convert"),m=e("../../lib/extend").extendFlat,g=e("../plots"),p=e("../cartesian/axes"),v=e("../../components/dragelement"),y=e("../../components/fx"),x=e("../../components/dragelement/helpers"),w=x.freeMode,k=x.rectMode,b=e("../../components/titles"),T=e("../cartesian/select").prepSelect,_=e("../cartesian/select").selectOnClick,M=e("../cartesian/select").clearSelect,A=e("../cartesian/select").clearSelectionsCache,S=e("../cartesian/constants");function E(G,W){this.id=G.id,this.graphDiv=G.graphDiv,this.init(W),this.makeFramework(W),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}o.exports=E;var D=E.prototype;D.init=function(G){this.container=G._ternarylayer,this.defs=G._defs,this.layoutId=G._uid,this.traceHash={},this.layers={}},D.plot=function(G,W){var K=W[this.id],te=W._size;this._hasClipOnAxisFalse=!1;for(var Y=0;YO*ae?Y=(Z=ae)*O:Z=(Y=ie)/O,re=Q*Y/ie,U=ee*Z/ae,K=W.l+W.w*ne-Y/2,te=W.t+W.h*(1-H)-Z/2,q.x0=K,q.y0=te,q.w=Y,q.h=Z,q.sum=ue,q.xaxis={type:"linear",range:[le+2*fe-ue,ue-le-2*ge],domain:[ne-re/2,ne+re/2],_id:"x"},h(q.xaxis,q.graphDiv._fullLayout),q.xaxis.setScale(),q.xaxis.isPtWithinRange=function(ze){return ze.a>=q.aaxis.range[0]&&ze.a<=q.aaxis.range[1]&&ze.b>=q.baxis.range[1]&&ze.b<=q.baxis.range[0]&&ze.c>=q.caxis.range[1]&&ze.c<=q.caxis.range[0]},q.yaxis={type:"linear",range:[le,ue-ge-fe],domain:[H-U/2,H+U/2],_id:"y"},h(q.yaxis,q.graphDiv._fullLayout),q.yaxis.setScale(),q.yaxis.isPtWithinRange=function(){return!0};var me=q.yaxis.domain[0],_e=q.aaxis=m({},G.aaxis,{range:[le,ue-ge-fe],side:"left",tickangle:(+G.aaxis.tickangle||0)-30,domain:[me,me+U*O],anchor:"free",position:0,_id:"y",_length:Y});h(_e,q.graphDiv._fullLayout),_e.setScale();var we=q.baxis=m({},G.baxis,{range:[ue-le-fe,ge],side:"bottom",domain:q.xaxis.domain,anchor:"free",position:0,_id:"x",_length:Y});h(we,q.graphDiv._fullLayout),we.setScale();var Te=q.caxis=m({},G.caxis,{range:[ue-le-ge,fe],side:"right",tickangle:(+G.caxis.tickangle||0)+30,domain:[me,me+U*O],anchor:"free",position:0,_id:"y",_length:Y});h(Te,q.graphDiv._fullLayout),Te.setScale();var Oe="M"+K+","+(te+Z)+"h"+Y+"l-"+Y/2+",-"+Z+"Z";q.clipDef.select("path").attr("d",Oe),q.layers.plotbg.select("path").attr("d",Oe);var de="M0,"+Z+"h"+Y+"l-"+Y/2+",-"+Z+"Z";q.clipDefRelative.select("path").attr("d",de);var ye=i(K,te);q.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ye),q.clipDefRelative.select("path").attr("transform",null);var Me=i(K-we._offset,te+Z);q.layers.baxis.attr("transform",Me),q.layers.bgrid.attr("transform",Me);var ke=i(K+Y/2,te)+"rotate(30)"+i(0,-_e._offset);q.layers.aaxis.attr("transform",ke),q.layers.agrid.attr("transform",ke);var Ee=i(K+Y/2,te)+"rotate(-30)"+i(0,-Te._offset);q.layers.caxis.attr("transform",Ee),q.layers.cgrid.attr("transform",Ee),q.drawAxes(!0),q.layers.aline.select("path").attr("d",_e.showline?"M"+K+","+(te+Z)+"l"+Y/2+",-"+Z:"M0,0").call(l.stroke,_e.linecolor||"#000").style("stroke-width",(_e.linewidth||0)+"px"),q.layers.bline.select("path").attr("d",we.showline?"M"+K+","+(te+Z)+"h"+Y:"M0,0").call(l.stroke,we.linecolor||"#000").style("stroke-width",(we.linewidth||0)+"px"),q.layers.cline.select("path").attr("d",Te.showline?"M"+(K+Y/2)+","+te+"l"+Y/2+","+Z:"M0,0").call(l.stroke,Te.linecolor||"#000").style("stroke-width",(Te.linewidth||0)+"px"),q.graphDiv._context.staticPlot||q.initInteractions(),d.setClipUrl(q.layers.frontplot,q._hasClipOnAxisFalse?null:q.clipId,q.graphDiv)},D.drawAxes=function(G){var W=this.graphDiv,K=this.id.substr(7)+"title",te=this.layers,Y=this.aaxis,Z=this.baxis,re=this.caxis;if(this.drawAx(Y),this.drawAx(Z),this.drawAx(re),G){var U=Math.max(Y.showticklabels?Y.tickfont.size/2:0,(re.showticklabels?.75*re.tickfont.size:0)+(re.ticks==="outside"?.87*re.ticklen:0)),q=(Z.showticklabels?Z.tickfont.size:0)+(Z.ticks==="outside"?Z.ticklen:0)+3;te["a-title"]=b.draw(W,"a"+K,{propContainer:Y,propName:this.id+".aaxis.title",placeholder:s(W,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-Y.title.font.size/3-U,"text-anchor":"middle"}}),te["b-title"]=b.draw(W,"b"+K,{propContainer:Z,propName:this.id+".baxis.title",placeholder:s(W,"Click to enter Component B title"),attributes:{x:this.x0-q,y:this.y0+this.h+.83*Z.title.font.size+q,"text-anchor":"middle"}}),te["c-title"]=b.draw(W,"c"+K,{propContainer:re,propName:this.id+".caxis.title",placeholder:s(W,"Click to enter Component C title"),attributes:{x:this.x0+this.w+q,y:this.y0+this.h+.83*re.title.font.size+q,"text-anchor":"middle"}})}},D.drawAx=function(G){var W,K=this.graphDiv,te=G._name,Y=te.charAt(0),Z=G._id,re=this.layers[te],U=Y+"tickLayout",q=(W=G).ticks+String(W.ticklen)+String(W.showticklabels);this[U]!==q&&(re.selectAll("."+Z+"tick").remove(),this[U]=q),G.setScale();var $=p.calcTicks(G),ne=p.clipEnds(G,$),H=p.makeTransTickFn(G),Q=p.getTickSigns(G)[2],ee=c.deg2rad(30),ie=Q*(G.linewidth||1)/2,ae=Q*G.ticklen,ue=this.w,le=this.h,ge=Y==="b"?"M0,"+ie+"l"+Math.sin(ee)*ae+","+Math.cos(ee)*ae:"M"+ie+",0l"+Math.cos(ee)*ae+","+-Math.sin(ee)*ae,fe={a:"M0,0l"+le+",-"+ue/2,b:"M0,0l-"+ue/2+",-"+le,c:"M0,0l-"+le+","+ue/2}[Y];p.drawTicks(K,G,{vals:G.ticks==="inside"?ne:$,layer:re,path:ge,transFn:H,crisp:!1}),p.drawGrid(K,G,{vals:ne,layer:this.layers[Y+"grid"],path:fe,transFn:H,crisp:!1}),p.drawLabels(K,G,{vals:$,layer:re,transFn:H,labelFns:p.makeLabelFns(G,0,30)})};var R=S.MINZOOM/2+.87,z="m-0.87,.5h"+R+"v3h-"+(R+5.2)+"l"+(R/2+2.6)+",-"+(.87*R+4.5)+"l2.6,1.5l-"+R/2+","+.87*R+"Z",L="m0.87,.5h-"+R+"v3h"+(R+5.2)+"l-"+(R/2+2.6)+",-"+(.87*R+4.5)+"l-2.6,1.5l"+R/2+","+.87*R+"Z",P="m0,1l"+R/2+","+.87*R+"l2.6,-1.5l-"+(R/2+2.6)+",-"+(.87*R+4.5)+"l-"+(R/2+2.6)+","+(.87*R+4.5)+"l2.6,1.5l"+R/2+",-"+.87*R+"Z",N=!0;function B(G){r.select(G).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}D.clearSelect=function(){A(this.dragOptions),M(this.dragOptions.gd)},D.initInteractions=function(){var G,W,K,te,Y,Z,re,U,q,$,ne,H,Q=this,ee=Q.layers.plotbg.select("path").node(),ie=Q.graphDiv,ae=ie._fullLayout._zoomlayer;function ue(de){var ye={};return ye[Q.id+".aaxis.min"]=de.a,ye[Q.id+".baxis.min"]=de.b,ye[Q.id+".caxis.min"]=de.c,ye}function le(de,ye){var Me=ie._fullLayout.clickmode;B(ie),de===2&&(ie.emit("plotly_doubleclick",null),u.call("_guiRelayout",ie,ue({a:0,b:0,c:0}))),Me.indexOf("select")>-1&&de===1&&_(ye,ie,[Q.xaxis],[Q.yaxis],Q.id,Q.dragOptions),Me.indexOf("event")>-1&&y.click(ie,ye,Q.id)}function ge(de,ye){return 1-ye/Q.h}function fe(de,ye){return 1-(de+(Q.h-ye)/Math.sqrt(3))/Q.w}function me(de,ye){return(de-(Q.h-ye)/Math.sqrt(3))/Q.w}function _e(de,ye){var Me=K+de*G,ke=te+ye*W,Ee=Math.max(0,Math.min(1,ge(0,te),ge(0,ke))),ze=Math.max(0,Math.min(1,fe(K,te),fe(Me,ke))),Fe=Math.max(0,Math.min(1,me(K,te),me(Me,ke))),Ve=(Ee/2+Fe)*Q.w,Ke=(1-Ee/2-ze)*Q.w,Re=(Ve+Ke)/2,qe=Ke-Ve,We=(1-Ee)*Q.h,Ye=We-qe/O;qe.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),H.transition().style("opacity",1).duration(200),$=!0),ie.emit("plotly_relayouting",ue(re))}function we(){B(ie),re!==Y&&(u.call("_guiRelayout",ie,ue(re)),N&&ie.data&&ie._context.showTips&&(c.notifier(s(ie,"Double-click to zoom back out"),"long"),N=!1))}function Te(de,ye){var Me=de/Q.xaxis._m,ke=ye/Q.yaxis._m,Ee=[(re={a:Y.a-ke,b:Y.b+(Me+ke)/2,c:Y.c-(Me-ke)/2}).a,re.b,re.c].sort(c.sorterAsc),ze=Ee.indexOf(re.a),Fe=Ee.indexOf(re.b),Ve=Ee.indexOf(re.c);Ee[0]<0&&(Ee[1]+Ee[0]/2<0?(Ee[2]+=Ee[0]+Ee[1],Ee[0]=Ee[1]=0):(Ee[2]+=Ee[0]/2,Ee[1]+=Ee[0]/2,Ee[0]=0),re={a:Ee[ze],b:Ee[Fe],c:Ee[Ve]},ye=(Y.a-re.a)*Q.yaxis._m,de=(Y.c-re.c-Y.b+re.b)*Q.xaxis._m);var Ke=i(Q.x0+de,Q.y0+ye);Q.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Ke);var Re=i(-de,-ye);Q.clipDefRelative.select("path").attr("transform",Re),Q.aaxis.range=[re.a,Q.sum-re.b-re.c],Q.baxis.range=[Q.sum-re.a-re.c,re.b],Q.caxis.range=[Q.sum-re.a-re.b,re.c],Q.drawAxes(!1),Q._hasClipOnAxisFalse&&Q.plotContainer.select(".scatterlayer").selectAll(".trace").call(d.hideOutsideRangePoints,Q),ie.emit("plotly_relayouting",ue(re))}function Oe(){u.call("_guiRelayout",ie,ue(re))}this.dragOptions={element:ee,gd:ie,plotinfo:{id:Q.id,domain:ie._fullLayout[Q.id].domain,xaxis:Q.xaxis,yaxis:Q.yaxis},subplot:Q.id,prepFn:function(de,ye,Me){Q.dragOptions.xaxes=[Q.xaxis],Q.dragOptions.yaxes=[Q.yaxis],G=ie._fullLayout._invScaleX,W=ie._fullLayout._invScaleY;var ke=Q.dragOptions.dragmode=ie._fullLayout.dragmode;w(ke)?Q.dragOptions.minDrag=1:Q.dragOptions.minDrag=void 0,ke==="zoom"?(Q.dragOptions.moveFn=_e,Q.dragOptions.clickFn=le,Q.dragOptions.doneFn=we,function(Ee,ze,Fe){var Ve=ee.getBoundingClientRect();K=ze-Ve.left,te=Fe-Ve.top,ie._fullLayout._calcInverseTransform(ie);var Ke=ie._fullLayout._invTransform,Re=c.apply3DTransform(Ke)(K,te);K=Re[0],te=Re[1],Y={a:Q.aaxis.range[0],b:Q.baxis.range[1],c:Q.caxis.range[1]},re=Y,Z=Q.aaxis.range[1]-Y.a,U=a(Q.graphDiv._fullLayout[Q.id].bgcolor).getLuminance(),q="M0,"+Q.h+"L"+Q.w/2+", 0L"+Q.w+","+Q.h+"Z",$=!1,ne=ae.append("path").attr("class","zoombox").attr("transform",i(Q.x0,Q.y0)).style({fill:U>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",q),H=ae.append("path").attr("class","zoombox-corners").attr("transform",i(Q.x0,Q.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),Q.clearSelect(ie)}(0,ye,Me)):ke==="pan"?(Q.dragOptions.moveFn=Te,Q.dragOptions.clickFn=le,Q.dragOptions.doneFn=Oe,Y={a:Q.aaxis.range[0],b:Q.baxis.range[1],c:Q.caxis.range[1]},re=Y,Q.clearSelect(ie)):(k(ke)||w(ke))&&T(de,ye,Me,Q.dragOptions,ke)}},ee.onmousemove=function(de){y.hover(ie,de,Q.id),ie._fullLayout._lasthover=ee,ie._fullLayout._hoversubplot=Q.id},ee.onmouseout=function(de){ie._dragging||v.unhover(ie,de)},v.init(this.dragOptions)}},{"../../components/color":366,"../../components/dragelement":385,"../../components/dragelement/helpers":384,"../../components/drawing":388,"../../components/fx":406,"../../components/titles":464,"../../lib":503,"../../lib/extend":493,"../../registry":638,"../cartesian/axes":554,"../cartesian/constants":561,"../cartesian/select":575,"../cartesian/set_convert":576,"../plots":619,"@plotly/d3":58,tinycolor2:312}],638:[function(e,o,f){var r=e("./lib/loggers"),a=e("./lib/noop"),u=e("./lib/push_unique"),c=e("./lib/is_plain_object"),i=e("./lib/dom").addStyleRule,s=e("./lib/extend"),l=e("./plots/attributes"),d=e("./plots/layout_attributes"),h=s.extendFlat,m=s.extendDeepAll;function g(_){var M=_.name,A=_.categories,S=_.meta;if(f.modules[M])r.log("Type "+M+" already registered");else{f.subplotsRegistry[_.basePlotModule.name]||function(N){var B=N.name;if(f.subplotsRegistry[B])return void r.log("Plot type "+B+" already registered.");for(var G in x(N),f.subplotsRegistry[B]=N,f.componentsRegistry)b(G,N.name)}(_.basePlotModule);for(var E={},D=0;D-1&&(v[x[d]].title={text:""});for(d=0;d")!==-1?"":E.html(O).text()});return E.remove(),D}(A),A=(A=A.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(l,"'"),a.isIE()&&(A=(A=(A=A.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),A}},{"../components/color":366,"../components/drawing":388,"../constants/xmlns_namespaces":480,"../lib":503,"@plotly/d3":58}],647:[function(e,o,f){var r=e("../../lib");o.exports=function(a,u){for(var c=0;cO+E||!r(D))}for(var z=0;zd))return i}return s!==void 0?s:c.dflt},f.coerceColor=function(c,i,s){return a(i).isValid()?i:s!==void 0?s:c.dflt},f.coerceEnumerated=function(c,i,s){return c.coerceNumber&&(i=+i),c.values.indexOf(i)!==-1?i:s!==void 0?s:c.dflt},f.getValue=function(c,i){var s;return Array.isArray(c)?i0?ue+=le:w<0&&(ue-=le)}return ue}function U(ae){var ue=w,le=ae.b,ge=re(ae);return r.inbox(le-ue,ge-ue,R+(ge-ue)/(ge-le)-1)}var q=m[k+"a"],$=m[b+"a"];M=Math.abs(q.r2c(q.range[1])-q.r2c(q.range[0]));var ne=r.getDistanceFunction(v,T,_,function(ae){return(T(ae)+_(ae))/2});if(r.getClosest(A,ne,m),m.index!==!1&&A[m.index].p!==l){P||(K=function(ae){return Math.min(N(ae),ae.p-E.bargroupwidth/2)},te=function(ae){return Math.max(B(ae),ae.p+E.bargroupwidth/2)});var H=A[m.index],Q=S.base?H.b+H.s:H.s;m[b+"0"]=m[b+"1"]=$.c2p(H[b],!0),m[b+"LabelVal"]=Q;var ee=E.extents[E.extents.round(H.p)];m[k+"0"]=q.c2p(D?K(H):ee[0],!0),m[k+"1"]=q.c2p(D?te(H):ee[1],!0);var ie=H.orig_p!==void 0;return m[k+"LabelVal"]=ie?H.orig_p:H.p,m.labelLabel=s(q,m[k+"LabelVal"],S[k+"hoverformat"]),m.valueLabel=s($,m[b+"LabelVal"],S[b+"hoverformat"]),m.baseLabel=s($,H.b,S[b+"hoverformat"]),m.spikeDistance=(function(ae){var ue=w,le=ae.b,ge=re(ae);return r.inbox(le-ue,ge-ue,z+(ge-ue)/(ge-le)-1)}(H)+function(ae){return Y(N(ae),B(ae),z)}(H))/2,m[k+"Spike"]=q.c2p(H.p,!0),c(H,S,m),m.hovertemplate=S.hovertemplate,m}}function h(m,g){var p=g.mcc||m.marker.color,v=g.mlcc||m.marker.line.color,y=i(m,g);return u.opacity(p)?p:u.opacity(v)&&y?v:void 0}o.exports={hoverPoints:function(m,g,p,v,y){var x=d(m,g,p,v,y);if(x){var w=x.cd,k=w[0].trace,b=w[x.index];return x.color=h(k,b),a.getComponentMethod("errorbars","hoverInfo")(b,k,x),[x]}},hoverOnBars:d,getTraceColor:h}},{"../../components/color":366,"../../components/fx":406,"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/axes":554,"../../registry":638,"./helpers":654}],656:[function(e,o,f){o.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":568,"../scatter/marker_colorbar":945,"./arrays_to_calcdata":647,"./attributes":648,"./calc":649,"./cross_trace_calc":651,"./defaults":652,"./event_data":653,"./hover":655,"./layout_attributes":657,"./layout_defaults":658,"./plot":659,"./select":660,"./style":662}],657:[function(e,o,f){o.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"}}},{}],658:[function(e,o,f){var r=e("../../registry"),a=e("../../plots/cartesian/axes"),u=e("../../lib"),c=e("./layout_attributes");o.exports=function(i,s,l){function d(k,b){return u.coerce(i,s,c,k,b)}for(var h=!1,m=!1,g=!1,p={},v=d("barmode"),y=0;y0}function D(z){return z==="auto"?0:z}function O(z,L){var P=Math.PI/180*L,N=Math.abs(Math.sin(P)),B=Math.abs(Math.cos(P));return{x:z.width*B+z.height*N,y:z.width*N+z.height*B}}function R(z,L,P,N,B,G){var W=!!G.isHorizontal,K=!!G.constrained,te=G.angle||0,Y=G.anchor||"end",Z=Y==="end",re=Y==="start",U=((G.leftToRight||0)+1)/2,q=1-U,$=B.width,ne=B.height,H=Math.abs(L-z),Q=Math.abs(N-P),ee=H>2*T&&Q>2*T?T:0;H-=2*ee,Q-=2*ee;var ie=D(te);te!=="auto"||$<=H&&ne<=Q||!($>H||ne>Q)||($>Q||ne>H)&&$.01?ze:function(Re,qe,We){return We&&Re===qe?Re:Math.abs(Re-qe)>=2?ze(Re):Re>qe?Math.ceil(Re):Math.floor(Re)};Oe=Fe(Oe,de,Q),de=Fe(de,Oe,Q),ye=Fe(ye,Me,!Q),Me=Fe(Me,ye,!Q)}var Ve=S(u.ensureSingle(we,"path"),te,B,G);if(Ve.style("vector-effect","non-scaling-stroke").attr("d",isNaN((de-Oe)*(Me-ye))||ke&&z._context.staticPlot?"M0,0Z":"M"+Oe+","+ye+"V"+Me+"H"+de+"V"+ye+"Z").call(s.setClipUrl,L.layerClipId,z),!te.uniformtext.mode&&ee){var Ke=s.makePointStyleFns(U);s.singlePointStyle(ge,Ve,U,Ke,z)}(function(Re,qe,We,Ye,nt,ft,vt,Pt,At,at,et){var Ot,Wt=qe.xaxis,Jt=qe.yaxis,Be=Re._fullLayout;function Ge(Kt,Ht,mn){return u.ensureSingle(Kt,"text").text(Ht).attr({class:"bartext bartext-"+Ot,"text-anchor":"middle","data-notex":1}).call(s.font,mn).call(c.convertToTspans,Re)}var Tt=Ye[0].trace,dt=Tt.orientation==="h",Pe=function(Kt,Ht,mn,zn,pn){var tn,nn=Ht[0].trace;return tn=nn.texttemplate?function(sn,gn,bn,In,Hn){var Wn=gn[0].trace,ar=u.castOption(Wn,bn,"texttemplate");if(!ar)return"";var Or,vr,Er,Kn,Ln=Wn.type==="histogram",lr=Wn.type==="waterfall",Wr=Wn.type==="funnel",Mn=Wn.orientation==="h";Mn?(Or="y",vr=Hn,Er="x",Kn=In):(Or="x",vr=In,Er="y",Kn=Hn);function rr(_i){return d(Kn,Kn.c2l(_i),!0).text}var nr=gn[bn],Bn={};Bn.label=nr.p,Bn.labelLabel=Bn[Or+"Label"]=(Fr=nr.p,d(vr,vr.c2l(Fr),!0).text);var Fr,$r=u.castOption(Wn,nr.i,"text");($r===0||$r)&&(Bn.text=$r),Bn.value=nr.s,Bn.valueLabel=Bn[Er+"Label"]=rr(nr.s);var pr={};b(pr,Wn,nr.i),(Ln||pr.x===void 0)&&(pr.x=Mn?Bn.value:Bn.label),(Ln||pr.y===void 0)&&(pr.y=Mn?Bn.label:Bn.value),(Ln||pr.xLabel===void 0)&&(pr.xLabel=Mn?Bn.valueLabel:Bn.labelLabel),(Ln||pr.yLabel===void 0)&&(pr.yLabel=Mn?Bn.labelLabel:Bn.valueLabel),lr&&(Bn.delta=+nr.rawS||nr.s,Bn.deltaLabel=rr(Bn.delta),Bn.final=nr.v,Bn.finalLabel=rr(Bn.final),Bn.initial=Bn.final-Bn.delta,Bn.initialLabel=rr(Bn.initial)),Wr&&(Bn.value=nr.s,Bn.valueLabel=rr(Bn.value),Bn.percentInitial=nr.begR,Bn.percentInitialLabel=u.formatPercent(nr.begR),Bn.percentPrevious=nr.difR,Bn.percentPreviousLabel=u.formatPercent(nr.difR),Bn.percentTotal=nr.sumR,Bn.percenTotalLabel=u.formatPercent(nr.sumR));var qr=u.castOption(Wn,nr.i,"customdata");return qr&&(Bn.customdata=qr),u.texttemplateString(ar,Bn,sn._d3locale,pr,Bn,Wn._meta||{})}(Kt,Ht,mn,zn,pn):nn.textinfo?function(sn,gn,bn,In){var Hn=sn[0].trace,Wn=Hn.orientation==="h",ar=Hn.type==="waterfall",Or=Hn.type==="funnel";function vr(qr){return d(Wn?bn:In,+qr,!0).text}var Er,Kn=Hn.textinfo,Ln=sn[gn],lr=Kn.split("+"),Wr=[],Mn=function(qr){return lr.indexOf(qr)!==-1};Mn("label")&&Wr.push((rr=sn[gn].p,d(Wn?In:bn,rr,!0).text));var rr;if(Mn("text")&&((Er=u.castOption(Hn,Ln.i,"text"))===0||Er)&&Wr.push(Er),ar){var nr=+Ln.rawS||Ln.s,Bn=Ln.v,Fr=Bn-nr;Mn("initial")&&Wr.push(vr(Fr)),Mn("delta")&&Wr.push(vr(nr)),Mn("final")&&Wr.push(vr(Bn))}if(Or){Mn("value")&&Wr.push(vr(Ln.s));var $r=0;Mn("percent initial")&&$r++,Mn("percent previous")&&$r++,Mn("percent total")&&$r++;var pr=$r>1;Mn("percent initial")&&(Er=u.formatPercent(Ln.begR),pr&&(Er+=" of initial"),Wr.push(Er)),Mn("percent previous")&&(Er=u.formatPercent(Ln.difR),pr&&(Er+=" of previous"),Wr.push(Er)),Mn("percent total")&&(Er=u.formatPercent(Ln.sumR),pr&&(Er+=" of total"),Wr.push(Er))}return Wr.join("
")}(Ht,mn,zn,pn):v.getValue(nn.text,mn),v.coerceString(w,tn)}(Be,Ye,nt,Wt,Jt);Ot=function(Kt,Ht){var mn=v.getValue(Kt.textposition,Ht);return v.coerceEnumerated(k,mn)}(Tt,nt);var Ie=at.mode==="stack"||at.mode==="relative",Ae=Ye[nt],De=!Ie||Ae._outmost;if(!Pe||Ot==="none"||(Ae.isBlank||ft===vt||Pt===At)&&(Ot==="auto"||Ot==="inside"))return void We.select("text").remove();var He=Be.font,rt=p.getBarColor(Ye[nt],Tt),lt=p.getInsideTextFont(Tt,nt,He,rt),ot=p.getOutsideTextFont(Tt,nt,He),kt=We.datum();dt?Wt.type==="log"&&kt.s0<=0&&(ft=Wt.range[0]=Ut*(St/tt):St>=tt*(zt/Ut);Ut>0&&tt>0&&(Dt||Le||Je)?Ot="inside":(Ot="outside",wt.remove(),wt=null)}else Ot="inside";if(!wt){bt=u.ensureUniformFontSize(Re,Ot==="outside"?ot:lt);var st=(wt=Ge(We,Pe,bt)).attr("transform");if(wt.attr("transform",""),Vt=s.bBox(wt.node()),Ut=Vt.width,tt=Vt.height,wt.attr("transform",st),Ut<=0||tt<=0)return void wt.remove()}var Et,It,Zt=Tt.textangle;Ot==="outside"?(It=Tt.constraintext==="both"||Tt.constraintext==="outside",Et=function(Kt,Ht,mn,zn,pn,tn){var nn,sn=!!tn.isHorizontal,gn=!!tn.constrained,bn=tn.angle||0,In=pn.width,Hn=pn.height,Wn=Math.abs(Ht-Kt),ar=Math.abs(zn-mn);nn=sn?ar>2*T?T:0:Wn>2*T?T:0;var Or=1;gn&&(Or=sn?Math.min(1,ar/Hn):Math.min(1,Wn/In));var vr=D(bn),Er=O(pn,vr),Kn=(sn?Er.x:Er.y)/2,Ln=(pn.left+pn.right)/2,lr=(pn.top+pn.bottom)/2,Wr=(Kt+Ht)/2,Mn=(mn+zn)/2,rr=0,nr=0,Bn=sn?A(Ht,Kt):A(mn,zn);return sn?(Wr=Ht-Bn*nn,rr=Bn*Kn):(Mn=zn+Bn*nn,nr=-Bn*Kn),{textX:Ln,textY:lr,targetX:Wr,targetY:Mn,anchorX:rr,anchorY:nr,scale:Or,rotate:vr}}(ft,vt,Pt,At,Vt,{isHorizontal:dt,constrained:It,angle:Zt})):(It=Tt.constraintext==="both"||Tt.constraintext==="inside",Et=R(ft,vt,Pt,At,Vt,{isHorizontal:dt,constrained:It,angle:Zt,anchor:Tt.insidetextanchor})),Et.fontSize=bt.size,m(Tt.type==="histogram"?"bar":Tt.type,Et,Be),Ae.transform=Et,S(wt,Be,at,et).attr("transform",u.getTextTransform(Et))})(z,L,we,Z,fe,Oe,de,ye,Me,B,G),L.layerClipId&&s.hideOutsideRangePoint(ge,we.select("text"),W,K,U.xcalendar,U.ycalendar)});var le=U.cliponaxis===!1;s.setClipUrl(re,le?null:L.layerClipId,z)});l.getComponentMethod("errorbars","plot")(z,Y,L,B)},toMoveInsideBar:R}},{"../../components/color":366,"../../components/drawing":388,"../../components/fx/helpers":402,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../registry":638,"./attributes":648,"./constants":650,"./helpers":654,"./style":662,"./uniform_text":664,"@plotly/d3":58,"fast-isnumeric":190}],660:[function(e,o,f){function r(a,u,c,i,s){var l=u.c2p(i?a.s0:a.p0,!0),d=u.c2p(i?a.s1:a.p1,!0),h=c.c2p(i?a.p0:a.s0,!0),m=c.c2p(i?a.p1:a.s1,!0);return s?[(l+d)/2,(h+m)/2]:i?[d,(h+m)/2]:[(l+d)/2,m]}o.exports=function(a,u){var c,i=a.cd,s=a.xaxis,l=a.yaxis,d=i[0].trace,h=d.type==="funnel",m=d.orientation==="h",g=[];if(u===!1)for(c=0;c1||S.bargap===0&&S.bargroupgap===0&&!E[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")}),M.selectAll("g.points").each(function(E){p(r.select(this),E[0].trace,_)}),i.getComponentMethod("errorbars","style")(M)},styleTextPoints:v,styleOnSelect:function(_,M,A){var S=M[0].trace;S.selectedpoints?function(E,D,O){u.selectedPointStyle(E.selectAll("path"),D),function(R,z,L){R.each(function(P){var N,B=r.select(this);if(P.selected){N=c.ensureUniformFontSize(L,y(B,P,z,L));var G=z.selected.textfont&&z.selected.textfont.color;G&&(N.color=G),u.font(B,N)}else u.selectedTextStyle(B,z)})}(E.selectAll("text"),D,O)}(A,S,_):(p(A,S,_),i.getComponentMethod("errorbars","style")(A))},getInsideTextFont:w,getOutsideTextFont:k,getBarColor:T,resizeText:s}},{"../../components/color":366,"../../components/drawing":388,"../../lib":503,"../../registry":638,"./attributes":648,"./helpers":654,"./uniform_text":664,"@plotly/d3":58}],663:[function(e,o,f){var r=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,u=e("../../components/colorscale/defaults"),c=e("../../lib").coercePattern;o.exports=function(i,s,l,d,h){var m=l("marker.color",d),g=a(i,"marker");g&&u(i,s,h,l,{prefix:"marker.",cLetter:"c"}),l("marker.line.color",r.defaultLine),a(i,"marker.line")&&u(i,s,h,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width"),l("marker.opacity"),c(l,"marker.pattern",m,g),l("selected.marker.color"),l("unselected.marker.color")}},{"../../components/color":366,"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"../../lib":503}],664:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib");function u(c){return"_"+c+"Text_minsize"}o.exports={recordMinTextSize:function(c,i,s){if(s.uniformtext.mode){var l=u(c),d=s.uniformtext.minsize,h=i.scale*i.fontSize;i.hide=hv.range[1]&&(_+=Math.PI),r.getClosest(m,function(S){return w(T,_,[S.rp0,S.rp1],[S.thetag0,S.thetag1],x)?k+Math.min(1,Math.abs(S.thetag1-S.thetag0)/b)-1+(S.rp1-T)/(S.rp1-S.rp0)-1:1/0},l),l.index!==!1){var M=m[l.index];l.x0=l.x1=M.ct[0],l.y0=l.y1=M.ct[1];var A=a.extendFlat({},M,{r:M.s,theta:M.p});return c(M,g,l),i(A,g,p,l),l.hovertemplate=g.hovertemplate,l.color=u(g,M),l.xLabelVal=l.yLabelVal=void 0,M.s<0&&(l.idealAlign="left"),[l]}}},{"../../components/fx":406,"../../lib":503,"../../plots/polar/helpers":621,"../bar/hover":655,"../scatterpolar/hover":1006}],669:[function(e,o,f){o.exports={moduleType:"trace",name:"barpolar",basePlotModule:e("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("../scatterpolar/format_labels"),style:e("../bar/style").style,styleOnSelect:e("../bar/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../bar/select"),meta:{}}},{"../../plots/polar":622,"../bar/select":660,"../bar/style":662,"../scatter/marker_colorbar":945,"../scatterpolar/format_labels":1005,"./attributes":665,"./calc":666,"./defaults":667,"./hover":668,"./layout_attributes":670,"./layout_defaults":671,"./plot":672}],670:[function(e,o,f){o.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],671:[function(e,o,f){var r=e("../../lib"),a=e("./layout_attributes");o.exports=function(u,c,i){var s,l={};function d(g,p){return r.coerce(u[s]||{},c[s],a,g,p)}for(var h=0;h0?(A=_,S=M):(A=M,S=_);var E=[i.findEnclosingVertexAngles(A,x.vangles)[0],(A+S)/2,i.findEnclosingVertexAngles(S,x.vangles)[1]];return i.pathPolygonAnnulus(b,T,A,S,E,w,k)}:function(b,T,_,M){return u.pathAnnulus(b,T,_,M,w,k)}}(l),y=l.layers.frontplot.select("g.barlayer");u.makeTraceGroups(y,d,"trace bars").each(function(){var x=r.select(this),w=u.ensureSingle(x,"g","points").selectAll("g.point").data(u.identity);w.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),w.exit().remove(),w.each(function(k){var b,T=r.select(this),_=k.rp0=g.c2p(k.s0),M=k.rp1=g.c2p(k.s1),A=k.thetag0=p.c2g(k.p0),S=k.thetag1=p.c2g(k.p1);if(a(_)&&a(M)&&a(A)&&a(S)&&_!==M&&A!==S){var E=g.c2g(k.s1),D=(A+S)/2;k.ct=[h.c2p(E*Math.cos(D)),m.c2p(E*Math.sin(D))],b=v(_,M,A,S)}else b="M0,0Z";u.ensureSingle(T,"path").attr("d",b)}),c.setClipUrl(x,l._hasClipOnAxisFalse?l.clipIds.forTraces:null,s)})}},{"../../components/drawing":388,"../../lib":503,"../../plots/polar/helpers":621,"@plotly/d3":58,"fast-isnumeric":190}],673:[function(e,o,f){var r=e("../scatter/attributes"),a=e("../bar/attributes"),u=e("../../components/color/attributes"),c=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../lib/extend").extendFlat,l=r.marker,d=l.line;o.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:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:c("x"),yhoverformat:c("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"},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:s({},l.symbol,{arrayOk:!1,editType:"plot"}),opacity:s({},l.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:s({},l.size,{arrayOk:!1,editType:"calc"}),color:s({},l.color,{arrayOk:!1,editType:"style"}),line:{color:s({},d.color,{arrayOk:!1,dflt:u.defaultLine,editType:"style"}),width:s({},d.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:r.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:r.selected.marker,editType:"style"},unselected:{marker:r.unselected.marker,editType:"style"},text:s({},r.text,{}),hovertext:s({},r.hovertext,{}),hovertemplate:i({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":365,"../../lib/extend":493,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../bar/attributes":648,"../scatter/attributes":927}],674:[function(e,o,f){var r=e("fast-isnumeric"),a=e("../../plots/cartesian/axes"),u=e("../../plots/cartesian/align_period"),c=e("../../lib"),i=e("../../constants/numerical").BADNUM,s=c._;o.exports=function(w,k){var b,T,_,M,A,S,E,D=w._fullLayout,O=a.getFromId(w,k.xaxis||"x"),R=a.getFromId(w,k.yaxis||"y"),z=[],L=k.type==="violin"?"_numViolins":"_numBoxes";k.orientation==="h"?(_=O,M="x",A=R,S="y",E=!!k.yperiodalignment):(_=R,M="y",A=O,S="x",E=!!k.xperiodalignment);var P,N,B,G,W,K,te=function(We,Ye,nt,ft){var vt,Pt=Ye+"0"in We,At="d"+Ye in We;if(Ye in We||Pt&&At){var at=nt.makeCalcdata(We,Ye);return[u(We,nt,Ye,at).vals,at]}vt=Pt?We[Ye+"0"]:"name"in We&&(nt.type==="category"||r(We.name)&&["linear","log"].indexOf(nt.type)!==-1||c.isDateTime(We.name)&&nt.type==="date")?We.name:ft;for(var et=nt.type==="multicategory"?nt.r2c_just_indices(vt):nt.d2c(vt,0,We[Ye+"calendar"]),Ot=We._length,Wt=new Array(Ot),Jt=0;JtP.uf};if(k._hasPreCompStats){var ne=k[M],H=function(We){return _.d2c((k[We]||[])[b])},Q=1/0,ee=-1/0;for(b=0;b=P.q1&&P.q3>=P.med){var ae=H("lowerfence");P.lf=ae!==i&&ae<=P.q1?ae:g(P,B,G);var ue=H("upperfence");P.uf=ue!==i&&ue>=P.q3?ue:p(P,B,G);var le=H("mean");P.mean=le!==i?le:G?c.mean(B,G):(P.q1+P.q3)/2;var ge=H("sd");P.sd=le!==i&&ge>=0?ge:G?c.stdev(B,G,P.mean):P.q3-P.q1,P.lo=v(P),P.uo=y(P);var fe=H("notchspan");fe=fe!==i&&fe>0?fe:x(P,G),P.ln=P.med-fe,P.un=P.med+fe;var me=P.lf,_e=P.uf;k.boxpoints&&B.length&&(me=Math.min(me,B[0]),_e=Math.max(_e,B[G-1])),k.notched&&(me=Math.min(me,P.ln),_e=Math.max(_e,P.un)),P.min=me,P.max=_e}else{var we;c.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+P.q1,"median = "+P.med,"q3 = "+P.q3].join(` +`)),we=P.med!==i?P.med:P.q1!==i?P.q3!==i?(P.q1+P.q3)/2:P.q1:P.q3!==i?P.q3:0,P.med=we,P.q1=P.q3=we,P.lf=P.uf=we,P.mean=P.sd=we,P.ln=P.un=we,P.min=P.max=we}Q=Math.min(Q,P.min),ee=Math.max(ee,P.max),P.pts2=N.filter($),z.push(P)}}k._extremes[_._id]=a.findExtremes(_,[Q,ee],{padded:!0})}else{var Te=_.makeCalcdata(k,M),Oe=function(We,Ye){for(var nt=We.length,ft=new Array(nt+1),vt=0;vt=0&&Me0){var Ke,Re;(P={}).pos=P[S]=U[b],N=P.pts=ye[b].sort(h),G=(B=P[M]=N.map(m)).length,P.min=B[0],P.max=B[G-1],P.mean=c.mean(B,G),P.sd=c.stdev(B,G,P.mean),P.med=c.interp(B,.5),G%2&&(Fe||Ve)?(Fe?(Ke=B.slice(0,G/2),Re=B.slice(G/2+1)):Ve&&(Ke=B.slice(0,G/2+1),Re=B.slice(G/2)),P.q1=c.interp(Ke,.5),P.q3=c.interp(Re,.5)):(P.q1=c.interp(B,.25),P.q3=c.interp(B,.75)),P.lf=g(P,B,G),P.uf=p(P,B,G),P.lo=v(P),P.uo=y(P);var qe=x(P,G);P.ln=P.med-qe,P.un=P.med+qe,ke=Math.min(ke,P.ln),Ee=Math.max(Ee,P.un),P.pts2=N.filter($),z.push(P)}k._extremes[_._id]=a.findExtremes(_,k.notched?Te.concat([ke,Ee]):Te,{padded:!0})}return function(We,Ye){if(c.isArrayOrTypedArray(Ye.selectedpoints))for(var nt=0;nt0?(z[0].t={num:D[L],dPos:q,posLetter:S,valLetter:M,labels:{med:s(w,"median:"),min:s(w,"min:"),q1:s(w,"q1:"),q3:s(w,"q3:"),max:s(w,"max:"),mean:k.boxmean==="sd"?s(w,"mean \xB1 \u03C3:"):s(w,"mean:"),lf:s(w,"lower fence:"),uf:s(w,"upper fence:")}},D[L]++,z):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function d(w,k,b){for(var T in l)c.isArrayOrTypedArray(k[T])&&(Array.isArray(b)?c.isArrayOrTypedArray(k[T][b[0]])&&(w[l[T]]=k[T][b[0]][b[1]]):w[l[T]]=k[T][b])}function h(w,k){return w.v-k.v}function m(w){return w.v}function g(w,k,b){return b===0?w.q1:Math.min(w.q1,k[Math.min(c.findBin(2.5*w.q1-1.5*w.q3,k,!0)+1,b-1)])}function p(w,k,b){return b===0?w.q3:Math.max(w.q3,k[Math.max(c.findBin(2.5*w.q3-1.5*w.q1,k),0)])}function v(w){return 4*w.q1-3*w.q3}function y(w){return 4*w.q3-3*w.q1}function x(w,k){return k===0?0:1.57*(w.q3-w.q1)/Math.sqrt(k)}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554,"fast-isnumeric":190}],675:[function(e,o,f){var r=e("../../plots/cartesian/axes"),a=e("../../lib"),u=e("../../plots/cartesian/constraints").getAxisGroup,c=["v","h"];function i(s,l,d,h){var m,g,p,v=l.calcdata,y=l._fullLayout,x=h._id,w=x.charAt(0),k=[],b=0;for(m=0;m1,S=1-y[s+"gap"],E=1-y[s+"groupgap"];for(m=0;m0){var ie=N.pointpos,ae=N.jitter,ue=N.marker.size/2,le=0;ie+ae>=0&&((le=Q*(ie+ae))>L?(ee=!0,ne=ue,q=le):le>re&&(ne=ue,q=L)),le<=L&&(q=L);var ge=0;ie-ae<=0&&((ge=-Q*(ie-ae))>P?(ee=!0,H=ue,$=ge):ge>U&&(H=ue,$=P)),ge<=P&&($=P)}else q=L,$=P;var fe=new Array(p.length);for(g=0;g0?(A="v",S=D>0?Math.min(R,O):Math.min(O)):D>0?(A="h",S=Math.min(R)):S=0;if(S){g._length=S;var G=p("orientation",A);g._hasPreCompStats?G==="v"&&D===0?(p("x0",0),p("dx",1)):G==="h"&&E===0&&(p("y0",0),p("dy",1)):G==="v"&&D===0?p("x0"):G==="h"&&E===0&&p("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(m,g,["x","y"],v)}else g.visible=!1}function h(m,g,p,v){var y=v.prefix,x=r.coerce2(m,g,l,"marker.outliercolor"),w=p("marker.line.outliercolor"),k="outliers";g._hasPreCompStats?k="all":(x||w)&&(k="suspectedoutliers");var b=p(y+"points",k);b?(p("jitter",b==="all"?.3:0),p("pointpos",b==="all"?-1.5:0),p("marker.symbol"),p("marker.opacity"),p("marker.size"),p("marker.color",g.line.color),p("marker.line.color"),p("marker.line.width"),b==="suspectedoutliers"&&(p("marker.line.outliercolor",g.marker.color),p("marker.line.outlierwidth")),p("selected.marker.color"),p("unselected.marker.color"),p("selected.marker.size"),p("unselected.marker.size"),p("text"),p("hovertext")):delete g.marker;var T=p("hoveron");T!=="all"&&T.indexOf("points")===-1||p("hovertemplate"),r.coerceSelectionMarkerOpacity(g,p)}o.exports={supplyDefaults:function(m,g,p,v){function y(M,A){return r.coerce(m,g,l,M,A)}if(d(m,g,y,v),g.visible!==!1){c(m,g,v,y),y("xhoverformat"),y("yhoverformat");var x=g._hasPreCompStats;x&&(y("lowerfence"),y("upperfence")),y("line.color",(m.marker||{}).color||p),y("line.width"),y("fillcolor",u.addOpacity(g.line.color,.5));var w=!1;if(x){var k=y("mean"),b=y("sd");k&&k.length&&(w=!0,b&&b.length&&(w="sd"))}y("boxmean",w),y("whiskerwidth"),y("width"),y("quartilemethod");var T=!1;if(x){var _=y("notchspan");_&&_.length&&(T=!0)}else r.validate(m.notchwidth,l.notchwidth)&&(T=!0);y("notched",T)&&y("notchwidth"),h(m,g,y,{prefix:"box"})}},crossTraceDefaults:function(m,g){var p,v;function y(k){return r.coerce(v._input,v,l,k)}for(var x=0;xb.lo&&(B.so=!0)}return M});k.enter().append("path").classed("point",!0),k.exit().remove(),k.call(u.translatePoints,g,p)}function s(l,d,h,m){var g,p,v=d.val,y=d.pos,x=!!y.rangebreaks,w=m.bPos,k=m.bPosPxOffset||0,b=h.boxmean||(h.meanline||{}).visible;Array.isArray(m.bdPos)?(g=m.bdPos[0],p=m.bdPos[1]):(g=m.bdPos,p=m.bdPos);var T=l.selectAll("path.mean").data(h.type==="box"&&h.boxmean||h.type==="violin"&&h.box.visible&&h.meanline.visible?a.identity:[]);T.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),T.exit().remove(),T.each(function(_){var M=y.c2l(_.pos+w,!0),A=y.l2p(M-g)+k,S=y.l2p(M+p)+k,E=x?(A+S)/2:y.l2p(M)+k,D=v.c2p(_.mean,!0),O=v.c2p(_.mean-_.sd,!0),R=v.c2p(_.mean+_.sd,!0);h.orientation==="h"?r.select(this).attr("d","M"+D+","+A+"V"+S+(b==="sd"?"m0,0L"+O+","+E+"L"+D+","+A+"L"+R+","+E+"Z":"")):r.select(this).attr("d","M"+A+","+D+"H"+S+(b==="sd"?"m0,0L"+E+","+O+"L"+A+","+D+"L"+E+","+R+"Z":""))})}o.exports={plot:function(l,d,h,m){var g=d.xaxis,p=d.yaxis;a.makeTraceGroups(m,h,"trace boxes").each(function(v){var y,x,w=r.select(this),k=v[0],b=k.t,T=k.trace;b.wdPos=b.bdPos*T.whiskerwidth,T.visible!==!0||b.empty?w.remove():(T.orientation==="h"?(y=p,x=g):(y=g,x=p),c(w,{pos:y,val:x},T,b),i(w,{x:g,y:p},T,b),s(w,{pos:y,val:x},T,b))})},plotBoxAndWhiskers:c,plotPoints:i,plotBoxMean:s}},{"../../components/drawing":388,"../../lib":503,"@plotly/d3":58}],683:[function(e,o,f){o.exports=function(r,a){var u,c,i=r.cd,s=r.xaxis,l=r.yaxis,d=[];if(a===!1)for(u=0;u=10)return null;for(var s=1/0,l=-1/0,d=c.length,h=0;h0?Math.floor:Math.ceil,G=P>0?Math.ceil:Math.floor,W=P>0?Math.min:Math.max,K=P>0?Math.max:Math.min,te=B(z+N),Y=G(L-N),Z=[[p=R(z)]];for(s=te;s*P=0;i--)s[g-i]=r[p][i],l[g-i]=a[p][i];for(d.push({x:s,y:l,bicubic:h}),i=p,s=[],l=[];i>=0;i--)s[p-i]=r[i][0],l[p-i]=a[i][0];return d.push({x:s,y:l,bicubic:m}),d}},{}],697:[function(e,o,f){var r=e("../../plots/cartesian/axes"),a=e("../../lib/extend").extendFlat;o.exports=function(u,c,i){var s,l,d,h,m,g,p,v,y,x,w,k,b,T,_=u["_"+c],M=u[c+"axis"],A=M._gridlines=[],S=M._minorgridlines=[],E=M._boundarylines=[],D=u["_"+i],O=u[i+"axis"];M.tickmode==="array"&&(M.tickvals=_.slice());var R=u._xctrl,z=u._yctrl,L=R[0].length,P=R.length,N=u._a.length,B=u._b.length;r.prepTicks(M),M.tickmode==="array"&&delete M.tickvals;var G=M.smoothing?3:1;function W(te){var Y,Z,re,U,q,$,ne,H,Q,ee,ie,ae,ue=[],le=[],ge={};if(c==="b")for(Z=u.b2j(te),re=Math.floor(Math.max(0,Math.min(B-2,Z))),U=Z-re,ge.length=B,ge.crossLength=N,ge.xy=function(fe){return u.evalxy([],fe,Z)},ge.dxy=function(fe,me){return u.dxydi([],fe,re,me,U)},Y=0;Y0&&(Q=u.dxydi([],Y-1,re,0,U),ue.push(q[0]+Q[0]/3),le.push(q[1]+Q[1]/3),ee=u.dxydi([],Y-1,re,1,U),ue.push(H[0]-ee[0]/3),le.push(H[1]-ee[1]/3)),ue.push(H[0]),le.push(H[1]),q=H;else for(Y=u.a2i(te),$=Math.floor(Math.max(0,Math.min(N-2,Y))),ne=Y-$,ge.length=N,ge.crossLength=B,ge.xy=function(fe){return u.evalxy([],Y,fe)},ge.dxy=function(fe,me){return u.dxydj([],$,fe,ne,me)},Z=0;Z0&&(ie=u.dxydj([],$,Z-1,ne,0),ue.push(q[0]+ie[0]/3),le.push(q[1]+ie[1]/3),ae=u.dxydj([],$,Z-1,ne,1),ue.push(H[0]-ae[0]/3),le.push(H[1]-ae[1]/3)),ue.push(H[0]),le.push(H[1]),q=H;return ge.axisLetter=c,ge.axis=M,ge.crossAxis=O,ge.value=te,ge.constvar=i,ge.index=v,ge.x=ue,ge.y=le,ge.smoothing=O.smoothing,ge}function K(te){var Y,Z,re,U,q,$=[],ne=[],H={};if(H.length=_.length,H.crossLength=D.length,c==="b")for(re=Math.max(0,Math.min(B-2,te)),q=Math.min(1,Math.max(0,te-re)),H.xy=function(Q){return u.evalxy([],Q,te)},H.dxy=function(Q,ee){return u.dxydi([],Q,re,ee,q)},Y=0;Y_.length-1||A.push(a(K(l),{color:M.gridcolor,width:M.gridwidth}));for(v=g;v_.length-1||w<0||w>_.length-1))for(k=_[d],b=_[w],s=0;s_[_.length-1]||S.push(a(W(x),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&E.push(a(K(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&E.push(a(K(_.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(h=5e-15,g=(m=[Math.floor((_[_.length-1]-M.tick0)/M.dtick*(1+h)),Math.ceil((_[0]-M.tick0)/M.dtick/(1+h))].sort(function(te,Y){return te-Y}))[0],p=m[1],v=g;v<=p;v++)y=M.tick0+M.dtick*v,A.push(a(W(y),{color:M.gridcolor,width:M.gridwidth}));for(v=g-1;v_[_.length-1]||S.push(a(W(x),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&E.push(a(W(_[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&E.push(a(W(_[_.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":493,"../../plots/cartesian/axes":554}],698:[function(e,o,f){var r=e("../../plots/cartesian/axes"),a=e("../../lib/extend").extendFlat;o.exports=function(u,c){var i,s,l,d=c._labels=[],h=c._gridlines;for(i=0;iu.length&&(a=a.slice(0,u.length)):a=[],i=0;i90&&(y-=180,h=-h),{angle:y,flip:h,p:r.c2p(c,a,u),offsetMultplier:m}}},{}],712:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../components/drawing"),u=e("./map_1d_array"),c=e("./makepath"),i=e("./orient_text"),s=e("../../lib/svg_text_utils"),l=e("../../lib"),d=l.strRotate,h=l.strTranslate,m=e("../../constants/alignment");function g(w,k,b,T,_,M){var A="const-"+_+"-lines",S=b.selectAll("."+A).data(M);S.enter().append("path").classed(A,!0).style("vector-effect","non-scaling-stroke"),S.each(function(E){var D=E,O=D.x,R=D.y,z=u([],O,w.c2p),L=u([],R,k.c2p),P="M"+c(z,L,D.smoothing);r.select(this).attr("d",P).style("stroke-width",D.width).style("stroke",D.color).style("fill","none")}),S.exit().remove()}function p(w,k,b,T,_,M,A,S){var E=M.selectAll("text."+S).data(A);E.enter().append("text").classed(S,!0);var D=0,O={};return E.each(function(R,z){var L;if(R.axis.tickangle==="auto")L=i(T,k,b,R.xy,R.dxy);else{var P=(R.axis.tickangle+180)*Math.PI/180;L=i(T,k,b,R.xy,[Math.cos(P),Math.sin(P)])}z||(O={angle:L.angle,flip:L.flip});var N=(R.endAnchor?-1:1)*L.flip,B=r.select(this).attr({"text-anchor":N>0?"start":"end","data-notex":1}).call(a.font,R.font).text(R.text).call(s.convertToTspans,w),G=a.bBox(this);B.attr("transform",h(L.p[0],L.p[1])+d(L.angle)+h(R.axis.labelpadding*N,.3*G.height)),D=Math.max(D,G.width+R.axis.labelpadding)}),E.exit().remove(),O.maxExtent=D,O}o.exports=function(w,k,b,T){var _=k.xaxis,M=k.yaxis,A=w._fullLayout._clips;l.makeTraceGroups(T,b,"trace").each(function(S){var E=r.select(this),D=S[0],O=D.trace,R=O.aaxis,z=O.baxis,L=l.ensureSingle(E,"g","minorlayer"),P=l.ensureSingle(E,"g","majorlayer"),N=l.ensureSingle(E,"g","boundarylayer"),B=l.ensureSingle(E,"g","labellayer");E.style("opacity",O.opacity),g(_,M,P,R,"a",R._gridlines),g(_,M,P,z,"b",z._gridlines),g(_,M,L,R,"a",R._minorgridlines),g(_,M,L,z,"b",z._minorgridlines),g(_,M,N,R,"a-boundary",R._boundarylines),g(_,M,N,z,"b-boundary",z._boundarylines);var G=p(w,_,M,O,D,B,R._labels,"a-label"),W=p(w,_,M,O,D,B,z._labels,"b-label");(function(K,te,Y,Z,re,U,q,$){var ne,H,Q,ee,ie=l.aggNums(Math.min,null,Y.a),ae=l.aggNums(Math.max,null,Y.a),ue=l.aggNums(Math.min,null,Y.b),le=l.aggNums(Math.max,null,Y.b);ne=.5*(ie+ae),H=ue,Q=Y.ab2xy(ne,H,!0),ee=Y.dxyda_rough(ne,H),q.angle===void 0&&l.extendFlat(q,i(Y,re,U,Q,Y.dxydb_rough(ne,H))),x(K,te,Y,Z,Q,ee,Y.aaxis,re,U,q,"a-title"),ne=ie,H=.5*(ue+le),Q=Y.ab2xy(ne,H,!0),ee=Y.dxydb_rough(ne,H),$.angle===void 0&&l.extendFlat($,i(Y,re,U,Q,Y.dxyda_rough(ne,H))),x(K,te,Y,Z,Q,ee,Y.baxis,re,U,$,"b-title")})(w,B,O,D,_,M,G,W),function(K,te,Y,Z,re){var U,q,$,ne,H=Y.select("#"+K._clipPathId);H.size()||(H=Y.append("clipPath").classed("carpetclip",!0));var Q=l.ensureSingle(H,"path","carpetboundary"),ee=te.clipsegments,ie=[];for(ne=0;ne90&&B<270,W=r.select(this);W.text(A.title.text).call(s.convertToTspans,w),G&&(L=(-s.lineCount(W)+y)*v*N-L),W.attr("transform",h(P.p[0],P.p[1])+d(P.angle)+h(0,L)).attr("text-anchor","middle").call(a.font,A.title.font)}),z.exit().remove()}},{"../../components/drawing":388,"../../constants/alignment":471,"../../lib":503,"../../lib/svg_text_utils":529,"./makepath":709,"./map_1d_array":710,"./orient_text":711,"@plotly/d3":58}],713:[function(e,o,f){var r=e("./constants"),a=e("../../lib/search").findBin,u=e("./compute_control_points"),c=e("./create_spline_evaluator"),i=e("./create_i_derivative_evaluator"),s=e("./create_j_derivative_evaluator");o.exports=function(l){var d=l._a,h=l._b,m=d.length,g=h.length,p=l.aaxis,v=l.baxis,y=d[0],x=d[m-1],w=h[0],k=h[g-1],b=d[d.length-1]-d[0],T=h[h.length-1]-h[0],_=b*r.RELATIVE_CULL_TOLERANCE,M=T*r.RELATIVE_CULL_TOLERANCE;y-=_,x+=_,w-=M,k+=M,l.isVisible=function(A,S){return A>y&&Aw&&Sx||Sk},l.setScale=function(){var A=l._x,S=l._y,E=u(l._xctrl,l._yctrl,A,S,p.smoothing,v.smoothing);l._xctrl=E[0],l._yctrl=E[1],l.evalxy=c([l._xctrl,l._yctrl],m,g,p.smoothing,v.smoothing),l.dxydi=i([l._xctrl,l._yctrl],p.smoothing,v.smoothing),l.dxydj=s([l._xctrl,l._yctrl],p.smoothing,v.smoothing)},l.i2a=function(A){var S=Math.max(0,Math.floor(A[0]),m-2),E=A[0]-S;return(1-E)*d[S]+E*d[S+1]},l.j2b=function(A){var S=Math.max(0,Math.floor(A[1]),m-2),E=A[1]-S;return(1-E)*h[S]+E*h[S+1]},l.ij2ab=function(A){return[l.i2a(A[0]),l.j2b(A[1])]},l.a2i=function(A){var S=Math.max(0,Math.min(a(A,d),m-2)),E=d[S],D=d[S+1];return Math.max(0,Math.min(m-1,S+(A-E)/(D-E)))},l.b2j=function(A){var S=Math.max(0,Math.min(a(A,h),g-2)),E=h[S],D=h[S+1];return Math.max(0,Math.min(g-1,S+(A-E)/(D-E)))},l.ab2ij=function(A){return[l.a2i(A[0]),l.b2j(A[1])]},l.i2c=function(A,S){return l.evalxy([],A,S)},l.ab2xy=function(A,S,E){if(!E&&(Ad[m-1]|Sh[g-1]))return[!1,!1];var D=l.a2i(A),O=l.b2j(S),R=l.evalxy([],D,O);if(E){var z,L,P,N,B=0,G=0,W=[];Ad[m-1]?(z=m-2,L=1,B=(A-d[m-1])/(d[m-1]-d[m-2])):L=D-(z=Math.max(0,Math.min(m-2,Math.floor(D)))),Sh[g-1]?(P=g-2,N=1,G=(S-h[g-1])/(h[g-1]-h[g-2])):N=O-(P=Math.max(0,Math.min(g-2,Math.floor(O)))),B&&(l.dxydi(W,z,P,L,N),R[0]+=W[0]*B,R[1]+=W[1]*B),G&&(l.dxydj(W,z,P,L,N),R[0]+=W[0]*G,R[1]+=W[1]*G)}return R},l.c2p=function(A,S,E){return[S.c2p(A[0]),E.c2p(A[1])]},l.p2x=function(A,S,E){return[S.p2c(A[0]),E.p2c(A[1])]},l.dadi=function(A){var S=Math.max(0,Math.min(d.length-2,A));return d[S+1]-d[S]},l.dbdj=function(A){var S=Math.max(0,Math.min(h.length-2,A));return h[S+1]-h[S]},l.dxyda=function(A,S,E,D){var O=l.dxydi(null,A,S,E,D),R=l.dadi(A,E);return[O[0]/R,O[1]/R]},l.dxydb=function(A,S,E,D){var O=l.dxydj(null,A,S,E,D),R=l.dbdj(S,D);return[O[0]/R,O[1]/R]},l.dxyda_rough=function(A,S,E){var D=b*(E||.1),O=l.ab2xy(A+D,S,!0),R=l.ab2xy(A-D,S,!0);return[.5*(O[0]-R[0])/D,.5*(O[1]-R[1])/D]},l.dxydb_rough=function(A,S,E){var D=T*(E||.1),O=l.ab2xy(A,S+D,!0),R=l.ab2xy(A,S-D,!0);return[.5*(O[0]-R[0])/D,.5*(O[1]-R[1])/D]},l.dpdx=function(A){return A._m},l.dpdy=function(A){return A._m}}},{"../../lib/search":523,"./compute_control_points":701,"./constants":702,"./create_i_derivative_evaluator":703,"./create_j_derivative_evaluator":704,"./create_spline_evaluator":705}],714:[function(e,o,f){var r=e("../../lib");o.exports=function(a,u,c){var i,s,l,d=[],h=[],m=a[0].length,g=a.length;function p(te,Y){var Z,re=0,U=0;return te>0&&(Z=a[Y][te-1])!==void 0&&(U++,re+=Z),te0&&(Z=a[Y-1][te])!==void 0&&(U++,re+=Z),Y0&&s0&&i1e-5);return r.log("Smoother converged to",D,"after",O,"iterations"),a}},{"../../lib":503}],715:[function(e,o,f){var r=e("../../lib").isArray1D;o.exports=function(a,u,c){var i=c("x"),s=i&&i.length,l=c("y"),d=l&&l.length;if(!s&&!d)return!1;if(u._cheater=!i,s&&!r(i)||d&&!r(l))u._length=null;else{var h=s?i.length:1/0;d&&(h=Math.min(h,l.length)),u.a&&u.a.length&&(h=Math.min(h,u.a.length)),u.b&&u.b.length&&(h=Math.min(h,u.b.length)),u._length=h}return!0}},{"../../lib":503}],716:[function(e,o,f){var r=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../scattergeo/attributes"),u=e("../../components/colorscale/attributes"),c=e("../../plots/attributes"),i=e("../../components/color/attributes").defaultLine,s=e("../../lib/extend").extendFlat,l=a.marker.line;o.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},a.geojson,{}),featureidkey:a.featureidkey,text:s({},a.text,{}),hovertext:s({},a.hovertext,{}),marker:{line:{color:s({},l.color,{dflt:i}),width:s({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},c.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:r(),showlegend:s({},c.showlegend,{dflt:!1})},u("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":365,"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scattergeo/attributes":969}],717:[function(e,o,f){var r=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,u=e("../../components/colorscale/calc"),c=e("../scatter/arrays_to_calcdata"),i=e("../scatter/calc_selection");function s(l){return l&&typeof l=="string"}o.exports=function(l,d){var h,m=d._length,g=new Array(m);h=d.geojson?function(w){return s(w)||r(w)}:s;for(var p=0;p")}}(c,p,l),[c]}},{"../../lib":503,"../../plots/cartesian/axes":554,"./attributes":716}],721:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"choropleth",basePlotModule:e("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":589,"../heatmap/colorbar":795,"./attributes":716,"./calc":717,"./defaults":718,"./event_data":719,"./hover":720,"./plot":722,"./select":723,"./style":724}],722:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=e("../../lib/geo_location_utils"),c=e("../../lib/topojson_utils").getTopojsonFeatures,i=e("../../plots/cartesian/autorange").findExtremes,s=e("./style").style;o.exports={calcGeoJSON:function(l,d){for(var h=l[0].trace,m=d[h.geo],g=m._subplot,p=h.locationmode,v=h._length,y=p==="geojson-id"?u.extractTraceFeature(l):c(h,g.topojson),x=[],w=[],k=0;k=0;c--){var i=u[c].id;if(typeof i=="string"&&i.indexOf("water")===0){for(var s=c+1;s=0;d--)s.removeLayer(l[d][1])},i.dispose=function(){var s=this.subplot.map;this._removeLayers(),s.removeSource(this.sourceId)},o.exports=function(s,l){var d=l[0].trace,h=new c(s,d.uid),m=h.sourceId,g=r(l),p=h.below=s.belowLookup["trace-"+d.uid];return s.map.addSource(m,{type:"geojson",data:g.geojson}),h._addLayers(g,p),l[0].trace._glTrace=h,h}},{"../../plots/mapbox/constants":611,"./convert":726}],730:[function(e,o,f){var r=e("../../components/colorscale/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,u=e("../../plots/template_attributes").hovertemplateAttrs,c=e("../mesh3d/attributes"),i=e("../../plots/attributes"),s=e("../../lib/extend").extendFlat,l={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"],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:u({editType:"calc"},{keys:["norm"]}),uhoverformat:a("u",1),vhoverformat:a("v",1),whoverformat:a("w",1),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),showlegend:s({},i.showlegend,{dflt:!1})};s(l,r("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach(function(d){l[d]=c[d]}),l.hoverinfo=s({},i.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,o.exports=l},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../mesh3d/attributes":867}],731:[function(e,o,f){var r=e("../../components/colorscale/calc");o.exports=function(a,u){for(var c=u.u,i=u.v,s=u.w,l=Math.min(u.x.length,u.y.length,u.z.length,c.length,i.length,s.length),d=-1/0,h=1/0,m=0;ml.level||l.starts.length&&s===l.level)}break;case"constraint":if(c.prefixBoundary=!1,c.edgepaths.length)return;var d=c.x.length,h=c.y.length,m=-1/0,g=1/0;for(u=0;u":y>m&&(c.prefixBoundary=!0);break;case"<":(ym||c.starts.length&&v===g)&&(c.prefixBoundary=!0);break;case"][":p=Math.min(y[0],y[1]),v=Math.max(y[0],y[1]),pm&&(c.prefixBoundary=!0)}}}},{}],738:[function(e,o,f){var r=e("../../components/colorscale"),a=e("./make_color_map"),u=e("./end_plus");o.exports={min:"zmin",max:"zmax",calc:function(c,i,s){var l=i.contours,d=i.line,h=l.size||1,m=l.coloring,g=a(i,{isColorbar:!0});if(m==="heatmap"){var p=r.extractOpts(i);s._fillgradient=p.reversescale?r.flipScale(p.colorscale):p.colorscale,s._zrange=[p.min,p.max]}else m==="fill"&&(s._fillcolor=g);s._line={color:m==="lines"?g:d.color,width:l.showlines!==!1?d.width:0,dash:d.dash},s._levels={start:l.start,end:u(l),size:h}}}},{"../../components/colorscale":378,"./end_plus":746,"./make_color_map":751}],739:[function(e,o,f){o.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}}},{}],740:[function(e,o,f){var r=e("fast-isnumeric"),a=e("./label_defaults"),u=e("../../components/color"),c=u.addOpacity,i=u.opacity,s=e("../../constants/filter_ops"),l=s.CONSTRAINT_REDUCTION,d=s.COMPARISON_OPS2;o.exports=function(h,m,g,p,v,y){var x,w,k,b=m.contours,T=g("contours.operation");b._operation=l[T],function(_,M){var A;d.indexOf(M.operation)===-1?(_("contours.value",[0,1]),Array.isArray(M.value)?M.value.length>2?M.value=M.value.slice(2):M.length===0?M.value=[0,1]:M.length<2?(A=parseFloat(M.value[0]),M.value=[A,A+1]):M.value=[parseFloat(M.value[0]),parseFloat(M.value[1])]:r(M.value)&&(A=parseFloat(M.value),M.value=[A,A+1])):(_("contours.value",0),r(M.value)||(Array.isArray(M.value)?M.value=parseFloat(M.value[0]):M.value=0))}(g,b),T==="="?x=b.showlines=!0:(x=g("contours.showlines"),k=g("fillcolor",c((h.line||{}).color||v,.5))),x&&(w=g("line.color",k&&i(k)?c(m.fillcolor,1):v),g("line.width",2),g("line.dash")),g("line.smoothing"),a(g,p,w,y)}},{"../../components/color":366,"../../constants/filter_ops":475,"./label_defaults":750,"fast-isnumeric":190}],741:[function(e,o,f){var r=e("../../constants/filter_ops"),a=e("fast-isnumeric");function u(s,l){var d,h=Array.isArray(l);function m(g){return a(g)?+g:null}return r.COMPARISON_OPS2.indexOf(s)!==-1?d=m(h?l[0]:l):r.INTERVAL_OPS.indexOf(s)!==-1?d=h?[m(l[0]),m(l[1])]:[m(l),m(l)]:r.SET_OPS.indexOf(s)!==-1&&(d=h?l.map(m):[m(l)]),d}function c(s){return function(l){l=u(s,l);var d=Math.min(l[0],l[1]),h=Math.max(l[0],l[1]);return{start:d,end:h,size:h-d}}}function i(s){return function(l){return{start:l=u(s,l),end:1/0,size:1/0}}}o.exports={"[]":c("[]"),"][":c("]["),">":i(">"),"<":i("<"),"=":i("=")}},{"../../constants/filter_ops":475,"fast-isnumeric":190}],742:[function(e,o,f){o.exports=function(r,a,u,c){var i=c("contours.start"),s=c("contours.end"),l=i===!1||s===!1,d=u("contours.size");!(l?a.autocontour=!0:u("autocontour",!1))&&d||u("ncontours")}},{}],743:[function(e,o,f){var r=e("../../lib");function a(u){return r.extendFlat({},u,{edgepaths:r.extendDeep([],u.edgepaths),paths:r.extendDeep([],u.paths),starts:r.extendDeep([],u.starts)})}o.exports=function(u,c){var i,s,l,d=function(g){return g.reverse()},h=function(g){return g};switch(c){case"=":case"<":return u;case">":for(u.length!==1&&r.warn("Contour data invalid for the specified inequality operation."),s=u[0],i=0;i1e3){r.warn("Too many contours, clipping at 1000",c);break}return h}},{"../../lib":503,"./constraint_mapping":741,"./end_plus":746}],746:[function(e,o,f){o.exports=function(r){return r.end+r.size/1e6}},{}],747:[function(e,o,f){var r=e("../../lib"),a=e("./constants");function u(s,l,d,h){return Math.abs(s[0]-l[0])20&&ee?Q===208||Q===1114?ae=ie[0]===0?1:-1:ue=ie[1]===0?1:-1:a.BOTTOMSTART.indexOf(Q)!==-1?ue=1:a.LEFTSTART.indexOf(Q)!==-1?ae=1:a.TOPSTART.indexOf(Q)!==-1?ue=-1:ae=-1,[ae,ue]}(v,d,l),x=[i(s,l,[-y[0],-y[1]])],w=s.z.length,k=s.z[0].length,b=l.slice(),T=y.slice();for(g=0;g<1e4;g++){if(v>20?(v=a.CHOOSESADDLE[v][(y[0]||y[1])<0?0:1],s.crossings[p]=a.SADDLEREMAINDER[v]):delete s.crossings[p],!(y=a.NEWDELTA[v])){r.log("Found bad marching index:",v,l,s.level);break}x.push(i(s,l,y)),l[0]+=y[0],l[1]+=y[1],p=l.join(","),u(x[x.length-1],x[x.length-2],h,m)&&x.pop();var _=y[0]&&(l[0]<0||l[0]>k-2)||y[1]&&(l[1]<0||l[1]>w-2);if(l[0]===b[0]&&l[1]===b[1]&&y[0]===T[0]&&y[1]===T[1]||d&&_)break;v=s.crossings[p]}g===1e4&&r.log("Infinite loop in contour?");var M,A,S,E,D,O,R,z,L,P,N,B,G,W,K,te=u(x[0],x[x.length-1],h,m),Y=0,Z=.2*s.smoothing,re=[],U=0;for(g=1;g=U;g--)if((M=re[g])=U&&M+re[A]z&&L--,s.edgepaths[L]=N.concat(x,P));break}H||(s.edgepaths[z]=x.concat(P))}for(z=0;zu?0:1)+(c[0][1]>u?0:2)+(c[1][1]>u?0:4)+(c[1][0]>u?0:8);return i===5||i===10?u>(c[0][0]+c[0][1]+c[1][0]+c[1][1])/4?i===5?713:1114:i===5?104:208:i===15?0:i}o.exports=function(u){var c,i,s,l,d,h,m,g,p,v=u[0].z,y=v.length,x=v[0].length,w=y===2||x===2;for(i=0;i=0&&(A=K,E=D):Math.abs(M[1]-A[1])<.01?Math.abs(M[1]-K[1])<.01&&(K[0]-M[0])*(A[0]-K[0])>=0&&(A=K,E=D):a.log("endpt to newendpt is not vert. or horz.",M,A,K)}if(M=A,E>=0)break;z+="L"+A}if(E===T.edgepaths.length){a.log("unclosed perimeter path");break}L=E,(N=P.indexOf(L)===-1)&&(L=P[0],z+="Z")}for(L=0;LA.center?A.right-D:D-A.left)/(z+Math.abs(Math.sin(R)*E)),N=(O>A.middle?A.bottom-O:O-A.top)/(Math.abs(L)+Math.cos(R)*E);if(P<1||N<1)return 1/0;var B=x.EDGECOST*(1/(P-1)+1/(N-1));B+=x.ANGLECOST*R*R;for(var G=D-z,W=O-L,K=D+z,te=O+L,Y=0;Y2*x.MAXCOST)break;N&&(D/=2),O=(E=R-D/2)+1.5*D}if(P<=x.MAXCOST)return z},f.addLabelData=function(T,_,M,A){var S=_.fontSize,E=_.width+S/3,D=Math.max(0,_.height-S/3),O=T.x,R=T.y,z=T.theta,L=Math.sin(z),P=Math.cos(z),N=function(G,W){return[O+G*P-W*L,R+G*L+W*P]},B=[N(-E/2,-D/2),N(-E/2,D/2),N(E/2,D/2),N(E/2,-D/2)];M.push({text:_.text,x:O,y:R,dy:_.dy,theta:z,level:_.level,width:E,height:D}),A.push(B)},f.drawLabels=function(T,_,M,A,S){var E=T.selectAll("text").data(_,function(R){return R.text+","+R.x+","+R.y+","+R.theta});if(E.exit().remove(),E.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(R){var z=R.x+Math.sin(R.theta)*R.dy,L=R.y-Math.cos(R.theta)*R.dy;r.select(this).text(R.text).attr({x:z,y:L,transform:"rotate("+180*R.theta/Math.PI+" "+z+" "+L+")"}).call(i.convertToTspans,M)}),S){for(var D="",O=0;Os.end&&(s.start=s.end=(s.start+s.end)/2),c._input.contours||(c._input.contours={}),a.extendFlat(c._input.contours,{start:s.start,end:s.end,size:s.size}),c._input.autocontour=!0}else if(s.type!=="constraint"){var m,g=s.start,p=s.end,v=c._input.contours;g>p&&(s.start=v.start=p,p=s.end=v.end=g,g=s.start),!(s.size>0)&&(m=g===p?1:u(g,p,c.ncontours).dtick,v.size=s.size=m)}}},{"../../lib":503,"../../plots/cartesian/axes":554}],755:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../components/drawing"),u=e("../heatmap/style"),c=e("./make_color_map");o.exports=function(i){var s=r.select(i).selectAll("g.contour");s.style("opacity",function(l){return l[0].trace.opacity}),s.each(function(l){var d=r.select(this),h=l[0].trace,m=h.contours,g=h.line,p=m.size||1,v=m.start,y=m.type==="constraint",x=!y&&m.coloring==="lines",w=!y&&m.coloring==="fill",k=x||w?c(h):null;d.selectAll("g.contourlevel").each(function(_){r.select(this).selectAll("path").call(a.lineGroupStyle,g.width,x?k(_.level):g.color,g.dash)});var b=m.labelfont;if(d.selectAll("g.contourlabels text").each(function(_){a.font(r.select(this),{family:b.family,size:b.size,color:b.color||(x?k(_.level):g.color)})}),y)d.selectAll("g.contourfill path").style("fill",h.fillcolor);else if(w){var T;d.selectAll("g.contourfill path").style("fill",function(_){return T===void 0&&(T=_.level),k(_.level+.5*p)}),T===void 0&&(T=v),d.selectAll("g.contourbg path").style("fill",k(T-.5*p))}}),u(i)}},{"../../components/drawing":388,"../heatmap/style":805,"./make_color_map":751,"@plotly/d3":58}],756:[function(e,o,f){var r=e("../../components/colorscale/defaults"),a=e("./label_defaults");o.exports=function(u,c,i,s,l){var d,h=i("contours.coloring"),m="";h==="fill"&&(d=i("contours.showlines")),d!==!1&&(h!=="lines"&&(m=i("line.color","#000")),i("line.width",.5),i("line.dash")),h!=="none"&&(u.showlegend!==!0&&(c.showlegend=!1),c._dfltShowLegend=!1,r(u,c,s,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),a(i,s,m,l)}},{"../../components/colorscale/defaults":376,"./label_defaults":750}],757:[function(e,o,f){var r=e("../heatmap/attributes"),a=e("../contour/attributes"),u=e("../../components/colorscale/attributes"),c=e("../../lib/extend").extendFlat,i=a.contours;o.exports=c({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:a.fillcolor,autocontour:a.autocontour,ncontours:a.ncontours,contours:{type:i.type,start:i.start,end:i.end,size:i.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:i.showlines,showlabels:i.showlabels,labelfont:i.labelfont,labelformat:i.labelformat,operation:i.operation,value:i.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a.line.color,width:a.line.width,dash:a.line.dash,smoothing:a.line.smoothing,editType:"plot"},transforms:void 0},u("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../contour/attributes":735,"../heatmap/attributes":792}],758:[function(e,o,f){var r=e("../../components/colorscale/calc"),a=e("../../lib"),u=e("../heatmap/convert_column_xyz"),c=e("../heatmap/clean_2d_array"),i=e("../heatmap/interp2d"),s=e("../heatmap/find_empties"),l=e("../heatmap/make_bound_array"),d=e("./defaults"),h=e("../carpet/lookup_carpetid"),m=e("../contour/set_contours");o.exports=function(g,p){var v=p._carpetTrace=h(g,p);if(v&&v.visible&&v.visible!=="legendonly"){if(!p.a||!p.b){var y=g.data[v.index],x=g.data[p.index];x.a||(x.a=y.a),x.b||(x.b=y.b),d(x,p,p._defaultColor,g._fullLayout)}var w=function(k,b){var T,_,M,A,S,E,D,O=b._carpetTrace,R=O.aaxis,z=O.baxis;R._minDtick=0,z._minDtick=0,a.isArray1D(b.z)&&u(b,R,z,"a","b",["z"]),T=b._a=b._a||b.a,A=b._b=b._b||b.b,T=T?R.makeCalcdata(b,"_a"):[],A=A?z.makeCalcdata(b,"_b"):[],_=b.a0||0,M=b.da||1,S=b.b0||0,E=b.db||1,D=b._z=c(b._z||b.z,b.transpose),b._emptypoints=s(D),i(D,b._emptypoints);var L=a.maxRowLength(D),P=b.xtype==="scaled"?"":T,N=l(b,P,_,M,L,R),B=b.ytype==="scaled"?"":A,G=l(b,B,S,E,D.length,z),W={a:N,b:G,z:D};return b.contours.type==="levels"&&b.contours.coloring!=="none"&&r(k,b,{vals:D,containerStr:"",cLetter:"z"}),[W]}(g,p);return m(p,p._z),w}}},{"../../components/colorscale/calc":374,"../../lib":503,"../carpet/lookup_carpetid":708,"../contour/set_contours":754,"../heatmap/clean_2d_array":794,"../heatmap/convert_column_xyz":796,"../heatmap/find_empties":798,"../heatmap/interp2d":801,"../heatmap/make_bound_array":803,"./defaults":759}],759:[function(e,o,f){var r=e("../../lib"),a=e("../heatmap/xyz_defaults"),u=e("./attributes"),c=e("../contour/constraint_defaults"),i=e("../contour/contours_defaults"),s=e("../contour/style_defaults");o.exports=function(l,d,h,m){function g(p,v){return r.coerce(l,d,u,p,v)}if(g("carpet"),l.a&&l.b){if(!a(l,d,g,m,"a","b"))return void(d.visible=!1);g("text"),g("contours.type")==="constraint"?c(l,d,g,m,h,{hasHover:!1}):(i(l,d,g,function(p){return r.coerce2(l,d,u,p)}),s(l,d,g,m,{hasHover:!1}))}else d._defaultColor=h,d._length=null}},{"../../lib":503,"../contour/constraint_defaults":740,"../contour/contours_defaults":742,"../contour/style_defaults":756,"../heatmap/xyz_defaults":807,"./attributes":757}],760:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../contour/colorbar"),calc:e("./calc"),plot:e("./plot"),style:e("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":568,"../contour/colorbar":738,"../contour/style":755,"./attributes":757,"./calc":758,"./defaults":759,"./plot":761}],761:[function(e,o,f){var r=e("@plotly/d3"),a=e("../carpet/map_1d_array"),u=e("../carpet/makepath"),c=e("../../components/drawing"),i=e("../../lib"),s=e("../contour/make_crossings"),l=e("../contour/find_all_paths"),d=e("../contour/plot"),h=e("../contour/constants"),m=e("../contour/convert_to_constraints"),g=e("../contour/empty_pathinfo"),p=e("../contour/close_boundaries"),v=e("../carpet/lookup_carpetid"),y=e("../carpet/axis_aligned_line");function x(b,T,_){var M=b.getPointAtLength(T),A=b.getPointAtLength(_),S=A.x-M.x,E=A.y-M.y,D=Math.sqrt(S*S+E*E);return[S/D,E/D]}function w(b){var T=Math.sqrt(b[0]*b[0]+b[1]*b[1]);return[b[0]/T,b[1]/T]}function k(b,T){var _=Math.abs(b[0]*T[0]+b[1]*T[1]);return Math.sqrt(1-_*_)/_}o.exports=function(b,T,_,M){var A=T.xaxis,S=T.yaxis;i.makeTraceGroups(M,_,"contour").each(function(E){var D=r.select(this),O=E[0],R=O.trace,z=R._carpetTrace=v(b,R),L=b.calcdata[z.index][0];if(z.visible&&z.visible!=="legendonly"){var P=O.a,N=O.b,B=R.contours,G=g(B,T,O),W=B.type==="constraint",K=B._operation,te=W?K==="="?"lines":"fill":B.coloring,Y=[[P[0],N[N.length-1]],[P[P.length-1],N[N.length-1]],[P[P.length-1],N[0]],[P[0],N[0]]];s(G);var Z=1e-8*(P[P.length-1]-P[0]),re=1e-8*(N[N.length-1]-N[0]);l(G,Z,re);var U,q,$,ne,H=G;B.type==="constraint"&&(H=m(G,K)),function(ae,ue){var le,ge,fe,me,_e,we,Te,Oe,de;for(le=0;le=0;ne--)U=L.clipsegments[ne],q=a([],U.x,A.c2p),$=a([],U.y,S.c2p),q.reverse(),$.reverse(),Q.push(u(q,$,U.bicubic));var ee="M"+Q.join("L")+"Z";(function(ae,ue,le,ge,fe,me){var _e,we,Te,Oe,de=i.ensureSingle(ae,"g","contourbg").selectAll("path").data(me!=="fill"||fe?[]:[0]);de.enter().append("path"),de.exit().remove();var ye=[];for(Oe=0;Oe=0&&(vt=He,At=at):Math.abs(ft[1]-vt[1])=0&&(vt=He,At=at):i.log("endpt to newendpt is not vert. or horz.",ft,vt,He)}if(At>=0)break;Ot+=Ae(ft,vt),ft=vt}if(At===Fe.edgepaths.length){i.log("unclosed perimeter path");break}nt=At,(Jt=Wt.indexOf(nt)===-1)&&(nt=Wt[0],Ot+=Ae(ft,vt)+"Z",ft=null)}for(nt=0;ntUt&&(Tt.max=Ut),Tt.len=Tt.max-Tt.min}(this,At,vt,at,_e,Pt.height),!(at.len<(Pt.width+Pt.height)*h.LABELMIN)))for(var et=Math.min(Math.ceil(at.len/ft),h.LABELMAX),Ot=0;Ot0?+y[g]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:T})}}var M=c.extractOpts(d),A=M.reversescale?c.flipScale(M.colorscale):M.colorscale,S=A[0][1],E=["interpolate",["linear"],["heatmap-density"],0,u.opacity(S)<1?S:u.addOpacity(S,0)];for(g=1;g=0;l--)i.removeLayer(s[l][1])},c.dispose=function(){var i=this.subplot.map;this._removeLayers(),i.removeSource(this.sourceId)},o.exports=function(i,s){var l=s[0].trace,d=new u(i,l.uid),h=d.sourceId,m=r(s),g=d.below=i.belowLookup["trace-"+l.uid];return i.map.addSource(h,{type:"geojson",data:m.geojson}),d._addLayers(m,g),d}},{"../../plots/mapbox/constants":611,"./convert":764}],770:[function(e,o,f){var r=e("../../lib");o.exports=function(a,u){for(var c=0;c"),h.color=function(T,_){var M=T.marker,A=_.mc||M.color,S=_.mlc||M.line.color,E=_.mlw||M.line.width;if(r(A))return A;if(r(S)&&E)return S}(g,v),[h]}}},{"../../components/color":366,"../../lib":503,"../bar/hover":655}],778:[function(e,o,f){o.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"../bar/select":660,"./attributes":771,"./calc":772,"./cross_trace_calc":774,"./defaults":775,"./event_data":776,"./hover":777,"./layout_attributes":779,"./layout_defaults":780,"./plot":781,"./style":782}],779:[function(e,o,f){o.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"}}},{}],780:[function(e,o,f){var r=e("../../lib"),a=e("./layout_attributes");o.exports=function(u,c,i){var s=!1;function l(m,g){return r.coerce(u,c,a,m,g)}for(var d=0;d path").each(function(x){if(!x.isBlank){var w=y.marker;r.select(this).call(u.fill,x.mc||w.color).call(u.stroke,x.mlc||w.line.color).call(a.dashLine,w.line.dash,x.mlw||w.line.width).style("opacity",y.selectedpoints&&!x.selected?c:1)}}),l(v,y,d),v.selectAll(".regions").each(function(){r.select(this).selectAll("path").style("stroke-width",0).call(u.fill,y.connector.fillcolor)}),v.selectAll(".lines").each(function(){var x=y.connector.line;a.lineGroupStyle(r.select(this).selectAll("path"),x.width,x.color,x.dash)})})}}},{"../../components/color":366,"../../components/drawing":388,"../../constants/interactions":478,"../bar/style":662,"../bar/uniform_text":664,"@plotly/d3":58}],783:[function(e,o,f){var r=e("../pie/attributes"),a=e("../../plots/attributes"),u=e("../../plots/domain").attributes,c=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../lib/extend").extendFlat;o.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:s({},r.marker.line.color,{dflt:null}),width:s({},r.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:s({},r.scalegroup,{}),textinfo:s({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:i({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:c({},{keys:["label","color","value","text","percent"]}),textposition:s({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:s({},r.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:u({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"}}},{"../../lib/extend":493,"../../plots/attributes":550,"../../plots/domain":584,"../../plots/template_attributes":633,"../pie/attributes":901}],784:[function(e,o,f){var r=e("../../plots/plots");f.name="funnelarea",f.plot=function(a,u,c,i){r.plotBasePlot(f.name,a,u,c,i)},f.clean=function(a,u,c,i){r.cleanBasePlot(f.name,a,u,c,i)}},{"../../plots/plots":619}],785:[function(e,o,f){var r=e("../pie/calc");o.exports={calc:function(a,u){return r.calc(a,u)},crossTraceCalc:function(a){r.crossTraceCalc(a,{type:"funnelarea"})}}},{"../pie/calc":903}],786:[function(e,o,f){var r=e("../../lib"),a=e("./attributes"),u=e("../../plots/domain").defaults,c=e("../bar/defaults").handleText,i=e("../pie/defaults").handleLabelsAndValues;o.exports=function(s,l,d,h){function m(T,_){return r.coerce(s,l,a,T,_)}var g=m("labels"),p=m("values"),v=i(g,p),y=v.len;if(l._hasLabels=v.hasLabels,l._hasValues=v.hasValues,!l._hasLabels&&l._hasValues&&(m("label0"),m("dlabel")),y){l._length=y,m("marker.line.width")&&m("marker.line.color",h.paper_bgcolor),m("marker.colors"),m("scalegroup");var x,w=m("text"),k=m("texttemplate");if(k||(x=m("textinfo",Array.isArray(w)?"text+percent":"percent")),m("hovertext"),m("hovertemplate"),k||x&&x!=="none"){var b=m("textposition");c(s,l,h,m,b,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}u(l,h,m),m("title.text")&&(m("title.position"),r.coerceFont(m,"title.font",h.font)),m("aspectratio"),m("baseratio")}else l.visible=!1}},{"../../lib":503,"../../plots/domain":584,"../bar/defaults":652,"../pie/defaults":904,"./attributes":783}],787:[function(e,o,f){o.exports={moduleType:"trace",name:"funnelarea",basePlotModule:e("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style"),styleOne:e("../pie/style_one"),meta:{}}},{"../pie/style_one":912,"./attributes":783,"./base_plot":784,"./calc":785,"./defaults":786,"./layout_attributes":788,"./layout_defaults":789,"./plot":790,"./style":791}],788:[function(e,o,f){var r=e("../pie/layout_attributes").hiddenlabels;o.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":908}],789:[function(e,o,f){var r=e("../../lib"),a=e("./layout_attributes");o.exports=function(u,c){function i(s,l){return r.coerce(u,c,a,s,l)}i("hiddenlabels"),i("funnelareacolorway",c.colorway),i("extendfunnelareacolors")}},{"../../lib":503,"./layout_attributes":788}],790:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../components/drawing"),u=e("../../lib"),c=u.strScale,i=u.strTranslate,s=e("../../lib/svg_text_utils"),l=e("../bar/plot").toMoveInsideBar,d=e("../bar/uniform_text"),h=d.recordMinTextSize,m=d.clearMinTextSize,g=e("../pie/helpers"),p=e("../pie/plot"),v=p.attachFxHandlers,y=p.determineInsideTextFont,x=p.layoutAreas,w=p.prerenderTitles,k=p.positionTitleOutside,b=p.formatSliceLabel;function T(_,M){return"l"+(M[0]-_[0])+","+(M[1]-_[1])}o.exports=function(_,M){var A=_._fullLayout;m("funnelarea",A),w(M,_),x(M,A._size),u.makeTraceGroups(A._funnelarealayer,M,"trace").each(function(S){var E=r.select(this),D=S[0],O=D.trace;(function(R){if(!R.length)return;var z=R[0],L=z.trace,P=L.aspectratio,N=L.baseratio;N>.999&&(N=.999);var B,G=Math.pow(N,2),W=z.vTotal,K=W,te=W*G/(1-G)/W;function Y(){var Te,Oe={x:Te=Math.sqrt(te),y:-Te};return[Oe.x,Oe.y]}var Z,re,U=[];for(U.push(Y()),Z=R.length-1;Z>-1;Z--)if(!(re=R[Z]).hidden){var q=re.v/K;te+=q,U.push(Y())}var $=1/0,ne=-1/0;for(Z=0;Z-1;Z--)if(!(re=R[Z]).hidden){var fe=U[ge+=1][0],me=U[ge][1];re.TL=[-fe,me],re.TR=[fe,me],re.BL=ue,re.BR=le,re.pxmid=(_e=re.TR,we=re.BR,[.5*(_e[0]+we[0]),.5*(_e[1]+we[1])]),ue=re.TL,le=re.TR}var _e,we})(S),E.each(function(){var R=r.select(this).selectAll("g.slice").data(S);R.enter().append("g").classed("slice",!0),R.exit().remove(),R.each(function(L,P){if(L.hidden)r.select(this).selectAll("path,g").remove();else{L.pointNumber=L.i,L.curveNumber=O.index;var N=D.cx,B=D.cy,G=r.select(this),W=G.selectAll("path.surface").data([L]);W.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),G.call(v,_,S);var K="M"+(N+L.TR[0])+","+(B+L.TR[1])+T(L.TR,L.BR)+T(L.BR,L.BL)+T(L.BL,L.TL)+"Z";W.attr("d",K),b(_,L,D);var te=g.castOption(O.textposition,L.pts),Y=G.selectAll("g.slicetext").data(L.text&&te!=="none"?[0]:[]);Y.enter().append("g").classed("slicetext",!0),Y.exit().remove(),Y.each(function(){var Z=u.ensureSingle(r.select(this),"text","",function(ee){ee.attr("data-notex",1)}),re=u.ensureUniformFontSize(_,y(O,L,A.font));Z.text(L.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,re).call(s.convertToTspans,_);var U,q,$,ne=a.bBox(Z.node()),H=Math.min(L.BL[1],L.BR[1])+B,Q=Math.max(L.TL[1],L.TR[1])+B;q=Math.max(L.TL[0],L.BL[0])+N,$=Math.min(L.TR[0],L.BR[0])+N,(U=l(q,$,H,Q,ne,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=re.size,h(O.type,U,A),S[P].transform=U,Z.attr("transform",u.getTextTransform(U))})}});var z=r.select(this).selectAll("g.titletext").data(O.title.text?[0]:[]);z.enter().append("g").classed("titletext",!0),z.exit().remove(),z.each(function(){var L=u.ensureSingle(r.select(this),"text","",function(B){B.attr("data-notex",1)}),P=O.title.text;O._meta&&(P=u.templateString(P,O._meta)),L.text(P).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,O.title.font).call(s.convertToTspans,_);var N=k(D,A._size);L.attr("transform",i(N.x,N.y)+c(Math.min(1,N.scale))+i(N.tx,N.ty))})})})}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../bar/plot":659,"../bar/uniform_text":664,"../pie/helpers":906,"../pie/plot":910,"@plotly/d3":58}],791:[function(e,o,f){var r=e("@plotly/d3"),a=e("../pie/style_one"),u=e("../bar/uniform_text").resizeText;o.exports=function(c){var i=c._fullLayout._funnelarealayer.selectAll(".trace");u(c,i,"funnelarea"),i.each(function(s){var l=s[0].trace,d=r.select(this);d.style({opacity:l.opacity}),d.selectAll("path.surface").each(function(h){r.select(this).call(a,h,l)})})}},{"../bar/uniform_text":664,"../pie/style_one":912,"@plotly/d3":58}],792:[function(e,o,f){var r=e("../scatter/attributes"),a=e("../../plots/attributes"),u=e("../../plots/font_attributes"),c=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../plots/template_attributes").texttemplateAttrs,l=e("../../components/colorscale/attributes"),d=e("../../lib/extend").extendFlat;o.exports=d({z:{valType:"data_array",editType:"calc"},x:d({},r.x,{impliedEdits:{xtype:"array"}}),x0:d({},r.x0,{impliedEdits:{xtype:"scaled"}}),dx:d({},r.dx,{impliedEdits:{xtype:"scaled"}}),y:d({},r.y,{impliedEdits:{ytype:"array"}}),y0:d({},r.y0,{impliedEdits:{ytype:"scaled"}}),dy:d({},r.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:d({},r.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:d({},r.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:d({},r.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:d({},r.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:d({},r.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:d({},r.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:c("x"),yhoverformat:c("y"),zhoverformat:c("z",1),hovertemplate:i(),texttemplate:s({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:u({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:d({},a.showlegend,{dflt:!1})},{transforms:void 0},l("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/font_attributes":585,"../../plots/template_attributes":633,"../scatter/attributes":927}],793:[function(e,o,f){var r=e("../../registry"),a=e("../../lib"),u=e("../../plots/cartesian/axes"),c=e("../../plots/cartesian/align_period"),i=e("../histogram2d/calc"),s=e("../../components/colorscale/calc"),l=e("./convert_column_xyz"),d=e("./clean_2d_array"),h=e("./interp2d"),m=e("./find_empties"),g=e("./make_bound_array"),p=e("../../constants/numerical").BADNUM;function v(y){for(var x=[],w=y.length,k=0;kte){W("x scale is not linear");break}}if(_.length&&B==="fast"){var Y=(_[_.length-1]-_[0])/(_.length-1),Z=Math.abs(Y/100);for(D=0;D<_.length-1;D++)if(Math.abs(_[D+1]-_[D]-Y)>Z){W("y scale is not linear");break}}}}var re=a.maxRowLength(E),U=x.xtype==="scaled"?"":w,q=g(x,U,k,b,re,R),$=x.ytype==="scaled"?"":_,ne=g(x,$,M,A,E.length,z);N||(x._extremes[R._id]=u.findExtremes(R,q),x._extremes[z._id]=u.findExtremes(z,ne));var H={x:q,y:ne,z:E,text:x._text||x.text,hovertext:x._hovertext||x.hovertext};if(x.xperiodalignment&&T&&(H.orig_x=T),x.yperiodalignment&&S&&(H.orig_y=S),U&&U.length===q.length-1&&(H.xCenter=U),$&&$.length===ne.length-1&&(H.yCenter=$),P&&(H.xRanges=O.xRanges,H.yRanges=O.yRanges,H.pts=O.pts),L||s(y,x,{vals:E,cLetter:"z"}),L&&x.contours&&x.contours.coloring==="heatmap"){var Q={type:x.type==="contour"?"heatmap":"histogram2d",xcalendar:x.xcalendar,ycalendar:x.ycalendar};H.xfill=g(Q,U,k,b,re,R),H.yfill=g(Q,$,M,A,E.length,z)}return[H]}},{"../../components/colorscale/calc":374,"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/axes":554,"../../registry":638,"../histogram2d/calc":826,"./clean_2d_array":794,"./convert_column_xyz":796,"./find_empties":798,"./interp2d":801,"./make_bound_array":803}],794:[function(e,o,f){var r=e("fast-isnumeric"),a=e("../../lib"),u=e("../../constants/numerical").BADNUM;o.exports=function(c,i,s,l){var d,h,m,g,p,v;function y(_){if(r(_))return+_}if(i&&i.transpose){for(d=0,p=0;p=0;l--)(d=((p[[(c=(s=v[l])[0])-1,i=s[1]]]||w)[2]+(p[[c+1,i]]||w)[2]+(p[[c,i-1]]||w)[2]+(p[[c,i+1]]||w)[2])/20)&&(h[s]=[c,i,d],v.splice(l,1),m=!0);if(!m)throw"findEmpties iterated with no new neighbors";for(s in h)p[s]=h[s],g.push(h[s])}return g.sort(function(b,T){return T[2]-b[2]})}},{"../../lib":503}],799:[function(e,o,f){var r=e("../../components/fx"),a=e("../../lib"),u=e("../../plots/cartesian/axes"),c=e("../../components/colorscale").extractOpts;o.exports=function(i,s,l,d,h){h||(h={});var m,g,p,v,y=h.isContour,x=i.cd[0],w=x.trace,k=i.xa,b=i.ya,T=x.x,_=x.y,M=x.z,A=x.xCenter,S=x.yCenter,E=x.zmask,D=w.zhoverformat,O=T,R=_;if(i.index!==!1){try{p=Math.round(i.index[1]),v=Math.round(i.index[0])}catch{return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",i.index)}if(p<0||p>=M[0].length||v<0||v>M.length)return}else{if(r.inbox(s-T[0],s-T[T.length-1],0)>0||r.inbox(l-_[0],l-_[_.length-1],0)>0)return;if(y){var z;for(O=[2*T[0]-T[1]],z=1;zT&&(M=Math.max(M,Math.abs(i[h][m]-b)/(_-T))))}return M}o.exports=function(i,s){var l,d=1;for(c(i,s),l=0;l.01;l++)d=c(i,s,u(d));return d>.01&&r.log("interp2d didn't converge quickly",d),i}},{"../../lib":503}],802:[function(e,o,f){var r=e("../../lib");o.exports=function(a,u){a("texttemplate");var c=r.extendFlat({},u.font,{color:"auto",size:"auto"});r.coerceFont(a,"textfont",c)}},{"../../lib":503}],803:[function(e,o,f){var r=e("../../registry"),a=e("../../lib").isArrayOrTypedArray;o.exports=function(u,c,i,s,l,d){var h,m,g,p=[],v=r.traceIs(u,"contour"),y=r.traceIs(u,"histogram"),x=r.traceIs(u,"gl2d");if(a(c)&&c.length>1&&!y&&d.type!=="category"){var w=c.length;if(!(w<=l))return v?c.slice(0,l):c.slice(0,l+1);if(v||x)p=c.slice(0,l);else if(l===1)p=[c[0]-.5,c[0]+.5];else{for(p=[1.5*c[0]-.5*c[1]],g=1;g0;)R=S.c2p(U[N]),N--;for(R0;)P=E.c2p(q[N]),N--;if(PJe||Je>E._length))for(B=zt;BEt||Et>S._length)){var It=d({x:st,y:Le},te,T._fullLayout);It.x=st,It.y=Le;var Zt=K.z[N][B];Zt===void 0?(It.z="",It.zLabel=""):(It.z=Zt,It.zLabel=i.tickText(Vt,Zt,"hover").text);var Kt=K.text&&K.text[N]&&K.text[N][B];Kt!==void 0&&Kt!==!1||(Kt=""),It.text=Kt;var Ht=s.texttemplateString(kt,It,T._fullLayout._d3locale,It,te._meta||{});if(Ht){var mn=Ht.split("
"),zn=mn.length,pn=0;for(G=0;G0&&(T=!0);for(var A=0;As){var l=s-c[a];return c[a]=s,l}}return 0},max:function(a,u,c,i){var s=i[u];if(r(s)){if(s=Number(s),!r(c[a]))return c[a]=s,s;if(c[a]l?v>c?v>1.1*a?a:v>1.1*u?u:c:v>i?i:v>s?s:l:Math.pow(10,Math.floor(Math.log(v)/Math.LN10))}function g(v,y,x,w,k,b){if(w&&v>c){var T=p(y,k,b),_=p(x,k,b),M=v===a?0:1;return T[M]!==_[M]}return Math.floor(x/v)-Math.floor(y/v)>.1}function p(v,y,x){var w=y.c2d(v,a,x).split("-");return w[0]===""&&(w.unshift(),w[0]="-"+w[0]),w}o.exports=function(v,y,x,w,k){var b,T,_=-1.1*y,M=-.1*y,A=v-M,S=x[0],E=x[1],D=Math.min(h(S+M,S+A,w,k),h(E+M,E+A,w,k)),O=Math.min(h(S+_,S+M,w,k),h(E+_,E+M,w,k));if(D>O&&Oc){var R=b===a?1:6,z=b===a?"M12":"M1";return function(L,P){var N=w.c2d(L,a,k),B=N.indexOf("-",R);B>0&&(N=N.substr(0,B));var G=w.d2c(N,0,k);if(Gv.r2l(H)&&(ee=c.tickIncrement(ee,O.size,!0,T)),U.start=v.l2r(ee),ne||a.nestedProperty(p,S+".start").set(U.start)}var ie=O.end,ae=v.r2l(re.end),ue=ae!==void 0;if((O.endFound||ue)&&ae!==v.r2l(ie)){var le=ue?ae:a.aggNums(Math.max,null,_);U.end=v.l2r(le),ue||a.nestedProperty(p,S+".start").set(U.end)}var ge="autobin"+y;return p._input[ge]===!1&&(p._input[S]=a.extendFlat({},p[S]||{}),delete p._input[ge],delete p[ge]),[U,_]}o.exports={calc:function(g,p){var v,y,x,w,k=[],b=[],T=p.orientation==="h",_=c.getFromId(g,T?p.yaxis:p.xaxis),M=T?"y":"x",A={x:"y",y:"x"}[M],S=p[M+"calendar"],E=p.cumulative,D=m(g,p,_,M),O=D[0],R=D[1],z=typeof O.size=="string",L=[],P=z?L:O,N=[],B=[],G=[],W=0,K=p.histnorm,te=p.histfunc,Y=K.indexOf("density")!==-1;E.enabled&&Y&&(K=K.replace(/ ?density$/,""),Y=!1);var Z,re=te==="max"||te==="min"?null:0,U=s.count,q=l[K],$=!1,ne=function(de){return _.r2c(de,0,S)};for(a.isArrayOrTypedArray(p[A])&&te!=="count"&&(Z=p[A],$=te==="avg",U=s[te]),v=ne(O.start),x=ne(O.end)+(v-c.tickIncrement(v,O.size,!1,S))/1e6;v=0&&w=0;ke--)Ve(ke);else if(ye==="increasing"){for(ke=1;ke=0;ke--)de[ke]+=de[ke+1];Me==="exclude"&&(de.push(0),de.shift())}}(b,E.direction,E.currentbin);var me=Math.min(k.length,b.length),_e=[],we=0,Te=me-1;for(v=0;v=we;v--)if(b[v]){Te=v;break}for(v=we;v<=Te;v++)if(r(k[v])&&r(b[v])){var Oe={p:k[v],s:b[v],b:0};E.enabled||(Oe.pts=G[v],ae?Oe.ph0=Oe.ph1=G[v].length?R[G[v][0]]:k[v]:(p._computePh=!0,Oe.ph0=ee(L[v]),Oe.ph1=ee(L[v+1],!0))),_e.push(Oe)}return _e.length===1&&(_e[0].width1=c.tickIncrement(_e[0].p,O.size,!1,S)-_e[0].p),i(_e,p),a.isArrayOrTypedArray(p.selectedpoints)&&a.tagSelected(_e,p,ge),_e},calcAllAutoBins:m}},{"../../lib":503,"../../plots/cartesian/axes":554,"../../registry":638,"../bar/arrays_to_calcdata":647,"./average":813,"./bin_functions":815,"./bin_label_vals":816,"./norm_functions":824,"fast-isnumeric":190}],818:[function(e,o,f){o.exports={eventDataKeys:["binNumber"]}},{}],819:[function(e,o,f){var r=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),u=e("../../registry").traceIs,c=e("../bar/defaults").handleGroupingDefaults,i=r.nestedProperty,s=e("../../plots/cartesian/constraints").getAxisGroup,l=[{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"}],d=["x","y"];o.exports=function(h,m){var g,p,v,y,x,w,k,b=m._histogramBinOpts={},T=[],_={},M=[];function A(Y,Z){return r.coerce(g._input,g,g._module.attributes,Y,Z)}function S(Y){return Y.orientation==="v"?"x":"y"}function E(Y,Z,re){var U=Y.uid+"__"+re;Z||(Z=U);var q=function(Q,ee){return a.getFromTrace({_fullLayout:m},Q,ee).type}(Y,re),$=Y[re+"calendar"]||"",ne=b[Z],H=!0;ne&&(q===ne.axType&&$===ne.calendar?(H=!1,ne.traces.push(Y),ne.dirs.push(re)):(Z=U,q!==ne.axType&&r.warn(["Attempted to group the bins of trace",Y.index,"set on a","type:"+q,"axis","with bins on","type:"+ne.axType,"axis."].join(" ")),$!==ne.calendar&&r.warn(["Attempted to group the bins of trace",Y.index,"set with a",$,"calendar","with bins",ne.calendar?"on a "+ne.calendar+" calendar":"w/o a set calendar"].join(" ")))),H&&(b[Z]={traces:[Y],dirs:[re],axType:q,calendar:Y[re+"calendar"]||""}),Y["_"+re+"bingroup"]=Z}for(x=0;xL&&D.splice(L,D.length-L),z.length>L&&z.splice(L,z.length-L);var P=[],N=[],B=[],G=typeof E.size=="string",W=typeof R.size=="string",K=[],te=[],Y=G?K:E,Z=W?te:R,re=0,U=[],q=[],$=p.histnorm,ne=p.histfunc,H=$.indexOf("density")!==-1,Q=ne==="max"||ne==="min"?null:0,ee=u.count,ie=c[$],ae=!1,ue=[],le=[],ge="z"in p?p.z:"marker"in p&&Array.isArray(p.marker.color)?p.marker.color:"";ge&&ne!=="count"&&(ae=ne==="avg",ee=u[ne]);var fe=E.size,me=M(E.start),_e=M(E.end)+(me-a.tickIncrement(me,fe,!1,T))/1e6;for(v=me;v<_e;v=a.tickIncrement(v,fe,!1,T))N.push(Q),K.push(v),ae&&B.push(0);K.push(v);var we,Te=N.length,Oe=(v-me)/Te,de=(we=me+Oe/2,k.c2r(we,0,T)),ye=R.size,Me=A(R.start),ke=A(R.end)+(Me-a.tickIncrement(Me,ye,!1,_))/1e6;for(v=Me;v=0&&x=0&&w-1,flipY:L.tiling.flip.indexOf("y")>-1,orientation:L.tiling.orientation,pad:{inner:L.tiling.pad},maxDepth:L._maxDepth}).descendants(),W=1/0,K=-1/0;G.forEach(function(U){var q=U.depth;q>=L._maxDepth?(U.x0=U.x1=(U.x0+U.x1)/2,U.y0=U.y1=(U.y0+U.y1)/2):(W=Math.min(W,q),K=Math.max(K,q))}),y=y.data(G,d.getPtId),L._maxVisibleLayers=isFinite(K)?K-W+1:0,y.enter().append("g").classed("slice",!0),E(y,!1,{},[w,k],_),y.order();var te=null;if(S&&R){var Y=d.getPtId(R);y.each(function(U){te===null&&d.getPtId(U)===Y&&(te={x0:U.x0,x1:U.x1,y0:U.y0,y1:U.y1})})}var Z=function(){return te||{x0:0,x1:w,y0:0,y1:k}},re=y;return S&&(re=re.transition().each("end",function(){var U=r.select(this);d.setSliceCursor(U,g,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),re.each(function(U){U._x0=b(U.x0),U._x1=b(U.x1),U._y0=T(U.y0),U._y1=T(U.y1),U._hoverX=b(U.x1-L.tiling.pad),U._hoverY=T(B?U.y1-L.tiling.pad/2:U.y0+L.tiling.pad/2);var q=r.select(this),$=a.ensureSingle(q,"path","surface",function(ee){ee.style("pointer-events","all")});S?$.transition().attrTween("d",function(ee){var ie=D(ee,!1,Z(),[w,k],{orientation:L.tiling.orientation,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1});return function(ae){return _(ie(ae))}}):$.attr("d",_),q.call(h,v,g,p,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(d.setSliceCursor,g,{isTransitioning:g._transitioning}),$.call(s,U,L,{hovered:!1}),U.x0===U.x1||U.y0===U.y1?U._text="":U._text=m(U,v,L,p,z)||"";var ne=a.ensureSingle(q,"g","slicetext"),H=a.ensureSingle(ne,"text","",function(ee){ee.attr("data-notex",1)}),Q=a.ensureUniformFontSize(g,d.determineTextFont(L,U,z.font));H.text(U._text||" ").classed("slicetext",!0).attr("text-anchor",N?"end":P?"start":"middle").call(u.font,Q).call(c.convertToTspans,g),U.textBB=u.bBox(H.node()),U.transform=M(U,{fontSize:Q.size}),U.transform.fontSize=Q.size,S?H.transition().attrTween("transform",function(ee){var ie=O(ee,!1,Z(),[w,k]);return function(ae){return A(ie(ae))}}):H.attr("transform",A(U))}),te}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../sunburst/fx":1054,"../sunburst/helpers":1055,"../sunburst/plot":1059,"../treemap/constants":1078,"./partition":842,"./style":844,"@plotly/d3":58}],839:[function(e,o,f){o.exports={moduleType:"trace",name:"icicle",basePlotModule:e("./base_plot"),categories:[],animatable:!0,attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style").style,colorbar:e("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":945,"./attributes":834,"./base_plot":835,"./calc":836,"./defaults":837,"./layout_attributes":840,"./layout_defaults":841,"./plot":843,"./style":844}],840:[function(e,o,f){o.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],841:[function(e,o,f){var r=e("../../lib"),a=e("./layout_attributes");o.exports=function(u,c){function i(s,l){return r.coerce(u,c,a,s,l)}i("iciclecolorway",c.colorway),i("extendiciclecolors")}},{"../../lib":503,"./layout_attributes":840}],842:[function(e,o,f){var r=e("d3-hierarchy"),a=e("../treemap/flip_tree");o.exports=function(u,c,i){var s=i.flipX,l=i.flipY,d=i.orientation==="h",h=i.maxDepth,m=c[0],g=c[1];h&&(m=(u.height+1)*c[0]/Math.min(u.height+1,h),g=(u.height+1)*c[1]/Math.min(u.height+1,h));var p=r.partition().padding(i.pad.inner).size(d?[c[1],m]:[c[0],g])(u);return(d||s||l)&&a(p,c,{swapXY:d,flipX:s,flipY:l}),p}},{"../treemap/flip_tree":1083,"d3-hierarchy":115}],843:[function(e,o,f){var r=e("../treemap/draw"),a=e("./draw_descendants");o.exports=function(u,c,i,s){return r(u,c,i,s,{type:"icicle",drawDescendants:a})}},{"../treemap/draw":1080,"./draw_descendants":838}],844:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../components/color"),u=e("../../lib"),c=e("../bar/uniform_text").resizeText;function i(s,l,d){var h=l.data.data,m=!l.children,g=h.i,p=u.castOption(d,g,"marker.line.color")||a.defaultLine,v=u.castOption(d,g,"marker.line.width")||0;s.style("stroke-width",v).call(a.fill,h.color).call(a.stroke,p).style("opacity",m?d.leaf.opacity:null)}o.exports={style:function(s){var l=s._fullLayout._iciclelayer.selectAll(".trace");c(s,l,"icicle"),l.each(function(d){var h=r.select(this),m=d[0].trace;h.style("opacity",m.opacity),h.selectAll("path.surface").each(function(g){r.select(this).call(i,g,m)})})},styleOne:i}},{"../../components/color":366,"../../lib":503,"../bar/uniform_text":664,"@plotly/d3":58}],845:[function(e,o,f){for(var r=e("../../plots/attributes"),a=e("../../plots/template_attributes").hovertemplateAttrs,u=e("../../lib/extend").extendFlat,c=e("./constants").colormodel,i=["rgb","rgba","rgba256","hsl","hsla"],s=[],l=[],d=0;d0||r.inbox(s-l.y0,s-(l.y0+l.h*d.dy),0)>0)){var g,p=Math.floor((i-l.x0)/d.dx),v=Math.floor(Math.abs(s-l.y0)/d.dy);if(d._hasZ?g=l.z[v][p]:d._hasSource&&(g=d._canvas.el.getContext("2d").getImageData(p,v,1,1).data),g){var y,x=l.hi||d.hoverinfo;if(x){var w=x.split("+");w.indexOf("all")!==-1&&(w=["color"]),w.indexOf("color")!==-1&&(y=!0)}var k,b=u.colormodel[d.colormodel],T=b.colormodel||d.colormodel,_=T.length,M=d._scaler(g),A=b.suffix,S=[];(d.hovertemplate||y)&&(S.push("["+[M[0]+A[0],M[1]+A[1],M[2]+A[2]].join(", ")),_===4&&S.push(", "+M[3]+A[3]),S.push("]"),S=S.join(""),c.extraText=T.toUpperCase()+": "+S),Array.isArray(d.hovertext)&&Array.isArray(d.hovertext[v])?k=d.hovertext[v][p]:Array.isArray(d.text)&&Array.isArray(d.text[v])&&(k=d.text[v][p]);var E=m.c2p(l.y0+(v+.5)*d.dy),D=l.x0+(p+.5)*d.dx,O=l.y0+(v+.5)*d.dy,R="["+g.slice(0,d.colormodel.length).join(", ")+"]";return[a.extendFlat(c,{index:[v,p],x0:h.c2p(l.x0+p*d.dx),x1:h.c2p(l.x0+(p+1)*d.dx),y0:E,y1:E,color:M,xVal:D,xLabelVal:D,yVal:O,yLabelVal:O,zLabelVal:R,text:k,hovertemplateLabels:{zLabel:R,colorLabel:S,"color[0]Label":M[0]+A[0],"color[1]Label":M[1]+A[1],"color[2]Label":M[2]+A[2],"color[3]Label":M[3]+A[3]}})]}}}},{"../../components/fx":406,"../../lib":503,"./constants":847}],852:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover"),eventData:e("./event_data"),moduleType:"trace",name:"image",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":568,"./attributes":845,"./calc":846,"./defaults":848,"./event_data":849,"./hover":851,"./plot":853,"./style":854}],853:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=a.strTranslate,c=e("../../constants/xmlns_namespaces"),i=e("./constants"),s=a.isIOS()||a.isSafari()||a.isIE();o.exports=function(l,d,h,m){var g=d.xaxis,p=d.yaxis,v=!(s||l._context._exportedPlot);a.makeTraceGroups(m,h,"im").each(function(y){var x=r.select(this),w=y[0],k=w.trace,b=(k.zsmooth==="fast"||k.zsmooth===!1&&v)&&!k._hasZ&&k._hasSource&&g.type==="linear"&&p.type==="linear";k._realImage=b;var T,_,M,A,S,E,D=w.z,O=w.x0,R=w.y0,z=w.w,L=w.h,P=k.dx,N=k.dy;for(E=0;T===void 0&&E0;)_=g.c2p(O+E*P),E--;for(E=0;A===void 0&&E0;)S=p.c2p(R+E*N),E--;_Y[0];if(Z||re){var U=T+B/2,q=A+G/2;K+="transform:"+u(U+"px",q+"px")+"scale("+(Z?-1:1)+","+(re?-1:1)+")"+u(-U+"px",-q+"px")+";"}}W.attr("style",K);var $=new Promise(function(H){if(k._hasZ)H();else if(k._hasSource)if(k._canvas&&k._canvas.el.width===z&&k._canvas.el.height===L&&k._canvas.source===k.source)H();else{var Q=document.createElement("canvas");Q.width=z,Q.height=L;var ee=Q.getContext("2d");k._image=k._image||new Image;var ie=k._image;ie.onload=function(){ee.drawImage(ie,0,0),k._canvas={el:Q,source:k.source},H()},ie.setAttribute("src",k.source)}}).then(function(){var H;if(k._hasZ)H=ne(function(ee,ie){return D[ie][ee]}).toDataURL("image/png");else if(k._hasSource)if(b)H=k.source;else{var Q=k._canvas.el.getContext("2d").getImageData(0,0,z,L).data;H=ne(function(ee,ie){var ae=4*(ie*z+ee);return[Q[ae],Q[ae+1],Q[ae+2],Q[ae+3]]}).toDataURL("image/png")}W.attr({"xlink:href":H,height:G,width:B,x:T,y:A})});l._promises.push($)}function ne(H){var Q=document.createElement("canvas");Q.width=B,Q.height=G;var ee,ie=Q.getContext("2d"),ae=function(de){return a.constrain(Math.round(g.c2p(O+de*P)-T),0,B)},ue=function(de){return a.constrain(Math.round(p.c2p(R+de*N)-A),0,G)},le=i.colormodel[k.colormodel],ge=le.colormodel||k.colormodel,fe=le.fmt;for(E=0;E0}function M(O){O.each(function(R){w.stroke(r.select(this),R.line.color)}).each(function(R){w.fill(r.select(this),R.color)}).style("stroke-width",function(R){return R.line.width})}function A(O,R,z){var L=O._fullLayout,P=c.extendFlat({type:"linear",ticks:"outside",range:z,showline:!0},R),N={type:"linear",_id:"x"+R._id},B={letter:"x",font:L.font,noHover:!0,noTickson:!0};function G(W,K){return c.coerce(P,N,x,W,K)}return v(P,N,G,B,L),y(P,N,G,B),N}function S(O,R,z){return[Math.min(R/O.width,z/O.height),O,R+"x"+z]}function E(O,R,z,L){var P=document.createElementNS("http://www.w3.org/2000/svg","text"),N=r.select(P);return N.text(O).attr("x",0).attr("y",0).attr("text-anchor",z).attr("data-unformatted",O).call(g.convertToTspans,L).call(h.font,R),h.bBox(N.node())}function D(O,R,z,L,P,N){var B="_cache"+R;O[B]&&O[B].key===P||(O[B]={key:P,value:z});var G=c.aggNums(N,null,[O[B].value,L],2);return O[B].value=G,G}o.exports=function(O,R,z,L){var P,N=O._fullLayout;_(z)&&L&&(P=L()),c.makeTraceGroups(N._indicatorlayer,R,"trace").each(function(B){var G,W,K,te,Y,Z=B[0].trace,re=r.select(this),U=Z._hasGauge,q=Z._isAngular,$=Z._isBullet,ne=Z.domain,H={w:N._size.w*(ne.x[1]-ne.x[0]),h:N._size.h*(ne.y[1]-ne.y[0]),l:N._size.l+N._size.w*ne.x[0],r:N._size.r+N._size.w*(1-ne.x[1]),t:N._size.t+N._size.h*(1-ne.y[1]),b:N._size.b+N._size.h*ne.y[0]},Q=H.l+H.w/2,ee=H.t+H.h/2,ie=Math.min(H.w/2,H.h),ae=m.innerRadius*ie,ue=Z.align||"center";if(W=ee,U){if(q&&(G=Q,W=ee+ie/2,K=function(Oe){return function(de,ye){var Me=Math.sqrt(de.width/2*(de.width/2)+de.height*de.height);return[ye/Me,de,ye]}(Oe,.9*ae)}),$){var le=m.bulletPadding,ge=1-m.bulletNumberDomainSize+le;G=H.l+(ge+(1-ge)*b[ue])*H.w,K=function(Oe){return S(Oe,(m.bulletNumberDomainSize-le)*H.w,H.h)}}}else G=H.l+b[ue]*H.w,K=function(Oe){return S(Oe,H.w,H.h)};(function(Oe,de,ye,Me){var ke,Ee,ze,Fe=ye[0].trace,Ve=Me.numbersX,Ke=Me.numbersY,Re=Fe.align||"center",qe=k[Re],We=Me.transitionOpts,Ye=Me.onComplete,nt=c.ensureSingle(de,"g","numbers"),ft=[];Fe._hasNumber&&ft.push("number"),Fe._hasDelta&&(ft.push("delta"),Fe.delta.position==="left"&&ft.reverse());var vt=nt.selectAll("text").data(ft);function Pt(Ge,Tt,dt,Pe){if(!Ge.match("s")||dt>=0==Pe>=0||Tt(dt).slice(-1).match(T)||Tt(Pe).slice(-1).match(T))return Tt;var Ie=Ge.slice().replace("s","f").replace(/\d+/,function(De){return parseInt(De)-1}),Ae=A(Oe,{tickformat:Ie});return function(De){return Math.abs(De)<1?p.tickText(Ae,De).text:Tt(De)}}vt.enter().append("text"),vt.attr("text-anchor",function(){return qe}).attr("class",function(Ge){return Ge}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),vt.exit().remove();var At,at=Fe.mode+Fe.align;if(Fe._hasDelta&&(At=function(){var Ge=A(Oe,{tickformat:Fe.delta.valueformat},Fe._range);Ge.setScale(),p.prepTicks(Ge);var Tt=function(He){return p.tickText(Ge,He).text},dt=function(He){return Fe.delta.relative?He.relativeDelta:He.delta},Pe=function(He,rt){return He===0||typeof He!="number"||isNaN(He)?"-":(He>0?Fe.delta.increasing.symbol:Fe.delta.decreasing.symbol)+rt(He)},Ie=function(He){return He.delta>=0?Fe.delta.increasing.color:Fe.delta.decreasing.color};Fe._deltaLastValue===void 0&&(Fe._deltaLastValue=dt(ye[0]));var Ae=nt.select("text.delta");function De(){Ae.text(Pe(dt(ye[0]),Tt)).call(w.fill,Ie(ye[0])).call(g.convertToTspans,Oe)}return Ae.call(h.font,Fe.delta.font).call(w.fill,Ie({delta:Fe._deltaLastValue})),_(We)?Ae.transition().duration(We.duration).ease(We.easing).tween("text",function(){var He=r.select(this),rt=dt(ye[0]),lt=Fe._deltaLastValue,ot=Pt(Fe.delta.valueformat,Tt,lt,rt),kt=u(lt,rt);return Fe._deltaLastValue=rt,function(wt){He.text(Pe(kt(wt),ot)),He.call(w.fill,Ie({delta:kt(wt)}))}}).each("end",function(){De(),Ye&&Ye()}).each("interrupt",function(){De(),Ye&&Ye()}):De(),Ee=E(Pe(dt(ye[0]),Tt),Fe.delta.font,qe,Oe),Ae}(),at+=Fe.delta.position+Fe.delta.font.size+Fe.delta.font.family+Fe.delta.valueformat,at+=Fe.delta.increasing.symbol+Fe.delta.decreasing.symbol,ze=Ee),Fe._hasNumber&&(function(){var Ge=A(Oe,{tickformat:Fe.number.valueformat},Fe._range);Ge.setScale(),p.prepTicks(Ge);var Tt=function(De){return p.tickText(Ge,De).text},dt=Fe.number.suffix,Pe=Fe.number.prefix,Ie=nt.select("text.number");function Ae(){var De=typeof ye[0].y=="number"?Pe+Tt(ye[0].y)+dt:"-";Ie.text(De).call(h.font,Fe.number.font).call(g.convertToTspans,Oe)}_(We)?Ie.transition().duration(We.duration).ease(We.easing).each("end",function(){Ae(),Ye&&Ye()}).each("interrupt",function(){Ae(),Ye&&Ye()}).attrTween("text",function(){var De=r.select(this),He=u(ye[0].lastY,ye[0].y);Fe._lastValue=ye[0].y;var rt=Pt(Fe.number.valueformat,Tt,ye[0].lastY,ye[0].y);return function(lt){De.text(Pe+rt(He(lt))+dt)}}):Ae(),ke=E(Pe+Tt(ye[0].y)+dt,Fe.number.font,qe,Oe)}(),at+=Fe.number.font.size+Fe.number.font.family+Fe.number.valueformat+Fe.number.suffix+Fe.number.prefix,ze=ke),Fe._hasDelta&&Fe._hasNumber){var et,Ot,Wt=[(ke.left+ke.right)/2,(ke.top+ke.bottom)/2],Jt=[(Ee.left+Ee.right)/2,(Ee.top+Ee.bottom)/2],Be=.75*Fe.delta.font.size;Fe.delta.position==="left"&&(et=D(Fe,"deltaPos",0,-1*(ke.width*b[Fe.align]+Ee.width*(1-b[Fe.align])+Be),at,Math.min),Ot=Wt[1]-Jt[1],ze={width:ke.width+Ee.width+Be,height:Math.max(ke.height,Ee.height),left:Ee.left+et,right:ke.right,top:Math.min(ke.top,Ee.top+Ot),bottom:Math.max(ke.bottom,Ee.bottom+Ot)}),Fe.delta.position==="right"&&(et=D(Fe,"deltaPos",0,ke.width*(1-b[Fe.align])+Ee.width*b[Fe.align]+Be,at,Math.max),Ot=Wt[1]-Jt[1],ze={width:ke.width+Ee.width+Be,height:Math.max(ke.height,Ee.height),left:ke.left,right:Ee.right+et,top:Math.min(ke.top,Ee.top+Ot),bottom:Math.max(ke.bottom,Ee.bottom+Ot)}),Fe.delta.position==="bottom"&&(et=null,Ot=Ee.height,ze={width:Math.max(ke.width,Ee.width),height:ke.height+Ee.height,left:Math.min(ke.left,Ee.left),right:Math.max(ke.right,Ee.right),top:ke.bottom-ke.height,bottom:ke.bottom+Ee.height}),Fe.delta.position==="top"&&(et=null,Ot=ke.top,ze={width:Math.max(ke.width,Ee.width),height:ke.height+Ee.height,left:Math.min(ke.left,Ee.left),right:Math.max(ke.right,Ee.right),top:ke.bottom-ke.height-Ee.height,bottom:ke.bottom}),At.attr({dx:et,dy:Ot})}(Fe._hasNumber||Fe._hasDelta)&&nt.attr("transform",function(){var Ge=Me.numbersScaler(ze);at+=Ge[2];var Tt,dt=D(Fe,"numbersScale",1,Ge[0],at,Math.min);Fe._scaleNumbers||(dt=1),Tt=Fe._isAngular?Ke-dt*ze.bottom:Ke-dt*(ze.top+ze.bottom)/2,Fe._numbersTop=dt*ze.top+Tt;var Pe=ze[Re];Re==="center"&&(Pe=(ze.left+ze.right)/2);var Ie=Ve-dt*Pe;return Ie=D(Fe,"numbersTranslate",0,Ie,at,Math.max),s(Ie,Tt)+i(dt)})})(O,re,B,{numbersX:G,numbersY:W,numbersScaler:K,transitionOpts:z,onComplete:P}),U&&(te={range:Z.gauge.axis.range,color:Z.gauge.bgcolor,line:{color:Z.gauge.bordercolor,width:0},thickness:1},Y={range:Z.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:Z.gauge.bordercolor,width:Z.gauge.borderwidth},thickness:1});var fe=re.selectAll("g.angular").data(q?B:[]);fe.exit().remove();var me=re.selectAll("g.angularaxis").data(q?B:[]);me.exit().remove(),q&&function(Oe,de,ye,Me){var ke,Ee,ze,Fe,Ve=ye[0].trace,Ke=Me.size,Re=Me.radius,qe=Me.innerRadius,We=Me.gaugeBg,Ye=Me.gaugeOutline,nt=[Ke.l+Ke.w/2,Ke.t+Ke.h/2+Re/2],ft=Me.gauge,vt=Me.layer,Pt=Me.transitionOpts,At=Me.onComplete,at=Math.PI/2;function et(Ut){var tt=Ve.gauge.axis.range[0],bt=(Ut-tt)/(Ve.gauge.axis.range[1]-tt)*Math.PI-at;return bt<-at?-at:bt>at?at:bt}function Ot(Ut){return r.svg.arc().innerRadius((qe+Re)/2-Ut/2*(Re-qe)).outerRadius((qe+Re)/2+Ut/2*(Re-qe)).startAngle(-at)}function Wt(Ut){Ut.attr("d",function(tt){return Ot(tt.thickness).startAngle(et(tt.range[0])).endAngle(et(tt.range[1]))()})}ft.enter().append("g").classed("angular",!0),ft.attr("transform",s(nt[0],nt[1])),vt.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),vt.selectAll("g.xangularaxistick,path,text").remove(),(ke=A(Oe,Ve.gauge.axis)).type="linear",ke.range=Ve.gauge.axis.range,ke._id="xangularaxis",ke.ticklabeloverflow="allow",ke.setScale();var Jt=function(Ut){return(ke.range[0]-Ut.x)/(ke.range[1]-ke.range[0])*Math.PI+Math.PI},Be={},Ge=p.makeLabelFns(ke,0).labelStandoff;Be.xFn=function(Ut){var tt=Jt(Ut);return Math.cos(tt)*Ge},Be.yFn=function(Ut){var tt=Jt(Ut),bt=Math.sin(tt)>0?.2:1;return-Math.sin(tt)*(Ge+Ut.fontSize*bt)+Math.abs(Math.cos(tt))*(Ut.fontSize*d)},Be.anchorFn=function(Ut){var tt=Jt(Ut),bt=Math.cos(tt);return Math.abs(bt)<.1?"middle":bt>0?"start":"end"},Be.heightFn=function(Ut,tt,bt){var zt=Jt(Ut);return-.5*(1+Math.sin(zt))*bt};var Tt=function(Ut){return s(nt[0]+Re*Math.cos(Ut),nt[1]-Re*Math.sin(Ut))};if(ze=function(Ut){return Tt(Jt(Ut))},Ee=p.calcTicks(ke),Fe=p.getTickSigns(ke)[2],ke.visible){Fe=ke.ticks==="inside"?-1:1;var dt=(ke.linewidth||1)/2;p.drawTicks(Oe,ke,{vals:Ee,layer:vt,path:"M"+Fe*dt+",0h"+Fe*ke.ticklen,transFn:function(Ut){var tt=Jt(Ut);return Tt(tt)+"rotate("+-l(tt)+")"}}),p.drawLabels(Oe,ke,{vals:Ee,layer:vt,transFn:ze,labelFns:Be})}var Pe=[We].concat(Ve.gauge.steps),Ie=ft.selectAll("g.bg-arc").data(Pe);Ie.enter().append("g").classed("bg-arc",!0).append("path"),Ie.select("path").call(Wt).call(M),Ie.exit().remove();var Ae=Ot(Ve.gauge.bar.thickness),De=ft.selectAll("g.value-arc").data([Ve.gauge.bar]);De.enter().append("g").classed("value-arc",!0).append("path");var He=De.select("path");_(Pt)?(He.transition().duration(Pt.duration).ease(Pt.easing).each("end",function(){At&&At()}).each("interrupt",function(){At&&At()}).attrTween("d",(rt=Ae,lt=et(ye[0].lastY),ot=et(ye[0].y),function(){var Ut=a(lt,ot);return function(tt){return rt.endAngle(Ut(tt))()}})),Ve._lastValue=ye[0].y):He.attr("d",typeof ye[0].y=="number"?Ae.endAngle(et(ye[0].y)):"M0,0Z");var rt,lt,ot;He.call(M),De.exit().remove(),Pe=[];var kt=Ve.gauge.threshold.value;(kt||kt===0)&&Pe.push({range:[kt,kt],color:Ve.gauge.threshold.color,line:{color:Ve.gauge.threshold.line.color,width:Ve.gauge.threshold.line.width},thickness:Ve.gauge.threshold.thickness});var wt=ft.selectAll("g.threshold-arc").data(Pe);wt.enter().append("g").classed("threshold-arc",!0).append("path"),wt.select("path").call(Wt).call(M),wt.exit().remove();var Vt=ft.selectAll("g.gauge-outline").data([Ye]);Vt.enter().append("g").classed("gauge-outline",!0).append("path"),Vt.select("path").call(Wt).call(M),Vt.exit().remove()}(O,0,B,{radius:ie,innerRadius:ae,gauge:fe,layer:me,size:H,gaugeBg:te,gaugeOutline:Y,transitionOpts:z,onComplete:P});var _e=re.selectAll("g.bullet").data($?B:[]);_e.exit().remove();var we=re.selectAll("g.bulletaxis").data($?B:[]);we.exit().remove(),$&&function(Oe,de,ye,Me){var ke,Ee,ze,Fe,Ve,Ke=ye[0].trace,Re=Me.gauge,qe=Me.layer,We=Me.gaugeBg,Ye=Me.gaugeOutline,nt=Me.size,ft=Ke.domain,vt=Me.transitionOpts,Pt=Me.onComplete;Re.enter().append("g").classed("bullet",!0),Re.attr("transform",s(nt.l,nt.t)),qe.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),qe.selectAll("g.xbulletaxistick,path,text").remove();var At=nt.h,at=Ke.gauge.bar.thickness*At,et=ft.x[0],Ot=ft.x[0]+(ft.x[1]-ft.x[0])*(Ke._hasNumber||Ke._hasDelta?1-m.bulletNumberDomainSize:1);(ke=A(Oe,Ke.gauge.axis))._id="xbulletaxis",ke.domain=[et,Ot],ke.setScale(),Ee=p.calcTicks(ke),ze=p.makeTransTickFn(ke),Fe=p.getTickSigns(ke)[2],Ve=nt.t+nt.h,ke.visible&&(p.drawTicks(Oe,ke,{vals:ke.ticks==="inside"?p.clipEnds(ke,Ee):Ee,layer:qe,path:p.makeTickPath(ke,Ve,Fe),transFn:ze}),p.drawLabels(Oe,ke,{vals:Ee,layer:qe,transFn:ze,labelFns:p.makeLabelFns(ke,Ve)}));function Wt(Ie){Ie.attr("width",function(Ae){return Math.max(0,ke.c2p(Ae.range[1])-ke.c2p(Ae.range[0]))}).attr("x",function(Ae){return ke.c2p(Ae.range[0])}).attr("y",function(Ae){return .5*(1-Ae.thickness)*At}).attr("height",function(Ae){return Ae.thickness*At})}var Jt=[We].concat(Ke.gauge.steps),Be=Re.selectAll("g.bg-bullet").data(Jt);Be.enter().append("g").classed("bg-bullet",!0).append("rect"),Be.select("rect").call(Wt).call(M),Be.exit().remove();var Ge=Re.selectAll("g.value-bullet").data([Ke.gauge.bar]);Ge.enter().append("g").classed("value-bullet",!0).append("rect"),Ge.select("rect").attr("height",at).attr("y",(At-at)/2).call(M),_(vt)?Ge.select("rect").transition().duration(vt.duration).ease(vt.easing).each("end",function(){Pt&&Pt()}).each("interrupt",function(){Pt&&Pt()}).attr("width",Math.max(0,ke.c2p(Math.min(Ke.gauge.axis.range[1],ye[0].y)))):Ge.select("rect").attr("width",typeof ye[0].y=="number"?Math.max(0,ke.c2p(Math.min(Ke.gauge.axis.range[1],ye[0].y))):0),Ge.exit().remove();var Tt=ye.filter(function(){return Ke.gauge.threshold.value||Ke.gauge.threshold.value===0}),dt=Re.selectAll("g.threshold-bullet").data(Tt);dt.enter().append("g").classed("threshold-bullet",!0).append("line"),dt.select("line").attr("x1",ke.c2p(Ke.gauge.threshold.value)).attr("x2",ke.c2p(Ke.gauge.threshold.value)).attr("y1",(1-Ke.gauge.threshold.thickness)/2*At).attr("y2",(1-(1-Ke.gauge.threshold.thickness)/2)*At).call(w.stroke,Ke.gauge.threshold.line.color).style("stroke-width",Ke.gauge.threshold.line.width),dt.exit().remove();var Pe=Re.selectAll("g.gauge-outline").data([Ye]);Pe.enter().append("g").classed("gauge-outline",!0).append("rect"),Pe.select("rect").call(Wt).call(M),Pe.exit().remove()}(O,0,B,{gauge:_e,layer:we,size:H,gaugeBg:te,gaugeOutline:Y,transitionOpts:z,onComplete:P});var Te=re.selectAll("text.title").data(B);Te.exit().remove(),Te.enter().append("text").classed("title",!0),Te.attr("text-anchor",function(){return $?k.right:k[Z.title.align]}).text(Z.title.text).call(h.font,Z.title.font).call(g.convertToTspans,O),Te.attr("transform",function(){var Oe,de=H.l+H.w*b[Z.title.align],ye=m.titlePadding,Me=h.bBox(Te.node());return U?(q&&(Z.gauge.axis.visible?Oe=h.bBox(me.node()).top-ye-Me.bottom:Oe=H.t+H.h/2-ie/2-Me.bottom-ye),$&&(Oe=W-(Me.top+Me.bottom)/2,de=H.l-m.bulletPadding*H.w)):Oe=Z._numbersTop-ye-Me.bottom,s(de,Oe)})})}},{"../../components/color":366,"../../components/drawing":388,"../../constants/alignment":471,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"../../plots/cartesian/axis_defaults":556,"../../plots/cartesian/layout_attributes":569,"../../plots/cartesian/position_defaults":572,"./constants":858,"@plotly/d3":58,"d3-interpolate":116}],862:[function(e,o,f){var r=e("../../components/colorscale/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,u=e("../../plots/template_attributes").hovertemplateAttrs,c=e("../mesh3d/attributes"),i=e("../../plots/attributes"),s=e("../../lib/extend").extendFlat,l=e("../../plot_api/edit_types").overrideAll,d=o.exports=l(s({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:u(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),valuehoverformat:a("value",1),showlegend:s({},i.showlegend,{dflt:!1})},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:c.opacity,lightposition:c.lightposition,lighting:c.lighting,flatshading:c.flatshading,contour:c.contour,hoverinfo:s({},i.hoverinfo)}),"calc","nested");d.flatshading.dflt=!0,d.lighting.facenormalsepsilon.dflt=0,d.x.editType=d.y.editType=d.z.editType=d.value.editType="calc+clearAxisTypes",d.transforms=void 0},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../mesh3d/attributes":867}],863:[function(e,o,f){var r=e("../../components/colorscale/calc"),a=e("../streamtube/calc").processGrid,u=e("../streamtube/calc").filter;o.exports=function(c,i){i._len=Math.min(i.x.length,i.y.length,i.z.length,i.value.length),i._x=u(i.x,i._len),i._y=u(i.y,i._len),i._z=u(i.z,i._len),i._value=u(i.value,i._len);var s=a(i);i._gridFill=s.fill,i._Xs=s.Xs,i._Ys=s.Ys,i._Zs=s.Zs,i._len=s.len;for(var l=1/0,d=-1/0,h=0;h0;v--){var y=Math.min(p[v],p[v-1]),x=Math.max(p[v],p[v-1]);if(x>y&&y-1}function Q(Re,qe){return Re===null?qe:Re}function ee(Re,qe,We){re();var Ye,nt,ft,vt=[qe],Pt=[We];if(b>=1)vt=[qe],Pt=[We];else if(b>0){var At=function(dt,Pe){var Ie=dt[0],Ae=dt[1],De=dt[2],He=function(tt,bt,zt){for(var St=[],Dt=0;Dt-1?We[Ot]:Z(Wt,Jt,Be);et[Ot]=Tt>-1?Tt:q(Wt,Jt,Be,Q(Re,Ge))}Ye=et[0],nt=et[1],ft=et[2],g._meshI.push(Ye),g._meshJ.push(nt),g._meshK.push(ft),++D}}function ie(Re,qe,We,Ye){var nt=Re[3];ntYe&&(nt=Ye);for(var ft=(Re[3]-nt)/(Re[3]-qe[3]+1e-9),vt=[],Pt=0;Pt<4;Pt++)vt[Pt]=(1-ft)*Re[Pt]+ft*qe[Pt];return vt}function ae(Re,qe,We){return Re>=qe&&Re<=We}function ue(Re){var qe=.001*(Y-te);return Re>=te-qe&&Re<=Y+qe}function le(Re){for(var qe=[],We=0;We<4;We++){var Ye=Re[We];qe.push([g._x[Ye],g._y[Ye],g._z[Ye],g._value[Ye]])}return qe}function ge(Re,qe,We,Ye,nt,ft){ft||(ft=1),We=[-1,-1,-1];var vt=!1,Pt=[ae(qe[0][3],Ye,nt),ae(qe[1][3],Ye,nt),ae(qe[2][3],Ye,nt)];if(!Pt[0]&&!Pt[1]&&!Pt[2])return!1;var At=function(et,Ot,Wt){return ue(Ot[0][3])&&ue(Ot[1][3])&&ue(Ot[2][3])?(ee(et,Ot,Wt),!0):ft<3&&ge(et,Ot,Wt,te,Y,++ft)};if(Pt[0]&&Pt[1]&&Pt[2])return At(Re,qe,We)||vt;var at=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(et){if(Pt[et[0]]&&Pt[et[1]]&&!Pt[et[2]]){var Ot=qe[et[0]],Wt=qe[et[1]],Jt=qe[et[2]],Be=ie(Jt,Ot,Ye,nt),Ge=ie(Jt,Wt,Ye,nt);vt=At(Re,[Ge,Be,Ot],[-1,-1,We[et[0]]])||vt,vt=At(Re,[Ot,Wt,Ge],[We[et[0]],We[et[1]],-1])||vt,at=!0}}),at||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(et){if(Pt[et[0]]&&!Pt[et[1]]&&!Pt[et[2]]){var Ot=qe[et[0]],Wt=qe[et[1]],Jt=qe[et[2]],Be=ie(Wt,Ot,Ye,nt),Ge=ie(Jt,Ot,Ye,nt);vt=At(Re,[Ge,Be,Ot],[-1,-1,We[et[0]]])||vt,at=!0}}),vt}function fe(Re,qe,We,Ye){var nt=!1,ft=le(qe),vt=[ae(ft[0][3],We,Ye),ae(ft[1][3],We,Ye),ae(ft[2][3],We,Ye),ae(ft[3][3],We,Ye)];if(!(vt[0]||vt[1]||vt[2]||vt[3]))return nt;if(vt[0]&&vt[1]&&vt[2]&&vt[3])return E&&(nt=function(At,at,et){var Ot=function(Wt,Jt,Be){ee(At,[at[Wt],at[Jt],at[Be]],[et[Wt],et[Jt],et[Be]])};Ot(0,1,2),Ot(3,0,1),Ot(2,3,0),Ot(1,2,3)}(Re,ft,qe)||nt),nt;var Pt=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(At){if(vt[At[0]]&&vt[At[1]]&&vt[At[2]]&&!vt[At[3]]){var at=ft[At[0]],et=ft[At[1]],Ot=ft[At[2]],Wt=ft[At[3]];if(E)nt=ee(Re,[at,et,Ot],[qe[At[0]],qe[At[1]],qe[At[2]]])||nt;else{var Jt=ie(Wt,at,We,Ye),Be=ie(Wt,et,We,Ye),Ge=ie(Wt,Ot,We,Ye);nt=ee(null,[Jt,Be,Ge],[-1,-1,-1])||nt}Pt=!0}}),Pt||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach(function(At){if(vt[At[0]]&&vt[At[1]]&&!vt[At[2]]&&!vt[At[3]]){var at=ft[At[0]],et=ft[At[1]],Ot=ft[At[2]],Wt=ft[At[3]],Jt=ie(Ot,at,We,Ye),Be=ie(Ot,et,We,Ye),Ge=ie(Wt,et,We,Ye),Tt=ie(Wt,at,We,Ye);E?(nt=ee(Re,[at,Tt,Jt],[qe[At[0]],-1,-1])||nt,nt=ee(Re,[et,Be,Ge],[qe[At[1]],-1,-1])||nt):nt=function(dt,Pe,Ie){var Ae=function(De,He,rt){ee(dt,[Pe[De],Pe[He],Pe[rt]],[Ie[De],Ie[He],Ie[rt]])};Ae(0,1,2),Ae(2,3,0)}(null,[Jt,Be,Ge,Tt],[-1,-1,-1,-1])||nt,Pt=!0}}),Pt||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(At){if(vt[At[0]]&&!vt[At[1]]&&!vt[At[2]]&&!vt[At[3]]){var at=ft[At[0]],et=ft[At[1]],Ot=ft[At[2]],Wt=ft[At[3]],Jt=ie(et,at,We,Ye),Be=ie(Ot,at,We,Ye),Ge=ie(Wt,at,We,Ye);E?(nt=ee(Re,[at,Jt,Be],[qe[At[0]],-1,-1])||nt,nt=ee(Re,[at,Be,Ge],[qe[At[0]],-1,-1])||nt,nt=ee(Re,[at,Ge,Jt],[qe[At[0]],-1,-1])||nt):nt=ee(null,[Jt,Be,Ge],[-1,-1,-1])||nt,Pt=!0}})),nt}function me(Re,qe,We,Ye,nt,ft,vt,Pt,At,at,et){var Ot=!1;return S&&(H(Re,"A")&&(Ot=fe(null,[qe,We,Ye,ft],at,et)||Ot),H(Re,"B")&&(Ot=fe(null,[We,Ye,nt,At],at,et)||Ot),H(Re,"C")&&(Ot=fe(null,[We,ft,vt,At],at,et)||Ot),H(Re,"D")&&(Ot=fe(null,[Ye,ft,Pt,At],at,et)||Ot),H(Re,"E")&&(Ot=fe(null,[We,Ye,ft,At],at,et)||Ot)),E&&(Ot=fe(Re,[We,Ye,ft,At],at,et)||Ot),Ot}function _e(Re,qe,We,Ye,nt,ft,vt,Pt){return[Pt[0]===!0||ge(Re,le([qe,We,Ye]),[qe,We,Ye],ft,vt),Pt[1]===!0||ge(Re,le([Ye,nt,qe]),[Ye,nt,qe],ft,vt)]}function we(Re,qe,We,Ye,nt,ft,vt,Pt,At){return Pt?_e(Re,qe,We,nt,Ye,ft,vt,At):_e(Re,We,nt,Ye,qe,ft,vt,At)}function Te(Re,qe,We,Ye,nt,ft,vt){var Pt,At,at,et,Ot=!1,Wt=function(){Ot=ge(Re,[Pt,At,at],[-1,-1,-1],nt,ft)||Ot,Ot=ge(Re,[at,et,Pt],[-1,-1,-1],nt,ft)||Ot},Jt=vt[0],Be=vt[1],Ge=vt[2];return Jt&&(Pt=$(le([G(qe,We-0,Ye-0)])[0],le([G(qe-1,We-0,Ye-0)])[0],Jt),At=$(le([G(qe,We-0,Ye-1)])[0],le([G(qe-1,We-0,Ye-1)])[0],Jt),at=$(le([G(qe,We-1,Ye-1)])[0],le([G(qe-1,We-1,Ye-1)])[0],Jt),et=$(le([G(qe,We-1,Ye-0)])[0],le([G(qe-1,We-1,Ye-0)])[0],Jt),Wt()),Be&&(Pt=$(le([G(qe-0,We,Ye-0)])[0],le([G(qe-0,We-1,Ye-0)])[0],Be),At=$(le([G(qe-0,We,Ye-1)])[0],le([G(qe-0,We-1,Ye-1)])[0],Be),at=$(le([G(qe-1,We,Ye-1)])[0],le([G(qe-1,We-1,Ye-1)])[0],Be),et=$(le([G(qe-1,We,Ye-0)])[0],le([G(qe-1,We-1,Ye-0)])[0],Be),Wt()),Ge&&(Pt=$(le([G(qe-0,We-0,Ye)])[0],le([G(qe-0,We-0,Ye-1)])[0],Ge),At=$(le([G(qe-0,We-1,Ye)])[0],le([G(qe-0,We-1,Ye-1)])[0],Ge),at=$(le([G(qe-1,We-1,Ye)])[0],le([G(qe-1,We-1,Ye-1)])[0],Ge),et=$(le([G(qe-1,We-0,Ye)])[0],le([G(qe-1,We-0,Ye-1)])[0],Ge),Wt()),Ot}function Oe(Re,qe,We,Ye,nt,ft,vt,Pt,At,at,et,Ot){var Wt=Re;return Ot?(S&&Re==="even"&&(Wt=null),me(Wt,qe,We,Ye,nt,ft,vt,Pt,At,at,et)):(S&&Re==="odd"&&(Wt=null),me(Wt,At,Pt,vt,ft,nt,Ye,We,qe,at,et))}function de(Re,qe,We,Ye,nt){for(var ft=[],vt=0,Pt=0;PtMath.abs(nt-K)?[W,nt]:[nt,K];Ee(Re,ft[0],ft[1])}}var vt=[[Math.min(te,K),Math.max(te,K)],[Math.min(W,Y),Math.max(W,Y)]];["x","y","z"].forEach(function(Pt){for(var At=[],at=0;at0&&(Ge.push(Pe.id),Pt==="x"?Tt.push([Pe.distRatio,0,0]):Pt==="y"?Tt.push([0,Pe.distRatio,0]):Tt.push([0,0,Pe.distRatio]))}else Be=Ke(1,Pt==="x"?L-1:Pt==="y"?P-1:N-1);Ge.length>0&&(At[et]=Pt==="x"?ze(null,Ge,Ot,Wt,Tt,At[et]):Pt==="y"?Fe(null,Ge,Ot,Wt,Tt,At[et]):Ve(null,Ge,Ot,Wt,Tt,At[et]),et++),Be.length>0&&(At[et]=Pt==="x"?de(null,Be,Ot,Wt,At[et]):Pt==="y"?ye(null,Be,Ot,Wt,At[et]):Me(null,Be,Ot,Wt,At[et]),et++)}var Ie=g.caps[Pt];Ie.show&&Ie.fill&&(ne(Ie.fill),At[et]=Pt==="x"?de(null,[0,L-1],Ot,Wt,At[et]):Pt==="y"?ye(null,[0,P-1],Ot,Wt,At[et]):Me(null,[0,N-1],Ot,Wt,At[et]),et++)}}),D===0&&U(),g._meshX=y,g._meshY=x,g._meshZ=w,g._meshIntensity=k,g._Xs=O,g._Ys=R,g._Zs=z}(),g}o.exports={findNearestOnAxis:s,generateIsoMeshes:m,createIsosurfaceTrace:function(g,p){var v=g.glplot.gl,y=r({gl:v}),x=new l(g,y,p.uid);return y._trace=x,x.update(p),g.glplot.add(y),x}}},{"../../../stackgl_modules":1124,"../../components/colorscale":378,"../../lib/gl_format_color":499,"../../lib/str2rgbarray":528,"../../plots/gl3d/zip3":609}],865:[function(e,o,f){var r=e("../../lib"),a=e("../../registry"),u=e("./attributes"),c=e("../../components/colorscale/defaults");function i(s,l,d,h,m){var g=m("isomin"),p=m("isomax");p!=null&&g!=null&&g>p&&(l.isomin=null,l.isomax=null);var v=m("x"),y=m("y"),x=m("z"),w=m("value");v&&v.length&&y&&y.length&&x&&x.length&&w&&w.length?(a.getComponentMethod("calendars","handleTraceDefaults")(s,l,["x","y","z"],h),m("valuehoverformat"),["x","y","z"].forEach(function(k){m(k+"hoverformat");var b="caps."+k;m(b+".show")&&m(b+".fill");var T="slices."+k;m(T+".show")&&(m(T+".fill"),m(T+".locations"))}),m("spaceframe.show")&&m("spaceframe.fill"),m("surface.show")&&(m("surface.count"),m("surface.fill"),m("surface.pattern")),m("contour.show")&&(m("contour.color"),m("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(k){m(k)}),c(s,l,h,m,{prefix:"",cLetter:"c"}),l._length=null):l.visible=!1}o.exports={supplyDefaults:function(s,l,d,h){i(s,l,d,h,function(m,g){return r.coerce(s,l,u,m,g)})},supplyIsoDefaults:i}},{"../../components/colorscale/defaults":376,"../../lib":503,"../../registry":638,"./attributes":862}],866:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,calc:e("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:e("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:e("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":598,"./attributes":862,"./calc":863,"./convert":864,"./defaults":865}],867:[function(e,o,f){var r=e("../../components/colorscale/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,u=e("../../plots/template_attributes").hovertemplateAttrs,c=e("../surface/attributes"),i=e("../../plots/attributes"),s=e("../../lib/extend").extendFlat;o.exports=s({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:u({editType:"calc"}),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("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},r("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:c.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},c.contours.x.show,{}),color:c.contours.x.color,width:c.contours.x.width,editType:"calc"},lightposition:{x:s({},c.lightposition.x,{dflt:1e5}),y:s({},c.lightposition.y,{dflt:1e5}),z:s({},c.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({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"},c.lighting),hoverinfo:s({},i.hoverinfo,{editType:"calc"}),showlegend:s({},i.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633,"../surface/attributes":1061}],868:[function(e,o,f){var r=e("../../components/colorscale/calc");o.exports=function(a,u){u.intensity&&r(a,u,{vals:u.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":374}],869:[function(e,o,f){var r=e("../../../stackgl_modules").gl_mesh3d,a=e("../../../stackgl_modules").delaunay_triangulate,u=e("../../../stackgl_modules").alpha_shape,c=e("../../../stackgl_modules").convex_hull,i=e("../../lib/gl_format_color").parseColorScale,s=e("../../lib/str2rgbarray"),l=e("../../components/colorscale").extractOpts,d=e("../../plots/gl3d/zip3");function h(x,w,k){this.scene=x,this.uid=k,this.mesh=w,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var m=h.prototype;function g(x){for(var w=[],k=x.length,b=0;b=w-.5)return!1;return!0}m.handlePick=function(x){if(x.object===this.mesh){var w=x.index=x.data.index;x.data._cellCenter?x.traceCoordinate=x.data.dataCoordinate:x.traceCoordinate=[this.data.x[w],this.data.y[w],this.data.z[w]];var k=this.data.hovertext||this.data.text;return Array.isArray(k)&&k[w]!==void 0?x.textLabel=k[w]:k&&(x.textLabel=k),!0}},m.update=function(x){var w=this.scene,k=w.fullSceneLayout;this.data=x;var b,T=x.x.length,_=d(p(k.xaxis,x.x,w.dataScale[0],x.xcalendar),p(k.yaxis,x.y,w.dataScale[1],x.ycalendar),p(k.zaxis,x.z,w.dataScale[2],x.zcalendar));if(x.i&&x.j&&x.k){if(x.i.length!==x.j.length||x.j.length!==x.k.length||!y(x.i,T)||!y(x.j,T)||!y(x.k,T))return;b=d(v(x.i),v(x.j),v(x.k))}else b=x.alphahull===0?c(_):x.alphahull>0?u(x.alphahull,_):function(E,D){for(var O=["x","y","z"].indexOf(E),R=[],z=D.length,L=0;LM):_=L>O,M=L;var P=v(O,R,z,L);P.pos=D,P.yc=(O+L)/2,P.i=E,P.dir=_?"increasing":"decreasing",P.x=P.pos,P.y=[z,R],A&&(P.orig_p=m[E]),b&&(P.tx=h.text[E]),T&&(P.htx=h.hovertext[E]),S.push(P)}else S.push({pos:D,empty:!0})}return h._extremes[p._id]=u.findExtremes(p,r.concat(w,x),{padded:!0}),S.length&&(S[0].t={labels:{open:a(d,"open:")+" ",high:a(d,"high:")+" ",low:a(d,"low:")+" ",close:a(d,"close:")+" "}}),S}o.exports={calc:function(d,h){var m=u.getFromId(d,h.xaxis),g=u.getFromId(d,h.yaxis),p=function(k,b,T){var _=T._minDiff;if(!_){var M,A=k._fullData,S=[];for(_=1/0,M=0;M"+b.labels[R]+r.hoverLabelText(w,z,k.yhoverformat):((O=a.extendFlat({},_)).y0=O.y1=L,O.yLabelVal=z,O.yLabel=b.labels[R]+r.hoverLabelText(w,z,k.yhoverformat),O.name="",T.push(O),E[z]=O)}return T}function m(g,p,v,y){var x=g.cd,w=g.ya,k=x[0].trace,b=x[0].t,T=d(g,p,v,y);if(!T)return[];var _=x[T.index],M=T.index=_.i,A=_.dir;function S(P){return b.labels[P]+r.hoverLabelText(w,k[P][M],k.yhoverformat)}var E=_.hi||k.hoverinfo,D=E.split("+"),O=E==="all",R=O||D.indexOf("y")!==-1,z=O||D.indexOf("text")!==-1,L=R?[S("open"),S("high"),S("low"),S("close")+" "+l[A]]:[];return z&&i(_,k,L),T.extraText=L.join("
"),T.y0=T.y1=w.c2p(_.yc,!0),[T]}o.exports={hoverPoints:function(g,p,v,y){return g.cd[0].trace.hoverlabel.split?h(g,p,v,y):m(g,p,v,y)},hoverSplit:h,hoverOnPoints:m}},{"../../components/color":366,"../../components/fx":406,"../../constants/delta.js":473,"../../lib":503,"../../plots/cartesian/axes":554}],876:[function(e,o,f){o.exports={moduleType:"trace",name:"ohlc",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc").calc,plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select")}},{"../../plots/cartesian":568,"./attributes":872,"./calc":873,"./defaults":874,"./hover":875,"./plot":878,"./select":879,"./style":880}],877:[function(e,o,f){var r=e("../../registry"),a=e("../../lib");o.exports=function(u,c,i,s){var l=i("x"),d=i("open"),h=i("high"),m=i("low"),g=i("close");if(i("hoverlabel.split"),r.getComponentMethod("calendars","handleTraceDefaults")(u,c,["x"],s),d&&h&&m&&g){var p=Math.min(d.length,h.length,m.length,g.length);return l&&(p=Math.min(p,a.minRowLength(l))),c._length=p,p}}},{"../../lib":503,"../../registry":638}],878:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib");o.exports=function(u,c,i,s){var l=c.yaxis,d=c.xaxis,h=!!d.rangebreaks;a.makeTraceGroups(s,i,"trace ohlc").each(function(m){var g=r.select(this),p=m[0],v=p.t;if(p.trace.visible!==!0||v.empty)g.remove();else{var y=v.tickLen,x=g.selectAll("path").data(a.identity);x.enter().append("path"),x.exit().remove(),x.attr("d",function(w){if(w.empty)return"M0,0Z";var k=d.c2p(w.pos-y,!0),b=d.c2p(w.pos+y,!0),T=h?(k+b)/2:d.c2p(w.pos,!0);return"M"+k+","+l.c2p(w.o,!0)+"H"+T+"M"+T+","+l.c2p(w.h,!0)+"V"+l.c2p(w.l,!0)+"M"+b+","+l.c2p(w.c,!0)+"H"+T})}})}},{"../../lib":503,"@plotly/d3":58}],879:[function(e,o,f){o.exports=function(r,a){var u,c=r.cd,i=r.xaxis,s=r.yaxis,l=[],d=c[0].t.bPos||0;if(a===!1)for(u=0;u=U.length||q[U[$]]!==void 0)return!1;q[U[$]]=!0}return!0}(Z.map(function(U){return U.displayindex})))for(re=0;re0;w&&(y="array");var k=g("categoryorder",y);k==="array"?(g("categoryarray"),g("ticktext")):(delete h.categoryarray,delete h.ticktext),w||k!=="array"||(m.categoryorder="trace")}}o.exports=function(h,m,g,p){function v(b,T){return r.coerce(h,m,s,b,T)}var y=i(h,m,{name:"dimensions",handleItemDefaults:d}),x=function(b,T,_,M,A){A("line.shape"),A("line.hovertemplate");var S=A("line.color",M.colorway[0]);if(a(b,"line")&&r.isArrayOrTypedArray(S)){if(S.length)return A("line.colorscale"),u(b,T,M,A,{prefix:"line.",cLetter:"c"}),S.length;T.line.color=_}return 1/0}(h,m,g,p,v);c(m,p,v),Array.isArray(y)&&y.length||(m.visible=!1),l(m,y,"values",x),v("hoveron"),v("hovertemplate"),v("arrangement"),v("bundlecolors"),v("sortpaths"),v("counts");var w={family:p.font.family,size:Math.round(p.font.size),color:p.font.color};r.coerceFont(v,"labelfont",w);var k={family:p.font.family,size:Math.round(p.font.size/1.2),color:p.font.color};r.coerceFont(v,"tickfont",k)}},{"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"../../lib":503,"../../plots/array_container_defaults":549,"../../plots/domain":584,"../parcoords/merge_length":898,"./attributes":881}],885:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:e("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":881,"./base_plot":882,"./calc":883,"./defaults":884,"./plot":887}],886:[function(e,o,f){var r=e("@plotly/d3"),a=e("d3-interpolate").interpolateNumber,u=e("../../plot_api/plot_api"),c=e("../../components/fx"),i=e("../../lib"),s=i.strTranslate,l=e("../../components/drawing"),d=e("tinycolor2"),h=e("../../lib/svg_text_utils");function m(U,q,$,ne){var H=U.map(K.bind(0,q,$)),Q=ne.selectAll("g.parcatslayer").data([null]);Q.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var ee=Q.selectAll("g.trace.parcats").data(H,g),ie=ee.enter().append("g").attr("class","trace parcats");ee.attr("transform",function(Te){return s(Te.x,Te.y)}),ie.append("g").attr("class","paths");var ae=ee.select("g.paths").selectAll("path.path").data(function(Te){return Te.paths},g);ae.attr("fill",function(Te){return Te.model.color});var ue=ae.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Te){return Te.model.color}).attr("fill-opacity",0);T(ue),ae.attr("d",function(Te){return Te.svgD}),ue.empty()||ae.sort(v),ae.exit().remove(),ae.on("mouseover",y).on("mouseout",x).on("click",b),ie.append("g").attr("class","dimensions");var le=ee.select("g.dimensions").selectAll("g.dimension").data(function(Te){return Te.dimensions},g);le.enter().append("g").attr("class","dimension"),le.attr("transform",function(Te){return s(Te.x,0)}),le.exit().remove();var ge=le.selectAll("g.category").data(function(Te){return Te.categories},g),fe=ge.enter().append("g").attr("class","category");ge.attr("transform",function(Te){return s(0,Te.y)}),fe.append("rect").attr("class","catrect").attr("pointer-events","none"),ge.select("rect.catrect").attr("fill","none").attr("width",function(Te){return Te.width}).attr("height",function(Te){return Te.height}),M(fe);var me=ge.selectAll("rect.bandrect").data(function(Te){return Te.bands},g);me.each(function(){i.raiseToTop(this)}),me.attr("fill",function(Te){return Te.color});var _e=me.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Te){return Te.color}).attr("fill-opacity",0);me.attr("fill",function(Te){return Te.color}).attr("width",function(Te){return Te.width}).attr("height",function(Te){return Te.height}).attr("y",function(Te){return Te.y}).attr("cursor",function(Te){return Te.parcatsViewModel.arrangement==="fixed"?"default":Te.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),A(_e),me.exit().remove(),fe.append("text").attr("class","catlabel").attr("pointer-events","none");var we=q._fullLayout.paper_bgcolor;ge.select("text.catlabel").attr("text-anchor",function(Te){return p(Te)?"start":"end"}).attr("alignment-baseline","middle").style("text-shadow",h.makeTextShadow(we)).style("fill","rgb(0, 0, 0)").attr("x",function(Te){return p(Te)?Te.width+5:-5}).attr("y",function(Te){return Te.height/2}).text(function(Te){return Te.model.categoryLabel}).each(function(Te){l.font(r.select(this),Te.parcatsViewModel.categorylabelfont),h.convertToTspans(r.select(this),q)}),fe.append("text").attr("class","dimlabel"),ge.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Te){return Te.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Te){return Te.width/2}).attr("y",-5).text(function(Te,Oe){return Oe===0?Te.parcatsViewModel.model.dimensions[Te.model.dimensionInd].dimensionLabel:null}).each(function(Te){l.font(r.select(this),Te.parcatsViewModel.labelfont)}),ge.selectAll("rect.bandrect").on("mouseover",R).on("mouseout",z),ge.exit().remove(),le.call(r.behavior.drag().origin(function(Te){return{x:Te.x,y:0}}).on("dragstart",L).on("drag",P).on("dragend",N)),ee.each(function(Te){Te.traceSelection=r.select(this),Te.pathSelection=r.select(this).selectAll("g.paths").selectAll("path.path"),Te.dimensionSelection=r.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),ee.exit().remove()}function g(U){return U.key}function p(U){var q=U.parcatsViewModel.dimensions.length,$=U.parcatsViewModel.dimensions[q-1].model.dimensionInd;return U.model.dimensionInd===$}function v(U,q){return U.model.rawColor>q.model.rawColor?1:U.model.rawColor"),Ee=r.mouse(ie)[0];c.loneHover({trace:ae,x:_e-le.left+ge.left,y:we-le.top+ge.top,text:ke,color:U.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Te,idealAlign:Ee<_e?"right":"left",hovertemplate:(ae.line||{}).hovertemplate,hovertemplateLabels:ye,eventData:[{data:ae._input,fullData:ae,count:Oe,probability:de}]},{container:ue._hoverlayer.node(),outerContainer:ue._paper.node(),gd:ie})}}}function x(U){if(!U.parcatsViewModel.dragDimension&&(T(r.select(this)),c.loneUnhover(U.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),U.parcatsViewModel.pathSelection.sort(v),U.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1)){var q=w(U),$=k(U);U.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:q,event:r.event,constraints:$})}}function w(U){for(var q=[],$=B(U.parcatsViewModel),ne=0;ne1&&ge.displayInd===le.dimensions.length-1?(ne=ae.left,H="left"):(ne=ae.left+ae.width,H="right");var _e=ue.model.count,we=ue.model.categoryLabel,Te=_e/ue.parcatsViewModel.model.count,Oe={countLabel:_e,categoryLabel:we,probabilityLabel:Te.toFixed(3)},de=[];ue.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&de.push(["Count:",Oe.countLabel].join(" ")),ue.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&de.push(["P("+Oe.categoryLabel+"):",Oe.probabilityLabel].join(" "));var ye=de.join("
");return{trace:fe,x:Q*(ne-q.left),y:ee*(me-q.top),text:ye,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:H,hovertemplate:fe.hovertemplate,hovertemplateLabels:Oe,eventData:[{data:fe._input,fullData:fe,count:_e,category:we,probability:Te}]}}function R(U){if(!U.parcatsViewModel.dragDimension&&U.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){if(r.mouse(this)[1]<-1)return;var q,$=U.parcatsViewModel.graphDiv,ne=$._fullLayout,H=ne._paperdiv.node().getBoundingClientRect(),Q=U.parcatsViewModel.hoveron;Q==="color"?(function(ee){var ie=r.select(ee).datum(),ae=S(ie);_(ae),ae.each(function(){i.raiseToTop(this)}),r.select(ee.parentNode).selectAll("rect.bandrect").filter(function(ue){return ue.color===ie.color}).each(function(){i.raiseToTop(this),r.select(this).attr("stroke","black").attr("stroke-width",1.5)})}(this),D(this,"plotly_hover",r.event)):(function(ee){r.select(ee.parentNode).selectAll("rect.bandrect").each(function(ie){var ae=S(ie);_(ae),ae.each(function(){i.raiseToTop(this)})}),r.select(ee.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),E(this,"plotly_hover",r.event)),U.parcatsViewModel.hoverinfoItems.indexOf("none")===-1&&(Q==="category"?q=O($,H,this):Q==="color"?q=function(ee,ie,ae){ee._fullLayout._calcInverseTransform(ee);var ue,le,ge=ee._fullLayout._invScaleX,fe=ee._fullLayout._invScaleY,me=ae.getBoundingClientRect(),_e=r.select(ae).datum(),we=_e.categoryViewModel,Te=we.parcatsViewModel,Oe=Te.model.dimensions[we.model.dimensionInd],de=Te.trace,ye=me.y+me.height/2;Te.dimensions.length>1&&Oe.displayInd===Te.dimensions.length-1?(ue=me.left,le="left"):(ue=me.left+me.width,le="right");var Me=we.model.categoryLabel,ke=_e.parcatsViewModel.model.count,Ee=0;_e.categoryViewModel.bands.forEach(function(ft){ft.color===_e.color&&(Ee+=ft.count)});var ze=we.model.count,Fe=0;Te.pathSelection.each(function(ft){ft.model.color===_e.color&&(Fe+=ft.model.count)});var Ve=Ee/ke,Ke=Ee/Fe,Re=Ee/ze,qe={countLabel:ke,categoryLabel:Me,probabilityLabel:Ve.toFixed(3)},We=[];we.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&We.push(["Count:",qe.countLabel].join(" ")),we.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(We.push("P(color \u2229 "+Me+"): "+qe.probabilityLabel),We.push("P("+Me+" | color): "+Ke.toFixed(3)),We.push("P(color | "+Me+"): "+Re.toFixed(3)));var Ye=We.join("
"),nt=d.mostReadable(_e.color,["black","white"]);return{trace:de,x:ge*(ue-ie.left),y:fe*(ye-ie.top),text:Ye,color:_e.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:nt,fontSize:10,idealAlign:le,hovertemplate:de.hovertemplate,hovertemplateLabels:qe,eventData:[{data:de._input,fullData:de,category:Me,count:ke,probability:Ve,categorycount:ze,colorcount:Fe,bandcolorcount:Ee}]}}($,H,this):Q==="dimension"&&(q=function(ee,ie,ae){var ue=[];return r.select(ae.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){ue.push(O(ee,ie,this))}),ue}($,H,this)),q&&c.loneHover(q,{container:ne._hoverlayer.node(),outerContainer:ne._paper.node(),gd:$}))}}function z(U){var q=U.parcatsViewModel;!q.dragDimension&&(T(q.pathSelection),M(q.dimensionSelection.selectAll("g.category")),A(q.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),c.loneUnhover(q.graphDiv._fullLayout._hoverlayer.node()),q.pathSelection.sort(v),q.hoverinfoItems.indexOf("skip")===-1)&&(U.parcatsViewModel.hoveron==="color"?D(this,"plotly_unhover",r.event):E(this,"plotly_unhover",r.event))}function L(U){U.parcatsViewModel.arrangement!=="fixed"&&(U.dragDimensionDisplayInd=U.model.displayInd,U.initialDragDimensionDisplayInds=U.parcatsViewModel.model.dimensions.map(function(q){return q.displayInd}),U.dragHasMoved=!1,U.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each(function(q){var $=r.mouse(this)[0],ne=r.mouse(this)[1];-2<=$&&$<=q.width+2&&-2<=ne&&ne<=q.height+2&&(U.dragCategoryDisplayInd=q.model.displayInd,U.initialDragCategoryDisplayInds=U.model.categories.map(function(H){return H.displayInd}),q.model.dragY=q.y,i.raiseToTop(this.parentNode),r.select(this.parentNode).selectAll("rect.bandrect").each(function(H){H.yle.y+le.height/2&&(Q.model.displayInd=le.model.displayInd,le.model.displayInd=ie),U.dragCategoryDisplayInd=Q.model.displayInd}if(U.dragCategoryDisplayInd===null||U.parcatsViewModel.arrangement==="freeform"){H.model.dragX=r.event.x;var ge=U.parcatsViewModel.dimensions[$],fe=U.parcatsViewModel.dimensions[ne];ge!==void 0&&H.model.dragXfe.x&&(H.model.displayInd=fe.model.displayInd,fe.model.displayInd=U.dragDimensionDisplayInd),U.dragDimensionDisplayInd=H.model.displayInd}Z(U.parcatsViewModel),Y(U.parcatsViewModel),W(U.parcatsViewModel),G(U.parcatsViewModel)}}function N(U){if(U.parcatsViewModel.arrangement!=="fixed"&&U.dragDimensionDisplayInd!==null){r.select(this).selectAll("text").attr("font-weight","normal");var q={},$=B(U.parcatsViewModel),ne=U.parcatsViewModel.model.dimensions.map(function(le){return le.displayInd}),H=U.initialDragDimensionDisplayInds.some(function(le,ge){return le!==ne[ge]});H&&ne.forEach(function(le,ge){var fe=U.parcatsViewModel.model.dimensions[ge].containerInd;q["dimensions["+fe+"].displayindex"]=le});var Q=!1;if(U.dragCategoryDisplayInd!==null){var ee=U.model.categories.map(function(le){return le.displayInd});if(Q=U.initialDragCategoryDisplayInds.some(function(le,ge){return le!==ee[ge]})){var ie=U.model.categories.slice().sort(function(le,ge){return le.displayInd-ge.displayInd}),ae=ie.map(function(le){return le.categoryValue}),ue=ie.map(function(le){return le.categoryLabel});q["dimensions["+U.model.containerInd+"].categoryarray"]=[ae],q["dimensions["+U.model.containerInd+"].ticktext"]=[ue],q["dimensions["+U.model.containerInd+"].categoryorder"]="array"}}U.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!U.dragHasMoved&&U.potentialClickBand&&(U.parcatsViewModel.hoveron==="color"?D(U.potentialClickBand,"plotly_click",r.event.sourceEvent):E(U.potentialClickBand,"plotly_click",r.event.sourceEvent)),U.model.dragX=null,U.dragCategoryDisplayInd!==null&&(U.parcatsViewModel.dimensions[U.dragDimensionDisplayInd].categories[U.dragCategoryDisplayInd].model.dragY=null,U.dragCategoryDisplayInd=null),U.dragDimensionDisplayInd=null,U.parcatsViewModel.dragDimension=null,U.dragHasMoved=null,U.potentialClickBand=null,Z(U.parcatsViewModel),Y(U.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each(function(){W(U.parcatsViewModel,!0),G(U.parcatsViewModel,!0)}).each("end",function(){(H||Q)&&u.restyle(U.parcatsViewModel.graphDiv,q,[$])})}}function B(U){for(var q,$=U.graphDiv._fullData,ne=0;ne<$.length;ne++)if(U.key===$[ne].uid){q=ne;break}return q}function G(U,q){var $;q===void 0&&(q=!1),U.pathSelection.data(function(ne){return ne.paths},g),($=U.pathSelection,q?$.transition():$).attr("d",function(ne){return ne.svgD})}function W(U,q){function $(ee){return q?ee.transition():ee}q===void 0&&(q=!1),U.dimensionSelection.data(function(ee){return ee.dimensions},g);var ne=U.dimensionSelection.selectAll("g.category").data(function(ee){return ee.categories},g);$(U.dimensionSelection).attr("transform",function(ee){return s(ee.x,0)}),$(ne).attr("transform",function(ee){return s(0,ee.y)}),ne.select(".dimlabel").text(function(ee,ie){return ie===0?ee.parcatsViewModel.model.dimensions[ee.model.dimensionInd].dimensionLabel:null}),ne.select(".catlabel").attr("text-anchor",function(ee){return p(ee)?"start":"end"}).attr("x",function(ee){return p(ee)?ee.width+5:-5}).each(function(ee){var ie,ae;p(ee)?(ie=ee.width+5,ae="start"):(ie=-5,ae="end"),r.select(this).selectAll("tspan").attr("x",ie).attr("text-anchor",ae)});var H=ne.selectAll("rect.bandrect").data(function(ee){return ee.bands},g),Q=H.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",function(ee){return ee.color}).attr("fill-opacity",0);H.attr("fill",function(ee){return ee.color}).attr("width",function(ee){return ee.width}).attr("height",function(ee){return ee.height}).attr("y",function(ee){return ee.y}),A(Q),H.each(function(){i.raiseToTop(this)}),H.exit().remove()}function K(U,q,$){var ne,H=$[0],Q=q.margin||{l:80,r:80,t:100,b:80},ee=H.trace,ie=ee.domain,ae=q.width,ue=q.height,le=Math.floor(ae*(ie.x[1]-ie.x[0])),ge=Math.floor(ue*(ie.y[1]-ie.y[0])),fe=ie.x[0]*ae+Q.l,me=q.height-ie.y[1]*q.height+Q.t,_e=ee.line.shape;ne=ee.hoverinfo==="all"?["count","probability"]:(ee.hoverinfo||"").split("+");var we={trace:ee,key:ee.uid,model:H,x:fe,y:me,width:le,height:ge,hoveron:ee.hoveron,hoverinfoItems:ne,arrangement:ee.arrangement,bundlecolors:ee.bundlecolors,sortpaths:ee.sortpaths,labelfont:ee.labelfont,categorylabelfont:ee.tickfont,pathShape:_e,dragDimension:null,margin:Q,paths:[],dimensions:[],graphDiv:U,traceSelection:null,pathSelection:null,dimensionSelection:null};return H.dimensions&&(Z(we),Y(we)),we}function te(U,q,$,ne,H){var Q,ee,ie=[],ae=[];for(ee=0;ee<$.length-1;ee++)Q=a($[ee]+U[ee],U[ee+1]),ie.push(Q(H)),ae.push(Q(1-H));var ue="M "+U[0]+","+q[0];for(ue+="l"+$[0]+",0 ",ee=1;ee<$.length;ee++)ue+="C"+ie[ee-1]+","+q[ee-1]+" "+ae[ee-1]+","+q[ee]+" "+U[ee]+","+q[ee],ue+="l"+$[ee]+",0 ";for(ue+="l0,"+ne+" ",ue+="l -"+$[$.length-1]+",0 ",ee=$.length-2;ee>=0;ee--)ue+="C"+ae[ee]+","+(q[ee+1]+ne)+" "+ie[ee]+","+(q[ee]+ne)+" "+(U[ee]+$[ee])+","+(q[ee]+ne),ue+="l-"+$[ee]+",0 ";return ue+="Z"}function Y(U){var q=U.dimensions,$=U.model,ne=q.map(function(We){return We.categories.map(function(Ye){return Ye.y})}),H=U.model.dimensions.map(function(We){return We.categories.map(function(Ye){return Ye.displayInd})}),Q=U.model.dimensions.map(function(We){return We.displayInd}),ee=U.dimensions.map(function(We){return We.model.dimensionInd}),ie=q.map(function(We){return We.x}),ae=q.map(function(We){return We.width}),ue=[];for(var le in $.paths)$.paths.hasOwnProperty(le)&&ue.push($.paths[le]);function ge(We){var Ye=We.categoryInds.map(function(nt,ft){return H[ft][nt]});return ee.map(function(nt){return Ye[nt]})}ue.sort(function(We,Ye){var nt=ge(We),ft=ge(Ye);return U.sortpaths==="backward"&&(nt.reverse(),ft.reverse()),nt.push(We.valueInds[0]),ft.push(Ye.valueInds[0]),U.bundlecolors&&(nt.unshift(We.rawColor),ft.unshift(Ye.rawColor)),ntft?1:0});for(var fe=new Array(ue.length),me=q[0].model.count,_e=q[0].categories.map(function(We){return We.height}).reduce(function(We,Ye){return We+Ye}),we=0;we0?_e*(Oe.count/me):0;for(var de,ye=new Array(ne.length),Me=0;Me1?(U.width-80-16)/(ne-1):0)*H;var Q,ee,ie,ae,ue,le=[],ge=U.model.maxCats,fe=q.categories.length,me=q.count,_e=U.height-8*(ge-1),we=8*(ge-fe)/2,Te=q.categories.map(function(Oe){return{displayInd:Oe.displayInd,categoryInd:Oe.categoryInd}});for(Te.sort(function(Oe,de){return Oe.displayInd-de.displayInd}),ue=0;ue0?ee.count/me*_e:0,ie={key:ee.valueInds[0],model:ee,width:16,height:Q,y:ee.dragY!==null?ee.dragY:we,bands:[],parcatsViewModel:U},we=we+Q+8,le.push(ie);return{key:q.dimensionInd,x:q.dragX!==null?q.dragX:$,y:0,width:16,model:q,categories:le,parcatsViewModel:U,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}o.exports=function(U,q,$,ne){m($,U,ne,q)}},{"../../components/drawing":388,"../../components/fx":406,"../../lib":503,"../../lib/svg_text_utils":529,"../../plot_api/plot_api":540,"@plotly/d3":58,"d3-interpolate":116,tinycolor2:312}],887:[function(e,o,f){var r=e("./parcats");o.exports=function(a,u,c,i){var s=a._fullLayout,l=s._paper,d=s._size;r(a,l,u,{width:d.w,height:d.h,margin:{t:d.t,r:d.r,b:d.b,l:d.l}},c,i)}},{"./parcats":886}],888:[function(e,o,f){var r=e("../../components/colorscale/attributes"),a=e("../../plots/cartesian/layout_attributes"),u=e("../../plots/font_attributes"),c=e("../../plots/domain").attributes,i=e("../../lib/extend").extendFlat,s=e("../../plot_api/plot_template").templatedArray;o.exports={domain:c({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:u({editType:"plot"}),tickfont:u({editType:"plot"}),rangefont:u({editType:"plot"}),dimensions:s("dimension",{label:{valType:"string",editType:"plot"},tickvals:i({},a.tickvals,{editType:"plot"}),ticktext:i({},a.ticktext,{editType:"plot"}),tickformat:i({},a.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:i({editType:"calc"},r("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/plot_template":543,"../../plots/cartesian/layout_attributes":569,"../../plots/domain":584,"../../plots/font_attributes":585}],889:[function(e,o,f){var r=e("./constants"),a=e("@plotly/d3"),u=e("../../lib/gup").keyFun,c=e("../../lib/gup").repeat,i=e("../../lib").sorterAsc,s=e("../../lib").strTranslate,l=r.bar.snapRatio;function d(O,R){return O*(1-l)+R*l}var h=r.bar.snapClose;function m(O,R){return O*(1-h)+R*h}function g(O,R,z,L){if(function(re,U){for(var q=0;q=U[q][0]&&re<=U[q][1])return!0;return!1}(z,L))return z;var P=O?-1:1,N=0,B=R.length-1;if(P<0){var G=N;N=B,B=G}for(var W=R[N],K=W,te=N;P*teR){Y=z;break}}if(P=K,isNaN(P)&&(P=isNaN(te)||isNaN(Y)?isNaN(te)?Y:te:R-W[te][1]H[1]+ee||Q=.9*H[1]+.1*H[0]?"n":Q<=.9*H[0]+.1*H[1]?"s":"ns"}(re,R);U&&(N.interval=G[P],N.intervalPix=re,N.region=U)}}if(O.ordinal&&!N.region){var q=O.unitTickvals,$=O.unitToPaddedPx.invert(R);for(z=0;z=ne[0]&&$<=ne[1]){N.clickableOrdinalRange=ne;break}}}return N}function _(O,R){a.event.sourceEvent.stopPropagation();var z=R.height-a.mouse(O)[1]-2*r.verticalPadding,L=R.brush.svgBrush;L.wasDragged=!0,L._dragging=!0,L.grabbingBar?L.newExtent=[z-L.grabPoint,z+L.barLength-L.grabPoint].map(R.unitToPaddedPx.invert):L.newExtent=[L.startExtent,R.unitToPaddedPx.invert(z)].sort(i),R.brush.filterSpecified=!0,L.extent=L.stayingIntervals.concat([L.newExtent]),L.brushCallback(R),b(O.parentNode)}function M(O,R){var z=T(R,R.height-a.mouse(O)[1]-2*r.verticalPadding),L="crosshair";z.clickableOrdinalRange?L="pointer":z.region&&(L=z.region+"-resize"),a.select(document.body).style("cursor",L)}function A(O){O.on("mousemove",function(R){a.event.preventDefault(),R.parent.inBrushDrag||M(this,R)}).on("mouseleave",function(R){R.parent.inBrushDrag||w()}).call(a.behavior.drag().on("dragstart",function(R){(function(z,L){a.event.sourceEvent.stopPropagation();var P=L.height-a.mouse(z)[1]-2*r.verticalPadding,N=L.unitToPaddedPx.invert(P),B=L.brush,G=T(L,P),W=G.interval,K=B.svgBrush;if(K.wasDragged=!1,K.grabbingBar=G.region==="ns",K.grabbingBar){var te=W.map(L.unitToPaddedPx);K.grabPoint=P-te[0]-r.verticalPadding,K.barLength=te[1]-te[0]}K.clickableOrdinalRange=G.clickableOrdinalRange,K.stayingIntervals=L.multiselect&&B.filterSpecified?B.filter.getConsolidated():[],W&&(K.stayingIntervals=K.stayingIntervals.filter(function(Y){return Y[0]!==W[0]&&Y[1]!==W[1]})),K.startExtent=G.region?W[G.region==="s"?1:0]:N,L.parent.inBrushDrag=!0,K.brushStartCallback()})(this,R)}).on("drag",function(R){_(this,R)}).on("dragend",function(R){(function(z,L){var P=L.brush,N=P.filter,B=P.svgBrush;B._dragging||(M(z,L),_(z,L),L.brush.svgBrush.wasDragged=!1),B._dragging=!1,a.event.sourceEvent.stopPropagation();var G=B.grabbingBar;if(B.grabbingBar=!1,B.grabLocation=void 0,L.parent.inBrushDrag=!1,w(),!B.wasDragged)return B.wasDragged=void 0,B.clickableOrdinalRange?P.filterSpecified&&L.multiselect?B.extent.push(B.clickableOrdinalRange):(B.extent=[B.clickableOrdinalRange],P.filterSpecified=!0):G?(B.extent=B.stayingIntervals,B.extent.length===0&&E(P)):E(P),B.brushCallback(L),b(z.parentNode),void B.brushEndCallback(P.filterSpecified?N.getConsolidated():[]);var W=function(){N.set(N.getConsolidated())};if(L.ordinal){var K=L.unitTickvals;K[K.length-1]B.newExtent[0];B.extent=B.stayingIntervals.concat(te?[B.newExtent]:[]),B.extent.length||E(P),B.brushCallback(L),te?b(z.parentNode,W):(W(),b(z.parentNode))}else W();B.brushEndCallback(P.filterSpecified?N.getConsolidated():[])})(this,R)}))}function S(O,R){return O[0]-R[0]}function E(O){O.filterSpecified=!1,O.svgBrush.extent=[[-1/0,1/0]]}function D(O){for(var R,z=O.slice(),L=[],P=z.shift();P;){for(R=P.slice();(P=z.shift())&&P[0]<=R[1];)R[1]=Math.max(R[1],P[1]);L.push(R)}return L.length===1&&L[0][0]>L[0][1]&&(L=[]),L}o.exports={makeBrush:function(O,R,z,L,P,N){var B,G=function(){var W,K,te=[];return{set:function(Y){(te=Y.map(function(Z){return Z.slice().sort(i)}).sort(S)).length===1&&te[0][0]===-1/0&&te[0][1]===1/0&&(te=[[0,-1]]),W=D(te),K=te.reduce(function(Z,re){return[Math.min(Z[0],re[0]),Math.max(Z[1],re[1])]},[1/0,-1/0])},get:function(){return te.slice()},getConsolidated:function(){return W},getBounds:function(){return K}}}();return G.set(z),{filter:G,filterSpecified:R,svgBrush:{extent:[],brushStartCallback:L,brushCallback:(B=P,function(W){var K=W.brush,te=function(Y){return Y.svgBrush.extent.map(function(Z){return Z.slice()})}(K).slice();K.filter.set(te),B()}),brushEndCallback:N}}},ensureAxisBrush:function(O,R){var z=O.selectAll("."+r.cn.axisBrush).data(c,u);z.enter().append("g").classed(r.cn.axisBrush,!0),function(L,P){var N=L.selectAll(".background").data(c);N.enter().append("rect").classed("background",!0).call(p).call(v).style("pointer-events","auto").attr("transform",s(0,r.verticalPadding)),N.call(A).attr("height",function(W){return W.height-r.verticalPadding});var B=L.selectAll(".highlight-shadow").data(c);B.enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",P).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),B.attr("y1",function(W){return W.height}).call(k);var G=L.selectAll(".highlight").data(c);G.enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),G.attr("y1",function(W){return W.height}).call(k)}(z,R)},cleanRanges:function(O,R){if(Array.isArray(O[0])?(O=O.map(function(L){return L.sort(i)}),O=R.multiselect?D(O.sort(S)):[O[0]]):O=[O.sort(i)],R.tickvals){var z=R.tickvals.slice().sort(i);if(!(O=O.map(function(L){var P=[g(0,z,L[0],[]),g(1,z,L[1],[])];if(P[1]>P[0])return P}).filter(function(L){return L})).length)return}return O.length>1?O:O[0]}}},{"../../lib":503,"../../lib/gup":500,"./constants":893,"@plotly/d3":58}],890:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:e("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":888,"./base_plot":891,"./calc":892,"./defaults":894}],891:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../plots/get_data").getModuleCalcData,u=e("./plot"),c=e("../../constants/xmlns_namespaces");f.name="parcoords",f.plot=function(i){var s=a(i.calcdata,"parcoords")[0];s.length&&u(i,s)},f.clean=function(i,s,l,d){var h=d._has&&d._has("parcoords"),m=s._has&&s._has("parcoords");h&&!m&&(d._paperdiv.selectAll(".parcoords").remove(),d._glimages.selectAll("*").remove())},f.toSVG=function(i){var s=i._fullLayout._glimages,l=r.select(i).selectAll(".svg-container");l.filter(function(d,h){return h===l.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var d=this.toDataURL("image/png");s.append("svg:image").attr({xmlns:c.svg,"xlink:href":d,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})}),window.setTimeout(function(){r.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":480,"../../plots/get_data":593,"./plot":900,"@plotly/d3":58}],892:[function(e,o,f){var r=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale"),u=e("../../lib/gup").wrap;o.exports=function(c,i){var s,l;return a.hasColorscale(i,"line")&&r(i.line.color)?(s=i.line.color,l=a.extractOpts(i.line).colorscale,a.calc(c,i,{vals:s,containerStr:"line",cLetter:"c"})):(s=function(d){for(var h=new Array(d),m=0;mh&&(r.log("parcoords traces support up to "+h+" dimensions at the moment"),k.splice(h));var b=i(p,v,{name:"dimensions",layout:x,handleItemDefaults:g}),T=function(M,A,S,E,D){var O=D("line.color",S);if(a(M,"line")&&r.isArrayOrTypedArray(O)){if(O.length)return D("line.colorscale"),u(M,A,E,D,{prefix:"line.",cLetter:"c"}),O.length;A.line.color=S}return 1/0}(p,v,y,x,w);c(v,x,w),Array.isArray(b)&&b.length||(v.visible=!1),m(v,b,"values",T);var _={family:x.font.family,size:Math.round(x.font.size/1.2),color:x.font.color};r.coerceFont(w,"labelfont",_),r.coerceFont(w,"tickfont",_),r.coerceFont(w,"rangefont",_),w("labelangle"),w("labelside")}},{"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"../../lib":503,"../../plots/array_container_defaults":549,"../../plots/cartesian/axes":554,"../../plots/domain":584,"./attributes":888,"./axisbrush":889,"./constants":893,"./merge_length":898}],895:[function(e,o,f){var r=e("../../lib").isTypedArray;f.convertTypedArray=function(a){return r(a)?Array.prototype.slice.call(a):a},f.isOrdinal=function(a){return!!a.tickvals},f.isVisible=function(a){return a.visible||!("visible"in a)}},{"../../lib":503}],896:[function(e,o,f){var r=e("./base_index");r.plot=e("./plot"),o.exports=r},{"./base_index":890,"./plot":900}],897:[function(e,o,f){var r=e("glslify"),a=r([`precision highp float; +#define GLSLIFY 1 + +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)); +} +`]),u=r([`precision highp float; +#define GLSLIFY 1 + +varying vec4 fragColor; + +void main() { + gl_FragColor = fragColor; +} +`]),c=e("./constants").maxDimensionCount,i=e("../../lib"),s=new Uint8Array(4),l=new Uint8Array(4),d={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(b,T,_,M,A){var S=b._gl;S.enable(S.SCISSOR_TEST),S.scissor(T,_,M,A),b.clear({color:[0,0,0,0],depth:1})}function m(b,T,_,M,A,S){var E=S.key;_.drawCompleted||(function(D){D.read({x:0,y:0,width:1,height:1,data:s})}(b),_.drawCompleted=!0),function D(O){var R=Math.min(M,A-O*M);O===0&&(window.cancelAnimationFrame(_.currentRafs[E]),delete _.currentRafs[E],h(b,S.scissorX,S.scissorY,S.scissorWidth,S.viewBoxSize[1])),_.clearOnly||(S.count=2*R,S.offset=2*O*M,T(S),O*M+R>>8*T)%256/255}function v(b,T,_){for(var M=new Array(8*T),A=0,S=0;SQ&&(Q=Y[U].dim1.canvasX,$=U);ne===0&&h(R,0,0,_.canvasWidth,_.canvasHeight);var ee=function(Te){var Oe,de,ye,Me=[[],[]];for(ye=0;ye<64;ye++){var ke=!Te&&yeee._length&&(_e=_e.slice(0,ee._length));var we,Te=ee.tickvals;function Oe(Ee,ze){return{val:Ee,text:we[ze]}}function de(Ee,ze){return Ee.val-ze.val}if(Array.isArray(Te)&&Te.length){we=ee.ticktext,Array.isArray(we)&&we.length?we.length>Te.length?we=we.slice(0,Te.length):Te.length>we.length&&(Te=Te.slice(0,we.length)):we=Te.map(u(ee.tickformat));for(var ye=1;ye=ze||Re>=Fe)return;var qe=ke.lineLayer.readPixel(Ke,Fe-1-Re),We=qe[3]!==0,Ye=We?qe[2]+256*(qe[1]+256*qe[0]):null,nt={x:Ke,y:Re,clientX:Ee.clientX,clientY:Ee.clientY,dataIndex:ke.model.key,curveNumber:Ye};Ye!==ae&&(We?Y.hover(nt):Y.unhover&&Y.unhover(nt),ae=Ye)}}),ie.style("opacity",function(ke){return ke.pick?0:1}),re.style("background","rgba(255, 255, 255, 0)");var ue=re.selectAll("."+w.cn.parcoords).data(ee,p);ue.exit().remove(),ue.enter().append("g").classed(w.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),ue.attr("transform",function(ke){return l(ke.model.translateX,ke.model.translateY)});var le=ue.selectAll("."+w.cn.parcoordsControlView).data(v,p);le.enter().append("g").classed(w.cn.parcoordsControlView,!0),le.attr("transform",function(ke){return l(ke.model.pad.l,ke.model.pad.t)});var ge=le.selectAll("."+w.cn.yAxis).data(function(ke){return ke.dimensions},p);ge.enter().append("g").classed(w.cn.yAxis,!0),le.each(function(ke){N(ge,ke,q)}),ie.each(function(ke){if(ke.viewModel){!ke.lineLayer||Y?ke.lineLayer=b(this,ke):ke.lineLayer.update(ke),(ke.key||ke.key===0)&&(ke.viewModel[ke.key]=ke.lineLayer);var Ee=!ke.context||Y;ke.lineLayer.render(ke.viewModel.panels,Ee)}}),ge.attr("transform",function(ke){return l(ke.xScale(ke.xIndex),0)}),ge.call(r.behavior.drag().origin(function(ke){return ke}).on("drag",function(ke){var Ee=ke.parent;Q.linePickActive(!1),ke.x=Math.max(-w.overdrag,Math.min(ke.model.width+w.overdrag,r.event.x)),ke.canvasX=ke.x*ke.model.canvasPixelRatio,ge.sort(function(ze,Fe){return ze.x-Fe.x}).each(function(ze,Fe){ze.xIndex=Fe,ze.x=ke===ze?ze.x:ze.xScale(ze.xIndex),ze.canvasX=ze.x*ze.model.canvasPixelRatio}),N(ge,Ee,q),ge.filter(function(ze){return Math.abs(ke.xIndex-ze.xIndex)!==0}).attr("transform",function(ze){return l(ze.xScale(ze.xIndex),0)}),r.select(this).attr("transform",l(ke.x,0)),ge.each(function(ze,Fe,Ve){Ve===ke.parent.key&&(Ee.dimensions[Fe]=ze)}),Ee.contextLayer&&Ee.contextLayer.render(Ee.panels,!1,!O(Ee)),Ee.focusLayer.render&&Ee.focusLayer.render(Ee.panels)}).on("dragend",function(ke){var Ee=ke.parent;ke.x=ke.xScale(ke.xIndex),ke.canvasX=ke.x*ke.model.canvasPixelRatio,N(ge,Ee,q),r.select(this).attr("transform",function(ze){return l(ze.x,0)}),Ee.contextLayer&&Ee.contextLayer.render(Ee.panels,!1,!O(Ee)),Ee.focusLayer&&Ee.focusLayer.render(Ee.panels),Ee.pickLayer&&Ee.pickLayer.render(Ee.panels,!0),Q.linePickActive(!0),Y&&Y.axesMoved&&Y.axesMoved(Ee.key,Ee.dimensions.map(function(ze){return ze.crossfilterDimensionIndex}))})),ge.exit().remove();var fe=ge.selectAll("."+w.cn.axisOverlays).data(v,p);fe.enter().append("g").classed(w.cn.axisOverlays,!0),fe.selectAll("."+w.cn.axis).remove();var me=fe.selectAll("."+w.cn.axis).data(v,p);me.enter().append("g").classed(w.cn.axis,!0),me.each(function(ke){var Ee=ke.model.height/ke.model.tickDistance,ze=ke.domainScale,Fe=ze.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Ee,ke.tickFormat).tickValues(ke.ordinal?Fe:null).tickFormat(function(Ve){return x.isOrdinal(ke)?Ve:B(ke.model.dimensions[ke.visibleIndex],Ve)}).scale(ze)),h.font(me.selectAll("text"),ke.model.tickFont)}),me.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),me.selectAll("text").style("text-shadow",d.makeTextShadow($)).style("cursor","default");var _e=fe.selectAll("."+w.cn.axisHeading).data(v,p);_e.enter().append("g").classed(w.cn.axisHeading,!0);var we=_e.selectAll("."+w.cn.axisTitle).data(v,p);we.enter().append("text").classed(w.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events","auto"),we.text(function(ke){return ke.label}).each(function(ke){var Ee=r.select(this);h.font(Ee,ke.model.labelFont),d.convertToTspans(Ee,W)}).attr("transform",function(ke){var Ee=P(ke.model.labelAngle,ke.model.labelSide),ze=w.axisTitleOffset;return(Ee.dir>0?"":l(0,2*ze+ke.model.height))+s(Ee.degrees)+l(-ze*Ee.dx,-ze*Ee.dy)}).attr("text-anchor",function(ke){var Ee=P(ke.model.labelAngle,ke.model.labelSide);return 2*Math.abs(Ee.dx)>Math.abs(Ee.dy)?Ee.dir*Ee.dx<0?"start":"end":"middle"});var Te=fe.selectAll("."+w.cn.axisExtent).data(v,p);Te.enter().append("g").classed(w.cn.axisExtent,!0);var Oe=Te.selectAll("."+w.cn.axisExtentTop).data(v,p);Oe.enter().append("g").classed(w.cn.axisExtentTop,!0),Oe.attr("transform",l(0,-w.axisExtentOffset));var de=Oe.selectAll("."+w.cn.axisExtentTopText).data(v,p);de.enter().append("text").classed(w.cn.axisExtentTopText,!0).call(L),de.text(function(ke){return G(ke,!0)}).each(function(ke){h.font(r.select(this),ke.model.rangeFont)});var ye=Te.selectAll("."+w.cn.axisExtentBottom).data(v,p);ye.enter().append("g").classed(w.cn.axisExtentBottom,!0),ye.attr("transform",function(ke){return l(0,ke.model.height+w.axisExtentOffset)});var Me=ye.selectAll("."+w.cn.axisExtentBottomText).data(v,p);Me.enter().append("text").classed(w.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(L),Me.text(function(ke){return G(ke,!1)}).each(function(ke){h.font(r.select(this),ke.model.rangeFont)}),k.ensureAxisBrush(fe,$)}},{"../../components/colorscale":378,"../../components/drawing":388,"../../lib":503,"../../lib/gup":500,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":554,"./axisbrush":889,"./constants":893,"./helpers":895,"./lines":897,"@plotly/d3":58,"color-rgba":91}],900:[function(e,o,f){var r=e("./parcoords"),a=e("../../lib/prepare_regl"),u=e("./helpers").isVisible,c={};function i(s,l,d){var h=l.indexOf(d),m=s.indexOf(h);return m===-1&&(m+=l.length),m}(o.exports=function(s,l){var d=s._fullLayout;if(a(s,[],c)){var h={},m={},g={},p={},v=d._size;l.forEach(function(y,x){var w=y[0].trace;g[x]=w.index;var k=p[x]=w._fullInput.index;h[x]=s.data[k].dimensions,m[x]=s.data[k].dimensions.slice()}),r(s,l,{width:v.w,height:v.h,margin:{t:v.t,r:v.r,b:v.b,l:v.l}},{filterChanged:function(y,x,w){var k=m[y][x],b=w.map(function(E){return E.slice()}),T="dimensions["+x+"].constraintrange",_=d._tracePreGUI[s._fullData[g[y]]._fullInput.uid];if(_[T]===void 0){var M=k.constraintrange;_[T]=M||null}var A=s._fullData[g[y]].dimensions[x];b.length?(b.length===1&&(b=b[0]),k.constraintrange=b,A.constraintrange=b.slice(),b=[b]):(delete k.constraintrange,delete A.constraintrange,b=null);var S={};S[T]=b,s.emit("plotly_restyle",[S,[p[y]]])},hover:function(y){s.emit("plotly_hover",y)},unhover:function(y){s.emit("plotly_unhover",y)},axesMoved:function(y,x){var w=function(k,b){return function(T,_){return i(k,b,T)-i(k,b,_)}}(x,m[y].filter(u));h[y].sort(w),m[y].filter(function(k){return!u(k)}).sort(function(k){return m[y].indexOf(k)}).forEach(function(k){h[y].splice(h[y].indexOf(k),1),h[y].splice(m[y].indexOf(k),0,k)}),s.emit("plotly_restyle",[{dimensions:[h[y]]},[p[y]]])}})}}).reglPrecompiled=c},{"../../lib/prepare_regl":516,"./helpers":895,"./parcoords":899}],901:[function(e,o,f){var r=e("../../plots/attributes"),a=e("../../plots/domain").attributes,u=e("../../plots/font_attributes"),c=e("../../components/color/attributes"),i=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../plots/template_attributes").texttemplateAttrs,l=e("../../lib/extend").extendFlat,d=u({editType:"plot",arrayOk:!0,colorEditType:"plot"});o.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:c.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},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:l({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:i({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},d,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},d,{}),outsidetextfont:l({},d,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},d,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:a({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:"number",min:-360,max:360,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:l({},d,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":365,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/domain":584,"../../plots/font_attributes":585,"../../plots/template_attributes":633}],902:[function(e,o,f){var r=e("../../plots/plots");f.name="pie",f.plot=function(a,u,c,i){r.plotBasePlot(f.name,a,u,c,i)},f.clean=function(a,u,c,i){r.cleanBasePlot(f.name,a,u,c,i)}},{"../../plots/plots":619}],903:[function(e,o,f){var r=e("fast-isnumeric"),a=e("tinycolor2"),u=e("../../components/color"),c={};function i(l){return function(d,h){return!!d&&!!(d=a(d)).isValid()&&(d=u.addOpacity(d,d.getAlpha()),l[h]||(l[h]=d),d)}}function s(l,d){var h,m=JSON.stringify(l),g=d[m];if(!g){for(g=l.slice(),h=0;h=0}),(d.type==="funnelarea"?A:d.sort)&&g.sort(function(R,z){return z.v-R.v}),g[0]&&(g[0].vTotal=M),g},crossTraceCalc:function(l,d){var h=(d||{}).type;h||(h="pie");var m=l._fullLayout,g=l.calcdata,p=m[h+"colorway"],v=m["_"+h+"colormap"];m["extend"+h+"colors"]&&(p=s(p,c));for(var y=0,x=0;x0){p=!0;break}}p||(g=0)}return{hasLabels:h,hasValues:m,len:g}}o.exports={handleLabelsAndValues:s,supplyDefaults:function(l,d,h,m){function g(_,M){return a.coerce(l,d,u,_,M)}var p=s(g("labels"),g("values")),v=p.len;if(d._hasLabels=p.hasLabels,d._hasValues=p.hasValues,!d._hasLabels&&d._hasValues&&(g("label0"),g("dlabel")),v){d._length=v,g("marker.line.width")&&g("marker.line.color"),g("marker.colors"),g("scalegroup");var y,x=g("text"),w=g("texttemplate");if(w||(y=g("textinfo",Array.isArray(x)?"text+percent":"percent")),g("hovertext"),g("hovertemplate"),w||y&&y!=="none"){var k=g("textposition");i(l,d,m,g,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(k)||k==="auto"||k==="outside")&&g("automargin"),(k==="inside"||k==="auto"||Array.isArray(k))&&g("insidetextorientation")}c(d,m,g);var b=g("hole");if(g("title.text")){var T=g("title.position",b?"middle center":"top center");b||T!=="middle center"||(d.title.position="top center"),a.coerceFont(g,"title.font",m.font)}g("sort"),g("direction"),g("rotation"),g("pull")}else d.visible=!1}}},{"../../lib":503,"../../plots/domain":584,"../bar/defaults":652,"./attributes":901,"fast-isnumeric":190}],905:[function(e,o,f){var r=e("../../components/fx/helpers").appendArrayMultiPointValues;o.exports=function(a,u){var c={curveNumber:u.index,pointNumbers:a.pts,data:u._input,fullData:u,label:a.label,color:a.color,value:a.v,percent:a.percent,text:a.text,bbox:a.bbox,v:a.v};return a.pts.length===1&&(c.pointNumber=c.i=a.pts[0]),r(c,u,a.pts),u.type==="funnelarea"&&(delete c.v,delete c.i),c}},{"../../components/fx/helpers":402}],906:[function(e,o,f){var r=e("../../lib");function a(u){return u.indexOf("e")!==-1?u.replace(/[.]?0+e/,"e"):u.indexOf(".")!==-1?u.replace(/[.]?0+$/,""):u}f.formatPiePercent=function(u,c){var i=a((100*u).toPrecision(3));return r.numSeparate(i,c)+"%"},f.formatPieValue=function(u,c){var i=a(u.toPrecision(10));return r.numSeparate(i,c)},f.getFirstFilled=function(u,c){if(Array.isArray(u))for(var i=0;i"),name:Q.hovertemplate||ee.indexOf("name")!==-1?Q.name:void 0,idealAlign:ne.pxmid[0]<0?"left":"right",color:y.castOption(me.bgcolor,ne.pts)||ne.color,borderColor:y.castOption(me.bordercolor,ne.pts),fontFamily:y.castOption(_e.family,ne.pts),fontSize:y.castOption(_e.size,ne.pts),fontColor:y.castOption(_e.color,ne.pts),nameLength:y.castOption(me.namelength,ne.pts),textAlign:y.castOption(me.align,ne.pts),hovertemplate:y.castOption(Q.hovertemplate,ne.pts),hovertemplateLabels:ne,eventData:[x(ne,Q)]},{container:H._hoverlayer.node(),outerContainer:H._paper.node(),gd:te,inOut_bbox:we}),ne.bbox=we[0],q._hasHoverLabel=!0}q._hasHoverEvent=!0,te.emit("plotly_hover",{points:[x(ne,Q)],event:r.event})}}),K.on("mouseout",function(ne){var H=te._fullLayout,Q=te._fullData[q.index],ee=r.select(this).datum();q._hasHoverEvent&&(ne.originalEvent=r.event,te.emit("plotly_unhover",{points:[x(ee,Q)],event:r.event}),q._hasHoverEvent=!1),q._hasHoverLabel&&(u.loneUnhover(H._hoverlayer.node()),q._hasHoverLabel=!1)}),K.on("click",function(ne){var H=te._fullLayout,Q=te._fullData[q.index];te._dragging||H.hovermode===!1||(te._hoverdata=[x(ne,Q)],u.click(te,r.event))})}function b(K,te,Y){var Z=y.castOption(K.insidetextfont.color,te.pts);!Z&&K._input.textfont&&(Z=y.castOption(K._input.textfont.color,te.pts));var re=y.castOption(K.insidetextfont.family,te.pts)||y.castOption(K.textfont.family,te.pts)||Y.family,U=y.castOption(K.insidetextfont.size,te.pts)||y.castOption(K.textfont.size,te.pts)||Y.size;return{color:Z||c.contrast(te.color),family:re,size:U}}function T(K,te){for(var Y,Z,re=0;reFe&&Fe>Ke||Ve=-4;ge-=2)fe(Math.PI*ge,"tan");for(ge=4;ge>=-4;ge-=2)fe(Math.PI*(ge+1),"tan")}if(ee||ae){for(ge=4;ge>=-4;ge-=2)fe(Math.PI*(ge+1.5),"rad");for(ge=4;ge>=-4;ge-=2)fe(Math.PI*(ge+.5),"rad")}}if($||ue||ee){var me=Math.sqrt(K.width*K.width+K.height*K.height);if((U={scale:re*Z*2/me,rCenter:1-re,rotate:0}).textPosAngle=(te.startangle+te.stopangle)/2,U.scale>=1)return U;le.push(U)}(ue||ae)&&((U=M(K,Z,q,ne,H)).textPosAngle=(te.startangle+te.stopangle)/2,le.push(U)),(ue||ie)&&((U=A(K,Z,q,ne,H)).textPosAngle=(te.startangle+te.stopangle)/2,le.push(U));for(var _e=0,we=0,Te=0;Te=1)break}return le[_e]}function M(K,te,Y,Z,re){te=Math.max(0,te-2*v);var U=K.width/K.height,q=D(U,Z,te,Y);return{scale:2*q/K.height,rCenter:S(U,q/te),rotate:E(re)}}function A(K,te,Y,Z,re){te=Math.max(0,te-2*v);var U=K.height/K.width,q=D(U,Z,te,Y);return{scale:2*q/K.width,rCenter:S(U,q/te),rotate:E(re+Math.PI/2)}}function S(K,te){return Math.cos(te)-K*te}function E(K){return(180/Math.PI*K+720)%180-90}function D(K,te,Y,Z){var re=K+1/(2*Math.tan(te));return Y*Math.min(1/(Math.sqrt(re*re+.5)+re),Z/(Math.sqrt(K*K+Z/2)+K))}function O(K,te){return K.v!==te.vTotal||te.trace.hole?Math.min(1/(1+1/Math.sin(K.halfangle)),K.ring/2):1}function R(K,te){var Y=te.pxmid[0],Z=te.pxmid[1],re=K.width/2,U=K.height/2;return Y<0&&(re*=-1),Z<0&&(U*=-1),{scale:1,rCenter:1,rotate:0,x:re+Math.abs(U)*(re>0?1:-1)/2,y:U/(1+Y*Y/(Z*Z)),outside:!0}}function z(K,te){var Y,Z,re,U=K.trace,q={x:K.cx,y:K.cy},$={tx:0,ty:0};$.ty+=U.title.font.size,re=P(U),U.title.position.indexOf("top")!==-1?(q.y-=(1+re)*K.r,$.ty-=K.titleBox.height):U.title.position.indexOf("bottom")!==-1&&(q.y+=(1+re)*K.r);var ne,H,Q=(ne=K.r,H=K.trace.aspectratio,ne/(H===void 0?1:H)),ee=te.w*(U.domain.x[1]-U.domain.x[0])/2;return U.title.position.indexOf("left")!==-1?(ee+=Q,q.x-=(1+re)*Q,$.tx+=K.titleBox.width/2):U.title.position.indexOf("center")!==-1?ee*=2:U.title.position.indexOf("right")!==-1&&(ee+=Q,q.x+=(1+re)*Q,$.tx-=K.titleBox.width/2),Y=ee/K.titleBox.width,Z=L(K,te)/K.titleBox.height,{x:q.x,y:q.y,scale:Math.min(Y,Z),tx:$.tx,ty:$.ty}}function L(K,te){var Y=K.trace,Z=te.h*(Y.domain.y[1]-Y.domain.y[0]);return Math.min(K.titleBox.height,Z/2)}function P(K){var te,Y=K.pull;if(!Y)return 0;if(Array.isArray(Y))for(Y=0,te=0;teY&&(Y=K.pull[te]);return Y}function N(K,te){for(var Y=[],Z=0;Z1?(we=ae.r,Te=we/le.aspectratio):(Te=ae.r,we=Te*le.aspectratio),we*=(1+le.baseratio)/2,_e=we*Te}fe=Math.min(fe,_e/ae.vTotal)}for(ue=0;ue")}if(U){var ge=s.castOption(re,te.i,"texttemplate");if(ge){var fe=function(_e){return{label:_e.label,value:_e.v,valueLabel:y.formatPieValue(_e.v,Z.separators),percent:_e.v/Y.vTotal,percentLabel:y.formatPiePercent(_e.v/Y.vTotal,Z.separators),color:_e.color,text:_e.text,customdata:s.castOption(re,_e.i,"customdata")}}(te),me=y.getFirstFilled(re.text,te.pts);(w(me)||me==="")&&(fe.text=me),te.text=s.texttemplateString(ge,fe,K._fullLayout._d3locale,fe,re._meta||{})}else te.text=""}}function W(K,te){var Y=K.rotate*Math.PI/180,Z=Math.cos(Y),re=Math.sin(Y),U=(te.left+te.right)/2,q=(te.top+te.bottom)/2;K.textX=U*Z-q*re,K.textY=U*re+q*Z,K.noCenter=!0}o.exports={plot:function(K,te){var Y=K._fullLayout,Z=Y._size;p("pie",Y),T(te,K),N(te,Z);var re=s.makeTraceGroups(Y._pielayer,te,"trace").each(function(U){var q=r.select(this),$=U[0],ne=$.trace;(function(H){var Q,ee,ie,ae=H[0],ue=ae.r,le=ae.trace,ge=y.getRotationAngle(le.rotation),fe=2*Math.PI/ae.vTotal,me="px0",_e="px1";if(le.direction==="counterclockwise"){for(Q=0;Qae.vTotal/2?1:0,ee.halfangle=Math.PI*Math.min(ee.v/ae.vTotal,.5),ee.ring=1-le.hole,ee.rInscribed=O(ee,ae))})(U),q.attr("stroke-linejoin","round"),q.each(function(){var H=r.select(this).selectAll("g.slice").data(U);H.enter().append("g").classed("slice",!0),H.exit().remove();var Q=[[[],[]],[[],[]]],ee=!1;H.each(function(_e,we){if(_e.hidden)r.select(this).selectAll("path,g").remove();else{_e.pointNumber=_e.i,_e.curveNumber=ne.index,Q[_e.pxmid[1]<0?0:1][_e.pxmid[0]<0?0:1].push(_e);var Te=$.cx,Oe=$.cy,de=r.select(this),ye=de.selectAll("path.surface").data([_e]);if(ye.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),de.call(k,K,U),ne.pull){var Me=+y.castOption(ne.pull,_e.pts)||0;Me>0&&(Te+=Me*_e.pxmid[0],Oe+=Me*_e.pxmid[1])}_e.cxFinal=Te,_e.cyFinal=Oe;var ke=ne.hole;if(_e.v===$.vTotal){var Ee="M"+(Te+_e.px0[0])+","+(Oe+_e.px0[1])+Re(_e.px0,_e.pxmid,!0,1)+Re(_e.pxmid,_e.px0,!0,1)+"Z";ke?ye.attr("d","M"+(Te+ke*_e.px0[0])+","+(Oe+ke*_e.px0[1])+Re(_e.px0,_e.pxmid,!1,ke)+Re(_e.pxmid,_e.px0,!1,ke)+"Z"+Ee):ye.attr("d",Ee)}else{var ze=Re(_e.px0,_e.px1,!0,1);if(ke){var Fe=1-ke;ye.attr("d","M"+(Te+ke*_e.px1[0])+","+(Oe+ke*_e.px1[1])+Re(_e.px1,_e.px0,!1,ke)+"l"+Fe*_e.px0[0]+","+Fe*_e.px0[1]+ze+"Z")}else ye.attr("d","M"+Te+","+Oe+"l"+_e.px0[0]+","+_e.px0[1]+ze+"Z")}G(K,_e,$);var Ve=y.castOption(ne.textposition,_e.pts),Ke=de.selectAll("g.slicetext").data(_e.text&&Ve!=="none"?[0]:[]);Ke.enter().append("g").classed("slicetext",!0),Ke.exit().remove(),Ke.each(function(){var qe=s.ensureSingle(r.select(this),"text","",function(at){at.attr("data-notex",1)}),We=s.ensureUniformFontSize(K,Ve==="outside"?function(at,et,Ot){var Wt=y.castOption(at.outsidetextfont.color,et.pts)||y.castOption(at.textfont.color,et.pts)||Ot.color,Jt=y.castOption(at.outsidetextfont.family,et.pts)||y.castOption(at.textfont.family,et.pts)||Ot.family,Be=y.castOption(at.outsidetextfont.size,et.pts)||y.castOption(at.textfont.size,et.pts)||Ot.size;return{color:Wt,family:Jt,size:Be}}(ne,_e,Y.font):b(ne,_e,Y.font));qe.text(_e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,We).call(h.convertToTspans,K);var Ye,nt=i.bBox(qe.node());if(Ve==="outside")Ye=R(nt,_e);else if(Ye=_(nt,_e,$),Ve==="auto"&&Ye.scale<1){var ft=s.ensureUniformFontSize(K,ne.outsidetextfont);qe.call(i.font,ft),Ye=R(nt=i.bBox(qe.node()),_e)}var vt=Ye.textPosAngle,Pt=vt===void 0?_e.pxmid:B($.r,vt);if(Ye.targetX=Te+Pt[0]*Ye.rCenter+(Ye.x||0),Ye.targetY=Oe+Pt[1]*Ye.rCenter+(Ye.y||0),W(Ye,nt),Ye.outside){var At=Ye.targetY;_e.yLabelMin=At-nt.height/2,_e.yLabelMid=At,_e.yLabelMax=At+nt.height/2,_e.labelExtraX=0,_e.labelExtraY=0,ee=!0}Ye.fontSize=We.size,g(ne.type,Ye,Y),U[we].transform=Ye,qe.attr("transform",s.getTextTransform(Ye))})}function Re(qe,We,Ye,nt){var ft=nt*(We[0]-qe[0]),vt=nt*(We[1]-qe[1]);return"a"+nt*$.r+","+nt*$.r+" 0 "+_e.largeArc+(Ye?" 1 ":" 0 ")+ft+","+vt}});var ie=r.select(this).selectAll("g.titletext").data(ne.title.text?[0]:[]);if(ie.enter().append("g").classed("titletext",!0),ie.exit().remove(),ie.each(function(){var _e,we=s.ensureSingle(r.select(this),"text","",function(Oe){Oe.attr("data-notex",1)}),Te=ne.title.text;ne._meta&&(Te=s.templateString(Te,ne._meta)),we.text(Te).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,ne.title.font).call(h.convertToTspans,K),_e=ne.title.position==="middle center"?function(Oe){var de=Math.sqrt(Oe.titleBox.width*Oe.titleBox.width+Oe.titleBox.height*Oe.titleBox.height);return{x:Oe.cx,y:Oe.cy,scale:Oe.trace.hole*Oe.r*2/de,tx:0,ty:-Oe.titleBox.height/2+Oe.trace.title.font.size}}($):z($,Z),we.attr("transform",d(_e.x,_e.y)+l(Math.min(1,_e.scale))+d(_e.tx,_e.ty))}),ee&&function(_e,we){var Te,Oe,de,ye,Me,ke,Ee,ze,Fe,Ve,Ke,Re,qe;function We(vt,Pt){return vt.pxmid[1]-Pt.pxmid[1]}function Ye(vt,Pt){return Pt.pxmid[1]-vt.pxmid[1]}function nt(vt,Pt){Pt||(Pt={});var At,at,et,Ot,Wt=Pt.labelExtraY+(Oe?Pt.yLabelMax:Pt.yLabelMin),Jt=Oe?vt.yLabelMin:vt.yLabelMax,Be=Oe?vt.yLabelMax:vt.yLabelMin,Ge=vt.cyFinal+Me(vt.px0[1],vt.px1[1]),Tt=Wt-Jt;if(Tt*Ee>0&&(vt.labelExtraY=Tt),Array.isArray(we.pull))for(at=0;at=(y.castOption(we.pull,et.pts)||0)||((vt.pxmid[1]-et.pxmid[1])*Ee>0?(Tt=et.cyFinal+Me(et.px0[1],et.px1[1])-Jt-vt.labelExtraY)*Ee>0&&(vt.labelExtraY+=Tt):(Be+vt.labelExtraY-Ge)*Ee>0&&(At=3*ke*Math.abs(at-Ve.indexOf(vt)),(Ot=et.cxFinal+ye(et.px0[0],et.px1[0])+At-(vt.cxFinal+vt.pxmid[0])-vt.labelExtraX)*ke>0&&(vt.labelExtraX+=Ot)))}for(Oe=0;Oe<2;Oe++)for(de=Oe?We:Ye,Me=Oe?Math.max:Math.min,Ee=Oe?1:-1,Te=0;Te<2;Te++){for(ye=Te?Math.max:Math.min,ke=Te?1:-1,(ze=_e[Oe][Te]).sort(de),Fe=_e[1-Oe][Te],Ve=Fe.concat(ze),Re=[],Ke=0;KeMath.abs(ze)?Me+="l"+ze*Te.pxmid[0]/Te.pxmid[1]+","+ze+"H"+(ye+Te.labelExtraX+ke):Me+="l"+Te.labelExtraX+","+Ee+"v"+(ze-Ee)+"h"+ke}else Me+="V"+(Te.yLabelMid+Te.labelExtraY)+"h"+ke;s.ensureSingle(Oe,"path","textline").call(c.stroke,we.outsidetextfont.color).attr({"stroke-width":Math.min(2,we.outsidetextfont.size/8),d:Me,fill:"none"})}else Oe.select("path.textline").remove()})}(H,ne),ee&&ne.automargin){var ae=i.bBox(q.node()),ue=ne.domain,le=Z.w*(ue.x[1]-ue.x[0]),ge=Z.h*(ue.y[1]-ue.y[0]),fe=(.5*le-$.r)/Z.w,me=(.5*ge-$.r)/Z.h;a.autoMargin(K,"pie."+ne.uid+".automargin",{xl:ue.x[0]-fe,xr:ue.x[1]+fe,yb:ue.y[0]-me,yt:ue.y[1]+me,l:Math.max($.cx-$.r-ae.left,0),r:Math.max(ae.right-($.cx+$.r),0),b:Math.max(ae.bottom-($.cy+$.r),0),t:Math.max($.cy-$.r-ae.top,0),pad:5})}})});setTimeout(function(){re.selectAll("tspan").each(function(){var U=r.select(this);U.attr("dy")&&U.attr("dy",U.attr("dy"))})},0)},formatSliceLabel:G,transformInsideText:_,determineInsideTextFont:b,positionTitleOutside:z,prerenderTitles:T,layoutAreas:N,attachFxHandlers:k,computeTransform:W}},{"../../components/color":366,"../../components/drawing":388,"../../components/fx":406,"../../lib":503,"../../lib/svg_text_utils":529,"../../plots/plots":619,"../bar/constants":650,"../bar/uniform_text":664,"./event_data":905,"./helpers":906,"@plotly/d3":58}],911:[function(e,o,f){var r=e("@plotly/d3"),a=e("./style_one"),u=e("../bar/uniform_text").resizeText;o.exports=function(c){var i=c._fullLayout._pielayer.selectAll(".trace");u(c,i,"pie"),i.each(function(s){var l=s[0].trace,d=r.select(this);d.style({opacity:l.opacity}),d.selectAll("path.surface").each(function(h){r.select(this).call(a,h,l)})})}},{"../bar/uniform_text":664,"./style_one":912,"@plotly/d3":58}],912:[function(e,o,f){var r=e("../../components/color"),a=e("./helpers").castOption;o.exports=function(u,c,i){var s=i.marker.line,l=a(s.color,c.pts)||r.defaultLine,d=a(s.width,c.pts)||0;u.style("stroke-width",d).call(r.fill,c.color).call(r.stroke,l)}},{"../../components/color":366,"./helpers":906}],913:[function(e,o,f){var r=e("../scatter/attributes");o.exports={x:r.x,y:r.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:r.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}},{"../scatter/attributes":927}],914:[function(e,o,f){var r=e("../../../stackgl_modules").gl_pointcloud2d,a=e("../../lib/str2rgbarray"),u=e("../../plots/cartesian/autorange").findExtremes,c=e("../scatter/get_trace_color");function i(l,d){this.scene=l,this.uid=d,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=r(l.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var s=i.prototype;s.handlePick=function(l){var d=this.idToIndex[l.pointId];return{trace:this,dataCoord:l.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*d],this.pickXYData[2*d+1]]:[this.pickXData[d],this.pickYData[d]],textLabel:Array.isArray(this.textLabels)?this.textLabels[d]:this.textLabels,color:this.color,name:this.name,pointIndex:d,hoverinfo:this.hoverinfo}},s.update=function(l){this.index=l.index,this.textLabels=l.text,this.name=l.name,this.hoverinfo=l.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(l),this.color=c(l,{})},s.updateFast=function(l){var d,h,m,g,p,v,y=this.xData=this.pickXData=l.x,x=this.yData=this.pickYData=l.y,w=this.pickXYData=l.xy,k=l.xbounds&&l.ybounds,b=l.indices,T=this.bounds;if(w){if(m=w,d=w.length>>>1,k)T[0]=l.xbounds[0],T[2]=l.xbounds[1],T[1]=l.ybounds[0],T[3]=l.ybounds[1];else for(v=0;vT[2]&&(T[2]=g),pT[3]&&(T[3]=p);if(b)h=b;else for(h=new Int32Array(d),v=0;vT[2]&&(T[2]=g),pT[3]&&(T[3]=p);this.idToIndex=h,this.pointcloudOptions.idToIndex=h,this.pointcloudOptions.positions=m;var _=a(l.marker.color),M=a(l.marker.border.color),A=l.opacity*l.marker.opacity;_[3]*=A,this.pointcloudOptions.color=_;var S=l.marker.blend;S===null&&(S=y.length<100||x.length<100),this.pointcloudOptions.blend=S,M[3]*=A,this.pointcloudOptions.borderColor=M;var E=l.marker.sizemin,D=Math.max(l.marker.sizemax,l.marker.sizemin);this.pointcloudOptions.sizeMin=E,this.pointcloudOptions.sizeMax=D,this.pointcloudOptions.areaRatio=l.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var O=this.scene.xaxis,R=this.scene.yaxis,z=D/2||.5;l._extremes[O._id]=u(O,[T[0],T[2]],{ppad:z}),l._extremes[R._id]=u(R,[T[1],T[3]],{ppad:z})},s.dispose=function(){this.pointcloud.dispose()},o.exports=function(l,d){var h=new i(l,d.uid);return h.update(d),h}},{"../../../stackgl_modules":1124,"../../lib/str2rgbarray":528,"../../plots/cartesian/autorange":553,"../scatter/get_trace_color":937}],915:[function(e,o,f){var r=e("../../lib"),a=e("./attributes");o.exports=function(u,c,i){function s(l,d){return r.coerce(u,c,a,l,d)}s("x"),s("y"),s("xbounds"),s("ybounds"),u.xy&&u.xy instanceof Float32Array&&(c.xy=u.xy),u.indices&&u.indices instanceof Int32Array&&(c.indices=u.indices),s("text"),s("marker.color",i),s("marker.opacity"),s("marker.blend"),s("marker.sizemin"),s("marker.sizemax"),s("marker.border.color",i),s("marker.border.arearatio"),c._length=null}},{"../../lib":503,"./attributes":913}],916:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("../scatter3d/calc"),plot:e("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:e("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":596,"../scatter3d/calc":956,"./attributes":913,"./convert":914,"./defaults":915}],917:[function(e,o,f){var r=e("../../plots/font_attributes"),a=e("../../plots/attributes"),u=e("../../components/color/attributes"),c=e("../../components/fx/attributes"),i=e("../../plots/domain").attributes,s=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../components/colorscale/attributes"),d=e("../../plot_api/plot_template").templatedArray,h=e("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,m=e("../../lib/extend").extendFlat,g=e("../../plot_api/edit_types").overrideAll;(o.exports=g({hoverinfo:m({},a.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:c.hoverlabel,domain:i({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:h("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:r({}),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:u.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:c.hoverlabel,hovertemplate:s({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:u.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:c.hoverlabel,hovertemplate:s({},{keys:["value","label"]}),colorscales:d("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:m(l().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":365,"../../components/colorscale/attributes":373,"../../components/fx/attributes":397,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plot_api/plot_template":543,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/domain":584,"../../plots/font_attributes":585,"../../plots/template_attributes":633}],918:[function(e,o,f){var r=e("../../plot_api/edit_types").overrideAll,a=e("../../plots/get_data").getModuleCalcData,u=e("./plot"),c=e("../../components/fx/layout_attributes"),i=e("../../lib/setcursor"),s=e("../../components/dragelement"),l=e("../../plots/cartesian/select").prepSelect,d=e("../../lib"),h=e("../../registry");function m(g,p){var v=g._fullData[p],y=g._fullLayout,x=y.dragmode,w=y.dragmode==="pan"?"move":"crosshair",k=v._bgRect;if(x!=="pan"&&x!=="zoom"){i(k,w);var b={_id:"x",c2p:d.identity,_offset:v._sankey.translateX,_length:v._sankey.width},T={_id:"y",c2p:d.identity,_offset:v._sankey.translateY,_length:v._sankey.height},_={gd:g,element:k.node(),plotinfo:{id:p,xaxis:b,yaxis:T,fillRangeItems:d.noop},subplot:p,xaxes:[b],yaxes:[T],doneFnCompleted:function(M){var A,S=g._fullData[p],E=S.node.groups.slice(),D=[];function O(P){for(var N=S._sankey.graph.nodes,B=0;BM&&(M=g.source[h]),g.target[h]>M&&(M=g.target[h]);var A,S=M+1;d.node._count=S;var E=d.node.groups,D={};for(h=0;h0&&i(N,S)&&i(B,S)&&(!D.hasOwnProperty(N)||!D.hasOwnProperty(B)||D[N]!==D[B])){D.hasOwnProperty(B)&&(B=D[B]),D.hasOwnProperty(N)&&(N=D[N]),B=+B,x[N=+N]=x[B]=!0;var G="";g.label&&g.label[h]&&(G=g.label[h]);var W=null;G&&w.hasOwnProperty(G)&&(W=w[G]),p.push({pointNumber:h,label:G,color:v?g.color[h]:g.color,customdata:y?g.customdata[h]:g.customdata,concentrationscale:W,source:N,target:B,value:+P}),L.source.push(N),L.target.push(B)}}var K=S+E.length,te=c(m.color),Y=c(m.customdata),Z=[];for(h=0;hS-1,childrenNodes:[],pointNumber:h,label:re,color:te?m.color[h]:m.color,customdata:Y?m.customdata[h]:m.customdata})}var U=!1;return function(q,$,ne){for(var H=a.init2dArray(q,0),Q=0;Q1})}(K,L.source,L.target)&&(U=!0),{circular:U,links:p,nodes:Z,groups:E,groupLookup:D}}o.exports=function(d,h){var m=l(h);return u({circular:m.circular,_nodes:m.nodes,_links:m.links,_groups:m.groups,_groupLookup:m.groupLookup})}},{"../../components/colorscale":378,"../../lib":503,"../../lib/gup":500,"strongly-connected-components":306}],920:[function(e,o,f){o.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"}}},{}],921:[function(e,o,f){var r=e("../../lib"),a=e("./attributes"),u=e("../../components/color"),c=e("tinycolor2"),i=e("../../plots/domain").defaults,s=e("../../components/fx/hoverlabel_defaults"),l=e("../../plot_api/plot_template"),d=e("../../plots/array_container_defaults");function h(m,g){function p(v,y){return r.coerce(m,g,a.link.colorscales,v,y)}p("label"),p("cmin"),p("cmax"),p("colorscale")}o.exports=function(m,g,p,v){function y(D,O){return r.coerce(m,g,a,D,O)}var x=r.extendDeep(v.hoverlabel,m.hoverlabel),w=m.node,k=l.newContainer(g,"node");function b(D,O){return r.coerce(w,k,a.node,D,O)}b("label"),b("groups"),b("x"),b("y"),b("pad"),b("thickness"),b("line.color"),b("line.width"),b("hoverinfo",m.hoverinfo),s(w,k,b,x),b("hovertemplate");var T=v.colorway;b("color",k.label.map(function(D,O){return u.addOpacity(function(R){return T[R%T.length]}(O),.8)})),b("customdata");var _=m.link||{},M=l.newContainer(g,"link");function A(D,O){return r.coerce(_,M,a.link,D,O)}A("label"),A("source"),A("target"),A("value"),A("line.color"),A("line.width"),A("hoverinfo",m.hoverinfo),s(_,M,A,x),A("hovertemplate");var S,E=c(v.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";A("color",r.repeat(E,M.value.length)),A("customdata"),d(_,M,{name:"colorscales",handleItemDefaults:h}),i(g,v,y),y("orientation"),y("valueformat"),y("valuesuffix"),k.x.length&&k.y.length&&(S="freeform"),y("arrangement",S),r.coerceFont(y,"textfont",r.extendFlat({},v.font)),g._length=null}},{"../../components/color":366,"../../components/fx/hoverlabel_defaults":404,"../../lib":503,"../../plot_api/plot_template":543,"../../plots/array_container_defaults":549,"../../plots/domain":584,"./attributes":917,tinycolor2:312}],922:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),moduleType:"trace",name:"sankey",basePlotModule:e("./base_plot"),selectPoints:e("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":917,"./base_plot":918,"./calc":919,"./defaults":921,"./plot":923,"./select.js":925}],923:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=a.numberFormat,c=e("./render"),i=e("../../components/fx"),s=e("../../components/color"),l=e("./constants").cn,d=a._;function h(_){return _!==""}function m(_,M){return _.filter(function(A){return A.key===M.traceId})}function g(_,M){r.select(_).select("path").style("fill-opacity",M),r.select(_).select("rect").style("fill-opacity",M)}function p(_){r.select(_).select("text.name").style("fill","black")}function v(_){return function(M){return _.node.sourceLinks.indexOf(M.link)!==-1||_.node.targetLinks.indexOf(M.link)!==-1}}function y(_){return function(M){return M.node.sourceLinks.indexOf(_.link)!==-1||M.node.targetLinks.indexOf(_.link)!==-1}}function x(_,M,A){M&&A&&m(A,M).selectAll("."+l.sankeyLink).filter(v(M)).call(k.bind(0,M,A,!1))}function w(_,M,A){M&&A&&m(A,M).selectAll("."+l.sankeyLink).filter(v(M)).call(b.bind(0,M,A,!1))}function k(_,M,A,S){var E=S.datum().link.label;S.style("fill-opacity",function(D){if(!D.link.concentrationscale)return .4}),E&&m(M,_).selectAll("."+l.sankeyLink).filter(function(D){return D.link.label===E}).style("fill-opacity",function(D){if(!D.link.concentrationscale)return .4}),A&&m(M,_).selectAll("."+l.sankeyNode).filter(y(_)).call(x)}function b(_,M,A,S){var E=S.datum().link.label;S.style("fill-opacity",function(D){return D.tinyColorAlpha}),E&&m(M,_).selectAll("."+l.sankeyLink).filter(function(D){return D.link.label===E}).style("fill-opacity",function(D){return D.tinyColorAlpha}),A&&m(M,_).selectAll(l.sankeyNode).filter(y(_)).call(w)}function T(_,M){var A=_.hoverlabel||{},S=a.nestedProperty(A,M).get();return!Array.isArray(S)&&S}o.exports=function(_,M){for(var A=_._fullLayout,S=A._paper,E=A._size,D=0;D<_._fullData.length;D++)if(_._fullData[D].visible&&_._fullData[D].type===l.sankey&&!_._fullData[D]._viewInitial){var O=_._fullData[D].node;_._fullData[D]._viewInitial={node:{groups:O.groups.slice(),x:O.x.slice(),y:O.y.slice()}}}var R=d(_,"source:")+" ",z=d(_,"target:")+" ",L=d(_,"concentration:")+" ",P=d(_,"incoming flow count:")+" ",N=d(_,"outgoing flow count:")+" ";c(_,S,M,{width:E.w,height:E.h,margin:{t:E.t,r:E.r,b:E.b,l:E.l}},{linkEvents:{hover:function(B,G,W){_._fullLayout.hovermode!==!1&&(r.select(B).call(k.bind(0,G,W,!0)),G.link.trace.link.hoverinfo!=="skip"&&(G.link.fullData=G.link.trace,_.emit("plotly_hover",{event:r.event,points:[G.link]})))},follow:function(B,G){if(_._fullLayout.hovermode!==!1){var W=G.link.trace.link;if(W.hoverinfo!=="none"&&W.hoverinfo!=="skip"){for(var K=[],te=0,Y=0;Y"),color:T(W,"bgcolor")||s.addOpacity(Z.color,1),borderColor:T(W,"bordercolor"),fontFamily:T(W,"font.family"),fontSize:T(W,"font.size"),fontColor:T(W,"font.color"),nameLength:T(W,"namelength"),textAlign:T(W,"align"),idealAlign:r.event.x"),color:T(W,"bgcolor")||G.tinyColorHue,borderColor:T(W,"bordercolor"),fontFamily:T(W,"font.family"),fontSize:T(W,"font.size"),fontColor:T(W,"font.color"),nameLength:T(W,"namelength"),textAlign:T(W,"align"),idealAlign:"left",hovertemplate:W.hovertemplate,hovertemplateLabels:q,eventData:[G.node]},{container:A._hoverlayer.node(),outerContainer:A._paper.node(),gd:_});g(H,.85),p(H)}}},unhover:function(B,G,W){_._fullLayout.hovermode!==!1&&(r.select(B).call(w,G,W),G.node.trace.node.hoverinfo!=="skip"&&(G.node.fullData=G.node.trace,_.emit("plotly_unhover",{event:r.event,points:[G.node]})),i.loneUnhover(A._hoverlayer.node()))},select:function(B,G,W){var K=G.node;K.originalEvent=r.event,_._hoverdata=[K],r.select(B).call(w,G,W),i.click(_,{target:!0})}}})}},{"../../components/color":366,"../../components/fx":406,"../../lib":503,"./constants":920,"./render":924,"@plotly/d3":58}],924:[function(e,o,f){var r=e("d3-force"),a=e("d3-interpolate").interpolateNumber,u=e("@plotly/d3"),c=e("@plotly/d3-sankey"),i=e("@plotly/d3-sankey-circular"),s=e("./constants"),l=e("tinycolor2"),d=e("../../components/color"),h=e("../../components/drawing"),m=e("../../lib"),g=m.strTranslate,p=m.strRotate,v=e("../../lib/gup"),y=v.keyFun,x=v.repeat,w=v.unwrap,k=e("../../lib/svg_text_utils"),b=e("../../registry"),T=e("../../constants/alignment"),_=T.CAP_SHIFT,M=T.LINE_SPACING;function A(Y,Z,re){var U,q=w(Z),$=q.trace,ne=$.domain,H=$.orientation==="h",Q=$.node.pad,ee=$.node.thickness,ie=Y.width*(ne.x[1]-ne.x[0]),ae=Y.height*(ne.y[1]-ne.y[0]),ue=q._nodes,le=q._links,ge=q.circular;(U=ge?i.sankeyCircular().circularLinkGap(0):c.sankey()).iterations(s.sankeyIterations).size(H?[ie,ae]:[ae,ie]).nodeWidth(ee).nodePadding(Q).nodeId(function(Ee){return Ee.pointNumber}).nodes(ue).links(le);var fe,me,_e,we=U();for(var Te in U.nodePadding()=Re||(Ve=Re-Fe.y0)>1e-6&&(Fe.y0+=Ve,Fe.y1+=Ve),Re=Fe.y1+Q})}(function(Ee){var ze,Fe,Ve=Ee.map(function(Ye,nt){return{x0:Ye.x0,index:nt}}).sort(function(Ye,nt){return Ye.x0-nt.x0}),Ke=[],Re=-1,qe=-1/0;for(fe=0;feqe+ee&&(Re+=1,ze=We.x0),qe=We.x0,Ke[Re]||(Ke[Re]=[]),Ke[Re].push(We),Fe=ze-We.x0,We.x0+=Fe,We.x1+=Fe}return Ke}(ue=we.nodes)),U.update(we)}return{circular:ge,key:re,trace:$,guid:m.randstr(),horizontal:H,width:ie,height:ae,nodePad:$.node.pad,nodeLineColor:$.node.line.color,nodeLineWidth:$.node.line.width,linkLineColor:$.link.line.color,linkLineWidth:$.link.line.width,valueFormat:$.valueformat,valueSuffix:$.valuesuffix,textFont:$.textfont,translateX:ne.x[0]*Y.width+Y.margin.l,translateY:Y.height-ne.y[1]*Y.height+Y.margin.t,dragParallel:H?ae:ie,dragPerpendicular:H?ie:ae,arrangement:$.arrangement,sankey:U,graph:we,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function S(Y,Z,re){var U=l(Z.color),q=Z.source.label+"|"+Z.target.label+"__"+re;return Z.trace=Y.trace,Z.curveNumber=Y.trace.index,{circular:Y.circular,key:q,traceId:Y.key,pointNumber:Z.pointNumber,link:Z,tinyColorHue:d.tinyRGB(U),tinyColorAlpha:U.getAlpha(),linkPath:E,linkLineColor:Y.linkLineColor,linkLineWidth:Y.linkLineWidth,valueFormat:Y.valueFormat,valueSuffix:Y.valueSuffix,sankey:Y.sankey,parent:Y,interactionState:Y.interactionState,flow:Z.flow}}function E(){return function(Y){if(Y.link.circular)return Z=Y.link,re=Z.width/2,U=Z.circularPathData,Z.circularLinkType==="top"?"M "+U.targetX+" "+(U.targetY+re)+" L"+U.rightInnerExtent+" "+(U.targetY+re)+"A"+(U.rightLargeArcRadius+re)+" "+(U.rightSmallArcRadius+re)+" 0 0 1 "+(U.rightFullExtent-re)+" "+(U.targetY-U.rightSmallArcRadius)+"L"+(U.rightFullExtent-re)+" "+U.verticalRightInnerExtent+"A"+(U.rightLargeArcRadius+re)+" "+(U.rightLargeArcRadius+re)+" 0 0 1 "+U.rightInnerExtent+" "+(U.verticalFullExtent-re)+"L"+U.leftInnerExtent+" "+(U.verticalFullExtent-re)+"A"+(U.leftLargeArcRadius+re)+" "+(U.leftLargeArcRadius+re)+" 0 0 1 "+(U.leftFullExtent+re)+" "+U.verticalLeftInnerExtent+"L"+(U.leftFullExtent+re)+" "+(U.sourceY-U.leftSmallArcRadius)+"A"+(U.leftLargeArcRadius+re)+" "+(U.leftSmallArcRadius+re)+" 0 0 1 "+U.leftInnerExtent+" "+(U.sourceY+re)+"L"+U.sourceX+" "+(U.sourceY+re)+"L"+U.sourceX+" "+(U.sourceY-re)+"L"+U.leftInnerExtent+" "+(U.sourceY-re)+"A"+(U.leftLargeArcRadius-re)+" "+(U.leftSmallArcRadius-re)+" 0 0 0 "+(U.leftFullExtent-re)+" "+(U.sourceY-U.leftSmallArcRadius)+"L"+(U.leftFullExtent-re)+" "+U.verticalLeftInnerExtent+"A"+(U.leftLargeArcRadius-re)+" "+(U.leftLargeArcRadius-re)+" 0 0 0 "+U.leftInnerExtent+" "+(U.verticalFullExtent+re)+"L"+U.rightInnerExtent+" "+(U.verticalFullExtent+re)+"A"+(U.rightLargeArcRadius-re)+" "+(U.rightLargeArcRadius-re)+" 0 0 0 "+(U.rightFullExtent+re)+" "+U.verticalRightInnerExtent+"L"+(U.rightFullExtent+re)+" "+(U.targetY-U.rightSmallArcRadius)+"A"+(U.rightLargeArcRadius-re)+" "+(U.rightSmallArcRadius-re)+" 0 0 0 "+U.rightInnerExtent+" "+(U.targetY-re)+"L"+U.targetX+" "+(U.targetY-re)+"Z":"M "+U.targetX+" "+(U.targetY-re)+" L"+U.rightInnerExtent+" "+(U.targetY-re)+"A"+(U.rightLargeArcRadius+re)+" "+(U.rightSmallArcRadius+re)+" 0 0 0 "+(U.rightFullExtent-re)+" "+(U.targetY+U.rightSmallArcRadius)+"L"+(U.rightFullExtent-re)+" "+U.verticalRightInnerExtent+"A"+(U.rightLargeArcRadius+re)+" "+(U.rightLargeArcRadius+re)+" 0 0 0 "+U.rightInnerExtent+" "+(U.verticalFullExtent+re)+"L"+U.leftInnerExtent+" "+(U.verticalFullExtent+re)+"A"+(U.leftLargeArcRadius+re)+" "+(U.leftLargeArcRadius+re)+" 0 0 0 "+(U.leftFullExtent+re)+" "+U.verticalLeftInnerExtent+"L"+(U.leftFullExtent+re)+" "+(U.sourceY+U.leftSmallArcRadius)+"A"+(U.leftLargeArcRadius+re)+" "+(U.leftSmallArcRadius+re)+" 0 0 0 "+U.leftInnerExtent+" "+(U.sourceY-re)+"L"+U.sourceX+" "+(U.sourceY-re)+"L"+U.sourceX+" "+(U.sourceY+re)+"L"+U.leftInnerExtent+" "+(U.sourceY+re)+"A"+(U.leftLargeArcRadius-re)+" "+(U.leftSmallArcRadius-re)+" 0 0 1 "+(U.leftFullExtent-re)+" "+(U.sourceY+U.leftSmallArcRadius)+"L"+(U.leftFullExtent-re)+" "+U.verticalLeftInnerExtent+"A"+(U.leftLargeArcRadius-re)+" "+(U.leftLargeArcRadius-re)+" 0 0 1 "+U.leftInnerExtent+" "+(U.verticalFullExtent-re)+"L"+U.rightInnerExtent+" "+(U.verticalFullExtent-re)+"A"+(U.rightLargeArcRadius-re)+" "+(U.rightLargeArcRadius-re)+" 0 0 1 "+(U.rightFullExtent+re)+" "+U.verticalRightInnerExtent+"L"+(U.rightFullExtent+re)+" "+(U.targetY+U.rightSmallArcRadius)+"A"+(U.rightLargeArcRadius-re)+" "+(U.rightSmallArcRadius-re)+" 0 0 1 "+U.rightInnerExtent+" "+(U.targetY+re)+"L"+U.targetX+" "+(U.targetY+re)+"Z";var Z,re,U,q=Y.link.source.x1,$=Y.link.target.x0,ne=a(q,$),H=ne(.5),Q=ne(.5),ee=Y.link.y0-Y.link.width/2,ie=Y.link.y0+Y.link.width/2,ae=Y.link.y1-Y.link.width/2,ue=Y.link.y1+Y.link.width/2;return"M"+q+","+ee+"C"+H+","+ee+" "+Q+","+ae+" "+$+","+ae+"L"+$+","+ue+"C"+Q+","+ue+" "+H+","+ie+" "+q+","+ie+"Z"}}function D(Y,Z){var re=l(Z.color),U=s.nodePadAcross,q=Y.nodePad/2;Z.dx=Z.x1-Z.x0,Z.dy=Z.y1-Z.y0;var $=Z.dx,ne=Math.max(.5,Z.dy),H="node_"+Z.pointNumber;return Z.group&&(H=m.randstr()),Z.trace=Y.trace,Z.curveNumber=Y.trace.index,{index:Z.pointNumber,key:H,partOfGroup:Z.partOfGroup||!1,group:Z.group,traceId:Y.key,trace:Y.trace,node:Z,nodePad:Y.nodePad,nodeLineColor:Y.nodeLineColor,nodeLineWidth:Y.nodeLineWidth,textFont:Y.textFont,size:Y.horizontal?Y.height:Y.width,visibleWidth:Math.ceil($),visibleHeight:ne,zoneX:-U,zoneY:-q,zoneWidth:$+2*U,zoneHeight:ne+2*q,labelY:Y.horizontal?Z.dy/2+1:Z.dx/2+1,left:Z.originalLayer===1,sizeAcross:Y.width,forceLayouts:Y.forceLayouts,horizontal:Y.horizontal,darkBackground:re.getBrightness()<=128,tinyColorHue:d.tinyRGB(re),tinyColorAlpha:re.getAlpha(),valueFormat:Y.valueFormat,valueSuffix:Y.valueSuffix,sankey:Y.sankey,graph:Y.graph,arrangement:Y.arrangement,uniqueNodeLabelPathId:[Y.guid,Y.key,H].join("_"),interactionState:Y.interactionState,figure:Y}}function O(Y){Y.attr("transform",function(Z){return g(Z.node.x0.toFixed(3),Z.node.y0.toFixed(3))})}function R(Y){Y.call(O)}function z(Y,Z){Y.call(R),Z.attr("d",E())}function L(Y){Y.attr("width",function(Z){return Z.node.x1-Z.node.x0}).attr("height",function(Z){return Z.visibleHeight})}function P(Y){return Y.link.width>1||Y.linkLineWidth>0}function N(Y){return g(Y.translateX,Y.translateY)+(Y.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function B(Y,Z,re){Y.on(".basic",null).on("mouseover.basic",function(U){U.interactionState.dragInProgress||U.partOfGroup||(re.hover(this,U,Z),U.interactionState.hovered=[this,U])}).on("mousemove.basic",function(U){U.interactionState.dragInProgress||U.partOfGroup||(re.follow(this,U),U.interactionState.hovered=[this,U])}).on("mouseout.basic",function(U){U.interactionState.dragInProgress||U.partOfGroup||(re.unhover(this,U,Z),U.interactionState.hovered=!1)}).on("click.basic",function(U){U.interactionState.hovered&&(re.unhover(this,U,Z),U.interactionState.hovered=!1),U.interactionState.dragInProgress||U.partOfGroup||re.select(this,U,Z)})}function G(Y,Z,re,U){var q=u.behavior.drag().origin(function($){return{x:$.node.x0+$.visibleWidth/2,y:$.node.y0+$.visibleHeight/2}}).on("dragstart",function($){if($.arrangement!=="fixed"&&(m.ensureSingle(U._fullLayout._infolayer,"g","dragcover",function(H){U._fullLayout._dragCover=H}),m.raiseToTop(this),$.interactionState.dragInProgress=$.node,K($.node),$.interactionState.hovered&&(re.nodeEvents.unhover.apply(0,$.interactionState.hovered),$.interactionState.hovered=!1),$.arrangement==="snap")){var ne=$.traceId+"|"+$.key;$.forceLayouts[ne]?$.forceLayouts[ne].alpha(1):function(H,Q,ee,ie){(function(ue){for(var le=0;le0&&fe.forceLayouts[le].alpha(0)}}(0,Q,ae,ee)).stop()}(0,ne,$),function(H,Q,ee,ie,ae){window.requestAnimationFrame(function ue(){var le;for(le=0;le0)window.requestAnimationFrame(ue);else{var ge=ee.node.originalX;ee.node.x0=ge-ee.visibleWidth/2,ee.node.x1=ge+ee.visibleWidth/2,W(ee,ae)}})}(Y,Z,$,ne,U)}}).on("drag",function($){if($.arrangement!=="fixed"){var ne=u.event.x,H=u.event.y;$.arrangement==="snap"?($.node.x0=ne-$.visibleWidth/2,$.node.x1=ne+$.visibleWidth/2,$.node.y0=H-$.visibleHeight/2,$.node.y1=H+$.visibleHeight/2):($.arrangement==="freeform"&&($.node.x0=ne-$.visibleWidth/2,$.node.x1=ne+$.visibleWidth/2),H=Math.max(0,Math.min($.size-$.visibleHeight/2,H)),$.node.y0=H-$.visibleHeight/2,$.node.y1=H+$.visibleHeight/2),K($.node),$.arrangement!=="snap"&&($.sankey.update($.graph),z(Y.filter(te($)),Z))}}).on("dragend",function($){if($.arrangement!=="fixed"){$.interactionState.dragInProgress=!1;for(var ne=0;ne<$.node.childrenNodes.length;ne++)$.node.childrenNodes[ne].x=$.node.x,$.node.childrenNodes[ne].y=$.node.y;$.arrangement!=="snap"&&W($,U)}});Y.on(".drag",null).call(q)}function W(Y,Z){for(var re=[],U=[],q=0;qb&&G[_].gap;)_--;for(A=G[_].s,T=G.length-1;T>_;T--)G[T].s=A;for(;b<_;)if(G[++b].gap){for(T=b+1;G[T].gap;)T++;for(var Q=G[b-1][Y],ee=G[b-1].s,ie=(G[T].s-ee)/(G[T][Y]-Q);bR[g]&&g=0;i--){var s=r[i];if(s.type==="scatter"&&s.xaxis===u.xaxis&&s.yaxis===u.yaxis){s.opacity=void 0;break}}}}}},{}],934:[function(e,o,f){var r=e("../../lib"),a=e("../../registry"),u=e("./attributes"),c=e("./constants"),i=e("./subtypes"),s=e("./xy_defaults"),l=e("./period_defaults"),d=e("./stack_defaults"),h=e("./marker_defaults"),m=e("./line_defaults"),g=e("./line_shape_defaults"),p=e("./text_defaults"),v=e("./fillcolor_defaults"),y=e("../../lib").coercePattern;o.exports=function(x,w,k,b){function T(R,z){return r.coerce(x,w,u,R,z)}var _=s(x,w,b,T);if(_||(w.visible=!1),w.visible){l(x,w,b,T),T("xhoverformat"),T("yhoverformat");var M=d(x,w,b,T),A=!M&&_=Math.min(ge,fe)&&x<=Math.max(ge,fe)?0:1/0}var me=Math.max(3,le.mrc||0),_e=1-1/me,we=Math.abs(v.c2p(le.x)-x);return we=Math.min(ge,fe)&&w<=Math.max(ge,fe)?0:1/0}var me=Math.max(3,le.mrc||0),_e=1-1/me,we=Math.abs(y.c2p(le.y)-w);return weae!=(U=K[G][1])>=ae&&(Y=K[G-1][0],Z=K[G][0],U-re&&(te=Y+(Z-Y)*(ae-re)/(U-re),H=Math.min(H,te),Q=Math.max(Q,te)));H=Math.max(H,0),Q=Math.min(Q,v._length);var ue=i.defaultLine;return i.opacity(p.fillcolor)?ue=p.fillcolor:i.opacity((p.line||{}).color)&&(ue=p.line.color),r.extendFlat(l,{distance:l.maxHoverDistance,x0:H,x1:Q,y0:ae,y1:ae,color:ue,hovertemplate:!1}),delete l.index,p.text&&!Array.isArray(p.text)?l.text=String(p.text):l.text=p.name,[l]}}}},{"../../components/color":366,"../../components/fx":406,"../../lib":503,"../../registry":638,"./get_trace_color":937}],939:[function(e,o,f){var r=e("./subtypes");o.exports={hasLines:r.hasLines,hasMarkers:r.hasMarkers,hasText:r.hasText,isBubble:r.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"./arrays_to_calcdata":926,"./attributes":927,"./calc":928,"./cross_trace_calc":932,"./cross_trace_defaults":933,"./defaults":934,"./format_labels":936,"./hover":938,"./marker_colorbar":945,"./plot":948,"./select":949,"./style":951,"./subtypes":952}],940:[function(e,o,f){var r=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,u=e("../../components/colorscale/defaults");o.exports=function(c,i,s,l,d,h){var m=(c.marker||{}).color;d("line.color",s),a(c,"line")?u(c,i,l,d,{prefix:"line.",cLetter:"c"}):d("line.color",!r(m)&&m||s),d("line.width"),(h||{}).noDash||d("line.dash")}},{"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"../../lib":503}],941:[function(e,o,f){var r=e("../../constants/numerical"),a=r.BADNUM,u=r.LOG_CLIP,c=u+.5,i=u-.5,s=e("../../lib"),l=s.segmentsIntersect,d=s.constrain,h=e("./constants");o.exports=function(m,g){var p,v,y,x,w,k,b,T,_,M,A,S,E,D,O,R,z,L,P=g.xaxis,N=g.yaxis,B=P.type==="log",G=N.type==="log",W=P._length,K=N._length,te=g.connectGaps,Y=g.baseTolerance,Z=g.shape,re=Z==="linear",U=g.fill&&g.fill!=="none",q=[],$=h.minTolerance,ne=m.length,H=new Array(ne),Q=0;function ee(Ye){var nt=m[Ye];if(!nt)return!1;var ft=g.linearized?P.l2p(nt.x):P.c2p(nt.x),vt=g.linearized?N.l2p(nt.y):N.c2p(nt.y);if(ft===a){if(B&&(ft=P.c2p(nt.x,!0)),ft===a)return!1;G&&vt===a&&(ft*=Math.abs(P._m*K*(P._m>0?c:i)/(N._m*W*(N._m>0?c:i)))),ft*=1e3}if(vt===a){if(G&&(vt=N.c2p(nt.y,!0)),vt===a)return!1;vt*=1e3}return[ft,vt]}function ie(Ye,nt,ft,vt){var Pt=ft-Ye,At=vt-nt,at=.5-Ye,et=.5-nt,Ot=Pt*Pt+At*At,Wt=Pt*at+At*et;if(Wt>0&&Wtye||Ye[1]ke)return[d(Ye[0],de,ye),d(Ye[1],Me,ke)]}function Fe(Ye,nt){return Ye[0]===nt[0]&&(Ye[0]===de||Ye[0]===ye)||Ye[1]===nt[1]&&(Ye[1]===Me||Ye[1]===ke)||void 0}function Ve(Ye,nt,ft){return function(vt,Pt){var At=ze(vt),at=ze(Pt),et=[];if(At&&at&&Fe(At,at))return et;At&&et.push(At),at&&et.push(at);var Ot=2*s.constrain((vt[Ye]+Pt[Ye])/2,nt,ft)-((At||vt)[Ye]+(at||Pt)[Ye]);return Ot&&((At&&at?Ot>0==At[Ye]>at[Ye]?At:at:At||at)[Ye]+=Ot),et}}function Ke(Ye){var nt=Ye[0],ft=Ye[1],vt=nt===H[Q-1][0],Pt=ft===H[Q-1][1];if(!vt||!Pt)if(Q>1){var At=nt===H[Q-2][0],at=ft===H[Q-2][1];vt&&(nt===de||nt===ye)&&At?at?Q--:H[Q-1]=Ye:Pt&&(ft===Me||ft===ke)&&at?At?Q--:H[Q-1]=Ye:H[Q++]=Ye}else H[Q++]=Ye}function Re(Ye){H[Q-1][0]!==Ye[0]&&H[Q-1][1]!==Ye[1]&&Ke([fe,me]),Ke(Ye),_e=null,fe=me=0}function qe(Ye){if(z=Ye[0]/W,L=Ye[1]/K,le=Ye[0]ye?ye:0,ge=Ye[1]ke?ke:0,le||ge){if(Q)if(_e){var nt=Te(_e,Ye);nt.length>1&&(Re(nt[0]),H[Q++]=nt[1])}else we=Te(H[Q-1],Ye)[0],H[Q++]=we;else H[Q++]=[le||Ye[0],ge||Ye[1]];var ft=H[Q-1];le&&ge&&(ft[0]!==le||ft[1]!==ge)?(_e&&(fe!==le&&me!==ge?Ke(fe&&me?(vt=_e,At=(Pt=Ye)[0]-vt[0],at=(Pt[1]-vt[1])/At,(vt[1]*Pt[0]-Pt[1]*vt[0])/At>0?[at>0?de:ye,ke]:[at>0?ye:de,Me]):[fe||le,me||ge]):fe&&me&&Ke([fe,me])),Ke([le,ge])):fe-le&&me-ge&&Ke([le||fe,ge||me]),_e=Ye,fe=le,me=ge}else _e&&Re(Te(_e,Ye)[0]),H[Q++]=Ye;var vt,Pt,At,at}for(Z==="linear"||Z==="spline"?Te=function(Ye,nt){for(var ft=[],vt=0,Pt=0;Pt<4;Pt++){var At=Ee[Pt],at=l(Ye[0],Ye[1],nt[0],nt[1],At[0],At[1],At[2],At[3]);at&&(!vt||Math.abs(at.x-ft[0][0])>1||Math.abs(at.y-ft[0][1])>1)&&(at=[at.x,at.y],vt&&ue(at,Ye)ae(k,We))break;y=k,(E=_[0]*T[0]+_[1]*T[1])>A?(A=E,x=k,b=!1):E=m.length||!k)break;qe(k),v=k}}else qe(x)}_e&&Ke([fe||_e[0],me||_e[1]]),q.push(H.slice(0,Q))}return q}},{"../../constants/numerical":479,"../../lib":503,"./constants":931}],942:[function(e,o,f){o.exports=function(r,a,u){u("line.shape")==="spline"&&u("line.smoothing")}},{}],943:[function(e,o,f){var r={tonextx:1,tonexty:1,tonext:1};o.exports=function(a,u,c){var i,s,l,d,h,m={},g=!1,p=-1,v=0,y=-1;for(s=0;s=0?h=y:(h=y=v,v++),h0?Math.max(h,s):0}}},{"fast-isnumeric":190}],945:[function(e,o,f){o.exports={container:"marker",min:"cmin",max:"cmax"}},{}],946:[function(e,o,f){var r=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,u=e("../../components/colorscale/defaults"),c=e("./subtypes");o.exports=function(i,s,l,d,h,m){var g=c.isBubble(i),p=(i.line||{}).color;m=m||{},p&&(l=p),h("marker.symbol"),h("marker.opacity",g?.7:1),h("marker.size"),h("marker.color",l),a(i,"marker")&&u(i,s,d,h,{prefix:"marker.",cLetter:"c"}),m.noSelect||(h("selected.marker.color"),h("unselected.marker.color"),h("selected.marker.size"),h("unselected.marker.size")),m.noLine||(h("marker.line.color",p&&!Array.isArray(p)&&s.marker.color!==p?p:g?r.background:r.defaultLine),a(i,"marker.line")&&u(i,s,d,h,{prefix:"marker.line.",cLetter:"c"}),h("marker.line.width",g?1:0)),g&&(h("marker.sizeref"),h("marker.sizemin"),h("marker.sizemode")),m.gradient&&h("marker.gradient.type")!=="none"&&h("marker.gradient.color")}},{"../../components/color":366,"../../components/colorscale/defaults":376,"../../components/colorscale/helpers":377,"./subtypes":952}],947:[function(e,o,f){var r=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function u(c,i){return r(i,c%a==0?1:0)}o.exports=function(c,i,s,l,d){if(d||(d={x:!0,y:!0}),d.x){var h=l("xperiod");h&&(l("xperiod0",u(h,i.xcalendar)),l("xperiodalignment"))}if(d.y){var m=l("yperiod");m&&(l("yperiod0",u(m,i.ycalendar)),l("yperiodalignment"))}}},{"../../constants/numerical":479,"../../lib":503}],948:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../registry"),u=e("../../lib"),c=u.ensureSingle,i=u.identity,s=e("../../components/drawing"),l=e("./subtypes"),d=e("./line_points"),h=e("./link_traces"),m=e("../../lib/polygon").tester;function g(p,v,y,x,w,k,b){var T;(function(ye,Me,ke,Ee,ze){var Fe=ke.xaxis,Ve=ke.yaxis,Ke=r.extent(u.simpleMap(Fe.range,Fe.r2c)),Re=r.extent(u.simpleMap(Ve.range,Ve.r2c)),qe=Ee[0].trace;if(!!l.hasMarkers(qe)){var We=qe.marker.maxdisplayed;if(We!==0){var Ye=Ee.filter(function(Pt){return Pt.x>=Ke[0]&&Pt.x<=Ke[1]&&Pt.y>=Re[0]&&Pt.y<=Re[1]}),nt=Math.ceil(Ye.length/We),ft=0;ze.forEach(function(Pt,At){var at=Pt[0].trace;l.hasMarkers(at)&&at.marker.maxdisplayed>0&&At0;function M(ye){return _?ye.transition():ye}var A=y.xaxis,S=y.yaxis,E=x[0].trace,D=E.line,O=r.select(k),R=c(O,"g","errorbars"),z=c(O,"g","lines"),L=c(O,"g","points"),P=c(O,"g","text");if(a.getComponentMethod("errorbars","plot")(p,R,y,b),E.visible===!0){var N,B;M(O).style("opacity",E.opacity);var G=E.fill.charAt(E.fill.length-1);G!=="x"&&G!=="y"&&(G=""),x[0][y.isRangePlot?"nodeRangePlot3":"node3"]=O;var W,K,te="",Y=[],Z=E._prevtrace;Z&&(te=Z._prevRevpath||"",B=Z._nextFill,Y=Z._polygons);var re,U,q,$,ne,H,Q,ee="",ie="",ae=[],ue=u.noop;if(N=E._ownFill,l.hasLines(E)||E.fill!=="none"){for(B&&B.datum(x),["hv","vh","hvh","vhv"].indexOf(D.shape)!==-1?(re=s.steps(D.shape),U=s.steps(D.shape.split("").reverse().join(""))):re=U=D.shape==="spline"?function(ye){var Me=ye[ye.length-1];return ye.length>1&&ye[0][0]===Me[0]&&ye[0][1]===Me[1]?s.smoothclosed(ye.slice(1),D.smoothing):s.smoothopen(ye,D.smoothing)}:function(ye){return"M"+ye.join("L")},q=function(ye){return U(ye.reverse())},ae=d(x,{xaxis:A,yaxis:S,connectGaps:E.connectgaps,baseTolerance:Math.max(D.width||1,3)/4,shape:D.shape,simplify:D.simplify,fill:E.fill}),Q=E._polygons=new Array(ae.length),T=0;T1){var ke=r.select(this);if(ke.datum(x),ye)M(ke.style("opacity",0).attr("d",W).call(s.lineGroupStyle)).style("opacity",1);else{var Ee=M(ke);Ee.attr("d",W),s.singleLineStyle(x,Ee)}}}}}var le=z.selectAll(".js-line").data(ae);M(le.exit()).style("opacity",0).remove(),le.each(ue(!1)),le.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(ue(!0)),s.setClipUrl(le,y.layerClipId,p),ae.length?(N?(N.datum(x),$&&H&&(G?(G==="y"?$[1]=H[1]=S.c2p(0,!0):G==="x"&&($[0]=H[0]=A.c2p(0,!0)),M(N).attr("d","M"+H+"L"+$+"L"+ee.substr(1)).call(s.singleFillStyle,p)):M(N).attr("d",ee+"Z").call(s.singleFillStyle,p))):B&&(E.fill.substr(0,6)==="tonext"&&ee&&te?(E.fill==="tonext"?M(B).attr("d",ee+"Z"+te+"Z").call(s.singleFillStyle,p):M(B).attr("d",ee+"L"+te.substr(1)+"Z").call(s.singleFillStyle,p),E._polygons=E._polygons.concat(Y)):(fe(B),E._polygons=null)),E._prevRevpath=ie,E._prevPolygons=Q):(N?fe(N):B&&fe(B),E._polygons=E._prevRevpath=E._prevPolygons=null),L.datum(x),P.datum(x),function(ye,Me,ke){var Ee,ze=ke[0].trace,Fe=l.hasMarkers(ze),Ve=l.hasText(ze),Ke=Oe(ze),Re=de,qe=de;if(Fe||Ve){var We=i,Ye=ze.stackgroup,nt=Ye&&p._fullLayout._scatterStackOpts[A._id+S._id][Ye].stackgaps==="infer zero";ze.marker.maxdisplayed||ze._needsCull?We=nt?_e:me:Ye&&!nt&&(We=we),Fe&&(Re=We),Ve&&(qe=We)}var ft,vt=(Ee=ye.selectAll("path.point").data(Re,Ke)).enter().append("path").classed("point",!0);_&&vt.call(s.pointStyle,ze,p).call(s.translatePoints,A,S).style("opacity",0).transition().style("opacity",1),Ee.order(),Fe&&(ft=s.makePointStyleFns(ze)),Ee.each(function(Pt){var At=r.select(this),at=M(At);s.translatePoint(Pt,at,A,S)?(s.singlePointStyle(Pt,at,ze,ft,p),y.layerClipId&&s.hideOutsideRangePoint(Pt,at,A,S,ze.xcalendar,ze.ycalendar),ze.customdata&&At.classed("plotly-customdata",Pt.data!==null&&Pt.data!==void 0)):at.remove()}),_?Ee.exit().transition().style("opacity",0).remove():Ee.exit().remove(),(Ee=Me.selectAll("g").data(qe,Ke)).enter().append("g").classed("textpoint",!0).append("text"),Ee.order(),Ee.each(function(Pt){var At=r.select(this),at=M(At.select("text"));s.translatePoint(Pt,at,A,S)?y.layerClipId&&s.hideOutsideRangePoint(Pt,At,A,S,ze.xcalendar,ze.ycalendar):At.remove()}),Ee.selectAll("text").call(s.textPointStyle,ze,p).each(function(Pt){var At=A.c2p(Pt.x),at=S.c2p(Pt.y);r.select(this).selectAll("tspan.line").each(function(){M(r.select(this)).attr({x:At,y:at})})}),Ee.exit().remove()}(L,P,x);var ge=E.cliponaxis===!1?null:y.layerClipId;s.setClipUrl(L,ge,p),s.setClipUrl(P,ge,p)}function fe(ye){M(ye).attr("d","M0,0Z")}function me(ye){return ye.filter(function(Me){return!Me.gap&&Me.vis})}function _e(ye){return ye.filter(function(Me){return Me.vis})}function we(ye){return ye.filter(function(Me){return!Me.gap})}function Te(ye){return ye.id}function Oe(ye){if(ye.ids)return Te}function de(){return!1}}o.exports=function(p,v,y,x,w,k){var b,T,_=!w,M=!!w&&w.duration>0,A=h(p,v,y);(b=x.selectAll("g.trace").data(A,function(S){return S[0].trace.uid})).enter().append("g").attr("class",function(S){return"trace scatter trace"+S[0].trace.uid}).style("stroke-miterlimit",2),b.order(),function(S,E,D){E.each(function(O){var R=c(r.select(this),"g","fills");s.setClipUrl(R,D.layerClipId,S);var z=O[0].trace,L=[];z._ownfill&&L.push("_ownFill"),z._nexttrace&&L.push("_nextFill");var P=R.selectAll("g").data(L,i);P.enter().append("g"),P.exit().each(function(N){z[N]=null}).remove(),P.order().each(function(N){z[N]=c(r.select(this),"path","js-fill")})})}(p,b,v),M?(k&&(T=k()),r.transition().duration(w.duration).ease(w.easing).each("end",function(){T&&T()}).each("interrupt",function(){T&&T()}).each(function(){x.selectAll("g.trace").each(function(S,E){g(p,E,v,S,A,this,w)})})):b.each(function(S,E){g(p,E,v,S,A,this,w)}),_&&b.exit().remove(),x.selectAll("path:not([d])").remove()}},{"../../components/drawing":388,"../../lib":503,"../../lib/polygon":515,"../../registry":638,"./line_points":941,"./link_traces":943,"./subtypes":952,"@plotly/d3":58}],949:[function(e,o,f){var r=e("./subtypes");o.exports=function(a,u){var c,i,s,l,d=a.cd,h=a.xaxis,m=a.yaxis,g=[],p=d[0].trace;if(!r.hasMarkers(p)&&!r.hasText(p))return[];if(u===!1)for(c=0;c0){var y=s.c2l(p);s._lowerLogErrorBound||(s._lowerLogErrorBound=y),s._lowerErrorBound=Math.min(s._lowerLogErrorBound,y)}}else d[h]=[-m[0]*i,m[1]*i]}return d}o.exports=function(u,c,i){var s=[a(u.x,u.error_x,c[0],i.xaxis),a(u.y,u.error_y,c[1],i.yaxis),a(u.z,u.error_z,c[2],i.zaxis)],l=function(v){for(var y=0;y-1?-1:D.indexOf("right")>-1?1:0}function b(D){return D==null?0:D.indexOf("top")>-1?-1:D.indexOf("bottom")>-1?1:0}function T(D,O){return O(4*D)}function _(D){return g[D]}function M(D,O,R,z,L){var P=null;if(s.isArrayOrTypedArray(D)){P=[];for(var N=0;N=0){var W=function(K,te,Y){var Z,re=(Y+1)%3,U=(Y+2)%3,q=[],$=[];for(Z=0;Z=0&&p("surfacecolor",v||y);for(var x=["x","y","z"],w=0;w<3;++w){var k="projection."+x[w];p(k+".show")&&(p(k+".opacity"),p(k+".scale"))}var b=r.getComponentMethod("errorbars","supplyDefaults");b(d,h,v||y||m,{axis:"z"}),b(d,h,v||y||m,{axis:"y",inherit:"z"}),b(d,h,v||y||m,{axis:"x",inherit:"z"})}else h.visible=!1}},{"../../lib":503,"../../registry":638,"../scatter/line_defaults":940,"../scatter/marker_defaults":946,"../scatter/subtypes":952,"../scatter/text_defaults":953,"./attributes":955}],960:[function(e,o,f){o.exports={plot:e("./convert"),attributes:e("./attributes"),markerSymbols:e("../../constants/gl3d_markers"),supplyDefaults:e("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:e("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:e("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":477,"../../plots/gl3d":598,"./attributes":955,"./calc":956,"./convert":958,"./defaults":959}],961:[function(e,o,f){var r=e("../scatter/attributes"),a=e("../../plots/attributes"),u=e("../../plots/template_attributes").hovertemplateAttrs,c=e("../../plots/template_attributes").texttemplateAttrs,i=e("../../components/colorscale/attributes"),s=e("../../lib/extend").extendFlat,l=r.marker,d=r.line,h=l.line;o.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},r.mode,{dflt:"markers"}),text:s({},r.text,{}),texttemplate:c({editType:"plot"},{keys:["a","b","text"]}),hovertext:s({},r.hovertext,{}),line:{color:d.color,width:d.width,dash:d.dash,shape:s({},d.shape,{values:["linear","spline"]}),smoothing:d.smoothing,editType:"calc"},connectgaps:r.connectgaps,fill:s({},r.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:h.width,editType:"calc"},i("marker.line")),gradient:l.gradient,editType:"calc"},i("marker")),textfont:r.textfont,textposition:r.textposition,selected:r.selected,unselected:r.unselected,hoverinfo:s({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:r.hoveron,hovertemplate:u()}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scatter/attributes":927}],962:[function(e,o,f){var r=e("fast-isnumeric"),a=e("../scatter/colorscale_calc"),u=e("../scatter/arrays_to_calcdata"),c=e("../scatter/calc_selection"),i=e("../scatter/calc").calcMarkerSize,s=e("../carpet/lookup_carpetid");o.exports=function(l,d){var h=d._carpetTrace=s(l,d);if(h&&h.visible&&h.visible!=="legendonly"){var m;d.xaxis=h.xaxis,d.yaxis=h.yaxis;var g,p,v=d._length,y=new Array(v),x=!1;for(m=0;m")}return l}function T(_,M){var A;A=_.labelprefix&&_.labelprefix.length>0?_.labelprefix.replace(/ = $/,""):_._hovertitle,k.push(A+": "+M.toFixed(3)+_.labelsuffix)}}},{"../../lib":503,"../scatter/hover":938}],967:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:e("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"../scatter/marker_colorbar":945,"../scatter/select":949,"../scatter/style":951,"./attributes":961,"./calc":962,"./defaults":963,"./event_data":964,"./format_labels":965,"./hover":966,"./plot":968}],968:[function(e,o,f){var r=e("../scatter/plot"),a=e("../../plots/cartesian/axes"),u=e("../../components/drawing");o.exports=function(c,i,s,l){var d,h,m,g=s[0][0].carpet,p={xaxis:a.getFromId(c,g.xaxis||"x"),yaxis:a.getFromId(c,g.yaxis||"y"),plot:i.plot};for(r(c,p,s,l),d=0;d")}(m,w,s,h[0].t.labels),s.hovertemplate=m.hovertemplate,[s]}}},{"../../components/fx":406,"../../constants/numerical":479,"../../lib":503,"../scatter/get_trace_color":937,"./attributes":969}],975:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:e("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":589,"../scatter/marker_colorbar":945,"../scatter/style":951,"./attributes":969,"./calc":970,"./defaults":971,"./event_data":972,"./format_labels":973,"./hover":974,"./plot":976,"./select":977,"./style":978}],976:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=e("../../lib/topojson_utils").getTopojsonFeatures,c=e("../../lib/geojson_utils"),i=e("../../lib/geo_location_utils"),s=e("../../plots/cartesian/autorange").findExtremes,l=e("../../constants/numerical").BADNUM,d=e("../scatter/calc").calcMarkerSize,h=e("../scatter/subtypes"),m=e("./style");o.exports={calcGeoJSON:function(g,p){var v,y,x=g[0].trace,w=p[x.geo],k=w._subplot,b=x._length;if(Array.isArray(x.locations)){var T=x.locationmode,_=T==="geojson-id"?i.extractTraceFeature(g):u(x,k.topojson);for(v=0;v=y,D=2*S,O={},R=_.makeCalcdata(k,"x"),z=M.makeCalcdata(k,"y"),L=i(k,_,"x",R),P=i(k,M,"y",z),N=L.vals,B=P.vals;k._x=N,k._y=B,k.xperiodalignment&&(k._origX=R,k._xStarts=L.starts,k._xEnds=L.ends),k.yperiodalignment&&(k._origY=z,k._yStarts=P.starts,k._yEnds=P.ends);var G=new Array(D),W=new Array(S);for(b=0;b1&&a.extendFlat(H.line,g.linePositions(Z,U,q)),H.errorX||H.errorY){var Q=g.errorBarPositions(Z,U,q,$,ne);H.errorX&&a.extendFlat(H.errorX,Q.x),H.errorY&&a.extendFlat(H.errorY,Q.y)}return H.text&&(a.extendFlat(H.text,{positions:q},g.textPosition(Z,U,H.text,H.marker)),a.extendFlat(H.textSel,{positions:q},g.textPosition(Z,U,H.text,H.markerSel)),a.extendFlat(H.textUnsel,{positions:q},g.textPosition(Z,U,H.text,H.markerUnsel))),H}(w,0,k,G,N,B),Y=p(w,A);return h(T,k),E?te.marker&&(K=te.marker.sizeAvg||Math.max(te.marker.size,3)):K=l(k,S),d(w,k,_,M,N,B,K),te.errorX&&x(k,_,te.errorX),te.errorY&&x(k,M,te.errorY),te.fill&&!Y.fill2d&&(Y.fill2d=!0),te.marker&&!Y.scatter2d&&(Y.scatter2d=!0),te.line&&!Y.line2d&&(Y.line2d=!0),!te.errorX&&!te.errorY||Y.error2d||(Y.error2d=!0),te.text&&!Y.glText&&(Y.glText=!0),te.marker&&(te.marker.snap=S),Y.lineOptions.push(te.line),Y.errorXOptions.push(te.errorX),Y.errorYOptions.push(te.errorY),Y.fillOptions.push(te.fill),Y.markerOptions.push(te.marker),Y.markerSelectedOptions.push(te.markerSel),Y.markerUnselectedOptions.push(te.markerUnsel),Y.textOptions.push(te.text),Y.textSelectedOptions.push(te.textSel),Y.textUnselectedOptions.push(te.textUnsel),Y.selectBatch.push([]),Y.unselectBatch.push([]),O._scene=Y,O.index=Y.count,O.x=N,O.y=B,O.positions=G,Y.count++,[{x:!1,y:!1,t:O,trace:k}]}},{"../../constants/numerical":479,"../../lib":503,"../../plots/cartesian/align_period":551,"../../plots/cartesian/autorange":553,"../../plots/cartesian/axis_ids":558,"../scatter/calc":928,"../scatter/colorscale_calc":930,"./constants":982,"./convert":983,"./scene_update":991,"@plotly/point-cluster":59}],982:[function(e,o,f){o.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]}}},{}],983:[function(e,o,f){var r=e("fast-isnumeric"),a=e("svg-path-sdf"),u=e("color-normalize"),c=e("../../registry"),i=e("../../lib"),s=e("../../components/drawing"),l=e("../../plots/cartesian/axis_ids"),d=e("../../lib/gl_format_color").formatColor,h=e("../scatter/subtypes"),m=e("../scatter/make_bubble_size_func"),g=e("./helpers"),p=e("./constants"),v=e("../../constants/interactions").DESELECTDIM,y={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},x=e("../../components/fx/helpers").appendArrayPointValue;function w(R,z){var L,P=R._fullLayout,N=z._length,B=z.textfont,G=z.textposition,W=Array.isArray(G)?G:[G],K=B.color,te=B.size,Y=B.family,Z={},re=R._context.plotGlPixelRatio,U=z.texttemplate;if(U){Z.text=[];var q=P._d3locale,$=Array.isArray(U),ne=$?Math.min(U.length,N):N,H=$?function(ge){return U[ge]}:function(){return U};for(L=0;Lp.TOO_MANY_POINTS||h.hasMarkers(z)?"rect":"round";if(te&&z.connectgaps){var Z=P[0],re=P[1];for(N=0;N1?K[N]:K[0]:K,U=Array.isArray(te)?te.length>1?te[N]:te[0]:te,q=y[re],$=y[U],ne=Y?Y/.8+1:0,H=-$*ne-.5*$;G.offset[N]=[q*ne/Z,H/Z]}}return G}}},{"../../components/drawing":388,"../../components/fx/helpers":402,"../../constants/interactions":478,"../../lib":503,"../../lib/gl_format_color":499,"../../plots/cartesian/axis_ids":558,"../../registry":638,"../scatter/make_bubble_size_func":944,"../scatter/subtypes":952,"./constants":982,"./helpers":987,"color-normalize":89,"fast-isnumeric":190,"svg-path-sdf":310}],984:[function(e,o,f){var r=e("../../lib"),a=e("../../registry"),u=e("./helpers"),c=e("./attributes"),i=e("../scatter/constants"),s=e("../scatter/subtypes"),l=e("../scatter/xy_defaults"),d=e("../scatter/period_defaults"),h=e("../scatter/marker_defaults"),m=e("../scatter/line_defaults"),g=e("../scatter/fillcolor_defaults"),p=e("../scatter/text_defaults");o.exports=function(v,y,x,w){function k(D,O){return r.coerce(v,y,c,D,O)}var b=!!v.marker&&u.isOpenSymbol(v.marker.symbol),T=s.isBubble(v),_=l(v,y,w,k);if(_){d(v,y,w,k),k("xhoverformat"),k("yhoverformat");var M=_100},f.isDotSymbol=function(a){return typeof a=="string"?r.DOT_RE.test(a):a>200}},{"./constants":982}],988:[function(e,o,f){var r=e("../../registry"),a=e("../../lib"),u=e("../scatter/get_trace_color");function c(i,s,l,d){var h=i.xa,m=i.ya,g=i.distance,p=i.dxy,v=i.index,y={pointNumber:v,x:s[v],y:l[v]};y.tx=Array.isArray(d.text)?d.text[v]:d.text,y.htx=Array.isArray(d.hovertext)?d.hovertext[v]:d.hovertext,y.data=Array.isArray(d.customdata)?d.customdata[v]:d.customdata,y.tp=Array.isArray(d.textposition)?d.textposition[v]:d.textposition;var x=d.textfont;x&&(y.ts=a.isArrayOrTypedArray(x.size)?x.size[v]:x.size,y.tc=Array.isArray(x.color)?x.color[v]:x.color,y.tf=Array.isArray(x.family)?x.family[v]:x.family);var w=d.marker;w&&(y.ms=a.isArrayOrTypedArray(w.size)?w.size[v]:w.size,y.mo=a.isArrayOrTypedArray(w.opacity)?w.opacity[v]:w.opacity,y.mx=a.isArrayOrTypedArray(w.symbol)?w.symbol[v]:w.symbol,y.mc=a.isArrayOrTypedArray(w.color)?w.color[v]:w.color);var k=w&&w.line;k&&(y.mlc=Array.isArray(k.color)?k.color[v]:k.color,y.mlw=a.isArrayOrTypedArray(k.width)?k.width[v]:k.width);var b=w&&w.gradient;b&&b.type!=="none"&&(y.mgt=Array.isArray(b.type)?b.type[v]:b.type,y.mgc=Array.isArray(b.color)?b.color[v]:b.color);var T=h.c2p(y.x,!0),_=m.c2p(y.y,!0),M=y.mrc||1,A=d.hoverlabel;A&&(y.hbg=Array.isArray(A.bgcolor)?A.bgcolor[v]:A.bgcolor,y.hbc=Array.isArray(A.bordercolor)?A.bordercolor[v]:A.bordercolor,y.hts=a.isArrayOrTypedArray(A.font.size)?A.font.size[v]:A.font.size,y.htc=Array.isArray(A.font.color)?A.font.color[v]:A.font.color,y.htf=Array.isArray(A.font.family)?A.font.family[v]:A.font.family,y.hnl=a.isArrayOrTypedArray(A.namelength)?A.namelength[v]:A.namelength);var S=d.hoverinfo;S&&(y.hi=Array.isArray(S)?S[v]:S);var E=d.hovertemplate;E&&(y.ht=Array.isArray(E)?E[v]:E);var D={};D[i.index]=y;var O=d._origX,R=d._origY,z=a.extendFlat({},i,{color:u(d,y),x0:T-M,x1:T+M,xLabelVal:O?O[v]:y.x,y0:_-M,y1:_+M,yLabelVal:R?R[v]:y.y,cd:D,distance:g,spikeDistance:p,hovertemplate:y.ht});return y.htx?z.text=y.htx:y.tx?z.text=y.tx:d.text&&(z.text=d.text),a.fillText(y,d,z),r.getComponentMethod("errorbars","hoverInfo")(y,d,z),z}o.exports={hoverPoints:function(i,s,l,d){var h,m,g,p,v,y,x,w,k,b,T=i.cd,_=T[0].t,M=T[0].trace,A=i.xa,S=i.ya,E=_.x,D=_.y,O=A.c2p(s),R=S.c2p(l),z=i.distance;if(_.tree){var L=A.p2c(O-z),P=A.p2c(O+z),N=S.p2c(R-z),B=S.p2c(R+z);h=d==="x"?_.tree.range(Math.min(L,P),Math.min(S._rl[0],S._rl[1]),Math.max(L,P),Math.max(S._rl[0],S._rl[1])):_.tree.range(Math.min(L,P),Math.min(N,B),Math.max(L,P),Math.max(N,B))}else h=_.ids;var G=z;if(d==="x"){var W=!!M.xperiodalignment,K=!!M.yperiodalignment;for(y=0;y=Math.min(te,Y)&&O<=Math.max(te,Y)?0:1/0}if(x=Math.min(Z,re)&&R<=Math.max(Z,re)?0:1/0}b=Math.sqrt(x*x+w*w),g=h[y]}}}else for(y=h.length-1;y>-1;y--)p=E[m=h[y]],v=D[m],x=A.c2p(p)-O,w=S.c2p(v)-R,(k=Math.sqrt(x*x+w*w))T.glText.length){var E=A-T.glText.length;for(w=0;wie&&(isNaN(ee[ae])||isNaN(ee[ae+1]));)ae-=2;Q.positions=ee.slice(ie,ae+2)}return Q}),T.line2d.update(T.lineOptions)),T.error2d){var O=(T.errorXOptions||[]).concat(T.errorYOptions||[]);T.error2d.update(O)}T.scatter2d&&T.scatter2d.update(T.markerOptions),T.fillOrder=i.repeat(null,A),T.fill2d&&(T.fillOptions=T.fillOptions.map(function(Q,ee){var ie=x[ee];if(Q&&ie&&ie[0]&&ie[0].trace){var ae,ue,le=ie[0],ge=le.trace,fe=le.t,me=T.lineOptions[ee],_e=[];ge._ownfill&&_e.push(ee),ge._nexttrace&&_e.push(ee+1),_e.length&&(T.fillOrder[ee]=_e);var we,Te,Oe=[],de=me&&me.positions||fe.positions;if(ge.fill==="tozeroy"){for(we=0;wewe&&isNaN(de[Te+1]);)Te-=2;de[we+1]!==0&&(Oe=[de[we],0]),Oe=Oe.concat(de.slice(we,Te+2)),de[Te+1]!==0&&(Oe=Oe.concat([de[Te],0]))}else if(ge.fill==="tozerox"){for(we=0;wewe&&isNaN(de[Te]);)Te-=2;de[we]!==0&&(Oe=[0,de[we+1]]),Oe=Oe.concat(de.slice(we,Te+2)),de[Te]!==0&&(Oe=Oe.concat([0,de[Te+1]]))}else if(ge.fill==="toself"||ge.fill==="tonext"){for(Oe=[],ae=0,Q.splitNull=!0,ue=0;ue-1;for(w=0;w")}function w(k){return k+"\xB0"}}o.exports={hoverPoints:function(l,d,h){var m=l.cd,g=m[0].trace,p=l.xa,v=l.ya,y=l.subplot,x=360*(d>=0?Math.floor((d+180)/360):Math.ceil((d-180)/360)),w=d-x;if(r.getClosest(m,function(D){var O=D.lonlat;if(O[0]===i)return 1/0;var R=a.modHalf(O[0],360),z=O[1],L=y.project([R,z]),P=L.x-p.c2p([w,z]),N=L.y-v.c2p([R,h]),B=Math.max(3,D.mrc||0);return Math.max(Math.sqrt(P*P+N*N)-B,1-3/B)},l),l.index!==!1){var k=m[l.index],b=k.lonlat,T=[a.modHalf(b[0],360)+x,b[1]],_=p.c2p(T),M=v.c2p(T),A=k.mrc||1;l.x0=_-A,l.x1=_+A,l.y0=M-A,l.y1=M+A;var S={};S[g.subplot]={_subplot:y};var E=g._module.formatLabels(k,g,S);return l.lonLabel=E.lonLabel,l.latLabel=E.latLabel,l.color=u(g,k),l.extraText=s(g,k,m[0].t.labels),l.hovertemplate=g.hovertemplate,[l]}},getExtraText:s}},{"../../components/fx":406,"../../constants/numerical":479,"../../lib":503,"../scatter/get_trace_color":937}],999:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("../scattergeo/calc"),plot:e("./plot"),hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),styleOnSelect:function(r,a){a&&a[0].trace._glTrace.update(a)},moduleType:"trace",name:"scattermapbox",basePlotModule:e("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":613,"../scatter/marker_colorbar":945,"../scattergeo/calc":970,"./attributes":993,"./defaults":995,"./event_data":996,"./format_labels":997,"./hover":998,"./plot":1e3,"./select":1001}],1e3:[function(e,o,f){var r=e("./convert"),a=e("../../plots/mapbox/constants").traceLayerPrefix,u=["fill","line","circle","symbol"];function c(s,l){this.type="scattermapbox",this.subplot=s,this.uid=l,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol"},this.layerIds={fill:a+l+"-fill",line:a+l+"-line",circle:a+l+"-circle",symbol:a+l+"-symbol"},this.below=null}var i=c.prototype;i.addSource=function(s,l){this.subplot.map.addSource(this.sourceIds[s],{type:"geojson",data:l.geojson})},i.setSourceData=function(s,l){this.subplot.map.getSource(this.sourceIds[s]).setData(l.geojson)},i.addLayer=function(s,l,d){this.subplot.addLayer({type:s,id:this.layerIds[s],source:this.sourceIds[s],layout:l.layout,paint:l.paint},d)},i.update=function(s){var l,d,h,m=this.subplot,g=m.map,p=r(m.gd,s),v=m.belowLookup["trace-"+this.uid];if(v!==this.below){for(l=u.length-1;l>=0;l--)d=u[l],g.removeLayer(this.layerIds[d]);for(l=0;l=0;l--){var d=u[l];s.removeLayer(this.layerIds[d]),s.removeSource(this.sourceIds[d])}},o.exports=function(s,l){for(var d=l[0].trace,h=new c(s,d.uid),m=r(s.gd,l),g=h.below=s.belowLookup["trace-"+d.uid],p=0;p")}}o.exports={hoverPoints:function(u,c,i,s){var l=r(u,c,i,s);if(l&&l[0].index!==!1){var d=l[0];if(d.index===void 0)return l;var h=u.subplot,m=d.cd[d.index],g=d.trace;if(h.isPtInside(m))return d.xLabelVal=void 0,d.yLabelVal=void 0,a(m,g,h,d),d.hovertemplate=g.hovertemplate,l}},makeHoverPointText:a}},{"../scatter/hover":938}],1007:[function(e,o,f){o.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:e("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,selectPoints:e("../scatter/select"),meta:{}}},{"../../plots/polar":622,"../scatter/marker_colorbar":945,"../scatter/select":949,"../scatter/style":951,"./attributes":1002,"./calc":1003,"./defaults":1004,"./format_labels":1005,"./hover":1006,"./plot":1008}],1008:[function(e,o,f){var r=e("../scatter/plot"),a=e("../../constants/numerical").BADNUM;o.exports=function(u,c,i){for(var s=c.layers.frontplot.select("g.scatterlayer"),l={xaxis:c.xaxis,yaxis:c.yaxis,plot:c.framework,layerClipId:c._hasClipOnAxisFalse?c.clipIds.forTraces:null},d=c.radialAxis,h=c.angularAxis,m=0;m=l&&(A.marker.cluster=b.tree),A.marker&&(A.markerSel.positions=A.markerUnsel.positions=A.marker.positions=D),A.line&&D.length>1&&s.extendFlat(A.line,i.linePositions(d,k,D)),A.text&&(s.extendFlat(A.text,{positions:D},i.textPosition(d,k,A.text,A.marker)),s.extendFlat(A.textSel,{positions:D},i.textPosition(d,k,A.text,A.markerSel)),s.extendFlat(A.textUnsel,{positions:D},i.textPosition(d,k,A.text,A.markerUnsel))),A.fill&&!v.fill2d&&(v.fill2d=!0),A.marker&&!v.scatter2d&&(v.scatter2d=!0),A.line&&!v.line2d&&(v.line2d=!0),A.text&&!v.glText&&(v.glText=!0),v.lineOptions.push(A.line),v.fillOptions.push(A.fill),v.markerOptions.push(A.marker),v.markerSelectedOptions.push(A.markerSel),v.markerUnselectedOptions.push(A.markerUnsel),v.textOptions.push(A.text),v.textSelectedOptions.push(A.textSel),v.textUnselectedOptions.push(A.textUnsel),v.selectBatch.push([]),v.unselectBatch.push([]),b.x=O,b.y=R,b.rawx=O,b.rawy=R,b.r=_,b.theta=M,b.positions=D,b._scene=v,b.index=v.count,v.count++}}),u(d,h,m)}},o.exports.reglPrecompiled={}},{"../../lib":503,"../scattergl/constants":982,"../scattergl/convert":983,"../scattergl/plot":990,"../scattergl/scene_update":991,"@plotly/point-cluster":59,"fast-isnumeric":190}],1017:[function(e,o,f){var r=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../../plots/template_attributes").texttemplateAttrs,u=e("../../lib/extend").extendFlat,c=e("../scatter/attributes"),i=e("../../plots/attributes"),s=c.line;o.exports={mode:c.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:c.text,texttemplate:a({editType:"plot"},{keys:["real","imag","text"]}),hovertext:c.hovertext,line:{color:s.color,width:s.width,dash:s.dash,shape:u({},s.shape,{values:["linear","spline"]}),smoothing:s.smoothing,editType:"calc"},connectgaps:c.connectgaps,marker:c.marker,cliponaxis:u({},c.cliponaxis,{dflt:!1}),textposition:c.textposition,textfont:c.textfont,fill:u({},c.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:c.fillcolor,hoverinfo:u({},i.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:c.hoveron,hovertemplate:r(),selected:c.selected,unselected:c.unselected}},{"../../lib/extend":493,"../../plots/attributes":550,"../../plots/template_attributes":633,"../scatter/attributes":927}],1018:[function(e,o,f){var r=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,u=e("../scatter/colorscale_calc"),c=e("../scatter/arrays_to_calcdata"),i=e("../scatter/calc_selection"),s=e("../scatter/calc").calcMarkerSize;o.exports=function(l,d){for(var h=l._fullLayout,m=d.subplot,g=h[m].realaxis,p=h[m].imaginaryaxis,v=g.makeCalcdata(d,"real"),y=p.makeCalcdata(d,"imag"),x=d._length,w=new Array(x),k=0;k")}}o.exports={hoverPoints:function(u,c,i,s){var l=r(u,c,i,s);if(l&&l[0].index!==!1){var d=l[0];if(d.index===void 0)return l;var h=u.subplot,m=d.cd[d.index],g=d.trace;if(h.isPtInside(m))return d.xLabelVal=void 0,d.yLabelVal=void 0,a(m,g,h,d),d.hovertemplate=g.hovertemplate,l}},makeHoverPointText:a}},{"../scatter/hover":938}],1022:[function(e,o,f){o.exports={moduleType:"trace",name:"scattersmith",basePlotModule:e("../../plots/smith"),categories:["smith","symbols","showLegend","scatter-like"],attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,selectPoints:e("../scatter/select"),meta:{}}},{"../../plots/smith":629,"../scatter/marker_colorbar":945,"../scatter/select":949,"../scatter/style":951,"./attributes":1017,"./calc":1018,"./defaults":1019,"./format_labels":1020,"./hover":1021,"./plot":1023}],1023:[function(e,o,f){var r=e("../scatter/plot"),a=e("../../constants/numerical").BADNUM,u=e("../../plots/smith/helpers").smith;o.exports=function(c,i,s){for(var l=i.layers.frontplot.select("g.scatterlayer"),d={xaxis:i.xaxis,yaxis:i.yaxis,plot:i.framework,layerClipId:i._hasClipOnAxisFalse?i.clipIds.forTraces:null},h=0;h"),l.hovertemplate=v.hovertemplate,s}function _(M,A){b.push(M._hovertitle+": "+A)}}},{"../scatter/hover":938}],1030:[function(e,o,f){o.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:e("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":634,"../scatter/marker_colorbar":945,"../scatter/select":949,"../scatter/style":951,"./attributes":1024,"./calc":1025,"./defaults":1026,"./event_data":1027,"./format_labels":1028,"./hover":1029,"./plot":1031}],1031:[function(e,o,f){var r=e("../scatter/plot");o.exports=function(a,u,c){var i=u.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var s={xaxis:u.xaxis,yaxis:u.yaxis,plot:i,layerClipId:u._hasClipOnAxisFalse?u.clipIdRelative:null},l=u.layers.frontplot.select("g.scatterlayer");r(a,s,c,l)}},{"../scatter/plot":948}],1032:[function(e,o,f){var r=e("../scatter/attributes"),a=e("../../components/colorscale/attributes"),u=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,c=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../scattergl/attributes"),s=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template").templatedArray,d=e("../../lib/extend").extendFlat,h=r.marker,m=h.line,g=d(a("marker.line",{editTypeOverride:"calc"}),{width:d({},m.width,{editType:"calc"}),editType:"calc"}),p=d(a("marker"),{symbol:h.symbol,size:d({},h.size,{editType:"markerSize"}),sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:h.opacity,colorbar:h.colorbar,line:g,editType:"calc"});function v(y){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[y],editType:"plot"}}}p.color.editType=p.cmin.editType=p.cmax.editType="style",o.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:d({},i.text,{}),hovertext:d({},i.hovertext,{}),hovertemplate:c(),xhoverformat:u("x"),yhoverformat:u("y"),marker:p,xaxes:v("x"),yaxes:v("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:i.selected.marker,editType:"calc"},unselected:{marker:i.unselected.marker,editType:"calc"},opacity:i.opacity}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/plot_template":543,"../../plots/cartesian/axis_format_attributes":557,"../../plots/cartesian/constants":561,"../../plots/template_attributes":633,"../scatter/attributes":927,"../scattergl/attributes":979}],1033:[function(e,o,f){var r=e("../../registry"),a=e("../../components/grid");o.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),calc:e("./calc"),plot:e("./plot"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select"),editStyle:e("./edit_style"),meta:{}},r.register(a)},{"../../components/grid":410,"../../registry":638,"../scatter/marker_colorbar":945,"./attributes":1032,"./calc":1035,"./defaults":1036,"./edit_style":1037,"./hover":1039,"./plot":1041,"./select":1043}],1034:[function(e,o,f){var r=e("regl-line2d"),a=e("../../registry"),u=e("../../lib/prepare_regl"),c=e("../../plots/get_data").getModuleCalcData,i=e("../../plots/cartesian"),s=e("../../plots/cartesian/axis_ids").getFromId,l=e("../../plots/cartesian/axes").shouldShowZeroLine,d={};function h(g,p,v){for(var y=v.matrixOptions.data.length,x=p._visibleDims,w=v.viewOpts.ranges=new Array(y),k=0;km?M.sizeAvg||Math.max(M.size,3):u(p,_),y=0;yD&&z||E-1,G=!0;if(c(M)||!!x.selectedpoints||B){var W=x._length;if(x.selectedpoints){k.selectBatch=x.selectedpoints;var K=x.selectedpoints,te={};for(m=0;m1&&(y=T[A-1],w=_[A-1],b=M[A-1]),l=0;ly?"-":"+")+"x")).replace("y",(x>w?"-":"+")+"y")).replace("z",(k>b?"-":"+")+"z");var G=function(){A=0,P=[],N=[],B=[]};(!A||A2?v.slice(1,y-1):y===2?[(v[0]+v[1])/2]:v}function g(v){var y=v.length;return y===1?[.5,.5]:[v[1]-v[0],v[y-1]-v[y-2]]}function p(v,y){var x=v.fullSceneLayout,w=v.dataScale,k=y._len,b={};function T(U,q){var $=x[q],ne=w[l[q]];return u.simpleMap(U,function(H){return $.d2l(H)*ne})}if(b.vectors=s(T(y._u,"xaxis"),T(y._v,"yaxis"),T(y._w,"zaxis"),k),!k)return{positions:[],cells:[]};var _=T(y._Xs,"xaxis"),M=T(y._Ys,"yaxis"),A=T(y._Zs,"zaxis");if(b.meshgrid=[_,M,A],b.gridFill=y._gridFill,y._slen)b.startingPositions=s(T(y._startsX,"xaxis"),T(y._startsY,"yaxis"),T(y._startsZ,"zaxis"));else{for(var S=M[0],E=m(_),D=m(A),O=new Array(E.length*D.length),R=0,z=0;z=0};A?(y=Math.min(M.length,E.length),x=function(ee){return P(M[ee])&&N(ee)},w=function(ee){return String(M[ee])}):(y=Math.min(S.length,E.length),x=function(ee){return P(S[ee])&&N(ee)},w=function(ee){return String(S[ee])}),O&&(y=Math.min(y,D.length));for(var B=0;B1){for(var te=u.randstr(),Y=0;Y"),name:P||re("name")?S.name:void 0,color:L("hoverlabel.bgcolor")||E.color,borderColor:L("hoverlabel.bordercolor"),fontFamily:L("hoverlabel.font.family"),fontSize:L("hoverlabel.font.size"),fontColor:L("hoverlabel.font.color"),nameLength:L("hoverlabel.namelength"),textAlign:L("hoverlabel.align"),hovertemplate:P,hovertemplateLabels:te,eventData:A};b&&($.x0=G-_.rInscribed*_.rpx1,$.x1=G+_.rInscribed*_.rpx1,$.idealAlign=_.pxmid[0]<0?"left":"right"),T&&($.x=G,$.idealAlign=G<0?"left":"right");var ne=[];c.loneHover($,{container:M._hoverlayer.node(),outerContainer:M._paper.node(),gd:p,inOut_bbox:ne}),A[0].bbox=ne[0],w._hasHoverLabel=!0}if(T){var H=m.select("path.surface");y.styleOne(H,_,S,{hovered:!0})}w._hasHoverEvent=!0,p.emit("plotly_hover",{points:A||[h(_,S,y.eventDataKeys)],event:r.event})}}),m.on("mouseout",function(_){var M=p._fullLayout,A=p._fullData[w.index],S=r.select(this).datum();if(w._hasHoverEvent&&(_.originalEvent=r.event,p.emit("plotly_unhover",{points:[h(S,A,y.eventDataKeys)],event:r.event}),w._hasHoverEvent=!1),w._hasHoverLabel&&(c.loneUnhover(M._hoverlayer.node()),w._hasHoverLabel=!1),T){var E=m.select("path.surface");y.styleOne(E,S,A,{hovered:!1})}}),m.on("click",function(_){var M=p._fullLayout,A=p._fullData[w.index],S=b&&(l.isHierarchyRoot(_)||l.isLeaf(_)),E=l.getPtId(_),D=l.isEntry(_)?l.findEntryWithChild(k,E):l.findEntryWithLevel(k,E),O=l.getPtId(D),R={points:[h(_,A,y.eventDataKeys)],event:r.event};S||(R.nextLevel=O);var z=s.triggerHandler(p,"plotly_"+w.type+"click",R);if(z!==!1&&M.hovermode&&(p._hoverdata=[h(_,A,y.eventDataKeys)],c.click(p,r.event)),!S&&z!==!1&&!p._dragging&&!p._transitioning){a.call("_storeDirectGUIEdit",A,M._tracePreGUI[A.uid],{level:A.level});var L={data:[{level:O}],traces:[w.index]},P={frame:{redraw:!1,duration:y.transitionTime},transition:{duration:y.transitionTime,easing:y.transitionEasing},mode:"immediate",fromcurrent:!0};c.loneUnhover(M._hoverlayer.node()),a.call("animate",p,L,P)}})}},{"../../components/fx":406,"../../components/fx/helpers":402,"../../lib":503,"../../lib/events":492,"../../registry":638,"../pie/helpers":906,"./helpers":1055,"@plotly/d3":58}],1055:[function(e,o,f){var r=e("../../lib"),a=e("../../components/color"),u=e("../../lib/setcursor"),c=e("../pie/helpers");function i(s){return s.data.data.pid}f.findEntryWithLevel=function(s,l){var d;return l&&s.eachAfter(function(h){if(f.getPtId(h)===l)return d=h.copy()}),d||s},f.findEntryWithChild=function(s,l){var d;return s.eachAfter(function(h){for(var m=h.children||[],g=0;g0)},f.getMaxDepth=function(s){return s.maxdepth>=0?s.maxdepth:1/0},f.isHeader=function(s,l){return!(f.isLeaf(s)||s.depth===l._maxDepth-1)},f.getParent=function(s,l){return f.findEntryWithLevel(s,i(l))},f.listPath=function(s,l){var d=s.parent;if(!d)return[];var h=l?[d.data[l]]:[d];return f.listPath(d,l).concat(h)},f.getPath=function(s){return f.listPath(s,"label").join("/")+"/"},f.formatValue=c.formatPieValue,f.formatPercent=function(s,l){var d=r.formatPercent(s,0);return d==="0%"&&(d=c.formatPiePercent(s,l)),d}},{"../../components/color":366,"../../lib":503,"../../lib/setcursor":524,"../pie/helpers":906}],1056:[function(e,o,f){o.exports={moduleType:"trace",name:"sunburst",basePlotModule:e("./base_plot"),categories:[],animatable:!0,attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot").plot,style:e("./style").style,colorbar:e("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":945,"./attributes":1049,"./base_plot":1050,"./calc":1051,"./defaults":1053,"./layout_attributes":1057,"./layout_defaults":1058,"./plot":1059,"./style":1060}],1057:[function(e,o,f){o.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1058:[function(e,o,f){var r=e("../../lib"),a=e("./layout_attributes");o.exports=function(u,c){function i(s,l){return r.coerce(u,c,a,s,l)}i("sunburstcolorway",c.colorway),i("extendsunburstcolors")}},{"../../lib":503,"./layout_attributes":1057}],1059:[function(e,o,f){var r=e("@plotly/d3"),a=e("d3-hierarchy"),u=e("d3-interpolate").interpolate,c=e("../../components/drawing"),i=e("../../lib"),s=e("../../lib/svg_text_utils"),l=e("../bar/uniform_text"),d=l.recordMinTextSize,h=l.clearMinTextSize,m=e("../pie/plot"),g=e("../pie/helpers").getRotationAngle,p=m.computeTransform,v=m.transformInsideText,y=e("./style").styleOne,x=e("../bar/style").resizeText,w=e("./fx"),k=e("./constants"),b=e("./helpers");function T(M,A,S,E){var D=M._fullLayout,O=!D.uniformtext.mode&&b.hasTransition(E),R=r.select(S).selectAll("g.slice"),z=A[0],L=z.trace,P=z.hierarchy,N=b.findEntryWithLevel(P,L.level),B=b.getMaxDepth(L),G=D._size,W=L.domain,K=G.w*(W.x[1]-W.x[0]),te=G.h*(W.y[1]-W.y[0]),Y=.5*Math.min(K,te),Z=z.cx=G.l+G.w*(W.x[1]+W.x[0])/2,re=z.cy=G.t+G.h*(1-W.y[0])-te/2;if(!N)return R.remove();var U=null,q={};O&&R.each(function(Oe){q[b.getPtId(Oe)]={rpx0:Oe.rpx0,rpx1:Oe.rpx1,x0:Oe.x0,x1:Oe.x1,transform:Oe.transform},!U&&b.isEntry(Oe)&&(U=Oe)});var $=function(Oe){return a.partition().size([2*Math.PI,Oe.height+1])(Oe)}(N).descendants(),ne=N.height+1,H=0,Q=B;z.hasMultipleRoots&&b.isHierarchyRoot(N)&&($=$.slice(1),ne-=1,H=1,Q+=1),$=$.filter(function(Oe){return Oe.y1<=Q});var ee=g(L.rotation);ee&&$.forEach(function(Oe){Oe.x0+=ee,Oe.x1+=ee});var ie=Math.min(ne,B),ae=function(Oe){return(Oe-H)/ie*Y},ue=function(Oe,de){return[Oe*Math.cos(de),-Oe*Math.sin(de)]},le=function(Oe){return i.pathAnnulus(Oe.rpx0,Oe.rpx1,Oe.x0,Oe.x1,Z,re)},ge=function(Oe){return Z+_(Oe)[0]*(Oe.transform.rCenter||0)+(Oe.transform.x||0)},fe=function(Oe){return re+_(Oe)[1]*(Oe.transform.rCenter||0)+(Oe.transform.y||0)};(R=R.data($,b.getPtId)).enter().append("g").classed("slice",!0),O?R.exit().transition().each(function(){var Oe=r.select(this);Oe.select("path.surface").transition().attrTween("d",function(de){var ye=function(Me){var ke,Ee=b.getPtId(Me),ze=q[Ee],Fe=q[b.getPtId(N)];if(Fe){var Ve=(Me.x1>Fe.x1?2*Math.PI:0)+ee;ke=Me.rpx1me?2*Math.PI:0)+ee;qe={x0:nt,x1:nt}}else qe={rpx0:Y,rpx1:Y},i.extendFlat(qe,Te(Re));else qe={rpx0:0,rpx1:0};else qe={x0:ee,x1:ee};return u(qe,Ye)}(Ve);return function(Re){return le(Ke(Re))}}):ye.attr("d",le),de.call(w,N,M,A,{eventDataKeys:k.eventDataKeys,transitionTime:k.CLICK_TRANSITION_TIME,transitionEasing:k.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,M,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:M._transitioning}),ye.call(y,Oe,L);var Me=i.ensureSingle(de,"g","slicetext"),ke=i.ensureSingle(Me,"text","",function(Ve){Ve.attr("data-notex",1)}),Ee=i.ensureUniformFontSize(M,b.determineTextFont(L,Oe,D.font));ke.text(f.formatSliceLabel(Oe,N,L,A,D)).classed("slicetext",!0).attr("text-anchor","middle").call(c.font,Ee).call(s.convertToTspans,M);var ze=c.bBox(ke.node());Oe.transform=v(ze,Oe,z),Oe.transform.targetX=ge(Oe),Oe.transform.targetY=fe(Oe);var Fe=function(Ve,Ke){var Re=Ve.transform;return p(Re,Ke),Re.fontSize=Ee.size,d(L.type,Re,D),i.getTextTransform(Re)};O?ke.transition().attrTween("transform",function(Ve){var Ke=function(Re){var qe,We=q[b.getPtId(Re)],Ye=Re.transform;if(We)qe=We;else if(qe={rpx1:Re.rpx1,transform:{textPosAngle:Ye.textPosAngle,scale:0,rotate:Ye.rotate,rCenter:Ye.rCenter,x:Ye.x,y:Ye.y}},U)if(Re.parent)if(me){var nt=Re.x1>me?2*Math.PI:0;qe.x0=qe.x1=nt}else i.extendFlat(qe,Te(Re));else qe.x0=qe.x1=ee;else qe.x0=qe.x1=ee;var ft=u(qe.transform.textPosAngle,Re.transform.textPosAngle),vt=u(qe.rpx1,Re.rpx1),Pt=u(qe.x0,Re.x0),At=u(qe.x1,Re.x1),at=u(qe.transform.scale,Ye.scale),et=u(qe.transform.rotate,Ye.rotate),Ot=Ye.rCenter===0?3:qe.transform.rCenter===0?1/3:1,Wt=u(qe.transform.rCenter,Ye.rCenter);return function(Jt){var Be=vt(Jt),Ge=Pt(Jt),Tt=At(Jt),dt=function(Ie){return Wt(Math.pow(Ie,Ot))}(Jt),Pe={pxmid:ue(Be,(Ge+Tt)/2),rpx1:Be,transform:{textPosAngle:ft(Jt),rCenter:dt,x:Ye.x,y:Ye.y}};return d(L.type,Ye,D),{transform:{targetX:ge(Pe),targetY:fe(Pe),scale:at(Jt),rotate:et(Jt),rCenter:dt}}}}(Ve);return function(Re){return Fe(Ke(Re),ze)}}):ke.attr("transform",Fe(Oe,ze))})}function _(M){return A=M.rpx1,S=M.transform.textPosAngle,[A*Math.sin(S),-A*Math.cos(S)];var A,S}f.plot=function(M,A,S,E){var D,O,R=M._fullLayout,z=R._sunburstlayer,L=!S,P=!R.uniformtext.mode&&b.hasTransition(S);h("sunburst",R),(D=z.selectAll("g.trace.sunburst").data(A,function(N){return N[0].trace.uid})).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),D.order(),P?(E&&(O=E()),r.transition().duration(S.duration).ease(S.easing).each("end",function(){O&&O()}).each("interrupt",function(){O&&O()}).each(function(){z.selectAll("g.trace").each(function(N){T(M,N,this,S)})})):(D.each(function(N){T(M,N,this,S)}),R.uniformtext.mode&&x(M,R._sunburstlayer.selectAll(".trace"),"sunburst")),L&&D.exit().remove()},f.formatSliceLabel=function(M,A,S,E,D){var O=S.texttemplate,R=S.textinfo;if(!(O||R&&R!=="none"))return"";var z=D.separators,L=E[0],P=M.data.data,N=L.hierarchy,B=b.isHierarchyRoot(M),G=b.getParent(N,M),W=b.getValue(M);if(!O){var K,te=R.split("+"),Y=function(ee){return te.indexOf(ee)!==-1},Z=[];if(Y("label")&&P.label&&Z.push(P.label),P.hasOwnProperty("v")&&Y("value")&&Z.push(b.formatValue(P.v,z)),!B){Y("current path")&&Z.push(b.getPath(M.data));var re=0;Y("percent parent")&&re++,Y("percent entry")&&re++,Y("percent root")&&re++;var U=re>1;if(re){var q,$=function(ee){K=b.formatPercent(q,z),U&&(K+=" of "+ee),Z.push(K)};Y("percent parent")&&!B&&(q=W/b.getValue(G),$("parent")),Y("percent entry")&&(q=W/b.getValue(A),$("entry")),Y("percent root")&&(q=W/b.getValue(N),$("root"))}}return Y("text")&&(K=i.castOption(S,P.i,"text"),i.isValidTextValue(K)&&Z.push(K)),Z.join("
")}var ne=i.castOption(S,P.i,"texttemplate");if(!ne)return"";var H={};P.label&&(H.label=P.label),P.hasOwnProperty("v")&&(H.value=P.v,H.valueLabel=b.formatValue(P.v,z)),H.currentPath=b.getPath(M.data),B||(H.percentParent=W/b.getValue(G),H.percentParentLabel=b.formatPercent(H.percentParent,z),H.parent=b.getPtLabel(G)),H.percentEntry=W/b.getValue(A),H.percentEntryLabel=b.formatPercent(H.percentEntry,z),H.entry=b.getPtLabel(A),H.percentRoot=W/b.getValue(N),H.percentRootLabel=b.formatPercent(H.percentRoot,z),H.root=b.getPtLabel(N),P.hasOwnProperty("color")&&(H.color=P.color);var Q=i.castOption(S,P.i,"text");return(i.isValidTextValue(Q)||Q==="")&&(H.text=Q),H.customdata=i.castOption(S,P.i,"customdata"),i.texttemplateString(ne,H,D._d3locale,H,S._meta||{})}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../bar/style":662,"../bar/uniform_text":664,"../pie/helpers":906,"../pie/plot":910,"./constants":1052,"./fx":1054,"./helpers":1055,"./style":1060,"@plotly/d3":58,"d3-hierarchy":115,"d3-interpolate":116}],1060:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../components/color"),u=e("../../lib"),c=e("../bar/uniform_text").resizeText;function i(s,l,d){var h=l.data.data,m=!l.children,g=h.i,p=u.castOption(d,g,"marker.line.color")||a.defaultLine,v=u.castOption(d,g,"marker.line.width")||0;s.style("stroke-width",v).call(a.fill,h.color).call(a.stroke,p).style("opacity",m?d.leaf.opacity:null)}o.exports={style:function(s){var l=s._fullLayout._sunburstlayer.selectAll(".trace");c(s,l,"sunburst"),l.each(function(d){var h=r.select(this),m=d[0].trace;h.style("opacity",m.opacity),h.selectAll("path.surface").each(function(g){r.select(this).call(i,g,m)})})},styleOne:i}},{"../../components/color":366,"../../lib":503,"../bar/uniform_text":664,"@plotly/d3":58}],1061:[function(e,o,f){var r=e("../../components/color"),a=e("../../components/colorscale/attributes"),u=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,c=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../../plots/attributes"),s=e("../../lib/extend").extendFlat,l=e("../../plot_api/edit_types").overrideAll;function d(m){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:r.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:r.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var h=o.exports=l(s({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:c(),xhoverformat:u("x"),yhoverformat:u("y"),zhoverformat:u("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},a("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:d(),y:d(),z:d()},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:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})},hoverinfo:s({},i.hoverinfo),showlegend:s({},i.showlegend,{dflt:!1})}),"calc","nested");h.x.editType=h.y.editType=h.z.editType="calc+clearAxisTypes",h.transforms=void 0},{"../../components/color":366,"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plot_api/edit_types":536,"../../plots/attributes":550,"../../plots/cartesian/axis_format_attributes":557,"../../plots/template_attributes":633}],1062:[function(e,o,f){var r=e("../../components/colorscale/calc");o.exports=function(a,u){u.surfacecolor?r(a,u,{vals:u.surfacecolor,containerStr:"",cLetter:"c"}):r(a,u,{vals:u.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":374}],1063:[function(e,o,f){var r=e("../../../stackgl_modules").gl_surface3d,a=e("../../../stackgl_modules").ndarray,u=e("../../../stackgl_modules").ndarray_linear_interpolate.d2,c=e("../heatmap/interp2d"),i=e("../heatmap/find_empties"),s=e("../../lib").isArrayOrTypedArray,l=e("../../lib/gl_format_color").parseColorScale,d=e("../../lib/str2rgbarray"),h=e("../../components/colorscale").extractOpts;function m(S,E,D){this.scene=S,this.uid=D,this.surface=E,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 g=m.prototype;g.getXat=function(S,E,D,O){var R=s(this.data.x)?s(this.data.x[0])?this.data.x[E][S]:this.data.x[S]:S;return D===void 0?R:O.d2l(R,0,D)},g.getYat=function(S,E,D,O){var R=s(this.data.y)?s(this.data.y[0])?this.data.y[E][S]:this.data.y[E]:E;return D===void 0?R:O.d2l(R,0,D)},g.getZat=function(S,E,D,O){var R=this.data.z[E][S];return R===null&&this.data.connectgaps&&this.data._interpolatedZ&&(R=this.data._interpolatedZ[E][S]),D===void 0?R:O.d2l(R,0,D)},g.handlePick=function(S){if(S.object===this.surface){var E=(S.data.index[0]-1)/this.dataScaleX-1,D=(S.data.index[1]-1)/this.dataScaleY-1,O=Math.max(Math.min(Math.round(E),this.data.z[0].length-1),0),R=Math.max(Math.min(Math.round(D),this.data._ylength-1),0);S.index=[O,R],S.traceCoordinate=[this.getXat(O,R),this.getYat(O,R),this.getZat(O,R)],S.dataCoordinate=[this.getXat(O,R,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(O,R,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(O,R,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var z=0;z<3;z++){var L=S.dataCoordinate[z];L!=null&&(S.dataCoordinate[z]*=this.scene.dataScale[z])}var P=this.data.hovertext||this.data.text;return Array.isArray(P)&&P[R]&&P[R][O]!==void 0?S.textLabel=P[R][O]:S.textLabel=P||"",S.data.dataCoordinate=S.dataCoordinate.slice(),this.surface.highlight(S.data),this.scene.glplot.spikes.position=S.dataCoordinate,!0}};var p=[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 v(S,E){if(S0){D=p[O];break}return D}function w(S,E){if(!(S<1||E<1)){for(var D=y(S),O=y(E),R=1,z=0;zT;)D--,D/=x(D),++D1?O:1},g.refineCoords=function(S){for(var E=this.dataScaleX,D=this.dataScaleY,O=S[0].shape[0],R=S[0].shape[1],z=0|Math.floor(S[0].shape[0]*E+1),L=0|Math.floor(S[0].shape[1]*D+1),P=1+O+1,N=1+R+1,B=a(new Float32Array(P*N),[P,N]),G=[1/E,0,0,0,1/D,0,0,0,1],W=0;W0&&this.contourStart[S]!==null&&this.contourEnd[S]!==null&&this.contourEnd[S]>this.contourStart[S]))for(R[S]=!0,E=this.contourStart[S];ER&&(this.minValues[E]=R),this.maxValues[E]",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"}}},{}],1070:[function(e,o,f){var r=e("./constants"),a=e("../../lib/extend").extendFlat,u=e("fast-isnumeric");function c(g){if(Array.isArray(g)){for(var p=0,v=0;v=p||_===g.length-1)&&(y[x]=k,k.key=T++,k.firstRowIndex=b,k.lastRowIndex=_,k={firstRowIndex:null,lastRowIndex:null,rows:[]},x+=w,b=_+1,w=0);return y}o.exports=function(g,p){var v=s(p.cells.values),y=function(B){return B.slice(p.header.values.length,B.length)},x=s(p.header.values);x.length&&!x[0].length&&(x[0]=[""],x=s(x));var w=x.concat(y(v).map(function(){return l((x[0]||[""]).length)})),k=p.domain,b=Math.floor(g._fullLayout._size.w*(k.x[1]-k.x[0])),T=Math.floor(g._fullLayout._size.h*(k.y[1]-k.y[0])),_=p.header.values.length?w[0].map(function(){return p.header.height}):[r.emptyHeaderHeight],M=v.length?v[0].map(function(){return p.cells.height}):[],A=_.reduce(i,0),S=m(M,T-A+r.uplift),E=h(m(_,A),[]),D=h(S,E),O={},R=p._fullInput.columnorder.concat(y(v.map(function(B,G){return G}))),z=w.map(function(B,G){var W=Array.isArray(p.columnwidth)?p.columnwidth[Math.min(G,p.columnwidth.length-1)]:p.columnwidth;return u(W)?Number(W):1}),L=z.reduce(i,0);z=z.map(function(B){return B/L*b});var P=Math.max(c(p.header.line.width),c(p.cells.line.width)),N={key:p.uid+g._context.staticPlot,translateX:k.x[0]*g._fullLayout._size.w,translateY:g._fullLayout._size.h*(1-k.y[1]),size:g._fullLayout._size,width:b,maxLineWidth:P,height:T,columnOrder:R,groupHeight:T,rowBlocks:D,headerRowBlocks:E,scrollY:0,cells:a({},p.cells,{values:v}),headerCells:a({},p.header,{values:w}),gdColumns:w.map(function(B){return B[0]}),gdColumnsOriginalOrder:w.map(function(B){return B[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:w.map(function(B,G){var W=O[B];return O[B]=(W||0)+1,{key:B+"__"+O[B],label:B,specIndex:G,xIndex:R[G],xScale:d,x:void 0,calcdata:void 0,columnWidth:z[G]}})};return N.columns.forEach(function(B){B.calcdata=N,B.x=d(B)}),N}},{"../../lib/extend":493,"./constants":1069,"fast-isnumeric":190}],1071:[function(e,o,f){var r=e("../../lib/extend").extendFlat;f.splitToPanels=function(a){var u=[0,0],c=r({},a,{key:"header",type:"header",page:0,prevPages:u,currentRepaint:[null,null],dragHandle:!0,values:a.calcdata.headerCells.values[a.specIndex],rowBlocks:a.calcdata.headerRowBlocks,calcdata:r({},a.calcdata,{cells:a.calcdata.headerCells})});return[r({},a,{key:"cells1",type:"cells",page:0,prevPages:u,currentRepaint:[null,null],dragHandle:!1,values:a.calcdata.cells.values[a.specIndex],rowBlocks:a.calcdata.rowBlocks}),r({},a,{key:"cells2",type:"cells",page:1,prevPages:u,currentRepaint:[null,null],dragHandle:!1,values:a.calcdata.cells.values[a.specIndex],rowBlocks:a.calcdata.rowBlocks}),c]},f.splitToCells=function(a){var u=function(c){var i=c.rowBlocks[c.page],s=i?i.rows[0].rowIndex:0,l=i?s+i.rows.length:0;return[s,l]}(a);return(a.values||[]).slice(u[0],u[1]).map(function(c,i){return{keyWithinBlock:i+(typeof c=="string"&&c.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:u[0]+i,column:a,calcdata:a.calcdata,page:a.page,rowBlocks:a.rowBlocks,value:c}})}},{"../../lib/extend":493}],1072:[function(e,o,f){var r=e("../../lib"),a=e("./attributes"),u=e("../../plots/domain").defaults;o.exports=function(c,i,s,l){function d(h,m){return r.coerce(c,i,a,h,m)}u(i,l,d),d("columnwidth"),d("header.values"),d("header.format"),d("header.align"),d("header.prefix"),d("header.suffix"),d("header.height"),d("header.line.width"),d("header.line.color"),d("header.fill.color"),r.coerceFont(d,"header.font",r.extendFlat({},l.font)),function(h,m){for(var g=h.columnorder||[],p=h.header.values.length,v=g.slice(0,p),y=v.slice().sort(function(k,b){return k-b}),x=v.map(function(k){return y.indexOf(k)}),w=x.length;w/i),ie=!Q||ee;q.mayHaveMarkup=Q&&H.match(/[<&>]/);var ae,ue=typeof(ae=H)=="string"&&ae.match(r.latexCheck);q.latex=ue;var le,ge,fe=ue?"":M(q.calcdata.cells.prefix,$,ne)||"",me=ue?"":M(q.calcdata.cells.suffix,$,ne)||"",_e=ue?null:M(q.calcdata.cells.format,$,ne)||null,we=fe+(_e?u(_e)(q.value):q.value)+me;if(q.wrappingNeeded=!q.wrapped&&!ie&&!ue&&(le=_(we)),q.cellHeightMayIncrease=ee||ue||q.mayHaveMarkup||(le===void 0?_(we):le),q.needsConvertToTspans=q.mayHaveMarkup||q.wrappingNeeded||q.latex,q.wrappingNeeded){var Te=(r.wrapSplitCharacter===" "?we.replace(/ge&&le.push(fe),ge+=we}return le}(q,Q,H);ee.length===1&&(ee[0]===q.length-1?ee.unshift(ee[0]-1):ee.push(ee[0]+1)),ee[0]%2&&ee.reverse(),Z.each(function(ie,ae){ie.page=ee[ae],ie.scrollY=Q}),Z.attr("transform",function(ie){var ae=G(ie.rowBlocks,ie.page)-ie.scrollY;return d(0,ae)}),Y&&(z(Y,re,Z,ee,U.prevPages,U,0),z(Y,re,Z,ee,U.prevPages,U,1),k(re,Y))}}function R(Y,Z,re,U){return function(q){var $=q.calcdata?q.calcdata:q,ne=Z.filter(function(ie){return $.key===ie.key}),H=re||$.scrollbarState.dragMultiplier,Q=$.scrollY;$.scrollY=U===void 0?$.scrollY+H*a.event.dy:U;var ee=ne.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(S);return O(Y,ee,ne),$.scrollY===Q}}function z(Y,Z,re,U,q,$,ne){U[ne]!==q[ne]&&(clearTimeout($.currentRepaint[ne]),$.currentRepaint[ne]=setTimeout(function(){var H=re.filter(function(Q,ee){return ee===ne&&U[ee]!==q[ee]});b(Y,Z,H,re),q[ne]=U[ne]}))}function L(Y,Z,re,U){return function(){var q=a.select(Z.parentNode);q.each(function($){var ne=$.fragments;q.selectAll("tspan.line").each(function(ge,fe){ne[fe].width=this.getComputedTextLength()});var H,Q,ee=ne[ne.length-1].width,ie=ne.slice(0,-1),ae=[],ue=0,le=$.column.columnWidth-2*r.cellPad;for($.value="";ie.length;)ue+(Q=(H=ie.shift()).width+ee)>le&&($.value+=ae.join(r.wrapSpacer)+r.lineBreaker,ae=[],ue=0),ae.push(H.text),ue+=Q;ue&&($.value+=ae.join(r.wrapSpacer)),$.wrapped=!0}),q.selectAll("tspan.line").remove(),T(q.select("."+r.cn.cellText),re,Y,U),a.select(Z.parentNode.parentNode).call(B)}}function P(Y,Z,re,U,q){return function(){if(!q.settledY){var $=a.select(Z.parentNode),ne=te(q),H=q.key-ne.firstRowIndex,Q=ne.rows[H].rowHeight,ee=q.cellHeightMayIncrease?Z.parentNode.getBoundingClientRect().height+2*r.cellPad:Q,ie=Math.max(ee,Q);ie-ne.rows[H].rowHeight&&(ne.rows[H].rowHeight=ie,Y.selectAll("."+r.cn.columnCell).call(B),O(null,Y.filter(S),0),k(re,U,!0)),$.attr("transform",function(){var ae=this.parentNode.getBoundingClientRect(),ue=a.select(this.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),le=this.transform.baseVal.consolidate(),ge=ue.top-ae.top+(le?le.matrix.f:r.cellPad);return d(N(q,a.select(this.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),ge)}),q.settledY=!0}}}function N(Y,Z){switch(Y.align){case"left":return r.cellPad;case"right":return Y.column.columnWidth-(Z||0)-r.cellPad;case"center":return(Y.column.columnWidth-(Z||0))/2;default:return r.cellPad}}function B(Y){Y.attr("transform",function(Z){var re=Z.rowBlocks[0].auxiliaryBlocks.reduce(function(q,$){return q+W($,1/0)},0),U=W(te(Z),Z.key);return d(0,U+re)}).selectAll("."+r.cn.cellRect).attr("height",function(Z){return(re=te(Z),U=Z.key,re.rows[U-re.firstRowIndex]).rowHeight;var re,U})}function G(Y,Z){for(var re=0,U=Z-1;U>=0;U--)re+=K(Y[U]);return re}function W(Y,Z){for(var re=0,U=0;U","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:d({},i.textfont,{}),editType:"calc"},text:i.text,textinfo:s.textinfo,texttemplate:a({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:i.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:l.eventDataKeys}),textfont:i.textfont,insidetextfont:i.insidetextfont,outsidetextfont:d({},i.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:i.sort,root:s.root,domain:c({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":373,"../../lib/extend":493,"../../plots/domain":584,"../../plots/template_attributes":633,"../pie/attributes":901,"../sunburst/attributes":1049,"./constants":1078}],1076:[function(e,o,f){var r=e("../../plots/plots");f.name="treemap",f.plot=function(a,u,c,i){r.plotBasePlot(f.name,a,u,c,i)},f.clean=function(a,u,c,i){r.cleanBasePlot(f.name,a,u,c,i)}},{"../../plots/plots":619}],1077:[function(e,o,f){var r=e("../sunburst/calc");f.calc=function(a,u){return r.calc(a,u)},f.crossTraceCalc=function(a){return r._runCrossTraceCalc("treemap",a)}},{"../sunburst/calc":1051}],1078:[function(e,o,f){o.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1079:[function(e,o,f){var r=e("../../lib"),a=e("./attributes"),u=e("../../components/color"),c=e("../../plots/domain").defaults,i=e("../bar/defaults").handleText,s=e("../bar/constants").TEXTPAD,l=e("../../components/colorscale"),d=l.hasColorscale,h=l.handleDefaults;o.exports=function(m,g,p,v){function y(S,E){return r.coerce(m,g,a,S,E)}var x=y("labels"),w=y("parents");if(x&&x.length&&w&&w.length){var k=y("values");k&&k.length?y("branchvalues"):y("count"),y("level"),y("maxdepth"),y("tiling.packing")==="squarify"&&y("tiling.squarifyratio"),y("tiling.flip"),y("tiling.pad");var b=y("text");y("texttemplate"),g.texttemplate||y("textinfo",Array.isArray(b)?"text+label":"label"),y("hovertext"),y("hovertemplate");var T=y("pathbar.visible");i(m,g,v,y,"auto",{hasPathbar:T,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),y("textposition");var _=g.textposition.indexOf("bottom")!==-1;y("marker.line.width")&&y("marker.line.color",v.paper_bgcolor);var M=y("marker.colors");(g._hasColorscale=d(m,"marker","colors")||(m.marker||{}).coloraxis)?h(m,g,v,y,{prefix:"marker.",cLetter:"c"}):y("marker.depthfade",!(M||[]).length);var A=2*g.textfont.size;y("marker.pad.t",_?A/4:A),y("marker.pad.l",A/4),y("marker.pad.r",A/4),y("marker.pad.b",_?A:A/4),g._hovered={marker:{line:{width:2,color:u.contrast(v.paper_bgcolor)}}},T&&(y("pathbar.thickness",g.pathbar.textfont.size+2*s),y("pathbar.side"),y("pathbar.edgeshape")),y("sort"),y("root.color"),c(g,v,y),g._length=null}else g.visible=!1}},{"../../components/color":366,"../../components/colorscale":378,"../../lib":503,"../../plots/domain":584,"../bar/constants":650,"../bar/defaults":652,"./attributes":1075}],1080:[function(e,o,f){var r=e("@plotly/d3"),a=e("../sunburst/helpers"),u=e("../bar/uniform_text").clearMinTextSize,c=e("../bar/style").resizeText,i=e("./plot_one");o.exports=function(s,l,d,h,m){var g,p,v=m.type,y=m.drawDescendants,x=s._fullLayout,w=x["_"+v+"layer"],k=!d;u(v,x),(g=w.selectAll("g.trace."+v).data(l,function(b){return b[0].trace.uid})).enter().append("g").classed("trace",!0).classed(v,!0),g.order(),!x.uniformtext.mode&&a.hasTransition(d)?(h&&(p=h()),r.transition().duration(d.duration).ease(d.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){w.selectAll("g.trace").each(function(b){i(s,b,this,d,y)})})):(g.each(function(b){i(s,b,this,d,y)}),x.uniformtext.mode&&c(s,w.selectAll(".trace"),v)),k&&g.exit().remove()}},{"../bar/style":662,"../bar/uniform_text":664,"../sunburst/helpers":1055,"./plot_one":1089,"@plotly/d3":58}],1081:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=e("../../components/drawing"),c=e("../../lib/svg_text_utils"),i=e("./partition"),s=e("./style").styleOne,l=e("./constants"),d=e("../sunburst/helpers"),h=e("../sunburst/fx");o.exports=function(m,g,p,v,y){var x=y.barDifY,w=y.width,k=y.height,b=y.viewX,T=y.viewY,_=y.pathSlice,M=y.toMoveInsideSlice,A=y.strTransform,S=y.hasTransition,E=y.handleSlicesExit,D=y.makeUpdateSliceInterpolator,O=y.makeUpdateTextInterpolator,R={},z=m._fullLayout,L=g[0],P=L.trace,N=L.hierarchy,B=w/P._entryDepth,G=d.listPath(p.data,"id"),W=i(N.copy(),[w,k],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(W=W.filter(function(te){var Y=G.indexOf(te.data.id);return Y!==-1&&(te.x0=B*Y,te.x1=B*(Y+1),te.y0=x,te.y1=x+k,te.onPathbar=!0,!0)})).reverse(),(v=v.data(W,d.getPtId)).enter().append("g").classed("pathbar",!0),E(v,!0,R,[w,k],_),v.order();var K=v;S&&(K=K.transition().each("end",function(){var te=r.select(this);d.setSliceCursor(te,m,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),K.each(function(te){te._x0=b(te.x0),te._x1=b(te.x1),te._y0=T(te.y0),te._y1=T(te.y1),te._hoverX=b(te.x1-Math.min(w,k)/2),te._hoverY=T(te.y1-k/2);var Y=r.select(this),Z=a.ensureSingle(Y,"path","surface",function($){$.style("pointer-events","all")});S?Z.transition().attrTween("d",function($){var ne=D($,!0,R,[w,k]);return function(H){return _(ne(H))}}):Z.attr("d",_),Y.call(h,p,m,g,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(d.setSliceCursor,m,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:m._transitioning}),Z.call(s,te,P,{hovered:!1}),te._text=(d.getPtLabel(te)||"").split("
").join(" ")||"";var re=a.ensureSingle(Y,"g","slicetext"),U=a.ensureSingle(re,"text","",function($){$.attr("data-notex",1)}),q=a.ensureUniformFontSize(m,d.determineTextFont(P,te,z.font,{onPathbar:!0}));U.text(te._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(u.font,q).call(c.convertToTspans,m),te.textBB=u.bBox(U.node()),te.transform=M(te,{fontSize:q.size,onPathbar:!0}),te.transform.fontSize=q.size,S?U.transition().attrTween("transform",function($){var ne=O($,!0,R,[w,k]);return function(H){return A(ne(H))}}):U.attr("transform",A(te))})}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../sunburst/fx":1054,"../sunburst/helpers":1055,"./constants":1078,"./partition":1087,"./style":1090,"@plotly/d3":58}],1082:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=e("../../components/drawing"),c=e("../../lib/svg_text_utils"),i=e("./partition"),s=e("./style").styleOne,l=e("./constants"),d=e("../sunburst/helpers"),h=e("../sunburst/fx"),m=e("../sunburst/plot").formatSliceLabel;o.exports=function(g,p,v,y,x){var w=x.width,k=x.height,b=x.viewX,T=x.viewY,_=x.pathSlice,M=x.toMoveInsideSlice,A=x.strTransform,S=x.hasTransition,E=x.handleSlicesExit,D=x.makeUpdateSliceInterpolator,O=x.makeUpdateTextInterpolator,R=x.prevEntry,z=g._fullLayout,L=p[0].trace,P=L.textposition.indexOf("left")!==-1,N=L.textposition.indexOf("right")!==-1,B=L.textposition.indexOf("bottom")!==-1,G=!B&&!L.marker.pad.t||B&&!L.marker.pad.b,W=i(v,[w,k],{packing:L.tiling.packing,squarifyratio:L.tiling.squarifyratio,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1,pad:{inner:L.tiling.pad,top:L.marker.pad.t,left:L.marker.pad.l,right:L.marker.pad.r,bottom:L.marker.pad.b}}).descendants(),K=1/0,te=-1/0;W.forEach(function(q){var $=q.depth;$>=L._maxDepth?(q.x0=q.x1=(q.x0+q.x1)/2,q.y0=q.y1=(q.y0+q.y1)/2):(K=Math.min(K,$),te=Math.max(te,$))}),y=y.data(W,d.getPtId),L._maxVisibleLayers=isFinite(te)?te-K+1:0,y.enter().append("g").classed("slice",!0),E(y,!1,{},[w,k],_),y.order();var Y=null;if(S&&R){var Z=d.getPtId(R);y.each(function(q){Y===null&&d.getPtId(q)===Z&&(Y={x0:q.x0,x1:q.x1,y0:q.y0,y1:q.y1})})}var re=function(){return Y||{x0:0,x1:w,y0:0,y1:k}},U=y;return S&&(U=U.transition().each("end",function(){var q=r.select(this);d.setSliceCursor(q,g,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),U.each(function(q){var $=d.isHeader(q,L);q._x0=b(q.x0),q._x1=b(q.x1),q._y0=T(q.y0),q._y1=T(q.y1),q._hoverX=b(q.x1-L.marker.pad.r),q._hoverY=T(B?q.y1-L.marker.pad.b/2:q.y0+L.marker.pad.t/2);var ne=r.select(this),H=a.ensureSingle(ne,"path","surface",function(ae){ae.style("pointer-events","all")});S?H.transition().attrTween("d",function(ae){var ue=D(ae,!1,re(),[w,k]);return function(le){return _(ue(le))}}):H.attr("d",_),ne.call(h,v,g,p,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(d.setSliceCursor,g,{isTransitioning:g._transitioning}),H.call(s,q,L,{hovered:!1}),q.x0===q.x1||q.y0===q.y1?q._text="":q._text=$?G?"":d.getPtLabel(q)||"":m(q,v,L,p,z)||"";var Q=a.ensureSingle(ne,"g","slicetext"),ee=a.ensureSingle(Q,"text","",function(ae){ae.attr("data-notex",1)}),ie=a.ensureUniformFontSize(g,d.determineTextFont(L,q,z.font));ee.text(q._text||" ").classed("slicetext",!0).attr("text-anchor",N?"end":P||$?"start":"middle").call(u.font,ie).call(c.convertToTspans,g),q.textBB=u.bBox(ee.node()),q.transform=M(q,{fontSize:ie.size,isHeader:$}),q.transform.fontSize=ie.size,S?ee.transition().attrTween("transform",function(ae){var ue=O(ae,!1,re(),[w,k]);return function(le){return A(ue(le))}}):ee.attr("transform",A(q))}),Y}},{"../../components/drawing":388,"../../lib":503,"../../lib/svg_text_utils":529,"../sunburst/fx":1054,"../sunburst/helpers":1055,"../sunburst/plot":1059,"./constants":1078,"./partition":1087,"./style":1090,"@plotly/d3":58}],1083:[function(e,o,f){o.exports=function r(a,u,c){var i;c.swapXY&&(i=a.x0,a.x0=a.y0,a.y0=i,i=a.x1,a.x1=a.y1,a.y1=i),c.flipX&&(i=a.x0,a.x0=u[0]-a.x1,a.x1=u[0]-i),c.flipY&&(i=a.y0,a.y0=u[1]-a.y1,a.y1=u[1]-i);var s=a.children;if(s)for(var l=0;l-1?N+W:-(G+W):0,te={x0:B,x1:B,y0:K,y1:K+G},Y=function(Ee,ze,Fe){var Ve=b.tiling.pad,Ke=function(Ye){return Ye-Ve<=ze.x0},Re=function(Ye){return Ye+Ve>=ze.x1},qe=function(Ye){return Ye-Ve<=ze.y0},We=function(Ye){return Ye+Ve>=ze.y1};return Ee.x0===ze.x0&&Ee.x1===ze.x1&&Ee.y0===ze.y0&&Ee.y1===ze.y1?{x0:Ee.x0,x1:Ee.x1,y0:Ee.y0,y1:Ee.y1}:{x0:Ke(Ee.x0-Ve)?0:Re(Ee.x0-Ve)?Fe[0]:Ee.x0,x1:Ke(Ee.x1+Ve)?0:Re(Ee.x1+Ve)?Fe[0]:Ee.x1,y0:qe(Ee.y0-Ve)?0:We(Ee.y0-Ve)?Fe[1]:Ee.y0,y1:qe(Ee.y1+Ve)?0:We(Ee.y1+Ve)?Fe[1]:Ee.y1}},Z=null,re={},U={},q=null,$=function(Ee,ze){return ze?re[m(Ee)]:U[m(Ee)]},ne=function(Ee,ze,Fe,Ve){if(ze)return re[m(_)]||te;var Ke=U[b.level]||Fe;return function(Re){return Re.data.depth-M.data.depth=(Ve-=(T?Pt:Pt.r)-i)){var At=(Fe+Ve)/2;Fe=At,Ve=At}var at;Ye?Ke<(at=Re-(T?Pt:Pt.b))&&at"?(Ye.x-=Re,nt.x-=Re,ft.x-=Re,vt.x-=Re):we==="/"?(ft.x-=Re,vt.x-=Re,qe.x-=Re/2,We.x-=Re/2):we==="\\"?(Ye.x-=Re,nt.x-=Re,qe.x-=Re/2,We.x-=Re/2):we==="<"&&(qe.x-=Re,We.x-=Re),_e(Ye),_e(vt),_e(qe),_e(nt),_e(ft),_e(We),"M"+fe(Ye.x,Ye.y)+"L"+fe(nt.x,nt.y)+"L"+fe(We.x,We.y)+"L"+fe(ft.x,ft.y)+"L"+fe(vt.x,vt.y)+"L"+fe(qe.x,qe.y)+"Z"},toMoveInsideSlice:Te,makeUpdateSliceInterpolator:de,makeUpdateTextInterpolator:ye,handleSlicesExit:Me,hasTransition:O,strTransform:ke}):S.remove()}},{"../../lib":503,"../bar/constants":650,"../bar/plot":659,"../bar/uniform_text":664,"../sunburst/helpers":1055,"./constants":1078,"./draw_ancestors":1081,"@plotly/d3":58,"d3-interpolate":116}],1090:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../components/color"),u=e("../../lib"),c=e("../sunburst/helpers"),i=e("../bar/uniform_text").resizeText;function s(l,d,h,m){var g,p,v=(m||{}).hovered,y=d.data.data,x=y.i,w=y.color,k=c.isHierarchyRoot(d),b=1;if(v)g=h._hovered.marker.line.color,p=h._hovered.marker.line.width;else if(k&&w===h.root.color)b=100,g="rgba(0,0,0,0)",p=0;else if(g=u.castOption(h,x,"marker.line.color")||a.defaultLine,p=u.castOption(h,x,"marker.line.width")||0,!h._hasColorscale&&!d.onPathbar){var T=h.marker.depthfade;if(T){var _,M=a.combine(a.addOpacity(h._backgroundColor,.75),w);if(T===!0){var A=c.getMaxDepth(h);_=isFinite(A)?c.isLeaf(d)?0:h._maxVisibleLayers-(d.data.depth-h._entryDepth):d.data.height+1}else _=d.data.depth-h._entryDepth,h._atRootLevel||_++;if(_>0)for(var S=0;S<_;S++){var E=.5*S/_;w=a.combine(a.addOpacity(M,E),w)}}}l.style("stroke-width",p).call(a.fill,w).call(a.stroke,g).style("opacity",b)}o.exports={style:function(l){var d=l._fullLayout._treemaplayer.selectAll(".trace");i(l,d,"treemap"),d.each(function(h){var m=r.select(this),g=h[0].trace;m.style("opacity",g.opacity),m.selectAll("path.surface").each(function(p){r.select(this).call(s,p,g,{hovered:!1})})})},styleOne:s}},{"../../components/color":366,"../../lib":503,"../bar/uniform_text":664,"../sunburst/helpers":1055,"@plotly/d3":58}],1091:[function(e,o,f){var r=e("../box/attributes"),a=e("../../lib/extend").extendFlat,u=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat;o.exports={y:r.y,x:r.x,x0:r.x0,y0:r.y0,xhoverformat:u("x"),yhoverformat:u("y"),name:a({},r.name,{}),orientation:a({},r.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:r.fillcolor,points:a({},r.boxpoints,{}),jitter:a({},r.jitter,{}),pointpos:a({},r.pointpos,{}),width:a({},r.width,{}),marker:r.marker,text:r.text,hovertext:r.hovertext,hovertemplate:r.hovertemplate,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:r.selected,unselected:r.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":493,"../../plots/cartesian/axis_format_attributes":557,"../box/attributes":673}],1092:[function(e,o,f){var r=e("../../lib"),a=e("../../plots/cartesian/axes"),u=e("../box/calc"),c=e("./helpers"),i=e("../../constants/numerical").BADNUM;function s(d,h,m){var g=h.max-h.min;if(!g)return d.bandwidth?d.bandwidth:0;if(d.bandwidth)return Math.max(d.bandwidth,g/1e4);var p=m.length,v=r.stdev(m,p-1,h.mean);return Math.max(function(y,x,w){return 1.059*Math.min(x,w/1.349)*Math.pow(y,-.2)}(p,v,h.q3-h.q1),g/100)}function l(d,h,m,g){var p,v=d.spanmode,y=d.span||[],x=[h.min,h.max],w=[h.min-2*g,h.max+2*g];function k(T){var _=y[T],M=m.type==="multicategory"?m.r2c(_):m.d2c(_,0,d[h.valLetter+"calendar"]);return M===i?w[T]:M}var b={type:"linear",range:p=v==="soft"?w:v==="hard"?x:[k(0),k(1)]};return a.setConvert(b),b.cleanRange(),p}o.exports=function(d,h){var m=u(d,h);if(m[0].t.empty)return m;for(var g=d._fullLayout,p=a.getFromId(d,h[h.orientation==="h"?"xaxis":"yaxis"]),v=1/0,y=-1/0,x=0,w=0,k=0;k0){var _,M,A,S,E,D=i.xa,O=i.ya;y.orientation==="h"?(E=s,_="y",A=O,M="x",S=D):(E=l,_="x",A=D,M="y",S=O);var R=v[i.index];if(E>=R.span[0]&&E<=R.span[1]){var z=r.extendFlat({},i),L=S.c2p(E,!0),P=c.getKdeValue(R,y,E),N=c.getPositionOnKdePath(R,y,L),B=A._offset,G=A._length;z[_+"0"]=N[0],z[_+"1"]=N[1],z[M+"0"]=z[M+"1"]=L,z[M+"Label"]=M+": "+a.hoverLabelText(S,E,y[M+"hoverformat"])+", "+v[0].t.labels.kde+" "+P.toFixed(3),z.spikeDistance=T[0].spikeDistance;var W=_+"Spike";z[W]=T[0][W],T[0].spikeDistance=void 0,T[0][W]=void 0,z.hovertemplate=!1,b.push(z),(g={stroke:i.color})[_+"1"]=r.constrain(B+N[0],B,B+G),g[_+"2"]=r.constrain(B+N[1],B,B+G),g[M+"1"]=g[M+"2"]=S._offset+L}}w&&(b=b.concat(T))}x.indexOf("points")!==-1&&(m=u.hoverOnPoints(i,s,l));var K=p.selectAll(".violinline-"+y.uid).data(g?[0]:[]);return K.enter().append("line").classed("violinline-"+y.uid,!0).attr("stroke-width",1.5),K.exit().remove(),K.attr(g),d==="closest"?m?[m]:b:(m&&b.push(m),b)}},{"../../lib":503,"../../plots/cartesian/axes":554,"../box/hover":678,"./helpers":1095}],1097:[function(e,o,f){o.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../box/select"),moduleType:"trace",name:"violin",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"../box/defaults":676,"../box/select":683,"../scatter/style":951,"./attributes":1091,"./calc":1092,"./cross_trace_calc":1093,"./defaults":1094,"./hover":1096,"./layout_attributes":1098,"./layout_defaults":1099,"./plot":1100,"./style":1101}],1098:[function(e,o,f){var r=e("../box/layout_attributes"),a=e("../../lib").extendFlat;o.exports={violinmode:a({},r.boxmode,{}),violingap:a({},r.boxgap,{}),violingroupgap:a({},r.boxgroupgap,{})}},{"../../lib":503,"../box/layout_attributes":680}],1099:[function(e,o,f){var r=e("../../lib"),a=e("./layout_attributes"),u=e("../box/layout_defaults");o.exports=function(c,i,s){u._supply(c,i,s,function(l,d){return r.coerce(c,i,a,l,d)},"violin")}},{"../../lib":503,"../box/layout_defaults":681,"./layout_attributes":1098}],1100:[function(e,o,f){var r=e("@plotly/d3"),a=e("../../lib"),u=e("../../components/drawing"),c=e("../box/plot"),i=e("../scatter/line_points"),s=e("./helpers");o.exports=function(l,d,h,m){var g=l._fullLayout,p=d.xaxis,v=d.yaxis;function y(x){var w=i(x,{xaxis:p,yaxis:v,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return u.smoothopen(w[0],1)}a.makeTraceGroups(m,h,"trace violins").each(function(x){var w=r.select(this),k=x[0],b=k.t,T=k.trace;if(T.visible!==!0||b.empty)w.remove();else{var _=b.bPos,M=b.bdPos,A=d[b.valLetter+"axis"],S=d[b.posLetter+"axis"],E=T.side==="both",D=E||T.side==="positive",O=E||T.side==="negative",R=w.selectAll("path.violin").data(a.identity);R.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),R.exit().remove(),R.each(function(K){var te,Y,Z,re,U,q,$,ne,H=r.select(this),Q=K.density,ee=Q.length,ie=S.c2l(K.pos+_,!0),ae=S.l2p(ie);if(T.width)te=b.maxKDE/M;else{var ue=g._violinScaleGroupStats[T.scalegroup];te=T.scalemode==="count"?ue.maxKDE/M*(ue.maxCount/K.pts.length):ue.maxKDE/M}if(D){for($=new Array(ee),U=0;U")),p.color=function(R,z){var L=R[z.dir].marker,P=L.color,N=L.line.color,B=L.line.width;if(a(P))return P;if(a(N)&&B)return N}(y,b),[p]}function O(R){return r(k,R,y[w+"hoverformat"])}}},{"../../components/color":366,"../../constants/delta.js":473,"../../plots/cartesian/axes":554,"../bar/hover":655}],1113:[function(e,o,f){o.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":568,"../bar/select":660,"./attributes":1106,"./calc":1107,"./cross_trace_calc":1109,"./defaults":1110,"./event_data":1111,"./hover":1112,"./layout_attributes":1114,"./layout_defaults":1115,"./plot":1116,"./style":1117}],1114:[function(e,o,f){o.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"}}},{}],1115:[function(e,o,f){var r=e("../../lib"),a=e("./layout_attributes");o.exports=function(u,c,i){var s=!1;function l(m,g){return r.coerce(u,c,a,m,g)}for(var d=0;d0&&(N+=A?"M"+L[0]+","+P[1]+"V"+P[0]:"M"+L[1]+","+P[0]+"H"+L[0]),S!=="between"&&(O.isSum||R path").each(function(x){if(!x.isBlank){var w=y[x.dir].marker;r.select(this).call(u.fill,w.color).call(u.stroke,w.line.color).call(a.dashLine,w.line.dash,w.line.width).style("opacity",y.selectedpoints&&!x.selected?c:1)}}),l(v,y,d),v.selectAll(".lines").each(function(){var x=y.connector.line;a.lineGroupStyle(r.select(this).selectAll("path"),x.width,x.color,x.dash)})})}}},{"../../components/color":366,"../../components/drawing":388,"../../constants/interactions":478,"../bar/style":662,"../bar/uniform_text":664,"@plotly/d3":58}],1118:[function(e,o,f){var r=e("../plots/cartesian/axes"),a=e("../lib"),u=e("../plot_api/plot_schema"),c=e("./helpers").pointsAccessorFunction,i=e("../constants/numerical").BADNUM;f.moduleType="transform",f.name="aggregate";var s=f.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"},l=s.aggregations;function d(p,v,y,x){if(x.enabled){for(var w=x.target,k=a.nestedProperty(v,w),b=k.get(),T=function(A,S){var E=A.func,D=S.d2c,O=S.c2d;switch(E){case"count":return h;case"first":return m;case"last":return g;case"sum":return function(R,z){for(var L=0,P=0;PP&&(P=W,N=G)}}return P?O(N):i};case"rms":return function(R,z){for(var L=0,P=0,N=0;N":return function(Z){return Y(Z)>K};case">=":return function(Z){return Y(Z)>=K};case"[]":return function(Z){var re=Y(Z);return re>=K[0]&&re<=K[1]};case"()":return function(Z){var re=Y(Z);return re>K[0]&&re=K[0]&&reK[0]&&re<=K[1]};case"][":return function(Z){var re=Y(Z);return re<=K[0]||re>=K[1]};case")(":return function(Z){var re=Y(Z);return reK[1]};case"](":return function(Z){var re=Y(Z);return re<=K[0]||re>K[1]};case")[":return function(Z){var re=Y(Z);return re=K[1]};case"{}":return function(Z){return K.indexOf(Y(Z))!==-1};case"}{":return function(Z){return K.indexOf(Y(Z))===-1}}}(g,u.getDataToCoordFunc(h,m,v,p),x),A={},S={},E=0;k?(T=function(z){A[z.astr]=r.extendDeep([],z.get()),z.set(new Array(y))},_=function(z,L){var P=A[z.astr][L];z.get()[L]=P}):(T=function(z){A[z.astr]=r.extendDeep([],z.get()),z.set([])},_=function(z,L){var P=A[z.astr][L];z.get().push(P)}),R(T);for(var D=c(m.transforms,g),O=0;O1?"%{group} (%{trace})":"%{group}");var p=s.styles,v=m.styles=[];if(p)for(h=0;h0?k-4:k;for(x=0;x>16&255,T[_++]=y>>8&255,T[_++]=255&y;return b===2&&(y=s[v.charCodeAt(x)]<<2|s[v.charCodeAt(x+1)]>>4,T[_++]=255&y),b===1&&(y=s[v.charCodeAt(x)]<<10|s[v.charCodeAt(x+1)]<<4|s[v.charCodeAt(x+2)]>>2,T[_++]=y>>8&255,T[_++]=255&y),T},c.fromByteArray=function(v){for(var y,x=v.length,w=x%3,k=[],b=0,T=x-w;bT?T:b+16383));return w===1?(y=v[x-1],k.push(i[y>>2]+i[y<<4&63]+"==")):w===2&&(y=(v[x-2]<<8)+v[x-1],k.push(i[y>>10]+i[y>>4&63]+i[y<<2&63]+"=")),k.join("")};for(var i=[],s=[],l=typeof Uint8Array<"u"?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,m=d.length;h0)throw new Error("Invalid string. Length must be a multiple of 4");var x=v.indexOf("=");return x===-1&&(x=y),[x,x===y?0:4-x%4]}function p(v,y,x){for(var w,k,b=[],T=y;T>18&63]+i[k>>12&63]+i[k>>6&63]+i[63&k]);return b.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],2:[function(a,u,c){},{}],3:[function(a,u,c){(function(i){(function(){var s=a("base64-js"),l=a("ieee754");c.Buffer=h,c.SlowBuffer=function(H){return+H!=H&&(H=0),h.alloc(+H)},c.INSPECT_MAX_BYTES=50;function d(H){if(H>2147483647)throw new RangeError('The value "'+H+'" is invalid for option "size"');var Q=new Uint8Array(H);return Q.__proto__=h.prototype,Q}function h(H,Q,ee){if(typeof H=="number"){if(typeof Q=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(H)}return m(H,Q,ee)}function m(H,Q,ee){if(typeof H=="string")return function(ue,le){if(typeof le=="string"&&le!==""||(le="utf8"),!h.isEncoding(le))throw new TypeError("Unknown encoding: "+le);var ge=0|x(ue,le),fe=d(ge),me=fe.write(ue,le);return me!==ge&&(fe=fe.slice(0,me)),fe}(H,Q);if(ArrayBuffer.isView(H))return v(H);if(H==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof H);if($(H,ArrayBuffer)||H&&$(H.buffer,ArrayBuffer))return function(ue,le,ge){if(le<0||ue.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|H}function x(H,Q){if(h.isBuffer(H))return H.length;if(ArrayBuffer.isView(H)||$(H,ArrayBuffer))return H.byteLength;if(typeof H!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof H);var ee=H.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&ee===0)return 0;for(var ae=!1;;)switch(Q){case"ascii":case"latin1":case"binary":return ee;case"utf8":case"utf-8":return re(H).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*ee;case"hex":return ee>>>1;case"base64":return U(H).length;default:if(ae)return ie?-1:re(H).length;Q=(""+Q).toLowerCase(),ae=!0}}function w(H,Q,ee){var ie=!1;if((Q===void 0||Q<0)&&(Q=0),Q>this.length||((ee===void 0||ee>this.length)&&(ee=this.length),ee<=0)||(ee>>>=0)<=(Q>>>=0))return"";for(H||(H="utf8");;)switch(H){case"hex":return P(this,Q,ee);case"utf8":case"utf-8":return R(this,Q,ee);case"ascii":return z(this,Q,ee);case"latin1":case"binary":return L(this,Q,ee);case"base64":return O(this,Q,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,Q,ee);default:if(ie)throw new TypeError("Unknown encoding: "+H);H=(H+"").toLowerCase(),ie=!0}}function k(H,Q,ee){var ie=H[Q];H[Q]=H[ee],H[ee]=ie}function b(H,Q,ee,ie,ae){if(H.length===0)return-1;if(typeof ee=="string"?(ie=ee,ee=0):ee>2147483647?ee=2147483647:ee<-2147483648&&(ee=-2147483648),ne(ee=+ee)&&(ee=ae?0:H.length-1),ee<0&&(ee=H.length+ee),ee>=H.length){if(ae)return-1;ee=H.length-1}else if(ee<0){if(!ae)return-1;ee=0}if(typeof Q=="string"&&(Q=h.from(Q,ie)),h.isBuffer(Q))return Q.length===0?-1:T(H,Q,ee,ie,ae);if(typeof Q=="number")return Q&=255,typeof Uint8Array.prototype.indexOf=="function"?ae?Uint8Array.prototype.indexOf.call(H,Q,ee):Uint8Array.prototype.lastIndexOf.call(H,Q,ee):T(H,[Q],ee,ie,ae);throw new TypeError("val must be string, number or Buffer")}function T(H,Q,ee,ie,ae){var ue,le=1,ge=H.length,fe=Q.length;if(ie!==void 0&&((ie=String(ie).toLowerCase())==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(H.length<2||Q.length<2)return-1;le=2,ge/=2,fe/=2,ee/=2}function me(Oe,de){return le===1?Oe[de]:Oe.readUInt16BE(de*le)}if(ae){var _e=-1;for(ue=ee;uege&&(ee=ge-fe),ue=ee;ue>=0;ue--){for(var we=!0,Te=0;Teae&&(ie=ae):ie=ae;var ue=Q.length;ie>ue/2&&(ie=ue/2);for(var le=0;le>8,fe=le%256,me.push(fe),me.push(ge);return me}(Q,H.length-ee),H,ee,ie)}function O(H,Q,ee){return Q===0&&ee===H.length?s.fromByteArray(H):s.fromByteArray(H.slice(Q,ee))}function R(H,Q,ee){ee=Math.min(H.length,ee);for(var ie=[],ae=Q;ae239?4:me>223?3:me>191?2:1;if(ae+we<=ee)switch(we){case 1:me<128&&(_e=me);break;case 2:(192&(ue=H[ae+1]))==128&&(fe=(31&me)<<6|63&ue)>127&&(_e=fe);break;case 3:ue=H[ae+1],le=H[ae+2],(192&ue)==128&&(192&le)==128&&(fe=(15&me)<<12|(63&ue)<<6|63&le)>2047&&(fe<55296||fe>57343)&&(_e=fe);break;case 4:ue=H[ae+1],le=H[ae+2],ge=H[ae+3],(192&ue)==128&&(192&le)==128&&(192&ge)==128&&(fe=(15&me)<<18|(63&ue)<<12|(63&le)<<6|63&ge)>65535&&fe<1114112&&(_e=fe)}_e===null?(_e=65533,we=1):_e>65535&&(_e-=65536,ie.push(_e>>>10&1023|55296),_e=56320|1023&_e),ie.push(_e),ae+=we}return function(Te){var Oe=Te.length;if(Oe<=4096)return String.fromCharCode.apply(String,Te);for(var de="",ye=0;ye"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),h.poolSize=8192,h.from=function(H,Q,ee){return m(H,Q,ee)},h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,h.alloc=function(H,Q,ee){return function(ie,ae,ue){return g(ie),ie<=0?d(ie):ae!==void 0?typeof ue=="string"?d(ie).fill(ae,ue):d(ie).fill(ae):d(ie)}(H,Q,ee)},h.allocUnsafe=function(H){return p(H)},h.allocUnsafeSlow=function(H){return p(H)},h.isBuffer=function(H){return H!=null&&H._isBuffer===!0&&H!==h.prototype},h.compare=function(H,Q){if($(H,Uint8Array)&&(H=h.from(H,H.offset,H.byteLength)),$(Q,Uint8Array)&&(Q=h.from(Q,Q.offset,Q.byteLength)),!h.isBuffer(H)||!h.isBuffer(Q))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(H===Q)return 0;for(var ee=H.length,ie=Q.length,ae=0,ue=Math.min(ee,ie);aeQ&&(H+=" ... "),""},h.prototype.compare=function(H,Q,ee,ie,ae){if($(H,Uint8Array)&&(H=h.from(H,H.offset,H.byteLength)),!h.isBuffer(H))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof H);if(Q===void 0&&(Q=0),ee===void 0&&(ee=H?H.length:0),ie===void 0&&(ie=0),ae===void 0&&(ae=this.length),Q<0||ee>H.length||ie<0||ae>this.length)throw new RangeError("out of range index");if(ie>=ae&&Q>=ee)return 0;if(ie>=ae)return-1;if(Q>=ee)return 1;if(this===H)return 0;for(var ue=(ae>>>=0)-(ie>>>=0),le=(ee>>>=0)-(Q>>>=0),ge=Math.min(ue,le),fe=this.slice(ie,ae),me=H.slice(Q,ee),_e=0;_e>>=0,isFinite(ee)?(ee>>>=0,ie===void 0&&(ie="utf8")):(ie=ee,ee=void 0)}var ae=this.length-Q;if((ee===void 0||ee>ae)&&(ee=ae),H.length>0&&(ee<0||Q<0)||Q>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");for(var ue=!1;;)switch(ie){case"hex":return _(this,H,Q,ee);case"utf8":case"utf-8":return M(this,H,Q,ee);case"ascii":return A(this,H,Q,ee);case"latin1":case"binary":return S(this,H,Q,ee);case"base64":return E(this,H,Q,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,H,Q,ee);default:if(ue)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),ue=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function z(H,Q,ee){var ie="";ee=Math.min(H.length,ee);for(var ae=Q;aeie)&&(ee=ie);for(var ae="",ue=Q;ueee)throw new RangeError("Trying to access beyond buffer length")}function G(H,Q,ee,ie,ae,ue){if(!h.isBuffer(H))throw new TypeError('"buffer" argument must be a Buffer instance');if(Q>ae||QH.length)throw new RangeError("Index out of range")}function W(H,Q,ee,ie,ae,ue){if(ee+ie>H.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("Index out of range")}function K(H,Q,ee,ie,ae){return Q=+Q,ee>>>=0,ae||W(H,0,ee,4),l.write(H,Q,ee,ie,23,4),ee+4}function te(H,Q,ee,ie,ae){return Q=+Q,ee>>>=0,ae||W(H,0,ee,8),l.write(H,Q,ee,ie,52,8),ee+8}h.prototype.slice=function(H,Q){var ee=this.length;(H=~~H)<0?(H+=ee)<0&&(H=0):H>ee&&(H=ee),(Q=Q===void 0?ee:~~Q)<0?(Q+=ee)<0&&(Q=0):Q>ee&&(Q=ee),Q>>=0,Q>>>=0,ee||B(H,Q,this.length);for(var ie=this[H],ae=1,ue=0;++ue>>=0,Q>>>=0,ee||B(H,Q,this.length);for(var ie=this[H+--Q],ae=1;Q>0&&(ae*=256);)ie+=this[H+--Q]*ae;return ie},h.prototype.readUInt8=function(H,Q){return H>>>=0,Q||B(H,1,this.length),this[H]},h.prototype.readUInt16LE=function(H,Q){return H>>>=0,Q||B(H,2,this.length),this[H]|this[H+1]<<8},h.prototype.readUInt16BE=function(H,Q){return H>>>=0,Q||B(H,2,this.length),this[H]<<8|this[H+1]},h.prototype.readUInt32LE=function(H,Q){return H>>>=0,Q||B(H,4,this.length),(this[H]|this[H+1]<<8|this[H+2]<<16)+16777216*this[H+3]},h.prototype.readUInt32BE=function(H,Q){return H>>>=0,Q||B(H,4,this.length),16777216*this[H]+(this[H+1]<<16|this[H+2]<<8|this[H+3])},h.prototype.readIntLE=function(H,Q,ee){H>>>=0,Q>>>=0,ee||B(H,Q,this.length);for(var ie=this[H],ae=1,ue=0;++ue=(ae*=128)&&(ie-=Math.pow(2,8*Q)),ie},h.prototype.readIntBE=function(H,Q,ee){H>>>=0,Q>>>=0,ee||B(H,Q,this.length);for(var ie=Q,ae=1,ue=this[H+--ie];ie>0&&(ae*=256);)ue+=this[H+--ie]*ae;return ue>=(ae*=128)&&(ue-=Math.pow(2,8*Q)),ue},h.prototype.readInt8=function(H,Q){return H>>>=0,Q||B(H,1,this.length),128&this[H]?-1*(255-this[H]+1):this[H]},h.prototype.readInt16LE=function(H,Q){H>>>=0,Q||B(H,2,this.length);var ee=this[H]|this[H+1]<<8;return 32768&ee?4294901760|ee:ee},h.prototype.readInt16BE=function(H,Q){H>>>=0,Q||B(H,2,this.length);var ee=this[H+1]|this[H]<<8;return 32768&ee?4294901760|ee:ee},h.prototype.readInt32LE=function(H,Q){return H>>>=0,Q||B(H,4,this.length),this[H]|this[H+1]<<8|this[H+2]<<16|this[H+3]<<24},h.prototype.readInt32BE=function(H,Q){return H>>>=0,Q||B(H,4,this.length),this[H]<<24|this[H+1]<<16|this[H+2]<<8|this[H+3]},h.prototype.readFloatLE=function(H,Q){return H>>>=0,Q||B(H,4,this.length),l.read(this,H,!0,23,4)},h.prototype.readFloatBE=function(H,Q){return H>>>=0,Q||B(H,4,this.length),l.read(this,H,!1,23,4)},h.prototype.readDoubleLE=function(H,Q){return H>>>=0,Q||B(H,8,this.length),l.read(this,H,!0,52,8)},h.prototype.readDoubleBE=function(H,Q){return H>>>=0,Q||B(H,8,this.length),l.read(this,H,!1,52,8)},h.prototype.writeUIntLE=function(H,Q,ee,ie){H=+H,Q>>>=0,ee>>>=0,ie||G(this,H,Q,ee,Math.pow(2,8*ee)-1,0);var ae=1,ue=0;for(this[Q]=255&H;++ue>>=0,ee>>>=0,ie||G(this,H,Q,ee,Math.pow(2,8*ee)-1,0);var ae=ee-1,ue=1;for(this[Q+ae]=255&H;--ae>=0&&(ue*=256);)this[Q+ae]=H/ue&255;return Q+ee},h.prototype.writeUInt8=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,1,255,0),this[Q]=255&H,Q+1},h.prototype.writeUInt16LE=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,2,65535,0),this[Q]=255&H,this[Q+1]=H>>>8,Q+2},h.prototype.writeUInt16BE=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,2,65535,0),this[Q]=H>>>8,this[Q+1]=255&H,Q+2},h.prototype.writeUInt32LE=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,4,4294967295,0),this[Q+3]=H>>>24,this[Q+2]=H>>>16,this[Q+1]=H>>>8,this[Q]=255&H,Q+4},h.prototype.writeUInt32BE=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,4,4294967295,0),this[Q]=H>>>24,this[Q+1]=H>>>16,this[Q+2]=H>>>8,this[Q+3]=255&H,Q+4},h.prototype.writeIntLE=function(H,Q,ee,ie){if(H=+H,Q>>>=0,!ie){var ae=Math.pow(2,8*ee-1);G(this,H,Q,ee,ae-1,-ae)}var ue=0,le=1,ge=0;for(this[Q]=255&H;++ue>0)-ge&255;return Q+ee},h.prototype.writeIntBE=function(H,Q,ee,ie){if(H=+H,Q>>>=0,!ie){var ae=Math.pow(2,8*ee-1);G(this,H,Q,ee,ae-1,-ae)}var ue=ee-1,le=1,ge=0;for(this[Q+ue]=255&H;--ue>=0&&(le*=256);)H<0&&ge===0&&this[Q+ue+1]!==0&&(ge=1),this[Q+ue]=(H/le>>0)-ge&255;return Q+ee},h.prototype.writeInt8=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,1,127,-128),H<0&&(H=255+H+1),this[Q]=255&H,Q+1},h.prototype.writeInt16LE=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,2,32767,-32768),this[Q]=255&H,this[Q+1]=H>>>8,Q+2},h.prototype.writeInt16BE=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,2,32767,-32768),this[Q]=H>>>8,this[Q+1]=255&H,Q+2},h.prototype.writeInt32LE=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,4,2147483647,-2147483648),this[Q]=255&H,this[Q+1]=H>>>8,this[Q+2]=H>>>16,this[Q+3]=H>>>24,Q+4},h.prototype.writeInt32BE=function(H,Q,ee){return H=+H,Q>>>=0,ee||G(this,H,Q,4,2147483647,-2147483648),H<0&&(H=4294967295+H+1),this[Q]=H>>>24,this[Q+1]=H>>>16,this[Q+2]=H>>>8,this[Q+3]=255&H,Q+4},h.prototype.writeFloatLE=function(H,Q,ee){return K(this,H,Q,!0,ee)},h.prototype.writeFloatBE=function(H,Q,ee){return K(this,H,Q,!1,ee)},h.prototype.writeDoubleLE=function(H,Q,ee){return te(this,H,Q,!0,ee)},h.prototype.writeDoubleBE=function(H,Q,ee){return te(this,H,Q,!1,ee)},h.prototype.copy=function(H,Q,ee,ie){if(!h.isBuffer(H))throw new TypeError("argument should be a Buffer");if(ee||(ee=0),ie||ie===0||(ie=this.length),Q>=H.length&&(Q=H.length),Q||(Q=0),ie>0&&ie=this.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("sourceEnd out of bounds");ie>this.length&&(ie=this.length),H.length-Q=0;--ue)H[ue+Q]=this[ue+ee];else Uint8Array.prototype.set.call(H,this.subarray(ee,ie),Q);return ae},h.prototype.fill=function(H,Q,ee,ie){if(typeof H=="string"){if(typeof Q=="string"?(ie=Q,Q=0,ee=this.length):typeof ee=="string"&&(ie=ee,ee=this.length),ie!==void 0&&typeof ie!="string")throw new TypeError("encoding must be a string");if(typeof ie=="string"&&!h.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);if(H.length===1){var ae=H.charCodeAt(0);(ie==="utf8"&&ae<128||ie==="latin1")&&(H=ae)}}else typeof H=="number"&&(H&=255);if(Q<0||this.length>>=0,ee=ee===void 0?this.length:ee>>>0,H||(H=0),typeof H=="number")for(ue=Q;ue55295&&ee<57344){if(!ae){if(ee>56319){(Q-=3)>-1&&ue.push(239,191,189);continue}if(le+1===ie){(Q-=3)>-1&&ue.push(239,191,189);continue}ae=ee;continue}if(ee<56320){(Q-=3)>-1&&ue.push(239,191,189),ae=ee;continue}ee=65536+(ae-55296<<10|ee-56320)}else ae&&(Q-=3)>-1&&ue.push(239,191,189);if(ae=null,ee<128){if((Q-=1)<0)break;ue.push(ee)}else if(ee<2048){if((Q-=2)<0)break;ue.push(ee>>6|192,63&ee|128)}else if(ee<65536){if((Q-=3)<0)break;ue.push(ee>>12|224,ee>>6&63|128,63&ee|128)}else{if(!(ee<1114112))throw new Error("Invalid code point");if((Q-=4)<0)break;ue.push(ee>>18|240,ee>>12&63|128,ee>>6&63|128,63&ee|128)}}return ue}function U(H){return s.toByteArray(function(Q){if((Q=(Q=Q.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;Q.length%4!=0;)Q+="=";return Q}(H))}function q(H,Q,ee,ie){for(var ae=0;ae=Q.length||ae>=H.length);++ae)Q[ae+ee]=H[ae];return ae}function $(H,Q){return H instanceof Q||H!=null&&H.constructor!=null&&H.constructor.name!=null&&H.constructor.name===Q.name}function ne(H){return H!=H}}).call(this)}).call(this,a("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:4}],4:[function(a,u,c){c.read=function(i,s,l,d,h){var m,g,p=8*h-d-1,v=(1<>1,x=-7,w=l?h-1:0,k=l?-1:1,b=i[s+w];for(w+=k,m=b&(1<<-x)-1,b>>=-x,x+=p;x>0;m=256*m+i[s+w],w+=k,x-=8);for(g=m&(1<<-x)-1,m>>=-x,x+=d;x>0;g=256*g+i[s+w],w+=k,x-=8);if(m===0)m=1-y;else{if(m===v)return g?NaN:1/0*(b?-1:1);g+=Math.pow(2,d),m-=y}return(b?-1:1)*g*Math.pow(2,m-d)},c.write=function(i,s,l,d,h,m){var g,p,v,y=8*m-h-1,x=(1<>1,k=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=d?0:m-1,T=d?1:-1,_=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(p=isNaN(s)?1:0,g=x):(g=Math.floor(Math.log(s)/Math.LN2),s*(v=Math.pow(2,-g))<1&&(g--,v*=2),(s+=g+w>=1?k/v:k*Math.pow(2,1-w))*v>=2&&(g++,v/=2),g+w>=x?(p=0,g=x):g+w>=1?(p=(s*v-1)*Math.pow(2,h),g+=w):(p=s*Math.pow(2,w-1)*Math.pow(2,h),g=0));h>=8;i[l+b]=255&p,b+=T,p/=256,h-=8);for(g=g<0;i[l+b]=255&g,b+=T,g/=256,y-=8);i[l+b-T]|=128*_}},{}],5:[function(a,u,c){var i,s,l=u.exports={};function d(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}function m(T){if(i===setTimeout)return setTimeout(T,0);if((i===d||!i)&&setTimeout)return i=setTimeout,setTimeout(T,0);try{return i(T,0)}catch{try{return i.call(null,T,0)}catch{return i.call(this,T,0)}}}(function(){try{i=typeof setTimeout=="function"?setTimeout:d}catch{i=d}try{s=typeof clearTimeout=="function"?clearTimeout:h}catch{s=h}})();var g,p=[],v=!1,y=-1;function x(){v&&g&&(v=!1,g.length?p=g.concat(p):y=-1,p.length&&w())}function w(){if(!v){var T=m(x);v=!0;for(var _=p.length;_;){for(g=p,p=[];++y<_;)g&&g[y].run();y=-1,_=p.length}g=null,v=!1,function(M){if(s===clearTimeout)return clearTimeout(M);if((s===h||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(M);try{s(M)}catch{try{return s.call(null,M)}catch{return s.call(this,M)}}}(T)}}function k(T,_){this.fun=T,this.array=_}function b(){}l.nextTick=function(T){var _=new Array(arguments.length-1);if(arguments.length>1)for(var M=1;M"u"?a("weak-map"):WeakMap,s=a("gl-buffer"),l=a("gl-vao"),d=new i;u.exports=function(h){var m=d.get(h),g=m&&(m._triangleBuffer.handle||m._triangleBuffer.buffer);if(!g||!h.isBuffer(g)){var p=s(h,new Float32Array([-1,-1,-1,4,4,-1]));(m=l(h,[{buffer:p,type:h.FLOAT,size:2}]))._triangleBuffer=p,d.set(h,m)}m.bind(),h.drawArrays(h.TRIANGLES,0,3),m.unbind()}},{"gl-buffer":78,"gl-vao":150,"weak-map":313}],9:[function(a,u,c){var i=a("pad-left");u.exports=function(s,l,d){l=typeof l=="number"?l:1,d=d||": ";var h=s.split(/\r?\n/),m=String(h.length+l-1).length;return h.map(function(g,p){var v=p+l,y=String(v).length;return i(v,m-y)+d+g}).join(` +`)}},{"pad-left":264}],10:[function(a,u,c){u.exports=function(l){var d=l.length;if(d===0)return[];if(d===1)return[0];for(var h=l[0].length,m=[l[0]],g=[0],p=1;p0?y=y.ushln(w):w<0&&(x=x.ushln(-w)),h(y,x)}},{"./div":17,"./is-rat":19,"./lib/is-bn":23,"./lib/num-to-bn":24,"./lib/rationalize":25,"./lib/str-to-bn":26}],19:[function(a,u,c){var i=a("./lib/is-bn");u.exports=function(s){return Array.isArray(s)&&s.length===2&&i(s[0])&&i(s[1])}},{"./lib/is-bn":23}],20:[function(a,u,c){var i=a("bn.js");u.exports=function(s){return s.cmp(new i(0))}},{"bn.js":33}],21:[function(a,u,c){var i=a("./bn-sign");u.exports=function(s){var l=s.length,d=s.words,h=0;if(l===1)h=d[0];else if(l===2)h=d[0]+67108864*d[1];else for(var m=0;m20?52:h+32}},{"bit-twiddle":32,"double-bits":64}],23:[function(a,u,c){a("bn.js"),u.exports=function(i){return i&&typeof i=="object"&&Boolean(i.words)}},{"bn.js":33}],24:[function(a,u,c){var i=a("bn.js"),s=a("double-bits");u.exports=function(l){var d=s.exponent(l);return d<52?new i(l):new i(l*Math.pow(2,52-d)).ushln(d-52)}},{"bn.js":33,"double-bits":64}],25:[function(a,u,c){var i=a("./num-to-bn"),s=a("./bn-sign");u.exports=function(l,d){var h=s(l),m=s(d);if(h===0)return[i(0),i(1)];if(m===0)return[i(0),i(0)];m<0&&(l=l.neg(),d=d.neg());var g=l.gcd(d);return g.cmpn(1)?[l.div(g),d.div(g)]:[l,d]}},{"./bn-sign":20,"./num-to-bn":24}],26:[function(a,u,c){var i=a("bn.js");u.exports=function(s){return new i(s)}},{"bn.js":33}],27:[function(a,u,c){var i=a("./lib/rationalize");u.exports=function(s,l){return i(s[0].mul(l[0]),s[1].mul(l[1]))}},{"./lib/rationalize":25}],28:[function(a,u,c){var i=a("./lib/bn-sign");u.exports=function(s){return i(s[0])*i(s[1])}},{"./lib/bn-sign":20}],29:[function(a,u,c){var i=a("./lib/rationalize");u.exports=function(s,l){return i(s[0].mul(l[1]).sub(s[1].mul(l[0])),s[1].mul(l[1]))}},{"./lib/rationalize":25}],30:[function(a,u,c){var i=a("./lib/bn-to-num"),s=a("./lib/ctz");u.exports=function(l){var d=l[0],h=l[1];if(d.cmpn(0)===0)return 0;var m=d.abs().divmod(h.abs()),g=m.div,p=i(g),v=m.mod,y=d.negative!==h.negative?-1:1;if(v.cmpn(0)===0)return y*p;if(p){var x=s(p)+4,w=i(v.ushln(x).divRound(h));return y*(p+w*Math.pow(2,-x))}var k=h.bitLength()-v.bitLength()+53;return w=i(v.ushln(k).divRound(h)),k<1023?y*w*Math.pow(2,-k):(w*=Math.pow(2,-1023),y*w*Math.pow(2,1023-k))}},{"./lib/bn-to-num":21,"./lib/ctz":22}],31:[function(a,u,c){function i(g,p,v,y,x){for(var w=x+1;y<=x;){var k=y+x>>>1,b=g[k];(v!==void 0?v(b,p):b-p)>=0?(w=k,x=k-1):y=k+1}return w}function s(g,p,v,y,x){for(var w=x+1;y<=x;){var k=y+x>>>1,b=g[k];(v!==void 0?v(b,p):b-p)>0?(w=k,x=k-1):y=k+1}return w}function l(g,p,v,y,x){for(var w=y-1;y<=x;){var k=y+x>>>1,b=g[k];(v!==void 0?v(b,p):b-p)<0?(w=k,y=k+1):x=k-1}return w}function d(g,p,v,y,x){for(var w=y-1;y<=x;){var k=y+x>>>1,b=g[k];(v!==void 0?v(b,p):b-p)<=0?(w=k,y=k+1):x=k-1}return w}function h(g,p,v,y,x){for(;y<=x;){var w=y+x>>>1,k=g[w],b=v!==void 0?v(k,p):k-p;if(b===0)return w;b<=0?y=w+1:x=w-1}return-1}function m(g,p,v,y,x,w){return typeof v=="function"?w(g,p,v,y===void 0?0:0|y,x===void 0?g.length-1:0|x):w(g,p,void 0,v===void 0?0:0|v,y===void 0?g.length-1:0|y)}u.exports={ge:function(g,p,v,y,x){return m(g,p,v,y,x,i)},gt:function(g,p,v,y,x){return m(g,p,v,y,x,s)},lt:function(g,p,v,y,x){return m(g,p,v,y,x,l)},le:function(g,p,v,y,x){return m(g,p,v,y,x,d)},eq:function(g,p,v,y,x){return m(g,p,v,y,x,h)}}},{}],32:[function(a,u,c){function i(l){var d=32;return(l&=-l)&&d--,65535&l&&(d-=16),16711935&l&&(d-=8),252645135&l&&(d-=4),858993459&l&&(d-=2),1431655765&l&&(d-=1),d}c.INT_BITS=32,c.INT_MAX=2147483647,c.INT_MIN=-1<<31,c.sign=function(l){return(l>0)-(l<0)},c.abs=function(l){var d=l>>31;return(l^d)-d},c.min=function(l,d){return d^(l^d)&-(l65535)<<4,d|=h=((l>>>=d)>255)<<3,d|=h=((l>>>=h)>15)<<2,(d|=h=((l>>>=h)>3)<<1)|(l>>>=h)>>1},c.log10=function(l){return l>=1e9?9:l>=1e8?8:l>=1e7?7:l>=1e6?6:l>=1e5?5:l>=1e4?4:l>=1e3?3:l>=100?2:l>=10?1:0},c.popCount=function(l){return 16843009*((l=(858993459&(l-=l>>>1&1431655765))+(l>>>2&858993459))+(l>>>4)&252645135)>>>24},c.countTrailingZeros=i,c.nextPow2=function(l){return l+=l===0,--l,l|=l>>>1,l|=l>>>2,l|=l>>>4,l|=l>>>8,(l|=l>>>16)+1},c.prevPow2=function(l){return l|=l>>>1,l|=l>>>2,l|=l>>>4,l|=l>>>8,(l|=l>>>16)-(l>>>1)},c.parity=function(l){return l^=l>>>16,l^=l>>>8,l^=l>>>4,27030>>>(l&=15)&1};var s=new Array(256);(function(l){for(var d=0;d<256;++d){var h=d,m=d,g=7;for(h>>>=1;h;h>>>=1)m<<=1,m|=1&h,--g;l[d]=m<>>8&255]<<16|s[l>>>16&255]<<8|s[l>>>24&255]},c.interleave2=function(l,d){return(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l&=65535)|l<<8))|l<<4))|l<<2))|l<<1))|(d=1431655765&((d=858993459&((d=252645135&((d=16711935&((d&=65535)|d<<8))|d<<4))|d<<2))|d<<1))<<1},c.deinterleave2=function(l,d){return(l=65535&((l=16711935&((l=252645135&((l=858993459&((l=l>>>d&1431655765)|l>>>1))|l>>>2))|l>>>4))|l>>>16))<<16>>16},c.interleave3=function(l,d,h){return l=1227133513&((l=3272356035&((l=251719695&((l=4278190335&((l&=1023)|l<<16))|l<<8))|l<<4))|l<<2),(l|=(d=1227133513&((d=3272356035&((d=251719695&((d=4278190335&((d&=1023)|d<<16))|d<<8))|d<<4))|d<<2))<<1)|(h=1227133513&((h=3272356035&((h=251719695&((h=4278190335&((h&=1023)|h<<16))|h<<8))|h<<4))|h<<2))<<2},c.deinterleave3=function(l,d){return(l=1023&((l=4278190335&((l=251719695&((l=3272356035&((l=l>>>d&1227133513)|l>>>2))|l>>>4))|l>>>8))|l>>>16))<<22>>22},c.nextCombination=function(l){var d=l|l-1;return d+1|(~d&-~d)-1>>>i(l)+1}},{}],33:[function(a,u,c){(function(i,s){function l(L,P){if(!L)throw new Error(P||"Assertion failed")}function d(L,P){L.super_=P;var N=function(){};N.prototype=P.prototype,L.prototype=new N,L.prototype.constructor=L}function h(L,P,N){if(h.isBN(L))return L;this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&(P!=="le"&&P!=="be"||(N=P,P=10),this._init(L||0,P||10,N||"be"))}var m;typeof i=="object"?i.exports=h:s.BN=h,h.BN=h,h.wordSize=26;try{m=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:a("buffer").Buffer}catch{}function g(L,P){var N=L.charCodeAt(P);return N>=65&&N<=70?N-55:N>=97&&N<=102?N-87:N-48&15}function p(L,P,N){var B=g(L,N);return N-1>=P&&(B|=g(L,N-1)<<4),B}function v(L,P,N,B){for(var G=0,W=Math.min(L.length,N),K=P;K=49?te-49+10:te>=17?te-17+10:te}return G}h.isBN=function(L){return L instanceof h||L!==null&&typeof L=="object"&&L.constructor.wordSize===h.wordSize&&Array.isArray(L.words)},h.max=function(L,P){return L.cmp(P)>0?L:P},h.min=function(L,P){return L.cmp(P)<0?L:P},h.prototype._init=function(L,P,N){if(typeof L=="number")return this._initNumber(L,P,N);if(typeof L=="object")return this._initArray(L,P,N);P==="hex"&&(P=16),l(P===(0|P)&&P>=2&&P<=36);var B=0;(L=L.toString().replace(/\s+/g,""))[0]==="-"&&(B++,this.negative=1),B=0;B-=3)W=L[B]|L[B-1]<<8|L[B-2]<<16,this.words[G]|=W<>>26-K&67108863,(K+=24)>=26&&(K-=26,G++);else if(N==="le")for(B=0,G=0;B>>26-K&67108863,(K+=24)>=26&&(K-=26,G++);return this.strip()},h.prototype._parseHex=function(L,P,N){this.length=Math.ceil((L.length-P)/6),this.words=new Array(this.length);for(var B=0;B=P;B-=2)G=p(L,P,B)<=18?(W-=18,K+=1,this.words[K]|=G>>>26):W+=8;else for(B=(L.length-P)%2==0?P+1:P;B=18?(W-=18,K+=1,this.words[K]|=G>>>26):W+=8;this.strip()},h.prototype._parseBase=function(L,P,N){this.words=[0],this.length=1;for(var B=0,G=1;G<=67108863;G*=P)B++;B--,G=G/P|0;for(var W=L.length-N,K=W%B,te=Math.min(W,W-K)+N,Y=0,Z=N;Z1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},h.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},h.prototype.inspect=function(){return(this.red?""};var y=["","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"],x=[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],w=[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 k(L,P,N){N.negative=P.negative^L.negative;var B=L.length+P.length|0;N.length=B,B=B-1|0;var G=0|L.words[0],W=0|P.words[0],K=G*W,te=67108863&K,Y=K/67108864|0;N.words[0]=te;for(var Z=1;Z>>26,U=67108863&Y,q=Math.min(Z,P.length-1),$=Math.max(0,Z-L.length+1);$<=q;$++){var ne=Z-$|0;re+=(K=(G=0|L.words[ne])*(W=0|P.words[$])+U)/67108864|0,U=67108863&K}N.words[Z]=0|U,Y=0|re}return Y!==0?N.words[Z]=0|Y:N.length--,N.strip()}h.prototype.toString=function(L,P){var N;if(P=0|P||1,(L=L||10)===16||L==="hex"){N="";for(var B=0,G=0,W=0;W>>24-B&16777215)!==0||W!==this.length-1?y[6-te.length]+te+N:te+N,(B+=2)>=26&&(B-=26,W--)}for(G!==0&&(N=G.toString(16)+N);N.length%P!=0;)N="0"+N;return this.negative!==0&&(N="-"+N),N}if(L===(0|L)&&L>=2&&L<=36){var Y=x[L],Z=w[L];N="";var re=this.clone();for(re.negative=0;!re.isZero();){var U=re.modn(Z).toString(L);N=(re=re.idivn(Z)).isZero()?U+N:y[Y-U.length]+U+N}for(this.isZero()&&(N="0"+N);N.length%P!=0;)N="0"+N;return this.negative!==0&&(N="-"+N),N}l(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var L=this.words[0];return this.length===2?L+=67108864*this.words[1]:this.length===3&&this.words[2]===1?L+=4503599627370496+67108864*this.words[1]:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-L:L},h.prototype.toJSON=function(){return this.toString(16)},h.prototype.toBuffer=function(L,P){return l(m!==void 0),this.toArrayLike(m,L,P)},h.prototype.toArray=function(L,P){return this.toArrayLike(Array,L,P)},h.prototype.toArrayLike=function(L,P,N){var B=this.byteLength(),G=N||Math.max(1,B);l(B<=G,"byte array longer than desired length"),l(G>0,"Requested array length <= 0"),this.strip();var W,K,te=P==="le",Y=new L(G),Z=this.clone();if(te){for(K=0;!Z.isZero();K++)W=Z.andln(255),Z.iushrn(8),Y[K]=W;for(;K=4096&&(N+=13,P>>>=13),P>=64&&(N+=7,P>>>=7),P>=8&&(N+=4,P>>>=4),P>=2&&(N+=2,P>>>=2),N+P},h.prototype._zeroBits=function(L){if(L===0)return 26;var P=L,N=0;return(8191&P)==0&&(N+=13,P>>>=13),(127&P)==0&&(N+=7,P>>>=7),(15&P)==0&&(N+=4,P>>>=4),(3&P)==0&&(N+=2,P>>>=2),(1&P)==0&&N++,N},h.prototype.bitLength=function(){var L=this.words[this.length-1],P=this._countBits(L);return 26*(this.length-1)+P},h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var L=0,P=0;PL.length?this.clone().ior(L):L.clone().ior(this)},h.prototype.uor=function(L){return this.length>L.length?this.clone().iuor(L):L.clone().iuor(this)},h.prototype.iuand=function(L){var P;P=this.length>L.length?L:this;for(var N=0;NL.length?this.clone().iand(L):L.clone().iand(this)},h.prototype.uand=function(L){return this.length>L.length?this.clone().iuand(L):L.clone().iuand(this)},h.prototype.iuxor=function(L){var P,N;this.length>L.length?(P=this,N=L):(P=L,N=this);for(var B=0;BL.length?this.clone().ixor(L):L.clone().ixor(this)},h.prototype.uxor=function(L){return this.length>L.length?this.clone().iuxor(L):L.clone().iuxor(this)},h.prototype.inotn=function(L){l(typeof L=="number"&&L>=0);var P=0|Math.ceil(L/26),N=L%26;this._expand(P),N>0&&P--;for(var B=0;B0&&(this.words[B]=~this.words[B]&67108863>>26-N),this.strip()},h.prototype.notn=function(L){return this.clone().inotn(L)},h.prototype.setn=function(L,P){l(typeof L=="number"&&L>=0);var N=L/26|0,B=L%26;return this._expand(N+1),this.words[N]=P?this.words[N]|1<L.length?(N=this,B=L):(N=L,B=this);for(var G=0,W=0;W>>26;for(;G!==0&&W>>26;if(this.length=N.length,G!==0)this.words[this.length]=G,this.length++;else if(N!==this)for(;WL.length?this.clone().iadd(L):L.clone().iadd(this)},h.prototype.isub=function(L){if(L.negative!==0){L.negative=0;var P=this.iadd(L);return L.negative=1,P._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(L),this.negative=1,this._normSign();var N,B,G=this.cmp(L);if(G===0)return this.negative=0,this.length=1,this.words[0]=0,this;G>0?(N=this,B=L):(N=L,B=this);for(var W=0,K=0;K>26,this.words[K]=67108863&P;for(;W!==0&&K>26,this.words[K]=67108863&P;if(W===0&&K>>13,$=0|K[1],ne=8191&$,H=$>>>13,Q=0|K[2],ee=8191&Q,ie=Q>>>13,ae=0|K[3],ue=8191&ae,le=ae>>>13,ge=0|K[4],fe=8191&ge,me=ge>>>13,_e=0|K[5],we=8191&_e,Te=_e>>>13,Oe=0|K[6],de=8191&Oe,ye=Oe>>>13,Me=0|K[7],ke=8191&Me,Ee=Me>>>13,ze=0|K[8],Fe=8191&ze,Ve=ze>>>13,Ke=0|K[9],Re=8191&Ke,qe=Ke>>>13,We=0|te[0],Ye=8191&We,nt=We>>>13,ft=0|te[1],vt=8191&ft,Pt=ft>>>13,At=0|te[2],at=8191&At,et=At>>>13,Ot=0|te[3],Wt=8191&Ot,Jt=Ot>>>13,Be=0|te[4],Ge=8191&Be,Tt=Be>>>13,dt=0|te[5],Pe=8191&dt,Ie=dt>>>13,Ae=0|te[6],De=8191&Ae,He=Ae>>>13,rt=0|te[7],lt=8191&rt,ot=rt>>>13,kt=0|te[8],wt=8191&kt,Vt=kt>>>13,Ut=0|te[9],tt=8191&Ut,bt=Ut>>>13;N.negative=L.negative^P.negative,N.length=19;var zt=(Z+(B=Math.imul(U,Ye))|0)+((8191&(G=(G=Math.imul(U,nt))+Math.imul(q,Ye)|0))<<13)|0;Z=((W=Math.imul(q,nt))+(G>>>13)|0)+(zt>>>26)|0,zt&=67108863,B=Math.imul(ne,Ye),G=(G=Math.imul(ne,nt))+Math.imul(H,Ye)|0,W=Math.imul(H,nt);var St=(Z+(B=B+Math.imul(U,vt)|0)|0)+((8191&(G=(G=G+Math.imul(U,Pt)|0)+Math.imul(q,vt)|0))<<13)|0;Z=((W=W+Math.imul(q,Pt)|0)+(G>>>13)|0)+(St>>>26)|0,St&=67108863,B=Math.imul(ee,Ye),G=(G=Math.imul(ee,nt))+Math.imul(ie,Ye)|0,W=Math.imul(ie,nt),B=B+Math.imul(ne,vt)|0,G=(G=G+Math.imul(ne,Pt)|0)+Math.imul(H,vt)|0,W=W+Math.imul(H,Pt)|0;var Dt=(Z+(B=B+Math.imul(U,at)|0)|0)+((8191&(G=(G=G+Math.imul(U,et)|0)+Math.imul(q,at)|0))<<13)|0;Z=((W=W+Math.imul(q,et)|0)+(G>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,B=Math.imul(ue,Ye),G=(G=Math.imul(ue,nt))+Math.imul(le,Ye)|0,W=Math.imul(le,nt),B=B+Math.imul(ee,vt)|0,G=(G=G+Math.imul(ee,Pt)|0)+Math.imul(ie,vt)|0,W=W+Math.imul(ie,Pt)|0,B=B+Math.imul(ne,at)|0,G=(G=G+Math.imul(ne,et)|0)+Math.imul(H,at)|0,W=W+Math.imul(H,et)|0;var Le=(Z+(B=B+Math.imul(U,Wt)|0)|0)+((8191&(G=(G=G+Math.imul(U,Jt)|0)+Math.imul(q,Wt)|0))<<13)|0;Z=((W=W+Math.imul(q,Jt)|0)+(G>>>13)|0)+(Le>>>26)|0,Le&=67108863,B=Math.imul(fe,Ye),G=(G=Math.imul(fe,nt))+Math.imul(me,Ye)|0,W=Math.imul(me,nt),B=B+Math.imul(ue,vt)|0,G=(G=G+Math.imul(ue,Pt)|0)+Math.imul(le,vt)|0,W=W+Math.imul(le,Pt)|0,B=B+Math.imul(ee,at)|0,G=(G=G+Math.imul(ee,et)|0)+Math.imul(ie,at)|0,W=W+Math.imul(ie,et)|0,B=B+Math.imul(ne,Wt)|0,G=(G=G+Math.imul(ne,Jt)|0)+Math.imul(H,Wt)|0,W=W+Math.imul(H,Jt)|0;var Je=(Z+(B=B+Math.imul(U,Ge)|0)|0)+((8191&(G=(G=G+Math.imul(U,Tt)|0)+Math.imul(q,Ge)|0))<<13)|0;Z=((W=W+Math.imul(q,Tt)|0)+(G>>>13)|0)+(Je>>>26)|0,Je&=67108863,B=Math.imul(we,Ye),G=(G=Math.imul(we,nt))+Math.imul(Te,Ye)|0,W=Math.imul(Te,nt),B=B+Math.imul(fe,vt)|0,G=(G=G+Math.imul(fe,Pt)|0)+Math.imul(me,vt)|0,W=W+Math.imul(me,Pt)|0,B=B+Math.imul(ue,at)|0,G=(G=G+Math.imul(ue,et)|0)+Math.imul(le,at)|0,W=W+Math.imul(le,et)|0,B=B+Math.imul(ee,Wt)|0,G=(G=G+Math.imul(ee,Jt)|0)+Math.imul(ie,Wt)|0,W=W+Math.imul(ie,Jt)|0,B=B+Math.imul(ne,Ge)|0,G=(G=G+Math.imul(ne,Tt)|0)+Math.imul(H,Ge)|0,W=W+Math.imul(H,Tt)|0;var st=(Z+(B=B+Math.imul(U,Pe)|0)|0)+((8191&(G=(G=G+Math.imul(U,Ie)|0)+Math.imul(q,Pe)|0))<<13)|0;Z=((W=W+Math.imul(q,Ie)|0)+(G>>>13)|0)+(st>>>26)|0,st&=67108863,B=Math.imul(de,Ye),G=(G=Math.imul(de,nt))+Math.imul(ye,Ye)|0,W=Math.imul(ye,nt),B=B+Math.imul(we,vt)|0,G=(G=G+Math.imul(we,Pt)|0)+Math.imul(Te,vt)|0,W=W+Math.imul(Te,Pt)|0,B=B+Math.imul(fe,at)|0,G=(G=G+Math.imul(fe,et)|0)+Math.imul(me,at)|0,W=W+Math.imul(me,et)|0,B=B+Math.imul(ue,Wt)|0,G=(G=G+Math.imul(ue,Jt)|0)+Math.imul(le,Wt)|0,W=W+Math.imul(le,Jt)|0,B=B+Math.imul(ee,Ge)|0,G=(G=G+Math.imul(ee,Tt)|0)+Math.imul(ie,Ge)|0,W=W+Math.imul(ie,Tt)|0,B=B+Math.imul(ne,Pe)|0,G=(G=G+Math.imul(ne,Ie)|0)+Math.imul(H,Pe)|0,W=W+Math.imul(H,Ie)|0;var Et=(Z+(B=B+Math.imul(U,De)|0)|0)+((8191&(G=(G=G+Math.imul(U,He)|0)+Math.imul(q,De)|0))<<13)|0;Z=((W=W+Math.imul(q,He)|0)+(G>>>13)|0)+(Et>>>26)|0,Et&=67108863,B=Math.imul(ke,Ye),G=(G=Math.imul(ke,nt))+Math.imul(Ee,Ye)|0,W=Math.imul(Ee,nt),B=B+Math.imul(de,vt)|0,G=(G=G+Math.imul(de,Pt)|0)+Math.imul(ye,vt)|0,W=W+Math.imul(ye,Pt)|0,B=B+Math.imul(we,at)|0,G=(G=G+Math.imul(we,et)|0)+Math.imul(Te,at)|0,W=W+Math.imul(Te,et)|0,B=B+Math.imul(fe,Wt)|0,G=(G=G+Math.imul(fe,Jt)|0)+Math.imul(me,Wt)|0,W=W+Math.imul(me,Jt)|0,B=B+Math.imul(ue,Ge)|0,G=(G=G+Math.imul(ue,Tt)|0)+Math.imul(le,Ge)|0,W=W+Math.imul(le,Tt)|0,B=B+Math.imul(ee,Pe)|0,G=(G=G+Math.imul(ee,Ie)|0)+Math.imul(ie,Pe)|0,W=W+Math.imul(ie,Ie)|0,B=B+Math.imul(ne,De)|0,G=(G=G+Math.imul(ne,He)|0)+Math.imul(H,De)|0,W=W+Math.imul(H,He)|0;var It=(Z+(B=B+Math.imul(U,lt)|0)|0)+((8191&(G=(G=G+Math.imul(U,ot)|0)+Math.imul(q,lt)|0))<<13)|0;Z=((W=W+Math.imul(q,ot)|0)+(G>>>13)|0)+(It>>>26)|0,It&=67108863,B=Math.imul(Fe,Ye),G=(G=Math.imul(Fe,nt))+Math.imul(Ve,Ye)|0,W=Math.imul(Ve,nt),B=B+Math.imul(ke,vt)|0,G=(G=G+Math.imul(ke,Pt)|0)+Math.imul(Ee,vt)|0,W=W+Math.imul(Ee,Pt)|0,B=B+Math.imul(de,at)|0,G=(G=G+Math.imul(de,et)|0)+Math.imul(ye,at)|0,W=W+Math.imul(ye,et)|0,B=B+Math.imul(we,Wt)|0,G=(G=G+Math.imul(we,Jt)|0)+Math.imul(Te,Wt)|0,W=W+Math.imul(Te,Jt)|0,B=B+Math.imul(fe,Ge)|0,G=(G=G+Math.imul(fe,Tt)|0)+Math.imul(me,Ge)|0,W=W+Math.imul(me,Tt)|0,B=B+Math.imul(ue,Pe)|0,G=(G=G+Math.imul(ue,Ie)|0)+Math.imul(le,Pe)|0,W=W+Math.imul(le,Ie)|0,B=B+Math.imul(ee,De)|0,G=(G=G+Math.imul(ee,He)|0)+Math.imul(ie,De)|0,W=W+Math.imul(ie,He)|0,B=B+Math.imul(ne,lt)|0,G=(G=G+Math.imul(ne,ot)|0)+Math.imul(H,lt)|0,W=W+Math.imul(H,ot)|0;var Zt=(Z+(B=B+Math.imul(U,wt)|0)|0)+((8191&(G=(G=G+Math.imul(U,Vt)|0)+Math.imul(q,wt)|0))<<13)|0;Z=((W=W+Math.imul(q,Vt)|0)+(G>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,B=Math.imul(Re,Ye),G=(G=Math.imul(Re,nt))+Math.imul(qe,Ye)|0,W=Math.imul(qe,nt),B=B+Math.imul(Fe,vt)|0,G=(G=G+Math.imul(Fe,Pt)|0)+Math.imul(Ve,vt)|0,W=W+Math.imul(Ve,Pt)|0,B=B+Math.imul(ke,at)|0,G=(G=G+Math.imul(ke,et)|0)+Math.imul(Ee,at)|0,W=W+Math.imul(Ee,et)|0,B=B+Math.imul(de,Wt)|0,G=(G=G+Math.imul(de,Jt)|0)+Math.imul(ye,Wt)|0,W=W+Math.imul(ye,Jt)|0,B=B+Math.imul(we,Ge)|0,G=(G=G+Math.imul(we,Tt)|0)+Math.imul(Te,Ge)|0,W=W+Math.imul(Te,Tt)|0,B=B+Math.imul(fe,Pe)|0,G=(G=G+Math.imul(fe,Ie)|0)+Math.imul(me,Pe)|0,W=W+Math.imul(me,Ie)|0,B=B+Math.imul(ue,De)|0,G=(G=G+Math.imul(ue,He)|0)+Math.imul(le,De)|0,W=W+Math.imul(le,He)|0,B=B+Math.imul(ee,lt)|0,G=(G=G+Math.imul(ee,ot)|0)+Math.imul(ie,lt)|0,W=W+Math.imul(ie,ot)|0,B=B+Math.imul(ne,wt)|0,G=(G=G+Math.imul(ne,Vt)|0)+Math.imul(H,wt)|0,W=W+Math.imul(H,Vt)|0;var Kt=(Z+(B=B+Math.imul(U,tt)|0)|0)+((8191&(G=(G=G+Math.imul(U,bt)|0)+Math.imul(q,tt)|0))<<13)|0;Z=((W=W+Math.imul(q,bt)|0)+(G>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,B=Math.imul(Re,vt),G=(G=Math.imul(Re,Pt))+Math.imul(qe,vt)|0,W=Math.imul(qe,Pt),B=B+Math.imul(Fe,at)|0,G=(G=G+Math.imul(Fe,et)|0)+Math.imul(Ve,at)|0,W=W+Math.imul(Ve,et)|0,B=B+Math.imul(ke,Wt)|0,G=(G=G+Math.imul(ke,Jt)|0)+Math.imul(Ee,Wt)|0,W=W+Math.imul(Ee,Jt)|0,B=B+Math.imul(de,Ge)|0,G=(G=G+Math.imul(de,Tt)|0)+Math.imul(ye,Ge)|0,W=W+Math.imul(ye,Tt)|0,B=B+Math.imul(we,Pe)|0,G=(G=G+Math.imul(we,Ie)|0)+Math.imul(Te,Pe)|0,W=W+Math.imul(Te,Ie)|0,B=B+Math.imul(fe,De)|0,G=(G=G+Math.imul(fe,He)|0)+Math.imul(me,De)|0,W=W+Math.imul(me,He)|0,B=B+Math.imul(ue,lt)|0,G=(G=G+Math.imul(ue,ot)|0)+Math.imul(le,lt)|0,W=W+Math.imul(le,ot)|0,B=B+Math.imul(ee,wt)|0,G=(G=G+Math.imul(ee,Vt)|0)+Math.imul(ie,wt)|0,W=W+Math.imul(ie,Vt)|0;var Ht=(Z+(B=B+Math.imul(ne,tt)|0)|0)+((8191&(G=(G=G+Math.imul(ne,bt)|0)+Math.imul(H,tt)|0))<<13)|0;Z=((W=W+Math.imul(H,bt)|0)+(G>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,B=Math.imul(Re,at),G=(G=Math.imul(Re,et))+Math.imul(qe,at)|0,W=Math.imul(qe,et),B=B+Math.imul(Fe,Wt)|0,G=(G=G+Math.imul(Fe,Jt)|0)+Math.imul(Ve,Wt)|0,W=W+Math.imul(Ve,Jt)|0,B=B+Math.imul(ke,Ge)|0,G=(G=G+Math.imul(ke,Tt)|0)+Math.imul(Ee,Ge)|0,W=W+Math.imul(Ee,Tt)|0,B=B+Math.imul(de,Pe)|0,G=(G=G+Math.imul(de,Ie)|0)+Math.imul(ye,Pe)|0,W=W+Math.imul(ye,Ie)|0,B=B+Math.imul(we,De)|0,G=(G=G+Math.imul(we,He)|0)+Math.imul(Te,De)|0,W=W+Math.imul(Te,He)|0,B=B+Math.imul(fe,lt)|0,G=(G=G+Math.imul(fe,ot)|0)+Math.imul(me,lt)|0,W=W+Math.imul(me,ot)|0,B=B+Math.imul(ue,wt)|0,G=(G=G+Math.imul(ue,Vt)|0)+Math.imul(le,wt)|0,W=W+Math.imul(le,Vt)|0;var mn=(Z+(B=B+Math.imul(ee,tt)|0)|0)+((8191&(G=(G=G+Math.imul(ee,bt)|0)+Math.imul(ie,tt)|0))<<13)|0;Z=((W=W+Math.imul(ie,bt)|0)+(G>>>13)|0)+(mn>>>26)|0,mn&=67108863,B=Math.imul(Re,Wt),G=(G=Math.imul(Re,Jt))+Math.imul(qe,Wt)|0,W=Math.imul(qe,Jt),B=B+Math.imul(Fe,Ge)|0,G=(G=G+Math.imul(Fe,Tt)|0)+Math.imul(Ve,Ge)|0,W=W+Math.imul(Ve,Tt)|0,B=B+Math.imul(ke,Pe)|0,G=(G=G+Math.imul(ke,Ie)|0)+Math.imul(Ee,Pe)|0,W=W+Math.imul(Ee,Ie)|0,B=B+Math.imul(de,De)|0,G=(G=G+Math.imul(de,He)|0)+Math.imul(ye,De)|0,W=W+Math.imul(ye,He)|0,B=B+Math.imul(we,lt)|0,G=(G=G+Math.imul(we,ot)|0)+Math.imul(Te,lt)|0,W=W+Math.imul(Te,ot)|0,B=B+Math.imul(fe,wt)|0,G=(G=G+Math.imul(fe,Vt)|0)+Math.imul(me,wt)|0,W=W+Math.imul(me,Vt)|0;var zn=(Z+(B=B+Math.imul(ue,tt)|0)|0)+((8191&(G=(G=G+Math.imul(ue,bt)|0)+Math.imul(le,tt)|0))<<13)|0;Z=((W=W+Math.imul(le,bt)|0)+(G>>>13)|0)+(zn>>>26)|0,zn&=67108863,B=Math.imul(Re,Ge),G=(G=Math.imul(Re,Tt))+Math.imul(qe,Ge)|0,W=Math.imul(qe,Tt),B=B+Math.imul(Fe,Pe)|0,G=(G=G+Math.imul(Fe,Ie)|0)+Math.imul(Ve,Pe)|0,W=W+Math.imul(Ve,Ie)|0,B=B+Math.imul(ke,De)|0,G=(G=G+Math.imul(ke,He)|0)+Math.imul(Ee,De)|0,W=W+Math.imul(Ee,He)|0,B=B+Math.imul(de,lt)|0,G=(G=G+Math.imul(de,ot)|0)+Math.imul(ye,lt)|0,W=W+Math.imul(ye,ot)|0,B=B+Math.imul(we,wt)|0,G=(G=G+Math.imul(we,Vt)|0)+Math.imul(Te,wt)|0,W=W+Math.imul(Te,Vt)|0;var pn=(Z+(B=B+Math.imul(fe,tt)|0)|0)+((8191&(G=(G=G+Math.imul(fe,bt)|0)+Math.imul(me,tt)|0))<<13)|0;Z=((W=W+Math.imul(me,bt)|0)+(G>>>13)|0)+(pn>>>26)|0,pn&=67108863,B=Math.imul(Re,Pe),G=(G=Math.imul(Re,Ie))+Math.imul(qe,Pe)|0,W=Math.imul(qe,Ie),B=B+Math.imul(Fe,De)|0,G=(G=G+Math.imul(Fe,He)|0)+Math.imul(Ve,De)|0,W=W+Math.imul(Ve,He)|0,B=B+Math.imul(ke,lt)|0,G=(G=G+Math.imul(ke,ot)|0)+Math.imul(Ee,lt)|0,W=W+Math.imul(Ee,ot)|0,B=B+Math.imul(de,wt)|0,G=(G=G+Math.imul(de,Vt)|0)+Math.imul(ye,wt)|0,W=W+Math.imul(ye,Vt)|0;var tn=(Z+(B=B+Math.imul(we,tt)|0)|0)+((8191&(G=(G=G+Math.imul(we,bt)|0)+Math.imul(Te,tt)|0))<<13)|0;Z=((W=W+Math.imul(Te,bt)|0)+(G>>>13)|0)+(tn>>>26)|0,tn&=67108863,B=Math.imul(Re,De),G=(G=Math.imul(Re,He))+Math.imul(qe,De)|0,W=Math.imul(qe,He),B=B+Math.imul(Fe,lt)|0,G=(G=G+Math.imul(Fe,ot)|0)+Math.imul(Ve,lt)|0,W=W+Math.imul(Ve,ot)|0,B=B+Math.imul(ke,wt)|0,G=(G=G+Math.imul(ke,Vt)|0)+Math.imul(Ee,wt)|0,W=W+Math.imul(Ee,Vt)|0;var nn=(Z+(B=B+Math.imul(de,tt)|0)|0)+((8191&(G=(G=G+Math.imul(de,bt)|0)+Math.imul(ye,tt)|0))<<13)|0;Z=((W=W+Math.imul(ye,bt)|0)+(G>>>13)|0)+(nn>>>26)|0,nn&=67108863,B=Math.imul(Re,lt),G=(G=Math.imul(Re,ot))+Math.imul(qe,lt)|0,W=Math.imul(qe,ot),B=B+Math.imul(Fe,wt)|0,G=(G=G+Math.imul(Fe,Vt)|0)+Math.imul(Ve,wt)|0,W=W+Math.imul(Ve,Vt)|0;var sn=(Z+(B=B+Math.imul(ke,tt)|0)|0)+((8191&(G=(G=G+Math.imul(ke,bt)|0)+Math.imul(Ee,tt)|0))<<13)|0;Z=((W=W+Math.imul(Ee,bt)|0)+(G>>>13)|0)+(sn>>>26)|0,sn&=67108863,B=Math.imul(Re,wt),G=(G=Math.imul(Re,Vt))+Math.imul(qe,wt)|0,W=Math.imul(qe,Vt);var gn=(Z+(B=B+Math.imul(Fe,tt)|0)|0)+((8191&(G=(G=G+Math.imul(Fe,bt)|0)+Math.imul(Ve,tt)|0))<<13)|0;Z=((W=W+Math.imul(Ve,bt)|0)+(G>>>13)|0)+(gn>>>26)|0,gn&=67108863;var bn=(Z+(B=Math.imul(Re,tt))|0)+((8191&(G=(G=Math.imul(Re,bt))+Math.imul(qe,tt)|0))<<13)|0;return Z=((W=Math.imul(qe,bt))+(G>>>13)|0)+(bn>>>26)|0,bn&=67108863,Y[0]=zt,Y[1]=St,Y[2]=Dt,Y[3]=Le,Y[4]=Je,Y[5]=st,Y[6]=Et,Y[7]=It,Y[8]=Zt,Y[9]=Kt,Y[10]=Ht,Y[11]=mn,Y[12]=zn,Y[13]=pn,Y[14]=tn,Y[15]=nn,Y[16]=sn,Y[17]=gn,Y[18]=bn,Z!==0&&(Y[19]=Z,N.length++),N};function T(L,P,N){return new _().mulp(L,P,N)}function _(L,P){this.x=L,this.y=P}Math.imul||(b=k),h.prototype.mulTo=function(L,P){var N=this.length+L.length;return this.length===10&&L.length===10?b(this,L,P):N<63?k(this,L,P):N<1024?function(B,G,W){W.negative=G.negative^B.negative,W.length=B.length+G.length;for(var K=0,te=0,Y=0;Y>>26)|0)>>>26,Z&=67108863}W.words[Y]=re,K=Z,Z=te}return K!==0?W.words[Y]=K:W.length--,W.strip()}(this,L,P):T(this,L,P)},_.prototype.makeRBT=function(L){for(var P=new Array(L),N=h.prototype._countBits(L)-1,B=0;B>=1;return B},_.prototype.permute=function(L,P,N,B,G,W){for(var K=0;K>>=1)G++;return 1<>>=13,N[2*W+1]=8191&G,G>>>=13;for(W=2*P;W>=26,P+=B/67108864|0,P+=G>>>26,this.words[N]=67108863&G}return P!==0&&(this.words[N]=P,this.length++),this},h.prototype.muln=function(L){return this.clone().imuln(L)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(L){var P=function(W){for(var K=new Array(W.bitLength()),te=0;te>>Z}return K}(L);if(P.length===0)return new h(1);for(var N=this,B=0;B=0);var P,N=L%26,B=(L-N)/26,G=67108863>>>26-N<<26-N;if(N!==0){var W=0;for(P=0;P>>26-N}W&&(this.words[P]=W,this.length++)}if(B!==0){for(P=this.length-1;P>=0;P--)this.words[P+B]=this.words[P];for(P=0;P=0),B=P?(P-P%26)/26:0;var G=L%26,W=Math.min((L-G)/26,this.length),K=67108863^67108863>>>G<W)for(this.length-=W,Y=0;Y=0&&(Z!==0||Y>=B);Y--){var re=0|this.words[Y];this.words[Y]=Z<<26-G|re>>>G,Z=re&K}return te&&Z!==0&&(te.words[te.length++]=Z),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},h.prototype.ishrn=function(L,P,N){return l(this.negative===0),this.iushrn(L,P,N)},h.prototype.shln=function(L){return this.clone().ishln(L)},h.prototype.ushln=function(L){return this.clone().iushln(L)},h.prototype.shrn=function(L){return this.clone().ishrn(L)},h.prototype.ushrn=function(L){return this.clone().iushrn(L)},h.prototype.testn=function(L){l(typeof L=="number"&&L>=0);var P=L%26,N=(L-P)/26,B=1<=0);var P=L%26,N=(L-P)/26;if(l(this.negative===0,"imaskn works only with positive numbers"),this.length<=N)return this;if(P!==0&&N++,this.length=Math.min(N,this.length),P!==0){var B=67108863^67108863>>>P<=67108864;P++)this.words[P]-=67108864,P===this.length-1?this.words[P+1]=1:this.words[P+1]++;return this.length=Math.max(this.length,P+1),this},h.prototype.isubn=function(L){if(l(typeof L=="number"),l(L<67108864),L<0)return this.iaddn(-L);if(this.negative!==0)return this.negative=0,this.iaddn(L),this.negative=1,this;if(this.words[0]-=L,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var P=0;P>26)-(te/67108864|0),this.words[B+N]=67108863&G}for(;B>26,this.words[B+N]=67108863&G;if(K===0)return this.strip();for(l(K===-1),K=0,B=0;B>26,this.words[B]=67108863&G;return this.negative=1,this.strip()},h.prototype._wordDiv=function(L,P){var N=(this.length,L.length),B=this.clone(),G=L,W=0|G.words[G.length-1];(N=26-this._countBits(W))!==0&&(G=G.ushln(N),B.iushln(N),W=0|G.words[G.length-1]);var K,te=B.length-G.length;if(P!=="mod"){(K=new h(null)).length=te+1,K.words=new Array(K.length);for(var Y=0;Y=0;re--){var U=67108864*(0|B.words[G.length+re])+(0|B.words[G.length+re-1]);for(U=Math.min(U/W|0,67108863),B._ishlnsubmul(G,U,re);B.negative!==0;)U--,B.negative=0,B._ishlnsubmul(G,1,re),B.isZero()||(B.negative^=1);K&&(K.words[re]=U)}return K&&K.strip(),B.strip(),P!=="div"&&N!==0&&B.iushrn(N),{div:K||null,mod:B}},h.prototype.divmod=function(L,P,N){return l(!L.isZero()),this.isZero()?{div:new h(0),mod:new h(0)}:this.negative!==0&&L.negative===0?(W=this.neg().divmod(L,P),P!=="mod"&&(B=W.div.neg()),P!=="div"&&(G=W.mod.neg(),N&&G.negative!==0&&G.iadd(L)),{div:B,mod:G}):this.negative===0&&L.negative!==0?(W=this.divmod(L.neg(),P),P!=="mod"&&(B=W.div.neg()),{div:B,mod:W.mod}):(this.negative&L.negative)!=0?(W=this.neg().divmod(L.neg(),P),P!=="div"&&(G=W.mod.neg(),N&&G.negative!==0&&G.isub(L)),{div:W.div,mod:G}):L.length>this.length||this.cmp(L)<0?{div:new h(0),mod:this}:L.length===1?P==="div"?{div:this.divn(L.words[0]),mod:null}:P==="mod"?{div:null,mod:new h(this.modn(L.words[0]))}:{div:this.divn(L.words[0]),mod:new h(this.modn(L.words[0]))}:this._wordDiv(L,P);var B,G,W},h.prototype.div=function(L){return this.divmod(L,"div",!1).div},h.prototype.mod=function(L){return this.divmod(L,"mod",!1).mod},h.prototype.umod=function(L){return this.divmod(L,"mod",!0).mod},h.prototype.divRound=function(L){var P=this.divmod(L);if(P.mod.isZero())return P.div;var N=P.div.negative!==0?P.mod.isub(L):P.mod,B=L.ushrn(1),G=L.andln(1),W=N.cmp(B);return W<0||G===1&&W===0?P.div:P.div.negative!==0?P.div.isubn(1):P.div.iaddn(1)},h.prototype.modn=function(L){l(L<=67108863);for(var P=(1<<26)%L,N=0,B=this.length-1;B>=0;B--)N=(P*N+(0|this.words[B]))%L;return N},h.prototype.idivn=function(L){l(L<=67108863);for(var P=0,N=this.length-1;N>=0;N--){var B=(0|this.words[N])+67108864*P;this.words[N]=B/L|0,P=B%L}return this.strip()},h.prototype.divn=function(L){return this.clone().idivn(L)},h.prototype.egcd=function(L){l(L.negative===0),l(!L.isZero());var P=this,N=L.clone();P=P.negative!==0?P.umod(L):P.clone();for(var B=new h(1),G=new h(0),W=new h(0),K=new h(1),te=0;P.isEven()&&N.isEven();)P.iushrn(1),N.iushrn(1),++te;for(var Y=N.clone(),Z=P.clone();!P.isZero();){for(var re=0,U=1;(P.words[0]&U)==0&&re<26;++re,U<<=1);if(re>0)for(P.iushrn(re);re-- >0;)(B.isOdd()||G.isOdd())&&(B.iadd(Y),G.isub(Z)),B.iushrn(1),G.iushrn(1);for(var q=0,$=1;(N.words[0]&$)==0&&q<26;++q,$<<=1);if(q>0)for(N.iushrn(q);q-- >0;)(W.isOdd()||K.isOdd())&&(W.iadd(Y),K.isub(Z)),W.iushrn(1),K.iushrn(1);P.cmp(N)>=0?(P.isub(N),B.isub(W),G.isub(K)):(N.isub(P),W.isub(B),K.isub(G))}return{a:W,b:K,gcd:N.iushln(te)}},h.prototype._invmp=function(L){l(L.negative===0),l(!L.isZero());var P=this,N=L.clone();P=P.negative!==0?P.umod(L):P.clone();for(var B,G=new h(1),W=new h(0),K=N.clone();P.cmpn(1)>0&&N.cmpn(1)>0;){for(var te=0,Y=1;(P.words[0]&Y)==0&&te<26;++te,Y<<=1);if(te>0)for(P.iushrn(te);te-- >0;)G.isOdd()&&G.iadd(K),G.iushrn(1);for(var Z=0,re=1;(N.words[0]&re)==0&&Z<26;++Z,re<<=1);if(Z>0)for(N.iushrn(Z);Z-- >0;)W.isOdd()&&W.iadd(K),W.iushrn(1);P.cmp(N)>=0?(P.isub(N),G.isub(W)):(N.isub(P),W.isub(G))}return(B=P.cmpn(1)===0?G:W).cmpn(0)<0&&B.iadd(L),B},h.prototype.gcd=function(L){if(this.isZero())return L.abs();if(L.isZero())return this.abs();var P=this.clone(),N=L.clone();P.negative=0,N.negative=0;for(var B=0;P.isEven()&&N.isEven();B++)P.iushrn(1),N.iushrn(1);for(;;){for(;P.isEven();)P.iushrn(1);for(;N.isEven();)N.iushrn(1);var G=P.cmp(N);if(G<0){var W=P;P=N,N=W}else if(G===0||N.cmpn(1)===0)break;P.isub(N)}return N.iushln(B)},h.prototype.invm=function(L){return this.egcd(L).a.umod(L)},h.prototype.isEven=function(){return(1&this.words[0])==0},h.prototype.isOdd=function(){return(1&this.words[0])==1},h.prototype.andln=function(L){return this.words[0]&L},h.prototype.bincn=function(L){l(typeof L=="number");var P=L%26,N=(L-P)/26,B=1<>>26,K&=67108863,this.words[W]=K}return G!==0&&(this.words[W]=G,this.length++),this},h.prototype.isZero=function(){return this.length===1&&this.words[0]===0},h.prototype.cmpn=function(L){var P,N=L<0;if(this.negative!==0&&!N)return-1;if(this.negative===0&&N)return 1;if(this.strip(),this.length>1)P=1;else{N&&(L=-L),l(L<=67108863,"Number is too big");var B=0|this.words[0];P=B===L?0:BL.length)return 1;if(this.length=0;N--){var B=0|this.words[N],G=0|L.words[N];if(B!==G){BG&&(P=1);break}}return P},h.prototype.gtn=function(L){return this.cmpn(L)===1},h.prototype.gt=function(L){return this.cmp(L)===1},h.prototype.gten=function(L){return this.cmpn(L)>=0},h.prototype.gte=function(L){return this.cmp(L)>=0},h.prototype.ltn=function(L){return this.cmpn(L)===-1},h.prototype.lt=function(L){return this.cmp(L)===-1},h.prototype.lten=function(L){return this.cmpn(L)<=0},h.prototype.lte=function(L){return this.cmp(L)<=0},h.prototype.eqn=function(L){return this.cmpn(L)===0},h.prototype.eq=function(L){return this.cmp(L)===0},h.red=function(L){return new R(L)},h.prototype.toRed=function(L){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),L.convertTo(this)._forceRed(L)},h.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(L){return this.red=L,this},h.prototype.forceRed=function(L){return l(!this.red,"Already a number in reduction context"),this._forceRed(L)},h.prototype.redAdd=function(L){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,L)},h.prototype.redIAdd=function(L){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,L)},h.prototype.redSub=function(L){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,L)},h.prototype.redISub=function(L){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,L)},h.prototype.redShl=function(L){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,L)},h.prototype.redMul=function(L){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.mul(this,L)},h.prototype.redIMul=function(L){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.imul(this,L)},h.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(L){return l(this.red&&!L.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,L)};var M={k256:null,p224:null,p192:null,p25519:null};function A(L,P){this.name=L,this.p=new h(P,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function D(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(L){if(typeof L=="string"){var P=h._prime(L);this.m=P.p,this.prime=P}else l(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}function z(L){R.call(this,L),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(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)}A.prototype._tmp=function(){var L=new h(null);return L.words=new Array(Math.ceil(this.n/13)),L},A.prototype.ireduce=function(L){var P,N=L;do this.split(N,this.tmp),P=(N=(N=this.imulK(N)).iadd(this.tmp)).bitLength();while(P>this.n);var B=P0?N.isub(this.p):N.strip!==void 0?N.strip():N._strip(),N},A.prototype.split=function(L,P){L.iushrn(this.n,0,P)},A.prototype.imulK=function(L){return L.imul(this.k)},d(S,A),S.prototype.split=function(L,P){for(var N=Math.min(L.length,9),B=0;B>>22,G=W}G>>>=22,L.words[B-10]=G,G===0&&L.length>10?L.length-=10:L.length-=9},S.prototype.imulK=function(L){L.words[L.length]=0,L.words[L.length+1]=0,L.length+=2;for(var P=0,N=0;N>>=26,L.words[N]=G,P=B}return P!==0&&(L.words[L.length++]=P),L},h._prime=function(L){if(M[L])return M[L];var P;if(L==="k256")P=new S;else if(L==="p224")P=new E;else if(L==="p192")P=new D;else{if(L!=="p25519")throw new Error("Unknown prime "+L);P=new O}return M[L]=P,P},R.prototype._verify1=function(L){l(L.negative===0,"red works only with positives"),l(L.red,"red works only with red numbers")},R.prototype._verify2=function(L,P){l((L.negative|P.negative)==0,"red works only with positives"),l(L.red&&L.red===P.red,"red works only with red numbers")},R.prototype.imod=function(L){return this.prime?this.prime.ireduce(L)._forceRed(this):L.umod(this.m)._forceRed(this)},R.prototype.neg=function(L){return L.isZero()?L.clone():this.m.sub(L)._forceRed(this)},R.prototype.add=function(L,P){this._verify2(L,P);var N=L.add(P);return N.cmp(this.m)>=0&&N.isub(this.m),N._forceRed(this)},R.prototype.iadd=function(L,P){this._verify2(L,P);var N=L.iadd(P);return N.cmp(this.m)>=0&&N.isub(this.m),N},R.prototype.sub=function(L,P){this._verify2(L,P);var N=L.sub(P);return N.cmpn(0)<0&&N.iadd(this.m),N._forceRed(this)},R.prototype.isub=function(L,P){this._verify2(L,P);var N=L.isub(P);return N.cmpn(0)<0&&N.iadd(this.m),N},R.prototype.shl=function(L,P){return this._verify1(L),this.imod(L.ushln(P))},R.prototype.imul=function(L,P){return this._verify2(L,P),this.imod(L.imul(P))},R.prototype.mul=function(L,P){return this._verify2(L,P),this.imod(L.mul(P))},R.prototype.isqr=function(L){return this.imul(L,L.clone())},R.prototype.sqr=function(L){return this.mul(L,L)},R.prototype.sqrt=function(L){if(L.isZero())return L.clone();var P=this.m.andln(3);if(l(P%2==1),P===3){var N=this.m.add(new h(1)).iushrn(2);return this.pow(L,N)}for(var B=this.m.subn(1),G=0;!B.isZero()&&B.andln(1)===0;)G++,B.iushrn(1);l(!B.isZero());var W=new h(1).toRed(this),K=W.redNeg(),te=this.m.subn(1).iushrn(1),Y=this.m.bitLength();for(Y=new h(2*Y*Y).toRed(this);this.pow(Y,te).cmp(K)!==0;)Y.redIAdd(K);for(var Z=this.pow(Y,B),re=this.pow(L,B.addn(1).iushrn(1)),U=this.pow(L,B),q=G;U.cmp(W)!==0;){for(var $=U,ne=0;$.cmp(W)!==0;ne++)$=$.redSqr();l(ne=0;B--){for(var Y=P.words[B],Z=te-1;Z>=0;Z--){var re=Y>>Z&1;G!==N[0]&&(G=this.sqr(G)),re!==0||W!==0?(W<<=1,W|=re,(++K===4||B===0&&Z===0)&&(G=this.mul(G,N[W]),K=0,W=0)):K=0}te=26}return G},R.prototype.convertTo=function(L){var P=L.umod(this.m);return P===L?P.clone():P},R.prototype.convertFrom=function(L){var P=L.clone();return P.red=null,P},h.mont=function(L){return new z(L)},d(z,R),z.prototype.convertTo=function(L){return this.imod(L.ushln(this.shift))},z.prototype.convertFrom=function(L){var P=this.imod(L.mul(this.rinv));return P.red=null,P},z.prototype.imul=function(L,P){if(L.isZero()||P.isZero())return L.words[0]=0,L.length=1,L;var N=L.imul(P),B=N.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=N.isub(B).iushrn(this.shift),W=G;return G.cmp(this.m)>=0?W=G.isub(this.m):G.cmpn(0)<0&&(W=G.iadd(this.m)),W._forceRed(this)},z.prototype.mul=function(L,P){if(L.isZero()||P.isZero())return new h(0)._forceRed(this);var N=L.mul(P),B=N.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=N.isub(B).iushrn(this.shift),W=G;return G.cmp(this.m)>=0?W=G.isub(this.m):G.cmpn(0)<0&&(W=G.iadd(this.m)),W._forceRed(this)},z.prototype.invm=function(L){return this.imod(L._invmp(this.m).mul(this.r2))._forceRed(this)}})(u===void 0||u,this)},{buffer:2}],34:[function(a,u,c){u.exports=function(i){var s,l,d,h=i.length,m=0;for(s=0;s>>1;if(!(M<=0)){var A,S=s.mallocDouble(2*M*T),E=s.mallocInt32(T);if((T=m(x,M,S,E))>0){if(M===1&&b)l.init(T),A=l.sweepComplete(M,k,0,T,S,E,0,T,S,E);else{var D=s.mallocDouble(2*M*_),O=s.mallocInt32(_);(_=m(w,M,D,O))>0&&(l.init(T+_),A=M===1?l.sweepBipartite(M,k,0,T,S,E,0,_,D,O):d(M,k,b,T,S,E,_,D,O),s.free(D),s.free(O))}s.free(S),s.free(E)}return A}}}function p(x,w){i.push([x,w])}function v(x){return i=[],g(x,x,p,!0),i}function y(x,w){return i=[],g(x,w,p,!1),i}},{"./lib/intersect":37,"./lib/sweep":41,"typedarray-pool":308}],36:[function(a,u,c){function i(s){return s?function(l,d,h,m,g,p,v,y,x,w,k){return g-m>x-y?function(b,T,_,M,A,S,E,D,O,R,z){for(var L=2*b,P=M,N=L*M;Pw-x?m?function(T,_,M,A,S,E,D,O,R,z,L){for(var P=2*T,N=A,B=P*A;N0;){var te=6*(W-=1),Y=T[te],Z=T[te+1],re=T[te+2],U=T[te+3],q=T[te+4],$=T[te+5],ne=2*W,H=_[ne],Q=_[ne+1],ee=1&$,ie=!!(16&$),ae=z,ue=L,le=N,ge=B;if(ee&&(ae=N,ue=B,le=z,ge=L),!(2&$&&(re=x(E,Y,Z,re,ae,ue,Q),Z>=re)||4&$&&(Z=w(E,Y,Z,re,ae,ue,H))>=re)){var fe=re-Z,me=q-U;if(ie){if(E*fe*(fe+me)<1<<22){if((G=m.scanComplete(E,Y,D,Z,re,ae,ue,U,q,le,ge))!==void 0)return G;continue}}else{if(E*Math.min(fe,me)<128){if((G=d(E,Y,D,ee,Z,re,ae,ue,U,q,le,ge))!==void 0)return G;continue}if(E*fe*me<1<<22){if((G=m.scanBipartite(E,Y,D,ee,Z,re,ae,ue,U,q,le,ge))!==void 0)return G;continue}}var _e=v(E,Y,Z,re,ae,ue,H,Q);if(Z<_e)if(E*(_e-Z)<128){if((G=h(E,Y+1,D,Z,_e,ae,ue,U,q,le,ge))!==void 0)return G}else if(Y===E-2){if((G=ee?m.sweepBipartite(E,D,U,q,le,ge,Z,_e,ae,ue):m.sweepBipartite(E,D,Z,_e,ae,ue,U,q,le,ge))!==void 0)return G}else M(W++,Y+1,Z,_e,U,q,ee,-1/0,1/0),M(W++,Y+1,U,q,Z,_e,1^ee,-1/0,1/0);if(_e=p0)&&!(p1>=hi)"),y=p("lo===p0"),x=p("lo>>1,w=2*l,k=x,b=g[w*x+d];v=S?(k=A,b=S):M>=D?(k=_,b=M):(k=E,b=D):S>=D?(k=A,b=S):D>=M?(k=_,b=M):(k=E,b=D);for(var O=w*(y-1),R=w*k,z=0;zh&&g[b+d]>w;--k,b-=v){for(var T=b,_=b+v,M=0;Mb;++b,y+=v)if(m[y+k]===p)if(w===b)w+=1,x+=v;else{for(var T=0;v>T;++T){var _=m[y+T];m[y+T]=m[x],m[x++]=_}var M=g[b];g[b]=g[w],g[w++]=M}return w},"lob;++b,y+=v)if(m[y+k]T;++T){var _=m[y+T];m[y+T]=m[x],m[x++]=_}var M=g[b];g[b]=g[w],g[w++]=M}return w},"lo<=p0":function(s,l,d,h,m,g,p){for(var v=2*s,y=v*d,x=y,w=d,k=s+l,b=d;h>b;++b,y+=v)if(m[y+k]<=p)if(w===b)w+=1,x+=v;else{for(var T=0;v>T;++T){var _=m[y+T];m[y+T]=m[x],m[x++]=_}var M=g[b];g[b]=g[w],g[w++]=M}return w},"hi<=p0":function(s,l,d,h,m,g,p){for(var v=2*s,y=v*d,x=y,w=d,k=s+l,b=d;h>b;++b,y+=v)if(m[y+k]<=p)if(w===b)w+=1,x+=v;else{for(var T=0;v>T;++T){var _=m[y+T];m[y+T]=m[x],m[x++]=_}var M=g[b];g[b]=g[w],g[w++]=M}return w},"loT;++T,y+=v){var _=m[y+k],M=m[y+b];if(_A;++A){var S=m[y+A];m[y+A]=m[x],m[x++]=S}var E=g[T];g[T]=g[w],g[w++]=E}}return w},"lo<=p0&&p0<=hi":function(s,l,d,h,m,g,p){for(var v=2*s,y=v*d,x=y,w=d,k=l,b=s+l,T=d;h>T;++T,y+=v){var _=m[y+k],M=m[y+b];if(_<=p&&p<=M)if(w===T)w+=1,x+=v;else{for(var A=0;v>A;++A){var S=m[y+A];m[y+A]=m[x],m[x++]=S}var E=g[T];g[T]=g[w],g[w++]=E}}return w},"!(lo>=p0)&&!(p1>=hi)":function(s,l,d,h,m,g,p,v){for(var y=2*s,x=y*d,w=x,k=d,b=l,T=s+l,_=d;h>_;++_,x+=y){var M=m[x+b],A=m[x+T];if(!(M>=p||v>=A))if(k===_)k+=1,w+=y;else{for(var S=0;y>S;++S){var E=m[x+S];m[x+S]=m[w],m[w++]=E}var D=g[_];g[_]=g[k],g[k++]=D}}return k}}},{}],40:[function(a,u,c){u.exports=function(p,v){v<=128?i(0,v-1,p):function y(x,w,k){var b=(w-x+1)/6|0,T=x+b,_=w-b,M=x+w>>1,A=M-b,S=M+b,E=T,D=A,O=M,R=S,z=_,L=x+1,P=w-1,N=0;m(E,D,k)&&(N=E,E=D,D=N),m(R,z,k)&&(N=R,R=z,z=N),m(E,O,k)&&(N=E,E=O,O=N),m(D,O,k)&&(N=D,D=O,O=N),m(E,R,k)&&(N=E,E=R,R=N),m(O,R,k)&&(N=O,O=R,R=N),m(D,z,k)&&(N=D,D=z,z=N),m(D,O,k)&&(N=D,D=O,O=N),m(R,z,k)&&(N=R,R=z,z=N);for(var B=k[2*D],G=k[2*D+1],W=k[2*R],K=k[2*R+1],te=2*E,Y=2*O,Z=2*z,re=2*T,U=2*M,q=2*_,$=0;$<2;++$){var ne=k[te+$],H=k[Y+$],Q=k[Z+$];k[re+$]=ne,k[U+$]=H,k[q+$]=Q}l(A,x,k),l(S,w,k);for(var ee=L;ee<=P;++ee)if(g(ee,B,G,k))ee!==L&&s(ee,L,k),++L;else if(!g(ee,W,K,k))for(;;){if(g(P,W,K,k)){g(P,B,G,k)?(d(ee,L,P,k),++L,--P):(s(ee,P,k),--P);break}if(--Pp;){var M=y[_-2],A=y[_-1];if(My[v+1])}function g(p,v,y,x){var w=x[p*=2];return w>>1;l(y,K);var te=0,Y=0;for(N=0;N=1<<28)x(m,g,Y--,Z=Z-(1<<28)|0);else if(Z>=0)x(d,h,te--,Z);else if(Z<=-(1<<28)){Z=-Z-(1<<28)|0;for(var re=0;re>>1;l(y,K);var te=0,Y=0,Z=0;for(N=0;N>1==y[2*N+3]>>1&&(U=2,N+=1),re<0){for(var q=-(re>>1)-1,$=0;$>1)-1,U===0?x(d,h,te--,q):U===1?x(m,g,Y--,q):U===2&&x(p,v,Z--,q)}},scanBipartite:function(k,b,T,_,M,A,S,E,D,O,R,z){var L=0,P=2*k,N=b,B=b+k,G=1,W=1;_?W=1<<28:G=1<<28;for(var K=M;K>>1;l(y,re);var U=0;for(K=0;K=1<<28?($=!_,te-=1<<28):($=!!_,te-=1),$)w(d,h,U++,te);else{var ne=z[te],H=P*te,Q=R[H+b+1],ee=R[H+b+1+k];e:for(var ie=0;ie>>1;l(y,te);var Y=0;for(B=0;B=1<<28)d[Y++]=G-(1<<28);else{var re=R[G-=1],U=L*G,q=O[U+b+1],$=O[U+b+1+k];e:for(var ne=0;ne=0;--ne)if(d[ne]===G){for(ie=ne+1;ie0;){for(var b=h.pop(),T=(p=h.pop(),x=-1,w=-1,v=g[p],1);T=0||(d.flip(p,b),s(l,d,h,x,p,w),s(l,d,h,p,w,x),s(l,d,h,w,b,x),s(l,d,h,b,x,w))}}},{"binary-search-bounds":31,"robust-in-sphere":282}],44:[function(a,u,c){var i,s=a("binary-search-bounds");function l(h,m,g,p,v,y,x){this.cells=h,this.neighbor=m,this.flags=p,this.constraint=g,this.active=v,this.next=y,this.boundary=x}function d(h,m){return h[0]-m[0]||h[1]-m[1]||h[2]-m[2]}u.exports=function(h,m,g){var p=function(D,O){for(var R=D.cells(),z=R.length,L=0;L0||x.length>0;){for(;y.length>0;){var _=y.pop();if(w[_]!==-v){w[_]=v,k[_];for(var M=0;M<3;++M){var A=T[3*_+M];A>=0&&w[A]===0&&(b[3*_+M]?x.push(A):(y.push(A),w[A]=v))}}}var S=x;x=y,y=S,x.length=0,v=-v}var E=function(D,O,R){for(var z=0,L=0;L1&&s(k[E[D-2]],k[E[D-1]],b)>0;)x.push([E[D-1],E[D-2],T]),D-=1;E.length=D,E.push(T);var O=S.upperIds;for(D=O.length;D>1&&s(k[O[D-2]],k[O[D-1]],b)<0;)x.push([O[D-2],O[D-1],T]),D-=1;O.length=D,O.push(T)}}function p(x,w){var k;return(k=x.a[0]S[0]&&T.push(new d(S,A,2,_),new d(A,S,1,_))}T.sort(h);for(var E=T[0].a[0]-(1+Math.abs(T[0].a[0]))*Math.pow(2,-52),D=[new l([E,1],[E,0],-1,[],[],[],[])],O=[],R=(_=0,T.length);_=0}}(),l.removeTriangle=function(h,m,g){var p=this.stars;d(p[h],m,g),d(p[m],g,h),d(p[g],h,m)},l.addTriangle=function(h,m,g){var p=this.stars;p[h].push(m,g),p[m].push(g,h),p[g].push(h,m)},l.opposite=function(h,m){for(var g=this.stars[m],p=1,v=g.length;pA[2]?1:0)}function T(M,A,S){if(M.length!==0){if(A)for(var E=0;E=0;--W){var ne=P[K=(ge=B[W])[0]],H=ne[0],Q=ne[1],ee=L[H],ie=L[Q];if((ee[0]-ie[0]||ee[1]-ie[1])<0){var ae=H;H=Q,Q=ae}ne[0]=H;var ue,le=ne[1]=ge[1];for(G&&(ue=ne[2]);W>0&&B[W-1][0]===K;){var ge,fe=(ge=B[--W])[1];G?P.push([le,fe,ue]):P.push([le,fe]),le=fe}G?P.push([le,Q,ue]):P.push([le,Q])}return te}(M,A,D,R,S));return T(A,z,S),!!z||D.length>0||R.length>0}},{"./lib/rat-seg-intersect":51,"big-rat":18,"big-rat/cmp":16,"big-rat/to-float":30,"box-intersect":35,nextafter:260,"rat-vec":273,"robust-segment-intersect":287,"union-find":309}],51:[function(a,u,c){u.exports=function(v,y,x,w){var k=h(y,v),b=h(w,x),T=p(k,b);if(d(T)===0)return null;var _=h(v,x),M=p(b,_),A=s(M,T),S=g(k,A);return m(v,S)};var i=a("big-rat/mul"),s=a("big-rat/div"),l=a("big-rat/sub"),d=a("big-rat/sign"),h=a("rat-vec/sub"),m=a("rat-vec/add"),g=a("rat-vec/muls");function p(v,y){return l(i(v[0],y[1]),i(v[1],y[0]))}},{"big-rat/div":17,"big-rat/mul":27,"big-rat/sign":28,"big-rat/sub":29,"rat-vec/add":272,"rat-vec/muls":274,"rat-vec/sub":275}],52:[function(a,u,c){u.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]}]}},{}],53:[function(a,u,c){var i=a("./colorScale"),s=a("lerp");function l(m){return[m[0]/255,m[1]/255,m[2]/255,m[3]]}function d(m){for(var g,p="#",v=0;v<3;++v)p+=("00"+(g=(g=m[v]).toString(16))).substr(g.length);return p}function h(m){return"rgba("+m.join(",")+")"}u.exports=function(m){var g,p,v,y,x,w,k,b,T,_;if(m||(m={}),b=(m.nshades||72)-1,k=m.format||"hex",(w=m.colormap)||(w="jet"),typeof w=="string"){if(w=w.toLowerCase(),!i[w])throw Error(w+" not a supported colorscale");x=i[w]}else{if(!Array.isArray(w))throw Error("unsupported colormap option",w);x=w.slice()}if(x.length>b+1)throw new Error(w+" map requires nshades to be at least size "+x.length);T=Array.isArray(m.alpha)?m.alpha.length!==2?[1,1]:m.alpha.slice():typeof m.alpha=="number"?[m.alpha,m.alpha]:[1,1],g=x.map(function(D){return Math.round(D.index*b)}),T[0]=Math.min(Math.max(T[0],0),1),T[1]=Math.min(Math.max(T[1],0),1);var M=x.map(function(D,O){var R=x[O].index,z=x[O].rgb.slice();return z.length===4&&z[3]>=0&&z[3]<=1||(z[3]=T[0]+(T[1]-T[0])*R),z}),A=[];for(_=0;_0||m(g,p,y)?-1:1:w===0?k>0||m(g,p,v)?1:-1:s(k-w)}var _=i(g,p,v);return _>0?x>0&&i(g,p,y)>0?1:-1:_<0?x>0||i(g,p,y)>0?1:-1:i(g,p,y)>0||m(g,p,v)?1:-1};var i=a("robust-orientation"),s=a("signum"),l=a("two-sum"),d=a("robust-product"),h=a("robust-sum");function m(g,p,v){var y=l(g[0],-p[0]),x=l(g[1],-p[1]),w=l(v[0],-p[0]),k=l(v[1],-p[1]),b=h(d(y,w),d(x,k));return b[b.length-1]>=0}},{"robust-orientation":284,"robust-product":285,"robust-sum":289,signum:55,"two-sum":307}],55:[function(a,u,c){u.exports=function(i){return i<0?-1:i>0?1:0}},{}],56:[function(a,u,c){u.exports=function(l,d){var h=l.length,m=l.length-d.length;if(m)return m;switch(h){case 0:return 0;case 1:return l[0]-d[0];case 2:return l[0]+l[1]-d[0]-d[1]||i(l[0],l[1])-i(d[0],d[1]);case 3:var g=l[0]+l[1],p=d[0]+d[1];if(m=g+l[2]-(p+d[2]))return m;var v=i(l[0],l[1]),y=i(d[0],d[1]);return i(v,l[2])-i(y,d[2])||i(v+l[2],g)-i(y+d[2],p);case 4:var x=l[0],w=l[1],k=l[2],b=l[3],T=d[0],_=d[1],M=d[2],A=d[3];return x+w+k+b-(T+_+M+A)||i(x,w,k,b)-i(T,_,M,A,T)||i(x+w,x+k,x+b,w+k,w+b,k+b)-i(T+_,T+M,T+A,_+M,_+A,M+A)||i(x+w+k,x+w+b,x+k+b,w+k+b)-i(T+_+M,T+_+A,T+M+A,_+M+A);default:for(var S=l.slice().sort(s),E=d.slice().sort(s),D=0;Di[l][0]&&(l=d);return sl?[[l],[s]]:[[s]]}},{}],60:[function(a,u,c){u.exports=function(s){var l=i(s),d=l.length;if(d<=2)return[];for(var h=new Array(d),m=l[d-1],g=0;g=v[_]&&(T+=1);k[b]=T}}return p}(i(m,!0),h)}};var i=a("incremental-convex-hull"),s=a("affine-hull")},{"affine-hull":10,"incremental-convex-hull":233}],62:[function(a,u,c){u.exports=function(i,s,l,d,h,m){var g=h-1,p=h*h,v=g*g,y=(1+2*h)*v,x=h*v,w=p*(3-2*h),k=p*g;if(i.length){m||(m=new Array(i.length));for(var b=i.length-1;b>=0;--b)m[b]=y*i[b]+x*s[b]+w*l[b]+k*d[b];return m}return y*i+x*s+w*l+k*d},u.exports.derivative=function(i,s,l,d,h,m){var g=6*h*h-6*h,p=3*h*h-4*h+1,v=-6*h*h+6*h,y=3*h*h-2*h;if(i.length){m||(m=new Array(i.length));for(var x=i.length-1;x>=0;--x)m[x]=g*i[x]+p*s[x]+v*l[x]+y*d[x];return m}return g*i+p*s+v*l[x]+y*d}},{}],63:[function(a,u,c){var i=a("incremental-convex-hull"),s=a("uniq");function l(h,m){this.point=h,this.index=m}function d(h,m){for(var g=h.point,p=m.point,v=g.length,y=0;y=2)return!1;R[L]=P}return!0}):O.filter(function(R){for(var z=0;z<=p;++z){var L=A[R[z]];if(L<0)return!1;R[z]=L}return!0}),1&p)for(x=0;x>>31},u.exports.exponent=function(m){return(u.exports.hi(m)<<1>>>21)-1023},u.exports.fraction=function(m){var g=u.exports.lo(m),p=u.exports.hi(m),v=1048575&p;return 2146435072&p&&(v+=1<<20),[g,v]},u.exports.denormalized=function(m){return!(2146435072&u.exports.hi(m))}}).call(this)}).call(this,a("buffer").Buffer)},{buffer:3}],65:[function(a,u,c){u.exports=function(i,s){switch(s===void 0&&(s=0),typeof i){case"number":if(i>0)return function(l,d){var h,m;for(h=new Array(l),m=0;m=v-1){_=w.length-1;var A=g-p[v-1];for(M=0;M=v-1)for(var T=w.length-1,_=(p[v-1],0);_=0;--v)if(g[--p])return!1;return!0},h.jump=function(g){var p=this.lastT(),v=this.dimension;if(!(g0;--M)y.push(l(b[M-1],T[M-1],arguments[M])),x.push(0)}},h.push=function(g){var p=this.lastT(),v=this.dimension;if(!(g1e-6?1/k:0;this._time.push(g);for(var A=v;A>0;--A){var S=l(T[A-1],_[A-1],arguments[A]);y.push(S),x.push((S-y[w++])*M)}}},h.set=function(g){var p=this.dimension;if(!(g0;--b)v.push(l(w[b-1],k[b-1],arguments[b])),y.push(0)}},h.move=function(g){var p=this.lastT(),v=this.dimension;if(!(g<=p||arguments.length!==v+1)){var y=this._state,x=this._velocity,w=y.length-this.dimension,k=this.bounds,b=k[0],T=k[1],_=g-p,M=_>1e-6?1/_:0;this._time.push(g);for(var A=v;A>0;--A){var S=arguments[A];y.push(l(b[A-1],T[A-1],y[w++]+S)),x.push(S*M)}}},h.idle=function(g){var p=this.lastT();if(!(g=0;--M)y.push(l(b[M],T[M],y[w]+_*x[w])),x.push(0),w+=1}}},{"binary-search-bounds":31,"cubic-hermite":62}],69:[function(a,u,c){u.exports=function(b){return new h(b||k,null)};function i(b,T,_,M,A,S){this._color=b,this.key=T,this.value=_,this.left=M,this.right=A,this._count=S}function s(b){return new i(b._color,b.key,b.value,b.left,b.right,b._count)}function l(b,T){return new i(b,T.key,T.value,T.left,T.right,T._count)}function d(b){b._count=1+(b.left?b.left._count:0)+(b.right?b.right._count:0)}function h(b,T){this._compare=b,this.root=T}var m=h.prototype;function g(b,T){var _;return T.left&&(_=g(b,T.left))?_:(_=b(T.key,T.value))||(T.right?g(b,T.right):void 0)}function p(b,T,_,M){if(T(b,M.key)<=0){var A;if(M.left&&(A=p(b,T,_,M.left))||(A=_(M.key,M.value)))return A}if(M.right)return p(b,T,_,M.right)}function v(b,T,_,M,A){var S,E=_(b,A.key),D=_(T,A.key);if(E<=0&&(A.left&&(S=v(b,T,_,M,A.left))||D>0&&(S=M(A.key,A.value))))return S;if(D>0&&A.right)return v(b,T,_,M,A.right)}function y(b,T){this.tree=b,this._stack=T}Object.defineProperty(m,"keys",{get:function(){var b=[];return this.forEach(function(T,_){b.push(T)}),b}}),Object.defineProperty(m,"values",{get:function(){var b=[];return this.forEach(function(T,_){b.push(_)}),b}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(b,T){for(var _=this._compare,M=this.root,A=[],S=[];M;){var E=_(b,M.key);A.push(M),S.push(E),M=E<=0?M.left:M.right}A.push(new i(0,b,T,null,null,1));for(var D=A.length-2;D>=0;--D)M=A[D],S[D]<=0?A[D]=new i(M._color,M.key,M.value,A[D+1],M.right,M._count+1):A[D]=new i(M._color,M.key,M.value,M.left,A[D+1],M._count+1);for(D=A.length-1;D>1;--D){var O=A[D-1];if(M=A[D],O._color===1||M._color===1)break;var R=A[D-2];if(R.left===O)if(O.left===M){if(!(z=R.right)||z._color!==0){R._color=0,R.left=O.right,O._color=1,O.right=R,A[D-2]=O,A[D-1]=M,d(R),d(O),D>=3&&((L=A[D-3]).left===R?L.left=O:L.right=O);break}O._color=1,R.right=l(1,z),R._color=0,D-=1}else{if(!(z=R.right)||z._color!==0){O.right=M.left,R._color=0,R.left=M.right,M._color=1,M.left=O,M.right=R,A[D-2]=M,A[D-1]=O,d(R),d(O),d(M),D>=3&&((L=A[D-3]).left===R?L.left=M:L.right=M);break}O._color=1,R.right=l(1,z),R._color=0,D-=1}else if(O.right===M){if(!(z=R.left)||z._color!==0){R._color=0,R.right=O.left,O._color=1,O.left=R,A[D-2]=O,A[D-1]=M,d(R),d(O),D>=3&&((L=A[D-3]).right===R?L.right=O:L.left=O);break}O._color=1,R.left=l(1,z),R._color=0,D-=1}else{var z;if(!(z=R.left)||z._color!==0){var L;O.left=M.right,R._color=0,R.right=M.left,M._color=1,M.right=O,M.left=R,A[D-2]=M,A[D-1]=O,d(R),d(O),d(M),D>=3&&((L=A[D-3]).right===R?L.right=M:L.left=M);break}O._color=1,R.left=l(1,z),R._color=0,D-=1}}return A[0]._color=1,new h(_,A[0])},m.forEach=function(b,T,_){if(this.root)switch(arguments.length){case 1:return g(b,this.root);case 2:return p(T,this._compare,b,this.root);case 3:return this._compare(T,_)>=0?void 0:v(T,_,this._compare,b,this.root)}},Object.defineProperty(m,"begin",{get:function(){for(var b=[],T=this.root;T;)b.push(T),T=T.left;return new y(this,b)}}),Object.defineProperty(m,"end",{get:function(){for(var b=[],T=this.root;T;)b.push(T),T=T.right;return new y(this,b)}}),m.at=function(b){if(b<0)return new y(this,[]);for(var T=this.root,_=[];;){if(_.push(T),T.left){if(b=T.right._count)break;T=T.right}return new y(this,[])},m.ge=function(b){for(var T=this._compare,_=this.root,M=[],A=0;_;){var S=T(b,_.key);M.push(_),S<=0&&(A=M.length),_=S<=0?_.left:_.right}return M.length=A,new y(this,M)},m.gt=function(b){for(var T=this._compare,_=this.root,M=[],A=0;_;){var S=T(b,_.key);M.push(_),S<0&&(A=M.length),_=S<0?_.left:_.right}return M.length=A,new y(this,M)},m.lt=function(b){for(var T=this._compare,_=this.root,M=[],A=0;_;){var S=T(b,_.key);M.push(_),S>0&&(A=M.length),_=S<=0?_.left:_.right}return M.length=A,new y(this,M)},m.le=function(b){for(var T=this._compare,_=this.root,M=[],A=0;_;){var S=T(b,_.key);M.push(_),S>=0&&(A=M.length),_=S<0?_.left:_.right}return M.length=A,new y(this,M)},m.find=function(b){for(var T=this._compare,_=this.root,M=[];_;){var A=T(b,_.key);if(M.push(_),A===0)return new y(this,M);_=A<=0?_.left:_.right}return new y(this,[])},m.remove=function(b){var T=this.find(b);return T?T.remove():this},m.get=function(b){for(var T=this._compare,_=this.root;_;){var M=T(b,_.key);if(M===0)return _.value;_=M<=0?_.left:_.right}};var x=y.prototype;function w(b,T){b.key=T.key,b.value=T.value,b.left=T.left,b.right=T.right,b._color=T._color,b._count=T._count}function k(b,T){return bT?1:0}Object.defineProperty(x,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(x,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),x.clone=function(){return new y(this.tree,this._stack.slice())},x.remove=function(){var b=this._stack;if(b.length===0)return this.tree;var T=new Array(b.length),_=b[b.length-1];T[T.length-1]=new i(_._color,_.key,_.value,_.left,_.right,_._count);for(var M=b.length-2;M>=0;--M)(_=b[M]).left===b[M+1]?T[M]=new i(_._color,_.key,_.value,T[M+1],_.right,_._count):T[M]=new i(_._color,_.key,_.value,_.left,T[M+1],_._count);if((_=T[T.length-1]).left&&_.right){var A=T.length;for(_=_.left;_.right;)T.push(_),_=_.right;var S=T[A-1];for(T.push(new i(_._color,S.key,S.value,_.left,_.right,_._count)),T[A-1].key=_.key,T[A-1].value=_.value,M=T.length-2;M>=A;--M)_=T[M],T[M]=new i(_._color,_.key,_.value,_.left,T[M+1],_._count);T[A-1].left=T[A]}if((_=T[T.length-1])._color===0){var E=T[T.length-2];for(E.left===_?E.left=null:E.right===_&&(E.right=null),T.pop(),M=0;M=0;--N){if(R=O[N],N===0)return void(R._color=1);if((z=O[N-1]).left===R){if((L=z.right).right&&L.right._color===0)return P=(L=z.right=s(L)).right=s(L.right),z.right=L.left,L.left=z,L.right=P,L._color=z._color,R._color=1,z._color=1,P._color=1,d(z),d(L),N>1&&((B=O[N-2]).left===z?B.left=L:B.right=L),void(O[N-1]=L);if(L.left&&L.left._color===0)return P=(L=z.right=s(L)).left=s(L.left),z.right=P.left,L.left=P.right,P.left=z,P.right=L,P._color=z._color,z._color=1,L._color=1,R._color=1,d(z),d(L),d(P),N>1&&((B=O[N-2]).left===z?B.left=P:B.right=P),void(O[N-1]=P);if(L._color===1){if(z._color===0)return z._color=1,void(z.right=l(0,L));z.right=l(0,L);continue}L=s(L),z.right=L.left,L.left=z,L._color=z._color,z._color=0,d(z),d(L),N>1&&((B=O[N-2]).left===z?B.left=L:B.right=L),O[N-1]=L,O[N]=z,N+11&&((B=O[N-2]).right===z?B.right=L:B.left=L),void(O[N-1]=L);if(L.right&&L.right._color===0)return P=(L=z.left=s(L)).right=s(L.right),z.left=P.right,L.right=P.left,P.right=z,P.left=L,P._color=z._color,z._color=1,L._color=1,R._color=1,d(z),d(L),d(P),N>1&&((B=O[N-2]).right===z?B.right=P:B.left=P),void(O[N-1]=P);if(L._color===1){if(z._color===0)return z._color=1,void(z.left=l(0,L));z.left=l(0,L);continue}var B;L=s(L),z.left=L.right,L.right=z,L._color=z._color,z._color=0,d(z),d(L),N>1&&((B=O[N-2]).right===z?B.right=L:B.left=L),O[N-1]=L,O[N]=z,N+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(x,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(x,"index",{get:function(){var b=0,T=this._stack;if(T.length===0){var _=this.tree.root;return _?_._count:0}T[T.length-1].left&&(b=T[T.length-1].left._count);for(var M=T.length-2;M>=0;--M)T[M+1]===T[M].right&&(++b,T[M].left&&(b+=T[M].left._count));return b},enumerable:!0}),x.next=function(){var b=this._stack;if(b.length!==0){var T=b[b.length-1];if(T.right)for(T=T.right;T;)b.push(T),T=T.left;else for(b.pop();b.length>0&&b[b.length-1].right===T;)T=b[b.length-1],b.pop()}},Object.defineProperty(x,"hasNext",{get:function(){var b=this._stack;if(b.length===0)return!1;if(b[b.length-1].right)return!0;for(var T=b.length-1;T>0;--T)if(b[T-1].left===b[T])return!0;return!1}}),x.update=function(b){var T=this._stack;if(T.length===0)throw new Error("Can't update empty node!");var _=new Array(T.length),M=T[T.length-1];_[_.length-1]=new i(M._color,M.key,b,M.left,M.right,M._count);for(var A=T.length-2;A>=0;--A)(M=T[A]).left===T[A+1]?_[A]=new i(M._color,M.key,M.value,_[A+1],M.right,M._count):_[A]=new i(M._color,M.key,M.value,M.left,_[A+1],M._count);return new h(this.tree._compare,_[0])},x.prev=function(){var b=this._stack;if(b.length!==0){var T=b[b.length-1];if(T.left)for(T=T.left;T;)b.push(T),T=T.right;else for(b.pop();b.length>0&&b[b.length-1].left===T;)T=b[b.length-1],b.pop()}},Object.defineProperty(x,"hasPrev",{get:function(){var b=this._stack;if(b.length===0)return!1;if(b[b.length-1].left)return!0;for(var T=b.length-1;T>0;--T)if(b[T-1].right===b[T])return!0;return!1}})},{}],70:[function(a,u,c){u.exports=function(A,S){var E=new p(A);return E.update(S),E};var i=a("./lib/text.js"),s=a("./lib/lines.js"),l=a("./lib/background.js"),d=a("./lib/cube.js"),h=a("./lib/ticks.js"),m=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function g(A,S){return A[0]=S[0],A[1]=S[1],A[2]=S[2],A}function p(A){this.gl=A,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.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",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=l(A)}var v=p.prototype;function y(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}v.update=function(A){function S(K,te,Y){if(Y in A){var Z,re=A[Y],U=this[Y];(K?Array.isArray(re)&&Array.isArray(re[0]):Array.isArray(re))?this[Y]=Z=[te(re[0]),te(re[1]),te(re[2])]:this[Y]=Z=[te(re),te(re),te(re)];for(var q=0;q<3;++q)if(Z[q]!==U[q])return!0}return!1}A=A||{};var E,D=S.bind(this,!1,Number),O=S.bind(this,!1,Boolean),R=S.bind(this,!1,String),z=S.bind(this,!0,function(K){if(Array.isArray(K)){if(K.length===3)return[+K[0],+K[1],+K[2],1];if(K.length===4)return[+K[0],+K[1],+K[2],+K[3]]}return[0,0,0,1]}),L=!1,P=!1;if("bounds"in A)for(var N=A.bounds,B=0;B<2;++B)for(var G=0;G<3;++G)N[B][G]!==this.bounds[B][G]&&(P=!0),this.bounds[B][G]=N[B][G];if("ticks"in A)for(E=A.ticks,L=!0,this.autoTicks=!1,B=0;B<3;++B)this.tickSpacing[B]=0;else D("tickSpacing")&&(this.autoTicks=!0,P=!0);if(this._firstInit&&("ticks"in A||"tickSpacing"in A||(this.autoTicks=!0),P=!0,L=!0,this._firstInit=!1),P&&this.autoTicks&&(E=h.create(this.bounds,this.tickSpacing),L=!0),L){for(B=0;B<3;++B)E[B].sort(function(K,te){return K.x-te.x});h.equal(E,this.ticks)?L=!1:this.ticks=E}O("tickEnable"),R("tickFont")&&(L=!0),D("tickSize"),D("tickAngle"),D("tickPad"),z("tickColor");var W=R("labels");R("labelFont")&&(W=!0),O("labelEnable"),D("labelSize"),D("labelPad"),z("labelColor"),O("lineEnable"),O("lineMirror"),D("lineWidth"),z("lineColor"),O("lineTickEnable"),O("lineTickMirror"),D("lineTickLength"),D("lineTickWidth"),z("lineTickColor"),O("gridEnable"),D("gridWidth"),z("gridColor"),O("zeroEnable"),z("zeroLineColor"),D("zeroLineWidth"),O("backgroundEnable"),z("backgroundColor"),this._text?this._text&&(W||L)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=i(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&L&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=s(this.gl,this.bounds,this.ticks))};var x=[new y,new y,new y];function w(A,S,E,D,O){for(var R=A.primalOffset,z=A.primalMinor,L=A.mirrorOffset,P=A.mirrorMinor,N=D[S],B=0;B<3;++B)if(S!==B){var G=R,W=L,K=z,te=P;N&1<0?(K[B]=-1,te[B]=0):(K[B]=0,te[B]=1)}}var k=[0,0,0],b={model:m,view:m,projection:m,_ortho:!1};v.isOpaque=function(){return!0},v.isTransparent=function(){return!1},v.drawTransparent=function(A){};var T=[0,0,0],_=[0,0,0],M=[0,0,0];v.draw=function(A){A=A||b;for(var S=this.gl,E=A.model||m,D=A.view||m,O=A.projection||m,R=this.bounds,z=A._ortho||!1,L=d(E,D,O,R,z),P=L.cubeEdges,N=L.axis,B=D[12],G=D[13],W=D[14],K=D[15],te=(z?2:1)*this.pixelRatio*(O[3]*B+O[7]*G+O[11]*W+O[15]*K)/S.drawingBufferHeight,Y=0;Y<3;++Y)this.lastCubeProps.cubeEdges[Y]=P[Y],this.lastCubeProps.axis[Y]=N[Y];var Z=x;for(Y=0;Y<3;++Y)w(x[Y],Y,this.bounds,P,N);S=this.gl;var re,U=k;for(Y=0;Y<3;++Y)this.backgroundEnable[Y]?U[Y]=N[Y]:U[Y]=0;for(this._background.draw(E,D,O,R,U,this.backgroundColor),this._lines.bind(E,D,O,this),Y=0;Y<3;++Y){var q=[0,0,0];N[Y]>0?q[Y]=R[1][Y]:q[Y]=R[0][Y];for(var $=0;$<2;++$){var ne=(Y+1+$)%3,H=(Y+1+(1^$))%3;this.gridEnable[ne]&&this._lines.drawGrid(ne,H,this.bounds,q,this.gridColor[ne],this.gridWidth[ne]*this.pixelRatio)}for($=0;$<2;++$)ne=(Y+1+$)%3,H=(Y+1+(1^$))%3,this.zeroEnable[H]&&Math.min(R[0][H],R[1][H])<=0&&Math.max(R[0][H],R[1][H])>=0&&this._lines.drawZero(ne,H,this.bounds,q,this.zeroLineColor[H],this.zeroLineWidth[H]*this.pixelRatio)}for(Y=0;Y<3;++Y){this.lineEnable[Y]&&this._lines.drawAxisLine(Y,this.bounds,Z[Y].primalOffset,this.lineColor[Y],this.lineWidth[Y]*this.pixelRatio),this.lineMirror[Y]&&this._lines.drawAxisLine(Y,this.bounds,Z[Y].mirrorOffset,this.lineColor[Y],this.lineWidth[Y]*this.pixelRatio);var Q=g(T,Z[Y].primalMinor),ee=g(_,Z[Y].mirrorMinor),ie=this.lineTickLength;for($=0;$<3;++$){var ae=te/E[5*$];Q[$]*=ie[$]*ae,ee[$]*=ie[$]*ae}this.lineTickEnable[Y]&&this._lines.drawAxisTicks(Y,Z[Y].primalOffset,Q,this.lineTickColor[Y],this.lineTickWidth[Y]*this.pixelRatio),this.lineTickMirror[Y]&&this._lines.drawAxisTicks(Y,Z[Y].mirrorOffset,ee,this.lineTickColor[Y],this.lineTickWidth[Y]*this.pixelRatio)}this._lines.unbind(),this._text.bind(E,D,O,this.pixelRatio);var ue,le;function ge(Oe){(le=[0,0,0])[Oe]=1}function fe(Oe,de,ye){var Me=(Oe+1)%3,ke=(Oe+2)%3,Ee=de[Me],ze=de[ke],Fe=ye[Me],Ve=ye[ke];Ee>0&&Ve>0||Ee>0&&Ve<0||Ee<0&&Ve>0||Ee<0&&Ve<0?ge(Me):(ze>0&&Fe>0||ze>0&&Fe<0||ze<0&&Fe>0||ze<0&&Fe<0)&&ge(ke)}for(Y=0;Y<3;++Y){var me=Z[Y].primalMinor,_e=Z[Y].mirrorMinor,we=g(M,Z[Y].primalOffset);for($=0;$<3;++$)this.lineTickEnable[Y]&&(we[$]+=te*me[$]*Math.max(this.lineTickLength[$],0)/E[5*$]);var Te=[0,0,0];if(Te[Y]=1,this.tickEnable[Y]){for(this.tickAngle[Y]===-3600?(this.tickAngle[Y]=0,this.tickAlign[Y]="auto"):this.tickAlign[Y]=-1,ue=1,(re=[this.tickAlign[Y],.5,ue])[0]==="auto"?re[0]=0:re[0]=parseInt(""+re[0]),le=[0,0,0],fe(Y,me,_e),$=0;$<3;++$)we[$]+=te*me[$]*this.tickPad[$]/E[5*$];this._text.drawTicks(Y,this.tickSize[Y],this.tickAngle[Y],we,this.tickColor[Y],Te,le,re)}if(this.labelEnable[Y]){for(ue=0,le=[0,0,0],this.labels[Y].length>4&&(ge(Y),ue=1),(re=[this.labelAlign[Y],.5,ue])[0]==="auto"?re[0]=0:re[0]=parseInt(""+re[0]),$=0;$<3;++$)we[$]+=te*me[$]*this.labelPad[$]/E[5*$];we[Y]+=.5*(R[0][Y]+R[1][Y]),this._text.drawLabel(Y,this.labelSize[Y],this.labelAngle[Y],we,this.labelColor[Y],[0,0,0],le,re)}}this._text.unbind()},v.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":71,"./lib/cube.js":72,"./lib/lines.js":73,"./lib/text.js":75,"./lib/ticks.js":76}],71:[function(a,u,c){u.exports=function(m){for(var g=[],p=[],v=0,y=0;y<3;++y)for(var x=(y+1)%3,w=(y+2)%3,k=[0,0,0],b=[0,0,0],T=-1;T<=1;T+=2){p.push(v,v+2,v+1,v+1,v+2,v+3),k[y]=T,b[y]=T;for(var _=-1;_<=1;_+=2){k[x]=_;for(var M=-1;M<=1;M+=2)k[w]=M,g.push(k[0],k[1],k[2],b[0],b[1],b[2]),v+=1}var A=x;x=w,w=A}var S=i(m,new Float32Array(g)),E=i(m,new Uint16Array(p),m.ELEMENT_ARRAY_BUFFER),D=s(m,[{buffer:S,type:m.FLOAT,size:3,offset:0,stride:24},{buffer:S,type:m.FLOAT,size:3,offset:12,stride:24}],E),O=l(m);return O.attributes.position.location=0,O.attributes.normal.location=1,new d(m,S,D,O)};var i=a("gl-buffer"),s=a("gl-vao"),l=a("./shaders").bg;function d(m,g,p,v){this.gl=m,this.buffer=g,this.vao=p,this.shader=v}var h=d.prototype;h.draw=function(m,g,p,v,y,x){for(var w=!1,k=0;k<3;++k)w=w||y[k];if(w){var b=this.gl;b.enable(b.POLYGON_OFFSET_FILL),b.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:m,view:g,projection:p,bounds:v,enable:y,colors:x},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),b.disable(b.POLYGON_OFFSET_FILL)}},h.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":74,"gl-buffer":78,"gl-vao":150}],72:[function(a,u,c){u.exports=function(_,M,A,S,E){s(h,M,_),s(h,A,h);for(var D=0,O=0;O<2;++O){p[2]=S[O][2];for(var R=0;R<2;++R){p[1]=S[R][1];for(var z=0;z<2;++z)p[0]=S[z][0],y(m[D],p,h),D+=1}}var L=-1;for(O=0;O<8;++O){for(var P=m[O][3],N=0;N<3;++N)g[O][N]=m[O][N]/P;E&&(g[O][2]*=-1),P<0&&(L<0||g[O][2]K&&(L|=1<K&&(L|=1<g[O][1])&&(ne=O);var H=-1;for(O=0;O<3;++O)(ee=ne^1<g[Q][0]&&(Q=ee))}var ie=k;ie[0]=ie[1]=ie[2]=0,ie[i.log2(H^ne)]=ne&H,ie[i.log2(ne^Q)]=ne&Q;var ae=7^Q;ae===L||ae===$?(ae=7^H,ie[i.log2(Q^ae)]=ae&Q):ie[i.log2(H^ae)]=ae&H;var ue=b,le=L;for(B=0;B<3;++B)ue[B]=le&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ? + b - PI : + b; +} + +float look_horizontal_or_vertical(float a, float ratio) { + // ratio controls the ratio between being horizontal to (vertical + horizontal) + // if ratio is set to 0.5 then it is 50%, 50%. + // when using a higher ratio e.g. 0.75 the result would + // likely be more horizontal than vertical. + + float b = positive_angle(a); + + return + (b < ( ratio) * HALF_PI) ? 0.0 : + (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : + (b < (2.0 + ratio) * HALF_PI) ? 0.0 : + (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : + 0.0; +} + +float roundTo(float a, float b) { + return float(b * floor((a + 0.5 * b) / b)); +} + +float look_round_n_directions(float a, int n) { + float b = positive_angle(a); + float div = TWO_PI / float(n); + float c = roundTo(b, div); + return look_upwards(c); +} + +float applyAlignOption(float rawAngle, float delta) { + return + (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions + (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical + (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis + (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards + (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal + rawAngle; // otherwise return back raw input angle +} + +bool isAxisTitle = (axis.x == 0.0) && + (axis.y == 0.0) && + (axis.z == 0.0); + +void main() { + //Compute world offset + float axisDistance = position.z; + vec3 dataPosition = axisDistance * axis + offset; + + float beta = angle; // i.e. user defined attributes for each tick + + float axisAngle; + float clipAngle; + float flip; + + if (enableAlign) { + axisAngle = (isAxisTitle) ? HALF_PI : + computeViewAngle(dataPosition, dataPosition + axis); + clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); + + axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; + clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; + + flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), + vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; + + beta += applyAlignOption(clipAngle, flip * PI); + } + + //Compute plane offset + vec2 planeCoord = position.xy * pixelScale; + + mat2 planeXform = scale * mat2( + cos(beta), sin(beta), + -sin(beta), cos(beta) + ); + + vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; + + //Compute clip position + vec3 clipPosition = project(dataPosition); + + //Apply text offset in clip coordinates + clipPosition += vec3(viewOffset, 0.0); + + //Done + gl_Position = vec4(clipPosition, 1.0); +}`]),m=i([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);c.text=function(v){return s(v,h,m,null,[{name:"position",type:"vec3"}])};var g=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec3 normal; + +uniform mat4 model, view, projection; +uniform vec3 enable; +uniform vec3 bounds[2]; + +varying vec3 colorChannel; + +void main() { + + vec3 signAxis = sign(bounds[1] - bounds[0]); + + vec3 realNormal = signAxis * normal; + + if(dot(realNormal, enable) > 0.0) { + vec3 minRange = min(bounds[0], bounds[1]); + vec3 maxRange = max(bounds[0], bounds[1]); + vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); + gl_Position = projection * view * model * vec4(nPosition, 1.0); + } else { + gl_Position = vec4(0,0,0,0); + } + + colorChannel = abs(realNormal); +}`]),p=i([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 colors[3]; + +varying vec3 colorChannel; + +void main() { + gl_FragColor = colorChannel.x * colors[0] + + colorChannel.y * colors[1] + + colorChannel.z * colors[2]; +}`]);c.bg=function(v){return s(v,g,p,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":132,glslify:231}],75:[function(a,u,c){(function(i){(function(){u.exports=function(x,w,k,b,T,_){var M=s(x),A=l(x,[{buffer:M,size:3}]),S=h(x);S.attributes.position.location=0;var E=new p(x,S,M,A);return E.update(w,k,b,T,_),E};var s=a("gl-buffer"),l=a("gl-vao"),d=a("vectorize-text"),h=a("./shaders").text,m=window||i.global||{},g=m.__TEXT_CACHE||{};m.__TEXT_CACHE={};function p(x,w,k,b){this.gl=x,this.shader=w,this.buffer=k,this.vao=b,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var v=p.prototype,y=[0,0];v.bind=function(x,w,k,b){this.vao.bind(),this.shader.bind();var T=this.shader.uniforms;T.model=x,T.view=w,T.projection=k,T.pixelScale=b,y[0]=this.gl.drawingBufferWidth,y[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=y},v.unbind=function(){this.vao.unbind()},v.update=function(x,w,k,b,T){var _=[];function M(L,P,N,B,G,W){var K=g[N];K||(K=g[N]={});var te=K[P];te||(te=K[P]=function(Q,ee){try{return d(Q,ee)}catch(ie){return console.warn('error vectorizing text:"'+Q+'" error:',ie),{cells:[],positions:[]}}}(P,{triangles:!0,font:N,textAlign:"center",textBaseline:"middle",lineSpacing:G,styletags:W}));for(var Y=(B||12)/12,Z=te.positions,re=te.cells,U=0,q=re.length;U=0;--ne){var H=Z[$[ne]];_.push(Y*H[0],-Y*H[1],L)}}for(var A=[0,0,0],S=[0,0,0],E=[0,0,0],D=[0,0,0],O={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},R=0;R<3;++R){E[R]=_.length/3|0,M(.5*(x[0][R]+x[1][R]),w[R],k[R],12,1.25,O),D[R]=(_.length/3|0)-E[R],A[R]=_.length/3|0;for(var z=0;z=0&&(m=d.length-h-1);var g=Math.pow(10,m),p=Math.round(s*l*g),v=p+"";if(v.indexOf("e")>=0)return v;var y=p/g,x=p%g;p<0?(y=0|-Math.ceil(y),x=0|-x):(y=0|Math.floor(y),x|=0);var w=""+y;if(p<0&&(w="-"+w),m){for(var k=""+x;k.length=s[0][h];--g)m.push({x:g*l[h],text:i(l[h],g)});d.push(m)}return d},c.equal=function(s,l){for(var d=0;d<3;++d){if(s[d].length!==l[d].length)return!1;for(var h=0;hx)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return v.bufferSubData(y,b,k),x}function p(v,y){for(var x=i.malloc(v.length,y),w=v.length,k=0;k=0;--A){if(_[A]!==M)return!1;M*=T[A]}return!0}(v.shape,v.stride))v.offset===0&&v.data.length===v.shape[0]?this.length=g(this.gl,this.type,this.length,this.usage,v.data,y):this.length=g(this.gl,this.type,this.length,this.usage,v.data.subarray(v.offset,v.shape[0]),y);else{var w=i.malloc(v.size,x),k=l(w,v.shape);s.assign(k,v),this.length=g(this.gl,this.type,this.length,this.usage,y<0?w:w.subarray(0,v.size),y),i.free(w)}}else if(Array.isArray(v)){var b;b=this.type===this.gl.ELEMENT_ARRAY_BUFFER?p(v,"uint16"):p(v,"float32"),this.length=g(this.gl,this.type,this.length,this.usage,y<0?b:b.subarray(0,v.length),y),i.free(b)}else if(typeof v=="object"&&typeof v.length=="number")this.length=g(this.gl,this.type,this.length,this.usage,v,y);else{if(typeof v!="number"&&v!==void 0)throw new Error("gl-buffer: Invalid data type");if(y>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(v|=0)<=0&&(v=1),this.gl.bufferData(this.type,0|v,this.usage),this.length=v}},u.exports=function(v,y,x,w){if(x=x||v.ARRAY_BUFFER,w=w||v.DYNAMIC_DRAW,x!==v.ARRAY_BUFFER&&x!==v.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(w!==v.DYNAMIC_DRAW&&w!==v.STATIC_DRAW&&w!==v.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 k=v.createBuffer(),b=new h(v,x,k,0,w);return b.update(y),b}},{ndarray:259,"ndarray-ops":254,"typedarray-pool":308}],79:[function(a,u,c){var i=a("gl-vec3");u.exports=function(l,d){var h=l.positions,m=l.vectors,g={positions:[],vertexIntensity:[],vertexIntensityBounds:l.vertexIntensityBounds,vectors:[],cells:[],coneOffset:l.coneOffset,colormap:l.colormap};if(l.positions.length===0)return d&&(d[0]=[0,0,0],d[1]=[0,0,0]),g;for(var p=0,v=1/0,y=-1/0,x=1/0,w=-1/0,k=1/0,b=-1/0,T=null,_=null,M=[],A=1/0,S=!1,E=0;Ep&&(p=i.length(O)),E){var R=2*i.distance(T,D)/(i.length(_)+i.length(O));R?(A=Math.min(A,R),S=!1):S=!0}S||(T=D,_=O),M.push(O)}var z=[v,x,k],L=[y,w,b];d&&(d[0]=z,d[1]=L),p===0&&(p=1);var P=1/p;isFinite(A)||(A=1),g.vectorScale=A;var N=l.coneSize||.5;l.absoluteConeSize&&(N=l.absoluteConeSize*P),g.coneScale=N,E=0;for(var B=0;E=1},x.isTransparent=function(){return this.opacity<1},x.pickSlots=1,x.setPickBase=function(b){this.pickId=b},x.update=function(b){b=b||{};var T=this.gl;this.dirty=!0,"lightPosition"in b&&(this.lightPosition=b.lightPosition),"opacity"in b&&(this.opacity=b.opacity),"ambient"in b&&(this.ambientLight=b.ambient),"diffuse"in b&&(this.diffuseLight=b.diffuse),"specular"in b&&(this.specularLight=b.specular),"roughness"in b&&(this.roughness=b.roughness),"fresnel"in b&&(this.fresnel=b.fresnel),b.tubeScale!==void 0&&(this.tubeScale=b.tubeScale),b.vectorScale!==void 0&&(this.vectorScale=b.vectorScale),b.coneScale!==void 0&&(this.coneScale=b.coneScale),b.coneOffset!==void 0&&(this.coneOffset=b.coneOffset),b.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=T.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=T.LINEAR,this.texture.setPixels(function(ne){for(var H=p({colormap:ne,nshades:256,format:"rgba"}),Q=new Uint8Array(1024),ee=0;ee<256;++ee){for(var ie=H[ee],ae=0;ae<3;++ae)Q[4*ee+ae]=ie[ae];Q[4*ee+3]=255*ie[3]}return g(Q,[256,256,4],[4,0,1])}(b.colormap)),this.texture.generateMipmap());var _=b.cells,M=b.positions,A=b.vectors;if(M&&_&&A){var S=[],E=[],D=[],O=[],R=[];this.cells=_,this.positions=M,this.vectors=A;var z=b.meshColor||[1,1,1,1],L=b.vertexIntensity,P=1/0,N=-1/0;if(L)if(b.vertexIntensityBounds)P=+b.vertexIntensityBounds[0],N=+b.vertexIntensityBounds[1];else for(var B=0;B0){var P=this.triShader;P.bind(),P.uniforms=D,this.triangleVAO.bind(),T.drawArrays(T.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},x.drawPick=function(b){b=b||{};for(var T=this.gl,_=b.model||v,M=b.view||v,A=b.projection||v,S=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],E=0;E<3;++E)S[0][E]=Math.max(S[0][E],this.clipBounds[0][E]),S[1][E]=Math.min(S[1][E],this.clipBounds[1][E]);this._model=[].slice.call(_),this._view=[].slice.call(M),this._projection=[].slice.call(A),this._resolution=[T.drawingBufferWidth,T.drawingBufferHeight];var D={model:_,view:M,projection:A,clipBounds:S,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},O=this.pickShader;O.bind(),O.uniforms=D,this.triangleCount>0&&(this.triangleVAO.bind(),T.drawArrays(T.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},x.pick=function(b){if(!b||b.id!==this.pickId)return null;var T=b.value[0]+256*b.value[1]+65536*b.value[2],_=this.cells[T],M=this.positions[_[1]].slice(0,3),A={position:M,dataCoordinate:M,index:Math.floor(_[1]/48)};return this.traceType==="cone"?A.index=Math.floor(_[1]/48):this.traceType==="streamtube"&&(A.intensity=this.intensity[_[1]],A.velocity=this.vectors[_[1]].slice(0,3),A.divergence=this.vectors[_[1]][3],A.index=T),A},x.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()},u.exports=function(b,T,_){var M=_.shaders;arguments.length===1&&(b=(T=b).gl);var A=w(b,M),S=k(b,M),E=d(b,g(new Uint8Array([255,255,255,255]),[1,1,4]));E.generateMipmap(),E.minFilter=b.LINEAR_MIPMAP_LINEAR,E.magFilter=b.LINEAR;var D=s(b),O=s(b),R=s(b),z=s(b),L=s(b),P=l(b,[{buffer:D,type:b.FLOAT,size:4},{buffer:L,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:R,type:b.FLOAT,size:4},{buffer:z,type:b.FLOAT,size:2},{buffer:O,type:b.FLOAT,size:4}]),N=new y(b,E,A,S,D,O,L,R,z,P,_.traceType||"cone");return N.update(T),N}},{colormap:53,"gl-buffer":78,"gl-mat4/invert":98,"gl-mat4/multiply":100,"gl-shader":132,"gl-texture2d":146,"gl-vao":150,ndarray:259}],81:[function(a,u,c){var i=a("glslify"),s=i([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // 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). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec3 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, coneScale, coneOffset; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * conePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(conePosition, 1.0); + vec4 t_position = view * conePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = conePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),l=i([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),d=i([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // 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). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float vectorScale, coneScale, coneOffset; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + gl_Position = projection * view * conePosition; + f_id = id; + f_position = position.xyz; +} +`]),h=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);c.meshShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},c.pickShader={vertex:d,fragment:h,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:231}],82:[function(a,u,c){u.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"}},{}],83:[function(a,u,c){var i=a("./1.0/numbers");u.exports=function(s){return i[s]}},{"./1.0/numbers":82}],84:[function(a,u,c){u.exports=function(y){var x=y.gl,w=i(x),k=s(x,[{buffer:w,type:x.FLOAT,size:3,offset:0,stride:40},{buffer:w,type:x.FLOAT,size:4,offset:12,stride:40},{buffer:w,type:x.FLOAT,size:3,offset:28,stride:40}]),b=l(x);b.attributes.position.location=0,b.attributes.color.location=1,b.attributes.offset.location=2;var T=new h(x,w,k,b);return T.update(y),T};var i=a("gl-buffer"),s=a("gl-vao"),l=a("./shaders/index"),d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(y,x,w,k){this.gl=y,this.shader=k,this.buffer=x,this.vao=w,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 m=h.prototype;function g(y,x){for(var w=0;w<3;++w)y[0][w]=Math.min(y[0][w],x[w]),y[1][w]=Math.max(y[1][w],x[w])}m.isOpaque=function(){return!this.hasAlpha},m.isTransparent=function(){return this.hasAlpha},m.drawTransparent=m.draw=function(y){var x=this.gl,w=this.shader.uniforms;this.shader.bind();var k=w.view=y.view||d,b=w.projection=y.projection||d;w.model=y.model||d,w.clipBounds=this.clipBounds,w.opacity=this.opacity;var T=k[12],_=k[13],M=k[14],A=k[15],S=(y._ortho?2:1)*this.pixelRatio*(b[3]*T+b[7]*_+b[11]*M+b[15]*A)/x.drawingBufferHeight;this.vao.bind();for(var E=0;E<3;++E)x.lineWidth(this.lineWidth[E]*this.pixelRatio),w.capSize=this.capSize[E]*S,this.lineCount[E]&&x.drawArrays(x.LINES,this.lineOffset[E],this.lineCount[E]);this.vao.unbind()};var p=function(){for(var y=new Array(3),x=0;x<3;++x){for(var w=[],k=1;k<=2;++k)for(var b=-1;b<=1;b+=2){var T=[0,0,0];T[(k+x)%3]=b,w.push(T)}y[x]=w}return y}();function v(y,x,w,k){for(var b=p[k],T=0;T0&&((R=S.slice())[M]+=D[1][M],b.push(S[0],S[1],S[2],O[0],O[1],O[2],O[3],0,0,0,R[0],R[1],R[2],O[0],O[1],O[2],O[3],0,0,0),g(this.bounds,R),_+=2+v(b,R,O,M))}}this.lineCount[M]=_-this.lineOffset[M]}this.buffer.update(b)}},m.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":85,"gl-buffer":78,"gl-vao":150}],85:[function(a,u,c){var i=a("glslify"),s=a("gl-shader"),l=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, offset; +attribute vec4 color; +uniform mat4 model, view, projection; +uniform float capSize; +varying vec4 fragColor; +varying vec3 fragPosition; + +void main() { + vec4 worldPosition = model * vec4(position, 1.0); + worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); + gl_Position = projection * view * worldPosition; + fragColor = color; + fragPosition = position; +}`]),d=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float opacity; +varying vec3 fragPosition; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], fragPosition) || + fragColor.a * opacity == 0. + ) discard; + + gl_FragColor = opacity * fragColor; +}`]);u.exports=function(h){return s(h,l,d,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":132,glslify:231}],86:[function(a,u,c){var i=a("gl-texture2d");u.exports=function(T,_,M,A){s||(s=T.FRAMEBUFFER_UNSUPPORTED,l=T.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,d=T.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,h=T.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var S=T.getExtension("WEBGL_draw_buffers");if(!m&&S&&function(P,N){var B=P.getParameter(N.MAX_COLOR_ATTACHMENTS_WEBGL);m=new Array(B+1);for(var G=0;G<=B;++G){for(var W=new Array(B),K=0;KE||M<0||M>E)throw new Error("gl-fbo: Parameters are too large for FBO");var D=1;if("color"in(A=A||{})){if((D=Math.max(0|A.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(D>1){if(!S)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(D>T.getParameter(S.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+D+" draw buffers")}}var O=T.UNSIGNED_BYTE,R=T.getExtension("OES_texture_float");if(A.float&&D>0){if(!R)throw new Error("gl-fbo: Context does not support floating point textures");O=T.FLOAT}else A.preferFloat&&D>0&&R&&(O=T.FLOAT);var z=!0;"depth"in A&&(z=!!A.depth);var L=!1;return"stencil"in A&&(L=!!A.stencil),new w(T,_,M,O,D,z,L,S)};var s,l,d,h,m=null;function g(T){return[T.getParameter(T.FRAMEBUFFER_BINDING),T.getParameter(T.RENDERBUFFER_BINDING),T.getParameter(T.TEXTURE_BINDING_2D)]}function p(T,_){T.bindFramebuffer(T.FRAMEBUFFER,_[0]),T.bindRenderbuffer(T.RENDERBUFFER,_[1]),T.bindTexture(T.TEXTURE_2D,_[2])}function v(T){switch(T){case s:throw new Error("gl-fbo: Framebuffer unsupported");case l:throw new Error("gl-fbo: Framebuffer incomplete attachment");case d:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case h:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function y(T,_,M,A,S,E){if(!A)return null;var D=i(T,_,M,S,A);return D.magFilter=T.NEAREST,D.minFilter=T.NEAREST,D.mipSamples=1,D.bind(),T.framebufferTexture2D(T.FRAMEBUFFER,E,T.TEXTURE_2D,D.handle,0),D}function x(T,_,M,A,S){var E=T.createRenderbuffer();return T.bindRenderbuffer(T.RENDERBUFFER,E),T.renderbufferStorage(T.RENDERBUFFER,A,_,M),T.framebufferRenderbuffer(T.FRAMEBUFFER,S,T.RENDERBUFFER,E),E}function w(T,_,M,A,S,E,D,O){this.gl=T,this._shape=[0|_,0|M],this._destroyed=!1,this._ext=O,this.color=new Array(S);for(var R=0;R1&&Y.drawBuffersWEBGL(m[te]);var $=B.getExtension("WEBGL_depth_texture");$?Z?P.depth=y(B,W,K,$.UNSIGNED_INT_24_8_WEBGL,B.DEPTH_STENCIL,B.DEPTH_STENCIL_ATTACHMENT):re&&(P.depth=y(B,W,K,B.UNSIGNED_SHORT,B.DEPTH_COMPONENT,B.DEPTH_ATTACHMENT)):re&&Z?P._depth_rb=x(B,W,K,B.DEPTH_STENCIL,B.DEPTH_STENCIL_ATTACHMENT):re?P._depth_rb=x(B,W,K,B.DEPTH_COMPONENT16,B.DEPTH_ATTACHMENT):Z&&(P._depth_rb=x(B,W,K,B.STENCIL_INDEX,B.STENCIL_ATTACHMENT));var ne=B.checkFramebufferStatus(B.FRAMEBUFFER);if(ne!==B.FRAMEBUFFER_COMPLETE){for(P._destroyed=!0,B.bindFramebuffer(B.FRAMEBUFFER,null),B.deleteFramebuffer(P.handle),P.handle=null,P.depth&&(P.depth.dispose(),P.depth=null),P._depth_rb&&(B.deleteRenderbuffer(P._depth_rb),P._depth_rb=null),q=0;qS||M<0||M>S)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");T._shape[0]=_,T._shape[1]=M;for(var E=g(A),D=0;D>8*z&255;this.pickOffset=k,T.bind();var L=T.uniforms;L.viewTransform=x,L.pickOffset=w,L.shape=this.shape;var P=T.attributes;return this.positionBuffer.bind(),P.position.pointer(),this.weightBuffer.bind(),P.weight.pointer(A.UNSIGNED_BYTE,!1),this.idBuffer.bind(),P.pickId.pointer(A.UNSIGNED_BYTE,!1),A.drawArrays(A.TRIANGLES,0,M),k+this.shape[0]*this.shape[1]}}}(),v.pick=function(x,w,k){var b=this.pickOffset,T=this.shape[0]*this.shape[1];if(k=b+T)return null;var _=k-b,M=this.xData,A=this.yData;return{object:this,pointId:_,dataCoord:[M[_%this.shape[0]],A[_/this.shape[0]|0]]}},v.update=function(x){var w=(x=x||{}).shape||[0,0],k=x.x||s(w[0]),b=x.y||s(w[1]),T=x.z||new Float32Array(w[0]*w[1]),_=x.zsmooth!==!1;this.xData=k,this.yData=b;var M,A,S,E,D=x.colorLevels||[0],O=x.colorValues||[0,0,0,1],R=D.length,z=this.bounds;_?(M=z[0]=k[0],A=z[1]=b[0],S=z[2]=k[k.length-1],E=z[3]=b[b.length-1]):(M=z[0]=k[0]+(k[1]-k[0])/2,A=z[1]=b[0]+(b[1]-b[0])/2,S=z[2]=k[k.length-1]+(k[k.length-1]-k[k.length-2])/2,E=z[3]=b[b.length-1]+(b[b.length-1]-b[b.length-2])/2);var L=1/(S-M),P=1/(E-A),N=w[0],B=w[1];this.shape=[N,B];var G=(_?(N-1)*(B-1):N*B)*(y.length>>>1);this.numVertices=G;for(var W=l.mallocUint8(4*G),K=l.mallocFloat32(2*G),te=l.mallocUint8(2*G),Y=l.mallocUint32(G),Z=0,re=_?N-1:N,U=_?B-1:B,q=0;q max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D dashTexture; +uniform float dashScale; +uniform float opacity; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], worldPosition) || + fragColor.a * opacity == 0. + ) discard; + + float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; + if(dashWeight < 0.5) { + discard; + } + gl_FragColor = fragColor * opacity; +} +`]),h=i([`precision highp float; +#define GLSLIFY 1 + +#define FLOAT_MAX 1.70141184e38 +#define FLOAT_MIN 1.17549435e-38 + +// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl +vec4 packFloat(float v) { + float av = abs(v); + + //Handle special cases + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; + } + + vec4 c = vec4(0,0,0,0); + + //Compute exponent and mantissa + float e = floor(log2(av)); + float m = av * pow(2.0, -e) - 1.0; + + //Unpack mantissa + c[1] = floor(128.0 * m); + m -= c[1] / 128.0; + c[2] = floor(32768.0 * m); + m -= c[2] / 32768.0; + c[3] = floor(8388608.0 * m); + + //Unpack exponent + float ebias = e + 127.0; + c[0] = floor(ebias / 2.0); + ebias -= c[0] * 2.0; + c[1] += floor(ebias) * 128.0; + + //Unpack sign bit + c[0] += 128.0 * step(0.0, -v); + + //Scale back to range + return c / 255.0; +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform float pickId; +uniform vec3 clipBounds[2]; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; + + gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); +}`]),m=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];c.createShader=function(g){return s(g,l,d,null,m)},c.createPickShader=function(g){return s(g,l,h,null,m)}},{"gl-shader":132,glslify:231}],91:[function(a,u,c){u.exports=function(M){var A=M.gl||M.scene&&M.scene.gl,S=v(A);S.attributes.position.location=0,S.attributes.nextPosition.location=1,S.attributes.arcLength.location=2,S.attributes.lineWidth.location=3,S.attributes.color.location=4;var E=y(A);E.attributes.position.location=0,E.attributes.nextPosition.location=1,E.attributes.arcLength.location=2,E.attributes.lineWidth.location=3,E.attributes.color.location=4;for(var D=i(A),O=s(A,[{buffer:D,size:3,offset:0,stride:48},{buffer:D,size:3,offset:12,stride:48},{buffer:D,size:1,offset:24,stride:48},{buffer:D,size:1,offset:28,stride:48},{buffer:D,size:4,offset:32,stride:48}]),R=g(new Array(1024),[256,1,4]),z=0;z<1024;++z)R.data[z]=255;var L=l(A,R);L.wrap=A.REPEAT;var P=new T(A,S,E,D,O,L);return P.update(M),P};var i=a("gl-buffer"),s=a("gl-vao"),l=a("gl-texture2d"),d=new Uint8Array(4),h=new Float32Array(d.buffer),m=a("binary-search-bounds"),g=a("ndarray"),p=a("./lib/shaders"),v=p.createShader,y=p.createPickShader,x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function w(M,A){for(var S=0,E=0;E<3;++E){var D=M[E]-A[E];S+=D*D}return Math.sqrt(S)}function k(M){for(var A=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],S=0;S<3;++S)A[0][S]=Math.max(M[0][S],A[0][S]),A[1][S]=Math.min(M[1][S],A[1][S]);return A}function b(M,A,S,E){this.arcLength=M,this.position=A,this.index=S,this.dataCoordinate=E}function T(M,A,S,E,D,O){this.gl=M,this.shader=A,this.pickShader=S,this.buffer=E,this.vao=D,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=O,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var _=T.prototype;_.isTransparent=function(){return this.hasAlpha},_.isOpaque=function(){return!this.hasAlpha},_.pickSlots=1,_.setPickBase=function(M){this.pickId=M},_.drawTransparent=_.draw=function(M){if(this.vertexCount){var A=this.gl,S=this.shader,E=this.vao;S.bind(),S.uniforms={model:M.model||x,view:M.view||x,projection:M.projection||x,clipBounds:k(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[A.drawingBufferWidth,A.drawingBufferHeight],pixelRatio:this.pixelRatio},E.bind(),E.draw(A.TRIANGLE_STRIP,this.vertexCount),E.unbind()}},_.drawPick=function(M){if(this.vertexCount){var A=this.gl,S=this.pickShader,E=this.vao;S.bind(),S.uniforms={model:M.model||x,view:M.view||x,projection:M.projection||x,pickId:this.pickId,clipBounds:k(this.clipBounds),screenShape:[A.drawingBufferWidth,A.drawingBufferHeight],pixelRatio:this.pixelRatio},E.bind(),E.draw(A.TRIANGLE_STRIP,this.vertexCount),E.unbind()}},_.update=function(M){var A,S;this.dirty=!0;var E=!!M.connectGaps;"dashScale"in M&&(this.dashScale=M.dashScale),this.hasAlpha=!1,"opacity"in M&&(this.opacity=+M.opacity,this.opacity<1&&(this.hasAlpha=!0));var D=[],O=[],R=[],z=0,L=0,P=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],N=M.position||M.positions;if(N){var B=M.color||M.colors||[0,0,0,1],G=M.lineWidth||1,W=!1;e:for(A=1;A0){for(var U=0;U<24;++U)D.push(D[D.length-12]);L+=2,W=!0}continue e}P[0][S]=Math.min(P[0][S],Z[S],re[S]),P[1][S]=Math.max(P[1][S],Z[S],re[S])}Array.isArray(B[0])?(K=B.length>A-1?B[A-1]:B.length>0?B[B.length-1]:[0,0,0,1],te=B.length>A?B[A]:B.length>0?B[B.length-1]:[0,0,0,1]):K=te=B,K.length===3&&(K=[K[0],K[1],K[2],1]),te.length===3&&(te=[te[0],te[1],te[2],1]),!this.hasAlpha&&K[3]<1&&(this.hasAlpha=!0),Y=Array.isArray(G)?G.length>A-1?G[A-1]:G.length>0?G[G.length-1]:[0,0,0,1]:G;var q=z;if(z+=w(Z,re),W){for(S=0;S<2;++S)D.push(Z[0],Z[1],Z[2],re[0],re[1],re[2],q,Y,K[0],K[1],K[2],K[3]);L+=2,W=!1}D.push(Z[0],Z[1],Z[2],re[0],re[1],re[2],q,Y,K[0],K[1],K[2],K[3],Z[0],Z[1],Z[2],re[0],re[1],re[2],q,-Y,K[0],K[1],K[2],K[3],re[0],re[1],re[2],Z[0],Z[1],Z[2],z,-Y,te[0],te[1],te[2],te[3],re[0],re[1],re[2],Z[0],Z[1],Z[2],z,Y,te[0],te[1],te[2],te[3]),L+=4}}if(this.buffer.update(D),O.push(z),R.push(N[N.length-1].slice()),this.bounds=P,this.vertexCount=L,this.points=R,this.arcLength=O,"dashes"in M){var $=M.dashes.slice();for($.unshift(0),A=1;A<$.length;++A)$[A]=$[A-1]+$[A];var ne=g(new Array(1024),[256,1,4]);for(A=0;A<256;++A){for(S=0;S<4;++S)ne.set(A,0,S,0);1&m.le($,$[$.length-1]*A/255)?ne.set(A,0,0,0):ne.set(A,0,0,255)}this.texture.setPixels(ne)}},_.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},_.pick=function(M){if(!M||M.id!==this.pickId)return null;var A=function(N,B,G,W){return d[0]=W,d[1]=G,d[2]=B,d[3]=N,h[0]}(M.value[0],M.value[1],M.value[2],0),S=m.le(this.arcLength,A);if(S<0)return null;if(S===this.arcLength.length-1)return new b(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),S);for(var E=this.points[S],D=this.points[Math.min(S+1,this.points.length-1)],O=(A-this.arcLength[S])/(this.arcLength[S+1]-this.arcLength[S]),R=1-O,z=[0,0,0],L=0;L<3;++L)z[L]=R*E[L]+O*D[L];var P=Math.min(O<.5?S:S+1,this.points.length-1);return new b(A,z,P,this.points[P])}},{"./lib/shaders":90,"binary-search-bounds":31,"gl-buffer":78,"gl-texture2d":146,"gl-vao":150,ndarray:259}],92:[function(a,u,c){u.exports=function(i){var s=new Float32Array(16);return s[0]=i[0],s[1]=i[1],s[2]=i[2],s[3]=i[3],s[4]=i[4],s[5]=i[5],s[6]=i[6],s[7]=i[7],s[8]=i[8],s[9]=i[9],s[10]=i[10],s[11]=i[11],s[12]=i[12],s[13]=i[13],s[14]=i[14],s[15]=i[15],s}},{}],93:[function(a,u,c){u.exports=function(){var i=new Float32Array(16);return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{}],94:[function(a,u,c){u.exports=function(i){var s=i[0],l=i[1],d=i[2],h=i[3],m=i[4],g=i[5],p=i[6],v=i[7],y=i[8],x=i[9],w=i[10],k=i[11],b=i[12],T=i[13],_=i[14],M=i[15];return(s*g-l*m)*(w*M-k*_)-(s*p-d*m)*(x*M-k*T)+(s*v-h*m)*(x*_-w*T)+(l*p-d*g)*(y*M-k*b)-(l*v-h*g)*(y*_-w*b)+(d*v-h*p)*(y*T-x*b)}},{}],95:[function(a,u,c){u.exports=function(i,s){var l=s[0],d=s[1],h=s[2],m=s[3],g=l+l,p=d+d,v=h+h,y=l*g,x=d*g,w=d*p,k=h*g,b=h*p,T=h*v,_=m*g,M=m*p,A=m*v;return i[0]=1-w-T,i[1]=x+A,i[2]=k-M,i[3]=0,i[4]=x-A,i[5]=1-y-T,i[6]=b+_,i[7]=0,i[8]=k+M,i[9]=b-_,i[10]=1-y-w,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{}],96:[function(a,u,c){u.exports=function(i,s,l){var d=s[0],h=s[1],m=s[2],g=s[3],p=d+d,v=h+h,y=m+m,x=d*p,w=d*v,k=d*y,b=h*v,T=h*y,_=m*y,M=g*p,A=g*v,S=g*y;return i[0]=1-(b+_),i[1]=w+S,i[2]=k-A,i[3]=0,i[4]=w-S,i[5]=1-(x+_),i[6]=T+M,i[7]=0,i[8]=k+A,i[9]=T-M,i[10]=1-(x+b),i[11]=0,i[12]=l[0],i[13]=l[1],i[14]=l[2],i[15]=1,i}},{}],97:[function(a,u,c){u.exports=function(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{}],98:[function(a,u,c){u.exports=function(i,s){var l=s[0],d=s[1],h=s[2],m=s[3],g=s[4],p=s[5],v=s[6],y=s[7],x=s[8],w=s[9],k=s[10],b=s[11],T=s[12],_=s[13],M=s[14],A=s[15],S=l*p-d*g,E=l*v-h*g,D=l*y-m*g,O=d*v-h*p,R=d*y-m*p,z=h*y-m*v,L=x*_-w*T,P=x*M-k*T,N=x*A-b*T,B=w*M-k*_,G=w*A-b*_,W=k*A-b*M,K=S*W-E*G+D*B+O*N-R*P+z*L;return K?(K=1/K,i[0]=(p*W-v*G+y*B)*K,i[1]=(h*G-d*W-m*B)*K,i[2]=(_*z-M*R+A*O)*K,i[3]=(k*R-w*z-b*O)*K,i[4]=(v*N-g*W-y*P)*K,i[5]=(l*W-h*N+m*P)*K,i[6]=(M*D-T*z-A*E)*K,i[7]=(x*z-k*D+b*E)*K,i[8]=(g*G-p*N+y*L)*K,i[9]=(d*N-l*G-m*L)*K,i[10]=(T*R-_*D+A*S)*K,i[11]=(w*D-x*R-b*S)*K,i[12]=(p*P-g*B-v*L)*K,i[13]=(l*B-d*P+h*L)*K,i[14]=(_*E-T*O-M*S)*K,i[15]=(x*O-w*E+k*S)*K,i):null}},{}],99:[function(a,u,c){var i=a("./identity");u.exports=function(s,l,d,h){var m,g,p,v,y,x,w,k,b,T,_=l[0],M=l[1],A=l[2],S=h[0],E=h[1],D=h[2],O=d[0],R=d[1],z=d[2];return Math.abs(_-O)<1e-6&&Math.abs(M-R)<1e-6&&Math.abs(A-z)<1e-6?i(s):(w=_-O,k=M-R,b=A-z,T=1/Math.sqrt(w*w+k*k+b*b),m=E*(b*=T)-D*(k*=T),g=D*(w*=T)-S*b,p=S*k-E*w,(T=Math.sqrt(m*m+g*g+p*p))?(m*=T=1/T,g*=T,p*=T):(m=0,g=0,p=0),v=k*p-b*g,y=b*m-w*p,x=w*g-k*m,(T=Math.sqrt(v*v+y*y+x*x))?(v*=T=1/T,y*=T,x*=T):(v=0,y=0,x=0),s[0]=m,s[1]=v,s[2]=w,s[3]=0,s[4]=g,s[5]=y,s[6]=k,s[7]=0,s[8]=p,s[9]=x,s[10]=b,s[11]=0,s[12]=-(m*_+g*M+p*A),s[13]=-(v*_+y*M+x*A),s[14]=-(w*_+k*M+b*A),s[15]=1,s)}},{"./identity":97}],100:[function(a,u,c){u.exports=function(i,s,l){var d=s[0],h=s[1],m=s[2],g=s[3],p=s[4],v=s[5],y=s[6],x=s[7],w=s[8],k=s[9],b=s[10],T=s[11],_=s[12],M=s[13],A=s[14],S=s[15],E=l[0],D=l[1],O=l[2],R=l[3];return i[0]=E*d+D*p+O*w+R*_,i[1]=E*h+D*v+O*k+R*M,i[2]=E*m+D*y+O*b+R*A,i[3]=E*g+D*x+O*T+R*S,E=l[4],D=l[5],O=l[6],R=l[7],i[4]=E*d+D*p+O*w+R*_,i[5]=E*h+D*v+O*k+R*M,i[6]=E*m+D*y+O*b+R*A,i[7]=E*g+D*x+O*T+R*S,E=l[8],D=l[9],O=l[10],R=l[11],i[8]=E*d+D*p+O*w+R*_,i[9]=E*h+D*v+O*k+R*M,i[10]=E*m+D*y+O*b+R*A,i[11]=E*g+D*x+O*T+R*S,E=l[12],D=l[13],O=l[14],R=l[15],i[12]=E*d+D*p+O*w+R*_,i[13]=E*h+D*v+O*k+R*M,i[14]=E*m+D*y+O*b+R*A,i[15]=E*g+D*x+O*T+R*S,i}},{}],101:[function(a,u,c){u.exports=function(i,s,l,d,h,m,g){var p=1/(s-l),v=1/(d-h),y=1/(m-g);return i[0]=-2*p,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*v,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*y,i[11]=0,i[12]=(s+l)*p,i[13]=(h+d)*v,i[14]=(g+m)*y,i[15]=1,i}},{}],102:[function(a,u,c){u.exports=function(i,s,l,d,h){var m=1/Math.tan(s/2),g=1/(d-h);return i[0]=m/l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=m,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=(h+d)*g,i[11]=-1,i[12]=0,i[13]=0,i[14]=2*h*d*g,i[15]=0,i}},{}],103:[function(a,u,c){u.exports=function(i,s,l,d){var h,m,g,p,v,y,x,w,k,b,T,_,M,A,S,E,D,O,R,z,L,P,N,B,G=d[0],W=d[1],K=d[2],te=Math.sqrt(G*G+W*W+K*K);return Math.abs(te)<1e-6?null:(G*=te=1/te,W*=te,K*=te,h=Math.sin(l),m=Math.cos(l),g=1-m,p=s[0],v=s[1],y=s[2],x=s[3],w=s[4],k=s[5],b=s[6],T=s[7],_=s[8],M=s[9],A=s[10],S=s[11],E=G*G*g+m,D=W*G*g+K*h,O=K*G*g-W*h,R=G*W*g-K*h,z=W*W*g+m,L=K*W*g+G*h,P=G*K*g+W*h,N=W*K*g-G*h,B=K*K*g+m,i[0]=p*E+w*D+_*O,i[1]=v*E+k*D+M*O,i[2]=y*E+b*D+A*O,i[3]=x*E+T*D+S*O,i[4]=p*R+w*z+_*L,i[5]=v*R+k*z+M*L,i[6]=y*R+b*z+A*L,i[7]=x*R+T*z+S*L,i[8]=p*P+w*N+_*B,i[9]=v*P+k*N+M*B,i[10]=y*P+b*N+A*B,i[11]=x*P+T*N+S*B,s!==i&&(i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15]),i)}},{}],104:[function(a,u,c){u.exports=function(i,s,l){var d=Math.sin(l),h=Math.cos(l),m=s[4],g=s[5],p=s[6],v=s[7],y=s[8],x=s[9],w=s[10],k=s[11];return s!==i&&(i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15]),i[4]=m*h+y*d,i[5]=g*h+x*d,i[6]=p*h+w*d,i[7]=v*h+k*d,i[8]=y*h-m*d,i[9]=x*h-g*d,i[10]=w*h-p*d,i[11]=k*h-v*d,i}},{}],105:[function(a,u,c){u.exports=function(i,s,l){var d=Math.sin(l),h=Math.cos(l),m=s[0],g=s[1],p=s[2],v=s[3],y=s[8],x=s[9],w=s[10],k=s[11];return s!==i&&(i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15]),i[0]=m*h-y*d,i[1]=g*h-x*d,i[2]=p*h-w*d,i[3]=v*h-k*d,i[8]=m*d+y*h,i[9]=g*d+x*h,i[10]=p*d+w*h,i[11]=v*d+k*h,i}},{}],106:[function(a,u,c){u.exports=function(i,s,l){var d=Math.sin(l),h=Math.cos(l),m=s[0],g=s[1],p=s[2],v=s[3],y=s[4],x=s[5],w=s[6],k=s[7];return s!==i&&(i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15]),i[0]=m*h+y*d,i[1]=g*h+x*d,i[2]=p*h+w*d,i[3]=v*h+k*d,i[4]=y*h-m*d,i[5]=x*h-g*d,i[6]=w*h-p*d,i[7]=k*h-v*d,i}},{}],107:[function(a,u,c){u.exports=function(i,s,l){var d=l[0],h=l[1],m=l[2];return i[0]=s[0]*d,i[1]=s[1]*d,i[2]=s[2]*d,i[3]=s[3]*d,i[4]=s[4]*h,i[5]=s[5]*h,i[6]=s[6]*h,i[7]=s[7]*h,i[8]=s[8]*m,i[9]=s[9]*m,i[10]=s[10]*m,i[11]=s[11]*m,i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15],i}},{}],108:[function(a,u,c){u.exports=function(i,s,l){var d,h,m,g,p,v,y,x,w,k,b,T,_=l[0],M=l[1],A=l[2];return s===i?(i[12]=s[0]*_+s[4]*M+s[8]*A+s[12],i[13]=s[1]*_+s[5]*M+s[9]*A+s[13],i[14]=s[2]*_+s[6]*M+s[10]*A+s[14],i[15]=s[3]*_+s[7]*M+s[11]*A+s[15]):(d=s[0],h=s[1],m=s[2],g=s[3],p=s[4],v=s[5],y=s[6],x=s[7],w=s[8],k=s[9],b=s[10],T=s[11],i[0]=d,i[1]=h,i[2]=m,i[3]=g,i[4]=p,i[5]=v,i[6]=y,i[7]=x,i[8]=w,i[9]=k,i[10]=b,i[11]=T,i[12]=d*_+p*M+w*A+s[12],i[13]=h*_+v*M+k*A+s[13],i[14]=m*_+y*M+b*A+s[14],i[15]=g*_+x*M+T*A+s[15]),i}},{}],109:[function(a,u,c){u.exports=function(i,s){if(i===s){var l=s[1],d=s[2],h=s[3],m=s[6],g=s[7],p=s[11];i[1]=s[4],i[2]=s[8],i[3]=s[12],i[4]=l,i[6]=s[9],i[7]=s[13],i[8]=d,i[9]=m,i[11]=s[14],i[12]=h,i[13]=g,i[14]=p}else i[0]=s[0],i[1]=s[4],i[2]=s[8],i[3]=s[12],i[4]=s[1],i[5]=s[5],i[6]=s[9],i[7]=s[13],i[8]=s[2],i[9]=s[6],i[10]=s[10],i[11]=s[14],i[12]=s[3],i[13]=s[7],i[14]=s[11],i[15]=s[15];return i}},{}],110:[function(a,u,c){var i=a("barycentric"),s=a("polytope-closest-point/lib/closest_point_2d.js");function l(m,g){for(var p=[0,0,0,0],v=0;v<4;++v)for(var y=0;y<4;++y)p[y]+=m[4*v+y]*g[v];return p}function d(m,g,p,v,y){for(var x=l(v,l(p,l(g,[m[0],m[1],m[2],1]))),w=0;w<3;++w)x[w]/=x[3];return[.5*y[0]*(1+x[0]),.5*y[1]*(1-x[1])]}function h(m,g){for(var p=[0,0,0],v=0;v1.0001)return null;S+=A[k]}return Math.abs(S-1)>.001?null:[b,h(m,A),A]}},{barycentric:14,"polytope-closest-point/lib/closest_point_2d.js":270}],111:[function(a,u,c){var i=a("glslify"),s=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, normal; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model + , view + , projection + , inverseModel; +uniform vec3 eyePosition + , lightPosition; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +vec4 project(vec3 p) { + return projection * view * model * vec4(p, 1.0); +} + +void main() { + gl_Position = project(position); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * vec4(position , 1.0); + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + f_color = color; + f_data = position; + f_uv = uv; +} +`]),l=i([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness + , fresnel + , kambient + , kdiffuse + , kspecular; +uniform sampler2D texture; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (f_color.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], f_data) + ) discard; + + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d + + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * f_color.a; +} +`]),d=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model, view, projection; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + gl_Position = projection * view * model * vec4(position, 1.0); + f_color = color; + f_data = position; + f_uv = uv; +}`]),h=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard; + + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),m=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; +attribute float pointSize; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0); + } else { + gl_Position = projection * view * model * vec4(position, 1.0); + } + gl_PointSize = pointSize; + f_color = color; + f_uv = uv; +}`]),g=i([`precision highp float; +#define GLSLIFY 1 + +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5); + if(dot(pointR, pointR) > 0.25) { + discard; + } + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),p=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 id; + +uniform mat4 model, view, projection; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + gl_Position = projection * view * model * vec4(position, 1.0); + f_id = id; + f_position = position; +}`]),v=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]),y=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute float pointSize; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0, 0.0, 0.0); + } else { + gl_Position = projection * view * model * vec4(position, 1.0); + gl_PointSize = pointSize; + } + f_id = id; + f_position = position; +}`]),x=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; + +uniform mat4 model, view, projection; + +void main() { + gl_Position = projection * view * model * vec4(position, 1.0); +}`]),w=i([`precision highp float; +#define GLSLIFY 1 + +uniform vec3 contourColor; + +void main() { + gl_FragColor = vec4(contourColor, 1.0); +} +`]);c.meshShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},c.wireShader={vertex:d,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},c.pointShader={vertex:m,fragment:g,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},c.pickShader={vertex:p,fragment:v,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},c.pointPickShader={vertex:y,fragment:v,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},c.contourShader={vertex:x,fragment:w,attributes:[{name:"position",type:"vec3"}]}},{glslify:231}],112:[function(a,u,c){var i=a("gl-shader"),s=a("gl-buffer"),l=a("gl-vao"),d=a("gl-texture2d"),h=a("normals"),m=a("gl-mat4/multiply"),g=a("gl-mat4/invert"),p=a("ndarray"),v=a("colormap"),y=a("simplicial-complex-contour"),x=a("typedarray-pool"),w=a("./lib/shaders"),k=a("./lib/closest-point"),b=w.meshShader,T=w.wireShader,_=w.pointShader,M=w.pickShader,A=w.pointPickShader,S=w.contourShader,E=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function D(W,K,te,Y,Z,re,U,q,$,ne,H,Q,ee,ie,ae,ue,le,ge,fe,me,_e,we,Te,Oe,de,ye,Me){this.gl=W,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=K,this.dirty=!0,this.triShader=te,this.lineShader=Y,this.pointShader=Z,this.pickShader=re,this.pointPickShader=U,this.contourShader=q,this.trianglePositions=$,this.triangleColors=H,this.triangleNormals=ee,this.triangleUVs=Q,this.triangleIds=ne,this.triangleVAO=ie,this.triangleCount=0,this.lineWidth=1,this.edgePositions=ae,this.edgeColors=le,this.edgeUVs=ge,this.edgeIds=ue,this.edgeVAO=fe,this.edgeCount=0,this.pointPositions=me,this.pointColors=we,this.pointUVs=Te,this.pointSizes=Oe,this.pointIds=_e,this.pointVAO=de,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=ye,this.contourVAO=Me,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=E,this._view=E,this._projection=E,this._resolution=[1,1]}var O=D.prototype;function R(W,K){if(!K||!K.length)return 1;for(var te=0;teW&&te>0){var Y=(K[te][0]-W)/(K[te][0]-K[te-1][0]);return K[te][1]*(1-Y)+Y*K[te-1][1]}}return 1}function z(W){var K=i(W,b.vertex,b.fragment);return K.attributes.position.location=0,K.attributes.color.location=2,K.attributes.uv.location=3,K.attributes.normal.location=4,K}function L(W){var K=i(W,T.vertex,T.fragment);return K.attributes.position.location=0,K.attributes.color.location=2,K.attributes.uv.location=3,K}function P(W){var K=i(W,_.vertex,_.fragment);return K.attributes.position.location=0,K.attributes.color.location=2,K.attributes.uv.location=3,K.attributes.pointSize.location=4,K}function N(W){var K=i(W,M.vertex,M.fragment);return K.attributes.position.location=0,K.attributes.id.location=1,K}function B(W){var K=i(W,A.vertex,A.fragment);return K.attributes.position.location=0,K.attributes.id.location=1,K.attributes.pointSize.location=4,K}function G(W){var K=i(W,S.vertex,S.fragment);return K.attributes.position.location=0,K}O.isOpaque=function(){return!this.hasAlpha},O.isTransparent=function(){return this.hasAlpha},O.pickSlots=1,O.setPickBase=function(W){this.pickId=W},O.highlight=function(W){if(W&&this.contourEnable){for(var K=y(this.cells,this.intensity,W.intensity),te=K.cells,Y=K.vertexIds,Z=K.vertexWeights,re=te.length,U=x.mallocFloat32(6*re),q=0,$=0;$0&&((ne=this.triShader).bind(),ne.uniforms=q,this.triangleVAO.bind(),K.drawArrays(K.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((ne=this.lineShader).bind(),ne.uniforms=q,this.edgeVAO.bind(),K.lineWidth(this.lineWidth*this.pixelRatio),K.drawArrays(K.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((ne=this.pointShader).bind(),ne.uniforms=q,this.pointVAO.bind(),K.drawArrays(K.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((ne=this.contourShader).bind(),ne.uniforms=q,this.contourVAO.bind(),K.drawArrays(K.LINES,0,this.contourCount),this.contourVAO.unbind())},O.drawPick=function(W){W=W||{};for(var K=this.gl,te=W.model||E,Y=W.view||E,Z=W.projection||E,re=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],U=0;U<3;++U)re[0][U]=Math.max(re[0][U],this.clipBounds[0][U]),re[1][U]=Math.min(re[1][U],this.clipBounds[1][U]);this._model=[].slice.call(te),this._view=[].slice.call(Y),this._projection=[].slice.call(Z),this._resolution=[K.drawingBufferWidth,K.drawingBufferHeight];var q,$={model:te,view:Y,projection:Z,clipBounds:re,pickId:this.pickId/255};(q=this.pickShader).bind(),q.uniforms=$,this.triangleCount>0&&(this.triangleVAO.bind(),K.drawArrays(K.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),K.lineWidth(this.lineWidth*this.pixelRatio),K.drawArrays(K.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((q=this.pointPickShader).bind(),q.uniforms=$,this.pointVAO.bind(),K.drawArrays(K.POINTS,0,this.pointCount),this.pointVAO.unbind())},O.pick=function(W){if(!W||W.id!==this.pickId)return null;for(var K=W.value[0]+256*W.value[1]+65536*W.value[2],te=this.cells[K],Y=this.positions,Z=new Array(te.length),re=0;reA[Z]&&(_.uniforms.dataAxis=g,_.uniforms.screenOffset=p,_.uniforms.color=P[b],_.uniforms.angle=N[b],S.drawArrays(S.TRIANGLES,A[Z],A[re]-A[Z]))),B[b]&&Y&&(p[1^b]-=U*R*G[b],_.uniforms.dataAxis=v,_.uniforms.screenOffset=p,_.uniforms.color=W[b],_.uniforms.angle=K[b],S.drawArrays(S.TRIANGLES,te,Y)),p[1^b]=U*E[2+(1^b)]-1,z[b+2]&&(p[1^b]+=U*R*L[b+2],ZA[Z]&&(_.uniforms.dataAxis=g,_.uniforms.screenOffset=p,_.uniforms.color=P[b+2],_.uniforms.angle=N[b+2],S.drawArrays(S.TRIANGLES,A[Z],A[re]-A[Z]))),B[b+2]&&Y&&(p[1^b]+=U*R*G[b+2],_.uniforms.dataAxis=v,_.uniforms.screenOffset=p,_.uniforms.color=W[b+2],_.uniforms.angle=K[b+2],S.drawArrays(S.TRIANGLES,te,Y))}),k.drawTitle=function(){var b=[0,0],T=[0,0];return function(){var _=this.plot,M=this.shader,A=_.gl,S=_.screenBox,E=_.titleCenter,D=_.titleAngle,O=_.titleColor,R=_.pixelRatio;if(this.titleCount){for(var z=0;z<2;++z)T[z]=2*(E[z]*R-S[z])/(S[2+z]-S[z])-1;M.bind(),M.uniforms.dataAxis=b,M.uniforms.screenOffset=T,M.uniforms.angle=D,M.uniforms.color=O,A.drawArrays(A.TRIANGLES,this.titleOffset,this.titleCount)}}}(),k.bind=(y=[0,0],x=[0,0],w=[0,0],function(){var b=this.plot,T=this.shader,_=b._tickBounds,M=b.dataBox,A=b.screenBox,S=b.viewBox;T.bind();for(var E=0;E<2;++E){var D=_[E],O=_[E+2]-D,R=.5*(M[E+2]+M[E]),z=M[E+2]-M[E],L=S[E],P=S[E+2]-L,N=A[E],B=A[E+2]-N;x[E]=2*O/z*P/B,y[E]=2*(D-R)/z*P/B}w[1]=2*b.pixelRatio/(A[3]-A[1]),w[0]=w[1]*(A[3]-A[1])/(A[2]-A[0]),T.uniforms.dataScale=x,T.uniforms.dataShift=y,T.uniforms.textScale=w,this.vbo.bind(),T.attributes.textCoordinate.pointer()}),k.update=function(b){var T,_,M,A,S,E=[],D=b.ticks,O=b.bounds;for(S=0;S<2;++S){var R=[Math.floor(E.length/3)],z=[-1/0],L=D[S];for(T=0;T=0){var L=x[z]-k[z]*(x[z+2]-x[z])/(k[z+2]-k[z]);z===0?_.drawLine(L,x[1],L,x[3],R[z],O[z]):_.drawLine(x[0],L,x[2],L,R[z],O[z])}}for(z=0;z=0;--y)this.objects[y].dispose();for(this.objects.length=0,y=this.overlays.length-1;y>=0;--y)this.overlays[y].dispose();this.overlays.length=0,this.gl=null},g.addObject=function(y){this.objects.indexOf(y)<0&&(this.objects.push(y),this.setDirty())},g.removeObject=function(y){for(var x=this.objects,w=0;wMath.abs(A))y.rotate(D,0,0,-M*S*Math.PI*T.rotateSpeed/window.innerWidth);else if(!T._ortho){var O=-T.zoomSpeed*E*A/window.innerHeight*(D-y.lastT())/20;y.pan(D,0,0,w*(Math.exp(O)-1))}}},!0)},T.enableMouseListeners(),T};var i=a("right-now"),s=a("3d-view"),l=a("mouse-change"),d=a("mouse-wheel"),h=a("mouse-event-offset"),m=a("has-passive-events")},{"3d-view":7,"has-passive-events":232,"mouse-change":247,"mouse-event-offset":248,"mouse-wheel":250,"right-now":278}],120:[function(a,u,c){var i=a("glslify"),s=a("gl-shader"),l=i([`precision mediump float; +#define GLSLIFY 1 +attribute vec2 position; +varying vec2 uv; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),d=i([`precision mediump float; +#define GLSLIFY 1 + +uniform sampler2D accumBuffer; +varying vec2 uv; + +void main() { + vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); + gl_FragColor = min(vec4(1,1,1,1), accum); +}`]);u.exports=function(h){return s(h,l,d,null,[{name:"position",type:"vec2"}])}},{"gl-shader":132,glslify:231}],121:[function(a,u,c){var i=a("./camera.js"),s=a("gl-axes3d"),l=a("gl-axes3d/properties"),d=a("gl-spikes3d"),h=a("gl-select-static"),m=a("gl-fbo"),g=a("a-big-triangle"),p=a("mouse-change"),v=a("gl-mat4/perspective"),y=a("gl-mat4/ortho"),x=a("./lib/shader"),w=a("is-mobile")({tablet:!0,featureDetect:!0});function k(){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 b(_){var M=Math.round(Math.log(Math.abs(_))/Math.log(10));if(M<0){var A=Math.round(Math.pow(10,-M));return Math.ceil(_*A)/A}return M>0?(A=Math.round(Math.pow(10,M)),Math.ceil(_/A)*A):Math.ceil(_)}function T(_){return typeof _!="boolean"||_}u.exports={createScene:function(_){(_=_||{}).camera=_.camera||{};var M=_.canvas;M||(M=document.createElement("canvas"),_.container?_.container.appendChild(M):document.body.appendChild(M));var A=_.gl;if(A||(_.glOptions&&(w=!!_.glOptions.preserveDrawingBuffer),A=function(fe,me){var _e=null;try{(_e=fe.getContext("webgl",me))||(_e=fe.getContext("experimental-webgl",me))}catch{return null}return _e}(M,_.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:w})),!A)throw new Error("webgl not supported");var S=_.bounds||[[-10,-10,-10],[10,10,10]],E=new k,D=m(A,A.drawingBufferWidth,A.drawingBufferHeight,{preferFloat:!w}),O=x(A),R=_.cameraObject&&_.cameraObject._ortho===!0||_.camera.projection&&_.camera.projection.type==="orthographic"||!1,z={eye:_.camera.eye||[2,0,0],center:_.camera.center||[0,0,0],up:_.camera.up||[0,1,0],zoomMin:_.camera.zoomMax||.1,zoomMax:_.camera.zoomMin||100,mode:_.camera.mode||"turntable",_ortho:R},L=_.axes||{},P=s(A,L);P.enable=!L.disable;var N=_.spikes||{},B=d(A,N),G=[],W=[],K=[],te=[],Y=!0,Z=!0,re=new Array(16),U=new Array(16),q={view:null,projection:re,model:U,_ortho:!1},$=(Z=!0,[A.drawingBufferWidth,A.drawingBufferHeight]),ne=_.cameraObject||i(M,z),H={gl:A,contextLost:!1,pixelRatio:_.pixelRatio||1,canvas:M,selection:E,camera:ne,axes:P,axesPixels:null,spikes:B,bounds:S,objects:G,shape:$,aspect:_.aspectRatio||[1,1,1],pickRadius:_.pickRadius||10,zNear:_.zNear||.01,zFar:_.zFar||1e3,fovy:_.fovy||Math.PI/4,clearColor:_.clearColor||[0,0,0,0],autoResize:T(_.autoResize),autoBounds:T(_.autoBounds),autoScale:!!_.autoScale,autoCenter:T(_.autoCenter),clipToBounds:T(_.clipToBounds),snapToData:!!_.snapToData,onselect:_.onselect||null,onrender:_.onrender||null,onclick:_.onclick||null,cameraParams:q,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(fe){this.aspect[0]=fe.x,this.aspect[1]=fe.y,this.aspect[2]=fe.z,Z=!0},setBounds:function(fe,me){this.bounds[0][fe]=me.min,this.bounds[1][fe]=me.max},setClearColor:function(fe){this.clearColor=fe},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)}},Q=[A.drawingBufferWidth/H.pixelRatio|0,A.drawingBufferHeight/H.pixelRatio|0];function ee(){if(!H._stopped&&H.autoResize){var fe=M.parentNode,me=1,_e=1;fe&&fe!==document.body?(me=fe.clientWidth,_e=fe.clientHeight):(me=window.innerWidth,_e=window.innerHeight);var we=0|Math.ceil(me*H.pixelRatio),Te=0|Math.ceil(_e*H.pixelRatio);if(we!==M.width||Te!==M.height){M.width=we,M.height=Te;var Oe=M.style;Oe.position=Oe.position||"absolute",Oe.left="0px",Oe.top="0px",Oe.width=me+"px",Oe.height=_e+"px",Y=!0}}}H.autoResize&&ee();function ie(){for(var fe=G.length,me=te.length,_e=0;_e0&&K[me-1]===0;)K.pop(),te.pop().dispose()}function ae(){if(H.contextLost)return!0;A.isContextLost()&&(H.contextLost=!0,H.mouseListener.enabled=!1,H.selection.object=null,H.oncontextloss&&H.oncontextloss())}window.addEventListener("resize",ee),H.update=function(fe){H._stopped||(Y=!0,Z=!0)},H.add=function(fe){H._stopped||(fe.axes=P,G.push(fe),W.push(-1),Y=!0,Z=!0,ie())},H.remove=function(fe){if(!H._stopped){var me=G.indexOf(fe);me<0||(G.splice(me,1),W.pop(),Y=!0,Z=!0,ie())}},H.dispose=function(){if(!H._stopped&&(H._stopped=!0,window.removeEventListener("resize",ee),M.removeEventListener("webglcontextlost",ae),H.mouseListener.enabled=!1,!H.contextLost)){P.dispose(),B.dispose();for(var fe=0;feE.distance)continue;for(var ke=0;ke 1.0) { + discard; + } + baseColor = mix(borderColor, color, step(radius, centerFraction)); + gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a); + } +} +`]),c.pickVertex=i([`precision mediump float; +#define GLSLIFY 1 + +attribute vec2 position; +attribute vec4 pickId; + +uniform mat3 matrix; +uniform float pointSize; +uniform vec4 pickOffset; + +varying vec4 fragId; + +void main() { + vec3 hgPosition = matrix * vec3(position, 1); + gl_Position = vec4(hgPosition.xy, 0, hgPosition.z); + gl_PointSize = pointSize; + + vec4 id = pickId + pickOffset; + id.y += floor(id.x / 256.0); + id.x -= floor(id.x / 256.0) * 256.0; + + id.z += floor(id.y / 256.0); + id.y -= floor(id.y / 256.0) * 256.0; + + id.w += floor(id.z / 256.0); + id.z -= floor(id.z / 256.0) * 256.0; + + fragId = id; +} +`]),c.pickFragment=i([`precision mediump float; +#define GLSLIFY 1 + +varying vec4 fragId; + +void main() { + float radius = length(2.0 * gl_PointCoord.xy - 1.0); + if(radius > 1.0) { + discard; + } + gl_FragColor = fragId / 255.0; +} +`])},{glslify:231}],123:[function(a,u,c){var i=a("gl-shader"),s=a("gl-buffer"),l=a("typedarray-pool"),d=a("./lib/shader");function h(v,y,x,w,k){this.plot=v,this.offsetBuffer=y,this.pickBuffer=x,this.shader=w,this.pickShader=k,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}u.exports=function(v,y){var x=v.gl,w=s(x),k=s(x),b=i(x,d.pointVertex,d.pointFragment),T=i(x,d.pickVertex,d.pickFragment),_=new h(v,w,k,b,T);return _.update(y),v.addObject(_),_};var m,g,p=h.prototype;p.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},p.update=function(v){var y;function x(A,S){return A in v?v[A]:S}v=v||{},this.sizeMin=x("sizeMin",.5),this.sizeMax=x("sizeMax",20),this.color=x("color",[1,0,0,1]).slice(),this.areaRatio=x("areaRatio",1),this.borderColor=x("borderColor",[0,0,0,1]).slice(),this.blend=x("blend",!1);var w=v.positions.length>>>1,k=v.positions instanceof Float32Array,b=v.idToIndex instanceof Int32Array&&v.idToIndex.length>=w,T=v.positions,_=k?T:l.mallocFloat32(T.length),M=b?v.idToIndex:l.mallocInt32(w);if(k||_.set(T),!b)for(_.set(T),y=0;y>>1;for(O=0;O=D[0]&&L<=D[2]&&P>=D[1]&&P<=D[3]&&R++}return R}(this.points,k),M=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(_,.33333)));m[0]=2/b,m[4]=2/T,m[6]=-2*k[0]/b-1,m[7]=-2*k[1]/T-1,this.offsetBuffer.bind(),x.bind(),x.attributes.position.pointer(),x.uniforms.matrix=m,x.uniforms.color=this.color,x.uniforms.borderColor=this.borderColor,x.uniforms.pointCloud=M<5,x.uniforms.pointSize=M,x.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),y&&(g[0]=255&v,g[1]=v>>8&255,g[2]=v>>16&255,g[3]=v>>24&255,this.pickBuffer.bind(),x.attributes.pickId.pointer(w.UNSIGNED_BYTE),x.uniforms.pickOffset=g,this.pickOffset=v);var A=w.getParameter(w.BLEND),S=w.getParameter(w.DITHER);return A&&!this.blend&&w.disable(w.BLEND),S&&w.disable(w.DITHER),w.drawArrays(w.POINTS,0,this.pointCount),A&&!this.blend&&w.enable(w.BLEND),S&&w.enable(w.DITHER),v+this.pointCount}),p.draw=p.unifiedDraw,p.drawPick=p.unifiedDraw,p.pick=function(v,y,x){var w=this.pickOffset,k=this.pointCount;if(x=w+k)return null;var b=x-w,T=this.points;return{object:this,pointId:b,dataCoord:[T[2*b],T[2*b+1]]}}},{"./lib/shader":122,"gl-buffer":78,"gl-shader":132,"typedarray-pool":308}],124:[function(a,u,c){u.exports=function(i,s,l,d){var h,m,g,p,v,y=s[0],x=s[1],w=s[2],k=s[3],b=l[0],T=l[1],_=l[2],M=l[3];return(m=y*b+x*T+w*_+k*M)<0&&(m=-m,b=-b,T=-T,_=-_,M=-M),1-m>1e-6?(h=Math.acos(m),g=Math.sin(h),p=Math.sin((1-d)*h)/g,v=Math.sin(d*h)/g):(p=1-d,v=d),i[0]=p*y+v*b,i[1]=p*x+v*T,i[2]=p*w+v*_,i[3]=p*k+v*M,i}},{}],125:[function(a,u,c){u.exports=function(i){return i||i===0?i.toString():""}},{}],126:[function(a,u,c){var i=a("vectorize-text");u.exports=function(l,d,h){var m=s[d];if(m||(m=s[d]={}),l in m)return m[l];var g={textAlign:"center",textBaseline:"middle",lineHeight:1,font:d,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},p=i(l,g);g.triangles=!1;var v,y,x=i(l,g);if(h&&h!==1){for(v=0;v max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform vec4 highlightId; +uniform float highlightScale; +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = 1.0; + if(distance(highlightId, id) < 0.0001) { + scale = highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1); + vec4 viewPosition = view * worldPosition; + viewPosition = viewPosition / viewPosition.w; + vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0)); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),d=s([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float highlightScale, pixelRatio; +uniform vec4 highlightId; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = pixelRatio; + if(distance(highlightId.bgr, id.bgr) < 0.001) { + scale *= highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1.0); + vec4 viewPosition = view * worldPosition; + vec4 clipPosition = projection * viewPosition; + clipPosition /= clipPosition.w; + + gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0); + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),h=s([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform float highlightScale; +uniform vec4 highlightId; +uniform vec3 axes[2]; +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float scale, pixelRatio; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float lscale = pixelRatio * scale; + if(distance(highlightId, id) < 0.0001) { + lscale *= highlightScale; + } + + vec4 clipCenter = projection * view * model * vec4(position, 1); + vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y; + vec4 clipPosition = projection * view * model * vec4(dataPosition, 1); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = dataPosition; + } +} +`]),m=s([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float opacity; + +varying vec4 interpColor; +varying vec3 dataCoordinate; + +void main() { + if ( + outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) || + interpColor.a * opacity == 0. + ) discard; + gl_FragColor = interpColor * opacity; +} +`]),g=s([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float pickGroup; + +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard; + + gl_FragColor = vec4(pickGroup, pickId.bgr); +}`]),p=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],v={vertex:l,fragment:m,attributes:p},y={vertex:d,fragment:m,attributes:p},x={vertex:h,fragment:m,attributes:p},w={vertex:l,fragment:g,attributes:p},k={vertex:d,fragment:g,attributes:p},b={vertex:h,fragment:g,attributes:p};function T(_,M){var A=i(_,M),S=A.attributes;return S.position.location=0,S.color.location=1,S.glyph.location=2,S.id.location=3,A}c.createPerspective=function(_){return T(_,v)},c.createOrtho=function(_){return T(_,y)},c.createProject=function(_){return T(_,x)},c.createPickPerspective=function(_){return T(_,w)},c.createPickOrtho=function(_){return T(_,k)},c.createPickProject=function(_){return T(_,b)}},{"gl-shader":132,glslify:231}],128:[function(a,u,c){var i=a("is-string-blank"),s=a("gl-buffer"),l=a("gl-vao"),d=a("typedarray-pool"),h=a("gl-mat4/multiply"),m=a("./lib/shaders"),g=a("./lib/glyphs"),p=a("./lib/get-simple-string"),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function y(K,te){var Y=K[0],Z=K[1],re=K[2],U=K[3];return K[0]=te[0]*Y+te[4]*Z+te[8]*re+te[12]*U,K[1]=te[1]*Y+te[5]*Z+te[9]*re+te[13]*U,K[2]=te[2]*Y+te[6]*Z+te[10]*re+te[14]*U,K[3]=te[3]*Y+te[7]*Z+te[11]*re+te[15]*U,K}function x(K,te,Y,Z){return y(Z,Z),y(Z,Z),y(Z,Z)}function w(K,te){this.index=K,this.dataCoordinate=this.position=te}function k(K){return K===!0||K>1?1:K}function b(K,te,Y,Z,re,U,q,$,ne,H,Q,ee){this.gl=K,this.pixelRatio=1,this.shader=te,this.orthoShader=Y,this.projectShader=Z,this.pointBuffer=re,this.colorBuffer=U,this.glyphBuffer=q,this.idBuffer=$,this.vao=ne,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=H,this.pickOrthoShader=Q,this.pickProjectShader=ee,this.points=[],this._selectResult=new w(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}u.exports=function(K){var te=K.gl,Y=m.createPerspective(te),Z=m.createOrtho(te),re=m.createProject(te),U=m.createPickPerspective(te),q=m.createPickOrtho(te),$=m.createPickProject(te),ne=s(te),H=s(te),Q=s(te),ee=s(te),ie=l(te,[{buffer:ne,size:3,type:te.FLOAT},{buffer:H,size:4,type:te.FLOAT},{buffer:Q,size:2,type:te.FLOAT},{buffer:ee,size:4,type:te.UNSIGNED_BYTE,normalized:!0}]),ae=new b(te,Y,Z,re,ne,H,Q,ee,ie,U,q,$);return ae.update(K),ae};var T=b.prototype;T.pickSlots=1,T.setPickBase=function(K){this.pickId=K},T.isTransparent=function(){if(this.hasAlpha)return!0;for(var K=0;K<3;++K)if(this.axesProject[K]&&this.projectHasAlpha)return!0;return!1},T.isOpaque=function(){if(!this.hasAlpha)return!0;for(var K=0;K<3;++K)if(this.axesProject[K]&&!this.projectHasAlpha)return!0;return!1};var _=[0,0],M=[0,0,0],A=[0,0,0],S=[0,0,0,1],E=[0,0,0,1],D=v.slice(),O=[0,0,0],R=[[0,0,0],[0,0,0]];function z(K){return K[0]=K[1]=K[2]=0,K}function L(K,te){return K[0]=te[0],K[1]=te[1],K[2]=te[2],K[3]=1,K}function P(K,te,Y,Z){return K[0]=te[0],K[1]=te[1],K[2]=te[2],K[Y]=Z,K}function N(K,te,Y,Z){var re,U=te.axesProject,q=te.gl,$=K.uniforms,ne=Y.model||v,H=Y.view||v,Q=Y.projection||v,ee=te.axesBounds,ie=function(ke){for(var Ee=R,ze=0;ze<2;++ze)for(var Fe=0;Fe<3;++Fe)Ee[ze][Fe]=Math.max(Math.min(ke[ze][Fe],1e8),-1e8);return Ee}(te.clipBounds);re=te.axes&&te.axes.lastCubeProps?te.axes.lastCubeProps.axis:[1,1,1],_[0]=2/q.drawingBufferWidth,_[1]=2/q.drawingBufferHeight,K.bind(),$.view=H,$.projection=Q,$.screenSize=_,$.highlightId=te.highlightId,$.highlightScale=te.highlightScale,$.clipBounds=ie,$.pickGroup=te.pickId/255,$.pixelRatio=Z;for(var ae=0;ae<3;++ae)if(U[ae]){$.scale=te.projectScale[ae],$.opacity=te.projectOpacity[ae];for(var ue=D,le=0;le<16;++le)ue[le]=0;for(le=0;le<4;++le)ue[5*le]=1;ue[5*ae]=0,re[ae]<0?ue[12+ae]=ee[0][ae]:ue[12+ae]=ee[1][ae],h(ue,ne,ue),$.model=ue;var ge=(ae+1)%3,fe=(ae+2)%3,me=z(M),_e=z(A);me[ge]=1,_e[fe]=1;var we=x(0,0,0,L(S,me)),Te=x(0,0,0,L(E,_e));if(Math.abs(we[1])>Math.abs(Te[1])){var Oe=we;we=Te,Te=Oe,Oe=me,me=_e,_e=Oe;var de=ge;ge=fe,fe=de}we[0]<0&&(me[ge]=-1),Te[1]>0&&(_e[fe]=-1);var ye=0,Me=0;for(le=0;le<4;++le)ye+=Math.pow(ne[4*ge+le],2),Me+=Math.pow(ne[4*fe+le],2);me[ge]/=Math.sqrt(ye),_e[fe]/=Math.sqrt(Me),$.axes[0]=me,$.axes[1]=_e,$.fragClipBounds[0]=P(O,ie[0],ae,-1e8),$.fragClipBounds[1]=P(O,ie[1],ae,1e8),te.vao.bind(),te.vao.draw(q.TRIANGLES,te.vertexCount),te.lineWidth>0&&(q.lineWidth(te.lineWidth*Z),te.vao.draw(q.LINES,te.lineVertexCount,te.vertexCount)),te.vao.unbind()}}var B=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function G(K,te,Y,Z,re,U,q){var $=Y.gl;if((U===Y.projectHasAlpha||q)&&N(te,Y,Z,re),U===Y.hasAlpha||q){K.bind();var ne=K.uniforms;ne.model=Z.model||v,ne.view=Z.view||v,ne.projection=Z.projection||v,_[0]=2/$.drawingBufferWidth,_[1]=2/$.drawingBufferHeight,ne.screenSize=_,ne.highlightId=Y.highlightId,ne.highlightScale=Y.highlightScale,ne.fragClipBounds=B,ne.clipBounds=Y.axes.bounds,ne.opacity=Y.opacity,ne.pickGroup=Y.pickId/255,ne.pixelRatio=re,Y.vao.bind(),Y.vao.draw($.TRIANGLES,Y.vertexCount),Y.lineWidth>0&&($.lineWidth(Y.lineWidth*re),Y.vao.draw($.LINES,Y.lineVertexCount,Y.vertexCount)),Y.vao.unbind()}}function W(K,te,Y,Z){var re;re=Array.isArray(K)?te=this.pointCount||te<0)return null;var Y=this.points[te],Z=this._selectResult;Z.index=te;for(var re=0;re<3;++re)Z.position[re]=Z.dataCoordinate[re]=Y[re];return Z},T.highlight=function(K){if(K){var te=K.index,Y=255&te,Z=te>>8&255,re=te>>16&255;this.highlightId=[Y/255,Z/255,re/255,0]}else this.highlightId=[1,1,1,1]},T.update=function(K){if("perspective"in(K=K||{})&&(this.useOrtho=!K.perspective),"orthographic"in K&&(this.useOrtho=!!K.orthographic),"lineWidth"in K&&(this.lineWidth=K.lineWidth),"project"in K)if(Array.isArray(K.project))this.axesProject=K.project;else{var te=!!K.project;this.axesProject=[te,te,te]}if("projectScale"in K)if(Array.isArray(K.projectScale))this.projectScale=K.projectScale.slice();else{var Y=+K.projectScale;this.projectScale=[Y,Y,Y]}if(this.projectHasAlpha=!1,"projectOpacity"in K){Array.isArray(K.projectOpacity)?this.projectOpacity=K.projectOpacity.slice():(Y=+K.projectOpacity,this.projectOpacity=[Y,Y,Y]);for(var Z=0;Z<3;++Z)this.projectOpacity[Z]=k(this.projectOpacity[Z]),this.projectOpacity[Z]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in K&&(this.opacity=k(K.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var re,U,q=K.position,$=K.font||"normal",ne=K.alignment||[0,0];if(ne.length===2)re=ne[0],U=ne[1];else for(re=[],U=[],Z=0;Z0){var Ve=0,Ke=fe,Re=[0,0,0,1],qe=[0,0,0,1],We=Array.isArray(ie)&&Array.isArray(ie[0]),Ye=Array.isArray(le)&&Array.isArray(le[0]);e:for(Z=0;Z<_e;++Z){for(ge+=1,we=q[Z],Te=0;Te<3;++Te){if(isNaN(we[Te])||!isFinite(we[Te]))continue e;Q[Te]=Math.max(Q[Te],we[Te]),H[Te]=Math.min(H[Te],we[Te])}Oe=(nt=W(ee,Z,$,this.pixelRatio)).mesh,de=nt.lines,ye=nt.bounds;var nt,ft=nt.visible;if(ft)if(Array.isArray(ie)){if((vt=We?Z0?1-ye[0][0]:Ot<0?1+ye[1][0]:1,Wt*=Wt>0?1-ye[0][1]:Wt<0?1+ye[1][1]:1],Be=Oe.cells||[],Ge=Oe.positions||[];for(Te=0;Te0){var R=p*_;w.drawBox(M-R,A-R,S+R,A+R,x),w.drawBox(M-R,E-R,S+R,E+R,x),w.drawBox(M-R,A-R,M+R,E+R,x),w.drawBox(S-R,A-R,S+R,E+R,x)}}}},h.update=function(m){m=m||{},this.innerFill=!!m.innerFill,this.outerFill=!!m.outerFill,this.innerColor=(m.innerColor||[0,0,0,.5]).slice(),this.outerColor=(m.outerColor||[0,0,0,.5]).slice(),this.borderColor=(m.borderColor||[0,0,0,1]).slice(),this.borderWidth=m.borderWidth||0,this.selectBox=(m.selectBox||this.selectBox).slice()},h.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":129,"gl-buffer":78,"gl-shader":132}],131:[function(a,u,c){u.exports=function(p,v){var y=v[0],x=v[1],w=i(p,y,x,{}),k=s.mallocUint8(y*x*4);return new m(p,w,k)};var i=a("gl-fbo"),s=a("typedarray-pool"),l=a("ndarray"),d=a("bit-twiddle").nextPow2;function h(p,v,y,x,w){this.coord=[p,v],this.id=y,this.value=x,this.distance=w}function m(p,v,y){this.gl=p,this.fbo=v,this.buffer=y,this._readTimeout=null;var x=this;this._readCallback=function(){x.gl&&(v.bind(),p.readPixels(0,0,v.shape[0],v.shape[1],p.RGBA,p.UNSIGNED_BYTE,x.buffer),x._readTimeout=null)}}var g=m.prototype;Object.defineProperty(g,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(p){if(this.gl){this.fbo.shape=p;var v=this.fbo.shape[0],y=this.fbo.shape[1];if(y*v*4>this.buffer.length){s.free(this.buffer);for(var x=this.buffer=s.mallocUint8(d(y*v*4)),w=0;ww)for(y=w;yx)for(y=x;y=0){for(var P=0|L.type.charAt(L.type.length-1),N=new Array(P),B=0;B=0;)G+=1;z[D]=G}var W=new Array(w.length);function K(){T.program=d.program(_,T._vref,T._fref,R,z);for(var te=0;te=0){if((A=_.charCodeAt(_.length-1)-48)<2||A>4)throw new i("","Invalid data type for attribute "+T+": "+_);h(g,p,M[0],y,A,x,T)}else{if(!(_.indexOf("mat")>=0))throw new i("","Unknown data type for attribute "+T+": "+_);var A;if((A=_.charCodeAt(_.length-1)-48)<2||A>4)throw new i("","Invalid data type for attribute "+T+": "+_);m(g,p,M,y,A,x,T)}}}return x};var i=a("./GLError");function s(g,p,v,y,x,w){this._gl=g,this._wrapper=p,this._index=v,this._locations=y,this._dimension=x,this._constFunc=w}var l=s.prototype;l.pointer=function(g,p,v,y){var x=this._gl,w=this._locations[this._index];x.vertexAttribPointer(w,this._dimension,g||x.FLOAT,!!p,v||0,y||0),x.enableVertexAttribArray(w)},l.set=function(g,p,v,y){return this._constFunc(this._locations[this._index],g,p,v,y)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(g){return g!==this._locations[this._index]&&(this._locations[this._index]=0|g,this._wrapper.program=null),0|g}});var d=[function(g,p,v){return v.length===void 0?g.vertexAttrib1f(p,v):g.vertexAttrib1fv(p,v)},function(g,p,v,y){return v.length===void 0?g.vertexAttrib2f(p,v,y):g.vertexAttrib2fv(p,v)},function(g,p,v,y,x){return v.length===void 0?g.vertexAttrib3f(p,v,y,x):g.vertexAttrib3fv(p,v)},function(g,p,v,y,x,w){return v.length===void 0?g.vertexAttrib4f(p,v,y,x,w):g.vertexAttrib4fv(p,v)}];function h(g,p,v,y,x,w,k){var b=d[x],T=new s(g,p,v,y,x,b);Object.defineProperty(w,k,{set:function(_){return g.disableVertexAttribArray(y[v]),b(g,y[v],_),_},get:function(){return T},enumerable:!0})}function m(g,p,v,y,x,w,k){for(var b=new Array(x),T=new Array(x),_=0;_4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+P);h["uniformMatrix"+L+"fv"](p[S],!1,E);break}throw new s("","Unknown uniform data type for "+name+": "+P)}if((L=P.charCodeAt(P.length-1)-48)<2||L>4)throw new s("","Invalid data type");switch(P.charAt(0)){case"b":case"i":h["uniform"+L+"iv"](p[S],E);break;case"v":h["uniform"+L+"fv"](p[S],E);break;default:throw new s("","Unrecognized data type for vector "+name+": "+P)}}}}}}function y(k,b,T){if(typeof T=="object"){var _=x(T);Object.defineProperty(k,b,{get:l(_),set:v(T),enumerable:!0,configurable:!1})}else p[T]?Object.defineProperty(k,b,{get:(M=T,function(A,S,E){return A.getUniform(S.program,E[M])}),set:v(T),enumerable:!0,configurable:!1}):k[b]=function(A){switch(A){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var S=A.indexOf("vec");if(0<=S&&S<=1&&A.length===4+S){if((E=A.charCodeAt(A.length-1)-48)<2||E>4)throw new s("","Invalid data type");return A.charAt(0)==="b"?d(E,!1):d(E,0)}if(A.indexOf("mat")===0&&A.length===4){var E;if((E=A.charCodeAt(A.length-1)-48)<2||E>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+A);return d(E*E,0)}throw new s("","Unknown uniform data type for "+name+": "+A)}}(g[T].type);var M}function x(k){var b;if(Array.isArray(k)){b=new Array(k.length);for(var T=0;T1){p[0]in m||(m[p[0]]=[]),m=m[p[0]];for(var v=1;v1)for(var x=0;x"u"?a("weakmap-shim"):WeakMap),d=0;function h(v,y,x,w,k,b,T){this.id=v,this.src=y,this.type=x,this.shader=w,this.count=b,this.programs=[],this.cache=T}function m(v){this.gl=v,this.shaders=[{},{}],this.programs={}}h.prototype.dispose=function(){if(--this.count==0){for(var v=this.cache,y=v.gl,x=this.programs,w=0,k=x.length;w 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, tubeScale; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * tubePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(tubePosition, 1.0); + vec4 t_position = view * tubePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = tubePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),l=i([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),d=i([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // 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). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float tubeScale; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + gl_Position = projection * view * tubePosition; + f_id = id; + f_position = position.xyz; +} +`]),h=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);c.meshShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},c.pickShader={vertex:d,fragment:h,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:231}],143:[function(a,u,c){var i=a("gl-vec3"),s=a("gl-vec4"),l=["xyz","xzy","yxz","yzx","zxy","zyx"],d=function(y,x,w,k){for(var b=0,T=0;T0)for(_e=0;_e<8;_e++){var we=(_e+1)%8;U.push(ne[_e],H[_e],H[we],H[we],ne[we],ne[_e]),$.push(ue,ae,ae,ae,ue,ue),Q.push(ee,ie,ie,ie,ee,ee);var Te=U.length;q.push([Te-6,Te-5,Te-4],[Te-3,Te-2,Te-1])}var Oe=ne;ne=H,H=Oe;var de=ue;ue=ae,ae=de;var ye=ee;ee=ie,ie=ye}return{positions:U,cells:q,vectors:$,vertexIntensity:Q}}(B,w,k,b)}),S=[],E=[],D=[],O=[];for(T=0;Tx)return w-1}return w},m=function(y,x,w){return yw?w:y},g=function(y){var x=1/0;y.sort(function(T,_){return T-_});for(var w=y.length,k=1;kye-1||Ke>Me-1||Re>ke-1)return i.create();var qe,We,Ye,nt,ft,vt,Pt=we[0][Ee],At=we[0][Ve],at=we[1][ze],et=we[1][Ke],Ot=we[2][Fe],Wt=(Te-Pt)/(At-Pt),Jt=(Oe-at)/(et-at),Be=(de-Ot)/(we[2][Re]-Ot);switch(isFinite(Wt)||(Wt=.5),isFinite(Jt)||(Jt=.5),isFinite(Be)||(Be=.5),me.reversedX&&(Ee=ye-1-Ee,Ve=ye-1-Ve),me.reversedY&&(ze=Me-1-ze,Ke=Me-1-Ke),me.reversedZ&&(Fe=ke-1-Fe,Re=ke-1-Re),me.filled){case 5:ft=Fe,vt=Re,Ye=ze*ke,nt=Ke*ke,qe=Ee*ke*Me,We=Ve*ke*Me;break;case 4:ft=Fe,vt=Re,qe=Ee*ke,We=Ve*ke,Ye=ze*ke*ye,nt=Ke*ke*ye;break;case 3:Ye=ze,nt=Ke,ft=Fe*Me,vt=Re*Me,qe=Ee*Me*ke,We=Ve*Me*ke;break;case 2:Ye=ze,nt=Ke,qe=Ee*Me,We=Ve*Me,ft=Fe*Me*ye,vt=Re*Me*ye;break;case 1:qe=Ee,We=Ve,ft=Fe*ye,vt=Re*ye,Ye=ze*ye*ke,nt=Ke*ye*ke;break;default:qe=Ee,We=Ve,Ye=ze*ye,nt=Ke*ye,ft=Fe*ye*Me,vt=Re*ye*Me}var Ge=_e[qe+Ye+ft],Tt=_e[qe+Ye+vt],dt=_e[qe+nt+ft],Pe=_e[qe+nt+vt],Ie=_e[We+Ye+ft],Ae=_e[We+Ye+vt],De=_e[We+nt+ft],He=_e[We+nt+vt],rt=i.create(),lt=i.create(),ot=i.create(),kt=i.create();i.lerp(rt,Ge,Ie,Wt),i.lerp(lt,Tt,Ae,Wt),i.lerp(ot,dt,De,Wt),i.lerp(kt,Pe,He,Wt);var wt=i.create(),Vt=i.create();i.lerp(wt,rt,ot,Jt),i.lerp(Vt,lt,kt,Jt);var Ut=i.create();return i.lerp(Ut,wt,Vt,Be),Ut}(le,y,M)},S=y.getDivergence||function(le,ge){var fe=i.create(),me=1e-4;i.add(fe,le,[me,0,0]);var _e=A(fe);i.subtract(_e,_e,ge),i.scale(_e,_e,1/me),i.add(fe,le,[0,me,0]);var we=A(fe);i.subtract(we,we,ge),i.scale(we,we,1/me),i.add(fe,le,[0,0,me]);var Te=A(fe);return i.subtract(Te,Te,ge),i.scale(Te,Te,1/me),i.add(fe,_e,we),i.add(fe,fe,Te),fe},E=[],D=x[0][0],O=x[0][1],R=x[0][2],z=x[1][0],L=x[1][1],P=x[1][2],N=function(le){var ge=le[0],fe=le[1],me=le[2];return!(gez||feL||meP)},B=10*i.distance(x[0],x[1])/k,G=B*B,W=1,K=0,te=w.length;te>1&&(W=function(le){for(var ge=[],fe=[],me=[],_e={},we={},Te={},Oe=le.length,de=0;deK&&(K=Q),ne.push(Q),E.push({points:re,velocities:U,divergences:ne});for(var ee=0;ee<100*k&&re.lengthG&&i.scale(ie,ie,B/Math.sqrt(ae)),i.add(ie,ie,Z),q=A(ie),i.squaredDistance($,ie)-G>-1e-4*G&&(re.push(ie),$=ie,U.push(q),H=S(ie,q),Q=i.length(H),isFinite(Q)&&Q>K&&(K=Q),ne.push(Q)),Z=ie}}var ue=d(E,y.colormap,K,W);return T?ue.tubeScale=T:(K===0&&(K=1),ue.tubeScale=.5*b*W/K),ue};var p=a("./lib/shaders"),v=a("gl-cone3d").createMesh;u.exports.createTubeMesh=function(y,x){return v(y,x,{shaders:p,traceType:"streamtube"})}},{"./lib/shaders":142,"gl-cone3d":79,"gl-vec3":169,"gl-vec4":205}],144:[function(a,u,c){var i=a("gl-shader"),s=a("glslify"),l=s([`precision highp float; +#define GLSLIFY 1 + +attribute vec4 uv; +attribute vec3 f; +attribute vec3 normal; + +uniform vec3 objectOffset; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 lightPosition, eyePosition; +uniform sampler2D colormap; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + vec3 localCoordinate = vec3(uv.zw, f.x); + worldCoordinate = objectOffset + localCoordinate; + vec4 worldPosition = model * vec4(worldCoordinate, 1.0); + vec4 clipPosition = projection * view * worldPosition; + gl_Position = clipPosition; + kill = f.y; + value = f.z; + planeCoordinate = uv.xy; + + vColor = texture2D(colormap, vec2(value, value)); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * worldPosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + lightDirection = lightPosition - cameraCoordinate.xyz; + eyeDirection = eyePosition - cameraCoordinate.xyz; + surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz); +} +`]),d=s([`precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float beckmannSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness) { + return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 lowerBound, upperBound; +uniform float contourTint; +uniform vec4 contourColor; +uniform sampler2D colormap; +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform float vertexColor; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + if ( + kill > 0.0 || + vColor.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) + ) discard; + + vec3 N = normalize(surfaceNormal); + vec3 V = normalize(eyeDirection); + vec3 L = normalize(lightDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = max(beckmannSpecular(L, V, N, roughness), 0.); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + //decide how to interpolate color \u2014 in vertex or in fragment + vec4 surfaceColor = + step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + + step(.5, vertexColor) * vColor; + + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; +} +`]),h=s([`precision highp float; +#define GLSLIFY 1 + +attribute vec4 uv; +attribute float f; + +uniform vec3 objectOffset; +uniform mat3 permutation; +uniform mat4 model, view, projection; +uniform float height, zOffset; +uniform sampler2D colormap; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + vec3 dataCoordinate = permutation * vec3(uv.xy, height); + worldCoordinate = objectOffset + dataCoordinate; + vec4 worldPosition = model * vec4(worldCoordinate, 1.0); + + vec4 clipPosition = projection * view * worldPosition; + clipPosition.z += zOffset; + + gl_Position = clipPosition; + value = f + objectOffset.z; + kill = -1.0; + planeCoordinate = uv.zw; + + vColor = texture2D(colormap, vec2(value, value)); + + //Don't do lighting for contours + surfaceNormal = vec3(1,0,0); + eyeDirection = vec3(0,1,0); + lightDirection = vec3(0,0,1); +} +`]),m=s([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec2 shape; +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 surfaceNormal; + +vec2 splitFloat(float v) { + float vh = 255.0 * v; + float upper = floor(vh); + float lower = fract(vh); + return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); +} + +void main() { + if ((kill > 0.0) || + (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; + + vec2 ux = splitFloat(planeCoordinate.x / shape.x); + vec2 uy = splitFloat(planeCoordinate.y / shape.y); + gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0)); +} +`]);c.createShader=function(g){var p=i(g,l,d,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p.attributes.normal.location=2,p},c.createPickShader=function(g){var p=i(g,l,m,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p.attributes.normal.location=2,p},c.createContourShader=function(g){var p=i(g,h,d,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p},c.createPickContourShader=function(g){var p=i(g,h,m,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p}},{"gl-shader":132,glslify:231}],145:[function(a,u,c){u.exports=function(q){var $=q.gl,ne=_($),H=A($),Q=M($),ee=S($),ie=s($),ae=l($,[{buffer:ie,size:4,stride:40,offset:0},{buffer:ie,size:3,stride:40,offset:16},{buffer:ie,size:3,stride:40,offset:28}]),ue=s($),le=l($,[{buffer:ue,size:4,stride:20,offset:0},{buffer:ue,size:1,stride:20,offset:16}]),ge=s($),fe=l($,[{buffer:ge,size:2,type:$.FLOAT}]),me=d($,1,256,$.RGBA,$.UNSIGNED_BYTE);me.minFilter=$.LINEAR,me.magFilter=$.LINEAR;var _e=new z($,[0,0],[[0,0,0],[0,0,0]],ne,H,ie,ae,me,Q,ee,ue,le,ge,fe,[0,0,0]),we={levels:[[],[],[]]};for(var Te in q)we[Te]=q[Te];return we.colormap=we.colormap||"jet",_e.update(we),_e};var i=a("bit-twiddle"),s=a("gl-buffer"),l=a("gl-vao"),d=a("gl-texture2d"),h=a("typedarray-pool"),m=a("colormap"),g=a("ndarray-ops"),p=a("ndarray-pack"),v=a("ndarray"),y=a("surface-nets"),x=a("gl-mat4/multiply"),w=a("gl-mat4/invert"),k=a("binary-search-bounds"),b=a("ndarray-gradient"),T=a("./lib/shaders"),_=T.createShader,M=T.createContourShader,A=T.createPickShader,S=T.createPickContourShader,E=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],D=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],O=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function R(q,$,ne,H,Q){this.position=q,this.index=$,this.uv=ne,this.level=H,this.dataCoordinate=Q}(function(){for(var q=0;q<3;++q){var $=O[q],ne=(q+2)%3;$[(q+1)%3+0]=1,$[ne+3]=1,$[q+6]=1}})();function z(q,$,ne,H,Q,ee,ie,ae,ue,le,ge,fe,me,_e,we){this.gl=q,this.shape=$,this.bounds=ne,this.objectOffset=we,this.intensityBounds=[],this._shader=H,this._pickShader=Q,this._coordinateBuffer=ee,this._vao=ie,this._colorMap=ae,this._contourShader=ue,this._contourPickShader=le,this._contourBuffer=ge,this._contourVAO=fe,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new R([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=me,this._dynamicVAO=_e,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=[v(h.mallocFloat(1024),[0,0]),v(h.mallocFloat(1024),[0,0]),v(h.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 L=z.prototype;L.genColormap=function(q,$){var ne=!1,H=p([m({colormap:q,nshades:256,format:"rgba"}).map(function(Q,ee){var ie=$?function(ae,ue){if(!ue||!ue.length)return 1;for(var le=0;leae&&le>0){var ge=(ue[le][0]-ae)/(ue[le][0]-ue[le-1][0]);return ue[le][1]*(1-ge)+ge*ue[le-1][1]}}return 1}(ee/255,$):Q[3];return ie<1&&(ne=!0),[Q[0],Q[1],Q[2],255*ie]})]);return g.divseq(H,255),this.hasAlphaScale=ne,H},L.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},L.isOpaque=function(){return!this.isTransparent()},L.pickSlots=1,L.setPickBase=function(q){this.pickId=q};var P=[0,0,0],N={showSurface:!1,showContour:!1,projections:[E.slice(),E.slice(),E.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function B(q,$){var ne,H,Q,ee=$.axes&&$.axes.lastCubeProps.axis||P,ie=$.showSurface,ae=$.showContour;for(ne=0;ne<3;++ne)for(ie=ie||$.surfaceProject[ne],H=0;H<3;++H)ae=ae||$.contourProject[ne][H];for(ne=0;ne<3;++ne){var ue=N.projections[ne];for(H=0;H<16;++H)ue[H]=0;for(H=0;H<4;++H)ue[5*H]=1;ue[5*ne]=0,ue[12+ne]=$.axesBounds[+(ee[ne]>0)][ne],x(ue,q.model,ue);var le=N.clipBounds[ne];for(Q=0;Q<2;++Q)for(H=0;H<3;++H)le[Q][H]=q.clipBounds[Q][H];le[0][ne]=-1e8,le[1][ne]=1e8}return N.showSurface=ie,N.showContour=ae,N}var G={model:E,view:E,projection:E,inverseModel:E.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},W=E.slice(),K=[1,0,0,0,1,0,0,0,1];function te(q,$){q=q||{};var ne=this.gl;ne.disable(ne.CULL_FACE),this._colorMap.bind(0);var H=G;H.model=q.model||E,H.view=q.view||E,H.projection=q.projection||E,H.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],H.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],H.objectOffset=this.objectOffset,H.contourColor=this.contourColor[0],H.inverseModel=w(H.inverseModel,H.model);for(var Q=0;Q<2;++Q)for(var ee=H.clipBounds[Q],ie=0;ie<3;++ie)ee[ie]=Math.min(Math.max(this.clipBounds[Q][ie],-1e8),1e8);H.kambient=this.ambientLight,H.kdiffuse=this.diffuseLight,H.kspecular=this.specularLight,H.roughness=this.roughness,H.fresnel=this.fresnel,H.opacity=this.opacity,H.height=0,H.permutation=K,H.vertexColor=this.vertexColor;var ae=W;for(x(ae,H.view,H.model),x(ae,H.projection,ae),w(ae,ae),Q=0;Q<3;++Q)H.eyePosition[Q]=ae[12+Q]/ae[15];var ue=ae[15];for(Q=0;Q<3;++Q)ue+=this.lightPosition[Q]*ae[4*Q+3];for(Q=0;Q<3;++Q){var le=ae[12+Q];for(ie=0;ie<3;++ie)le+=ae[4*ie+Q]*this.lightPosition[ie];H.lightPosition[Q]=le/ue}var ge=B(H,this);if(ge.showSurface){for(this._shader.bind(),this._shader.uniforms=H,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ne.TRIANGLES,this._vertexCount),Q=0;Q<3;++Q)this.surfaceProject[Q]&&this.vertexCount&&(this._shader.uniforms.model=ge.projections[Q],this._shader.uniforms.clipBounds=ge.clipBounds[Q],this._vao.draw(ne.TRIANGLES,this._vertexCount));this._vao.unbind()}if(ge.showContour){var fe=this._contourShader;H.kambient=1,H.kdiffuse=0,H.kspecular=0,H.opacity=1,fe.bind(),fe.uniforms=H;var me=this._contourVAO;for(me.bind(),Q=0;Q<3;++Q)for(fe.uniforms.permutation=O[Q],ne.lineWidth(this.contourWidth[Q]*this.pixelRatio),ie=0;ie>4)/16)/255,Q=Math.floor(H),ee=H-Q,ie=$[1]*(q.value[1]+(15&q.value[2])/16)/255,ae=Math.floor(ie),ue=ie-ae;Q+=1,ae+=1;var le=ne.position;le[0]=le[1]=le[2]=0;for(var ge=0;ge<2;++ge)for(var fe=ge?ee:1-ee,me=0;me<2;++me)for(var _e=Q+ge,we=ae+me,Te=fe*(me?ue:1-ue),Oe=0;Oe<3;++Oe)le[Oe]+=this._field[Oe].get(_e,we)*Te;for(var de=this._pickResult.level,ye=0;ye<3;++ye)if(de[ye]=k.le(this.contourLevels[ye],le[ye]),de[ye]<0)this.contourLevels[ye].length>0&&(de[ye]=0);else if(de[ye]Math.abs(ke-le[ye])&&(de[ye]+=1)}for(ne.index[0]=ee<.5?Q:Q+1,ne.index[1]=ue<.5?ae:ae+1,ne.uv[0]=H/$[0],ne.uv[1]=ie/$[1],Oe=0;Oe<3;++Oe)ne.dataCoordinate[Oe]=this._field[Oe].get(ne.index[0],ne.index[1]);return ne},L.padField=function(q,$){var ne=$.shape.slice(),H=q.shape.slice();g.assign(q.lo(1,1).hi(ne[0],ne[1]),$),g.assign(q.lo(1).hi(ne[0],1),$.hi(ne[0],1)),g.assign(q.lo(1,H[1]-1).hi(ne[0],1),$.lo(0,ne[1]-1).hi(ne[0],1)),g.assign(q.lo(0,1).hi(1,ne[1]),$.hi(1)),g.assign(q.lo(H[0]-1,1).hi(1,ne[1]),$.lo(ne[0]-1)),q.set(0,0,$.get(0,0)),q.set(0,H[1]-1,$.get(0,ne[1]-1)),q.set(H[0]-1,0,$.get(ne[0]-1,0)),q.set(H[0]-1,H[1]-1,$.get(ne[0]-1,ne[1]-1))},L.update=function(q){q=q||{},this.objectOffset=q.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in q&&(this.contourWidth=Z(q.contourWidth,Number)),"showContour"in q&&(this.showContour=Z(q.showContour,Boolean)),"showSurface"in q&&(this.showSurface=!!q.showSurface),"contourTint"in q&&(this.contourTint=Z(q.contourTint,Boolean)),"contourColor"in q&&(this.contourColor=U(q.contourColor)),"contourProject"in q&&(this.contourProject=Z(q.contourProject,function(Kt){return Z(Kt,Boolean)})),"surfaceProject"in q&&(this.surfaceProject=q.surfaceProject),"dynamicColor"in q&&(this.dynamicColor=U(q.dynamicColor)),"dynamicTint"in q&&(this.dynamicTint=Z(q.dynamicTint,Number)),"dynamicWidth"in q&&(this.dynamicWidth=Z(q.dynamicWidth,Number)),"opacity"in q&&(this.opacity=q.opacity),"opacityscale"in q&&(this.opacityscale=q.opacityscale),"colorBounds"in q&&(this.colorBounds=q.colorBounds),"vertexColor"in q&&(this.vertexColor=q.vertexColor?1:0),"colormap"in q&&this._colorMap.setPixels(this.genColormap(q.colormap,this.opacityscale));var $=q.field||q.coords&&q.coords[2]||null,ne=!1;if($||($=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 q||"coords"in q){var H=($.shape[0]+2)*($.shape[1]+2);H>this._field[2].data.length&&(h.freeFloat(this._field[2].data),this._field[2].data=h.mallocFloat(i.nextPow2(H))),this._field[2]=v(this._field[2].data,[$.shape[0]+2,$.shape[1]+2]),this.padField(this._field[2],$),this.shape=$.shape.slice();for(var Q=this.shape,ee=0;ee<2;++ee)this._field[2].size>this._field[ee].data.length&&(h.freeFloat(this._field[ee].data),this._field[ee].data=h.mallocFloat(this._field[2].size)),this._field[ee]=v(this._field[ee].data,[Q[0]+2,Q[1]+2]);if(q.coords){var ie=q.coords;if(!Array.isArray(ie)||ie.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(ee=0;ee<2;++ee){var ae=ie[ee];for(me=0;me<2;++me)if(ae.shape[me]!==Q[me])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[ee],ae)}}else if(q.ticks){var ue=q.ticks;if(!Array.isArray(ue)||ue.length!==2)throw new Error("gl-surface: invalid ticks");for(ee=0;ee<2;++ee){var le=ue[ee];if((Array.isArray(le)||le.length)&&(le=v(le)),le.shape[0]!==Q[ee])throw new Error("gl-surface: invalid tick length");var ge=v(le.data,Q);ge.stride[ee]=le.stride[0],ge.stride[1^ee]=0,this.padField(this._field[ee],ge)}}else{for(ee=0;ee<2;++ee){var fe=[0,0];fe[ee]=1,this._field[ee]=v(this._field[ee].data,[Q[0]+2,Q[1]+2],fe,0)}this._field[0].set(0,0,0);for(var me=0;me0){for(var It=0;It<5;++It)Pe.pop();Pt-=1}continue e}Pe.push(rt[0],rt[1],kt[0],kt[1],rt[2]),Pt+=1}}He.push(Pt)}this._contourOffsets[Ie]=De,this._contourCounts[Ie]=He}var Zt=h.mallocFloat(Pe.length);for(ee=0;eeO||E<0||E>O)throw new Error("gl-texture2d: Invalid texture size");return A._shape=[S,E],A.bind(),D.texImage2D(D.TEXTURE_2D,0,A.format,S,E,0,A.format,A.type,null),A._mipLevels=[0],A}function x(A,S,E,D,O,R){this.gl=A,this.handle=S,this.format=O,this.type=R,this._shape=[E,D],this._mipLevels=[0],this._magFilter=A.NEAREST,this._minFilter=A.NEAREST,this._wrapS=A.CLAMP_TO_EDGE,this._wrapT=A.CLAMP_TO_EDGE,this._anisoSamples=1;var z=this,L=[this._wrapS,this._wrapT];Object.defineProperties(L,[{get:function(){return z._wrapS},set:function(N){return z.wrapS=N}},{get:function(){return z._wrapT},set:function(N){return z.wrapT=N}}]),this._wrapVector=L;var P=[this._shape[0],this._shape[1]];Object.defineProperties(P,[{get:function(){return z._shape[0]},set:function(N){return z.width=N}},{get:function(){return z._shape[1]},set:function(N){return z.height=N}}]),this._shapeVector=P}var w=x.prototype;function k(A,S){return A.length===3?S[2]===1&&S[1]===A[0]*A[2]&&S[0]===A[2]:S[0]===1&&S[1]===A[0]}function b(A){var S=A.createTexture();return A.bindTexture(A.TEXTURE_2D,S),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,A.NEAREST),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MAG_FILTER,A.NEAREST),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),S}function T(A,S,E,D,O){var R=A.getParameter(A.MAX_TEXTURE_SIZE);if(S<0||S>R||E<0||E>R)throw new Error("gl-texture2d: Invalid texture shape");if(O===A.FLOAT&&!A.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var z=b(A);return A.texImage2D(A.TEXTURE_2D,0,D,S,E,0,D,O,null),new x(A,z,S,E,D,O)}function _(A,S,E,D,O,R){var z=b(A);return A.texImage2D(A.TEXTURE_2D,0,O,O,R,S),new x(A,z,E,D,O,R)}function M(A,S){var E=S.dtype,D=S.shape.slice(),O=A.getParameter(A.MAX_TEXTURE_SIZE);if(D[0]<0||D[0]>O||D[1]<0||D[1]>O)throw new Error("gl-texture2d: Invalid texture size");var R=k(D,S.stride.slice()),z=0;E==="float32"?z=A.FLOAT:E==="float64"?(z=A.FLOAT,R=!1,E="float32"):E==="uint8"?z=A.UNSIGNED_BYTE:(z=A.UNSIGNED_BYTE,R=!1,E="uint8");var L,P,N=0;if(D.length===2)N=A.LUMINANCE,D=[D[0],D[1],1],S=i(S.data,D,[S.stride[0],S.stride[1],1],S.offset);else{if(D.length!==3)throw new Error("gl-texture2d: Invalid shape for texture");if(D[2]===1)N=A.ALPHA;else if(D[2]===2)N=A.LUMINANCE_ALPHA;else if(D[2]===3)N=A.RGB;else{if(D[2]!==4)throw new Error("gl-texture2d: Invalid shape for pixel coords");N=A.RGBA}}z!==A.FLOAT||A.getExtension("OES_texture_float")||(z=A.UNSIGNED_BYTE,R=!1);var B=S.size;if(R)L=S.offset===0&&S.data.length===B?S.data:S.data.subarray(S.offset,S.offset+B);else{var G=[D[2],D[2]*D[0],1];P=l.malloc(B,E);var W=i(P,D,G,0);E!=="float32"&&E!=="float64"||z!==A.UNSIGNED_BYTE?s.assign(W,S):v(W,S),L=P.subarray(0,B)}var K=b(A);return A.texImage2D(A.TEXTURE_2D,0,N,D[0],D[1],0,N,z,L),R||l.free(P),new x(A,K,D[0],D[1],N,z)}Object.defineProperties(w,{minFilter:{get:function(){return this._minFilter},set:function(A){this.bind();var S=this.gl;if(this.type===S.FLOAT&&d.indexOf(A)>=0&&(S.getExtension("OES_texture_float_linear")||(A=S.NEAREST)),h.indexOf(A)<0)throw new Error("gl-texture2d: Unknown filter mode "+A);return S.texParameteri(S.TEXTURE_2D,S.TEXTURE_MIN_FILTER,A),this._minFilter=A}},magFilter:{get:function(){return this._magFilter},set:function(A){this.bind();var S=this.gl;if(this.type===S.FLOAT&&d.indexOf(A)>=0&&(S.getExtension("OES_texture_float_linear")||(A=S.NEAREST)),h.indexOf(A)<0)throw new Error("gl-texture2d: Unknown filter mode "+A);return S.texParameteri(S.TEXTURE_2D,S.TEXTURE_MAG_FILTER,A),this._magFilter=A}},mipSamples:{get:function(){return this._anisoSamples},set:function(A){var S=this._anisoSamples;if(this._anisoSamples=0|Math.max(A,1),S!==this._anisoSamples){var E=this.gl.getExtension("EXT_texture_filter_anisotropic");E&&this.gl.texParameterf(this.gl.TEXTURE_2D,E.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(A){if(this.bind(),m.indexOf(A)<0)throw new Error("gl-texture2d: Unknown wrap mode "+A);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,A),this._wrapS=A}},wrapT:{get:function(){return this._wrapT},set:function(A){if(this.bind(),m.indexOf(A)<0)throw new Error("gl-texture2d: Unknown wrap mode "+A);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,A),this._wrapT=A}},wrap:{get:function(){return this._wrapVector},set:function(A){if(Array.isArray(A)||(A=[A,A]),A.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var S=0;S<2;++S)if(m.indexOf(A[S])<0)throw new Error("gl-texture2d: Unknown wrap mode "+A);this._wrapS=A[0],this._wrapT=A[1];var E=this.gl;return this.bind(),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,this._wrapS),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,this._wrapT),A}},shape:{get:function(){return this._shapeVector},set:function(A){if(Array.isArray(A)){if(A.length!==2)throw new Error("gl-texture2d: Invalid texture shape")}else A=[0|A,0|A];return y(this,0|A[0],0|A[1]),[0|A[0],0|A[1]]}},width:{get:function(){return this._shape[0]},set:function(A){return y(this,A|=0,this._shape[1]),A}},height:{get:function(){return this._shape[1]},set:function(A){return A|=0,y(this,this._shape[0],A),A}}}),w.bind=function(A){var S=this.gl;return A!==void 0&&S.activeTexture(S.TEXTURE0+(0|A)),S.bindTexture(S.TEXTURE_2D,this.handle),A!==void 0?0|A:S.getParameter(S.ACTIVE_TEXTURE)-S.TEXTURE0},w.dispose=function(){this.gl.deleteTexture(this.handle)},w.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var A=Math.min(this._shape[0],this._shape[1]),S=0;A>0;++S,A>>>=1)this._mipLevels.indexOf(S)<0&&this._mipLevels.push(S)},w.setPixels=function(A,S,E,D){var O=this.gl;this.bind(),Array.isArray(S)?(D=E,E=0|S[1],S=0|S[0]):(S=S||0,E=E||0),D=D||0;var R=p(A)?A:A.raw;if(R)this._mipLevels.indexOf(D)<0?(O.texImage2D(O.TEXTURE_2D,0,this.format,this.format,this.type,R),this._mipLevels.push(D)):O.texSubImage2D(O.TEXTURE_2D,D,S,E,this.format,this.type,R);else{if(!(A.shape&&A.stride&&A.data))throw new Error("gl-texture2d: Unsupported data type");if(A.shape.length<2||S+A.shape[1]>this._shape[1]>>>D||E+A.shape[0]>this._shape[0]>>>D||S<0||E<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");(function(z,L,P,N,B,G,W,K){var te=K.dtype,Y=K.shape.slice();if(Y.length<2||Y.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var Z=0,re=0,U=k(Y,K.stride.slice());if(te==="float32"?Z=z.FLOAT:te==="float64"?(Z=z.FLOAT,U=!1,te="float32"):te==="uint8"?Z=z.UNSIGNED_BYTE:(Z=z.UNSIGNED_BYTE,U=!1,te="uint8"),Y.length===2)re=z.LUMINANCE,Y=[Y[0],Y[1],1],K=i(K.data,Y,[K.stride[0],K.stride[1],1],K.offset);else{if(Y.length!==3)throw new Error("gl-texture2d: Invalid shape for texture");if(Y[2]===1)re=z.ALPHA;else if(Y[2]===2)re=z.LUMINANCE_ALPHA;else if(Y[2]===3)re=z.RGB;else{if(Y[2]!==4)throw new Error("gl-texture2d: Invalid shape for pixel coords");re=z.RGBA}Y[2]}if(re!==z.LUMINANCE&&re!==z.ALPHA||B!==z.LUMINANCE&&B!==z.ALPHA||(re=B),re!==B)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var q=K.size,$=W.indexOf(N)<0;if($&&W.push(N),Z===G&&U)K.offset===0&&K.data.length===q?$?z.texImage2D(z.TEXTURE_2D,N,B,Y[0],Y[1],0,B,G,K.data):z.texSubImage2D(z.TEXTURE_2D,N,L,P,Y[0],Y[1],B,G,K.data):$?z.texImage2D(z.TEXTURE_2D,N,B,Y[0],Y[1],0,B,G,K.data.subarray(K.offset,K.offset+q)):z.texSubImage2D(z.TEXTURE_2D,N,L,P,Y[0],Y[1],B,G,K.data.subarray(K.offset,K.offset+q));else{var ne;ne=G===z.FLOAT?l.mallocFloat32(q):l.mallocUint8(q);var H=i(ne,Y,[Y[2],Y[2]*Y[0],1]);Z===z.FLOAT&&G===z.UNSIGNED_BYTE?v(H,K):s.assign(H,K),$?z.texImage2D(z.TEXTURE_2D,N,B,Y[0],Y[1],0,B,G,ne.subarray(0,q)):z.texSubImage2D(z.TEXTURE_2D,N,L,P,Y[0],Y[1],B,G,ne.subarray(0,q)),G===z.FLOAT?l.freeFloat32(ne):l.freeUint8(ne)}})(O,S,E,D,this.format,this.type,this._mipLevels,A)}}},{ndarray:259,"ndarray-ops":254,"typedarray-pool":308}],147:[function(a,u,c){u.exports=function(i,s,l){s?s.bind():i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null);var d=0|i.getParameter(i.MAX_VERTEX_ATTRIBS);if(l){if(l.length>d)throw new Error("gl-vao: Too many vertex attributes");for(var h=0;h1?0:Math.acos(p)};var i=a("./fromValues"),s=a("./normalize"),l=a("./dot")},{"./dot":162,"./fromValues":168,"./normalize":179}],153:[function(a,u,c){u.exports=function(i,s){return i[0]=Math.ceil(s[0]),i[1]=Math.ceil(s[1]),i[2]=Math.ceil(s[2]),i}},{}],154:[function(a,u,c){u.exports=function(i){var s=new Float32Array(3);return s[0]=i[0],s[1]=i[1],s[2]=i[2],s}},{}],155:[function(a,u,c){u.exports=function(i,s){return i[0]=s[0],i[1]=s[1],i[2]=s[2],i}},{}],156:[function(a,u,c){u.exports=function(){var i=new Float32Array(3);return i[0]=0,i[1]=0,i[2]=0,i}},{}],157:[function(a,u,c){u.exports=function(i,s,l){var d=s[0],h=s[1],m=s[2],g=l[0],p=l[1],v=l[2];return i[0]=h*v-m*p,i[1]=m*g-d*v,i[2]=d*p-h*g,i}},{}],158:[function(a,u,c){u.exports=a("./distance")},{"./distance":159}],159:[function(a,u,c){u.exports=function(i,s){var l=s[0]-i[0],d=s[1]-i[1],h=s[2]-i[2];return Math.sqrt(l*l+d*d+h*h)}},{}],160:[function(a,u,c){u.exports=a("./divide")},{"./divide":161}],161:[function(a,u,c){u.exports=function(i,s,l){return i[0]=s[0]/l[0],i[1]=s[1]/l[1],i[2]=s[2]/l[2],i}},{}],162:[function(a,u,c){u.exports=function(i,s){return i[0]*s[0]+i[1]*s[1]+i[2]*s[2]}},{}],163:[function(a,u,c){u.exports=1e-6},{}],164:[function(a,u,c){u.exports=function(s,l){var d=s[0],h=s[1],m=s[2],g=l[0],p=l[1],v=l[2];return Math.abs(d-g)<=i*Math.max(1,Math.abs(d),Math.abs(g))&&Math.abs(h-p)<=i*Math.max(1,Math.abs(h),Math.abs(p))&&Math.abs(m-v)<=i*Math.max(1,Math.abs(m),Math.abs(v))};var i=a("./epsilon")},{"./epsilon":163}],165:[function(a,u,c){u.exports=function(i,s){return i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]}},{}],166:[function(a,u,c){u.exports=function(i,s){return i[0]=Math.floor(s[0]),i[1]=Math.floor(s[1]),i[2]=Math.floor(s[2]),i}},{}],167:[function(a,u,c){u.exports=function(s,l,d,h,m,g){var p,v;for(l||(l=3),d||(d=0),v=h?Math.min(h*l+d,s.length):s.length,p=d;p0&&(m=1/Math.sqrt(m),i[0]=s[0]*m,i[1]=s[1]*m,i[2]=s[2]*m),i}},{}],180:[function(a,u,c){u.exports=function(i,s){s=s||1;var l=2*Math.random()*Math.PI,d=2*Math.random()-1,h=Math.sqrt(1-d*d)*s;return i[0]=Math.cos(l)*h,i[1]=Math.sin(l)*h,i[2]=d*s,i}},{}],181:[function(a,u,c){u.exports=function(i,s,l,d){var h=l[1],m=l[2],g=s[1]-h,p=s[2]-m,v=Math.sin(d),y=Math.cos(d);return i[0]=s[0],i[1]=h+g*y-p*v,i[2]=m+g*v+p*y,i}},{}],182:[function(a,u,c){u.exports=function(i,s,l,d){var h=l[0],m=l[2],g=s[0]-h,p=s[2]-m,v=Math.sin(d),y=Math.cos(d);return i[0]=h+p*v+g*y,i[1]=s[1],i[2]=m+p*y-g*v,i}},{}],183:[function(a,u,c){u.exports=function(i,s,l,d){var h=l[0],m=l[1],g=s[0]-h,p=s[1]-m,v=Math.sin(d),y=Math.cos(d);return i[0]=h+g*y-p*v,i[1]=m+g*v+p*y,i[2]=s[2],i}},{}],184:[function(a,u,c){u.exports=function(i,s){return i[0]=Math.round(s[0]),i[1]=Math.round(s[1]),i[2]=Math.round(s[2]),i}},{}],185:[function(a,u,c){u.exports=function(i,s,l){return i[0]=s[0]*l,i[1]=s[1]*l,i[2]=s[2]*l,i}},{}],186:[function(a,u,c){u.exports=function(i,s,l,d){return i[0]=s[0]+l[0]*d,i[1]=s[1]+l[1]*d,i[2]=s[2]+l[2]*d,i}},{}],187:[function(a,u,c){u.exports=function(i,s,l,d){return i[0]=s,i[1]=l,i[2]=d,i}},{}],188:[function(a,u,c){u.exports=a("./squaredDistance")},{"./squaredDistance":190}],189:[function(a,u,c){u.exports=a("./squaredLength")},{"./squaredLength":191}],190:[function(a,u,c){u.exports=function(i,s){var l=s[0]-i[0],d=s[1]-i[1],h=s[2]-i[2];return l*l+d*d+h*h}},{}],191:[function(a,u,c){u.exports=function(i){var s=i[0],l=i[1],d=i[2];return s*s+l*l+d*d}},{}],192:[function(a,u,c){u.exports=a("./subtract")},{"./subtract":193}],193:[function(a,u,c){u.exports=function(i,s,l){return i[0]=s[0]-l[0],i[1]=s[1]-l[1],i[2]=s[2]-l[2],i}},{}],194:[function(a,u,c){u.exports=function(i,s,l){var d=s[0],h=s[1],m=s[2];return i[0]=d*l[0]+h*l[3]+m*l[6],i[1]=d*l[1]+h*l[4]+m*l[7],i[2]=d*l[2]+h*l[5]+m*l[8],i}},{}],195:[function(a,u,c){u.exports=function(i,s,l){var d=s[0],h=s[1],m=s[2],g=l[3]*d+l[7]*h+l[11]*m+l[15];return g=g||1,i[0]=(l[0]*d+l[4]*h+l[8]*m+l[12])/g,i[1]=(l[1]*d+l[5]*h+l[9]*m+l[13])/g,i[2]=(l[2]*d+l[6]*h+l[10]*m+l[14])/g,i}},{}],196:[function(a,u,c){u.exports=function(i,s,l){var d=s[0],h=s[1],m=s[2],g=l[0],p=l[1],v=l[2],y=l[3],x=y*d+p*m-v*h,w=y*h+v*d-g*m,k=y*m+g*h-p*d,b=-g*d-p*h-v*m;return i[0]=x*y+b*-g+w*-v-k*-p,i[1]=w*y+b*-p+k*-g-x*-v,i[2]=k*y+b*-v+x*-p-w*-g,i}},{}],197:[function(a,u,c){u.exports=function(i,s,l){return i[0]=s[0]+l[0],i[1]=s[1]+l[1],i[2]=s[2]+l[2],i[3]=s[3]+l[3],i}},{}],198:[function(a,u,c){u.exports=function(i){var s=new Float32Array(4);return s[0]=i[0],s[1]=i[1],s[2]=i[2],s[3]=i[3],s}},{}],199:[function(a,u,c){u.exports=function(i,s){return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i}},{}],200:[function(a,u,c){u.exports=function(){var i=new Float32Array(4);return i[0]=0,i[1]=0,i[2]=0,i[3]=0,i}},{}],201:[function(a,u,c){u.exports=function(i,s){var l=s[0]-i[0],d=s[1]-i[1],h=s[2]-i[2],m=s[3]-i[3];return Math.sqrt(l*l+d*d+h*h+m*m)}},{}],202:[function(a,u,c){u.exports=function(i,s,l){return i[0]=s[0]/l[0],i[1]=s[1]/l[1],i[2]=s[2]/l[2],i[3]=s[3]/l[3],i}},{}],203:[function(a,u,c){u.exports=function(i,s){return i[0]*s[0]+i[1]*s[1]+i[2]*s[2]+i[3]*s[3]}},{}],204:[function(a,u,c){u.exports=function(i,s,l,d){var h=new Float32Array(4);return h[0]=i,h[1]=s,h[2]=l,h[3]=d,h}},{}],205:[function(a,u,c){u.exports={create:a("./create"),clone:a("./clone"),fromValues:a("./fromValues"),copy:a("./copy"),set:a("./set"),add:a("./add"),subtract:a("./subtract"),multiply:a("./multiply"),divide:a("./divide"),min:a("./min"),max:a("./max"),scale:a("./scale"),scaleAndAdd:a("./scaleAndAdd"),distance:a("./distance"),squaredDistance:a("./squaredDistance"),length:a("./length"),squaredLength:a("./squaredLength"),negate:a("./negate"),inverse:a("./inverse"),normalize:a("./normalize"),dot:a("./dot"),lerp:a("./lerp"),random:a("./random"),transformMat4:a("./transformMat4"),transformQuat:a("./transformQuat")}},{"./add":197,"./clone":198,"./copy":199,"./create":200,"./distance":201,"./divide":202,"./dot":203,"./fromValues":204,"./inverse":206,"./length":207,"./lerp":208,"./max":209,"./min":210,"./multiply":211,"./negate":212,"./normalize":213,"./random":214,"./scale":215,"./scaleAndAdd":216,"./set":217,"./squaredDistance":218,"./squaredLength":219,"./subtract":220,"./transformMat4":221,"./transformQuat":222}],206:[function(a,u,c){u.exports=function(i,s){return i[0]=1/s[0],i[1]=1/s[1],i[2]=1/s[2],i[3]=1/s[3],i}},{}],207:[function(a,u,c){u.exports=function(i){var s=i[0],l=i[1],d=i[2],h=i[3];return Math.sqrt(s*s+l*l+d*d+h*h)}},{}],208:[function(a,u,c){u.exports=function(i,s,l,d){var h=s[0],m=s[1],g=s[2],p=s[3];return i[0]=h+d*(l[0]-h),i[1]=m+d*(l[1]-m),i[2]=g+d*(l[2]-g),i[3]=p+d*(l[3]-p),i}},{}],209:[function(a,u,c){u.exports=function(i,s,l){return i[0]=Math.max(s[0],l[0]),i[1]=Math.max(s[1],l[1]),i[2]=Math.max(s[2],l[2]),i[3]=Math.max(s[3],l[3]),i}},{}],210:[function(a,u,c){u.exports=function(i,s,l){return i[0]=Math.min(s[0],l[0]),i[1]=Math.min(s[1],l[1]),i[2]=Math.min(s[2],l[2]),i[3]=Math.min(s[3],l[3]),i}},{}],211:[function(a,u,c){u.exports=function(i,s,l){return i[0]=s[0]*l[0],i[1]=s[1]*l[1],i[2]=s[2]*l[2],i[3]=s[3]*l[3],i}},{}],212:[function(a,u,c){u.exports=function(i,s){return i[0]=-s[0],i[1]=-s[1],i[2]=-s[2],i[3]=-s[3],i}},{}],213:[function(a,u,c){u.exports=function(i,s){var l=s[0],d=s[1],h=s[2],m=s[3],g=l*l+d*d+h*h+m*m;return g>0&&(g=1/Math.sqrt(g),i[0]=l*g,i[1]=d*g,i[2]=h*g,i[3]=m*g),i}},{}],214:[function(a,u,c){var i=a("./normalize"),s=a("./scale");u.exports=function(l,d){return d=d||1,l[0]=Math.random(),l[1]=Math.random(),l[2]=Math.random(),l[3]=Math.random(),i(l,l),s(l,l,d),l}},{"./normalize":213,"./scale":215}],215:[function(a,u,c){u.exports=function(i,s,l){return i[0]=s[0]*l,i[1]=s[1]*l,i[2]=s[2]*l,i[3]=s[3]*l,i}},{}],216:[function(a,u,c){u.exports=function(i,s,l,d){return i[0]=s[0]+l[0]*d,i[1]=s[1]+l[1]*d,i[2]=s[2]+l[2]*d,i[3]=s[3]+l[3]*d,i}},{}],217:[function(a,u,c){u.exports=function(i,s,l,d,h){return i[0]=s,i[1]=l,i[2]=d,i[3]=h,i}},{}],218:[function(a,u,c){u.exports=function(i,s){var l=s[0]-i[0],d=s[1]-i[1],h=s[2]-i[2],m=s[3]-i[3];return l*l+d*d+h*h+m*m}},{}],219:[function(a,u,c){u.exports=function(i){var s=i[0],l=i[1],d=i[2],h=i[3];return s*s+l*l+d*d+h*h}},{}],220:[function(a,u,c){u.exports=function(i,s,l){return i[0]=s[0]-l[0],i[1]=s[1]-l[1],i[2]=s[2]-l[2],i[3]=s[3]-l[3],i}},{}],221:[function(a,u,c){u.exports=function(i,s,l){var d=s[0],h=s[1],m=s[2],g=s[3];return i[0]=l[0]*d+l[4]*h+l[8]*m+l[12]*g,i[1]=l[1]*d+l[5]*h+l[9]*m+l[13]*g,i[2]=l[2]*d+l[6]*h+l[10]*m+l[14]*g,i[3]=l[3]*d+l[7]*h+l[11]*m+l[15]*g,i}},{}],222:[function(a,u,c){u.exports=function(i,s,l){var d=s[0],h=s[1],m=s[2],g=l[0],p=l[1],v=l[2],y=l[3],x=y*d+p*m-v*h,w=y*h+v*d-g*m,k=y*m+g*h-p*d,b=-g*d-p*h-v*m;return i[0]=x*y+b*-g+w*-v-k*-p,i[1]=w*y+b*-p+k*-g-x*-v,i[2]=k*y+b*-v+x*-p-w*-g,i[3]=s[3],i}},{}],223:[function(a,u,c){var i=a("glsl-tokenizer"),s=a("atob-lite");u.exports=function(l){for(var d=Array.isArray(l)?l:i(l),h=0;h0)continue;ne=q.slice(0,1).join("")}return P(ne),A+=ne.length,(b=b.slice(ne.length)).length}}function Y(){return/[^a-fA-F0-9]/.test(p)?(P(b.join("")),k=999,x):(b.push(p),v=p,x+1)}function Z(){return p==="."||/[eE]/.test(p)?(b.push(p),k=5,v=p,x+1):p==="x"&&b.length===1&&b[0]==="0"?(k=11,b.push(p),v=p,x+1):/[^\d]/.test(p)?(P(b.join("")),k=999,x):(b.push(p),v=p,x+1)}function re(){return p==="f"&&(b.push(p),v=p,x+=1),/[eE]/.test(p)?(b.push(p),v=p,x+1):(p!=="-"&&p!=="+"||!/[eE]/.test(v))&&/[^\d]/.test(p)?(P(b.join("")),k=999,x):(b.push(p),v=p,x+1)}function U(){if(/[^\d\w_]/.test(p)){var q=b.join("");return k=L[q]?8:z[q]?7:6,P(b.join("")),k=999,x}return b.push(p),v=p,x+1}};var i=a("./lib/literals"),s=a("./lib/operators"),l=a("./lib/builtins"),d=a("./lib/literals-300es"),h=a("./lib/builtins-300es"),m=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":226,"./lib/builtins-300es":225,"./lib/literals":228,"./lib/literals-300es":227,"./lib/operators":229}],225:[function(a,u,c){var i=a("./builtins");i=i.slice().filter(function(s){return!/^(gl\_|texture)/.test(s)}),u.exports=i.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":226}],226:[function(a,u,c){u.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"]},{}],227:[function(a,u,c){var i=a("./literals");u.exports=i.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"])},{"./literals":228}],228:[function(a,u,c){u.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"]},{}],229:[function(a,u,c){u.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],230:[function(a,u,c){var i=a("./index");u.exports=function(s,l){var d=i(l),h=[];return h=(h=h.concat(d(s))).concat(d(null))}},{"./index":224}],231:[function(a,u,c){u.exports=function(i){typeof i=="string"&&(i=[i]);for(var s=[].slice.call(arguments,1),l=[],d=0;d0;)for(var _=(v=T.pop()).adjacent,M=0;M<=x;++M){var A=_[M];if(A.boundary&&!(A.lastVisited<=-w)){for(var S=A.vertices,E=0;E<=x;++E){var D=S[E];k[E]=D<0?y:b[D]}var O=this.orient();if(O>0)return A;A.lastVisited=-w,O===0&&T.push(A)}}return null},p.walk=function(v,y){var x=this.vertices.length-1,w=this.dimension,k=this.vertices,b=this.tuple,T=y?this.interior.length*Math.random()|0:this.interior.length-1,_=this.interior[T];e:for(;!_.boundary;){for(var M=_.vertices,A=_.adjacent,S=0;S<=w;++S)b[S]=k[M[S]];for(_.lastVisited=x,S=0;S<=w;++S){var E=A[S];if(!(E.lastVisited>=x)){var D=b[S];b[S]=v;var O=this.orient();if(b[S]=D,O<0){_=E;continue e}E.boundary?E.lastVisited=-x:E.lastVisited=x}}return}return _},p.addPeaks=function(v,y){var x=this.vertices.length-1,w=this.dimension,k=this.vertices,b=this.tuple,T=this.interior,_=this.simplices,M=[y];y.lastVisited=x,y.vertices[y.vertices.indexOf(-1)]=x,y.boundary=!1,T.push(y);for(var A=[];M.length>0;){var S=(y=M.pop()).vertices,E=y.adjacent,D=S.indexOf(x);if(!(D<0)){for(var O=0;O<=w;++O)if(O!==D){var R=E[O];if(R.boundary&&!(R.lastVisited>=x)){var z=R.vertices;if(R.lastVisited!==-x){for(var L=0,P=0;P<=w;++P)z[P]<0?(L=P,b[P]=v):b[P]=k[z[P]];if(this.orient()>0){z[L]=x,R.boundary=!1,T.push(R),M.push(R),R.lastVisited=x;continue}R.lastVisited=-x}var N=R.adjacent,B=S.slice(),G=E.slice(),W=new l(B,G,!0);_.push(W);var K=N.indexOf(y);if(!(K<0))for(N[K]=W,G[D]=R,B[O]=-1,G[O]=y,E[O]=W,W.flip(),P=0;P<=w;++P){var te=B[P];if(!(te<0||te===x)){for(var Y=new Array(w-1),Z=0,re=0;re<=w;++re){var U=B[re];U<0||re===P||(Y[Z++]=U)}A.push(new d(Y,W,P))}}}}}}for(A.sort(h),O=0;O+1=0?T[M++]=_[S]:A=1&S;if(A===(1&v)){var E=T[0];T[0]=T[1],T[1]=E}y.push(T)}}return y}},{"robust-orientation":284,"simplicial-complex":293}],234:[function(a,u,c){var i=a("binary-search-bounds");function s(M,A,S,E,D){this.mid=M,this.left=A,this.right=S,this.leftPoints=E,this.rightPoints=D,this.count=(A?A.count:0)+(S?S.count:0)+E.length}u.exports=function(M){return!M||M.length===0?new T(null):new T(b(M))};var l=s.prototype;function d(M,A){M.mid=A.mid,M.left=A.left,M.right=A.right,M.leftPoints=A.leftPoints,M.rightPoints=A.rightPoints,M.count=A.count}function h(M,A){var S=b(A);M.mid=S.mid,M.left=S.left,M.right=S.right,M.leftPoints=S.leftPoints,M.rightPoints=S.rightPoints,M.count=S.count}function m(M,A){var S=M.intervals([]);S.push(A),h(M,S)}function g(M,A){var S=M.intervals([]),E=S.indexOf(A);return E<0?0:(S.splice(E,1),h(M,S),1)}function p(M,A,S){for(var E=0;E=0&&M[E][1]>=A;--E){var D=S(M[E]);if(D)return D}}function y(M,A){for(var S=0;S>1],D=[],O=[],R=[];for(S=0;S3*(A+1)?m(this,M):this.left.insert(M):this.left=b([M]);else if(M[0]>this.mid)this.right?4*(this.right.count+1)>3*(A+1)?m(this,M):this.right.insert(M):this.right=b([M]);else{var S=i.ge(this.leftPoints,M,w),E=i.ge(this.rightPoints,M,k);this.leftPoints.splice(S,0,M),this.rightPoints.splice(E,0,M)}},l.remove=function(M){var A=this.count-this.leftPoints;if(M[1]3*(A-1)?g(this,M):(O=this.left.remove(M))===2?(this.left=null,this.count-=1,1):(O===1&&(this.count-=1),O):0;if(M[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(A-1)?g(this,M):(O=this.right.remove(M))===2?(this.right=null,this.count-=1,1):(O===1&&(this.count-=1),O):0;if(this.count===1)return this.leftPoints[0]===M?2:0;if(this.leftPoints.length===1&&this.leftPoints[0]===M){if(this.left&&this.right){for(var S=this,E=this.left;E.right;)S=E,E=E.right;if(S===this)E.right=this.right;else{var D=this.left,O=this.right;S.count-=E.count,S.right=E.left,E.left=D,E.right=O}d(this,E),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?d(this,this.left):d(this,this.right);return 1}for(D=i.ge(this.leftPoints,M,w);Dthis.mid){var S;return this.right&&(S=this.right.queryPoint(M,A))?S:v(this.rightPoints,M,A)}return y(this.leftPoints,A)},l.queryInterval=function(M,A,S){var E;return Mthis.mid&&this.right&&(E=this.right.queryInterval(M,A,S))?E:Athis.mid?v(this.rightPoints,M,S):y(this.leftPoints,S)};var _=T.prototype;_.insert=function(M){this.root?this.root.insert(M):this.root=new s(M[0],null,null,[M],[M])},_.remove=function(M){if(this.root){var A=this.root.remove(M);return A===2&&(this.root=null),A!==0}return!1},_.queryPoint=function(M,A){if(this.root)return this.root.queryPoint(M,A)},_.queryInterval=function(M,A,S){if(M<=A&&this.root)return this.root.queryInterval(M,A,S)},Object.defineProperty(_,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(_,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":31}],235:[function(a,u,c){u.exports=function(i){for(var s=new Array(i),l=0;l + * @license MIT + */u.exports=function(s){return s!=null&&(i(s)||function(l){return typeof l.readFloatLE=="function"&&typeof l.slice=="function"&&i(l.slice(0,0))}(s)||!!s._isBuffer)}},{}],238:[function(a,u,c){u.exports=l,u.exports.isMobile=l,u.exports.default=l;var i=/(android|bb\d+|meego).+mobile|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|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,s=/(android|bb\d+|meego).+mobile|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|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function l(d){d||(d={});var h=d.ua;if(h||typeof navigator>"u"||(h=navigator.userAgent),h&&h.headers&&typeof h.headers["user-agent"]=="string"&&(h=h.headers["user-agent"]),typeof h!="string")return!1;var m=d.tablet?s.test(h):i.test(h);return!m&&d.tablet&&d.featureDetect&&navigator&&navigator.maxTouchPoints>1&&h.indexOf("Macintosh")!==-1&&h.indexOf("Safari")!==-1&&(m=!0),m}},{}],239:[function(a,u,c){u.exports=function(i){for(var s,l=i.length,d=0;d13)&&s!==32&&s!==133&&s!==160&&s!==5760&&s!==6158&&(s<8192||s>8205)&&s!==8232&&s!==8233&&s!==8239&&s!==8287&&s!==8288&&s!==12288&&s!==65279)return!1;return!0}},{}],240:[function(a,u,c){u.exports=function(i,s,l){return i*(1-l)+s*l}},{}],241:[function(a,u,c){var i=a("./normalize"),s=a("gl-mat4/create"),l=a("gl-mat4/clone"),d=a("gl-mat4/determinant"),h=a("gl-mat4/invert"),m=a("gl-mat4/transpose"),g={length:a("gl-vec3/length"),normalize:a("gl-vec3/normalize"),dot:a("gl-vec3/dot"),cross:a("gl-vec3/cross")},p=s(),v=s(),y=[0,0,0,0],x=[[0,0,0],[0,0,0],[0,0,0]],w=[0,0,0];function k(b,T,_,M,A){b[0]=T[0]*M+_[0]*A,b[1]=T[1]*M+_[1]*A,b[2]=T[2]*M+_[2]*A}u.exports=function(b,T,_,M,A,S){if(T||(T=[0,0,0]),_||(_=[0,0,0]),M||(M=[0,0,0]),A||(A=[0,0,0,1]),S||(S=[0,0,0,1]),!i(p,b)||(l(v,p),v[3]=0,v[7]=0,v[11]=0,v[15]=1,Math.abs(d(v)<1e-8)))return!1;var E,D,O,R,z,L,P,N=p[3],B=p[7],G=p[11],W=p[12],K=p[13],te=p[14],Y=p[15];if(N!==0||B!==0||G!==0){if(y[0]=N,y[1]=B,y[2]=G,y[3]=Y,!h(v,v))return!1;m(v,v),E=A,O=v,R=(D=y)[0],z=D[1],L=D[2],P=D[3],E[0]=O[0]*R+O[4]*z+O[8]*L+O[12]*P,E[1]=O[1]*R+O[5]*z+O[9]*L+O[13]*P,E[2]=O[2]*R+O[6]*z+O[10]*L+O[14]*P,E[3]=O[3]*R+O[7]*z+O[11]*L+O[15]*P}else A[0]=A[1]=A[2]=0,A[3]=1;if(T[0]=W,T[1]=K,T[2]=te,function(re,U){re[0][0]=U[0],re[0][1]=U[1],re[0][2]=U[2],re[1][0]=U[4],re[1][1]=U[5],re[1][2]=U[6],re[2][0]=U[8],re[2][1]=U[9],re[2][2]=U[10]}(x,p),_[0]=g.length(x[0]),g.normalize(x[0],x[0]),M[0]=g.dot(x[0],x[1]),k(x[1],x[1],x[0],1,-M[0]),_[1]=g.length(x[1]),g.normalize(x[1],x[1]),M[0]/=_[1],M[1]=g.dot(x[0],x[2]),k(x[2],x[2],x[0],1,-M[1]),M[2]=g.dot(x[1],x[2]),k(x[2],x[2],x[1],1,-M[2]),_[2]=g.length(x[2]),g.normalize(x[2],x[2]),M[1]/=_[2],M[2]/=_[2],g.cross(w,x[1],x[2]),g.dot(x[0],w)<0)for(var Z=0;Z<3;Z++)_[Z]*=-1,x[Z][0]*=-1,x[Z][1]*=-1,x[Z][2]*=-1;return S[0]=.5*Math.sqrt(Math.max(1+x[0][0]-x[1][1]-x[2][2],0)),S[1]=.5*Math.sqrt(Math.max(1-x[0][0]+x[1][1]-x[2][2],0)),S[2]=.5*Math.sqrt(Math.max(1-x[0][0]-x[1][1]+x[2][2],0)),S[3]=.5*Math.sqrt(Math.max(1+x[0][0]+x[1][1]+x[2][2],0)),x[2][1]>x[1][2]&&(S[0]=-S[0]),x[0][2]>x[2][0]&&(S[1]=-S[1]),x[1][0]>x[0][1]&&(S[2]=-S[2]),!0}},{"./normalize":242,"gl-mat4/clone":92,"gl-mat4/create":93,"gl-mat4/determinant":94,"gl-mat4/invert":98,"gl-mat4/transpose":109,"gl-vec3/cross":157,"gl-vec3/dot":162,"gl-vec3/length":172,"gl-vec3/normalize":179}],242:[function(a,u,c){u.exports=function(i,s){var l=s[15];if(l===0)return!1;for(var d=1/l,h=0;h<16;h++)i[h]=s[h]*d;return!0}},{}],243:[function(a,u,c){var i=a("gl-vec3/lerp"),s=a("mat4-recompose"),l=a("mat4-decompose"),d=a("gl-mat4/determinant"),h=a("quat-slerp"),m=v(),g=v(),p=v();function v(){return{translate:y(),scale:y(1),skew:y(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function y(x){return[x||0,x||0,x||0]}u.exports=function(x,w,k,b){if(d(w)===0||d(k)===0)return!1;var T=l(w,m.translate,m.scale,m.skew,m.perspective,m.quaternion),_=l(k,g.translate,g.scale,g.skew,g.perspective,g.quaternion);return!(!T||!_)&&(i(p.translate,m.translate,g.translate,b),i(p.skew,m.skew,g.skew,b),i(p.scale,m.scale,g.scale,b),i(p.perspective,m.perspective,g.perspective,b),h(p.quaternion,m.quaternion,g.quaternion,b),s(x,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}},{"gl-mat4/determinant":94,"gl-vec3/lerp":173,"mat4-decompose":241,"mat4-recompose":244,"quat-slerp":271}],244:[function(a,u,c){var i={identity:a("gl-mat4/identity"),translate:a("gl-mat4/translate"),multiply:a("gl-mat4/multiply"),create:a("gl-mat4/create"),scale:a("gl-mat4/scale"),fromRotationTranslation:a("gl-mat4/fromRotationTranslation")},s=(i.create(),i.create());u.exports=function(l,d,h,m,g,p){return i.identity(l),i.fromRotationTranslation(l,p,d),l[3]=g[0],l[7]=g[1],l[11]=g[2],l[15]=g[3],i.identity(s),m[2]!==0&&(s[9]=m[2],i.multiply(l,l,s)),m[1]!==0&&(s[9]=0,s[8]=m[1],i.multiply(l,l,s)),m[0]!==0&&(s[8]=0,s[4]=m[0],i.multiply(l,l,s)),i.scale(l,l,h),l}},{"gl-mat4/create":93,"gl-mat4/fromRotationTranslation":96,"gl-mat4/identity":97,"gl-mat4/multiply":100,"gl-mat4/scale":107,"gl-mat4/translate":108}],245:[function(a,u,c){var i=a("binary-search-bounds"),s=a("mat4-interpolate"),l=a("gl-mat4/invert"),d=a("gl-mat4/rotateX"),h=a("gl-mat4/rotateY"),m=a("gl-mat4/rotateZ"),g=a("gl-mat4/lookAt"),p=a("gl-mat4/translate"),v=(a("gl-mat4/scale"),a("gl-vec3/normalize")),y=[0,0,0];function x(b){this._components=b.slice(),this._time=[0],this.prevMatrix=b.slice(),this.nextMatrix=b.slice(),this.computedMatrix=b.slice(),this.computedInverse=b.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]}u.exports=function(b){return new x((b=b||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var w=x.prototype;w.recalcMatrix=function(b){var T=this._time,_=i.le(T,b),M=this.computedMatrix;if(!(_<0)){var A=this._components;if(_===T.length-1)for(var S=16*_,E=0;E<16;++E)M[E]=A[S++];else{var D=T[_+1]-T[_],O=(S=16*_,this.prevMatrix),R=!0;for(E=0;E<16;++E)O[E]=A[S++];var z=this.nextMatrix;for(E=0;E<16;++E)z[E]=A[S++],R=R&&O[E]===z[E];if(D<1e-6||R)for(E=0;E<16;++E)M[E]=O[E];else s(M,O,z,(b-T[_])/D)}var L=this.computedUp;L[0]=M[1],L[1]=M[5],L[2]=M[9],v(L,L);var P=this.computedInverse;l(P,M);var N=this.computedEye,B=P[15];N[0]=P[12]/B,N[1]=P[13]/B,N[2]=P[14]/B;var G=this.computedCenter,W=Math.exp(this.computedRadius[0]);for(E=0;E<3;++E)G[E]=N[E]-M[2+4*E]*W}},w.idle=function(b){if(!(b1&&i(s[g[x-2]],s[g[x-1]],y)<=0;)x-=1,g.pop();for(g.push(v),x=p.length;x>1&&i(s[p[x-2]],s[p[x-1]],y)>=0;)x-=1,p.pop();p.push(v)}d=new Array(p.length+g.length-2);for(var w=0,k=(h=0,g.length);h0;--b)d[w++]=p[b];return d};var i=a("robust-orientation")[3]},{"robust-orientation":284}],247:[function(a,u,c){u.exports=function(s,l){l||(l=s,s=window);var d=0,h=0,m=0,g={shift:!1,alt:!1,control:!1,meta:!1},p=!1;function v(S){var E=!1;return"altKey"in S&&(E=E||S.altKey!==g.alt,g.alt=!!S.altKey),"shiftKey"in S&&(E=E||S.shiftKey!==g.shift,g.shift=!!S.shiftKey),"ctrlKey"in S&&(E=E||S.ctrlKey!==g.control,g.control=!!S.ctrlKey),"metaKey"in S&&(E=E||S.metaKey!==g.meta,g.meta=!!S.metaKey),E}function y(S,E){var D=i.x(E),O=i.y(E);"buttons"in E&&(S=0|E.buttons),(S!==d||D!==h||O!==m||v(E))&&(d=0|S,h=D||0,m=O||0,l&&l(d,h,m,g))}function x(S){y(0,S)}function w(){(d||h||m||g.shift||g.alt||g.meta||g.control)&&(h=m=0,d=0,g.shift=g.alt=g.control=g.meta=!1,l&&l(0,0,0,g))}function k(S){v(S)&&l&&l(d,h,m,g)}function b(S){i.buttons(S)===0?y(0,S):y(d,S)}function T(S){y(d|i.buttons(S),S)}function _(S){y(d&~i.buttons(S),S)}function M(){p||(p=!0,s.addEventListener("mousemove",b),s.addEventListener("mousedown",T),s.addEventListener("mouseup",_),s.addEventListener("mouseleave",x),s.addEventListener("mouseenter",x),s.addEventListener("mouseout",x),s.addEventListener("mouseover",x),s.addEventListener("blur",w),s.addEventListener("keyup",k),s.addEventListener("keydown",k),s.addEventListener("keypress",k),s!==window&&(window.addEventListener("blur",w),window.addEventListener("keyup",k),window.addEventListener("keydown",k),window.addEventListener("keypress",k)))}M();var A={element:s};return Object.defineProperties(A,{enabled:{get:function(){return p},set:function(S){S?M():function(){!p||(p=!1,s.removeEventListener("mousemove",b),s.removeEventListener("mousedown",T),s.removeEventListener("mouseup",_),s.removeEventListener("mouseleave",x),s.removeEventListener("mouseenter",x),s.removeEventListener("mouseout",x),s.removeEventListener("mouseover",x),s.removeEventListener("blur",w),s.removeEventListener("keyup",k),s.removeEventListener("keydown",k),s.removeEventListener("keypress",k),s!==window&&(window.removeEventListener("blur",w),window.removeEventListener("keyup",k),window.removeEventListener("keydown",k),window.removeEventListener("keypress",k)))}()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return h},enumerable:!0},y:{get:function(){return m},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),A};var i=a("mouse-event")},{"mouse-event":249}],248:[function(a,u,c){var i={left:0,top:0};u.exports=function(s,l,d){l=l||s.currentTarget||s.srcElement,Array.isArray(d)||(d=[0,0]);var h=s.clientX||0,m=s.clientY||0,g=(p=l,p===window||p===document||p===document.body?i:p.getBoundingClientRect()),p;return d[0]=h-g.left,d[1]=m-g.top,d}},{}],249:[function(a,u,c){function i(s){return s.target||s.srcElement||window}c.buttons=function(s){if(typeof s=="object"){if("buttons"in s)return s.buttons;if("which"in s){if((l=s.which)===2)return 4;if(l===3)return 2;if(l>0)return 1<=0)return 1< 0"),typeof l.vertex!="function"&&d("Must specify vertex creation function"),typeof l.cell!="function"&&d("Must specify cell creation function"),typeof l.phase!="function"&&d("Must specify phase function");for(var p=l.getters||[],v=new Array(m),y=0;y=0?v[y]=!0:v[y]=!1;return function(x,w,k,b,T,_){var M=[_,T].join(",");return(0,s[M])(x,w,k,i.mallocUint32,i.freeUint32)}(l.vertex,l.cell,l.phase,0,h,v)};var s={"false,0,1":function(l,d,h,m,g){return function(p,v,y,x){var w,k=0|p.shape[0],b=0|p.shape[1],T=p.data,_=0|p.offset,M=0|p.stride[0],A=0|p.stride[1],S=_,E=0|-M,D=0,O=0|-A,R=0,z=-M-A|0,L=0,P=0|M,N=A-M*k|0,B=0,G=0,W=0,K=2*k|0,te=m(K),Y=m(K),Z=0,re=0,U=-1,q=-1,$=0,ne=0|-k,H=0|k,Q=0,ee=-k-1|0,ie=k-1|0,ae=0,ue=0,le=0;for(B=0;B0){if(G=1,te[Z++]=h(T[S],v,y,x),S+=P,k>0)for(B=1,w=T[S],re=te[Z]=h(w,v,y,x),$=te[Z+U],Q=te[Z+ne],ae=te[Z+ee],re===$&&re===Q&&re===ae||(D=T[S+E],R=T[S+O],L=T[S+z],l(B,G,w,D,R,L,re,$,Q,ae,v,y,x),ue=Y[Z]=W++),Z+=1,S+=P,B=2;B0)for(B=1,w=T[S],re=te[Z]=h(w,v,y,x),$=te[Z+U],Q=te[Z+ne],ae=te[Z+ee],re===$&&re===Q&&re===ae||(D=T[S+E],R=T[S+O],L=T[S+z],l(B,G,w,D,R,L,re,$,Q,ae,v,y,x),ue=Y[Z]=W++,ae!==Q&&d(Y[Z+ne],ue,R,L,Q,ae,v,y,x)),Z+=1,S+=P,B=2;B0){if(B=1,te[Z++]=h(T[S],v,y,x),S+=P,b>0)for(G=1,w=T[S],re=te[Z]=h(w,v,y,x),Q=te[Z+ne],$=te[Z+U],ae=te[Z+ee],re===Q&&re===$&&re===ae||(D=T[S+E],R=T[S+O],L=T[S+z],l(B,G,w,D,R,L,re,Q,$,ae,v,y,x),ue=Y[Z]=W++),Z+=1,S+=P,G=2;G0)for(G=1,w=T[S],re=te[Z]=h(w,v,y,x),Q=te[Z+ne],$=te[Z+U],ae=te[Z+ee],re===Q&&re===$&&re===ae||(D=T[S+E],R=T[S+O],L=T[S+z],l(B,G,w,D,R,L,re,Q,$,ae,v,y,x),ue=Y[Z]=W++,ae!==Q&&d(Y[Z+ne],ue,L,D,ae,Q,v,y,x)),Z+=1,S+=P,G=2;G2&&S[1]>2&&_(A.pick(-1,-1).lo(1,1).hi(S[0]-2,S[1]-2),M.pick(-1,-1,0).lo(1,1).hi(S[0]-2,S[1]-2),M.pick(-1,-1,1).lo(1,1).hi(S[0]-2,S[1]-2)),S[1]>2&&(T(A.pick(0,-1).lo(1).hi(S[1]-2),M.pick(0,-1,1).lo(1).hi(S[1]-2)),b(M.pick(0,-1,0).lo(1).hi(S[1]-2))),S[1]>2&&(T(A.pick(S[0]-1,-1).lo(1).hi(S[1]-2),M.pick(S[0]-1,-1,1).lo(1).hi(S[1]-2)),b(M.pick(S[0]-1,-1,0).lo(1).hi(S[1]-2))),S[0]>2&&(T(A.pick(-1,0).lo(1).hi(S[0]-2),M.pick(-1,0,0).lo(1).hi(S[0]-2)),b(M.pick(-1,0,1).lo(1).hi(S[0]-2))),S[0]>2&&(T(A.pick(-1,S[1]-1).lo(1).hi(S[0]-2),M.pick(-1,S[1]-1,0).lo(1).hi(S[0]-2)),b(M.pick(-1,S[1]-1,1).lo(1).hi(S[0]-2))),M.set(0,0,0,0),M.set(0,0,1,0),M.set(S[0]-1,0,0,0),M.set(S[0]-1,0,1,0),M.set(0,S[1]-1,0,0),M.set(0,S[1]-1,1,0),M.set(S[0]-1,S[1]-1,0,0),M.set(S[0]-1,S[1]-1,1,0),M}}u.exports=function(k,b,T){return Array.isArray(T)||(T=i(b.dimension,typeof T=="string"?T:"clamp")),b.size===0?k:b.dimension===0?(k.set(0),k):function(_){var M=_.join();if(D=p[M])return D;for(var A=_.length,S=[v,y],E=1;E<=A;++E)S.push(x(E));var D=w.apply(void 0,S);return p[M]=D,D}(T)(k,b)}},{dup:65}],253:[function(a,u,c){function i(h,m){var g=Math.floor(m),p=m-g,v=0<=g&&g0;){L<64?(b=L,L=0):(b=64,L-=64);for(var P=0|m[1];P>0;){P<64?(T=P,P=0):(T=64,P-=64),v=R+L*M+P*A,w=z+L*E+P*D;var N=0,B=0,G=0,W=S,K=M-_*S,te=A-b*M,Y=O,Z=E-_*O,re=D-b*E;for(G=0;G0;){D<64?(b=D,D=0):(b=64,D-=64);for(var O=0|m[0];O>0;){O<64?(k=O,O=0):(k=64,O-=64),v=S+D*_+O*T,w=E+D*A+O*M;var R=0,z=0,L=_,P=T-b*_,N=A,B=M-b*A;for(z=0;z0;){z<64?(T=z,z=0):(T=64,z-=64);for(var L=0|m[0];L>0;){L<64?(k=L,L=0):(k=64,L-=64);for(var P=0|m[1];P>0;){P<64?(b=P,P=0):(b=64,P-=64),v=O+z*A+L*_+P*M,w=R+z*D+L*S+P*E;var N=0,B=0,G=0,W=A,K=_-T*A,te=M-k*_,Y=D,Z=S-T*D,re=E-k*S;for(G=0;Gp;){R=0,z=D-w;t:for(O=0;OP)break t;z+=M,R+=A}for(R=D,z=D-w,O=0;O>1,_e=me-le,we=me+le,Te=ge,Oe=_e,de=me,ye=we,Me=fe,ke=y+1,Ee=x-1,ze=!0,Fe=0,Ve=0,Ke=0,Re=M,qe=g(Re),We=g(Re);K=b*Te,te=b*Oe,ue=k;e:for(W=0;W0){O=Te,Te=Oe,Oe=O;break e}if(Ke<0)break e;ue+=S}K=b*ye,te=b*Me,ue=k;e:for(W=0;W0){O=ye,ye=Me,Me=O;break e}if(Ke<0)break e;ue+=S}K=b*Te,te=b*de,ue=k;e:for(W=0;W0){O=Te,Te=de,de=O;break e}if(Ke<0)break e;ue+=S}K=b*Oe,te=b*de,ue=k;e:for(W=0;W0){O=Oe,Oe=de,de=O;break e}if(Ke<0)break e;ue+=S}K=b*Te,te=b*ye,ue=k;e:for(W=0;W0){O=Te,Te=ye,ye=O;break e}if(Ke<0)break e;ue+=S}K=b*de,te=b*ye,ue=k;e:for(W=0;W0){O=de,de=ye,ye=O;break e}if(Ke<0)break e;ue+=S}K=b*Oe,te=b*Me,ue=k;e:for(W=0;W0){O=Oe,Oe=Me,Me=O;break e}if(Ke<0)break e;ue+=S}K=b*Oe,te=b*de,ue=k;e:for(W=0;W0){O=Oe,Oe=de,de=O;break e}if(Ke<0)break e;ue+=S}K=b*ye,te=b*Me,ue=k;e:for(W=0;W0){O=ye,ye=Me,Me=O;break e}if(Ke<0)break e;ue+=S}for(K=b*Te,te=b*Oe,Y=b*de,Z=b*ye,re=b*Me,U=b*ge,q=b*me,$=b*fe,ae=0,ue=k,W=0;W0)){if(Ke<0){for(K=b*P,te=b*ke,Y=b*Ee,ue=k,W=0;W0)for(;;){for(N=k+Ee*b,ae=0,W=0;W0)){for(N=k+Ee*b,ae=0,W=0;Wfe){e:for(;;){for(N=k+ke*b,ae=0,ue=k,W=0;W1&&T?M(b,T[0],T[1]):M(b)}(m,g,y);return v(y,x)}},{"typedarray-pool":308}],258:[function(a,u,c){var i=a("./lib/compile_sort.js"),s={};u.exports=function(l){var d=l.order,h=l.dtype,m=[d,h].join(":"),g=s[m];return g||(s[m]=g=i(d,h)),g(l),l}},{"./lib/compile_sort.js":257}],259:[function(a,u,c){var i=a("is-buffer"),s=typeof Float64Array<"u";function l(p,v){return p[0]-v[0]}function d(){var p,v=this.stride,y=new Array(v.length);for(p=0;p=0&&(b+=M*(T=0|k),_-=T),new x(this.data,_,M,b)},w.step=function(k){var b=this.shape[0],T=this.stride[0],_=this.offset,M=0,A=Math.ceil;return typeof k=="number"&&((M=0|k)<0?(_+=T*(b-1),b=A(-b/M)):b=A(b/M),T*=M),new x(this.data,b,T,_)},w.transpose=function(k){k=k===void 0?0:0|k;var b=this.shape,T=this.stride;return new x(this.data,b[k],T[k],this.offset)},w.pick=function(k){var b=[],T=[],_=this.offset;return typeof k=="number"&&k>=0?_=_+this.stride[0]*k|0:(b.push(this.shape[0]),T.push(this.stride[0])),(0,v[b.length+1])(this.data,b,T,_)},function(k,b,T,_){return new x(k,b[0],T[0],_)}},2:function(p,v,y){function x(k,b,T,_,M,A){this.data=k,this.shape=[b,T],this.stride=[_,M],this.offset=0|A}var w=x.prototype;return w.dtype=p,w.dimension=2,Object.defineProperty(w,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(w,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),w.set=function(k,b,T){return p==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*b,T):this.data[this.offset+this.stride[0]*k+this.stride[1]*b]=T},w.get=function(k,b){return p==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*b):this.data[this.offset+this.stride[0]*k+this.stride[1]*b]},w.index=function(k,b){return this.offset+this.stride[0]*k+this.stride[1]*b},w.hi=function(k,b){return new x(this.data,typeof k!="number"||k<0?this.shape[0]:0|k,typeof b!="number"||b<0?this.shape[1]:0|b,this.stride[0],this.stride[1],this.offset)},w.lo=function(k,b){var T=this.offset,_=0,M=this.shape[0],A=this.shape[1],S=this.stride[0],E=this.stride[1];return typeof k=="number"&&k>=0&&(T+=S*(_=0|k),M-=_),typeof b=="number"&&b>=0&&(T+=E*(_=0|b),A-=_),new x(this.data,M,A,S,E,T)},w.step=function(k,b){var T=this.shape[0],_=this.shape[1],M=this.stride[0],A=this.stride[1],S=this.offset,E=0,D=Math.ceil;return typeof k=="number"&&((E=0|k)<0?(S+=M*(T-1),T=D(-T/E)):T=D(T/E),M*=E),typeof b=="number"&&((E=0|b)<0?(S+=A*(_-1),_=D(-_/E)):_=D(_/E),A*=E),new x(this.data,T,_,M,A,S)},w.transpose=function(k,b){k=k===void 0?0:0|k,b=b===void 0?1:0|b;var T=this.shape,_=this.stride;return new x(this.data,T[k],T[b],_[k],_[b],this.offset)},w.pick=function(k,b){var T=[],_=[],M=this.offset;return typeof k=="number"&&k>=0?M=M+this.stride[0]*k|0:(T.push(this.shape[0]),_.push(this.stride[0])),typeof b=="number"&&b>=0?M=M+this.stride[1]*b|0:(T.push(this.shape[1]),_.push(this.stride[1])),(0,v[T.length+1])(this.data,T,_,M)},function(k,b,T,_){return new x(k,b[0],b[1],T[0],T[1],_)}},3:function(p,v,y){function x(k,b,T,_,M,A,S,E){this.data=k,this.shape=[b,T,_],this.stride=[M,A,S],this.offset=0|E}var w=x.prototype;return w.dtype=p,w.dimension=3,Object.defineProperty(w,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(w,"order",{get:function(){var k=Math.abs(this.stride[0]),b=Math.abs(this.stride[1]),T=Math.abs(this.stride[2]);return k>b?b>T?[2,1,0]:k>T?[1,2,0]:[1,0,2]:k>T?[2,0,1]:T>b?[0,1,2]:[0,2,1]}}),w.set=function(k,b,T,_){return p==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T,_):this.data[this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T]=_},w.get=function(k,b,T){return p==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T):this.data[this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T]},w.index=function(k,b,T){return this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T},w.hi=function(k,b,T){return new x(this.data,typeof k!="number"||k<0?this.shape[0]:0|k,typeof b!="number"||b<0?this.shape[1]:0|b,typeof T!="number"||T<0?this.shape[2]:0|T,this.stride[0],this.stride[1],this.stride[2],this.offset)},w.lo=function(k,b,T){var _=this.offset,M=0,A=this.shape[0],S=this.shape[1],E=this.shape[2],D=this.stride[0],O=this.stride[1],R=this.stride[2];return typeof k=="number"&&k>=0&&(_+=D*(M=0|k),A-=M),typeof b=="number"&&b>=0&&(_+=O*(M=0|b),S-=M),typeof T=="number"&&T>=0&&(_+=R*(M=0|T),E-=M),new x(this.data,A,S,E,D,O,R,_)},w.step=function(k,b,T){var _=this.shape[0],M=this.shape[1],A=this.shape[2],S=this.stride[0],E=this.stride[1],D=this.stride[2],O=this.offset,R=0,z=Math.ceil;return typeof k=="number"&&((R=0|k)<0?(O+=S*(_-1),_=z(-_/R)):_=z(_/R),S*=R),typeof b=="number"&&((R=0|b)<0?(O+=E*(M-1),M=z(-M/R)):M=z(M/R),E*=R),typeof T=="number"&&((R=0|T)<0?(O+=D*(A-1),A=z(-A/R)):A=z(A/R),D*=R),new x(this.data,_,M,A,S,E,D,O)},w.transpose=function(k,b,T){k=k===void 0?0:0|k,b=b===void 0?1:0|b,T=T===void 0?2:0|T;var _=this.shape,M=this.stride;return new x(this.data,_[k],_[b],_[T],M[k],M[b],M[T],this.offset)},w.pick=function(k,b,T){var _=[],M=[],A=this.offset;return typeof k=="number"&&k>=0?A=A+this.stride[0]*k|0:(_.push(this.shape[0]),M.push(this.stride[0])),typeof b=="number"&&b>=0?A=A+this.stride[1]*b|0:(_.push(this.shape[1]),M.push(this.stride[1])),typeof T=="number"&&T>=0?A=A+this.stride[2]*T|0:(_.push(this.shape[2]),M.push(this.stride[2])),(0,v[_.length+1])(this.data,_,M,A)},function(k,b,T,_){return new x(k,b[0],b[1],b[2],T[0],T[1],T[2],_)}},4:function(p,v,y){function x(k,b,T,_,M,A,S,E,D,O){this.data=k,this.shape=[b,T,_,M],this.stride=[A,S,E,D],this.offset=0|O}var w=x.prototype;return w.dtype=p,w.dimension=4,Object.defineProperty(w,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(w,"order",{get:y}),w.set=function(k,b,T,_,M){return p==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_,M):this.data[this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_]=M},w.get=function(k,b,T,_){return p==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_):this.data[this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_]},w.index=function(k,b,T,_){return this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_},w.hi=function(k,b,T,_){return new x(this.data,typeof k!="number"||k<0?this.shape[0]:0|k,typeof b!="number"||b<0?this.shape[1]:0|b,typeof T!="number"||T<0?this.shape[2]:0|T,typeof _!="number"||_<0?this.shape[3]:0|_,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},w.lo=function(k,b,T,_){var M=this.offset,A=0,S=this.shape[0],E=this.shape[1],D=this.shape[2],O=this.shape[3],R=this.stride[0],z=this.stride[1],L=this.stride[2],P=this.stride[3];return typeof k=="number"&&k>=0&&(M+=R*(A=0|k),S-=A),typeof b=="number"&&b>=0&&(M+=z*(A=0|b),E-=A),typeof T=="number"&&T>=0&&(M+=L*(A=0|T),D-=A),typeof _=="number"&&_>=0&&(M+=P*(A=0|_),O-=A),new x(this.data,S,E,D,O,R,z,L,P,M)},w.step=function(k,b,T,_){var M=this.shape[0],A=this.shape[1],S=this.shape[2],E=this.shape[3],D=this.stride[0],O=this.stride[1],R=this.stride[2],z=this.stride[3],L=this.offset,P=0,N=Math.ceil;return typeof k=="number"&&((P=0|k)<0?(L+=D*(M-1),M=N(-M/P)):M=N(M/P),D*=P),typeof b=="number"&&((P=0|b)<0?(L+=O*(A-1),A=N(-A/P)):A=N(A/P),O*=P),typeof T=="number"&&((P=0|T)<0?(L+=R*(S-1),S=N(-S/P)):S=N(S/P),R*=P),typeof _=="number"&&((P=0|_)<0?(L+=z*(E-1),E=N(-E/P)):E=N(E/P),z*=P),new x(this.data,M,A,S,E,D,O,R,z,L)},w.transpose=function(k,b,T,_){k=k===void 0?0:0|k,b=b===void 0?1:0|b,T=T===void 0?2:0|T,_=_===void 0?3:0|_;var M=this.shape,A=this.stride;return new x(this.data,M[k],M[b],M[T],M[_],A[k],A[b],A[T],A[_],this.offset)},w.pick=function(k,b,T,_){var M=[],A=[],S=this.offset;return typeof k=="number"&&k>=0?S=S+this.stride[0]*k|0:(M.push(this.shape[0]),A.push(this.stride[0])),typeof b=="number"&&b>=0?S=S+this.stride[1]*b|0:(M.push(this.shape[1]),A.push(this.stride[1])),typeof T=="number"&&T>=0?S=S+this.stride[2]*T|0:(M.push(this.shape[2]),A.push(this.stride[2])),typeof _=="number"&&_>=0?S=S+this.stride[3]*_|0:(M.push(this.shape[3]),A.push(this.stride[3])),(0,v[M.length+1])(this.data,M,A,S)},function(k,b,T,_){return new x(k,b[0],b[1],b[2],b[3],T[0],T[1],T[2],T[3],_)}},5:function(p,v,y){function x(k,b,T,_,M,A,S,E,D,O,R,z){this.data=k,this.shape=[b,T,_,M,A],this.stride=[S,E,D,O,R],this.offset=0|z}var w=x.prototype;return w.dtype=p,w.dimension=5,Object.defineProperty(w,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(w,"order",{get:y}),w.set=function(k,b,T,_,M,A){return p==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_+this.stride[4]*M,A):this.data[this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_+this.stride[4]*M]=A},w.get=function(k,b,T,_,M){return p==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_+this.stride[4]*M):this.data[this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_+this.stride[4]*M]},w.index=function(k,b,T,_,M){return this.offset+this.stride[0]*k+this.stride[1]*b+this.stride[2]*T+this.stride[3]*_+this.stride[4]*M},w.hi=function(k,b,T,_,M){return new x(this.data,typeof k!="number"||k<0?this.shape[0]:0|k,typeof b!="number"||b<0?this.shape[1]:0|b,typeof T!="number"||T<0?this.shape[2]:0|T,typeof _!="number"||_<0?this.shape[3]:0|_,typeof M!="number"||M<0?this.shape[4]:0|M,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},w.lo=function(k,b,T,_,M){var A=this.offset,S=0,E=this.shape[0],D=this.shape[1],O=this.shape[2],R=this.shape[3],z=this.shape[4],L=this.stride[0],P=this.stride[1],N=this.stride[2],B=this.stride[3],G=this.stride[4];return typeof k=="number"&&k>=0&&(A+=L*(S=0|k),E-=S),typeof b=="number"&&b>=0&&(A+=P*(S=0|b),D-=S),typeof T=="number"&&T>=0&&(A+=N*(S=0|T),O-=S),typeof _=="number"&&_>=0&&(A+=B*(S=0|_),R-=S),typeof M=="number"&&M>=0&&(A+=G*(S=0|M),z-=S),new x(this.data,E,D,O,R,z,L,P,N,B,G,A)},w.step=function(k,b,T,_,M){var A=this.shape[0],S=this.shape[1],E=this.shape[2],D=this.shape[3],O=this.shape[4],R=this.stride[0],z=this.stride[1],L=this.stride[2],P=this.stride[3],N=this.stride[4],B=this.offset,G=0,W=Math.ceil;return typeof k=="number"&&((G=0|k)<0?(B+=R*(A-1),A=W(-A/G)):A=W(A/G),R*=G),typeof b=="number"&&((G=0|b)<0?(B+=z*(S-1),S=W(-S/G)):S=W(S/G),z*=G),typeof T=="number"&&((G=0|T)<0?(B+=L*(E-1),E=W(-E/G)):E=W(E/G),L*=G),typeof _=="number"&&((G=0|_)<0?(B+=P*(D-1),D=W(-D/G)):D=W(D/G),P*=G),typeof M=="number"&&((G=0|M)<0?(B+=N*(O-1),O=W(-O/G)):O=W(O/G),N*=G),new x(this.data,A,S,E,D,O,R,z,L,P,N,B)},w.transpose=function(k,b,T,_,M){k=k===void 0?0:0|k,b=b===void 0?1:0|b,T=T===void 0?2:0|T,_=_===void 0?3:0|_,M=M===void 0?4:0|M;var A=this.shape,S=this.stride;return new x(this.data,A[k],A[b],A[T],A[_],A[M],S[k],S[b],S[T],S[_],S[M],this.offset)},w.pick=function(k,b,T,_,M){var A=[],S=[],E=this.offset;return typeof k=="number"&&k>=0?E=E+this.stride[0]*k|0:(A.push(this.shape[0]),S.push(this.stride[0])),typeof b=="number"&&b>=0?E=E+this.stride[1]*b|0:(A.push(this.shape[1]),S.push(this.stride[1])),typeof T=="number"&&T>=0?E=E+this.stride[2]*T|0:(A.push(this.shape[2]),S.push(this.stride[2])),typeof _=="number"&&_>=0?E=E+this.stride[3]*_|0:(A.push(this.shape[3]),S.push(this.stride[3])),typeof M=="number"&&M>=0?E=E+this.stride[4]*M|0:(A.push(this.shape[4]),S.push(this.stride[4])),(0,v[A.length+1])(this.data,A,S,E)},function(k,b,T,_){return new x(k,b[0],b[1],b[2],b[3],b[4],T[0],T[1],T[2],T[3],T[4],_)}}};function m(p,v){var y=v===-1?"T":String(v),x=h[y];return v===-1?x(p):v===0?x(p,g[p][0]):x(p,g[p],d)}var g={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};u.exports=function(p,v,y,x){if(p===void 0)return(0,g.array[0])([]);typeof p=="number"&&(p=[p]),v===void 0&&(v=[p.length]);var w=v.length;if(y===void 0){y=new Array(w);for(var k=w-1,b=1;k>=0;--k)y[k]=b,b*=v[k]}if(x===void 0)for(x=0,k=0;kl==l>0?m===-1>>>0?(h+=1,m=0):m+=1:m===0?(m=-1>>>0,h-=1):m-=1,i.pack(m,h)}},{"double-bits":64}],261:[function(a,u,c){c.vertexNormals=function(i,s,l){for(var d=s.length,h=new Array(d),m=l===void 0?1e-6:l,g=0;gm){var D=h[y],O=1/Math.sqrt(M*S);for(E=0;E<3;++E){var R=(E+1)%3,z=(E+2)%3;D[E]+=O*(A[R]*_[z]-A[z]*_[R])}}}for(g=0;gm)for(O=1/Math.sqrt(L),E=0;E<3;++E)D[E]*=O;else for(E=0;E<3;++E)D[E]=0}return h},c.faceNormals=function(i,s,l){for(var d=i.length,h=new Array(d),m=l===void 0?1e-6:l,g=0;gm?1/Math.sqrt(b):0,y=0;y<3;++y)k[y]*=b;h[g]=k}return h}},{}],262:[function(a,u,c){u.exports=function(i,s,l,d,h,m,g,p,v,y){var x=s+m+y;if(w>0){var w=Math.sqrt(x+1);i[0]=.5*(g-v)/w,i[1]=.5*(p-d)/w,i[2]=.5*(l-m)/w,i[3]=.5*w}else{var k=Math.max(s,m,y);w=Math.sqrt(2*k-x+1),s>=k?(i[0]=.5*w,i[1]=.5*(h+l)/w,i[2]=.5*(p+d)/w,i[3]=.5*(g-v)/w):m>=k?(i[0]=.5*(l+h)/w,i[1]=.5*w,i[2]=.5*(v+g)/w,i[3]=.5*(p-d)/w):(i[0]=.5*(d+p)/w,i[1]=.5*(g+v)/w,i[2]=.5*w,i[3]=.5*(l-h)/w)}return i}},{}],263:[function(a,u,c){u.exports=function(x){var w=(x=x||{}).center||[0,0,0],k=x.rotation||[0,0,0,1],b=x.radius||1;w=[].slice.call(w,0,3),p(k=[].slice.call(k,0,4),k);var T=new v(k,w,Math.log(b));return T.setDistanceLimits(x.zoomMin,x.zoomMax),("eye"in x||"up"in x)&&T.lookAt(0,x.eye,x.center,x.up),T};var i=a("filtered-vector"),s=a("gl-mat4/lookAt"),l=a("gl-mat4/fromQuat"),d=a("gl-mat4/invert"),h=a("./lib/quatFromFrame");function m(x,w,k){return Math.sqrt(Math.pow(x,2)+Math.pow(w,2)+Math.pow(k,2))}function g(x,w,k,b){return Math.sqrt(Math.pow(x,2)+Math.pow(w,2)+Math.pow(k,2)+Math.pow(b,2))}function p(x,w){var k=w[0],b=w[1],T=w[2],_=w[3],M=g(k,b,T,_);M>1e-6?(x[0]=k/M,x[1]=b/M,x[2]=T/M,x[3]=_/M):(x[0]=x[1]=x[2]=0,x[3]=1)}function v(x,w,k){this.radius=i([k]),this.center=i(w),this.rotation=i(x),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 y=v.prototype;y.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},y.recalcMatrix=function(x){this.radius.curve(x),this.center.curve(x),this.rotation.curve(x);var w=this.computedRotation;p(w,w);var k=this.computedMatrix;l(k,w);var b=this.computedCenter,T=this.computedEye,_=this.computedUp,M=Math.exp(this.computedRadius[0]);T[0]=b[0]+M*k[2],T[1]=b[1]+M*k[6],T[2]=b[2]+M*k[10],_[0]=k[1],_[1]=k[5],_[2]=k[9];for(var A=0;A<3;++A){for(var S=0,E=0;E<3;++E)S+=k[A+4*E]*T[E];k[12+A]=-S}},y.getMatrix=function(x,w){this.recalcMatrix(x);var k=this.computedMatrix;if(w){for(var b=0;b<16;++b)w[b]=k[b];return w}return k},y.idle=function(x){this.center.idle(x),this.radius.idle(x),this.rotation.idle(x)},y.flush=function(x){this.center.flush(x),this.radius.flush(x),this.rotation.flush(x)},y.pan=function(x,w,k,b){w=w||0,k=k||0,b=b||0,this.recalcMatrix(x);var T=this.computedMatrix,_=T[1],M=T[5],A=T[9],S=m(_,M,A);_/=S,M/=S,A/=S;var E=T[0],D=T[4],O=T[8],R=E*_+D*M+O*A,z=m(E-=_*R,D-=M*R,O-=A*R);E/=z,D/=z,O/=z,T[2],T[6],T[10];var L=E*w+_*k,P=D*w+M*k,N=O*w+A*k;this.center.move(x,L,P,N);var B=Math.exp(this.computedRadius[0]);B=Math.max(1e-4,B+b),this.radius.set(x,Math.log(B))},y.rotate=function(x,w,k,b){this.recalcMatrix(x),w=w||0,k=k||0;var T=this.computedMatrix,_=T[0],M=T[4],A=T[8],S=T[1],E=T[5],D=T[9],O=T[2],R=T[6],z=T[10],L=w*_+k*S,P=w*M+k*E,N=w*A+k*D,B=-(R*N-z*P),G=-(z*L-O*N),W=-(O*P-R*L),K=Math.sqrt(Math.max(0,1-Math.pow(B,2)-Math.pow(G,2)-Math.pow(W,2))),te=g(B,G,W,K);te>1e-6?(B/=te,G/=te,W/=te,K/=te):(B=G=W=0,K=1);var Y=this.computedRotation,Z=Y[0],re=Y[1],U=Y[2],q=Y[3],$=Z*K+q*B+re*W-U*G,ne=re*K+q*G+U*B-Z*W,H=U*K+q*W+Z*G-re*B,Q=q*K-Z*B-re*G-U*W;if(b){B=O,G=R,W=z;var ee=Math.sin(b)/m(B,G,W);B*=ee,G*=ee,W*=ee,Q=Q*(K=Math.cos(w))-($=$*K+Q*B+ne*W-H*G)*B-(ne=ne*K+Q*G+H*B-$*W)*G-(H=H*K+Q*W+$*G-ne*B)*W}var ie=g($,ne,H,Q);ie>1e-6?($/=ie,ne/=ie,H/=ie,Q/=ie):($=ne=H=0,Q=1),this.rotation.set(x,$,ne,H,Q)},y.lookAt=function(x,w,k,b){this.recalcMatrix(x),k=k||this.computedCenter,w=w||this.computedEye,b=b||this.computedUp;var T=this.computedMatrix;s(T,w,k,b);var _=this.computedRotation;h(_,T[0],T[1],T[2],T[4],T[5],T[6],T[8],T[9],T[10]),p(_,_),this.rotation.set(x,_[0],_[1],_[2],_[3]);for(var M=0,A=0;A<3;++A)M+=Math.pow(k[A]-w[A],2);this.radius.set(x,.5*Math.log(Math.max(M,1e-6))),this.center.set(x,k[0],k[1],k[2])},y.translate=function(x,w,k,b){this.center.move(x,w||0,k||0,b||0)},y.setMatrix=function(x,w){var k=this.computedRotation;h(k,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),p(k,k),this.rotation.set(x,k[0],k[1],k[2],k[3]);var b=this.computedMatrix;d(b,w);var T=b[15];if(Math.abs(T)>1e-6){var _=b[12]/T,M=b[13]/T,A=b[14]/T;this.recalcMatrix(x);var S=Math.exp(this.computedRadius[0]);this.center.set(x,_-b[2]*S,M-b[6]*S,A-b[10]*S),this.radius.idle(x)}else this.center.idle(x),this.radius.idle(x)},y.setDistance=function(x,w){w>0&&this.radius.set(x,Math.log(w))},y.setDistanceLimits=function(x,w){x=x>0?Math.log(x):-1/0,w=w>0?Math.log(w):1/0,w=Math.max(w,x),this.radius.bounds[0][0]=x,this.radius.bounds[1][0]=w},y.getDistanceLimits=function(x){var w=this.radius.bounds;return x?(x[0]=Math.exp(w[0][0]),x[1]=Math.exp(w[1][0]),x):[Math.exp(w[0][0]),Math.exp(w[1][0])]},y.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]}},y.fromJSON=function(x){var w=this.lastT(),k=x.center;k&&this.center.set(w,k[0],k[1],k[2]);var b=x.rotation;b&&this.rotation.set(w,b[0],b[1],b[2],b[3]);var T=x.distance;T&&T>0&&this.radius.set(w,Math.log(T)),this.setDistanceLimits(x.zoomMin,x.zoomMax)}},{"./lib/quatFromFrame":262,"filtered-vector":68,"gl-mat4/fromQuat":95,"gl-mat4/invert":98,"gl-mat4/lookAt":99}],264:[function(a,u,c){var i=a("repeat-string");u.exports=function(s,l,d){return i(d=d!==void 0?d+"":" ",l)+s}},{"repeat-string":277}],265:[function(a,u,c){u.exports=function(i,s){s||(s=[0,""]),i=String(i);var l=parseFloat(i,10);return s[0]=l,s[1]=i.match(/[\d.\-\+]*\s*(.*)/)[1]||"",s}},{}],266:[function(a,u,c){u.exports=function(s,l){for(var d=0|l.length,h=s.length,m=[new Array(d),new Array(d)],g=0;g0){E=m[R][A][0],O=R;break}D=E[1^O];for(var z=0;z<2;++z)for(var L=m[z][A],P=0;P0&&(E=N,D=B,O=z)}return S||E&&y(E,O),D}function w(M,A){var S=m[A][M][0],E=[M];y(S,A);for(var D=S[1^A];;){for(;D!==M;)E.push(D),D=x(E[E.length-2],D,!1);if(m[0][M].length+m[1][M].length===0)break;var O=E[E.length-1],R=M,z=E[1],L=x(O,R,!0);if(i(l[O],l[R],l[z],l[L])<0)break;E.push(M),D=x(O,R)}return E}function k(M,A){return A[1]===A[A.length-1]}for(g=0;g0;){m[0][g].length;var _=w(g,b);k(0,_)?T.push.apply(T,_):(T.length>0&&v.push(T),T=_)}T.length>0&&v.push(T)}return v};var i=a("compare-angle")},{"compare-angle":54}],267:[function(a,u,c){u.exports=function(s,l){for(var d=i(s,l.length),h=new Array(l.length),m=new Array(l.length),g=[],p=0;p0;){var y=g.pop();h[y]=!1;var x=d[y];for(p=0;p0})).length,M=new Array(_),A=new Array(_);for(b=0;b<_;++b){M[b]=b;var S=new Array(_),E=T[b].map(function(le){return y[le]}),D=l([E]),O=0;e:for(var R=0;R<_;++R)if(S[R]=0,b!==R){for(var z=(ae=T[R]).length,L=0;L0;){var ne=q.pop(),H=G[ne];m(H,function(le,ge){return le-ge});var Q,ee=H.length,ie=$[ne];if(ie===0){var ae=T[ne];Q=[ae]}for(b=0;b=0||($[ue]=1^ie,q.push(ue),ie===0&&(U(ae=T[ue])||(ae.reverse(),Q.push(ae))))}ie===0&&x.push(Q)}return x};var i=a("edges-to-adjacency-list"),s=a("planar-dual"),l=a("point-in-big-polygon"),d=a("two-product"),h=a("robust-sum"),m=a("uniq"),g=a("./lib/trim-leaves");function p(v,y){for(var x=new Array(v),w=0;w0&&R[L]===z[0]))return 1;P=O[L-1]}for(var N=1;P;){var B=P.key,G=i(z,B[0],B[1]);if(B[0][0]0))return 0;N=-1,P=P.right}else if(G>0)P=P.left;else{if(!(G<0))return 0;N=1,P=P.right}}return N}}(E.slabs,E.coordinates);return x.length===0?D:function(O,R){return function(z){return O(z[0],z[1])?0:R(z)}}(m(x),D)};var i=a("robust-orientation")[3],s=a("slab-decomposition"),l=a("interval-tree-1d"),d=a("binary-search-bounds");function h(){return!0}function m(p){for(var v={},y=0;y=y?(L=1,S=y+2*k+T):S=k*(L=-k/y)+T):(L=0,b>=0?(P=0,S=T):-b>=w?(P=1,S=w+2*b+T):S=b*(P=-b/w)+T);else if(P<0)P=0,k>=0?(L=0,S=T):-k>=y?(L=1,S=y+2*k+T):S=k*(L=-k/y)+T;else{var N=1/z;S=(L*=N)*(y*L+x*(P*=N)+2*k)+P*(x*L+w*P+2*b)+T}else L<0?(D=w+b)>(E=x+k)?(O=D-E)>=(R=y-2*x+w)?(L=1,P=0,S=y+2*k+T):S=(L=O/R)*(y*L+x*(P=1-L)+2*k)+P*(x*L+w*P+2*b)+T:(L=0,D<=0?(P=1,S=w+2*b+T):b>=0?(P=0,S=T):S=b*(P=-b/w)+T):P<0?(D=y+k)>(E=x+b)?(O=D-E)>=(R=y-2*x+w)?(P=1,L=0,S=w+2*b+T):S=(L=1-(P=O/R))*(y*L+x*P+2*k)+P*(x*L+w*P+2*b)+T:(P=0,D<=0?(L=1,S=y+2*k+T):k>=0?(L=0,S=T):S=k*(L=-k/y)+T):(O=w+b-x-k)<=0?(L=0,P=1,S=w+2*b+T):O>=(R=y-2*x+w)?(L=1,P=0,S=y+2*k+T):S=(L=O/R)*(y*L+x*(P=1-L)+2*k)+P*(x*L+w*P+2*b)+T;var B=1-L-P;for(v=0;v0){var y=d[m-1];if(i(p,y)===0&&l(y)!==v){m-=1;continue}}d[m++]=p}}return d.length=m,d}},{"cell-orientation":47,"compare-cell":56,"compare-oriented-cell":57}],277:[function(a,u,c){var i,s="";u.exports=function(l,d){if(typeof l!="string")throw new TypeError("expected a string");if(d===1)return l;if(d===2)return l+l;var h=l.length*d;if(i!==l||i===void 0)i=l,s="";else if(s.length>=h)return s.substr(0,h);for(;h>s.length&&d>1;)1&d&&(s+=l),d>>=1,l+=l;return s=(s+=l).substr(0,h)}},{}],278:[function(a,u,c){(function(i){(function(){u.exports=i.performance&&i.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this)}).call(this,r!==void 0?r:typeof self<"u"?self:typeof window<"u"?window:{})},{}],279:[function(a,u,c){u.exports=function(i){for(var s=i.length,l=i[i.length-1],d=s,h=s-2;h>=0;--h){var m=l,g=i[h];(v=g-((l=m+g)-m))&&(i[--d]=l,l=v)}var p=0;for(h=d;h0){if(S<=0)return E;M=A+S}else{if(!(A<0)||S>=0)return E;M=-(A+S)}var D=33306690738754716e-32*M;return E>=D||E<=-D?E:v(b,T,_)},function(b,T,_,M){var A=b[0]-M[0],S=T[0]-M[0],E=_[0]-M[0],D=b[1]-M[1],O=T[1]-M[1],R=_[1]-M[1],z=b[2]-M[2],L=T[2]-M[2],P=_[2]-M[2],N=S*R,B=E*O,G=E*D,W=A*R,K=A*O,te=S*D,Y=z*(N-B)+L*(G-W)+P*(K-te),Z=7771561172376103e-31*((Math.abs(N)+Math.abs(B))*Math.abs(z)+(Math.abs(G)+Math.abs(W))*Math.abs(L)+(Math.abs(K)+Math.abs(te))*Math.abs(P));return Y>Z||-Y>Z?Y:y(b,T,_,M)}];function w(b){var T=x[b.length];return T||(T=x[b.length]=p(b.length)),T.apply(void 0,b)}function k(b,T,_,M,A,S,E){return function(D,O,R,z,L){switch(arguments.length){case 0:case 1:return 0;case 2:return M(D,O);case 3:return A(D,O,R);case 4:return S(D,O,R,z);case 5:return E(D,O,R,z,L)}for(var P=new Array(arguments.length),N=0;N0&&g>0||m<0&&g<0)return!1;var p=i(d,s,l),v=i(h,s,l);return p>0&&v>0||p<0&&v<0?!1:m===0&&g===0&&p===0&&v===0?function(y,x,w,k){for(var b=0;b<2;++b){var T=y[b],_=x[b],M=Math.min(T,_),A=Math.max(T,_),S=w[b],E=k[b],D=Math.min(S,E);if(Math.max(S,E)=d?(h=w,(v+=1)=d?(h=w,(v+=1)>1,w=d[2*x+1];if(w===p)return x;p>1,w=d[2*x+1];if(w===p)return x;p>1,w=d[2*x+1];if(w===p)return x;p>1,_=l(y[T],x);_<=0?(_===0&&(b=T),w=T+1):_>0&&(k=T-1)}return b}function p(y,x){for(var w=new Array(y.length),k=0,b=w.length;k=y.length||l(y[R],T)!==0););}return w}function v(y,x){if(x<0)return[];for(var w=[],k=(1<>>S&1&&A.push(b[S]);x.push(A)}return h(x)},c.skeleton=v,c.boundary=function(y){for(var x=[],w=0,k=y.length;w>1:(te>>1)-1}function E(te){for(var Y=A(te);;){var Z=Y,re=2*te+1,U=2*(te+1),q=te;if(re0;){var Z=S(te);if(Z>=0&&Y0){var te=L[0];return M(0,N-1),N-=1,E(0),te}return-1}function R(te,Y){var Z=L[te];return y[Z]===Y?te:(y[Z]=-1/0,D(te),O(),y[Z]=Y,D((N+=1)-1))}function z(te){if(!x[te]){x[te]=!0;var Y=p[te],Z=v[te];p[Z]>=0&&(p[Z]=Y),v[Y]>=0&&(v[Y]=Z),P[Y]>=0&&R(P[Y],_(Y)),P[Z]>=0&&R(P[Z],_(Z))}}var L=[],P=new Array(m);for(w=0;w>1;w>=0;--w)E(w);for(;;){var B=O();if(B<0||y[B]>h)break;z(B)}var G=[];for(w=0;w=0&&Z>=0&&Y!==Z){var re=P[Y],U=P[Z];re!==U&&K.push([re,U])}}),s.unique(s.normalize(K)),{positions:G,edges:K}};var i=a("robust-orientation"),s=a("simplicial-complex")},{"robust-orientation":284,"simplicial-complex":295}],298:[function(a,u,c){u.exports=function(l,d){var h,m,g,p;if(d[0][0]d[1][0]))return s(d,l);h=d[1],m=d[0]}if(l[0][0]l[1][0]))return-s(l,d);g=l[1],p=l[0]}var v=i(h,m,p),y=i(h,m,g);if(v<0){if(y<=0)return v}else if(v>0){if(y>=0)return v}else if(y)return y;if(v=i(p,g,m),y=i(p,g,h),v<0){if(y<=0)return v}else if(v>0){if(y>=0)return v}else if(y)return y;return m[0]-p[0]};var i=a("robust-orientation");function s(l,d){var h,m,g,p;if(d[0][0]d[1][0])){var v=Math.min(l[0][1],l[1][1]),y=Math.max(l[0][1],l[1][1]),x=Math.min(d[0][1],d[1][1]),w=Math.max(d[0][1],d[1][1]);return yw?v-w:y-w}h=d[1],m=d[0]}l[0][1]0)if(x[0]!==T[1][0])w=y,y=y.right;else{if(M=g(y.right,x))return M;y=y.left}else{if(x[0]!==T[1][0])return y;var M;if(M=g(y.right,x))return M;y=y.left}}return w}function p(y,x,w,k){this.y=y,this.index=x,this.start=w,this.closed=k}function v(y,x,w,k){this.x=y,this.segment=x,this.create=w,this.index=k}h.prototype.castUp=function(y){var x=i.le(this.coordinates,y[0]);if(x<0)return-1;this.slabs[x];var w=g(this.slabs[x],y),k=-1;if(w&&(k=w.value),this.coordinates[x]===y[0]){var b=null;if(w&&(b=w.key),x>0){var T=g(this.slabs[x-1],y);T&&(b?d(T.key,b)>0&&(b=T.key,k=T.value):(k=T.value,b=T.key))}var _=this.horizontal[x];if(_.length>0){var M=i.ge(_,y[1],m);if(M<_.length){var A=_[M];if(y[1]===A.y){if(A.closed)return A.index;for(;M<_.length-1&&_[M+1].y===y[1];)if((A=_[M+=1]).closed)return A.index;if(A.y===y[1]&&!A.start){if((M+=1)>=_.length)return k;A=_[M]}}if(A.start)if(b){var S=l(b[0],b[1],[y[0],A.y]);b[0][0]>b[1][0]&&(S=-S),S>0&&(k=A.index)}else k=A.index;else A.y!==y[1]&&(k=A.index)}}}return k}},{"./lib/order-segments":298,"binary-search-bounds":31,"functional-red-black-tree":69,"robust-orientation":284}],300:[function(a,u,c){var i=a("robust-dot-product"),s=a("robust-sum");function l(h,m){var g=s(i(h,m),[m[m.length-1]]);return g[g.length-1]}function d(h,m,g,p){var v=-m/(p-m);v<0?v=0:v>1&&(v=1);for(var y=1-v,x=h.length,w=new Array(x),k=0;k0||v>0&&k<0){var b=d(y,k,x,v);g.push(b),p.push(b.slice())}k<0?p.push(x.slice()):k>0?g.push(x.slice()):(g.push(x.slice()),p.push(x.slice())),v=k}return{positive:g,negative:p}},u.exports.positive=function(h,m){for(var g=[],p=l(h[h.length-1],m),v=h[h.length-1],y=h[0],x=0;x0||p>0&&w<0)&&g.push(d(v,w,y,p)),w>=0&&g.push(y.slice()),p=w}return g},u.exports.negative=function(h,m){for(var g=[],p=l(h[h.length-1],m),v=h[h.length-1],y=h[0],x=0;x0||p>0&&w<0)&&g.push(d(v,w,y,p)),w<=0&&g.push(y.slice()),p=w}return g}},{"robust-dot-product":281,"robust-sum":289}],301:[function(a,u,c){(function(){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 s(g){return d(m(g),arguments)}function l(g,p){return s.apply(null,[g].concat(p||[]))}function d(g,p){var v,y,x,w,k,b,T,_,M,A=1,S=g.length,E="";for(y=0;y=0),w.type){case"b":v=parseInt(v,10).toString(2);break;case"c":v=String.fromCharCode(parseInt(v,10));break;case"d":case"i":v=parseInt(v,10);break;case"j":v=JSON.stringify(v,null,w.width?parseInt(w.width):0);break;case"e":v=w.precision?parseFloat(v).toExponential(w.precision):parseFloat(v).toExponential();break;case"f":v=w.precision?parseFloat(v).toFixed(w.precision):parseFloat(v);break;case"g":v=w.precision?String(Number(v.toPrecision(w.precision))):parseFloat(v);break;case"o":v=(parseInt(v,10)>>>0).toString(8);break;case"s":v=String(v),v=w.precision?v.substring(0,w.precision):v;break;case"t":v=String(!!v),v=w.precision?v.substring(0,w.precision):v;break;case"T":v=Object.prototype.toString.call(v).slice(8,-1).toLowerCase(),v=w.precision?v.substring(0,w.precision):v;break;case"u":v=parseInt(v,10)>>>0;break;case"v":v=v.valueOf(),v=w.precision?v.substring(0,w.precision):v;break;case"x":v=(parseInt(v,10)>>>0).toString(16);break;case"X":v=(parseInt(v,10)>>>0).toString(16).toUpperCase()}i.json.test(w.type)?E+=v:(!i.number.test(w.type)||_&&!w.sign?M="":(M=_?"+":"-",v=v.toString().replace(i.sign,"")),b=w.pad_char?w.pad_char==="0"?"0":w.pad_char.charAt(1):" ",T=w.width-(M+v).length,k=w.width&&T>0?b.repeat(T):"",E+=w.align?M+v+k:b==="0"?M+k+v:k+M+v)}return E}var h=Object.create(null);function m(g){if(h[g])return h[g];for(var p,v=g,y=[],x=0;v;){if((p=i.text.exec(v))!==null)y.push(p[0]);else if((p=i.modulo.exec(v))!==null)y.push("%");else{if((p=i.placeholder.exec(v))===null)throw new SyntaxError("[sprintf] unexpected placeholder");if(p[2]){x|=1;var w=[],k=p[2],b=[];if((b=i.key.exec(k))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");for(w.push(b[1]);(k=k.substring(b[0].length))!=="";)if((b=i.key_access.exec(k))!==null)w.push(b[1]);else{if((b=i.index_access.exec(k))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");w.push(b[1])}p[2]=w}else x|=2;if(x===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");y.push({placeholder:p[0],param_no:p[1],keys:p[2],sign:p[3],pad_char:p[4],align:p[5],width:p[6],precision:p[7],type:p[8]})}v=v.substring(p[0].length)}return h[g]=y}c!==void 0&&(c.sprintf=s,c.vsprintf=l),typeof window<"u"&&(window.sprintf=s,window.vsprintf=l)})()},{}],302:[function(a,u,c){u.exports=function(h,m){if(h.dimension<=0)return{positions:[],cells:[]};if(h.dimension===1)return function(v,y){for(var x=s(v,y),w=x.length,k=new Array(w),b=new Array(w),T=0;Tw|0},vertex:function(v,y,x,w,k,b,T,_,M,A,S,E,D){var O=(T<<0)+(_<<1)+(M<<2)+(A<<3)|0;if(O!==0&&O!==15)switch(O){case 0:S.push([v-.5,y-.5]);break;case 1:S.push([v-.25-.25*(w+x-2*D)/(x-w),y-.25-.25*(k+x-2*D)/(x-k)]);break;case 2:S.push([v-.75-.25*(-w-x+2*D)/(w-x),y-.25-.25*(b+w-2*D)/(w-b)]);break;case 3:S.push([v-.5,y-.5-.5*(k+x+b+w-4*D)/(x-k+w-b)]);break;case 4:S.push([v-.25-.25*(b+k-2*D)/(k-b),y-.75-.25*(-k-x+2*D)/(k-x)]);break;case 5:S.push([v-.5-.5*(w+x+b+k-4*D)/(x-w+k-b),y-.5]);break;case 6:S.push([v-.5-.25*(-w-x+b+k)/(w-x+k-b),y-.5-.25*(-k-x+b+w)/(k-x+w-b)]);break;case 7:S.push([v-.75-.25*(b+k-2*D)/(k-b),y-.75-.25*(b+w-2*D)/(w-b)]);break;case 8:S.push([v-.75-.25*(-b-k+2*D)/(b-k),y-.75-.25*(-b-w+2*D)/(b-w)]);break;case 9:S.push([v-.5-.25*(w+x+-b-k)/(x-w+b-k),y-.5-.25*(k+x+-b-w)/(x-k+b-w)]);break;case 10:S.push([v-.5-.5*(-w-x-b-k+4*D)/(w-x+b-k),y-.5]);break;case 11:S.push([v-.25-.25*(-b-k+2*D)/(b-k),y-.75-.25*(k+x-2*D)/(x-k)]);break;case 12:S.push([v-.5,y-.5-.5*(-k-x-b-w+4*D)/(k-x+b-w)]);break;case 13:S.push([v-.75-.25*(w+x-2*D)/(x-w),y-.25-.25*(-b-w+2*D)/(b-w)]);break;case 14:S.push([v-.25-.25*(-w-x+2*D)/(w-x),y-.25-.25*(-k-x+2*D)/(k-x)]);break;case 15:S.push([v-.5,y-.5])}},cell:function(v,y,x,w,k,b,T,_,M){k?_.push([v,y]):_.push([y,v])}});return function(v,y){var x=[],w=[];return p(v,x,w,y),{positions:x,cells:w}}}},d={}},{"ndarray-extract-contour":251,"zero-crossings":318}],303:[function(a,u,c){(function(i){(function(){u.exports=function h(m,g,p){p=p||{};var v=d[m];v||(v=d[m]={" ":{data:new Float32Array(0),shape:.2}});var y=v[g];if(!y)if(g.length<=1||!/\d/.test(g))y=v[g]=function(D){for(var O=D.cells,R=D.positions,z=new Float32Array(6*O.length),L=0,P=0,N=0;N0&&(b+=.02);var _=new Float32Array(k),M=0,A=-.5*b;for(T=0;TMath.max(T,_)?M[2]=1:T>Math.max(b,_)?M[0]=1:M[1]=1;for(var A=0,S=0,E=0;E<3;++E)A+=k[E]*k[E],S+=M[E]*k[E];for(E=0;E<3;++E)M[E]-=S/A*k[E];return h(M,M),M}function y(k,b,T,_,M,A,S,E){this.center=i(T),this.up=i(_),this.right=i(M),this.radius=i([A]),this.angle=i([S,E]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(k,b),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 D=0;D<16;++D)this.computedMatrix[D]=.5;this.recalcMatrix(0)}var x=y.prototype;x.setDistanceLimits=function(k,b){k=k>0?Math.log(k):-1/0,b=b>0?Math.log(b):1/0,b=Math.max(b,k),this.radius.bounds[0][0]=k,this.radius.bounds[1][0]=b},x.getDistanceLimits=function(k){var b=this.radius.bounds[0];return k?(k[0]=Math.exp(b[0][0]),k[1]=Math.exp(b[1][0]),k):[Math.exp(b[0][0]),Math.exp(b[1][0])]},x.recalcMatrix=function(k){this.center.curve(k),this.up.curve(k),this.right.curve(k),this.radius.curve(k),this.angle.curve(k);for(var b=this.computedUp,T=this.computedRight,_=0,M=0,A=0;A<3;++A)M+=b[A]*T[A],_+=b[A]*b[A];var S=Math.sqrt(_),E=0;for(A=0;A<3;++A)T[A]-=b[A]*M/_,E+=T[A]*T[A],b[A]/=S;var D=Math.sqrt(E);for(A=0;A<3;++A)T[A]/=D;var O=this.computedToward;d(O,b,T),h(O,O);var R=Math.exp(this.computedRadius[0]),z=this.computedAngle[0],L=this.computedAngle[1],P=Math.cos(z),N=Math.sin(z),B=Math.cos(L),G=Math.sin(L),W=this.computedCenter,K=P*B,te=N*B,Y=G,Z=-P*G,re=-N*G,U=B,q=this.computedEye,$=this.computedMatrix;for(A=0;A<3;++A){var ne=K*T[A]+te*O[A]+Y*b[A];$[4*A+1]=Z*T[A]+re*O[A]+U*b[A],$[4*A+2]=ne,$[4*A+3]=0}var H=$[1],Q=$[5],ee=$[9],ie=$[2],ae=$[6],ue=$[10],le=Q*ue-ee*ae,ge=ee*ie-H*ue,fe=H*ae-Q*ie,me=g(le,ge,fe);for(le/=me,ge/=me,fe/=me,$[0]=le,$[4]=ge,$[8]=fe,A=0;A<3;++A)q[A]=W[A]+$[2+4*A]*R;for(A=0;A<3;++A){E=0;for(var _e=0;_e<3;++_e)E+=$[A+4*_e]*q[_e];$[12+A]=-E}$[15]=1},x.getMatrix=function(k,b){this.recalcMatrix(k);var T=this.computedMatrix;if(b){for(var _=0;_<16;++_)b[_]=T[_];return b}return T};var w=[0,0,0];x.rotate=function(k,b,T,_){if(this.angle.move(k,b,T),_){this.recalcMatrix(k);var M=this.computedMatrix;w[0]=M[2],w[1]=M[6],w[2]=M[10];for(var A=this.computedUp,S=this.computedRight,E=this.computedToward,D=0;D<3;++D)M[4*D]=A[D],M[4*D+1]=S[D],M[4*D+2]=E[D];for(l(M,M,_,w),D=0;D<3;++D)A[D]=M[4*D],S[D]=M[4*D+1];this.up.set(k,A[0],A[1],A[2]),this.right.set(k,S[0],S[1],S[2])}},x.pan=function(k,b,T,_){b=b||0,T=T||0,_=_||0,this.recalcMatrix(k);var M=this.computedMatrix,A=(Math.exp(this.computedRadius[0]),M[1]),S=M[5],E=M[9],D=g(A,S,E);A/=D,S/=D,E/=D;var O=M[0],R=M[4],z=M[8],L=O*A+R*S+z*E,P=g(O-=A*L,R-=S*L,z-=E*L),N=(O/=P)*b+A*T,B=(R/=P)*b+S*T,G=(z/=P)*b+E*T;this.center.move(k,N,B,G);var W=Math.exp(this.computedRadius[0]);W=Math.max(1e-4,W+_),this.radius.set(k,Math.log(W))},x.translate=function(k,b,T,_){this.center.move(k,b||0,T||0,_||0)},x.setMatrix=function(k,b,T,_){var M=1;typeof T=="number"&&(M=0|T),(M<0||M>3)&&(M=1);var A=(M+2)%3;b||(this.recalcMatrix(k),b=this.computedMatrix);var S=b[M],E=b[M+4],D=b[M+8];if(_){var O=Math.abs(S),R=Math.abs(E),z=Math.abs(D),L=Math.max(O,R,z);O===L?(S=S<0?-1:1,E=D=0):z===L?(D=D<0?-1:1,S=E=0):(E=E<0?-1:1,S=D=0)}else{var P=g(S,E,D);S/=P,E/=P,D/=P}var N,B,G=b[A],W=b[A+4],K=b[A+8],te=G*S+W*E+K*D,Y=g(G-=S*te,W-=E*te,K-=D*te),Z=E*(K/=Y)-D*(W/=Y),re=D*(G/=Y)-S*K,U=S*W-E*G,q=g(Z,re,U);if(Z/=q,re/=q,U/=q,this.center.jump(k,de,ye,Me),this.radius.idle(k),this.up.jump(k,S,E,D),this.right.jump(k,G,W,K),M===2){var $=b[1],ne=b[5],H=b[9],Q=$*G+ne*W+H*K,ee=$*Z+ne*re+H*U;N=le<0?-Math.PI/2:Math.PI/2,B=Math.atan2(ee,Q)}else{var ie=b[2],ae=b[6],ue=b[10],le=ie*S+ae*E+ue*D,ge=ie*G+ae*W+ue*K,fe=ie*Z+ae*re+ue*U;N=Math.asin(p(le)),B=Math.atan2(fe,ge)}this.angle.jump(k,B,N),this.recalcMatrix(k);var me=b[2],_e=b[6],we=b[10],Te=this.computedMatrix;s(Te,b);var Oe=Te[15],de=Te[12]/Oe,ye=Te[13]/Oe,Me=Te[14]/Oe,ke=Math.exp(this.computedRadius[0]);this.center.jump(k,de-me*ke,ye-_e*ke,Me-we*ke)},x.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},x.idle=function(k){this.center.idle(k),this.up.idle(k),this.right.idle(k),this.radius.idle(k),this.angle.idle(k)},x.flush=function(k){this.center.flush(k),this.up.flush(k),this.right.flush(k),this.radius.flush(k),this.angle.flush(k)},x.setDistance=function(k,b){b>0&&this.radius.set(k,Math.log(b))},x.lookAt=function(k,b,T,_){this.recalcMatrix(k),b=b||this.computedEye,T=T||this.computedCenter;var M=(_=_||this.computedUp)[0],A=_[1],S=_[2],E=g(M,A,S);if(!(E<1e-6)){M/=E,A/=E,S/=E;var D=b[0]-T[0],O=b[1]-T[1],R=b[2]-T[2],z=g(D,O,R);if(!(z<1e-6)){D/=z,O/=z,R/=z;var L=this.computedRight,P=L[0],N=L[1],B=L[2],G=M*P+A*N+S*B,W=g(P-=G*M,N-=G*A,B-=G*S);if(!(W<.01&&(W=g(P=A*R-S*O,N=S*D-M*R,B=M*O-A*D))<1e-6)){P/=W,N/=W,B/=W,this.up.set(k,M,A,S),this.right.set(k,P,N,B),this.center.set(k,T[0],T[1],T[2]),this.radius.set(k,Math.log(z));var K=A*B-S*N,te=S*P-M*B,Y=M*N-A*P,Z=g(K,te,Y),re=M*D+A*O+S*R,U=P*D+N*O+B*R,q=(K/=Z)*D+(te/=Z)*O+(Y/=Z)*R,$=Math.asin(p(re)),ne=Math.atan2(q,U),H=this.angle._state,Q=H[H.length-1],ee=H[H.length-2];Q%=2*Math.PI;var ie=Math.abs(Q+2*Math.PI-ne),ae=Math.abs(Q-ne),ue=Math.abs(Q-2*Math.PI-ne);ie0?B.pop():new ArrayBuffer(P)}function k(P){return new Uint8Array(w(P),0,P)}function b(P){return new Uint16Array(w(2*P),0,P)}function T(P){return new Uint32Array(w(4*P),0,P)}function _(P){return new Int8Array(w(P),0,P)}function M(P){return new Int16Array(w(2*P),0,P)}function A(P){return new Int32Array(w(4*P),0,P)}function S(P){return new Float32Array(w(4*P),0,P)}function E(P){return new Float64Array(w(8*P),0,P)}function D(P){return h?new Uint8ClampedArray(w(P),0,P):k(P)}function O(P){return m?new BigUint64Array(w(8*P),0,P):null}function R(P){return g?new BigInt64Array(w(8*P),0,P):null}function z(P){return new DataView(w(P),0,P)}function L(P){P=s.nextPow2(P);var N=s.log2(P),B=y[N];return B.length>0?B.pop():new d(P)}c.free=function(P){if(d.isBuffer(P))y[s.log2(P.length)].push(P);else{if(Object.prototype.toString.call(P)!=="[object ArrayBuffer]"&&(P=P.buffer),!P)return;var N=P.length||P.byteLength,B=0|s.log2(N);v[B].push(P)}},c.freeUint8=c.freeUint16=c.freeUint32=c.freeBigUint64=c.freeInt8=c.freeInt16=c.freeInt32=c.freeBigInt64=c.freeFloat32=c.freeFloat=c.freeFloat64=c.freeDouble=c.freeUint8Clamped=c.freeDataView=function(P){x(P.buffer)},c.freeArrayBuffer=x,c.freeBuffer=function(P){y[s.log2(P.length)].push(P)},c.malloc=function(P,N){if(N===void 0||N==="arraybuffer")return w(P);switch(N){case"uint8":return k(P);case"uint16":return b(P);case"uint32":return T(P);case"int8":return _(P);case"int16":return M(P);case"int32":return A(P);case"float":case"float32":return S(P);case"double":case"float64":return E(P);case"uint8_clamped":return D(P);case"bigint64":return R(P);case"biguint64":return O(P);case"buffer":return L(P);case"data":case"dataview":return z(P);default:return null}return null},c.mallocArrayBuffer=w,c.mallocUint8=k,c.mallocUint16=b,c.mallocUint32=T,c.mallocInt8=_,c.mallocInt16=M,c.mallocInt32=A,c.mallocFloat32=c.mallocFloat=S,c.mallocFloat64=c.mallocDouble=E,c.mallocUint8Clamped=D,c.mallocBigUint64=O,c.mallocBigInt64=R,c.mallocDataView=z,c.mallocBuffer=L,c.clearCache=function(){for(var P=0;P<32;++P)p.UINT8[P].length=0,p.UINT16[P].length=0,p.UINT32[P].length=0,p.INT8[P].length=0,p.INT16[P].length=0,p.INT32[P].length=0,p.FLOAT[P].length=0,p.DOUBLE[P].length=0,p.BIGUINT64[P].length=0,p.BIGINT64[P].length=0,p.UINT8C[P].length=0,v[P].length=0,y[P].length=0}}).call(this)}).call(this,r!==void 0?r:typeof self<"u"?self:typeof window<"u"?window:{})},{"bit-twiddle":32,buffer:3,dup:65}],309:[function(a,u,c){function i(l){this.roots=new Array(l),this.ranks=new Array(l);for(var d=0;d0&&(T=b.size),b.lineSpacing&&b.lineSpacing>0&&(_=b.lineSpacing),b.styletags&&b.styletags.breaklines&&(M.breaklines=!!b.styletags.breaklines),b.styletags&&b.styletags.bolds&&(M.bolds=!!b.styletags.bolds),b.styletags&&b.styletags.italics&&(M.italics=!!b.styletags.italics),b.styletags&&b.styletags.subscripts&&(M.subscripts=!!b.styletags.subscripts),b.styletags&&b.styletags.superscripts&&(M.superscripts=!!b.styletags.superscripts)),k.font=[b.fontStyle,b.fontVariant,b.fontWeight,T+"px",b.font].filter(function(A){return A}).join(" "),k.textAlign="start",k.textBaseline="alphabetic",k.direction="ltr",y(function(A,S,E,D,O,R){E=E.replace(/\n/g,""),E=R.breaklines===!0?E.replace(/\/g,` +`):E.replace(/\/g," ");var z="",L=[];for(G=0;G-1?parseInt(_e[1+Oe]):0,Me=de>-1?parseInt(we[1+de]):0;ye!==Me&&(Te=Te.replace(ie(),"?px "),te*=Math.pow(.75,Me-ye),Te=Te.replace("?px ",ie())),K+=.25*re*(Me-ye)}if(R.superscripts===!0){var ke=_e.indexOf("+"),Ee=we.indexOf("+"),ze=ke>-1?parseInt(_e[1+ke]):0,Fe=Ee>-1?parseInt(we[1+Ee]):0;ze!==Fe&&(Te=Te.replace(ie(),"?px "),te*=Math.pow(.75,Fe-ze),Te=Te.replace("?px ",ie())),K-=.25*re*(Fe-ze)}if(R.bolds===!0){var Ve=_e.indexOf("b|")>-1,Ke=we.indexOf("b|")>-1;!Ve&&Ke&&(Te=Re?Te.replace("italic ","italic bold "):"bold "+Te),Ve&&!Ke&&(Te=Te.replace("bold ",""))}if(R.italics===!0){var Re=_e.indexOf("i|")>-1,qe=we.indexOf("i|")>-1;!Re&&qe&&(Te="italic "+Te),Re&&!qe&&(Te=Te.replace("italic ",""))}S.font=Te}for(B=0;B",_="",M=T.length,A=_.length,S=w[0]==="+"||w[0]==="-",E=0,D=-A;E>-1&&(E=k.indexOf(T,E))!==-1&&(D=k.indexOf(_,E+M))!==-1&&!(D<=E);){for(var O=E;O=D)b[O]=null,k=k.substr(0,O)+" "+k.substr(O+1);else if(b[O]!==null){var R=b[O].indexOf(w[0]);R===-1?b[O]+=w:S&&(b[O]=b[O].substr(0,R+1)+(1+parseInt(b[O][R+1]))+b[O].substr(R+2))}var z=E+M,L=k.substr(z,D-z).indexOf(T);E=L!==-1?L:D+A}return b}function p(x,w){var k=i(x,128);return w?l(k.cells,k.positions,.25):{edges:k.cells,positions:k.positions}}function v(x,w,k,b){var T=p(x,b),_=function(B,G,W){for(var K=G.textAlign||"start",te=G.textBaseline||"alphabetic",Y=[1<<30,1<<30],Z=[0,0],re=B.length,U=0;U"u"||!ses.ok||ses.ok()){typeof ses<"u"&&(ses.weakMapPermitHostObjects=T);var i=!1;if(typeof WeakMap=="function"){var s=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var l=new s,d=Object.freeze({});if(l.set(d,1),l.get(d)===1)return void(u.exports=WeakMap);i=!0}}var h=Object.getOwnPropertyNames,m=Object.defineProperty,g=Object.isExtensible,p="weakmap:ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var v=new ArrayBuffer(25),y=new Uint8Array(v);crypto.getRandomValues(y),p="weakmap:rand:"+Array.prototype.map.call(y,function(E){return(E%36).toString(36)}).join("")+"___"}if(m(Object,"getOwnPropertyNames",{value:function(E){return h(E).filter(_)}}),"getPropertyNames"in Object){var x=Object.getPropertyNames;m(Object,"getPropertyNames",{value:function(E){return x(E).filter(_)}})}(function(){var E=Object.freeze;m(Object,"freeze",{value:function(R){return M(R),E(R)}});var D=Object.seal;m(Object,"seal",{value:function(R){return M(R),D(R)}});var O=Object.preventExtensions;m(Object,"preventExtensions",{value:function(R){return M(R),O(R)}})})();var w=!1,k=0,b=function(){this instanceof b||S();var E=[],D=[],O=k++;return Object.create(b.prototype,{get___:{value:A(function(R,z){var L,P=M(R);return P?O in P?P[O]:z:(L=E.indexOf(R))>=0?D[L]:z})},has___:{value:A(function(R){var z=M(R);return z?O in z:E.indexOf(R)>=0})},set___:{value:A(function(R,z){var L,P=M(R);return P?P[O]=z:(L=E.indexOf(R))>=0?D[L]=z:(L=E.length,D[L]=z,E[L]=R),this})},delete___:{value:A(function(R){var z,L,P=M(R);return P?O in P&&delete P[O]:!((z=E.indexOf(R))<0)&&(L=E.length-1,E[z]=void 0,D[z]=D[L],E[z]=E[L],E.length=L,D.length=L,!0)})}})};b.prototype=Object.create(Object.prototype,{get:{value:function(E,D){return this.get___(E,D)},writable:!0,configurable:!0},has:{value:function(E){return this.has___(E)},writable:!0,configurable:!0},set:{value:function(E,D){return this.set___(E,D)},writable:!0,configurable:!0},delete:{value:function(E){return this.delete___(E)},writable:!0,configurable:!0}}),typeof s=="function"?function(){function E(){this instanceof b||S();var D,O=new s,R=void 0,z=!1;return D=i?function(L,P){return O.set(L,P),O.has(L)||(R||(R=new b),R.set(L,P)),this}:function(L,P){if(z)try{O.set(L,P)}catch{R||(R=new b),R.set___(L,P)}else O.set(L,P);return this},Object.create(b.prototype,{get___:{value:A(function(L,P){return R?O.has(L)?O.get(L):R.get___(L,P):O.get(L,P)})},has___:{value:A(function(L){return O.has(L)||!!R&&R.has___(L)})},set___:{value:A(D)},delete___:{value:A(function(L){var P=!!O.delete(L);return R&&R.delete___(L)||P})},permitHostObjects___:{value:A(function(L){if(L!==T)throw new Error("bogus call to permitHostObjects___");z=!0})}})}i&&typeof Proxy<"u"&&(Proxy=void 0),E.prototype=b.prototype,u.exports=E,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),u.exports=b)}function T(E){E.permitHostObjects___&&E.permitHostObjects___(T)}function _(E){return!(E.substr(0,8)=="weakmap:"&&E.substr(E.length-3)==="___")}function M(E){if(E!==Object(E))throw new TypeError("Not an object: "+E);var D=E[p];if(D&&D.key===E)return D;if(g(E)){D={key:E};try{return m(E,p,{value:D,writable:!1,enumerable:!1,configurable:!1}),D}catch{return}}}function A(E){return E.prototype=null,Object.freeze(E)}function S(){w||typeof console>"u"||(w=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}})()},{}],314:[function(a,u,c){var i=a("./hidden-store.js");u.exports=function(){var s={};return function(l){if((typeof l!="object"||l===null)&&typeof l!="function")throw new Error("Weakmap-shim: Key must be object");var d=l.valueOf(s);return d&&d.identity===s?d:i(l,s)}}},{"./hidden-store.js":315}],315:[function(a,u,c){u.exports=function(i,s){var l={identity:s},d=i.valueOf;return Object.defineProperty(i,"valueOf",{value:function(h){return h!==s?d.apply(this,arguments):l},writable:!0}),l}},{}],316:[function(a,u,c){var i=a("./create-store.js");u.exports=function(){var s=i();return{get:function(l,d){var h=s(l);return h.hasOwnProperty("value")?h.value:d},set:function(l,d){return s(l).value=d,this},has:function(l){return"value"in s(l)},delete:function(l){return delete s(l).value}}}},{"./create-store.js":314}],317:[function(a,u,c){var i,s=function(){return function(l,d,h,m,g,p){var v=l[0],y=h[0],x=[0],w=y;m|=0;var k=0,b=y;for(k=0;k=0!=_>=0&&g.push(x[0]+.5+.5*(T+_)/(T-_)),m+=b,++x[0]}}};u.exports=(i={funcName:"zeroCrossings"},function(l){var d={};return function(h,m,g){var p=h.dtype,v=h.order,y=[p,v.join()].join(),x=d[y];return x||(d[y]=x=l([p,v])),x(h.shape.slice(0),h.data,h.stride,0|h.offset,m,g)}}(s.bind(void 0,i)))},{}],318:[function(a,u,c){u.exports=function(s,l){var d=[];return l=+l||0,i(s.hi(s.shape[0]-1),d,l),d};var i=a("./lib/zc-core")},{"./lib/zc-core":317}]},{},[6])(6)})}).call(this)}).call(this,typeof Ro<"u"?Ro:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[27])(27)})})(qD);var dW=NG(qD.exports);/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017-2022 Joachim Wester + * MIT licensed + */var pW=globalThis&&globalThis.__extends||function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,f){o.__proto__=f}||function(o,f){for(var r in f)f.hasOwnProperty(r)&&(o[r]=f[r])},t(n,e)};return function(n,e){t(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),gW=Object.prototype.hasOwnProperty;function tk(t,n){return gW.call(t,n)}function nk(t){if(Array.isArray(t)){for(var n=new Array(t.length),e=0;e=48&&o<=57){n++;continue}return!1}return!0}function Zp(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function HD(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function ik(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var n=0,e=t.length;n0&&c[s-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(e&&d===void 0&&(i[h]===void 0?d=c.slice(0,s).join("/"):s==l-1&&(d=n.path),d!==void 0&&m(n,0,t,d)),s++,Array.isArray(i)){if(h==="-")h=i.length;else{if(e&&!rk(h))throw new vs("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",r,n,t);rk(h)&&(h=~~h)}if(s>=l){if(e&&n.op==="add"&&h>i.length)throw new vs("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",r,n,t);var a=vW[n.op].call(n,i,h,t);if(a.test===!1)throw new vs("Test operation failed","TEST_OPERATION_FAILED",r,n,t);return a}}else if(s>=l){var a=Gg[n.op].call(n,i,h,t);if(a.test===!1)throw new vs("Test operation failed","TEST_OPERATION_FAILED",r,n,t);return a}if(i=i[h],e&&s0)throw new vs('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",n,t,e);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new vs("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",n,t,e);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new vs("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",n,t,e);if((t.op==="add"||t.op==="replace"||t.op==="test")&&ik(t.value))throw new vs("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",n,t,e);if(e){if(t.op=="add"){var f=t.path.split("/").length,r=o.split("/").length;if(f!==r+1&&f!==r)throw new vs("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",n,t,e)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==o)throw new vs("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",n,t,e)}else if(t.op==="move"||t.op==="copy"){var a={op:"_get",path:t.from,value:void 0},u=GD([a],e);if(u&&u.name==="OPERATION_PATH_UNRESOLVABLE")throw new vs("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",n,t,e)}}}else throw new vs("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",n,t,e)}function GD(t,n,e){try{if(!Array.isArray(t))throw new vs("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(n)Y2(Zu(n),Zu(t),e||!0);else{e=e||h_;for(var o=0;o0&&(t.patches=[],t.callback&&t.callback(o)),o}function _A(t,n,e,o,f){if(n!==t){typeof n.toJSON=="function"&&(n=n.toJSON());for(var r=nk(n),a=nk(t),u=!1,c=a.length-1;c>=0;c--){var i=a[c],s=t[i];if(tk(n,i)&&!(n[i]===void 0&&s!==void 0&&Array.isArray(n)===!1)){var l=n[i];typeof s=="object"&&s!=null&&typeof l=="object"&&l!=null&&Array.isArray(s)===Array.isArray(l)?_A(s,l,e,o+"/"+Zp(i),f):s!==l&&(f&&e.push({op:"test",path:o+"/"+Zp(i),value:Zu(s)}),e.push({op:"replace",path:o+"/"+Zp(i),value:Zu(l)}))}else Array.isArray(t)===Array.isArray(n)?(f&&e.push({op:"test",path:o+"/"+Zp(i),value:Zu(s)}),e.push({op:"remove",path:o+"/"+Zp(i)}),u=!0):(f&&e.push({op:"test",path:o,value:t}),e.push({op:"replace",path:o,value:n}))}if(!(!u&&r.length==a.length))for(var c=0;c0)return[x,o+d.join(`, +`+v),s].join(` +`+c)}return w}(n,"",0)};function Nu(t,n,e){return t.fields=n||[],t.fname=e,t}function xs(t){return t==null?null:t.fname}function Bl(t){return t==null?null:t.fields}function WD(t){return t.length===1?OW(t[0]):LW(t)}const OW=t=>function(n){return n[t]},LW=t=>{const n=t.length;return function(e){for(let o=0;oa?i():a=u+1:c==="["?(u>a&&i(),f=a=u+1):c==="]"&&(f||Pr("Access path missing open bracket: "+t),f>0&&i(),f=0,a=u+1)}return f&&Pr("Access path missing closing bracket: "+t),o&&Pr("Access path missing closing quote: "+t),u>a&&(u++,i()),n}function Lu(t,n,e){const o=ih(t);return t=o.length===1?o[0]:t,Nu((e&&e.get||WD)(o),[t],n||t)}const Ty=Lu("id"),Hl=Nu(t=>t,[],"identity"),Md=Nu(()=>0,[],"zero"),Um=Nu(()=>1,[],"one"),mc=Nu(()=>!0,[],"true"),yd=Nu(()=>!1,[],"false");function PW(t,n,e){const o=[n].concat([].slice.call(e));console[t].apply(console,o)}const YD=0,wA=1,kA=2,XD=3,ZD=4;function TA(t,n,e=PW){let o=t||YD;return{level(f){return arguments.length?(o=+f,this):o},error(){return o>=wA&&e(n||"error","ERROR",arguments),this},warn(){return o>=kA&&e(n||"warn","WARN",arguments),this},info(){return o>=XD&&e(n||"log","INFO",arguments),this},debug(){return o>=ZD&&e(n||"log","DEBUG",arguments),this}}}var Ir=Array.isArray;function Ei(t){return t===Object(t)}const MC=t=>t!=="__proto__";function Vm(...t){return t.reduce((n,e)=>{for(const o in e)if(o==="signals")n.signals=DW(n.signals,e.signals);else{const f=o==="legend"?{layout:1}:o==="style"?!0:null;qm(n,o,e[o],f)}return n},{})}function qm(t,n,e,o){if(!MC(n))return;let f,r;if(Ei(e)&&!Ir(e)){r=Ei(t[n])?t[n]:t[n]={};for(f in e)o&&(o===!0||o[f])?qm(r,f,e[f]):MC(f)&&(r[f]=e[f])}else t[n]=e}function DW(t,n){if(t==null)return n;const e={},o=[];function f(r){e[r.name]||(e[r.name]=1,o.push(r))}return n.forEach(f),t.forEach(f),o}function Na(t){return t[t.length-1]}function Rl(t){return t==null||t===""?null:+t}const JD=t=>n=>t*Math.exp(n),KD=t=>n=>Math.log(t*n),QD=t=>n=>Math.sign(n)*Math.log1p(Math.abs(n/t)),eI=t=>n=>Math.sign(n)*Math.expm1(Math.abs(n))*t,d_=t=>n=>n<0?-Math.pow(-n,t):Math.pow(n,t);function X2(t,n,e,o){const f=e(t[0]),r=e(Na(t)),a=(r-f)*n;return[o(f-a),o(r-a)]}function tI(t,n){return X2(t,n,Rl,Hl)}function nI(t,n){var e=Math.sign(t[0]);return X2(t,n,KD(e),JD(e))}function rI(t,n,e){return X2(t,n,d_(e),d_(1/e))}function iI(t,n,e){return X2(t,n,QD(e),eI(e))}function Z2(t,n,e,o,f){const r=o(t[0]),a=o(Na(t)),u=n!=null?o(n):(r+a)/2;return[f(u+(r-u)*e),f(u+(a-u)*e)]}function AA(t,n,e){return Z2(t,n,e,Rl,Hl)}function MA(t,n,e){const o=Math.sign(t[0]);return Z2(t,n,e,KD(o),JD(o))}function p_(t,n,e,o){return Z2(t,n,e,d_(o),d_(1/o))}function SA(t,n,e,o){return Z2(t,n,e,QD(o),eI(o))}function aI(t){return 1+~~(new Date(t).getMonth()/3)}function oI(t){return 1+~~(new Date(t).getUTCMonth()/3)}function ki(t){return t!=null?Ir(t)?t:[t]:[]}function sI(t,n,e){let o=t[0],f=t[1],r;return f=e-n?[n,e]:[o=Math.min(Math.max(o,n),e-r),o+r]}function ga(t){return typeof t=="function"}const IW="descending";function EA(t,n,e){e=e||{},n=ki(n)||[];const o=[],f=[],r={},a=e.comparator||zW;return ki(t).forEach((u,c)=>{u!=null&&(o.push(n[c]===IW?-1:1),f.push(u=ga(u)?u:Lu(u,null,e)),(Bl(u)||[]).forEach(i=>r[i]=1))}),f.length===0?null:Nu(a(f,o),Object.keys(r))}const J2=(t,n)=>(tn||n==null)&&t!=null?1:(n=n instanceof Date?+n:n,(t=t instanceof Date?+t:t)!==t&&n===n?-1:n!==n&&t===t?1:0),zW=(t,n)=>t.length===1?RW(t[0],n[0]):FW(t,n,t.length),RW=(t,n)=>function(e,o){return J2(t(e),t(o))*n},FW=(t,n,e)=>(n.push(0),function(o,f){let r,a=0,u=-1;for(;a===0&&++ut}function CA(t,n){let e;return o=>{e&&clearTimeout(e),e=setTimeout(()=>(n(o),e=null),t)}}function pa(t){for(let n,e,o=1,f=arguments.length;oa&&(a=f))}else{for(f=n(t[e]);ea&&(a=f))}return[r,a]}function lI(t,n){const e=t.length;let o=-1,f,r,a,u,c;if(n==null){for(;++o=r){f=a=r;break}if(o===e)return[-1,-1];for(u=c=o;++or&&(f=r,u=o),a=r){f=a=r;break}if(o===e)return[-1,-1];for(u=c=o;++or&&(f=r,u=o),a{f.set(r,t[r])}),f}function uI(t,n,e,o,f,r){if(!e&&e!==0)return r;const a=+e;let u=t[0],c=Na(t),i;cr&&(a=f,f=r,r=a),e=e===void 0||e,o=o===void 0||o,(e?f<=t:fu.replace(/\\(.)/g,"$1")):ki(t));const o=t&&t.length,f=e&&e.get||WD,r=u=>f(n?[u]:ih(u));let a;if(!o)a=function(){return""};else if(o===1){const u=r(t[0]);a=function(c){return""+u(c)}}else{const u=t.map(r);a=function(c){let i=""+u[0](c),s=0;for(;++s{n={},e={},o=0},r=(a,u)=>(++o>t&&(e=n,n={},o=1),n[a]=u);return f(),{clear:f,has:a=>qi(n,a)||qi(e,a),get:a=>qi(n,a)?n[a]:qi(e,a)?r(a,e[a]):void 0,set:(a,u)=>qi(n,a)?n[a]=u:r(a,u)}}function pI(t,n,e,o){const f=n.length,r=e.length;if(!r)return n;if(!f)return e;const a=o||new n.constructor(f+r);let u=0,c=0,i=0;for(;u0?e[c++]:n[u++];for(;u=0;)e+=t;return e}function gI(t,n,e,o){const f=e||" ",r=t+"",a=n-r.length;return a<=0?r:o==="left"?iv(f,a)+r:o==="center"?iv(f,~~(a/2))+r+iv(f,Math.ceil(a/2)):r+iv(f,a)}function Ay(t){return t&&Na(t)-t[0]||0}function oi(t){return Ir(t)?"["+t.map(oi)+"]":Ei(t)||bi(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function LA(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const jW=t=>wo(t)||Nd(t)?t:Date.parse(t);function PA(t,n){return n=n||jW,t==null||t===""?null:n(t)}function DA(t){return t==null||t===""?null:t+""}function ff(t){const n={},e=t.length;for(let o=0;o1)o=YW(t,n,e);else for(f=0,o=new Array(r=t.arcs.length);f=a&&(o=a-f,f+=o/++e,r+=o*(a-f));else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(u=+u)>=u&&(o=u-f,f+=o/++e,r+=o*(u-f))}if(e>1)return r/(e-1)}function ZW(t,n){const e=XW(t,n);return e&&Math.sqrt(e)}class fu{constructor(){this._partials=new Float64Array(32),this._n=0}add(n){const e=this._partials;let o=0;for(let f=0;f0){for(a=n[--e];e>0&&(o=a,f=n[--e],a=o+f,r=f-(a-o),!r););e>0&&(r<0&&n[e-1]<0||r>0&&n[e-1]>0)&&(f=r*2,o=a+f,f==o-a&&(a=o))}return a}}class EC extends Map{constructor(n,e=bI){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(const[o,f]of n)this.set(o,f)}get(n){return super.get(ok(this,n))}has(n){return super.has(ok(this,n))}set(n,e){return super.set(yI(this,n),e)}delete(n){return super.delete(xI(this,n))}}class g_ extends Set{constructor(n,e=bI){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(const o of n)this.add(o)}has(n){return super.has(ok(this,n))}add(n){return super.add(yI(this,n))}delete(n){return super.delete(xI(this,n))}}function ok({_intern:t,_key:n},e){const o=n(e);return t.has(o)?t.get(o):e}function yI({_intern:t,_key:n},e){const o=n(e);return t.has(o)?t.get(o):(t.set(o,e),e)}function xI({_intern:t,_key:n},e){const o=n(e);return t.has(o)&&(e=t.get(o),t.delete(o)),e}function bI(t){return t!==null&&typeof t=="object"?t.valueOf():t}function JW(t,n){return Array.from(n,e=>t[e])}function KW(t=Vv){if(t===Vv)return _I;if(typeof t!="function")throw new TypeError("compare is not a function");return(n,e)=>{const o=t(n,e);return o||o===0?o:(t(e,e)===0)-(t(n,n)===0)}}function _I(t,n){return(t==null||!(t>=t))-(n==null||!(n>=n))||(tn?1:0)}function d0(t,n){let e;if(n===void 0)for(const o of t)o!=null&&(e=o)&&(e=o);else{let o=-1;for(let f of t)(f=n(f,++o,t))!=null&&(e=f)&&(e=f)}return e}function sk(t,n){let e;if(n===void 0)for(const o of t)o!=null&&(e>o||e===void 0&&o>=o)&&(e=o);else{let o=-1;for(let f of t)(f=n(f,++o,t))!=null&&(e>f||e===void 0&&f>=f)&&(e=f)}return e}function wI(t,n,e=0,o=t.length-1,f){for(f=f===void 0?_I:KW(f);o>e;){if(o-e>600){const c=o-e+1,i=n-e+1,s=Math.log(c),l=.5*Math.exp(2*s/3),d=.5*Math.sqrt(s*l*(c-l)/c)*(i-c/2<0?-1:1),h=Math.max(e,Math.floor(n-i*l/c+d)),m=Math.min(o,Math.floor(n+(c-i)*l/c+d));wI(t,n,h,m,f)}const r=t[n];let a=e,u=o;for(D1(t,e,n),f(t[o],r)>0&&D1(t,e,o);a0;)--u}f(t[e],r)===0?D1(t,e,u):(++u,D1(t,u,o)),u<=n&&(e=u+1),n<=u&&(o=u-1)}return t}function D1(t,n,e){const o=t[n];t[n]=t[e],t[e]=o}function lk(t,n,e){if(t=Float64Array.from(UG(t,e)),!!(o=t.length)){if((n=+n)<=0||o<2)return sk(t);if(n>=1)return d0(t);var o,f=(o-1)*n,r=Math.floor(f),a=d0(wI(t,r).subarray(0,r+1)),u=sk(t.subarray(r+1));return a+(u-a)*(f-r)}}function kI(t,n,e=jG){if(!!(o=t.length)){if((n=+n)<=0||o<2)return+e(t[0],0,t);if(n>=1)return+e(t[o-1],o-1,t);var o,f=(o-1)*n,r=Math.floor(f),a=+e(t[r],r,t),u=+e(t[r+1],r+1,t);return a+(u-a)*(f-r)}}function QW(t,n){let e=0,o=0;if(n===void 0)for(let f of t)f!=null&&(f=+f)>=f&&(++e,o+=f);else{let f=-1;for(let r of t)(r=n(r,++f,t))!=null&&(r=+r)>=r&&(++e,o+=r)}if(e)return o/e}function TI(t,n){return lk(t,.5,n)}function*eY(t){for(const n of t)yield*n}function AI(t){return Array.from(eY(t))}function Ju(t,n,e){t=+t,n=+n,e=(f=arguments.length)<2?(n=t,t=0,1):f<3?1:+e;for(var o=-1,f=Math.max(0,Math.ceil((n-t)/e))|0,r=new Array(f);++o0))return c;do c.push(i=new Date(+r)),n(r,u),t(r);while(i=a)for(;t(a),!r(a);)a.setTime(a-1)},function(a,u){if(a>=a)if(u<0)for(;++u<=0;)for(;n(a,-1),!r(a););else for(;--u>=0;)for(;n(a,1),!r(a););})},e&&(f.count=function(r,a){return E5.setTime(+r),C5.setTime(+a),t(E5),t(C5),Math.floor(e(E5,C5))},f.every=function(r){return r=Math.floor(r),!isFinite(r)||!(r>0)?null:r>1?f.filter(o?function(a){return o(a)%r===0}:function(a){return f.count(0,a)%r===0}):f}),f}var uk=ul(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});uk.every=function(t){return t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ul(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):uk};var IA=uk;const Ih=1e3,cc=Ih*60,zh=cc*60,_0=zh*24,zA=_0*7,CC=_0*30,O5=_0*365;var iY=ul(function(t){t.setTime(t-t.getMilliseconds())},function(t,n){t.setTime(+t+n*Ih)},function(t,n){return(n-t)/Ih},function(t){return t.getUTCSeconds()}),Cd=iY,aY=ul(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ih)},function(t,n){t.setTime(+t+n*cc)},function(t,n){return(n-t)/cc},function(t){return t.getMinutes()}),RA=aY,oY=ul(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ih-t.getMinutes()*cc)},function(t,n){t.setTime(+t+n*zh)},function(t,n){return(n-t)/zh},function(t){return t.getHours()}),FA=oY,sY=ul(t=>t.setHours(0,0,0,0),(t,n)=>t.setDate(t.getDate()+n),(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*cc)/_0,t=>t.getDate()-1),Bd=sY;function V0(t){return ul(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(n,e){n.setDate(n.getDate()+e*7)},function(n,e){return(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*cc)/zA})}var My=V0(0),ck=V0(1);V0(2);V0(3);var Hv=V0(4);V0(5);V0(6);var lY=ul(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+(n.getFullYear()-t.getFullYear())*12},function(t){return t.getMonth()}),m_=lY,SI=ul(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});SI.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:ul(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)})};var Wd=SI,uY=ul(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*cc)},function(t,n){return(n-t)/cc},function(t){return t.getUTCMinutes()}),NA=uY,cY=ul(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+n*zh)},function(t,n){return(n-t)/zh},function(t){return t.getUTCHours()}),BA=cY,fY=ul(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/_0},function(t){return t.getUTCDate()-1}),jd=fY;function q0(t){return ul(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCDate(n.getUTCDate()+e*7)},function(n,e){return(e-n)/zA})}var Sy=q0(0),fk=q0(1);q0(2);q0(3);var $v=q0(4);q0(5);q0(6);var hY=ul(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+(n.getUTCFullYear()-t.getUTCFullYear())*12},function(t){return t.getUTCMonth()}),v_=hY,EI=ul(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});EI.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:ul(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})};var Yd=EI;function CI(t,n,e,o,f,r){const a=[[Cd,1,Ih],[Cd,5,5*Ih],[Cd,15,15*Ih],[Cd,30,30*Ih],[r,1,cc],[r,5,5*cc],[r,15,15*cc],[r,30,30*cc],[f,1,zh],[f,3,3*zh],[f,6,6*zh],[f,12,12*zh],[o,1,_0],[o,2,2*_0],[e,1,zA],[n,1,CC],[n,3,3*CC],[t,1,O5]];function u(i,s,l){const d=sp).right(a,d);if(h===a.length)return t.every(b0(i/O5,s/O5,l));if(h===0)return IA.every(Math.max(b0(i,s,l),1));const[m,g]=a[d/a[h-1][2](t[n]=1+e,t),{});function UA(t){const n=ki(t).slice(),e={};return n.length||Pr("Missing time unit."),n.forEach(f=>{qi(L5,f)?e[f]=1:Pr("Invalid time unit: ".concat(f,"."))}),(e[Gs]||e[Il]?1:0)+(e[Pu]||e[jl]||e[Du]?1:0)+(e[Jf]?1:0)>1&&Pr("Incompatible time units: ".concat(t)),n.sort((f,r)=>L5[f]-L5[r]),n}const vY={[wl]:"%Y ",[Pu]:"Q%q ",[jl]:"%b ",[Du]:"%d ",[Gs]:"W%U ",[Il]:"%a ",[Jf]:"%j ",[Qu]:"%H:00",[ec]:"00:%M",[vc]:":%S",[hf]:".%L",["".concat(wl,"-").concat(jl)]:"%Y-%m ",["".concat(wl,"-").concat(jl,"-").concat(Du)]:"%Y-%m-%d ",["".concat(Qu,"-").concat(ec)]:"%H:%M"};function OI(t,n){const e=pa({},vY,n),o=UA(t),f=o.length;let r="",a=0,u,c;for(a=0;aa;--u)if(c=o.slice(a,u).join("-"),e[c]!=null){r+=e[c],a=u;break}return r.trim()}const Kp=new Date;function VA(t){return Kp.setFullYear(t),Kp.setMonth(0),Kp.setDate(1),Kp.setHours(0,0,0,0),Kp}function LI(t){return DI(new Date(t))}function PI(t){return hk(new Date(t))}function DI(t){return Bd.count(VA(t.getFullYear())-1,t)}function hk(t){return My.count(VA(t.getFullYear())-1,t)}function dk(t){return VA(t).getDay()}function yY(t,n,e,o,f,r,a){if(0<=t&&t<100){const u=new Date(-1,n,e,o,f,r,a);return u.setFullYear(t),u}return new Date(t,n,e,o,f,r,a)}function II(t){return RI(new Date(t))}function zI(t){return pk(new Date(t))}function RI(t){const n=Date.UTC(t.getUTCFullYear(),0,1);return jd.count(n-1,t)}function pk(t){const n=Date.UTC(t.getUTCFullYear(),0,1);return Sy.count(n-1,t)}function gk(t){return Kp.setTime(Date.UTC(t,0,1)),Kp.getUTCDay()}function xY(t,n,e,o,f,r,a){if(0<=t&&t<100){const u=new Date(Date.UTC(-1,n,e,o,f,r,a));return u.setUTCFullYear(e.y),u}return new Date(Date.UTC(t,n,e,o,f,r,a))}function FI(t,n,e,o,f){const r=n||1,a=Na(t),u=(v,y,x)=>(x=x||v,bY(e[x],o[x],v===a&&r,y)),c=new Date,i=ff(t),s=i[wl]?u(wl):$l(2012),l=i[jl]?u(jl):i[Pu]?u(Pu):Md,d=i[Gs]&&i[Il]?u(Il,1,Gs+Il):i[Gs]?u(Gs,1):i[Il]?u(Il,1):i[Du]?u(Du,1):i[Jf]?u(Jf,1):Um,h=i[Qu]?u(Qu):Md,m=i[ec]?u(ec):Md,g=i[vc]?u(vc):Md,p=i[hf]?u(hf):Md;return function(v){c.setTime(+v);const y=s(c);return f(y,l(c),d(c,y),h(c),m(c),g(c),p(c))}}function bY(t,n,e,o){const f=e<=1?t:o?(r,a)=>o+e*Math.floor((t(r,a)-o)/e):(r,a)=>e*Math.floor(t(r,a)/e);return n?(r,a)=>n(f(r,a),a):f}function um(t,n,e){return n+t*7-(e+6)%7}const _Y={[wl]:t=>t.getFullYear(),[Pu]:t=>Math.floor(t.getMonth()/3),[jl]:t=>t.getMonth(),[Du]:t=>t.getDate(),[Qu]:t=>t.getHours(),[ec]:t=>t.getMinutes(),[vc]:t=>t.getSeconds(),[hf]:t=>t.getMilliseconds(),[Jf]:t=>DI(t),[Gs]:t=>hk(t),[Gs+Il]:(t,n)=>um(hk(t),t.getDay(),dk(n)),[Il]:(t,n)=>um(1,t.getDay(),dk(n))},wY={[Pu]:t=>3*t,[Gs]:(t,n)=>um(t,0,dk(n))};function NI(t,n){return FI(t,n||1,_Y,wY,yY)}const kY={[wl]:t=>t.getUTCFullYear(),[Pu]:t=>Math.floor(t.getUTCMonth()/3),[jl]:t=>t.getUTCMonth(),[Du]:t=>t.getUTCDate(),[Qu]:t=>t.getUTCHours(),[ec]:t=>t.getUTCMinutes(),[vc]:t=>t.getUTCSeconds(),[hf]:t=>t.getUTCMilliseconds(),[Jf]:t=>RI(t),[Gs]:t=>pk(t),[Il]:(t,n)=>um(1,t.getUTCDay(),gk(n)),[Gs+Il]:(t,n)=>um(pk(t),t.getUTCDay(),gk(n))},TY={[Pu]:t=>3*t,[Gs]:(t,n)=>um(t,0,gk(n))};function BI(t,n){return FI(t,n||1,kY,TY,xY)}const AY={[wl]:Wd,[Pu]:m_.every(3),[jl]:m_,[Gs]:My,[Du]:Bd,[Il]:Bd,[Jf]:Bd,[Qu]:FA,[ec]:RA,[vc]:Cd,[hf]:IA},MY={[wl]:Yd,[Pu]:v_.every(3),[jl]:v_,[Gs]:Sy,[Du]:jd,[Il]:jd,[Jf]:jd,[Qu]:BA,[ec]:NA,[vc]:Cd,[hf]:IA};function $m(t){return AY[t]}function Gm(t){return MY[t]}function jI(t,n,e){return t?t.offset(n,e):void 0}function UI(t,n,e){return jI($m(t),n,e)}function VI(t,n,e){return jI(Gm(t),n,e)}function qI(t,n,e,o){return t?t.range(n,e,o):void 0}function HI(t,n,e,o){return qI($m(t),n,e,o)}function $I(t,n,e,o){return qI(Gm(t),n,e,o)}const av=1e3,ov=av*60,sv=ov*60,K2=sv*24,SY=K2*7,OC=K2*30,mk=K2*365,GI=[wl,jl,Du,Qu,ec,vc,hf],lv=GI.slice(0,-1),uv=lv.slice(0,-1),cv=uv.slice(0,-1),EY=cv.slice(0,-1),CY=[wl,Gs],LC=[wl,jl],WI=[wl],I1=[[lv,1,av],[lv,5,5*av],[lv,15,15*av],[lv,30,30*av],[uv,1,ov],[uv,5,5*ov],[uv,15,15*ov],[uv,30,30*ov],[cv,1,sv],[cv,3,3*sv],[cv,6,6*sv],[cv,12,12*sv],[EY,1,K2],[CY,1,SY],[LC,1,OC],[LC,3,3*OC],[WI,1,mk]];function YI(t){const n=t.extent,e=t.maxbins||40,o=Math.abs(Ay(n))/e;let f=V2(u=>u[2]).right(I1,o),r,a;return f===I1.length?(r=WI,a=b0(n[0]/mk,n[1]/mk,e)):f?(f=I1[o/I1[f-1][2]53)return null;"w"in H||(H.w=1),"Z"in H?(ee=D5(z1(H.y,0,1)),ie=ee.getUTCDay(),ee=ie>4||ie===0?fk.ceil(ee):fk(ee),ee=jd.offset(ee,(H.V-1)*7),H.y=ee.getUTCFullYear(),H.m=ee.getUTCMonth(),H.d=ee.getUTCDate()+(H.w+6)%7):(ee=P5(z1(H.y,0,1)),ie=ee.getDay(),ee=ie>4||ie===0?ck.ceil(ee):ck(ee),ee=Bd.offset(ee,(H.V-1)*7),H.y=ee.getFullYear(),H.m=ee.getMonth(),H.d=ee.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),ie="Z"in H?D5(z1(H.y,0,1)).getUTCDay():P5(z1(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(ie+5)%7:H.w+H.U*7-(ie+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,D5(H)):P5(H)}}function _(q,$,ne,H){for(var Q=0,ee=$.length,ie=ne.length,ae,ue;Q=ie)return-1;if(ae=$.charCodeAt(Q++),ae===37){if(ae=$.charAt(Q++),ue=k[ae in PC?$.charAt(Q++):ae],!ue||(H=ue(q,ne,H))<0)return-1}else if(ae!=ne.charCodeAt(H++))return-1}return H}function M(q,$,ne){var H=i.exec($.slice(ne));return H?(q.p=s.get(H[0].toLowerCase()),ne+H[0].length):-1}function A(q,$,ne){var H=h.exec($.slice(ne));return H?(q.w=m.get(H[0].toLowerCase()),ne+H[0].length):-1}function S(q,$,ne){var H=l.exec($.slice(ne));return H?(q.w=d.get(H[0].toLowerCase()),ne+H[0].length):-1}function E(q,$,ne){var H=v.exec($.slice(ne));return H?(q.m=y.get(H[0].toLowerCase()),ne+H[0].length):-1}function D(q,$,ne){var H=g.exec($.slice(ne));return H?(q.m=p.get(H[0].toLowerCase()),ne+H[0].length):-1}function O(q,$,ne){return _(q,n,$,ne)}function R(q,$,ne){return _(q,e,$,ne)}function z(q,$,ne){return _(q,o,$,ne)}function L(q){return a[q.getDay()]}function P(q){return r[q.getDay()]}function N(q){return c[q.getMonth()]}function B(q){return u[q.getMonth()]}function G(q){return f[+(q.getHours()>=12)]}function W(q){return 1+~~(q.getMonth()/3)}function K(q){return a[q.getUTCDay()]}function te(q){return r[q.getUTCDay()]}function Y(q){return c[q.getUTCMonth()]}function Z(q){return u[q.getUTCMonth()]}function re(q){return f[+(q.getUTCHours()>=12)]}function U(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var $=b(q+="",x);return $.toString=function(){return q},$},parse:function(q){var $=T(q+="",!1);return $.toString=function(){return q},$},utcFormat:function(q){var $=b(q+="",w);return $.toString=function(){return q},$},utcParse:function(q){var $=T(q+="",!0);return $.toString=function(){return q},$}}}var PC={"-":"",_:" ","0":"0"},cl=/^\s*\d+/,OY=/^%/,LY=/[\\^$*+?|[\]().{}]/g;function Ya(t,n,e){var o=t<0?"-":"",f=(o?-t:t)+"",r=f.length;return o+(r[n.toLowerCase(),e]))}function DY(t,n,e){var o=cl.exec(n.slice(e,e+1));return o?(t.w=+o[0],e+o[0].length):-1}function IY(t,n,e){var o=cl.exec(n.slice(e,e+1));return o?(t.u=+o[0],e+o[0].length):-1}function zY(t,n,e){var o=cl.exec(n.slice(e,e+2));return o?(t.U=+o[0],e+o[0].length):-1}function RY(t,n,e){var o=cl.exec(n.slice(e,e+2));return o?(t.V=+o[0],e+o[0].length):-1}function FY(t,n,e){var o=cl.exec(n.slice(e,e+2));return o?(t.W=+o[0],e+o[0].length):-1}function DC(t,n,e){var o=cl.exec(n.slice(e,e+4));return o?(t.y=+o[0],e+o[0].length):-1}function IC(t,n,e){var o=cl.exec(n.slice(e,e+2));return o?(t.y=+o[0]+(+o[0]>68?1900:2e3),e+o[0].length):-1}function NY(t,n,e){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return o?(t.Z=o[1]?0:-(o[2]+(o[3]||"00")),e+o[0].length):-1}function BY(t,n,e){var o=cl.exec(n.slice(e,e+1));return o?(t.q=o[0]*3-3,e+o[0].length):-1}function jY(t,n,e){var o=cl.exec(n.slice(e,e+2));return o?(t.m=o[0]-1,e+o[0].length):-1}function zC(t,n,e){var o=cl.exec(n.slice(e,e+2));return o?(t.d=+o[0],e+o[0].length):-1}function UY(t,n,e){var o=cl.exec(n.slice(e,e+3));return o?(t.m=0,t.d=+o[0],e+o[0].length):-1}function RC(t,n,e){var o=cl.exec(n.slice(e,e+2));return o?(t.H=+o[0],e+o[0].length):-1}function VY(t,n,e){var o=cl.exec(n.slice(e,e+2));return o?(t.M=+o[0],e+o[0].length):-1}function qY(t,n,e){var o=cl.exec(n.slice(e,e+2));return o?(t.S=+o[0],e+o[0].length):-1}function HY(t,n,e){var o=cl.exec(n.slice(e,e+3));return o?(t.L=+o[0],e+o[0].length):-1}function $Y(t,n,e){var o=cl.exec(n.slice(e,e+6));return o?(t.L=Math.floor(o[0]/1e3),e+o[0].length):-1}function GY(t,n,e){var o=OY.exec(n.slice(e,e+1));return o?e+o[0].length:-1}function WY(t,n,e){var o=cl.exec(n.slice(e));return o?(t.Q=+o[0],e+o[0].length):-1}function YY(t,n,e){var o=cl.exec(n.slice(e));return o?(t.s=+o[0],e+o[0].length):-1}function FC(t,n){return Ya(t.getDate(),n,2)}function XY(t,n){return Ya(t.getHours(),n,2)}function ZY(t,n){return Ya(t.getHours()%12||12,n,2)}function JY(t,n){return Ya(1+Bd.count(Wd(t),t),n,3)}function ZI(t,n){return Ya(t.getMilliseconds(),n,3)}function KY(t,n){return ZI(t,n)+"000"}function QY(t,n){return Ya(t.getMonth()+1,n,2)}function eX(t,n){return Ya(t.getMinutes(),n,2)}function tX(t,n){return Ya(t.getSeconds(),n,2)}function nX(t){var n=t.getDay();return n===0?7:n}function rX(t,n){return Ya(My.count(Wd(t)-1,t),n,2)}function JI(t){var n=t.getDay();return n>=4||n===0?Hv(t):Hv.ceil(t)}function iX(t,n){return t=JI(t),Ya(Hv.count(Wd(t),t)+(Wd(t).getDay()===4),n,2)}function aX(t){return t.getDay()}function oX(t,n){return Ya(ck.count(Wd(t)-1,t),n,2)}function sX(t,n){return Ya(t.getFullYear()%100,n,2)}function lX(t,n){return t=JI(t),Ya(t.getFullYear()%100,n,2)}function uX(t,n){return Ya(t.getFullYear()%1e4,n,4)}function cX(t,n){var e=t.getDay();return t=e>=4||e===0?Hv(t):Hv.ceil(t),Ya(t.getFullYear()%1e4,n,4)}function fX(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Ya(n/60|0,"0",2)+Ya(n%60,"0",2)}function NC(t,n){return Ya(t.getUTCDate(),n,2)}function hX(t,n){return Ya(t.getUTCHours(),n,2)}function dX(t,n){return Ya(t.getUTCHours()%12||12,n,2)}function pX(t,n){return Ya(1+jd.count(Yd(t),t),n,3)}function KI(t,n){return Ya(t.getUTCMilliseconds(),n,3)}function gX(t,n){return KI(t,n)+"000"}function mX(t,n){return Ya(t.getUTCMonth()+1,n,2)}function vX(t,n){return Ya(t.getUTCMinutes(),n,2)}function yX(t,n){return Ya(t.getUTCSeconds(),n,2)}function xX(t){var n=t.getUTCDay();return n===0?7:n}function bX(t,n){return Ya(Sy.count(Yd(t)-1,t),n,2)}function QI(t){var n=t.getUTCDay();return n>=4||n===0?$v(t):$v.ceil(t)}function _X(t,n){return t=QI(t),Ya($v.count(Yd(t),t)+(Yd(t).getUTCDay()===4),n,2)}function wX(t){return t.getUTCDay()}function kX(t,n){return Ya(fk.count(Yd(t)-1,t),n,2)}function TX(t,n){return Ya(t.getUTCFullYear()%100,n,2)}function AX(t,n){return t=QI(t),Ya(t.getUTCFullYear()%100,n,2)}function MX(t,n){return Ya(t.getUTCFullYear()%1e4,n,4)}function SX(t,n){var e=t.getUTCDay();return t=e>=4||e===0?$v(t):$v.ceil(t),Ya(t.getUTCFullYear()%1e4,n,4)}function EX(){return"+0000"}function BC(){return"%"}function jC(t){return+t}function UC(t){return Math.floor(+t/1e3)}var Og,qA,ez,HA,tz;CX({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"]});function CX(t){return Og=XI(t),qA=Og.format,ez=Og.parse,HA=Og.utcFormat,tz=Og.utcParse,Og}function fv(t){const n={};return e=>n[e]||(n[e]=t(e))}function OX(t,n){return e=>{const o=t(e),f=o.indexOf(n);if(f<0)return o;let r=LX(o,f);const a=rf;)if(o[r]!=="0"){++r;break}return o.slice(0,r)+a}}function LX(t,n){let e=t.lastIndexOf("e"),o;if(e>0)return e;for(e=t.length;--e>n;)if(o=t.charCodeAt(e),o>=48&&o<=57)return e+1}function nz(t){const n=fv(t.format),e=t.formatPrefix;return{format:n,formatPrefix:e,formatFloat(o){const f=K4(o||",");if(f.precision==null){switch(f.precision=12,f.type){case"%":f.precision-=2;break;case"e":f.precision-=1;break}return OX(n(f),n(".1f")(1)[1])}else return n(f)},formatSpan(o,f,r,a){a=K4(a??",f");const u=b0(o,f,r),c=Math.max(Math.abs(o),Math.abs(f));let i;if(a.precision==null)switch(a.type){case"s":return isNaN(i=HG(u,c))||(a.precision=i),e(a,c);case"":case"e":case"g":case"p":case"r":{isNaN(i=qG(u,c))||(a.precision=i-(a.type==="e"));break}case"f":case"%":{isNaN(i=VG(u))||(a.precision=i-(a.type==="%")*2);break}}return n(a)}}}let vk;rz();function rz(){return vk=nz({format:ND,formatPrefix:$G})}function iz(t){return nz(GG(t))}function y_(t){return arguments.length?vk=iz(t):vk}function VC(t,n,e){e=e||{},Ei(e)||Pr("Invalid time multi-format specifier: ".concat(e));const o=n(vc),f=n(ec),r=n(Qu),a=n(Du),u=n(Gs),c=n(jl),i=n(Pu),s=n(wl),l=t(e[hf]||".%L"),d=t(e[vc]||":%S"),h=t(e[ec]||"%I:%M"),m=t(e[Qu]||"%I %p"),g=t(e[Du]||e[Il]||"%a %d"),p=t(e[Gs]||"%b %d"),v=t(e[jl]||"%B"),y=t(e[Pu]||"%B"),x=t(e[wl]||"%Y");return w=>(o(w)bi(o)?n(o):VC(n,$m,o),utcFormat:o=>bi(o)?e(o):VC(e,Gm,o),timeParse:fv(t.parse),utcParse:fv(t.utcParse)}}let yk;oz();function oz(){return yk=az({format:qA,parse:ez,utcFormat:HA,utcParse:tz})}function sz(t){return az(XI(t))}function Gv(t){return arguments.length?yk=sz(t):yk}const xk=(t,n)=>pa({},t,n);function lz(t,n){const e=t?iz(t):y_(),o=n?sz(n):Gv();return xk(e,o)}function $A(t,n){const e=arguments.length;return e&&e!==2&&Pr("defaultLocale expects either zero or two arguments."),e?xk(y_(t),Gv(n)):xk(y_(),Gv())}function PX(){return rz(),oz(),$A()}const DX=/^(data:|([A-Za-z]+:)?\/\/)/,IX=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,zX=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,qC="file://";function RX(t,n){return e=>({options:e||{},sanitize:NX,load:FX,fileAccess:!!n,file:BX(n),http:UX(t)})}async function FX(t,n){const e=await this.sanitize(t,n),o=e.href;return e.localFile?this.file(o):this.http(o,n)}async function NX(t,n){n=pa({},this.options,n);const e=this.fileAccess,o={href:null};let f,r,a;const u=IX.test(t.replace(zX,""));(t==null||typeof t!="string"||!u)&&Pr("Sanitize failure, invalid URI: "+oi(t));const c=DX.test(t);return(a=n.baseURL)&&!c&&(!t.startsWith("/")&&!a.endsWith("/")&&(t="/"+t),t=a+t),r=(f=t.startsWith(qC))||n.mode==="file"||n.mode!=="http"&&!c&&e,f?t=t.slice(qC.length):t.startsWith("//")&&(n.defaultProtocol==="file"?(t=t.slice(2),r=!0):t=(n.defaultProtocol||"http")+":"+t),Object.defineProperty(o,"localFile",{value:!!r}),o.href=t,n.target&&(o.target=n.target+""),n.rel&&(o.rel=n.rel+""),n.context==="image"&&n.crossOrigin&&(o.crossOrigin=n.crossOrigin+""),o}function BX(t){return t?n=>new Promise((e,o)=>{t.readFile(n,(f,r)=>{f?o(f):e(r)})}):jX}async function jX(){Pr("No file system access.")}function UX(t){return t?async function(n,e){const o=pa({},this.options.http,e),f=e&&e.response,r=await t(n,o);return r.ok?ga(r[f])?r[f]():r.text():Pr(r.status+""+r.statusText)}:VX}async function VX(){Pr("No HTTP fetch method available.")}const qX=t=>t!=null&&t===t,HX=t=>t==="true"||t==="false"||t===!0||t===!1,$X=t=>!Number.isNaN(Date.parse(t)),uz=t=>!Number.isNaN(+t)&&!(t instanceof Date),GX=t=>uz(t)&&Number.isInteger(+t),bk={boolean:LA,integer:Rl,number:Rl,date:PA,string:DA,unknown:Hl},Qx=[HX,GX,uz,$X],WX=["boolean","integer","number","date"];function cz(t,n){if(!t||!t.length)return"unknown";const e=t.length,o=Qx.length,f=Qx.map((r,a)=>a+1);for(let r=0,a=0,u,c;rr===0?a:r,0)-1]}function fz(t,n){return n.reduce((e,o)=>(e[o]=cz(t,o),e),{})}function HC(t){const n=function(e,o){const f={delimiter:t};return GA(e,o?pa(o,f):f)};return n.responseType="text",n}function GA(t,n){return n.header&&(t=n.header.map(oi).join(n.delimiter)+` +`+t),cW(n.delimiter).parse(t+"")}GA.responseType="text";function YX(t){return typeof Buffer=="function"&&ga(Buffer.isBuffer)?Buffer.isBuffer(t):!1}function WA(t,n){const e=n&&n.property?Lu(n.property):Hl;return Ei(t)&&!YX(t)?XX(e(t),n):e(JSON.parse(t))}WA.responseType="json";function XX(t,n){return!Ir(t)&&cI(t)&&(t=[...t]),n&&n.copy?JSON.parse(JSON.stringify(t)):t}const ZX={interior:(t,n)=>t!==n,exterior:(t,n)=>t===n};function hz(t,n){let e,o,f,r;return t=WA(t,n),n&&n.feature?(e=HW,f=n.feature):n&&n.mesh?(e=GW,f=n.mesh,r=ZX[n.filter]):Pr("Missing TopoJSON feature or mesh parameter."),o=(o=t.objects[f])?e(t,o,r):Pr("Invalid TopoJSON object: "+f),o&&o.features||[o]}hz.responseType="json";const Bb={dsv:GA,csv:HC(","),tsv:HC(" "),json:WA,topojson:hz};function YA(t,n){return arguments.length>1?(Bb[t]=n,this):qi(Bb,t)?Bb[t]:null}function dz(t){const n=YA(t);return n&&n.responseType||"text"}function pz(t,n,e,o){n=n||{};const f=YA(n.type||"json");return f||Pr("Unknown data format type: "+n.type),t=f(t,n),n.parse&&JX(t,n.parse,e,o),qi(t,"columns")&&delete t.columns,t}function JX(t,n,e,o){if(!t.length)return;const f=Gv();e=e||f.timeParse,o=o||f.utcParse;let r=t.columns||Object.keys(t[0]),a,u,c,i,s,l;n==="auto"&&(n=fz(t,r)),r=Object.keys(n);const d=r.map(h=>{const m=n[h];let g,p;if(m&&(m.startsWith("date:")||m.startsWith("utc:")))return g=m.split(/:(.+)?/,2),p=g[1],(p[0]==="'"&&p[p.length-1]==="'"||p[0]==='"'&&p[p.length-1]==='"')&&(p=p.slice(1,-1)),(g[0]==="utc"?o:e)(p);if(!bk[m])throw Error("Illegal format pattern: "+h+":"+m);return bk[m]});for(c=0,s=t.length,l=r.length;c{const r=n(f);return o[r]||(o[r]=1,e.push(f)),e},e.remove=f=>{const r=n(f);if(o[r]){o[r]=0;const a=e.indexOf(f);a>=0&&e.splice(a,1)}return e},e}async function jb(t,n){try{await n(t)}catch(e){t.error(e)}}const gz=Symbol("vega_id");let KX=1;function tw(t){return!!(t&&$i(t))}function $i(t){return t[gz]}function mz(t,n){return t[gz]=n,t}function ro(t){const n=t===Object(t)?t:{data:t};return $i(n)?n:mz(n,KX++)}function XA(t){return nw(t,ro({}))}function nw(t,n){for(const e in t)n[e]=t[e];return n}function vz(t,n){return mz(n,$i(t))}function H0(t,n){return t?n?(e,o)=>t(e,o)||$i(n(e))-$i(n(o)):(e,o)=>t(e,o)||$i(e)-$i(o):null}function yz(t){return t&&t.constructor===$0}function $0(){const t=[],n=[],e=[],o=[],f=[];let r=null,a=!1;return{constructor:$0,insert(u){const c=ki(u),i=c.length;for(let s=0;s{m(y)&&(i[$i(y)]=-1)});for(l=0,d=t.length;l0&&(v(g,m,h.value),u.modifies(m));for(l=0,d=f.length;l{m(y)&&i[$i(y)]>0&&v(y,h.field,h.value)}),u.modifies(h.field);if(a)u.mod=n.length||o.length?c.filter(y=>i[$i(y)]>0):c.slice();else for(p in s)u.mod.push(s[p]);return(r||r==null&&(n.length||o.length))&&u.clean(!0),u}}}const Ub="_:mod:_";function rw(){Object.defineProperty(this,Ub,{writable:!0,value:{}})}rw.prototype={set(t,n,e,o){const f=this,r=f[t],a=f[Ub];return n!=null&&n>=0?(r[n]!==e||o)&&(r[n]=e,a[n+":"+t]=-1,a[t]=-1):(r!==e||o)&&(f[t]=e,a[t]=Ir(e)?1+e.length:-1),f},modified(t,n){const e=this[Ub];if(arguments.length){if(Ir(t)){for(let o=0;o=0?n+1{h instanceof Co?(h!==this&&(n&&h.targets().add(this),r.push(h)),f.push({op:h,name:l,index:d})):o.set(l,d,h)};for(a in t)if(u=t[a],a===eZ)ki(u).forEach(l=>{l instanceof Co?l!==this&&(l.targets().add(this),r.push(l)):Pr("Pulse parameters must be operator instances.")}),this.source=u;else if(Ir(u))for(o.set(a,-1,Array(c=u.length)),i=0;i{const e=Date.now();return e-n>t?(n=e,1):0})},debounce(t){const n=xd();return this.targets().add(xd(null,null,CA(t,e=>{const o=e.dataflow;n.receive(e),o&&o.run&&o.run()}))),n},between(t,n){let e=!1;return t.targets().add(xd(null,null,()=>e=!0)),n.targets().add(xd(null,null,()=>e=!1)),this.filter(()=>e)},detach(){this._filter=mc,this._targets=null}};function sZ(t,n,e,o){const f=this,r=xd(e,o),a=function(i){i.dataflow=f;try{r.receive(i)}catch(s){f.error(s)}finally{f.run()}};let u;typeof t=="string"&&typeof document<"u"?u=document.querySelectorAll(t):u=ki(t);const c=u.length;for(let i=0;in=o);return e.requests=0,e.done=()=>{--e.requests===0&&(t._pending=null,n(t))},t._pending=e}const dZ={skip:!0};function pZ(t,n,e,o,f){return(t instanceof Co?mZ:gZ)(this,t,n,e,o,f),this}function gZ(t,n,e,o,f,r){const a=pa({},r,dZ);let u,c;ga(e)||(e=$l(e)),o===void 0?u=i=>t.touch(e(i)):ga(o)?(c=new Co(null,o,f,!1),u=i=>{c.evaluate(i);const s=e(i),l=c.value;yz(l)?t.pulse(s,l,r):t.update(s,l,a)}):u=i=>t.update(e(i),o,a),n.apply(u)}function mZ(t,n,e,o,f,r){if(o===void 0)n.targets().add(e);else{const a=r||{},u=new Co(null,vZ(e,o),f,!1);u.modified(a.force),u.rank=n.rank,n.targets().add(u),e&&(u.skip(!0),u.value=e.value,u.targets().add(e),t.connect(e,[u]))}}function vZ(t,n){return n=ga(n)?n:$l(n),t?function(e,o){const f=n(e,o);return t.skip()||(t.skip(f!==this.value).value=f),f}:n}function yZ(t){t.rank=++this._rank}function xZ(t){const n=[t];let e,o,f;for(;n.length;)if(this.rank(e=n.pop()),o=e._targets)for(f=o.length;--f>=0;)n.push(e=o[f]),e===t&&Pr("Cycle detected in dataflow graph.")}const x_={},Df=1<<0,wd=1<<1,Eh=1<<2,bZ=Df|wd,GC=Df|Eh,Lg=Df|wd|Eh,WC=1<<3,N1=1<<4,YC=1<<5,XC=1<<6;function Ud(t,n,e){this.dataflow=t,this.stamp=n??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=e||null}function I5(t,n){const e=[];return _d(t,n,o=>e.push(o)),e}function ZC(t,n){const e={};return t.visit(n,o=>{e[$i(o)]=1}),o=>e[$i(o)]?null:o}function eb(t,n){return t?(e,o)=>t(e,o)&&n(e,o):n}Ud.prototype={StopPropagation:x_,ADD:Df,REM:wd,MOD:Eh,ADD_REM:bZ,ADD_MOD:GC,ALL:Lg,REFLOW:WC,SOURCE:N1,NO_SOURCE:YC,NO_FIELDS:XC,fork(t){return new Ud(this.dataflow).init(this,t)},clone(){const t=this.fork(Lg);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(Lg|N1)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new Ud(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,n){const e=this;return e.stamp=t.stamp,e.encode=t.encode,t.fields&&!(n&XC)&&(e.fields=t.fields),n&Df?(e.addF=t.addF,e.add=t.add):(e.addF=null,e.add=[]),n&wd?(e.remF=t.remF,e.rem=t.rem):(e.remF=null,e.rem=[]),n&Eh?(e.modF=t.modF,e.mod=t.mod):(e.modF=null,e.mod=[]),n&YC?(e.srcF=null,e.source=null):(e.srcF=t.srcF,e.source=t.source,t.cleans&&(e.cleans=t.cleans)),e},runAfter(t){this.dataflow.runAfter(t)},changed(t){const n=t||Lg;return n&Df&&this.add.length||n&wd&&this.rem.length||n&Eh&&this.mod.length},reflow(t){if(t)return this.fork(Lg).reflow();const n=this.add.length,e=this.source&&this.source.length;return e&&e!==n&&(this.mod=this.source,n&&this.filter(Eh,ZC(this,Df))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const n=this.fields||(this.fields={});return Ir(t)?t.forEach(e=>n[e]=!0):n[t]=!0,this},modified(t,n){const e=this.fields;return(n||this.mod.length)&&e?arguments.length?Ir(t)?t.some(o=>e[o]):e[t]:!!e:!1},filter(t,n){const e=this;return t&Df&&(e.addF=eb(e.addF,n)),t&wd&&(e.remF=eb(e.remF,n)),t&Eh&&(e.modF=eb(e.modF,n)),t&N1&&(e.srcF=eb(e.srcF,n)),e},materialize(t){t=t||Lg;const n=this;return t&Df&&n.addF&&(n.add=I5(n.add,n.addF),n.addF=null),t&wd&&n.remF&&(n.rem=I5(n.rem,n.remF),n.remF=null),t&Eh&&n.modF&&(n.mod=I5(n.mod,n.modF),n.modF=null),t&N1&&n.srcF&&(n.source=n.source.filter(n.srcF),n.srcF=null),n},visit(t,n){const e=this,o=n;if(t&N1)return _d(e.source,e.srcF,o),e;t&Df&&_d(e.add,e.addF,o),t&wd&&_d(e.rem,e.remF,o),t&Eh&&_d(e.mod,e.modF,o);const f=e.source;if(t&WC&&f){const r=e.add.length+e.mod.length;r===f.length||(r?_d(f,ZC(e,GC),o):_d(f,e.srcF,o))}return e}};function ZA(t,n,e,o){const f=this,r=e.length;let a=0;this.dataflow=t,this.stamp=n,this.fields=null,this.encode=o||null,this.pulses=e;for(let u=0;un.add.push(e)),t&n.REM&&this.visit(n.REM,e=>n.rem.push(e)),t&n.MOD&&this.visit(n.MOD,e=>n.mod.push(e))),n},changed(t){return this.changes&t},modified(t){const n=this,e=n.fields;return e&&n.changes&n.MOD?Ir(t)?t.some(o=>e[o]):e[t]:0},filter(){Pr("MultiPulse does not support filtering.")},materialize(){Pr("MultiPulse does not support materialization.")},visit(t,n){const e=this,o=e.pulses,f=o.length;let r=0;if(t&e.SOURCE)for(;ro._enqueue(s,!0)),o._touched=ew(Ty);let a=0,u,c,i;try{for(;o._heap.size()>0;){if(u=o._heap.pop(),u.rank!==u.qrank){o._enqueue(u,!0);continue}c=u.run(o._getPulse(u,t)),c.then?c=await c:c.async&&(f.push(c.async),c=x_),c!==x_&&u._targets&&u._targets.forEach(s=>o._enqueue(s)),++a}}catch(s){o._heap.clear(),i=s}if(o._input={},o._pulse=null,o.debug(`Pulse ${r}: ${a} operators`),i&&(o._postrun=[],o.error(i)),o._postrun.length){const s=o._postrun.sort((l,d)=>d.priority-l.priority);o._postrun=[];for(let l=0;lo.runAsync(null,()=>{s.forEach(l=>{try{l(o)}catch(d){o.error(d)}})})),o}async function wZ(t,n,e){for(;this._running;)await this._running;const o=()=>this._running=null;return(this._running=this.evaluate(t,n,e)).then(o,o),this._running}function kZ(t,n,e){return this._pulse?xz(this):(this.evaluate(t,n,e),this)}function TZ(t,n,e){if(this._pulse||n)this._postrun.push({priority:e||0,callback:t});else try{t(this)}catch(o){this.error(o)}}function xz(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}function AZ(t,n){const e=t.stampf.pulse),n):this._input[t.id]||SZ(this._pulse,e&&e.pulse)}function SZ(t,n){return n&&n.stamp===t.stamp?n:(t=t.fork(),n&&n!==x_&&(t.source=n.source),t)}const JA={skip:!1,force:!1};function EZ(t,n){const e=n||JA;return this._pulse?this._enqueue(t):this._touched.add(t),e.skip&&t.skip(!0),this}function CZ(t,n,e){const o=e||JA;return(t.set(n)||o.force)&&this.touch(t,o),this}function OZ(t,n,e){this.touch(t,e||JA);const o=new Ud(this,this._clock+(this._pulse?0:1)),f=t.pulse&&t.pulse.source||[];return o.target=t,this._input[t.id]=n.pulse(o,f),this}function LZ(t){let n=[];return{clear:()=>n=[],size:()=>n.length,peek:()=>n[0],push:e=>(n.push(e),bz(n,0,n.length-1,t)),pop:()=>{const e=n.pop();let o;return n.length?(o=n[0],n[0]=e,PZ(n,0,t)):o=e,o}}}function bz(t,n,e,o){let f,r;const a=t[e];for(;e>n;){if(r=e-1>>1,f=t[r],o(a,f)<0){t[e]=f,e=r;continue}break}return t[e]=a}function PZ(t,n,e){const o=n,f=t.length,r=t[n];let a=(n<<1)+1,u;for(;a=0&&(a=u),t[n]=t[a],n=a,a=(n<<1)+1;return t[n]=r,bz(t,o,n,e)}function Qg(){this.logger(TA()),this.logLevel(wA),this._clock=0,this._rank=0,this._locale=$A();try{this._loader=Q2()}catch{}this._touched=ew(Ty),this._input={},this._pulse=null,this._heap=LZ((t,n)=>t.qrank-n.qrank),this._postrun=[]}function B1(t){return function(){return this._log[t].apply(this,arguments)}}Qg.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:B1("error"),warn:B1("warn"),info:B1("info"),debug:B1("debug"),logLevel:B1("level"),cleanThreshold:1e4,add:iZ,connect:aZ,rank:yZ,rerank:xZ,pulse:OZ,touch:EZ,update:CZ,changeset:$0,ingest:uZ,parse:lZ,preload:fZ,request:cZ,events:sZ,on:pZ,evaluate:_Z,run:kZ,runAsync:wZ,runAfter:TZ,_enqueue:AZ,_getPulse:MZ};function _r(t,n){Co.call(this,t,null,n)}ni(_r,Co,{run(t){if(t.stampthis.pulse=e):n!==t.StopPropagation&&(this.pulse=n),n},evaluate(t){const n=this.marshall(t.stamp),e=this.transform(n,t);return n.clear(),e},transform(){}});const cm={};function _z(t){const n=wz(t);return n&&n.Definition||null}function wz(t){return t=t&&t.toLowerCase(),qi(cm,t)?cm[t]:null}function*kz(t,n){if(n==null)for(let e of t)e!=null&&e!==""&&(e=+e)>=e&&(yield e);else{let e=-1;for(let o of t)o=n(o,++e,t),o!=null&&o!==""&&(o=+o)>=o&&(yield o)}}function KA(t,n,e){const o=Float64Array.from(kz(t,e));return o.sort(Vv),n.map(f=>kI(o,f))}function QA(t,n){return KA(t,[.25,.5,.75],n)}function e6(t,n){const e=t.length,o=ZW(t,n),f=QA(t,n),r=(f[2]-f[0])/1.34,a=Math.min(o,r)||o||Math.abs(f[0])||1;return 1.06*a*Math.pow(e,-.2)}function Tz(t){const n=t.maxbins||20,e=t.base||10,o=Math.log(e),f=t.divide||[5,2];let r=t.extent[0],a=t.extent[1],u,c,i,s,l,d;const h=t.span||a-r||Math.abs(r)||1;if(t.step)u=t.step;else if(t.steps){for(s=h/n,l=0,d=t.steps.length;ln;)u*=e;for(l=0,d=f.length;l=i&&h/s<=n&&(u=s)}s=Math.log(u);const m=s>=0?0:~~(-s/o)+1,g=Math.pow(e,-m-1);return(t.nice||t.nice===void 0)&&(s=Math.floor(r/u+g)*u,r=rd);const f=t.length,r=new Float64Array(f);let a=0,u=1,c=o(t[0]),i=c,s=c+n,l;for(;u=s){for(i=(c+i)/2;a>1);af;)t[a--]=t[o]}o=f,f=r}return t}function zZ(t){return function(){return t=(1103515245*t+12345)%2147483647,t/2147483647}}function RZ(t,n){n==null&&(n=t,t=0);let e,o,f;const r={min(a){return arguments.length?(e=a||0,f=o-e,r):e},max(a){return arguments.length?(o=a||0,f=o-e,r):o},sample(){return e+Math.floor(f*yc())},pdf(a){return a===Math.floor(a)&&a>=e&&a=o?1:(u-e+1)/f},icdf(a){return a>=0&&a<=1?e-1+Math.floor(a*f):NaN}};return r.min(t).max(n)}const Sz=Math.sqrt(2*Math.PI),FZ=Math.SQRT2;let j1=NaN;function aw(t,n){t=t||0,n=n??1;let e=0,o=0,f,r;if(j1===j1)e=j1,j1=NaN;else{do e=yc()*2-1,o=yc()*2-1,f=e*e+o*o;while(f===0||f>1);r=Math.sqrt(-2*Math.log(f)/f),e*=r,j1=o*r}return t+e*n}function t6(t,n,e){e=e??1;const o=(t-(n||0))/e;return Math.exp(-.5*o*o)/(e*Sz)}function ow(t,n,e){n=n||0,e=e??1;const o=(t-n)/e,f=Math.abs(o);let r;if(f>37)r=0;else{const a=Math.exp(-f*f/2);let u;f<7.07106781186547?(u=.0352624965998911*f+.700383064443688,u=u*f+6.37396220353165,u=u*f+33.912866078383,u=u*f+112.079291497871,u=u*f+221.213596169931,u=u*f+220.206867912376,r=a*u,u=.0883883476483184*f+1.75566716318264,u=u*f+16.064177579207,u=u*f+86.7807322029461,u=u*f+296.564248779674,u=u*f+637.333633378831,u=u*f+793.826512519948,u=u*f+440.413735824752,r=r/u):(u=f+.65,u=f+4/u,u=f+3/u,u=f+2/u,u=f+1/u,r=a/u/2.506628274631)}return o>0?1-r:r}function sw(t,n,e){return t<0||t>1?NaN:(n||0)+(e??1)*FZ*NZ(2*t-1)}function NZ(t){let n=-Math.log((1-t)*(1+t)),e;return n<6.25?(n-=3.125,e=-364441206401782e-35,e=-16850591381820166e-35+e*n,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=-1333171662854621e-31+e*n,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=-4054566272975207e-29+e*n,e=-8151934197605472e-29+e*n,e=26335093153082323e-28+e*n,e=-12975133253453532e-27+e*n,e=-5415412054294628e-26+e*n,e=10512122733215323e-25+e*n,e=-4112633980346984e-24+e*n,e=-29070369957882005e-24+e*n,e=42347877827932404e-23+e*n,e=-13654692000834679e-22+e*n,e=-13882523362786469e-21+e*n,e=.00018673420803405714+e*n,e=-.000740702534166267+e*n,e=-.006033670871430149+e*n,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=22137376921775787e-25,e=9075656193888539e-23+e*n,e=-27517406297064545e-23+e*n,e=18239629214389228e-24+e*n,e=15027403968909828e-22+e*n,e=-4013867526981546e-21+e*n,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=-47318229009055734e-21+e*n,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=-.0003550375203628475+e*n,e=.0009532893797373805+e*n,e=-.0016882755560235047+e*n,e=.002491442096107851+e*n,e=-.003751208507569241+e*n,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=-2555641816996525e-25+e*n,e=15076572693500548e-25+e*n,e=-3789465440126737e-24+e*n,e=761570120807834e-23+e*n,e=-1496002662714924e-23+e*n,e=2914795345090108e-23+e*n,e=-6771199775845234e-23+e*n,e=22900482228026655e-23+e*n,e=-99298272942317e-20+e*n,e=4526062597223154e-21+e*n,e=-1968177810553167e-20+e*n,e=7599527703001776e-20+e*n,e=-.00021503011930044477+e*n,e=-.00013871931833623122+e*n,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0,e*t}function n6(t,n){let e,o;const f={mean(r){return arguments.length?(e=r||0,f):e},stdev(r){return arguments.length?(o=r??1,f):o},sample:()=>aw(e,o),pdf:r=>t6(r,e,o),cdf:r=>ow(r,e,o),icdf:r=>sw(r,e,o)};return f.mean(t).stdev(n)}function r6(t,n){const e=n6();let o=0;const f={data(r){return arguments.length?(t=r,o=r?r.length:0,f.bandwidth(n)):t},bandwidth(r){return arguments.length?(n=r,!n&&t&&(n=e6(t)),f):n},sample(){return t[~~(yc()*o)]+n*e.sample()},pdf(r){let a=0,u=0;for(;ui6(e,o),pdf:r=>a6(r,e,o),cdf:r=>o6(r,e,o),icdf:r=>s6(r,e,o)};return f.mean(t).stdev(n)}function Cz(t,n){let e=0,o;function f(a){const u=[];let c=0,i;for(i=0;i=n&&t<=e?1/(e-n):0}function c6(t,n,e){return e==null&&(e=n??1,n=0),te?1:(t-n)/(e-n)}function f6(t,n,e){return e==null&&(e=n??1,n=0),t>=0&&t<=1?n+t*(e-n):NaN}function Oz(t,n){let e,o;const f={min(r){return arguments.length?(e=r||0,f):e},max(r){return arguments.length?(o=r??1,f):o},sample:()=>l6(e,o),pdf:r=>u6(r,e,o),cdf:r=>c6(r,e,o),icdf:r=>f6(r,e,o)};return n==null&&(n=t??1,t=0),f.min(t).max(n)}function Ey(t,n,e,o){const f=o-t*t,r=Math.abs(f)<1e-24?0:(e-t*n)/f;return[n-r*t,r]}function lw(t,n,e,o){t=t.filter(h=>{let m=n(h),g=e(h);return m!=null&&(m=+m)>=m&&g!=null&&(g=+g)>=g}),o&&t.sort((h,m)=>n(h)-n(m));const f=t.length,r=new Float64Array(f),a=new Float64Array(f);let u=0,c=0,i=0,s,l,d;for(d of t)r[u]=s=+n(d),a[u]=l=+e(d),++u,c+=(s-c)/u,i+=(l-i)/u;for(u=0;u=r&&a!=null&&(a=+a)>=a&&o(r,a,++f)}function Wm(t,n,e,o,f){let r=0,a=0;return Cy(t,n,e,(u,c)=>{const i=c-f(u),s=c-o;r+=i*i,a+=s*s}),1-r/a}function h6(t,n,e){let o=0,f=0,r=0,a=0,u=0;Cy(t,n,e,(s,l)=>{++u,o+=(s-o)/u,f+=(l-f)/u,r+=(s*l-r)/u,a+=(s*s-a)/u});const c=Ey(o,f,r,a),i=s=>c[0]+c[1]*s;return{coef:c,predict:i,rSquared:Wm(t,n,e,f,i)}}function Lz(t,n,e){let o=0,f=0,r=0,a=0,u=0;Cy(t,n,e,(s,l)=>{++u,s=Math.log(s),o+=(s-o)/u,f+=(l-f)/u,r+=(s*l-r)/u,a+=(s*s-a)/u});const c=Ey(o,f,r,a),i=s=>c[0]+c[1]*Math.log(s);return{coef:c,predict:i,rSquared:Wm(t,n,e,f,i)}}function Pz(t,n,e){const[o,f,r,a]=lw(t,n,e);let u=0,c=0,i=0,s=0,l=0,d,h,m;Cy(t,n,e,(y,x)=>{d=o[l++],h=Math.log(x),m=d*x,u+=(x*h-u)/l,c+=(m-c)/l,i+=(m*h-i)/l,s+=(d*m-s)/l});const[g,p]=Ey(c/a,u/a,i/a,s/a),v=y=>Math.exp(g+p*(y-r));return{coef:[Math.exp(g-p*r),p],predict:v,rSquared:Wm(t,n,e,a,v)}}function Dz(t,n,e){let o=0,f=0,r=0,a=0,u=0,c=0;Cy(t,n,e,(l,d)=>{const h=Math.log(l),m=Math.log(d);++c,o+=(h-o)/c,f+=(m-f)/c,r+=(h*m-r)/c,a+=(h*h-a)/c,u+=(d-u)/c});const i=Ey(o,f,r,a),s=l=>i[0]*Math.pow(l,i[1]);return i[0]=Math.exp(i[0]),{coef:i,predict:s,rSquared:Wm(t,n,e,u,s)}}function d6(t,n,e){const[o,f,r,a]=lw(t,n,e),u=o.length;let c=0,i=0,s=0,l=0,d=0,h,m,g,p;for(h=0;h(T=T-r,x*T*T+w*T+k+a);return{coef:[k-w*r+x*r*r+a,w-2*x*r,x],predict:b,rSquared:Wm(t,n,e,a,b)}}function Iz(t,n,e,o){if(o===1)return h6(t,n,e);if(o===2)return d6(t,n,e);const[f,r,a,u]=lw(t,n,e),c=f.length,i=[],s=[],l=o+1;let d,h,m,g,p;for(d=0;d{x-=a;let w=u+v[0]+v[1]*x+v[2]*x*x;for(d=3;d=0;--r)for(u=n[r],c=1,f[r]+=u,a=1;a<=r;++a)c*=(r+1-a)/a,f[r-a]+=u*Math.pow(e,a)*c;return f[0]+=o,f}function jZ(t){const n=t.length-1,e=[];let o,f,r,a,u;for(o=0;oMath.abs(t[o][a])&&(a=f);for(r=o;r=o;r--)t[r][f]-=t[r][o]*t[o][f]/t[o][o]}for(f=n-1;f>=0;--f){for(u=0,r=f+1;rf[x]-v?y:x;let k=0,b=0,T=0,_=0,M=0;const A=1/Math.abs(f[w]-v||1);for(let D=y;D<=x;++D){const O=f[D],R=r[D],z=UZ(Math.abs(v-O)*A)*d[D],L=O*z;k+=z,b+=L,T+=R*z,_+=R*L,M+=O*L}const[S,E]=Ey(b/k,T/k,_/k,M/k);s[p]=S+E*v,l[p]=Math.abs(r[p]-s[p]),VZ(f,p+1,m)}if(h===JC)break;const g=TI(l);if(Math.abs(g)=1?KC:(y=1-v*v)*y}return qZ(f,s,a,u)}function UZ(t){return(t=1-t*t*t)*t*t}function VZ(t,n,e){const o=t[n];let f=e[0],r=e[1]+1;if(!(r>=t.length))for(;n>f&&t[r]-o<=o-t[f];)e[0]=++f,e[1]=r,++r}function qZ(t,n,e,o){const f=t.length,r=[];let a=0,u=0,c=[],i;for(;a[g,t(g)],r=n[0],a=n[1],u=a-r,c=u/o,i=[f(r)],s=[];if(e===o){for(let g=1;g0;)s.push(f(r+g/e*u))}let l=i[0],d=s[s.length-1];const h=1/u,m=$Z(l[1],s);for(;d;){const g=f((l[0]+d[0])/2);g[0]-l[0]>=c&&GZ(l,g,d,h,m)>HZ?s.push(g):(l=d,i.push(d),s.pop()),d=s[s.length-1]}return i}function $Z(t,n){let e=t,o=t;const f=n.length;for(let r=0;ro&&(o=a)}return 1/(o-e)}function GZ(t,n,e,o,f){const r=Math.atan2(f*(e[1]-t[1]),o*(e[0]-t[0])),a=Math.atan2(f*(n[1]-t[1]),o*(n[0]-t[0]));return Math.abs(r-a)}function WZ(t){return n=>{const e=t.length;let o=1,f=String(t[0](n));for(;o{},YZ={init:z5,add:z5,rem:z5,idx:0},Wv={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,n)=>t.sum+=+n,rem:(t,n)=>t.sum-=n},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,n)=>t.product*=n,rem:(t,n)=>t.product/=n},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,n)=>(t.mean_d=n-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,n)=>(t.mean_d=n-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,n)=>t.dev+=t.mean_d*(n-t.mean),rem:(t,n)=>t.dev-=t.mean_d*(n-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,n)=>{(n{n<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,n)=>{(n>t.max||t.max===void 0)&&(t.max=n)},rem:(t,n)=>{n>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,n,e)=>{n{n<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,n,e)=>{n>t.max&&(t.argmax=e)},rem:(t,n)=>{n>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3}},Oy=Object.keys(Wv);function XZ(t,n){return e=>pa({name:t,out:e||t},YZ,n)}Oy.forEach(t=>{Wv[t]=XZ(t,Wv[t])});function Fz(t,n){return Wv[t](n)}function Nz(t,n){return t.idx-n.idx}function ZZ(t){const n={};t.forEach(o=>n[o.name]=o);const e=o=>{!o.req||o.req.forEach(f=>{n[f]||e(n[f]=Wv[f]())})};return t.forEach(e),Object.values(n).sort(Nz)}function JZ(){this.valid=0,this.missing=0,this._ops.forEach(t=>t.init(this))}function KZ(t,n){if(t==null||t===""){++this.missing;return}t===t&&(++this.valid,this._ops.forEach(e=>e.add(this,t,n)))}function QZ(t,n){if(t==null||t===""){--this.missing;return}t===t&&(--this.valid,this._ops.forEach(e=>e.rem(this,t,n)))}function eJ(t){return this._out.forEach(n=>t[n.out]=n.value(this)),t}function Bz(t,n){const e=n||Hl,o=ZZ(t),f=t.slice().sort(Nz);function r(a){this._ops=o,this._out=f,this.cell=a,this.init()}return r.prototype.init=JZ,r.prototype.add=KZ,r.prototype.rem=QZ,r.prototype.set=eJ,r.prototype.get=e,r.fields=t.map(a=>a.out),r}function p6(t){this._key=t?Lu(t):$i,this.reset()}const Tl=p6.prototype;Tl.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Tl.add=function(t){this._add.push(t)};Tl.rem=function(t){this._rem.push(t)};Tl.values=function(){if(this._get=null,this._rem.length===0)return this._add;const t=this._add,n=this._rem,e=this._key,o=t.length,f=n.length,r=Array(o-f),a={};let u,c,i;for(u=0;u=0;)r=t(n[o])+"",qi(e,r)||(e[r]=1,++f);return f};Tl.extent=function(t){if(this._get!==t||!this._ext){const n=this.values(),e=lI(n,t);this._ext=[n[e[0]],n[e[1]]],this._get=t}return this._ext};Tl.argmin=function(t){return this.extent(t)[0]||{}};Tl.argmax=function(t){return this.extent(t)[1]||{}};Tl.min=function(t){const n=this.extent(t)[0];return n!=null?t(n):void 0};Tl.max=function(t){const n=this.extent(t)[1];return n!=null?t(n):void 0};Tl.quartile=function(t){return(this._get!==t||!this._q)&&(this._q=QA(this.values(),t),this._get=t),this._q};Tl.q1=function(t){return this.quartile(t)[0]};Tl.q2=function(t){return this.quartile(t)[1]};Tl.q3=function(t){return this.quartile(t)[2]};Tl.ci=function(t){return(this._get!==t||!this._ci)&&(this._ci=Az(this.values(),1e3,.05,t),this._get=t),this._ci};Tl.ci0=function(t){return this.ci(t)[0]};Tl.ci1=function(t){return this.ci(t)[1]};function Xd(t){_r.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Xd.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Oy},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};ni(Xd,_r,{transform(t,n){const e=this,o=n.fork(n.NO_SOURCE|n.NO_FIELDS),f=t.modified();return e.stamp=o.stamp,e.value&&(f||n.modified(e._inputs,!0))?(e._prev=e.value,e.value=f?e.init(t):{},n.visit(n.SOURCE,r=>e.add(r))):(e.value=e.value||e.init(t),n.visit(n.REM,r=>e.rem(r)),n.visit(n.ADD,r=>e.add(r))),o.modifies(e._outputs),e._drop=t.drop!==!1,t.cross&&e._dims.length>1&&(e._drop=!1,e.cross()),n.clean()&&e._drop&&o.clean(!0).runAfter(()=>this.clean()),e.changes(o)},cross(){const t=this,n=t.value,e=t._dnames,o=e.map(()=>({})),f=e.length;function r(u){let c,i,s,l;for(c in u)for(s=u[c].tuple,i=0;i{const v=xs(p);return f(p),e.push(v),v}),this.cellkey=t.key?t.key:_k(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const r=t.fields||[null],a=t.ops||["count"],u=t.as||[],c=r.length,i={};let s,l,d,h,m,g;for(c!==a.length&&Pr("Unmatched number of fields and aggregate ops."),g=0;gBz(p,p.field)),{}},cellkey:_k(),cell(t,n){let e=this.value[t];return e?e.num===0&&this._drop&&e.stamp{const l=o(s);s[u]=l,s[c]=l==null?null:f+r*(1+(l-f)/r)}:s=>s[u]=o(s)),n.modifies(e?a:u)},_bins(t){if(this.value&&!t.modified())return this.value;const n=t.field,e=Tz(t),o=e.step;let f=e.start,r=f+Math.ceil((e.stop-f)/o)*o,a,u;(a=t.anchor)!=null&&(u=a-(f+o*Math.floor((a-f)/o)),f+=u,r+=u);const c=function(i){let s=Rl(n(i));return s==null?null:sr?1/0:(s=Math.max(f,Math.min(s,r-o)),f+o*Math.floor(tJ+(s-f)/o))};return c.start=f,c.stop=e.stop,c.step=o,this.value=Nu(c,Bl(n),t.name||"bin_"+xs(n))}});function jz(t,n,e){const o=t;let f=n||[],r=e||[],a={},u=0;return{add:c=>r.push(c),remove:c=>a[o(c)]=++u,size:()=>f.length,data:(c,i)=>(u&&(f=f.filter(s=>!a[o(s)]),a={},u=0),i&&c&&f.sort(c),r.length&&(f=c?pI(c,f,r.sort(c)):f.concat(r),r=[]),f)}}function m6(t){_r.call(this,[],t)}m6.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};ni(m6,_r,{transform(t,n){const e=n.fork(n.ALL),o=jz($i,this.value,e.materialize(e.ADD).add),f=t.sort,r=n.changed()||f&&(t.modified("sort")||n.modified(f.fields));return e.visit(e.REM,o.remove),this.modified(r),this.value=e.source=o.data(H0(f),r),n.source&&n.source.root&&(this.value.root=n.source.root),e}});function Uz(t){Co.call(this,null,nJ,t)}ni(Uz,Co);function nJ(t){return this.value&&!t.modified()?this.value:EA(t.fields,t.orders)}function v6(t){_r.call(this,null,t)}v6.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function rJ(t,n,e){switch(n){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break}return t.match(e)}ni(v6,_r,{transform(t,n){const e=l=>d=>{for(var h=rJ(u(d),t.case,r)||[],m,g=0,p=h.length;gf[l]=1+(f[l]||0)),s=e(l=>f[l]-=1);return o?n.visit(n.SOURCE,i):(n.visit(n.ADD,i),n.visit(n.REM,s)),this._finish(n,c)},_parameterCheck(t,n){let e=!1;return(t.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),e=!0),(t.modified("pattern")||!this._match)&&(this._match=new RegExp(t.pattern||"[\\w']+","g"),e=!0),(t.modified("field")||n.modified(t.field.fields))&&(e=!0),e&&(this._counts={}),e},_finish(t,n){const e=this._counts,o=this._tuples||(this._tuples={}),f=n[0],r=n[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let u,c,i;for(u in e)c=o[u],i=e[u]||0,!c&&i?(o[u]=c=ro({}),c[f]=u,c[r]=i,a.add.push(c)):i===0?(c&&a.rem.push(c),e[u]=null,o[u]=null):c[r]!==i&&(c[r]=i,a.mod.push(c));return a.modifies(n)}});function y6(t){_r.call(this,null,t)}y6.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};ni(y6,_r,{transform(t,n){const e=n.fork(n.NO_SOURCE),o=t.as||["a","b"],f=o[0],r=o[1],a=!this.value||n.changed(n.ADD_REM)||t.modified("as")||t.modified("filter");let u=this.value;return a?(u&&(e.rem=u),u=n.materialize(n.SOURCE).source,e.add=this.value=iJ(u,f,r,t.filter||mc)):e.mod=u,e.source=this.value,e.modifies(o)}});function iJ(t,n,e,o){for(var f=[],r={},a=t.length,u=0,c,i;uVz(r,n))):typeof o[f]===e7&&o[f](t[f]);return o}function x6(t){_r.call(this,null,t)}const qz=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],sJ={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:qz},{name:"weights",type:"number",array:!0}]};x6.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:qz.concat(sJ)},{name:"as",type:"string",array:!0,default:["value","density"]}]};ni(x6,_r,{transform(t,n){const e=n.fork(n.NO_SOURCE|n.NO_FIELDS);if(!this.value||n.changed()||t.modified()){const o=Vz(t.distribution,lJ(n)),f=t.steps||t.minsteps||25,r=t.steps||t.maxsteps||200;let a=t.method||"pdf";a!=="pdf"&&a!=="cdf"&&Pr("Invalid density method: "+a),!t.extent&&!o.data&&Pr("Missing density extent parameter."),a=o[a];const u=t.as||["value","density"],c=t.extent||Zf(o.data()),i=uw(a,c,f,r).map(s=>{const l={};return l[u[0]]=s[0],l[u[1]]=s[1],ro(l)});this.value&&(e.rem=this.value),this.value=e.add=e.source=i}return e}});function lJ(t){return()=>t.materialize(t.SOURCE).source}function Hz(t,n){return t?t.map((e,o)=>n[o]||xs(e)):null}function b6(t,n,e){const o=[],f=l=>l(c);let r,a,u,c,i,s;if(n==null)o.push(t.map(e));else for(r={},a=0,u=t.length;aAy(Zf(t,n))/30;ni(_6,_r,{transform(t,n){if(this.value&&!(t.modified()||n.changed()))return n;const e=n.materialize(n.SOURCE).source,o=b6(n.source,t.groupby,Hl),f=t.smooth||!1,r=t.field,a=t.step||uJ(e,r),u=H0((m,g)=>r(m)-r(g)),c=t.as||$z,i=o.length;let s=1/0,l=-1/0,d=0,h;for(;dl&&(l=g),m[++h][c]=g}return this.value={start:s,stop:l,step:a},n.reflow(!0).modifies(c)}});function Gz(t){Co.call(this,null,cJ,t),this.modified(!0)}ni(Gz,Co);function cJ(t){const n=t.expr;return this.value&&!t.modified("expr")?this.value:Nu(e=>n(e,t),Bl(n),xs(n))}function w6(t){_r.call(this,[void 0,void 0],t)}w6.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};ni(w6,_r,{transform(t,n){const e=this.value,o=t.field,f=n.changed()||n.modified(o.fields)||t.modified("field");let r=e[0],a=e[1];if((f||r==null)&&(r=1/0,a=-1/0),n.visit(f?n.SOURCE:n.ADD,u=>{const c=Rl(o(u));c!=null&&(ca&&(a=c))}),!Number.isFinite(r)||!Number.isFinite(a)){let u=xs(o);u&&(u=' for field "'.concat(u,'"')),n.dataflow.warn("Infinite extent".concat(u,": [").concat(r,", ").concat(a,"]")),r=a=void 0}this.value=[r,a]}});function k6(t,n){Co.call(this,t),this.parent=n,this.count=0}ni(k6,Co,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}});function cw(t){_r.call(this,{},t),this._keys=Hm();const n=this._targets=[];n.active=0,n.forEach=e=>{for(let o=0,f=n.active;oo&&o.count>0);this.initTargets(e)}},initTargets(t){const n=this._targets,e=n.length,o=t?t.length:0;let f=0;for(;fthis.subflow(c,f,n);return this._group=t.group||{},this.initTargets(),n.visit(n.REM,c=>{const i=$i(c),s=r.get(i);s!==void 0&&(r.delete(i),u(s).rem(c))}),n.visit(n.ADD,c=>{const i=o(c);r.set($i(c),i),u(i).add(c)}),a||n.modified(o.fields)?n.visit(n.MOD,c=>{const i=$i(c),s=r.get(i),l=o(c);s===l?u(l).mod(c):(r.set(i,l),u(s).rem(c),u(l).add(c))}):n.changed(n.MOD)&&n.visit(n.MOD,c=>{u(r.get($i(c))).mod(c)}),a&&n.visit(n.REFLOW,c=>{const i=$i(c),s=r.get(i),l=o(c);s!==l&&(r.set(i,l),u(s).rem(c),u(l).add(c))}),n.clean()?e.runAfter(()=>{this.clean(),r.clean()}):r.empty>e.cleanThreshold&&e.runAfter(r.clean),n}});function Wz(t){Co.call(this,null,fJ,t)}ni(Wz,Co);function fJ(t){return this.value&&!t.modified()?this.value:Ir(t.name)?ki(t.name).map(n=>Lu(n)):Lu(t.name,t.as)}function T6(t){_r.call(this,Hm(),t)}T6.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};ni(T6,_r,{transform(t,n){const e=n.dataflow,o=this.value,f=n.fork(),r=f.add,a=f.rem,u=f.mod,c=t.expr;let i=!0;n.visit(n.REM,l=>{const d=$i(l);o.has(d)?o.delete(d):a.push(l)}),n.visit(n.ADD,l=>{c(l,t)?r.push(l):o.set($i(l),1)});function s(l){const d=$i(l),h=c(l,t),m=o.get(d);h&&m?(o.delete(d),r.push(l)):!h&&!m?(o.set(d,1),a.push(l)):i&&h&&!m&&u.push(l)}return n.visit(n.MOD,s),t.modified()&&(i=!1,n.visit(n.REFLOW,s)),o.empty>e.cleanThreshold&&e.runAfter(o.clean),f}});function A6(t){_r.call(this,[],t)}A6.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};ni(A6,_r,{transform(t,n){const e=n.fork(n.NO_SOURCE),o=t.fields,f=Hz(o,t.as||[]),r=t.index||null,a=f.length;return e.rem=this.value,n.visit(n.SOURCE,u=>{const c=o.map(m=>m(u)),i=c.reduce((m,g)=>Math.max(m,g.length),0);let s=0,l,d,h;for(;s{for(let s=0,l;sa[o]=e(a,t))}});function Yz(t){_r.call(this,[],t)}ni(Yz,_r,{transform(t,n){const e=n.fork(n.ALL),o=t.generator;let f=this.value,r=t.size-f.length,a,u,c;if(r>0){for(a=[];--r>=0;)a.push(c=ro(o(t))),f.push(c);e.add=e.add.length?e.materialize(e.ADD).add.concat(a):a}else u=f.slice(0,-r),e.rem=e.rem.length?e.materialize(e.REM).rem.concat(u):u,f=f.slice(-r);return e.source=this.value=f,e}});const tb={value:"value",median:TI,mean:QW,min:sk,max:d0},hJ=[];function E6(t){_r.call(this,[],t)}E6.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function dJ(t){var n=t.method||tb.value,e;if(tb[n]==null)Pr("Unrecognized imputation method: "+n);else return n===tb.value?(e=t.value!==void 0?t.value:0,()=>e):tb[n]}function pJ(t){const n=t.field;return e=>e?n(e):NaN}ni(E6,_r,{transform(t,n){var e=n.fork(n.ALL),o=dJ(t),f=pJ(t),r=xs(t.field),a=xs(t.key),u=(t.groupby||[]).map(xs),c=gJ(n.source,t.groupby,t.key,t.keyvals),i=[],s=this.value,l=c.domain.length,d,h,m,g,p,v,y,x,w,k;for(p=0,x=c.length;pv(p),r=[],a=o?o.slice():[],u={},c={},i,s,l,d,h,m,g,p;for(a.forEach((v,y)=>u[v]=y+1),d=0,g=t.length;de.add(r))):(f=e.value=e.value||this.init(t),n.visit(n.REM,r=>e.rem(r)),n.visit(n.ADD,r=>e.add(r))),e.changes(),n.visit(n.SOURCE,r=>{pa(r,f[e.cellkey(r)].tuple)}),n.reflow(o).modifies(this._outputs)},changes(){const t=this._adds,n=this._mods;let e,o;for(e=0,o=this._alen;e{const m=r6(h,a)[u],g=t.counts?h.length:1,p=s||Zf(h);uw(m,p,l,d).forEach(v=>{const y={};for(let x=0;x(this._pending=ki(f.data),r=>r.touch(this)))}:e.request(t.url,t.format).then(o=>R5(this,n,ki(o.data)))}});function vJ(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}function R5(t,n,e){e.forEach(ro);const o=n.fork(n.NO_FIELDS&n.NO_SOURCE);return o.rem=t.value,t.value=o.source=o.add=e,t._pending=null,o.rem.length&&o.clean(!0),o}function L6(t){_r.call(this,{},t)}L6.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};ni(L6,_r,{transform(t,n){const e=t.fields,o=t.index,f=t.values,r=t.default==null?null:t.default,a=t.modified(),u=e.length;let c=a?n.SOURCE:n.ADD,i=n,s=t.as,l,d,h;return f?(d=f.length,u>1&&!s&&Pr('Multi-field lookup requires explicit "as" parameter.'),s&&s.length!==u*d&&Pr('The "as" parameter has too few output field names.'),s=s||f.map(xs),l=function(m){for(var g=0,p=0,v,y;gn.modified(m.fields)),c|=h?n.MOD:0),n.visit(c,l),i.modifies(s)}});function Jz(t){Co.call(this,null,yJ,t)}ni(Jz,Co);function yJ(t){if(this.value&&!t.modified())return this.value;const n=t.extents,e=n.length;let o=1/0,f=-1/0,r,a;for(r=0;rf&&(f=a[1]);return[o,f]}function Kz(t){Co.call(this,null,xJ,t)}ni(Kz,Co);function xJ(t){return this.value&&!t.modified()?this.value:t.values.reduce((n,e)=>n.concat(e),[])}function Qz(t){_r.call(this,null,t)}ni(Qz,_r,{transform(t,n){return this.modified(t.modified()),this.value=t,n.fork(n.NO_SOURCE|n.NO_FIELDS)}});function P6(t){Xd.call(this,t)}P6.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Oy,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};ni(P6,Xd,{_transform:Xd.prototype.transform,transform(t,n){return this._transform(bJ(t,n),n)}});function bJ(t,n){const e=t.field,o=t.value,f=(t.op==="count"?"__count__":t.op)||"sum",r=Bl(e).concat(Bl(o)),a=wJ(e,t.limit||0,n);return n.changed()&&t.set("__pivot__",null,null,!0),{key:t.key,groupby:t.groupby,ops:a.map(()=>f),fields:a.map(u=>_J(u,e,o,r)),as:a.map(u=>u+""),modified:t.modified.bind(t)}}function _J(t,n,e,o){return Nu(f=>n(f)===t?e(f):NaN,o,t+"")}function wJ(t,n,e){const o={},f=[];return e.visit(e.SOURCE,r=>{const a=t(r);o[a]||(o[a]=1,f.push(a))}),f.sort(J2),n?f.slice(0,n):f}function eR(t){cw.call(this,t)}ni(eR,cw,{transform(t,n){const e=t.subflow,o=t.field,f=r=>this.subflow($i(r),e,n,r);return(t.modified("field")||o&&n.modified(Bl(o)))&&Pr("PreFacet does not support field modification."),this.initTargets(),o?(n.visit(n.MOD,r=>{const a=f(r);o(r).forEach(u=>a.mod(u))}),n.visit(n.ADD,r=>{const a=f(r);o(r).forEach(u=>a.add(ro(u)))}),n.visit(n.REM,r=>{const a=f(r);o(r).forEach(u=>a.rem(u))})):(n.visit(n.MOD,r=>f(r).mod(r)),n.visit(n.ADD,r=>f(r).add(r)),n.visit(n.REM,r=>f(r).rem(r))),n.clean()&&n.runAfter(()=>this.clean()),n}});function D6(t){_r.call(this,null,t)}D6.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};ni(D6,_r,{transform(t,n){const e=n.fork(n.NO_SOURCE),o=t.fields,f=Hz(t.fields,t.as||[]),r=o?(u,c)=>kJ(u,c,o,f):nw;let a;return this.value?a=this.value:(n=n.addAll(),a=this.value={}),n.visit(n.REM,u=>{const c=$i(u);e.rem.push(a[c]),a[c]=null}),n.visit(n.ADD,u=>{const c=r(u,ro({}));a[$i(u)]=c,e.add.push(c)}),n.visit(n.MOD,u=>{e.mod.push(r(u,a[$i(u)]))}),e}});function kJ(t,n,e,o){for(let f=0,r=e.length;f{const d=KA(l,i);for(let h=0;h{const r=$i(f);e.rem.push(o[r]),o[r]=null}),n.visit(n.ADD,f=>{const r=XA(f);o[$i(f)]=r,e.add.push(r)}),n.visit(n.MOD,f=>{const r=o[$i(f)];for(const a in f)r[a]=f[a],e.modifies(a);e.mod.push(r)})),e}});function z6(t){_r.call(this,[],t),this.count=0}z6.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};ni(z6,_r,{transform(t,n){const e=n.fork(n.NO_SOURCE),o=t.modified("size"),f=t.size,r=this.value.reduce((s,l)=>(s[$i(l)]=1,s),{});let a=this.value,u=this.count,c=0;function i(s){let l,d;a.length=c&&(l=a[d],r[$i(l)]&&e.rem.push(l),a[d]=s)),++u}if(n.rem.length&&(n.visit(n.REM,s=>{const l=$i(s);r[l]&&(r[l]=-1,e.rem.push(s)),--u}),a=a.filter(s=>r[$i(s)]!==-1)),(n.rem.length||o)&&a.length{r[$i(s)]||i(s)}),c=-1),o&&a.length>f){const s=a.length-f;for(let l=0;l{r[$i(s)]&&e.mod.push(s)}),n.add.length&&n.visit(n.ADD,i),(n.add.length||c<0)&&(e.add=a.filter(s=>!r[$i(s)])),this.count=u,this.value=e.source=a,e}});function R6(t){_r.call(this,null,t)}R6.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};ni(R6,_r,{transform(t,n){if(this.value&&!t.modified())return;const e=n.materialize().fork(n.MOD),o=t.as||"data";return e.rem=this.value?n.rem.concat(this.value):n.rem,this.value=Ju(t.start,t.stop,t.step||1).map(f=>{const r={};return r[o]=f,ro(r)}),e.add=n.add.concat(this.value),e}});function rR(t){_r.call(this,null,t),this.modified(!0)}ni(rR,_r,{transform(t,n){return this.value=n.source,n.changed()?n.fork(n.NO_SOURCE|n.NO_FIELDS):n.StopPropagation}});function F6(t){_r.call(this,null,t)}const iR=["unit0","unit1"];F6.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:jA,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:iR}]};ni(F6,_r,{transform(t,n){const e=t.field,o=t.interval!==!1,f=t.timezone==="utc",r=this._floor(t,n),a=(f?Gm:$m)(r.unit).offset,u=t.as||iR,c=u[0],i=u[1],s=r.step;let l=r.start||1/0,d=r.stop||-1/0,h=n.ADD;return(t.modified()||n.changed(n.REM)||n.modified(Bl(e)))&&(n=n.reflow(!0),h=n.SOURCE,l=1/0,d=-1/0),n.visit(h,m=>{const g=e(m);let p,v;g==null?(m[c]=null,o&&(m[i]=null)):(m[c]=p=v=r(g),o&&(m[i]=v=a(p,s)),pd&&(d=v))}),r.start=l,r.stop=d,n.modifies(o?u:c)},_floor(t,n){const e=t.timezone==="utc",{units:o,step:f}=t.units?{units:t.units,step:t.step||1}:YI({extent:t.extent||Zf(n.materialize(n.SOURCE).source,t.field),maxbins:t.maxbins}),r=UA(o),a=this.value||{},u=(e?BI:NI)(r,f);return u.unit=Na(r),u.units=r,u.step=f,u.start=a.start,u.stop=a.stop,this.value=u}});function aR(t){_r.call(this,Hm(),t)}ni(aR,_r,{transform(t,n){const e=n.dataflow,o=t.field,f=this.value,r=u=>f.set(o(u),u);let a=!0;return t.modified("field")||n.modified(o.fields)?(f.clear(),n.visit(n.SOURCE,r)):n.changed()?(n.visit(n.REM,u=>f.delete(o(u))),n.visit(n.ADD,r)):a=!1,this.modified(a),f.empty>e.cleanThreshold&&e.runAfter(f.clean),n.fork()}});function oR(t){_r.call(this,null,t)}ni(oR,_r,{transform(t,n){(!this.value||t.modified("field")||t.modified("sort")||n.changed()||t.sort&&n.modified(t.sort.fields))&&(this.value=(t.sort?n.source.slice().sort(H0(t.sort)):n.source).map(t.field))}});function AJ(t,n,e,o){const f=Yv[t](n,e);return{init:f.init||Md,update:function(r,a){a[o]=f.next(r)}}}const Yv={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:n=>{const e=n.index,o=n.data;return e&&n.compare(o[e-1],o[e])?t=e+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:n=>{const e=n.index,o=n.data;return e&&n.compare(o[e-1],o[e])?++t:t}}},percent_rank:function(){const t=Yv.rank(),n=t.next;return{init:t.init,next:e=>(n(e)-1)/(e.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:n=>{const e=n.data,o=n.compare;let f=n.index;if(t0||Pr("ntile num must be greater than zero.");const e=Yv.cume_dist(),o=e.next;return{init:e.init,next:f=>Math.ceil(n*o(f))}},lag:function(t,n){return n=+n||1,{next:e=>{const o=e.index-n;return o>=0?t(e.data[o]):null}}},lead:function(t,n){return n=+n||1,{next:e=>{const o=e.index+n,f=e.data;return ot(n.data[n.i0])}},last_value:function(t){return{next:n=>t(n.data[n.i1-1])}},nth_value:function(t,n){return n=+n,n>0||Pr("nth_value nth must be greater than zero."),{next:e=>{const o=e.i0+(n-1);return on=null,next:e=>{const o=t(e.data[e.index]);return o!=null?n=o:n}}},next_value:function(t){let n,e;return{init:()=>(n=null,e=-1),next:o=>{const f=o.data;return o.index<=e?n:(e=MJ(t,f,o.index))<0?(e=f.length,n=null):n=t(f[e])}}}};function MJ(t,n,e){for(let o=n.length;eu[m]=1)}d(t.sort),n.forEach((h,m)=>{const g=e[m],p=xs(g),v=Rz(h,p,f[m]);if(d(g),r.push(v),qi(Yv,h))a.push(AJ(h,e[m],o[m],v));else{if(g==null&&h!=="count"&&Pr("Null aggregate field specified."),h==="count"){i.push(v);return}l=!1;let y=c[p];y||(y=c[p]=[],y.field=g,s.push(y)),y.push(Fz(h,v))}}),(i.length||s.length)&&(this.cell=EJ(s,i,l)),this.inputs=Object.keys(u)}const lR=sR.prototype;lR.init=function(){this.windows.forEach(t=>t.init()),this.cell&&this.cell.init()};lR.update=function(t,n){const e=this.cell,o=this.windows,f=t.data,r=o&&o.length;let a;if(e){for(a=t.p0;aBz(c,c.field));const o={num:0,agg:null,store:!1,count:n};if(!e)for(var f=t.length,r=o.agg=Array(f),a=0;athis.group(f(u));let a=this.state;(!a||e)&&(a=this.state=new sR(t)),e||n.modified(a.inputs)?(this.value={},n.visit(n.SOURCE,u=>r(u).add(u))):(n.visit(n.REM,u=>r(u).remove(u)),n.visit(n.ADD,u=>r(u).add(u)));for(let u=0,c=this._mlen;u0&&!f(r[e],r[e-1])&&(t.i0=n.left(r,r[e])),o1?0:t<-1?fm:Math.acos(t)}function n7(t){return t>=1?b_:t<=-1?-b_:Math.asin(t)}function zJ(t){return t.innerRadius}function RJ(t){return t.outerRadius}function FJ(t){return t.startAngle}function NJ(t){return t.endAngle}function BJ(t){return t&&t.padAngle}function jJ(t,n,e,o,f,r,a,u){var c=e-t,i=o-n,s=a-f,l=u-r,d=l*c-s*i;if(!(d*dO*O+R*R&&(_=A,M=S),{cx:_,cy:M,x01:-s,y01:-l,x11:_*(f/k-1),y11:M*(f/k-1)}}function UJ(){var t=zJ,n=RJ,e=Yo(0),o=null,f=FJ,r=NJ,a=BJ,u=null;function c(){var i,s,l=+t.apply(this,arguments),d=+n.apply(this,arguments),h=f.apply(this,arguments)-b_,m=r.apply(this,arguments)-b_,g=t7(m-h),p=m>h;if(u||(u=i=Bm()),dLl))u.moveTo(0,0);else if(g>uR-Ll)u.moveTo(d*Np(h),d*Of(h)),u.arc(0,0,d,h,m,!p),l>Ll&&(u.moveTo(l*Np(m),l*Of(m)),u.arc(0,0,l,m,h,p));else{var v=h,y=m,x=h,w=m,k=g,b=g,T=a.apply(this,arguments)/2,_=T>Ll&&(o?+o.apply(this,arguments):i0(l*l+d*d)),M=F5(t7(d-l)/2,+e.apply(this,arguments)),A=M,S=M,E,D;if(_>Ll){var O=n7(_/l*Of(T)),R=n7(_/d*Of(T));(k-=O*2)>Ll?(O*=p?1:-1,x+=O,w-=O):(k=0,x=w=(h+m)/2),(b-=R*2)>Ll?(R*=p?1:-1,v+=R,y-=R):(b=0,v=y=(h+m)/2)}var z=d*Np(v),L=d*Of(v),P=l*Np(w),N=l*Of(w);if(M>Ll){var B=d*Np(y),G=d*Of(y),W=l*Np(x),K=l*Of(x),te;if(gLl?S>Ll?(E=nb(W,K,z,L,d,S,p),D=nb(B,G,P,N,d,S,p),u.moveTo(E.cx+E.x01,E.cy+E.y01),SLl)||!(k>Ll)?u.lineTo(P,N):A>Ll?(E=nb(P,N,B,G,l,-A,p),D=nb(z,L,W,K,l,-A,p),u.lineTo(E.cx+E.x01,E.cy+E.y01),A=d;--h)u.point(y[h],x[h]);u.lineEnd(),u.areaEnd()}p&&(y[l]=+t(g,l,s),x[l]=+n(g,l,s),u.point(o?+o(g,l,s):y[l],e?+e(g,l,s):x[l]))}if(v)return u=null,v+""||null}function i(){return BD().defined(f).curve(a).context(r)}return c.x=function(s){return arguments.length?(t=typeof s=="function"?s:Yo(+s),o=null,c):t},c.x0=function(s){return arguments.length?(t=typeof s=="function"?s:Yo(+s),c):t},c.x1=function(s){return arguments.length?(o=s==null?null:typeof s=="function"?s:Yo(+s),c):o},c.y=function(s){return arguments.length?(n=typeof s=="function"?s:Yo(+s),e=null,c):n},c.y0=function(s){return arguments.length?(n=typeof s=="function"?s:Yo(+s),c):n},c.y1=function(s){return arguments.length?(e=s==null?null:typeof s=="function"?s:Yo(+s),c):e},c.lineX0=c.lineY0=function(){return i().x(t).y(n)},c.lineY1=function(){return i().x(t).y(e)},c.lineX1=function(){return i().x(o).y(n)},c.defined=function(s){return arguments.length?(f=typeof s=="function"?s:Yo(!!s),c):f},c.curve=function(s){return arguments.length?(a=s,r!=null&&(u=a(r)),c):a},c.context=function(s){return arguments.length?(s==null?r=u=null:u=a(r=s),c):r},c}var VJ={draw(t,n){const e=i0(n/fm);t.moveTo(e,0),t.arc(0,0,e,0,uR)}};function qJ(t,n){let e=null;t=typeof t=="function"?t:Yo(t||VJ),n=typeof n=="function"?n:Yo(n===void 0?64:+n);function o(){let f;if(e||(e=f=Bm()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),f)return e=null,f+""||null}return o.type=function(f){return arguments.length?(t=typeof f=="function"?f:Yo(f),o):t},o.size=function(f){return arguments.length?(n=typeof f=="function"?f:Yo(+f),o):n},o.context=function(f){return arguments.length?(e=f??null,o):e},o}function Zd(){}function __(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function fw(t){this._context=t}fw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:__(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:__(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function HJ(t){return new fw(t)}function fR(t){this._context=t}fR.prototype={areaStart:Zd,areaEnd:Zd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:__(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function $J(t){return new fR(t)}function hR(t){this._context=t}hR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,o=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,o):this._context.moveTo(e,o);break;case 3:this._point=4;default:__(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function GJ(t){return new hR(t)}function dR(t,n){this._basis=new fw(t),this._beta=n}dR.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var o=t[0],f=n[0],r=t[e]-o,a=n[e]-f,u=-1,c;++u<=e;)c=u/e,this._basis.point(this._beta*t[u]+(1-this._beta)*(o+c*r),this._beta*n[u]+(1-this._beta)*(f+c*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var WJ=function t(n){function e(o){return n===1?new fw(o):new dR(o,n)}return e.beta=function(o){return t(+o)},e}(.85);function w_(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function B6(t,n){this._context=t,this._k=(1-n)/6}B6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:w_(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:w_(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var YJ=function t(n){function e(o){return new B6(o,n)}return e.tension=function(o){return t(+o)},e}(0);function j6(t,n){this._context=t,this._k=(1-n)/6}j6.prototype={areaStart:Zd,areaEnd:Zd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:w_(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var XJ=function t(n){function e(o){return new j6(o,n)}return e.tension=function(o){return t(+o)},e}(0);function U6(t,n){this._context=t,this._k=(1-n)/6}U6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:w_(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var ZJ=function t(n){function e(o){return new U6(o,n)}return e.tension=function(o){return t(+o)},e}(0);function V6(t,n,e){var o=t._x1,f=t._y1,r=t._x2,a=t._y2;if(t._l01_a>Ll){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);o=(o*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,f=(f*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Ll){var i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*i+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*i+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(o,f,r,a,t._x2,t._y2)}function pR(t,n){this._context=t,this._alpha=n}pR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,o=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:V6(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var JJ=function t(n){function e(o){return n?new pR(o,n):new B6(o,0)}return e.alpha=function(o){return t(+o)},e}(.5);function gR(t,n){this._context=t,this._alpha=n}gR.prototype={areaStart:Zd,areaEnd:Zd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,o=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:V6(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var KJ=function t(n){function e(o){return n?new gR(o,n):new j6(o,0)}return e.alpha=function(o){return t(+o)},e}(.5);function mR(t,n){this._context=t,this._alpha=n}mR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,o=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+o*o,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:V6(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var QJ=function t(n){function e(o){return n?new mR(o,n):new U6(o,0)}return e.alpha=function(o){return t(+o)},e}(.5);function vR(t){this._context=t}vR.prototype={areaStart:Zd,areaEnd:Zd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};function eK(t){return new vR(t)}function r7(t){return t<0?-1:1}function i7(t,n,e){var o=t._x1-t._x0,f=n-t._x1,r=(t._y1-t._y0)/(o||f<0&&-0),a=(e-t._y1)/(f||o<0&&-0),u=(r*f+a*o)/(o+f);return(r7(r)+r7(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(u))||0}function a7(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function N5(t,n,e){var o=t._x0,f=t._y0,r=t._x1,a=t._y1,u=(r-o)/3;t._context.bezierCurveTo(o+u,f+u*n,r-u,a-u*e,r,a)}function k_(t){this._context=t}k_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:N5(this,this._t0,a7(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,!(t===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,N5(this,a7(this,e=i7(this,t,n)),e);break;default:N5(this,this._t0,e=i7(this,t,n));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}};function yR(t){this._context=new xR(t)}(yR.prototype=Object.create(k_.prototype)).point=function(t,n){k_.prototype.point.call(this,n,t)};function xR(t){this._context=t}xR.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,o,f,r){this._context.bezierCurveTo(n,t,o,e,r,f)}};function tK(t){return new k_(t)}function nK(t){return new yR(t)}function bR(t){this._context=t}bR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),e===2)this._context.lineTo(t[1],n[1]);else for(var o=o7(t),f=o7(n),r=0,a=1;a=0;--n)f[n]=(a[n]-f[n+1])/r[n];for(r[e-1]=(t[e]+f[e-1])/2,n=0;n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}break}}this._x=t,this._y=n}};function iK(t){return new hw(t,.5)}function aK(t){return new hw(t,0)}function oK(t){return new hw(t,1)}function Vd(t,n){if(typeof document<"u"&&document.createElement){const e=document.createElement("canvas");if(e&&e.getContext)return e.width=t,e.height=n,e}return null}const sK=()=>typeof Image<"u"?Image:null,wk=Symbol("implicit");function q6(){var t=new EC,n=[],e=[],o=wk;function f(r){let a=t.get(r);if(a===void 0){if(o!==wk)return o;t.set(r,a=n.push(r)-1)}return e[a%e.length]}return f.domain=function(r){if(!arguments.length)return n.slice();n=[],t=new EC;for(const a of r)t.has(a)||t.set(a,n.push(a)-1);return f},f.range=function(r){return arguments.length?(e=Array.from(r),f):e.slice()},f.unknown=function(r){return arguments.length?(o=r,f):o},f.copy=function(){return q6(n,e).unknown(o)},Zh.apply(f,arguments),f}const _R=Math.PI/180,wR=180/Math.PI,T_=18,kR=.96422,TR=1,AR=.82521,MR=4/29,em=6/29,SR=3*em*em,lK=em*em*em;function ER(t){if(t instanceof $f)return new $f(t.l,t.a,t.b,t.opacity);if(t instanceof Rh)return CR(t);t instanceof q2||(t=UD(t));var n=V5(t.r),e=V5(t.g),o=V5(t.b),f=B5((.2225045*n+.7168786*e+.0606169*o)/TR),r,a;return n===e&&e===o?r=a=f:(r=B5((.4360747*n+.3850649*e+.1430804*o)/kR),a=B5((.0139322*n+.0971045*e+.7141733*o)/AR)),new $f(116*f-16,500*(r-f),200*(f-a),t.opacity)}function A_(t,n,e,o){return arguments.length===1?ER(t):new $f(t,n,e,o??1)}function $f(t,n,e,o){this.l=+t,this.a=+n,this.b=+e,this.opacity=+o}mA($f,A_,vA(yA,{brighter:function(t){return new $f(this.l+T_*(t??1),this.a,this.b,this.opacity)},darker:function(t){return new $f(this.l-T_*(t??1),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return n=kR*j5(n),t=TR*j5(t),e=AR*j5(e),new q2(U5(3.1338561*n-1.6168667*t-.4906146*e),U5(-.9787684*n+1.9161415*t+.033454*e),U5(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}}));function B5(t){return t>lK?Math.pow(t,1/3):t/SR+MR}function j5(t){return t>em?t*t*t:SR*(t-MR)}function U5(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function V5(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function uK(t){if(t instanceof Rh)return new Rh(t.h,t.c,t.l,t.opacity);if(t instanceof $f||(t=ER(t)),t.a===0&&t.b===0)return new Rh(NaN,0180?s+=360:s-i>180&&(i+=360),d.push({i:l.push(f(l)+"rotate(",null,o)-2,x:Xp(i,s)})):s&&l.push(f(l)+"rotate("+s+o)}function u(i,s,l,d){i!==s?d.push({i:l.push(f(l)+"skewX(",null,o)-2,x:Xp(i,s)}):s&&l.push(f(l)+"skewX("+s+o)}function c(i,s,l,d,h,m){if(i!==l||s!==d){var g=h.push(f(h)+"scale(",null,",",null,")");m.push({i:g-4,x:Xp(i,l)},{i:g-2,x:Xp(s,d)})}else(l!==1||d!==1)&&h.push(f(h)+"scale("+l+","+d+")")}return function(i,s){var l=[],d=[];return i=t(i),s=t(s),r(i.translateX,i.translateY,s.translateX,s.translateY,l,d),a(i.rotate,s.rotate,l,d),u(i.skewX,s.skewX,l,d),c(i.scaleX,i.scaleY,s.scaleX,s.scaleY,l,d),i=s=null,function(h){for(var m=-1,g=d.length,p;++mMath.pow(t,n)}function IK(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),n=>Math.log(n)/t)}function p7(t){return(n,e)=>-t(-n,e)}function W6(t){const n=t(h7,d7),e=n.domain;let o=10,f,r;function a(){return f=IK(o),r=DK(o),e()[0]<0?(f=p7(f),r=p7(r),t(OK,LK)):t(h7,d7),n}return n.base=function(u){return arguments.length?(o=+u,a()):o},n.domain=function(u){return arguments.length?(e(u),a()):e()},n.ticks=u=>{const c=e();let i=c[0],s=c[c.length-1];const l=s0){for(;d<=h;++d)for(m=1;ms)break;v.push(g)}}else for(;d<=h;++d)for(m=o-1;m>=1;--m)if(g=d>0?m/r(-d):m*r(d),!(gs)break;v.push(g)}v.length*2{if(u==null&&(u=10),c==null&&(c=o===10?"s":","),typeof c!="function"&&(!(o%1)&&(c=K4(c)).precision==null&&(c.trim=!0),c=ND(c)),u===1/0)return c;const i=Math.max(1,o*u/n.ticks().length);return s=>{let l=s/r(Math.round(f(s)));return l*oe(FR(e(),{floor:u=>r(Math.floor(f(u))),ceil:u=>r(Math.ceil(f(u)))})),n}function NR(){const t=W6(xA()).domain([1,10]);return t.copy=()=>G2(t,NR()).base(t.base()),Zh.apply(t,arguments),t}function g7(t){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))}}function m7(t){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}function Y6(t){var n=1,e=t(g7(n),m7(n));return e.constant=function(o){return arguments.length?t(g7(n=+o),m7(n)):n},jm(e)}function BR(){var t=Y6(xA());return t.copy=function(){return G2(t,BR()).constant(t.constant())},Zh.apply(t,arguments)}function v7(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function zK(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function RK(t){return t<0?-t*t:t*t}function X6(t){var n=t(Ed,Ed),e=1;function o(){return e===1?t(Ed,Ed):e===.5?t(zK,RK):t(v7(e),v7(1/e))}return n.exponent=function(f){return arguments.length?(e=+f,o()):e},jm(n)}function Z6(){var t=X6(xA());return t.copy=function(){return G2(t,Z6()).exponent(t.exponent())},Zh.apply(t,arguments),t}function FK(){return Z6.apply(null,arguments).exponent(.5)}function jR(){var t=[],n=[],e=[],o;function f(){var a=0,u=Math.max(1,n.length);for(e=new Array(u-1);++a0?e[u-1]:t[0],u=e?[o[e-1],n]:[o[i-1],o[i]]},a.unknown=function(c){return arguments.length&&(r=c),a},a.thresholds=function(){return o.slice()},a.copy=function(){return UR().domain([t,n]).range(f).unknown(r)},Zh.apply(jm(a),arguments)}function VR(){var t=[.5],n=[0,1],e,o=1;function f(r){return r!=null&&r<=r?n[W2(t,r,0,o)]:e}return f.domain=function(r){return arguments.length?(t=Array.from(r),o=Math.min(t.length,n.length-1),f):t.slice()},f.range=function(r){return arguments.length?(n=Array.from(r),o=Math.min(t.length,n.length-1),f):n.slice()},f.invertExtent=function(r){var a=n.indexOf(r);return[t[a-1],t[a]]},f.unknown=function(r){return arguments.length?(e=r,f):e},f.copy=function(){return VR().domain(t).range(n).unknown(e)},Zh.apply(f,arguments)}function NK(t){return new Date(t)}function BK(t){return t instanceof Date?+t:+new Date(+t)}function J6(t,n,e,o,f,r,a,u,c,i){var s=oW(),l=s.invert,d=s.domain,h=i(".%L"),m=i(":%S"),g=i("%I:%M"),p=i("%I %p"),v=i("%a %d"),y=i("%b %d"),x=i("%B"),w=i("%Y");function k(b){return(c(b)0?o:1:0}const HK="identity",hm="linear",Wh="log",Ly="pow",Py="sqrt",mw="symlog",w0="time",k0="utc",Gf="sequential",Ym="diverging",dm="quantile",vw="quantize",yw="threshold",nM="ordinal",Ak="point",YR="band",rM="bin-ordinal",Xs="continuous",Dy="discrete",Iy="discretizing",kc="interpolating",iM="temporal";function $K(t){return function(n){let e=n[0],o=n[1],f;return o=o&&e[c]<=f&&(r<0&&(r=c),a=c);if(!(r<0))return o=t.invertExtent(e[r]),f=t.invertExtent(e[a]),[o[0]===void 0?o[1]:o[0],f[1]===void 0?f[0]:f[1]]}}function aM(){const t=q6().unknown(void 0),n=t.domain,e=t.range;let o=[0,1],f,r,a=!1,u=0,c=0,i=.5;delete t.unknown;function s(){const l=n().length,d=o[1]g+f*v);return e(d?p.reverse():p)}return t.domain=function(l){return arguments.length?(n(l),s()):n()},t.range=function(l){return arguments.length?(o=[+l[0],+l[1]],s()):o.slice()},t.rangeRound=function(l){return o=[+l[0],+l[1]],a=!0,s()},t.bandwidth=function(){return r},t.step=function(){return f},t.round=function(l){return arguments.length?(a=!!l,s()):a},t.padding=function(l){return arguments.length?(c=Math.max(0,Math.min(1,l)),u=c,s()):u},t.paddingInner=function(l){return arguments.length?(u=Math.max(0,Math.min(1,l)),s()):u},t.paddingOuter=function(l){return arguments.length?(c=Math.max(0,Math.min(1,l)),s()):c},t.align=function(l){return arguments.length?(i=Math.max(0,Math.min(1,l)),s()):i},t.invertRange=function(l){if(l[0]==null||l[1]==null)return;const d=o[1]o[1-d])))return v=Math.max(0,ek(h,g)-1),y=g===p?v:ek(h,p)-1,g-h[v]>r+1e-10&&++v,d&&(x=v,v=m-y,y=m-x),v>y?void 0:n().slice(v,y+1)},t.invert=function(l){const d=t.invertRange([l,l]);return d&&d[0]},t.copy=function(){return aM().domain(n()).range(o).round(a).paddingInner(u).paddingOuter(c).align(i)},s()}function XR(t){const n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return XR(n())},t}function WK(){return XR(aM().paddingInner(1))}var YK=Array.prototype.map;function XK(t){return YK.call(t,Rl)}const ZK=Array.prototype.slice;function ZR(){let t=[],n=[];function e(o){return o==null||o!==o?void 0:n[(W2(t,o)-1)%n.length]}return e.domain=function(o){return arguments.length?(t=XK(o),e):t.slice()},e.range=function(o){return arguments.length?(n=ZK.call(o),e):n.slice()},e.tickFormat=function(o,f){return lW(t[0],Na(t),o??10,f)},e.copy=function(){return ZR().domain(e.domain()).range(e.range())},e}const S_={};function JK(t,n,e){const o=function(){const r=n();return r.invertRange||(r.invertRange=r.invert?$K(r):r.invertExtent?GK(r):void 0),r.type=t,r};return o.metadata=ff(ki(e)),o}function Xa(t,n,e){return arguments.length>1?(S_[t]=JK(t,n,e),this):JR(t)?S_[t]:void 0}Xa(HK,RR);Xa(hm,sW,Xs);Xa(Wh,NR,[Xs,Wh]);Xa(Ly,Z6,Xs);Xa(Py,FK,Xs);Xa(mw,BR,Xs);Xa(w0,jK,[Xs,iM]);Xa(k0,UK,[Xs,iM]);Xa(Gf,K6,[Xs,kc]);Xa("".concat(Gf,"-").concat(hm),K6,[Xs,kc]);Xa("".concat(Gf,"-").concat(Wh),qR,[Xs,kc,Wh]);Xa("".concat(Gf,"-").concat(Ly),Q6,[Xs,kc]);Xa("".concat(Gf,"-").concat(Py),VK,[Xs,kc]);Xa("".concat(Gf,"-").concat(mw),HR,[Xs,kc]);Xa("".concat(Ym,"-").concat(hm),$R,[Xs,kc]);Xa("".concat(Ym,"-").concat(Wh),GR,[Xs,kc,Wh]);Xa("".concat(Ym,"-").concat(Ly),eM,[Xs,kc]);Xa("".concat(Ym,"-").concat(Py),qK,[Xs,kc]);Xa("".concat(Ym,"-").concat(mw),WR,[Xs,kc]);Xa(dm,jR,[Iy,dm]);Xa(vw,UR,Iy);Xa(yw,VR,Iy);Xa(rM,ZR,[Dy,Iy]);Xa(nM,q6,Dy);Xa(YR,aM,Dy);Xa(Ak,WK,Dy);function JR(t){return qi(S_,t)}function G0(t,n){const e=S_[t];return e&&e.metadata[n]}function oM(t){return G0(t,Xs)}function pm(t){return G0(t,Dy)}function Mk(t){return G0(t,Iy)}function KR(t){return G0(t,Wh)}function KK(t){return G0(t,iM)}function QR(t){return G0(t,kc)}function eF(t){return G0(t,dm)}const QK=["clamp","base","constant","exponent"];function tF(t,n){const e=n[0],o=Na(n)-e;return function(f){return t(e+f*o)}}function xw(t,n,e){return G6(sM(n||"rgb",e),t)}function nF(t,n){const e=new Array(n),o=n+1;for(let f=0;ft[u]?a[u](t[u]()):0),a)}function sM(t,n){const e=CK[eQ(t)];return n!=null&&e&&e.gamma?e.gamma(n):e}function eQ(t){return"interpolate"+t.toLowerCase().split("-").map(n=>n[0].toUpperCase()+n.slice(1)).join("")}const tQ={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},nQ={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function iF(t){const n=t.length/6|0,e=new Array(n);for(let o=0;oxw(iF(t)));function lM(t,n){return t=t&&t.toLowerCase(),arguments.length>1?(y7[t]=n,this):y7[t]}const Vb="symbol",rQ="discrete",iQ="gradient",aQ=t=>Ir(t)?t.map(n=>String(n)):String(t),oQ=(t,n)=>t[1]-n[1],sQ=(t,n)=>n[1]-t[1];function uM(t,n,e){let o;return wo(n)&&(t.bins&&(n=Math.max(n,t.bins.length)),e!=null&&(n=Math.min(n,Math.floor(Ay(t.domain())/e||1)))),Ei(n)&&(o=n.step,n=n.interval),bi(n)&&(n=t.type===w0?$m(n):t.type==k0?Gm(n):Pr("Only time and utc scales accept interval strings."),o&&(n=n.every(o))),n}function oF(t,n,e){let o=t.range(),f=o[0],r=Na(o),a=oQ;if(f>r&&(o=r,r=f,f=o,a=sQ),f=Math.floor(f),r=Math.ceil(r),n=n.map(u=>[u,t(u)]).filter(u=>f<=u[1]&&u[1]<=r).sort(a).map(u=>u[0]),e>0&&n.length>1){const u=[n[0],Na(n)];for(;n.length>e&&n.length>=3;)n=n.filter((c,i)=>!(i%2));n.length<3&&(n=u)}return n}function cM(t,n){return t.bins?oF(t,t.bins):t.ticks?t.ticks(n):t.domain()}function sF(t,n,e,o,f,r){const a=n.type;let u=aQ;if(a===w0||f===w0)u=t.timeFormat(o);else if(a===k0||f===k0)u=t.utcFormat(o);else if(KR(a)){const c=t.formatFloat(o);if(r||n.bins)u=c;else{const i=lF(n,e,!1);u=s=>i(s)?c(s):""}}else if(n.tickFormat){const c=n.domain();u=t.formatSpan(c[0],c[c.length-1],e,o)}else o&&(u=t.format(o));return u}function lF(t,n,e){const o=cM(t,n),f=t.base(),r=Math.log(f),a=Math.max(1,f*n/o.length),u=c=>{let i=c/Math.pow(f,Math.round(Math.log(c)/r));return i*f1?o[1]-o[0]:o[0],a;for(a=1;aSk[t.type]||t.bins;function fF(t,n,e,o,f,r,a){const u=uF[n.type]&&r!==w0&&r!==k0?lQ(t,n,f):sF(t,n,e,f,r,a);return o===Vb&&fQ(n)?hQ(u):o===rQ?dQ(u):pQ(u)}const hQ=t=>(n,e,o)=>{const f=x7(o[e+1],x7(o.max,1/0)),r=b7(n,t),a=b7(f,t);return r&&a?r+" \u2013 "+a:a?"< "+a:"\u2265 "+r},x7=(t,n)=>t??n,dQ=t=>(n,e)=>e?t(n):null,pQ=t=>n=>t(n),b7=(t,n)=>Number.isFinite(t)?n(t):null;function gQ(t){const n=t.domain(),e=n.length-1;let o=+n[0],f=+Na(n),r=f-o;if(t.type===yw){const a=e?r/e:.1;o-=a,f+=a,r=f-o}return a=>(a-o)/r}function mQ(t,n,e,o){const f=o||n.type;return bi(e)&&KK(f)&&(e=e.replace(/%a/g,"%A").replace(/%b/g,"%B")),!e&&f===w0?t.timeFormat("%A, %d %B %Y, %X"):!e&&f===k0?t.utcFormat("%A, %d %B %Y, %X UTC"):fF(t,n,5,null,e,o,!0)}function hF(t,n,e){e=e||{};const o=Math.max(3,e.maxlen||7),f=mQ(t,n,e.format,e.formatType);if(Mk(n.type)){const r=cF(n).slice(1).map(f),a=r.length;return"".concat(a," boundar").concat(a===1?"y":"ies",": ").concat(r.join(", "))}else if(pm(n.type)){const r=n.domain(),a=r.length,u=a>o?r.slice(0,o-2).map(f).join(", ")+", ending with "+r.slice(-1).map(f):r.map(f).join(", ");return"".concat(a," value").concat(a===1?"":"s",": ").concat(u)}else{const r=n.domain();return"values from ".concat(f(r[0])," to ").concat(f(Na(r)))}}let dF=0;function vQ(){dF=0}const E_="p_";function fM(t){return t&&t.gradient}function pF(t,n,e){const o=t.gradient;let f=t.id,r=o==="radial"?E_:"";return f||(f=t.id="gradient_"+dF++,o==="radial"?(t.x1=Lf(t.x1,.5),t.y1=Lf(t.y1,.5),t.r1=Lf(t.r1,0),t.x2=Lf(t.x2,.5),t.y2=Lf(t.y2,.5),t.r2=Lf(t.r2,.5),r=E_):(t.x1=Lf(t.x1,0),t.y1=Lf(t.y1,0),t.x2=Lf(t.x2,1),t.y2=Lf(t.y2,0))),n[f]=t,"url("+(e||"")+"#"+r+f+")"}function Lf(t,n){return t??n}function gF(t,n){var e=[],o;return o={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:n?n[0]:1,y2:n?n[1]:0,stops:e,stop:function(f,r){return e.push({offset:f,color:r}),o}}}const _7={basis:{curve:HJ},"basis-closed":{curve:$J},"basis-open":{curve:GJ},bundle:{curve:WJ,tension:"beta",value:.85},cardinal:{curve:YJ,tension:"tension",value:0},"cardinal-open":{curve:ZJ,tension:"tension",value:0},"cardinal-closed":{curve:XJ,tension:"tension",value:0},"catmull-rom":{curve:JJ,tension:"alpha",value:.5},"catmull-rom-closed":{curve:KJ,tension:"alpha",value:.5},"catmull-rom-open":{curve:QJ,tension:"alpha",value:.5},linear:{curve:jD},"linear-closed":{curve:eK},monotone:{horizontal:nK,vertical:tK},natural:{curve:rK},step:{curve:iK},"step-after":{curve:oK},"step-before":{curve:aK}};function hM(t,n,e){var o=qi(_7,t)&&_7[t],f=null;return o&&(f=o.curve||o[n||"vertical"],o.tension&&e!=null&&(f=f[o.tension](e))),f}const yQ={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},xQ=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,bQ=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,_Q=/^((\s+,?\s*)|(,\s*))/,wQ=/^[01]/;function gm(t){const n=[];return(t.match(xQ)||[]).forEach(o=>{let f=o[0];const r=f.toLowerCase(),a=yQ[r],u=kQ(r,a,o.slice(1).trim()),c=u.length;if(c1&&(g=Math.sqrt(g),e*=g,o*=g);const p=d/e,v=l/e,y=-l/o,x=d/o,w=p*u+v*c,k=y*u+x*c,b=p*t+v*n,T=y*t+x*n,_=(b-w)*(b-w)+(T-k)*(T-k);let M=1/_-.25;M<0&&(M=0);let A=Math.sqrt(M);r==f&&(A=-A);const S=.5*(w+b)-A*(T-k),E=.5*(k+T)+A*(b-w),D=Math.atan2(k-E,w-S);let R=Math.atan2(T-E,b-S)-D;R<0&&r===1?R+=Ff:R>0&&r===0&&(R-=Ff);const z=Math.ceil(Math.abs(R/(Qp+.001))),L=[];for(let P=0;P+t}function ib(t,n,e){return Math.max(n,Math.min(t,e))}function yF(){var t=CQ,n=OQ,e=LQ,o=PQ,f=Th(0),r=f,a=f,u=f,c=null;function i(s,l,d){var h,m=l??+t.call(this,s),g=d??+n.call(this,s),p=+e.call(this,s),v=+o.call(this,s),y=Math.min(p,v)/2,x=ib(+f.call(this,s),0,y),w=ib(+r.call(this,s),0,y),k=ib(+a.call(this,s),0,y),b=ib(+u.call(this,s),0,y);if(c||(c=h=Bm()),x<=0&&w<=0&&k<=0&&b<=0)c.rect(m,g,p,v);else{var T=m+p,_=g+v;c.moveTo(m+x,g),c.lineTo(T-w,g),c.bezierCurveTo(T-md*w,g,T,g+md*w,T,g+w),c.lineTo(T,_-b),c.bezierCurveTo(T,_-md*b,T-md*b,_,T-b,_),c.lineTo(m+k,_),c.bezierCurveTo(m+md*k,_,m,_-md*k,m,_-k),c.lineTo(m,g+x),c.bezierCurveTo(m,g+md*x,m+md*x,g,m+x,g),c.closePath()}if(h)return c=null,h+""||null}return i.x=function(s){return arguments.length?(t=Th(s),i):t},i.y=function(s){return arguments.length?(n=Th(s),i):n},i.width=function(s){return arguments.length?(e=Th(s),i):e},i.height=function(s){return arguments.length?(o=Th(s),i):o},i.cornerRadius=function(s,l,d,h){return arguments.length?(f=Th(s),r=l!=null?Th(l):f,u=d!=null?Th(d):f,a=h!=null?Th(h):r,i):f},i.context=function(s){return arguments.length?(c=s??null,i):c},i}function xF(){var t,n,e,o,f=null,r,a,u,c;function i(l,d,h){const m=h/2;if(r){var g=u-d,p=l-a;if(g||p){var v=Math.sqrt(g*g+p*p),y=(g/=v)*c,x=(p/=v)*c,w=Math.atan2(p,g);f.moveTo(a-y,u-x),f.lineTo(l-g*m,d-p*m),f.arc(l,d,m,w-Math.PI,w),f.lineTo(a+y,u+x),f.arc(a,u,c,w,w+Math.PI)}else f.arc(l,d,m,0,Ff);f.closePath()}else r=1;a=l,u=d,c=m}function s(l){var d,h=l.length,m,g=!1,p;for(f==null&&(f=p=Bm()),d=0;d<=h;++d)!(dt.x||0,Fy=t=>t.y||0,DQ=t=>t.width||0,IQ=t=>t.height||0,zQ=t=>(t.x||0)+(t.width||0),RQ=t=>(t.y||0)+(t.height||0),FQ=t=>t.startAngle||0,NQ=t=>t.endAngle||0,BQ=t=>t.padAngle||0,jQ=t=>t.innerRadius||0,UQ=t=>t.outerRadius||0,VQ=t=>t.cornerRadius||0,qQ=t=>zy(t.cornerRadiusTopLeft,t.cornerRadius)||0,HQ=t=>zy(t.cornerRadiusTopRight,t.cornerRadius)||0,$Q=t=>zy(t.cornerRadiusBottomRight,t.cornerRadius)||0,GQ=t=>zy(t.cornerRadiusBottomLeft,t.cornerRadius)||0,WQ=t=>zy(t.size,64),YQ=t=>t.size||1,bw=t=>t.defined!==!1,XQ=t=>vF(t.shape||"circle"),ZQ=UJ().startAngle(FQ).endAngle(NQ).padAngle(BQ).innerRadius(jQ).outerRadius(UQ).cornerRadius(VQ),JQ=cR().x(Ry).y1(Fy).y0(RQ).defined(bw),KQ=cR().y(Fy).x1(Ry).x0(zQ).defined(bw),QQ=BD().x(Ry).y(Fy).defined(bw),eee=yF().x(Ry).y(Fy).width(DQ).height(IQ).cornerRadius(qQ,HQ,$Q,GQ),tee=qJ().type(XQ).size(WQ),nee=xF().x(Ry).y(Fy).defined(bw).size(YQ);function dM(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function ree(t,n){return ZQ.context(t)(n)}function iee(t,n){const e=n[0],o=e.interpolate||"linear";return(e.orient==="horizontal"?KQ:JQ).curve(hM(o,e.orient,e.tension)).context(t)(n)}function aee(t,n){const e=n[0],o=e.interpolate||"linear";return QQ.curve(hM(o,e.orient,e.tension)).context(t)(n)}function Xm(t,n,e,o){return eee.context(t)(n,e,o)}function oee(t,n){return(n.mark.shape||n.shape).context(t)(n)}function see(t,n){return tee.context(t)(n)}function lee(t,n){return nee.context(t)(n)}var bF=1;function _F(){bF=1}function pM(t,n,e){var o=n.clip,f=t._defs,r=n.clip_id||(n.clip_id="clip"+bF++),a=f.clipping[r]||(f.clipping[r]={id:r});return ga(o)?a.path=o(null):dM(e)?a.path=Xm(null,e,0,0):(a.width=e.width||0,a.height=e.height||0),"url(#"+r+")"}function zs(t){this.clear(),t&&this.union(t)}zs.prototype={clone(){return new zs(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,n,e,o){return ethis.x2&&(this.x2=t),n>this.y2&&(this.y2=n),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,n){return this.x1+=t,this.x2+=t,this.y1+=n,this.y2+=n,this},rotate(t,n,e){const o=this.rotatedPoints(t,n,e);return this.clear().add(o[0],o[1]).add(o[2],o[3]).add(o[4],o[5]).add(o[6],o[7])},rotatedPoints(t,n,e){var{x1:o,y1:f,x2:r,y2:a}=this,u=Math.cos(t),c=Math.sin(t),i=n-n*u+e*c,s=e-n*c-e*u;return[u*o-c*f+i,c*o+u*f+s,u*o-c*a+i,c*o+u*a+s,u*r-c*f+i,c*r+u*f+s,u*r-c*a+i,c*r+u*a+s]},union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)},contains(t,n){return!(tthis.x2||nthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function _w(t){this.mark=t,this.bounds=this.bounds||new zs}function ww(t){_w.call(this,t),this.items=this.items||[]}ni(ww,_w);function gM(t){this._pending=0,this._loader=t||Q2()}function A7(t){t._pending+=1}function U1(t){t._pending-=1}gM.prototype={pending(){return this._pending},sanitizeURL(t){const n=this;return A7(n),n._loader.sanitize(t,{context:"href"}).then(e=>(U1(n),e)).catch(()=>(U1(n),null))},loadImage(t){const n=this,e=sK();return A7(n),n._loader.sanitize(t,{context:"image"}).then(o=>{const f=o.href;if(!f||!e)throw{url:f};const r=new e,a=qi(o,"crossOrigin")?o.crossOrigin:"anonymous";return a!=null&&(r.crossOrigin=a),r.onload=()=>U1(n),r.onerror=()=>U1(n),r.src=f,r}).catch(o=>(U1(n),{complete:!1,width:0,height:0,src:o&&o.url||""}))},ready(){const t=this;return new Promise(n=>{function e(o){t.pending()?setTimeout(()=>{e(!0)},10):n(o)}e(!1)})}};function Jh(t,n,e){if(n.stroke&&n.opacity!==0&&n.strokeOpacity!==0){const o=n.strokeWidth!=null?+n.strokeWidth:1;t.expand(o+(e?uee(n,o):0))}return t}function uee(t,n){return t.strokeJoin&&t.strokeJoin!=="miter"?0:n}const cee=Ff-1e-8;let kw,qb,Hb,a0,Ek,$b,Ck,Ok;const Od=(t,n)=>kw.add(t,n),Gb=(t,n)=>Od(qb=t,Hb=n),M7=t=>Od(t,kw.y1),S7=t=>Od(kw.x1,t),e0=(t,n)=>Ek*t+Ck*n,t0=(t,n)=>$b*t+Ok*n,G5=(t,n)=>Od(e0(t,n),t0(t,n)),W5=(t,n)=>Gb(e0(t,n),t0(t,n));function Ny(t,n){return kw=t,n?(a0=n*Jd,Ek=Ok=Math.cos(a0),$b=Math.sin(a0),Ck=-$b):(Ek=Ok=1,a0=$b=Ck=0),fee}const fee={beginPath(){},closePath(){},moveTo:W5,lineTo:W5,rect(t,n,e,o){a0?(G5(t+e,n),G5(t+e,n+o),G5(t,n+o),W5(t,n)):(Od(t+e,n+o),Gb(t,n))},quadraticCurveTo(t,n,e,o){const f=e0(t,n),r=t0(t,n),a=e0(e,o),u=t0(e,o);E7(qb,f,a,M7),E7(Hb,r,u,S7),Gb(a,u)},bezierCurveTo(t,n,e,o,f,r){const a=e0(t,n),u=t0(t,n),c=e0(e,o),i=t0(e,o),s=e0(f,r),l=t0(f,r);C7(qb,a,c,s,M7),C7(Hb,u,i,l,S7),Gb(s,l)},arc(t,n,e,o,f,r){if(o+=a0,f+=a0,qb=e*Math.cos(f)+t,Hb=e*Math.sin(f)+n,Math.abs(f-o)>cee)Od(t-e,n-e),Od(t+e,n+e);else{const a=i=>Od(e*Math.cos(i)+t,e*Math.sin(i)+n);let u,c;if(a(o),a(f),f!==o)if(o=o%Ff,o<0&&(o+=Ff),f=f%Ff,f<0&&(f+=Ff),ff;++c,u-=Qp)a(u);else for(u=o-o%Qp+Qp,c=0;c<4&&uTQ?(s=a*a+u*r,s>=0&&(s=Math.sqrt(s),c=(-a+s)/r,i=(-a-s)/r)):c=.5*u/a,0d)return!1;g>l&&(l=g)}else if(h>0){if(g0?(t.globalAlpha=e,t.fillStyle=TF(t,n,n.fill),!0):!1}var dee=[];function vm(t,n,e){var o=(o=n.strokeWidth)!=null?o:1;return o<=0?!1:(e*=n.strokeOpacity==null?1:n.strokeOpacity,e>0?(t.globalAlpha=e,t.strokeStyle=TF(t,n,n.stroke),t.lineWidth=o,t.lineCap=n.strokeCap||"butt",t.lineJoin=n.strokeJoin||"miter",t.miterLimit=n.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(n.strokeDash||dee),t.lineDashOffset=n.strokeDashOffset||0),!0):!1)}function pee(t,n){return t.zindex-n.zindex||t.index-n.index}function yM(t){if(!t.zdirty)return t.zitems;var n=t.items,e=[],o,f,r;for(f=0,r=n.length;f=0;)if(o=n(e[f]))return o;if(e===r){for(e=t.items,f=e.length;--f>=0;)if(!e[f].zindex&&(o=n(e[f])))return o}return null}function xM(t){return function(n,e,o){df(e,f=>{(!o||o.intersects(f.bounds))&&AF(t,n,f,f)})}}function gee(t){return function(n,e,o){e.items.length&&(!o||o.intersects(e.bounds))&&AF(t,n,e.items[0],e.items)}}function AF(t,n,e,o){var f=e.opacity==null?1:e.opacity;f!==0&&(t(n,o)||(mm(n,e),e.fill&&C_(n,e,f)&&n.fill(),e.stroke&&vm(n,e,f)&&n.stroke()))}function Tw(t){return t=t||mc,function(n,e,o,f,r,a){return o*=n.pixelRatio,f*=n.pixelRatio,O_(e,u=>{const c=u.bounds;if(!(c&&!c.contains(r,a)||!c)&&t(n,u,o,f,r,a))return u})}}function By(t,n){return function(e,o,f,r){var a=Array.isArray(o)?o[0]:o,u=n??a.fill,c=a.stroke&&e.isPointInStroke,i,s;return c&&(i=a.strokeWidth,s=a.strokeCap,e.lineWidth=i??1,e.lineCap=s??"butt"),t(e,o)?!1:u&&e.isPointInPath(f,r)||c&&e.isPointInStroke(f,r)}}function bM(t){return Tw(By(t))}function g0(t,n){return"translate("+t+","+n+")"}function _M(t){return"rotate("+t+")"}function mee(t,n){return"scale("+t+","+n+")"}function MF(t){return g0(t.x||0,t.y||0)}function vee(t){return g0(t.x||0,t.y||0)+(t.angle?" "+_M(t.angle):"")}function yee(t){return g0(t.x||0,t.y||0)+(t.angle?" "+_M(t.angle):"")+(t.scaleX||t.scaleY?" "+mee(t.scaleX||1,t.scaleY||1):"")}function wM(t,n,e){function o(a,u){a("transform",vee(u)),a("d",n(null,u))}function f(a,u){return n(Ny(a,u.angle),u),Jh(a,u).translate(u.x||0,u.y||0)}function r(a,u){var c=u.x||0,i=u.y||0,s=u.angle||0;a.translate(c,i),s&&a.rotate(s*=Jd),a.beginPath(),n(a,u),s&&a.rotate(-s),a.translate(-c,-i)}return{type:t,tag:"path",nested:!1,attr:o,bound:f,draw:xM(r),pick:bM(r),isect:e||mM(r)}}var xee=wM("arc",ree);function bee(t,n){for(var e=t[0].orient==="horizontal"?n[1]:n[0],o=t[0].orient==="horizontal"?"y":"x",f=t.length,r=1/0,a,u;--f>=0;)t[f].defined!==!1&&(u=Math.abs(t[f][o]-e),u=0;)if(t[o].defined!==!1&&(f=t[o].x-n[0],r=t[o].y-n[1],a=f*f+r*r,a=0;)if(t[e].defined!==!1&&(o=t[e].x-n[0],f=t[e].y-n[1],r=o*o+f*f,o=t[e].size||1,r.5&&n<1.5?.5-Math.abs(n-1):0}function Aee(t,n){t("transform",MF(n))}function CF(t,n){const e=EF(n);t("d",Xm(null,n,e,e))}function Mee(t,n){t("class","background"),t("aria-hidden",!0),CF(t,n)}function See(t,n){t("class","foreground"),t("aria-hidden",!0),n.strokeForeground?CF(t,n):t("d","")}function Eee(t,n,e){const o=n.clip?pM(e,n,n):null;t("clip-path",o)}function Cee(t,n){if(!n.clip&&n.items){const e=n.items,o=e.length;for(let f=0;f{const f=o.x||0,r=o.y||0,a=o.strokeForeground,u=o.opacity==null?1:o.opacity;(o.stroke||o.fill)&&u&&(Jv(t,o,f,r),mm(t,o),o.fill&&C_(t,o,u)&&t.fill(),o.stroke&&!a&&vm(t,o,u)&&t.stroke()),t.save(),t.translate(f,r),o.clip&&SF(t,o),e&&e.translate(-f,-r),df(o,c=>{this.draw(t,c,e)}),e&&e.translate(f,r),t.restore(),a&&o.stroke&&u&&(Jv(t,o,f,r),mm(t,o),vm(t,o,u)&&t.stroke())})}function Iee(t,n,e,o,f,r){if(n.bounds&&!n.bounds.contains(f,r)||!n.items)return null;const a=e*t.pixelRatio,u=o*t.pixelRatio;return O_(n,c=>{let i,s,l;const d=c.bounds;if(d&&!d.contains(f,r))return;s=c.x||0,l=c.y||0;const h=s+(c.width||0),m=l+(c.height||0),g=c.clip;if(g&&(fh||rm))return;if(t.save(),t.translate(s,l),s=f-s,l=r-l,g&&dM(c)&&!Pee(t,c,a,u))return t.restore(),null;const p=c.strokeForeground,v=n.interactive!==!1;return v&&p&&c.stroke&&Lee(t,c,a,u)?(t.restore(),c):(i=O_(c,y=>zee(y,s,l)?this.pick(y,e,o,s,l):null),!i&&v&&(c.fill||!p&&c.stroke)&&Oee(t,c,a,u)&&(i=c),t.restore(),i||null)})}function zee(t,n,e){return(t.interactive!==!1||t.marktype==="group")&&t.bounds&&t.bounds.contains(n,e)}var Ree={type:"group",tag:"g",nested:!1,attr:Aee,bound:Cee,draw:Dee,pick:Iee,isect:wF,content:Eee,background:Mee,foreground:See},Kv={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function TM(t,n){var e=t.image;return(!e||t.url&&t.url!==e.url)&&(e={complete:!1,width:0,height:0},n.loadImage(t.url).then(o=>{t.image=o,t.image.url=t.url})),e}function AM(t,n){return t.width!=null?t.width:!n||!n.width?0:t.aspect!==!1&&t.height?t.height*n.width/n.height:n.width}function MM(t,n){return t.height!=null?t.height:!n||!n.height?0:t.aspect!==!1&&t.width?t.width*n.height/n.width:n.height}function Aw(t,n){return t==="center"?n/2:t==="right"?n:0}function Mw(t,n){return t==="middle"?n/2:t==="bottom"?n:0}function Fee(t,n,e){const o=TM(n,e),f=AM(n,o),r=MM(n,o),a=(n.x||0)-Aw(n.align,f),u=(n.y||0)-Mw(n.baseline,r),c=!o.src&&o.toDataURL?o.toDataURL():o.src||"";t("href",c,Kv["xmlns:xlink"],"xlink:href"),t("transform",g0(a,u)),t("width",f),t("height",r),t("preserveAspectRatio",n.aspect===!1?"none":"xMidYMid")}function Nee(t,n){const e=n.image,o=AM(n,e),f=MM(n,e),r=(n.x||0)-Aw(n.align,o),a=(n.y||0)-Mw(n.baseline,f);return t.set(r,a,r+o,a+f)}function Bee(t,n,e){df(n,o=>{if(e&&!e.intersects(o.bounds))return;const f=TM(o,this);let r=AM(o,f),a=MM(o,f);if(r===0||a===0)return;let u=(o.x||0)-Aw(o.align,r),c=(o.y||0)-Mw(o.baseline,a),i,s,l,d;o.aspect!==!1&&(s=f.width/f.height,l=o.width/o.height,s===s&&l===l&&s!==l&&(l{if(!(e&&!e.intersects(o.bounds))){var f=o.opacity==null?1:o.opacity;f&&OF(t,o,f)&&(mm(t,o),t.stroke())}})}function Jee(t,n,e,o){return t.isPointInStroke?OF(t,n,1)&&t.isPointInStroke(e,o):!1}var Kee={type:"rule",tag:"line",nested:!1,attr:Yee,bound:Xee,draw:Zee,pick:Tw(Jee),isect:kF},Qee=wM("shape",oee),ete=wM("symbol",see,vM);const D7=dI();var af={height:ah,measureWidth:SM,estimateWidth:Pk,width:Pk,canvas:LF};LF(!0);function LF(t){af.width=t&&qd?SM:Pk}function Pk(t,n){return PF(Qd(t,n),ah(t))}function PF(t,n){return~~(.8*t.length*n)}function SM(t,n){return ah(t)<=0||!(n=Qd(t,n))?0:DF(n,Sw(t))}function DF(t,n){const e="(".concat(n,") ").concat(t);let o=D7.get(e);return o===void 0&&(qd.font=n,o=qd.measureText(t).width,D7.set(e,o)),o}function ah(t){return t.fontSize!=null?+t.fontSize||0:11}function Kd(t){return t.lineHeight!=null?t.lineHeight:ah(t)+2}function tte(t){return Ir(t)?t.length>1?t:t[0]:t}function jy(t){return tte(t.lineBreak&&t.text&&!Ir(t.text)?t.text.split(t.lineBreak):t.text)}function EM(t){const n=jy(t);return(Ir(n)?n.length-1:0)*Kd(t)}function Qd(t,n){const e=n==null?"":(n+"").trim();return t.limit>0&&e.length?rte(t,e):e}function nte(t){if(af.width===SM){const n=Sw(t);return e=>DF(e,n)}else{const n=ah(t);return e=>PF(e,n)}}function rte(t,n){var e=+t.limit,o=nte(t);if(o(n)>>1,o(n.slice(c))>e?a=c+1:u=c;return f+n.slice(a)}else{for(;a>>1),o(n.slice(0,c))Math.max(d,af.width(n,h)),0)):l=af.width(n,s),f==="center"?c-=l/2:f==="right"&&(c-=l),t.set(c+=a,i+=u,c+l,i+o),n.angle&&!e)t.rotate(n.angle*Jd,a,u);else if(e===2)return t.rotatedPoints(n.angle*Jd,a,u);return t}function ote(t,n,e){df(n,o=>{var f=o.opacity==null?1:o.opacity,r,a,u,c,i,s,l;if(!(e&&!e.intersects(o.bounds)||f===0||o.fontSize<=0||o.text==null||o.text.length===0)){if(t.font=Sw(o),t.textAlign=o.align||"left",r=Ew(o),a=r.x1,u=r.y1,o.angle&&(t.save(),t.translate(a,u),t.rotate(o.angle*Jd),a=u=0),a+=o.dx||0,u+=(o.dy||0)+CM(o),s=jy(o),mm(t,o),Ir(s))for(i=Kd(o),c=0;cn;)t.removeChild(e[--o]);return t}function BF(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function Cw(t,n){const e=n.getBoundingClientRect();return[t.clientX-e.left-(n.clientLeft||0),t.clientY-e.top-(n.clientTop||0)]}function hte(t,n,e,o){var f=t&&t.mark,r,a;if(f&&(r=tc[f.marktype]).tip){for(a=Cw(n,e),a[0]-=o[0],a[1]-=o[1];t=t.mark.group;)a[0]-=t.x||0,a[1]-=t.y||0;t=r.tip(f.items,a)}return t}function ep(t,n){this._active=null,this._handlers={},this._loader=t||Q2(),this._tooltip=n||dte}function dte(t,n,e,o){t.element().setAttribute("title",o||"")}ep.prototype={initialize(t,n,e){return this._el=t,this._obj=e||null,this.origin(n)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,n,e){for(let o=t?t.length:0;--o>=0;)if(t[o].type===n&&(!e||t[o].handler===e))return o;return-1},handlers(t){const n=this._handlers,e=[];if(t)e.push(...n[this.eventName(t)]);else for(const o in n)e.push(...n[o]);return e},eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)},handleHref(t,n,e){this._loader.sanitize(e,{context:"href"}).then(o=>{const f=new MouseEvent(t.type,t),r=Ld(null,"a");for(const a in o)r.setAttribute(a,o[a]);r.dispatchEvent(f)}).catch(()=>{})},handleTooltip(t,n,e){if(n&&n.tooltip!=null){n=hte(n,t,this.canvas(),this._origin);const o=e&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,o)}},getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const e=n.getBoundingClientRect(),o=this._origin,f=t.bounds,r=f.width(),a=f.height();let u=f.x1+o[0]+e.left,c=f.y1+o[1]+e.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,c+=t.y||0;return{x:u,y:c,width:r,height:a,left:u,top:c,right:u+r,bottom:c+a}}};function oh(t){this._el=null,this._bgcolor=null,this._loader=new gM(t)}oh.prototype={initialize(t,n,e,o,f){return this._el=t,this.resize(n,e,o,f)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)},resize(t,n,e,o){return this._width=t,this._height=n,this._origin=e||[0,0],this._scale=o||1,this},dirty(){},render(t){const n=this;return n._call=function(){n._render(t)},n._call(),n._call=null,n},_render(){},renderAsync(t){const n=this.render(t);return this._ready?this._ready.then(()=>n):Promise.resolve(n)},_load(t,n){var e=this,o=e._loader[t](n);if(!e._ready){const f=e._call;e._ready=e._loader.ready().then(r=>{r&&f(),e._ready=null})}return o},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const pte="keydown",gte="keypress",mte="keyup",jF="dragenter",Yb="dragleave",UF="dragover",Ik="mousedown",vte="mouseup",L_="mousemove",Ev="mouseout",VF="mouseover",P_="click",yte="dblclick",xte="wheel",qF="mousewheel",D_="touchstart",I_="touchmove",z_="touchend",bte=[pte,gte,mte,jF,Yb,UF,Ik,vte,L_,Ev,VF,P_,yte,xte,qF,D_,I_,z_],zk=L_,Qv=Ev,Rk=P_;function Vy(t,n){ep.call(this,t,n),this._down=null,this._touch=null,this._first=!0,this._events={}}const _te=t=>t===D_||t===I_||t===z_?[D_,I_,z_]:[t];function z7(t,n){_te(n).forEach(e=>wte(t,e))}function wte(t,n){const e=t.canvas();e&&!t._events[n]&&(t._events[n]=1,e.addEventListener(n,t[n]?o=>t[n](o):o=>t.fire(n,o)))}function R7(t,n,e){return function(o){const f=this._active,r=this.pickEvent(o);r===f?this.fire(t,o):((!f||!f.exit)&&this.fire(e,o),this._active=r,this.fire(n,o),this.fire(t,o))}}function F7(t){return function(n){this.fire(t,n),this._active=null}}ni(Vy,ep,{initialize(t,n,e){return this._canvas=t&&PM(t,"canvas"),[P_,Ik,L_,Ev,Yb].forEach(o=>z7(this,o)),ep.prototype.initialize.call(this,t,n,e)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:bte,DOMMouseScroll(t){this.fire(qF,t)},mousemove:R7(L_,VF,Ev),dragover:R7(UF,jF,Yb),mouseout:F7(Ev),dragleave:F7(Yb),mousedown(t){this._down=this._active,this.fire(Ik,t)},click(t){this._down===this._active&&(this.fire(P_,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(D_,t,!0)},touchmove(t){this.fire(I_,t,!0)},touchend(t){this.fire(z_,t,!0),this._touch=null},fire(t,n,e){const o=e?this._touch:this._active,f=this._handlers[t];if(n.vegaType=t,t===Rk&&o&&o.href?this.handleHref(n,o,o.href):(t===zk||t===Qv)&&this.handleTooltip(n,o,t!==Qv),f)for(let r=0,a=f.length;r=0&&o.splice(f,1),this},pickEvent(t){const n=Cw(t,this._canvas),e=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-e[0],n[1]-e[1])},pick(t,n,e,o,f){const r=this.context();return tc[t.marktype].pick.call(this,r,t,n,e,o,f)}});function kte(){return typeof window<"u"&&window.devicePixelRatio||1}var Tte=kte();function Ate(t,n,e,o,f,r){const a=typeof HTMLElement<"u"&&t instanceof HTMLElement&&t.parentNode!=null,u=t.getContext("2d"),c=a?Tte:f;t.width=n*c,t.height=e*c;for(const i in r)u[i]=r[i];return a&&c!==1&&(t.style.width=n+"px",t.style.height=e+"px"),u.pixelRatio=c,u.setTransform(c,0,0,c,c*o[0],c*o[1]),t}function R_(t){oh.call(this,t),this._options={},this._redraw=!1,this._dirty=new zs,this._tempb=new zs}const N7=oh.prototype,Mte=(t,n,e)=>new zs().set(0,0,n,e).translate(-t[0],-t[1]);function Ste(t,n,e){return n.expand(1).round(),t.pixelRatio%1&&n.scale(t.pixelRatio).round().scale(1/t.pixelRatio),n.translate(-(e[0]%1),-(e[1]%1)),t.beginPath(),t.rect(n.x1,n.y1,n.width(),n.height()),t.clip(),n}ni(R_,oh,{initialize(t,n,e,o,f,r){return this._options=r||{},this._canvas=this._options.externalContext?null:Vd(1,1,this._options.type),t&&this._canvas&&(Xc(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),N7.initialize.call(this,t,n,e,o,f)},resize(t,n,e,o){if(N7.resize.call(this,t,n,e,o),this._canvas)Ate(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const f=this._options.externalContext;f||Pr("CanvasRenderer is missing a valid canvas or context"),f.scale(this._scale,this._scale),f.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const n=this._tempb.clear().union(t.bounds);let e=t.mark.group;for(;e;)n.translate(e.x||0,e.y||0),e=e.mark.group;this._dirty.union(n)},_render(t){const n=this.context(),e=this._origin,o=this._width,f=this._height,r=this._dirty,a=Mte(e,o,f);n.save();const u=this._redraw||r.empty()?(this._redraw=!1,a.expand(1)):Ste(n,a.intersect(r),e);return this.clear(-e[0],-e[1],o,f),this.draw(n,t,u),n.restore(),r.clear(),this},draw(t,n,e){const o=tc[n.marktype];n.clip&&Tee(t,n),o.draw.call(this,t,n,e),n.clip&&t.restore()},clear(t,n,e,o){const f=this._options,r=this.context();f.type!=="pdf"&&!f.externalContext&&r.clearRect(t,n,e,o),this._bgcolor!=null&&(r.fillStyle=this._bgcolor,r.fillRect(t,n,e,o))}});function DM(t,n){ep.call(this,t,n);const e=this;e._hrefHandler=Fk(e,(o,f)=>{f&&f.href&&e.handleHref(o,f,f.href)}),e._tooltipHandler=Fk(e,(o,f)=>{e.handleTooltip(o,f,o.type!==Qv)})}const Fk=(t,n)=>e=>{let o=e.target.__data__;o=Array.isArray(o)?o[0]:o,e.vegaType=e.type,n.call(t._obj,e,o)};ni(DM,ep,{initialize(t,n,e){let o=this._svg;return o&&(o.removeEventListener(Rk,this._hrefHandler),o.removeEventListener(zk,this._tooltipHandler),o.removeEventListener(Qv,this._tooltipHandler)),this._svg=o=t&&PM(t,"svg"),o&&(o.addEventListener(Rk,this._hrefHandler),o.addEventListener(zk,this._tooltipHandler),o.addEventListener(Qv,this._tooltipHandler)),ep.prototype.initialize.call(this,t,n,e)},canvas(){return this._svg},on(t,n){const e=this.eventName(t),o=this._handlers;if(this._handlerIndex(o[e],t,n)<0){const r={type:t,handler:n,listener:Fk(this,n)};(o[e]||(o[e]=[])).push(r),this._svg&&this._svg.addEventListener(e,r.listener)}return this},off(t,n){const e=this.eventName(t),o=this._handlers[e],f=this._handlerIndex(o,t,n);return f>=0&&(this._svg&&this._svg.removeEventListener(e,o[f].listener),o.splice(f,1)),this}});const HF="aria-hidden",IM="aria-label",zM="role",RM="aria-roledescription",$F="graphics-object",FM="graphics-symbol",GF=(t,n,e)=>({[zM]:t,[RM]:n,[IM]:e||void 0}),Ete=ff(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),B7={axis:{desc:"axis",caption:Lte},legend:{desc:"legend",caption:Pte},"title-text":{desc:"title",caption:t=>"Title text '".concat(U7(t),"'")},"title-subtitle":{desc:"subtitle",caption:t=>"Subtitle text '".concat(U7(t),"'")}},j7={ariaRole:zM,ariaRoleDescription:RM,description:IM};function WF(t,n){const e=n.aria===!1;if(t(HF,e||void 0),e||n.description==null)for(const o in j7)t(j7[o],void 0);else{const o=n.mark.marktype;t(IM,n.description),t(zM,n.ariaRole||(o==="group"?$F:FM)),t(RM,n.ariaRoleDescription||"".concat(o," mark"))}}function YF(t){return t.aria===!1?{[HF]:!0}:Ete[t.role]?null:B7[t.role]?Ote(t,B7[t.role]):Cte(t)}function Cte(t){const n=t.marktype,e=n==="group"||n==="text"||t.items.some(o=>o.description!=null&&o.aria!==!1);return GF(e?$F:FM,"".concat(n," mark container"),t.description)}function Ote(t,n){try{const e=t.items[0],o=n.caption||(()=>"");return GF(n.role||FM,n.desc,e.description||o(e))}catch{return null}}function U7(t){return ki(t.text).join(" ")}function Lte(t){const n=t.datum,e=t.orient,o=n.title?XF(t):null,f=t.context,r=f.scales[n.scale].value,a=f.dataflow.locale(),u=r.type,c=e==="left"||e==="right"?"Y":"X";return"".concat(c,"-axis")+(o?" titled '".concat(o,"'"):"")+" for a ".concat(pm(u)?"discrete":u," scale")+" with ".concat(hF(a,r,t))}function Pte(t){const n=t.datum,e=n.title?XF(t):null,o="".concat(n.type||""," legend").trim(),f=n.scales,r=Object.keys(f),a=t.context,u=a.scales[f[r[0]]].value,c=a.dataflow.locale();return Ite(o)+(e?" titled '".concat(e,"'"):"")+" for ".concat(Dte(r))+" with ".concat(hF(c,u,t))}function XF(t){try{return ki(Na(t.items).items[0].text).join(" ")}catch{return null}}function Dte(t){return t=t.map(n=>n+(n==="fill"||n==="stroke"?" color":"")),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+Na(t)}function Ite(t){return t.length?t[0].toUpperCase()+t.slice(1):t}const ZF=t=>(t+"").replace(/&/g,"&").replace(//g,">"),zte=t=>ZF(t).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function NM(){let t="",n="",e="";const o=[],f=()=>n=e="",r=c=>{n&&(t+="".concat(n,">").concat(e),f()),o.push(c)},a=(c,i)=>(i!=null&&(n+=" ".concat(c,'="').concat(zte(i),'"')),u),u={open(c){r(c),n="<"+c;for(var i=arguments.length,s=new Array(i>1?i-1:0),l=1;l".concat(e,""):"/>"):t+=""),f(),u},attr:a,text:c=>(e+=ZF(c),u),toString:()=>t};return u}const JF=t=>KF(NM(),t)+"";function KF(t,n){if(t.open(n.tagName),n.hasAttributes()){const e=n.attributes,o=e.length;for(let f=0;f{i.dirty=n})),!o.zdirty){if(e.exit){r.nested&&o.items.length?(c=o.items[0],c._svg&&this._update(r,c._svg,c)):e._svg&&(c=e._svg.parentNode,c&&c.removeChild(e._svg)),e._svg=null;continue}e=r.nested?o.items[0]:e,e._update!==n&&(!e._svg||!e._svg.ownerSVGElement?(this._dirtyAll=!1,q7(e,n)):this._update(r,e._svg,e),e._update=n)}return!this._dirtyAll},mark(t,n,e){if(!this.isDirty(n))return n._svg;const o=this._svg,f=tc[n.marktype],r=n.interactive===!1?"none":null,a=f.tag==="g",u=H7(n,t,e,"g",o);u.setAttribute("class",BF(n));const c=YF(n);for(const d in c)ru(u,d,c[d]);a||ru(u,"pointer-events",r),ru(u,"clip-path",n.clip?pM(this,n,n.group):null);let i=null,s=0;const l=d=>{const h=this.isDirty(d),m=H7(d,u,i,f.tag,o);h&&(this._update(f,m,d),a&&Nte(this,m,d)),i=m,++s};return f.nested?n.items.length&&l(n.items[0]):df(n,l),Xc(u,s),u},_update(t,n,e){Fh=n,Dl=n.__values__,WF(Cv,e),t.attr(Cv,e,this);const o=jte[t.type];o&&o.call(this,t,n,e),Fh&&this.style(Fh,e)},style(t,n){if(n!=null){for(const e in F_){let o=e==="font"?Uy(n):n[e];if(o===Dl[e])continue;const f=F_[e];o==null?t.removeAttribute(f):(fM(o)&&(o=pF(o,this._defs.gradient,eN())),t.setAttribute(f,o+"")),Dl[e]=o}for(const e in N_)Xb(t,N_[e],n[e])}},defs(){const t=this._svg,n=this._defs;let e=n.el,o=0;for(const f in n.gradient)e||(n.el=e=Au(t,V1+1,"defs",$s)),o=Rte(e,n.gradient[f],o);for(const f in n.clipping)e||(n.el=e=Au(t,V1+1,"defs",$s)),o=Fte(e,n.clipping[f],o);e&&(o===0?(t.removeChild(e),n.el=null):Xc(e,o))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});function q7(t,n){for(;t&&t.dirty!==n;t=t.mark.group)if(t.dirty=n,t.mark&&t.mark.dirty!==n)t.mark.dirty=n;else return}function Rte(t,n,e){let o,f,r;if(n.gradient==="radial"){let a=Au(t,e++,"pattern",$s);Pd(a,{id:E_+n.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),a=Au(a,0,"rect",$s),Pd(a,{width:1,height:1,fill:"url(".concat(eN(),"#").concat(n.id,")")}),t=Au(t,e++,"radialGradient",$s),Pd(t,{id:n.id,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})}else t=Au(t,e++,"linearGradient",$s),Pd(t,{id:n.id,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2});for(o=0,f=n.stops.length;o{o=t.mark(n,r,o),++f}),Xc(n,1+f)}function H7(t,n,e,o,f){let r=t._svg,a;if(!r&&(a=n.ownerDocument,r=Ld(a,o,$s),t._svg=r,t.mark&&(r.__data__=t,r.__values__={fill:"default"},o==="g"))){const u=Ld(a,"path",$s);r.appendChild(u),u.__data__=t;const c=Ld(a,"g",$s);r.appendChild(c),c.__data__=t;const i=Ld(a,"path",$s);r.appendChild(i),i.__data__=t,i.__values__={fill:"default"}}return(r.ownerSVGElement!==f||Bte(r,e))&&n.insertBefore(r,e?e.nextSibling:n.firstChild),r}function Bte(t,n){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=n}let Fh=null,Dl=null;const jte={group(t,n,e){const o=Fh=n.childNodes[2];Dl=o.__values__,t.foreground(Cv,e,this),Dl=n.__values__,Fh=n.childNodes[1],t.content(Cv,e,this);const f=Fh=n.childNodes[0];t.background(Cv,e,this);const r=e.mark.interactive===!1?"none":null;if(r!==Dl.events&&(ru(o,"pointer-events",r),ru(f,"pointer-events",r),Dl.events=r),e.strokeForeground&&e.stroke){const a=e.fill;ru(o,"display",null),this.style(f,e),ru(f,"stroke",null),a&&(e.fill=null),Dl=o.__values__,this.style(o,e),a&&(e.fill=a),Fh=null}else ru(o,"display","none")},image(t,n,e){e.smooth===!1?(Xb(n,"image-rendering","optimizeSpeed"),Xb(n,"image-rendering","pixelated")):Xb(n,"image-rendering",null)},text(t,n,e){const o=jy(e);let f,r,a,u;Ir(o)?(r=o.map(c=>Qd(e,c)),f=r.join(` +`),f!==Dl.text&&(Xc(n,0),a=n.ownerDocument,u=Kd(e),r.forEach((c,i)=>{const s=Ld(a,"tspan",$s);s.__data__=e,s.textContent=c,i&&(s.setAttribute("x",0),s.setAttribute("dy",u)),n.appendChild(s)}),Dl.text=f)):(r=Qd(e,o),r!==Dl.text&&(n.textContent=r,Dl.text=r)),ru(n,"font-family",Uy(e)),ru(n,"font-size",ah(e)+"px"),ru(n,"font-style",e.fontStyle),ru(n,"font-variant",e.fontVariant),ru(n,"font-weight",e.fontWeight)}};function Cv(t,n,e){n!==Dl[t]&&(e?Ute(Fh,t,n,e):ru(Fh,t,n),Dl[t]=n)}function Xb(t,n,e){e!==Dl[n]&&(e==null?t.style.removeProperty(n):t.style.setProperty(n,e+""),Dl[n]=e)}function Pd(t,n){for(const e in n)ru(t,e,n[e])}function ru(t,n,e){e!=null?t.setAttribute(n,e):t.removeAttribute(n)}function Ute(t,n,e,o){e!=null?t.setAttributeNS(o,n,e):t.removeAttributeNS(o,n)}function eN(){let t;return typeof window>"u"?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function jM(t){oh.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}ni(jM,oh,{svg(){return this._text},_render(t){const n=NM();n.open("svg",pa({},Kv,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}));const e=this._bgcolor;return e&&e!=="transparent"&&e!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:e}).close(),n.open("g",QF,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this},mark(t,n){const e=tc[n.marktype],o=e.tag,f=[WF,e.attr];t.open("g",{class:BF(n),"clip-path":n.clip?pM(this,n,n.group):null},YF(n),{"pointer-events":o!=="g"&&n.interactive===!1?"none":null});const r=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(o,this.attr(n,a,f,o!=="g"?o:null)),o==="text"){const c=jy(a);if(Ir(c)){const i={x:0,dy:Kd(a)};for(let s=0;sthis.mark(t,l)),t.close(),c&&s?(i&&(a.fill=null),a.stroke=s,t.open("path",this.attr(n,a,e.foreground,"bgrect")).close(),i&&(a.fill=i)):t.open("path",this.attr(n,a,e.foreground,"bgfore")).close()}t.close(),u&&t.close()};return e.nested?n.items&&n.items.length&&r(n.items[0]):df(n,r),t.close()},href(t){const n=t.href;let e;if(n){if(e=this._hrefs&&this._hrefs[n])return e;this.sanitizeURL(n).then(o=>{o["xlink:href"]=o.href,o.href=null,(this._hrefs||(this._hrefs={}))[n]=o})}return null},attr(t,n,e,o){const f={},r=(a,u,c,i)=>{f[i||a]=u};return Array.isArray(e)?e.forEach(a=>a(r,n,this)):e(r,n,this),o&&Vte(f,n,t,o,this._defs),f},defs(t){const n=this._defs.gradient,e=this._defs.clipping;if(Object.keys(n).length+Object.keys(e).length!==0){t.open("defs");for(const f in n){const r=n[f],a=r.stops;r.gradient==="radial"?(t.open("pattern",{id:E_+f,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+f+")"}).close(),t.close(),t.open("radialGradient",{id:f,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):t.open("linearGradient",{id:f,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let u=0;u1?(ym[t]=n,this):ym[t]}function aN(t,n,e){const o=[],f=new zs().union(n),r=t.marktype;return r?oN(t,f,e,o):r==="group"?sN(t,f,e,o):Pr("Intersect scene must be mark node or group item.")}function oN(t,n,e,o){if(qte(t,n,e)){const f=t.items,r=t.marktype,a=f.length;let u=0;if(r==="group")for(;u=0;r--)if(e[r]!=o[r])return!1;for(r=e.length-1;r>=0;r--)if(f=e[r],!UM(t[f],n[f],f))return!1;return typeof t==typeof n}function Gte(){_F(),vQ()}const xm="top",Zc="left",ef="right",tp="bottom",Wte="top-left",Yte="top-right",Xte="bottom-left",Zte="bottom-right",VM="start",Nk="middle",iu="end",Jte="x",Kte="y",Lw="group",qM="axis",HM="title",Qte="frame",ene="scope",$M="legend",fN="row-header",hN="row-footer",dN="row-title",pN="column-header",gN="column-footer",mN="column-title",tne="padding",nne="symbol",vN="fit",rne="fit-x",ine="fit-y",ane="pad",GM="none",ab="all",Bk="each",WM="flush",Id="column",zd="row";function yN(t){_r.call(this,null,t)}ni(yN,_r,{transform(t,n){const e=n.dataflow,o=t.mark,f=o.marktype,r=tc[f],a=r.bound;let u=o.bounds,c;if(r.nested)o.items.length&&e.dirty(o.items[0]),u=ob(o,a),o.items.forEach(i=>{i.bounds.clear().union(u)});else if(f===Lw||t.modified())switch(n.visit(n.MOD,i=>e.dirty(i)),u.clear(),o.items.forEach(i=>u.union(ob(i,a))),o.role){case qM:case $M:case HM:n.reflow()}else c=n.changed(n.REM),n.visit(n.ADD,i=>{u.union(ob(i,a))}),n.visit(n.MOD,i=>{c=c||u.alignsWith(i.bounds),e.dirty(i),u.union(ob(i,a))}),c&&(u.clear(),o.items.forEach(i=>u.union(i.bounds)));return uN(o),n.modifies("bounds")}});function ob(t,n,e){return n(t.bounds.clear(),t,e)}const $7=":vega_identifier:";function YM(t){_r.call(this,0,t)}YM.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};ni(YM,_r,{transform(t,n){const e=one(n.dataflow),o=t.as;let f=e.value;return n.visit(n.ADD,r=>r[o]=r[o]||++f),e.set(this.value=f),n}});function one(t){return t._signals[$7]||(t._signals[$7]=t.add(0))}function xN(t){_r.call(this,null,t)}ni(xN,_r,{transform(t,n){let e=this.value;e||(e=n.dataflow.scenegraph().mark(t.markdef,sne(t),t.index),e.group.context=t.context,t.context.group||(t.context.group=e.group),e.source=this.source,e.clip=t.clip,e.interactive=t.interactive,this.value=e);const o=e.marktype===Lw?ww:_w;return n.visit(n.ADD,f=>o.call(f,e)),(t.modified("clip")||t.modified("interactive"))&&(e.clip=t.clip,e.interactive=!!t.interactive,e.zdirty=!0,n.reflow()),e.items=n.source,n}});function sne(t){const n=t.groups,e=t.parent;return n&&n.size===1?n.get(Object.keys(n.object)[0]):n&&e?n.lookup(e):null}function bN(t){_r.call(this,null,t)}const G7={parity:t=>t.filter((n,e)=>e%2?n.opacity=0:1),greedy:(t,n)=>{let e;return t.filter((o,f)=>!f||!_N(e.bounds,o.bounds,n)?(e=o,1):o.opacity=0)}},_N=(t,n,e)=>e>Math.max(n.x1-t.x2,t.x1-n.x2,n.y1-t.y2,t.y1-n.y2),W7=(t,n)=>{for(var e=1,o=t.length,f=t[0].bounds,r;e{const n=t.bounds;return n.width()>1&&n.height()>1},une=(t,n,e)=>{var o=t.range(),f=new zs;return n===xm||n===tp?f.set(o[0],-1/0,o[1],1/0):f.set(-1/0,o[0],1/0,o[1]),f.expand(e||1),r=>f.encloses(r.bounds)},Y7=t=>(t.forEach(n=>n.opacity=1),t),X7=(t,n)=>t.reflow(n.modified()).modifies("opacity");ni(bN,_r,{transform(t,n){const e=G7[t.method]||G7.parity,o=t.separation||0;let f=n.materialize(n.SOURCE).source,r,a;if(!f||!f.length)return;if(!t.method)return t.modified("method")&&(Y7(f),n=X7(n,t)),n;if(f=f.filter(lne),!f.length)return;if(t.sort&&(f=f.slice().sort(t.sort)),r=Y7(f),n=X7(n,t),r.length>=3&&W7(r,o)){do r=e(r,o);while(r.length>=3&&W7(r,o));r.length<3&&!Na(f).opacity&&(r.length>1&&(Na(r).opacity=0),Na(f).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(a=une(t.boundScale,t.boundOrient,+t.boundTolerance),f.forEach(c=>{a(c)||(c.opacity=0)}));const u=r[0].mark.bounds.clear();return f.forEach(c=>{c.opacity&&u.union(c.bounds)}),n}});function wN(t){_r.call(this,null,t)}ni(wN,_r,{transform(t,n){const e=n.dataflow;if(n.visit(n.ALL,o=>e.dirty(o)),n.fields&&n.fields.zindex){const o=n.source&&n.source[0];o&&(o.mark.zdirty=!0)}}});const Pl=new zs;function Xg(t,n,e){return t[n]===e?0:(t[n]=e,1)}function cne(t){var n=t.items[0].orient;return n===Zc||n===ef}function fne(t){let n=+t.grid;return[t.ticks?n++:-1,t.labels?n++:-1,n+ +t.domain]}function hne(t,n,e,o){var f=n.items[0],r=f.datum,a=f.translate!=null?f.translate:.5,u=f.orient,c=fne(r),i=f.range,s=f.offset,l=f.position,d=f.minExtent,h=f.maxExtent,m=r.title&&f.items[c[2]].items[0],g=f.titlePadding,p=f.bounds,v=m&&EM(m),y=0,x=0,w,k;switch(Pl.clear().union(p),p.clear(),(w=c[0])>-1&&p.union(f.items[w].bounds),(w=c[1])>-1&&p.union(f.items[w].bounds),u){case xm:y=l||0,x=-s,k=Math.max(d,Math.min(h,-p.y1)),p.add(0,-k).add(i,0),m&&sb(t,m,k,g,v,0,-1,p);break;case Zc:y=-s,x=l||0,k=Math.max(d,Math.min(h,-p.x1)),p.add(-k,0).add(0,i),m&&sb(t,m,k,g,v,1,-1,p);break;case ef:y=e+s,x=l||0,k=Math.max(d,Math.min(h,p.x2)),p.add(0,0).add(k,i),m&&sb(t,m,k,g,v,1,1,p);break;case tp:y=l||0,x=o+s,k=Math.max(d,Math.min(h,p.y2)),p.add(0,0).add(i,k),m&&sb(t,m,k,g,0,0,1,p);break;default:y=f.x,x=f.y}return Jh(p.translate(y,x),f),Xg(f,"x",y+a)|Xg(f,"y",x+a)&&(f.bounds=Pl,t.dirty(f),f.bounds=p,t.dirty(f)),f.mark.bounds.clear().union(p)}function sb(t,n,e,o,f,r,a,u){const c=n.bounds;if(n.auto){const i=a*(e+f+o);let s=0,l=0;t.dirty(n),r?s=(n.x||0)-(n.x=i):l=(n.y||0)-(n.y=i),n.mark.bounds.clear().union(c.translate(-s,-l)),t.dirty(n)}u.union(c)}const Z7=(t,n)=>Math.floor(Math.min(t,n)),J7=(t,n)=>Math.ceil(Math.max(t,n));function dne(t){var n=t.items,e=n.length,o=0,f,r;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o1)for(T=0;T0&&(x[T]+=O/2);if(u&&Wo(e.center,zd)&&s!==1)for(T=0;T0&&(w[T]+=R/2);for(T=0;Tf&&(t.warn("Grid headers exceed limit: "+f),n=n.slice(0,f)),g+=r,y=0,w=n.length;y=0&&(T=e[x])==null;x-=d);u?(_=h==null?T.x:Math.round(T.bounds.x1+h*T.bounds.width()),M=g):(_=g,M=h==null?T.y:Math.round(T.bounds.y1+h*T.bounds.height())),k.union(b.bounds.translate(_-(b.x||0),M-(b.y||0))),b.x=_,b.y=M,t.dirty(b),p=a(p,k[i])}return p}function Q7(t,n,e,o,f,r){if(!!n){t.dirty(n);var a=e,u=e;o?a=Math.round(f.x1+r*f.width()):u=Math.round(f.y1+r*f.height()),n.bounds.translate(a-(n.x||0),u-(n.y||0)),n.mark.bounds.clear().union(n.bounds),n.x=a,n.y=u,t.dirty(n)}}function xne(t,n){const e=t[n]||{};return(o,f)=>e[o]!=null?e[o]:t[o]!=null?t[o]:f}function bne(t,n){let e=-1/0;return t.forEach(o=>{o.offset!=null&&(e=Math.max(e,o.offset))}),e>-1/0?e:n}function _ne(t,n,e,o,f,r,a){const u=xne(e,n),c=bne(t,u("offset",0)),i=u("anchor",VM),s=i===iu?1:i===Nk?.5:0,l={align:Bk,bounds:u("bounds",WM),columns:u("direction")==="vertical"?1:t.length,padding:u("margin",8),center:u("center"),nodirty:!0};switch(n){case Zc:l.anchor={x:Math.floor(o.x1)-c,column:iu,y:s*(a||o.height()+2*o.y1),row:i};break;case ef:l.anchor={x:Math.ceil(o.x2)+c,y:s*(a||o.height()+2*o.y1),row:i};break;case xm:l.anchor={y:Math.floor(f.y1)-c,row:iu,x:s*(r||f.width()+2*f.x1),column:i};break;case tp:l.anchor={y:Math.ceil(f.y2)+c,x:s*(r||f.width()+2*f.x1),column:i};break;case Wte:l.anchor={x:c,y:c};break;case Yte:l.anchor={x:r-c,y:c,column:iu};break;case Xte:l.anchor={x:c,y:a-c,row:iu};break;case Zte:l.anchor={x:r-c,y:a-c,column:iu,row:iu};break}return l}function wne(t,n){var e=n.items[0],o=e.datum,f=e.orient,r=e.bounds,a=e.x,u=e.y,c,i;return e._bounds?e._bounds.clear().union(r):e._bounds=r.clone(),r.clear(),Tne(t,e,e.items[0].items[0]),r=kne(e,r),c=2*e.padding,i=2*e.padding,r.empty()||(c=Math.ceil(r.width()+c),i=Math.ceil(r.height()+i)),o.type===nne&&Ane(e.items[0].items[0].items[0].items),f!==GM&&(e.x=a=0,e.y=u=0),e.width=c,e.height=i,Jh(r.set(a,u,a+c,u+i),e),e.mark.bounds.clear().union(r),e}function kne(t,n){return t.items.forEach(e=>n.union(e.bounds)),n.x1=t.padding,n.y1=t.padding,n}function Tne(t,n,e){var o=n.padding,f=o-e.x,r=o-e.y;if(!n.datum.title)(f||r)&&q1(t,e,f,r);else{var a=n.items[1].items[0],u=a.anchor,c=n.titlePadding||0,i=o-a.x,s=o-a.y;switch(a.orient){case Zc:f+=Math.ceil(a.bounds.width())+c;break;case ef:case tp:break;default:r+=a.bounds.height()+c}switch((f||r)&&q1(t,e,f,r),a.orient){case Zc:s+=Dg(n,e,a,u,1,1);break;case ef:i+=Dg(n,e,a,iu,0,0)+c,s+=Dg(n,e,a,u,1,1);break;case tp:i+=Dg(n,e,a,u,0,0),s+=Dg(n,e,a,iu,-1,0,1)+c;break;default:i+=Dg(n,e,a,u,0,0)}(i||s)&&q1(t,a,i,s),(i=Math.round(a.bounds.x1-o))<0&&(q1(t,e,-i,0),q1(t,a,-i,0))}}function Dg(t,n,e,o,f,r,a){const u=t.datum.type!=="symbol",c=e.datum.vgrad,i=u&&(r||!c)&&!a?n.items[0]:n,s=i.bounds[f?"y2":"x2"]-t.padding,l=c&&r?s:0,d=c&&r?0:s,h=f<=0?0:EM(e);return Math.round(o===VM?l:o===iu?d-h:.5*(s-h))}function q1(t,n,e,o){n.x+=e,n.y+=o,n.bounds.translate(e,o),n.mark.bounds.translate(e,o),t.dirty(n)}function Ane(t){const n=t.reduce((e,o)=>(e[o.column]=Math.max(o.bounds.x2-o.x,e[o.column]||0),e),{});t.forEach(e=>{e.width=n[e.column],e.height=e.bounds.y2-e.y})}function Mne(t,n,e,o,f){var r=n.items[0],a=r.frame,u=r.orient,c=r.anchor,i=r.offset,s=r.padding,l=r.items[0].items[0],d=r.items[1]&&r.items[1].items[0],h=u===Zc||u===ef?o:e,m=0,g=0,p=0,v=0,y=0,x;if(a!==Lw?u===Zc?(m=f.y2,h=f.y1):u===ef?(m=f.y1,h=f.y2):(m=f.x1,h=f.x2):u===Zc&&(m=o,h=0),x=c===VM?m:c===iu?h:(m+h)/2,d&&d.text){switch(u){case xm:case tp:y=l.bounds.height()+s;break;case Zc:v=l.bounds.width()+s;break;case ef:v=-l.bounds.width()-s;break}Pl.clear().union(d.bounds),Pl.translate(v-(d.x||0),y-(d.y||0)),Xg(d,"x",v)|Xg(d,"y",y)&&(t.dirty(d),d.bounds.clear().union(Pl),d.mark.bounds.clear().union(Pl),t.dirty(d)),Pl.clear().union(d.bounds)}else Pl.clear();switch(Pl.union(l.bounds),u){case xm:g=x,p=f.y1-Pl.height()-i;break;case Zc:g=f.x1-Pl.width()-i,p=x;break;case ef:g=f.x2+Pl.width()+i,p=x;break;case tp:g=x,p=f.y2+i;break;default:g=r.x,p=r.y}return Xg(r,"x",g)|Xg(r,"y",p)&&(Pl.translate(g,p),t.dirty(r),r.bounds.clear().union(Pl),n.bounds.clear().union(Pl),t.dirty(r)),r.bounds}function TN(t){_r.call(this,null,t)}ni(TN,_r,{transform(t,n){const e=n.dataflow;return t.mark.items.forEach(o=>{t.layout&&mne(e,o,t.layout),Ene(e,o,t)}),Sne(t.mark.group)?n.reflow():n}});function Sne(t){return t&&t.mark.role!=="legend-entry"}function Ene(t,n,e){var o=n.items,f=Math.max(0,n.width||0),r=Math.max(0,n.height||0),a=new zs().set(0,0,f,r),u=a.clone(),c=a.clone(),i=[],s,l,d,h,m,g;for(m=0,g=o.length;m{d=v.orient||ef,d!==GM&&(p[d]||(p[d]=[])).push(v)});for(const v in p){const y=p[v];kN(t,y,_ne(y,v,e.legends,u,c,f,r))}i.forEach(v=>{const y=v.bounds;if(y.equals(v._bounds)||(v.bounds=v._bounds,t.dirty(v),v.bounds=y,t.dirty(v)),e.autosize&&e.autosize.type===vN)switch(v.orient){case Zc:case ef:a.add(y.x1,0).add(y.x2,0);break;case xm:case tp:a.add(0,y.y1).add(0,y.y2)}else a.union(y)})}a.union(u).union(c),s&&a.union(Mne(t,s,f,r,a)),n.clip&&a.set(0,0,n.width||0,n.height||0),Cne(t,n,a,e)}function Cne(t,n,e,o){const f=o.autosize||{},r=f.type;if(t._autosize<1||!r)return;let a=t._width,u=t._height,c=Math.max(0,n.width||0),i=Math.max(0,Math.ceil(-e.x1)),s=Math.max(0,n.height||0),l=Math.max(0,Math.ceil(-e.y1));const d=Math.max(0,Math.ceil(e.x2-c)),h=Math.max(0,Math.ceil(e.y2-s));if(f.contains===tne){const m=t.padding();a-=m.left+m.right,u-=m.top+m.bottom}r===GM?(i=0,l=0,c=a,s=u):r===vN?(c=Math.max(0,a-i-d),s=Math.max(0,u-l-h)):r===rne?(c=Math.max(0,a-i-d),u=s+l+h):r===ine?(a=c+i+d,s=Math.max(0,u-l-h)):r===ane&&(a=c+i+d,u=s+l+h),t._resizeView(a,u,c,s,[i,l],f.resize)}var One=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",bound:yN,identifier:YM,mark:xN,overlap:bN,render:wN,viewlayout:TN});function AN(t){_r.call(this,null,t)}ni(AN,_r,{transform(t,n){if(this.value&&!t.modified())return n.StopPropagation;var e=n.dataflow.locale(),o=n.fork(n.NO_SOURCE|n.NO_FIELDS),f=this.value,r=t.scale,a=t.count==null?t.values?t.values.length:10:t.count,u=uM(r,a,t.minstep),c=t.format||sF(e,r,u,t.formatSpecifier,t.formatType,!!t.values),i=t.values?oF(r,t.values,u):cM(r,u);return f&&(o.rem=f),f=i.map((s,l)=>ro({index:l/(i.length-1||1),value:s,label:c(s)})),t.extra&&f.length&&f.push(ro({index:-1,extra:{value:f[0].value},label:""})),o.source=f,o.add=f,this.value=f,o}});function MN(t){_r.call(this,null,t)}function Lne(){return ro({})}function Pne(t){const n=Hm().test(e=>e.exit);return n.lookup=e=>n.get(t(e)),n}ni(MN,_r,{transform(t,n){var e=n.dataflow,o=n.fork(n.NO_SOURCE|n.NO_FIELDS),f=t.item||Lne,r=t.key||$i,a=this.value;return Ir(o.encode)&&(o.encode=null),a&&(t.modified("key")||n.modified(r))&&Pr("DataJoin does not support modified key function or fields."),a||(n=n.addAll(),this.value=a=Pne(r)),n.visit(n.ADD,u=>{const c=r(u);let i=a.get(c);i?i.exit?(a.empty--,o.add.push(i)):o.mod.push(i):(i=f(u),a.set(c,i),o.add.push(i)),i.datum=u,i.exit=!1}),n.visit(n.MOD,u=>{const c=r(u),i=a.get(c);i&&(i.datum=u,o.mod.push(i))}),n.visit(n.REM,u=>{const c=r(u),i=a.get(c);u===i.datum&&!i.exit&&(o.rem.push(i),i.exit=!0,++a.empty)}),n.changed(n.ADD_MOD)&&o.modifies("datum"),(n.clean()||t.clean&&a.empty>e.cleanThreshold)&&e.runAfter(a.clean),o}});function SN(t){_r.call(this,null,t)}ni(SN,_r,{transform(t,n){var e=n.fork(n.ADD_REM),o=t.mod||!1,f=t.encoders,r=n.encode;if(Ir(r))if(e.changed()||r.every(l=>f[l]))r=r[0],e.encode=null;else return n.StopPropagation;var a=r==="enter",u=f.update||yd,c=f.enter||yd,i=f.exit||yd,s=(r&&!a?f[r]:u)||yd;if(n.changed(n.ADD)&&(n.visit(n.ADD,l=>{c(l,t),u(l,t)}),e.modifies(c.output),e.modifies(u.output),s!==yd&&s!==u&&(n.visit(n.ADD,l=>{s(l,t)}),e.modifies(s.output))),n.changed(n.REM)&&i!==yd&&(n.visit(n.REM,l=>{i(l,t)}),e.modifies(i.output)),a||s!==yd){const l=n.MOD|(t.modified()?n.REFLOW:0);a?(n.visit(l,d=>{const h=c(d,t)||o;(s(d,t)||h)&&e.mod.push(d)}),e.mod.length&&e.modifies(c.output)):n.visit(l,d=>{(s(d,t)||o)&&e.mod.push(d)}),e.mod.length&&e.modifies(s.output)}return e.changed()?e:n.StopPropagation}});function EN(t){_r.call(this,[],t)}ni(EN,_r,{transform(t,n){if(this.value!=null&&!t.modified())return n.StopPropagation;var e=n.dataflow.locale(),o=n.fork(n.NO_SOURCE|n.NO_FIELDS),f=this.value,r=t.type||Vb,a=t.scale,u=+t.limit,c=uM(a,t.count==null?5:t.count,t.minstep),i=!!t.values||r===Vb,s=t.format||fF(e,a,c,r,t.formatSpecifier,t.formatType,i),l=t.values||cF(a,c),d,h,m,g,p;return f&&(o.rem=f),r===Vb?(u&&l.length>u?(n.dataflow.warn("Symbol legend count exceeds limit, filtering items."),f=l.slice(0,u-1),p=!0):f=l,ga(m=t.size)?(!t.values&&a(f[0])===0&&(f=f.slice(1)),g=f.reduce((v,y)=>Math.max(v,m(y,t)),0)):m=$l(g=m||8),f=f.map((v,y)=>ro({index:y,label:s(v,y,f),value:v,offset:g,size:m(v,t)})),p&&(p=l[f.length],f.push(ro({index:f.length,label:"\u2026".concat(l.length-f.length," entries"),value:p,offset:g,size:m(p,t)})))):r===iQ?(d=a.domain(),h=rF(a,d[0],Na(d)),l.length<3&&!t.values&&d[0]!==Na(d)&&(l=[d[0],Na(d)]),f=l.map((v,y)=>ro({index:y,label:s(v,y,l),value:v,perc:h(v)}))):(m=l.length-1,h=gQ(a),f=l.map((v,y)=>ro({index:y,label:s(v,y,l),value:v,perc:y?h(v):0,perc2:y===m?1:h(l[y+1])}))),o.source=f,o.add=f,this.value=f,o}});const Dne=t=>t.source.x,Ine=t=>t.source.y,zne=t=>t.target.x,Rne=t=>t.target.y;function XM(t){_r.call(this,{},t)}XM.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};ni(XM,_r,{transform(t,n){var e=t.sourceX||Dne,o=t.sourceY||Ine,f=t.targetX||zne,r=t.targetY||Rne,a=t.as||"path",u=t.orient||"vertical",c=t.shape||"line",i=eO.get(c+"-"+u)||eO.get(c);return i||Pr("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),n.visit(n.SOURCE,s=>{s[a]=i(e(s),o(s),f(s),r(s))}),n.reflow(t.modified()).modifies(a)}});const CN=(t,n,e,o)=>"M"+t+","+n+"L"+e+","+o,Fne=(t,n,e,o)=>CN(n*Math.cos(t),n*Math.sin(t),o*Math.cos(e),o*Math.sin(e)),ON=(t,n,e,o)=>{var f=e-t,r=o-n,a=Math.sqrt(f*f+r*r)/2,u=180*Math.atan2(r,f)/Math.PI;return"M"+t+","+n+"A"+a+","+a+" "+u+" 0 1 "+e+","+o},Nne=(t,n,e,o)=>ON(n*Math.cos(t),n*Math.sin(t),o*Math.cos(e),o*Math.sin(e)),LN=(t,n,e,o)=>{const f=e-t,r=o-n,a=.2*(f+r),u=.2*(r-f);return"M"+t+","+n+"C"+(t+a)+","+(n+u)+" "+(e+u)+","+(o-a)+" "+e+","+o},Bne=(t,n,e,o)=>LN(n*Math.cos(t),n*Math.sin(t),o*Math.cos(e),o*Math.sin(e)),jne=(t,n,e,o)=>"M"+t+","+n+"V"+o+"H"+e,Une=(t,n,e,o)=>"M"+t+","+n+"H"+e+"V"+o,Vne=(t,n,e,o)=>{const f=Math.cos(t),r=Math.sin(t),a=Math.cos(e),u=Math.sin(e),c=Math.abs(e-t)>Math.PI?e<=t:e>t;return"M"+n*f+","+n*r+"A"+n+","+n+" 0 0,"+(c?1:0)+" "+n*a+","+n*u+"L"+o*a+","+o*u},qne=(t,n,e,o)=>{const f=(t+e)/2;return"M"+t+","+n+"C"+f+","+n+" "+f+","+o+" "+e+","+o},Hne=(t,n,e,o)=>{const f=(n+o)/2;return"M"+t+","+n+"C"+t+","+f+" "+e+","+f+" "+e+","+o},$ne=(t,n,e,o)=>{const f=Math.cos(t),r=Math.sin(t),a=Math.cos(e),u=Math.sin(e),c=(n+o)/2;return"M"+n*f+","+n*r+"C"+c*f+","+c*r+" "+c*a+","+c*u+" "+o*a+","+o*u},eO=Hm({line:CN,"line-radial":Fne,arc:ON,"arc-radial":Nne,curve:LN,"curve-radial":Bne,"orthogonal-horizontal":jne,"orthogonal-vertical":Une,"orthogonal-radial":Vne,"diagonal-horizontal":qne,"diagonal-vertical":Hne,"diagonal-radial":$ne});function ZM(t){_r.call(this,null,t)}ZM.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};ni(ZM,_r,{transform(t,n){var e=t.as||["startAngle","endAngle"],o=e[0],f=e[1],r=t.field||Um,a=t.startAngle||0,u=t.endAngle!=null?t.endAngle:2*Math.PI,c=n.source,i=c.map(r),s=i.length,l=a,d=(u-a)/MI(i),h=Ju(s),m,g,p;for(t.sort&&h.sort((v,y)=>i[v]-i[y]),m=0;m-1)return o;var f=n.domain,r=t.type,a=n.zero||n.zero===void 0&&Wne(t),u,c;if(!f)return 0;if(PN(r)&&n.padding&&f[0]!==Na(f)&&(f=Qne(r,f,n.range,n.padding,n.exponent,n.constant)),(a||n.domainMin!=null||n.domainMax!=null||n.domainMid!=null)&&(u=(f=f.slice()).length-1||1,a&&(f[0]>0&&(f[0]=0),f[u]<0&&(f[u]=0)),n.domainMin!=null&&(f[0]=n.domainMin),n.domainMax!=null&&(f[u]=n.domainMax),n.domainMid!=null)){c=n.domainMid;const i=c>f[u]?u+1:cf+(r<0?-1:r>0?1:0),0));o!==n.length&&e.warn("Log scale domain includes zero: "+oi(n))}return n}function ere(t,n,e){let o=n.bins;if(o&&!Ir(o)){const f=t.domain(),r=f[0],a=Na(f),u=o.step;let c=o.start==null?r:o.start,i=o.stop==null?a:o.stop;u||Pr("Scale bins parameter missing step property."),ca&&(i=u*Math.floor(a/u)),o=Ju(c,i+u/2,u)}return o?t.bins=o:t.bins&&delete t.bins,t.type===rM&&(o?!n.domain&&!n.domainRaw&&(t.domain(o),e=o.length):t.bins=t.domain()),e}function tre(t,n,e){var o=t.type,f=n.round||!1,r=n.range;if(n.rangeStep!=null)r=nre(o,n,e);else if(n.scheme&&(r=rre(o,n,e),ga(r))){if(t.interpolator)return t.interpolator(r);Pr("Scale type ".concat(o," does not support interpolating color schemes."))}if(r&&QR(o))return t.interpolator(xw(jk(r,n.reverse),n.interpolate,n.interpolateGamma));r&&n.interpolate&&t.interpolate?t.interpolate(sM(n.interpolate,n.interpolateGamma)):ga(t.round)?t.round(f):ga(t.rangeRound)&&t.interpolate(f?$2:ky),r&&t.range(jk(r,n.reverse))}function nre(t,n,e){t!==YR&&t!==Ak&&Pr("Only band and point scales support rangeStep.");var o=(n.paddingOuter!=null?n.paddingOuter:n.padding)||0,f=t===Ak?1:(n.paddingInner!=null?n.paddingInner:n.padding)||0;return[0,n.rangeStep*tM(e,f,o)]}function rre(t,n,e){var o=n.schemeExtent,f,r;return Ir(n.scheme)?r=xw(n.scheme,n.interpolate,n.interpolateGamma):(f=n.scheme.toLowerCase(),r=lM(f),r||Pr("Unrecognized scheme name: ".concat(n.scheme))),e=t===yw?e+1:t===rM?e-1:t===dm||t===vw?+n.schemeCount||Gne:e,QR(t)?tO(r,o,n.reverse):ga(r)?nF(tO(r,o),e):t===nM?r:r.slice(0,e)}function tO(t,n,e){return ga(t)&&(n||e)?tF(t,jk(n||[0,1],e)):t}function jk(t,n){return n?t.slice().reverse():t}function zN(t){_r.call(this,null,t)}ni(zN,_r,{transform(t,n){const e=t.modified("sort")||n.changed(n.ADD)||n.modified(t.sort.fields)||n.modified("datum");return e&&n.source.sort(H0(t.sort)),this.modified(e),n}});const nO="zero",RN="center",FN="normalize",NN=["y0","y1"];function JM(t){_r.call(this,null,t)}JM.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:nO,values:[nO,RN,FN]},{name:"as",type:"string",array:!0,length:2,default:NN}]};ni(JM,_r,{transform(t,n){var e=t.as||NN,o=e[0],f=e[1],r=H0(t.sort),a=t.field||Um,u=t.offset===RN?ire:t.offset===FN?are:ore,c,i,s,l;for(c=sre(n.source,t.groupby,r,a),i=0,s=c.length,l=c.max;ig(s),a,u,c,i,s,l,d,h,m;if(n==null)f.push(t.slice());else for(a={},u=0,c=t.length;um&&(m=h),e&&d.sort(e)}return f.max=m,f}var lre=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",axisticks:AN,datajoin:MN,encode:SN,legendentries:EN,linkpath:XM,pie:ZM,scale:DN,sortitems:zN,stack:JM}),Xi=1e-6,B_=1e-12,Sa=Math.PI,ys=Sa/2,j_=Sa/4,du=Sa*2,Os=180/Sa,Ea=Sa/180,Va=Math.abs,Zm=Math.atan,xc=Math.atan2,Zi=Math.cos,ub=Math.ceil,BN=Math.exp,Uk=Math.hypot,U_=Math.log,Z5=Math.pow,Gi=Math.sin,fc=Math.sign||function(t){return t>0?1:t<0?-1:0},pu=Math.sqrt,KM=Math.tan;function jN(t){return t>1?0:t<-1?Sa:Math.acos(t)}function Iu(t){return t>1?ys:t<-1?-ys:Math.asin(t)}function bl(){}function V_(t,n){t&&iO.hasOwnProperty(t.type)&&iO[t.type](t,n)}var rO={Feature:function(t,n){V_(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,o=-1,f=e.length;++o=0?1:-1,f=o*e,r=Zi(n),a=Gi(n),u=$k*a,c=Hk*r+u*Zi(f),i=u*o*Gi(f);q_.add(xc(i,c)),qk=t,Hk=r,$k=a}function hre(t){return H_=new fu,Dh(t,Kf),H_*2}function $_(t){return[xc(t[1],t[0]),Iu(t[2])]}function T0(t){var n=t[0],e=t[1],o=Zi(e);return[o*Zi(n),o*Gi(n),Gi(e)]}function cb(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function bm(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function J5(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function fb(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function G_(t){var n=pu(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var us,ku,ms,Yu,Jp,HN,$N,tm,Ov,kd,Yh,Oh={point:Gk,lineStart:oO,lineEnd:sO,polygonStart:function(){Oh.point=WN,Oh.lineStart=dre,Oh.lineEnd=pre,Ov=new fu,Kf.polygonStart()},polygonEnd:function(){Kf.polygonEnd(),Oh.point=Gk,Oh.lineStart=oO,Oh.lineEnd=sO,q_<0?(us=-(ms=180),ku=-(Yu=90)):Ov>Xi?Yu=90:Ov<-Xi&&(ku=-90),Yh[0]=us,Yh[1]=ms},sphere:function(){us=-(ms=180),ku=-(Yu=90)}};function Gk(t,n){kd.push(Yh=[us=t,ms=t]),nYu&&(Yu=n)}function GN(t,n){var e=T0([t*Ea,n*Ea]);if(tm){var o=bm(tm,e),f=[o[1],-o[0],0],r=bm(f,o);G_(r),r=$_(r);var a=t-Jp,u=a>0?1:-1,c=r[0]*Os*u,i,s=Va(a)>180;s^(u*JpYu&&(Yu=i)):(c=(c+360)%360-180,s^(u*JpYu&&(Yu=n))),s?tWu(us,ms)&&(ms=t):Wu(t,ms)>Wu(us,ms)&&(us=t):ms>=us?(tms&&(ms=t)):t>Jp?Wu(us,t)>Wu(us,ms)&&(ms=t):Wu(t,ms)>Wu(us,ms)&&(us=t)}else kd.push(Yh=[us=t,ms=t]);nYu&&(Yu=n),tm=e,Jp=t}function oO(){Oh.point=GN}function sO(){Yh[0]=us,Yh[1]=ms,Oh.point=Gk,tm=null}function WN(t,n){if(tm){var e=t-Jp;Ov.add(Va(e)>180?e+(e>0?360:-360):e)}else HN=t,$N=n;Kf.point(t,n),GN(t,n)}function dre(){Kf.lineStart()}function pre(){WN(HN,$N),Kf.lineEnd(),Va(Ov)>Xi&&(us=-(ms=180)),Yh[0]=us,Yh[1]=ms,tm=null}function Wu(t,n){return(n-=t)<0?n+360:n}function gre(t,n){return t[0]-n[0]}function lO(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nWu(o[0],o[1])&&(o[1]=f[1]),Wu(f[0],o[1])>Wu(o[0],o[1])&&(o[0]=f[0])):r.push(o=f);for(a=-1/0,e=r.length-1,n=0,o=r[e];n<=e;o=f,++n)f=r[n],(u=Wu(o[1],f[0]))>a&&(a=u,us=f[0],ms=o[1])}return kd=Yh=null,us===1/0||ku===1/0?[[NaN,NaN],[NaN,NaN]]:[[us,ku],[ms,Yu]]}var hv,W_,Y_,X_,Z_,J_,K_,Q_,Wk,Yk,Xk,YN,XN,au,ou,su,tf={sphere:bl,point:QM,lineStart:uO,lineEnd:cO,polygonStart:function(){tf.lineStart=xre,tf.lineEnd=bre},polygonEnd:function(){tf.lineStart=uO,tf.lineEnd=cO}};function QM(t,n){t*=Ea,n*=Ea;var e=Zi(n);qy(e*Zi(t),e*Gi(t),Gi(n))}function qy(t,n,e){++hv,Y_+=(t-Y_)/hv,X_+=(n-X_)/hv,Z_+=(e-Z_)/hv}function uO(){tf.point=vre}function vre(t,n){t*=Ea,n*=Ea;var e=Zi(n);au=e*Zi(t),ou=e*Gi(t),su=Gi(n),tf.point=yre,qy(au,ou,su)}function yre(t,n){t*=Ea,n*=Ea;var e=Zi(n),o=e*Zi(t),f=e*Gi(t),r=Gi(n),a=xc(pu((a=ou*r-su*f)*a+(a=su*o-au*r)*a+(a=au*f-ou*o)*a),au*o+ou*f+su*r);W_+=a,J_+=a*(au+(au=o)),K_+=a*(ou+(ou=f)),Q_+=a*(su+(su=r)),qy(au,ou,su)}function cO(){tf.point=QM}function xre(){tf.point=_re}function bre(){ZN(YN,XN),tf.point=QM}function _re(t,n){YN=t,XN=n,t*=Ea,n*=Ea,tf.point=ZN;var e=Zi(n);au=e*Zi(t),ou=e*Gi(t),su=Gi(n),qy(au,ou,su)}function ZN(t,n){t*=Ea,n*=Ea;var e=Zi(n),o=e*Zi(t),f=e*Gi(t),r=Gi(n),a=ou*r-su*f,u=su*o-au*r,c=au*f-ou*o,i=Uk(a,u,c),s=Iu(i),l=i&&-s/i;Wk.add(l*a),Yk.add(l*u),Xk.add(l*c),W_+=s,J_+=s*(au+(au=o)),K_+=s*(ou+(ou=f)),Q_+=s*(su+(su=r)),qy(au,ou,su)}function wre(t){hv=W_=Y_=X_=Z_=J_=K_=Q_=0,Wk=new fu,Yk=new fu,Xk=new fu,Dh(t,tf);var n=+Wk,e=+Yk,o=+Xk,f=Uk(n,e,o);return fSa?t+Math.round(-t/du)*du:t,n]}Jk.invert=Jk;function JN(t,n,e){return(t%=du)?n||e?Zk(hO(t),dO(n,e)):hO(t):n||e?dO(n,e):Jk}function fO(t){return function(n,e){return n+=t,[n>Sa?n-du:n<-Sa?n+du:n,e]}}function hO(t){var n=fO(t);return n.invert=fO(-t),n}function dO(t,n){var e=Zi(t),o=Gi(t),f=Zi(n),r=Gi(n);function a(u,c){var i=Zi(c),s=Zi(u)*i,l=Gi(u)*i,d=Gi(c),h=d*e+s*o;return[xc(l*f-h*r,s*e-d*o),Iu(h*f+l*r)]}return a.invert=function(u,c){var i=Zi(c),s=Zi(u)*i,l=Gi(u)*i,d=Gi(c),h=d*f-l*r;return[xc(l*f+d*r,s*e+h*o),Iu(h*e-s*o)]},a}function kre(t){t=JN(t[0]*Ea,t[1]*Ea,t.length>2?t[2]*Ea:0);function n(e){return e=t(e[0]*Ea,e[1]*Ea),e[0]*=Os,e[1]*=Os,e}return n.invert=function(e){return e=t.invert(e[0]*Ea,e[1]*Ea),e[0]*=Os,e[1]*=Os,e},n}function Tre(t,n,e,o,f,r){if(!!e){var a=Zi(n),u=Gi(n),c=o*e;f==null?(f=n+o*du,r=n-c/2):(f=pO(a,f),r=pO(a,r),(o>0?fr)&&(f+=o*du));for(var i,s=f;o>0?s>r:s1&&t.push(t.pop().concat(t.shift()))},result:function(){var e=t;return t=[],n=null,e}}}function Zb(t,n){return Va(t[0]-n[0])=0;--u)f.point((l=s[u])[0],l[1]);else o(d.x,d.p.x,-1,f);d=d.p}d=d.o,s=d.z,h=!h}while(!d.v);f.lineEnd()}}}function gO(t){if(!!(n=t.length)){for(var n,e=0,o=t[0],f;++e=0?1:-1,A=M*_,S=A>Sa,E=p*b;if(c.add(xc(E*M*Gi(A),v*T+E*Zi(A))),a+=S?_+M*du:_,S^m>=e^w>=e){var D=bm(T0(h),T0(x));G_(D);var O=bm(r,D);G_(O);var R=(S^_>=0?-1:1)*Iu(O[2]);(o>R||o===R&&(D[0]||D[1]))&&(u+=S^_>=0?1:-1)}}return(a<-Xi||a0){for(c||(f.polygonStart(),c=!0),f.lineStart(),b=0;b<_;++b)f.point((A=M[b])[0],A[1]);f.lineEnd()}return}T>1&&w&2&&k.push(k.pop().concat(k.shift())),s.push(k.filter(Mre))}}return d}}function Mre(t){return t.length>1}function Sre(t,n){return((t=t.x)[0]<0?t[1]-ys-Xi:ys-t[1])-((n=n.x)[0]<0?n[1]-ys-Xi:ys-n[1])}var mO=eB(function(){return!0},Ere,Ore,[-Sa,-ys]);function Ere(t){var n=NaN,e=NaN,o=NaN,f;return{lineStart:function(){t.lineStart(),f=1},point:function(r,a){var u=r>0?Sa:-Sa,c=Va(r-n);Va(c-Sa)0?ys:-ys),t.point(o,e),t.lineEnd(),t.lineStart(),t.point(u,e),t.point(r,e),f=0):o!==u&&c>=Sa&&(Va(n-o)Xi?Zm((Gi(n)*(r=Zi(o))*Gi(e)-Gi(o)*(f=Zi(n))*Gi(t))/(f*r*a)):(n+o)/2}function Ore(t,n,e,o){var f;if(t==null)f=e*ys,o.point(-Sa,f),o.point(0,f),o.point(Sa,f),o.point(Sa,0),o.point(Sa,-f),o.point(0,-f),o.point(-Sa,-f),o.point(-Sa,0),o.point(-Sa,f);else if(Va(t[0]-n[0])>Xi){var r=t[0]0,f=Va(n)>Xi;function r(s,l,d,h){Tre(h,t,e,d,s,l)}function a(s,l){return Zi(s)*Zi(l)>n}function u(s){var l,d,h,m,g;return{lineStart:function(){m=h=!1,g=1},point:function(p,v){var y=[p,v],x,w=a(p,v),k=o?w?0:i(p,v):w?i(p+(p<0?Sa:-Sa),v):0;if(!l&&(m=h=w)&&s.lineStart(),w!==h&&(x=c(l,y),(!x||Zb(l,x)||Zb(y,x))&&(y[2]=1)),w!==h)g=0,w?(s.lineStart(),x=c(y,l),s.point(x[0],x[1])):(x=c(l,y),s.point(x[0],x[1],2),s.lineEnd()),l=x;else if(f&&l&&o^w){var b;!(k&d)&&(b=c(y,l,!0))&&(g=0,o?(s.lineStart(),s.point(b[0][0],b[0][1]),s.point(b[1][0],b[1][1]),s.lineEnd()):(s.point(b[1][0],b[1][1]),s.lineEnd(),s.lineStart(),s.point(b[0][0],b[0][1],3)))}w&&(!l||!Zb(l,y))&&s.point(y[0],y[1]),l=y,h=w,d=k},lineEnd:function(){h&&s.lineEnd(),l=null},clean:function(){return g|(m&&h)<<1}}}function c(s,l,d){var h=T0(s),m=T0(l),g=[1,0,0],p=bm(h,m),v=cb(p,p),y=p[0],x=v-y*y;if(!x)return!d&&s;var w=n*v/x,k=-n*y/x,b=bm(g,p),T=fb(g,w),_=fb(p,k);J5(T,_);var M=b,A=cb(T,M),S=cb(M,M),E=A*A-S*(cb(T,T)-1);if(!(E<0)){var D=pu(E),O=fb(M,(-A-D)/S);if(J5(O,T),O=$_(O),!d)return O;var R=s[0],z=l[0],L=s[1],P=l[1],N;z0^O[1]<(Va(O[0]-R)Sa^(R<=O[0]&&O[0]<=z)){var K=fb(M,(-A+D)/S);return J5(K,T),[O,$_(K)]}}}function i(s,l){var d=o?t:Sa-t,h=0;return s<-d?h|=1:s>d&&(h|=2),l<-d?h|=4:l>d&&(h|=8),h}return eB(a,u,r,o?[0,-t]:[-Sa,t-Sa])}function Pre(t,n,e,o,f,r){var a=t[0],u=t[1],c=n[0],i=n[1],s=0,l=1,d=c-a,h=i-u,m;if(m=e-a,!(!d&&m>0)){if(m/=d,d<0){if(m0){if(m>l)return;m>s&&(s=m)}if(m=f-a,!(!d&&m<0)){if(m/=d,d<0){if(m>l)return;m>s&&(s=m)}else if(d>0){if(m0)){if(m/=h,h<0){if(m0){if(m>l)return;m>s&&(s=m)}if(m=r-u,!(!h&&m<0)){if(m/=h,h<0){if(m>l)return;m>s&&(s=m)}else if(h>0){if(m0&&(t[0]=a+s*d,t[1]=u+s*h),l<1&&(n[0]=a+l*d,n[1]=u+l*h),!0}}}}}var dv=1e9,db=-dv;function tB(t,n,e,o){function f(i,s){return t<=i&&i<=e&&n<=s&&s<=o}function r(i,s,l,d){var h=0,m=0;if(i==null||(h=a(i,l))!==(m=a(s,l))||c(i,s)<0^l>0)do d.point(h===0||h===3?t:e,h>1?o:n);while((h=(h+l+4)%4)!==m);else d.point(s[0],s[1])}function a(i,s){return Va(i[0]-t)0?0:3:Va(i[0]-e)0?2:1:Va(i[1]-n)0?1:0:s>0?3:2}function u(i,s){return c(i.x,s.x)}function c(i,s){var l=a(i,1),d=a(s,1);return l!==d?l-d:l===0?s[1]-i[1]:l===1?i[0]-s[0]:l===2?i[1]-s[1]:s[0]-i[0]}return function(i){var s=i,l=KN(),d,h,m,g,p,v,y,x,w,k,b,T={point:_,lineStart:E,lineEnd:D,polygonStart:A,polygonEnd:S};function _(R,z){f(R,z)&&s.point(R,z)}function M(){for(var R=0,z=0,L=h.length;zo&&(te-W)*(o-K)>(Y-K)*(t-W)&&++R:Y<=o&&(te-W)*(o-K)<(Y-K)*(t-W)&&--R;return R}function A(){s=l,d=[],h=[],b=!0}function S(){var R=M(),z=b&&R,L=(d=AI(d)).length;(z||L)&&(i.polygonStart(),z&&(i.lineStart(),r(null,null,1,i),i.lineEnd()),L&&QN(d,u,R,r,i),i.polygonEnd()),s=i,d=h=m=null}function E(){T.point=O,h&&h.push(m=[]),k=!0,w=!1,y=x=NaN}function D(){d&&(O(g,p),v&&w&&l.rejoin(),d.push(l.result())),T.point=_,w&&s.lineEnd()}function O(R,z){var L=f(R,z);if(h&&m.push([R,z]),k)g=R,p=z,v=L,k=!1,L&&(s.lineStart(),s.point(R,z));else if(L&&w)s.point(R,z);else{var P=[y=Math.max(db,Math.min(dv,y)),x=Math.max(db,Math.min(dv,x))],N=[R=Math.max(db,Math.min(dv,R)),z=Math.max(db,Math.min(dv,z))];Pre(P,N,t,n,e,o)?(w||(s.lineStart(),s.point(P[0],P[1])),s.point(N[0],N[1]),L||s.lineEnd(),b=!1):L&&(s.lineStart(),s.point(R,z),b=!1)}y=R,x=z,w=L}return T}}function vO(t,n,e){var o=Ju(t,n-Xi,e).concat(n);return function(f){return o.map(function(r){return[f,r]})}}function yO(t,n,e){var o=Ju(t,n-Xi,e).concat(n);return function(f){return o.map(function(r){return[r,f]})}}function Dre(){var t,n,e,o,f,r,a,u,c=10,i=c,s=90,l=360,d,h,m,g,p=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return Ju(ub(o/s)*s,e,s).map(m).concat(Ju(ub(u/l)*l,a,l).map(g)).concat(Ju(ub(n/c)*c,t,c).filter(function(x){return Va(x%s)>Xi}).map(d)).concat(Ju(ub(r/i)*i,f,i).filter(function(x){return Va(x%l)>Xi}).map(h))}return v.lines=function(){return y().map(function(x){return{type:"LineString",coordinates:x}})},v.outline=function(){return{type:"Polygon",coordinates:[m(o).concat(g(a).slice(1),m(e).reverse().slice(1),g(u).reverse().slice(1))]}},v.extent=function(x){return arguments.length?v.extentMajor(x).extentMinor(x):v.extentMinor()},v.extentMajor=function(x){return arguments.length?(o=+x[0][0],e=+x[1][0],u=+x[0][1],a=+x[1][1],o>e&&(x=o,o=e,e=x),u>a&&(x=u,u=a,a=x),v.precision(p)):[[o,u],[e,a]]},v.extentMinor=function(x){return arguments.length?(n=+x[0][0],t=+x[1][0],r=+x[0][1],f=+x[1][1],n>t&&(x=n,n=t,t=x),r>f&&(x=r,r=f,f=x),v.precision(p)):[[n,r],[t,f]]},v.step=function(x){return arguments.length?v.stepMajor(x).stepMinor(x):v.stepMinor()},v.stepMajor=function(x){return arguments.length?(s=+x[0],l=+x[1],v):[s,l]},v.stepMinor=function(x){return arguments.length?(c=+x[0],i=+x[1],v):[c,i]},v.precision=function(x){return arguments.length?(p=+x,d=vO(r,f,90),h=yO(n,t,p),m=vO(u,a,90),g=yO(o,e,p),v):p},v.extentMajor([[-180,-90+Xi],[180,90-Xi]]).extentMinor([[-180,-80-Xi],[180,80+Xi]])}var ey=t=>t,Q5=new fu,Kk=new fu,nB,rB,Qk,eT,Sd={point:bl,lineStart:bl,lineEnd:bl,polygonStart:function(){Sd.lineStart=Ire,Sd.lineEnd=Rre},polygonEnd:function(){Sd.lineStart=Sd.lineEnd=Sd.point=bl,Q5.add(Va(Kk)),Kk=new fu},result:function(){var t=Q5/2;return Q5=new fu,t}};function Ire(){Sd.point=zre}function zre(t,n){Sd.point=iB,nB=Qk=t,rB=eT=n}function iB(t,n){Kk.add(eT*t-Qk*n),Qk=t,eT=n}function Rre(){iB(nB,rB)}var xO=Sd,_m=1/0,e2=_m,ty=-_m,t2=ty,Fre={point:Nre,lineStart:bl,lineEnd:bl,polygonStart:bl,polygonEnd:bl,result:function(){var t=[[_m,e2],[ty,t2]];return ty=t2=-(e2=_m=1/0),t}};function Nre(t,n){t<_m&&(_m=t),t>ty&&(ty=t),nt2&&(t2=n)}var n2=Fre,tT=0,nT=0,pv=0,r2=0,i2=0,Zg=0,rT=0,iT=0,gv=0,aB,oB,Nf,Bf,Jc={point:A0,lineStart:bO,lineEnd:_O,polygonStart:function(){Jc.lineStart=Ure,Jc.lineEnd=Vre},polygonEnd:function(){Jc.point=A0,Jc.lineStart=bO,Jc.lineEnd=_O},result:function(){var t=gv?[rT/gv,iT/gv]:Zg?[r2/Zg,i2/Zg]:pv?[tT/pv,nT/pv]:[NaN,NaN];return tT=nT=pv=r2=i2=Zg=rT=iT=gv=0,t}};function A0(t,n){tT+=t,nT+=n,++pv}function bO(){Jc.point=Bre}function Bre(t,n){Jc.point=jre,A0(Nf=t,Bf=n)}function jre(t,n){var e=t-Nf,o=n-Bf,f=pu(e*e+o*o);r2+=f*(Nf+t)/2,i2+=f*(Bf+n)/2,Zg+=f,A0(Nf=t,Bf=n)}function _O(){Jc.point=A0}function Ure(){Jc.point=qre}function Vre(){sB(aB,oB)}function qre(t,n){Jc.point=sB,A0(aB=Nf=t,oB=Bf=n)}function sB(t,n){var e=t-Nf,o=n-Bf,f=pu(e*e+o*o);r2+=f*(Nf+t)/2,i2+=f*(Bf+n)/2,Zg+=f,f=Bf*t-Nf*n,rT+=f*(Nf+t),iT+=f*(Bf+n),gv+=f*3,A0(Nf=t,Bf=n)}var wO=Jc;function lB(t){this._context=t}lB.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:{this._context.moveTo(t,n),this._point=1;break}case 1:{this._context.lineTo(t,n);break}default:{this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,du);break}}},result:bl};var aT=new fu,e4,uB,cB,mv,vv,a2={point:bl,lineStart:function(){a2.point=Hre},lineEnd:function(){e4&&fB(uB,cB),a2.point=bl},polygonStart:function(){e4=!0},polygonEnd:function(){e4=null},result:function(){var t=+aT;return aT=new fu,t}};function Hre(t,n){a2.point=fB,uB=mv=t,cB=vv=n}function fB(t,n){mv-=t,vv-=n,aT.add(pu(mv*mv+vv*vv)),mv=t,vv=n}var kO=a2;function hB(){this._string=[]}hB.prototype={_radius:4.5,_circle:TO(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:{this._string.push("M",t,",",n),this._point=1;break}case 1:{this._string.push("L",t,",",n);break}default:{this._circle==null&&(this._circle=TO(this._radius)),this._string.push("M",t,",",n,this._circle);break}}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}else return null}};function TO(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function dB(t,n){var e=4.5,o,f;function r(a){return a&&(typeof e=="function"&&f.pointRadius(+e.apply(this,arguments)),Dh(a,o(f))),f.result()}return r.area=function(a){return Dh(a,o(xO)),xO.result()},r.measure=function(a){return Dh(a,o(kO)),kO.result()},r.bounds=function(a){return Dh(a,o(n2)),n2.result()},r.centroid=function(a){return Dh(a,o(wO)),wO.result()},r.projection=function(a){return arguments.length?(o=a==null?(t=null,ey):(t=a).stream,r):t},r.context=function(a){return arguments.length?(f=a==null?(n=null,new hB):new lB(n=a),typeof e!="function"&&f.pointRadius(e),r):n},r.pointRadius=function(a){return arguments.length?(e=typeof a=="function"?a:(f.pointRadius(+a),+a),r):e},r.projection(t).context(n)}function Pw(t){return function(n){var e=new oT;for(var o in t)e[o]=t[o];return e.stream=n,e}}function oT(){}oT.prototype={constructor:oT,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function eS(t,n,e){var o=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),o!=null&&t.clipExtent(null),Dh(e,t.stream(n2)),n(n2.result()),o!=null&&t.clipExtent(o),t}function Dw(t,n,e){return eS(t,function(o){var f=n[1][0]-n[0][0],r=n[1][1]-n[0][1],a=Math.min(f/(o[1][0]-o[0][0]),r/(o[1][1]-o[0][1])),u=+n[0][0]+(f-a*(o[1][0]+o[0][0]))/2,c=+n[0][1]+(r-a*(o[1][1]+o[0][1]))/2;t.scale(150*a).translate([u,c])},e)}function tS(t,n,e){return Dw(t,[[0,0],n],e)}function nS(t,n,e){return eS(t,function(o){var f=+n,r=f/(o[1][0]-o[0][0]),a=(f-r*(o[1][0]+o[0][0]))/2,u=-r*o[0][1];t.scale(150*r).translate([a,u])},e)}function rS(t,n,e){return eS(t,function(o){var f=+n,r=f/(o[1][1]-o[0][1]),a=-r*o[0][0],u=(f-r*(o[1][1]+o[0][1]))/2;t.scale(150*r).translate([a,u])},e)}var AO=16,$re=Zi(30*Ea);function MO(t,n){return+n?Wre(t,n):Gre(t)}function Gre(t){return Pw({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}function Wre(t,n){function e(o,f,r,a,u,c,i,s,l,d,h,m,g,p){var v=i-o,y=s-f,x=v*v+y*y;if(x>4*n&&g--){var w=a+d,k=u+h,b=c+m,T=pu(w*w+k*k+b*b),_=Iu(b/=T),M=Va(Va(b)-1)n||Va((v*D+y*O)/x-.5)>.3||a*d+u*h+c*m<$re)&&(e(o,f,r,a,u,c,S,E,M,w/=T,k/=T,b,g,p),p.point(S,E),e(S,E,M,w,k,b,i,s,l,d,h,m,g,p))}}return function(o){var f,r,a,u,c,i,s,l,d,h,m,g,p={point:v,lineStart:y,lineEnd:w,polygonStart:function(){o.polygonStart(),p.lineStart=k},polygonEnd:function(){o.polygonEnd(),p.lineStart=y}};function v(_,M){_=t(_,M),o.point(_[0],_[1])}function y(){l=NaN,p.point=x,o.lineStart()}function x(_,M){var A=T0([_,M]),S=t(_,M);e(l,d,s,h,m,g,l=S[0],d=S[1],s=_,h=A[0],m=A[1],g=A[2],AO,o),o.point(l,d)}function w(){p.point=v,o.lineEnd()}function k(){y(),p.point=b,p.lineEnd=T}function b(_,M){x(f=_,M),r=l,a=d,u=h,c=m,i=g,p.point=x}function T(){e(l,d,s,h,m,g,r,a,f,u,c,i,AO,o),p.lineEnd=w,w()}return p}}var Yre=Pw({point:function(t,n){this.stream.point(t*Ea,n*Ea)}});function Xre(t){return Pw({point:function(n,e){var o=t(n,e);return this.stream.point(o[0],o[1])}})}function Zre(t,n,e,o,f){function r(a,u){return a*=o,u*=f,[n+t*a,e-t*u]}return r.invert=function(a,u){return[(a-n)/t*o,(e-u)/t*f]},r}function SO(t,n,e,o,f,r){if(!r)return Zre(t,n,e,o,f);var a=Zi(r),u=Gi(r),c=a*t,i=u*t,s=a/t,l=u/t,d=(u*e-a*n)/t,h=(u*n+a*e)/t;function m(g,p){return g*=o,p*=f,[c*g-i*p+n,e-i*g-c*p]}return m.invert=function(g,p){return[o*(s*g-l*p+d),f*(h-l*g-s*p)]},m}function sh(t){return pB(function(){return t})()}function pB(t){var n,e=150,o=480,f=250,r=0,a=0,u=0,c=0,i=0,s,l=0,d=1,h=1,m=null,g=mO,p=null,v,y,x,w=ey,k=.5,b,T,_,M,A;function S(R){return _(R[0]*Ea,R[1]*Ea)}function E(R){return R=_.invert(R[0],R[1]),R&&[R[0]*Os,R[1]*Os]}S.stream=function(R){return M&&A===R?M:M=Yre(Xre(s)(g(b(w(A=R)))))},S.preclip=function(R){return arguments.length?(g=R,m=void 0,O()):g},S.postclip=function(R){return arguments.length?(w=R,p=v=y=x=null,O()):w},S.clipAngle=function(R){return arguments.length?(g=+R?Lre(m=R*Ea):(m=null,mO),O()):m*Os},S.clipExtent=function(R){return arguments.length?(w=R==null?(p=v=y=x=null,ey):tB(p=+R[0][0],v=+R[0][1],y=+R[1][0],x=+R[1][1]),O()):p==null?null:[[p,v],[y,x]]},S.scale=function(R){return arguments.length?(e=+R,D()):e},S.translate=function(R){return arguments.length?(o=+R[0],f=+R[1],D()):[o,f]},S.center=function(R){return arguments.length?(r=R[0]%360*Ea,a=R[1]%360*Ea,D()):[r*Os,a*Os]},S.rotate=function(R){return arguments.length?(u=R[0]%360*Ea,c=R[1]%360*Ea,i=R.length>2?R[2]%360*Ea:0,D()):[u*Os,c*Os,i*Os]},S.angle=function(R){return arguments.length?(l=R%360*Ea,D()):l*Os},S.reflectX=function(R){return arguments.length?(d=R?-1:1,D()):d<0},S.reflectY=function(R){return arguments.length?(h=R?-1:1,D()):h<0},S.precision=function(R){return arguments.length?(b=MO(T,k=R*R),O()):pu(k)},S.fitExtent=function(R,z){return Dw(S,R,z)},S.fitSize=function(R,z){return tS(S,R,z)},S.fitWidth=function(R,z){return nS(S,R,z)},S.fitHeight=function(R,z){return rS(S,R,z)};function D(){var R=SO(e,0,0,d,h,l).apply(null,n(r,a)),z=SO(e,o-R[0],f-R[1],d,h,l);return s=JN(u,c,i),T=Zk(n,z),_=Zk(s,T),b=MO(T,k),O()}function O(){return M=A=null,S}return function(){return n=t.apply(this,arguments),S.invert=n.invert&&E,D()}}function iS(t){var n=0,e=Sa/3,o=pB(t),f=o(n,e);return f.parallels=function(r){return arguments.length?o(n=r[0]*Ea,e=r[1]*Ea):[n*Os,e*Os]},f}function Jre(t){var n=Zi(t);function e(o,f){return[o*n,Gi(f)/n]}return e.invert=function(o,f){return[o/n,Iu(f*n)]},e}function Kre(t,n){var e=Gi(t),o=(e+Gi(n))/2;if(Va(o)=.12&&p<.234&&g>=-.425&&g<-.214?f:p>=.166&&p<.234&&g>=-.214&&g<-.115?a:e).invert(d)},s.stream=function(d){return t&&n===d?t:t=Qre([e.stream(n=d),f.stream(d),a.stream(d)])},s.precision=function(d){return arguments.length?(e.precision(d),f.precision(d),a.precision(d),l()):e.precision()},s.scale=function(d){return arguments.length?(e.scale(d),f.scale(d*.35),a.scale(d),s.translate(e.translate())):e.scale()},s.translate=function(d){if(!arguments.length)return e.translate();var h=e.scale(),m=+d[0],g=+d[1];return o=e.translate(d).clipExtent([[m-.455*h,g-.238*h],[m+.455*h,g+.238*h]]).stream(i),r=f.translate([m-.307*h,g+.201*h]).clipExtent([[m-.425*h+Xi,g+.12*h+Xi],[m-.214*h-Xi,g+.234*h-Xi]]).stream(i),u=a.translate([m-.205*h,g+.212*h]).clipExtent([[m-.214*h+Xi,g+.166*h+Xi],[m-.115*h-Xi,g+.234*h-Xi]]).stream(i),l()},s.fitExtent=function(d,h){return Dw(s,d,h)},s.fitSize=function(d,h){return tS(s,d,h)},s.fitWidth=function(d,h){return nS(s,d,h)},s.fitHeight=function(d,h){return rS(s,d,h)};function l(){return t=n=null,s}return s.scale(1070)}function mB(t){return function(n,e){var o=Zi(n),f=Zi(e),r=t(o*f);return r===1/0?[2,0]:[r*f*Gi(n),r*Gi(e)]}}function Hy(t){return function(n,e){var o=pu(n*n+e*e),f=t(o),r=Gi(f),a=Zi(f);return[xc(n*r,o*a),Iu(o&&e*r/o)]}}var vB=mB(function(t){return pu(2/(1+t))});vB.invert=Hy(function(t){return 2*Iu(t/2)});function tie(){return sh(vB).scale(124.75).clipAngle(180-.001)}var yB=mB(function(t){return(t=jN(t))&&t/Gi(t)});yB.invert=Hy(function(t){return t});function nie(){return sh(yB).scale(79.4188).clipAngle(180-.001)}function Iw(t,n){return[t,U_(KM((ys+n)/2))]}Iw.invert=function(t,n){return[t,2*Zm(BN(n))-ys]};function rie(){return xB(Iw).scale(961/du)}function xB(t){var n=sh(t),e=n.center,o=n.scale,f=n.translate,r=n.clipExtent,a=null,u,c,i;n.scale=function(l){return arguments.length?(o(l),s()):o()},n.translate=function(l){return arguments.length?(f(l),s()):f()},n.center=function(l){return arguments.length?(e(l),s()):e()},n.clipExtent=function(l){return arguments.length?(l==null?a=u=c=i=null:(a=+l[0][0],u=+l[0][1],c=+l[1][0],i=+l[1][1]),s()):a==null?null:[[a,u],[c,i]]};function s(){var l=Sa*o(),d=n(kre(n.rotate()).invert([0,0]));return r(a==null?[[d[0]-l,d[1]-l],[d[0]+l,d[1]+l]]:t===Iw?[[Math.max(d[0]-l,a),u],[Math.min(d[0]+l,c),i]]:[[a,Math.max(d[1]-l,u)],[c,Math.min(d[1]+l,i)]])}return s()}function pb(t){return KM((ys+t)/2)}function iie(t,n){var e=Zi(t),o=t===n?Gi(t):U_(e/Zi(n))/U_(pb(n)/pb(t)),f=e*Z5(pb(t),o)/o;if(!o)return Iw;function r(a,u){f>0?u<-ys+Xi&&(u=-ys+Xi):u>ys-Xi&&(u=ys-Xi);var c=f/Z5(pb(u),o);return[c*Gi(o*a),f-c*Zi(o*a)]}return r.invert=function(a,u){var c=f-u,i=fc(o)*pu(a*a+c*c),s=xc(a,Va(c))*fc(c);return c*o<0&&(s-=Sa*fc(a)*fc(c)),[s/o,2*Zm(Z5(f/i,1/o))-ys]},r}function aie(){return iS(iie).scale(109.5).parallels([30,30])}function s2(t,n){return[t,n]}s2.invert=s2;function oie(){return sh(s2).scale(152.63)}function sie(t,n){var e=Zi(t),o=t===n?Gi(t):(e-Zi(n))/(n-t),f=e/o+t;if(Va(o)Xi&&--o>0);return[t/(.8707+(r=e*e)*(-.131979+r*(-.013791+r*r*r*(.003971-.001529*r)))),e]};function die(){return sh(wB).scale(175.295)}function kB(t,n){return[Zi(n)*Gi(t),Gi(n)]}kB.invert=Hy(Iu);function pie(){return sh(kB).scale(249.5).clipAngle(90+Xi)}function TB(t,n){var e=Zi(n),o=1+Zi(t)*e;return[e*Gi(t)/o,Gi(n)/o]}TB.invert=Hy(function(t){return 2*Zm(t)});function gie(){return sh(TB).scale(250).clipAngle(142)}function AB(t,n){return[U_(KM((ys+n)/2)),-t]}AB.invert=function(t,n){return[-n,2*Zm(BN(t))-ys]};function mie(){var t=xB(AB),n=t.center,e=t.rotate;return t.center=function(o){return arguments.length?n([-o[1],o[0]]):(o=n(),[o[1],-o[0]])},t.rotate=function(o){return arguments.length?e([o[0],o[1],o.length>2?o[2]+90:90]):(o=e(),[o[0],o[1],o[2]-90])},e([0,0,90]).scale(159.155)}var vie=Math.abs,sT=Math.cos,u2=Math.sin,yie=1e-6,MB=Math.PI,lT=MB/2,EO=xie(2);function CO(t){return t>1?lT:t<-1?-lT:Math.asin(t)}function xie(t){return t>0?Math.sqrt(t):0}function bie(t,n){var e=t*u2(n),o=30,f;do n-=f=(n+u2(n)-e)/(1+sT(n));while(vie(f)>yie&&--o>0);return n/2}function _ie(t,n,e){function o(f,r){return[t*f*sT(r=bie(e,r)),n*u2(r)]}return o.invert=function(f,r){return r=CO(r/n),[f/(t*sT(r)),CO((2*r+u2(2*r))/e)]},o}var wie=_ie(EO/lT,EO,MB);function kie(){return sh(wie).scale(169.529)}const Tie=dB(),uT=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Aie(t,n){return function e(){const o=n();return o.type=t,o.path=dB().projection(o),o.copy=o.copy||function(){const f=e();return uT.forEach(r=>{o[r]&&f[r](o[r]())}),f.path.pointRadius(o.path.pointRadius()),f},o}}function aS(t,n){if(!t||typeof t!="string")throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(c2[t]=Aie(t,n),this):c2[t]||null}function SB(t){return t&&t.path||Tie}const c2={albers:gB,albersusa:eie,azimuthalequalarea:tie,azimuthalequidistant:nie,conicconformal:aie,conicequalarea:o2,conicequidistant:lie,equalEarth:cie,equirectangular:oie,gnomonic:fie,identity:hie,mercator:rie,mollweide:kie,naturalEarth1:die,orthographic:pie,stereographic:gie,transversemercator:mie};for(const t in c2)aS(t,c2[t]);function Mie(){}const Ah=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function EB(){var t=1,n=1,e=u;function o(c,i){return i.map(s=>f(c,s))}function f(c,i){var s=[],l=[];return r(c,i,d=>{e(d,c,i),Sie(d)>0?s.push([d]):l.push(d)}),l.forEach(d=>{for(var h=0,m=s.length,g;h=i,Ah[p<<1].forEach(x);++h=i,Ah[g|p<<1].forEach(x);for(Ah[p<<0].forEach(x);++m=i,v=c[m*t]>=i,Ah[p<<1|v<<2].forEach(x);++h=i,y=v,v=c[m*t+h+1]>=i,Ah[g|p<<1|v<<2|y<<3].forEach(x);Ah[p|v<<3].forEach(x)}for(h=-1,v=c[m*t]>=i,Ah[v<<2].forEach(x);++h=i,Ah[v<<2|y<<3].forEach(x);Ah[v<<3].forEach(x);function x(w){var k=[w[0][0]+h,w[0][1]+m],b=[w[1][0]+h,w[1][1]+m],T=a(k),_=a(b),M,A;(M=d[T])?(A=l[_])?(delete d[M.end],delete l[A.start],M===A?(M.ring.push(b),s(M.ring)):l[M.start]=d[A.end]={start:M.start,end:A.end,ring:M.ring.concat(A.ring)}):(delete d[M.end],M.ring.push(b),d[M.end=_]=M):(M=l[_])?(A=d[T])?(delete l[M.start],delete d[A.end],M===A?(M.ring.push(b),s(M.ring)):l[A.start]=d[M.end]={start:A.start,end:M.end,ring:A.ring.concat(M.ring)}):(delete l[M.start],M.ring.unshift(k),l[M.start=T]=M):l[T]=d[_]={start:T,end:_,ring:[k,b]}}}function a(c){return c[0]*2+c[1]*(t+1)*4}function u(c,i,s){c.forEach(l=>{var d=l[0],h=l[1],m=d|0,g=h|0,p,v=i[g*t+m];d>0&&d0&&h=0&&s>=0||Pr("invalid size"),t=i,n=s,o},o.smooth=function(c){return arguments.length?(e=c?u:Mie,o):e===u},o}function Sie(t){for(var n=0,e=t.length,o=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++no!=h>o&&e<(d-i)*(o-s)/(h-s)+i&&(f=-f)}return f}function Oie(t,n,e){var o;return Lie(t,n,e)&&Pie(t[o=+(t[0]===n[0])],e[o],n[o])}function Lie(t,n,e){return(n[0]-t[0])*(e[1]-t[1])===(e[0]-t[0])*(n[1]-t[1])}function Pie(t,n,e){return t<=n&&n<=e||e<=n&&n<=t}function CB(t,n,e){return function(o){var f=Zf(o),r=e?Math.min(f[0],0):f[0],a=f[1],u=a-r,c=n?b0(r,a,t):u/(t+1);return Ju(r+c,a,c)}}function oS(t){_r.call(this,null,t)}oS.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};ni(oS,_r,{transform(t,n){if(this.value&&!n.changed()&&!t.modified())return n.StopPropagation;var e=n.fork(n.NO_SOURCE|n.NO_FIELDS),o=n.materialize(n.SOURCE).source,f=t.field||Hl,r=EB().smooth(t.smooth!==!1),a=t.thresholds||Die(o,f,t),u=t.as===null?null:t.as||"contour",c=[];return o.forEach(i=>{const s=f(i),l=r.size([s.width,s.height])(s.values,Ir(a)?a:a(s.values));Iie(l,s,i,t),l.forEach(d=>{c.push(nw(i,ro(u!=null?{[u]:d}:d)))})}),this.value&&(e.rem=this.value),this.value=e.source=e.add=c,e}});function Die(t,n,e){const o=CB(e.levels||10,e.nice,e.zero!==!1);return e.resolve!=="shared"?o:o(t.map(f=>d0(n(f).values)))}function Iie(t,n,e,o){let f=o.scale||n.scale,r=o.translate||n.translate;if(ga(f)&&(f=f(e,o)),ga(r)&&(r=r(e,o)),(f===1||f==null)&&!r)return;const a=(wo(f)?f:f[0])||1,u=(wo(f)?f:f[1])||1,c=r&&r[0]||0,i=r&&r[1]||0;t.forEach(OB(n,a,u,c,i))}function OB(t,n,e,o,f){const r=t.x1||0,a=t.y1||0,u=n*e<0;function c(l){l.forEach(i)}function i(l){u&&l.reverse(),l.forEach(s)}function s(l){l[0]=(l[0]-r)*n+o,l[1]=(l[1]-a)*e+f}return function(l){return l.coordinates.forEach(c),l}}function OO(t,n,e){const o=t>=0?t:e6(n,e);return Math.round((Math.sqrt(4*o*o+1)-1)/2)}function t4(t){return ga(t)?t:$l(+t)}function LB(){var t=c=>c[0],n=c=>c[1],e=Um,o=[-1,-1],f=960,r=500,a=2;function u(c,i){const s=OO(o[0],c,t)>>a,l=OO(o[1],c,n)>>a,d=s?s+2:0,h=l?l+2:0,m=2*d+(f>>a),g=2*h+(r>>a),p=new Float32Array(m*g),v=new Float32Array(m*g);let y=p;c.forEach(w=>{const k=d+(+t(w)>>a),b=h+(+n(w)>>a);k>=0&&k=0&&b0&&l>0?(Ig(m,g,p,v,s),zg(m,g,v,p,l),Ig(m,g,p,v,s),zg(m,g,v,p,l),Ig(m,g,p,v,s),zg(m,g,v,p,l)):s>0?(Ig(m,g,p,v,s),Ig(m,g,v,p,s),Ig(m,g,p,v,s),y=v):l>0&&(zg(m,g,p,v,l),zg(m,g,v,p,l),zg(m,g,p,v,l),y=v);const x=i?Math.pow(2,-2*a):1/MI(y);for(let w=0,k=m*g;w>a),y2:h+(r>>a)}}return u.x=function(c){return arguments.length?(t=t4(c),u):t},u.y=function(c){return arguments.length?(n=t4(c),u):n},u.weight=function(c){return arguments.length?(e=t4(c),u):e},u.size=function(c){if(!arguments.length)return[f,r];var i=+c[0],s=+c[1];return i>=0&&s>=0||Pr("invalid size"),f=i,r=s,u},u.cellSize=function(c){return arguments.length?((c=+c)>=1||Pr("invalid cell size"),a=Math.floor(Math.log(c)/Math.LN2),u):1<=f&&(u>=r&&(c-=e[u-r+a*t]),o[u-f+a*t]=c/Math.min(u+1,t-1+r-u,r))}function zg(t,n,e,o,f){const r=(f<<1)+1;for(let a=0;a=f&&(u>=r&&(c-=e[a+(u-r)*t]),o[a+(u-f)*t]=c/Math.min(u+1,n-1+r-u,r))}function sS(t){_r.call(this,null,t)}sS.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const zie=["x","y","weight","size","cellSize","bandwidth"];function PB(t,n){return zie.forEach(e=>n[e]!=null?t[e](n[e]):0),t}ni(sS,_r,{transform(t,n){if(this.value&&!n.changed()&&!t.modified())return n.StopPropagation;var e=n.fork(n.NO_SOURCE|n.NO_FIELDS),o=n.materialize(n.SOURCE).source,f=Rie(o,t.groupby),r=(t.groupby||[]).map(xs),a=PB(LB(),t),u=t.as||"grid",c=[];function i(s,l){for(let d=0;dro(i({[u]:a(s,t.counts)},s.dims))),this.value&&(e.rem=this.value),this.value=e.source=e.add=c,e}});function Rie(t,n){var e=[],o=s=>s(u),f,r,a,u,c,i;if(n==null)e.push(t);else for(f={},r=0,a=t.length;re.push(u(s))),r&&a&&(n.visit(c,s=>{var l=r(s),d=a(s);l!=null&&d!=null&&(l=+l)===l&&(d=+d)===d&&o.push([l,d])}),e=e.concat({type:cT,geometry:{type:Fie,coordinates:o}})),this.value={type:uS,features:e}}});function fS(t){_r.call(this,null,t)}fS.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};ni(fS,_r,{transform(t,n){var e=n.fork(n.ALL),o=this.value,f=t.field||Hl,r=t.as||"path",a=e.SOURCE;!o||t.modified()?(this.value=o=SB(t.projection),e.materialize().reflow()):a=f===Hl||n.modified(f.fields)?e.ADD_MOD:e.ADD;const u=Nie(o,t.pointRadius);return e.visit(a,c=>c[r]=o(f(c))),o.pointRadius(u),e.modifies(r)}});function Nie(t,n){const e=t.pointRadius();return t.context(null),n!=null&&t.pointRadius(n),e}function hS(t){_r.call(this,null,t)}hS.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};ni(hS,_r,{transform(t,n){var e=t.projection,o=t.fields[0],f=t.fields[1],r=t.as||["x","y"],a=r[0],u=r[1],c;function i(s){const l=e([o(s),f(s)]);l?(s[a]=l[0],s[u]=l[1]):(s[a]=void 0,s[u]=void 0)}return t.modified()?n=n.materialize().reflow(!0).visit(n.SOURCE,i):(c=n.modified(o.fields)||n.modified(f.fields),n.visit(c?n.ADD_MOD:n.ADD,i)),n.modifies(r)}});function dS(t){_r.call(this,null,t)}dS.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};ni(dS,_r,{transform(t,n){var e=n.fork(n.ALL),o=this.value,f=t.as||"shape",r=e.ADD;return(!o||t.modified())&&(this.value=o=Bie(SB(t.projection),t.field||Lu("datum"),t.pointRadius),e.materialize().reflow(),r=e.SOURCE),e.visit(r,a=>a[f]=o),e.modifies(f)}});function Bie(t,n,e){const o=e==null?f=>t(n(f)):f=>{var r=t.pointRadius(),a=t.pointRadius(e)(n(f));return t.pointRadius(r),a};return o.context=f=>(t.context(f),o),o}function pS(t){_r.call(this,[],t),this.generator=Dre()}pS.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};ni(pS,_r,{transform(t,n){var e=this.value,o=this.generator,f;if(!e.length||t.modified())for(const r in t)ga(o[r])&&o[r](t[r]);return f=o(),e.length?n.mod.push(vz(e[0],f)):n.add.push(ro(f)),e[0]=f,n}});function gS(t){_r.call(this,null,t)}gS.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};ni(gS,_r,{transform(t,n){if(!n.changed()&&!t.modified())return n.StopPropagation;var e=n.materialize(n.SOURCE).source,o=t.resolve==="shared",f=t.field||Hl,r=Uie(t.opacity,t),a=jie(t.color,t),u=t.as||"image",c={$x:0,$y:0,$value:0,$max:o?d0(e.map(i=>d0(f(i).values))):0};return e.forEach(i=>{const s=f(i),l=pa({},i,c);o||(l.$max=d0(s.values||[])),i[u]=Vie(s,l,a.dep?a:$l(a(l)),r.dep?r:$l(r(l)))}),n.reflow(!0).modifies(u)}});function jie(t,n){let e;return ga(t)?(e=o=>c_(t(o,n)),e.dep=DB(t)):e=$l(c_(t||"#888")),e}function Uie(t,n){let e;return ga(t)?(e=o=>t(o,n),e.dep=DB(t)):t?e=$l(t):(e=o=>o.$value/o.$max||0,e.dep=!0),e}function DB(t){if(!ga(t))return!1;const n=ff(Bl(t));return n.$x||n.$y||n.$value||n.$max}function Vie(t,n,e,o){const f=t.width,r=t.height,a=t.x1||0,u=t.y1||0,c=t.x2||f,i=t.y2||r,s=t.values,l=s?p=>s[p]:Md,d=Vd(c-a,i-u),h=d.getContext("2d"),m=h.getImageData(0,0,c-a,i-u),g=m.data;for(let p=u,v=0;p{t[o]!=null&&LO(e,o,t[o])})):uT.forEach(o=>{t.modified(o)&&LO(e,o,t[o])}),t.pointRadius!=null&&e.path.pointRadius(t.pointRadius),t.fit&&qie(e,t),n.fork(n.NO_SOURCE|n.NO_FIELDS)}});function qie(t,n){const e=$ie(n.fit);n.extent?t.fitExtent(n.extent,e):n.size&&t.fitSize(n.size,e)}function Hie(t){const n=aS((t||"mercator").toLowerCase());return n||Pr("Unrecognized projection type: "+t),n()}function LO(t,n,e){ga(t[n])&&t[n](e)}function $ie(t){return t=ki(t),t.length===1?t[0]:{type:uS,features:t.reduce((n,e)=>n.concat(Gie(e)),[])}}function Gie(t){return t.type===uS?t.features:ki(t).filter(n=>n!=null).map(n=>n.type===cT?n:{type:cT,geometry:n})}var Wie=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",contour:lS,geojson:cS,geopath:fS,geopoint:hS,geoshape:dS,graticule:pS,heatmap:gS,isocontour:oS,kde2d:sS,projection:IB});function Yie(t,n){var e,o=1;t==null&&(t=0),n==null&&(n=0);function f(){var r,a=e.length,u,c=0,i=0;for(r=0;r=(l=(u+i)/2))?u=l:i=l,(p=e>=(d=(c+s)/2))?c=d:s=d,f=r,!(r=r[v=p<<1|g]))return f[v]=a,t;if(h=+t._x.call(null,r.data),m=+t._y.call(null,r.data),n===h&&e===m)return a.next=r,f?f[v]=a:t._root=a,t;do f=f?f[v]=new Array(4):t._root=new Array(4),(g=n>=(l=(u+i)/2))?u=l:i=l,(p=e>=(d=(c+s)/2))?c=d:s=d;while((v=p<<1|g)===(y=(m>=d)<<1|h>=l));return f[y]=r,f[v]=a,t}function Zie(t){var n,e,o=t.length,f,r,a=new Array(o),u=new Array(o),c=1/0,i=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=f),rl&&(l=r));if(c>s||i>l)return this;for(this.cover(c,i).cover(s,l),e=0;et||t>=f||o>n||n>=r;)switch(i=(ns||(u=m.y0)>l||(c=m.x1)=v)<<1|t>=p)&&(m=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=m)}else{var y=t-+this._x.call(null,h.data),x=n-+this._y.call(null,h.data),w=y*y+x*x;if(w=(d=(a+c)/2))?a=d:c=d,(g=l>=(h=(u+i)/2))?u=h:i=h,n=e,!(e=e[p=g<<1|m]))return this;if(!e.length)break;(n[p+1&3]||n[p+2&3]||n[p+3&3])&&(o=n,v=p)}for(;e.data!==t;)if(f=e,!(e=e.next))return this;return(r=e.next)&&delete e.next,f?(r?f.next=r:delete f.next,this):n?(r?n[p]=r:delete n[p],(e=n[0]||n[1]||n[2]||n[3])&&e===(n[3]||n[2]||n[1]||n[0])&&!e.length&&(o?o[v]=e:this._root=e),this):(this._root=r,this)}function nae(t){for(var n=0,e=t.length;nd.index){var S=h-_.x-_.vx,E=m-_.y-_.vy,D=S*S+E*E;Dh+A||bm+A||Ti.r&&(i.r=i[s].r)}function c(){if(!!n){var i,s=n.length,l;for(e=new Array(s),i=0;i[n(k,b,a),k])),w;for(p=0,u=new Array(v);p{}};function RB(){for(var t=0,n=arguments.length,e={},o;t=0&&(o=e.slice(f+1),e=e.slice(0,f)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:o}})}Jb.prototype=RB.prototype={constructor:Jb,on:function(t,n){var e=this._,o=vae(t+"",e),f,r=-1,a=o.length;if(arguments.length<2){for(;++r0)for(var e=new Array(f),o=0,f,r;o=0&&t._call.call(void 0,n),t=t._next;--wm}function zO(){M0=(h2=ny.now())+zw,wm=yv=0;try{bae()}finally{wm=0,wae(),M0=0}}function _ae(){var t=ny.now(),n=t-h2;n>FB&&(zw-=n,h2=t)}function wae(){for(var t,n=f2,e,o=1/0;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:f2=e);xv=t,fT(o)}function fT(t){if(!wm){yv&&(yv=clearTimeout(yv));var n=t-M0;n>24?(t<1/0&&(yv=setTimeout(zO,t-ny.now()-zw)),H1&&(H1=clearInterval(H1))):(H1||(h2=ny.now(),H1=setInterval(_ae,FB)),wm=1,NB(zO))}}function kae(t,n,e){var o=new d2,f=n;return n==null?(o.restart(t,n,e),o):(o._restart=o.restart,o.restart=function(r,a,u){a=+a,u=u==null?yS():+u,o._restart(function c(i){i+=f,o._restart(c,f+=a,u),r(i)},a,u)},o.restart(t,n,e),o)}const Tae=1664525,Aae=1013904223,RO=4294967296;function Mae(){let t=1;return()=>(t=(Tae*t+Aae)%RO)/RO}function Sae(t){return t.x}function Eae(t){return t.y}var Cae=10,Oae=Math.PI*(3-Math.sqrt(5));function Lae(t){var n,e=1,o=.001,f=1-Math.pow(o,1/300),r=0,a=.6,u=new Map,c=BB(l),i=RB("tick","end"),s=Mae();t==null&&(t=[]);function l(){d(),i.call("tick",n),e1?(p==null?u.delete(g):u.set(g,m(p)),n):u.get(g)},find:function(g,p,v){var y=0,x=t.length,w,k,b,T,_;for(v==null?v=1/0:v*=v,y=0;y1?(i.on(g,p),n):i.on(g)}}}function Pae(){var t,n,e,o,f=uu(-30),r,a=1,u=1/0,c=.81;function i(h){var m,g=t.length,p=mS(t,Sae,Eae).visitAfter(l);for(o=h,m=0;m=u)return;(h.data!==n||h.next)&&(v===0&&(v=Rd(e),w+=v*v),y===0&&(y=Rd(e),w+=y*y),w=0;)e.tick();else if(e.stopped()&&e.restart(),!o)return n.StopPropagation}return this.finish(t,n)},finish(t,n){const e=n.dataflow;for(let u=this._argops,c=0,i=u.length,s;ct.touch(n).run()}function Fae(t,n){const e=Lae(t),o=e.stop,f=e.restart;let r=!1;return e.stopped=()=>r,e.restart=()=>(r=!1,f()),e.stop=()=>(r=!0,o()),UB(e,n,!0).on("end",()=>r=!0)}function UB(t,n,e,o){var f=ki(n.forces),r,a,u,c;for(r=0,a=hT.length;rn(o,e):n)}var Uae=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",force:xS});function Vae(t,n){return t.parent===n.parent?1:2}function qae(t){return t.reduce(Hae,0)/t.length}function Hae(t,n){return t+n.x}function $ae(t){return 1+t.reduce(Gae,0)}function Gae(t,n){return Math.max(t,n.y)}function Wae(t){for(var n;n=t.children;)t=n[0];return t}function Yae(t){for(var n;n=t.children;)t=n[n.length-1];return t}function Xae(){var t=Vae,n=1,e=1,o=!1;function f(r){var a,u=0;r.eachAfter(function(d){var h=d.children;h?(d.x=qae(h),d.y=$ae(h)):(d.x=a?u+=t(d,a):0,d.y=0,a=d)});var c=Wae(r),i=Yae(r),s=c.x-t(c,i)/2,l=i.x+t(i,c)/2;return r.eachAfter(o?function(d){d.x=(d.x-r.x)*n,d.y=(r.y-d.y)*e}:function(d){d.x=(d.x-s)/(l-s)*n,d.y=(1-(r.y?d.y/r.y:1))*e})}return f.separation=function(r){return arguments.length?(t=r,f):t},f.size=function(r){return arguments.length?(o=!1,n=+r[0],e=+r[1],f):o?null:[n,e]},f.nodeSize=function(r){return arguments.length?(o=!0,n=+r[0],e=+r[1],f):o?[n,e]:null},f}function Zae(t){var n=0,e=t.children,o=e&&e.length;if(!o)n=1;else for(;--o>=0;)n+=e[o].value;t.value=n}function Jae(){return this.eachAfter(Zae)}function Kae(t,n){let e=-1;for(const o of this)t.call(n,o,++e,this);return this}function Qae(t,n){for(var e=this,o=[e],f,r,a=-1;e=o.pop();)if(t.call(n,e,++a,this),f=e.children)for(r=f.length-1;r>=0;--r)o.push(f[r]);return this}function eoe(t,n){for(var e=this,o=[e],f=[],r,a,u,c=-1;e=o.pop();)if(f.push(e),r=e.children)for(a=0,u=r.length;a=0;)e+=o[f].value;n.value=e})}function roe(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})}function ioe(t){for(var n=this,e=aoe(n,t),o=[n];n!==e;)n=n.parent,o.push(n);for(var f=o.length;t!==e;)o.splice(f,0,t),t=t.parent;return o}function aoe(t,n){if(t===n)return t;var e=t.ancestors(),o=n.ancestors(),f=null;for(t=e.pop(),n=o.pop();t===n;)f=t,t=e.pop(),n=o.pop();return f}function ooe(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n}function soe(){return Array.from(this)}function loe(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t}function uoe(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n}function*coe(){var t=this,n,e=[t],o,f,r;do for(n=e.reverse(),e=[];t=n.pop();)if(yield t,o=t.children)for(f=0,r=o.length;f=0;--u)f.push(r=a[u]=new km(a[u])),r.parent=o,r.depth=o.depth+1;return e.eachBefore(VB)}function foe(){return bS(this).eachBefore(poe)}function hoe(t){return t.children}function doe(t){return Array.isArray(t)?t[1]:null}function poe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function VB(t){var n=0;do t.height=n;while((t=t.parent)&&t.height<++n)}function km(t){this.data=t,this.depth=this.height=0,this.parent=null}km.prototype=bS.prototype={constructor:km,count:Jae,each:Kae,eachAfter:eoe,eachBefore:Qae,find:toe,sum:noe,sort:roe,path:ioe,ancestors:ooe,descendants:soe,leaves:loe,links:uoe,copy:foe,[Symbol.iterator]:coe};function Kb(t){return t==null?null:qB(t)}function qB(t){if(typeof t!="function")throw new Error;return t}function n0(){return 0}function Hg(t){return function(){return t}}const goe=1664525,moe=1013904223,NO=4294967296;function voe(){let t=1;return()=>(t=(goe*t+moe)%NO)/NO}function yoe(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function xoe(t,n){let e=t.length,o,f;for(;e;)f=n()*e--|0,o=t[e],t[e]=t[f],t[f]=o;return t}function boe(t,n){for(var e=0,o=(t=xoe(Array.from(t),n)).length,f=[],r,a;e0&&e*e>o*o+f*f}function n4(t,n){for(var e=0;e1e-6?(S+Math.sqrt(S*S-4*A*E))/(2*A):E/S);return{x:o+b+T*D,y:f+_+M*D,r:D}}function BO(t,n,e){var o=t.x-n.x,f,r,a=t.y-n.y,u,c,i=o*o+a*a;i?(r=n.r+e.r,r*=r,c=t.r+e.r,c*=c,r>c?(f=(i+c-r)/(2*i),u=Math.sqrt(Math.max(0,c/i-f*f)),e.x=t.x-f*o-u*a,e.y=t.y-f*a+u*o):(f=(i+r-c)/(2*i),u=Math.sqrt(Math.max(0,r/i-f*f)),e.x=n.x+f*o-u*a,e.y=n.y+f*a+u*o)):(e.x=n.x+e.r,e.y=n.y)}function jO(t,n){var e=t.r+n.r-1e-6,o=n.x-t.x,f=n.y-t.y;return e>0&&e*e>o*o+f*f}function UO(t){var n=t._,e=t.next._,o=n.r+e.r,f=(n.x*e.r+e.x*n.r)/o,r=(n.y*e.r+e.y*n.r)/o;return f*f+r*r}function mb(t){this._=t,this.next=null,this.previous=null}function Toe(t,n){if(!(r=(t=yoe(t)).length))return 0;var e,o,f,r,a,u,c,i,s,l,d;if(e=t[0],e.x=0,e.y=0,!(r>1))return e.r;if(o=t[1],e.x=-o.r,o.x=e.r,o.y=0,!(r>2))return e.r+o.r;BO(o,e,f=t[2]),e=new mb(e),o=new mb(o),f=new mb(f),e.next=f.previous=o,o.next=e.previous=f,f.next=o.previous=e;e:for(c=3;cLoe(e(w,k,f))),y=v.map(GO),x=new Set(v).add("");for(const w of y)x.has(w)||(x.add(w),v.push(w),y.push(GO(w)),r.push(i4));a=(w,k)=>v[k],u=(w,k)=>y[k]}for(s=0,c=r.length;s=0&&(h=r[v],h.data===i4);--v)h.data=null}if(l.parent=Eoe,l.eachBefore(function(v){v.depth=v.parent.depth+1,--c}).eachBefore(VB),l.parent=null,c>0)throw new Error("cycle");return l}return o.id=function(f){return arguments.length?(t=Kb(f),o):t},o.parentId=function(f){return arguments.length?(n=Kb(f),o):n},o.path=function(f){return arguments.length?(e=Kb(f),o):e},o}function Loe(t){t=`${t}`;let n=t.length;return dT(t,n-1)&&!dT(t,n-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function GO(t){let n=t.length;if(n<2)return"";for(;--n>1&&!dT(t,n););return t.slice(0,n)}function dT(t,n){if(t[n]==="/"){let e=0;for(;n>0&&t[--n]==="\\";)++e;if((e&1)===0)return!0}return!1}function Poe(t,n){return t.parent===n.parent?1:2}function a4(t){var n=t.children;return n?n[0]:t.t}function o4(t){var n=t.children;return n?n[n.length-1]:t.t}function Doe(t,n,e){var o=e/(n.i-t.i);n.c-=o,n.s+=e,t.c+=o,n.z+=e,n.m+=e}function Ioe(t){for(var n=0,e=0,o=t.children,f=o.length,r;--f>=0;)r=o[f],r.z+=n,r.m+=n,n+=r.s+(e+=r.c)}function zoe(t,n,e){return t.a.parent===n.parent?t.a:e}function Qb(t,n){this._=t,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=n}Qb.prototype=Object.create(km.prototype);function Roe(t){for(var n=new Qb(t,0),e,o=[n],f,r,a,u;e=o.pop();)if(r=e._.children)for(e.children=new Array(u=r.length),a=u-1;a>=0;--a)o.push(f=e.children[a]=new Qb(r[a],a)),f.parent=e;return(n.parent=new Qb(null,0)).children=[n],n}function Foe(){var t=Poe,n=1,e=1,o=null;function f(i){var s=Roe(i);if(s.eachAfter(r),s.parent.m=-s.z,s.eachBefore(a),o)i.eachBefore(c);else{var l=i,d=i,h=i;i.eachBefore(function(y){y.xd.x&&(d=y),y.depth>h.depth&&(h=y)});var m=l===d?1:t(l,d)/2,g=m-l.x,p=n/(d.x+m+g),v=e/(h.depth||1);i.eachBefore(function(y){y.x=(y.x+g)*p,y.y=y.depth*v})}return i}function r(i){var s=i.children,l=i.parent.children,d=i.i?l[i.i-1]:null;if(s){Ioe(i);var h=(s[0].z+s[s.length-1].z)/2;d?(i.z=d.z+t(i._,d._),i.m=i.z-h):i.z=h}else d&&(i.z=d.z+t(i._,d._));i.parent.A=u(i,d,i.parent.A||l[0])}function a(i){i._.x=i.z+i.parent.m,i.m+=i.parent.m}function u(i,s,l){if(s){for(var d=i,h=i,m=s,g=d.parent.children[0],p=d.m,v=h.m,y=m.m,x=g.m,w;m=o4(m),d=a4(d),m&&d;)g=a4(g),h=o4(h),h.a=i,w=m.z+y-d.z-p+t(m._,d._),w>0&&(Doe(zoe(m,i,l),i,w),p+=w,v+=w),y+=m.m,p+=d.m,x+=g.m,v+=h.m;m&&!o4(h)&&(h.t=m,h.m+=y-v),d&&!a4(g)&&(g.t=d,g.m+=p-x,l=i)}return l}function c(i){i.x*=n,i.y=i.depth*e}return f.separation=function(i){return arguments.length?(t=i,f):t},f.size=function(i){return arguments.length?(o=!1,n=+i[0],e=+i[1],f):o?null:[n,e]},f.nodeSize=function(i){return arguments.length?(o=!0,n=+i[0],e=+i[1],f):o?[n,e]:null},f}function Rw(t,n,e,o,f){for(var r=t.children,a,u=-1,c=r.length,i=t.value&&(f-e)/t.value;++uy&&(y=i),b=p*p*k,x=Math.max(y/b,b/v),x>w){p-=i;break}w=x}a.push(c={value:p,dice:h1?o:1)},e}(WB);function Noe(){var t=XB,n=!1,e=1,o=1,f=[0],r=n0,a=n0,u=n0,c=n0,i=n0;function s(d){return d.x0=d.y0=0,d.x1=e,d.y1=o,d.eachBefore(l),f=[0],n&&d.eachBefore(GB),d}function l(d){var h=f[d.depth],m=d.x0+h,g=d.y0+h,p=d.x1-h,v=d.y1-h;p=d-1){var y=r[l];y.x0=m,y.y0=g,y.x1=p,y.y1=v;return}for(var x=i[l],w=h/2+x,k=l+1,b=d-1;k>>1;i[T]v-g){var A=h?(m*M+p*_)/h:p;s(l,k,_,m,g,A,v),s(k,d,M,A,g,p,v)}else{var S=h?(g*M+v*_)/h:v;s(l,k,_,m,g,p,S),s(k,d,M,m,S,p,v)}}}function joe(t,n,e,o,f){(t.depth&1?Rw:$y)(t,n,e,o,f)}var Uoe=function t(n){function e(o,f,r,a,u){if((c=o._squarify)&&c.ratio===n)for(var c,i,s,l,d=-1,h,m=c.length,g=o.value;++d1?o:1)},e}(WB);function pT(t,n,e){const o={};return t.each(f=>{const r=f.data;e(r)&&(o[n(r)]=f)}),t.lookup=o,t}function _S(t){_r.call(this,null,t)}_S.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const Voe=t=>t.values;ni(_S,_r,{transform(t,n){n.source||Pr("Nest transform requires an upstream data source.");var e=t.generate,o=t.modified(),f=n.clone(),r=this.value;return(!r||o||n.changed())&&(r&&r.each(a=>{a.children&&tw(a.data)&&f.rem.push(a.data)}),this.value=r=bS({values:ki(t.keys).reduce((a,u)=>(a.key(u),a),qoe()).entries(f.source)},Voe),e&&r.each(a=>{a.children&&(a=ro(a.data),f.add.push(a),f.source.push(a))}),pT(r,$i,$i)),f.source.root=r,f}});function qoe(){const t=[],n={entries:f=>o(e(f,0),0),key:f=>(t.push(f),n)};function e(f,r){if(r>=t.length)return f;const a=f.length,u=t[r++],c={},i={};let s=-1,l,d,h;for(;++st.length)return f;const a=[];for(const u in f)a.push({key:u,values:o(f[u],r)});return a}return n}function Kh(t){_r.call(this,null,t)}const Hoe=(t,n)=>t.parent===n.parent?1:2;ni(Kh,_r,{transform(t,n){(!n.source||!n.source.root)&&Pr(this.constructor.name+" transform requires a backing tree data source.");const e=this.layout(t.method),o=this.fields,f=n.source.root,r=t.as||o;t.field?f.sum(t.field):f.count(),t.sort&&f.sort(H0(t.sort,a=>a.data)),$oe(e,this.params,t),e.separation&&e.separation(t.separation!==!1?Hoe:Um);try{this.value=e(f)}catch(a){Pr(a)}return f.each(a=>Goe(a,o,r)),n.reflow(t.modified()).modifies(r).modifies("leaf")}});function $oe(t,n,e){for(let o,f=0,r=n.length;fr[$i(a)]=1),o.each(a=>{const u=a.data,c=a.parent&&a.parent.data;c&&r[$i(u)]&&r[$i(c)]&&f.add.push(ro({source:c,target:u}))}),this.value=f.add):n.changed(n.MOD)&&(n.visit(n.MOD,a=>r[$i(a)]=1),e.forEach(a=>{(r[$i(a.source)]||r[$i(a.target)])&&f.mod.push(a)})),f}});const YO={binary:Boe,dice:$y,slice:Rw,slicedice:joe,squarify:XB,resquarify:Uoe},yT=["x0","y0","x1","y1","depth","children"];function SS(t){Kh.call(this,t)}SS.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:yT.length,default:yT}]};ni(SS,Kh,{layout(){const t=Noe();return t.ratio=n=>{const e=t.tile();e.ratio&&t.tile(e.ratio(n))},t.method=n=>{qi(YO,n)?t.tile(YO[n]):Pr("Unrecognized Treemap layout method: "+n)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:yT});var Woe=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",nest:_S,pack:wS,partition:kS,stratify:TS,tree:AS,treelinks:MS,treemap:SS});const s4=4278190080;function Yoe(t,n){const e=t.bitmap();return(n||[]).forEach(o=>e.set(t(o.boundary[0]),t(o.boundary[3]))),[e,void 0]}function Xoe(t,n,e,o,f){const r=t.width,a=t.height,u=o||f,c=Vd(r,a).getContext("2d"),i=Vd(r,a).getContext("2d"),s=u&&Vd(r,a).getContext("2d");e.forEach(_=>e_(c,_,!1)),e_(i,n,!1),u&&e_(s,n,!0);const l=l4(c,r,a),d=l4(i,r,a),h=u&&l4(s,r,a),m=t.bitmap(),g=u&&t.bitmap();let p,v,y,x,w,k,b,T;for(v=0;v{f.items.forEach(r=>e_(t,r.items,e))}):tc[o].draw(t,{items:e?n.map(Zoe):n})}function Zoe(t){const n=nw(t,{});return n.stroke&&n.strokeOpacity!==0||n.fill&&n.fillOpacity!==0?{...n,strokeOpacity:1,stroke:"#000",fillOpacity:0}:n}const Mh=5,tu=31,ry=32,Td=new Uint32Array(ry+1),Yc=new Uint32Array(ry+1);Yc[0]=0;Td[0]=~Yc[0];for(let t=1;t<=ry;++t)Yc[t]=Yc[t-1]<<1|1,Td[t]=~Yc[t];function Joe(t,n){const e=new Uint32Array(~~((t*n+ry)/ry));function o(r,a){e[r]|=a}function f(r,a){e[r]&=a}return{array:e,get:(r,a)=>{const u=a*t+r;return e[u>>>Mh]&1<<(u&tu)},set:(r,a)=>{const u=a*t+r;o(u>>>Mh,1<<(u&tu))},clear:(r,a)=>{const u=a*t+r;f(u>>>Mh,~(1<<(u&tu)))},getRange:(r,a,u,c)=>{let i=c,s,l,d,h;for(;i>=a;--i)if(s=i*t+r,l=i*t+u,d=s>>>Mh,h=l>>>Mh,d===h){if(e[d]&Td[s&tu]&Yc[(l&tu)+1])return!0}else{if(e[d]&Td[s&tu]||e[h]&Yc[(l&tu)+1])return!0;for(let m=d+1;m{let i,s,l,d,h;for(;a<=c;++a)if(i=a*t+r,s=a*t+u,l=i>>>Mh,d=s>>>Mh,l===d)o(l,Td[i&tu]&Yc[(s&tu)+1]);else for(o(l,Td[i&tu]),o(d,Yc[(s&tu)+1]),h=l+1;h{let i,s,l,d,h;for(;a<=c;++a)if(i=a*t+r,s=a*t+u,l=i>>>Mh,d=s>>>Mh,l===d)f(l,Yc[i&tu]|Td[(s&tu)+1]);else for(f(l,Yc[i&tu]),f(d,Td[(s&tu)+1]),h=l+1;hr<0||a<0||c>=n||u>=t}}function Koe(t,n,e){const o=Math.max(1,Math.sqrt(t*n/1e6)),f=~~((t+2*e+o)/o),r=~~((n+2*e+o)/o),a=u=>~~((u+e)/o);return a.invert=u=>u*o-e,a.bitmap=()=>Joe(f,r),a.ratio=o,a.padding=e,a.width=t,a.height=n,a}function Qoe(t,n,e,o){const f=t.width,r=t.height;return function(a){const u=a.datum.datum.items[o].items,c=u.length,i=a.datum.fontSize,s=af.width(a.datum,a.datum.text);let l=0,d,h,m,g,p,v,y;for(let x=0;x=l&&(l=y,a.x=p,a.y=v);return p=s/2,v=i/2,d=a.x-p,h=a.x+p,m=a.y-v,g=a.y+v,a.align="center",d<0&&h<=f?a.align="left":0<=d&&ff||n-(a=o/2)<0||n+a>r}function Fd(t,n,e,o,f,r,a,u){const c=f*r/(o*2),i=t(n-c),s=t(n+c),l=t(e-(r=r/2)),d=t(e+r);return a.outOfBounds(i,l,s,d)||a.getRange(i,l,s,d)||u&&u.getRange(i,l,s,d)}function ese(t,n,e,o){const f=t.width,r=t.height,a=n[0],u=n[1];function c(i,s,l,d,h){const m=t.invert(i),g=t.invert(s);let p=l,v=r,y;if(!p2(m,g,d,h,f,r)&&!Fd(t,m,g,h,d,p,a,u)&&!Fd(t,m,g,h,d,h,a,null)){for(;v-p>=1;)y=(p+v)/2,Fd(t,m,g,h,d,y,a,u)?v=y:p=y;if(p>l)return[m,g,p,!0]}}return function(i){const s=i.datum.datum.items[o].items,l=s.length,d=i.datum.fontSize,h=af.width(i.datum,i.datum.text);let m=e?d:0,g=!1,p=!1,v=0,y,x,w,k,b,T,_,M,A,S,E,D,O,R,z,L,P;for(let N=0;Nx&&(P=y,y=x,x=P),w>k&&(P=w,w=k,k=P),A=t(y),E=t(x),S=~~((A+E)/2),D=t(w),R=t(k),O=~~((D+R)/2),_=S;_>=A;--_)for(M=O;M>=D;--M)L=c(_,M,m,h,d),L&&([i.x,i.y,m,g]=L);for(_=S;_<=E;++_)for(M=O;M<=R;++M)L=c(_,M,m,h,d),L&&([i.x,i.y,m,g]=L);!g&&!e&&(z=Math.abs(x-y+k-w),b=(y+x)/2,T=(w+k)/2,z>=v&&!p2(b,T,h,d,f,r)&&!Fd(t,b,T,d,h,d,a,null)&&(v=z,i.x=b,i.y=T,p=!0))}return g||p?(b=h/2,T=d/2,a.setRange(t(i.x-b),t(i.y-T),t(i.x+b),t(i.y+T)),i.align="center",i.baseline="middle",!0):!1}}const tse=[-1,-1,1,1],nse=[-1,1,-1,1];function rse(t,n,e,o){const f=t.width,r=t.height,a=n[0],u=n[1],c=t.bitmap();return function(i){const s=i.datum.datum.items[o].items,l=s.length,d=i.datum.fontSize,h=af.width(i.datum,i.datum.text),m=[];let g=e?d:0,p=!1,v=!1,y=0,x,w,k,b,T,_,M,A,S,E,D,O;for(let R=0;R=1;)D=(S+E)/2,Fd(t,T,_,d,h,D,a,u)?E=D:S=D;S>g&&(i.x=T,i.y=_,g=S,p=!0)}}!p&&!e&&(O=Math.abs(w-x+b-k),T=(x+w)/2,_=(k+b)/2,O>=y&&!p2(T,_,h,d,f,r)&&!Fd(t,T,_,d,h,d,a,null)&&(y=O,i.x=T,i.y=_,v=!0))}return p||v?(T=h/2,_=d/2,a.setRange(t(i.x-T),t(i.y-_),t(i.x+T),t(i.y+_)),i.align="center",i.baseline="middle",!0):!1}}const ise=["right","center","left"],ase=["bottom","middle","top"];function ose(t,n,e,o){const f=t.width,r=t.height,a=n[0],u=n[1],c=o.length;return function(i){var s;const l=i.boundary,d=i.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>f||l[3]>r)return!1;let h=(s=i.textWidth)!==null&&s!==void 0?s:0,m,g,p,v,y,x,w,k,b,T,_,M,A,S,E;for(let D=0;D>>2&3)-1,p=m===0&&g===0||o[D]<0,v=m&&g?Math.SQRT1_2:1,y=o[D]<0?-1:1,x=l[1+m]+o[D]*m*v,_=l[4+g]+y*d*g/2+o[D]*g*v,k=_-d/2,b=_+d/2,M=t(x),S=t(k),E=t(b),!h)if(XO(M,M,S,E,a,u,x,x,k,b,l,p))h=af.width(i.datum,i.datum.text);else continue;if(T=x+y*h*m/2,x=T-h/2,w=T+h/2,M=t(x),A=t(w),XO(M,A,S,E,a,u,x,w,k,b,l,p))return i.x=m?m*y<0?w:x:T,i.y=g?g*y<0?b:k:_,i.align=ise[m*y+1],i.baseline=ase[g*y+1],a.setRange(M,S,A,E),!0}return!1}}function XO(t,n,e,o,f,r,a,u,c,i,s,l){return!(f.outOfBounds(t,e,n,o)||(l&&r||f).getRange(t,e,n,o))}const u4=0,c4=4,f4=8,h4=0,d4=1,p4=2,sse={"top-left":u4+h4,top:u4+d4,"top-right":u4+p4,left:c4+h4,middle:c4+d4,right:c4+p4,"bottom-left":f4+h4,bottom:f4+d4,"bottom-right":f4+p4},lse={naive:Qoe,"reduced-search":ese,floodfill:rse};function use(t,n,e,o,f,r,a,u,c,i,s){if(!t.length)return t;const l=Math.max(o.length,f.length),d=cse(o,l),h=fse(f,l),m=hse(t[0].datum),g=m==="group"&&t[0].datum.items[c].marktype,p=g==="area",v=dse(m,g,u,c),y=i===null||i===1/0,x=p&&s==="naive";let w=-1,k=-1;const b=t.map(A=>{const S=y?af.width(A,A.text):void 0;return w=Math.max(w,S),k=Math.max(k,A.fontSize),{datum:A,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(A),textWidth:S}});i=i===null||i===1/0?Math.max(w,k)+Math.max(...o):i;const T=Koe(n[0],n[1],i);let _;if(!x){e&&b.sort((E,D)=>e(E.datum,D.datum));let A=!1;for(let E=0;EE.datum);_=r.length||S?Xoe(T,S||[],r,A,p):Yoe(T,a&&b)}const M=p?lse[s](T,_,a,c):ose(T,_,h,d);return b.forEach(A=>A.opacity=+M(A)),b}function cse(t,n){const e=new Float64Array(n),o=t.length;for(let f=0;f[r.x,r.x,r.x,r.y,r.y,r.y];return t?t==="line"||t==="area"?r=>f(r.datum):n==="line"?r=>{const a=r.datum.items[o].items;return f(a.length?a[e==="start"?0:a.length-1]:{x:NaN,y:NaN})}:r=>{const a=r.datum.bounds;return[a.x1,(a.x1+a.x2)/2,a.x2,a.y1,(a.y1+a.y2)/2,a.y2]}:f}const xT=["x","y","opacity","align","baseline"],ZB=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function ES(t){_r.call(this,null,t)}ES.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:ZB},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:xT.length,default:xT}]};ni(ES,_r,{transform(t,n){function e(r){const a=t[r];return ga(a)&&n.modified(a.fields)}const o=t.modified();if(!(o||n.changed(n.ADD_REM)||e("sort")))return;(!t.size||t.size.length!==2)&&Pr("Size parameter should be specified as a [width, height] array.");const f=t.as||xT;return use(n.materialize(n.SOURCE).source||[],t.size,t.sort,ki(t.offset==null?1:t.offset),ki(t.anchor||ZB),t.avoidMarks||[],t.avoidBaseMark!==!1,t.lineAnchor||"end",t.markIndex||0,t.padding===void 0?0:t.padding,t.method||"naive").forEach(r=>{const a=r.datum;a[f[0]]=r.x,a[f[1]]=r.y,a[f[2]]=r.opacity,a[f[3]]=r.align,a[f[4]]=r.baseline}),n.reflow(o).modifies(f)}});var pse=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",label:ES});function JB(t,n){var e=[],o=function(s){return s(u)},f,r,a,u,c,i;if(n==null)e.push(t);else for(f={},r=0,a=t.length;r{zz(i,t.x,t.y,t.bandwidth||.3).forEach(s=>{const l={};for(let d=0;dt==="poly"?n:t==="quad"?2:1;function OS(t){_r.call(this,null,t)}OS.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(bT)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};ni(OS,_r,{transform(t,n){const e=n.fork(n.NO_SOURCE|n.NO_FIELDS);if(!this.value||n.changed()||t.modified()){const o=n.materialize(n.SOURCE).source,f=JB(o,t.groupby),r=(t.groupby||[]).map(xs),a=t.method||"linear",u=t.order||3,c=gse(a,u),i=t.as||[xs(t.x),xs(t.y)],s=bT[a],l=[];let d=t.extent;qi(bT,a)||Pr("Invalid regression method: "+a),d!=null&&a==="log"&&d[0]<=0&&(n.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),f.forEach(h=>{if(h.length<=c){n.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=s(h,t.x,t.y,u);if(t.params){l.push(ro({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const p=d||Zf(h,t.x),v=y=>{const x={};for(let w=0;wv([y,g.predict(y)])):uw(g.predict,p,25,200).forEach(v)}),this.value&&(e.rem=this.value),this.value=e.add=e.source=l}return e}});var mse=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",loess:CS,regression:OS});const Uh=11102230246251565e-32,Ol=134217729,vse=(3+8*Uh)*Uh;function g4(t,n,e,o,f){let r,a,u,c,i=n[0],s=o[0],l=0,d=0;s>i==s>-i?(r=i,i=n[++l]):(r=s,s=o[++d]);let h=0;if(li==s>-i?(a=i+r,u=r-(a-i),i=n[++l]):(a=s+r,u=r-(a-s),s=o[++d]),r=a,u!==0&&(f[h++]=u);li==s>-i?(a=r+i,c=a-r,u=r-(a-c)+(i-c),i=n[++l]):(a=r+s,c=a-r,u=r-(a-c)+(s-c),s=o[++d]),r=a,u!==0&&(f[h++]=u);for(;l=O||-D>=O||(l=t-M,u=t-(M+l)+(l-f),l=e-A,i=e-(A+l)+(l-f),l=n-S,c=n-(S+l)+(l-r),l=o-E,s=o-(E+l)+(l-r),u===0&&c===0&&i===0&&s===0)||(O=_se*a+vse*Math.abs(D),D+=M*s+E*u-(S*i+A*c),D>=O||-D>=O))return D;w=u*E,d=Ol*u,h=d-(d-u),m=u-h,d=Ol*E,g=d-(d-E),p=E-g,k=m*p-(w-h*g-m*g-h*p),b=c*A,d=Ol*c,h=d-(d-c),m=c-h,d=Ol*A,g=d-(d-A),p=A-g,T=m*p-(b-h*g-m*g-h*p),v=k-T,l=k-v,nu[0]=k-(v+l)+(l-T),y=w+v,l=y-w,x=w-(y-l)+(v-l),v=x-b,l=x-v,nu[1]=x-(v+l)+(l-b),_=y+v,l=_-y,nu[2]=y-(_-l)+(v-l),nu[3]=_;const R=g4(4,Rg,4,nu,ZO);w=M*s,d=Ol*M,h=d-(d-M),m=M-h,d=Ol*s,g=d-(d-s),p=s-g,k=m*p-(w-h*g-m*g-h*p),b=S*i,d=Ol*S,h=d-(d-S),m=S-h,d=Ol*i,g=d-(d-i),p=i-g,T=m*p-(b-h*g-m*g-h*p),v=k-T,l=k-v,nu[0]=k-(v+l)+(l-T),y=w+v,l=y-w,x=w-(y-l)+(v-l),v=x-b,l=x-v,nu[1]=x-(v+l)+(l-b),_=y+v,l=_-y,nu[2]=y-(_-l)+(v-l),nu[3]=_;const z=g4(R,ZO,4,nu,JO);w=u*s,d=Ol*u,h=d-(d-u),m=u-h,d=Ol*s,g=d-(d-s),p=s-g,k=m*p-(w-h*g-m*g-h*p),b=c*i,d=Ol*c,h=d-(d-c),m=c-h,d=Ol*i,g=d-(d-i),p=i-g,T=m*p-(b-h*g-m*g-h*p),v=k-T,l=k-v,nu[0]=k-(v+l)+(l-T),y=w+v,l=y-w,x=w-(y-l)+(v-l),v=x-b,l=x-v,nu[1]=x-(v+l)+(l-b),_=y+v,l=_-y,nu[2]=y-(_-l)+(v-l),nu[3]=_;const L=g4(z,JO,4,nu,KO);return KO[L-1]}function vb(t,n,e,o,f,r){const a=(n-r)*(e-f),u=(t-f)*(o-r),c=a-u;if(a===0||u===0||a>0!=u>0)return c;const i=Math.abs(a+u);return Math.abs(c)>=xse*i?c:-wse(t,n,e,o,f,r,i)}const QO=Math.pow(2,-52),yb=new Uint32Array(512);class g2{static from(n,e=Sse,o=Ese){const f=n.length,r=new Float64Array(f*2);for(let a=0;a>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const o=Math.max(2*e-5,0);this._triangles=new Uint32Array(o*3),this._halfedges=new Int32Array(o*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:o,_hullTri:f,_hullHash:r}=this,a=n.length>>1;let u=1/0,c=1/0,i=-1/0,s=-1/0;for(let A=0;Ai&&(i=S),E>s&&(s=E),this._ids[A]=A}const l=(u+i)/2,d=(c+s)/2;let h=1/0,m,g,p;for(let A=0;A0&&(g=A,h=S)}let x=n[2*g],w=n[2*g+1],k=1/0;for(let A=0;AD&&(A[S++]=O,D=this._dists[O])}this.hull=A.subarray(0,S),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(vb(v,y,x,w,b,T)<0){const A=g,S=x,E=w;g=p,x=b,w=T,p=A,b=S,T=E}const _=Mse(v,y,x,w,b,T);this._cx=_.x,this._cy=_.y;for(let A=0;A0&&Math.abs(O-S)<=QO&&Math.abs(R-E)<=QO||(S=O,E=R,D===m||D===g||D===p))continue;let z=0;for(let G=0,W=this._hashKey(O,R);G=0;)if(L=P,L===z){L=-1;break}if(L===-1)continue;let N=this._addTriangle(L,D,o[L],-1,-1,f[L]);f[D]=this._legalize(N+2),f[L]=N,M++;let B=o[L];for(;P=o[B],vb(O,R,n[2*B],n[2*B+1],n[2*P],n[2*P+1])<0;)N=this._addTriangle(B,D,P,f[D],-1,f[B]),f[D]=this._legalize(N+2),o[B]=B,M--,B=P;if(L===z)for(;P=e[L],vb(O,R,n[2*P],n[2*P+1],n[2*L],n[2*L+1])<0;)N=this._addTriangle(P,D,L,-1,f[L],f[P]),this._legalize(N+2),f[P]=N,o[L]=L,M--,L=P;this._hullStart=e[D]=L,o[L]=e[B]=D,o[D]=B,r[this._hashKey(O,R)]=D,r[this._hashKey(n[2*L],n[2*L+1])]=L}this.hull=new Uint32Array(M);for(let A=0,S=this._hullStart;A0?3-e:1+e)/4}function m4(t,n,e,o){const f=t-e,r=n-o;return f*f+r*r}function Tse(t,n,e,o,f,r,a,u){const c=t-a,i=n-u,s=e-a,l=o-u,d=f-a,h=r-u,m=c*c+i*i,g=s*s+l*l,p=d*d+h*h;return c*(l*p-g*h)-i*(s*p-g*d)+m*(s*h-l*d)<0}function Ase(t,n,e,o,f,r){const a=e-t,u=o-n,c=f-t,i=r-n,s=a*a+u*u,l=c*c+i*i,d=.5/(a*i-u*c),h=(i*s-u*l)*d,m=(a*l-c*s)*d;return h*h+m*m}function Mse(t,n,e,o,f,r){const a=e-t,u=o-n,c=f-t,i=r-n,s=a*a+u*u,l=c*c+i*i,d=.5/(a*i-u*c),h=t+(i*s-u*l)*d,m=n+(a*l-c*s)*d;return{x:h,y:m}}function Jg(t,n,e,o){if(o-e<=20)for(let f=e+1;f<=o;f++){const r=t[f],a=n[r];let u=f-1;for(;u>=e&&n[t[u]]>a;)t[u+1]=t[u--];t[u+1]=r}else{const f=e+o>>1;let r=e+1,a=o;$1(t,f,r),n[t[e]]>n[t[o]]&&$1(t,e,o),n[t[r]]>n[t[o]]&&$1(t,r,o),n[t[e]]>n[t[r]]&&$1(t,e,r);const u=t[r],c=n[u];for(;;){do r++;while(n[t[r]]c);if(a=a-e?(Jg(t,n,r,o),Jg(t,n,e,a-1)):(Jg(t,n,e,a-1),Jg(t,n,r,o))}}function $1(t,n,e){const o=t[n];t[n]=t[e],t[e]=o}function Sse(t){return t[0]}function Ese(t){return t[1]}const eL=1e-6;class o0{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(n,e){this._+=`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(n,e){this._+=`L${this._x1=+n},${this._y1=+e}`}arc(n,e,o){n=+n,e=+e,o=+o;const f=n+o,r=e;if(o<0)throw new Error("negative radius");this._x1===null?this._+=`M${f},${r}`:(Math.abs(this._x1-f)>eL||Math.abs(this._y1-r)>eL)&&(this._+="L"+f+","+r),o&&(this._+=`A${o},${o},0,1,1,${n-o},${e}A${o},${o},0,1,1,${this._x1=f},${this._y1=r}`)}rect(n,e,o,f){this._+=`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}h${+o}v${+f}h${-o}Z`}value(){return this._||null}}class _T{constructor(){this._=[]}moveTo(n,e){this._.push([n,e])}closePath(){this._.push(this._[0].slice())}lineTo(n,e){this._.push([n,e])}value(){return this._.length?this._:null}}class Cse{constructor(n,[e,o,f,r]=[0,0,960,500]){if(!((f=+f)>=(e=+e))||!((r=+r)>=(o=+o)))throw new Error("invalid bounds");this.delaunay=n,this._circumcenters=new Float64Array(n.points.length*2),this.vectors=new Float64Array(n.points.length*2),this.xmax=f,this.xmin=e,this.ymax=r,this.ymin=o,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:n,hull:e,triangles:o},vectors:f}=this,r=this.circumcenters=this._circumcenters.subarray(0,o.length/3*2);for(let h=0,m=0,g=o.length,p,v;h1;)r-=2;for(let a=2;a4)for(let a=0;a0){if(e>=this.ymax)return null;(a=(this.ymax-e)/f)0){if(n>=this.xmax)return null;(a=(this.xmax-n)/o)this.xmax?2:0)|(ethis.ymax?8:0)}}const Ose=2*Math.PI,Fg=Math.pow;function Lse(t){return t[0]}function Pse(t){return t[1]}function Dse(t){const{triangles:n,coords:e}=t;for(let o=0;o1e-10)return!1}return!0}function Ise(t,n,e){return[t+Math.sin(t+n)*e,n+Math.cos(t-n)*e]}class LS{static from(n,e=Lse,o=Pse,f){return new LS("length"in n?zse(n,e,o,f):Float64Array.from(Rse(n,e,o,f)))}constructor(n){this._delaunator=new g2(n),this.inedges=new Int32Array(n.length/2),this._hullIndex=new Int32Array(n.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const n=this._delaunator,e=this.points;if(n.hull&&n.hull.length>2&&Dse(n)){this.collinear=Int32Array.from({length:e.length/2},(d,h)=>h).sort((d,h)=>e[2*d]-e[2*h]||e[2*d+1]-e[2*h+1]);const c=this.collinear[0],i=this.collinear[this.collinear.length-1],s=[e[2*c],e[2*c+1],e[2*i],e[2*i+1]],l=1e-8*Math.hypot(s[3]-s[1],s[2]-s[0]);for(let d=0,h=e.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=f[0],a[f[0]]=1,f.length===2&&(a[f[1]]=0,this.triangles[1]=f[1],this.triangles[2]=f[1]))}voronoi(n){return new Cse(this,n)}*neighbors(n){const{inedges:e,hull:o,_hullIndex:f,halfedges:r,triangles:a,collinear:u}=this;if(u){const l=u.indexOf(n);l>0&&(yield u[l-1]),l=0&&r!==o&&r!==f;)o=r;return r}_step(n,e,o){const{inedges:f,hull:r,_hullIndex:a,halfedges:u,triangles:c,points:i}=this;if(f[n]===-1||!i.length)return(n+1)%(i.length>>1);let s=n,l=Fg(e-i[n*2],2)+Fg(o-i[n*2+1],2);const d=f[n];let h=d;do{let m=c[h];const g=Fg(e-i[m*2],2)+Fg(o-i[m*2+1],2);if(g>5,t_=1<<11;function jse(){var t=[256,256],n,e,o,f,r,a,u,c=KB,i=[],s=Math.random,l={};l.layout=function(){for(var m=d(Vd()),g=Gse((t[0]>>5)*t[1]),p=null,v=i.length,y=-1,x=[],w=i.map(b=>({text:n(b),font:e(b),style:f(b),weight:r(b),rotate:a(b),size:~~(o(b)+1e-14),padding:u(b),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:b})).sort((b,T)=>T.size-b.size);++y>1,k.y=t[1]*(s()+.5)>>1,Use(m,k,w,y),k.hasText&&h(g,k,p)&&(x.push(k),p?qse(p,k):p=[{x:k.x+k.x0,y:k.y+k.y0},{x:k.x+k.x1,y:k.y+k.y1}],k.x-=t[0]>>1,k.y-=t[1]>>1)}return x};function d(m){m.width=m.height=1;var g=Math.sqrt(m.getContext("2d").getImageData(0,0,1,1).data.length>>2);m.width=(wv<<5)/g,m.height=t_/g;var p=m.getContext("2d");return p.fillStyle=p.strokeStyle="red",p.textAlign="center",{context:p,ratio:g}}function h(m,g,p){for(var v=g.x,y=g.y,x=Math.sqrt(t[0]*t[0]+t[1]*t[1]),w=c(t),k=s()<.5?1:-1,b=-k,T,_,M;(T=w(b+=k))&&(_=~~T[0],M=~~T[1],!(Math.min(Math.abs(_),Math.abs(M))>=x));)if(g.x=v+_,g.y=y+M,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>t[0]||g.y+g.y1>t[1])&&(!p||!Vse(g,m,t[0]))&&(!p||Hse(g,p))){for(var A=g.sprite,S=g.width>>5,E=t[0]>>5,D=g.x-(S<<4),O=D&127,R=32-O,z=g.y1-g.y0,L=(g.y+g.y0)*E+(D>>5),P,N=0;N>>O:0);L+=E}return g.sprite=null,!0}return!1}return l.words=function(m){return arguments.length?(i=m,l):i},l.size=function(m){return arguments.length?(t=[+m[0],+m[1]],l):t},l.font=function(m){return arguments.length?(e=Bp(m),l):e},l.fontStyle=function(m){return arguments.length?(f=Bp(m),l):f},l.fontWeight=function(m){return arguments.length?(r=Bp(m),l):r},l.rotate=function(m){return arguments.length?(a=Bp(m),l):a},l.text=function(m){return arguments.length?(n=Bp(m),l):n},l.spiral=function(m){return arguments.length?(c=Wse[m]||m,l):c},l.fontSize=function(m){return arguments.length?(o=Bp(m),l):o},l.padding=function(m){return arguments.length?(u=Bp(m),l):u},l.random=function(m){return arguments.length?(s=m,l):s},l}function Use(t,n,e,o){if(!n.sprite){var f=t.context,r=t.ratio;f.clearRect(0,0,(wv<<5)/r,t_/r);var a=0,u=0,c=0,i=e.length,s,l,d,h,m;for(--o;++o>5<<5,d=~~Math.max(Math.abs(y+x),Math.abs(y-x))}else s=s+31>>5<<5;if(d>c&&(c=d),a+s>=wv<<5&&(a=0,u+=c,c=0),u+d>=t_)break;f.translate((a+(s>>1))/r,(u+(d>>1))/r),n.rotate&&f.rotate(n.rotate*v4),f.fillText(n.text,0,0),n.padding&&(f.lineWidth=2*n.padding,f.strokeText(n.text,0,0)),f.restore(),n.width=s,n.height=d,n.xoff=a,n.yoff=u,n.x1=s>>1,n.y1=d>>1,n.x0=-n.x1,n.y0=-n.y1,n.hasText=!0,a+=s}for(var k=f.getImageData(0,0,(wv<<5)/r,t_/r).data,b=[];--o>=0;)if(n=e[o],!!n.hasText){for(s=n.width,l=s>>5,d=n.y1-n.y0,h=0;h>5),A=k[(u+m)*(wv<<5)+(a+h)<<2]?1<<31-h%32:0;b[M]|=A,T|=A}T?_=m:(n.y0++,d--,m--,u++)}n.y1=n.y0+_,n.sprite=b.slice(0,(n.y1-n.y0)*l)}}}function Vse(t,n,e){e>>=5;for(var o=t.sprite,f=t.width>>5,r=t.x-(f<<4),a=r&127,u=32-a,c=t.y1-t.y0,i=(t.y+t.y0)*e+(r>>5),s,l=0;l>>a:0))&n[i+d])return!0;i+=e}return!1}function qse(t,n){var e=t[0],o=t[1];n.x+n.x0o.x&&(o.x=n.x+n.x1),n.y+n.y1>o.y&&(o.y=n.y+n.y1)}function Hse(t,n){return t.x+t.x1>n[0].x&&t.x+t.x0n[0].y&&t.y+t.y0g(m(p))}f.forEach(m=>{m[a[0]]=NaN,m[a[1]]=NaN,m[a[3]]=0});const i=r.words(f).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(u).random(yc).layout(),s=r.size(),l=s[0]>>1,d=s[1]>>1,h=i.length;for(let m=0,g,p;mnew Uint8Array(t),Jse=t=>new Uint16Array(t),zv=t=>new Uint32Array(t);function Kse(){let t=8,n=[],e=zv(0),o=xb(0,t),f=xb(0,t);return{data:()=>n,seen:()=>e=Qse(e,n.length),add(r){for(let a=0,u=n.length,c=r.length,i;an.length,curr:()=>o,prev:()=>f,reset:r=>f[r]=o[r],all:()=>t<257?255:t<65537?65535:4294967295,set(r,a){o[r]|=a},clear(r,a){o[r]&=~a},resize(r,a){const u=o.length;(r>u||a>t)&&(t=Math.max(a,t),o=xb(r,t,o),f=xb(r,t))}}}function Qse(t,n,e){return t.length>=n?t:(e=e||new t.constructor(n),e.set(t),e)}function xb(t,n,e){const o=(n<257?Zse:n<65537?Jse:zv)(t);return e&&o.set(e),o}function tL(t,n,e){const o=1<0)for(p=0;pt,size:()=>e}}function ele(t,n){return t.sort.call(n,(e,o)=>{const f=t[e],r=t[o];return fr?1:0}),JW(t,n)}function tle(t,n,e,o,f,r,a,u,c){let i=0,s=0,l;for(l=0;in.modified(o.fields));return e?this.reinit(t,n):this.eval(t,n)}else return this.init(t,n)},init(t,n){const e=t.fields,o=t.query,f=this._indices={},r=this._dims=[],a=o.length;let u=0,c,i;for(;u{const r=f.remove(n,e);for(const a in o)o[a].reindex(r)})},update(t,n,e){const o=this._dims,f=t.query,r=n.stamp,a=o.length;let u=0,c,i;for(e.filters=0,i=0;ih)for(p=h,v=Math.min(l,m);pm)for(p=Math.max(l,m),v=d;pl)for(m=l,g=Math.min(i,d);md)for(m=Math.max(i,d),g=s;mu[s]&e?null:a[s];return r.filter(r.MOD,i),f&f-1?(r.filter(r.ADD,s=>{const l=u[s]&e;return!l&&l^c[s]&e?a[s]:null}),r.filter(r.REM,s=>{const l=u[s]&e;return l&&!(l^(l^c[s]&e))?a[s]:null})):(r.filter(r.ADD,i),r.filter(r.REM,s=>(u[s]&e)===f?a[s]:null)),r.filter(r.SOURCE,s=>i(s._index))}});var nle=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",crossfilter:IS,resolvefilter:zS});const rle="RawCode",S0="Literal",ile="Property",ale="Identifier",ole="ArrayExpression",sle="BinaryExpression",ej="CallExpression",lle="ConditionalExpression",ule="LogicalExpression",cle="MemberExpression",fle="ObjectExpression",hle="UnaryExpression";function gf(t){this.type=t}gf.prototype.visit=function(t){let n,e,o;if(t(this))return 1;for(n=dle(this),e=0,o=n.length;e";lh[E0]="Identifier";lh[dp]="Keyword";lh[Nw]="Null";lh[W0]="Numeric";lh[wu]="Punctuator";lh[Yy]="String";lh[ple]="RegularExpression";var gle="ArrayExpression",mle="BinaryExpression",vle="CallExpression",yle="ConditionalExpression",tj="Identifier",xle="Literal",ble="LogicalExpression",_le="MemberExpression",wle="ObjectExpression",kle="Property",Tle="UnaryExpression",rl="Unexpected token %0",Ale="Unexpected number",Mle="Unexpected string",Sle="Unexpected identifier",Ele="Unexpected reserved word",Cle="Unexpected end of input",wT="Invalid regular expression",y4="Invalid regular expression: missing /",nj="Octal literals are not allowed in strict mode.",Ole="Duplicate data property in object literal not allowed in strict mode",_l="ILLEGAL",iy="Disabled.",Lle=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Ple=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Bw(t,n){if(!t)throw new Error("ASSERT: "+n)}function Lh(t){return t>=48&&t<=57}function RS(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function Rv(t){return"01234567".indexOf(t)>=0}function Dle(t){return t===32||t===9||t===11||t===12||t===160||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function ay(t){return t===10||t===13||t===8232||t===8233}function Xy(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t===92||t>=128&&Lle.test(String.fromCharCode(t))}function m2(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===92||t>=128&&Ple.test(String.fromCharCode(t))}const Ile={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function rj(){for(;Cr1114111||t!=="}")&&Wa({},rl,_l),n<=65535?String.fromCharCode(n):(e=(n-65536>>10)+55296,o=(n-65536&1023)+56320,String.fromCharCode(e,o))}function ij(){var t,n;for(t=Ii.charCodeAt(Cr++),n=String.fromCharCode(t),t===92&&(Ii.charCodeAt(Cr)!==117&&Wa({},rl,_l),++Cr,t=kT("u"),(!t||t==="\\"||!Xy(t.charCodeAt(0)))&&Wa({},rl,_l),n=t);Cr>>=")return Cr+=4,{type:wu,value:a,start:t,end:Cr};if(r=a.substr(0,3),r===">>>"||r==="<<="||r===">>=")return Cr+=3,{type:wu,value:r,start:t,end:Cr};if(f=r.substr(0,2),o===f[1]&&"+-<>&|".indexOf(o)>=0||f==="=>")return Cr+=2,{type:wu,value:f,start:t,end:Cr};if(f==="//"&&Wa({},rl,_l),"<>=!+-*%&|^/".indexOf(o)>=0)return++Cr,{type:wu,value:o,start:t,end:Cr};Wa({},rl,_l)}function Nle(t){let n="";for(;Cr=0&&Cr=0&&(e=e.replace(/\\u\{([0-9a-fA-F]+)\}/g,(o,f)=>{if(parseInt(f,16)<=1114111)return"x";Wa({},wT)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(e)}catch{Wa({},wT)}try{return new RegExp(t,n)}catch{return null}}function Vle(){var t,n,e,o,f;for(t=Ii[Cr],Bw(t==="/","Regular expression literal must start with a slash"),n=Ii[Cr++],e=!1,o=!1;Cr=0&&Wa({},wT,e),{value:e,literal:n}}function Hle(){var t,n,e,o;return vo=null,rj(),t=Cr,n=Vle(),e=qle(),o=Ule(n.value,e.value),{literal:n.literal+e.literal,value:o,regex:{pattern:n.value,flags:e.value},start:t,end:Cr}}function $le(t){return t.type===E0||t.type===dp||t.type===Fw||t.type===Nw}function aj(){if(rj(),Cr>=Ul)return{type:Wy,start:Cr,end:Cr};const t=Ii.charCodeAt(Cr);return Xy(t)?Fle():t===40||t===41||t===59?x4():t===39||t===34?jle():t===46?Lh(Ii.charCodeAt(Cr+1))?rL():x4():Lh(t)?rL():x4()}function Mu(){const t=vo;return Cr=t.end,vo=aj(),Cr=t.end,t}function oj(){const t=Cr;vo=aj(),Cr=t}function Gle(t){const n=new gf(gle);return n.elements=t,n}function iL(t,n,e){const o=new gf(t==="||"||t==="&&"?ble:mle);return o.operator=t,o.left=n,o.right=e,o}function Wle(t,n){const e=new gf(vle);return e.callee=t,e.arguments=n,e}function Yle(t,n,e){const o=new gf(yle);return o.test=t,o.consequent=n,o.alternate=e,o}function FS(t){const n=new gf(tj);return n.name=t,n}function kv(t){const n=new gf(xle);return n.value=t.value,n.raw=Ii.slice(t.start,t.end),t.regex&&(n.raw==="//"&&(n.raw="/(?:)/"),n.regex=t.regex),n}function aL(t,n,e){const o=new gf(_le);return o.computed=t==="[",o.object=n,o.property=e,o.computed||(e.member=!0),o}function Xle(t){const n=new gf(wle);return n.properties=t,n}function oL(t,n,e){const o=new gf(kle);return o.key=n,o.value=e,o.kind=t,o}function Zle(t,n){const e=new gf(Tle);return e.operator=t,e.argument=n,e.prefix=!0,e}function Wa(t,n){var e,o=Array.prototype.slice.call(arguments,2),f=n.replace(/%(\d)/g,(r,a)=>(Bw(a":case"<=":case">=":case"instanceof":case"in":n=7;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11;break}return n}function lue(){var t,n,e,o,f,r,a,u,c,i;if(t=vo,c=n_(),o=vo,f=uL(o),f===0)return c;for(o.prec=f,Mu(),n=[t,vo],a=n_(),r=[c,o,a];(f=uL(vo))>0;){for(;r.length>2&&f<=r[r.length-2].prec;)a=r.pop(),u=r.pop().value,c=r.pop(),n.pop(),e=iL(u,c,a),r.push(e);o=Mu(),o.prec=f,r.push(o),n.push(vo),e=n_(),r.push(e)}for(i=r.length-1,e=r[i],n.pop();i>1;)n.pop(),e=iL(r[i-1].value,r[i-2],e),i-=2;return e}function C0(){var t,n,e;return t=lue(),qo("?")&&(Mu(),n=C0(),Vl(":"),e=C0(),t=Yle(t,n,e)),t}function NS(){const t=C0();if(qo(","))throw new Error(iy);return t}function BS(t){Ii=t,Cr=0,Ul=Ii.length,vo=null,oj();const n=NS();if(vo.type!==Wy)throw new Error("Unexpect token after expression.");return n}var sj={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function lj(t){function n(a,u,c,i){let s=t(u[0]);return c&&(s=c+"("+s+")",c.lastIndexOf("new ",0)===0&&(s="("+s+")")),s+"."+a+(i<0?"":i===0?"()":"("+u.slice(1).map(t).join(",")+")")}function e(a,u,c){return i=>n(a,i,u,c)}const o="new Date",f="String",r="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(a){a.length<3&&Pr("Missing arguments to clamp function."),a.length>3&&Pr("Too many arguments to clamp function.");const u=a.map(t);return"Math.max("+u[1]+", Math.min("+u[2]+","+u[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:o,date:e("getDate",o,0),day:e("getDay",o,0),year:e("getFullYear",o,0),month:e("getMonth",o,0),hours:e("getHours",o,0),minutes:e("getMinutes",o,0),seconds:e("getSeconds",o,0),milliseconds:e("getMilliseconds",o,0),time:e("getTime",o,0),timezoneoffset:e("getTimezoneOffset",o,0),utcdate:e("getUTCDate",o,0),utcday:e("getUTCDay",o,0),utcyear:e("getUTCFullYear",o,0),utcmonth:e("getUTCMonth",o,0),utchours:e("getUTCHours",o,0),utcminutes:e("getUTCMinutes",o,0),utcseconds:e("getUTCSeconds",o,0),utcmilliseconds:e("getUTCMilliseconds",o,0),length:e("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase",f,0),lower:e("toLowerCase",f,0),substring:e("substring",f),split:e("split",f),trim:e("trim",f,0),regexp:r,test:e("test",r),if:function(a){a.length<3&&Pr("Missing arguments to if function."),a.length>3&&Pr("Too many arguments to if function.");const u=a.map(t);return"("+u[0]+"?"+u[1]+":"+u[2]+")"}}}function uue(t){const n=t&&t.length-1;return n&&(t[0]==='"'&&t[n]==='"'||t[0]==="'"&&t[n]==="'")?t.slice(1,-1):t}function uj(t){t=t||{};const n=t.allowed?ff(t.allowed):{},e=t.forbidden?ff(t.forbidden):{},o=t.constants||sj,f=(t.functions||lj)(l),r=t.globalvar,a=t.fieldvar,u=ga(r)?r:m=>`${r}["${m}"]`;let c={},i={},s=0;function l(m){if(bi(m))return m;const g=d[m.type];return g==null&&Pr("Unsupported type: "+m.type),g(m)}const d={Literal:m=>m.raw,Identifier:m=>{const g=m.name;return s>0?g:qi(e,g)?Pr("Illegal identifier: "+g):qi(o,g)?o[g]:qi(n,g)?g:(c[g]=1,u(g))},MemberExpression:m=>{const g=!m.computed,p=l(m.object);g&&(s+=1);const v=l(m.property);return p===a&&(i[uue(v)]=1),g&&(s-=1),p+(g?"."+v:"["+v+"]")},CallExpression:m=>{m.callee.type!=="Identifier"&&Pr("Illegal callee type: "+m.callee.type);const g=m.callee.name,p=m.arguments,v=qi(f,g)&&f[g];return v||Pr("Unrecognized function: "+g),ga(v)?v(p):v+"("+p.map(l).join(",")+")"},ArrayExpression:m=>"["+m.elements.map(l).join(",")+"]",BinaryExpression:m=>"("+l(m.left)+" "+m.operator+" "+l(m.right)+")",UnaryExpression:m=>"("+m.operator+l(m.argument)+")",ConditionalExpression:m=>"("+l(m.test)+"?"+l(m.consequent)+":"+l(m.alternate)+")",LogicalExpression:m=>"("+l(m.left)+m.operator+l(m.right)+")",ObjectExpression:m=>"{"+m.properties.map(l).join(",")+"}",Property:m=>{s+=1;const g=l(m.key);return s-=1,g+":"+l(m.value)}};function h(m){const g={code:l(m),globals:Object.keys(c),fields:Object.keys(i)};return c={},i={},g}return h.functions=f,h.constants=o,h}const jS="intersect",cL="union",cue="vlMulti",fue="vlPoint",fL="or",hue="and",Rf="_vgsid_",oy=Lu(Rf),due="E",pue="R",gue="R-E",mue="R-LE",vue="R-RE",v2="index:unit";function hL(t,n){for(var e=n.fields,o=n.values,f=e.length,r=0,a,u;rpa(n.fields?{values:n.fields.map(o=>(o.getter||(o.getter=Lu(o.field)))(e.datum))}:{[Rf]:oy(e.datum)},n))}function kue(t,n,e,o){for(var f=this.context.data[t],r=f?f.values.value:[],a={},u={},c={},i,s,l,d,h,m,g,p,v,y,x=r.length,w=0,k,b;w(T[s[M].field]=_,T),{})))}else h=Rf,m=oy(i),g=a[h]||(a[h]={}),p=g[d]||(g[d]=[]),p.push(m),e&&(p=u[d]||(u[d]=[]),p.push({[Rf]:m}));if(n=n||cL,a[Rf]?a[Rf]=_4["".concat(Rf,"_").concat(n)](...Object.values(a[Rf])):Object.keys(a).forEach(T=>{a[T]=Object.keys(a[T]).map(_=>a[T][_]).reduce((_,M)=>_===void 0?M:_4["".concat(c[T],"_").concat(n)](_,M))}),r=Object.keys(u),e&&r.length){const T=o?fue:cue;a[T]=n===cL?{[fL]:r.reduce((_,M)=>(_.push(...u[M]),_),[])}:{[hue]:r.map(_=>({[fL]:u[_]}))}}return a}var _4={["".concat(Rf,"_union")]:rY,["".concat(Rf,"_intersect")]:tY,E_union:function(t,n){if(!t.length)return n;for(var e=0,o=n.length;en.indexOf(e)>=0):n},R_union:function(t,n){var e=Rl(n[0]),o=Rl(n[1]);return e>o&&(e=n[1],o=n[0]),t.length?(t[0]>e&&(t[0]=e),t[1]o&&(e=n[1],o=n[0]),t.length?oo&&(t[1]=o),t):[e,o]}};const Tue=":",Aue="@";function US(t,n,e,o){n[0].type!==S0&&Pr("First argument to selection functions must be a string literal.");const f=n[0].value,r=n.length>=2&&Na(n).value,a="unit",u=Aue+a,c=Tue+f;r===jS&&!qi(o,u)&&(o[u]=e.getData(f).indataRef(e,a)),qi(o,c)||(o[c]=e.getData(f).tuplesRef())}function fj(t){const n=this.context.data[t];return n?n.values.value:[]}function Mue(t,n,e){const o=this.context.data[t]["index:"+n],f=o?o.value.get(e):void 0;return f&&f.count}function Sue(t,n){const e=this.context.dataflow,o=this.context.data[t],f=o.input;return e.pulse(f,e.changeset().remove(mc).insert(n)),1}function Eue(t,n,e){if(t){const o=this.context.dataflow,f=t.mark.source;o.pulse(f,o.changeset().encode(t,n))}return e!==void 0?e:t}const Zy=t=>function(n,e){return this.context.dataflow.locale()[t](e)(n)},Cue=Zy("format"),hj=Zy("timeFormat"),Oue=Zy("utcFormat"),Lue=Zy("timeParse"),Pue=Zy("utcParse"),bb=new Date(2e3,0,1);function Uw(t,n,e){return!Number.isInteger(t)||!Number.isInteger(n)?"":(bb.setYear(2e3),bb.setMonth(t),bb.setDate(n),hj.call(this,bb,e))}function Due(t){return Uw.call(this,t,1,"%B")}function Iue(t){return Uw.call(this,t,1,"%b")}function zue(t){return Uw.call(this,0,2+t,"%A")}function Rue(t){return Uw.call(this,0,2+t,"%a")}const Fue=":",Nue="@",TT="%",dj="$";function VS(t,n,e,o){n[0].type!==S0&&Pr("First argument to data functions must be a string literal.");const f=n[0].value,r=Fue+f;if(!qi(r,o))try{o[r]=e.getData(f).tuplesRef()}catch{}}function Bue(t,n,e,o){n[0].type!==S0&&Pr("First argument to indata must be a string literal."),n[1].type!==S0&&Pr("Second argument to indata must be a string literal.");const f=n[0].value,r=n[1].value,a=Nue+r;qi(a,o)||(o[a]=e.getData(f).indataRef(e,r))}function Su(t,n,e,o){if(n[0].type===S0)dL(e,o,n[0].value);else for(t in e.scales)dL(e,o,t)}function dL(t,n,e){const o=TT+e;if(!qi(n,o))try{n[o]=t.scaleRef(e)}catch{}}function Qh(t,n){let e;return ga(t)?t:bi(t)?(e=n.scales[t])&&e.value:void 0}function jue(t,n,e){n.__bandwidth=f=>f&&f.bandwidth?f.bandwidth():0,e._bandwidth=Su,e._range=Su,e._scale=Su;const o=f=>"_["+(f.type===S0?oi(TT+f.value):oi(TT)+"+"+t(f))+"]";return{_bandwidth:f=>"this.__bandwidth(".concat(o(f[0]),")"),_range:f=>"".concat(o(f[0]),".range()"),_scale:f=>"".concat(o(f[0]),"(").concat(t(f[1]),")")}}function qS(t,n){return function(e,o,f){if(e){const r=Qh(e,(f||this).context);return r&&r.path[t](o)}else return n(o)}}const Uue=qS("area",hre),Vue=qS("bounds",mre),que=qS("centroid",wre);function Hue(t){const n=this.context.group;let e=!1;if(n)for(;t;){if(t===n){e=!0;break}t=t.mark.group}return e}function HS(t,n,e){try{t[n].apply(t,["EXPRESSION"].concat([].slice.call(e)))}catch(o){t.warn(o)}return e[e.length-1]}function $ue(){return HS(this.context.dataflow,"warn",arguments)}function Gue(){return HS(this.context.dataflow,"info",arguments)}function Wue(){return HS(this.context.dataflow,"debug",arguments)}function w4(t){const n=t/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}function AT(t){const n=c_(t),e=w4(n.r),o=w4(n.g),f=w4(n.b);return .2126*e+.7152*o+.0722*f}function Yue(t,n){const e=AT(t),o=AT(n),f=Math.max(e,o),r=Math.min(e,o);return(f+.05)/(r+.05)}function Xue(){const t=[].slice.call(arguments);return t.unshift({}),pa(...t)}function pj(t,n){return t===n||t!==t&&n!==n?!0:Ir(t)?Ir(n)&&t.length===n.length?Zue(t,n):!1:Ei(t)&&Ei(n)?gj(t,n):!1}function Zue(t,n){for(let e=0,o=t.length;egj(t,n)}function Jue(t,n,e,o,f,r){const a=this.context.dataflow,u=this.context.data[t],c=u.input,i=a.stamp();let s=u.changes,l,d;if(a._trigger===!1||!(c.value.length||n||o))return 0;if((!s||s.stamp{u.modified=!0,a.pulse(c,s).run()},!0,1)),e&&(l=e===!0?mc:Ir(e)||tw(e)?e:pL(e),s.remove(l)),n&&s.insert(n),o&&(l=pL(o),c.value.some(l)?s.remove(l):s.insert(o)),f)for(d in r)s.modify(f,d,r[d]);return 1}function Kue(t){const n=t.touches,e=n[0].clientX-n[1].clientX,o=n[0].clientY-n[1].clientY;return Math.sqrt(e*e+o*o)}function Que(t){const n=t.touches;return Math.atan2(n[0].clientY-n[1].clientY,n[0].clientX-n[1].clientX)}const gL={};function ece(t,n){const e=gL[n]||(gL[n]=Lu(n));return Ir(t)?t.map(e):e(t)}function $S(t){return Ir(t)||ArrayBuffer.isView(t)?t:null}function GS(t){return $S(t)||(bi(t)?t:null)}function tce(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o1?n-1:0),o=1;o1?n-1:0),o=1;or.stop(i(s),t(s))),r}function gce(t,n,e){const o=Qh(t,(e||this).context);return function(f){return o?o.path.context(f)(n):""}}function mce(t){let n=null;return function(e){return e?Zv(e,n=n||gm(t)):t}}const mj=t=>t.data;function vj(t,n){const e=fj.call(n,t);return e.root&&e.root.lookup||{}}function vce(t,n,e){const o=vj(t,this),f=o[n],r=o[e];return f&&r?f.path(r).map(mj):void 0}function yce(t,n){const e=vj(t,this)[n];return e?e.ancestors().map(mj):void 0}const yj=()=>typeof window<"u"&&window||null;function xce(){const t=yj();return t?t.screen:{}}function bce(){const t=yj();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]}function _ce(){const t=this.context.dataflow,n=t.container&&t.container();return n?[n.clientWidth,n.clientHeight]:[void 0,void 0]}function xj(t,n,e){if(!t)return[];const[o,f]=t,r=new zs().set(o[0],o[1],f[0],f[1]),a=e||this.context.dataflow.scenegraph().root;return aN(a,r,wce(n))}function wce(t){let n=null;if(t){const e=ki(t.marktype),o=ki(t.markname);n=f=>(!e.length||e.some(r=>f.marktype===r))&&(!o.length||o.some(r=>f.name===r))}return n}function kce(t,n,e){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;const f=t[t.length-1];return f===void 0||Math.sqrt((f[0]-n)**2+(f[1]-e)**2)>o?(t.push([n,e]),[...t]):t}function Tce(t){return(t??[]).reduce((n,e,o)=>{let[f,r]=e;return n+=o==0?"M ".concat(f,",").concat(r," "):o===t.length-1?" Z":"L ".concat(f,",").concat(r," ")},"")}function Ace(t,n,e){const{x:o,y:f,mark:r}=e,a=new zs().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[c,i]of n)ca.x2&&(a.x2=c),ia.y2&&(a.y2=i);return a.translate(o,f),xj([[a.x1,a.y1],[a.x2,a.y2]],t,r).filter(c=>Mce(c.x,c.y,n))}function Mce(t,n,e){let o=0;for(let f=0,r=e.length-1;fn!=u>n&&t<(a-c)*(n-i)/(u-i)+c&&o++}return o&1}const sy={random(){return yc()},cumulativeNormal:ow,cumulativeLogNormal:o6,cumulativeUniform:c6,densityNormal:t6,densityLogNormal:a6,densityUniform:u6,quantileNormal:sw,quantileLogNormal:s6,quantileUniform:f6,sampleNormal:aw,sampleLogNormal:i6,sampleUniform:l6,isArray:Ir,isBoolean:fp,isDate:Nd,isDefined(t){return t!==void 0},isNumber:wo,isObject:Ei,isRegExp:fI,isString:bi,isTuple:tw,isValid(t){return t!=null&&t===t},toBoolean:LA,toDate(t){return PA(t)},toNumber:Rl,toString:DA,indexof:nce,join:tce,lastindexof:rce,replace:ace,reverse:oce,slice:ice,flush:uI,lerp:hI,merge:Xue,pad:gI,peek:Na,pluck:ece,span:Ay,inrange:Wg,truncate:mI,rgb:c_,lab:A_,hcl:M_,hsl:Q4,luminance:AT,contrast:Yue,sequence:Ju,format:Cue,utcFormat:Oue,utcParse:Pue,utcOffset:VI,utcSequence:$I,timeFormat:hj,timeParse:Lue,timeOffset:UI,timeSequence:HI,timeUnitSpecifier:OI,monthFormat:Due,monthAbbrevFormat:Iue,dayFormat:zue,dayAbbrevFormat:Rue,quarter:aI,utcquarter:oI,week:PI,utcweek:zI,dayofyear:LI,utcdayofyear:II,warn:$ue,info:Gue,debug:Wue,extent(t){return Zf(t)},inScope:Hue,intersect:xj,clampRange:sI,pinchDistance:Kue,pinchAngle:Que,screen:xce,containerSize:_ce,windowSize:bce,bandspace:sce,setdata:Sue,pathShape:mce,panLinear:tI,panLog:nI,panPow:rI,panSymlog:iI,zoomLinear:AA,zoomLog:MA,zoomPow:p_,zoomSymlog:SA,encode:Eue,modify:Jue,lassoAppend:kce,lassoPath:Tce,intersectLasso:Ace},Sce=["view","item","group","xy","x","y"],Ece="event.vega.",bj="this.",WS={},_j={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat(oi(dj+t),"]"),functions:Cce,constants:sj,visitors:WS},MT=uj(_j);function Cce(t){const n=lj(t);Sce.forEach(e=>n[e]=Ece+e);for(const e in sy)n[e]=bj+e;return pa(n,jue(t,sy,WS)),n}function Fs(t,n,e){return arguments.length===1?sy[t]:(sy[t]=n,e&&(WS[t]=e),MT&&(MT.functions[t]=bj+t),this)}Fs("bandwidth",lce,Su);Fs("copy",uce,Su);Fs("domain",cce,Su);Fs("range",hce,Su);Fs("invert",fce,Su);Fs("scale",dce,Su);Fs("gradient",pce,Su);Fs("geoArea",Uue,Su);Fs("geoBounds",Vue,Su);Fs("geoCentroid",que,Su);Fs("geoShape",gce,Su);Fs("indata",Mue,Bue);Fs("data",fj,VS);Fs("treePath",vce,VS);Fs("treeAncestors",yce,VS);Fs("vlSelectionTest",yue,US);Fs("vlSelectionIdTest",_ue,US);Fs("vlSelectionResolve",kue,US);Fs("vlSelectionTuples",wue);function Qf(t,n){const e={};let o;try{t=bi(t)?t:oi(t)+"",o=BS(t)}catch{Pr("Expression parse error: "+t)}o.visit(r=>{if(r.type!==ej)return;const a=r.callee.name,u=_j.visitors[a];u&&u(a,r.arguments,n,e)});const f=MT(o);return f.globals.forEach(r=>{const a=dj+r;!qi(e,a)&&n.getSignal(r)&&(e[a]=n.signalRef(r))}),{$expr:pa({code:f.code},n.options.ast?{ast:o}:null),$fields:f.fields,$params:e}}function Oce(t){const n=this,e=t.operators||[];return t.background&&(n.background=t.background),t.eventConfig&&(n.eventConfig=t.eventConfig),t.locale&&(n.locale=t.locale),e.forEach(o=>n.parseOperator(o)),e.forEach(o=>n.parseOperatorParameters(o)),(t.streams||[]).forEach(o=>n.parseStream(o)),(t.updates||[]).forEach(o=>n.parseUpdate(o)),n.resolve()}const Lce=ff(["rule"]),mL=ff(["group","image","rect"]);function Pce(t,n){let e="";return Lce[n]||(t.x2&&(t.x?(mL[n]&&(e+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),e+="o.width=o.x2-o.x;"):e+="o.x=o.x2-(o.width||0);"),t.xc&&(e+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(mL[n]&&(e+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),e+="o.height=o.y2-o.y;"):e+="o.y=o.y2-(o.height||0);"),t.yc&&(e+="o.y=o.yc-(o.height||0)/2;")),e}function YS(t){return(t+"").toLowerCase()}function Dce(t){return YS(t)==="operator"}function Ice(t){return YS(t)==="collect"}function G1(t,n,e){e[e.length-1]!==";"&&(e="return("+e+");");const o=Function(...n.concat(e));return t&&t.functions?o.bind(t.functions):o}function zce(t,n,e,o){return"((u = ".concat(t,") < (v = ").concat(n,") || u == null) && v != null ? ").concat(e,` + : (u > v || v == null) && u != null ? `).concat(o,` + : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? `).concat(e,` + : v !== v && u === u ? `).concat(o," : ")}var Rce={operator:(t,n)=>G1(t,["_"],n.code),parameter:(t,n)=>G1(t,["datum","_"],n.code),event:(t,n)=>G1(t,["event"],n.code),handler:(t,n)=>{const e="var datum=event.item&&event.item.datum;return ".concat(n.code,";");return G1(t,["_","event"],e)},encode:(t,n)=>{const{marktype:e,channels:o}=n;let f="var o=item,datum=o.datum,m=0,$;";for(const r in o){const a="o["+oi(r)+"]";f+="$=".concat(o[r].code,";if(").concat(a,"!==$)").concat(a,"=$,m=1;")}return f+=Pce(o,e),f+="return m;",G1(t,["item","_"],f)},codegen:{get(t){const n="[".concat(t.map(oi).join("]["),"]"),e=Function("_","return _".concat(n,";"));return e.path=n,e},comparator(t,n){let e;const o=(r,a)=>{const u=n[a];let c,i;return r.path?(c="a".concat(r.path),i="b".concat(r.path)):((e=e||{})["f"+a]=r,c="this.f".concat(a,"(a)"),i="this.f".concat(a,"(b)")),zce(c,i,-u,u)},f=Function("a","b","var u, v; return "+t.map(o).join("")+"0;");return e?f.bind(e):f}}};function Fce(t){const n=this;Dce(t.type)||!t.type?n.operator(t,t.update?n.operatorExpression(t.update):null):n.transform(t,t.type)}function Nce(t){const n=this;if(t.params){const e=n.get(t.id);e||Pr("Invalid operator id: "+t.id),n.dataflow.connect(e,e.parameters(n.parseParameters(t.params),t.react,t.initonly))}}function Bce(t,n){n=n||{};const e=this;for(const o in t){const f=t[o];n[o]=Ir(f)?f.map(r=>vL(r,e,n)):vL(f,e,n)}return n}function vL(t,n,e){if(!t||!Ei(t))return t;for(let o=0,f=yL.length,r;of&&f.$tupleid?$i:f);return n.fn[e]||(n.fn[e]=EA(o,t.$order,n.expr.codegen))}function $ce(t,n){const e=t.$encode,o={};for(const f in e){const r=e[f];o[f]=Nu(n.encodeExpression(r.$expr),r.$fields),o[f].output=r.$output}return o}function Gce(t,n){return n}function Wce(t,n){const e=t.$subflow;return function(o,f,r){const a=n.fork().parse(e),u=a.get(e.operators[0].id),c=a.signals.parent;return c&&c.set(r),u.detachSubflow=()=>n.detach(a),u}}function Yce(){return $i}function Xce(t){var n=this,e=t.filter!=null?n.eventExpression(t.filter):void 0,o=t.stream!=null?n.get(t.stream):void 0,f;t.source?o=n.events(t.source,t.type,e):t.merge&&(f=t.merge.map(r=>n.get(r)),o=f[0].merge.apply(f[0],f.slice(1))),t.between&&(f=t.between.map(r=>n.get(r)),o=o.between(f[0],f[1])),t.filter&&(o=o.filter(e)),t.throttle!=null&&(o=o.throttle(+t.throttle)),t.debounce!=null&&(o=o.debounce(+t.debounce)),o==null&&Pr("Invalid stream definition: "+JSON.stringify(t)),t.consume&&o.consume(!0),n.stream(t,o)}function Zce(t){var n=this,e=Ei(e=t.source)?e.$ref:e,o=n.get(e),f=null,r=t.update,a=void 0;o||Pr("Source not defined: "+t.source),f=t.target&&t.target.$expr?n.eventExpression(t.target.$expr):n.get(t.target),r&&r.$expr&&(r.$params&&(a=n.parseParameters(r.$params)),r=n.handlerExpression(r.$expr)),n.update(t,o,f,r,a)}const Jce={skip:!0};function Kce(t){var n=this,e={};if(t.signals){var o=e.signals={};Object.keys(n.signals).forEach(r=>{const a=n.signals[r];t.signals(r,a)&&(o[r]=a.value)})}if(t.data){var f=e.data={};Object.keys(n.data).forEach(r=>{const a=n.data[r];t.data(r,a)&&(f[r]=a.input.value)})}return n.subcontext&&t.recurse!==!1&&(e.subcontext=n.subcontext.map(r=>r.getState(t))),e}function Qce(t){var n=this,e=n.dataflow,o=t.data,f=t.signals;Object.keys(f||{}).forEach(r=>{e.update(n.signals[r],f[r],Jce)}),Object.keys(o||{}).forEach(r=>{e.pulse(n.data[r].input,e.changeset().remove(mc).insert(o[r]))}),(t.subcontext||[]).forEach((r,a)=>{const u=n.subcontext[a];u&&u.setState(r)})}function wj(t,n,e,o){return new kj(t,n,e,o)}function kj(t,n,e,o){this.dataflow=t,this.transforms=n,this.events=t.events.bind(t),this.expr=o||Rce,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},e&&(this.functions=Object.create(e),this.functions.context=this)}function xL(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}kj.prototype=xL.prototype={fork(){const t=new xL(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter(e=>e!==t);const n=Object.keys(t.nodes);for(const e of n)t.nodes[e]._targets=null;for(const e of n)t.nodes[e].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,n){return this.nodes[t]=n},add(t,n){const e=this,o=e.dataflow,f=t.value;if(e.set(t.id,n),Ice(t.type)&&f&&(f.$ingest?o.ingest(n,f.$ingest,f.$format):f.$request?o.preload(n,f.$request,f.$format):o.pulse(n,o.changeset().insert(f))),t.root&&(e.root=n),t.parent){let r=e.get(t.parent.$ref);r?(o.connect(r,[n]),n.targets().add(r)):(e.unresolved=e.unresolved||[]).push(()=>{r=e.get(t.parent.$ref),o.connect(r,[n]),n.targets().add(r)})}if(t.signal&&(e.signals[t.signal]=n),t.scale&&(e.scales[t.scale]=n),t.data)for(const r in t.data){const a=e.data[r]||(e.data[r]={});t.data[r].forEach(u=>a[u]=n)}},resolve(){return(this.unresolved||[]).forEach(t=>t()),delete this.unresolved,this},operator(t,n){this.add(t,this.dataflow.add(t.value,n))},transform(t,n){this.add(t,this.dataflow.add(this.transforms[YS(n)]))},stream(t,n){this.set(t.id,n)},update(t,n,e,o,f){this.dataflow.on(n,e,o,f,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:Oce,parseOperator:Fce,parseOperatorParameters:Nce,parseParameters:Bce,parseStream:Xce,parseUpdate:Zce,getState:Kce,setState:Qce};function efe(t){const n=t.container();n&&(n.setAttribute("role","graphics-document"),n.setAttribute("aria-roleDescription","visualization"),Tj(n,t.description()))}function Tj(t,n){t&&(n==null?t.removeAttribute("aria-label"):t.setAttribute("aria-label",n))}function tfe(t){t.add(null,n=>(t._background=n.bg,t._resize=1,n.bg),{bg:t._signals.background})}const k4="default";function nfe(t){const n=t._signals.cursor||(t._signals.cursor=t.add({user:k4,item:null}));t.on(t.events("view","mousemove"),n,(e,o)=>{const f=n.value,r=f?bi(f)?f:f.user:k4,a=o.item&&o.item.cursor||null;return f&&r===f.user&&a==f.item?f:{user:r,item:a}}),t.add(null,function(e){let o=e.cursor,f=this.value;return bi(o)||(f=o.item,o=o.user),ST(t,o&&o!==k4?o:f||o),f},{cursor:n})}function ST(t,n){const e=t.globalCursor()?typeof document<"u"&&document.body:t.container();if(e)return n==null?e.style.removeProperty("cursor"):e.style.cursor=n}function y2(t,n){var e=t._runtime.data;return qi(e,n)||Pr("Unrecognized data set: "+n),e[n]}function rfe(t,n){return arguments.length<2?y2(this,t).values.value:Vw.call(this,t,$0().remove(mc).insert(n))}function Vw(t,n){yz(n)||Pr("Second argument to changes must be a changeset.");const e=y2(this,t);return e.modified=!0,this.pulse(e.input,n)}function ife(t,n){return Vw.call(this,t,$0().insert(n))}function afe(t,n){return Vw.call(this,t,$0().remove(n))}function Aj(t){var n=t.padding();return Math.max(0,t._viewWidth+n.left+n.right)}function Mj(t){var n=t.padding();return Math.max(0,t._viewHeight+n.top+n.bottom)}function qw(t){var n=t.padding(),e=t._origin;return[n.left+e[0],n.top+e[1]]}function ofe(t){var n=qw(t),e=Aj(t),o=Mj(t);t._renderer.background(t.background()),t._renderer.resize(e,o,n),t._handler.origin(n),t._resizeListeners.forEach(f=>{try{f(e,o)}catch(r){t.error(r)}})}function sfe(t,n,e){var o=t._renderer,f=o&&o.canvas(),r,a,u;return f&&(u=qw(t),a=n.changedTouches?n.changedTouches[0]:n,r=Cw(a,f),r[0]-=u[0],r[1]-=u[1]),n.dataflow=t,n.item=e,n.vega=lfe(t,e,r),n}function lfe(t,n,e){const o=n?n.mark.marktype==="group"?n:n.mark.group:null;function f(a){var u=o,c;if(a){for(c=n;c;c=c.mark.group)if(c.mark.name===a){u=c;break}}return u&&u.mark&&u.mark.interactive?u:{}}function r(a){if(!a)return e;bi(a)&&(a=f(a));const u=e.slice();for(;a;)u[0]-=a.x||0,u[1]-=a.y||0,a=a.mark&&a.mark.group;return u}return{view:$l(t),item:$l(n||{}),group:f,xy:r,x:a=>r(a)[0],y:a=>r(a)[1]}}const bL="view",ufe="timer",cfe="window",ffe={trap:!1};function hfe(t){const n=pa({defaults:{}},t),e=(o,f)=>{f.forEach(r=>{Ir(o[r])&&(o[r]=ff(o[r]))})};return e(n.defaults,["prevent","allow"]),e(n,["view","window","selector"]),n}function Sj(t,n,e,o){t._eventListeners.push({type:e,sources:ki(n),handler:o})}function dfe(t,n){var e=t._eventConfig.defaults,o=e.prevent,f=e.allow;return o===!1||f===!0?!1:o===!0||f===!1?!0:o?o[n]:f?!f[n]:t.preventDefault()}function _b(t,n,e){const o=t._eventConfig&&t._eventConfig[n];return o===!1||Ei(o)&&!o[e]?(t.warn("Blocked ".concat(n," ").concat(e," event listener.")),!1):!0}function pfe(t,n,e){var o=this,f=new iw(e),r=function(i,s){o.runAsync(null,()=>{t===bL&&dfe(o,n)&&i.preventDefault(),f.receive(sfe(o,i,s))})},a;if(t===ufe)_b(o,"timer",n)&&o.timer(r,n);else if(t===bL)_b(o,"view",n)&&o.addEventListener(n,r,ffe);else if(t===cfe?_b(o,"window",n)&&typeof window<"u"&&(a=[window]):typeof document<"u"&&_b(o,"selector",n)&&(a=document.querySelectorAll(t)),!a)o.warn("Can not resolve event source: "+t);else{for(var u=0,c=a.length;u=0;)n[o].stop();for(o=e.length;--o>=0;)for(r=e[o],f=r.sources.length;--f>=0;)r.sources[f].removeEventListener(r.type,r.handler);return t&&t.call(this,this._handler,null,null,null),this}function Ku(t,n,e){const o=document.createElement(t);for(const f in n)o.setAttribute(f,n[f]);return e!=null&&(o.textContent=e),o}const vfe="vega-bind",yfe="vega-bind-name",xfe="vega-bind-radio";function bfe(t,n,e){if(!n)return;const o=e.param;let f=e.state;return f||(f=e.state={elements:null,active:!1,set:null,update:a=>{a!=t.signal(o.signal)&&t.runAsync(null,()=>{f.source=!0,t.signal(o.signal,a)})}},o.debounce&&(f.update=CA(o.debounce,f.update))),(o.input==null&&o.element?_fe:kfe)(f,n,o,t),f.active||(t.on(t._signals[o.signal],null,()=>{f.source?f.source=!1:f.set(t.signal(o.signal))}),f.active=!0),f}function _fe(t,n,e,o){const f=e.event||"input",r=()=>t.update(n.value);o.signal(e.signal,n.value),n.addEventListener(f,r),Sj(o,n,f,r),t.set=a=>{n.value=a,n.dispatchEvent(wfe(f))}}function wfe(t){return typeof Event<"u"?new Event(t):{type:t}}function kfe(t,n,e,o){const f=o.signal(e.signal),r=Ku("div",{class:vfe}),a=e.input==="radio"?r:r.appendChild(Ku("label"));a.appendChild(Ku("span",{class:yfe},e.name||e.signal)),n.appendChild(r);let u=Tfe;switch(e.input){case"checkbox":u=Afe;break;case"select":u=Mfe;break;case"radio":u=Sfe;break;case"range":u=Efe;break}u(t,a,e,f)}function Tfe(t,n,e,o){const f=Ku("input");for(const r in e)r!=="signal"&&r!=="element"&&f.setAttribute(r==="input"?"type":r,e[r]);f.setAttribute("name",e.signal),f.value=o,n.appendChild(f),f.addEventListener("input",()=>t.update(f.value)),t.elements=[f],t.set=r=>f.value=r}function Afe(t,n,e,o){const f={type:"checkbox",name:e.signal};o&&(f.checked=!0);const r=Ku("input",f);n.appendChild(r),r.addEventListener("change",()=>t.update(r.checked)),t.elements=[r],t.set=a=>r.checked=!!a||null}function Mfe(t,n,e,o){const f=Ku("select",{name:e.signal}),r=e.labels||[];e.options.forEach((a,u)=>{const c={value:a};x2(a,o)&&(c.selected=!0),f.appendChild(Ku("option",c,(r[u]||a)+""))}),n.appendChild(f),f.addEventListener("change",()=>{t.update(e.options[f.selectedIndex])}),t.elements=[f],t.set=a=>{for(let u=0,c=e.options.length;u{const c={type:"radio",name:e.signal,value:a};x2(a,o)&&(c.checked=!0);const i=Ku("input",c);i.addEventListener("change",()=>t.update(a));const s=Ku("label",{},(r[u]||a)+"");return s.prepend(i),f.appendChild(s),i}),t.set=a=>{const u=t.elements,c=u.length;for(let i=0;i{c.textContent=u.value,t.update(+u.value)};u.addEventListener("input",i),u.addEventListener("change",i),t.elements=[u],t.set=s=>{u.value=s,c.textContent=s}}function x2(t,n){return t===n||t+""==n+""}function Ej(t,n,e,o,f,r){return n=n||new o(t.loader()),n.initialize(e,Aj(t),Mj(t),qw(t),f,r).background(t.background())}function XS(t,n){return n?function(){try{n.apply(this,arguments)}catch(e){t.error(e)}}:null}function Cfe(t,n,e,o){const f=new o(t.loader(),XS(t,t.tooltip())).scene(t.scenegraph().root).initialize(e,qw(t),t);return n&&n.handlers().forEach(r=>{f.on(r.type,r.handler)}),f}function Ofe(t,n){const e=this,o=e._renderType,f=e._eventConfig.bind,r=Ow(o);t=e._el=t?T4(e,t,!0):null,efe(e),r||e.error("Unrecognized renderer type: "+o);const a=r.handler||Vy,u=t?r.renderer:r.headless;return e._renderer=u?Ej(e,e._renderer,t,u):null,e._handler=Cfe(e,e._handler,t,a),e._redraw=!0,t&&f!=="none"&&(n=n?e._elBind=T4(e,n,!0):t.appendChild(Ku("form",{class:"vega-bindings"})),e._bind.forEach(c=>{c.param.element&&f!=="container"&&(c.element=T4(e,c.param.element,!!c.param.input))}),e._bind.forEach(c=>{bfe(e,c.element||n,c)})),e}function T4(t,n,e){if(typeof n=="string")if(typeof document<"u"){if(n=document.querySelector(n),!n)return t.error("Signal bind element not found: "+n),null}else return t.error("DOM document instance not found."),null;if(n&&e)try{n.textContent=""}catch(o){n=null,t.error(o)}return n}const W1=t=>+t||0,Lfe=t=>({top:t,bottom:t,left:t,right:t});function TL(t){return Ei(t)?{top:W1(t.top),bottom:W1(t.bottom),left:W1(t.left),right:W1(t.right)}:Lfe(W1(t))}async function ZS(t,n,e,o){const f=Ow(n),r=f&&f.headless;return r||Pr("Unrecognized renderer type: "+n),await t.runAsync(),Ej(t,null,null,r,e,o).renderAsync(t._scenegraph.root)}async function Pfe(t,n){t!==Dd.Canvas&&t!==Dd.SVG&&t!==Dd.PNG&&Pr("Unrecognized image type: "+t);const e=await ZS(this,t,n);return t===Dd.SVG?Dfe(e.svg(),"image/svg+xml"):e.canvas().toDataURL("image/png")}function Dfe(t,n){const e=new Blob([t],{type:n});return window.URL.createObjectURL(e)}async function Ife(t,n){return(await ZS(this,Dd.Canvas,t,n)).canvas()}async function zfe(t){return(await ZS(this,Dd.SVG,t)).svg()}function Rfe(t,n,e){return wj(t,cm,sy,e).parse(n)}function Ffe(t){var n=this._runtime.scales;return qi(n,t)||Pr("Unrecognized scale or projection: "+t),n[t].value}var Cj="width",Oj="height",JS="padding",AL={skip:!0};function Lj(t,n){var e=t.autosize(),o=t.padding();return n-(e&&e.contains===JS?o.left+o.right:0)}function Pj(t,n){var e=t.autosize(),o=t.padding();return n-(e&&e.contains===JS?o.top+o.bottom:0)}function Nfe(t){var n=t._signals,e=n[Cj],o=n[Oj],f=n[JS];function r(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,u=>{t._width=u.size,t._viewWidth=Lj(t,u.size),r()},{size:e}),t._resizeHeight=t.add(null,u=>{t._height=u.size,t._viewHeight=Pj(t,u.size),r()},{size:o});const a=t.add(null,r,{pad:f});t._resizeWidth.rank=e.rank+1,t._resizeHeight.rank=o.rank+1,a.rank=f.rank+1}function Bfe(t,n,e,o,f,r){this.runAfter(a=>{let u=0;a._autosize=0,a.width()!==e&&(u=1,a.signal(Cj,e,AL),a._resizeWidth.skip(!0)),a.height()!==o&&(u=1,a.signal(Oj,o,AL),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==n&&(a._resize=1,a._viewHeight=n),(a._origin[0]!==f[0]||a._origin[1]!==f[1])&&(a._resize=1,a._origin=f),u&&a.run("enter"),r&&a.runAfter(c=>c.resize())},!1,1)}function jfe(t){return this._runtime.getState(t||{data:Ufe,signals:Vfe,recurse:!0})}function Ufe(t,n){return n.modified&&Ir(n.input.value)&&t.indexOf("_:vega:_")}function Vfe(t,n){return!(t==="parent"||n instanceof cm.proxy)}function qfe(t){return this.runAsync(null,n=>{n._trigger=!1,n._runtime.setState(t)},n=>{n._trigger=!0}),this}function Hfe(t,n){function e(o){t({timestamp:Date.now(),elapsed:o})}this._timers.push(kae(e,n))}function $fe(t,n,e,o){const f=t.element();f&&f.setAttribute("title",Gfe(o))}function Gfe(t){return t==null?"":Ir(t)?Dj(t):Ei(t)&&!Nd(t)?Wfe(t):t+""}function Wfe(t){return Object.keys(t).map(n=>{const e=t[n];return n+": "+(Ir(e)?Dj(e):Ij(e))}).join(` +`)}function Dj(t){return"["+t.map(Ij).join(", ")+"]"}function Ij(t){return Ir(t)?"[\u2026]":Ei(t)&&!Nd(t)?"{\u2026}":t}function zj(t,n){const e=this;if(n=n||{},Qg.call(e),n.loader&&e.loader(n.loader),n.logger&&e.logger(n.logger),n.logLevel!=null&&e.logLevel(n.logLevel),n.locale||t.locale){const r=pa({},t.locale,n.locale);e.locale(lz(r.number,r.time))}e._el=null,e._elBind=null,e._renderType=n.renderer||Dd.Canvas,e._scenegraph=new LM;const o=e._scenegraph.root;e._renderer=null,e._tooltip=n.tooltip||$fe,e._redraw=!0,e._handler=new Vy().scene(o),e._globalCursor=!1,e._preventDefault=!1,e._timers=[],e._eventListeners=[],e._resizeListeners=[],e._eventConfig=hfe(t.eventConfig),e.globalCursor(e._eventConfig.globalCursor);const f=Rfe(e,t,n.expr);e._runtime=f,e._signals=f.signals,e._bind=(t.bindings||[]).map(r=>({state:null,param:pa({},r)})),f.root&&f.root.set(o),o.source=f.data.root.input,e.pulse(f.data.root.input,e.changeset().insert(o.items)),e._width=e.width(),e._height=e.height(),e._viewWidth=Lj(e,e._width),e._viewHeight=Pj(e,e._height),e._origin=[0,0],e._resize=0,e._autosize=1,Nfe(e),tfe(e),nfe(e),e.description(t.description),n.hover&&e.hover(),n.container&&e.initialize(n.container,n.bind)}function wb(t,n){return qi(t._signals,n)?t._signals[n]:Pr("Unrecognized signal name: "+oi(n))}function Rj(t,n){const e=(t._targets||[]).filter(o=>o._update&&o._update.handler===n);return e.length?e[0]:null}function ML(t,n,e,o){let f=Rj(e,o);return f||(f=XS(t,()=>o(n,e.value)),f.handler=o,t.on(e,null,f)),t}function SL(t,n,e){const o=Rj(n,e);return o&&n._targets.remove(o),t}ni(zj,Qg,{async evaluate(t,n,e){if(await Qg.prototype.evaluate.call(this,t,n),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,ofe(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(o){this.error(o)}return e&&jb(this,e),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const n=t!=null?t+"":null;return n!==this._desc&&Tj(this._el,this._desc=n),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,n,e){const o=wb(this,t);return arguments.length===1?o.value:this.update(o,n,e)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",TL(t)):TL(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(Ow(t)||Pr("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(Qg.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(wb(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Bfe,addEventListener(t,n,e){let o=n;return e&&e.trap===!1||(o=XS(this,n),o.raw=n),this._handler.on(t,o),this},removeEventListener(t,n){for(var e=this._handler.handlers(t),o=e.length,f,r;--o>=0;)if(r=e[o].type,f=e[o].handler,t===r&&(n===f||n===f.raw)){this._handler.off(r,f);break}return this},addResizeListener(t){const n=this._resizeListeners;return n.indexOf(t)<0&&n.push(t),this},removeResizeListener(t){var n=this._resizeListeners,e=n.indexOf(t);return e>=0&&n.splice(e,1),this},addSignalListener(t,n){return ML(this,t,wb(this,t),n)},removeSignalListener(t,n){return SL(this,wb(this,t),n)},addDataListener(t,n){return ML(this,t,y2(this,t).values,n)},removeDataListener(t,n){return SL(this,y2(this,t).values,n)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const n=ST(this,null);this._globalCursor=!!t,n&&ST(this,n)}return this}else return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:Hfe,events:pfe,finalize:mfe,hover:gfe,data:rfe,change:Vw,insert:ife,remove:afe,scale:Ffe,initialize:Ofe,toImageURL:Pfe,toCanvas:Ife,toSVG:zfe,getState:jfe,setState:qfe});const Yfe="view",b2="[",_2="]",Fj="{",Nj="}",Xfe=":",Bj=",",Zfe="@",Jfe=">",Kfe=/[[\]{}]/,Qfe={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let jj,Uj;function pp(t,n,e){return jj=n||Yfe,Uj=e||Qfe,Vj(t.trim()).map(ET)}function ehe(t){return Uj[t]}function Fv(t,n,e,o,f){const r=t.length;let a=0,u;for(;n=0?--a:o&&o.indexOf(u)>=0&&++a}return n}function Vj(t){const n=[],e=t.length;let o=0,f=0;for(;f' after between selector: "+t;o=o.map(ET);const f=ET(t.slice(1).trim());return f.between?{between:o,stream:f}:(f.between=o,f)}function nhe(t){const n={source:jj},e=[];let o=[0,0],f=0,r=0,a=t.length,u=0,c,i;if(t[a-1]===Nj){if(u=t.lastIndexOf(Fj),u>=0){try{o=rhe(t.substring(u+1,a-1))}catch{throw"Invalid throttle specification: "+t}t=t.slice(0,u).trim(),a=t.length}else throw"Unmatched right brace: "+t;u=0}if(!a)throw t;if(t[0]===Zfe&&(f=++u),c=Fv(t,u,Xfe),c1?(n.type=e[1],f?n.markname=e[0].slice(1):ehe(e[0])?n.marktype=e[0]:n.source=e[0]):n.type=e[0],n.type.slice(-1)==="!"&&(n.consume=!0,n.type=n.type.slice(0,-1)),i!=null&&(n.filter=i),o[0]&&(n.throttle=o[0]),o[1]&&(n.debounce=o[1]),n}function rhe(t){const n=t.split(Bj);if(!t.length||n.length>2)throw t;return n.map(e=>{const o=+e;if(o!==o)throw t;return o})}function ihe(t){return Ei(t)?t:{type:t||"pad"}}const Y1=t=>+t||0,ahe=t=>({top:t,bottom:t,left:t,right:t});function ohe(t){return Ei(t)?t.signal?t:{top:Y1(t.top),bottom:Y1(t.bottom),left:Y1(t.left),right:Y1(t.right)}:ahe(Y1(t))}const il=t=>Ei(t)&&!Ir(t)?pa({},t):{value:t};function EL(t,n,e,o){return e!=null?(Ei(e)&&!Ir(e)||Ir(e)&&e.length&&Ei(e[0])?t.update[n]=e:t[o||"enter"][n]={value:e},1):0}function kl(t,n,e){for(const o in n)EL(t,o,n[o]);for(const o in e)EL(t,o,e[o],"update")}function Jm(t,n,e){for(const o in n)e&&qi(e,o)||(t[o]=pa(t[o]||{},n[o]));return t}function $g(t,n){return n&&(n.enter&&n.enter[t]||n.update&&n.update[t])}const KS="mark",QS="frame",eE="scope",she="axis",lhe="axis-domain",uhe="axis-grid",che="axis-label",fhe="axis-tick",hhe="axis-title",dhe="legend",phe="legend-band",ghe="legend-entry",mhe="legend-gradient",qj="legend-label",vhe="legend-symbol",yhe="legend-title",xhe="title",bhe="title-text",_he="title-subtitle";function whe(t,n,e,o,f){const r={},a={};let u,c,i,s;c="lineBreak",n==="text"&&f[c]!=null&&!$g(c,t)&&A4(r,c,f[c]),(e=="legend"||String(e).startsWith("axis"))&&(e=null),s=e===QS?f.group:e===KS?pa({},f.mark,f[n]):null;for(c in s)i=$g(c,t)||(c==="fill"||c==="stroke")&&($g("fill",t)||$g("stroke",t)),i||A4(r,c,s[c]);ki(o).forEach(l=>{const d=f.style&&f.style[l];for(const h in d)$g(h,t)||A4(r,h,d[h])}),t=pa({},t);for(c in r)s=r[c],s.signal?(u=u||{})[c]=s:a[c]=s;return t.enter=pa(a,t.enter),u&&(t.update=pa(u,t.update)),t}function A4(t,n,e){t[n]=e&&e.signal?{signal:e.signal}:{value:e}}const Hj=t=>bi(t)?oi(t):t.signal?`(${t.signal})`:$j(t);function Hw(t){if(t.gradient!=null)return The(t);let n=t.signal?`(${t.signal})`:t.color?khe(t.color):t.field!=null?$j(t.field):t.value!==void 0?oi(t.value):void 0;return t.scale!=null&&(n=Ahe(t,n)),n===void 0&&(n=null),t.exponent!=null&&(n=`pow(${n},${r_(t.exponent)})`),t.mult!=null&&(n+=`*${r_(t.mult)}`),t.offset!=null&&(n+=`+${r_(t.offset)}`),t.round&&(n=`round(${n})`),n}const kb=(t,n,e,o)=>`(${t}(${[n,e,o].map(Hw).join(",")})+'')`;function khe(t){return t.c?kb("hcl",t.h,t.c,t.l):t.h||t.s?kb("hsl",t.h,t.s,t.l):t.l||t.a?kb("lab",t.l,t.a,t.b):t.r||t.g||t.b?kb("rgb",t.r,t.g,t.b):null}function The(t){const n=[t.start,t.stop,t.count].map(e=>e==null?null:oi(e));for(;n.length&&Na(n)==null;)n.pop();return n.unshift(Hj(t.gradient)),`gradient(${n.join(",")})`}function r_(t){return Ei(t)?"("+Hw(t)+")":t}function $j(t){return Gj(Ei(t)?t:{datum:t})}function Gj(t){let n,e,o;if(t.signal)n="datum",o=t.signal;else if(t.group||t.parent){for(e=Math.max(1,t.level||1),n="item";e-- >0;)n+=".mark.group";t.parent?(o=t.parent,n+=".datum"):o=t.group}else t.datum?(n="datum",o=t.datum):Pr("Invalid field reference: "+oi(t));return t.signal||(o=bi(o)?ih(o).map(oi).join("]["):Gj(o)),n+"["+o+"]"}function Ahe(t,n){const e=Hj(t.scale);return t.range!=null?n=`lerp(_range(${e}), ${+t.range})`:(n!==void 0&&(n=`_scale(${e}, ${n})`),t.band&&(n=(n?n+"+":"")+`_bandwidth(${e})`+(+t.band==1?"":"*"+r_(t.band)),t.extra&&(n=`(datum.extra ? _scale(${e}, datum.extra.value) : ${n})`)),n==null&&(n="0")),n}function Mhe(t){let n="";return t.forEach(e=>{const o=Hw(e);n+=e.test?`(${e.test})?${o}:`:o}),Na(n)===":"&&(n+="null"),n}function Wj(t,n,e,o,f,r){const a={};r=r||{},r.encoders={$encode:a},t=whe(t,n,e,o,f.config);for(const u in t)a[u]=She(t[u],n,r,f);return r}function She(t,n,e,o){const f={},r={};for(const a in t)t[a]!=null&&(f[a]=Che(Ehe(t[a]),o,e,r));return{$expr:{marktype:n,channels:f},$fields:Object.keys(r),$output:Object.keys(t)}}function Ehe(t){return Ir(t)?Mhe(t):Hw(t)}function Che(t,n,e,o){const f=Qf(t,n);return f.$fields.forEach(r=>o[r]=1),pa(e,f.$params),f.$expr}const Ohe="outer",Lhe=["value","update","init","react","bind"];function CL(t,n){Pr(t+' for "outer" push: '+oi(n))}function Yj(t,n){const e=t.name;if(t.push===Ohe)n.signals[e]||CL("No prior signal definition",e),Lhe.forEach(o=>{t[o]!==void 0&&CL("Invalid property ",o)});else{const o=n.addSignal(e,t.value);t.react===!1&&(o.react=!1),t.bind&&n.addBinding(e,t.bind)}}function CT(t,n,e,o){this.id=-1,this.type=t,this.value=n,this.params=e,o&&(this.parent=o)}function $w(t,n,e,o){return new CT(t,n,e,o)}function w2(t,n){return $w("operator",t,n)}function Hi(t){const n={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(n),n}function ly(t,n){return n?{$field:t,$name:n}:{$field:t}}const OT=ly("key");function OL(t,n){return{$compare:t,$order:n}}function Phe(t,n){const e={$key:t};return n&&(e.$flat=!0),e}const Dhe="ascending",Ihe="descending";function zhe(t){return Ei(t)?(t.order===Ihe?"-":"+")+Gw(t.op,t.field):""}function Gw(t,n){return(t&&t.signal?"$"+t.signal:t||"")+(t&&n?"_":"")+(n&&n.signal?"$"+n.signal:n||"")}const tE="scope",LT="view";function Ys(t){return t&&t.signal}function Rhe(t){return t&&t.expr}function i_(t){if(Ys(t))return!0;if(Ei(t)){for(const n in t)if(i_(t[n]))return!0}return!1}function Wc(t,n){return t??n}function m0(t){return t&&t.signal||t}const LL="timer";function uy(t,n){return(t.merge?Nhe:t.stream?Bhe:t.type?jhe:Pr("Invalid stream specification: "+oi(t)))(t,n)}function Fhe(t){return t===tE?LT:t||LT}function Nhe(t,n){const e=t.merge.map(f=>uy(f,n)),o=nE({merge:e},t,n);return n.addStream(o).id}function Bhe(t,n){const e=uy(t.stream,n),o=nE({stream:e},t,n);return n.addStream(o).id}function jhe(t,n){let e;t.type===LL?(e=n.event(LL,t.throttle),t={between:t.between,filter:t.filter}):e=n.event(Fhe(t.source),t.type);const o=nE({stream:e},t,n);return Object.keys(o).length===1?e:n.addStream(o).id}function nE(t,n,e){let o=n.between;return o&&(o.length!==2&&Pr('Stream "between" parameter must have 2 entries: '+oi(n)),t.between=[uy(o[0],e),uy(o[1],e)]),o=n.filter?[].concat(n.filter):[],(n.marktype||n.markname||n.markrole)&&o.push(Uhe(n.marktype,n.markname,n.markrole)),n.source===tE&&o.push("inScope(event.item)"),o.length&&(t.filter=Qf("("+o.join(")&&(")+")",e).$expr),(o=n.throttle)!=null&&(t.throttle=+o),(o=n.debounce)!=null&&(t.debounce=+o),n.consume&&(t.consume=!0),t}function Uhe(t,n,e){const o="event.item";return o+(t&&t!=="*"?"&&"+o+".mark.marktype==='"+t+"'":"")+(e?"&&"+o+".mark.role==='"+e+"'":"")+(n?"&&"+o+".mark.name==='"+n+"'":"")}const Vhe={code:"_.$value",ast:{type:"Identifier",value:"value"}};function qhe(t,n,e){const o=t.encode,f={target:e};let r=t.events,a=t.update,u=[];r||Pr("Signal update missing events specification."),bi(r)&&(r=pp(r,n.isSubscope()?tE:LT)),r=ki(r).filter(c=>c.signal||c.scale?(u.push(c),0):1),u.length>1&&(u=[$he(u)]),r.length&&u.push(r.length>1?{merge:r}:r[0]),o!=null&&(a&&Pr("Signal encode and update are mutually exclusive."),a="encode(item(),"+oi(o)+")"),f.update=bi(a)?Qf(a,n):a.expr!=null?Qf(a.expr,n):a.value!=null?a.value:a.signal!=null?{$expr:Vhe,$params:{$value:n.signalRef(a.signal)}}:Pr("Invalid signal update specification."),t.force&&(f.options={force:!0}),u.forEach(c=>n.addUpdate(pa(Hhe(c,n),f)))}function Hhe(t,n){return{source:t.signal?n.signalRef(t.signal):t.scale?n.scaleRef(t.scale):uy(t,n)}}function $he(t){return{signal:"["+t.map(n=>n.scale?'scale("'+n.scale+'")':n.signal)+"]"}}function Ghe(t,n){const e=n.getSignal(t.name);let o=t.update;t.init&&(o?Pr("Signals can not include both init and update expressions."):(o=t.init,e.initonly=!0)),o&&(o=Qf(o,n),e.update=o.$expr,e.params=o.$params),t.on&&t.on.forEach(f=>qhe(f,n,e.id))}const ko=t=>(n,e,o)=>$w(t,e,n||void 0,o),Xj=ko("aggregate"),Whe=ko("axisticks"),Zj=ko("bound"),mf=ko("collect"),PL=ko("compare"),Yhe=ko("datajoin"),Jj=ko("encode"),Xhe=ko("expression"),Zhe=ko("facet"),Jhe=ko("field"),Khe=ko("key"),Qhe=ko("legendentries"),ede=ko("load"),tde=ko("mark"),nde=ko("multiextent"),rde=ko("multivalues"),ide=ko("overlap"),ade=ko("params"),Kj=ko("prefacet"),ode=ko("projection"),sde=ko("proxy"),lde=ko("relay"),Qj=ko("render"),ude=ko("scale"),Y0=ko("sieve"),cde=ko("sortitems"),eU=ko("viewlayout"),fde=ko("values");let hde=0;const tU={min:"min",max:"max",count:"sum"};function dde(t,n){const e=t.type||"linear";JR(e)||Pr("Unrecognized scale type: "+oi(e)),n.addScale(t.name,{type:e,domain:void 0})}function pde(t,n){const e=n.getScale(t.name).params;let o;e.domain=nU(t.domain,t,n),t.range!=null&&(e.range=iU(t,n,e)),t.interpolate!=null&&Tde(t.interpolate,e),t.nice!=null&&(e.nice=kde(t.nice)),t.bins!=null&&(e.bins=wde(t.bins,n));for(o in t)qi(e,o)||o==="name"||(e[o]=hc(t[o],n))}function hc(t,n){return Ei(t)?t.signal?n.signalRef(t.signal):Pr("Unsupported object: "+oi(t)):t}function a_(t,n){return t.signal?n.signalRef(t.signal):t.map(e=>hc(e,n))}function Ww(t){Pr("Can not find data set: "+oi(t))}function nU(t,n,e){if(!t){(n.domainMin!=null||n.domainMax!=null)&&Pr("No scale domain defined for domainMin/domainMax to override.");return}return t.signal?e.signalRef(t.signal):(Ir(t)?gde:t.fields?vde:mde)(t,n,e)}function gde(t,n,e){return t.map(o=>hc(o,e))}function mde(t,n,e){const o=e.getData(t.data);return o||Ww(t.data),pm(n.type)?o.valuesRef(e,t.field,rU(t.sort,!1)):eF(n.type)?o.domainRef(e,t.field):o.extentRef(e,t.field)}function vde(t,n,e){const o=t.data,f=t.fields.reduce((r,a)=>(a=bi(a)?{data:o,field:a}:Ir(a)||a.signal?yde(a,e):a,r.push(a),r),[]);return(pm(n.type)?xde:eF(n.type)?bde:_de)(t,e,f)}function yde(t,n){const e="_:vega:_"+hde++,o=mf({});if(Ir(t))o.value={$ingest:t};else if(t.signal){const f="setdata("+oi(e)+","+t.signal+")";o.params.input=n.signalRef(f)}return n.addDataPipeline(e,[o,Y0({})]),{data:e,field:"data"}}function xde(t,n,e){const o=rU(t.sort,!0);let f,r;const a=e.map(i=>{const s=n.getData(i.data);return s||Ww(i.data),s.countsRef(n,i.field,o)}),u={groupby:OT,pulse:a};o&&(f=o.op||"count",r=o.field?Gw(f,o.field):"count",u.ops=[tU[f]],u.fields=[n.fieldRef(r)],u.as=[r]),f=n.add(Xj(u));const c=n.add(mf({pulse:Hi(f)}));return r=n.add(fde({field:OT,sort:n.sortRef(o),pulse:Hi(c)})),Hi(r)}function rU(t,n){return t&&(!t.field&&!t.op?Ei(t)?t.field="key":t={field:"key"}:!t.field&&t.op!=="count"?Pr("No field provided for sort aggregate op: "+t.op):n&&t.field&&t.op&&!tU[t.op]&&Pr("Multiple domain scales can not be sorted using "+t.op)),t}function bde(t,n,e){const o=e.map(f=>{const r=n.getData(f.data);return r||Ww(f.data),r.domainRef(n,f.field)});return Hi(n.add(rde({values:o})))}function _de(t,n,e){const o=e.map(f=>{const r=n.getData(f.data);return r||Ww(f.data),r.extentRef(n,f.field)});return Hi(n.add(nde({extents:o})))}function wde(t,n){return t.signal||Ir(t)?a_(t,n):n.objectProperty(t)}function kde(t){return Ei(t)?{interval:hc(t.interval),step:hc(t.step)}:hc(t)}function Tde(t,n){n.interpolate=hc(t.type||t),t.gamma!=null&&(n.interpolateGamma=hc(t.gamma))}function iU(t,n,e){const o=n.config.range;let f=t.range;if(f.signal)return n.signalRef(f.signal);if(bi(f)){if(o&&qi(o,f))return t=pa({},t,{range:o[f]}),iU(t,n,e);f==="width"?f=[0,{signal:"width"}]:f==="height"?f=pm(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Pr("Unrecognized scale range value: "+oi(f))}else if(f.scheme){e.scheme=Ir(f.scheme)?a_(f.scheme,n):hc(f.scheme,n),f.extent&&(e.schemeExtent=a_(f.extent,n)),f.count&&(e.schemeCount=hc(f.count,n));return}else if(f.step){e.rangeStep=hc(f.step,n);return}else{if(pm(t.type)&&!Ir(f))return nU(f,t,n);Ir(f)||Pr("Unsupported range type: "+oi(f))}return f.map(r=>(Ir(r)?a_:hc)(r,n))}function Ade(t,n){const e=n.config.projection||{},o={};for(const f in t)f!=="name"&&(o[f]=PT(t[f],f,n));for(const f in e)o[f]==null&&(o[f]=PT(e[f],f,n));n.addProjection(t.name,o)}function PT(t,n,e){return Ir(t)?t.map(o=>PT(o,n,e)):Ei(t)?t.signal?e.signalRef(t.signal):n==="fit"?t:Pr("Unsupported parameter object: "+oi(t)):t}const vf="top",Km="left",Qm="right",np="bottom",aU="center",Mde="vertical",Sde="start",Ede="middle",Cde="end",DT="index",rE="label",Ode="offset",Tm="perc",Lde="perc2",pc="value",Jy="guide-label",iE="guide-title",Pde="group-title",Dde="group-subtitle",DL="symbol",o_="gradient",IT="discrete",zT="size",Ide="shape",zde="fill",Rde="stroke",Fde="strokeWidth",Nde="strokeDash",Bde="opacity",aE=[zT,Ide,zde,Rde,Fde,Nde,Bde],Ky={name:1,style:1,interactive:1},Ua={value:0},gc={value:1},Yw="group",oU="rect",oE="rule",jde="symbol",X0="text";function cy(t){return t.type=Yw,t.interactive=t.interactive||!1,t}function Bu(t,n){const e=(o,f)=>Wc(t[o],Wc(n[o],f));return e.isVertical=o=>Mde===Wc(t.direction,n.direction||(o?n.symbolDirection:n.gradientDirection)),e.gradientLength=()=>Wc(t.gradientLength,n.gradientLength||n.gradientWidth),e.gradientThickness=()=>Wc(t.gradientThickness,n.gradientThickness||n.gradientHeight),e.entryColumns=()=>Wc(t.columns,Wc(n.columns,+e.isVertical(!0))),e}function sU(t,n){const e=n&&(n.update&&n.update[t]||n.enter&&n.enter[t]);return e&&e.signal?e:e?e.value:null}function Ude(t,n,e){const o=n.config.style[e];return o&&o[t]}function Xw(t,n,e){return`item.anchor === '${Sde}' ? ${t} : item.anchor === '${Cde}' ? ${n} : ${e}`}const sE=Xw(oi(Km),oi(Qm),oi(aU));function Vde(t){const n=t("tickBand");let e=t("tickOffset"),o,f;return n?n.signal?(o={signal:`(${n.signal}) === 'extent' ? 1 : 0.5`},f={signal:`(${n.signal}) === 'extent'`},Ei(e)||(e={signal:`(${n.signal}) === 'extent' ? 0 : ${e}`})):n==="extent"?(o=1,f=!0,e=0):(o=.5,f=!1):(o=t("bandPosition"),f=t("tickExtra")),{extra:f,band:o,offset:e}}function lU(t,n){return n?t?Ei(t)?Object.assign({},t,{offset:lU(t.offset,n)}):{value:t,offset:n}:n:t}function nc(t,n){return n?(t.name=n.name,t.style=n.style||t.style,t.interactive=!!n.interactive,t.encode=Jm(t.encode,n,Ky)):t.interactive=!1,t}function qde(t,n,e,o){const f=Bu(t,e),r=f.isVertical(),a=f.gradientThickness(),u=f.gradientLength();let c,i,s,l,d;r?(i=[0,1],s=[0,0],l=a,d=u):(i=[0,0],s=[1,0],l=u,d=a);const h={enter:c={opacity:Ua,x:Ua,y:Ua,width:il(l),height:il(d)},update:pa({},c,{opacity:gc,fill:{gradient:n,start:i,stop:s}}),exit:{opacity:Ua}};return kl(h,{stroke:f("gradientStrokeColor"),strokeWidth:f("gradientStrokeWidth")},{opacity:f("gradientOpacity")}),nc({type:oU,role:mhe,encode:h},o)}function Hde(t,n,e,o,f){const r=Bu(t,e),a=r.isVertical(),u=r.gradientThickness(),c=r.gradientLength();let i,s,l,d,h="";a?(i="y",l="y2",s="x",d="width",h="1-"):(i="x",l="x2",s="y",d="height");const m={opacity:Ua,fill:{scale:n,field:pc}};m[i]={signal:h+"datum."+Tm,mult:c},m[s]=Ua,m[l]={signal:h+"datum."+Lde,mult:c},m[d]=il(u);const g={enter:m,update:pa({},m,{opacity:gc}),exit:{opacity:Ua}};return kl(g,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),nc({type:oU,role:phe,key:pc,from:f,encode:g},o)}const $de=`datum.${Tm}<=0?"${Km}":datum.${Tm}>=1?"${Qm}":"${aU}"`,Gde=`datum.${Tm}<=0?"${np}":datum.${Tm}>=1?"${vf}":"${Ede}"`;function IL(t,n,e,o){const f=Bu(t,n),r=f.isVertical(),a=il(f.gradientThickness()),u=f.gradientLength();let c=f("labelOverlap"),i,s,l,d,h="";const m={enter:i={opacity:Ua},update:s={opacity:gc,text:{field:rE}},exit:{opacity:Ua}};return kl(m,{fill:f("labelColor"),fillOpacity:f("labelOpacity"),font:f("labelFont"),fontSize:f("labelFontSize"),fontStyle:f("labelFontStyle"),fontWeight:f("labelFontWeight"),limit:Wc(t.labelLimit,n.gradientLabelLimit)}),r?(i.align={value:"left"},i.baseline=s.baseline={signal:Gde},l="y",d="x",h="1-"):(i.align=s.align={signal:$de},i.baseline={value:"top"},l="x",d="y"),i[l]=s[l]={signal:h+"datum."+Tm,mult:u},i[d]=s[d]=a,a.offset=Wc(t.labelOffset,n.gradientLabelOffset)||0,c=c?{separation:f("labelSeparation"),method:c,order:"datum."+DT}:void 0,nc({type:X0,role:qj,style:Jy,key:pc,from:o,encode:m,overlap:c},e)}function Wde(t,n,e,o,f){const r=Bu(t,n),a=e.entries,u=!!(a&&a.interactive),c=a?a.name:void 0,i=r("clipHeight"),s=r("symbolOffset"),l={data:"value"},d=`(${f}) ? datum.${Ode} : datum.${zT}`,h=i?il(i):{field:zT},m=`datum.${DT}`,g=`max(1, ${f})`;let p,v,y,x,w;h.mult=.5,p={enter:v={opacity:Ua,x:{signal:d,mult:.5,offset:s},y:h},update:y={opacity:gc,x:v.x,y:v.y},exit:{opacity:Ua}};let k=null,b=null;t.fill||(k=n.symbolBaseFillColor,b=n.symbolBaseStrokeColor),kl(p,{fill:r("symbolFillColor",k),shape:r("symbolType"),size:r("symbolSize"),stroke:r("symbolStrokeColor",b),strokeDash:r("symbolDash"),strokeDashOffset:r("symbolDashOffset"),strokeWidth:r("symbolStrokeWidth")},{opacity:r("symbolOpacity")}),aE.forEach(A=>{t[A]&&(y[A]=v[A]={scale:t[A],field:pc})});const T=nc({type:jde,role:vhe,key:pc,from:l,clip:i?!0:void 0,encode:p},e.symbols),_=il(s);_.offset=r("labelOffset"),p={enter:v={opacity:Ua,x:{signal:d,offset:_},y:h},update:y={opacity:gc,text:{field:rE},x:v.x,y:v.y},exit:{opacity:Ua}},kl(p,{align:r("labelAlign"),baseline:r("labelBaseline"),fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:r("labelLimit")});const M=nc({type:X0,role:qj,style:Jy,key:pc,from:l,encode:p},e.labels);return p={enter:{noBound:{value:!i},width:Ua,height:i?il(i):Ua,opacity:Ua},exit:{opacity:Ua},update:y={opacity:gc,row:{signal:null},column:{signal:null}}},r.isVertical(!0)?(x=`ceil(item.mark.items.length / ${g})`,y.row.signal=`${m}%${x}`,y.column.signal=`floor(${m} / ${x})`,w={field:["row",m]}):(y.row.signal=`floor(${m} / ${g})`,y.column.signal=`${m} % ${g}`,w={field:m}),y.column.signal=`(${f})?${y.column.signal}:${m}`,o={facet:{data:o,name:"value",groupby:DT}},cy({role:eE,from:o,encode:Jm(p,a,Ky),marks:[T,M],name:c,interactive:u,sort:w})}function Yde(t,n){const e=Bu(t,n);return{align:e("gridAlign"),columns:e.entryColumns(),center:{row:!0,column:!1},padding:{row:e("rowPadding"),column:e("columnPadding")}}}const lE='item.orient === "left"',uE='item.orient === "right"',Zw=`(${lE} || ${uE})`,Xde=`datum.vgrad && ${Zw}`,Zde=Xw('"top"','"bottom"','"middle"'),Jde=Xw('"right"','"left"','"center"'),Kde=`datum.vgrad && ${uE} ? (${Jde}) : (${Zw} && !(datum.vgrad && ${lE})) ? "left" : ${sE}`,Qde=`item._anchor || (${Zw} ? "middle" : "start")`,epe=`${Xde} ? (${lE} ? -90 : 90) : 0`,tpe=`${Zw} ? (datum.vgrad ? (${uE} ? "bottom" : "top") : ${Zde}) : "top"`;function npe(t,n,e,o){const f=Bu(t,n),r={enter:{opacity:Ua},update:{opacity:gc,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ua}};return kl(r,{orient:f("titleOrient"),_anchor:f("titleAnchor"),anchor:{signal:Qde},angle:{signal:epe},align:{signal:Kde},baseline:{signal:tpe},text:t.title,fill:f("titleColor"),fillOpacity:f("titleOpacity"),font:f("titleFont"),fontSize:f("titleFontSize"),fontStyle:f("titleFontStyle"),fontWeight:f("titleFontWeight"),limit:f("titleLimit"),lineHeight:f("titleLineHeight")},{align:f("titleAlign"),baseline:f("titleBaseline")}),nc({type:X0,role:yhe,style:iE,from:o,encode:r},e)}function rpe(t,n){let e;return Ei(t)&&(t.signal?e=t.signal:t.path?e="pathShape("+zL(t.path)+")":t.sphere&&(e="geoShape("+zL(t.sphere)+', {type: "Sphere"})')),e?n.signalRef(e):!!t}function zL(t){return Ei(t)&&t.signal?t.signal:oi(t)}function uU(t){const n=t.role||"";return!n.indexOf("axis")||!n.indexOf("legend")||!n.indexOf("title")?n:t.type===Yw?eE:n||KS}function ipe(t){return{marktype:t.type,name:t.name||void 0,role:t.role||uU(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function ape(t,n){return t&&t.signal?n.signalRef(t.signal):t!==!1}function cE(t,n){const e=_z(t.type);e||Pr("Unrecognized transform type: "+oi(t.type));const o=$w(e.type.toLowerCase(),null,cU(e,t,n));return t.signal&&n.addSignal(t.signal,n.proxy(o)),o.metadata=e.metadata||{},o}function cU(t,n,e){const o={},f=t.params.length;for(let r=0;rRL(t,r,e)):RL(t,f,e)}function RL(t,n,e){const o=t.type;if(Ys(n))return NL(o)?Pr("Expression references can not be signals."):M4(o)?e.fieldRef(n):BL(o)?e.compareRef(n):e.signalRef(n.signal);{const f=t.expr||M4(o);return f&&upe(n)?e.exprRef(n.expr,n.as):f&&cpe(n)?ly(n.field,n.as):NL(o)?Qf(n,e):fpe(o)?Hi(e.getData(n).values):M4(o)?ly(n):BL(o)?e.compareRef(n):n}}function spe(t,n,e){return bi(n.from)||Pr('Lookup "from" parameter must be a string literal.'),e.getData(n.from).lookupRef(e,n.key)}function lpe(t,n,e){const o=n[t.name];return t.array?(Ir(o)||Pr("Expected an array of sub-parameters. Instead: "+oi(o)),o.map(f=>FL(t,f,e))):FL(t,o,e)}function FL(t,n,e){const o=t.params.length;let f;for(let a=0;at&&t.expr,cpe=t=>t&&t.field,fpe=t=>t==="data",NL=t=>t==="expr",M4=t=>t==="field",BL=t=>t==="compare";function hpe(t,n,e){let o,f,r,a,u;return t?(o=t.facet)&&(n||Pr("Only group marks can be faceted."),o.field!=null?a=u=s_(o,e):(t.data?u=Hi(e.getData(t.data).aggregate):(r=cE(pa({type:"aggregate",groupby:ki(o.groupby)},o.aggregate),e),r.params.key=e.keyRef(o.groupby),r.params.pulse=s_(o,e),a=u=Hi(e.add(r))),f=e.keyRef(o.groupby,!0))):a=Hi(e.add(mf(null,[{}]))),a||(a=s_(t,e)),{key:f,pulse:a,parent:u}}function s_(t,n){return t.$ref?t:t.data&&t.data.$ref?t.data:Hi(n.getData(t.data).output)}function O0(t,n,e,o,f){this.scope=t,this.input=n,this.output=e,this.values=o,this.aggregate=f,this.index={}}O0.fromEntries=function(t,n){const e=n.length,o=n[e-1],f=n[e-2];let r=n[0],a=null,u=1;for(r&&r.type==="load"&&(r=n[1]),t.add(n[0]);ul??"null").join(",")+"),0)",s=Qf(i,n);c.update=s.$expr,c.params=s.$params}function Jw(t,n){const e=uU(t),o=t.type===Yw,f=t.from&&t.from.facet,r=t.overlap;let a=t.layout||e===eE||e===QS,u,c,i,s,l,d,h;const m=e===KS||a||f,g=hpe(t.from,o,n);c=n.add(Yhe({key:g.key||(t.key?ly(t.key):void 0),pulse:g.pulse,clean:!o}));const p=Hi(c);c=i=n.add(mf({pulse:p})),c=n.add(tde({markdef:ipe(t),interactive:ape(t.interactive,n),clip:rpe(t.clip,n),context:{$context:!0},groups:n.lookup(),parent:n.signals.parent?n.signalRef("parent"):null,index:n.markpath(),pulse:Hi(c)}));const v=Hi(c);c=s=n.add(Jj(Wj(t.encode,t.type,e,t.style,n,{mod:!1,pulse:v}))),c.params.parent=n.encode(),t.transform&&t.transform.forEach(b=>{const T=cE(b,n),_=T.metadata;(_.generates||_.changes)&&Pr("Mark transforms should not generate new data."),_.nomod||(s.params.mod=!0),T.params.pulse=Hi(c),n.add(c=T)}),t.sort&&(c=n.add(cde({sort:n.compareRef(t.sort),pulse:Hi(c)})));const y=Hi(c);(f||a)&&(a=n.add(eU({layout:n.objectProperty(t.layout),legends:n.legends,mark:v,pulse:y})),d=Hi(a));const x=n.add(Zj({mark:v,pulse:d||y}));h=Hi(x),o&&(m&&(u=n.operators,u.pop(),a&&u.pop()),n.pushState(y,d||h,p),f?dpe(t,n,g):m?ppe(t,n,g):n.parse(t),n.popState(),m&&(a&&u.push(a),u.push(x))),r&&(h=gpe(r,h,n));const w=n.add(Qj({pulse:h})),k=n.add(Y0({pulse:Hi(w)},void 0,n.parent()));t.name!=null&&(l=t.name,n.addData(l,new O0(n,i,w,k)),t.on&&t.on.forEach(b=>{(b.insert||b.remove||b.toggle)&&Pr("Marks only support modify triggers."),hU(b,n,l)}))}function gpe(t,n,e){const o=t.method,f=t.bound,r=t.separation,a={separation:Ys(r)?e.signalRef(r.signal):r,method:Ys(o)?e.signalRef(o.signal):o,pulse:n};if(t.order&&(a.sort=e.compareRef({field:t.order})),f){const u=f.tolerance;a.boundTolerance=Ys(u)?e.signalRef(u.signal):+u,a.boundScale=e.scaleRef(f.scale),a.boundOrient=f.orient}return Hi(e.add(ide(a)))}function mpe(t,n){const e=n.config.legend,o=t.encode||{},f=Bu(t,e),r=o.legend||{},a=r.name||void 0,u=r.interactive,c=r.style,i={};let s=0,l,d,h;aE.forEach(x=>t[x]?(i[x]=t[x],s=s||t[x]):0),s||Pr("Missing valid scale for legend.");const m=vpe(t,n.scaleType(s)),g={title:t.title!=null,scales:i,type:m,vgrad:m!=="symbol"&&f.isVertical()},p=Hi(n.add(mf(null,[g]))),v={enter:{x:{value:0},y:{value:0}}},y=Hi(n.add(Qhe(d={type:m,scale:n.scaleRef(s),count:n.objectProperty(f("tickCount")),limit:n.property(f("symbolLimit")),values:n.objectProperty(t.values),minstep:n.property(t.tickMinStep),formatType:n.property(t.formatType),formatSpecifier:n.property(t.format)})));return m===o_?(h=[qde(t,s,e,o.gradient),IL(t,e,o.labels,y)],d.count=d.count||n.signalRef(`max(2,2*floor((${m0(f.gradientLength())})/100))`)):m===IT?h=[Hde(t,s,e,o.gradient,y),IL(t,e,o.labels,y)]:(l=Yde(t,e),h=[Wde(t,e,o,y,m0(l.columns))],d.size=bpe(t,n,h[0].marks)),h=[cy({role:ghe,from:p,encode:v,marks:h,layout:l,interactive:u})],g.title&&h.push(npe(t,e,o.title,p)),Jw(cy({role:dhe,from:p,encode:Jm(xpe(f,t,e),r,Ky),marks:h,aria:f("aria"),description:f("description"),zindex:f("zindex"),name:a,interactive:u,style:c}),n)}function vpe(t,n){let e=t.type||DL;return!t.type&&ype(t)===1&&(t.fill||t.stroke)&&(e=oM(n)?o_:Mk(n)?IT:DL),e!==o_?e:Mk(n)?IT:o_}function ype(t){return aE.reduce((n,e)=>n+(t[e]?1:0),0)}function xpe(t,n,e){const o={enter:{},update:{}};return kl(o,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:e.strokeWidth,strokeDash:e.strokeDash,x:t("legendX"),y:t("legendY"),format:n.format,formatType:n.formatType}),o}function bpe(t,n,e){const o=m0(UL("size",t,e)),f=m0(UL("strokeWidth",t,e)),r=m0(_pe(e[1].encode,n,Jy));return Qf(`max(ceil(sqrt(${o})+${f}),${r})`,n)}function UL(t,n,e){return n[t]?`scale("${n[t]}",datum)`:sU(t,e[0].encode)}function _pe(t,n,e){return sU("fontSize",t)||Ude("fontSize",n,e)}const wpe=`item.orient==="${Km}"?-90:item.orient==="${Qm}"?90:0`;function kpe(t,n){t=bi(t)?{text:t}:t;const e=Bu(t,n.config.title),o=t.encode||{},f=o.group||{},r=f.name||void 0,a=f.interactive,u=f.style,c=[],i={},s=Hi(n.add(mf(null,[i])));return c.push(Mpe(t,e,Tpe(t),s)),t.subtitle&&c.push(Spe(t,e,o.subtitle,s)),Jw(cy({role:xhe,from:s,encode:Ape(e,f),marks:c,aria:e("aria"),description:e("description"),zindex:e("zindex"),name:r,interactive:a,style:u}),n)}function Tpe(t){const n=t.encode;return n&&n.title||pa({name:t.name,interactive:t.interactive,style:t.style},n)}function Ape(t,n){const e={enter:{},update:{}};return kl(e,{orient:t("orient"),anchor:t("anchor"),align:{signal:sE},angle:{signal:wpe},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),Jm(e,n,Ky)}function Mpe(t,n,e,o){const f={value:0},r=t.text,a={enter:{opacity:f},update:{opacity:{value:1}},exit:{opacity:f}};return kl(a,{text:r,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:n("dx"),dy:n("dy"),fill:n("color"),font:n("font"),fontSize:n("fontSize"),fontStyle:n("fontStyle"),fontWeight:n("fontWeight"),lineHeight:n("lineHeight")},{align:n("align"),angle:n("angle"),baseline:n("baseline")}),nc({type:X0,role:bhe,style:Pde,from:o,encode:a},e)}function Spe(t,n,e,o){const f={value:0},r=t.subtitle,a={enter:{opacity:f},update:{opacity:{value:1}},exit:{opacity:f}};return kl(a,{text:r,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:n("dx"),dy:n("dy"),fill:n("subtitleColor"),font:n("subtitleFont"),fontSize:n("subtitleFontSize"),fontStyle:n("subtitleFontStyle"),fontWeight:n("subtitleFontWeight"),lineHeight:n("subtitleLineHeight")},{align:n("align"),angle:n("angle"),baseline:n("baseline")}),nc({type:X0,role:_he,style:Dde,from:o,encode:a},e)}function Epe(t,n){const e=[];t.transform&&t.transform.forEach(o=>{e.push(cE(o,n))}),t.on&&t.on.forEach(o=>{hU(o,n,t.name)}),n.addDataPipeline(t.name,Cpe(t,n,e))}function Cpe(t,n,e){const o=[];let f=null,r=!1,a=!1,u,c,i,s,l;for(t.values?Ys(t.values)||i_(t.format)?(o.push(VL(n,t)),o.push(f=jp())):o.push(f=jp({$ingest:t.values,$format:t.format})):t.url?i_(t.url)||i_(t.format)?(o.push(VL(n,t)),o.push(f=jp())):o.push(f=jp({$request:t.url,$format:t.format})):t.source&&(f=u=ki(t.source).map(d=>Hi(n.getData(d).output)),o.push(null)),c=0,i=e.length;ct===np||t===vf,Kw=(t,n,e)=>Ys(t)?Dpe(t.signal,n,e):t===Km||t===vf?n:e,al=(t,n,e)=>Ys(t)?Lpe(t.signal,n,e):dU(t)?n:e,of=(t,n,e)=>Ys(t)?Ppe(t.signal,n,e):dU(t)?e:n,pU=(t,n,e)=>Ys(t)?Ipe(t.signal,n,e):t===vf?{value:n}:{value:e},Ope=(t,n,e)=>Ys(t)?zpe(t.signal,n,e):t===Qm?{value:n}:{value:e},Lpe=(t,n,e)=>gU(`${t} === '${vf}' || ${t} === '${np}'`,n,e),Ppe=(t,n,e)=>gU(`${t} !== '${vf}' && ${t} !== '${np}'`,n,e),Dpe=(t,n,e)=>fE(`${t} === '${Km}' || ${t} === '${vf}'`,n,e),Ipe=(t,n,e)=>fE(`${t} === '${vf}'`,n,e),zpe=(t,n,e)=>fE(`${t} === '${Qm}'`,n,e),gU=(t,n,e)=>(n=n!=null?il(n):n,e=e!=null?il(e):e,qL(n)&&qL(e)?(n=n?n.signal||oi(n.value):null,e=e?e.signal||oi(e.value):null,{signal:`${t} ? (${n}) : (${e})`}):[pa({test:t},n)].concat(e||[])),qL=t=>t==null||Object.keys(t).length===1,fE=(t,n,e)=>({signal:`${t} ? (${Kg(n)}) : (${Kg(e)})`}),Rpe=(t,n,e,o,f)=>({signal:(o!=null?`${t} === '${Km}' ? (${Kg(o)}) : `:"")+(e!=null?`${t} === '${np}' ? (${Kg(e)}) : `:"")+(f!=null?`${t} === '${Qm}' ? (${Kg(f)}) : `:"")+(n!=null?`${t} === '${vf}' ? (${Kg(n)}) : `:"")+"(null)"}),Kg=t=>Ys(t)?t.signal:t==null?null:oi(t),Fpe=(t,n)=>n===0?0:Ys(t)?{signal:`(${t.signal}) * ${n}`}:{value:t*n},nm=(t,n)=>{const e=t.signal;return e&&e.endsWith("(null)")?{signal:e.slice(0,-6)+n.signal}:t};function Ng(t,n,e,o){let f;if(n&&qi(n,t))return n[t];if(qi(e,t))return e[t];if(t.startsWith("title")){switch(t){case"titleColor":f="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":f=t[5].toLowerCase()+t.slice(6)}return o[iE][f]}else if(t.startsWith("label")){switch(t){case"labelColor":f="fill";break;case"labelFont":case"labelFontSize":f=t[5].toLowerCase()+t.slice(6)}return o[Jy][f]}return null}function HL(t){const n={};for(const e of t)if(!!e)for(const o in e)n[o]=1;return Object.keys(n)}function Npe(t,n){var e=n.config,o=e.style,f=e.axis,r=n.scaleType(t.scale)==="band"&&e.axisBand,a=t.orient,u,c,i;if(Ys(a)){const l=HL([e.axisX,e.axisY]),d=HL([e.axisTop,e.axisBottom,e.axisLeft,e.axisRight]);u={};for(i of l)u[i]=al(a,Ng(i,e.axisX,f,o),Ng(i,e.axisY,f,o));c={};for(i of d)c[i]=Rpe(a.signal,Ng(i,e.axisTop,f,o),Ng(i,e.axisBottom,f,o),Ng(i,e.axisLeft,f,o),Ng(i,e.axisRight,f,o))}else u=a===vf||a===np?e.axisX:e.axisY,c=e["axis"+a[0].toUpperCase()+a.slice(1)];return u||c||r?pa({},f,u,c,r):f}function Bpe(t,n,e,o){const f=Bu(t,n),r=t.orient;let a,u;const c={enter:a={opacity:Ua},update:u={opacity:gc},exit:{opacity:Ua}};kl(c,{stroke:f("domainColor"),strokeCap:f("domainCap"),strokeDash:f("domainDash"),strokeDashOffset:f("domainDashOffset"),strokeWidth:f("domainWidth"),strokeOpacity:f("domainOpacity")});const i=$L(t,0),s=$L(t,1);return a.x=u.x=al(r,i,Ua),a.x2=u.x2=al(r,s),a.y=u.y=of(r,i,Ua),a.y2=u.y2=of(r,s),nc({type:oE,role:lhe,from:o,encode:c},e)}function $L(t,n){return{scale:t.scale,range:n}}function jpe(t,n,e,o,f){const r=Bu(t,n),a=t.orient,u=t.gridScale,c=Kw(a,1,-1),i=Upe(t.offset,c);let s,l,d;const h={enter:s={opacity:Ua},update:d={opacity:gc},exit:l={opacity:Ua}};kl(h,{stroke:r("gridColor"),strokeCap:r("gridCap"),strokeDash:r("gridDash"),strokeDashOffset:r("gridDashOffset"),strokeOpacity:r("gridOpacity"),strokeWidth:r("gridWidth")});const m={scale:t.scale,field:pc,band:f.band,extra:f.extra,offset:f.offset,round:r("tickRound")},g=al(a,{signal:"height"},{signal:"width"}),p=u?{scale:u,range:0,mult:c,offset:i}:{value:0,offset:i},v=u?{scale:u,range:1,mult:c,offset:i}:pa(g,{mult:c,offset:i});return s.x=d.x=al(a,m,p),s.y=d.y=of(a,m,p),s.x2=d.x2=of(a,v),s.y2=d.y2=al(a,v),l.x=al(a,m),l.y=of(a,m),nc({type:oE,role:uhe,key:pc,from:o,encode:h},e)}function Upe(t,n){if(n!==1)if(!Ei(t))t=Ys(n)?{signal:`(${n.signal}) * (${t||0})`}:n*(t||0);else{let e=t=pa({},t);for(;e.mult!=null;)if(Ei(e.mult))e=e.mult=pa({},e.mult);else return e.mult=Ys(n)?{signal:`(${e.mult}) * (${n.signal})`}:e.mult*n,t;e.mult=n}return t}function Vpe(t,n,e,o,f,r){const a=Bu(t,n),u=t.orient,c=Kw(u,-1,1);let i,s,l;const d={enter:i={opacity:Ua},update:l={opacity:gc},exit:s={opacity:Ua}};kl(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=il(f);h.mult=c;const m={scale:t.scale,field:pc,band:r.band,extra:r.extra,offset:r.offset,round:a("tickRound")};return l.y=i.y=al(u,Ua,m),l.y2=i.y2=al(u,h),s.x=al(u,m),l.x=i.x=of(u,Ua,m),l.x2=i.x2=of(u,h),s.y=of(u,m),nc({type:oE,role:fhe,key:pc,from:o,encode:d},e)}function S4(t,n,e,o,f){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+n+","+e+","+o+","+f+")"}}function qpe(t,n,e,o,f,r){const a=Bu(t,n),u=t.orient,c=t.scale,i=Kw(u,-1,1),s=m0(a("labelFlush")),l=m0(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let m=s===0||!!s,g;const p=il(f);p.mult=i,p.offset=il(a("labelPadding")||0),p.offset.mult=i;const v={scale:c,field:pc,band:.5,offset:lU(r.offset,a("labelOffset"))},y=al(u,m?S4(c,s,'"left"','"right"','"center"'):{value:"center"},Ope(u,"left","right")),x=al(u,pU(u,"bottom","top"),m?S4(c,s,'"top"','"bottom"','"middle"'):{value:"middle"}),w=S4(c,s,`-(${l})`,l,0);m=m&&l;const k={opacity:Ua,x:al(u,v,p),y:of(u,v,p)},b={enter:k,update:g={opacity:gc,text:{field:rE},x:k.x,y:k.y,align:y,baseline:x},exit:{opacity:Ua,x:k.x,y:k.y}};kl(b,{dx:!d&&m?al(u,w):null,dy:!h&&m?of(u,w):null}),kl(b,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const T=a("labelBound");let _=a("labelOverlap");return _=_||T?{separation:a("labelSeparation"),method:_,order:"datum.index",bound:T?{scale:c,orient:u,tolerance:T}:null}:void 0,g.align!==y&&(g.align=nm(g.align,y)),g.baseline!==x&&(g.baseline=nm(g.baseline,x)),nc({type:X0,role:che,style:Jy,key:pc,from:o,encode:b,overlap:_},e)}function Hpe(t,n,e,o){const f=Bu(t,n),r=t.orient,a=Kw(r,-1,1);let u,c;const i={enter:u={opacity:Ua,anchor:il(f("titleAnchor",null)),align:{signal:sE}},update:c=pa({},u,{opacity:gc,text:il(t.title)}),exit:{opacity:Ua}},s={signal:`lerp(range("${t.scale}"), ${Xw(0,1,.5)})`};return c.x=al(r,s),c.y=of(r,s),u.angle=al(r,Ua,Fpe(a,90)),u.baseline=al(r,pU(r,np,vf),{value:np}),c.angle=u.angle,c.baseline=u.baseline,kl(i,{fill:f("titleColor"),fillOpacity:f("titleOpacity"),font:f("titleFont"),fontSize:f("titleFontSize"),fontStyle:f("titleFontStyle"),fontWeight:f("titleFontWeight"),limit:f("titleLimit"),lineHeight:f("titleLineHeight")},{align:f("titleAlign"),angle:f("titleAngle"),baseline:f("titleBaseline")}),$pe(f,r,i,e),i.update.align=nm(i.update.align,u.align),i.update.angle=nm(i.update.angle,u.angle),i.update.baseline=nm(i.update.baseline,u.baseline),nc({type:X0,role:hhe,style:iE,from:o,encode:i},e)}function $pe(t,n,e,o){const f=(u,c)=>u!=null?(e.update[c]=nm(il(u),e.update[c]),!1):!$g(c,o),r=f(t("titleX"),"x"),a=f(t("titleY"),"y");e.enter.auto=a===r?il(a):al(n,il(a),il(r))}function Gpe(t,n){const e=Npe(t,n),o=t.encode||{},f=o.axis||{},r=f.name||void 0,a=f.interactive,u=f.style,c=Bu(t,e),i=Vde(c),s={scale:t.scale,ticks:!!c("ticks"),labels:!!c("labels"),grid:!!c("grid"),domain:!!c("domain"),title:t.title!=null},l=Hi(n.add(mf({},[s]))),d=Hi(n.add(Whe({scale:n.scaleRef(t.scale),extra:n.property(i.extra),count:n.objectProperty(t.tickCount),values:n.objectProperty(t.values),minstep:n.property(t.tickMinStep),formatType:n.property(t.formatType),formatSpecifier:n.property(t.format)}))),h=[];let m;return s.grid&&h.push(jpe(t,e,o.grid,d,i)),s.ticks&&(m=c("tickSize"),h.push(Vpe(t,e,o.ticks,d,m,i))),s.labels&&(m=s.ticks?m:0,h.push(qpe(t,e,o.labels,d,m,i))),s.domain&&h.push(Bpe(t,e,o.domain,l)),s.title&&h.push(Hpe(t,e,o.title,l)),Jw(cy({role:she,from:l,encode:Jm(Wpe(c,t),f,Ky),marks:h,aria:c("aria"),description:c("description"),zindex:c("zindex"),name:r,interactive:a,style:u}),n)}function Wpe(t,n){const e={enter:{},update:{}};return kl(e,{orient:t("orient"),offset:t("offset")||0,position:Wc(n.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:`abs(span(range("${n.scale}")))`},translate:t("translate"),format:n.format,formatType:n.formatType}),e}function mU(t,n,e){const o=ki(t.signals),f=ki(t.scales);return e||o.forEach(r=>Yj(r,n)),ki(t.projections).forEach(r=>Ade(r,n)),f.forEach(r=>dde(r,n)),ki(t.data).forEach(r=>Epe(r,n)),f.forEach(r=>pde(r,n)),(e||o).forEach(r=>Ghe(r,n)),ki(t.axes).forEach(r=>Gpe(r,n)),ki(t.marks).forEach(r=>Jw(r,n)),ki(t.legends).forEach(r=>mpe(r,n)),t.title&&kpe(t.title,n),n.parseLambdas(),n}const Ype=t=>Jm({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function Xpe(t,n){const e=n.config,o=Hi(n.root=n.add(w2())),f=Zpe(t,e);f.forEach(i=>Yj(i,n)),n.description=t.description||e.description,n.eventConfig=e.events,n.legends=n.objectProperty(e.legend&&e.legend.layout),n.locale=e.locale;const r=n.add(mf()),a=n.add(Jj(Wj(Ype(t.encode),Yw,QS,t.style,n,{pulse:Hi(r)}))),u=n.add(eU({layout:n.objectProperty(t.layout),legends:n.legends,autosize:n.signalRef("autosize"),mark:o,pulse:Hi(a)}));n.operators.pop(),n.pushState(Hi(a),Hi(u),null),mU(t,n,f),n.operators.push(u);let c=n.add(Zj({mark:o,pulse:Hi(u)}));return c=n.add(Qj({pulse:Hi(c)})),c=n.add(Y0({pulse:Hi(c)})),n.addData("root",new O0(n,r,r,c)),n}function Z1(t,n){return n&&n.signal?{name:t,update:n.signal}:{name:t,value:n}}function Zpe(t,n){const e=a=>Wc(t[a],n[a]),o=[Z1("background",e("background")),Z1("autosize",ihe(e("autosize"))),Z1("padding",ohe(e("padding"))),Z1("width",e("width")||0),Z1("height",e("height")||0)],f=o.reduce((a,u)=>(a[u.name]=u,a),{}),r={};return ki(t.signals).forEach(a=>{qi(f,a.name)?a=pa(f[a.name],a):o.push(a),r[a.name]=a}),ki(n.signals).forEach(a=>{!qi(r,a.name)&&!qi(f,a.name)&&o.push(a)}),o}function vU(t,n){this.config=t||{},this.options=n||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function GL(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}vU.prototype=GL.prototype={parse(t){return mU(t,this)},fork(){return new GL(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(n=>{n.$ref=t.id}),t.refs=null),t},proxy(t){const n=t instanceof CT?Hi(t):t;return this.add(sde({value:n}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,n;this.root&&(this.root.root=!0);for(t in this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function e(o,f,r){let a,u;o&&(a=o.data||(o.data={}),u=a[f]||(a[f]=[]),u.push(r))}for(t in this.data){n=this.data[t],e(n.input,t,"input"),e(n.output,t,"output"),e(n.values,t,"values");for(const o in n.index)e(n.index[o],t,"index:"+o)}return this},pushState(t,n,e){this._encode.push(Hi(this.add(Y0({pulse:t})))),this._parent.push(n),this._lookup.push(e?Hi(this.proxy(e)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Na(this._parent)},encode(){return Na(this._encode)},lookup(){return Na(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,n){if(bi(t))return ly(t,n);t.signal||Pr("Unsupported field reference: "+oi(t));const e=t.signal;let o=this.field[e];if(!o){const f={name:this.signalRef(e)};n&&(f.as=n),this.field[e]=o=Hi(this.add(Jhe(f)))}return o},compareRef(t){let n=!1;const e=r=>Ys(r)?(n=!0,this.signalRef(r.signal)):Rhe(r)?(n=!0,this.exprRef(r.expr)):r,o=ki(t.field).map(e),f=ki(t.order).map(e);return n?Hi(this.add(PL({fields:o,orders:f}))):OL(o,f)},keyRef(t,n){let e=!1;const o=r=>Ys(r)?(e=!0,Hi(f[r.signal])):r,f=this.signals;return t=ki(t).map(o),e?Hi(this.add(Khe({fields:t,flat:n}))):Phe(t,n)},sortRef(t){if(!t)return t;const n=Gw(t.op,t.field),e=t.order||Dhe;return e.signal?Hi(this.add(PL({fields:n,orders:this.signalRef(e.signal)}))):OL(n,e)},event(t,n){const e=t+":"+n;if(!this.events[e]){const o=this.id();this.streams.push({id:o,source:t,type:n}),this.events[e]=o}return this.events[e]},hasOwnSignal(t){return qi(this.signals,t)},addSignal(t,n){this.hasOwnSignal(t)&&Pr("Duplicate signal name: "+oi(t));const e=n instanceof CT?n:this.add(w2(n));return this.signals[t]=e},getSignal(t){return this.signals[t]||Pr("Unrecognized signal name: "+oi(t)),this.signals[t]},signalRef(t){return this.signals[t]?Hi(this.signals[t]):(qi(this.lambdas,t)||(this.lambdas[t]=this.add(w2(null))),Hi(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let n=0,e=t.length;n0?",":"")+(Ei(f)?f.signal||hE(f):oi(f))}return e+"]"}function Kpe(t){let n="{",e=0,o,f;for(o in t)f=t[o],n+=(++e>1?",":"")+oi(o)+":"+(Ei(f)?f.signal||hE(f):oi(f));return n+"}"}function Qpe(){const t="sans-serif",o="#4c78a8",f="#000",r="#888",a="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:o},area:{fill:o},image:null,line:{stroke:o,strokeWidth:2},path:{stroke:o},rect:{fill:o},rule:{stroke:f},shape:{stroke:o},symbol:{fill:o,size:64},text:{fill:f,font:t,fontSize:11},trail:{fill:o,size:2},style:{"guide-label":{fill:f,font:t,fontSize:10},"guide-title":{fill:f,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:f,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:f,font:t,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:a}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:a,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:a,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:r,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function e0e(t,n,e){return Ei(t)||Pr("Input Vega specification must be an object."),n=Vm(Qpe(),n,t.config),Xpe(t,new vU(n,e)).toRuntime()}var t0e="5.22.1";pa(cm,PJ,One,lre,Wie,Uae,pse,Woe,mse,Bse,Xse,nle);var n0e=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",version:t0e,Dataflow:Qg,EventStream:iw,MultiPulse:ZA,Operator:Co,Parameters:rw,Pulse:Ud,Transform:_r,changeset:$0,definition:_z,ingest:ro,isTuple:tw,transform:wz,transforms:cm,tupleid:$i,interpolate:sM,interpolateColors:xw,interpolateRange:tF,quantizeInterpolator:nF,scale:Xa,scheme:lM,projection:aS,View:zj,defaultLocale:$A,formatLocale:y_,locale:lz,resetDefaultLocale:PX,timeFormatLocale:Gv,expressionFunction:Fs,parse:e0e,runtimeContext:wj,codegenExpression:uj,parseExpression:BS,parseSelector:pp,Debug:ZD,Error:wA,Info:XD,None:YD,Warn:kA,accessor:Nu,accessorFields:Bl,accessorName:xs,array:ki,ascending:J2,clampRange:sI,compare:EA,constant:$l,debounce:CA,error:Pr,extend:pa,extent:Zf,extentIndex:lI,falsy:yd,fastmap:Hm,field:Lu,flush:uI,hasOwnProperty:qi,id:Ty,identity:Hl,inherits:ni,inrange:Wg,isArray:Ir,isBoolean:fp,isDate:Nd,isFunction:ga,isIterable:cI,isNumber:wo,isObject:Ei,isRegExp:fI,isString:bi,key:OA,lerp:hI,logger:TA,lruCache:dI,merge:pI,mergeConfig:Vm,one:Um,pad:gI,panLinear:tI,panLog:nI,panPow:rI,panSymlog:iI,peek:Na,quarter:aI,repeat:iv,span:Ay,splitAccessPath:ih,stringValue:oi,toBoolean:LA,toDate:PA,toNumber:Rl,toSet:ff,toString:DA,truncate:mI,truthy:mc,utcquarter:oI,visitArray:_d,writeConfig:qm,zero:Md,zoomLinear:AA,zoomLog:MA,zoomPow:p_,zoomSymlog:SA,bandwidthNRD:e6,bin:Tz,bootstrapCI:Az,cumulativeLogNormal:o6,cumulativeNormal:ow,cumulativeUniform:c6,densityLogNormal:a6,densityNormal:t6,densityUniform:u6,dotbin:Mz,quantileLogNormal:s6,quantileNormal:sw,quantileUniform:f6,quantiles:KA,quartiles:QA,get random(){return yc},randomInteger:RZ,randomKDE:r6,randomLCG:zZ,randomLogNormal:Ez,randomMixture:Cz,randomNormal:n6,randomUniform:Oz,regressionExp:Pz,regressionLinear:h6,regressionLoess:zz,regressionLog:Lz,regressionPoly:Iz,regressionPow:Dz,regressionQuad:d6,sampleCurve:uw,sampleLogNormal:i6,sampleNormal:aw,sampleUniform:l6,setRandom:DZ,DATE:Du,DAY:Il,DAYOFYEAR:Jf,HOURS:Qu,MILLISECONDS:hf,MINUTES:ec,MONTH:jl,QUARTER:Pu,SECONDS:vc,TIME_UNITS:jA,WEEK:Gs,YEAR:wl,dayofyear:LI,timeBin:YI,timeFloor:NI,timeInterval:$m,timeOffset:UI,timeSequence:HI,timeUnitSpecifier:OI,timeUnits:UA,utcFloor:BI,utcInterval:Gm,utcOffset:VI,utcSequence:$I,utcdayofyear:II,utcweek:zI,week:PI,format:Bb,formats:YA,inferType:cz,inferTypes:fz,loader:Q2,read:pz,responseType:dz,typeParsers:bk,path:Bm,Bounds:zs,CanvasHandler:Vy,CanvasRenderer:R_,Gradient:gF,GroupItem:ww,Handler:ep,Item:_w,Marks:tc,RenderType:Dd,Renderer:oh,ResourceLoader:gM,SVGHandler:DM,SVGRenderer:BM,SVGStringRenderer:jM,Scenegraph:LM,boundClip:uN,boundContext:Ny,boundItem:Dk,boundMark:IF,boundStroke:Jh,domChild:Au,domClear:Xc,domCreate:Ld,domFind:PM,font:Sw,fontFamily:Uy,fontSize:ah,intersect:aN,intersectBoxLine:Yg,intersectPath:mM,intersectPoint:vM,intersectRule:kF,lineHeight:Kd,markup:NM,multiLineOffset:EM,pathCurves:hM,pathEqual:cN,pathParse:gm,pathRectangle:yF,pathRender:Zv,pathSymbols:vF,pathTrail:xF,point:Cw,renderModule:Ow,resetSVGClipId:_F,resetSVGDefIds:Gte,sceneEqual:UM,sceneFromJSON:RF,scenePickVisit:O_,sceneToJSON:zF,sceneVisit:df,sceneZOrder:yM,serializeXML:JF,textMetrics:af});function r0e(t,n,e){let o;n.x2&&(n.x?(e&&t.x>t.x2&&(o=t.x,t.x=t.x2,t.x2=o),t.width=t.x2-t.x):t.x=t.x2-(t.width||0)),n.xc&&(t.x=t.xc-(t.width||0)/2),n.y2&&(n.y?(e&&t.y>t.y2&&(o=t.y,t.y=t.y2,t.y2=o),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),n.yc&&(t.y=t.yc-(t.height||0)/2)}var i0e={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},a0e={"*":(t,n)=>t*n,"+":(t,n)=>t+n,"-":(t,n)=>t-n,"/":(t,n)=>t/n,"%":(t,n)=>t%n,">":(t,n)=>t>n,"<":(t,n)=>tt<=n,">=":(t,n)=>t>=n,"==":(t,n)=>t==n,"!=":(t,n)=>t!=n,"===":(t,n)=>t===n,"!==":(t,n)=>t!==n,"&":(t,n)=>t&n,"|":(t,n)=>t|n,"^":(t,n)=>t^n,"<<":(t,n)=>t<>":(t,n)=>t>>n,">>>":(t,n)=>t>>>n},o0e={"+":t=>+t,"-":t=>-t,"~":t=>~t,"!":t=>!t};const s0e=Array.prototype.slice,Up=(t,n,e)=>{const o=e?e(n[0]):n[0];return o[t].apply(o,s0e.call(n,1))},l0e=(t,n,e,o,f,r,a)=>new Date(t,n||0,e??1,o||0,f||0,r||0,a||0);var u0e={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(t,n,e)=>Math.max(n,Math.min(e,t)),now:Date.now,utc:Date.UTC,datetime:l0e,date:t=>new Date(t).getDate(),day:t=>new Date(t).getDay(),year:t=>new Date(t).getFullYear(),month:t=>new Date(t).getMonth(),hours:t=>new Date(t).getHours(),minutes:t=>new Date(t).getMinutes(),seconds:t=>new Date(t).getSeconds(),milliseconds:t=>new Date(t).getMilliseconds(),time:t=>new Date(t).getTime(),timezoneoffset:t=>new Date(t).getTimezoneOffset(),utcdate:t=>new Date(t).getUTCDate(),utcday:t=>new Date(t).getUTCDay(),utcyear:t=>new Date(t).getUTCFullYear(),utcmonth:t=>new Date(t).getUTCMonth(),utchours:t=>new Date(t).getUTCHours(),utcminutes:t=>new Date(t).getUTCMinutes(),utcseconds:t=>new Date(t).getUTCSeconds(),utcmilliseconds:t=>new Date(t).getUTCMilliseconds(),length:t=>t.length,join:function(){return Up("join",arguments)},indexof:function(){return Up("indexOf",arguments)},lastindexof:function(){return Up("lastIndexOf",arguments)},slice:function(){return Up("slice",arguments)},reverse:t=>t.slice().reverse(),parseFloat,parseInt,upper:t=>String(t).toUpperCase(),lower:t=>String(t).toLowerCase(),substring:function(){return Up("substring",arguments,String)},split:function(){return Up("split",arguments,String)},replace:function(){return Up("replace",arguments,String)},trim:t=>String(t).trim(),regexp:RegExp,test:(t,n)=>RegExp(t).test(n)};const c0e=["view","item","group","xy","x","y"],f0e={Literal:(t,n)=>n.value,Identifier:(t,n)=>{const e=n.name;return t.memberDepth>0?e:e==="datum"?t.datum:e==="event"?t.event:e==="item"?t.item:i0e[e]||t.params["$"+e]},MemberExpression:(t,n)=>{const e=!n.computed,o=t(n.object);e&&(t.memberDepth+=1);const f=t(n.property);return e&&(t.memberDepth-=1),o[f]},CallExpression:(t,n)=>{const e=n.arguments;let o=n.callee.name;return o.startsWith("_")&&(o=o.slice(1)),o==="if"?t(e[0])?t(e[1]):t(e[2]):(t.fn[o]||u0e[o]).apply(t.fn,e.map(t))},ArrayExpression:(t,n)=>n.elements.map(t),BinaryExpression:(t,n)=>a0e[n.operator](t(n.left),t(n.right)),UnaryExpression:(t,n)=>o0e[n.operator](t(n.argument)),ConditionalExpression:(t,n)=>t(n.test)?t(n.consequent):t(n.alternate),LogicalExpression:(t,n)=>n.operator==="&&"?t(n.left)&&t(n.right):t(n.left)||t(n.right),ObjectExpression:(t,n)=>n.properties.reduce((e,o)=>{t.memberDepth+=1;const f=t(o.key);return t.memberDepth-=1,e[f]=t(o.value),e},{})};function J1(t,n,e,o,f,r){const a=u=>f0e[u.type](a,u);return a.memberDepth=0,a.fn=Object.create(n),a.params=e,a.datum=o,a.event=f,a.item=r,c0e.forEach(u=>a.fn[u]=(...c)=>f.vega[u](...c)),a(t)}var h0e={operator(t,n){const e=n.ast,o=t.functions;return f=>J1(e,o,f)},parameter(t,n){const e=n.ast,o=t.functions;return(f,r)=>J1(e,o,r,f)},event(t,n){const e=n.ast,o=t.functions;return f=>J1(e,o,void 0,void 0,f)},handler(t,n){const e=n.ast,o=t.functions;return(f,r)=>{const a=r.item&&r.item.datum;return J1(e,o,f,a,r)}},encode(t,n){const{marktype:e,channels:o}=n,f=t.functions,r=e==="group"||e==="image"||e==="rect";return(a,u)=>{const c=a.datum;let i=0,s;for(const l in o)s=J1(o[l].ast,f,u,c,void 0,a),a[l]!==s&&(a[l]=s,i=1);return e!=="rule"&&r0e(a,o,r),i}}};const d0e="vega-lite",p0e='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',g0e="5.5.0",m0e=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],v0e="https://vega.github.io/vega-lite/",y0e="Vega-Lite is a concise high-level language for interactive visualization.",x0e=["vega","chart","visualization"],b0e="build/vega-lite.js",_0e="build/vega-lite.min.js",w0e="build/vega-lite.min.js",k0e="build/src/index",T0e="build/src/index.d.ts",A0e={vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2pdf:"./bin/vl2pdf",vl2vg:"./bin/vl2vg"},M0e=["bin","build","src","vega-lite*","tsconfig.json"],S0e={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.js","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json","predeploy:site":"yarn presite","deploy:site":"gh-pages -d site",data:"rsync -r node_modules/vega-datasets/data/* site/data",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",eslintbase:"eslint .",format:"yarn eslintbase --fix && yarn prettierbase --write",lint:"yarn eslintbase && yarn prettierbase --check",jest:"NODE_OPTIONS=--experimental-vm-modules npx jest",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk --experimental-vm-modules ./node_modules/.bin/jest --runInBand test","test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"yarn run prebuild && yarn build && yarn shipit",shipit:"auto shipit"},E0e={type:"git",url:"https://github.com/vega/vega-lite.git"},C0e="BSD-3-Clause",O0e={url:"https://github.com/vega/vega-lite/issues"},L0e={"@auto-it/conventional-commits":"^10.37.6","@auto-it/first-time-contributor":"^10.37.6","@babel/core":"^7.19.1","@babel/preset-env":"^7.19.1","@babel/preset-typescript":"^7.18.6","@rollup/plugin-alias":"^4.0.0","@rollup/plugin-babel":"^6.0.0","@rollup/plugin-commonjs":"^23.0.0","@rollup/plugin-json":"^4.1.0","@types/jest":"^27.4.1","@rollup/plugin-node-resolve":"^14.1.0","@types/chai":"^4.3.3","@types/d3":"^7.4.0","@types/mkdirp":"^1.0.2","@types/pako":"^2.0.0","@typescript-eslint/eslint-plugin":"^5.38.0","@typescript-eslint/parser":"^5.38.0",ajv:"^8.11.0","ajv-formats":"^2.1.1",auto:"^10.37.6",chai:"^4.3.6",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^2.2.2",d3:"^7.6.1","del-cli":"^5.0.0",eslint:"^8.23.1","eslint-config-prettier":"^8.5.0","eslint-plugin-jest":"^27.0.4","eslint-plugin-prettier":"^4.2.1","gh-pages":"^4.0.0",jest:"^27.5.1","highlight.js":"^11.6.0","jest-dev-server":"^6.1.1",mkdirp:"^1.0.4",pako:"^2.0.4",prettier:"^2.7.1",puppeteer:"^15.0.0",rollup:"^2.79.1","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2",serve:"^14.0.1",terser:"^5.15.0","ts-jest":"^29.0.1","ts-json-schema-generator":"^1.1.1","vega-cli":"^5.22.1",typescript:"~4.8.3","vega-datasets":"~2.5.1","vega-embed":"^6.21.0","vega-tooltip":"^0.28.0","yaml-front-matter":"^4.1.1"},P0e={"@types/clone":"~2.1.1",clone:"~2.1.2","fast-deep-equal":"~3.1.3","fast-json-stable-stringify":"~2.1.0","json-stringify-pretty-compact":"~3.0.0",tslib:"~2.4.0","vega-event-selector":"~3.0.0","vega-expression":"~5.0.0","vega-util":"~1.17.0",yargs:"~17.6.0"},D0e={vega:"^5.22.0"},I0e={node:">=12"};var z0e={name:d0e,author:p0e,version:g0e,collaborators:m0e,homepage:v0e,description:y0e,keywords:x0e,main:b0e,unpkg:_0e,jsdelivr:w0e,module:k0e,types:T0e,bin:A0e,files:M0e,scripts:S0e,repository:E0e,license:C0e,bugs:O0e,devDependencies:L0e,dependencies:P0e,peerDependencies:D0e,engines:I0e},yU={exports:{}};(function(t){var n=function(){function e(d,h){return h!=null&&d instanceof h}var o;try{o=Map}catch{o=function(){}}var f;try{f=Set}catch{f=function(){}}var r;try{r=Promise}catch{r=function(){}}function a(d,h,m,g,p){typeof h=="object"&&(m=h.depth,g=h.prototype,p=h.includeNonEnumerable,h=h.circular);var v=[],y=[],x=typeof Buffer<"u";typeof h>"u"&&(h=!0),typeof m>"u"&&(m=1/0);function w(k,b){if(k===null)return null;if(b===0)return k;var T,_;if(typeof k!="object")return k;if(e(k,o))T=new o;else if(e(k,f))T=new f;else if(e(k,r))T=new r(function(L,P){k.then(function(N){L(w(N,b-1))},function(N){P(w(N,b-1))})});else if(a.__isArray(k))T=[];else if(a.__isRegExp(k))T=new RegExp(k.source,l(k)),k.lastIndex&&(T.lastIndex=k.lastIndex);else if(a.__isDate(k))T=new Date(k.getTime());else{if(x&&Buffer.isBuffer(k))return Buffer.allocUnsafe?T=Buffer.allocUnsafe(k.length):T=new Buffer(k.length),k.copy(T),T;e(k,Error)?T=Object.create(k):typeof g>"u"?(_=Object.getPrototypeOf(k),T=Object.create(_)):(T=Object.create(g),_=g)}if(h){var M=v.indexOf(k);if(M!=-1)return y[M];v.push(k),y.push(T)}e(k,o)&&k.forEach(function(L,P){var N=w(P,b-1),B=w(L,b-1);T.set(N,B)}),e(k,f)&&k.forEach(function(L){var P=w(L,b-1);T.add(P)});for(var A in k){var S;_&&(S=Object.getOwnPropertyDescriptor(_,A)),!(S&&S.set==null)&&(T[A]=w(k[A],b-1))}if(Object.getOwnPropertySymbols)for(var E=Object.getOwnPropertySymbols(k),A=0;Arm(e,n))}:pE(t)?{or:t.or.map(e=>rm(e,n))}:n(t)}const Uf=xU,ha=R0e;function bU(t){throw new Error(t)}function Am(t,n){const e={};for(const o of n)qi(t,o)&&(e[o]=t[o]);return e}function Eu(t,n){const e=Object.assign({},t);for(const o of n)delete e[o];return e}Set.prototype.toJSON=function(){return`Set(${[...this].map(t=>dE(t)).join(",")})`};const No=dE;function Ba(t){if(wo(t))return t;const n=bi(t)?t:dE(t);if(n.length<250)return n;let e=0;for(let o=0;ou===0?a:`[${a}]`),r=f.map((a,u)=>f.slice(0,u+1).join(""));for(const a of r)n.add(a)}return n}function xE(t,n){return t===void 0||n===void 0?!0:yE(FT(t),FT(n))}function _o(t){return Xr(t).length===0}const Xr=Object.keys,ql=Object.values,rp=Object.entries;function fy(t){return t===!0||t===!1}function Xo(t){const n=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+n}function Nv(t,n){return mE(t)?`!(${Nv(t.not,n)})`:gE(t)?`(${t.and.map(e=>Nv(e,n)).join(") && (")})`:pE(t)?`(${t.or.map(e=>Nv(e,n)).join(") || (")})`:n(t)}function k2(t,n){if(n.length===0)return!0;const e=n.shift();return e in t&&k2(t[e],n)&&delete t[e],_o(t)}function Qy(t){return t.charAt(0).toUpperCase()+t.substr(1)}function bE(t,n="datum"){const e=ih(t),o=[];for(let f=1;f<=e.length;f++){const r=`[${e.slice(0,f).map(oi).join("][")}]`;o.push(`${n}${r}`)}return o.join(" && ")}function kU(t,n="datum"){return`${n}[${oi(ih(t).join("."))}]`}function B0e(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function bc(t){return`${ih(t).map(B0e).join("\\.")}`}function P0(t,n,e){return t.replace(new RegExp(n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),e)}function _E(t){return`${ih(t).join(".")}`}function Mm(t){return t?ih(t).length:0}function Rs(...t){for(const n of t)if(n!==void 0)return n}let TU=42;function AU(t){const n=++TU;return t?String(t)+n:n}function j0e(){TU=42}function MU(t){return SU(t)?t:`__${t}`}function SU(t){return t.startsWith("__")}function hy(t){if(t!==void 0)return(t%360+360)%360}function Qw(t){return wo(t)?!0:!isNaN(t)&&!isNaN(parseFloat(t))}var ex=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);fs3(t[n])?Xo(`_${n}_${rp(t[n])}`):Xo(`_${n}_${t[n]}`)).join("")}function Bo(t){return t===!0||K0(t)&&!t.binned}function xl(t){return t==="binned"||K0(t)&&t.binned===!0}function K0(t){return Ei(t)}function s3(t){return t?.param}function WL(t){switch(t){case Vh:case qh:case nd:case zu:case hh:case dh:case yp:case rd:case mp:case vp:case Ru:return 6;case xp:return 4;default:return 10}}function ix(t){return!!t?.expr}function Tu(t){const n=Xr(t||{}),e={};for(const o of n)e[o]=Xu(t[o]);return e}var hge=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f{var f;return e.field.push(hi(o,n)),e.order.push((f=o.sort)!==null&&f!==void 0?f:"ascending"),e},{field:[],order:[]})}function GU(t,n){const e=[...t];return n.forEach(o=>{for(const f of e)if(Uf(f,o))return;e.push(o)}),e}function WU(t,n){return Uf(t,n)||!n?t:t?[...ki(t),...ki(n)].join(", "):n}function YU(t,n){const e=t.value,o=n.value;if(e==null||o===null)return{explicit:t.explicit,value:null};if((Ad(e)||Vi(e))&&(Ad(o)||Vi(o)))return{explicit:t.explicit,value:WU(e,o)};if(Ad(e)||Vi(e))return{explicit:t.explicit,value:e};if(Ad(o)||Vi(o))return{explicit:t.explicit,value:o};if(!Ad(e)&&!Vi(e)&&!Ad(o)&&!Vi(o))return{explicit:t.explicit,value:GU(e,o)};throw new Error("It should never reach here")}function OE(t){return`Invalid specification ${No(t)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const bge='Autosize "fit" only works for single views and layered views.';function ZL(t){return`${t=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function JL(t){const n=t=="width"?"Width":"Height",e=t=="width"?"x":"y";return`${n} "container" only works well with autosize "fit" or "fit-${e}".`}function KL(t){return t?`Dropping "fit-${t}" because spec has discrete ${Fu(t)}.`:'Dropping "fit" because spec has discrete size.'}function LE(t){return`Unknown field for ${t}. Cannot calculate view size.`}function QL(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function _ge(t,n){return`Cannot project a selection on encoding channel "${t}" as it uses an aggregate function ("${n}").`}function wge(t){return`The "nearest" transform is not supported for ${t} marks.`}function XU(t){return`Selection not supported for ${t} yet.`}function kge(t){return`Cannot find a selection named "${t}".`}const Tge="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Age="Legend bindings are only supported for selections over an individual field or encoding channel.";function Mge(t){return`Lookups can only be performed on selection parameters. "${t}" is a variable parameter.`}function Sge(t){return`Cannot define and lookup the "${t}" selection in the same view. Try moving the lookup into a second, layered view?`}const Ege="The same selection must be used to override scale domains in a layered view.",Cge='Interval selections should be initialized using "x" and/or "y" keys.';function Oge(t){return`Unknown repeated value "${t}".`}function eP(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}const Lge="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Pge(t){return`Unrecognized parse "${t}".`}function tP(t,n,e){return`An ancestor parsed field "${t}" as ${e} but a child wants to parse the field as ${n}.`}const Dge="Attempt to add the same child twice.";function Ige(t){return`Ignoring an invalid transform: ${No(t)}.`}const zge='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function nP(t){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${t} are dropped.`}function Rge(t){const{parentProjection:n,projection:e}=t;return`Layer's shared projection ${No(n)} is overridden by a child projection ${No(e)}.`}const Fge="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Nge(t){return`${t}Offset dropped because ${t} is continuous`}function Bge(t){return`There is no ${t} encoding. Replacing ${t}Offset encoding as ${t}.`}function jge(t,n,e){return`Channel ${t} is a ${n}. Converted to {value: ${No(e)}}.`}function ZU(t){return`Invalid field type "${t}".`}function Uge(t,n){return`Invalid field type "${t}" for aggregate: "${n}", using "quantitative" instead.`}function Vge(t){return`Invalid aggregation operator "${t}".`}function JU(t,n){const{fill:e,stroke:o}=n;return`Dropping color ${t} as the plot also has ${e&&o?"fill and stroke":e?"fill":"stroke"}.`}function qge(t){return`Position range does not support relative band size for ${t}.`}function BT(t,n){return`Dropping ${No(t)} from channel "${n}" since it does not contain any data field, datum, value, or signal.`}const Hge="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function l3(t,n,e){return`${t} dropped as it is incompatible with "${n}"${e?` when ${e}`:""}.`}function $ge(t){return`${t} encoding has no scale, so specified scale is ignored.`}function Gge(t){return`${t}-encoding is dropped as ${t} is not a valid encoding channel.`}function Wge(t){return`${t} encoding should be discrete (ordinal / nominal / binned).`}function Yge(t){return`${t} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Xge(t){return`Facet encoding dropped as ${t.join(" and ")} ${t.length>1?"are":"is"} also specified.`}function C4(t,n){return`Using discrete channel "${t}" to encode "${n}" field can be misleading as it does not encode ${n==="ordinal"?"order":"magnitude"}.`}function Zge(t){return`The ${t} for range marks cannot be an expression`}function Jge(t,n){return`Line mark is for continuous lines and thus cannot be used with ${t&&n?"x2 and y2":t?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Kge(t,n){return`Specified orient "${t}" overridden with "${n}".`}function Qge(t){return`Cannot use the scale property "${t}" with non-color channel.`}function eme(t){return`Cannot use the relative band size with ${t} scale.`}function tme(t){return`Using unaggregated domain with raw field has no effect (${No(t)}).`}function nme(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function rme(t){return`Unaggregated domain is currently unsupported for log scale (${No(t)}).`}function ime(t){return`Cannot apply size to non-oriented mark "${t}".`}function ame(t,n,e){return`Channel "${t}" does not work with "${n}" scale. We are using "${e}" scale instead.`}function ome(t,n){return`FieldDef does not work with "${t}" scale. We are using "${n}" scale instead.`}function KU(t,n,e){return`${e}-scale's "${n}" is dropped as it does not work with ${t} scale.`}function QU(t){return`The step for "${t}" is dropped because the ${t==="width"?"x":"y"} is continuous.`}function sme(t,n,e,o){return`Conflicting ${n.toString()} property "${t.toString()}" (${No(e)} and ${No(o)}). Using ${No(e)}.`}function lme(t,n,e,o){return`Conflicting ${n.toString()} property "${t.toString()}" (${No(e)} and ${No(o)}). Using the union of the two domains.`}function ume(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}function cme(t){return`Dropping sort property ${No(t)} as unioned domains only support boolean or op "count", "min", and "max".`}const rP="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",fme="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",hme="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",dme="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function pme(t){return`Cannot stack "${t}" if there is already "${t}2".`}function gme(t){return`Cannot stack non-linear scale (${t}).`}function mme(t){return`Stacking is applied even though the aggregate function is non-summative ("${t}").`}function A2(t,n){return`Invalid ${t}: ${No(n)}.`}function vme(t){return`Dropping day from datetime ${No(t)} as day cannot be combined with other units.`}function yme(t,n){return`${n?"extent ":""}${n&&t?"and ":""}${t?"center ":""}${n&&t?"are ":"is "}not needed when data are aggregated.`}function xme(t,n,e){return`${t} is not usually used with ${n} for ${e}.`}function bme(t,n){return`Continuous axis should not have customized aggregation function ${t}; ${n} already agregates the axis.`}function iP(t){return`1D error band does not support ${t}.`}function eV(t){return`Channel ${t} is required for "binned" bin.`}function _me(t){return`Channel ${t} should not be used with "binned" bin.`}function wme(t){return`Domain for ${t} is required for threshold scale.`}globalThis&&globalThis.__classPrivateFieldSet;globalThis&&globalThis.__classPrivateFieldGet;const tV=TA(kA);let Sm=tV;function kme(t){return Sm=t,Sm}function Tme(){return Sm=tV,Sm}function Kr(...t){Sm.warn(...t)}function Ame(...t){Sm.debug(...t)}function Q0(t){if(t&&Ei(t)){for(const n of DE)if(n in t)return!0}return!1}const nV=["january","february","march","april","may","june","july","august","september","october","november","december"],Mme=nV.map(t=>t.substr(0,3)),rV=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Sme=rV.map(t=>t.substr(0,3));function Eme(t){if(Qw(t)&&(t=+t),wo(t))return t>4&&Kr(A2("quarter",t)),t-1;throw new Error(A2("quarter",t))}function Cme(t){if(Qw(t)&&(t=+t),wo(t))return t-1;{const n=t.toLowerCase(),e=nV.indexOf(n);if(e!==-1)return e;const o=n.substr(0,3),f=Mme.indexOf(o);if(f!==-1)return f;throw new Error(A2("month",t))}}function Ome(t){if(Qw(t)&&(t=+t),wo(t))return t%7;{const n=t.toLowerCase(),e=rV.indexOf(n);if(e!==-1)return e;const o=n.substr(0,3),f=Sme.indexOf(o);if(f!==-1)return f;throw new Error(A2("day",t))}}function PE(t,n){const e=[];if(n&&t.day!==void 0&&Xr(t).length>1&&(Kr(vme(t)),t=ha(t),delete t.day),t.year!==void 0?e.push(t.year):e.push(2012),t.month!==void 0){const o=n?Cme(t.month):t.month;e.push(o)}else if(t.quarter!==void 0){const o=n?Eme(t.quarter):t.quarter;e.push(wo(o)?o*3:`${o}*3`)}else e.push(0);if(t.date!==void 0)e.push(t.date);else if(t.day!==void 0){const o=n?Ome(t.day):t.day;e.push(wo(o)?o+1:`${o}+1`)}else e.push(1);for(const o of["hours","minutes","seconds","milliseconds"]){const f=t[o];e.push(typeof f>"u"?0:f)}return e}function dy(t){const e=PE(t,!0).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}function Lme(t){const e=PE(t,!1).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}function Pme(t){const n=PE(t,!0);return t.utc?+new Date(Date.UTC(...n)):+new Date(...n)}var Dme=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);faV(t,n))}function aV(t,n){const e=t.indexOf(n);return!(e<0||e>0&&n==="seconds"&&t.charAt(e-1)==="i"||t.length>e+3&&n==="day"&&t.charAt(e+3)==="o"||e>0&&n==="year"&&t.charAt(e-1)==="f")}function Fme(t,n,{end:e}={end:!1}){const o=bE(n),f=IE(t)?"utc":"";function r(c){return c==="quarter"?`(${f}quarter(${o})-1)`:`${f}${c}(${o})`}let a;const u={};for(const c of DE)aV(t,c)&&(u[c]=r(c),a=c);return e&&(u[a]+="+1"),Lme(u)}function oV(t){if(!t)return;const n=zE(t);return`timeUnitSpecifier(${No(n)}, ${No(Rme)})`}function Nme(t,n,e){if(!t)return;const o=oV(t);return`${e||IE(t)?"utc":"time"}Format(${n}, ${o})`}function Gl(t){if(!t)return;let n;return bi(t)?n={unit:t}:Ei(t)&&(n=Object.assign(Object.assign({},t),t.unit?{unit:t.unit}:{})),IE(n.unit)&&(n.utc=!0,n.unit=zme(n.unit)),n}function Bme(t){const n=Gl(t),{utc:e}=n,o=Dme(n,["utc"]);return o.unit?(e?"utc":"")+Xr(o).map(f=>Xo(`${f==="unit"?"":`_${f}_`}${o[f]}`)).join(""):(e?"utc":"")+"timeunit"+Xr(o).map(f=>Xo(`_${f}_${o[f]}`)).join("")}function jme(t){return t?.param}function RE(t){return!!t?.field&&t.equal!==void 0}function FE(t){return!!t?.field&&t.lt!==void 0}function NE(t){return!!t?.field&&t.lte!==void 0}function BE(t){return!!t?.field&&t.gt!==void 0}function jE(t){return!!t?.field&&t.gte!==void 0}function UE(t){if(t?.field){if(Ir(t.range)&&t.range.length===2)return!0;if(Vi(t.range))return!0}return!1}function VE(t){return!!t?.field&&(Ir(t.oneOf)||Ir(t.in))}function Ume(t){return!!t?.field&&t.valid!==void 0}function sV(t){return VE(t)||RE(t)||UE(t)||FE(t)||BE(t)||NE(t)||jE(t)}function Pf(t,n){return y3(t,{timeUnit:n,wrapTime:!0})}function Vme(t,n){return t.map(e=>Pf(e,n))}function lV(t,n=!0){var e;const{field:o}=t,f=(e=Gl(t.timeUnit))===null||e===void 0?void 0:e.unit,r=f?`time(${Fme(f,o)})`:hi(t,{expr:"datum"});if(RE(t))return`${r}===${Pf(t.equal,f)}`;if(FE(t)){const a=t.lt;return`${r}<${Pf(a,f)}`}else if(BE(t)){const a=t.gt;return`${r}>${Pf(a,f)}`}else if(NE(t)){const a=t.lte;return`${r}<=${Pf(a,f)}`}else if(jE(t)){const a=t.gte;return`${r}>=${Pf(a,f)}`}else{if(VE(t))return`indexof([${Vme(t.oneOf,f).join(",")}], ${r}) !== -1`;if(Ume(t))return qE(r,t.valid);if(UE(t)){const{range:a}=t,u=Vi(a)?{signal:`${a.signal}[0]`}:a[0],c=Vi(a)?{signal:`${a.signal}[1]`}:a[1];if(u!==null&&c!==null&&n)return"inrange("+r+", ["+Pf(u,f)+", "+Pf(c,f)+"])";const i=[];return u!==null&&i.push(`${r} >= ${Pf(u,f)}`),c!==null&&i.push(`${r} <= ${Pf(c,f)}`),i.length>0?i.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${No(t)}`)}function qE(t,n=!0){return n?`isValid(${t}) && isFinite(+${t})`:`!isValid(${t}) || !isFinite(+${t})`}function qme(t){var n;return sV(t)&&t.timeUnit?Object.assign(Object.assign({},t),{timeUnit:(n=Gl(t.timeUnit))===null||n===void 0?void 0:n.unit}):t}const ax={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Hme(t){return t==="quantitative"||t==="temporal"}function uV(t){return t==="ordinal"||t==="nominal"}const z0=ax.quantitative,HE=ax.ordinal,Em=ax.temporal,$E=ax.nominal,n1=ax.geojson;function $me(t){if(t)switch(t=t.toLowerCase(),t){case"q":case z0:return"quantitative";case"t":case Em:return"temporal";case"o":case HE:return"ordinal";case"n":case $E:return"nominal";case n1:return"geojson"}}var Gme=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f{switch(n.fieldTitle){case"plain":return t.field;case"functional":return F1e(t);default:return R1e(t,n)}};let zV=IV;function RV(t){zV=t}function N1e(){RV(IV)}function am(t,n,{allowDisabling:e,includeDefault:o=!0}){var f,r;const a=(f=t8(t))===null||f===void 0?void 0:f.title;if(!ti(t))return a??t.title;const u=t,c=o?n8(u,n):void 0;return e?Rs(a,u.title,c):(r=a??u.title)!==null&&r!==void 0?r:c}function t8(t){if(Lm(t)&&t.axis)return t.axis;if(PV(t)&&t.legend)return t.legend;if(QE(t)&&t.header)return t.header}function n8(t,n){return zV(t,n)}function C2(t){var n;if(DV(t)){const{format:e,formatType:o}=t;return{format:e,formatType:o}}else{const e=(n=t8(t))!==null&&n!==void 0?n:{},{format:o,formatType:f}=e;return{format:o,formatType:f}}}function B1e(t,n){var e;switch(n){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(e8(t)&&Ir(t.sort))return"ordinal";const{aggregate:o,bin:f,timeUnit:r}=t;if(r)return"temporal";if(f||o&&!_p(o)&&!Xh(o))return"quantitative";if(eg(t)&&((e=t.scale)===null||e===void 0?void 0:e.type))switch(jT[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function th(t){if(ti(t))return t;if(m3(t))return t.condition}function Ws(t){if(la(t))return t;if(lx(t))return t.condition}function FV(t,n,e,o={}){if(bi(t)||wo(t)||fp(t)){const f=bi(t)?"string":wo(t)?"number":"boolean";return Kr(jge(n,f,t)),{value:t}}return la(t)?O2(t,n,e,o):lx(t)?Object.assign(Object.assign({},t),{condition:O2(t.condition,n,e,o)}):t}function O2(t,n,e,o){if(DV(t)){const{format:f,formatType:r}=t,a=qT(t,["format","formatType"]);if(F0(r)&&!e.customFormatTypes)return Kr(nP(n)),O2(a,n,e,o)}else{const f=Lm(t)?"axis":PV(t)?"legend":QE(t)?"header":null;if(f&&t[f]){const r=t[f],{format:a,formatType:u}=r,c=qT(r,["format","formatType"]);if(F0(u)&&!e.customFormatTypes)return Kr(nP(n)),O2(Object.assign(Object.assign({},t),{[f]:c}),n,e,o)}}return ti(t)?r8(t,n,o):j1e(t)}function j1e(t){let n=t.type;if(n)return t;const{datum:e}=t;return n=wo(e)?"quantitative":bi(e)?"nominal":Q0(e)?"temporal":void 0,Object.assign(Object.assign({},t),{type:n})}function r8(t,n,{compositeMark:e=!1}={}){const{aggregate:o,timeUnit:f,bin:r,field:a}=t,u=Object.assign({},t);if(!e&&o&&!EE(o)&&!_p(o)&&!Xh(o)&&(Kr(Vge(o)),delete u.aggregate),f&&(u.timeUnit=Gl(f)),a&&(u.field=`${a}`),Bo(r)&&(u.bin=v3(r,n)),xl(r)&&!sl(n)&&Kr(_me(n)),wc(u)){const{type:c}=u,i=$me(c);c!==i&&(u.type=i),c!=="quantitative"&&BU(o)&&(Kr(Uge(c,o)),u.type="quantitative")}else if(!PU(n)){const c=B1e(u,n);u.type=c}if(wc(u)){const{compatible:c,warning:i}=U1e(u,n)||{};c===!1&&Kr(i)}if(e8(u)&&bi(u.sort)){const{sort:c}=u;if(lP(c))return Object.assign(Object.assign({},u),{sort:{encoding:c}});const i=c.substr(1);if(c.charAt(0)==="-"&&lP(i))return Object.assign(Object.assign({},u),{sort:{encoding:i,order:"descending"}})}if(QE(u)){const{header:c}=u;if(c){const{orient:i}=c,s=qT(c,["orient"]);if(i)return Object.assign(Object.assign({},u),{header:Object.assign(Object.assign({},s),{labelOrient:c.labelOrient||i,titleOrient:c.titleOrient||i})})}}return u}function v3(t,n){return fp(t)?{maxbins:WL(n)}:t==="binned"?{binned:!0}:!t.maxbins&&!t.step?Object.assign(Object.assign({},t),{maxbins:WL(n)}):t}const Bg={compatible:!0};function U1e(t,n){const e=t.type;if(e==="geojson"&&n!=="shape")return{compatible:!1,warning:`Channel ${n} should not be used with a geojson data.`};switch(n){case Vh:case qh:case e3:return E2(t)?Bg:{compatible:!1,warning:Wge(n)};case cs:case ol:case gp:case e1:case zu:case hh:case dh:case tx:case rx:case t3:case D0:case n3:case r3:case Z0:case Tc:case xf:case i3:return Bg;case fh:case _c:case ch:case bf:return e!==z0?{compatible:!1,warning:`Channel ${n} should be used with a quantitative field only, not ${t.type} field.`}:Bg;case rd:case mp:case vp:case yp:case nd:case td:case ed:case yf:case uh:return e==="nominal"&&!t.sort?{compatible:!1,warning:`Channel ${n} should not be used with an unsorted discrete field.`}:Bg;case Ru:case xp:return!E2(t)&&!I1e(t)?{compatible:!1,warning:Yge(n)}:Bg;case nx:return t.type==="nominal"&&!("sort"in t)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Bg}}function Pm(t){const{formatType:n}=C2(t);return n==="time"||!n&&V1e(t)}function V1e(t){return t&&(t.type==="temporal"||ti(t)&&!!t.timeUnit)}function y3(t,{timeUnit:n,type:e,wrapTime:o,undefinedIfExprNotRequired:f}){var r;const a=n&&((r=Gl(n))===null||r===void 0?void 0:r.unit);let u=a||e==="temporal",c;return ix(t)?c=t.expr:Vi(t)?c=t.signal:Q0(t)?(u=!0,c=dy(t)):(bi(t)||wo(t))&&u&&(c=`datetime(${No(t)})`,Ime(a)&&(wo(t)&&t<1e4||bi(t)&&isNaN(Date.parse(t)))&&(c=dy({[a]:t}))),c?o&&u?`time(${c})`:c:f?void 0:No(t)}function NV(t,n){const{type:e}=t;return n.map(o=>{const f=y3(o,{timeUnit:ti(t)?t.timeUnit:void 0,type:e,undefinedIfExprNotRequired:!0});return f!==void 0?{signal:f}:o})}function ux(t,n){return Bo(t.bin)?bp(n)&&["ordinal","nominal"].includes(t.type):(console.warn("Only call this method for binned field defs."),!1)}const cP={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function cx(t){return t?.condition}const BV=["domain","grid","labels","ticks","title"],q1e={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},jV={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},H1e=Object.assign(Object.assign({},jV),{style:1,labelExpr:1,encoding:1});function fP(t){return!!H1e[t]}const $1e={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},UV=Xr($1e);function id(t){return"mark"in t}class x3{constructor(n,e){this.name=n,this.run=e}hasMatchingType(n){return id(n)?_1e(n.mark)===this.name:!1}}var G1e=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f!!o.field):ti(e)||m3(e):!1}function VV(t,n){const e=t&&t[n];return e?Ir(e)?L0(e,o=>!!o.field):ti(e)||mh(e)||lx(e):!1}function $T(t,n){if(sl(n)){const e=t[n];if((ti(e)||mh(e))&&uV(e.type)){const o=DU(n);return VV(t,o)}}return!1}function i8(t){return L0($0e,n=>{if(y0(t,n)){const e=t[n];if(Ir(e))return L0(e,o=>!!o.aggregate);{const o=th(e);return o&&!!o.aggregate}}return!1})}function qV(t,n){const e=[],o=[],f=[],r=[],a={};return a8(t,(u,c)=>{if(ti(u)){const{field:i,aggregate:s,bin:l,timeUnit:d}=u,h=G1e(u,["field","aggregate","bin","timeUnit"]);if(s||d||l){const m=t8(u),g=m?.title;let p=hi(u,{forAs:!0});const v=Object.assign(Object.assign(Object.assign({},g?[]:{title:am(u,n,{allowDisabling:!0})}),h),{field:p});if(s){let y;if(_p(s)?(y="argmax",p=hi({op:"argmax",field:s.argmax},{forAs:!0}),v.field=`${p}.${i}`):Xh(s)?(y="argmin",p=hi({op:"argmin",field:s.argmin},{forAs:!0}),v.field=`${p}.${i}`):s!=="boxplot"&&s!=="errorbar"&&s!=="errorband"&&(y=s),y){const x={op:y,as:p};i&&(x.field=i),r.push(x)}}else if(e.push(p),wc(u)&&Bo(l)){if(o.push({bin:l,field:i,as:p}),e.push(hi(u,{binSuffix:"end"})),ux(u,c)&&e.push(hi(u,{binSuffix:"range"})),sl(c)){const y={field:`${p}_end`};a[`${c}2`]=y}v.bin="binned",PU(c)||(v.type=z0)}else if(d){f.push({timeUnit:d,field:i,as:p});const y=wc(u)&&u.type!==Em&&"time";y&&(c===tx||c===D0?v.formatType=y:tge(c)?v.legend=Object.assign({formatType:y},v.legend):sl(c)&&(v.axis=Object.assign({formatType:y},v.axis)))}a[c]=v}else e.push(i),a[c]=t[c]}else a[c]=t[c]}),{bins:o,timeUnits:f,aggregate:r,groupby:e,encoding:a}}function W1e(t,n,e){const o=rge(n,e);if(o){if(o==="binned"){const f=t[n===yf?cs:ol];return!!(ti(f)&&ti(t[n])&&xl(f.bin))}}else return!1;return!0}function Y1e(t,n,e,o){const f={};for(const r of Xr(t))LU(r)||Kr(Gge(r));for(let r of J0e){if(!t[r])continue;const a=t[r];if(t1(r)){const u=IU(r),c=f[u];if(ti(c)){if(Hme(c.type)&&ti(a)){Kr(Nge(u));continue}}else r=u,Kr(Bge(u))}if(r==="angle"&&n==="arc"&&!t.theta&&(Kr(Fge),r=Tc),!W1e(t,r,n)){Kr(l3(r,n));continue}if(r===nd&&n==="line"){const u=th(t[r]);if(u?.aggregate){Kr(Hge);continue}}if(r===zu&&(e?"fill"in t:"stroke"in t)){Kr(JU("encoding",{fill:"fill"in t,stroke:"stroke"in t}));continue}if(r===rx||r===nx&&!Ir(a)&&!pf(a)||r===D0&&Ir(a))a&&(f[r]=ki(a).reduce((u,c)=>(ti(c)?u.push(r8(c,r)):Kr(BT(c,r)),u),[]));else{if(r===D0&&a===null)f[r]=null;else if(!ti(a)&&!mh(a)&&!pf(a)&&!g3(a)&&!Vi(a)){Kr(BT(a,r));continue}f[r]=FV(a,r,o)}}return f}function b3(t,n){const e={};for(const o of Xr(t)){const f=FV(t[o],o,n,{compositeMark:!0});e[o]=f}return e}function X1e(t){const n=[];for(const e of Xr(t))if(y0(t,e)){const o=t[e],f=ki(o);for(const r of f)ti(r)?n.push(r):m3(r)&&n.push(r.condition)}return n}function a8(t,n,e){if(!!t)for(const o of Xr(t)){const f=t[o];if(Ir(f))for(const r of f)n.call(e,r,o);else n.call(e,f,o)}}function Z1e(t,n,e,o){return t?Xr(t).reduce((f,r)=>{const a=t[r];return Ir(a)?a.reduce((u,c)=>n.call(o,u,c,r),f):n.call(o,f,a,r)},e):e}function HV(t,n){return Xr(n).reduce((e,o)=>{switch(o){case cs:case ol:case n3:case i3:case r3:case yf:case uh:case gp:case e1:case Tc:case td:case xf:case ed:case ch:case fh:case bf:case _c:case tx:case Ru:case Z0:case D0:return e;case nx:if(t==="line"||t==="trail")return e;case rx:case t3:{const f=n[o];if(Ir(f)||ti(f))for(const r of ki(f))r.aggregate||e.push(hi(r,{}));return e}case nd:if(t==="trail")return e;case zu:case hh:case dh:case rd:case mp:case vp:case xp:case yp:{const f=th(n[o]);return f&&!f.aggregate&&e.push(hi(f,{})),e}}},[])}var $V=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f{const c=o?` of ${o8(n)}`:"";return{field:a+n.field,type:n.type,title:Vi(u)?{signal:`${u}"${escape(c)}"`}:u+c}}),r=X1e(e).map(P1e);return{tooltip:[...f,...Vf(r,Ba)]}}function o8(t){const{title:n,field:e}=t;return Rs(n,e)}function s8(t,n,e,o,f){const{scale:r,axis:a}=e;return({partName:u,mark:c,positionPrefix:i,endPositionPrefix:s=void 0,extraEncoding:l={}})=>{const d=o8(e);return GV(t,u,f,{mark:c,encoding:Object.assign(Object.assign(Object.assign({[n]:Object.assign(Object.assign(Object.assign({field:`${i}_${e.field}`,type:e.type},d!==void 0?{title:d}:{}),r!==void 0?{scale:r}:{}),a!==void 0?{axis:a}:{})},bi(s)?{[`${n}2`]:{field:`${s}_${e.field}`}}:{}),o),l)})}}function GV(t,n,e,o){const{clip:f,color:r,opacity:a}=t,u=t.type;return t[n]||t[n]===void 0&&e[n]?[Object.assign(Object.assign({},o),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e[n]),f?{clip:f}:{}),r?{color:r}:{}),a?{opacity:a}:{}),eh(o.mark)?o.mark:{type:o.mark}),{style:`${u}-${String(n)}`}),fp(t[n])?{}:t[n])})]:[]}function WV(t,n,e){const{encoding:o}=t,f=n==="vertical"?"y":"x",r=o[f],a=o[`${f}2`],u=o[`${f}Error`],c=o[`${f}Error2`];return{continuousAxisChannelDef:Tb(r,e),continuousAxisChannelDef2:Tb(a,e),continuousAxisChannelDefError:Tb(u,e),continuousAxisChannelDefError2:Tb(c,e),continuousAxis:f}}function Tb(t,n){if(t?.aggregate){const{aggregate:e}=t,o=$V(t,["aggregate"]);return e!==n&&Kr(bme(e,n)),o}else return t}function YV(t,n){const{mark:e,encoding:o}=t,{x:f,y:r}=o;if(eh(e)&&e.orient)return e.orient;if(qf(f)){if(qf(r)){const a=ti(f)&&f.aggregate,u=ti(r)&&r.aggregate;if(!a&&u===n)return"vertical";if(!u&&a===n)return"horizontal";if(a===n&&u===n)throw new Error("Both x and y cannot have aggregate");return Pm(r)&&!Pm(f)?"horizontal":"vertical"}return"horizontal"}else{if(qf(r))return"vertical";throw new Error(`Need a valid continuous axis for ${n}s`)}}var u_=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);fs8(i,y,v,ue,n.boxplot),D=E(S),O=E(k),R=E(Object.assign(Object.assign({},S),A?{size:A}:{})),z=GT([{fieldPrefix:h==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:h==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],v,k),L={type:"tick",color:"black",opacity:1,orient:b,invalid:d,aria:!1},P=h==="min-max"?z:GT([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],v,k),N=[...D({partName:"rule",mark:{type:"rule",invalid:d,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:P}),...D({partName:"rule",mark:{type:"rule",invalid:d,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:P}),...D({partName:"ticks",mark:L,positionPrefix:"lower_whisker",extraEncoding:P}),...D({partName:"ticks",mark:L,positionPrefix:"upper_whisker",extraEncoding:P})],B=[...h!=="tukey"?N:[],...O({partName:"box",mark:Object.assign(Object.assign({type:"bar"},l?{size:l}:{}),{orient:T,invalid:d,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:z}),...R({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:d},Ei(n.boxplot.median)&&n.boxplot.median.color?{color:n.boxplot.median.color}:{}),l?{size:l}:{}),{orient:b,aria:!1}),positionPrefix:"mid_box",extraEncoding:z})];if(h==="min-max")return Object.assign(Object.assign({},c),{transform:((o=c.transform)!==null&&o!==void 0?o:[]).concat(p),layer:B});const G=`datum["lower_box_${v.field}"]`,W=`datum["upper_box_${v.field}"]`,K=`(${W} - ${G})`,te=`${G} - ${s} * ${K}`,Y=`${W} + ${s} * ${K}`,Z=`datum["${v.field}"]`,re={joinaggregate:JV(v.field),groupby:x},U={transform:[{filter:`(${te} <= ${Z}) && (${Z} <= ${Y})`},{aggregate:[{op:"min",field:v.field,as:`lower_whisker_${v.field}`},{op:"max",field:v.field,as:`upper_whisker_${v.field}`},{op:"min",field:`lower_box_${v.field}`,as:`lower_box_${v.field}`},{op:"max",field:`upper_box_${v.field}`,as:`upper_box_${v.field}`},...w],groupby:x}],layer:N},q=u_(S,["tooltip"]),{scale:$,axis:ne}=v,H=o8(v),Q=Eu(ne,["title"]),ee=GV(i,"outliers",n.boxplot,{transform:[{filter:`(${Z} < ${te}) || (${Z} > ${Y})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[y]:Object.assign(Object.assign(Object.assign({field:v.field,type:v.type},H!==void 0?{title:H}:{}),$!==void 0?{scale:$}:{}),_o(Q)?{}:{axis:Q})},q),M?{color:M}:{}),_?{tooltip:_}:{})})[0];let ie;const ae=[...m,...g,re];return ee?ie={transform:ae,layer:[ee,U]}:(ie=U,ie.transform.unshift(...ae)),Object.assign(Object.assign({},c),{layer:[ie,{transform:p,layer:B}]})}function JV(t){return[{op:"q1",field:t,as:`lower_box_${t}`},{op:"q3",field:t,as:`upper_box_${t}`}]}function eve(t,n,e){const o=YV(t,L2),{continuousAxisChannelDef:f,continuousAxis:r}=WV(t,o,L2),a=f.field,u=XV(n),c=[...JV(a),{op:"median",field:a,as:`mid_box_${a}`},{op:"min",field:a,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:a,as:(u==="min-max"?"upper_whisker_":"max_")+a}],i=u==="min-max"||u==="tukey"?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${n}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${n}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],s=t.encoding,l=r;s[l];const d=u_(s,[typeof l=="symbol"?l:l+""]),{customTooltipWithoutAggregatedField:h,filteredEncoding:m}=J1e(d),{bins:g,timeUnits:p,aggregate:v,groupby:y,encoding:x}=qV(m,e),w=o==="vertical"?"horizontal":"vertical",k=o,b=[...g,...p,{aggregate:[...v,...c],groupby:y},...i];return{bins:g,timeUnits:p,transform:b,groupby:y,aggregate:v,continuousAxisChannelDef:f,continuousAxis:r,encodingWithoutContinuousAxis:x,ticksOrient:w,boxOrient:k,customTooltipWithoutAggregatedField:h}}var hP=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f1?{layer:m}:Object.assign({},m[0]))}function rve(t,n){const{encoding:e}=t;if(ive(e))return{orient:YV(t,n),inputType:"raw"};const o=ave(e),f=ove(e),r=e.x,a=e.y;if(o){if(f)throw new Error(`${n} cannot be both type aggregated-upper-lower and aggregated-error`);const u=e.x2,c=e.y2;if(la(u)&&la(c))throw new Error(`${n} cannot have both x2 and y2`);if(la(u)){if(qf(r))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${n}`)}else if(la(c)){if(qf(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${n}`)}throw new Error("No ranged axis")}else{const u=e.xError,c=e.xError2,i=e.yError,s=e.yError2;if(la(c)&&!la(u))throw new Error(`${n} cannot have xError2 without xError`);if(la(s)&&!la(i))throw new Error(`${n} cannot have yError2 without yError`);if(la(u)&&la(i))throw new Error(`${n} cannot have both xError and yError with both are quantiative`);if(la(u)){if(qf(r))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(la(i)){if(qf(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function ive(t){return(la(t.x)||la(t.y))&&!la(t.x2)&&!la(t.y2)&&!la(t.xError)&&!la(t.xError2)&&!la(t.yError)&&!la(t.yError2)}function ave(t){return la(t.x2)||la(t.y2)}function ove(t){return la(t.xError)||la(t.xError2)||la(t.yError)||la(t.yError2)}function QV(t,n,e){var o;const{mark:f,encoding:r,params:a,projection:u}=t,c=hP(t,["mark","encoding","params","projection"]),i=eh(f)?f:{type:f};a&&Kr(XU(n));const{orient:s,inputType:l}=rve(t,n),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:m,continuousAxisChannelDefError2:g,continuousAxis:p}=WV(t,s,n),{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:x,tooltipTitleWithFieldName:w}=sve(i,d,h,m,g,l,n,e),k=r,b=p;k[b];const T=p==="x"?"x2":"y2";k[T];const _=p==="x"?"xError":"yError";k[_];const M=p==="x"?"xError2":"yError2";k[M];const A=hP(k,[typeof b=="symbol"?b:b+"",typeof T=="symbol"?T:T+"",typeof _=="symbol"?_:_+"",typeof M=="symbol"?M:M+""]),{bins:S,timeUnits:E,aggregate:D,groupby:O,encoding:R}=qV(A,e),z=[...D,...v],L=l!=="raw"?[]:O,P=GT(x,d,R,w);return{transform:[...(o=c.transform)!==null&&o!==void 0?o:[],...S,...E,...z.length===0?[]:[{aggregate:z,groupby:L}],...y],groupby:L,continuousAxisChannelDef:d,continuousAxis:p,encodingWithoutContinuousAxis:R,ticksOrient:s==="vertical"?"horizontal":"vertical",markDef:i,outerSpec:c,tooltipEncoding:P}}function sve(t,n,e,o,f,r,a,u){let c=[],i=[];const s=n.field;let l,d=!1;if(r==="raw"){const h=t.center?t.center:t.extent?t.extent==="iqr"?"median":"mean":u.errorbar.center,m=t.extent?t.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(m==="iqr")&&Kr(xme(h,m,a)),m==="stderr"||m==="stdev")c=[{op:m,field:s,as:`extent_${s}`},{op:h,field:s,as:`center_${s}`}],i=[{calculate:`datum["center_${s}"] + datum["extent_${s}"]`,as:`upper_${s}`},{calculate:`datum["center_${s}"] - datum["extent_${s}"]`,as:`lower_${s}`}],l=[{fieldPrefix:"center_",titlePrefix:Qy(h)},{fieldPrefix:"upper_",titlePrefix:dP(h,m,"+")},{fieldPrefix:"lower_",titlePrefix:dP(h,m,"-")}],d=!0;else{let g,p,v;m==="ci"?(g="mean",p="ci0",v="ci1"):(g="median",p="q1",v="q3"),c=[{op:p,field:s,as:`lower_${s}`},{op:v,field:s,as:`upper_${s}`},{op:g,field:s,as:`center_${s}`}],l=[{fieldPrefix:"upper_",titlePrefix:am({field:s,aggregate:v,type:"quantitative"},u,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:am({field:s,aggregate:p,type:"quantitative"},u,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:am({field:s,aggregate:g,type:"quantitative"},u,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&Kr(yme(t.center,t.extent)),r==="aggregated-upper-lower"?(l=[],i=[{calculate:`datum["${e.field}"]`,as:`upper_${s}`},{calculate:`datum["${s}"]`,as:`lower_${s}`}]):r==="aggregated-error"&&(l=[{fieldPrefix:"",titlePrefix:s}],i=[{calculate:`datum["${s}"] + datum["${o.field}"]`,as:`upper_${s}`}],f?i.push({calculate:`datum["${s}"] + datum["${f.field}"]`,as:`lower_${s}`}):i.push({calculate:`datum["${s}"] - datum["${o.field}"]`,as:`lower_${s}`}));for(const h of i)l.push({fieldPrefix:h.as.substring(0,6),titlePrefix:P0(P0(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:i,errorBarSpecificAggregate:c,tooltipSummary:l,tooltipTitleWithFieldName:d}}function dP(t,n,e){return`${Qy(t)} ${e} ${n}`}const u8="errorband",lve=["band","borders"],uve=new x3(u8,eq);function eq(t,{config:n}){t=Object.assign(Object.assign({},t),{encoding:b3(t.encoding,n)});const{transform:e,continuousAxisChannelDef:o,continuousAxis:f,encodingWithoutContinuousAxis:r,markDef:a,outerSpec:u,tooltipEncoding:c}=QV(t,u8,n),i=a,s=s8(i,f,o,r,n.errorband),l=t.encoding.x!==void 0&&t.encoding.y!==void 0;let d={type:l?"area":"rect"},h={type:l?"line":"rule"};const m=Object.assign(Object.assign({},i.interpolate?{interpolate:i.interpolate}:{}),i.tension&&i.interpolate?{tension:i.tension}:{});return l?(d=Object.assign(Object.assign(Object.assign({},d),m),{ariaRoleDescription:"errorband"}),h=Object.assign(Object.assign(Object.assign({},h),m),{aria:!1})):i.interpolate?Kr(iP("interpolate")):i.tension&&Kr(iP("tension")),Object.assign(Object.assign({},u),{transform:e,layer:[...s({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c}),...s({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:c}),...s({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:c})]})}const tq={};function c8(t,n,e){const o=new x3(t,n);tq[t]={normalizer:o,parts:e}}function cve(){return Xr(tq)}c8(L2,ZV,K1e);c8(l8,KV,tve);c8(u8,eq,lve);const fve=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],nq={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},rq={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},hve=Xr(nq),dve=Xr(rq),pve={header:1,headerRow:1,headerColumn:1,headerFacet:1},iq=Xr(pve),aq=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],gve={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},mve={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},nh="_vgsid_",vve={point:{on:"click",fields:[nh],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function f8(t){return t==="legend"||!!t?.legend}function O4(t){return f8(t)&&Ei(t)}function h8(t){return!!t?.select}var yve=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);fthis.mapLayerOrUnit(o,e))})}mapHConcat(n,e){return Object.assign(Object.assign({},n),{hconcat:n.hconcat.map(o=>this.map(o,e))})}mapVConcat(n,e){return Object.assign(Object.assign({},n),{vconcat:n.vconcat.map(o=>this.map(o,e))})}mapConcat(n,e){const{concat:o}=n,f=Bve(n,["concat"]);return Object.assign(Object.assign({},f),{concat:o.map(r=>this.map(r,e))})}mapFacet(n,e){return Object.assign(Object.assign({},n),{spec:this.map(n.spec,e)})}mapRepeat(n,e){return Object.assign(Object.assign({},n),{spec:this.map(n.spec,e)})}}const jve={zero:1,center:1,normalize:1};function Uve(t){return t in jve}const Vve=new Set([mV,c3,u3,M2,h3,WE,YE,f3,vV,GE]),qve=new Set([c3,u3,mV]);function jg(t){return ti(t)&&Om(t)==="quantitative"&&!t.bin}function yP(t,n){var e,o;const f=n==="x"?"y":"radius",r=t[n],a=t[f];if(ti(r)&&ti(a))if(jg(r)&&jg(a)){if(r.stack)return n;if(a.stack)return f;const u=ti(r)&&!!r.aggregate,c=ti(a)&&!!a.aggregate;if(u!==c)return u?n:f;{const i=(e=r.scale)===null||e===void 0?void 0:e.type,s=(o=a.scale)===null||o===void 0?void 0:o.type;if(i&&i!=="linear")return f;if(s&&s!=="linear")return n}}else{if(jg(r))return n;if(jg(a))return f}else{if(jg(r))return n;if(jg(a))return f}}function Hve(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function fq(t,n){var e,o;const f=eh(t)?t.type:t;if(!Vve.has(f))return null;const r=yP(n,"x")||yP(n,"theta");if(!r)return null;const a=n[r],u=ti(a)?hi(a,{}):void 0,c=Hve(r),i=[],s=new Set;if(n[c]){const h=n[c],m=ti(h)?hi(h,{}):void 0;m&&m!==u&&(i.push(c),s.add(m));const g=c==="x"?"xOffset":"yOffset",p=n[g],v=ti(p)?hi(p,{}):void 0;v&&v!==u&&(i.push(g),s.add(v))}const l=K0e.reduce((h,m)=>{if(m!=="tooltip"&&y0(n,m)){const g=n[m];for(const p of ki(g)){const v=th(p);if(v.aggregate)continue;const y=hi(v,{});(!y||!s.has(y))&&h.push({channel:m,fieldDef:v})}}return h},[]);let d;return a.stack!==void 0?fp(a.stack)?d=a.stack?"zero":null:d=a.stack:qve.has(f)&&(d="zero"),!d||!Uve(d)||i8(n)&&l.length===0?null:((e=a?.scale)===null||e===void 0?void 0:e.type)&&((o=a?.scale)===null||o===void 0?void 0:o.type)!==Cu.LINEAR?(Kr(gme(a.scale.type)),null):la(n[ph(r)])?(a.stack!==void 0&&Kr(pme(r)),null):(ti(a)&&a.aggregate&&!cge.has(a.aggregate)&&Kr(mme(a.aggregate)),{groupbyChannels:i,groupbyFields:s,fieldChannel:r,impute:a.impute===null?!1:kp(f),stackBy:l,offset:d})}var hq=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f1?n:n.type}function Gve(t){for(const n of["line","area","rule","trail"])t[n]&&(t=Object.assign(Object.assign({},t),{[n]:Eu(t[n],["point","line"])}));return t}function L4(t,n={},e){return t.point==="transparent"?{opacity:0}:t.point?Ei(t.point)?t.point:{}:t.point!==void 0?null:n.point||e.shape?Ei(n.point)?n.point:{}:void 0}function xP(t,n={}){return t.line?t.line===!0?{}:t.line:t.line!==void 0?null:n.line?n.line===!0?{}:n.line:void 0}class Wve{constructor(){this.name="path-overlay"}hasMatchingType(n,e){if(id(n)){const{mark:o,encoding:f}=n,r=eh(o)?o:{type:o};switch(r.type){case"line":case"rule":case"trail":return!!L4(r,e[r.type],f);case"area":return!!L4(r,e[r.type],f)||!!xP(r,e[r.type])}}return!1}run(n,e,o){const{config:f}=e,{params:r,projection:a,mark:u,encoding:c}=n,i=hq(n,["params","projection","mark","encoding"]),s=b3(c,f),l=eh(u)?u:{type:u},d=L4(l,f[l.type],s),h=l.type==="area"&&xP(l,f[l.type]),m=[Object.assign(Object.assign({},r?{params:r}:{}),{mark:$ve(Object.assign(Object.assign({},l.type==="area"&&l.opacity===void 0&&l.fillOpacity===void 0?{opacity:.7}:{}),l)),encoding:Eu(s,["shape"])})],g=fq(l,s);let p=s;if(g){const{fieldChannel:v,offset:y}=g;p=Object.assign(Object.assign({},s),{[v]:Object.assign(Object.assign({},s[v]),y?{stack:y}:{})})}return p=Eu(p,["y2","x2"]),h&&m.push(Object.assign(Object.assign({},a?{projection:a}:{}),{mark:Object.assign(Object.assign({type:"line"},Am(l,["clip","interpolate","tension","tooltip"])),h),encoding:p})),d&&m.push(Object.assign(Object.assign({},a?{projection:a}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},Am(l,["clip","tooltip"])),d),encoding:p})),o(Object.assign(Object.assign({},i),{layer:m}),Object.assign(Object.assign({},e),{config:Gve(f)}))}}var Yve=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f_P(r,n)).filter(r=>r);else{const r=_P(f,n);r!==void 0&&(e[o]=r)}}return e}class Zve{constructor(){this.name="RuleForRangedLine"}hasMatchingType(n){if(id(n)){const{encoding:e,mark:o}=n;if(o==="line"||eh(o)&&o.type==="line")for(const f of X0e){const r=J0(f),a=e[r];if(e[f]&&(ti(a)&&!xl(a.bin)||mh(a)))return!0}}return!1}run(n,e,o){const{encoding:f,mark:r}=n;return Kr(Jge(!!f.x2,!!f.y2)),o(Object.assign(Object.assign({},n),{mark:Ei(r)?Object.assign(Object.assign({},r),{type:"rule"}):"rule"}),e)}}var vd=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f{const d=Object.assign(Object.assign({},i),{layer:l}),h=`${(f.name||"")+s}child__layer_${Xo(l)}`,m=this.mapLayerOrUnit(f,Object.assign(Object.assign({},e),{repeater:d,repeaterPrefix:h}));return m.name=h,m})})}mapNonLayerRepeat(n,e){var o;const{repeat:f,spec:r,data:a}=n,u=vd(n,["repeat","spec","data"]);!Ir(f)&&n.columns&&(n=Eu(n,["columns"]),Kr(eP("repeat")));const c=[],{repeater:i={},repeaterPrefix:s=""}=e,l=!Ir(f)&&f.row||[i?i.row:null],d=!Ir(f)&&f.column||[i?i.column:null],h=Ir(f)&&f||[i?i.repeat:null];for(const g of h)for(const p of l)for(const v of d){const y={repeat:g,row:p,column:v,layer:i.layer},x=(r.name||"")+s+"child__"+(Ir(f)?`${Xo(g)}`:(f.row?`row_${Xo(p)}`:"")+(f.column?`column_${Xo(v)}`:"")),w=this.map(r,Object.assign(Object.assign({},e),{repeater:y,repeaterPrefix:x}));w.name=x,c.push(Eu(w,["data"]))}const m=Ir(f)?n.columns:f.column?f.column.length:1;return Object.assign(Object.assign({data:(o=r.data)!==null&&o!==void 0?o:a,align:"all"},u),{columns:m,concat:c})}mapFacet(n,e){const{facet:o}=n;return sx(o)&&n.columns&&(n=Eu(n,["columns"]),Kr(eP("facet"))),super.mapFacet(n,e)}mapUnitWithParentEncodingOrProjection(n,e){const{encoding:o,projection:f}=n,{parentEncoding:r,parentProjection:a,config:u}=e,c=kP({parentProjection:a,projection:f}),i=wP({parentEncoding:r,encoding:P4(o,e.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},n),c?{projection:c}:{}),i?{encoding:i}:{}),{config:u})}mapFacetedUnit(n,e){const o=n.encoding,{row:f,column:r,facet:a}=o,u=vd(o,["row","column","facet"]),{mark:c,width:i,projection:s,height:l,view:d,params:h,encoding:m}=n,g=vd(n,["mark","width","projection","height","view","params","encoding"]),{facetMapping:p,layout:v}=this.getFacetMappingAndLayout({row:f,column:r,facet:a},e),y=P4(u,e.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},g),v),{facet:p,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i?{width:i}:{}),l?{height:l}:{}),d?{view:d}:{}),s?{projection:s}:{}),{mark:c,encoding:y}),h?{params:h}:{})}),e)}getFacetMappingAndLayout(n,e){var o;const{row:f,column:r,facet:a}=n;if(f||r){a&&Kr(Xge([...f?[Vh]:[],...r?[qh]:[]]));const u={},c={};for(const i of[Vh,qh]){const s=n[i];if(s){const l=vd(s,["align","center","spacing","columns"]);u[i]=l;for(const d of["align","center","spacing"])s[d]!==void 0&&((o=c[d])!==null&&o!==void 0||(c[d]={}),c[d][i]=s[d])}}return{facetMapping:u,layout:c}}else{const{align:u,center:c,spacing:i,columns:s}=a,l=vd(a,["align","center","spacing","columns"]);return{facetMapping:Xve(l,e.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},u?{align:u}:{}),c?{center:c}:{}),i?{spacing:i}:{}),s?{columns:s}:{})}}}mapLayer(n,e){var{parentEncoding:o,parentProjection:f}=e,r=vd(e,["parentEncoding","parentProjection"]);const{encoding:a,projection:u}=n,c=vd(n,["encoding","projection"]),i=Object.assign(Object.assign({},r),{parentEncoding:wP({parentEncoding:o,encoding:a,layer:!0}),parentProjection:kP({parentProjection:f,projection:u})});return super.mapLayer(c,i)}}function wP({parentEncoding:t,encoding:n={},layer:e}){let o={};if(t){const f=new Set([...Xr(t),...Xr(n)]);for(const r of f){const a=n[r],u=t[r];if(la(a)){const c=Object.assign(Object.assign({},u),a);o[r]=c}else lx(a)?o[r]=Object.assign(Object.assign({},a),{condition:Object.assign(Object.assign({},u),a.condition)}):a||a===null?o[r]=a:(e||pf(u)||Vi(u)||la(u)||Ir(u))&&(o[r]=u)}}else o=n;return!o||_o(o)?void 0:o}function kP(t){const{parentProjection:n,projection:e}=t;return n&&e&&Kr(Rge({parentProjection:n,projection:e})),e??n}function m8(t){return"filter"in t}function Kve(t){return t?.stop!==void 0}function gq(t){return"lookup"in t}function Qve(t){return"data"in t}function eye(t){return"param"in t}function tye(t){return"pivot"in t}function nye(t){return"density"in t}function rye(t){return"quantile"in t}function iye(t){return"regression"in t}function aye(t){return"loess"in t}function oye(t){return"sample"in t}function sye(t){return"window"in t}function lye(t){return"joinaggregate"in t}function uye(t){return"flatten"in t}function cye(t){return"calculate"in t}function mq(t){return"bin"in t}function fye(t){return"impute"in t}function hye(t){return"timeUnit"in t}function dye(t){return"aggregate"in t}function pye(t){return"stack"in t}function gye(t){return"fold"in t}function mye(t){return t.map(n=>m8(n)?{filter:rm(n.filter,qme)}:n)}var Hd=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f{var c;const i=u,{init:s,bind:l,empty:d}=i,h=Hd(i,["init","bind","empty"]);h.type==="single"?(h.type="point",h.toggle=!1):h.type==="multi"&&(h.type="point"),e.emptySelections[a]=d!=="none";for(const m of ql((c=e.selectionPredicates[a])!==null&&c!==void 0?c:{}))m.empty=d!=="none";return{name:a,value:s,select:h,bind:l}})}):n}}function TP(t,n){const{transform:e}=t,o=Hd(t,["transform"]);if(e){const f=e.map(r=>{if(m8(r))return{filter:XT(r,n)};if(mq(r)&&K0(r.bin))return Object.assign(Object.assign({},r),{bin:yq(r.bin)});if(gq(r)){const a=r.from,{selection:u}=a,c=Hd(a,["selection"]);return u?Object.assign(Object.assign({},r),{from:Object.assign({param:u},c)}):r}return r});return Object.assign(Object.assign({},o),{transform:f})}return t}function vq(t,n){var e,o;const f=ha(t);if(ti(f)&&K0(f.bin)&&(f.bin=yq(f.bin)),eg(f)&&((o=(e=f.scale)===null||e===void 0?void 0:e.domain)===null||o===void 0?void 0:o.selection)){const r=f.scale.domain,{selection:a}=r,u=Hd(r,["selection"]);f.scale.domain=Object.assign(Object.assign({},u),a?{param:a}:{})}if(g3(f))if(Ir(f.condition))f.condition=f.condition.map(r=>{const{selection:a,param:u,test:c}=r,i=Hd(r,["selection","param","test"]);return u?r:Object.assign(Object.assign({},i),{test:XT(r,n)})});else{const r=vq(f.condition,n),{selection:a,param:u,test:c}=r,i=Hd(r,["selection","param","test"]);f.condition=u?f.condition:Object.assign(Object.assign({},i),{test:XT(f.condition,n)})}return f}function yq(t){const n=t.extent;if(n?.selection){const{selection:e}=n,o=Hd(n,["selection"]);return Object.assign(Object.assign({},t),{extent:Object.assign(Object.assign({},o),{param:e})})}return t}function XT(t,n){const e=o=>rm(o,f=>{var r,a,u;const c=(r=n.emptySelections[f])!==null&&r!==void 0?r:!0,i={param:f,empty:c};return(a=(u=n.selectionPredicates)[f])!==null&&a!==void 0||(u[f]=[]),n.selectionPredicates[f].push(i),i});return t.selection?e(t.selection):rm(t.test||t.filter,o=>o.selection?e(o.selection):o)}class ZT extends g8{map(n,e){var o;const f=(o=e.selections)!==null&&o!==void 0?o:[];if(n.params&&!id(n)){const r=[];for(const a of n.params)h8(a)?f.push(a):r.push(a);n.params=r}return e.selections=f,super.map(n,xq(n,e))}mapUnit(n,e){var o;const f=e.selections;if(!f||!f.length)return n;const r=((o=e.path)!==null&&o!==void 0?o:[]).concat(n.name),a=[];for(const u of f)if(!u.views||!u.views.length)a.push(u);else for(const c of u.views)(bi(c)&&(c===n.name||r.indexOf(c)>=0)||Ir(c)&&c.map(i=>r.indexOf(i)).every((i,s,l)=>i!==-1&&(s===0||i>l[s-1])))&&a.push(u);return a.length&&(n.params=a),n}}for(const t of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const n=ZT.prototype[t];ZT.prototype[t]=function(e,o){return n.call(this,e,xq(e,o))}}function xq(t,n){var e;return t.name?Object.assign(Object.assign({},n),{path:((e=n.path)!==null&&e!==void 0?e:[]).concat(t.name)}):n}function bq(t,n){n===void 0&&(n=cq(t.config));const e=_ye(t,n),{width:o,height:f}=t,r=wye(e,{width:o,height:f,autosize:t.autosize},n);return Object.assign(Object.assign({},e),r?{autosize:r}:{})}const yye=new Jve,xye=new vye,bye=new ZT;function _ye(t,n={}){const e={config:n};return bye.map(yye.map(xye.map(t,e),e),e)}function AP(t){return bi(t)?{type:t}:t??{}}function wye(t,n,e){let{width:o,height:f}=n;const r=id(t)||w3(t),a={};r?o=="container"&&f=="container"?(a.type="fit",a.contains="padding"):o=="container"?(a.type="fit-x",a.contains="padding"):f=="container"&&(a.type="fit-y",a.contains="padding"):(o=="container"&&(Kr(ZL("width")),o=void 0),f=="container"&&(Kr(ZL("height")),f=void 0));const u=Object.assign(Object.assign(Object.assign({type:"pad"},a),e?AP(e.autosize):{}),AP(t.autosize));if(u.type==="fit"&&!r&&(Kr(bge),u.type="pad"),o=="container"&&!(u.type=="fit"||u.type=="fit-x")&&Kr(JL("width")),f=="container"&&!(u.type=="fit"||u.type=="fit-y")&&Kr(JL("height")),!Uf(u,{type:"pad"}))return u}function kye(t){return t==="fit"||t==="fit-x"||t==="fit-y"}function Tye(t){return t?`fit-${a3(t)}`:"fit"}const Aye=["background","padding"];function MP(t,n){const e={};for(const o of Aye)t&&t[o]!==void 0&&(e[o]=Xu(t[o]));return n&&(e.params=t.params),e}class ad{constructor(n={},e={}){this.explicit=n,this.implicit=e}clone(){return new ad(ha(this.explicit),ha(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(n){return Rs(this.explicit[n],this.implicit[n])}getWithExplicit(n){return this.explicit[n]!==void 0?{explicit:!0,value:this.explicit[n]}:this.implicit[n]!==void 0?{explicit:!1,value:this.implicit[n]}:{explicit:!1,value:void 0}}setWithExplicit(n,{value:e,explicit:o}){e!==void 0&&this.set(n,e,o)}set(n,e,o){return delete this[o?"implicit":"explicit"][n],this[o?"explicit":"implicit"][n]=e,this}copyKeyFromSplit(n,{explicit:e,implicit:o}){e[n]!==void 0?this.set(n,e[n],!0):o[n]!==void 0&&this.set(n,o[n],!1)}copyKeyFromObject(n,e){e[n]!==void 0&&this.set(n,e[n],!0)}copyAll(n){for(const e of Xr(n.combine())){const o=n.getWithExplicit(e);this.setWithExplicit(e,o)}}}function If(t){return{explicit:!0,value:t}}function Gu(t){return{explicit:!1,value:t}}function _q(t){return(n,e,o,f)=>{const r=t(n.value,e.value);return r>0?n:r<0?e:k3(n,e,o,f)}}function k3(t,n,e,o){return t.explicit&&n.explicit&&Kr(sme(e,o,t.value,n.value)),t}function ap(t,n,e,o,f=k3){return t===void 0||t.value===void 0?n:t.explicit&&!n.explicit?t:n.explicit&&!t.explicit?n:Uf(t.value,n.value)?t:f(t,n,e,o)}class Mye extends ad{constructor(n={},e={},o=!1){super(n,e),this.explicit=n,this.implicit=e,this.parseNothing=o}clone(){const n=super.clone();return n.parseNothing=this.parseNothing,n}}function Dm(t){return"url"in t}function py(t){return"values"in t}function wq(t){return"name"in t&&!Dm(t)&&!py(t)&&!$d(t)}function $d(t){return t&&(kq(t)||Tq(t)||v8(t))}function kq(t){return"sequence"in t}function Tq(t){return"sphere"in t}function v8(t){return"graticule"in t}var Fo;(function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup"})(Fo||(Fo={}));var Sye=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);fN0(f,n,e));return n?`[${o.join(", ")}]`:o}else if(Q0(t))return e(n?dy(t):Pme(t));return n?e(No(t)):t}function Eye(t,n){var e;for(const o of ql((e=t.component.selection)!==null&&e!==void 0?e:{})){const f=o.name;let r=`${f}${lp}, ${o.resolve==="global"?"true":`{unit: ${Im(t)}}`}`;for(const a of A3)!a.defined(o)||(a.signals&&(n=a.signals(t,o,n)),a.modifyExpr&&(r=a.modifyExpr(t,o,r)));n.push({name:f+sxe,on:[{events:{signal:o.name+lp},update:`modify(${oi(o.name+B0)}, ${r})`}]})}return y8(n)}function Cye(t,n){if(t.component.selection&&Xr(t.component.selection).length){const e=oi(t.getName("cell"));n.unshift({name:"facet",value:{},on:[{events:pp("mousemove","scope"),update:`isTuple(facet) ? facet : group(${e}).datum`}]})}return y8(n)}function Oye(t,n){var e;let o=!1;for(const f of ql((e=t.component.selection)!==null&&e!==void 0?e:{})){const r=f.name,a=oi(r+B0);if(n.filter(c=>c.name===r).length===0){const c=f.resolve==="global"?"union":f.resolve,i=f.type==="point"?", true, true)":")";n.push({name:f.name,update:`${jq}(${a}, ${oi(c)}${i}`})}o=!0;for(const c of A3)c.defined(f)&&c.topLevelSignals&&(n=c.topLevelSignals(t,f,n))}return o&&n.filter(r=>r.name==="unit").length===0&&n.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]}),y8(n)}function Lye(t,n){var e;const o=[...n],f=Im(t,{escape:!1});for(const r of ql((e=t.component.selection)!==null&&e!==void 0?e:{})){const a={name:r.name+B0};if(r.project.hasSelectionId&&(a.transform=[{type:"collect",sort:{field:nh}}]),r.init){const c=r.project.items.map(i=>Sye(i,["signals"]));a.values=r.project.hasSelectionId?r.init.map(i=>({unit:f,[nh]:N0(i,!1)[0]})):r.init.map(i=>({unit:f,fields:c,values:N0(i,!1)}))}o.filter(c=>c.name===r.name+B0).length||o.push(a)}return o}function Aq(t,n){var e;for(const o of ql((e=t.component.selection)!==null&&e!==void 0?e:{}))for(const f of A3)f.defined(o)&&f.marks&&(n=f.marks(t,o,n));return n}function Pye(t,n){for(const e of t.children)Is(e)&&(n=Aq(e,n));return n}function Dye(t,n,e,o){const f=$q(t,n.param,n);return{signal:rc(e.get("type"))&&Ir(o)&&o[0]>o[1]?`isValid(${f}) && reverse(${f})`:f}}function y8(t){return t.map(n=>(n.on&&!n.on.length&&delete n.on,n))}class To{constructor(n,e){this.debugName=e,this._children=[],this._parent=null,n&&(this.parent=n)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(n){this._parent=n,n&&n.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(n,e){if(this._children.includes(n)){Kr(Dge);return}e!==void 0?this._children.splice(e,0,n):this._children.push(n)}removeChild(n){const e=this._children.indexOf(n);return this._children.splice(e,1),e}remove(){let n=this._parent.removeChild(this);for(const e of this._children)e._parent=this._parent,this._parent.addChild(e,n++)}insertAsParentOf(n){const e=n.parent;e.removeChild(this),this.parent=e,n.parent=this}swapWithParent(){const n=this._parent,e=n.parent;for(const f of this._children)f.parent=n;this._children=[],n.removeChild(this);const o=n.parent.removeChild(n);this._parent=e,e.addChild(this,o),n.parent=this}}class hu extends To{constructor(n,e,o,f){super(n,e),this.type=o,this.refCounts=f,this._source=this._name=e,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const n=new this.constructor;return n.debugName=`clone_${this.debugName}`,n._source=this._source,n._name=`clone_${this._name}`,n.type=this.type,n.refCounts=this.refCounts,n.refCounts[n._name]=0,n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${AU()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(n){this._source=n}}var SP=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f{const{field:a,timeUnit:u}=r;if(u){const c=hi(r,{forAs:!0});f[Ba({as:c,field:a,timeUnit:u})]={as:c,field:a,timeUnit:u}}return f},{});return _o(o)?null:new Yf(n,o)}static makeFromTransform(n,e){const o=Object.assign({},e),{timeUnit:f}=o,r=SP(o,["timeUnit"]),a=Gl(f),u=Object.assign(Object.assign({},r),{timeUnit:a});return new Yf(n,{[Ba(u)]:u})}merge(n){this.formula=Object.assign({},this.formula);for(const e in n.formula)this.formula[e]||(this.formula[e]=n.formula[e]);for(const e of n.children)n.removeChild(e),e.parent=this;n.remove()}removeFormulas(n){const e={};for(const[o,f]of rp(this.formula))n.has(f.as)||(e[o]=f);this.formula=e}producedFields(){return new Set(ql(this.formula).map(n=>n.as))}dependentFields(){return new Set(ql(this.formula).map(n=>n.field))}hash(){return`TimeUnit ${Ba(this.formula)}`}assemble(){const n=[];for(const e of ql(this.formula)){const{field:o,as:f,timeUnit:r}=e,a=Gl(r),{unit:u,utc:c}=a,i=SP(a,["unit","utc"]);n.push(Object.assign(Object.assign(Object.assign(Object.assign({field:bc(o),type:"timeunit"},u?{units:zE(u)}:{}),c?{timezone:"utc"}:{}),i),{as:[f,`${f}_end`]}))}return n}}var Iye=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f!0,parse:(t,n,e)=>{var o;const f=n.name,r=(o=n.project)!==null&&o!==void 0?o:n.project=new zye,a={},u={},c=new Set,i=(g,p)=>{const v=p==="visual"?g.channel:g.field;let y=Xo(`${f}_${v}`);for(let x=1;c.has(y);x++)y=Xo(`${f}_${v}_${x}`);return c.add(y),{[p]:y}},s=n.type,l=t.config.selection[s],d=e.value!==void 0?ki(e.value):null;let{fields:h,encodings:m}=Ei(e.select)?e.select:{};if(!h&&!m&&d){for(const g of d)if(!!Ei(g))for(const p of Xr(g))Y0e(p)?(m||(m=[])).push(p):s==="interval"?(Kr(Cge),m=l.encodings):(h||(h=[])).push(p)}!h&&!m&&(m=l.encodings,"fields"in l&&(h=l.fields));for(const g of m??[]){const p=t.fieldDef(g);if(p){let v=p.field;if(p.aggregate){Kr(_ge(g,p.aggregate));continue}else if(!v){Kr(QL(g));continue}if(p.timeUnit){v=t.vgField(g);const y={timeUnit:p.timeUnit,as:v,field:p.field};u[Ba(y)]=y}if(!a[v]){let y="E";if(s==="interval"){const w=t.getScaleComponent(g).get("type");rc(w)&&(y="R")}else p.bin&&(y="R-RE");const x={field:v,channel:g,type:y};x.signals=Object.assign(Object.assign({},i(x,"data")),i(x,"visual")),r.items.push(a[v]=x),r.hasField[v]=r.hasChannel[g]=a[v],r.hasSelectionId=r.hasSelectionId||v===nh}}else Kr(QL(g))}for(const g of h??[]){if(r.hasField[g])continue;const p={type:"E",field:g};p.signals=Object.assign({},i(p,"data")),r.items.push(p),r.hasField[g]=p,r.hasSelectionId=r.hasSelectionId||g===nh}d&&(n.init=d.map(g=>r.items.map(p=>Ei(g)?g[p.channel]!==void 0?g[p.channel]:g[p.field]:g))),_o(u)||(r.timeUnit=new Yf(null,u))},signals:(t,n,e)=>{const o=n.name+fx;return e.filter(r=>r.name===o).length>0||n.project.hasSelectionId?e:e.concat({name:o,value:n.project.items.map(r=>{const a=Iye(r,["signals","hasLegend"]);return a.field=bc(a.field),a})})}},op={defined:t=>t.type==="interval"&&t.resolve==="global"&&t.bind&&t.bind==="scales",parse:(t,n)=>{const e=n.scales=[];for(const o of n.project.items){const f=o.channel;if(!bp(f))continue;const r=t.getScaleComponent(f),a=r?r.get("type"):void 0;if(!r||!rc(a)){Kr(Tge);continue}r.set("selectionExtent",{param:n.name,field:o.field},!0),e.push(o)}},topLevelSignals:(t,n,e)=>{const o=n.scales.filter(a=>e.filter(u=>u.name===a.signals.data).length===0);if(!t.parent||KT(t)||o.length===0)return e;const f=e.filter(a=>a.name===n.name)[0];let r=f.update;if(r.indexOf(jq)>=0)f.update=`{${o.map(a=>`${oi(bc(a.field))}: ${a.signals.data}`).join(", ")}}`;else{for(const a of o){const u=`${oi(bc(a.field))}: ${a.signals.data}`;r.includes(u)||(r=`${r.substring(0,r.length-1)}, ${u}}`)}f.update=r}return e.concat(o.map(a=>({name:a.signals.data})))},signals:(t,n,e)=>{if(t.parent&&!KT(t))for(const o of n.scales){const f=e.filter(r=>r.name===o.signals.data)[0];f.push="outer",delete f.value,delete f.update}return e}};function JT(t,n){return`domain(${oi(t.scaleName(n))})`}function KT(t){var n;return t.parent&&s1(t.parent)&&((n=!t.parent.parent)!==null&&n!==void 0?n:KT(t.parent.parent))}var Fye=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);ft.type==="interval",signals:(t,n,e)=>{const o=n.name,f=o+fx,r=op.defined(n),a=n.init?n.init[0]:null,u=[],c=[];if(n.translate&&!r){const s=`!event.item || event.item.mark.name !== ${oi(o+om)}`;Mq(n,(l,d)=>{var h,m;const g=ki((h=(m=d.between[0]).filter)!==null&&h!==void 0?h:m.filter=[]);return g.includes(s)||g.push(s),l})}n.project.items.forEach((s,l)=>{const d=s.channel;if(d!==cs&&d!==ol){Kr("Interval selections only support x and y encoding channels.");return}const h=a?a[l]:null,m=Bye(t,n,s,h),g=s.signals.data,p=s.signals.visual,v=oi(t.scaleName(d)),y=t.getScaleComponent(d).get("type"),x=rc(y)?"+":"";e.push(...m),u.push(g),c.push({scaleName:t.scaleName(d),expr:`(!isArray(${g}) || (${x}invert(${v}, ${p})[0] === ${x}${g}[0] && ${x}invert(${v}, ${p})[1] === ${x}${g}[1]))`})}),!r&&c.length&&e.push({name:o+QT,value:{},on:[{events:c.map(s=>({scale:s.scaleName})),update:`${c.map(s=>s.expr).join(" && ")} ? ${o+QT} : {}`}]});const i=`unit: ${Im(t)}, fields: ${f}, values`;return e.concat(Object.assign(Object.assign({name:o+lp},a?{init:`{${i}: ${N0(a)}}`}:{}),u.length?{on:[{events:[{signal:u.join(" || ")}],update:`${u.join(" && ")} ? {${i}: [${u}]} : null`}]}:{}))},marks:(t,n,e)=>{const o=n.name,{x:f,y:r}=n.project.hasChannel,a=f?.signals.visual,u=r?.signals.visual,c=`data(${oi(n.name+B0)})`;if(op.defined(n)||!f&&!r)return e;const i={x:f!==void 0?{signal:`${a}[0]`}:{value:0},y:r!==void 0?{signal:`${u}[0]`}:{value:0},x2:f!==void 0?{signal:`${a}[1]`}:{field:{group:"width"}},y2:r!==void 0?{signal:`${u}[1]`}:{field:{group:"height"}}};if(n.resolve==="global")for(const p of Xr(i))i[p]=[Object.assign({test:`${c}.length && ${c}[0].unit === ${Im(t)}`},i[p]),{value:0}];const s=n.mark,{fill:l,fillOpacity:d,cursor:h}=s,m=Fye(s,["fill","fillOpacity","cursor"]),g=Xr(m).reduce((p,v)=>(p[v]=[{test:[f!==void 0&&`${a}[0] !== ${a}[1]`,r!==void 0&&`${u}[0] !== ${u}[1]`].filter(y=>y).join(" && "),value:m[v]},{value:null}],p),{});return[{name:`${o+om}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:l},fillOpacity:{value:d}},update:i}},...e,{name:o+om,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},i),g)}}]}};function Bye(t,n,e,o){const f=e.channel,r=e.signals.visual,a=e.signals.data,u=op.defined(n),c=oi(t.scaleName(f)),i=t.getScaleComponent(f),s=i?i.get("type"):void 0,l=g=>`scale(${c}, ${g})`,d=t.getSizeSignalRef(f===cs?"width":"height").signal,h=`${f}(unit)`,m=Mq(n,(g,p)=>[...g,{events:p.between[0],update:`[${h}, ${h}]`},{events:p,update:`[${r}[0], clamp(${h}, 0, ${d})]`}]);return m.push({events:{signal:n.name+QT},update:rc(s)?`[${l(`${a}[0]`)}, ${l(`${a}[1]`)}]`:"[0, 0]"}),u?[{name:a,on:[]}]:[Object.assign(Object.assign({name:r},o?{init:N0(o,!0,l)}:{value:[]}),{on:m}),Object.assign(Object.assign({name:a},o?{init:N0(o)}:{}),{on:[{events:{signal:r},update:`${r}[0] === ${r}[1] ? null : invert(${c}, ${r})`}]})]}function Mq(t,n){return t.events.reduce((e,o)=>o.between?n(e,o):(Kr(`${o} is not an ordered event stream for interval selections.`),e),[])}const jye={defined:t=>t.type==="point",signals:(t,n,e)=>{var o;const f=n.name,r=f+fx,a=n.project,u="(item().isVoronoi ? datum.datum : datum)",c=ql((o=t.component.selection)!==null&&o!==void 0?o:{}).reduce((d,h)=>h.type==="interval"?d.concat(h.name+om):d,[]).map(d=>`indexof(item().mark.name, '${d}') < 0`).join(" && "),i=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${c?` && ${c}`:""}`;let s=`unit: ${Im(t)}, `;if(n.project.hasSelectionId)s+=`${nh}: ${u}[${oi(nh)}]`;else{const d=a.items.map(h=>{const m=t.fieldDef(h.channel);return m?.bin?`[${u}[${oi(t.vgField(h.channel,{}))}], ${u}[${oi(t.vgField(h.channel,{binSuffix:"end"}))}]]`:`${u}[${oi(h.field)}]`}).join(", ");s+=`fields: ${r}, values: [${d}]`}const l=n.events;return e.concat([{name:f+lp,on:l?[{events:l,update:`${i} ? {${s}} : null`,force:!0}]:[]}])}};function r1(t,n,e,o){const f=g3(n)&&n.condition,r=o(n);if(f){const u=ki(f).map(c=>{const i=o(c);if(C1e(c)){const{param:s,empty:l}=c,d=Hq(t,{param:s,empty:l});return Object.assign({test:d},i)}else{const s=R2(t,c.test);return Object.assign({test:s},i)}});return{[e]:[...u,...r!==void 0?[r]:[]]}}else return r!==void 0?{[e]:r}:{}}function x8(t,n="text"){const e=t.encoding[n];return r1(t,e,n,o=>T3(o,t.config))}function T3(t,n,e="datum"){if(t){if(pf(t))return Ho(t.value);if(la(t)){const{format:o,formatType:f}=C2(t);return KE({fieldOrDatumDef:t,format:o,formatType:f,expr:e,config:n})}}}function Sq(t,n={}){const{encoding:e,markDef:o,config:f,stack:r}=t,a=e.tooltip;if(Ir(a))return{tooltip:EP({tooltip:a},r,f,n)};{const u=n.reactiveGeom?"datum.datum":"datum";return r1(t,a,"tooltip",c=>{const i=T3(c,f,u);if(i)return i;if(c===null)return;let s=oo("tooltip",o,f);if(s===!0&&(s={content:"encoding"}),bi(s))return{value:s};if(Ei(s))return Vi(s)?s:s.content==="encoding"?EP(e,r,f,n):{signal:u}})}}function Eq(t,n,e,{reactiveGeom:o}={}){const f={},r=o?"datum.datum":"datum",a=[];function u(i,s){const l=J0(s),d=wc(i)?i:Object.assign(Object.assign({},i),{type:t[l].type}),h=d.title||n8(d,e),m=ki(h).join(", ");let g;if(sl(s)){const p=s==="x"?"x2":"y2",v=th(t[p]);if(xl(d.bin)&&v){const y=hi(d,{expr:r}),x=hi(v,{expr:r}),{format:w,formatType:k}=C2(d);g=ox(y,x,w,k,e),f[p]=!0}}if((sl(s)||s===Tc||s===xf)&&n&&n.fieldChannel===s&&n.offset==="normalize"){const{format:p,formatType:v}=C2(d);g=KE({fieldOrDatumDef:d,format:p,formatType:v,expr:r,config:e,normalizeStack:!0}).signal}g??(g=T3(d,e,r).signal),a.push({channel:s,key:m,value:g})}a8(t,(i,s)=>{ti(i)?u(i,s):m3(i)&&u(i.condition,s)});const c={};for(const{channel:i,key:s,value:l}of a)!f[i]&&!c[s]&&(c[s]=l);return c}function EP(t,n,e,{reactiveGeom:o}={}){const f=Eq(t,n,e,{reactiveGeom:o}),r=rp(f).map(([a,u])=>`"${a}": ${u}`);return r.length>0?{signal:`{${r.join(", ")}}`}:void 0}function Uye(t){const{markDef:n,config:e}=t,o=oo("aria",n,e);return o===!1?{}:Object.assign(Object.assign(Object.assign({},o?{aria:o}:{}),Vye(t)),qye(t))}function Vye(t){const{mark:n,markDef:e,config:o}=t;if(o.aria===!1)return{};const f=oo("ariaRoleDescription",e,o);return f!=null?{ariaRoleDescription:{value:f}}:n in vge?{}:{ariaRoleDescription:{value:n}}}function qye(t){const{encoding:n,markDef:e,config:o,stack:f}=t,r=n.description;if(r)return r1(t,r,"description",c=>T3(c,t.config));const a=oo("description",e,o);if(a!=null)return{description:Ho(a)};if(o.aria===!1)return{};const u=Eq(n,f,o);if(!_o(u))return{description:{signal:rp(u).map(([c,i],s)=>`"${s>0?"; ":""}${c}: " + (${i})`).join(" + ")}}}function nl(t,n,e={}){const{markDef:o,encoding:f,config:r}=n,{vgChannel:a}=e;let{defaultRef:u,defaultValue:c}=e;u===void 0&&(c??(c=oo(t,o,r,{vgChannel:a,ignoreVgConfig:!0})),c!==void 0&&(u=Ho(c)));const i=f[t];return r1(n,i,a??t,s=>JE({channel:t,channelDef:s,markDef:o,config:r,scaleName:n.scaleName(t),scale:n.getScaleComponent(t),stack:null,defaultRef:u}))}function Cq(t,n={filled:void 0}){var e,o,f,r;const{markDef:a,encoding:u,config:c}=t,{type:i}=a,s=(e=n.filled)!==null&&e!==void 0?e:oo("filled",a,c),l=Fa(["bar","point","circle","square","geoshape"],i)?"transparent":void 0,d=(f=(o=oo(s===!0?"color":void 0,a,c,{vgChannel:"fill"}))!==null&&o!==void 0?o:c.mark[s===!0&&"color"])!==null&&f!==void 0?f:l,h=(r=oo(s===!1?"color":void 0,a,c,{vgChannel:"stroke"}))!==null&&r!==void 0?r:c.mark[s===!1&&"color"],m=s?"fill":"stroke",g=Object.assign(Object.assign({},d?{fill:Ho(d)}:{}),h?{stroke:Ho(h)}:{});return a.color&&(s?a.fill:a.stroke)&&Kr(JU("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},g),nl("color",t,{vgChannel:m,defaultValue:s?d:h})),nl("fill",t,{defaultValue:u.fill?d:void 0})),nl("stroke",t,{defaultValue:u.stroke?h:void 0}))}function Hye(t){const{encoding:n,mark:e}=t,o=n.order;return!kp(e)&&pf(o)?r1(t,o,"zindex",f=>Ho(f.value)):{}}function gy({channel:t,markDef:n,encoding:e={},model:o,bandPosition:f}){const r=`${t}Offset`,a=n[r],u=e[r];if((r==="xOffset"||r==="yOffset")&&u){const i=JE({channel:r,channelDef:u,markDef:n,config:o?.config,scaleName:o.scaleName(r),scale:o.getScaleComponent(r),stack:null,defaultRef:Ho(a),bandPosition:f});return{offsetType:"encoding",offset:i}}const c=n[r];return c?{offsetType:"visual",offset:c}:{}}function Fl(t,n,{defaultPos:e,vgChannel:o}){const{encoding:f,markDef:r,config:a,stack:u}=n,c=f[t],i=f[ph(t)],s=n.scaleName(t),l=n.getScaleComponent(t),{offset:d,offsetType:h}=gy({channel:t,markDef:r,encoding:f,model:n,bandPosition:.5}),m=b8({model:n,defaultPos:e,channel:t,scaleName:s,scale:l}),g=!c&&sl(t)&&(f.latitude||f.longitude)?{field:n.getName(t)}:$ye({channel:t,channelDef:c,channel2Def:i,markDef:r,config:a,scaleName:s,scale:l,stack:u,offset:d,defaultRef:m,bandPosition:h==="encoding"?0:void 0});return g?{[o||t]:g}:void 0}function $ye(t){const{channel:n,channelDef:e,scaleName:o,stack:f,offset:r,markDef:a}=t;if(la(e)&&f&&n===f.fieldChannel){if(ti(e)){let u=e.bandPosition;if(u===void 0&&a.type==="text"&&(n==="radius"||n==="theta")&&(u=.5),u!==void 0)return S2({scaleName:o,fieldOrDatumDef:e,startSuffix:"start",bandPosition:u,offset:r})}return v0(e,o,{suffix:"end"},{offset:r})}return XE(t)}function b8({model:t,defaultPos:n,channel:e,scaleName:o,scale:f}){const{markDef:r,config:a}=t;return()=>{const u=J0(e),c=ip(e),i=oo(e,r,a,{vgChannel:c});if(i!==void 0)return Bv(e,i);switch(n){case"zeroOrMin":case"zeroOrMax":if(o){const s=f.get("type");if(!Fa([Cu.LOG,Cu.TIME,Cu.UTC],s)){if(f.domainDefinitelyIncludesZero())return{scale:o,value:0}}}if(n==="zeroOrMin")return u==="y"?{field:{group:"height"}}:{value:0};switch(u){case"radius":return{signal:`min(${t.width.signal},${t.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const s=t[Fu(e)];return Object.assign(Object.assign({},s),{mult:.5})}}}}const Gye={left:"x",center:"xc",right:"x2"},Wye={top:"y",middle:"yc",bottom:"y2"};function Oq(t,n,e,o="middle"){if(t==="radius"||t==="theta")return ip(t);const f=t==="x"?"align":"baseline",r=oo(f,n,e);let a;return Vi(r)?(Kr(Zge(f)),a=void 0):a=r,t==="x"?Gye[a||(o==="top"?"left":"center")]:Wye[a||o]}function I2(t,n,{defaultPos:e,defaultPos2:o,range:f}){return f?Lq(t,n,{defaultPos:e,defaultPos2:o}):Fl(t,n,{defaultPos:e})}function Lq(t,n,{defaultPos:e,defaultPos2:o}){const{markDef:f,config:r}=n,a=ph(t),u=Fu(t),c=Yye(n,o,a),i=c[u]?Oq(t,f,r):ip(t);return Object.assign(Object.assign({},Fl(t,n,{defaultPos:e,vgChannel:i})),c)}function Yye(t,n,e){const{encoding:o,mark:f,markDef:r,stack:a,config:u}=t,c=J0(e),i=Fu(e),s=ip(e),l=o[c],d=t.scaleName(c),h=t.getScaleComponent(c),{offset:m}=e in o||e in r?gy({channel:e,markDef:r,encoding:o,model:t}):gy({channel:c,markDef:r,encoding:o,model:t});if(!l&&(e==="x2"||e==="y2")&&(o.latitude||o.longitude)){const p=Fu(e),v=t.markDef[p];return v!=null?{[p]:{value:v}}:{[s]:{field:t.getName(e)}}}const g=Xye({channel:e,channelDef:l,channel2Def:o[e],markDef:r,config:u,scaleName:d,scale:h,stack:a,offset:m,defaultRef:void 0});return g!==void 0?{[s]:g}:Ab(e,r)||Ab(e,{[e]:T2(e,r,u.style),[i]:T2(i,r,u.style)})||Ab(e,u[f])||Ab(e,u.mark)||{[s]:b8({model:t,defaultPos:n,channel:e,scaleName:d,scale:h})()}}function Xye({channel:t,channelDef:n,channel2Def:e,markDef:o,config:f,scaleName:r,scale:a,stack:u,offset:c,defaultRef:i}){return la(n)&&u&&t.charAt(0)===u.fieldChannel.charAt(0)?v0(n,r,{suffix:"start"},{offset:c}):XE({channel:t,channelDef:e,scaleName:r,scale:a,stack:u,markDef:o,config:f,offset:c,defaultRef:i})}function Ab(t,n){const e=Fu(t),o=ip(t);if(n[o]!==void 0)return{[o]:Bv(t,n[o])};if(n[t]!==void 0)return{[o]:Bv(t,n[t])};if(n[e]){const f=n[e];if(R0(f))Kr(qge(e));else return{[e]:Bv(t,f)}}}function sp(t,n){var e,o;const{config:f,encoding:r,markDef:a}=t,u=a.type,c=ph(n),i=Fu(n),s=r[n],l=r[c],d=t.getScaleComponent(n),h=d?d.get("type"):void 0,m=a.orient,g=(o=(e=r[i])!==null&&e!==void 0?e:r.size)!==null&&o!==void 0?o:oo("size",a,f,{vgChannel:i}),p=u==="bar"&&(n==="x"?m==="vertical":m==="horizontal");return ti(s)&&(Bo(s.bin)||xl(s.bin)||s.timeUnit&&!l)&&!(g&&!R0(g))&&!ll(h)?Kye({fieldDef:s,fieldDef2:l,channel:n,model:t}):(la(s)&&ll(h)||p)&&!l?Jye(s,n,t):Lq(n,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Zye(t,n,e,o,f){if(R0(f))if(e){const a=e.get("type");if(a==="band"){let u=`bandwidth('${n}')`;return f.band!==1&&(u=`${f.band} * ${u}`),{signal:`max(0.25, ${u})`}}else f.band!==1&&(Kr(eme(a)),f=void 0)}else return{mult:f.band,field:{group:t}};else{if(Vi(f))return f;if(f)return{value:f}}if(e){const a=e.get("range");if(wp(a)&&wo(a.step))return{value:a.step-2}}return{value:P2(o.view,t)-2}}function Jye(t,n,e){const{markDef:o,encoding:f,config:r,stack:a}=e,u=o.orient,c=e.scaleName(n),i=e.getScaleComponent(n),s=Fu(n),l=ph(n),d=Z0e(n),h=e.scaleName(d),m=u==="horizontal"&&n==="y"||u==="vertical"&&n==="x";let g;(f.size||o.size)&&(m?g=nl("size",e,{vgChannel:s,defaultRef:Ho(o.size)}):Kr(ime(o.type)));const p=!!g,v=OV({channel:n,fieldDef:t,markDef:o,config:r,scaleType:i?.get("type"),useVlSizeChannel:m});g=g||{[s]:Zye(s,h||c,i,r,v)};const y=i?.get("type")==="band"&&R0(v)&&!p?"top":"middle",x=Oq(n,o,r,y),w=x==="xc"||x==="yc",{offset:k,offsetType:b}=gy({channel:n,markDef:o,encoding:f,model:e,bandPosition:w?.5:0}),T=XE({channel:n,channelDef:t,markDef:o,config:r,scaleName:c,scale:i,stack:a,offset:k,defaultRef:b8({model:e,defaultPos:"mid",channel:n,scaleName:c,scale:i}),bandPosition:w?b==="encoding"?0:.5:Vi(v)?{signal:`(1-${v})/2`}:R0(v)?(1-v.band)/2:0});if(s)return Object.assign({[x]:T},g);{const _=ip(l),M=g[s],A=k?Object.assign(Object.assign({},M),{offset:k}):M;return{[x]:T,[_]:Ir(T)?[T[0],Object.assign(Object.assign({},T[1]),{offset:A})]:Object.assign(Object.assign({},T),{offset:A})}}}function K1(t,n,e,o,f){if(CU(t))return 0;const r=t==="x"||t==="y2"?-n/2:n/2;if(Vi(e)||Vi(f)||Vi(o)){const a=Hh(e),u=Hh(f),c=Hh(o),i=c?`${c} + `:"",s=a?`(${a} ? -1 : 1) * `:"",l=u?`(${u} + ${r})`:r;return{signal:i+s+l}}else return f=f||0,o+(e?-f-r:+f+r)}function Kye({fieldDef:t,fieldDef2:n,channel:e,model:o}){var f,r,a;const{config:u,markDef:c,encoding:i}=o,s=o.getScaleComponent(e),l=o.scaleName(e),d=s?s.get("type"):void 0,h=s.get("reverse"),m=OV({channel:e,fieldDef:t,markDef:c,config:u,scaleType:d}),g=(f=o.component.axes[e])===null||f===void 0?void 0:f[0],p=(r=g?.get("translate"))!==null&&r!==void 0?r:.5,v=sl(e)&&(a=oo("binSpacing",c,u))!==null&&a!==void 0?a:0,y=ph(e),x=ip(e),w=ip(y),{offset:k}=gy({channel:e,markDef:c,encoding:i,model:o,bandPosition:0}),b=Vi(m)?{signal:`(1-${m.signal})/2`}:R0(m)?(1-m.band)/2:.5;if(Bo(t.bin)||t.timeUnit)return{[w]:CP({fieldDef:t,scaleName:l,bandPosition:b,offset:K1(y,v,h,p,k)}),[x]:CP({fieldDef:t,scaleName:l,bandPosition:Vi(b)?{signal:`1-${b.signal}`}:1-b,offset:K1(e,v,h,p,k)})};if(xl(t.bin)){const T=v0(t,l,{},{offset:K1(y,v,h,p,k)});if(ti(n))return{[w]:T,[x]:v0(n,l,{},{offset:K1(e,v,h,p,k)})};if(K0(t.bin)&&t.bin.step)return{[w]:T,[x]:{signal:`scale("${l}", ${hi(t,{expr:"datum"})} + ${t.bin.step})`,offset:K1(e,v,h,p,k)}}}Kr(eV(y))}function CP({fieldDef:t,scaleName:n,bandPosition:e,offset:o}){return S2({scaleName:n,fieldOrDatumDef:t,bandPosition:e,offset:o})}const Qye=new Set(["aria","width","height"]);function Ac(t,n){const{fill:e=void 0,stroke:o=void 0}=n.color==="include"?Cq(t):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},exe(t.markDef,n)),OP(t,"fill",e)),OP(t,"stroke",o)),nl("opacity",t)),nl("fillOpacity",t)),nl("strokeOpacity",t)),nl("strokeWidth",t)),nl("strokeDash",t)),Hye(t)),Sq(t)),x8(t,"href")),Uye(t))}function OP(t,n,e){const{config:o,mark:f,markDef:r}=t;if(oo("invalid",r,o)==="hide"&&e&&!kp(f)){const u=txe(t,{invalid:!0,channels:o3});if(u)return{[n]:[{test:u,value:null},...ki(e)]}}return e?{[n]:e}:{}}function exe(t,n){return mge.reduce((e,o)=>(!Qye.has(o)&&t[o]!==void 0&&n[o]!=="ignore"&&(e[o]=Ho(t[o])),e),{})}function txe(t,{invalid:n=!1,channels:e}){const o=e.reduce((r,a)=>{const u=t.getScaleComponent(a);if(u){const c=u.get("type"),i=t.vgField(a,{expr:"datum"});i&&rc(c)&&(r[i]=!0)}return r},{}),f=Xr(o);if(f.length>0){const r=n?"||":"&&";return f.map(a=>ZE(a,n)).join(` ${r} `)}}function _8(t){const{config:n,markDef:e}=t;if(oo("invalid",e,n)){const f=nxe(t,{channels:gh});if(f)return{defined:{signal:f}}}return{}}function nxe(t,{invalid:n=!1,channels:e}){const o=e.reduce((r,a)=>{var u;const c=t.getScaleComponent(a);if(c){const i=c.get("type"),s=t.vgField(a,{expr:"datum",binSuffix:!((u=t.stack)===null||u===void 0)&&u.impute?"mid":void 0});s&&rc(i)&&(r[s]=!0)}return r},{}),f=Xr(o);if(f.length>0){const r=n?"||":"&&";return f.map(a=>ZE(a,n)).join(` ${r} `)}}function LP(t,n){if(n!==void 0)return{[t]:Ho(n)}}const D4="voronoi",Pq={defined:t=>t.type==="point"&&t.nearest,parse:(t,n)=>{if(n.events)for(const e of n.events)e.markname=t.getName(D4)},marks:(t,n,e)=>{const{x:o,y:f}=n.project.hasChannel,r=t.mark;if(kp(r))return Kr(wge(r)),e;const a={name:t.getName(D4),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},Sq(t,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:o||!f?"datum.datum.x || 0":"0"},y:{expr:f||!o?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let u=0,c=!1;return e.forEach((i,s)=>{var l;const d=(l=i.name)!==null&&l!==void 0?l:"";d===t.component.mark[0].name?u=s:d.indexOf(D4)>=0&&(c=!0)}),c||e.splice(u+1,0,a),e}},Dq={defined:t=>t.type==="point"&&t.resolve==="global"&&t.bind&&t.bind!=="scales"&&!f8(t.bind),parse:(t,n,e)=>Uq(n,e),topLevelSignals:(t,n,e)=>{const o=n.name,f=n.project,r=n.bind,a=n.init&&n.init[0],u=Pq.defined(n)?"(item().isVoronoi ? datum.datum : datum)":"datum";return f.items.forEach((c,i)=>{var s,l;const d=Xo(`${o}_${c.field}`);e.filter(m=>m.name===d).length||e.unshift(Object.assign(Object.assign({name:d},a?{init:N0(a[i])}:{value:null}),{on:n.events?[{events:n.events,update:`datum && item().mark.marktype !== 'group' ? ${u}[${oi(c.field)}] : null`}]:[],bind:(l=(s=r[c.field])!==null&&s!==void 0?s:r[c.channel])!==null&&l!==void 0?l:r}))}),e},signals:(t,n,e)=>{const o=n.name,f=n.project,r=e.filter(i=>i.name===o+lp)[0],a=o+fx,u=f.items.map(i=>Xo(`${o}_${i.field}`)),c=u.map(i=>`${i} !== null`).join(" && ");return u.length&&(r.update=`${c} ? {fields: ${a}, values: [${u.join(", ")}]} : null`),delete r.value,delete r.on,e}},z2="_toggle",Iq={defined:t=>t.type==="point"&&!!t.toggle,signals:(t,n,e)=>e.concat({name:n.name+z2,value:!1,on:[{events:n.events,update:n.toggle}]}),modifyExpr:(t,n)=>{const e=n.name+lp,o=n.name+z2;return`${o} ? null : ${e}, `+(n.resolve==="global"?`${o} ? null : true, `:`${o} ? null : {unit: ${Im(t)}}, `)+`${o} ? ${e} : null`}},rxe={defined:t=>t.clear!==void 0&&t.clear!==!1,parse:(t,n)=>{n.clear&&(n.clear=bi(n.clear)?pp(n.clear,"view"):n.clear)},topLevelSignals:(t,n,e)=>{if(Dq.defined(n))for(const o of n.project.items){const f=e.findIndex(r=>r.name===Xo(`${n.name}_${o.field}`));f!==-1&&e[f].on.push({events:n.clear,update:"null"})}return e},signals:(t,n,e)=>{function o(f,r){f!==-1&&e[f].on&&e[f].on.push({events:n.clear,update:r})}if(n.type==="interval")for(const f of n.project.items){const r=e.findIndex(a=>a.name===f.signals.visual);if(o(r,"[0, 0]"),r===-1){const a=e.findIndex(u=>u.name===f.signals.data);o(a,"null")}}else{let f=e.findIndex(r=>r.name===n.name+lp);o(f,"null"),Iq.defined(n)&&(f=e.findIndex(r=>r.name===n.name+z2),o(f,"false"))}return e}},zq={defined:t=>{const n=t.resolve==="global"&&t.bind&&f8(t.bind),e=t.project.items.length===1&&t.project.items[0].field!==nh;return n&&!e&&Kr(Age),n&&e},parse:(t,n,e)=>{var o;const f=ha(e);if(f.select=bi(f.select)?{type:f.select,toggle:n.toggle}:Object.assign(Object.assign({},f.select),{toggle:n.toggle}),Uq(n,f),Ei(e.select)&&(e.select.on||e.select.clear)){const u='event.item && indexof(event.item.mark.role, "legend") < 0';for(const c of n.events)c.filter=ki((o=c.filter)!==null&&o!==void 0?o:[]),c.filter.includes(u)||c.filter.push(u)}const r=O4(n.bind)?n.bind.legend:"click",a=bi(r)?pp(r,"view"):ki(r);n.bind={legend:{merge:a}}},topLevelSignals:(t,n,e)=>{const o=n.name,f=O4(n.bind)&&n.bind.legend,r=a=>u=>{const c=ha(u);return c.markname=a,c};for(const a of n.project.items){if(!a.hasLegend)continue;const u=`${Xo(a.field)}_legend`,c=`${o}_${u}`;if(e.filter(s=>s.name===c).length===0){const s=f.merge.map(r(`${u}_symbols`)).concat(f.merge.map(r(`${u}_labels`))).concat(f.merge.map(r(`${u}_entries`)));e.unshift(Object.assign(Object.assign({name:c},n.init?{}:{value:null}),{on:[{events:s,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:f.merge,update:`!event.item || !datum ? null : ${c}`,force:!0}]}))}}return e},signals:(t,n,e)=>{const o=n.name,f=n.project,r=e.find(d=>d.name===o+lp),a=o+fx,u=f.items.filter(d=>d.hasLegend).map(d=>Xo(`${o}_${Xo(d.field)}_legend`)),i=`${u.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${a}, values: [${u.join(", ")}]} : null`;n.events&&u.length>0?r.on.push({events:u.map(d=>({signal:d})),update:i}):u.length>0&&(r.update=i,delete r.value,delete r.on);const s=e.find(d=>d.name===o+z2),l=O4(n.bind)&&n.bind.legend;return s&&(n.events?s.on.push(Object.assign(Object.assign({},s.on[0]),{events:l})):s.on[0].events=l),e}};function ixe(t,n,e){var o,f,r,a;const u=(o=t.fieldDef(n))===null||o===void 0?void 0:o.field;for(const c of ql((f=t.component.selection)!==null&&f!==void 0?f:{})){const i=(r=c.project.hasField[u])!==null&&r!==void 0?r:c.project.hasChannel[n];if(i&&zq.defined(c)){const s=(a=e.get("selections"))!==null&&a!==void 0?a:[];s.push(c.name),e.set("selections",s,!1),i.hasLegend=!0}}}const Rq="_translate_anchor",Fq="_translate_delta",axe={defined:t=>t.type==="interval"&&t.translate,signals:(t,n,e)=>{const o=n.name,f=op.defined(n),r=o+Rq,{x:a,y:u}=n.project.hasChannel;let c=pp(n.translate,"scope");return f||(c=c.map(i=>(i.between[0].markname=o+om,i))),e.push({name:r,value:{},on:[{events:c.map(i=>i.between[0]),update:"{x: x(unit), y: y(unit)"+(a!==void 0?`, extent_x: ${f?JT(t,cs):`slice(${a.signals.visual})`}`:"")+(u!==void 0?`, extent_y: ${f?JT(t,ol):`slice(${u.signals.visual})`}`:"")+"}"}]},{name:o+Fq,value:{},on:[{events:c,update:`{x: ${r}.x - x(unit), y: ${r}.y - y(unit)}`}]}),a!==void 0&&PP(t,n,a,"width",e),u!==void 0&&PP(t,n,u,"height",e),e}};function PP(t,n,e,o,f){var r,a;const u=n.name,c=u+Rq,i=u+Fq,s=e.channel,l=op.defined(n),d=f.filter(T=>T.name===e.signals[l?"data":"visual"])[0],h=t.getSizeSignalRef(o).signal,m=t.getScaleComponent(s),g=m.get("type"),p=m.get("reverse"),v=l?s===cs?p?"":"-":p?"-":"":"",y=`${c}.extent_${s}`,x=`${v}${i}.${s} / ${l?`${h}`:`span(${y})`}`,w=l?g==="log"?"panLog":g==="symlog"?"panSymlog":g==="pow"?"panPow":"panLinear":"panLinear",k=l?g==="pow"?`, ${(r=m.get("exponent"))!==null&&r!==void 0?r:1}`:g==="symlog"?`, ${(a=m.get("constant"))!==null&&a!==void 0?a:1}`:"":"",b=`${w}(${y}, ${x}${k})`;d.on.push({events:{signal:i},update:l?b:`clampRange(${b}, 0, ${h})`})}const Nq="_zoom_anchor",Bq="_zoom_delta",oxe={defined:t=>t.type==="interval"&&t.zoom,signals:(t,n,e)=>{const o=n.name,f=op.defined(n),r=o+Bq,{x:a,y:u}=n.project.hasChannel,c=oi(t.scaleName(cs)),i=oi(t.scaleName(ol));let s=pp(n.zoom,"scope");return f||(s=s.map(l=>(l.markname=o+om,l))),e.push({name:o+Nq,on:[{events:s,update:f?"{"+[c?`x: invert(${c}, x(unit))`:"",i?`y: invert(${i}, y(unit))`:""].filter(l=>!!l).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:r,on:[{events:s,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),a!==void 0&&DP(t,n,a,"width",e),u!==void 0&&DP(t,n,u,"height",e),e}};function DP(t,n,e,o,f){var r,a;const u=n.name,c=e.channel,i=op.defined(n),s=f.filter(w=>w.name===e.signals[i?"data":"visual"])[0],l=t.getSizeSignalRef(o).signal,d=t.getScaleComponent(c),h=d.get("type"),m=i?JT(t,c):s.name,g=u+Bq,p=`${u}${Nq}.${c}`,v=i?h==="log"?"zoomLog":h==="symlog"?"zoomSymlog":h==="pow"?"zoomPow":"zoomLinear":"zoomLinear",y=i?h==="pow"?`, ${(r=d.get("exponent"))!==null&&r!==void 0?r:1}`:h==="symlog"?`, ${(a=d.get("constant"))!==null&&a!==void 0?a:1}`:"":"",x=`${v}(${m}, ${p}, ${g}${y})`;s.on.push({events:{signal:g},update:i?x:`clampRange(${x}, 0, ${l})`})}const B0="_store",lp="_tuple",sxe="_modify",jq="vlSelectionResolve",A3=[jye,Nye,Rye,Iq,Dq,op,zq,rxe,axe,oxe,Pq];function lxe(t){let n=t.parent;for(;n&&!lf(n);)n=n.parent;return n}function Im(t,{escape:n}={escape:!0}){let e=n?oi(t.name):t.name;const o=lxe(t);if(o){const{facet:f}=o;for(const r of dc)f[r]&&(e+=` + '__facet_${r}_' + (facet[${oi(o.vgField(r))}])`)}return e}function w8(t){var n;return ql((n=t.component.selection)!==null&&n!==void 0?n:{}).reduce((e,o)=>e||o.project.hasSelectionId,!1)}function Uq(t,n){(bi(n.select)||!n.select.on)&&delete t.events,(bi(n.select)||!n.select.clear)&&delete t.clear,(bi(n.select)||!n.select.toggle)&&delete t.toggle}function eA(t){const n=[];return t.type==="Identifier"?[t.name]:t.type==="Literal"?[t.value]:(t.type==="MemberExpression"&&(n.push(...eA(t.object)),n.push(...eA(t.property))),n)}function Vq(t){return t.object.type==="MemberExpression"?Vq(t.object):t.object.name==="datum"}function qq(t){const n=BS(t),e=new Set;return n.visit(o=>{o.type==="MemberExpression"&&Vq(o)&&e.add(eA(o).slice(1).join("."))}),e}class i1 extends To{constructor(n,e,o){super(n),this.model=e,this.filter=o,this.expr=R2(this.model,this.filter,this),this._dependentFields=qq(this.expr)}clone(){return new i1(null,this.model,ha(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function uxe(t,n){var e;const o={},f=t.config.selection;if(!n||!n.length)return o;for(const r of n){const a=Xo(r.name),u=r.select,c=bi(u)?u:u.type,i=Ei(u)?ha(u):{type:c},s=f[c];for(const d in s)d==="fields"||d==="encodings"||(d==="mark"&&(i[d]=Object.assign(Object.assign({},s[d]),i[d])),(i[d]===void 0||i[d]===!0)&&(i[d]=(e=s[d])!==null&&e!==void 0?e:i[d]));const l=o[a]=Object.assign(Object.assign({},i),{name:a,type:c,init:r.value,bind:r.bind,events:bi(i.on)?pp(i.on,"scope"):ki(ha(i.on))});for(const d of A3)d.defined(l)&&d.parse&&d.parse(t,l,r)}return o}function Hq(t,n,e,o="datum"){const f=bi(n)?n:n.param,r=Xo(f),a=oi(r+B0);let u;try{u=t.getSelectionComponent(r,f)}catch{return`!!${r}`}if(u.project.timeUnit){const d=e??t.component.data.raw,h=u.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const c=u.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",i=u.resolve==="global"?")":`, ${oi(u.resolve)})`,s=`${c}${a}, ${o}${i}`,l=`length(data(${a}))`;return n.empty===!1?`${l} && ${s}`:`!${l} || ${s}`}function $q(t,n,e){const o=Xo(n),f=e.encoding;let r=e.field,a;try{a=t.getSelectionComponent(o,n)}catch{return o}if(!f&&!r)r=a.project.items[0].field,a.project.items.length>1&&Kr(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${oi(r)}.`);else if(f&&!r){const u=a.project.items.filter(c=>c.channel===f);!u.length||u.length>1?(r=a.project.items[0].field,Kr((u.length?"Multiple ":"No ")+`matching ${oi(f)} encoding found for selection ${oi(e.param)}. Using "field": ${oi(r)}.`)):r=u[0].field}return`${a.name}[${oi(bc(r))}]`}function cxe(t,n){var e;for(const[o,f]of rp((e=t.component.selection)!==null&&e!==void 0?e:{})){const r=t.getName(`lookup_${o}`);t.component.data.outputNodes[r]=f.materialized=new hu(new i1(n,t,{param:o}),r,Fo.Lookup,t.component.data.outputNodeRefCounts)}}function R2(t,n,e){return Nv(n,o=>bi(o)?o:jme(o)?Hq(t,o,e):lV(o))}var Mb=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);fn8(e,n)).join(", "):t}function I4(t,n,e,o){var f,r,a,u,c;(f=t.encode)!==null&&f!==void 0||(t.encode={}),(r=(u=t.encode)[n])!==null&&r!==void 0||(u[n]={}),(a=(c=t.encode[n]).update)!==null&&a!==void 0||(c.update={}),t.encode[n].update[e]=o}function Tv(t,n,e,o={header:!1}){var f,r;const a=t.combine(),{disable:u,orient:c,scale:i,labelExpr:s,title:l,zindex:d}=a,h=Mb(a,["disable","orient","scale","labelExpr","title","zindex"]);if(!u){for(const m in h){const g=q1e[m],p=h[m];if(g&&g!==n&&g!=="both")delete h[m];else if(cx(p)){const{condition:v}=p,y=Mb(p,["condition"]),x=ki(v),w=cP[m];if(w){const{vgProp:k,part:b}=w,T=[...x.map(_=>{const{test:M}=_,A=Mb(_,["test"]);return Object.assign({test:R2(null,M)},A)}),y];I4(h,b,k,T),delete h[m]}else if(w===null){const k={signal:x.map(b=>{const{test:T}=b,_=Mb(b,["test"]);return`${R2(null,T)} ? ${XL(_)} : `}).join("")+XL(y)};h[m]=k}}else if(Vi(p)){const v=cP[m];if(v){const{vgProp:y,part:x}=v;I4(h,x,y,p),delete h[m]}}Fa(["labelAlign","labelBaseline"],m)&&h[m]===null&&delete h[m]}if(n==="grid"){if(!h.grid)return;if(h.encode){const{grid:m}=h.encode;h.encode=Object.assign({},m?{grid:m}:{}),_o(h.encode)&&delete h.encode}return Object.assign(Object.assign({scale:i,orient:c},h),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Rs(d,0)})}else{if(!o.header&&t.mainExtracted)return;if(s!==void 0){let g=s;((r=(f=h.encode)===null||f===void 0?void 0:f.labels)===null||r===void 0?void 0:r.update)&&Vi(h.encode.labels.update.text)&&(g=P0(s,"datum.label",h.encode.labels.update.text.signal)),I4(h,"labels","text",{signal:g})}if(h.labelAlign===null&&delete h.labelAlign,h.encode){for(const g of BV)t.hasAxisPart(g)||delete h.encode[g];_o(h.encode)&&delete h.encode}const m=fxe(l,e);return Object.assign(Object.assign(Object.assign(Object.assign({scale:i,orient:c,grid:!1},m?{title:m}:{}),h),e.aria===!1?{aria:!1}:{}),{zindex:Rs(d,0)})}}}function Gq(t){const{axes:n}=t.component,e=[];for(const o of gh)if(n[o]){for(const f of n[o])if(!f.get("disable")&&!f.get("gridScale")){const r=o==="x"?"height":"width",a=t.getSizeSignalRef(r).signal;r!==a&&e.push({name:r,update:a})}}return e}function hxe(t,n){const{x:e=[],y:o=[]}=t;return[...e.map(f=>Tv(f,"grid",n)),...o.map(f=>Tv(f,"grid",n)),...e.map(f=>Tv(f,"main",n)),...o.map(f=>Tv(f,"main",n))].filter(f=>f)}function IP(t,n,e,o){return Object.assign.apply(null,[{},...t.map(f=>{if(f==="axisOrient"){const r=e==="x"?"bottom":"left",a=n[e==="x"?"axisBottom":"axisLeft"]||{},u=n[e==="x"?"axisTop":"axisRight"]||{},c=new Set([...Xr(a),...Xr(u)]),i={};for(const s of c.values())i[s]={signal:`${o.signal} === "${r}" ? ${Hh(a[s])} : ${Hh(u[s])}`};return i}return n[f]})])}function dxe(t,n,e,o){const f=n==="band"?["axisDiscrete","axisBand"]:n==="point"?["axisDiscrete","axisPoint"]:hV(n)?["axisQuantitative"]:n==="time"||n==="utc"?["axisTemporal"]:[],r=t==="x"?"axisX":"axisY",a=Vi(e)?"axisOrient":`axis${Qy(e)}`,u=[...f,...f.map(i=>r+i.substr(4))],c=["axis",a,r];return{vlOnlyAxisConfig:IP(u,o,t,e),vgAxisConfig:IP(c,o,t,e),axisConfigStyle:pxe([...c,...u],o)}}function pxe(t,n){var e;const o=[{}];for(const f of t){let r=(e=n[f])===null||e===void 0?void 0:e.style;if(r){r=ki(r);for(const a of r)o.push(n.style[a])}}return Object.assign.apply(null,o)}function tA(t,n,e,o={}){var f;const r=HU(t,e,n);if(r!==void 0)return{configFrom:"style",configValue:r};for(const a of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((f=o[a])===null||f===void 0?void 0:f[t])!==void 0)return{configFrom:a,configValue:o[a][t]};return{}}const zP={scale:({model:t,channel:n})=>t.scaleName(n),format:({fieldOrDatumDef:t,config:n,axis:e})=>{const{format:o,formatType:f}=e;return TV(t,t.type,o,f,n,!0)},formatType:({axis:t,fieldOrDatumDef:n,scaleType:e})=>{const{formatType:o}=t;return AV(o,n,e)},grid:({fieldOrDatumDef:t,axis:n,scaleType:e})=>{var o;return(o=n.grid)!==null&&o!==void 0?o:gxe(e,t)},gridScale:({model:t,channel:n})=>mxe(t,n),labelAlign:({axis:t,labelAngle:n,orient:e,channel:o})=>t.labelAlign||Yq(n,e,o),labelAngle:({labelAngle:t})=>t,labelBaseline:({axis:t,labelAngle:n,orient:e,channel:o})=>t.labelBaseline||Wq(n,e,o),labelFlush:({axis:t,fieldOrDatumDef:n,channel:e})=>{var o;return(o=t.labelFlush)!==null&&o!==void 0?o:yxe(n.type,e)},labelOverlap:({axis:t,fieldOrDatumDef:n,scaleType:e})=>{var o;return(o=t.labelOverlap)!==null&&o!==void 0?o:xxe(n.type,e,ti(n)&&!!n.timeUnit,ti(n)?n.sort:void 0)},orient:({orient:t})=>t,tickCount:({channel:t,model:n,axis:e,fieldOrDatumDef:o,scaleType:f})=>{var r;const a=t==="x"?"width":t==="y"?"height":void 0,u=a?n.getSizeSignalRef(a):void 0;return(r=e.tickCount)!==null&&r!==void 0?r:_xe({fieldOrDatumDef:o,scaleType:f,size:u,values:e.values})},title:({axis:t,model:n,channel:e})=>{if(t.title!==void 0)return t.title;const o=Xq(n,e);if(o!==void 0)return o;const f=n.typedFieldDef(e),r=e==="x"?"x2":"y2",a=n.fieldDef(r);return GU(f?[uP(f)]:[],ti(a)?[uP(a)]:[])},values:({axis:t,fieldOrDatumDef:n})=>wxe(t,n),zindex:({axis:t,fieldOrDatumDef:n,mark:e})=>{var o;return(o=t.zindex)!==null&&o!==void 0?o:kxe(e,n)}};function gxe(t,n){return!ll(t)&&ti(n)&&!Bo(n?.bin)&&!xl(n?.bin)}function mxe(t,n){const e=n==="x"?"y":"x";if(t.getScaleComponent(e))return t.scaleName(e)}function vxe(t,n,e,o,f){const r=n?.labelAngle;if(r!==void 0)return Vi(r)?r:hy(r);{const{configValue:a}=tA("labelAngle",o,n?.style,f);return a!==void 0?hy(a):e===cs&&Fa([$E,HE],t.type)&&!(ti(t)&&t.timeUnit)?270:void 0}}function nA(t){return`(((${t.signal} % 360) + 360) % 360)`}function Wq(t,n,e,o){if(t!==void 0)if(e==="x"){if(Vi(t)){const f=nA(t),r=Vi(n)?`(${n.signal} === "top")`:n==="top";return{signal:`(45 < ${f} && ${f} < 135) || (225 < ${f} && ${f} < 315) ? "middle" :(${f} <= 45 || 315 <= ${f}) === ${r} ? "bottom" : "top"`}}if(45{if(!!eg(o)&&EV(o.sort)){const{field:r,timeUnit:a}=o,u=o.sort,c=u.map((i,s)=>`${lV({field:r,timeUnit:a,equal:i})} ? ${s} : `).join("")+u.length;n=new zm(n,{calculate:c,as:Rm(o,f,{forAs:!0})})}}),n}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Ba(this.transform)}`}}function Rm(t,n,e){return hi(t,Object.assign({prefix:n,suffix:"sort_index"},e??{}))}function M3(t,n){return Fa(["top","bottom"],n)?"column":Fa(["left","right"],n)||t==="row"?"row":"column"}function Fm(t,n,e,o){const f=o==="row"?e.headerRow:o==="column"?e.headerColumn:e.headerFacet;return Rs((n||{})[t],f[t],e.header[t])}function S3(t,n,e,o){const f={};for(const r of t){const a=Fm(r,n||{},e,o);a!==void 0&&(f[r]=a)}return f}const k8=["row","column"],T8=["header","footer"];function Txe(t,n){const e=t.component.layoutHeaders[n].title,o=t.config?t.config:void 0,f=t.component.layoutHeaders[n].facetFieldDef?t.component.layoutHeaders[n].facetFieldDef:void 0,{titleAnchor:r,titleAngle:a,titleOrient:u}=S3(["titleAnchor","titleAngle","titleOrient"],f.header,o,n),c=M3(n,u),i=hy(a);return{name:`${n}-title`,type:"group",role:`${c}-title`,title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:e},n==="row"?{orient:"left"}:{}),{style:"guide-title"}),Jq(i,c)),Zq(c,i,r)),Kq(o,f,n,hve,nq))}}function Zq(t,n,e="middle"){switch(e){case"start":return{align:"left"};case"end":return{align:"right"}}const o=Yq(n,t==="row"?"left":"top",t==="row"?"y":"x");return o?{align:o}:{}}function Jq(t,n){const e=Wq(t,n==="row"?"left":"top",n==="row"?"y":"x",!0);return e?{baseline:e}:{}}function Axe(t,n){const e=t.component.layoutHeaders[n],o=[];for(const f of T8)if(e[f])for(const r of e[f]){const a=Sxe(t,n,f,e,r);a!=null&&o.push(a)}return o}function Mxe(t,n){var e;const{sort:o}=t;return Wf(o)?{field:hi(o,{expr:"datum"}),order:(e=o.order)!==null&&e!==void 0?e:"ascending"}:Ir(o)?{field:Rm(t,n,{expr:"datum"}),order:"ascending"}:{field:hi(t,{expr:"datum"}),order:o??"ascending"}}function rA(t,n,e){const{format:o,formatType:f,labelAngle:r,labelAnchor:a,labelOrient:u,labelExpr:c}=S3(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,e,n),i=KE({fieldOrDatumDef:t,format:o,formatType:f,expr:"parent",config:e}).signal,s=M3(n,u);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:c?P0(P0(c,"datum.label",i),"datum.value",hi(t,{expr:"parent"})):i}},n==="row"?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),Jq(r,s)),Zq(s,r,a)),Kq(e,t,n,dve,rq))}function Sxe(t,n,e,o,f){if(f){let r=null;const{facetFieldDef:a}=o,u=t.config?t.config:void 0;if(a&&f.labels){const{labelOrient:l}=S3(["labelOrient"],a.header,u,n);(n==="row"&&!Fa(["top","bottom"],l)||n==="column"&&!Fa(["left","right"],l))&&(r=rA(a,n,u))}const c=lf(t)&&!sx(t.facet),i=f.axes,s=i?.length>0;if(r||s){const l=n==="row"?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName(`${n}_${e}`),type:"group",role:`${n}-${e}`},o.facetFieldDef?{from:{data:t.getName(`${n}_domain`)},sort:Mxe(a,n)}:{}),s&&c?{from:{data:t.getName(`facet_domain_${n}`)}}:{}),r?{title:r}:{}),f.sizeSignal?{encode:{update:{[l]:f.sizeSignal}}}:{}),s?{axes:i}:{})}}return null}const Exe={column:{start:0,end:1},row:{start:1,end:0}};function Cxe(t,n){return Exe[n][t]}function Oxe(t,n){const e={};for(const o of dc){const f=t[o];if(f?.facetFieldDef){const{titleAnchor:r,titleOrient:a}=S3(["titleAnchor","titleOrient"],f.facetFieldDef.header,n,o),u=M3(o,a),c=Cxe(r,u);c!==void 0&&(e[u]=c)}}return _o(e)?void 0:e}function Kq(t,n,e,o,f){const r={};for(const a of o){if(!f[a])continue;const u=Fm(a,n?.header,t,e);u!==void 0&&(r[f[a]]=u)}return r}function A8(t){return[...Sb(t,"width"),...Sb(t,"height"),...Sb(t,"childWidth"),...Sb(t,"childHeight")]}function Sb(t,n){const e=n==="width"?"x":"y",o=t.component.layoutSize.get(n);if(!o||o==="merged")return[];const f=t.getSizeSignalRef(n).signal;if(o==="step"){const r=t.getScaleComponent(e);if(r){const a=r.get("type"),u=r.get("range");if(ll(a)&&wp(u)){const c=t.scaleName(e);return lf(t.parent)&&t.parent.component.resolve.scale[e]==="independent"?[RP(c,u)]:[RP(c,u),{name:f,update:Qq(c,r,`domain('${c}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(o=="container"){const r=f.endsWith("width"),a=r?"containerSize()[0]":"containerSize()[1]",u=WT(t.config.view,r?"width":"height"),c=`isFinite(${a}) ? ${a} : ${u}`;return[{name:f,init:c,on:[{update:c,events:"window:resize"}]}]}else return[{name:f,value:o}]}function RP(t,n){const e=`${t}_step`;return Vi(n.step)?{name:e,update:n.step.signal}:{name:e,value:n.step}}function Qq(t,n,e){const o=n.get("type"),f=n.get("padding"),r=Rs(n.get("paddingOuter"),f);let a=n.get("paddingInner");return a=o==="band"?a!==void 0?a:f:1,`bandspace(${e}, ${Hh(a)}, ${Hh(r)}) * ${t}_step`}function eH(t){return t==="childWidth"?"width":t==="childHeight"?"height":t}function tH(t,n){return Xr(t).reduce((e,o)=>{const f=t[o];return Object.assign(Object.assign({},e),r1(n,f,o,r=>Ho(r.value)))},{})}function nH(t,n){if(lf(n))return t==="theta"?"independent":"shared";if(s1(n))return"shared";if(P8(n))return sl(t)||t==="theta"||t==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function M8(t,n){const e=t.scale[n],o=sl(n)?"axis":"legend";return e==="independent"?(t[o][n]==="shared"&&Kr(ume(n)),"independent"):t[o][n]||"shared"}const Lxe=Object.assign(Object.assign({},mve),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),rH=Xr(Lxe);class Pxe extends ad{}const FP={symbols:Dxe,gradient:Ixe,labels:zxe,entries:Rxe};function Dxe(t,{fieldOrDatumDef:n,model:e,channel:o,legendCmpt:f,legendType:r}){var a,u,c,i,s,l,d,h;if(r!=="symbol")return;const{markDef:m,encoding:g,config:p,mark:v}=e,y=m.filled&&v!=="trail";let x=Object.assign(Object.assign({},xge({},e,h1e)),Cq(e,{filled:y}));const w=(a=f.get("symbolOpacity"))!==null&&a!==void 0?a:p.legend.symbolOpacity,k=(u=f.get("symbolFillColor"))!==null&&u!==void 0?u:p.legend.symbolFillColor,b=(c=f.get("symbolStrokeColor"))!==null&&c!==void 0?c:p.legend.symbolStrokeColor,T=w===void 0?(i=iH(g.opacity))!==null&&i!==void 0?i:m.opacity:void 0;if(x.fill){if(o==="fill"||y&&o===zu)delete x.fill;else if(x.fill.field)k?delete x.fill:(x.fill=Ho((s=p.legend.symbolBaseFillColor)!==null&&s!==void 0?s:"black"),x.fillOpacity=Ho(T??1));else if(Ir(x.fill)){const _=(h=(d=iA((l=g.fill)!==null&&l!==void 0?l:g.color))!==null&&d!==void 0?d:m.fill)!==null&&h!==void 0?h:y&&m.color;_&&(x.fill=Ho(_))}}if(x.stroke){if(o==="stroke"||!y&&o===zu)delete x.stroke;else if(x.stroke.field||b)delete x.stroke;else if(Ir(x.stroke)){const _=Rs(iA(g.stroke||g.color),m.stroke,y?m.color:void 0);_&&(x.stroke={value:_})}}if(o!==rd){const _=ti(n)&&oH(e,f,n);_?x.opacity=[Object.assign({test:_},Ho(T??1)),Ho(p.legend.unselectedOpacity)]:T&&(x.opacity=Ho(T))}return x=Object.assign(Object.assign({},x),t),_o(x)?void 0:x}function Ixe(t,{model:n,legendType:e,legendCmpt:o}){var f;if(e!=="gradient")return;const{config:r,markDef:a,encoding:u}=n;let c={};const s=((f=o.get("gradientOpacity"))!==null&&f!==void 0?f:r.legend.gradientOpacity)===void 0?iH(u.opacity)||a.opacity:void 0;return s&&(c.opacity=Ho(s)),c=Object.assign(Object.assign({},c),t),_o(c)?void 0:c}function zxe(t,{fieldOrDatumDef:n,model:e,channel:o,legendCmpt:f}){const r=e.legend(o)||{},a=e.config,u=ti(n)?oH(e,f,n):void 0,c=u?[{test:u,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:i,formatType:s}=r;let l;F0(s)?l=rf({fieldOrDatumDef:n,field:"datum.value",format:i,formatType:s,config:a}):i===void 0&&s===void 0&&a.customFormatTypes&&(n.type==="quantitative"&&a.numberFormatType?l=rf({fieldOrDatumDef:n,field:"datum.value",format:a.numberFormat,formatType:a.numberFormatType,config:a}):n.type==="temporal"&&a.timeFormatType&&ti(n)&&n.timeUnit===void 0&&(l=rf({fieldOrDatumDef:n,field:"datum.value",format:a.timeFormat,formatType:a.timeFormatType,config:a})));const d=Object.assign(Object.assign(Object.assign({},c?{opacity:c}:{}),l?{text:l}:{}),t);return _o(d)?void 0:d}function Rxe(t,{legendCmpt:n}){const e=n.get("selections");return e?.length?Object.assign(Object.assign({},t),{fill:{value:"transparent"}}):t}function iH(t){return aH(t,(n,e)=>Math.max(n,e.value))}function iA(t){return aH(t,(n,e)=>Rs(n,e.value))}function aH(t,n){if(L1e(t))return ki(t.condition).reduce(n,t.value);if(pf(t))return t.value}function oH(t,n,e){const o=n.get("selections");if(!o?.length)return;const f=oi(e.field);return o.map(r=>`(!length(data(${oi(Xo(r)+B0)})) || (${r}[${f}] && indexof(${r}[${f}], datum.value) >= 0))`).join(" || ")}const NP={direction:({direction:t})=>t,format:({fieldOrDatumDef:t,legend:n,config:e})=>{const{format:o,formatType:f}=n;return TV(t,t.type,o,f,e,!1)},formatType:({legend:t,fieldOrDatumDef:n,scaleType:e})=>{const{formatType:o}=t;return AV(o,n,e)},gradientLength:t=>{var n,e;const{legend:o,legendConfig:f}=t;return(e=(n=o.gradientLength)!==null&&n!==void 0?n:f.gradientLength)!==null&&e!==void 0?e:qxe(t)},labelOverlap:({legend:t,legendConfig:n,scaleType:e})=>{var o,f;return(f=(o=t.labelOverlap)!==null&&o!==void 0?o:n.labelOverlap)!==null&&f!==void 0?f:Hxe(e)},symbolType:({legend:t,markDef:n,channel:e,encoding:o})=>{var f;return(f=t.symbolType)!==null&&f!==void 0?f:Nxe(n.type,e,o.shape,n.shape)},title:({fieldOrDatumDef:t,config:n})=>am(t,n,{allowDisabling:!0}),type:({legendType:t,scaleType:n,channel:e})=>{if(im(e)&&nf(n)){if(t==="gradient")return}else if(t==="symbol")return;return t},values:({fieldOrDatumDef:t,legend:n})=>Fxe(n,t)};function Fxe(t,n){const e=t.values;if(Ir(e))return NV(n,e);if(Vi(e))return e}function Nxe(t,n,e,o){var f;if(n!=="shape"){const r=(f=iA(e))!==null&&f!==void 0?f:o;if(r)return r}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function Bxe(t){const{legend:n}=t;return Rs(n.type,jxe(t))}function jxe({channel:t,timeUnit:n,scaleType:e}){if(im(t)){if(Fa(["quarter","month","day"],n))return"symbol";if(nf(e))return"gradient"}return"symbol"}function Uxe({legendConfig:t,legendType:n,orient:e,legend:o}){var f,r;return(r=(f=o.direction)!==null&&f!==void 0?f:t[n?"gradientDirection":"symbolDirection"])!==null&&r!==void 0?r:Vxe(e,n)}function Vxe(t,n){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return n==="gradient"?"horizontal":void 0}}function qxe({legendConfig:t,model:n,direction:e,orient:o,scaleType:f}){const{gradientHorizontalMaxLength:r,gradientHorizontalMinLength:a,gradientVerticalMaxLength:u,gradientVerticalMinLength:c}=t;if(nf(f))return e==="horizontal"?o==="top"||o==="bottom"?BP(n,"width",a,r):a:BP(n,"height",c,u)}function BP(t,n,e,o){return{signal:`clamp(${t.getSizeSignalRef(n).signal}, ${e}, ${o})`}}function Hxe(t){if(Fa(["quantile","threshold","log","symlog"],t))return"greedy"}function sH(t){const n=Is(t)?$xe(t):Xxe(t);return t.component.legends=n,n}function $xe(t){const{encoding:n}=t,e={};for(const o of[zu,...aq]){const f=Ws(n[o]);!f||!t.getScaleComponent(o)||o===Ru&&ti(f)&&f.type===n1||(e[o]=Yxe(t,o))}return e}function Gxe(t,n){const e=t.scaleName(n);if(t.mark==="trail"){if(n==="color")return{stroke:e};if(n==="size")return{strokeWidth:e}}return n==="color"?t.markDef.filled?{fill:e}:{stroke:e}:{[n]:e}}function Wxe(t,n,e,o){switch(n){case"disable":return e!==void 0;case"values":return!!e?.values;case"title":if(n==="title"&&t===o?.title)return!0}return t===(e||{})[n]}function Yxe(t,n){var e,o,f;let r=t.legend(n);const{markDef:a,encoding:u,config:c}=t,i=c.legend,s=new Pxe({},Gxe(t,n));ixe(t,n,s);const l=r!==void 0?!r:i.disable;if(s.set("disable",l,r!==void 0),l)return s;r=r||{};const d=t.getScaleComponent(n).get("type"),h=Ws(u[n]),m=ti(h)?(e=Gl(h.timeUnit))===null||e===void 0?void 0:e.unit:void 0,g=r.orient||c.legend.orient||"right",p=Bxe({legend:r,channel:n,timeUnit:m,scaleType:d}),v=Uxe({legend:r,legendType:p,orient:g,legendConfig:i}),y={legend:r,channel:n,model:t,markDef:a,encoding:u,fieldOrDatumDef:h,legendConfig:i,config:c,scaleType:d,orient:g,legendType:p,direction:v};for(const T of rH){if(p==="gradient"&&T.startsWith("symbol")||p==="symbol"&&T.startsWith("gradient"))continue;const _=T in NP?NP[T](y):r[T];if(_!==void 0){const M=Wxe(_,T,r,t.fieldDef(n));(M||c.legend[T]===void 0)&&s.set(T,_,M)}}const x=(o=r?.encoding)!==null&&o!==void 0?o:{},w=s.get("selections"),k={},b={fieldOrDatumDef:h,model:t,channel:n,legendCmpt:s,legendType:p};for(const T of["labels","legend","title","symbols","gradient","entries"]){const _=tH((f=x[T])!==null&&f!==void 0?f:{},t),M=T in FP?FP[T](_,b):_;M!==void 0&&!_o(M)&&(k[T]=Object.assign(Object.assign(Object.assign({},w?.length&&ti(h)?{name:`${Xo(h.field)}_legend_${T}`}:{}),w?.length?{interactive:!!w}:{}),{update:M}))}return _o(k)||s.set("encode",k,!!r?.encoding),s}function Xxe(t){const{legends:n,resolve:e}=t.component;for(const o of t.children){sH(o);for(const f of Xr(o.component.legends))e.legend[f]=M8(t.component.resolve,f),e.legend[f]==="shared"&&(n[f]=lH(n[f],o.component.legends[f]),n[f]||(e.legend[f]="independent",delete n[f]))}for(const o of Xr(n))for(const f of t.children)!f.component.legends[o]||e.legend[o]==="shared"&&delete f.component.legends[o];return n}function lH(t,n){var e,o,f,r;if(!t)return n.clone();const a=t.getWithExplicit("orient"),u=n.getWithExplicit("orient");if(a.explicit&&u.explicit&&a.value!==u.value)return;let c=!1;for(const i of rH){const s=ap(t.getWithExplicit(i),n.getWithExplicit(i),i,"legend",(l,d)=>{switch(i){case"symbolType":return Zxe(l,d);case"title":return YU(l,d);case"type":return c=!0,Gu("symbol")}return k3(l,d,i,"legend")});t.setWithExplicit(i,s)}return c&&(!((o=(e=t.implicit)===null||e===void 0?void 0:e.encode)===null||o===void 0)&&o.gradient&&k2(t.implicit,["encode","gradient"]),!((r=(f=t.explicit)===null||f===void 0?void 0:f.encode)===null||r===void 0)&&r.gradient&&k2(t.explicit,["encode","gradient"])),t}function Zxe(t,n){return n.value==="circle"?n:t}var Jxe=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);fQxe(f,t.config)).filter(f=>f!==void 0)}function Qxe(t,n){var e,o,f;const r=t.combine(),{disable:a,labelExpr:u,selections:c}=r,i=Jxe(r,["disable","labelExpr","selections"]);if(!a){if(n.aria===!1&&i.aria==null&&(i.aria=!1),!((e=i.encode)===null||e===void 0)&&e.symbols){const s=i.encode.symbols.update;s.fill&&s.fill.value!=="transparent"&&!s.stroke&&!i.stroke&&(s.stroke={value:"transparent"});for(const l of aq)i[l]&&delete s[l]}if(i.title||delete i.title,u!==void 0){let s=u;((f=(o=i.encode)===null||o===void 0?void 0:o.labels)===null||f===void 0?void 0:f.update)&&Vi(i.encode.labels.update.text)&&(s=P0(u,"datum.label",i.encode.labels.update.text.signal)),Kxe(i,"labels","text",{signal:s})}return i}}function ebe(t){return s1(t)||P8(t)?tbe(t):cH(t)}function tbe(t){return t.children.reduce((n,e)=>n.concat(e.assembleProjections()),cH(t))}function cH(t){const n=t.component.projection;if(!n||n.merged)return[];const e=n.combine(),{name:o}=e;if(n.data){const f={signal:`[${n.size.map(a=>a.signal).join(", ")}]`},r=n.data.reduce((a,u)=>{const c=Vi(u)?u.signal:`data('${t.lookupDataSource(u)}')`;return Fa(a,c)||a.push(c),a},[]);if(r.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:o,size:f,fit:{signal:r.length>1?`[${r.join(", ")}]`:r[0]}},e)]}else return[Object.assign(Object.assign({name:o},{translate:{signal:"[width / 2, height / 2]"}}),e)]}const nbe=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class fH extends ad{constructor(n,e,o,f){super(Object.assign({},e),{name:n}),this.specifiedProjection=e,this.size=o,this.data=f,this.merged=!1}get isFit(){return!!this.data}}function hH(t){t.component.projection=Is(t)?rbe(t):obe(t)}function rbe(t){var n;if(t.hasProjection){const e=Tu(t.specifiedProjection),o=!(e&&(e.scale!=null||e.translate!=null)),f=o?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,r=o?ibe(t):void 0,a=new fH(t.projectionName(!0),Object.assign(Object.assign({},(n=Tu(t.config.projection))!==null&&n!==void 0?n:{}),e??{}),f,r);return a.get("type")||a.set("type","equalEarth",!1),a}}function ibe(t){const n=[],{encoding:e}=t;for(const o of[[fh,ch],[_c,bf]])(Ws(e[o[0]])||Ws(e[o[1]]))&&n.push({signal:t.getName(`geojson_${n.length}`)});return t.channelHasField(Ru)&&t.typedFieldDef(Ru).type===n1&&n.push({signal:t.getName(`geojson_${n.length}`)}),n.length===0&&n.push(t.requestDataName(Fo.Main)),n}function abe(t,n){const e=vE(nbe,f=>!!(!qi(t.explicit,f)&&!qi(n.explicit,f)||qi(t.explicit,f)&&qi(n.explicit,f)&&Uf(t.get(f),n.get(f))));if(Uf(t.size,n.size)){if(e)return t;if(Uf(t.explicit,{}))return n;if(Uf(n.explicit,{}))return t}return null}function obe(t){if(t.children.length===0)return;let n;for(const o of t.children)hH(o);const e=vE(t.children,o=>{const f=o.component.projection;if(f)if(n){const r=abe(n,f);return r&&(n=r),!!r}else return n=f,!0;else return!0});if(n&&e){const o=t.projectionName(!0),f=new fH(o,n.specifiedProjection,n.size,ha(n.data));for(const r of t.children){const a=r.component.projection;a&&(a.isFit&&f.data.push(...r.component.projection.data),r.renameProjection(a.get("name"),o),a.merged=!0)}return f}}var sbe=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f{if(wc(r)&&Bo(r.bin)){const{key:u,binComponent:c}=jP(r,r.bin,e);f[u]=Object.assign(Object.assign(Object.assign({},c),f[u]),lbe(e,r,a,e.config))}return f},{});return _o(o)?null:new Xf(n,o)}static makeFromTransform(n,e,o){const{key:f,binComponent:r}=jP(e,e.bin,o);return new Xf(n,{[f]:r})}merge(n,e){for(const o of Xr(n.bins))o in this.bins?(e(n.bins[o].signal,this.bins[o].signal),this.bins[o].as=Vf([...this.bins[o].as,...n.bins[o].as],Ba)):this.bins[o]=n.bins[o];for(const o of n.children)n.removeChild(o),o.parent=this;n.remove()}producedFields(){return new Set(ql(this.bins).map(n=>n.as).flat(2))}dependentFields(){return new Set(ql(this.bins).map(n=>n.field))}hash(){return`Bin ${Ba(this.bins)}`}assemble(){return ql(this.bins).flatMap(n=>{const e=[],[o,...f]=n.as,r=n.bin,{extent:a}=r,u=sbe(r,["extent"]),c=Object.assign(Object.assign(Object.assign({type:"bin",field:bc(n.field),as:o,signal:n.signal},s3(a)?{extent:null}:{extent:a}),n.span?{span:{signal:`span(${n.span})`}}:{}),u);!a&&n.extentSignal&&(e.push({type:"extent",field:bc(n.field),signal:n.extentSignal}),c.extent={signal:n.extentSignal}),e.push(c);for(const i of f)for(let s=0;s<2;s++)e.push({type:"formula",expr:hi({field:o[s]},{expr:"datum"}),as:i[s]});return n.formula&&e.push({type:"formula",expr:n.formula,as:n.formulaAs}),e})}}function fbe(t,n,e,o){var f;const r=Is(o)?o.encoding[ph(n)]:void 0;if(wc(e)&&Is(o)&&LV(e,r,o.markDef,o.config))t.add(hi(e,{})),t.add(hi(e,{suffix:"end"})),e.bin&&ux(e,n)&&t.add(hi(e,{binSuffix:"range"}));else if(q0e(n)){const a=V0e(n);t.add(o.getName(a))}else t.add(hi(e));return eg(e)&&e1e((f=e.scale)===null||f===void 0?void 0:f.range)&&t.add(e.scale.range.field),t}function hbe(t,n){var e;for(const o of Xr(n)){const f=n[o];for(const r of Xr(f))o in t?t[o][r]=new Set([...(e=t[o][r])!==null&&e!==void 0?e:[],...f[r]]):t[o]={[r]:f[r]}}}class sf extends To{constructor(n,e,o){super(n),this.dimensions=e,this.measures=o}clone(){return new sf(null,new Set(this.dimensions),ha(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(n,e){let o=!1;e.forEachFieldDef(a=>{a.aggregate&&(o=!0)});const f={},r=new Set;return!o||(e.forEachFieldDef((a,u)=>{var c,i,s,l;const{aggregate:d,field:h}=a;if(d)if(d==="count")(c=f["*"])!==null&&c!==void 0||(f["*"]={}),f["*"].count=new Set([hi(a,{forAs:!0})]);else{if(Xh(d)||_p(d)){const m=Xh(d)?"argmin":"argmax",g=d[m];(i=f[g])!==null&&i!==void 0||(f[g]={}),f[g][m]=new Set([hi({op:m,field:g},{forAs:!0})])}else(s=f[h])!==null&&s!==void 0||(f[h]={}),f[h][d]=new Set([hi(a,{forAs:!0})]);bp(u)&&e.scaleDomain(u)==="unaggregated"&&((l=f[h])!==null&&l!==void 0||(f[h]={}),f[h].min=new Set([hi({field:h,aggregate:"min"},{forAs:!0})]),f[h].max=new Set([hi({field:h,aggregate:"max"},{forAs:!0})]))}else fbe(r,u,a,e)}),r.size+Xr(f).length===0)?null:new sf(n,r,f)}static makeFromTransform(n,e){var o,f,r;const a=new Set,u={};for(const c of e.aggregate){const{op:i,field:s,as:l}=c;i&&(i==="count"?((o=u["*"])!==null&&o!==void 0||(u["*"]={}),u["*"].count=new Set([l||hi(c,{forAs:!0})])):((f=u[s])!==null&&f!==void 0||(u[s]={}),u[s][i]=new Set([l||hi(c,{forAs:!0})])))}for(const c of(r=e.groupby)!==null&&r!==void 0?r:[])a.add(c);return a.size+Xr(u).length===0?null:new sf(n,a,u)}merge(n){return wU(this.dimensions,n.dimensions)?(hbe(this.measures,n.measures),!0):(Ame("different dimensions, cannot merge"),!1)}addDimensions(n){n.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Xr(this.measures)])}producedFields(){const n=new Set;for(const e of Xr(this.measures))for(const o of Xr(this.measures[e])){const f=this.measures[e][o];f.size===0?n.add(`${o}_${e}`):f.forEach(n.add,n)}return n}hash(){return`Aggregate ${Ba({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const n=[],e=[],o=[];for(const r of Xr(this.measures))for(const a of Xr(this.measures[r]))for(const u of this.measures[r][a])o.push(u),n.push(a),e.push(r==="*"?null:bc(r));return{type:"aggregate",groupby:[...this.dimensions].map(bc),ops:n,fields:e,as:o}}}class a1 extends To{constructor(n,e,o,f){super(n),this.model=e,this.name=o,this.data=f;for(const r of dc){const a=e.facet[r];if(a){const{bin:u,sort:c}=a;this[r]=Object.assign({name:e.getName(`${r}_domain`),fields:[hi(a),...Bo(u)?[hi(a,{binSuffix:"end"})]:[]]},Wf(c)?{sortField:c}:Ir(c)?{sortIndexField:Rm(a,r)}:{})}}this.childModel=e.child}hash(){let n="Facet";for(const e of dc)this[e]&&(n+=` ${e.charAt(0)}:${Ba(this[e])}`);return n}get fields(){var n;const e=[];for(const o of dc)!((n=this[o])===null||n===void 0)&&n.fields&&e.push(...this[o].fields);return e}dependentFields(){const n=new Set(this.fields);for(const e of dc)this[e]&&(this[e].sortField&&n.add(this[e].sortField.field),this[e].sortIndexField&&n.add(this[e].sortIndexField));return n}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const n={};for(const e of gh){const o=this.childModel.component.scales[e];if(o&&!o.merged){const f=o.get("type"),r=o.get("range");if(ll(f)&&wp(r)){const a=E3(this.childModel,e),u=L8(a);u?n[e]=u:Kr(LE(e))}}}return n}assembleRowColumnHeaderData(n,e,o){const f={row:"y",column:"x",facet:void 0}[n],r=[],a=[],u=[];f&&o&&o[f]&&(e?(r.push(`distinct_${o[f]}`),a.push("max")):(r.push(o[f]),a.push("distinct")),u.push(`distinct_${o[f]}`));const{sortField:c,sortIndexField:i}=this[n];if(c){const{op:s=d3,field:l}=c;r.push(l),a.push(s),u.push(hi(c,{forAs:!0}))}else i&&(r.push(i),a.push("max"),u.push(i));return{name:this[n].name,source:e??this.data,transform:[Object.assign({type:"aggregate",groupby:this[n].fields},r.length?{fields:r,ops:a,as:u}:{})]}}assembleFacetHeaderData(n){var e,o;const{columns:f}=this.model.layout,{layoutHeaders:r}=this.model.component,a=[],u={};for(const s of k8){for(const l of T8){const d=(e=r[s]&&r[s][l])!==null&&e!==void 0?e:[];for(const h of d)if(((o=h.axes)===null||o===void 0?void 0:o.length)>0){u[s]=!0;break}}if(u[s]){const l=`length(data("${this.facet.name}"))`,d=s==="row"?f?{signal:`ceil(${l} / ${f})`}:1:f?{signal:`min(${l}, ${f})`}:{signal:l};a.push({name:`${this.facet.name}_${s}`,transform:[{type:"sequence",start:0,stop:d}]})}}const{row:c,column:i}=u;return(c||i)&&a.unshift(this.assembleRowColumnHeaderData("facet",null,n)),a}assemble(){var n,e;const o=[];let f=null;const r=this.getChildIndependentFieldsWithStep(),{column:a,row:u,facet:c}=this;if(a&&u&&(r.x||r.y)){f=`cross_${this.column.name}_${this.row.name}`;const i=[].concat((n=r.x)!==null&&n!==void 0?n:[],(e=r.y)!==null&&e!==void 0?e:[]),s=i.map(()=>"distinct");o.push({name:f,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:i,ops:s}]})}for(const i of[qh,Vh])this[i]&&o.push(this.assembleRowColumnHeaderData(i,f,r));if(c){const i=this.assembleFacetHeaderData(r);i&&o.push(...i)}return o}}function UP(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function dbe(t,n){const e=bE(t);if(n==="number")return`toNumber(${e})`;if(n==="boolean")return`toBoolean(${e})`;if(n==="string")return`toString(${e})`;if(n==="date")return`toDate(${e})`;if(n==="flatten")return e;if(n.startsWith("date:")){const o=UP(n.slice(5,n.length));return`timeParse(${e},'${o}')`}else if(n.startsWith("utc:")){const o=UP(n.slice(4,n.length));return`utcParse(${e},'${o}')`}else return Kr(Pge(n)),null}function pbe(t){const n={};return l_(t.filter,e=>{var o;if(sV(e)){let f=null;RE(e)?f=Xu(e.equal):NE(e)?f=Xu(e.lte):FE(e)?f=Xu(e.lt):BE(e)?f=Xu(e.gt):jE(e)?f=Xu(e.gte):UE(e)?f=e.range[0]:VE(e)&&(f=((o=e.oneOf)!==null&&o!==void 0?o:e.in)[0]),f&&(Q0(f)?n[e.field]="date":wo(f)?n[e.field]="number":bi(f)&&(n[e.field]="string")),e.timeUnit&&(n[e.field]="date")}}),n}function gbe(t){const n={};function e(o){Pm(o)?n[o.field]="date":o.type==="quantitative"&&uge(o.aggregate)?n[o.field]="number":Mm(o.field)>1?o.field in n||(n[o.field]="flatten"):eg(o)&&Wf(o.sort)&&Mm(o.sort.field)>1&&(o.sort.field in n||(n[o.sort.field]="flatten"))}if((Is(t)||lf(t))&&t.forEachFieldDef((o,f)=>{if(wc(o))e(o);else{const r=J0(f),a=t.fieldDef(r);e(Object.assign(Object.assign({},o),{type:a.type}))}}),Is(t)){const{mark:o,markDef:f,encoding:r}=t;if(kp(o)&&!t.encoding.order){const a=f.orient==="horizontal"?"y":"x",u=r[a];ti(u)&&u.type==="quantitative"&&!(u.field in n)&&(n[u.field]="number")}}return n}function mbe(t){const n={};if(Is(t)&&t.component.selection)for(const e of Xr(t.component.selection)){const o=t.component.selection[e];for(const f of o.project.items)!f.channel&&Mm(f.field)>1&&(n[f.field]="flatten")}return n}class Nl extends To{constructor(n,e){super(n),this._parse=e}clone(){return new Nl(null,ha(this._parse))}hash(){return`Parse ${Ba(this._parse)}`}static makeExplicit(n,e,o){var f;let r={};const a=e.data;return!$d(a)&&((f=a?.format)===null||f===void 0?void 0:f.parse)&&(r=a.format.parse),this.makeWithAncestors(n,r,{},o)}static makeWithAncestors(n,e,o,f){for(const u of Xr(o)){const c=f.getWithExplicit(u);c.value!==void 0&&(c.explicit||c.value===o[u]||c.value==="derived"||o[u]==="flatten"?delete o[u]:Kr(tP(u,o[u],c.value)))}for(const u of Xr(e)){const c=f.get(u);c!==void 0&&(c===e[u]?delete e[u]:Kr(tP(u,e[u],c)))}const r=new ad(e,o);f.copyAll(r);const a={};for(const u of Xr(r.combine())){const c=r.get(u);c!==null&&(a[u]=c)}return Xr(a).length===0||f.parseNothing?null:new Nl(n,a)}get parse(){return this._parse}merge(n){this._parse=Object.assign(Object.assign({},this._parse),n.parse),n.remove()}assembleFormatParse(){const n={};for(const e of Xr(this._parse)){const o=this._parse[e];Mm(e)===1&&(n[e]=o)}return n}producedFields(){return new Set(Xr(this._parse))}dependentFields(){return new Set(Xr(this._parse))}assembleTransforms(n=!1){return Xr(this._parse).filter(e=>n?Mm(e)>1:!0).map(e=>{const o=dbe(e,this._parse[e]);return o?{type:"formula",expr:o,as:_E(e)}:null}).filter(e=>e!==null)}}class up extends To{clone(){return new up(null)}constructor(n){super(n)}dependentFields(){return new Set}producedFields(){return new Set([nh])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:nh}}}class hx extends To{constructor(n,e){super(n),this.params=e}clone(){return new hx(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Ba(this.params)}`}assemble(){return Object.assign({type:"graticule"},this.params===!0?{}:this.params)}}class dx extends To{constructor(n,e){super(n),this.params=e}clone(){return new dx(null,this.params)}dependentFields(){return new Set}producedFields(){var n;return new Set([(n=this.params.as)!==null&&n!==void 0?n:"data"])}hash(){return`Hash ${Ba(this.params)}`}assemble(){return Object.assign({type:"sequence"},this.params)}}class j0 extends To{constructor(n){super(null),n??(n={name:"source"});let e;if($d(n)||(e=n.format?Object.assign({},Eu(n.format,["parse"])):{}),py(n))this._data={values:n.values};else if(Dm(n)){if(this._data={url:n.url},!e.type){let o=/(?:\.([^.]+))?$/.exec(n.url)[1];Fa(["json","csv","tsv","dsv","topojson"],o)||(o="json"),e.type=o}}else Tq(n)?this._data={values:[{type:"Sphere"}]}:(wq(n)||$d(n))&&(this._data={});this._generator=$d(n),n.name&&(this._name=n.name),e&&!_o(e)&&(this._data.format=e)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(n){this._name=n}set parent(n){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var VP=globalThis&&globalThis.__classPrivateFieldSet||function(t,n,e,o,f){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?t!==n||!f:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?f.call(t,e):f?f.value=e:n.set(t,e),e},vbe=globalThis&&globalThis.__classPrivateFieldGet||function(t,n,e,o){if(e==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?t!==n||!o:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?o:e==="a"?o.call(t):o?o.value:n.get(t)},Av;function E8(t){return t instanceof j0||t instanceof hx||t instanceof dx}class C8{constructor(){Av.set(this,void 0),VP(this,Av,!1,"f")}setModified(){VP(this,Av,!0,"f")}get modifiedFlag(){return vbe(this,Av,"f")}}Av=new WeakMap;class tg extends C8{getNodeDepths(n,e,o){o.set(n,e);for(const f of n.children)this.getNodeDepths(f,e+1,o);return o}optimize(n){const o=[...this.getNodeDepths(n,0,new Map).entries()].sort((f,r)=>r[1]-f[1]);for(const f of o)this.run(f[0]);return this.modifiedFlag}}class O8 extends C8{optimize(n){this.run(n);for(const e of n.children)this.optimize(e);return this.modifiedFlag}}class ybe extends O8{mergeNodes(n,e){const o=e.shift();for(const f of e)n.removeChild(f),f.parent=o,f.remove()}run(n){const e=n.children.map(f=>f.hash()),o={};for(let f=0;f1&&(this.setModified(),this.mergeNodes(n,o[f]))}}class xbe extends O8{constructor(n){super(),this.requiresSelectionId=n&&w8(n)}run(n){n instanceof up&&(this.requiresSelectionId&&(E8(n.parent)||n.parent instanceof sf||n.parent instanceof Nl)||(this.setModified(),n.remove()))}}class bbe extends C8{optimize(n){return this.run(n,new Set),this.modifiedFlag}run(n,e){let o=new Set;n instanceof Yf&&(o=n.producedFields(),yE(o,e)&&(this.setModified(),n.removeFormulas(e),n.producedFields.length===0&&n.remove()));for(const f of n.children)this.run(f,new Set([...e,...o]))}}class _be extends O8{constructor(){super()}run(n){n instanceof hu&&!n.isRequired()&&(this.setModified(),n.remove())}}class wbe extends tg{run(n){if(!E8(n)&&!(n.numChildren()>1)){for(const e of n.children)if(e instanceof Nl)if(n instanceof Nl)this.setModified(),n.merge(e);else{if(xE(n.producedFields(),e.dependentFields()))continue;this.setModified(),e.swapWithParent()}}}}class kbe extends tg{run(n){const e=[...n.children],o=n.children.filter(f=>f instanceof Nl);if(n.numChildren()>1&&o.length>=1){const f={},r=new Set;for(const a of o){const u=a.parse;for(const c of Xr(u))c in f?f[c]!==u[c]&&r.add(c):f[c]=u[c]}for(const a of r)delete f[a];if(!_o(f)){this.setModified();const a=new Nl(n,f);for(const u of e){if(u instanceof Nl)for(const c of Xr(f))delete u.parse[c];n.removeChild(u),u.parent=a,u instanceof Nl&&Xr(u.parse).length===0&&u.remove()}}}}}class Tbe extends tg{run(n){n instanceof hu||n.numChildren()>0||n instanceof a1||n instanceof j0||(this.setModified(),n.remove())}}class Abe extends tg{run(n){const e=n.children.filter(f=>f instanceof Yf),o=e.pop();for(const f of e)this.setModified(),o.merge(f)}}class Mbe extends tg{run(n){const e=n.children.filter(f=>f instanceof sf),o={};for(const f of e){const r=Ba(f.groupBy);r in o||(o[r]=[]),o[r].push(f)}for(const f of Xr(o)){const r=o[f];if(r.length>1){const a=r.pop();for(const u of r)a.merge(u)&&(n.removeChild(u),u.parent=a,u.remove(),this.setModified())}}}}class Sbe extends tg{constructor(n){super(),this.model=n}run(n){const e=!(E8(n)||n instanceof i1||n instanceof Nl||n instanceof up),o=[],f=[];for(const r of n.children)r instanceof Xf&&(e&&!xE(n.producedFields(),r.dependentFields())?o.push(r):f.push(r));if(o.length>0){const r=o.pop();for(const a of o)r.merge(a,this.model.renameSignal.bind(this.model));this.setModified(),n instanceof Xf?n.merge(r,this.model.renameSignal.bind(this.model)):r.swapWithParent()}if(f.length>1){const r=f.pop();for(const a of f)r.merge(a,this.model.renameSignal.bind(this.model));this.setModified()}}}class Ebe extends tg{run(n){const e=[...n.children];if(!L0(e,a=>a instanceof hu)||n.numChildren()<=1)return;const f=[];let r;for(const a of e)if(a instanceof hu){let u=a;for(;u.numChildren()===1;){const[c]=u.children;if(c instanceof hu)u=c;else break}f.push(...u.children),r?(n.removeChild(a),a.parent=r.parent,r.parent.removeChild(r),r.parent=u,this.setModified()):r=u}else f.push(a);if(f.length){this.setModified();for(const a of f)a.parent.removeChild(a),a.parent=r}}}class ng extends To{constructor(n,e){super(n),this.transform=e}clone(){return new ng(null,ha(this.transform))}addDimensions(n){this.transform.groupby=Vf(this.transform.groupby.concat(n),e=>e)}dependentFields(){const n=new Set;return this.transform.groupby&&this.transform.groupby.forEach(n.add,n),this.transform.joinaggregate.map(e=>e.field).filter(e=>e!==void 0).forEach(n.add,n),n}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(n){var e;return(e=n.as)!==null&&e!==void 0?e:hi(n)}hash(){return`JoinAggregateTransform ${Ba(this.transform)}`}assemble(){const n=[],e=[],o=[];for(const r of this.transform.joinaggregate)e.push(r.op),o.push(this.getDefaultName(r)),n.push(r.field===void 0?null:r.field);const f=this.transform.groupby;return Object.assign({type:"joinaggregate",as:o,ops:e,fields:n},f!==void 0?{groupby:f}:{})}}function Cbe(t){return t.stack.stackBy.reduce((n,e)=>{const o=e.fieldDef,f=hi(o);return f&&n.push(f),n},[])}function Obe(t){return Ir(t)&&t.every(n=>bi(n))&&t.length>1}class $h extends To{constructor(n,e){super(n),this._stack=e}clone(){return new $h(null,ha(this._stack))}static makeFromTransform(n,e){const{stack:o,groupby:f,as:r,offset:a="zero"}=e,u=[],c=[];if(e.sort!==void 0)for(const l of e.sort)u.push(l.field),c.push(Rs(l.order,"ascending"));const i={field:u,order:c};let s;return Obe(r)?s=r:bi(r)?s=[r,`${r}_end`]:s=[`${e.stack}_start`,`${e.stack}_end`],new $h(n,{dimensionFieldDefs:[],stackField:o,groupby:f,offset:a,sort:i,facetby:[],as:s})}static makeFromEncoding(n,e){const o=e.stack,{encoding:f}=e;if(!o)return null;const{groupbyChannels:r,fieldChannel:a,offset:u,impute:c}=o,i=r.map(h=>{const m=f[h];return th(m)}).filter(h=>!!h),s=Cbe(e),l=e.encoding.order;let d;return Ir(l)||ti(l)?d=$U(l):d=s.reduce((h,m)=>(h.field.push(m),h.order.push(a==="y"?"descending":"ascending"),h),{field:[],order:[]}),new $h(n,{dimensionFieldDefs:i,stackField:e.vgField(a),facetby:[],stackby:s,sort:d,offset:u,impute:c,as:[e.vgField(a,{suffix:"start",forAs:!0}),e.vgField(a,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(n){this._stack.facetby.push(...n)}dependentFields(){const n=new Set;return n.add(this._stack.stackField),this.getGroupbyFields().forEach(n.add,n),this._stack.facetby.forEach(n.add,n),this._stack.sort.field.forEach(n.add,n),n}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Ba(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:n,impute:e,groupby:o}=this._stack;return n.length>0?n.map(f=>f.bin?e?[hi(f,{binSuffix:"mid"})]:[hi(f,{}),hi(f,{binSuffix:"end"})]:[hi(f)]).flat():o??[]}assemble(){const n=[],{facetby:e,dimensionFieldDefs:o,stackField:f,stackby:r,sort:a,offset:u,impute:c,as:i}=this._stack;if(c)for(const s of o){const{bandPosition:l=.5,bin:d}=s;if(d){const h=hi(s,{expr:"datum"}),m=hi(s,{expr:"datum",binSuffix:"end"});n.push({type:"formula",expr:`${l}*${h}+${1-l}*${m}`,as:hi(s,{binSuffix:"mid",forAs:!0})})}n.push({type:"impute",field:f,groupby:[...r,...e],key:hi(s,{binSuffix:"mid"}),method:"value",value:0})}return n.push({type:"stack",groupby:[...this.getGroupbyFields(),...e],field:f,sort:a,as:i,offset:u}),n}}class o1 extends To{constructor(n,e){super(n),this.transform=e}clone(){return new o1(null,ha(this.transform))}addDimensions(n){this.transform.groupby=Vf(this.transform.groupby.concat(n),e=>e)}dependentFields(){var n,e;const o=new Set;return((n=this.transform.groupby)!==null&&n!==void 0?n:[]).forEach(o.add,o),((e=this.transform.sort)!==null&&e!==void 0?e:[]).forEach(f=>o.add(f.field)),this.transform.window.map(f=>f.field).filter(f=>f!==void 0).forEach(o.add,o),o}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(n){var e;return(e=n.as)!==null&&e!==void 0?e:hi(n)}hash(){return`WindowTransform ${Ba(this.transform)}`}assemble(){var n;const e=[],o=[],f=[],r=[];for(const d of this.transform.window)o.push(d.op),f.push(this.getDefaultName(d)),r.push(d.param===void 0?null:d.param),e.push(d.field===void 0?null:d.field);const a=this.transform.frame,u=this.transform.groupby;if(a&&a[0]===null&&a[1]===null&&o.every(d=>EE(d)))return Object.assign({type:"joinaggregate",as:f,ops:o,fields:e},u!==void 0?{groupby:u}:{});const c=[],i=[];if(this.transform.sort!==void 0)for(const d of this.transform.sort)c.push(d.field),i.push((n=d.order)!==null&&n!==void 0?n:"ascending");const s={field:c,order:i},l=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:r,as:f,ops:o,fields:e,sort:s},l!==void 0?{ignorePeers:l}:{}),u!==void 0?{groupby:u}:{}),a!==void 0?{frame:a}:{})}}function Lbe(t){function n(e){if(!(e instanceof a1)){const o=e.clone();if(o instanceof hu){const f=oA+o.getSource();o.setSource(f),t.model.component.data.outputNodes[f]=o}else(o instanceof sf||o instanceof $h||o instanceof o1||o instanceof ng)&&o.addDimensions(t.fields);for(const f of e.children.flatMap(n))f.parent=o;return[o]}return e.children.flatMap(n)}return n}function aA(t){if(t instanceof a1)if(t.numChildren()===1&&!(t.children[0]instanceof hu)){const n=t.children[0];(n instanceof sf||n instanceof $h||n instanceof o1||n instanceof ng)&&n.addDimensions(t.fields),n.swapWithParent(),aA(t)}else{const n=t.model.component.data.main;pH(n);const e=Lbe(t),o=t.children.map(e).flat();for(const f of o)f.parent=n}else t.children.map(aA)}function pH(t){if(t instanceof hu&&t.type===Fo.Main&&t.numChildren()===1){const n=t.children[0];n instanceof a1||(n.swapWithParent(),pH(t))}}const oA="scale_",Eb=5;function sA(t){for(const n of t){for(const e of n.children)if(e.parent!==n)return!1;if(!sA(n.children))return!1}return!0}function Uc(t,n){let e=!1;for(const o of n)e=t.optimize(o)||e;return e}function qP(t,n,e){let o=t.sources,f=!1;return f=Uc(new _be,o)||f,f=Uc(new xbe(n),o)||f,o=o.filter(r=>r.numChildren()>0),f=Uc(new Tbe,o)||f,o=o.filter(r=>r.numChildren()>0),e||(f=Uc(new wbe,o)||f,f=Uc(new Sbe(n),o)||f,f=Uc(new bbe,o)||f,f=Uc(new kbe,o)||f,f=Uc(new Mbe,o)||f,f=Uc(new Abe,o)||f,f=Uc(new ybe,o)||f,f=Uc(new Ebe,o)||f),t.sources=o,f}function Pbe(t,n){sA(t.sources);let e=0,o=0;for(let f=0;fn(e))}}var Dbe=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f({signal:`{data: ${y3(o,{timeUnit:e,type:n})}}`}))}function z4(t,n,e){var o;const f=(o=Gl(e))===null||o===void 0?void 0:o.unit;return n==="temporal"||f?Nbe(t,n,f):[t]}function bd(t,n,e,o){const{encoding:f}=e,r=Ws(f[o]),{type:a}=r,u=r.timeUnit;if(Qme(n)){const l=bd(t,void 0,e,o),d=z4(n.unionWith,a,u);return If([...d,...l.value])}else{if(Vi(n))return If([n]);if(n&&n!=="unaggregated"&&!pV(n))return If(z4(n,a,u))}const c=e.stack;if(c&&o===c.fieldChannel){if(c.offset==="normalize")return Gu([[0,1]]);const l=e.requestDataName(Fo.Main);return Gu([{data:l,field:e.vgField(o,{suffix:"start"})},{data:l,field:e.vgField(o,{suffix:"end"})}])}const i=bp(o)&&ti(r)?jbe(e,o,t):void 0;if(mh(r)){const l=z4([r.datum],a,u);return Gu(l)}const s=r;if(n==="unaggregated"){const l=e.requestDataName(Fo.Main),{field:d}=r;return Gu([{data:l,field:hi({field:d,aggregate:"min"})},{data:l,field:hi({field:d,aggregate:"max"})}])}else if(Bo(s.bin)){if(ll(t))return Gu(t==="bin-ordinal"?[]:[{data:fy(i)?e.requestDataName(Fo.Main):e.requestDataName(Fo.Raw),field:e.vgField(o,ux(s,o)?{binSuffix:"range"}:{}),sort:i===!0||!Ei(i)?{field:e.vgField(o,{}),op:"min"}:i}]);{const{bin:l}=s;if(Bo(l)){const d=S8(e,s.field,l);return Gu([new Ou(()=>{const h=e.getSignalName(d);return`[${h}.start, ${h}.stop]`})])}else return Gu([{data:e.requestDataName(Fo.Main),field:e.vgField(o,{})}])}}else if(s.timeUnit&&Fa(["time","utc"],t)&&LV(s,Is(e)?e.encoding[ph(o)]:void 0,e.markDef,e.config)){const l=e.requestDataName(Fo.Main);return Gu([{data:l,field:e.vgField(o)},{data:l,field:e.vgField(o,{suffix:"end"})}])}else return Gu(i?[{data:fy(i)?e.requestDataName(Fo.Main):e.requestDataName(Fo.Raw),field:e.vgField(o),sort:i}]:[{data:e.requestDataName(Fo.Main),field:e.vgField(o)}])}function R4(t,n){const{op:e,field:o,order:f}=t;return Object.assign(Object.assign({op:e??(n?"sum":d3)},o?{field:bc(o)}:{}),f?{order:f}:{})}function Bbe(t,n){var e;const o=t.component.scales[n],f=t.specifiedScales[n].domain,r=(e=t.fieldDef(n))===null||e===void 0?void 0:e.bin,a=pV(f)&&f,u=K0(r)&&s3(r.extent)&&r.extent;(a||u)&&o.set("selectionExtent",a??u,!0)}function jbe(t,n,e){if(!ll(e))return;const o=t.fieldDef(n),f=o.sort;if(EV(f))return{op:"min",field:Rm(o,n),order:"ascending"};const{stack:r}=t,a=r?new Set([...r.groupbyFields,...r.stackBy.map(u=>u.fieldDef.field)]):void 0;if(Wf(f)){const u=r&&!a.has(f.field);return R4(f,u)}else if(SV(f)){const{encoding:u,order:c}=f,i=t.fieldDef(u),{aggregate:s,field:l}=i,d=r&&!a.has(l);if(Xh(s)||_p(s))return R4({field:hi(i),order:c},d);if(EE(s)||!s)return R4({op:s,field:l,order:c},d)}else{if(f==="descending")return{op:"min",field:t.vgField(n),order:"descending"};if(Fa(["ascending",void 0],f))return!0}}function HP(t,n){const{aggregate:e,type:o}=t;return e?bi(e)&&!fge.has(e)?{valid:!1,reason:nme(e)}:o==="quantitative"&&n==="log"?{valid:!1,reason:rme(t)}:{valid:!0}:{valid:!1,reason:tme(t)}}function lA(t,n,e,o){return t.explicit&&n.explicit&&Kr(lme(e,o,t.value,n.value)),{explicit:t.explicit,value:[...t.value,...n.value]}}function Ube(t){const n=Vf(t.map(a=>Nh(a)?Dbe(a,["sort"]):a),Ba),e=Vf(t.map(a=>{if(Nh(a)){const u=a.sort;return u!==void 0&&!fy(u)&&("op"in u&&u.op==="count"&&delete u.field,u.order==="ascending"&&delete u.order),u}}).filter(a=>a!==void 0),Ba);if(n.length===0)return;if(n.length===1){const a=t[0];if(Nh(a)&&e.length>0){let u=e[0];if(e.length>1)Kr(rP),u=!0;else if(Ei(u)&&"field"in u){const c=u.field;a.field===c&&(u=u.order?{order:u.order}:!0)}return Object.assign(Object.assign({},a),{sort:u})}return a}const o=Vf(e.map(a=>fy(a)||!("op"in a)||bi(a.op)&&a.op in sge?a:(Kr(cme(a)),!0)),Ba);let f;o.length===1?f=o[0]:o.length>1&&(Kr(rP),f=!0);const r=Vf(t.map(a=>Nh(a)?a.data:null),a=>a);return r.length===1&&r[0]!==null?Object.assign({data:r[0],fields:n.map(u=>u.field)},f?{sort:f}:{}):Object.assign({fields:n},f?{sort:f}:{})}function L8(t){if(Nh(t)&&bi(t.field))return t.field;if(dge(t)){let n;for(const e of t.fields)if(Nh(e)&&bi(e.field)){if(!n)n=e.field;else if(n!==e.field)return Kr(fme),n}return Kr(hme),n}else if(pge(t)){Kr(dme);const n=t.fields[0];return bi(n)?n:void 0}}function E3(t,n){const o=t.component.scales[n].get("domains").map(f=>(Nh(f)&&(f.data=t.lookupDataSource(f.data)),f));return Ube(o)}var Vbe=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);fn.concat(mH(e)),$P(t)):$P(t)}function $P(t){return Xr(t.component.scales).reduce((n,e)=>{const o=t.component.scales[e];if(o.merged)return n;const f=o.combine(),{name:r,type:a,selectionExtent:u,domains:c,range:i,reverse:s}=f,l=Vbe(f,["name","type","selectionExtent","domains","range","reverse"]),d=qbe(f.range,r,e,t),h=E3(t,e),m=u?Dye(t,u,o,h):null;return n.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:r,type:a},h?{domain:h}:{}),m?{domainRaw:m}:{}),{range:d}),s!==void 0?{reverse:s}:{}),l)),n},[])}function qbe(t,n,e,o){if(sl(e)){if(wp(t))return{step:{signal:`${n}_step`}}}else if(Ei(t)&&Nh(t))return Object.assign(Object.assign({},t),{data:o.lookupDataSource(t.data)});return t}class vH extends ad{constructor(n,e){super({},{name:n}),this.merged=!1,this.setWithExplicit("type",e)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:L0(this.get("domains"),n=>Ir(n)&&n.length===2&&n[0]<=0&&n[1]>=0)}}const Hbe=["range","scheme"];function $be(t){const n=t.component.scales;for(const e of o3){const o=n[e];if(!o)continue;const f=Gbe(e,t);o.setWithExplicit("range",f)}}function GP(t,n){const e=t.fieldDef(n);if(e?.bin){const{bin:o,field:f}=e,r=Fu(n),a=t.getName(r);if(Ei(o)&&o.binned&&o.step!==void 0)return new Ou(()=>{const u=t.scaleName(n),c=`(domain("${u}")[1] - domain("${u}")[0]) / ${o.step}`;return`${t.getSignalName(a)} / (${c})`});if(Bo(o)){const u=S8(t,f,o);return new Ou(()=>{const c=t.getSignalName(u),i=`(${c}.stop - ${c}.start) / ${c}.step`;return`${t.getSignalName(a)} / (${i})`})}}}function Gbe(t,n){const e=n.specifiedScales[t],{size:o}=n,r=n.getScaleComponent(t).get("type");for(const l of Hbe)if(e[l]!==void 0){const d=UT(r,l),h=gV(t,l);if(!d)Kr(KU(r,l,t));else if(h)Kr(h);else switch(l){case"range":{const m=e.range;if(Ir(m)){if(sl(t))return If(m.map(g=>{if(g==="width"||g==="height"){const p=n.getName(g),v=n.getSignalName.bind(n);return Ou.fromName(v,p)}return g}))}else if(Ei(m))return If({data:n.requestDataName(Fo.Main),field:m.field,sort:{op:"min",field:n.vgField(t)}});return If(m)}case"scheme":return If(Wbe(e[l]))}}const a=t===cs||t==="xOffset"?"width":"height",u=o[a];if(rh(u)){if(sl(t))if(ll(r)){const l=yH(u,n,t);if(l)return If({step:l})}else Kr(QU(a));else if(t1(t)){const l=t===gp?"x":"y";if(n.getScaleComponent(l).get("type")==="band"){const m=xH(u,r);if(m)return If(m)}}}const{rangeMin:c,rangeMax:i}=e,s=Ybe(t,n);return(c!==void 0||i!==void 0)&&UT(r,"rangeMin")&&Ir(s)&&s.length===2?If([c??s[0],i??s[1]]):Gu(s)}function Wbe(t){return Kme(t)?Object.assign({scheme:t.name},Eu(t,["name"])):{scheme:t}}function Ybe(t,n){const{size:e,config:o,mark:f,encoding:r}=n,a=n.getSignalName.bind(n),{type:u}=Ws(r[t]),i=n.getScaleComponent(t).get("type"),{domain:s,domainMid:l}=n.specifiedScales[t];switch(t){case cs:case ol:{if(Fa(["point","band"],i)){const m=bH(t,e,o.view);if(rh(m))return{step:yH(m,n,t)}}const d=Fu(t),h=n.getName(d);return t===ol&&rc(i)?[Ou.fromName(a,h),0]:[0,Ou.fromName(a,h)]}case gp:case e1:return Xbe(t,n,i);case nd:{const d=n.component.scales[t].get("zero"),h=_H(f,d,o),m=Kbe(f,e,n,o);return Cm(i)?Jbe(h,m,Zbe(i,o,s,t)):[h,m]}case Tc:return[0,Math.PI*2];case Z0:return[0,360];case xf:return[0,new Ou(()=>{const d=n.getSignalName("width"),h=n.getSignalName("height");return`min(${d},${h})/2`})];case yp:return[o.scale.minStrokeWidth,o.scale.maxStrokeWidth];case xp:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Ru:return"symbol";case zu:case hh:case dh:return i==="ordinal"?u==="nominal"?"category":"ordinal":l!==void 0?"diverging":f==="rect"||f==="geoshape"?"heatmap":"ramp";case rd:case mp:case vp:return[o.scale.minOpacity,o.scale.maxOpacity]}}function yH(t,n,e){var o,f,r,a,u;const{encoding:c}=n,i=n.getScaleComponent(e),s=DU(e),l=c[s];if(sq({step:t,offsetIsDiscrete:la(l)&&uV(l.type)})==="offset"&&VV(c,s)){const h=n.getScaleComponent(s);let g=`domain('${n.scaleName(s)}').length`;if(h.get("type")==="band"){const v=(f=(o=h.get("paddingInner"))!==null&&o!==void 0?o:h.get("padding"))!==null&&f!==void 0?f:0,y=(a=(r=h.get("paddingOuter"))!==null&&r!==void 0?r:h.get("padding"))!==null&&a!==void 0?a:0;g=`bandspace(${g}, ${v}, ${y})`}const p=(u=i.get("paddingInner"))!==null&&u!==void 0?u:i.get("padding");return{signal:`${t.step} * ${g} / (1-${yge(p)})`}}else return t.step}function xH(t,n){if(sq({step:t,offsetIsDiscrete:ll(n)})==="offset")return{step:t.step}}function Xbe(t,n,e){const o=t===gp?"x":"y",r=n.getScaleComponent(o).get("type"),a=n.scaleName(o);if(r==="band"){const u=bH(o,n.size,n.config.view);if(rh(u)){const c=xH(u,e);if(c)return c}return[0,{signal:`bandwidth('${a}')`}]}else return bU(`Cannot use ${t} scale if ${o} scale is not discrete.`)}function bH(t,n,e){const o=t===cs?"width":"height",f=n[o];return f||D2(e,o)}function Zbe(t,n,e,o){switch(t){case"quantile":return n.scale.quantileCount;case"quantize":return n.scale.quantizeCount;case"threshold":return e!==void 0&&Ir(e)?e.length+1:(Kr(wme(o)),3)}}function Jbe(t,n,e){const o=()=>{const f=Hh(n),r=Hh(t),a=`(${f} - ${r}) / (${e} - 1)`;return`sequence(${r}, ${f} + ${a}, ${a})`};return Vi(n)?new Ou(o):{signal:o()}}function _H(t,n,e){if(n)return Vi(n)?{signal:`${n.signal} ? 0 : ${_H(t,!1,e)}`}:0;switch(t){case"bar":case"tick":return e.scale.minBandSize;case"line":case"trail":case"rule":return e.scale.minStrokeWidth;case"text":return e.scale.minFontSize;case"point":case"square":case"circle":return e.scale.minSize}throw new Error(l3("size",t))}const WP=.95;function Kbe(t,n,e,o){const f={x:GP(e,"x"),y:GP(e,"y")};switch(t){case"bar":case"tick":{if(o.scale.maxBandSize!==void 0)return o.scale.maxBandSize;const r=YP(n,f,o.view);return wo(r)?r-1:new Ou(()=>`${r.signal} - 1`)}case"line":case"trail":case"rule":return o.scale.maxStrokeWidth;case"text":return o.scale.maxFontSize;case"point":case"square":case"circle":{if(o.scale.maxSize)return o.scale.maxSize;const r=YP(n,f,o.view);return wo(r)?Math.pow(WP*r,2):new Ou(()=>`pow(${WP} * ${r.signal}, 2)`)}}throw new Error(l3("size",t))}function YP(t,n,e){const o=rh(t.width)?t.width.step:P2(e,"width"),f=rh(t.height)?t.height.step:P2(e,"height");return n.x||n.y?new Ou(()=>`min(${[n.x?n.x.signal:o,n.y?n.y.signal:f].join(", ")})`):Math.min(o,f)}function wH(t,n){Is(t)?Qbe(t,n):TH(t,n)}function Qbe(t,n){const e=t.component.scales,{config:o,encoding:f,markDef:r,specifiedScales:a}=t;for(const u of Xr(e)){const c=a[u],i=e[u],s=t.getScaleComponent(u),l=Ws(f[u]),d=c[n],h=s.get("type"),m=s.get("padding"),g=s.get("paddingInner"),p=UT(h,n),v=gV(u,n);if(d!==void 0&&(p?v&&Kr(v):Kr(KU(h,n,u))),p&&v===void 0)if(d!==void 0){const y=l.timeUnit,x=l.type;switch(n){case"domainMax":case"domainMin":Q0(c[n])||x==="temporal"||y?i.set(n,{signal:y3(c[n],{type:x,timeUnit:y})},!0):i.set(n,c[n],!0);break;default:i.copyKeyFromObject(n,c)}}else{const y=n in XP?XP[n]({model:t,channel:u,fieldOrDatumDef:l,scaleType:h,scalePadding:m,scalePaddingInner:g,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:r,config:o,hasNestedOffsetScale:$T(f,u),hasSecondaryRangeChannel:!!f[ph(u)]}):o.scale[n];y!==void 0&&i.set(n,y,!1)}}}const XP={bins:({model:t,fieldOrDatumDef:n})=>ti(n)?e_e(t,n):void 0,interpolate:({channel:t,fieldOrDatumDef:n})=>t_e(t,n.type),nice:({scaleType:t,channel:n,domain:e,domainMin:o,domainMax:f,fieldOrDatumDef:r})=>n_e(t,n,e,o,f,r),padding:({channel:t,scaleType:n,fieldOrDatumDef:e,markDef:o,config:f})=>r_e(t,n,f.scale,e,o,f.bar),paddingInner:({scalePadding:t,channel:n,markDef:e,scaleType:o,config:f,hasNestedOffsetScale:r})=>i_e(t,n,e.type,o,f.scale,r),paddingOuter:({scalePadding:t,channel:n,scaleType:e,scalePaddingInner:o,config:f,hasNestedOffsetScale:r})=>a_e(t,n,e,o,f.scale,r),reverse:({fieldOrDatumDef:t,scaleType:n,channel:e,config:o})=>{const f=ti(t)?t.sort:void 0;return o_e(n,f,e,o.scale)},zero:({channel:t,fieldOrDatumDef:n,domain:e,markDef:o,scaleType:f,config:r,hasSecondaryRangeChannel:a})=>s_e(t,n,e,o,f,r.scale,a)};function kH(t){Is(t)?$be(t):TH(t,"range")}function TH(t,n){const e=t.component.scales;for(const o of t.children)n==="range"?kH(o):wH(o,n);for(const o of Xr(e)){let f;for(const r of t.children){const a=r.component.scales[o];if(a){const u=a.getWithExplicit(n);f=ap(f,u,n,"scale",_q((c,i)=>{switch(n){case"range":return c.step&&i.step?c.step-i.step:0}return 0}))}}e[o].setWithExplicit(n,f)}}function e_e(t,n){const e=n.bin;if(Bo(e)){const o=S8(t,n.field,e);return new Ou(()=>t.getSignalName(o))}else if(xl(e)&&K0(e)&&e.step!==void 0)return{step:e.step}}function t_e(t,n){if(Fa([zu,hh,dh],t)&&n!=="nominal")return"hcl"}function n_e(t,n,e,o,f,r){var a;if(!(((a=th(r))===null||a===void 0?void 0:a.bin)||Ir(e)||f!=null||o!=null||Fa([Cu.TIME,Cu.UTC],t)))return sl(n)?!0:void 0}function r_e(t,n,e,o,f,r){if(sl(t)){if(nf(n)){if(e.continuousPadding!==void 0)return e.continuousPadding;const{type:a,orient:u}=f;if(a==="bar"&&!(ti(o)&&(o.bin||o.timeUnit))&&(u==="vertical"&&t==="x"||u==="horizontal"&&t==="y"))return r.continuousBandSize}if(n===Cu.POINT)return e.pointPadding}}function i_e(t,n,e,o,f,r=!1){if(t===void 0){if(sl(n)){const{bandPaddingInner:a,barBandPaddingInner:u,rectBandPaddingInner:c,bandWithNestedOffsetPaddingInner:i}=f;return r?i:Rs(a,e==="bar"?u:c)}else if(t1(n)&&o===Cu.BAND)return f.offsetBandPaddingInner}}function a_e(t,n,e,o,f,r=!1){if(t===void 0){if(sl(n)){const{bandPaddingOuter:a,bandWithNestedOffsetPaddingOuter:u}=f;if(r)return u;if(e===Cu.BAND)return Rs(a,Vi(o)?{signal:`${o.signal}/2`}:o/2)}else if(t1(n)){if(e===Cu.POINT)return .5;if(e===Cu.BAND)return f.offsetBandPaddingOuter}}}function o_e(t,n,e,o){if(e==="x"&&o.xReverse!==void 0)return rc(t)&&n==="descending"?Vi(o.xReverse)?{signal:`!${o.xReverse.signal}`}:!o.xReverse:o.xReverse;if(rc(t)&&n==="descending")return!0}function s_e(t,n,e,o,f,r,a){if(!!e&&e!=="unaggregated"&&rc(f)){if(Ir(e)){const c=e[0],i=e[e.length-1];if(c<=0&&i>=0)return!0}return!1}if(t==="size"&&n.type==="quantitative"&&!Cm(f))return!0;if(!(ti(n)&&n.bin)&&Fa([...gh,...Q0e],t)){const{orient:c,type:i}=o;return Fa(["bar","area","line","trail"],i)&&(c==="horizontal"&&t==="y"||c==="vertical"&&t==="x")?!1:Fa(["bar","area"],i)&&!a?!0:r?.zero}return!1}function l_e(t,n,e,o,f=!1){const r=u_e(n,e,o,f),{type:a}=t;return bp(n)?a!==void 0?a1e(n,a)?ti(e)&&!i1e(a,e.type)?(Kr(ome(a,r)),r):a:(Kr(ame(n,a,r)),r):r:null}function u_e(t,n,e,o){var f;switch(n.type){case"nominal":case"ordinal":{if(im(t)||E4(t)==="discrete")return t==="shape"&&n.type==="ordinal"&&Kr(C4(t,"ordinal")),"ordinal";if(sl(t)||t1(t)){if(Fa(["rect","bar","image","rule"],e.type)||o)return"band"}else if(e.type==="arc"&&t in SE)return"band";const r=e[Fu(t)];return R0(r)||Lm(n)&&((f=n.axis)===null||f===void 0?void 0:f.tickBand)?"band":"point"}case"temporal":return im(t)?"time":E4(t)==="discrete"?(Kr(C4(t,"temporal")),"ordinal"):ti(n)&&n.timeUnit&&Gl(n.timeUnit).utc?"utc":"time";case"quantitative":return im(t)?ti(n)&&Bo(n.bin)?"bin-ordinal":"linear":E4(t)==="discrete"?(Kr(C4(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(ZU(n.type))}function c_e(t,{ignoreRange:n}={}){AH(t),gH(t);for(const e of r1e)wH(t,e);n||kH(t)}function AH(t){Is(t)?t.component.scales=f_e(t):t.component.scales=d_e(t)}function f_e(t){const{encoding:n,mark:e,markDef:o}=t,f={};for(const r of o3){const a=Ws(n[r]);if(a&&e===yV&&r===Ru&&a.type===n1)continue;let u=a&&a.scale;if(t1(r)){const c=IU(r);if(!$T(n,c)){u&&Kr($ge(r));continue}}if(a&&u!==null&&u!==!1){u??(u={});const c=$T(n,r),i=l_e(u,r,a,o,c);f[r]=new vH(t.scaleName(`${r}`,!0),{value:i,explicit:u.type===i})}}return f}const h_e=_q((t,n)=>aP(t)-aP(n));function d_e(t){var n,e;const o=t.component.scales={},f={},r=t.component.resolve;for(const a of t.children){AH(a);for(const u of Xr(a.component.scales))if((n=(e=r.scale)[u])!==null&&n!==void 0||(e[u]=nH(u,t)),r.scale[u]==="shared"){const c=f[u],i=a.component.scales[u].getWithExplicit("type");c?Wme(c.value,i.value)?f[u]=ap(c,i,"type","scale",h_e):(r.scale[u]="independent",delete f[u]):f[u]=i}}for(const a of Xr(f)){const u=t.scaleName(a,!0),c=f[a];o[a]=new vH(u,c);for(const i of t.children){const s=i.component.scales[a];s&&(i.renameScale(s.get("name"),u),s.merged=!0)}}return o}var F4=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f{var l,d,h;return!((l=s.from)===null||l===void 0)&&l.data&&(s.from.data=this.lookupDataSource(s.from.data)),!((h=(d=s.from)===null||d===void 0?void 0:d.facet)===null||h===void 0)&&h.data&&(s.from.facet.data=this.lookupDataSource(s.from.facet.data)),s},this.parent=o,this.config=r,this.view=Tu(u),this.name=(c=n.name)!==null&&c!==void 0?c:f,this.title=Ad(n.title)?{text:n.title}:n.title?Tu(n.title):void 0,this.scaleNameMap=o?o.scaleNameMap:new N4,this.projectionNameMap=o?o.projectionNameMap:new N4,this.signalNameMap=o?o.signalNameMap:new N4,this.data=n.data,this.description=n.description,this.transforms=mye((i=n.transform)!==null&&i!==void 0?i:[]),this.layout=e==="layer"||e==="unit"?{}:wve(n,e,r),this.component={data:{sources:o?o.component.data.sources:[],outputNodes:o?o.component.data.outputNodes:{},outputNodeRefCounts:o?o.component.data.outputNodeRefCounts:{},isFaceted:p3(n)||o?.component.data.isFaceted&&n.data===void 0},layoutSize:new ad,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},a?ha(a):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){c_e(this)}parseProjection(){hH(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){sH(this)}assembleEncodeFromView(n){const e=F4(n,["style"]),o={};for(const f of Xr(e)){const r=e[f];r!==void 0&&(o[f]=Ho(r))}return o}assembleGroupEncodeEntry(n){let e={};return this.view&&(e=this.assembleEncodeFromView(this.view)),!n&&(this.description&&(e.description=Ho(this.description)),this.type==="unit"||this.type==="layer")?Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},e??{}):_o(e)?void 0:e}assembleLayout(){if(!this.layout)return;const n=this.layout,{spacing:e}=n,o=F4(n,["spacing"]),{component:f,config:r}=this,a=Oxe(f.layoutHeaders,r);return Object.assign(Object.assign(Object.assign({padding:e},this.assembleDefaultLayout()),o),a?{titleBand:a}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:n}=this.component;let e=[];for(const o of dc)n[o].title&&e.push(Txe(this,o));for(const o of k8)e=e.concat(Axe(this,o));return e}assembleAxes(){return hxe(this.component.axes,this.config)}assembleLegends(){return uH(this)}assembleProjections(){return ebe(this)}assembleTitle(){var n,e,o;const f=(n=this.title)!==null&&n!==void 0?n:{},{encoding:r}=f,a=F4(f,["encoding"]),u=Object.assign(Object.assign(Object.assign({},UU(this.config.title).nonMarkTitleProperties),a),r?{encode:{update:r}}:{});if(u.text)return Fa(["unit","layer"],this.type)?Fa(["middle",void 0],u.anchor)&&((e=u.frame)!==null&&e!==void 0||(u.frame="group")):(o=u.anchor)!==null&&o!==void 0||(u.anchor="start"),_o(u)?void 0:u}assembleGroup(n=[]){const e={};n=n.concat(this.assembleSignals()),n.length>0&&(e.signals=n);const o=this.assembleLayout();o&&(e.layout=o),e.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const f=!this.parent||lf(this.parent)?mH(this):[];f.length>0&&(e.scales=f);const r=this.assembleAxes();r.length>0&&(e.axes=r);const a=this.assembleLegends();return a.length>0&&(e.legends=a),e}getName(n){return Xo((this.name?`${this.name}_`:"")+n)}getDataName(n){return this.getName(Fo[n].toLowerCase())}requestDataName(n){const e=this.getDataName(n),o=this.component.data.outputNodeRefCounts;return o[e]=(o[e]||0)+1,e}getSizeSignalRef(n){if(lf(this.parent)){const e=eH(n),o=a3(e),f=this.component.scales[o];if(f&&!f.merged){const r=f.get("type"),a=f.get("range");if(ll(r)&&wp(a)){const u=f.get("name"),c=E3(this,o),i=L8(c);if(i){const s=hi({aggregate:"distinct",field:i},{expr:"datum"});return{signal:Qq(u,f,s)}}else return Kr(LE(o)),null}}}return{signal:this.signalNameMap.get(this.getName(n))}}lookupDataSource(n){const e=this.component.data.outputNodes[n];return e?e.getSource():n}getSignalName(n){return this.signalNameMap.get(n)}renameSignal(n,e){this.signalNameMap.rename(n,e)}renameScale(n,e){this.scaleNameMap.rename(n,e)}renameProjection(n,e){this.projectionNameMap.rename(n,e)}scaleName(n,e){if(e)return this.getName(n);if(LU(n)&&bp(n)&&this.component.scales[n]||this.scaleNameMap.has(this.getName(n)))return this.scaleNameMap.get(this.getName(n))}projectionName(n){if(n)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(n){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const e=this.component.scales[n];return e&&!e.merged?e:this.parent?this.parent.getScaleComponent(n):void 0}getSelectionComponent(n,e){let o=this.component.selection[n];if(!o&&this.parent&&(o=this.parent.getSelectionComponent(n,e)),!o)throw new Error(kge(e));return o}hasAxisOrientSignalRef(){var n,e;return((n=this.component.axes.x)===null||n===void 0?void 0:n.some(o=>o.hasOrientSignalRef()))||((e=this.component.axes.y)===null||e===void 0?void 0:e.some(o=>o.hasOrientSignalRef()))}}class MH extends D8{vgField(n,e={}){const o=this.fieldDef(n);if(!!o)return hi(o,e)}reduceFieldDef(n,e){return Z1e(this.getMapping(),(o,f,r)=>{const a=th(f);return a?n(o,a,r):o},e)}forEachFieldDef(n,e){a8(this.getMapping(),(o,f)=>{const r=th(o);r&&n(r,f)},e)}}var p_e=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f{const l=bp(s)&&e.getScaleComponent(s);if(l){const d=l.get("type");rc(d)&&i.aggregate!=="count"&&!kp(f)&&(c[i.field]=i)}return c},{});return Xr(u).length?new my(n,u):null}dependentFields(){return new Set(Xr(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Ba(this.filter)}`}assemble(){const n=Xr(this.filter).reduce((e,o)=>{const f=this.filter[o],r=hi(f,{expr:"datum"});return f!==null&&(f.type==="temporal"?e.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):f.type==="quantitative"&&(e.push(`isValid(${r})`),e.push(`isFinite(+${r})`))),e},[]);return n.length>0?{type:"filter",expr:n.join(" && ")}:null}}class O3 extends To{constructor(n,e){super(n),this.transform=e,this.transform=ha(e);const{flatten:o,as:f=[]}=this.transform;this.transform.as=o.map((r,a)=>{var u;return(u=f[a])!==null&&u!==void 0?u:r})}clone(){return new O3(this.parent,ha(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Ba(this.transform)}`}assemble(){const{flatten:n,as:e}=this.transform;return{type:"flatten",fields:n,as:e}}}class L3 extends To{constructor(n,e){var o,f,r;super(n),this.transform=e,this.transform=ha(e);const a=(o=this.transform.as)!==null&&o!==void 0?o:[void 0,void 0];this.transform.as=[(f=a[0])!==null&&f!==void 0?f:"key",(r=a[1])!==null&&r!==void 0?r:"value"]}clone(){return new L3(null,ha(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Ba(this.transform)}`}assemble(){const{fold:n,as:e}=this.transform;return{type:"fold",fields:n,as:e}}}class sm extends To{constructor(n,e,o,f){super(n),this.fields=e,this.geojson=o,this.signal=f}clone(){return new sm(null,ha(this.fields),this.geojson,this.signal)}static parseAll(n,e){if(e.component.projection&&!e.component.projection.isFit)return n;let o=0;for(const f of[[fh,ch],[_c,bf]]){const r=f.map(a=>{const u=Ws(e.encoding[a]);return ti(u)?u.field:mh(u)?{expr:`${u.datum}`}:pf(u)?{expr:`${u.value}`}:void 0});(r[0]||r[1])&&(n=new sm(n,r,null,e.getName(`geojson_${o++}`)))}if(e.channelHasField(Ru)){const f=e.typedFieldDef(Ru);f.type===n1&&(n=new sm(n,null,f.field,e.getName(`geojson_${o++}`)))}return n}dependentFields(){var n;const e=((n=this.fields)!==null&&n!==void 0?n:[]).filter(bi);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Ba(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})]}}class vy extends To{constructor(n,e,o,f){super(n),this.projection=e,this.fields=o,this.as=f}clone(){return new vy(null,this.projection,ha(this.fields),ha(this.as))}static parseAll(n,e){if(!e.projectionName())return n;for(const o of[[fh,ch],[_c,bf]]){const f=o.map(a=>{const u=Ws(e.encoding[a]);return ti(u)?u.field:mh(u)?{expr:`${u.datum}`}:pf(u)?{expr:`${u.value}`}:void 0}),r=o[0]===_c?"2":"";(f[0]||f[1])&&(n=new vy(n,e.projectionName(),f,[e.getName(`x${r}`),e.getName(`y${r}`)]))}return n}dependentFields(){return new Set(this.fields.filter(bi))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Ba(this.fields)} ${Ba(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class x0 extends To{constructor(n,e){super(n),this.transform=e}clone(){return new x0(null,ha(this.transform))}dependentFields(){var n;return new Set([this.transform.impute,this.transform.key,...(n=this.transform.groupby)!==null&&n!==void 0?n:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(n){const{start:e=0,stop:o,step:f}=n;return{signal:`sequence(${[e,o,...f?[f]:[]].join(",")})`}}static makeFromTransform(n,e){return new x0(n,e)}static makeFromEncoding(n,e){const o=e.encoding,f=o.x,r=o.y;if(ti(f)&&ti(r)){const a=f.impute?f:r.impute?r:void 0;if(a===void 0)return;const u=f.impute?r:r.impute?f:void 0,{method:c,value:i,frame:s,keyvals:l}=a.impute,d=HV(e.mark,o);return new x0(n,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:a.field,key:u.field},c?{method:c}:{}),i!==void 0?{value:i}:{}),s?{frame:s}:{}),l!==void 0?{keyvals:l}:{}),d.length?{groupby:d}:{}))}return null}hash(){return`Impute ${Ba(this.transform)}`}assemble(){const{impute:n,key:e,keyvals:o,method:f,groupby:r,value:a,frame:u=[null,null]}=this.transform,c=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:n,key:e},o?{keyvals:Kve(o)?this.processSequence(o):o}:{}),{method:"value"}),r?{groupby:r}:{}),{value:!f||f==="value"?a:null});if(f&&f!=="value"){const i=Object.assign({type:"window",as:[`imputed_${n}_value`],ops:[f],fields:[n],frame:u,ignorePeers:!1},r?{groupby:r}:{}),s={type:"formula",expr:`datum.${n} === null ? datum.imputed_${n}_value : datum.${n}`,as:n};return[c,i,s]}else return[c]}}var g_e=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);fo)}producedFields(){}dependentFields(){var n;return new Set([this.transform.pivot,this.transform.value,...(n=this.transform.groupby)!==null&&n!==void 0?n:[]])}hash(){return`PivotTransform ${Ba(this.transform)}`}assemble(){const{pivot:n,value:e,groupby:o,limit:f,op:r}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:n,value:e},f!==void 0?{limit:f}:{}),r!==void 0?{op:r}:{}),o!==void 0?{groupby:o}:{})}}class R3 extends To{constructor(n,e){super(n),this.transform=e}clone(){return new R3(null,ha(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Ba(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function SH(t){let n=0;function e(o,f){var r;if(o instanceof j0&&!o.isGenerator&&!Dm(o.data)&&(t.push(f),f={name:null,source:f.name,transform:[]}),o instanceof Nl&&(o.parent instanceof j0&&!f.source?(f.format=Object.assign(Object.assign({},(r=f.format)!==null&&r!==void 0?r:{}),{parse:o.assembleFormatParse()}),f.transform.push(...o.assembleTransforms(!0))):f.transform.push(...o.assembleTransforms())),o instanceof a1){f.name||(f.name=`data_${n++}`),!f.source||f.transform.length>0?(t.push(f),o.data=f.name):o.data=f.source,t.push(...o.assemble());return}switch((o instanceof hx||o instanceof dx||o instanceof my||o instanceof i1||o instanceof zm||o instanceof vy||o instanceof sf||o instanceof yy||o instanceof o1||o instanceof ng||o instanceof L3||o instanceof O3||o instanceof C3||o instanceof P3||o instanceof D3||o instanceof I3||o instanceof up||o instanceof R3||o instanceof z3)&&f.transform.push(o.assemble()),(o instanceof Xf||o instanceof Yf||o instanceof x0||o instanceof $h||o instanceof sm)&&f.transform.push(...o.assemble()),o instanceof hu&&(f.source&&f.transform.length===0?o.setSource(f.source):o.parent instanceof hu?o.setSource(f.name):(f.name||(f.name=`data_${n++}`),o.setSource(f.name),o.numChildren()===1&&(t.push(f),f={name:null,source:f.name,transform:[]}))),o.numChildren()){case 0:o instanceof hu&&(!f.source||f.transform.length>0)&&t.push(f);break;case 1:e(o.children[0],f);break;default:{f.name||(f.name=`data_${n++}`);let a=f.name;!f.source||f.transform.length>0?t.push(f):a=f.source;for(const u of o.children)e(u,{name:null,source:a,transform:[]});break}}}return e}function y_e(t){const n=[],e=SH(n);for(const o of t.children)e(o,{source:t.name,name:null,transform:[]});return n}function x_e(t,n){var e,o;const f=[],r=SH(f);let a=0;for(const c of t.sources){c.hasName()||(c.dataName=`source_${a++}`);const i=c.assemble();r(c,i)}for(const c of f)c.transform.length===0&&delete c.transform;let u=0;for(const[c,i]of f.entries())((e=i.transform)!==null&&e!==void 0?e:[]).length===0&&!i.source&&f.splice(u++,0,f.splice(c,1)[0]);for(const c of f)for(const i of(o=c.transform)!==null&&o!==void 0?o:[])i.type==="lookup"&&(i.from=t.outputNodes[i.from].getSource());for(const c of f)c.name in n&&(c.values=n[c.name]);return f}function b_e(t){return t==="top"||t==="left"||Vi(t)?"header":"footer"}function __e(t){for(const n of dc)w_e(t,n);ZP(t,"x"),ZP(t,"y")}function w_e(t,n){var e;const{facet:o,config:f,child:r,component:a}=t;if(t.channelHasField(n)){const u=o[n],c=Fm("title",null,f,n);let i=am(u,f,{allowDisabling:!0,includeDefault:c===void 0||!!c});r.component.layoutHeaders[n].title&&(i=Ir(i)?i.join(", "):i,i+=` / ${r.component.layoutHeaders[n].title}`,r.component.layoutHeaders[n].title=null);const s=Fm("labelOrient",u.header,f,n),l=u.header!==null?Rs((e=u.header)===null||e===void 0?void 0:e.labels,f.header.labels,!0):!1,d=Fa(["bottom","right"],s)?"footer":"header";a.layoutHeaders[n]={title:u.header!==null?i:null,facetFieldDef:u,[d]:n==="facet"?[]:[EH(t,n,l)]}}}function EH(t,n,e){const o=n==="row"?"height":"width";return{labels:e,sizeSignal:t.child.component.layoutSize.get(o)?t.child.getSizeSignalRef(o):void 0,axes:[]}}function ZP(t,n){var e;const{child:o}=t;if(o.component.axes[n]){const{layoutHeaders:f,resolve:r}=t.component;if(r.axis[n]=M8(r,n),r.axis[n]==="shared"){const a=n==="x"?"column":"row",u=f[a];for(const c of o.component.axes[n]){const i=b_e(c.get("orient"));(e=u[i])!==null&&e!==void 0||(u[i]=[EH(t,a,!1)]);const s=Tv(c,"main",t.config,{header:!0});s&&u[i][0].axes.push(s),c.mainExtracted=!0}}}}function k_e(t){I8(t),F2(t,"width"),F2(t,"height")}function T_e(t){I8(t);const n=t.layout.columns===1?"width":"childWidth",e=t.layout.columns===void 0?"height":"childHeight";F2(t,n),F2(t,e)}function I8(t){for(const n of t.children)n.parseLayoutSize()}function F2(t,n){var e;const o=eH(n),f=a3(o),r=t.component.resolve,a=t.component.layoutSize;let u;for(const c of t.children){const i=c.component.layoutSize.getWithExplicit(o),s=(e=r.scale[f])!==null&&e!==void 0?e:nH(f,t);if(s==="independent"&&i.value==="step"){u=void 0;break}if(u){if(s==="independent"&&u.value!==i.value){u=void 0;break}u=ap(u,i,o,"")}else u=i}if(u){for(const c of t.children)t.renameSignal(c.getName(o),t.getName(n)),c.component.layoutSize.set(o,"merged",!1);a.setWithExplicit(n,u)}else a.setWithExplicit(n,{explicit:!1,value:void 0})}function A_e(t){const{size:n,component:e}=t;for(const o of gh){const f=Fu(o);if(n[f]){const r=n[f];e.layoutSize.set(f,rh(r)?"step":r,!0)}else{const r=M_e(t,f);e.layoutSize.set(f,r,!1)}}}function M_e(t,n){const e=n==="width"?"x":"y",o=t.config,f=t.getScaleComponent(e);if(f){const r=f.get("type"),a=f.get("range");if(ll(r)){const u=D2(o.view,n);return wp(a)||rh(u)?"step":u}else return WT(o.view,n)}else{if(t.hasProjection||t.mark==="arc")return WT(o.view,n);{const r=D2(o.view,n);return rh(r)?r.step:r}}}function uA(t,n,e){return hi(n,Object.assign({suffix:`by_${hi(t)}`},e??{}))}class jv extends MH{constructor(n,e,o,f){super(n,"facet",e,o,f,n.resolve),this.child=B8(n.spec,this,this.getName("child"),void 0,f),this.children=[this.child],this.facet=this.initFacet(n.facet)}initFacet(n){if(!sx(n))return{facet:this.initFacetFieldDef(n,"facet")};const e=Xr(n),o={};for(const f of e){if(![Vh,qh].includes(f)){Kr(l3(f,"facet"));break}const r=n[f];if(r.field===void 0){Kr(BT(r,f));break}o[f]=this.initFacetFieldDef(r,f)}return o}initFacetFieldDef(n,e){const o=r8(n,e);return o.header?o.header=Tu(o.header):o.header===null&&(o.header=null),o}channelHasField(n){return!!this.facet[n]}fieldDef(n){return this.facet[n]}parseData(){this.component.data=F3(this),this.child.parseData()}parseLayoutSize(){I8(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),__e(this)}assembleSelectionTopLevelSignals(n){return this.child.assembleSelectionTopLevelSignals(n)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(n){return this.child.assembleSelectionData(n)}getHeaderLayoutMixins(){var n,e,o;const f={};for(const r of dc)for(const a of T8){const u=this.component.layoutHeaders[r],c=u[a],{facetFieldDef:i}=u;if(i){const s=Fm("titleOrient",i.header,this.config,r);if(["right","bottom"].includes(s)){const l=M3(r,s);(n=f.titleAnchor)!==null&&n!==void 0||(f.titleAnchor={}),f.titleAnchor[l]="end"}}if(c?.[0]){const s=r==="row"?"height":"width",l=a==="header"?"headerBand":"footerBand";r!=="facet"&&!this.child.component.layoutSize.get(s)&&((e=f[l])!==null&&e!==void 0||(f[l]={}),f[l][r]=.5),u.title&&((o=f.offset)!==null&&o!==void 0||(f.offset={}),f.offset[r==="row"?"rowTitle":"columnTitle"]=10)}}return f}assembleDefaultLayout(){const{column:n,row:e}=this.facet,o=n?this.columnDistinctSignal():e?1:void 0;let f="all";return(!e&&this.component.resolve.scale.x==="independent"||!n&&this.component.resolve.scale.y==="independent")&&(f="none"),Object.assign(Object.assign(Object.assign({},this.getHeaderLayoutMixins()),o?{columns:o}:{}),{bounds:"full",align:f})}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof jv))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(n){return this.parent&&this.parent instanceof jv?Object.assign(Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:hi(this.facet.column,{prefix:"distinct"})}}}}:{}),super.assembleGroup(n)):super.assembleGroup(n)}getCardinalityAggregateForChild(){const n=[],e=[],o=[];if(this.child instanceof jv){if(this.child.channelHasField("column")){const f=hi(this.child.facet.column);n.push(f),e.push("distinct"),o.push(`distinct_${f}`)}}else for(const f of gh){const r=this.child.component.scales[f];if(r&&!r.merged){const a=r.get("type"),u=r.get("range");if(ll(a)&&wp(u)){const c=E3(this.child,f),i=L8(c);i?(n.push(i),e.push("distinct"),o.push(`distinct_${i}`)):Kr(LE(f))}}}return{fields:n,ops:e,as:o}}assembleFacet(){const{name:n,data:e}=this.component.data.facetRoot,{row:o,column:f}=this.facet,{fields:r,ops:a,as:u}=this.getCardinalityAggregateForChild(),c=[];for(const s of dc){const l=this.facet[s];if(l){c.push(hi(l));const{bin:d,sort:h}=l;if(Bo(d)&&c.push(hi(l,{binSuffix:"end"})),Wf(h)){const{field:m,op:g=d3}=h,p=uA(l,h);o&&f?(r.push(p),a.push("max"),u.push(p)):(r.push(m),a.push(g),u.push(p))}else if(Ir(h)){const m=Rm(l,s);r.push(m),a.push("max"),u.push(m)}}}const i=!!o&&!!f;return Object.assign({name:n,data:e,groupby:c},i||r.length>0?{aggregate:Object.assign(Object.assign({},i?{cross:i}:{}),r.length?{fields:r,ops:a,as:u}:{})}:{})}facetSortFields(n){const{facet:e}=this,o=e[n];return o?Wf(o.sort)?[uA(o,o.sort,{expr:"datum"})]:Ir(o.sort)?[Rm(o,n,{expr:"datum"})]:[hi(o,{expr:"datum"})]:[]}facetSortOrder(n){const{facet:e}=this,o=e[n];if(o){const{sort:f}=o;return[(Wf(f)?f.order:!Ir(f)&&f)||"ascending"]}return[]}assembleLabelTitle(){var n;const{facet:e,config:o}=this;if(e.facet)return rA(e.facet,"facet",o);const f={row:["top","bottom"],column:["left","right"]};for(const r of k8)if(e[r]){const a=Fm("labelOrient",(n=e[r])===null||n===void 0?void 0:n.header,o,r);if(f[r].includes(a))return rA(e[r],r,o)}}assembleMarks(){const{child:n}=this,e=this.component.data.facetRoot,o=y_e(e),f=n.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||n.assembleTitle(),a=n.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{}),a?{style:a}:{}),{from:{facet:this.assembleFacet()},sort:{field:dc.map(c=>this.facetSortFields(c)).flat(),order:dc.map(c=>this.facetSortOrder(c)).flat()}}),o.length>0?{data:o}:{}),f?{encode:{update:f}}:{}),n.assembleGroup(Cye(this,[])))]}getMapping(){return this.facet}}function S_e(t,n){const{row:e,column:o}=n;if(e&&o){let f=null;for(const r of[e,o])if(Wf(r.sort)){const{field:a,op:u=d3}=r.sort;t=f=new ng(t,{joinaggregate:[{op:u,field:a,as:uA(r,r.sort,{forAs:!0})}],groupby:[hi(r)]})}return f}return null}function CH(t,n){var e,o,f,r;for(const a of n){const u=a.data;if(t.name&&a.hasName()&&t.name!==a.dataName)continue;const c=(e=t.format)===null||e===void 0?void 0:e.mesh,i=(o=u.format)===null||o===void 0?void 0:o.feature;if(c&&i)continue;const s=(f=t.format)===null||f===void 0?void 0:f.feature;if((s||i)&&s!==i)continue;const l=(r=u.format)===null||r===void 0?void 0:r.mesh;if(!((c||l)&&c!==l)){if(py(t)&&py(u)){if(Uf(t.values,u.values))return a}else if(Dm(t)&&Dm(u)){if(t.url===u.url)return a}else if(wq(t)&&t.name===a.dataName)return a}}return null}function E_e(t,n){if(t.data||!t.parent){if(t.data===null){const o=new j0({values:[]});return n.push(o),o}const e=CH(t.data,n);if(e)return $d(t.data)||(e.data.format=_U({},t.data.format,e.data.format)),!e.hasName()&&t.data.name&&(e.dataName=t.data.name),e;{const o=new j0(t.data);return n.push(o),o}}else return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}function C_e(t,n,e){var o,f;let r=0;for(const a of n.transforms){let u,c;if(cye(a))c=t=new zm(t,a),u="derived";else if(m8(a)){const i=pbe(a);c=t=(o=Nl.makeWithAncestors(t,{},i,e))!==null&&o!==void 0?o:t,t=new i1(t,n,a.filter)}else if(mq(a))c=t=Xf.makeFromTransform(t,a,n),u="number";else if(hye(a))u="date",e.getWithExplicit(a.field).value===void 0&&(t=new Nl(t,{[a.field]:u}),e.set(a.field,u,!1)),c=t=Yf.makeFromTransform(t,a);else if(dye(a))c=t=sf.makeFromTransform(t,a),u="number",w8(n)&&(t=new up(t));else if(gq(a))c=t=yy.make(t,n,a,r++),u="derived";else if(sye(a))c=t=new o1(t,a),u="number";else if(lye(a))c=t=new ng(t,a),u="number";else if(pye(a))c=t=$h.makeFromTransform(t,a),u="derived";else if(gye(a))c=t=new L3(t,a),u="derived";else if(uye(a))c=t=new O3(t,a),u="derived";else if(tye(a))c=t=new z3(t,a),u="derived";else if(oye(a))t=new R3(t,a);else if(fye(a))c=t=x0.makeFromTransform(t,a),u="derived";else if(nye(a))c=t=new C3(t,a),u="derived";else if(rye(a))c=t=new D3(t,a),u="derived";else if(iye(a))c=t=new I3(t,a),u="derived";else if(aye(a))c=t=new P3(t,a),u="derived";else{Kr(Ige(a));continue}if(c&&u!==void 0)for(const i of(f=c.producedFields())!==null&&f!==void 0?f:[])e.set(i,u,!1)}return t}function F3(t){var n,e,o,f,r,a,u,c,i,s;let l=E_e(t,t.component.data.sources);const{outputNodes:d,outputNodeRefCounts:h}=t.component.data,m=t.data,p=!(m&&($d(m)||Dm(m)||py(m)))&&t.parent?t.parent.component.data.ancestorParse.clone():new Mye;$d(m)?(kq(m)?l=new dx(l,m.sequence):v8(m)&&(l=new hx(l,m.graticule)),p.parseNothing=!0):((n=m?.format)===null||n===void 0?void 0:n.parse)===null&&(p.parseNothing=!0),l=(e=Nl.makeExplicit(l,t,p))!==null&&e!==void 0?e:l,l=new up(l);const v=t.parent&&s1(t.parent);(Is(t)||lf(t))&&v&&(l=(o=Xf.makeFromEncoding(l,t))!==null&&o!==void 0?o:l),t.transforms.length>0&&(l=C_e(l,t,p));const y=mbe(t),x=gbe(t);l=(f=Nl.makeWithAncestors(l,{},Object.assign(Object.assign({},y),x),p))!==null&&f!==void 0?f:l,Is(t)&&(l=sm.parseAll(l,t),l=vy.parseAll(l,t)),(Is(t)||lf(t))&&(v||(l=(r=Xf.makeFromEncoding(l,t))!==null&&r!==void 0?r:l),l=(a=Yf.makeFromEncoding(l,t))!==null&&a!==void 0?a:l,l=zm.parseAllForSortIndex(l,t));const w=t.getDataName(Fo.Raw),k=new hu(l,w,Fo.Raw,h);if(d[w]=k,l=k,Is(t)){const M=sf.makeFromEncoding(l,t);M&&(l=M,w8(t)&&(l=new up(l))),l=(u=x0.makeFromEncoding(l,t))!==null&&u!==void 0?u:l,l=(c=$h.makeFromEncoding(l,t))!==null&&c!==void 0?c:l}Is(t)&&(l=(i=my.make(l,t))!==null&&i!==void 0?i:l);const b=t.getDataName(Fo.Main),T=new hu(l,b,Fo.Main,h);d[b]=T,l=T,Is(t)&&cxe(t,T);let _=null;if(lf(t)){const M=t.getName("facet");l=(s=S_e(l,t.facet))!==null&&s!==void 0?s:l,_=new a1(l,t,M,T.getSource()),d[M]=_}return Object.assign(Object.assign({},t.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:k,main:T,facetRoot:_,ancestorParse:p})}class O_e extends D8{constructor(n,e,o,f){var r,a,u,c;super(n,"concat",e,o,f,n.resolve),(((a=(r=n.resolve)===null||r===void 0?void 0:r.axis)===null||a===void 0?void 0:a.x)==="shared"||((c=(u=n.resolve)===null||u===void 0?void 0:u.axis)===null||c===void 0?void 0:c.y)==="shared")&&Kr(Lge),this.children=this.getChildren(n).map((i,s)=>B8(i,this,this.getName(`concat_${s}`),void 0,f))}parseData(){this.component.data=F3(this);for(const n of this.children)n.parseData()}parseSelections(){this.component.selection={};for(const n of this.children){n.parseSelections();for(const e of Xr(n.component.selection))this.component.selection[e]=n.component.selection[e]}}parseMarkGroup(){for(const n of this.children)n.parseMarkGroup()}parseAxesAndHeaders(){for(const n of this.children)n.parseAxesAndHeaders()}getChildren(n){return _3(n)?n.vconcat:p8(n)?n.hconcat:n.concat}parseLayoutSize(){T_e(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(n){return this.children.reduce((e,o)=>o.assembleSelectionTopLevelSignals(e),n)}assembleSignals(){return this.children.forEach(n=>n.assembleSignals()),[]}assembleLayoutSignals(){const n=A8(this);for(const e of this.children)n.push(...e.assembleLayoutSignals());return n}assembleSelectionData(n){return this.children.reduce((e,o)=>o.assembleSelectionData(e),n)}assembleMarks(){return this.children.map(n=>{const e=n.assembleTitle(),o=n.assembleGroupStyle(),f=n.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:n.getName("group")},e?{title:e}:{}),o?{style:o}:{}),f?{encode:{update:f}}:{}),n.assembleGroup())})}assembleGroupStyle(){}assembleDefaultLayout(){const n=this.layout.columns;return Object.assign(Object.assign({},n!=null?{columns:n}:{}),{bounds:"full",align:"each"})}}function L_e(t){return t===!1||t===null}const P_e=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},jV),{labelExpr:1,encode:1}),OH=Xr(P_e);class z8 extends ad{constructor(n={},e={},o=!1){super(),this.explicit=n,this.implicit=e,this.mainExtracted=o}clone(){return new z8(ha(this.explicit),ha(this.implicit),this.mainExtracted)}hasAxisPart(n){return n==="axis"?!0:n==="grid"||n==="title"?!!this.get(n):!L_e(this.get(n))}hasOrientSignalRef(){return Vi(this.explicit.orient)}}function D_e(t,n,e){var o;const{encoding:f,config:r}=t,a=(o=Ws(f[n]))!==null&&o!==void 0?o:Ws(f[ph(n)]),u=t.axis(n)||{},{format:c,formatType:i}=u;if(F0(i))return Object.assign({text:rf({fieldOrDatumDef:a,field:"datum.value",format:c,formatType:i,config:r})},e);if(c===void 0&&i===void 0&&r.customFormatTypes){if(Om(a)==="quantitative"){if(Lm(a)&&a.stack==="normalize"&&r.normalizedNumberFormatType)return Object.assign({text:rf({fieldOrDatumDef:a,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r})},e);if(r.numberFormatType)return Object.assign({text:rf({fieldOrDatumDef:a,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r})},e)}if(Om(a)==="temporal"&&r.timeFormatType&&ti(a)&&!a.timeUnit)return Object.assign({text:rf({fieldOrDatumDef:a,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r})},e)}return e}function I_e(t){return gh.reduce((n,e)=>(t.component.scales[e]&&(n[e]=[U_e(e,t)]),n),{})}const z_e={bottom:"top",top:"bottom",left:"right",right:"left"};function R_e(t){var n;const{axes:e,resolve:o}=t.component,f={top:0,bottom:0,right:0,left:0};for(const r of t.children){r.parseAxesAndHeaders();for(const a of Xr(r.component.axes))o.axis[a]=M8(t.component.resolve,a),o.axis[a]==="shared"&&(e[a]=F_e(e[a],r.component.axes[a]),e[a]||(o.axis[a]="independent",delete e[a]))}for(const r of gh){for(const a of t.children)if(!!a.component.axes[r]){if(o.axis[r]==="independent"){e[r]=((n=e[r])!==null&&n!==void 0?n:[]).concat(a.component.axes[r]);for(const u of a.component.axes[r]){const{value:c,explicit:i}=u.getWithExplicit("orient");if(!Vi(c)){if(f[c]>0&&!i){const s=z_e[c];f[c]>f[s]&&u.set("orient",s,!1)}f[c]++}}}delete a.component.axes[r]}if(o.axis[r]==="independent"&&e[r]&&e[r].length>1)for(const a of e[r])!!a.get("grid")&&!a.explicit.grid&&(a.implicit.grid=!1)}}function F_e(t,n){if(t){if(t.length!==n.length)return;const e=t.length;for(let o=0;oe.clone());return t}function N_e(t,n){for(const e of OH){const o=ap(t.getWithExplicit(e),n.getWithExplicit(e),e,"axis",(f,r)=>{switch(e){case"title":return YU(f,r);case"gridScale":return{explicit:f.explicit,value:Rs(f.value,r.value)}}return k3(f,r,e,"axis")});t.setWithExplicit(e,o)}return t}function B_e(t,n,e,o,f){if(n==="disable")return e!==void 0;switch(e=e||{},n){case"titleAngle":case"labelAngle":return t===(Vi(e.labelAngle)?e.labelAngle:hy(e.labelAngle));case"values":return!!e.values;case"encode":return!!e.encoding||!!e.labelAngle;case"title":if(t===Xq(o,f))return!0}return t===e[n]}const j_e=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function U_e(t,n){var e,o,f;let r=n.axis(t);const a=new z8,u=Ws(n.encoding[t]),{mark:c,config:i}=n,s=r?.orient||((e=i[t==="x"?"axisX":"axisY"])===null||e===void 0?void 0:e.orient)||((o=i.axis)===null||o===void 0?void 0:o.orient)||bxe(t),l=n.getScaleComponent(t).get("type"),d=dxe(t,l,s,n.config),h=r!==void 0?!r:tA("disable",i.style,r?.style,d).configValue;if(a.set("disable",h,r!==void 0),h)return a;r=r||{};const m=vxe(u,r,t,i.style,d),g={fieldOrDatumDef:u,axis:r,channel:t,model:n,scaleType:l,orient:s,labelAngle:m,mark:c,config:i};for(const y of OH){const x=y in zP?zP[y](g):fP(y)?r[y]:void 0,w=x!==void 0,k=B_e(x,y,r,n,t);if(w&&k)a.set(y,x,k);else{const{configValue:b=void 0,configFrom:T=void 0}=fP(y)&&y!=="values"?tA(y,i.style,r.style,d):{},_=b!==void 0;w&&!_?a.set(y,x,k):(T!=="vgAxisConfig"||j_e.has(y)&&_||cx(b)||Vi(b))&&a.set(y,b,!1)}}const p=(f=r.encoding)!==null&&f!==void 0?f:{},v=BV.reduce((y,x)=>{var w;if(!a.hasAxisPart(x))return y;const k=tH((w=p[x])!==null&&w!==void 0?w:{},n),b=x==="labels"?D_e(n,t,k):k;return b!==void 0&&!_o(b)&&(y[x]={update:b}),y},{});return _o(v)||a.set("encode",v,!!r.encoding||r.labelAngle!==void 0),a}function V_e({encoding:t,size:n}){for(const e of gh){const o=Fu(e);rh(n[o])&&qf(t[e])&&(delete n[o],Kr(QU(o)))}return n}function q_e(t,n,e){const o=Tu(t),f=oo("orient",o,e);if(o.orient=W_e(o.type,n,f),f!==void 0&&f!==o.orient&&Kr(Kge(o.orient,f)),o.type==="bar"&&o.orient){const u=oo("cornerRadiusEnd",o,e);if(u!==void 0){const c=o.orient==="horizontal"&&n.x2||o.orient==="vertical"&&n.y2?["cornerRadius"]:v1e[o.orient];for(const i of c)o[i]=u;o.cornerRadiusEnd!==void 0&&delete o.cornerRadiusEnd}}return oo("opacity",o,e)===void 0&&(o.opacity=$_e(o.type,n)),oo("cursor",o,e)===void 0&&(o.cursor=H_e(o,n,e)),o}function H_e(t,n,e){return n.href||t.href||oo("href",t,e)?"pointer":t.cursor}function $_e(t,n){if(Fa([h3,GE,WE,YE],t)&&!i8(n))return .7}function G_e(t,n,{graticule:e}){if(e)return!1;const o=I0("filled",t,n),f=t.type;return Rs(o,f!==h3&&f!==f3&&f!==M2)}function W_e(t,n,e){switch(t){case h3:case WE:case YE:case vV:case s1e:case o1e:return}const{x:o,y:f,x2:r,y2:a}=n;switch(t){case c3:if(ti(o)&&(xl(o.bin)||ti(f)&&f.aggregate&&!o.aggregate))return"vertical";if(ti(f)&&(xl(f.bin)||ti(o)&&o.aggregate&&!f.aggregate))return"horizontal";if(a||r){if(e)return e;if(!r)return(ti(o)&&o.type===z0&&!Bo(o.bin)||HT(o))&&ti(f)&&xl(f.bin)?"horizontal":"vertical";if(!a)return(ti(f)&&f.type===z0&&!Bo(f.bin)||HT(f))&&ti(o)&&xl(o.bin)?"vertical":"horizontal"}case M2:if(r&&!(ti(o)&&xl(o.bin))&&a&&!(ti(f)&&xl(f.bin)))return;case u3:if(a)return ti(f)&&xl(f.bin)?"horizontal":"vertical";if(r)return ti(o)&&xl(o.bin)?"vertical":"horizontal";if(t===M2){if(o&&!f)return"vertical";if(f&&!o)return"horizontal"}case f3:case GE:{const u=qf(o),c=qf(f);if(e)return e;if(u&&!c)return t!=="tick"?"horizontal":"vertical";if(!u&&c)return t!=="tick"?"vertical":"horizontal";if(u&&c){const i=o,s=f,l=i.type===Em,d=s.type===Em;return l&&!d?t!=="tick"?"vertical":"horizontal":!l&&d?t!=="tick"?"horizontal":"vertical":!i.aggregate&&s.aggregate?t!=="tick"?"vertical":"horizontal":i.aggregate&&!s.aggregate&&t!=="tick"?"horizontal":"vertical"}else return}}return"vertical"}const Y_e={vgMark:"arc",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),Fl("x",t,{defaultPos:"mid"})),Fl("y",t,{defaultPos:"mid"})),sp(t,"radius")),sp(t,"theta"))},X_e={vgMark:"area",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),I2("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="horizontal"})),I2("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="vertical"})),_8(t))},Z_e={vgMark:"rect",encodeEntry:t=>Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),sp(t,"x")),sp(t,"y"))},J_e={vgMark:"shape",encodeEntry:t=>Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:t=>{const{encoding:n}=t,e=n.shape;return[Object.assign({type:"geoshape",projection:t.projectionName()},e&&ti(e)&&e.type===n1?{field:hi(e,{expr:"datum"})}:{})]}},K_e={vgMark:"image",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),sp(t,"x")),sp(t,"y")),x8(t,"url"))},Q_e={vgMark:"line",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),Fl("x",t,{defaultPos:"mid"})),Fl("y",t,{defaultPos:"mid"})),nl("size",t,{vgChannel:"strokeWidth"})),_8(t))},e2e={vgMark:"trail",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),Fl("x",t,{defaultPos:"mid"})),Fl("y",t,{defaultPos:"mid"})),nl("size",t)),_8(t))};function R8(t,n){const{config:e}=t;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),Fl("x",t,{defaultPos:"mid"})),Fl("y",t,{defaultPos:"mid"})),nl("size",t)),nl("angle",t)),t2e(t,e,n))}function t2e(t,n,e){return e?{shape:{value:e}}:nl("shape",t)}const n2e={vgMark:"symbol",encodeEntry:t=>R8(t)},r2e={vgMark:"symbol",encodeEntry:t=>R8(t,"circle")},i2e={vgMark:"symbol",encodeEntry:t=>R8(t,"square")},a2e={vgMark:"rect",encodeEntry:t=>Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),sp(t,"x")),sp(t,"y"))},o2e={vgMark:"rule",encodeEntry:t=>{const{markDef:n}=t,e=n.orient;return!t.encoding.x&&!t.encoding.y&&!t.encoding.latitude&&!t.encoding.longitude?{}:Object.assign(Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),I2("x",t,{defaultPos:e==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:e!=="vertical"})),I2("y",t,{defaultPos:e==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:e!=="horizontal"})),nl("size",t,{vgChannel:"strokeWidth"}))}},s2e={vgMark:"text",encodeEntry:t=>{const{config:n,encoding:e}=t;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ac(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),Fl("x",t,{defaultPos:"mid"})),Fl("y",t,{defaultPos:"mid"})),x8(t)),nl("size",t,{vgChannel:"fontSize"})),nl("angle",t)),LP("align",l2e(t.markDef,e,n))),LP("baseline",u2e(t.markDef,e,n))),Fl("radius",t,{defaultPos:null})),Fl("theta",t,{defaultPos:null}))}};function l2e(t,n,e){if(oo("align",t,e)===void 0)return"center"}function u2e(t,n,e){if(oo("baseline",t,e)===void 0)return"middle"}const c2e={vgMark:"rect",encodeEntry:t=>{const{config:n,markDef:e}=t,o=e.orient,f=o==="horizontal"?"width":"height",r=o==="horizontal"?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ac(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Fl("x",t,{defaultPos:"mid",vgChannel:"xc"})),Fl("y",t,{defaultPos:"mid",vgChannel:"yc"})),nl("size",t,{defaultValue:f2e(t),vgChannel:f})),{[r]:Ho(oo("thickness",e,n))})}};function f2e(t){var n;const{config:e,markDef:o}=t,{orient:f}=o,r=f==="horizontal"?"width":"height",a=t.getScaleComponent(f==="horizontal"?"x":"y"),u=(n=oo("size",o,e,{vgChannel:r}))!==null&&n!==void 0?n:e.tick.bandSize;if(u!==void 0)return u;{const c=a?a.get("range"):void 0;return c&&wp(c)&&wo(c.step)?c.step*3/4:P2(e.view,r)*3/4}}const Cb={arc:Y_e,area:X_e,bar:Z_e,circle:r2e,geoshape:J_e,image:K_e,line:Q_e,point:n2e,rect:a2e,rule:o2e,square:i2e,text:s2e,tick:c2e,trail:e2e};function h2e(t){if(Fa([f3,u3,l1e],t.mark)){const n=HV(t.mark,t.encoding);if(n.length>0)return d2e(t,n)}else if(t.mark===c3){const n=NT.some(e=>oo(e,t.markDef,t.config));if(t.stack&&!t.fieldDef("size")&&n)return p2e(t)}return F8(t)}const JP="faceted_path_";function d2e(t,n){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:JP+t.requestDataName(Fo.Main),data:t.requestDataName(Fo.Main),groupby:n}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:F8(t,{fromPrefix:JP})}]}const KP="stack_group_";function p2e(t){var n;const[e]=F8(t,{fromPrefix:KP}),o=t.scaleName(t.stack.fieldChannel),f=(s={})=>t.vgField(t.stack.fieldChannel,s),r=(s,l)=>{const d=[f({prefix:"min",suffix:"start",expr:l}),f({prefix:"max",suffix:"start",expr:l}),f({prefix:"min",suffix:"end",expr:l}),f({prefix:"max",suffix:"end",expr:l})];return`${s}(${d.map(h=>`scale('${o}',${h})`).join(",")})`};let a,u;t.stack.fieldChannel==="x"?(a=Object.assign(Object.assign({},Am(e.encode.update,["y","yc","y2","height",...NT])),{x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}}),u={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},e.encode.update=Object.assign(Object.assign({},Eu(e.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(a=Object.assign(Object.assign({},Am(e.encode.update,["x","xc","x2","width"])),{y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}}),u={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},e.encode.update=Object.assign(Object.assign({},Eu(e.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const s of NT){const l=I0(s,t.markDef,t.config);e.encode.update[s]?(a[s]=e.encode.update[s],delete e.encode.update[s]):l&&(a[s]=Ho(l)),l&&(e.encode.update[s]={value:0})}const c=[];if(((n=t.stack.groupbyChannels)===null||n===void 0?void 0:n.length)>0)for(const s of t.stack.groupbyChannels){const l=t.fieldDef(s),d=hi(l);d&&c.push(d),(l?.bin||l?.timeUnit)&&c.push(hi(l,{binSuffix:"end"}))}return a=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((s,l)=>{if(e.encode.update[l])return Object.assign(Object.assign({},s),{[l]:e.encode.update[l]});{const d=I0(l,t.markDef,t.config);return d!==void 0?Object.assign(Object.assign({},s),{[l]:Ho(d)}):s}},a),a.stroke&&(a.strokeForeground={value:!0},a.strokeOffset={value:0}),[{type:"group",from:{facet:{data:t.requestDataName(Fo.Main),name:KP+t.requestDataName(Fo.Main),groupby:c,aggregate:{fields:[f({suffix:"start"}),f({suffix:"start"}),f({suffix:"end"}),f({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:a},marks:[{type:"group",encode:{update:u},marks:[e]}]}]}function g2e(t){var n;const{encoding:e,stack:o,mark:f,markDef:r,config:a}=t,u=e.order;if(!(!Ir(u)&&pf(u)&&RT(u.value)||!u&&RT(oo("order",r,a)))){if((Ir(u)||ti(u))&&!o)return $U(u,{expr:"datum"});if(kp(f)){const c=r.orient==="horizontal"?"y":"x",i=e[c];if(ti(i)){const s=i.sort;if(Ir(s))return{field:hi(i,{prefix:c,suffix:"sort_index",expr:"datum"})};if(Wf(s))return{field:hi({aggregate:i8(t.encoding)?s.op:void 0,field:s.field},{expr:"datum"})};if(SV(s)){const l=t.fieldDef(s.encoding);return{field:hi(l,{expr:"datum"}),order:s.order}}else return s===null?void 0:{field:hi(i,{binSuffix:!((n=t.stack)===null||n===void 0)&&n.impute?"mid":void 0,expr:"datum"})}}return}}}function F8(t,n={fromPrefix:""}){const{mark:e,markDef:o,encoding:f,config:r}=t,a=Rs(o.clip,m2e(t),v2e(t)),u=qU(o),c=f.key,i=g2e(t),s=y2e(t),l=oo("aria",o,r),d=Cb[e].postEncodingTransform?Cb[e].postEncodingTransform(t):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName("marks"),type:Cb[e].vgMark},a?{clip:!0}:{}),u?{style:u}:{}),c?{key:c.field}:{}),i?{sort:i}:{}),s||{}),l===!1?{aria:l}:{}),{from:{data:n.fromPrefix+t.requestDataName(Fo.Main)},encode:{update:Cb[e].encodeEntry(t)}}),d?{transform:d}:{})]}function m2e(t){const n=t.getScaleComponent("x"),e=t.getScaleComponent("y");return n?.get("selectionExtent")||e?.get("selectionExtent")?!0:void 0}function v2e(t){const n=t.component.projection;return n&&!n.isFit?!0:void 0}function y2e(t){if(!t.component.selection)return null;const n=Xr(t.component.selection).length;let e=n,o=t.parent;for(;o&&e===0;)e=Xr(o.component.selection).length,o=o.parent;return e?{interactive:n>0||!!t.encoding.tooltip}:null}class LH extends MH{constructor(n,e,o,f={},r){var a;super(n,"unit",e,o,r,void 0,pP(n)?n.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const u=eh(n.mark)?Object.assign({},n.mark):{type:n.mark},c=u.type;u.filled===void 0&&(u.filled=G_e(u,r,{graticule:n.data&&v8(n.data)}));const i=this.encoding=Y1e(n.encoding||{},c,u.filled,r);this.markDef=q_e(u,i,r),this.size=V_e({encoding:i,size:pP(n)?Object.assign(Object.assign(Object.assign({},f),n.width?{width:n.width}:{}),n.height?{height:n.height}:{}):f}),this.stack=fq(c,i),this.specifiedScales=this.initScales(c,i),this.specifiedAxes=this.initAxes(i),this.specifiedLegends=this.initLegends(i),this.specifiedProjection=n.projection,this.selection=((a=n.params)!==null&&a!==void 0?a:[]).filter(s=>h8(s))}get hasProjection(){const{encoding:n}=this,e=this.mark===yV,o=n&&H0e.some(f=>la(n[f]));return e||o}scaleDomain(n){const e=this.specifiedScales[n];return e?e.domain:void 0}axis(n){return this.specifiedAxes[n]}legend(n){return this.specifiedLegends[n]}initScales(n,e){return o3.reduce((o,f)=>{var r;const a=Ws(e[f]);return a&&(o[f]=this.initScale((r=a.scale)!==null&&r!==void 0?r:{})),o},{})}initScale(n){const{domain:e,range:o}=n,f=Tu(n);return Ir(e)&&(f.domain=e.map(Xu)),Ir(o)&&(f.range=o.map(Xu)),f}initAxes(n){return gh.reduce((e,o)=>{const f=n[o];if(la(f)||o===cs&&la(n.x2)||o===ol&&la(n.y2)){const r=la(f)?f.axis:void 0;e[o]=r&&this.initAxis(Object.assign({},r))}return e},{})}initAxis(n){const e=Xr(n),o={};for(const f of e){const r=n[f];o[f]=cx(r)?VU(r):Xu(r)}return o}initLegends(n){return ege.reduce((e,o)=>{const f=Ws(n[o]);if(f&&nge(o)){const r=f.legend;e[o]=r&&Tu(r)}return e},{})}parseData(){this.component.data=F3(this)}parseLayoutSize(){A_e(this)}parseSelections(){this.component.selection=uxe(this,this.selection)}parseMarkGroup(){this.component.mark=h2e(this)}parseAxesAndHeaders(){this.component.axes=I_e(this)}assembleSelectionTopLevelSignals(n){return Oye(this,n)}assembleSignals(){return[...Gq(this),...Eye(this,[])]}assembleSelectionData(n){return Lye(this,n)}assembleLayout(){return null}assembleLayoutSignals(){return A8(this)}assembleMarks(){var n;let e=(n=this.component.mark)!==null&&n!==void 0?n:[];return(!this.parent||!s1(this.parent))&&(e=Aq(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:n}=this.view||{};if(n!==void 0)return n;if(this.encoding.x||this.encoding.y)return"cell"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(n){return y0(this.encoding,n)}fieldDef(n){const e=this.encoding[n];return th(e)}typedFieldDef(n){const e=this.fieldDef(n);return wc(e)?e:null}}class N8 extends D8{constructor(n,e,o,f,r){super(n,"layer",e,o,r,n.resolve,n.view);const a=Object.assign(Object.assign(Object.assign({},f),n.width?{width:n.width}:{}),n.height?{height:n.height}:{});this.children=n.layer.map((u,c)=>{if(w3(u))return new N8(u,this,this.getName(`layer_${c}`),a,r);if(id(u))return new LH(u,this,this.getName(`layer_${c}`),a,r);throw new Error(OE(u))})}parseData(){this.component.data=F3(this);for(const n of this.children)n.parseData()}parseLayoutSize(){k_e(this)}parseSelections(){this.component.selection={};for(const n of this.children){n.parseSelections();for(const e of Xr(n.component.selection))this.component.selection[e]=n.component.selection[e]}}parseMarkGroup(){for(const n of this.children)n.parseMarkGroup()}parseAxesAndHeaders(){R_e(this)}assembleSelectionTopLevelSignals(n){return this.children.reduce((e,o)=>o.assembleSelectionTopLevelSignals(e),n)}assembleSignals(){return this.children.reduce((n,e)=>n.concat(e.assembleSignals()),Gq(this))}assembleLayoutSignals(){return this.children.reduce((n,e)=>n.concat(e.assembleLayoutSignals()),A8(this))}assembleSelectionData(n){return this.children.reduce((e,o)=>o.assembleSelectionData(e),n)}assembleGroupStyle(){const n=new Set;for(const o of this.children)for(const f of ki(o.assembleGroupStyle()))n.add(f);const e=Array.from(n);return e.length>1?e:e.length===1?e[0]:void 0}assembleTitle(){let n=super.assembleTitle();if(n)return n;for(const e of this.children)if(n=e.assembleTitle(),n)return n}assembleLayout(){return null}assembleMarks(){return Pye(this,this.children.flatMap(n=>n.assembleMarks()))}assembleLegends(){return this.children.reduce((n,e)=>n.concat(e.assembleLegends()),uH(this))}}function B8(t,n,e,o,f){if(p3(t))return new jv(t,n,e,f);if(w3(t))return new N8(t,n,e,o,f);if(id(t))return new LH(t,n,e,o,f);if(xve(t))return new O_e(t,n,e,f);throw new Error(OE(t))}var x2e=globalThis&&globalThis.__rest||function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);f(h.name==="width"||h.name==="height")&&h.value!==void 0?(n[h.name]=+h.value,!1):!0);const{params:l}=n,d=x2e(n,["params"]);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},t.description?{description:t.description}:{}),d),u?{title:u}:{}),c?{style:c}:{}),i?{encode:{update:i}}:{}),{data:r}),a.length>0?{projections:a}:{}),t.assembleGroup([...s,...t.assembleSelectionTopLevelSignals([]),...oq(l)])),f?{config:f}:{}),o?{usermeta:o}:{})}const k2e=z0e.version;var T2e=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",version:k2e,compile:b2e,normalize:bq,deepEqual:Uf,duplicate:ha,never:bU,pick:Am,omit:Eu,stringify:No,hash:Ba,isNullOrFalse:RT,contains:Fa,some:L0,every:vE,mergeDeep:_U,unique:Vf,isEqual:N0e,setEqual:wU,hasIntersection:yE,prefixGenerator:FT,fieldIntersection:xE,isEmpty:_o,keys:Xr,vals:ql,entries:rp,isBoolean:fy,varName:Xo,logicalExpr:Nv,deleteNestedProperty:k2,titleCase:Qy,accessPathWithDatum:bE,flatAccessWithDatum:kU,replacePathInField:bc,replaceAll:P0,removePathFromField:_E,accessPathDepth:Mm,getFirstDefined:Rs,uniqueId:AU,resetIdCounter:j0e,internalField:MU,isInternalField:SU,normalizeAngle:hy,isNumeric:Qw});function PH(t){const[n,e]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:n,version:e}}var A2e="vega-themes",M2e="2.10.0",S2e="Themes for stylized Vega and Vega-Lite visualizations.",E2e=["vega","vega-lite","themes","style"],C2e="BSD-3-Clause",O2e={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},L2e=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],P2e="build/vega-themes.js",D2e="build/vega-themes.module.js",I2e="build/vega-themes.min.js",z2e="build/vega-themes.min.js",R2e="build/vega-themes.module.d.ts",F2e={type:"git",url:"https://github.com/vega/vega-themes.git"},N2e=["src","build"],B2e={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",prepare:"beemo create-config",eslintbase:"beemo eslint .",format:"yarn eslintbase --fix",lint:"yarn eslintbase",release:"auto shipit"},j2e={"@auto-it/conventional-commits":"^10.32.2","@auto-it/first-time-contributor":"^10.32.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.6","rollup-plugin-ts":"^1.4.7",auto:"^10.32.2","browser-sync":"^2.27.7",concurrently:"^6.4.0","gh-pages":"^3.2.3",rollup:"^2.60.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-terser":"^7.0.2",typescript:"^4.4.4",vega:"^5.19.1","vega-lite":"^5.0.0","vega-lite-dev-config":"^0.20.0"},U2e={vega:"*","vega-lite":"*"},V2e={name:A2e,version:M2e,description:S2e,keywords:E2e,license:C2e,author:O2e,contributors:L2e,main:P2e,module:D2e,unpkg:I2e,jsdelivr:z2e,types:R2e,repository:F2e,files:N2e,scripts:B2e,devDependencies:j2e,peerDependencies:U2e};const Ug="#fff",q2e="#888",H2e={background:"#333",title:{color:Ug,subtitleColor:Ug},style:{"guide-label":{fill:Ug},"guide-title":{fill:Ug}},axis:{domainColor:Ug,gridColor:q2e,tickColor:Ug}},Vp="#4572a7",$2e={background:"#fff",arc:{fill:Vp},area:{fill:Vp},line:{stroke:Vp,strokeWidth:2},path:{stroke:Vp},rect:{fill:Vp},shape:{stroke:Vp},symbol:{fill:Vp,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},qp="#30a2da",B4="#cbcbcb",G2e="#999",W2e="#333",QP="#f0f0f0",eD="#333",Y2e={arc:{fill:qp},area:{fill:qp},axis:{domainColor:B4,grid:!0,gridColor:B4,gridWidth:1,labelColor:G2e,labelFontSize:10,titleColor:W2e,tickColor:B4,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:QP,group:{fill:QP},legend:{labelColor:eD,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:eD,titleFontSize:14,titlePadding:10},line:{stroke:qp,strokeWidth:2},path:{stroke:qp,strokeWidth:.5},rect:{fill:qp},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:qp},bar:{binSpacing:2,fill:qp,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Hp="#000",X2e={group:{fill:"#e5e5e5"},arc:{fill:Hp},area:{fill:Hp},line:{stroke:Hp},path:{stroke:Hp},rect:{fill:Hp},shape:{stroke:Hp},symbol:{fill:Hp,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Z2e=22,J2e="normal",tD="Benton Gothic, sans-serif",nD=11.5,K2e="normal",$p="#82c6df",j4="Benton Gothic Bold, sans-serif",rD="normal",iD=13,Q1={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},Q2e={background:"#ffffff",title:{anchor:"start",color:"#000000",font:j4,fontSize:Z2e,fontWeight:J2e},arc:{fill:$p},area:{fill:$p},line:{stroke:$p,strokeWidth:2},path:{stroke:$p},rect:{fill:$p},shape:{stroke:$p},symbol:{fill:$p,size:30},axis:{labelFont:tD,labelFontSize:nD,labelFontWeight:K2e,titleFont:j4,titleFontSize:iD,titleFontWeight:rD},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:tD,labelFontSize:nD,symbolType:"square",titleFont:j4,titleFontSize:iD,titleFontWeight:rD},range:{category:Q1["category-6"],diverging:Q1["fireandice-6"],heatmap:Q1["fire-7"],ordinal:Q1["fire-7"],ramp:Q1["fire-7"]}},Gp="#ab5787",Ob="#979797",ewe={background:"#f9f9f9",arc:{fill:Gp},area:{fill:Gp},line:{stroke:Gp},path:{stroke:Gp},rect:{fill:Gp},shape:{stroke:Gp},symbol:{fill:Gp,size:30},axis:{domainColor:Ob,domainWidth:.5,gridWidth:.2,labelColor:Ob,tickColor:Ob,tickWidth:.2,titleColor:Ob},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Wp="#3e5c69",twe={background:"#fff",arc:{fill:Wp},area:{fill:Wp},line:{stroke:Wp},path:{stroke:Wp},rect:{fill:Wp},shape:{stroke:Wp},symbol:{fill:Wp},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},uc="#1696d2",aD="#000000",nwe="#FFFFFF",Lb="Lato",U4="Lato",rwe="Lato",iwe="#DEDDDD",awe=18,ev={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},owe={background:nwe,title:{anchor:"start",fontSize:awe,font:Lb},axisX:{domain:!0,domainColor:aD,domainWidth:1,grid:!1,labelFontSize:12,labelFont:U4,labelAngle:0,tickColor:aD,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Lb},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:iwe,gridWidth:1,labelFontSize:12,labelFont:U4,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Lb,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:U4,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Lb,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:ev["six-groups-cat-1"],diverging:ev["diverging-colors"],heatmap:ev["diverging-colors"],ordinal:ev["six-groups-seq"],ramp:ev["shades-blue"]},area:{fill:uc},rect:{fill:uc},line:{color:uc,stroke:uc,strokeWidth:5},trail:{color:uc,stroke:uc,strokeWidth:0,size:1},path:{stroke:uc,strokeWidth:.5},point:{filled:!0},text:{font:rwe,color:uc,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:uc,stroke:null}},arc:{fill:uc},shape:{stroke:uc},symbol:{fill:uc,size:30}},Yp="#3366CC",oD="#ccc",Pb="Arial, sans-serif",swe={arc:{fill:Yp},area:{fill:Yp},path:{stroke:Yp},rect:{fill:Yp},shape:{stroke:Yp},symbol:{stroke:Yp},circle:{fill:Yp},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:Pb,fontSize:12},"guide-title":{font:Pb,fontSize:12},"group-title":{font:Pb,fontSize:12}},title:{font:Pb,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:oD,tickColor:oD,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},j8=t=>t*(1/3+1),sD=j8(9),lD=j8(10),uD=j8(12),tv="Segoe UI",cD="wf_standard-font, helvetica, arial, sans-serif",fD="#252423",nv="#605E5C",hD="transparent",lwe="#C8C6C4",qc="#118DFF",uwe="#12239E",cwe="#E66C37",fwe="#6B007B",hwe="#E044A7",dwe="#744EC2",pwe="#D9B300",gwe="#D64550",DH=qc,IH="#DEEFFF",dD=[IH,DH],mwe=[IH,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",DH],vwe={view:{stroke:hD},background:hD,font:tv,header:{titleFont:cD,titleFontSize:uD,titleColor:fD,labelFont:tv,labelFontSize:lD,labelColor:nv},axis:{ticks:!1,grid:!1,domain:!1,labelColor:nv,labelFontSize:sD,titleFont:cD,titleColor:fD,titleFontSize:uD,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:lwe,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:qc},line:{stroke:qc,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:tv,fontSize:sD,fill:nv},arc:{fill:qc},area:{fill:qc,line:!0,opacity:.6},path:{stroke:qc},rect:{fill:qc},point:{fill:qc,filled:!0,size:75},shape:{stroke:qc},symbol:{fill:qc,strokeWidth:1.5,size:50},legend:{titleFont:tv,titleFontWeight:"bold",titleColor:nv,labelFont:tv,labelFontSize:lD,labelColor:nv,symbolType:"circle",symbolSize:75},range:{category:[qc,uwe,cwe,fwe,hwe,dwe,pwe,gwe],diverging:dD,heatmap:dD,ordinal:mwe}},ywe=V2e.version;var xwe=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",dark:H2e,excel:$2e,fivethirtyeight:Y2e,ggplot2:X2e,googlecharts:swe,latimes:Q2e,powerbi:vwe,quartz:ewe,urbaninstitute:owe,version:ywe,vox:twe});/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */function bwe(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,o=Object.getOwnPropertySymbols(t);fn(bi(o)?o:pD(o,e))).join(", ")}]`;if(Ei(t)){let o="";const f=t,{title:r,image:a}=f,u=bwe(f,["title","image"]);r&&(o+=`

${n(r)}

`),a&&(o+=``);const c=Object.keys(u);if(c.length>0){o+="";for(const i of c){let s=u[i];s!==void 0&&(Ei(s)&&(s=pD(s,e)),o+=``)}o+="
${n(i)}:${n(s)}
"}return o||"{}"}return n(t)}function wwe(t){const n=[];return function(e,o){if(typeof o!="object"||o===null)return o;const f=n.indexOf(this)+1;return n.length=f,n.length>t?"[Object]":n.indexOf(o)>=0?"[Circular]":(n.push(o),o)}}function pD(t,n){return JSON.stringify(t,wwe(n))}var kwe=`#vg-tooltip-element { + visibility: hidden; + padding: 8px; + position: fixed; + z-index: 1000; + font-family: sans-serif; + font-size: 11px; + border-radius: 3px; + box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); + /* The default theme is the light theme. */ + background-color: rgba(255, 255, 255, 0.95); + border: 1px solid #d9d9d9; + color: black; +} +#vg-tooltip-element.visible { + visibility: visible; +} +#vg-tooltip-element h2 { + margin-top: 0; + margin-bottom: 10px; + font-size: 13px; +} +#vg-tooltip-element img { + max-width: 200px; + max-height: 200px; +} +#vg-tooltip-element table { + border-spacing: 0; +} +#vg-tooltip-element table tr { + border: none; +} +#vg-tooltip-element table tr td { + overflow: hidden; + text-overflow: ellipsis; + padding-top: 2px; + padding-bottom: 2px; +} +#vg-tooltip-element table tr td.key { + color: #808080; + max-width: 150px; + text-align: right; + padding-right: 4px; +} +#vg-tooltip-element table tr td.value { + display: block; + max-width: 300px; + max-height: 7em; + text-align: left; +} +#vg-tooltip-element.dark-theme { + background-color: rgba(32, 32, 32, 0.9); + border: 1px solid #f5f5f5; + color: white; +} +#vg-tooltip-element.dark-theme td.key { + color: #bfbfbf; +} +`;const zH="vg-tooltip-element",Twe={offsetX:10,offsetY:10,id:zH,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Awe,maxDepth:2,formatTooltip:_we};function Awe(t){return String(t).replace(/&/g,"&").replace(/window.innerWidth&&(f=+t.clientX-e-n.width);let r=t.clientY+o;return r+n.height>window.innerHeight&&(r=+t.clientY-o-n.height),{x:f,y:r}}class Ewe{constructor(n){this.options=Object.assign(Object.assign({},Twe),n);const e=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const o=document.createElement("style");o.setAttribute("id",this.options.styleId),o.innerHTML=Mwe(e);const f=document.head;f.childNodes.length>0?f.insertBefore(o,f.childNodes[0]):f.appendChild(o)}}tooltipHandler(n,e,o,f){var r;if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),((r=document.fullscreenElement)!==null&&r!==void 0?r:document.body).appendChild(this.el)),f==null||f===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(f,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:a,y:u}=Swe(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${u}px; left: ${a}px`)}}function Cwe(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function gD(t,n,e,o,f,r,a){try{var u=t[r](a),c=u.value}catch(i){e(i);return}u.done?n(c):Promise.resolve(c).then(o,f)}function N2(t){return function(){var n=this,e=arguments;return new Promise(function(o,f){var r=t.apply(n,e);function a(c){gD(r,o,f,a,u,"next",c)}function u(c){gD(r,o,f,a,u,"throw",c)}a(void 0)})}}var RH=Object.prototype,s0=RH.hasOwnProperty,jf,U8=typeof Symbol=="function"?Symbol:{},N3=U8.iterator||"@@iterator",Owe=U8.asyncIterator||"@@asyncIterator",B2=U8.toStringTag||"@@toStringTag";function FH(t,n,e,o){var f=n&&n.prototype instanceof cA?n:cA,r=Object.create(f.prototype),a=new fA(o||[]);return r._invoke=zwe(t,e,a),r}function V8(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(o){return{type:"throw",arg:o}}}var mD="suspendedStart",Lwe="suspendedYield",vD="executing",Db="completed",Kc={};function cA(){}function B3(){}function Nm(){}var q8={};q8[N3]=function(){return this};var V4=Object.getPrototypeOf,Ib=V4&&V4(V4(H8([])));Ib&&Ib!==RH&&s0.call(Ib,N3)&&(q8=Ib);var l1=Nm.prototype=cA.prototype=Object.create(q8);B3.prototype=l1.constructor=Nm;Nm.constructor=B3;Nm[B2]=B3.displayName="GeneratorFunction";function NH(t){["next","throw","return"].forEach(function(n){t[n]=function(e){return this._invoke(n,e)}})}function BH(t){var n=typeof t=="function"&&t.constructor;return n?n===B3||(n.displayName||n.name)==="GeneratorFunction":!1}function Pwe(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,Nm):(t.__proto__=Nm,B2 in t||(t[B2]="GeneratorFunction")),t.prototype=Object.create(l1),t}function Dwe(t){return{__await:t}}function j3(t,n){function e(r,a,u,c){var i=V8(t[r],t,a);if(i.type==="throw")c(i.arg);else{var s=i.arg,l=s.value;return l&&typeof l=="object"&&s0.call(l,"__await")?n.resolve(l.__await).then(function(d){e("next",d,u,c)},function(d){e("throw",d,u,c)}):n.resolve(l).then(function(d){s.value=d,u(s)},function(d){return e("throw",d,u,c)})}}var o;function f(r,a){function u(){return new n(function(c,i){e(r,a,c,i)})}return o=o?o.then(u,u):u()}this._invoke=f}NH(j3.prototype);j3.prototype[Owe]=function(){return this};function Iwe(t,n,e,o,f){f===void 0&&(f=Promise);var r=new j3(FH(t,n,e,o),f);return BH(n)?r:r.next().then(function(a){return a.done?a.value:r.next()})}function zwe(t,n,e){var o=mD;return function(r,a){if(o===vD)throw new Error("Generator is already running");if(o===Db){if(r==="throw")throw a;return UH()}for(e.method=r,e.arg=a;;){var u=e.delegate;if(u){var c=jH(u,e);if(c){if(c===Kc)continue;return c}}if(e.method==="next")e.sent=e._sent=e.arg;else if(e.method==="throw"){if(o===mD)throw o=Db,e.arg;e.dispatchException(e.arg)}else e.method==="return"&&e.abrupt("return",e.arg);o=vD;var i=V8(t,n,e);if(i.type==="normal"){if(o=e.done?Db:Lwe,i.arg===Kc)continue;return{value:i.arg,done:e.done}}else i.type==="throw"&&(o=Db,e.method="throw",e.arg=i.arg)}}}function jH(t,n){var e=t.iterator[n.method];if(e===jf){if(n.delegate=null,n.method==="throw"){if(t.iterator.return&&(n.method="return",n.arg=jf,jH(t,n),n.method==="throw"))return Kc;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return Kc}var o=V8(e,t.iterator,n.arg);if(o.type==="throw")return n.method="throw",n.arg=o.arg,n.delegate=null,Kc;var f=o.arg;if(!f)return n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,Kc;if(f.done)n[t.resultName]=f.value,n.next=t.nextLoc,n.method!=="return"&&(n.method="next",n.arg=jf);else return f;return n.delegate=null,Kc}NH(l1);l1[B2]="Generator";l1[N3]=function(){return this};l1.toString=function(){return"[object Generator]"};function Rwe(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function q4(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function fA(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Rwe,this),this.reset(!0)}function Fwe(t){var n=[];for(var e in t)n.push(e);return n.reverse(),function o(){for(;n.length;){var f=n.pop();if(f in t)return o.value=f,o.done=!1,o}return o.done=!0,o}}function H8(t){if(t){var n=t[N3];if(n)return n.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var e=-1,o=function f(){for(;++e=0;--f){var r=this.tryEntries[f],a=r.completion;if(r.tryLoc==="root")return o("end");if(r.tryLoc<=this.prev){var u=s0.call(r,"catchLoc"),c=s0.call(r,"finallyLoc");if(u&&c){if(this.prev=0;--o){var f=this.tryEntries[o];if(f.tryLoc<=this.prev&&s0.call(f,"finallyLoc")&&this.prev=0;--e){var o=this.tryEntries[e];if(o.finallyLoc===n)return this.complete(o.completion,o.afterLoc),q4(o),Kc}},catch:function(n){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc===n){var f=o.completion;if(f.type==="throw"){var r=f.arg;q4(o)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(n,e,o){return this.delegate={iterator:H8(n),resultName:e,nextLoc:o},this.method==="next"&&(this.arg=jf),Kc}};var Hf={wrap:FH,isGeneratorFunction:BH,AsyncIterator:j3,mark:Pwe,awrap:Dwe,async:Iwe,keys:Fwe,values:H8},Nwe=Za;Za.Node=U0;Za.create=Za;function Za(t){var n=this;if(n instanceof Za||(n=new Za),n.tail=null,n.head=null,n.length=0,t&&typeof t.forEach=="function")t.forEach(function(f){n.push(f)});else if(arguments.length>0)for(var e=0,o=arguments.length;e1)e=n;else if(this.head)o=this.head.next,e=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=0;o!==null;f++)e=t(e,o.value,f),o=o.next;return e};Za.prototype.reduceReverse=function(t,n){var e,o=this.tail;if(arguments.length>1)e=n;else if(this.tail)o=this.tail.prev,e=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=this.length-1;o!==null;f--)e=t(e,o.value,f),o=o.prev;return e};Za.prototype.toArray=function(){for(var t=new Array(this.length),n=0,e=this.head;e!==null;n++)t[n]=e.value,e=e.next;return t};Za.prototype.toArrayReverse=function(){for(var t=new Array(this.length),n=0,e=this.tail;e!==null;n++)t[n]=e.value,e=e.prev;return t};Za.prototype.slice=function(t,n){n=n||this.length,n<0&&(n+=this.length),t=t||0,t<0&&(t+=this.length);var e=new Za;if(nthis.length&&(n=this.length);for(var o=0,f=this.head;f!==null&&othis.length&&(n=this.length);for(var o=this.length,f=this.tail;f!==null&&o>n;o--)f=f.prev;for(;f!==null&&o>t;o--,f=f.prev)e.push(f.value);return e};Za.prototype.splice=function(t,n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var e=0,o=this.head;o!==null&&e1;class qwe{constructor(n){if(typeof n=="number"&&(n={max:n}),n||(n={}),n.max&&(typeof n.max!="number"||n.max<0))throw new TypeError("max must be a non-negative number");this[r0]=n.max||1/0;var e=n.length||H4;if(this[Vg]=typeof e!="function"?H4:e,this[Uv]=n.stale||!1,n.maxAge&&typeof n.maxAge!="number")throw new TypeError("maxAge must be a number");this[l0]=n.maxAge||0,this[Ch]=n.dispose,this[yD]=n.noDisposeOnSet||!1,this[VH]=n.updateAgeOnGet||!1,this.reset()}set max(n){if(typeof n!="number"||n<0)throw new TypeError("max must be a non-negative number");this[r0]=n||1/0,rv(this)}get max(){return this[r0]}set allowStale(n){this[Uv]=!!n}get allowStale(){return this[Uv]}set maxAge(n){if(typeof n!="number")throw new TypeError("maxAge must be a non-negative number");this[l0]=n,rv(this)}get maxAge(){return this[l0]}set lengthCalculator(n){typeof n!="function"&&(n=H4),n!==this[Vg]&&(this[Vg]=n,this[Ph]=0,this[tl].forEach(e=>{e.length=this[Vg](e.value,e.key),this[Ph]+=e.length})),rv(this)}get lengthCalculator(){return this[Vg]}get length(){return this[Ph]}get itemCount(){return this[tl].length}rforEach(n,e){e=e||this;for(var o=this[tl].tail;o!==null;){var f=o.prev;xD(this,n,o,e),o=f}}forEach(n,e){e=e||this;for(var o=this[tl].head;o!==null;){var f=o.next;xD(this,n,o,e),o=f}}keys(){return this[tl].toArray().map(n=>n.key)}values(){return this[tl].toArray().map(n=>n.value)}reset(){this[Ch]&&this[tl]&&this[tl].length&&this[tl].forEach(n=>this[Ch](n.key,n.value)),this[Hc]=new Map,this[tl]=new Vwe,this[Ph]=0}dump(){return this[tl].map(n=>j2(this,n)?!1:{k:n.key,v:n.value,e:n.now+(n.maxAge||0)}).toArray().filter(n=>n)}dumpLru(){return this[tl]}set(n,e,o){if(o=o||this[l0],o&&typeof o!="number")throw new TypeError("maxAge must be a number");var f=o?Date.now():0,r=this[Vg](e,n);if(this[Hc].has(n)){if(r>this[r0])return lm(this,this[Hc].get(n)),!1;var a=this[Hc].get(n),u=a.value;return this[Ch]&&(this[yD]||this[Ch](n,u.value)),u.now=f,u.maxAge=o,u.value=e,this[Ph]+=r-u.length,u.length=r,this.get(n),rv(this),!0}var c=new Hwe(n,e,r,f,o);return c.length>this[r0]?(this[Ch]&&this[Ch](n,e),!1):(this[Ph]+=c.length,this[tl].unshift(c),this[Hc].set(n,this[tl].head),rv(this),!0)}has(n){if(!this[Hc].has(n))return!1;var e=this[Hc].get(n).value;return!j2(this,e)}get(n){return $4(this,n,!0)}peek(n){return $4(this,n,!1)}pop(){var n=this[tl].tail;return n?(lm(this,n),n.value):null}del(n){lm(this,this[Hc].get(n))}load(n){this.reset();for(var e=Date.now(),o=n.length-1;o>=0;o--){var f=n[o],r=f.e||0;if(r===0)this.set(f.k,f.v);else{var a=r-e;a>0&&this.set(f.k,f.v,a)}}}prune(){this[Hc].forEach((n,e)=>$4(this,e,!1))}}var $4=(t,n,e)=>{var o=t[Hc].get(n);if(o){var f=o.value;if(j2(t,f)){if(lm(t,o),!t[Uv])return}else e&&(t[VH]&&(o.value.now=Date.now()),t[tl].unshiftNode(o));return f.value}},j2=(t,n)=>{if(!n||!n.maxAge&&!t[l0])return!1;var e=Date.now()-n.now;return n.maxAge?e>n.maxAge:t[l0]&&e>t[l0]},rv=t=>{if(t[Ph]>t[r0])for(var n=t[tl].tail;t[Ph]>t[r0]&&n!==null;){var e=n.prev;lm(t,n),n=e}},lm=(t,n)=>{if(n){var e=n.value;t[Ch]&&t[Ch](e.key,e.value),t[Ph]-=e.length,t[Hc].delete(e.key),t[tl].removeNode(n)}};class Hwe{constructor(n,e,o,f,r){this.key=n,this.value=e,this.length=o,this.now=f,this.maxAge=r||0}}var xD=(t,n,e,o)=>{var f=e.value;j2(t,f)&&(lm(t,e),t[Uv]||(f=void 0)),f&&n.call(o,f.value,f.key,t)},$we=qwe,Gwe=["includePrerelease","loose","rtl"],Wwe=t=>t?typeof t!="object"?{loose:!0}:Gwe.filter(n=>t[n]).reduce((n,e)=>(n[e]=!0,n),{}):{},$8=Wwe,Qc={exports:{}},Ywe="2.0.0",Xwe=256,Zwe=Number.MAX_SAFE_INTEGER||9007199254740991,Jwe=16,G8={SEMVER_SPEC_VERSION:Ywe,MAX_LENGTH:Xwe,MAX_SAFE_INTEGER:Zwe,MAX_SAFE_COMPONENT_LENGTH:Jwe},Kwe=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?function(){for(var t=arguments.length,n=new Array(t),e=0;e{},U3=Kwe;(function(t,n){var e=G8.MAX_SAFE_COMPONENT_LENGTH,o=U3;n=t.exports={};var f=n.re=[],r=n.src=[],a=n.t={},u=0,c=(i,s,l)=>{var d=u++;o(i,d,s),a[i]=d,r[d]=s,f[d]=new RegExp(s,l?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION","(".concat(r[a.NUMERICIDENTIFIER],")\\.")+"(".concat(r[a.NUMERICIDENTIFIER],")\\.")+"(".concat(r[a.NUMERICIDENTIFIER],")")),c("MAINVERSIONLOOSE","(".concat(r[a.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(r[a.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(r[a.NUMERICIDENTIFIERLOOSE],")")),c("PRERELEASEIDENTIFIER","(?:".concat(r[a.NUMERICIDENTIFIER],"|").concat(r[a.NONNUMERICIDENTIFIER],")")),c("PRERELEASEIDENTIFIERLOOSE","(?:".concat(r[a.NUMERICIDENTIFIERLOOSE],"|").concat(r[a.NONNUMERICIDENTIFIER],")")),c("PRERELEASE","(?:-(".concat(r[a.PRERELEASEIDENTIFIER],"(?:\\.").concat(r[a.PRERELEASEIDENTIFIER],")*))")),c("PRERELEASELOOSE","(?:-?(".concat(r[a.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(r[a.PRERELEASEIDENTIFIERLOOSE],")*))")),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD","(?:\\+(".concat(r[a.BUILDIDENTIFIER],"(?:\\.").concat(r[a.BUILDIDENTIFIER],")*))")),c("FULLPLAIN","v?".concat(r[a.MAINVERSION]).concat(r[a.PRERELEASE],"?").concat(r[a.BUILD],"?")),c("FULL","^".concat(r[a.FULLPLAIN],"$")),c("LOOSEPLAIN","[v=\\s]*".concat(r[a.MAINVERSIONLOOSE]).concat(r[a.PRERELEASELOOSE],"?").concat(r[a.BUILD],"?")),c("LOOSE","^".concat(r[a.LOOSEPLAIN],"$")),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE","".concat(r[a.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),c("XRANGEIDENTIFIER","".concat(r[a.NUMERICIDENTIFIER],"|x|X|\\*")),c("XRANGEPLAIN","[v=\\s]*(".concat(r[a.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(r[a.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(r[a.XRANGEIDENTIFIER],")")+"(?:".concat(r[a.PRERELEASE],")?").concat(r[a.BUILD],"?")+")?)?"),c("XRANGEPLAINLOOSE","[v=\\s]*(".concat(r[a.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(r[a.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(r[a.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(r[a.PRERELEASELOOSE],")?").concat(r[a.BUILD],"?")+")?)?"),c("XRANGE","^".concat(r[a.GTLT],"\\s*").concat(r[a.XRANGEPLAIN],"$")),c("XRANGELOOSE","^".concat(r[a.GTLT],"\\s*").concat(r[a.XRANGEPLAINLOOSE],"$")),c("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(e,"})")+"(?:\\.(\\d{1,".concat(e,"}))?")+"(?:\\.(\\d{1,".concat(e,"}))?")+"(?:$|[^\\d])"),c("COERCERTL",r[a.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM","(\\s*)".concat(r[a.LONETILDE],"\\s+"),!0),n.tildeTrimReplace="$1~",c("TILDE","^".concat(r[a.LONETILDE]).concat(r[a.XRANGEPLAIN],"$")),c("TILDELOOSE","^".concat(r[a.LONETILDE]).concat(r[a.XRANGEPLAINLOOSE],"$")),c("LONECARET","(?:\\^)"),c("CARETTRIM","(\\s*)".concat(r[a.LONECARET],"\\s+"),!0),n.caretTrimReplace="$1^",c("CARET","^".concat(r[a.LONECARET]).concat(r[a.XRANGEPLAIN],"$")),c("CARETLOOSE","^".concat(r[a.LONECARET]).concat(r[a.XRANGEPLAINLOOSE],"$")),c("COMPARATORLOOSE","^".concat(r[a.GTLT],"\\s*(").concat(r[a.LOOSEPLAIN],")$|^$")),c("COMPARATOR","^".concat(r[a.GTLT],"\\s*(").concat(r[a.FULLPLAIN],")$|^$")),c("COMPARATORTRIM","(\\s*)".concat(r[a.GTLT],"\\s*(").concat(r[a.LOOSEPLAIN],"|").concat(r[a.XRANGEPLAIN],")"),!0),n.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE","^\\s*(".concat(r[a.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(r[a.XRANGEPLAIN],")")+"\\s*$"),c("HYPHENRANGELOOSE","^\\s*(".concat(r[a.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(r[a.XRANGEPLAINLOOSE],")")+"\\s*$"),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Qc,Qc.exports);var bD=/^[0-9]+$/,qH=(t,n)=>{var e=bD.test(t),o=bD.test(n);return e&&o&&(t=+t,n=+n),t===n?0:e&&!o?-1:o&&!e?1:tqH(n,t),e3e={compareIdentifiers:qH,rcompareIdentifiers:Qwe},zb=U3,_D=G8.MAX_LENGTH,Rb=G8.MAX_SAFE_INTEGER,wD=Qc.exports.re,kD=Qc.exports.t,t3e=$8,qg=e3e.compareIdentifiers;class $c{constructor(n,e){if(e=t3e(e),n instanceof $c){if(n.loose===!!e.loose&&n.includePrerelease===!!e.includePrerelease)return n;n=n.version}else if(typeof n!="string")throw new TypeError("Invalid Version: ".concat(n));if(n.length>_D)throw new TypeError("version is longer than ".concat(_D," characters"));zb("SemVer",n,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;var o=n.trim().match(e.loose?wD[kD.LOOSE]:wD[kD.FULL]);if(!o)throw new TypeError("Invalid Version: ".concat(n));if(this.raw=n,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Rb||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Rb||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Rb||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(f=>{if(/^[0-9]+$/.test(f)){var r=+f;if(r>=0&&r=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);o===-1&&this.prerelease.push(0)}e&&(qg(this.prerelease[0],e)===0?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: ".concat(n))}return this.format(),this.raw=this.version,this}}var W8=$c,TD=W8,n3e=(t,n,e)=>new TD(t,e).compare(new TD(n,e)),u1=n3e,r3e=u1,i3e=(t,n,e)=>r3e(t,n,e)===0,a3e=i3e,o3e=u1,s3e=(t,n,e)=>o3e(t,n,e)!==0,l3e=s3e,u3e=u1,c3e=(t,n,e)=>u3e(t,n,e)>0,f3e=c3e,h3e=u1,d3e=(t,n,e)=>h3e(t,n,e)>=0,p3e=d3e,g3e=u1,m3e=(t,n,e)=>g3e(t,n,e)<0,v3e=m3e,y3e=u1,x3e=(t,n,e)=>y3e(t,n,e)<=0,b3e=x3e,_3e=a3e,w3e=l3e,k3e=f3e,T3e=p3e,A3e=v3e,M3e=b3e,S3e=(t,n,e,o)=>{switch(n){case"===":return typeof t=="object"&&(t=t.version),typeof e=="object"&&(e=e.version),t===e;case"!==":return typeof t=="object"&&(t=t.version),typeof e=="object"&&(e=e.version),t!==e;case"":case"=":case"==":return _3e(t,e,o);case"!=":return w3e(t,e,o);case">":return k3e(t,e,o);case">=":return T3e(t,e,o);case"<":return A3e(t,e,o);case"<=":return M3e(t,e,o);default:throw new TypeError("Invalid operator: ".concat(n))}},E3e=S3e,G4,AD;function C3e(){if(AD)return G4;AD=1;var t=Symbol("SemVer ANY");class n{static get ANY(){return t}constructor(s,l){if(l=e(l),s instanceof n){if(s.loose===!!l.loose)return s;s=s.value}a("comparator",s,l),this.options=l,this.loose=!!l.loose,this.parse(s),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(s){var l=this.options.loose?o[f.COMPARATORLOOSE]:o[f.COMPARATOR],d=s.match(l);if(!d)throw new TypeError("Invalid comparator: ".concat(s));this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new u(d[2],this.options.loose):this.semver=t}toString(){return this.value}test(s){if(a("Comparator.test",s,this.options.loose),this.semver===t||s===t)return!0;if(typeof s=="string")try{s=new u(s,this.options)}catch{return!1}return r(s,this.operator,this.semver,this.options)}intersects(s,l){if(!(s instanceof n))throw new TypeError("a Comparator is required");if((!l||typeof l!="object")&&(l={loose:!!l,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new c(s.value,l).test(this.value);if(s.operator==="")return s.value===""?!0:new c(this.value,l).test(s.semver);var d=(this.operator===">="||this.operator===">")&&(s.operator===">="||s.operator===">"),h=(this.operator==="<="||this.operator==="<")&&(s.operator==="<="||s.operator==="<"),m=this.semver.version===s.semver.version,g=(this.operator===">="||this.operator==="<=")&&(s.operator===">="||s.operator==="<="),p=r(this.semver,"<",s.semver,l)&&(this.operator===">="||this.operator===">")&&(s.operator==="<="||s.operator==="<"),v=r(this.semver,">",s.semver,l)&&(this.operator==="<="||this.operator==="<")&&(s.operator===">="||s.operator===">");return d||h||m&&g||p||v}}G4=n;var e=$8,o=Qc.exports.re,f=Qc.exports.t,r=E3e,a=U3,u=W8,c=HH();return G4}function MD(t,n){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=O3e(t))||n&&t&&typeof t.length=="number"){e&&(t=e);var o=0,f=function(){};return{s:f,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(i){throw i},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var i=e.next();return r=i.done,i},e:function(i){a=!0,u=i},f:function(){try{!r&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function O3e(t,n){if(!!t){if(typeof t=="string")return SD(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return SD(t,n)}}function SD(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);ethis.parseRange(P.trim())).filter(P=>P.length),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(E));if(this.set.length>1){var O=this.set[0];if(this.set=this.set.filter(P=>!d(P[0])),this.set.length===0)this.set=[O];else if(this.set.length>1){var R=MD(this.set),z;try{for(R.s();!(z=R.n()).done;){var L=z.value;if(L.length===1&&h(L[0])){this.set=[L];break}}}catch(P){R.e(P)}finally{R.f()}}}this.format()}format(){return this.range=this.set.map(E=>E.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(E){E=E.trim();var D=Object.keys(this.options).join(","),O="parseRange:".concat(D,":").concat(E),R=e.get(O);if(R)return R;var z=this.options.loose,L=z?u[c.HYPHENRANGELOOSE]:u[c.HYPHENRANGE];E=E.replace(L,M(this.options.includePrerelease)),r("hyphen replace",E),E=E.replace(u[c.COMPARATORTRIM],i),r("comparator trim",E),E=E.replace(u[c.TILDETRIM],s),E=E.replace(u[c.CARETTRIM],l),E=E.split(/\s+/).join(" ");var P=E.split(" ").map(Y=>g(Y,this.options)).join(" ").split(/\s+/).map(Y=>_(Y,this.options));z&&(P=P.filter(Y=>(r("loose invalid filter",Y,this.options),!!Y.match(u[c.COMPARATORLOOSE])))),r("range list",P);var N=new Map,B=P.map(Y=>new f(Y,this.options)),G=MD(B),W;try{for(G.s();!(W=G.n()).done;){var K=W.value;if(d(K))return[K];N.set(K.value,K)}}catch(Y){G.e(Y)}finally{G.f()}N.size>1&&N.has("")&&N.delete("");var te=[...N.values()];return e.set(O,te),te}intersects(E,D){if(!(E instanceof t))throw new TypeError("a Range is required");return this.set.some(O=>m(O,D)&&E.set.some(R=>m(R,D)&&O.every(z=>R.every(L=>z.intersects(L,D)))))}test(E){if(!E)return!1;if(typeof E=="string")try{E=new a(E,this.options)}catch{return!1}for(var D=0;DS.value==="<0.0.0-0",h=S=>S.value==="",m=(S,E)=>{for(var D=!0,O=S.slice(),R=O.pop();D&&O.length;)D=O.every(z=>R.intersects(z,E)),R=O.pop();return D},g=(S,E)=>(r("comp",S,E),S=x(S,E),r("caret",S),S=v(S,E),r("tildes",S),S=k(S,E),r("xrange",S),S=T(S,E),r("stars",S),S),p=S=>!S||S.toLowerCase()==="x"||S==="*",v=(S,E)=>S.trim().split(/\s+/).map(D=>y(D,E)).join(" "),y=(S,E)=>{var D=E.loose?u[c.TILDELOOSE]:u[c.TILDE];return S.replace(D,(O,R,z,L,P)=>{r("tilde",S,O,R,z,L,P);var N;return p(R)?N="":p(z)?N=">=".concat(R,".0.0 <").concat(+R+1,".0.0-0"):p(L)?N=">=".concat(R,".").concat(z,".0 <").concat(R,".").concat(+z+1,".0-0"):P?(r("replaceTilde pr",P),N=">=".concat(R,".").concat(z,".").concat(L,"-").concat(P," <").concat(R,".").concat(+z+1,".0-0")):N=">=".concat(R,".").concat(z,".").concat(L," <").concat(R,".").concat(+z+1,".0-0"),r("tilde return",N),N})},x=(S,E)=>S.trim().split(/\s+/).map(D=>w(D,E)).join(" "),w=(S,E)=>{r("caret",S,E);var D=E.loose?u[c.CARETLOOSE]:u[c.CARET],O=E.includePrerelease?"-0":"";return S.replace(D,(R,z,L,P,N)=>{r("caret",S,R,z,L,P,N);var B;return p(z)?B="":p(L)?B=">=".concat(z,".0.0").concat(O," <").concat(+z+1,".0.0-0"):p(P)?z==="0"?B=">=".concat(z,".").concat(L,".0").concat(O," <").concat(z,".").concat(+L+1,".0-0"):B=">=".concat(z,".").concat(L,".0").concat(O," <").concat(+z+1,".0.0-0"):N?(r("replaceCaret pr",N),z==="0"?L==="0"?B=">=".concat(z,".").concat(L,".").concat(P,"-").concat(N," <").concat(z,".").concat(L,".").concat(+P+1,"-0"):B=">=".concat(z,".").concat(L,".").concat(P,"-").concat(N," <").concat(z,".").concat(+L+1,".0-0"):B=">=".concat(z,".").concat(L,".").concat(P,"-").concat(N," <").concat(+z+1,".0.0-0")):(r("no pr"),z==="0"?L==="0"?B=">=".concat(z,".").concat(L,".").concat(P).concat(O," <").concat(z,".").concat(L,".").concat(+P+1,"-0"):B=">=".concat(z,".").concat(L,".").concat(P).concat(O," <").concat(z,".").concat(+L+1,".0-0"):B=">=".concat(z,".").concat(L,".").concat(P," <").concat(+z+1,".0.0-0")),r("caret return",B),B})},k=(S,E)=>(r("replaceXRanges",S,E),S.split(/\s+/).map(D=>b(D,E)).join(" ")),b=(S,E)=>{S=S.trim();var D=E.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return S.replace(D,(O,R,z,L,P,N)=>{r("xRange",S,O,R,z,L,P,N);var B=p(z),G=B||p(L),W=G||p(P),K=W;return R==="="&&K&&(R=""),N=E.includePrerelease?"-0":"",B?R===">"||R==="<"?O="<0.0.0-0":O="*":R&&K?(G&&(L=0),P=0,R===">"?(R=">=",G?(z=+z+1,L=0,P=0):(L=+L+1,P=0)):R==="<="&&(R="<",G?z=+z+1:L=+L+1),R==="<"&&(N="-0"),O="".concat(R+z,".").concat(L,".").concat(P).concat(N)):G?O=">=".concat(z,".0.0").concat(N," <").concat(+z+1,".0.0-0"):W&&(O=">=".concat(z,".").concat(L,".0").concat(N," <").concat(z,".").concat(+L+1,".0-0")),r("xRange return",O),O})},T=(S,E)=>(r("replaceStars",S,E),S.trim().replace(u[c.STAR],"")),_=(S,E)=>(r("replaceGTE0",S,E),S.trim().replace(u[E.includePrerelease?c.GTE0PRE:c.GTE0],"")),M=S=>(E,D,O,R,z,L,P,N,B,G,W,K,te)=>(p(O)?D="":p(R)?D=">=".concat(O,".0.0").concat(S?"-0":""):p(z)?D=">=".concat(O,".").concat(R,".0").concat(S?"-0":""):L?D=">=".concat(D):D=">=".concat(D).concat(S?"-0":""),p(B)?N="":p(G)?N="<".concat(+B+1,".0.0-0"):p(W)?N="<".concat(B,".").concat(+G+1,".0-0"):K?N="<=".concat(B,".").concat(G,".").concat(W,"-").concat(K):S?N="<".concat(B,".").concat(G,".").concat(+W+1,"-0"):N="<=".concat(N),"".concat(D," ").concat(N).trim()),A=(S,E,D)=>{for(var O=0;O0){var z=S[R].semver;if(z.major===E.major&&z.minor===E.minor&&z.patch===E.patch)return!0}return!1}return!0};return W4}var L3e=HH(),P3e=(t,n,e)=>{try{n=new L3e(n,e)}catch{return!1}return n.test(t)},$H=P3e;function D3e(t,n,e){var o=t.open(n),f=1e4,r=250,a=new URL(n),u=a.origin,c=~~(f/r);function i(l){l.source===o&&(c=0,t.removeEventListener("message",i,!1))}t.addEventListener("message",i,!1);function s(){c<=0||(o.postMessage(e,u),setTimeout(s,r),c-=1)}setTimeout(s,r)}var I3e=`.vega-embed { + position: relative; + display: inline-block; + box-sizing: border-box; +} +.vega-embed.has-actions { + padding-right: 38px; +} +.vega-embed details:not([open]) > :not(summary) { + display: none !important; +} +.vega-embed summary { + list-style: none; + position: absolute; + top: 0; + right: 0; + padding: 6px; + z-index: 1000; + background: white; + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); + color: #1b1e23; + border: 1px solid #aaa; + border-radius: 999px; + opacity: 0.2; + transition: opacity 0.4s ease-in; + cursor: pointer; + line-height: 0px; +} +.vega-embed summary::-webkit-details-marker { + display: none; +} +.vega-embed summary:active { + box-shadow: #aaa 0px 0px 0px 1px inset; +} +.vega-embed summary svg { + width: 14px; + height: 14px; +} +.vega-embed details[open] summary { + opacity: 0.7; +} +.vega-embed:hover summary, .vega-embed:focus-within summary { + opacity: 1 !important; + transition: opacity 0.2s ease; +} +.vega-embed .vega-actions { + position: absolute; + z-index: 1001; + top: 35px; + right: -9px; + display: flex; + flex-direction: column; + padding-bottom: 8px; + padding-top: 8px; + border-radius: 4px; + box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2); + border: 1px solid #d9d9d9; + background: white; + animation-duration: 0.15s; + animation-name: scale-in; + animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); + text-align: left; +} +.vega-embed .vega-actions a { + padding: 8px 16px; + font-family: sans-serif; + font-size: 14px; + font-weight: 600; + white-space: nowrap; + color: #434a56; + text-decoration: none; +} +.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus { + background-color: #f7f7f9; + color: black; +} +.vega-embed .vega-actions::before, .vega-embed .vega-actions::after { + content: ""; + display: inline-block; + position: absolute; +} +.vega-embed .vega-actions::before { + left: auto; + right: 14px; + top: -16px; + border: 8px solid rgba(0, 0, 0, 0); + border-bottom-color: #d9d9d9; +} +.vega-embed .vega-actions::after { + left: auto; + right: 15px; + top: -14px; + border: 7px solid rgba(0, 0, 0, 0); + border-bottom-color: #fff; +} +.vega-embed .chart-wrapper.fit-x { + width: 100%; +} +.vega-embed .chart-wrapper.fit-y { + height: 100%; +} + +.vega-embed-wrapper { + max-width: 100%; + overflow: auto; + padding-right: 14px; +} + +@keyframes scale-in { + from { + opacity: 0; + transform: scale(0.6); + } + to { + opacity: 1; + transform: scale(1); + } +} +`;String.prototype.startsWith||(String.prototype.startsWith=function(t,n){return this.substr(!n||n<0?0:+n,t.length)===t});function GH(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(i){throw i},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r=!0,a=!1,u;return{s:function(){e=e.call(t)},n:function(){var i=e.next();return r=i.done,i},e:function(i){a=!0,u=i},f:function(){try{!r&&e.return!=null&&e.return()}finally{if(a)throw u}}}}function F3e(t,n){if(!!t){if(typeof t=="string")return CD(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return CD(t,n)}}function CD(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);et,"vega-lite":(t,n)=>xy.compile(t,{config:n}).spec},U3e=` + + + + +`,V3e="chart-wrapper";function q3e(t){return typeof t=="function"}function LD(t,n,e,o){var f="".concat(n,'
'),r="
".concat(e,""),a=window.open("");a.document.write(f+t+r),a.document.title="".concat(Mv[o]," JSON Source")}function H3e(t,n){if(t.$schema){var e=PH(t.$schema);if(n&&n!==e.library){var o;console.warn("The given visualization spec is written in ".concat(Mv[e.library],", but mode argument sets ").concat((o=Mv[n])!==null&&o!==void 0?o:n,"."))}var f=e.library;return $H(U2[f],"^".concat(e.version.slice(1)))||console.warn("The input spec uses ".concat(Mv[f]," ").concat(e.version,", but the current version of ").concat(Mv[f]," is v").concat(U2[f],".")),f}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":n??"vega"}function $3e(t){return!!(t&&"load"in t)}function PD(t){return $3e(t)?t:Gc.loader(t)}function G3e(t){var n,e,o=(n=(e=t.usermeta)===null||e===void 0?void 0:e.embedOptions)!==null&&n!==void 0?n:{};return bi(o.defaultStyle)&&(o.defaultStyle=!1),o}function W3e(t,n){return hA.apply(this,arguments)}function hA(){return hA=N2(Hf.mark(function t(n,e){var o,f,r,a,u,c,i,s,l,d,h,m=arguments;return Hf.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(r=m.length>2&&m[2]!==void 0?m[2]:{},!bi(e)){p.next=10;break}return u=PD(r.loader),p.t0=JSON,p.next=6,u.load(e);case 6:p.t1=p.sent,a=p.t0.parse.call(p.t0,p.t1),p.next=11;break;case 10:a=e;case 11:return c=G3e(a),i=c.loader,(!u||i)&&(u=PD((s=r.loader)!==null&&s!==void 0?s:i)),p.next=16,DD(c,u);case 16:return l=p.sent,p.next=19,DD(r,u);case 19:return d=p.sent,h=Gd(Gd({},GH(d,l)),{},{config:Vm((o=d.config)!==null&&o!==void 0?o:{},(f=l.config)!==null&&f!==void 0?f:{})}),p.next=23,X3e(n,a,h,u);case 23:return p.abrupt("return",p.sent);case 24:case"end":return p.stop()}},t)})),hA.apply(this,arguments)}function DD(t,n){return dA.apply(this,arguments)}function dA(){return dA=N2(Hf.mark(function t(n,e){var o,f,r;return Hf.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!bi(n.config)){u.next=8;break}return u.t1=JSON,u.next=4,e.load(n.config);case 4:u.t2=u.sent,u.t0=u.t1.parse.call(u.t1,u.t2),u.next=9;break;case 8:u.t0=(o=n.config)!==null&&o!==void 0?o:{};case 9:if(f=u.t0,!bi(n.patch)){u.next=18;break}return u.t4=JSON,u.next=14,e.load(n.patch);case 14:u.t5=u.sent,u.t3=u.t4.parse.call(u.t4,u.t5),u.next=19;break;case 18:u.t3=n.patch;case 19:return r=u.t3,u.abrupt("return",Gd(Gd(Gd({},n),r?{patch:r}:{}),f?{config:f}:{}));case 21:case"end":return u.stop()}},t)})),dA.apply(this,arguments)}function Y3e(t){var n,e=t.getRootNode?t.getRootNode():document;return e instanceof ShadowRoot?{root:e,rootContainer:e}:{root:document,rootContainer:(n=document.head)!==null&&n!==void 0?n:document.body}}function X3e(t,n){return pA.apply(this,arguments)}function pA(){return pA=N2(Hf.mark(function t(n,e){var o,f,r,a,u,c,i,s,l,d,h,m,g,p,v,y,x,w,k,b,T,_,M,A,S,E,D,O,R,z,L,P,N,B,G,W,K,te,Y,Z,re,U,q,$,ne,H,Q,ee,ie,ae,ue,le=arguments;return Hf.wrap(function(fe){for(;;)switch(fe.prev=fe.next){case 0:if(ue=function(){te&&document.removeEventListener("click",te),P.finalize()},s=le.length>2&&le[2]!==void 0?le[2]:{},l=le.length>3?le[3]:void 0,d=s.theme?Vm(xwe[s.theme],(o=s.config)!==null&&o!==void 0?o:{}):s.config,h=fp(s.actions)?s.actions:GH({},N3e,(f=s.actions)!==null&&f!==void 0?f:{}),m=Gd(Gd({},B3e),s.i18n),g=(r=s.renderer)!==null&&r!==void 0?r:"canvas",p=(a=s.logLevel)!==null&&a!==void 0?a:Gc.Warn,v=(u=s.downloadFileName)!==null&&u!==void 0?u:"visualization",y=typeof n=="string"?document.querySelector(n):n,y){fe.next=12;break}throw new Error("".concat(n," does not exist"));case 12:if(s.defaultStyle!==!1&&(x="vega-embed-style",w=Y3e(y),k=w.root,b=w.rootContainer,k.getElementById(x)||(T=document.createElement("style"),T.id=x,T.innerHTML=s.defaultStyle===void 0||s.defaultStyle===!0?I3e.toString():s.defaultStyle,b.appendChild(T))),_=H3e(e,s.mode),M=j3e[_](e,d),_==="vega-lite"&&M.$schema&&(A=PH(M.$schema),$H(U2.vega,"^".concat(A.version.slice(1)))||console.warn("The compiled spec uses Vega ".concat(A.version,", but current version is v").concat(U2.vega,"."))),y.classList.add("vega-embed"),h&&y.classList.add("has-actions"),y.innerHTML="",S=y,h&&(E=document.createElement("div"),E.classList.add(V3e),y.appendChild(E),S=E),D=s.patch,D&&(M=D instanceof Function?D(M):Y2(M,D,!0,!1).newDocument),s.formatLocale&&Gc.formatLocale(s.formatLocale),s.timeFormatLocale&&Gc.timeFormatLocale(s.timeFormatLocale),s.expressionFunctions)for(O in s.expressionFunctions)R=s.expressionFunctions[O],"fn"in R?Gc.expressionFunction(O,R.fn,R.visitor):R instanceof Function&&Gc.expressionFunction(O,R);return z=s.ast,L=Gc.parse(M,_==="vega-lite"?{}:d,{ast:z}),P=new(s.viewClass||Gc.View)(L,Gd({loader:l,logLevel:p,renderer:g},z?{expr:(c=(i=Gc.expressionInterpreter)!==null&&i!==void 0?i:s.expr)!==null&&c!==void 0?c:h0e}:{})),P.addSignalListener("autosize",(me,_e)=>{var we=_e.type;we=="fit-x"?(S.classList.add("fit-x"),S.classList.remove("fit-y")):we=="fit-y"?(S.classList.remove("fit-x"),S.classList.add("fit-y")):we=="fit"?S.classList.add("fit-x","fit-y"):S.classList.remove("fit-x","fit-y")}),s.tooltip!==!1&&(N=q3e(s.tooltip)?s.tooltip:new Ewe(s.tooltip===!0?{}:s.tooltip).call,P.tooltip(N)),B=s.hover,B===void 0&&(B=_==="vega"),B&&(G=typeof B=="boolean"?{}:B,W=G.hoverSet,K=G.updateSet,P.hover(W,K)),s&&(s.width!=null&&P.width(s.width),s.height!=null&&P.height(s.height),s.padding!=null&&P.padding(s.padding)),fe.next=37,P.initialize(S,s.bind).runAsync();case 37:if(h!==!1){if(Y=y,s.defaultStyle!==!1&&(Z=document.createElement("details"),Z.title=m.CLICK_TO_VIEW_ACTIONS,y.append(Z),Y=Z,re=document.createElement("summary"),re.innerHTML=U3e,Z.append(re),te=me=>{Z.contains(me.target)||Z.removeAttribute("open")},document.addEventListener("click",te)),U=document.createElement("div"),Y.append(U),U.classList.add("vega-actions"),h===!0||h.export!==!1){q=R3e(["svg","png"]);try{for(ne=function(){var _e=$.value;if(h===!0||h.export===!0||h.export[_e]){var we=m["".concat(_e.toUpperCase(),"_ACTION")],Te=document.createElement("a");Te.text=we,Te.href="#",Te.target="_blank",Te.download="".concat(v,".").concat(_e),Te.addEventListener("mousedown",function(){var Oe=N2(Hf.mark(function de(ye){var Me;return Hf.wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return ye.preventDefault(),Ee.next=3,P.toImageURL(_e,s.scaleFactor);case 3:Me=Ee.sent,this.href=Me;case 5:case"end":return Ee.stop()}},de,this)}));return function(de){return Oe.apply(this,arguments)}}()),U.append(Te)}},q.s();!($=q.n()).done;)ne()}catch(me){q.e(me)}finally{q.f()}}(h===!0||h.source!==!1)&&(H=document.createElement("a"),H.text=m.SOURCE_ACTION,H.href="#",H.addEventListener("click",function(me){var _e,we;LD(S5(e),(_e=s.sourceHeader)!==null&&_e!==void 0?_e:"",(we=s.sourceFooter)!==null&&we!==void 0?we:"",_),me.preventDefault()}),U.append(H)),_==="vega-lite"&&(h===!0||h.compiled!==!1)&&(Q=document.createElement("a"),Q.text=m.COMPILED_ACTION,Q.href="#",Q.addEventListener("click",function(me){var _e,we;LD(S5(M),(_e=s.sourceHeader)!==null&&_e!==void 0?_e:"",(we=s.sourceFooter)!==null&&we!==void 0?we:"","vega"),me.preventDefault()}),U.append(Q)),(h===!0||h.editor!==!1)&&(ie=(ee=s.editorUrl)!==null&&ee!==void 0?ee:"https://vega.github.io/editor/",ae=document.createElement("a"),ae.text=m.EDITOR_ACTION,ae.href="#",ae.addEventListener("click",function(me){D3e(window,ie,{config:d,mode:_,renderer:g,spec:S5(e)}),me.preventDefault()}),U.append(ae))}return fe.abrupt("return",{view:P,spec:e,vgSpec:M,finalize:ue,embedOptions:s});case 39:case"end":return fe.stop()}},t)})),pA.apply(this,arguments)}const Z3e=new Set(["width","height"]);function J3e(t,n){for(const[e,o]of Object.entries(n))o&&(!!o&&{}.toString.call(o)==="[object Function]"?o(t.data(e)):t.change(e,Gc.changeset().remove(()=>!0).insert(o)))}function Nb(t={},n={},e=new Set){const o=Object.keys(t),f=Object.keys(n);return t===n||o.length===f.length&&o.filter(r=>!e.has(r)).every(r=>t[r]===n[r])}function ID(t,n){const e=Object.keys(n);for(const o of e)try{t.removeSignalListener(o,n[o])}catch(f){console.warn("Cannot remove invalid signal listener.",f)}return e.length>0}function X4(t,n){const e=Object.keys(n);for(const o of e)try{t.addSignalListener(o,n[o])}catch(f){console.warn("Cannot add invalid signal listener.",f)}return e.length>0}function K3e(t){return new Set(t.flatMap(n=>Object.keys(n)))}function Q3e(t,n){if(t===n)return!1;const e={width:!1,height:!1,isExpensive:!1},o="width"in t||"width"in n,f="height"in t||"height"in n;return o&&(!("width"in t)||!("width"in n)||t.width!==n.width)&&("width"in t&&typeof t.width=="number"?e.width=t.width:e.isExpensive=!0),f&&(!("height"in t)||!("height"in n)||t.height!==n.height)&&("height"in t&&typeof t.height=="number"?e.height=t.height:e.isExpensive=!0),[...K3e([t,n])].filter(a=>a!=="width"&&a!=="height").some(a=>!(a in t)||!(a in n)||!xU(t[a],n[a]))&&(e.isExpensive=!0),e.width!==!1||e.height!==!1||e.isExpensive?e:!1}function zD(t,n){const{width:e,height:o}=n;return typeof e<"u"&&typeof o<"u"?{...t,width:e,height:o}:typeof e<"u"?{...t,width:e}:typeof o<"u"?{...t,height:o}:t}function e5e(t){let n;return{c(){n=Gh("div")},m(e,o){uf(e,n,o),t[11](n)},p:cu,i:cu,o:cu,d(e){e&&cf(n),t[11](null)}}}function t5e(t,n,e){let{options:o}=n,{spec:f}=n,{view:r}=n,{signalListeners:a={}}=n,{data:u={}}=n;const c=TG();let i,s={},l={},d={},h={},m;FD(()=>{p()});async function g(){p();try{e(6,i=await W3e(m,f,o)),e(1,r=i.view),X4(r,a)&&r.runAsync(),y(r)}catch(k){v(k)}}function p(){i&&(i.finalize(),e(6,i=void 0),e(1,r=void 0))}function v(k){c("onError",{error:k}),console.warn(k)}function y(k){x(),c("onNewView",{view:k})}async function x(){u&&Object.keys(u).length>0&&i!==void 0&&(e(1,r=i.view),J3e(r,u),await r.resize().runAsync())}function w(k){gA[k?"unshift":"push"](()=>{m=k,e(0,m)})}return t.$$set=k=>{"options"in k&&e(2,o=k.options),"spec"in k&&e(3,f=k.spec),"view"in k&&e(1,r=k.view),"signalListeners"in k&&e(4,a=k.signalListeners),"data"in k&&e(5,u=k.data)},t.$$.update=()=>{if(t.$$.dirty&1056&&(Nb(u,h)||x(),e(10,h=u)),t.$$.dirty&991&&m!==void 0){if(!Nb(o,s,Z3e))g();else{const k=Q3e(zD(f,o),zD(d,s)),b=a,T=l;if(k){if(k.isExpensive)g();else if(i!==void 0){const _=!Nb(b,T);e(1,r=i.view),k.width!==!1&&r.width(k.width),k.height!==!1&&r.height(k.height),_&&(T&&ID(r,T),b&&X4(r,b)),r.runAsync()}}else!Nb(b,T)&&i!==void 0&&(e(1,r=i.view),T&&ID(r,T),b&&X4(r,b),r.runAsync())}e(7,s=o),e(8,l=a),e(9,d=f)}},[m,r,o,f,a,u,i,s,l,d,h,w]}class n5e extends by{constructor(n){super(),_y(this,n,t5e,e5e,wy,{options:2,spec:3,view:1,signalListeners:4,data:5})}}function r5e(t){let n,e,o;function f(a){t[6](a)}let r={spec:t[1],data:t[2],signalListeners:t[3],options:t[4]};return t[0]!==void 0&&(r.view=t[0]),n=new n5e({props:r}),gA.push(()=>AG(n,"view",f)),n.$on("onNewView",t[7]),n.$on("onError",t[8]),{c(){u0(n.$$.fragment)},m(a,u){c0(n,a,u),o=!0},p(a,[u]){const c={};u&2&&(c.spec=a[1]),u&4&&(c.data=a[2]),u&8&&(c.signalListeners=a[3]),u&16&&(c.options=a[4]),!e&&u&1&&(e=!0,c.view=a[0],MG(()=>e=!1)),n.$set(c)},i(a){o||(Bh(n.$$.fragment,a),o=!0)},o(a){jh(n.$$.fragment,a),o=!1},d(a){f0(n,a)}}}const i5e="vega";function a5e(t,n,e){let o,{spec:f}=n,{options:r={}}=n,{data:a={}}=n,{signalListeners:u={}}=n,{view:c=void 0}=n;function i(d){c=d,e(0,c)}function s(d){Z4.call(this,t,d)}function l(d){Z4.call(this,t,d)}return t.$$set=d=>{"spec"in d&&e(1,f=d.spec),"options"in d&&e(5,r=d.options),"data"in d&&e(2,a=d.data),"signalListeners"in d&&e(3,u=d.signalListeners),"view"in d&&e(0,c=d.view)},t.$$.update=()=>{t.$$.dirty&32&&e(4,o={...r,mode:i5e})},[c,f,a,u,o,r,i,s,l]}class o5e extends by{constructor(n){super(),_y(this,n,a5e,r5e,wy,{spec:1,options:5,data:2,signalListeners:3,view:0})}}function s5e(t){return{axis:{labelFont:"sans-serif",labelColor:t?Cf.slate["200"]:Cf.gray[900],titleFont:"sans-serif",titleColor:t?Cf.slate["200"]:Cf.gray[900],tickColor:"#aaa",gridColor:"#aaa",titleFontWeight:"normal",labelFontWeight:"normal"},legend:{labelColor:t?Cf.slate["200"]:Cf.gray[900],labelFont:"sans-serif",titleColor:t?Cf.slate["200"]:Cf.gray[900],titleFont:"sans-serif",titleFontWeight:"normal",labelFontWeight:"normal"},title:{color:t?Cf.slate["200"]:Cf.gray[900],font:"sans-serif",fontWeight:"normal"}}}function l5e(t){let n,e,o,f;return o=new VD({}),{c(){n=Gh("div"),e=Gh("div"),u0(o.$$.fragment),Aa(e,"class","h-5 dark:text-white opacity-50"),Aa(n,"class","h-full min-h-[15rem] flex justify-center items-center")},m(r,a){uf(r,n,a),zf(n,e),c0(o,e,null),f=!0},p:cu,i(r){f||(Bh(o.$$.fragment,r),f=!0)},o(r){jh(o.$$.fragment,r),f=!1},d(r){r&&cf(n),f0(o)}}}function u5e(t){let n,e,o;return{c(){n=Gh("div"),e=Gh("img"),Aa(e,"class","w-full max-h-[30rem] object-contain"),bC(e.src,o=t[0].plot)||Aa(e,"src",o),Aa(n,"class","output-image w-full flex justify-center items-center relative")},m(f,r){uf(f,n,r),zf(n,e)},p(f,r){r&1&&!bC(e.src,o=f[0].plot)&&Aa(e,"src",o)},i:cu,o:cu,d(f){f&&cf(n)}}}function c5e(t){let n,e,o,f;e=new o5e({props:{spec:t[2]}});let r=t[1]&&RD(t);return{c(){n=Gh("div"),u0(e.$$.fragment),o=J4(),r&&r.c(),Aa(n,"class","flex flex-col justify-center items-center w-full h-full")},m(a,u){uf(a,n,u),c0(e,n,null),zf(n,o),r&&r.m(n,null),f=!0},p(a,u){const c={};u&4&&(c.spec=a[2]),e.$set(c),a[1]?r?r.p(a,u):(r=RD(a),r.c(),r.m(n,null)):r&&(r.d(1),r=null)},i(a){f||(Bh(e.$$.fragment,a),f=!0)},o(a){jh(e.$$.fragment,a),f=!1},d(a){a&&cf(n),f0(e),r&&r.d()}}}function f5e(t){let n;return{c(){n=Gh("div"),Aa(n,"id","bokehDiv")},m(e,o){uf(e,n,o)},p:cu,i:cu,o:cu,d(e){e&&cf(n)}}}function h5e(t){let n;return{c(){n=Gh("div")},m(e,o){uf(e,n,o),t[8](n)},p:cu,i:cu,o:cu,d(e){e&&cf(n),t[8](null)}}}function RD(t){let n,e;return{c(){n=Gh("div"),e=LG(t[1]),Aa(n,"class","flex justify-center text-xs w-full h-full text-black dark:text-slate-200 ")},m(o,f){uf(o,n,f),zf(n,e)},p(o,f){f&2&&PG(e,o[1])},d(o){o&&cf(n)}}}function d5e(t){let n,e,o,f;const r=[h5e,f5e,c5e,u5e,l5e],a=[];function u(c,i){return c[0]&&c[0].type=="plotly"?0:c[0]&&c[0].type=="bokeh"?1:c[0]&&c[0].type=="altair"?2:c[0]&&c[0].type=="matplotlib"?3:4}return n=u(t),e=a[n]=r[n](t),{c(){e.c(),o=SG()},m(c,i){a[n].m(c,i),uf(c,o,i),f=!0},p(c,[i]){let s=n;n=u(c),n===s?a[n].p(c,i):(EG(),jh(a[s],1,1,()=>{a[s]=null}),CG(),e=a[n],e?e.p(c,i):(e=a[n]=r[n](c),e.c()),Bh(e,1),e.m(o.parentNode,o))},i(c){f||(Bh(e),f=!0)},o(c){jh(e),f=!1},d(c){a[n].d(c),c&&cf(o)}}}const p5e="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.2.min.js";function g5e(t,n,e){let o,{value:f}=n,{target:r}=n,a=null,{colors:u=[]}=n,{theme:c}=n,{caption:i}=n;function s(M){let A=u[M%u.length];return A&&A in M5?M5[A]?.primary:A||M5[BG(M)].primary}let l,d;const h=["https://cdn.pydata.org/bokeh/release/bokeh-widgets-2.4.2.min.js","https://cdn.pydata.org/bokeh/release/bokeh-tables-2.4.2.min.js","https://cdn.pydata.org/bokeh/release/bokeh-gl-2.4.2.min.js","https://cdn.pydata.org/bokeh/release/bokeh-api-2.4.2.min.js"];function m(){return h.map((M,A)=>{const S=document.createElement("script");return S.onload=()=>k(A+1),S.src=M,document.head.appendChild(S),S})}function g(){const M=document.createElement("script");return M.onload=T,M.src=p5e,document.head.appendChild(M),M}function p(){if(!d){d=document.getElementById("plotly.js-style-global");const M=d.cloneNode();r.appendChild(M);for(const A of d.sheet.cssRules)M.sheet.insertRule(A.cssText)}}const v=g();let y=[];const x=[],w=Array(5).fill(0).map((M,A)=>b(A)),k=M=>{f&&f.type=="bokeh"&&x[M]()};function b(M){return new Promise((A,S)=>{x[M]=A})}function T(){k(0),y=m()}Promise.all(w).then(()=>{let M=JSON.parse(f.plot);window.Bokeh.embed.embed_item(M,"bokehDiv")}),OG(()=>{if(f&&f.type=="plotly"){p();let M=JSON.parse(f.plot);M.layout.title?M.layout.margin={autoexpand:!0}:M.layout.margin={l:0,r:0,b:0,t:0},dW.react(l,M)}else if(f&&f.type=="bokeh"){document.getElementById("bokehDiv").innerHTML="";let M=JSON.parse(f.plot);window.Bokeh.embed.embed_item(M,"bokehDiv")}}),FD(()=>{v in document.children&&(document.removeChild(v),y.forEach(M=>document.removeChild(M)))});function _(M){gA[M?"unshift":"push"](()=>{l=M,e(3,l)})}return t.$$set=M=>{"value"in M&&e(0,f=M.value),"target"in M&&e(4,r=M.target),"colors"in M&&e(5,u=M.colors),"theme"in M&&e(6,c=M.theme),"caption"in M&&e(1,i=M.caption)},t.$$.update=()=>{if(t.$$.dirty&64&&e(7,o=c=="dark"),t.$$.dirty&133&&f&&f.type=="altair"){e(2,a=JSON.parse(f.plot));const M=s5e(o);switch(e(2,a.config=M,a),f.chart||""){case"scatter":a.encoding.color&&a.encoding.color.type=="nominal"?e(2,a.encoding.color.scale.range=a.encoding.color.scale.range.map((A,S)=>s(S)),a):a.encoding.color&&a.encoding.color.type=="quantitative"&&(e(2,a.encoding.color.scale.range=["#eff6ff","#1e3a8a"],a),e(2,a.encoding.color.scale.range.interpolate="hsl",a));break;case"line":a.layer.forEach(A=>{A.encoding.color&&(A.encoding.color.scale.range=A.encoding.color.scale.range.map((S,E)=>s(E)))}),console.log(a)}}},[f,i,a,l,r,u,c,o,_]}class m5e extends by{constructor(n){super(),_y(this,n,g5e,d5e,wy,{value:0,target:4,colors:5,theme:6,caption:1})}}function v5e(t){let n,e,o,f,r,a;n=new fW({props:{show_label:t[5],label:t[4]||"Plot",Icon:VD}});const u=[t[3]];let c={};for(let i=0;i{"value"in m&&e(0,o=m.value),"elem_id"in m&&e(1,f=m.elem_id),"visible"in m&&e(2,r=m.visible),"loading_status"in m&&e(3,a=m.loading_status),"label"in m&&e(4,u=m.label),"show_label"in m&&e(5,c=m.show_label),"target"in m&&e(6,i=m.target),"style"in m&&e(7,s=m.style),"theme"in m&&e(8,l=m.theme),"caption"in m&&e(9,d=m.caption)},[o,f,r,a,u,c,i,s,l,d,h]}class b5e extends by{constructor(n){super(),_y(this,n,x5e,y5e,wy,{value:0,elem_id:1,visible:2,loading_status:3,label:4,show_label:5,target:6,style:7,theme:8,caption:9})}}var S5e=b5e;const E5e=["static"];export{S5e as Component,E5e as modes}; +//# sourceMappingURL=index.03f37f65.js.map